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

Go to the source code of this file.

Classes

struct  wlmtk_tile_style
 
struct  _wlmtk_tile_vmt_t
 
struct  _wlmtk_tile_t
 

Typedefs

typedef struct _wlmtk_tile_t wlmtk_tile_t
 
typedef struct _wlmtk_tile_vmt_t wlmtk_tile_vmt_t
 

Functions

bool wlmtk_tile_init (wlmtk_tile_t *tile_ptr, const struct wlmtk_tile_style *style_ptr)
 
wlmtk_tile_vmt_t wlmtk_tile_extend (wlmtk_tile_t *tile_ptr, const wlmtk_tile_vmt_t *tile_vmt_ptr)
 
void wlmtk_tile_fini (wlmtk_tile_t *tile_ptr)
 
bool wlmtk_tile_set_style (wlmtk_tile_t *tile_ptr, const struct wlmtk_tile_style *style_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)
 
wlmtk_tile_twlmtk_tile_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
bs_dllist_node_t * wlmtk_dlnode_from_tile (wlmtk_tile_t *tile_ptr)
 

Variables

const bspl_desc_t wlmtk_tile_style_desc []
 
const bs_test_set_t wlmtk_tile_test_set
 

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_tile_t

typedef struct _wlmtk_tile_t wlmtk_tile_t

Forward declaration: State of a tile.

◆ wlmtk_tile_vmt_t

Forward declaration: Tile virtual method table.

Function Documentation

◆ wlmtk_dlnode_from_tile()

bs_dllist_node_t * wlmtk_dlnode_from_tile ( wlmtk_tile_t tile_ptr)
Returns
wlmtk_tile_t::dlnode from tile_ptr.

◆ 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_extend()

wlmtk_tile_vmt_t wlmtk_tile_extend ( wlmtk_tile_t tile_ptr,
const wlmtk_tile_vmt_t tile_vmt_ptr 
)

Extends the tile's virtual methods.

Parameters
tile_ptr
tile_vmt_ptr
Returns
The previous virtual method table.

◆ wlmtk_tile_fini()

void wlmtk_tile_fini ( wlmtk_tile_t tile_ptr)

Un-initializes the tile.

Parameters
tile_ptr

◆ wlmtk_tile_from_dlnode()

wlmtk_tile_t * wlmtk_tile_from_dlnode ( bs_dllist_node_t *  dlnode_ptr)
Returns
The wlmtk_tile_t for dlnode_ptr.

◆ wlmtk_tile_init()

bool wlmtk_tile_init ( wlmtk_tile_t tile_ptr,
const struct wlmtk_tile_style style_ptr 
)

Initializes the tile.

Parameters
tile_ptr
style_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

◆ wlmtk_tile_set_style()

bool wlmtk_tile_set_style ( wlmtk_tile_t tile_ptr,
const struct wlmtk_tile_style style_ptr 
)

Updates the style for the tile.

Parameters
tile_ptr
style_ptr
Returns
true on success.

Variable Documentation

◆ wlmtk_tile_style_desc

const bspl_desc_t wlmtk_tile_style_desc[]
extern

Plist decoding descriptor of a tile style.

◆ wlmtk_tile_test_set

const bs_test_set_t wlmtk_tile_test_set
extern

Unit test cases for wlmtk_tile_t.