wlmaker
Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions | Variables
workspace.h File Reference
#include "iconified.h"
#include "layer_surface.h"
#include "server.h"
#include "tile_container.h"
#include "toolkit/toolkit.h"
Include dependency graph for workspace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WLMAKER_WORKSPACE_LAYER_NUM   (WLMAKER_WORKSPACE_LAYER_OVERLAY + 1)
 

Typedefs

typedef struct _wlmaker_workspace_t wlmaker_workspace_t
 
typedef enum _wlmaker_workspace_layer_t wlmaker_workspace_layer_t
 

Enumerations

enum  _wlmaker_workspace_layer_t {
  WLMAKER_WORKSPACE_LAYER_BACKGROUND = 0 , WLMAKER_WORKSPACE_LAYER_BOTTOM = 1 , WLMAKER_WORKSPACE_LAYER_SHELL = 2 , WLMAKER_WORKSPACE_LAYER_TOP = 3 ,
  WLMAKER_WORKSPACE_LAYER_OVERLAY = 4
}
 

Functions

wlmaker_workspace_twlmaker_workspace_create (wlmaker_server_t *server_ptr, uint32_t color, int index, const char *name_ptr)
 
void wlmaker_workspace_destroy (wlmaker_workspace_t *workspace_ptr)
 
void wlmaker_workspace_set_enabled (wlmaker_workspace_t *workspace_ptr, bool enabled)
 
void wlmaker_workspace_add_view (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr, wlmaker_workspace_layer_t layer)
 
