wlmaker
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
desktop.h File Reference
#include <libbase/libbase.h>
#include <stdbool.h>
#include <wayland-server-core.h>
#include "element.h"
#include "menu.h"
#include "surface.h"
#include "window.h"
#include "workspace.h"
Include dependency graph for desktop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wlmtk_desktop_events_t
 

Typedefs

typedef struct _wlmtk_desktop_t wlmtk_desktop_t
 

Functions

wlmtk_desktop_twlmtk_desktop_create (struct wlr_scene *wlr_scene_ptr, struct wlr_output_layout *wlr_output_layout_ptr)
 
void wlmtk_desktop_destroy (wlmtk_desktop_t *desktop_ptr)
 
wlmtk_desktop_events_twlmtk_desktop_events (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_add_workspace (wlmtk_desktop_t *desktop_ptr, wlmtk_workspace_t *workspace_ptr)
 
void wlmtk_desktop_remove_workspace (wlmtk_desktop_t *desktop_ptr, wlmtk_workspace_t *workspace_ptr)
 
wlmtk_workspace_twlmtk_desktop_get_current_workspace (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_destroy_last_workspace (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_switch_to_next_workspace (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_switch_to_previous_workspace (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_for_each_workspace (wlmtk_desktop_t *desktop_ptr, void(*func)(bs_dllist_node_t *dlnode_ptr, void *ud_ptr), void *ud_ptr)
 
bool wlmtk_desktop_lock (wlmtk_desktop_t *desktop_ptr, wlmtk_element_t *element_ptr)
 
bool wlmtk_desktop_unlock (wlmtk_desktop_t *desktop_ptr, wlmtk_element_t *element_ptr)
 
bool wlmtk_desktop_locked (wlmtk_desktop_t *desktop_ptr)
 
void wlmtk_desktop_lock_unreference (wlmtk_desktop_t *desktop_ptr, wlmtk_element_t *element_ptr)
 
wlmtk_element_twlmtk_desktop_element (wlmtk_desktop_t *desktop_ptr)
 
bool wlmtk_desktop_set_style (wlmtk_desktop_t *desktop_ptr, wlmtk_window_style_ref_t *window_style_ref_ptr, wlmtk_menu_style_ref_t *menu_style_ref_ptr)
 

Variables

const bs_test_set_t wlmtk_desktop_test_set
 

Detailed Description

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ wlmtk_desktop_t

Forward declaration: Desktop element (technically: container).

Function Documentation

◆ wlmtk_desktop_add_workspace()

void wlmtk_desktop_add_workspace ( wlmtk_desktop_t desktop_ptr,
wlmtk_workspace_t workspace_ptr 
)

Adds a workspace.

Parameters
desktop_ptr
workspace_ptr

◆ wlmtk_desktop_create()

wlmtk_desktop_t * wlmtk_desktop_create ( struct wlr_scene *  wlr_scene_ptr,
struct wlr_output_layout *  wlr_output_layout_ptr 
)

Creates the desktop element.

Parameters
wlr_scene_ptr
wlr_output_layout_ptr
Returns
Handle of the desktop element or NULL on error.

◆ wlmtk_desktop_destroy()

void wlmtk_desktop_destroy ( wlmtk_desktop_t desktop_ptr)

Destroys the desktop element.

Parameters
desktop_ptr

◆ wlmtk_desktop_destroy_last_workspace()

void wlmtk_desktop_destroy_last_workspace ( wlmtk_desktop_t desktop_ptr)

Destroys the last workspace – if it's not the only remaining workspace, not the current workspace, and if there's no windows contained in it.

Parameters
desktop_ptr

◆ wlmtk_desktop_element()

wlmtk_element_t * wlmtk_desktop_element ( wlmtk_desktop_t desktop_ptr)
Returns
pointer to the desktop's wlmtk_element_t. (Temporary)

◆ wlmtk_desktop_events()

wlmtk_desktop_events_t * wlmtk_desktop_events ( wlmtk_desktop_t desktop_ptr)

Gets the set of events available in desktop. To bind listeners to.

Parameters
desktop_ptr
Returns
Pointer to wlmtk_desktop_t::events.

◆ wlmtk_desktop_for_each_workspace()

void wlmtk_desktop_for_each_workspace ( wlmtk_desktop_t desktop_ptr,
void(*)(bs_dllist_node_t *dlnode_ptr, void *ud_ptr)  func,
void *  ud_ptr 
)

Runs |func()| for each workspace.

Parameters
desktop_ptr
func
ud_ptr

◆ wlmtk_desktop_get_current_workspace()

wlmtk_workspace_t * wlmtk_desktop_get_current_workspace ( wlmtk_desktop_t desktop_ptr)

Returns a pointer to the currently-active workspace.

Parameters
desktop_ptr

◆ wlmtk_desktop_lock()

bool wlmtk_desktop_lock ( wlmtk_desktop_t desktop_ptr,
wlmtk_element_t element_ptr 
)

Locks the desktop, using the provided element.

The desktop must not be locked already. If locked successfully, the desktop will keep a reference to element_ptr. The lock must call wlmtk_desktop_unlock to unlock desktop, and for releasing the reference.

Parameters
desktop_ptr
element_ptr
Returns
Whether the lock was established.

◆ wlmtk_desktop_lock_unreference()

void wlmtk_desktop_lock_unreference ( wlmtk_desktop_t desktop_ptr,
wlmtk_element_t element_ptr 
)

Releases the lock reference, but keeps the desktop locked.

This is in accordance with the session lock protocol specification [1], stating the session should remain locked if the client dies. This call is a no-op if element_ptr is not currently the lock of desktop_ptr.

[1] https://wayland.app/protocols/ext-session-lock-v1

Parameters
desktop_ptr
element_ptr

◆ wlmtk_desktop_locked()

bool wlmtk_desktop_locked ( wlmtk_desktop_t desktop_ptr)
Returns
Whether desktop is locked.

◆ wlmtk_desktop_remove_workspace()

void wlmtk_desktop_remove_workspace ( wlmtk_desktop_t desktop_ptr,
wlmtk_workspace_t workspace_ptr 
)

Removes the workspace.

Parameters
desktop_ptr
workspace_ptr

◆ wlmtk_desktop_set_style()

bool wlmtk_desktop_set_style ( wlmtk_desktop_t desktop_ptr,
wlmtk_window_style_ref_t window_style_ref_ptr,
wlmtk_menu_style_ref_t menu_style_ref_ptr 
)

Updates the style for all windows contained in desktop.

◆ wlmtk_desktop_switch_to_next_workspace()

void wlmtk_desktop_switch_to_next_workspace ( wlmtk_desktop_t desktop_ptr)

Switches to the next workspace.

Parameters
desktop_ptr

◆ wlmtk_desktop_switch_to_previous_workspace()

void wlmtk_desktop_switch_to_previous_workspace ( wlmtk_desktop_t desktop_ptr)

Switches to the previous workspace.

Parameters
desktop_ptr

◆ wlmtk_desktop_unlock()

bool wlmtk_desktop_unlock ( wlmtk_desktop_t desktop_ptr,
wlmtk_element_t element_ptr 
)

Unlocks the desktop, and releases the reference from wlmtk_desktop_lock.

Unlocking can only be done with element_ptr matching the element_ptr argument from wlmtk_desktop_lock.

Parameters
desktop_ptr
element_ptr
Returns
Whether the lock was lifted.

Variable Documentation

◆ wlmtk_desktop_test_set

const bs_test_set_t wlmtk_desktop_test_set
extern

Unit test cases.