DeskUp 0.3
Loading...
Searching...
No Matches
window_core.h File Reference

Declares basic code to interact with Desk Up. More...

Include dependency graph for window_core.h:

Go to the source code of this file.

Functions

int DU_Init ()
 Initializes the DeskUp backend system.
void DU_Destroy ()
 Destroys and cleans up the DeskUp backend resources.

Variables

std::string DESKUPDIR
 
std::unique_ptr< DeskUpWindowDevicecurrent_window_backend
 

Detailed Description

Declares basic code to interact with Desk Up.

This file is part of DeskUp

Author
Nicolas Serrano Garcia serra.nosp@m.noga.nosp@m.rcian.nosp@m.icol.nosp@m.as@gm.nosp@m.ail..nosp@m.com
Date
2025

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Function Documentation

◆ DU_Destroy()

void DU_Destroy ( )

Destroys and cleans up the DeskUp backend resources.

Releases the backend device and clears global state. Should be called when DeskUp is no longer needed to free resources. After calling this function, DU_Init() must be called again before using any DeskUp functionality.

Note
Safe to call even if DU_Init() was not called or failed.
See also
DU_Init()
Version
0.1.1
Date
2025

◆ DU_Init()

int DU_Init ( )

Initializes the DeskUp backend system.

This function must be called once before using any DeskUp backend feature. It iterates through the available backends (currently only the Windows backend) and:

  • Calls the backend bootstrap function isAvailable() to check if it can be used.
  • If available, calls createDevice() to create and configure the backend device.
  • Calls getDeskUpPath() through the device to determine the workspace base directory.

Once initialization completes successfully:

Note
The function currently supports only the Windows backend, which internally maps to:
Returns
1 if initialization succeeds, 0 otherwise.
See also
DeskUpWindowDevice
DeskUpWindowBootStrap
WIN_isAvailable()
WIN_CreateDevice()
WIN_getDeskUpPath()
Version
0.1.1
Date
2025

Variable Documentation

◆ current_window_backend

std::unique_ptr<DeskUpWindowDevice> current_window_backend
extern

A unique pointer to the selected backend device for DeskUp.

This global pointer gets assigned when calling DU_Init(), so using it without initializing DeskUp will cause undefined behaviour. It provides access to backend-specific functions such as window enumeration, size, and position.

See also
DU_Init()
DeskUpWindowBootStrap
Version
0.1.0
Date
2025

◆ DESKUPDIR

std::string DESKUPDIR
extern

The path to the DeskUp saved workspace.

This global variable gets assigned when calling DU_Init(), so using it without initializing DeskUp will cause undefined behaviour. In the process, it calls the device's getDeskUpPath() function, which is resolved to the specific backend implementation (e.g. WIN_getDeskUpPath on Windows).

See also
DU_Init()
DeskUpWindowDevice::getDeskUpPath
Version
0.1.0
Date
2025