DeskUp 0.3
Loading...
Searching...
No Matches
DeskUpWindowDevice Struct Reference

This abstract struct represents all the common calls that any backend must have. More...

#include <desk_up_window_device.h>

Public Attributes

DeskUp::Result< unsigned int >(* getWindowHeight )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get the height of a window.
DeskUp::Result< unsigned int >(* getWindowWidth )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get the width of a window.
DeskUp::Result< int >(* getWindowXPos )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get the X position of a the top left corner of a window.
DeskUp::Result< int >(* getWindowYPos )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get the Y position of a the top left corner of a window.
DeskUp::Result< fs::path >(* getPathFromWindow )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get the path to the executable that created the window.
DeskUp::Result< std::string >(* getDeskUpPath )(void)
 A pointer to function that is used to get the generic DeskUp workspaces path.
DeskUp::Result< std::vector< windowDesc > >(* getAllOpenWindows )(DeskUpWindowDevice *_this)
 A pointer to function that is used to get a list of abstract windows.
DeskUp::Status(* loadWindowFromPath )(DeskUpWindowDevice *_this, const fs::path &path)
 A pointer to function that is used to open a window from a given path.
DeskUp::Result< windowDesc >(* recoverSavedWindow )(DeskUpWindowDevice *_this, const fs::path &filePath)
 A pointer to function that is used to recover a window from a deskUp file, which shall be located inside appData\DeskUp.
DeskUp::Status(* resizeWindow )(DeskUpWindowDevice *_this, const windowDesc window)
 A pointer to function that is used to resize a given window.
DeskUp::Result< unsigned int >(* closeProcessFromPath )(DeskUpWindowDevice *_this, const fs::path &path, bool allowForce)
 A pointer to function that is used to close all the windows associated with a given path.
void * internalData
 A pointer that points to the specific information needed by each backend.
void(* DestroyDevice )(DeskUpWindowDevice *_this)
 A pointer to function that is used to delete the device.

Detailed Description

This abstract struct represents all the common calls that any backend must have.

There are multiple pointers to functions inside this struct. Each one of them gets connected to a backend function whenever the backend gets created. When invoking the pointer, it implicitly calls the correct backend function, thus giving the expected result for that specific backend. This struct also carries specific backend information needed to get information from a backend successfully.

See also
windowData
Author
Nicolas Serrano Garcia serra.nosp@m.noga.nosp@m.rcian.nosp@m.icol.nosp@m.as@gm.nosp@m.ail..nosp@m.com
Version
0.1.0
Date
2025

Member Data Documentation

◆ closeProcessFromPath

DeskUp::Result< unsigned int >(* DeskUpWindowDevice::closeProcessFromPath) (DeskUpWindowDevice *_this, const fs::path &path, bool allowForce)

A pointer to function that is used to close all the windows associated with a given path.

Parameters
_thisThe very same instance
patha std::string instance that represents the path
allowForceWhether if the call should force the program to close
Returns
The number of closed windows from a specific app
Version
0.2.0
Date
2025

◆ DestroyDevice

void(* DeskUpWindowDevice::DestroyDevice) (DeskUpWindowDevice *_this)

A pointer to function that is used to delete the device.

Each device defines it's own deleter, which then gets called in the wrapper DU_destroy inside window_core.cc

Parameters
_thisThe very same instance
Version
0.3.2
Date
2025

◆ getAllOpenWindows

DeskUp::Result< std::vector< windowDesc > >(* DeskUpWindowDevice::getAllOpenWindows) (DeskUpWindowDevice *_this)

A pointer to function that is used to get a list of abstract windows.

For any backend to return the same thing, an abstract struct representing a windows is created. Regardless of the implementation, every device returns a vector of this type.

Parameters
_thisThe very same instance
Returns
An std::vector representing all the visible and non-minimized windows currently open
Version
0.1.0
Date
2025

◆ getDeskUpPath

DeskUp::Result< std::string >(* DeskUpWindowDevice::getDeskUpPath) (void)

