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

Go to the source code of this file.

Classes

struct  _wlmtk_container_vmt_t
 
struct  _wlmtk_container_t
 

Typedefs

typedef struct _wlmtk_container_t wlmtk_container_t
 
typedef struct _wlmtk_container_vmt_t wlmtk_container_vmt_t
 

Functions

bool wlmtk_container_init (wlmtk_container_t *container_ptr, wlmtk_env_t *env_ptr)
 
wlmtk_container_vmt_t wlmtk_container_extend (wlmtk_container_t *container_ptr, const wlmtk_container_vmt_t *container_vmt_ptr)
 
bool wlmtk_container_init_attached (wlmtk_container_t *container_ptr, wlmtk_env_t *env_ptr, struct wlr_scene_tree *root_wlr_scene_tree_ptr)
 
void wlmtk_container_fini (wlmtk_container_t *container_ptr)
 
void wlmtk_container_add_element (wlmtk_container_t *container_ptr, wlmtk_element_t *element_ptr)
 
void wlmtk_container_add_element_atop (wlmtk_container_t *container_ptr, wlmtk_element_t *reference_element_ptr, wlmtk_element_t *element_ptr)
 
void wlmtk_container_remove_element (wlmtk_container_t *container_ptr, wlmtk_element_t *element_ptr)
 
void wlmtk_container_raise_element_to_top (wlmtk_container_t *container_ptr, wlmtk_element_t *element_ptr)
 
void wlmtk_container_update_pointer_focus (wlmtk_container_t *container_ptr)
 
void wlmtk_container_set_keyboard_focus_element (wlmtk_container_t *container_ptr, wlmtk_element_t *element_ptr)
 
static void wlmtk_container_update_layout (wlmtk_container_t *container_ptr)
 
struct wlr_scene_tree * wlmtk_container_wlr_scene_tree (wlmtk_container_t *container_ptr)
 
wlmtk_container_twlmtk_container_create_fake_parent (void)
 
void wlmtk_container_destroy_fake_parent (wlmtk_container_t *container_ptr)
 

Variables

const bs_test_case_t wlmtk_container_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.

Typedef Documentation

◆ wlmtk_container_t

Forward declaration: Container.

◆ wlmtk_container_vmt_t

Forward declaration: Container virtual method table.

Function Documentation

◆ wlmtk_container_add_element()

void wlmtk_container_add_element ( wlmtk_container_t * container_ptr,
wlmtk_element_t * element_ptr )

Adds element_ptr to the container.

Requires that element_ptr is not added to a container yet. The element will be added at the top of the container.

Parameters
container_ptr
element_ptr

◆ wlmtk_container_add_element_atop()

void wlmtk_container_add_element_atop ( wlmtk_container_t * container_ptr,
wlmtk_element_t * reference_element_ptr,
wlmtk_element_t * element_ptr )

Adds element_ptr to the container atop the reference's position.

If reference_element_ptr is NULL, the element will be added at the back.

Parameters
container_ptr
reference_element_ptrMust be an element of this container.
element_ptr

◆ wlmtk_container_create_fake_parent()

wlmtk_container_t * wlmtk_container_create_fake_parent ( void )

Constructor for a fake container with a scene tree.

◆ wlmtk_container_destroy_fake_parent()

void wlmtk_container_destroy_fake_parent ( wlmtk_container_t * container_ptr)

Destructor for that fake container.

◆ wlmtk_container_extend()

wlmtk_container_vmt_t wlmtk_container_extend ( wlmtk_container_t * container_ptr,
const wlmtk_container_vmt_t * container_vmt_ptr )

Extends the container's virtual methods.

Parameters
container_ptr
container_vmt_ptr
Returns
The previous virtual method table.

◆ wlmtk_container_fini()

void wlmtk_container_fini ( wlmtk_container_t * container_ptr)

Un-initializes the container.

Any element still in elements will be destroyed.

Parameters
container_ptr

◆ wlmtk_container_init()

bool wlmtk_container_init ( wlmtk_container_t * container_ptr,
wlmtk_env_t * env_ptr )

Initializes the container with the provided virtual method table.

Parameters
container_ptr
env_ptr
Returns
true on success.

◆ wlmtk_container_init_attached()

bool wlmtk_container_init_attached ( wlmtk_container_t * container_ptr,
wlmtk_env_t * env_ptr,
struct wlr_scene_tree * root_wlr_scene_tree_ptr )

Initializes the container, and attach to WLR sene graph.

Parameters
container_ptr
env_ptr
root_wlr_scene_tree_ptr
Returns
true on success.

◆ wlmtk_container_raise_element_to_top()

void wlmtk_container_raise_element_to_top ( wlmtk_container_t * container_ptr,
wlmtk_element_t * element_ptr )

Places element_ptr at the top (head) of the container.

Expects that container_ptr is element_ptr's parent container.

Parameters
container_ptr
element_ptr

◆ wlmtk_container_remove_element()

void wlmtk_container_remove_element ( wlmtk_container_t * container_ptr,
wlmtk_element_t * element_ptr )

Removes element_ptr from the container.

Expects that container_ptr is element_ptr's parent container.

Parameters
container_ptr
element_ptr

◆ wlmtk_container_set_keyboard_focus_element()

void wlmtk_container_set_keyboard_focus_element ( wlmtk_container_t * container_ptr,
wlmtk_element_t * element_ptr )

Reports element_ptr as having keyboard focus, and registers it as such in this container. Will propagate wlmtk_container_t::super_element to this container's parent as element having keyboard focus.

Parameters
container_ptr
element_ptr

◆ wlmtk_container_update_layout()

static void wlmtk_container_update_layout ( wlmtk_container_t * container_ptr)
inlinestatic

Updates the layout of the container.

Parameters
container_ptrContainer to update. NULL implies a no-op.

◆ wlmtk_container_update_pointer_focus()

void wlmtk_container_update_pointer_focus ( wlmtk_container_t * container_ptr)

Updates pointer focus of the container.

Parameters
container_ptr

◆ wlmtk_container_wlr_scene_tree()

struct wlr_scene_tree * wlmtk_container_wlr_scene_tree ( wlmtk_container_t * container_ptr)

Returns the wlroots scene graph tree for this node.

Private: Should be called only by wlmtk_element_t.

Parameters
container_ptr
Returns
The scene tree, or NULL if not attached to a scene graph.

Variable Documentation

◆ wlmtk_container_test_cases

const bs_test_case_t wlmtk_container_test_cases[]
extern

Unit tests for the container.