wlmaker
Loading...
Searching...
No Matches
Functions | Variables
tile.c File Reference
#include "tile.h"
#include "gfxbuf.h"
#include "primitives.h"
Include dependency graph for tile.c:

Functions

static void _wlmtk_tile_update_layout (wlmtk_container_t *container_ptr)
 
static struct wlr_buffer * _wlmtk_tile_create_buffer (const wlmtk_tile_style_t *style_ptr)
 
bool wlmtk_tile_init (wlmtk_tile_t *tile_ptr, const wlmtk_tile_style_t *style_ptr, wlmtk_env_t *env_ptr)
 
void wlmtk_tile_fini (wlmtk_tile_t *tile_ptr)
 
bool wlmtk_tile_set_background_buffer (wlmtk_tile_t *tile_ptr, struct wlr_buffer *wlr_buffer_ptr)
 
void wlmtk_tile_set_content (wlmtk_tile_t *tile_ptr, wlmtk_element_t *element_ptr)
 
void wlmtk_tile_set_overlay (wlmtk_tile_t *tile_ptr, wlmtk_element_t *element_ptr)
 
wlmtk_element_twlmtk_tile_element (wlmtk_tile_t *tile_ptr)
 
static void test_init_fini (bs_test_t *test_ptr)
 

Variables

static const wlmtk_container_vmt_t _wlmtk_tile_container_vmt
 
const bs_test_case_t wlmtk_tile_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.

Function Documentation

◆ _wlmtk_tile_create_buffer()

struct wlr_buffer * _wlmtk_tile_create_buffer ( const wlmtk_tile_style_t * style_ptr)
static

Crates a wlr_buffer with background, as described in style_ptr.

◆ _wlmtk_tile_update_layout()

void _wlmtk_tile_update_layout ( wlmtk_container_t * container_ptr)
static

Handles requests to update layout. Called when elements are added.

◆ test_init_fini()

static void test_init_fini ( bs_test_t * test_ptr)
static

Exercises setup and teardown.

◆ wlmtk_tile_element()

wlmtk_element_t * wlmtk_tile_element ( wlmtk_tile_t * tile_ptr)
Returns
the superclass' wlmtk_element_t of tile_ptr.

◆ wlmtk_tile_fini()

void wlmtk_tile_fini ( wlmtk_tile_t * tile_ptr)

Un-initializes the tile.

Parameters
tile_ptr

◆ wlmtk_tile_init()

bool wlmtk_tile_init ( wlmtk_tile_t * tile_ptr,
const wlmtk_tile_style_t * style_ptr,
wlmtk_env_t * env_ptr )

Initializes the tile.

Parameters
tile_ptr
style_ptr
env_ptr
Returns
true on success.

◆ wlmtk_tile_set_background_buffer()

bool wlmtk_tile_set_background_buffer ( wlmtk_tile_t * tile_ptr,
struct wlr_buffer * wlr_buffer_ptr )

Sets (overwrites) the default tile's background buffer.

This permits specific tiles, eg. a Dock Clip to include active elements in the background, or change the bezel or texture.

Parameters
tile_ptr
wlr_buffer_ptrPoints to a struct wlr_buffer. The tile will add a buffer lock, so the caller may safely drop or unlock the buffer. The buffer must match the tile's size.
Returns
false if the buffer did not match the tile size.

◆ wlmtk_tile_set_content()

void wlmtk_tile_set_content ( wlmtk_tile_t * tile_ptr,
wlmtk_element_t * element_ptr )

Sets element_ptr as the content of tile_ptr.

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Flesh out the behaviour – permit only 1 content? Does the tile claim ownerwhip? How to reset the content?

Parameters
tile_ptr
element_ptr

◆ wlmtk_tile_set_overlay()

void wlmtk_tile_set_overlay ( wlmtk_tile_t * tile_ptr,
wlmtk_element_t * element_ptr )

Sets element_ptr as the overlay of tile_ptr.

TODO(kaese.nosp@m.r@gu.nosp@m.bbe.c.nosp@m.h): Flesh out the behaviour – permit only 1 overlay? Does the tile claim ownerwhip? How to reset the overlay?

Parameters
tile_ptr
element_ptr

Variable Documentation

◆ _wlmtk_tile_container_vmt

const wlmtk_container_vmt_t _wlmtk_tile_container_vmt
static
Initial value:
= {
.update_layout = _wlmtk_tile_update_layout
}
static void _wlmtk_tile_update_layout(wlmtk_container_t *container_ptr)
Definition tile.c:188

Virtual methods implemented by wlmtk_tile_t.

◆ wlmtk_tile_test_cases

const bs_test_case_t wlmtk_tile_test_cases[]
Initial value:
= {
{ 1, "init_fini", test_init_fini },
{ 0, NULL, NULL }
}
static void test_init_fini(bs_test_t *test_ptr)
Definition tile.c:225

Unit test cases for wlmtk_tile_t.