wlmaker
Loading...
Searching...
No Matches
menu_item.h
Go to the documentation of this file.
1/* ========================================================================= */
20#ifndef __WLMTK_MENU_ITEM_H__
21#define __WLMTK_MENU_ITEM_H__
22
23#include <libbase/libbase.h>
24#include <stdbool.h>
25#include <wayland-server-core.h>
26
27#include "element.h"
28#include "style.h"
29
32
33#include "menu.h" // IWYU pragma: keep
34
36typedef struct _wlmtk_menu_item_vmt_t wlmtk_menu_item_vmt_t;
37
39typedef enum {
40 WLMTK_MENU_ITEM_ENABLED,
41 WLMTK_MENU_ITEM_HIGHLIGHTED,
42 WLMTK_MENU_ITEM_DISABLED
44
46typedef struct {
48 struct wl_signal triggered;
50 struct wl_signal destroy;
52
53#ifdef __cplusplus
54extern "C" {
55#endif // __cplusplus
56
67 const wlmtk_menu_item_style_t *style_ptr);
68
75
78 wlmtk_menu_item_t *menu_item_ptr);
79
89 wlmtk_menu_item_t *menu_item_ptr,
90 wlmtk_menu_t *menu_ptr);
91
103 wlmtk_menu_item_t *menu_item_ptr,
104 wlmtk_menu_t *submenu_ptr);
105
114 wlmtk_menu_item_t *menu_item_ptr);
115
123 wlmtk_menu_item_t *menu_item_ptr,
124 enum wlmtk_menu_mode mode);
125
128 wlmtk_menu_item_t *menu_item_ptr);
129
132 wlmtk_menu_item_t *menu_item_ptr);
133
141 wlmtk_menu_item_t *menu_item_ptr,
142 const char *text_ptr);
143
151 wlmtk_menu_item_t *menu_item_ptr,
152 bool enabled);
153
163 wlmtk_menu_item_t *menu_item_ptr,
164 bool highlighted);
165
171void wlmtk_menu_item_trigger(wlmtk_menu_item_t *menu_item_ptr);
172
174bs_dllist_node_t *wlmtk_dlnode_from_menu_item(
175 wlmtk_menu_item_t *menu_item_ptr);
176
178wlmtk_menu_item_t *wlmtk_menu_item_from_dlnode(bs_dllist_node_t *dlnode_ptr);
179
182
184extern const bs_test_case_t wlmtk_menu_item_test_cases[];
185
186#ifdef __cplusplus
187} // extern "C"
188#endif // __cplusplus
189
190#endif /* __WLMTK_MENU_ITEM_H__ */
191/* == End of menu_item.h =================================================== */
wlmtk_menu_mode
Definition menu.h:54
struct _wlmtk_menu_item_vmt_t wlmtk_menu_item_vmt_t
Definition menu_item.h:36
wlmtk_menu_item_t * wlmtk_menu_item_create(const wlmtk_menu_item_style_t *style_ptr)
Definition menu_item.c:155
void wlmtk_menu_item_set_submenu(wlmtk_menu_item_t *menu_item_ptr, wlmtk_menu_t *submenu_ptr)
Definition menu_item.c:263
wlmtk_menu_item_state_t wlmtk_menu_item_get_state(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:327
wlmtk_menu_item_state_t
Definition menu_item.h:39
bool wlmtk_menu_item_set_highlighted(wlmtk_menu_item_t *menu_item_ptr, bool highlighted)
Definition menu_item.c:375
wlmtk_menu_item_events_t * wlmtk_menu_item_events(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:233
void wlmtk_menu_item_set_enabled(wlmtk_menu_item_t *menu_item_ptr, bool enabled)
Definition menu_item.c:348
wlmtk_menu_item_t * wlmtk_menu_item_from_dlnode(bs_dllist_node_t *dlnode_ptr)
Definition menu_item.c:418
bs_dllist_node_t * wlmtk_dlnode_from_menu_item(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:409
void wlmtk_menu_item_destroy(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:198
void wlmtk_menu_item_set_parent_menu(wlmtk_menu_item_t *menu_item_ptr, wlmtk_menu_t *menu_ptr)
Definition menu_item.c:240
wlmtk_element_t * wlmtk_menu_item_element(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:426
void wlmtk_menu_item_set_mode(wlmtk_menu_item_t *menu_item_ptr, enum wlmtk_menu_mode mode)
Definition menu_item.c:309
void wlmtk_menu_item_trigger(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:390
bool wlmtk_menu_item_set_text(wlmtk_menu_item_t *menu_item_ptr, const char *text_ptr)
Definition menu_item.c:334
const bs_test_case_t wlmtk_menu_item_test_cases[]
Definition menu_item.c:752
enum wlmtk_menu_mode wlmtk_menu_item_get_mode(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:320
wlmtk_menu_t * wlmtk_menu_item_get_submenu(wlmtk_menu_item_t *menu_item_ptr)
Definition menu_item.c:302
Definition element.h:181
Definition menu_item.c:39
Definition menu.c:37
Definition menu_item.h:46
Definition style.h:126