A pointer to function that is used to get the generic DeskUp workspaces path.

The return path is the path to the top-level folder where all the user workspaces are saved. A workspace whose name is "foo" will have it's information saved in getDeskUpPath() + "/foo"

Returns
An std::string representing the path to the top-level Desk Up workspaces folder
Version
0.1.0
Date
2025

◆ getPathFromWindow

DeskUp::Result< fs::path >(* DeskUpWindowDevice::getPathFromWindow) (DeskUpWindowDevice *_this)

A pointer to function that is used to get the path to the executable that created the window.

Parameters
_thisThe very same instance
Returns
An filesystem::path representing the path of the window
Version
0.1.0
Date
2025

◆ getWindowHeight

DeskUp::Result< unsigned int >(* DeskUpWindowDevice::getWindowHeight) (DeskUpWindowDevice *_this)

A pointer to function that is used to get the height of a window.

Parameters
_thisThe very same instance
Returns
An unsigned int representing the height of the window
Version
0.1.0
Date
2025

◆ getWindowWidth

DeskUp::Result< unsigned int >(* DeskUpWindowDevice::getWindowWidth) (DeskUpWindowDevice *_this)

A pointer to function that is used to get the width of a window.

Parameters
_thisThe very same instance
Returns
An unsigned int representing the width of the window
Version
0.1.0
Date
2025

◆ getWindowXPos

DeskUp::Result< int >(* DeskUpWindowDevice::getWindowXPos) (DeskUpWindowDevice *_this)

A pointer to function that is used to get the X position of a the top left corner of a window.

Parameters
_thisThe very same instance
Returns
An int representing the X position of the top left corner of a window
Version
0.1.0
Date
2025

◆ getWindowYPos

DeskUp::Result< int >(* DeskUpWindowDevice::getWindowYPos) (DeskUpWindowDevice *_this)

A pointer to function that is used to get the Y position of a the top left corner of a window.

Parameters
_thisThe very same instance
Returns
An int representing the Y position of the top left corner of a window
Version
0.1.0
Date
2025

◆ internalData

void* DeskUpWindowDevice::internalData

A pointer that points to the specific information needed by each backend.

each backend defines WindowData, which is the template to seek the values of this pointer. Whenever a device call wants to access backend-specific info, this pointer gets casted to windowData* by std::reinterpret_cast. Then the backend accesses whatever information it needs. Finally, the same call casts back this pointer to void* , leaving everything as it was. One can interpret this pointer as a "black box", or a "pouch", where the info gets thrown inside, and then reinterpreted back whenever it is needed

Version
0.1.0
Date
2025

◆ loadWindowFromPath

DeskUp::Status(* DeskUpWindowDevice::loadWindowFromPath) (DeskUpWindowDevice *_this, const fs::path &path)

A pointer to function that is used to open a window from a given path.

If the path is empty,

Parameters
_thisThe very same instance
patha const char* to the executable
Returns
void
Version
0.2.0
Date
2025

◆ recoverSavedWindow

DeskUp::Result< windowDesc >(* DeskUpWindowDevice::recoverSavedWindow) (DeskUpWindowDevice *_this, const fs::path &filePath)

A pointer to function that is used to recover a window from a deskUp file, which shall be located inside appData\DeskUp.

Parameters
_thisThe very same instance
patha const char* to the executable
Returns
A windowDesc representing the recovered window. If any of the recovery processes fails, the associated field will be set to the default value for it's type (int 0 and string "")
Version
0.2.0
Date
2025

◆ resizeWindow

DeskUp::Status(* DeskUpWindowDevice::resizeWindow) (DeskUpWindowDevice *_this, const windowDesc window)

A pointer to function that is used to resize a given window.

Information about the window whose geometry is intended to modify must be specified inside the _this->internalData parameter

Parameters
_thisThe very same instance
patha windowDesc instance whose geometry wants to be used for the resizing
Returns
A void
Version
0.2.0
Date
2025

The documentation for this struct was generated from the following file: