wlmaker
|
#include "iconified.h"
#include "layer_surface.h"
#include "server.h"
#include "tile_container.h"
#include "toolkit/toolkit.h"
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 } |
Variables | |
const bs_test_case_t | wlmaker_workspace_test_cases [] |
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.
#define WLMAKER_WORKSPACE_LAYER_NUM (WLMAKER_WORKSPACE_LAYER_OVERLAY + 1) |
Number of defined layers. Helpful ot iterate over layers 0...NUM.
typedef enum _wlmaker_workspace_layer_t wlmaker_workspace_layer_t |
Forward definition: Workspace layer.
typedef struct _wlmaker_workspace_t wlmaker_workspace_t |
Forward definition: Workspace state.
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.
bs_dllist_node_t * wlmaker_dlnode_from_workspace | ( | wlmaker_workspace_t * | workspace_ptr | ) |
Cast: Returns a pointer to the dlnode
element of workspace_ptr
.
workspace_ptr |
dlnode
of workspace_ptr
. 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.
workspace_ptr |
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.
workspace_ptr |
void wlmaker_workspace_activate_view | ( | wlmaker_workspace_t * | workspace_ptr, |
wlmaker_view_t * | view_ptr ) |
Activates the view.
workspace_ptr | |
view_ptr |
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.
workspace_ptr | |
view_ptr | |
layer |
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.
workspace_ptr |
wlmaker_workspace_t * wlmaker_workspace_create | ( | wlmaker_server_t * | server_ptr, |
uint32_t | color, | ||
int | index, | ||
const char * | name_ptr ) |
Creates a workspace.
server_ptr | |
color | |
index | |
name_ptr |
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.
workspace_ptr | |
view_ptr |
void wlmaker_workspace_destroy | ( | wlmaker_workspace_t * | workspace_ptr | ) |
Destroys a workspace.
workspace_ptr |
wlmaker_workspace_t * wlmaker_workspace_from_dlnode | ( | bs_dllist_node_t * | dlnode_ptr | ) |
Cast: Returns a pointer to wlmaker_workspace_t holding dlnode_ptr
.
dlnode_ptr | A pointer to the dlnode element. |
wlmaker_view_t * wlmaker_workspace_get_activated_view | ( | wlmaker_workspace_t * | workspace_ptr | ) |
Accessor: Gets the currently-activated view.
workspace_ptr |
Returns The currently-activated view, or NULL if none.
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.
workspace_ptr | |
index_ptr | |
name_ptr_ptr |
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.
workspace_ptr | |
wlr_output_ptr | |
fullscreen_area_ptr |
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.
workspace_ptr | |
wlr_output_ptr | |
maximize_area_ptr |
wlmaker_tile_container_t * wlmaker_workspace_get_tile_container | ( | wlmaker_workspace_t * | workspace_ptr | ) |
Prototype: Gets the tile container for the workspace. TODO: eliminate.
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.
workspace_ptr |
bs_dllist_t
. 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.
workspace_ptr | |
iconified_ptr |
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.
workspace_ptr | |
layer | |
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 ) |
Removes the layer surface from the specified layer.
|layer_surface_ptr| must currently be a member of |layer_surfaces|.
workspace_ptr | |
layer | |
layer_surface_ptr |
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.
workspace_ptr | |
view_ptr |
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.
workspace_ptr | |
view_ptr |
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.
workspace_ptr | |
view_ptr |
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.
workspace_ptr | |
view_ptr |
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.
workspace_ptr | |
enabled |
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.
workspace_ptr | |
extents_ptr |
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.
workspace_ptr | |
view_ptr |
wlmtk_workspace_t * wlmaker_workspace_wlmtk | ( | wlmaker_workspace_t * | workspace_ptr | ) |
Transitional: Returns the wlmtk_workspace_t.
|
extern |
Unit tests.