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

Go to the source code of this file.

Classes

struct  _wlmtk_panel_vmt_t
 
struct  _wlmtk_panel_positioning_t
 
struct  _wlmtk_panel_t
 
struct  _wlmtk_fake_panel_t
 

Typedefs

typedef struct _wlmtk_panel_t wlmtk_panel_t
 
typedef struct _wlmtk_panel_vmt_t wlmtk_panel_vmt_t
 
typedef struct _wlmtk_panel_positioning_t wlmtk_panel_positioning_t
 
typedef struct _wlmtk_fake_panel_t wlmtk_fake_panel_t
 

Functions

bool wlmtk_panel_init (wlmtk_panel_t *panel_ptr, const wlmtk_panel_positioning_t *positioning_ptr)
 
void wlmtk_panel_fini (wlmtk_panel_t *panel_ptr)
 
wlmtk_panel_vmt_t wlmtk_panel_extend (wlmtk_panel_t *panel_ptr, const wlmtk_panel_vmt_t *panel_vmt_ptr)
 
wlmtk_element_twlmtk_panel_element (wlmtk_panel_t *panel_ptr)
 
bs_dllist_node_t * wlmtk_dlnode_from_panel (wlmtk_panel_t *panel_ptr)
 
wlmtk_panel_twlmtk_panel_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
void wlmtk_panel_set_layer (wlmtk_panel_t *panel_ptr, wlmtk_layer_t *layer_ptr)
 
wlmtk_layer_twlmtk_panel_get_layer (wlmtk_panel_t *panel_ptr)
 
void wlmtk_panel_set_layer_output (wlmtk_panel_t *panel_ptr, wlmtk_layer_output_t *layer_output_ptr)
 
wlmtk_layer_output_twlmtk_panel_get_layer_output (wlmtk_panel_t *panel_ptr)
 
static uint32_t wlmtk_panel_request_size (wlmtk_panel_t *panel_ptr, int width, int height)
 
void wlmtk_panel_commit (wlmtk_panel_t *panel_ptr, uint32_t serial, const wlmtk_panel_positioning_t *positioning_ptr)
 
struct wlr_box wlmtk_panel_compute_dimensions (const wlmtk_panel_t *panel_ptr, const struct wlr_box *full_area_ptr, struct wlr_box *usable_area_ptr)
 
wlmtk_fake_panel_twlmtk_fake_panel_create (const wlmtk_panel_positioning_t *positioning_ptr)
 
void wlmtk_fake_panel_destroy (wlmtk_fake_panel_t *fake_panel_ptr)
 

Variables

const bs_test_case_t wlmtk_panel_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_fake_panel_t

Forward declaration: Fake panel, for tests.

◆ wlmtk_panel_positioning_t

Forward declaration: The panel's positioning parameters.

◆ wlmtk_panel_t

typedef struct _wlmtk_panel_t wlmtk_panel_t

Forward declaration: An element of a layer, we call it: Panel.

◆ wlmtk_panel_vmt_t

Forward declaration: The panel's virtual method table.

Function Documentation

◆ wlmtk_dlnode_from_panel()

bs_dllist_node_t * wlmtk_dlnode_from_panel ( wlmtk_panel_t panel_ptr)
Returns
Pointer to wlmtk_panel_t::dlnode.

◆ wlmtk_fake_panel_create()

wlmtk_fake_panel_t * wlmtk_fake_panel_create ( const wlmtk_panel_positioning_t positioning_ptr)

Creates a fake panel, for tests.

◆ wlmtk_fake_panel_destroy()

void wlmtk_fake_panel_destroy ( wlmtk_fake_panel_t fake_panel_ptr)

Destroys the fake panel.

◆ wlmtk_panel_commit()

void wlmtk_panel_commit ( wlmtk_panel_t panel_ptr,
uint32_t  serial,
const wlmtk_panel_positioning_t positioning_ptr 
)

Reports a commit for the given serial, and updates positioning.

Parameters
panel_ptr
serial
positioning_ptr

◆ wlmtk_panel_compute_dimensions()

struct wlr_box wlmtk_panel_compute_dimensions ( const wlmtk_panel_t panel_ptr,
const struct wlr_box *  full_area_ptr,
struct wlr_box *  usable_area_ptr 
)

Computes the requested dimension for the panel.

Parameters
panel_ptr
full_area_ptr
usable_area_ptrAre that remains usable from the output and layer after factoring in other panels. *usable_area_ptr will be updated with this panel's exclusive area (if any) subtracted.
Returns
A wlr_box with the requested position and size for this panel. The caller is advised to issue a call to wlmtk_panel_request_size call and update the panel element's position with the box' information.

◆ wlmtk_panel_element()

wlmtk_element_t * wlmtk_panel_element ( wlmtk_panel_t panel_ptr)
Returns
pointer to the super wlmtk_element_t of the panel.

◆ wlmtk_panel_extend()

wlmtk_panel_vmt_t wlmtk_panel_extend ( wlmtk_panel_t panel_ptr,
const wlmtk_panel_vmt_t panel_vmt_ptr 
)

Extends the panel by the specified virtual methods.

Parameters
panel_ptr
panel_vmt_ptr
Returns
The original virtual method table.

◆ wlmtk_panel_fini()

void wlmtk_panel_fini ( wlmtk_panel_t panel_ptr)

Un-initializes the panel.

Parameters
panel_ptr

◆ wlmtk_panel_from_dlnode()

wlmtk_panel_t * wlmtk_panel_from_dlnode ( bs_dllist_node_t *  dlnode_ptr)
Returns
Pointer to wlmtk_panel_t for the given dlnode.

◆ wlmtk_panel_get_layer()

wlmtk_layer_t * wlmtk_panel_get_layer ( wlmtk_panel_t panel_ptr)
Returns
the wlmtk_layer_t this panel belongs to. Or NULL, if unmapped.

◆ wlmtk_panel_get_layer_output()

wlmtk_layer_output_t * wlmtk_panel_get_layer_output ( wlmtk_panel_t panel_ptr)
Returns
the wlmtk_layer_output_t the panel belongs to. NULL if unmapped.

◆ wlmtk_panel_init()

bool wlmtk_panel_init ( wlmtk_panel_t panel_ptr,
const wlmtk_panel_positioning_t positioning_ptr 
)

Initializes the panel.

Parameters
panel_ptr
positioning_ptr
Returns
true on success.

◆ wlmtk_panel_request_size()

static uint32_t wlmtk_panel_request_size ( wlmtk_panel_t panel_ptr,
int  width,
int  height 
)
inlinestatic

Requests new size. See wlmtk_panel_vmt_t::request_size.

◆ wlmtk_panel_set_layer()

void wlmtk_panel_set_layer ( wlmtk_panel_t panel_ptr,
wlmtk_layer_t layer_ptr 
)
protected

Sets the layer for the panel_ptr.

This method must only be called from wlmtk_layer_t.

Parameters
panel_ptr
layer_ptr

◆ wlmtk_panel_set_layer_output()

void wlmtk_panel_set_layer_output ( wlmtk_panel_t panel_ptr,
wlmtk_layer_output_t layer_output_ptr 
)
protected

Sets the layer output for the panel_ptr.

This method must only be called from wlmtk_layer_output_t.

Parameters
panel_ptr
layer_output_ptr

Variable Documentation

◆ wlmtk_panel_test_cases

const bs_test_case_t wlmtk_panel_test_cases[]
extern

Unit test cases of panel.