20#ifndef __WLMTK_ELEMENT_H__
21#define __WLMTK_ELEMENT_H__
23#include <libbase/libbase.h>
27#include <wayland-server-core.h>
28#include <xkbcommon/xkbcommon.h>
30#define WLR_USE_UNSTABLE
31#include <wlr/util/box.h>
32#undef WLR_USE_UNSTABLE
44struct wlr_keyboard_key_event;
48#define WLR_USE_UNSTABLE
49#include <wlr/types/wlr_pointer.h>
50#undef WLR_USE_UNSTABLE
59 struct wl_signal pointer_enter;
61 struct wl_signal pointer_leave;
63 struct wl_signal pointer_motion;
72 struct wlr_scene_node *(*create_scene_node)(
74 struct wlr_scene_tree *wlr_scene_tree_ptr);
134 struct wlr_pointer_axis_event *wlr_pointer_axis_event_ptr);
157 struct wlr_keyboard_key_event *wlr_keyboard_key_event_ptr);
176 enum xkb_key_direction direction,
261 bs_dllist_node_t *dlnode_ptr);
348 element_ptr, left_ptr, top_ptr, right_ptr, bottom_ptr);
363 element_ptr->vmt.get_dimensions(
364 element_ptr, &box.x, &box.y, &box.width, &box.height);
406 struct wlr_pointer_axis_event *wlr_pointer_axis_event_ptr);
444 struct wlr_keyboard_key_event *wlr_keyboard_key_event_ptr)
447 element_ptr, wlr_keyboard_key_event_ptr);
454 enum xkb_key_direction direction,
458 element_ptr, keysym, direction, modifiers);
492 struct wlr_box dimensions;
513 struct wlr_pointer_axis_event wlr_pointer_axis_event;
535 int width,
int height);
void wlmtk_fake_element_grab_keyboard(wlmtk_fake_element_t *fake_element_ptr)
Definition element.c:501
bool wlmtk_element_init(wlmtk_element_t *element_ptr)
Definition element.c:72
wlmtk_fake_element_t * wlmtk_fake_element_create(void)
Definition element.c:470
static void wlmtk_element_get_dimensions(wlmtk_element_t *element_ptr, int *left_ptr, int *top_ptr, int *right_ptr, int *bottom_ptr)
Definition element.h:340
void wlmtk_element_fini(wlmtk_element_t *element_ptr)
Definition element.c:131
void wlmtk_element_pointer_grab_cancel(wlmtk_element_t *element_ptr)
Definition element.c:348
bool wlmtk_element_pointer_motion(wlmtk_element_t *element_ptr, wlmtk_pointer_motion_event_t *pointer_motion_ptr)
Definition element.c:264
bs_dllist_node_t * wlmtk_dlnode_from_element(wlmtk_element_t *element_ptr)
Definition element.c:142
static struct wlr_box wlmtk_element_get_dimensions_box(wlmtk_element_t *element_ptr)
Definition element.h:359
static void wlmtk_element_destroy(wlmtk_element_t *element_ptr)
Definition element.h:477
bool wlmtk_element_pointer_focus(wlmtk_element_t *element_ptr, wlmtk_pointer_motion_event_t *motion_event_ptr)
Definition element.c:310
const bs_test_case_t wlmtk_element_test_cases[]
Definition element.c:653
wlmtk_element_t * wlmtk_element_from_dlnode(bs_dllist_node_t *dlnode_ptr)
Definition element.c:149
void wlmtk_element_attach_to_scene_graph(wlmtk_element_t *element_ptr)
Definition element.c:166
static bool wlmtk_element_keyboard_sym(wlmtk_element_t *element_ptr, xkb_keysym_t keysym, enum xkb_key_direction direction, uint32_t modifiers)
Definition element.h:451
bool wlmtk_element_pointer_button(wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
Definition element.c:292
void wlmtk_element_pointer_blur(wlmtk_element_t *element_ptr)
Definition element.c:333
wlmtk_element_vmt_t wlmtk_element_extend(wlmtk_element_t *element_ptr, const wlmtk_element_vmt_t *element_vmt_ptr)
Definition element.c:87
void wlmtk_element_set_position(wlmtk_element_t *element_ptr, int x, int y)
Definition element.c:243
void wlmtk_element_set_visible(wlmtk_element_t *element_ptr, bool visible)
Definition element.c:210
bool wlmtk_element_pointer_axis(wlmtk_element_t *element_ptr, struct wlr_pointer_axis_event *wlr_pointer_axis_event_ptr)
Definition element.c:300
void wlmtk_element_set_parent_container(wlmtk_element_t *element_ptr, wlmtk_container_t *parent_container_ptr)
Definition element.c:156
void wlmtk_element_get_position(wlmtk_element_t *element_ptr, int *x_ptr, int *y_ptr)
Definition element.c:227
static bool wlmtk_element_keyboard_event(wlmtk_element_t *element_ptr, struct wlr_keyboard_key_event *wlr_keyboard_key_event_ptr)
Definition element.h:442
static void wlmtk_element_keyboard_blur(wlmtk_element_t *element_ptr)
Definition element.h:462
void wlmtk_fake_element_set_dimensions(wlmtk_fake_element_t *fake_element_ptr, int width, int height)
Definition element.c:488
Definition container.h:55
wlmtk_element_vmt_t vmt
Definition element.h:186
bool pointer_inside
Definition element.h:221
bool visible
Definition element.h:218
bs_dllist_node_t dlnode
Definition element.h:183
int y
Definition element.h:215
bool inhibit_pointer_blur
Definition element.h:224
struct wlr_scene_node * wlr_scene_node_ptr
Definition element.h:194
struct wl_listener wlr_scene_node_destroy_listener
Definition element.h:197
wlmtk_pointer_motion_event_t last_pointer_motion_event
Definition element.h:200
wlmtk_container_t * parent_container_ptr
Definition element.h:191
wlmtk_element_events_t events
Definition element.h:188
int x
Definition element.h:209
bool(* keyboard_sym)(wlmtk_element_t *element_ptr, xkb_keysym_t keysym, enum xkb_key_direction direction, uint32_t modifiers)
Definition element.h:173
void(* pointer_grab_cancel)(wlmtk_element_t *element_ptr)
Definition element.h:110
void(* get_dimensions)(wlmtk_element_t *element_ptr, int *x1_ptr, int *y1_ptr, int *x2_ptr, int *y2_ptr)
Definition element.h:77
void(* keyboard_blur)(wlmtk_element_t *element_ptr)
Definition element.h:142
bool(* keyboard_event)(wlmtk_element_t *element_ptr, struct wlr_keyboard_key_event *wlr_keyboard_key_event_ptr)
Definition element.h:155
bool(* pointer_button)(wlmtk_element_t *element_ptr, const wlmtk_button_event_t *button_event_ptr)
Definition element.h:120
bool(* pointer_axis)(wlmtk_element_t *element_ptr, struct wlr_pointer_axis_event *wlr_pointer_axis_event_ptr)
Definition element.h:132
void(* destroy)(wlmtk_element_t *element_ptr)
Definition element.h:69
bool(* pointer_accepts_motion)(wlmtk_element_t *element_ptr, wlmtk_pointer_motion_event_t *motion_event_ptr)
Definition element.h:96
bool pointer_grab_cancel_called
Definition element.h:504
bool keyboard_event_called
Definition element.h:508
bool has_keyboard_focus
Definition element.h:506
bool pointer_button_called
Definition element.h:498
wlmtk_element_vmt_t orig_vmt
Definition element.h:490
bool pointer_axis_called
Definition element.h:502
bool keyboard_sym_called
Definition element.h:510
wlmtk_element_t element
Definition element.h:488
wlmtk_button_event_t pointer_button_event
Definition element.h:500
bool pointer_accepts_motion_called
Definition element.h:495