💾 Archived View for lofi.haiku-os.org › docs › develop › servers › app_server › Desktop.gmi captured on 2024-08-25 at 00:21:37. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-09-28)
-=-=-=-=-=-=-
There are no globally accessible objects in this section of code, but many function definitions to work with workspaces, screen attributes, and other such things. These functions work with the private desktop classes Screen and Workspace.
Sets up all the stuff necessary for the system’s desktop.
1. Create a graphics module list by looping through allocation and initialization of display modules until failure is returned. If app_server exists, just create a ViewDriver module
2. Create and populate Screen list, pointing each Screen instance to its Driver instance
3. Create layer and workspace locks
4. Set screen 0 to active
5. Create the desktop_private::draglock semaphore
Undoes everything done in InitDesktop().
1. Delete all locks
2. Delete all screens in the list
3. Delete the desktop_private::draglock semaphore
4. If desktop_private::dragmessage is non-NULL, delete it.
Each of these calls the appropriate method in the Screen class. Add and Delete workspace functions operate on all screens.
Each of these calls operate on the objects in the Screen list, calling methods as appropriate.
These operate on the layer structure in the active Screen object, calling methods as appropriate.
This assigns a BMessage in its flattened state to the internal storage. Only one message can be stored at a time. Once an assignment is made, another cannot be made until the current one is emptied. If additional calls are made while there is a drag message assigned, the new assignment will not be made. Note that this merely passes a pointer around. No copies are made and the caller is responsible for freeing any allocated objects from the heap.
1. Acquire the draglock
2. release the lock and return if winborder_private::dragmessage is non-NULL
3. Assign parameters to the private variables
4. Release the draglock
Retrieve the current drag message in use. This function will fail if a NULL pointer is passed to it. Note that this does not free the current drag message from use. The size of the flattened message is stored in the size parameter. Note that if there is no message in use, it will return NULL and set size to 0.
1. return NULL if size pointer is NULL
2. acquire the draglock
3. set value of size parameter to winborder_private::dragmessagesize
4. assign a temporary pointer the value of desktop_private::dragmessage
5. release the draglock
6. return the temporary pointer
This empties the current drag message from use and allows for other messages to be assigned.
1. acquire draglock
2. assign 0 to desktop_private::dragmessagesize and set desktop_private::dragmessage to NULL
3. release draglock