libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xmenu_private.h
Go to the documentation of this file.
1 /*
2  * 0BSD
3  *
4  * BSD Zero Clause License
5  *
6  * Copyright (c) 2019 Hermann Meyer
7  *
8  * Permission to use, copy, modify, and/or distribute this software for any
9  * purpose with or without fee is hereby granted.
10 
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  *
19  */
20 
21 #pragma once
22 
23 #ifndef XMENU_PRIVATE_H_
24 #define XMENU_PRIVATE_H_
25 
26 #include "xmenu.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /**
33  * @brief _draw_menu_label - draw the menu label on expose call
34  * @param *w_ - the menu to draw
35  * @param *user_data - attached user_data
36  * @return void
37  */
38 
39 void _draw_menu_label(void *w_, void* user_data);
40 
41 /**
42  * @brief _check_menu_state - follow the mouse pointer when a menu is active
43  * @param *w_ - the menu to check
44  * @param *user_data - attached user_data
45  * @return void
46  */
47 
48 void _check_menu_state(void *w_, void* user_data);
49 
50 /**
51  * @brief _menu_released - popup the menu on click
52  * @param *w_ - void pointer to the Widget_t button
53  * @param *button - void pointer to XEvent.xbutton struct
54  * @param *user_data - void pointer to attached user_data
55  * @return void
56  */
57 
58 void _menu_released(void *w_, void* button_, void* user_data);
59 
60 /**
61  * @brief _menu_entry_released - the menu release func
62  * @param *w_ - void pointer to the Widget_t menu
63  * @param *item - void pointer to the selected item *(int*)
64  * @param *user_data - void pointer to the item label *(const char**)
65  * @return void
66  */
67 
68 void _menu_entry_released(void *w_, void* item_, void* user_data);
69 
70 /**
71  * @brief _draw_menu - draw menu on expose call
72  * @param *w_ - the menu to draw
73  * @param *user_data - attached user_data
74  * @return void
75  */
76 
77 void _draw_menu(void *w_, void* user_data);
78 
79 /**
80  * @brief _draw_item - draw item on expose call
81  * @param *w_ - the item to draw
82  * @param *user_data - attached user_data
83  * @return void
84  */
85 
86 void _draw_item(void *w_, void* user_data);
87 
88 /**
89  * @brief _draw_accel_item - draw accel item on expose call
90  * @param *w_ - the item to draw
91  * @param *user_data - attached user_data
92  * @return void
93  */
94 
95 void _draw_accel_item(void *w_, void* user_data);
96 
97 /**
98  * @brief _draw_check_item - draw item on expose call
99  * @param *w_ - the item to draw
100  * @param *user_data - attached user_data
101  * @return void
102  */
103 
104 void _draw_check_item(void *w_, void* user_data);
105 
106 /**
107  * @brief _draw_viewslider - draw a slider on the viewport
108  * to indicate the view point
109  * @param *w_ - void pointer to view_port
110  * @param *user_data - attached user_data
111  * @return void
112  */
113 
114 void _draw_viewslider(void *w_, void* user_data);
115 
116 /**
117  * @brief _set_viewpoint - move the view_port to position
118  * @param *w_ - void pointer to view_port
119  * @param *user_data - attached user_data
120  * @return void
121  */
122 
123 void _set_viewpoint(void *w_, void* user_data);
124 
125 /**
126  * @brief _check_item_button_pressed - redraw item on button press
127  * @param *button - the xbutton which is pressed
128  * @param *user_data - attached user_data
129  * @return void
130  */
131 
132 void _check_item_button_pressed(void *w_, void* button_, void* user_data);
133 
134 /**
135  * @brief _radio_item_button_pressed - redraw item on button press
136  * @param *button - the xbutton which is pressed
137  * @param *user_data - attached user_data
138  * @return void
139  */
140 
141 void _radio_item_button_pressed(void *w_, void* button_, void* user_data);
142 
143 /**
144  * @brief _configure_menu - set final size and position of menu to a Widget_t
145  * @param *parent - pointer to the Widget_t the menu should pop over
146  * @param *menu - the menu to show
147  * @return void
148  */
149 
150 void _configure_menu(Widget_t *parent, Widget_t *menu, int elem, bool above);
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif //XMENU_PRIVATE_H_
_draw_check_item
void _draw_check_item(void *w_, void *user_data)
_draw_check_item - draw item on expose call
Definition: xmenu_private.c:210
_radio_item_button_pressed
void _radio_item_button_pressed(void *w_, void *button_, void *user_data)
_radio_item_button_pressed - redraw item on button press
Definition: xmenu_private.c:274
_draw_viewslider
void _draw_viewslider(void *w_, void *user_data)
_draw_viewslider - draw a slider on the viewport to indicate the view point
Definition: xmenu_private.c:234
_draw_menu_label
void _draw_menu_label(void *w_, void *user_data)
_draw_menu_label - draw the menu label on expose call
Definition: xmenu_private.c:44
_set_viewpoint
void _set_viewpoint(void *w_, void *user_data)
_set_viewpoint - move the view_port to position
Definition: xmenu_private.c:257
_draw_menu
void _draw_menu(void *w_, void *user_data)
_draw_menu - draw menu on expose call
Definition: xmenu_private.c:122
_check_item_button_pressed
void _check_item_button_pressed(void *w_, void *button_, void *user_data)
_check_item_button_pressed - redraw item on button press
Definition: xmenu_private.c:266
_configure_menu
void _configure_menu(Widget_t *parent, Widget_t *menu, int elem, bool above)
_configure_menu - set final size and position of menu to a Widget_t
Definition: xmenu_private.c:281
_draw_item
void _draw_item(void *w_, void *user_data)
_draw_item - draw item on expose call
Definition: xmenu_private.c:129
xmenu.h
_draw_accel_item
void _draw_accel_item(void *w_, void *user_data)
_draw_accel_item - draw accel item on expose call
Definition: xmenu_private.c:162
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
_menu_entry_released
void _menu_entry_released(void *w_, void *item_, void *user_data)
_menu_entry_released - the menu release func
Definition: xmenu_private.c:105
_menu_released
void _menu_released(void *w_, void *button_, void *user_data)
_menu_released - popup the menu on click
Definition: xmenu_private.c:97
_check_menu_state
void _check_menu_state(void *w_, void *user_data)
_check_menu_state - follow the mouse pointer when a menu is active
Definition: xmenu_private.c:78