void wlmaker_workspace_remove_view (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_raise_view (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_lower_view (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_activate_view (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
wlmaker_view_twlmaker_workspace_get_activated_view (wlmaker_workspace_t *workspace_ptr)
 
void wlmaker_workspace_activate_next_view (wlmaker_workspace_t *workspace_ptr)
 
void wlmaker_workspace_activate_previous_view (wlmaker_workspace_t *workspace_ptr)
 
const bs_dllist_t * wlmaker_workspace_get_views_dllist (wlmaker_workspace_t *workspace_ptr)
 
void wlmaker_workspace_set_extents (wlmaker_workspace_t *workspace_ptr, const struct wlr_box *extents_ptr)
 
void wlmaker_workspace_arrange_views (wlmaker_workspace_t *workspace_ptr)
 
void wlmaker_workspace_view_set_as_iconified (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_iconified_set_as_view (wlmaker_workspace_t *workspace_ptr, wlmaker_iconified_t *iconified_ptr)
 
void wlmaker_workspace_promote_view_to_fullscreen (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_demote_view_from_fullscreen (wlmaker_workspace_t *workspace_ptr, wlmaker_view_t *view_ptr)
 
void wlmaker_workspace_layer_surface_add (wlmaker_workspace_t *workspace_ptr, wlmaker_workspace_layer_t layer, wlmaker_layer_surface_t *layer_surface_ptr)
 
void wlmaker_workspace_layer_surface_remove (wlmaker_workspace_t *workspace_ptr, wlmaker_workspace_layer_t layer, wlmaker_layer_surface_t *layer_surface_ptr)
 
void wlmaker_workspace_get_details (wlmaker_workspace_t *workspace_ptr, int *index_ptr, const char **name_ptr_ptr)
 
void wlmaker_workspace_get_maximize_area (wlmaker_workspace_t *workspace_ptr, struct wlr_output *wlr_output_ptr, struct wlr_box *maximize_area_ptr)
 
void wlmaker_workspace_get_fullscreen_area (wlmaker_workspace_t *workspace_ptr, struct wlr_output *wlr_output_ptr, struct wlr_box *fullscreen_area_ptr)
 
wlmaker_workspace_twlmaker_workspace_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
bs_dllist_node_t * wlmaker_dlnode_from_workspace (wlmaker_workspace_t *workspace_ptr)
 
wlmaker_tile_container_twlmaker_workspace_get_tile_container (wlmaker_workspace_t *workspace_ptr)
 
wlmtk_workspace_twlmaker_workspace_wlmtk (wlmaker_workspace_t *workspace_ptr)
 

Variables

const bs_test_case_t wlmaker_workspace_test_cases []
 

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.

Interface for a workspace. A server has one or multiple workspaces, and each workspace may hold an arbitrary number of views.

Macro Definition Documentation

◆ WLMAKER_WORKSPACE_LAYER_NUM

#define WLMAKER_WORKSPACE_LAYER_NUM   (WLMAKER_WORKSPACE_LAYER_OVERLAY + 1)

Number of defined layers. Helpful ot iterate over layers 0...NUM.

Typedef Documentation

◆ wlmaker_workspace_layer_t

Forward definition: Workspace layer.

◆ wlmaker_workspace_t

Forward definition: Workspace state.

Enumeration Type Documentation

◆ _wlmaker_workspace_layer_t

Indicates which layer the view shall be rendered in.

This follows "wlr-layer-shell-unstable-v1-protocol.h", but adds an explicit "shell" layer between "bottom" and "top". As specified in the layer protocol, these are ordeder by z depth, bottom-most first. wlroots suggests that "Fullscreen shell surfaces will typically be rendered at the top layer". We'll actually render it in scene node placed just above the top layer – but won't report it as an extra layer.

Function Documentation

◆ wlmaker_dlnode_from_workspace()

bs_dllist_node_t * wlmaker_dlnode_from_workspace ( wlmaker_workspace_t * workspace_ptr)

Cast: Returns a pointer to the dlnode element of workspace_ptr.

Parameters
workspace_ptr
Returns
Pointer to the bs_dllist_node_t dlnode of workspace_ptr.

◆ wlmaker_workspace_activate_next_view()

void wlmaker_workspace_activate_next_view ( wlmaker_workspace_t * workspace_ptr)

Activates the view after the currently activated one.

Intended to permit cycling through tasks. Will activate the view, but not raise it. See wlmaker_workspace_activate_previous_view.

Parameters
workspace_ptr

◆ wlmaker_workspace_activate_previous_view()

void wlmaker_workspace_activate_previous_view ( wlmaker_workspace_t * workspace_ptr)

Activates the view before the currently activated one.

Intended to permit cycling through tasks. Will activate the view, but not raise it. See wlmaker_workspace_activate_next_view.

Parameters
workspace_ptr

◆ wlmaker_workspace_activate_view()

void wlmaker_workspace_activate_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Activates the view.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_add_view()

void wlmaker_workspace_add_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr,
wlmaker_workspace_layer_t layer )

Adds the view to a layer of the workspace.

Parameters
workspace_ptr
view_ptr
layer

◆ wlmaker_workspace_arrange_views()

void wlmaker_workspace_arrange_views ( wlmaker_workspace_t * workspace_ptr)

(Re)arranges the views in the workspace.

This should be called whenever the output layout changes.

Parameters
workspace_ptr

◆ wlmaker_workspace_create()

wlmaker_workspace_t * wlmaker_workspace_create ( wlmaker_server_t * server_ptr,
uint32_t color,
int index,
const char * name_ptr )

Creates a workspace.

Parameters
server_ptr
color
index
name_ptr
Returns
Workspace handle or NULL on error. Must be destroyed with wlmaker_workspace_destroy().

◆ wlmaker_workspace_demote_view_from_fullscreen()

void wlmaker_workspace_demote_view_from_fullscreen ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Demotes |view_ptr| from the fullscreen layer, moving it to the previously- used layer.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_destroy()

void wlmaker_workspace_destroy ( wlmaker_workspace_t * workspace_ptr)

Destroys a workspace.

Parameters
workspace_ptr

◆ wlmaker_workspace_from_dlnode()

wlmaker_workspace_t * wlmaker_workspace_from_dlnode ( bs_dllist_node_t * dlnode_ptr)

Cast: Returns a pointer to wlmaker_workspace_t holding dlnode_ptr.

Parameters
dlnode_ptrA pointer to the dlnode element.
Returns
Pointer to the workspace holding the dlnode.

◆ wlmaker_workspace_get_activated_view()

wlmaker_view_t * wlmaker_workspace_get_activated_view ( wlmaker_workspace_t * workspace_ptr)

Accessor: Gets the currently-activated view.

Parameters
workspace_ptr

Returns The currently-activated view, or NULL if none.

◆ wlmaker_workspace_get_details()

void wlmaker_workspace_get_details ( wlmaker_workspace_t * workspace_ptr,
int * index_ptr,
const char ** name_ptr_ptr )

Retrieves the naming detalis of this workspace.

Parameters
workspace_ptr
index_ptr
name_ptr_ptr

◆ wlmaker_workspace_get_fullscreen_area()

void wlmaker_workspace_get_fullscreen_area ( wlmaker_workspace_t * workspace_ptr,
struct wlr_output * wlr_output_ptr,
struct wlr_box * fullscreen_area_ptr )

Gets the 'fullscreen' area for this workspace and outpout.

Parameters
workspace_ptr
wlr_output_ptr
fullscreen_area_ptr

◆ wlmaker_workspace_get_maximize_area()

void wlmaker_workspace_get_maximize_area ( wlmaker_workspace_t * workspace_ptr,
struct wlr_output * wlr_output_ptr,
struct wlr_box * maximize_area_ptr )

Gets the 'maximize' area for this workspace and outpout.

Parameters
workspace_ptr
wlr_output_ptr
maximize_area_ptr

◆ wlmaker_workspace_get_tile_container()

wlmaker_tile_container_t * wlmaker_workspace_get_tile_container ( wlmaker_workspace_t * workspace_ptr)

Prototype: Gets the tile container for the workspace. TODO: eliminate.

◆ wlmaker_workspace_get_views_dllist()

const bs_dllist_t * wlmaker_workspace_get_views_dllist ( wlmaker_workspace_t * workspace_ptr)

Gets a pointer to the double-linked list holding all SHELL views.

Parameters
workspace_ptr
Returns
The bs_dllist_t.

◆ wlmaker_workspace_iconified_set_as_view()

void wlmaker_workspace_iconified_set_as_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_iconified_t * iconified_ptr )

Sets the iconified_ptr as view, ie. un-minimize the corresponding view.

Parameters
workspace_ptr
iconified_ptr

◆ wlmaker_workspace_layer_surface_add()

void wlmaker_workspace_layer_surface_add ( wlmaker_workspace_t * workspace_ptr,
wlmaker_workspace_layer_t layer,
wlmaker_layer_surface_t * layer_surface_ptr )

Adds the layer surface to the specified layer.

In addition to the reference to the layer surface's view, we want to retain pointers to all currently-mapped layer surfaces on our workspace and layer. Required for re-configuring the surfaces through the wlroots layer surface API. This should be called after wlmaker_workspace_add_view.

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Layer views should be recognized and added in wlmaker_workspace_add_view, not needing an extra call.

Parameters
workspace_ptr
layer
layer_surface_ptr

◆ wlmaker_workspace_layer_surface_remove()

void wlmaker_workspace_layer_surface_remove ( wlmaker_workspace_t * workspace_ptr,
wlmaker_workspace_layer_t layer,
wlmaker_layer_surface_t * layer_surface_ptr )

Removes the layer surface from the specified layer.

|layer_surface_ptr| must currently be a member of |layer_surfaces|.

Parameters
workspace_ptr
layer
layer_surface_ptr

◆ wlmaker_workspace_lower_view()

void wlmaker_workspace_lower_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Lowers the view to the bottom of the workspace. Does not change activation.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_promote_view_to_fullscreen()

void wlmaker_workspace_promote_view_to_fullscreen ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Promotes |view_ptr| to the fullscreen layer. Will demote any view currently on the fullscreen layer.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_raise_view()

void wlmaker_workspace_raise_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Raises the view to the top of the workspace. Does not change activation.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_remove_view()

void wlmaker_workspace_remove_view ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Removes the view from the workspace.

If this view happened to be the currently-activated view: Will deactivate it and activate the next view from the |views| stack of this workspace.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_set_enabled()

void wlmaker_workspace_set_enabled ( wlmaker_workspace_t * workspace_ptr,
bool enabled )

Sets this workspace as enabled.

Expects that any other workspace has been disabled beforehand, otherwise focus expectations will get wonky.

Parameters
workspace_ptr
enabled

◆ wlmaker_workspace_set_extents()

void wlmaker_workspace_set_extents ( wlmaker_workspace_t * workspace_ptr,
const struct wlr_box * extents_ptr )

Sets extents of the workspace.

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Should re-trigger re-arranging.

Parameters
workspace_ptr
extents_ptr

◆ wlmaker_workspace_view_set_as_iconified()

void wlmaker_workspace_view_set_as_iconified ( wlmaker_workspace_t * workspace_ptr,
wlmaker_view_t * view_ptr )

Sets view_ptr as an iconified, ie. minimizes that view.

Parameters
workspace_ptr
view_ptr

◆ wlmaker_workspace_wlmtk()

wlmtk_workspace_t * wlmaker_workspace_wlmtk ( wlmaker_workspace_t * workspace_ptr)

Transitional: Returns the wlmtk_workspace_t.

Variable Documentation

◆ wlmaker_workspace_test_cases

const bs_test_case_t wlmaker_workspace_test_cases[]
extern

Unit tests.