![]() |
DeskUp 0.3
|
Describes a single window instance in the DeskUp system. More...
#include <window_desc.h>
Public Member Functions | |
| windowDesc () | |
| Constructs a window descriptor with default parameters (integers to 0 and strings empty). | |
| 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. | |
| int | saveTo (fs::path path) |
| Saves the current window description to a file. | |
| bool | operator! () const |
| Returns whether the window description is invalid or empty. | |
Public Attributes | |
| std::string | name |
| Constructs a window descriptor with explicit name, geometry, and executable path. | |
| int | x |
| The X coordinate (top-left corner) of the window. | |
| int | y |
| The Y coordinate (top-left corner) of the window. | |
| int | w |
| The window width in pixels. | |
| int | h |
| The window height in pixels. | |
| fs::path | pathToExec |
| The absolute path to the executable that owns this window. | |
Describes a single window instance in the DeskUp system.
This structure holds all relevant information needed to represent a window in the abstract DeskUp format. It allows storing the executable path, name, and geometry (x, y, width, height).
Instances of this struct are typically generated by backend functions such as WIN_getAllOpenWindows(), and can later be serialized using saveTo().
|
inline |
Constructs a window descriptor with explicit name, geometry, and executable path.
| n | window name. |
| x | X coordinate (top-left) in pixels. |
| y | Y coordinate (top-left) in pixels. |
| w | Width in pixels. |
| h | Height in pixels. |
| p | Absolute path to the owning executable. |
|
inline |
Returns whether the window description is invalid or empty.
This operator checks if all window geometry attributes (x, y, w, h) are zero, which indicates an uninitialized or invalid state.
true if all coordinates and dimensions are zero, false otherwise. | int windowDesc::saveTo | ( | fs::path | path | ) |
Saves the current window description to a file.
Writes the window’s executable path and geometry (x, y, width, height) to the specified file, each on a new line.
This function returns a SaveErrorCode value to indicate whether the operation succeeded or failed, allowing fine-grained error handling. Positive values indicate success; negative values specify different failure modes.
Format written to file (one value per line):
| path | Absolute or relative path to the file where data will be stored. |
| std::string windowDesc::name |
Constructs a window descriptor with explicit name, geometry, and executable path.
| n | window name. |
| x | X coordinate (top-left) in pixels. |
| y | Y coordinate (top-left) in pixels. |
| w | Width in pixels. |
| h | Height in pixels. |
| p | Absolute path to the owning executable. |
The window name.
Usually derived from the executable name or window title.