43namespace fs = std::filesystem;
76 windowDesc(std::string n,
int xPos,
int yPos,
int width,
int height, std::string p) :
name(n),
x(xPos),
y(yPos),
w(width),
h(height),
pathToExec(fs::path(p)) {}
157 int saveTo(fs::path path);
169 return !
x && !
y && !
w && !
h;
windowDesc(std::string n, int xPos, int yPos, int width, int height, std::string p)
Constructs a window descriptor with explicit name, geometry, and executable path.
Definition window_desc.h:76
int h
The window height in pixels.
Definition window_desc.h:113
bool operator!() const
Returns whether the window description is invalid or empty.
Definition window_desc.h:168
std::string name
Constructs a window descriptor with explicit name, geometry, and executable path.
Definition window_desc.h:93
windowDesc()
Constructs a window descriptor with default parameters (integers to 0 and strings empty).
Definition window_desc.cc:12
int x
The X coordinate (top-left corner) of the window.
Definition window_desc.h:98
int saveTo(fs::path path)
Saves the current window description to a file.
Definition window_desc.cc:21
fs::path pathToExec
The absolute path to the executable that owns this window.
Definition window_desc.h:118
int y
The Y coordinate (top-left corner) of the window.
Definition window_desc.h:103
int w
The window width in pixels.
Definition window_desc.h:108
SaveErrorCode
Enumerates possible results and error codes for windowDesc::saveTo().
Definition window_desc.h:191
@ ERR_FILE_NOT_FOUND
File not found or directory path invalid.
Definition window_desc.h:220
@ ERR_UNKNOWN
Unknown or unexpected error during save.
Definition window_desc.h:232
@ ERR_NO_PERMISSION
Insufficient permissions to write the file.
Definition window_desc.h:214
@ ERR_FILE_NOT_OPEN
The target file could not be opened.
Definition window_desc.h:208
@ SAVE_SUCCESS
File successfully written.
Definition window_desc.h:196
@ ERR_DISK_FULL
Disk or storage device is full.
Definition window_desc.h:226
@ ERR_EMPTY_PATH
The provided file path is empty.
Definition window_desc.h:202