wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
window.c File Reference
#include "window.h"
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <linux/input-event-codes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/util/edges.h>
#include "bordered.h"
#include "box.h"
#include "container.h"
#include "input.h"
#include "menu_item.h"
#include "resizebar.h"
#include "test.h"
#include "tile.h"
#include "titlebar.h"
Include dependency graph for window.c:

Classes

struct  _wlmtk_window_t
 
struct  _wlmtk_window_style_ref_t
 
struct  wlmtk_window_style_holder
 

Functions

static bool _wlmtk_window_element_pointer_button (wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
 
static void _wlmtk_window_element_layout (wlmtk_element_t *element_ptr)
 
static void _wlmtk_window_container_element_get_dimensions (wlmtk_element_t *element_ptr, int *x1_ptr, int *y1_ptr, int *x2_ptr, int *y2_ptr)
 
static void _wlmtk_window_apply_decoration (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_create_titlebar (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_create_resizebar (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_destroy_titlebar (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_destroy_resizebar (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_set_decoration_width (wlmtk_window_t *window_ptr)
 
static void _wlmtk_window_menu_request_close_handler (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmtk_window_style_destroy (bs_ref_t *ref_ptr)
 
static void _wlmtk_window_request_fullscreen_size (wlmtk_window_t *window_ptr, bool fullscreen)
 
static void _wlmtk_window_request_maximized_size (wlmtk_window_t *window_ptr, bool maximized)
 
wlmtk_window_twlmtk_window_create (wlmtk_element_t *content_element_ptr, wlmtk_window_style_ref_t *style_ref_ptr, wlmtk_menu_style_ref_t *menu_style_ref_ptr)
 
void wlmtk_window_destroy (wlmtk_window_t *window_ptr)
 
wlmtk_window_events_twlmtk_window_events (wlmtk_window_t *window_ptr)
 
wlmtk_element_twlmtk_window_element (wlmtk_window_t *window_ptr)
 
wlmtk_window_twlmtk_window_from_element (wlmtk_element_t *element_ptr)
 
struct wlr_box wlmtk_window_get_bounding_box (wlmtk_window_t *window_ptr)
 
void wlmtk_window_position_changed (wlmtk_window_t *window_ptr)
 
void wlmtk_window_set_properties (wlmtk_window_t *window_ptr, uint32_t properties)
 
void wlmtk_window_set_client (wlmtk_window_t *window_ptr, const wlmtk_util_client_t *client_ptr)
 
const wlmtk_util_client_twlmtk_window_get_client_ptr (wlmtk_window_t *window_ptr)
 
void wlmtk_window_set_preferred_wlr_output (wlmtk_window_t *window_ptr, struct wlr_output *wlr_output_ptr)
 
struct wlr_output * wlmtk_window_get_wlr_output (wlmtk_window_t *window_ptr)
 
bool wlmtk_window_set_title (wlmtk_window_t *window_ptr, const char *title_ptr)
 
const char * wlmtk_window_get_title (wlmtk_window_t *window_ptr)
 
void wlmtk_window_set_activated (wlmtk_window_t *window_ptr, bool activated)
 
bool wlmtk_window_is_activated (wlmtk_window_t *window_ptr)
 
void wlmtk_window_request_size (wlmtk_window_t *window_ptr, const struct wlr_box *box_ptr)
 
void wlmtk_window_commit_size (wlmtk_window_t *window_ptr, int width, int height)
 
struct wlr_box wlmtk_window_get_size (wlmtk_window_t *window_ptr)
 
void wlmtk_window_set_resize_edges (wlmtk_window_t *window_ptr, uint32_t edges)
 
uint32_t wlmtk_window_get_resize_edges (wlmtk_window_t *window_ptr)
 
void wlmtk_window_request_close (wlmtk_window_t *window_ptr)
 
void wlmtk_window_request_minimize (wlmtk_window_t *window_ptr)
 
void wlmtk_window_request_fullscreen (wlmtk_window_t *window_ptr, bool fullscreen)
 
bool wlmtk_window_is_fullscreen (wlmtk_window_t *window_ptr)
 
void wlmtk_window_commit_fullscreen (wlmtk_window_t *window_ptr, bool fullscreen)
 
void wlmtk_window_request_maximized (wlmtk_window_t *window_ptr, bool maximized)
 
bool wlmtk_window_is_maximized (wlmtk_window_t *window_ptr)
 
void wlmtk_window_commit_maximized (wlmtk_window_t *window_ptr, bool maximized)
 
void wlmtk_window_request_shaded (wlmtk_window_t *window_ptr, bool shaded)
 
bool wlmtk_window_is_shaded (wlmtk_window_t *window_ptr)
 
void wlmtk_window_menu_set_enabled (wlmtk_window_t *window_ptr, bool enabled)
 
wlmtk_menu_twlmtk_window_menu (wlmtk_window_t *window_ptr)
 
void wlmtk_window_set_server_side_decorated (wlmtk_window_t *window_ptr, bool decorated)
 
void wlmtk_window_set_options (wlmtk_window_t *window_ptr, uint32_t move_modifier)
 
void wlmtk_window_set_workspace (wlmtk_window_t *window_ptr, wlmtk_workspace_t *workspace_ptr)
 
wlmtk_workspace_twlmtk_window_get_workspace (wlmtk_window_t *window_ptr)
 
bs_dllist_node_t * wlmtk_dlnode_from_window (wlmtk_window_t *window_ptr)
 
wlmtk_window_twlmtk_window_from_dlnode (bs_dllist_node_t *dlnode_ptr)
 
bool wlmtk_window_set_style (wlmtk_window_t *window_ptr, wlmtk_window_style_ref_t *style_ref_ptr, wlmtk_menu_style_ref_t *menu_style_ref_ptr)
 
struct wlmtk_window_stylewlmtk_window_style_create (void)
 
wlmtk_window_style_ref_twlmtk_window_style_to_ref (struct wlmtk_window_style *window_style_ptr)
 
const struct wlmtk_window_stylewlmtk_window_style_ref_retain (wlmtk_window_style_ref_t *ref_ptr)
 
void wlmtk_window_style_ref_release (wlmtk_window_style_ref_t *ref_ptr)
 
bool wlmtk_window_style_decode (bspl_object_t *object_ptr, const union bspl_desc_value *desc_value_ptr, void *value_ptr)
 
bool wlmtk_window_style_decode_init (void *dst_ptr)
 
void wlmtk_window_style_decode_fini (void *dst_ptr)
 
static void test_create_destroy (bs_test_t *test_ptr)
 
static void test_decoration (bs_test_t *test_ptr)
 
static void test_events (bs_test_t *test_ptr)
 
static void test_set_activated (bs_test_t *test_ptr)
 
static void test_resize (bs_test_t *test_ptr)
 
static void test_fullscreen (bs_test_t *test_ptr)
 
static void test_fullscreen_preferred_output (bs_test_t *test_ptr)
 
static void test_fullscreen_unmap (bs_test_t *test_ptr)
 
static void test_maximized (bs_test_t *test_ptr)
 
static void test_shaded (bs_test_t *test_ptr)
 
static void test_modifier_move (bs_test_t *test_ptr)
 
static void test_menu (bs_test_t *test_ptr)
 
static void test_style (bs_test_t *test_ptr)
 
static void test_style_decode (bs_test_t *test_ptr)
 
wlmtk_window_twlmtk_test_window_create (wlmtk_element_t *content_element_ptr)
 

Variables

static const wlmtk_element_vmt_t window_element_vmt
 
static const wlmtk_element_vmt_t _wlmtk_window_content_container_element_vmt
 
static const bspl_desc_t _wlmtk_window_style_desc []
 
static const bs_test_case_t _wlmtk_window_test_cases []
 
const bs_test_set_t wlmtk_window_test_set
 
static struct wlmtk_window_style_holder _wlmtk_window_test_style_holder
 
static const struct wlmtk_menu_style _wlmtk_window_test_menu_style
 

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_window_apply_decoration()

void _wlmtk_window_apply_decoration ( wlmtk_window_t window_ptr)
static

Applies window decoration depending on current state.

◆ _wlmtk_window_container_element_get_dimensions()

void _wlmtk_window_container_element_get_dimensions ( wlmtk_element_t element_ptr,
int *  x1_ptr,
int *  y1_ptr,
int *  x2_ptr,
int *  y2_ptr 
)
static

Gets dimensions of the content container: Forward to only the content.

◆ _wlmtk_window_create_resizebar()

void _wlmtk_window_create_resizebar ( wlmtk_window_t window_ptr)
static

Creates the resizebar.

◆ _wlmtk_window_create_titlebar()

void _wlmtk_window_create_titlebar ( wlmtk_window_t window_ptr)
static

Creates the titlebar.

◆ _wlmtk_window_destroy_resizebar()

void _wlmtk_window_destroy_resizebar ( wlmtk_window_t window_ptr)
static

Destroys the resizebar.

◆ _wlmtk_window_destroy_titlebar()

void _wlmtk_window_destroy_titlebar ( wlmtk_window_t window_ptr)
static

Destroys the titlebar.

◆ _wlmtk_window_element_layout()

void _wlmtk_window_element_layout ( wlmtk_element_t element_ptr)
static

Implementation of wlmtk_element_vmt_t::layout.

Invoked when the window's contained elements triggered a layout update, and will use this to trigger (potential) size updates to the window decorations.

Parameters
element_ptr

◆ _wlmtk_window_element_pointer_button()

bool _wlmtk_window_element_pointer_button ( wlmtk_element_t element_ptr,
const wlmtk_button_event_t button_event_ptr 
)
static

Activates window on button press, and calls the parent's implementation.

◆ _wlmtk_window_menu_request_close_handler()

void _wlmtk_window_menu_request_close_handler ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

◆ _wlmtk_window_request_fullscreen_size()

void _wlmtk_window_request_fullscreen_size ( wlmtk_window_t window_ptr,
bool  fullscreen 
)
static

Requests size appropriate for the fullscreen state.

◆ _wlmtk_window_request_maximized_size()

void _wlmtk_window_request_maximized_size ( wlmtk_window_t window_ptr,
bool  maximized 
)
static

Requests the size appropriate for the maximized state.

◆ _wlmtk_window_set_decoration_width()

void _wlmtk_window_set_decoration_width ( wlmtk_window_t window_ptr)
static

Sets the decoration's width to match the content.

◆ _wlmtk_window_style_destroy()

void _wlmtk_window_style_destroy ( bs_ref_t *  ref_ptr)
static

Destroys the window style.

◆ test_create_destroy()

void test_create_destroy ( bs_test_t *  test_ptr)
static

Exercises ctor and dtor and some accessors.

◆ test_decoration()

void test_decoration ( bs_test_t *  test_ptr)
static

Tests server-side decoration.

◆ test_events()

void test_events ( bs_test_t *  test_ptr)
static

Tests that desired events are firing.

◆ test_fullscreen()

void test_fullscreen ( bs_test_t *  test_ptr)
static

Tests fullscreen mode of a window.

◆ test_fullscreen_preferred_output()

void test_fullscreen_preferred_output ( bs_test_t *  test_ptr)
static

Tests fullscreen mode of a window onto preferred output .

◆ test_fullscreen_unmap()

void test_fullscreen_unmap ( bs_test_t *  test_ptr)
static

Tests that unmapping a fullscreen window works.

◆ test_maximized()

void test_maximized ( bs_test_t *  test_ptr)
static

Tests maximizing a window.

◆ test_menu()

void test_menu ( bs_test_t *  test_ptr)
static

Tests enabling and disabling the window menu.

◆ test_modifier_move()

void test_modifier_move ( bs_test_t *  test_ptr)
static

Tests that modifer-motion moves the window.

◆ test_resize()

void test_resize ( bs_test_t *  test_ptr)
static

Tests resize request: Ignore when fullscreen, unmaximize when maximized.

◆ test_set_activated()

void test_set_activated ( bs_test_t *  test_ptr)
static

Tests that activation updates decoration and callback.

◆ test_shaded()

void test_shaded ( bs_test_t *  test_ptr)
static

Tests shading of a window.

◆ test_style()

void test_style ( bs_test_t *  test_ptr)
static

Tests style reference counter.

◆ test_style_decode()

void test_style_decode ( bs_test_t *  test_ptr)
static

Tests decoding the window style from a plist dict.

◆ wlmtk_dlnode_from_window()

bs_dllist_node_t * wlmtk_dlnode_from_window ( wlmtk_window_t window_ptr)
Returns
pointer to wlmtk_window_t::dlnode.

◆ wlmtk_test_window_create()

wlmtk_window_t * wlmtk_test_window_create ( wlmtk_element_t content_element_ptr)

Creates a window, with default styles, for testing.

Parameters
content_element_ptr
Returns
See wlmtk_window_create.

◆ wlmtk_window_commit_fullscreen()

void wlmtk_window_commit_fullscreen ( wlmtk_window_t window_ptr,
bool  fullscreen 
)

Commits the window as fullscreen: Client has comitted the surface in fullscreen state.

Parameters
window_ptr
fullscreen

◆ wlmtk_window_commit_maximized()

void wlmtk_window_commit_maximized ( wlmtk_window_t window_ptr,
bool  maximized 
)

Commits the maximized mode for the window.

The call is idempotent: Once the window is committed, further calls with the same maximized value will return straight away.

Parameters
window_ptr
maximized

◆ wlmtk_window_commit_size()

void wlmtk_window_commit_size ( wlmtk_window_t window_ptr,
int  width,
int  height 
)

Sets the window's committed size. Should be called when the content size is changed, eg. on surface commit.

Parameters
window_ptr
width
height

◆ wlmtk_window_create()

wlmtk_window_t * wlmtk_window_create ( wlmtk_element_t content_element_ptr,
wlmtk_window_style_ref_t style_ref_ptr,
wlmtk_menu_style_ref_t menu_style_ref_ptr 
)

Creates a window.

Parameters
content_element_ptr
style_ref_ptr
menu_style_ref_ptr
Returns
The window handle, or NULL on error.

◆ wlmtk_window_destroy()

void wlmtk_window_destroy ( wlmtk_window_t window_ptr)

Destroys the window.

Parameters
window_ptr

◆ wlmtk_window_element()

wlmtk_element_t * wlmtk_window_element ( wlmtk_window_t window_ptr)

Returns the element for adding the window into a container.

Parameters
window_ptr
Returns
Pointer to the super element of wlmtk_window_t::bordered.

◆ wlmtk_window_events()

wlmtk_window_events_t * wlmtk_window_events ( wlmtk_window_t window_ptr)

Gets the set of events available to a window, for binding listeners.

Parameters
window_ptr
Returns
Pointer to this window's wlmtk_window_t::events.

◆ wlmtk_window_from_dlnode()

wlmtk_window_t * wlmtk_window_from_dlnode ( bs_dllist_node_t *  dlnode_ptr)

◆ wlmtk_window_from_element()

wlmtk_window_t * wlmtk_window_from_element ( wlmtk_element_t element_ptr)

Returns the window, where element_ptr is wlmtk_window_element.

Parameters
element_ptr
Returns
the wlmtk_window_t from the element pointer.

◆ wlmtk_window_get_bounding_box()

struct wlr_box wlmtk_window_get_bounding_box ( wlmtk_window_t window_ptr)

Returns the bounding box for the window.

Parameters
window_ptr
Returns
the box.

◆ wlmtk_window_get_client_ptr()

const wlmtk_util_client_t * wlmtk_window_get_client_ptr ( wlmtk_window_t window_ptr)

Returns a pointer to wlmtk_window_t::client.

Parameters
window_ptr
Returns
Client information. Remains walid until window_ptr is destroyed.

◆ wlmtk_window_get_resize_edges()

uint32_t wlmtk_window_get_resize_edges ( wlmtk_window_t window_ptr)
Returns
resizing edges.

◆ wlmtk_window_get_size()

struct wlr_box wlmtk_window_get_size ( wlmtk_window_t window_ptr)

Returns the window's (committed) size. That may be different than the dimensions of the window's wlmtk_window_t::content_element_ptr.

Parameters
window_ptr
Returns
The size box. Only width and height will be used.

◆ wlmtk_window_get_title()

const char * wlmtk_window_get_title ( wlmtk_window_t window_ptr)

Returns the title of the window.

Parameters
window_ptr
Returns
Pointer to the window title. Will remain valid until the next call to wlmtk_window_set_title, or until the window is destroyed. Will never be NULL.

◆ wlmtk_window_get_wlr_output()

struct wlr_output * wlmtk_window_get_wlr_output ( wlmtk_window_t window_ptr)

Gets the struct wlr_output that the window is on, or it prefers.

Parameters
window_ptr
Returns
The preferred output, if wlmtk_window_set_preferred_wlr_output was called with wlr_output_ptr other than NULL. Otherwise, returns a pointer to the struct wlr_output the window is currently placed on, or NULL if the window is not mapped or there are no outputs.

◆ wlmtk_window_get_workspace()

wlmtk_workspace_t * wlmtk_window_get_workspace ( wlmtk_window_t window_ptr)
Returns
The value of wlmtk_window_t::workspace_ptr.

◆ wlmtk_window_is_activated()

bool wlmtk_window_is_activated ( wlmtk_window_t window_ptr)
Returns
whether the window is currently activated.

◆ wlmtk_window_is_fullscreen()

bool wlmtk_window_is_fullscreen ( wlmtk_window_t window_ptr)
Returns
whether the window currently is in fullscreen mode.

◆ wlmtk_window_is_maximized()

bool wlmtk_window_is_maximized ( wlmtk_window_t window_ptr)
Returns
whether the window currently is in maximized mode.

◆ wlmtk_window_is_shaded()

bool wlmtk_window_is_shaded ( wlmtk_window_t window_ptr)
Returns
whether the window currently is shaded.

◆ wlmtk_window_menu()

wlmtk_menu_t * wlmtk_window_menu ( wlmtk_window_t window_ptr)

Returns a pointer to the window menu's state.

Parameters
window_ptr
Returns
A pointer to the wlmtk_menu_t of the window menu.

◆ wlmtk_window_menu_set_enabled()

void wlmtk_window_menu_set_enabled ( wlmtk_window_t window_ptr,
bool  enabled 
)

En-/Disables the window menu.

Parameters
window_ptr
enabled

◆ wlmtk_window_position_changed()

void wlmtk_window_position_changed ( wlmtk_window_t window_ptr)

Helper: Indicates that the position has changed.

◆ wlmtk_window_request_close()

void wlmtk_window_request_close ( wlmtk_window_t window_ptr)

Requests to close the window.

Parameters
window_ptr

◆ wlmtk_window_request_fullscreen()

void wlmtk_window_request_fullscreen ( wlmtk_window_t window_ptr,
bool  fullscreen 
)

Requests the window to be fullscreen (or end fullscreen).

Parameters
window_ptr
fullscreen

◆ wlmtk_window_request_maximized()

void wlmtk_window_request_maximized ( wlmtk_window_t window_ptr,
bool  maximized 
)

Requests the window to be maximized (or end maximized).

Guarantees to emit a wlmtk_window_events_t::request_maximized signal, either with the provided maximized value, or with what the compositor deems acceptable.

Parameters
window_ptr
maximized

◆ wlmtk_window_request_minimize()

void wlmtk_window_request_minimize ( wlmtk_window_t window_ptr)

Requests to minimize (iconify) the window.

Parameters
window_ptr

◆ wlmtk_window_request_shaded()

void wlmtk_window_request_shaded ( wlmtk_window_t window_ptr,
bool  shaded 
)

Requests the window to be shaded (rolled up) or not.

Parameters
window_ptr
shaded

◆ wlmtk_window_request_size()

void wlmtk_window_request_size ( wlmtk_window_t window_ptr,
const struct wlr_box *  box_ptr 
)

Requests the window's size to be updated.

Parameters
window_ptr
box_ptrOnly the width and height are considered.

◆ wlmtk_window_set_activated()

void wlmtk_window_set_activated ( wlmtk_window_t window_ptr,
bool  activated 
)

Sets the window as activated, depending on the argument's value.

An activated window will have keyboard focus and would have distinct decorations to indicate state.

Parameters
window_ptr
activated

◆ wlmtk_window_set_client()

void wlmtk_window_set_client ( wlmtk_window_t window_ptr,
const wlmtk_util_client_t client_ptr 
)

Sets client information for the window.

Parameters
window_ptr
client_ptrThe client's information will be copied into wlmtk_window_t::client, and does not need to outlive this call.

◆ wlmtk_window_set_options()

void wlmtk_window_set_options ( wlmtk_window_t window_ptr,
uint32_t  move_modifier 
)

Sets window options (currently: the modifier to move when dragging).

Parameters
window_ptr
move_modifier

◆ wlmtk_window_set_preferred_wlr_output()

void wlmtk_window_set_preferred_wlr_output ( wlmtk_window_t window_ptr,
struct wlr_output *  wlr_output_ptr 
)

Sets the WLR output for the window. Used for fullscreen requests.

See also wlmtk_window_get_wlr_output.

Parameters
window_ptr
wlr_output_ptrOutput to consider when requesting a window as fullscreen. Can be NULL to indicate no preference.

◆ wlmtk_window_set_properties()

void wlmtk_window_set_properties ( wlmtk_window_t window_ptr,
uint32_t  properties 
)

Sets properties for the window.

Parameters
window_ptr
properties
See also
wlmtk_window_property_t.

◆ wlmtk_window_set_resize_edges()

void wlmtk_window_set_resize_edges ( wlmtk_window_t window_ptr,
uint32_t  edges 
)

Sets the resizing edges. Keeps the opposite edges firm when resizing.

Parameters
window_ptr
edges

◆ wlmtk_window_set_server_side_decorated()

void wlmtk_window_set_server_side_decorated ( wlmtk_window_t window_ptr,
bool  decorated 
)

Sets whether to have server-side decorations for this window.

Parameters
window_ptr
decorated

◆ wlmtk_window_set_style()

bool wlmtk_window_set_style ( wlmtk_window_t window_ptr,
wlmtk_window_style_ref_t style_ref_ptr,
wlmtk_menu_style_ref_t menu_style_ref_ptr 
)

Applies the style held by the reference.

Parameters
window_ptr
style_ref_ptr
menu_style_ref_ptr
Returns
true on success.

◆ wlmtk_window_set_title()

bool wlmtk_window_set_title ( wlmtk_window_t window_ptr,
const char *  title_ptr 
)

Sets the title for the window.

If title_ptr is NULL, a generic name is set.

Parameters
window_ptr
title_ptrMay be NULL.
Returns
true on success.

◆ wlmtk_window_set_workspace()

void wlmtk_window_set_workspace ( wlmtk_window_t window_ptr,
wlmtk_workspace_t workspace_ptr 
)

Sets wlmtk_window_t::workspace_ptr.

Protected method, to be called only from wlmtk_workspace_t.

Parameters
window_ptr
workspace_ptr

◆ wlmtk_window_style_create()

struct wlmtk_window_style * wlmtk_window_style_create ( void  )

Creates a holder for the window style, with initialized reference.

Returns
Pointer to wlmtk_window_style. To destroy, call wlmtk_window_style_ref_release on wlmtk_window_style_to_ref.

◆ wlmtk_window_style_decode()

bool wlmtk_window_style_decode ( bspl_object_t *  object_ptr,
const union bspl_desc_value *  desc_value_ptr,
void *  value_ptr 
)

Decodes dict at object_ptr into wlmtk_window_style at value_ptr

◆ wlmtk_window_style_decode_fini()

void wlmtk_window_style_decode_fini ( void *  dst_ptr)

Fini.

◆ wlmtk_window_style_decode_init()

bool wlmtk_window_style_decode_init ( void *  dst_ptr)

Initializer.

◆ wlmtk_window_style_ref_release()

void wlmtk_window_style_ref_release ( wlmtk_window_style_ref_t ref_ptr)

Releases a reference.

◆ wlmtk_window_style_ref_retain()

const struct wlmtk_window_style * wlmtk_window_style_ref_retain ( wlmtk_window_style_ref_t ref_ptr)

Retains a reference.

Returns
a read-only style.

◆ wlmtk_window_style_to_ref()

wlmtk_window_style_ref_t * wlmtk_window_style_to_ref ( struct wlmtk_window_style window_style_ptr)
Returns
the wlmtk_window_style_ref_t for the style.

Variable Documentation

◆ _wlmtk_window_content_container_element_vmt

const wlmtk_element_vmt_t _wlmtk_window_content_container_element_vmt
static
Initial value:
= {
}
static void _wlmtk_window_container_element_get_dimensions(wlmtk_element_t *element_ptr, int *x1_ptr, int *y1_ptr, int *x2_ptr, int *y2_ptr)
Definition window.c:970

Virtual method table for the window's content superclass element.

◆ _wlmtk_window_style_desc

const bspl_desc_t _wlmtk_window_style_desc[]
static
Initial value:
= {
BSPL_DESC_DICT(
"TitleBar", true, struct wlmtk_window_style, titlebar, titlebar,
BSPL_DESC_DICT(
"ResizeBar", true, struct wlmtk_window_style, resizebar, resizebar,
BSPL_DESC_DICT(
"Border", true, struct wlmtk_window_style, border, border,
BSPL_DESC_DICT(
"Margin", true, struct wlmtk_window_style, margin, margin,
}
const bspl_desc_t wlmtk_resizebar_style_desc[]
Definition resizebar.c:79
Definition window.h:99
const bspl_desc_t wlmtk_style_margin_desc[]
Definition style.c:29
const bspl_desc_t wlmtk_titlebar_style_desc[]
Definition titlebar.c:92

Descriptor for decoding the "Window" dictionary.

◆ _wlmtk_window_test_cases

const bs_test_case_t _wlmtk_window_test_cases[]
static
Initial value:
= {
{ 1, "create_destroy", test_create_destroy },
{ 1, "decoration", test_decoration },
{ 1, "events", test_events },
{ 1, "set_activated", test_set_activated },
{ 1, "resize", test_resize },
{ 1, "fullscreen", test_fullscreen },
{ 1, "fullscreen_preferred_output", test_fullscreen_preferred_output },
{ 1, "fullscreen_unmap", test_fullscreen_unmap },
{ 1, "maximized", test_maximized },
{ 1, "shaded", test_shaded },
{ 1, "modifier_move", test_modifier_move },
{ 1, "menu", test_menu },
{ 1, "style", test_style },
{ 1, "style_decode", test_style_decode },
}
static const struct wlmtk_margin_style test_style
Definition bordered.c:250
static void test_events(bs_test_t *test_ptr)
Definition window.c:1487
static void test_menu(bs_test_t *test_ptr)
Definition window.c:2222
static void test_decoration(bs_test_t *test_ptr)
Definition window.c:1402
static void test_resize(bs_test_t *test_ptr)
Definition window.c:1541
static void test_shaded(bs_test_t *test_ptr)
Definition window.c:2062
static void test_create_destroy(bs_test_t *test_ptr)
Definition window.c:1339
static void test_fullscreen(bs_test_t *test_ptr)
Definition window.c:1607
static void test_modifier_move(bs_test_t *test_ptr)
Definition window.c:2127
static void test_style_decode(bs_test_t *test_ptr)
Definition window.c:2275
static void test_fullscreen_unmap(bs_test_t *test_ptr)
Definition window.c:1826
static void test_set_activated(bs_test_t *test_ptr)
Definition window.c:1508
static void test_fullscreen_preferred_output(bs_test_t *test_ptr)
Definition window.c:1747
static void test_maximized(bs_test_t *test_ptr)
Definition window.c:1907

Test cases

◆ _wlmtk_window_test_menu_style

const struct wlmtk_menu_style _wlmtk_window_test_menu_style
static
Initial value:
= {
.item = {
.height = 20,
.width = 100
}
}

Menu style used as default for testing windows.

◆ _wlmtk_window_test_style_holder

struct wlmtk_window_style_holder _wlmtk_window_test_style_holder
static
Initial value:
= {
.wsr = { .reference = { .count = 1 } },
.style = {
.titlebar = { .height = 10 },
.resizebar = { .height = 5 },
.margin = { .width = 1 },
.border = { .width = 2 },
}
}

Window style used as default for testing, including a reference.

◆ window_element_vmt

const wlmtk_element_vmt_t window_element_vmt
static
Initial value:
= {
}
static bool _wlmtk_window_element_pointer_button(wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
Definition window.c:921
static void _wlmtk_window_element_layout(wlmtk_element_t *element_ptr)
Definition window.c:1002

Virtual method table for the window's element superclass.

◆ wlmtk_window_test_set

const bs_test_set_t wlmtk_window_test_set
Initial value:
= BS_TEST_SET(
true, "window", _wlmtk_window_test_cases)
static const bs_test_case_t _wlmtk_window_test_cases[]
Definition window.c:1281

Window unit test cases.