libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xbutton_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 XBUTTON_PRIVATE_H_
24 #define XBUTTON_PRIVATE_H_
25 
26 #include "xbutton.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 /**
34  * @brief _rounded_rectangle - internal draw a rounded button
35  * @param x - point on x axis
36  * @param y - point on y axis
37  * @param width - the button width
38  * @param height - the button height
39  * @return void
40  */
41 
42 void _rounded_rectangle(cairo_t *cr,float x, float y, float width, float height);
43 
44 /**
45  * @brief _pattern_in - a little pattern to make press state more visible
46  * @param *w_ - void pointer to the Widget_t button
47  * @param st - the color state to use
48  * @param height - the button height
49  * @return void
50  */
51 
52 void _pattern_out(Widget_t *w, Color_state st, int height);
53 
54 /**
55  * @brief _pattern_in - a little pattern to make press state more visible
56  * @param *w_ - void pointer to the Widget_t button
57  * @param st - the color state to use
58  * @param height - the button height
59  * @return void
60  */
61 
62 void _pattern_in(Widget_t *w, Color_state st, int height);
63 
64 /**
65  * @brief _draw_ switch_image_button - internal draw the button to the buffer
66  * @param *w_ - void pointer to the Widget_t button
67  * @param *user_data - void pointer to attached user_data
68  * @return void
69  */
70 
71 void _draw_switch_image_button(void *w_, void* user_data);
72 
73 /**
74  * @brief _draw_button - internal draw the button to the buffer
75  * @param *w_ - void pointer to the Widget_t button
76  * @param *user_data - void pointer to attached user_data
77  * @return void
78  */
79 
80 void _draw_button(void *w_, void* user_data);
81 
82 /**
83  * @brief _draw_on_off_button - internal draw the on/off button to the buffer
84  * @param *w_ - void pointer to the Widget_t button
85  * @param *user_data - void pointer to attached user_data
86  * @return void
87  */
88 
89 void _draw_on_off_button(void *w_, void* user_data);
90 
91 /**
92  * @brief _draw_ti_button - internal draw the button to the buffer
93  * @param *w_ - void pointer to the Widget_t button
94  * @param *user_data - void pointer to attached user_data
95  * @return void
96  */
97 
98 void _draw_ti_button(void *w_, void* user_data);
99 
100 /**
101  * @brief _draw_check_button - internal draw the button to the buffer
102  * @param *w_ - void pointer to the Widget_t button
103  * @param *user_data - void pointer to attached user_data
104  * @return void
105  */
106 
107 void _draw_check_button(void *w_, void* user_data);
108 
109 /**
110  * @brief _draw_check_box - internal draw the check box to the buffer
111  * @param *w_ - void pointer to the Widget_t button
112  * @param *user_data - void pointer to attached user_data
113  * @return void
114  */
115 
116 void _draw_check_box(void *w_, void* user_data);
117 
118 /*---------------------------------------------------------------------
119 -----------------------------------------------------------------------
120  button
121 -----------------------------------------------------------------------
122 ----------------------------------------------------------------------*/
123 
124 /**
125  * @brief _button_pressed - redraw the button and send state via user_callback
126  * @param *w_ - void pointer to the Widget_t button
127  * @param *button - void pointer to XEvent.xbutton struct
128  * @param *user_data - void pointer to attached user_data
129  * @return void
130  */
131 
132 void _button_pressed(void *w_, void* button, void* user_data);
133 
134 /**
135  * @brief _button_released - redraw the button and send state via user_callback
136  * @param *w_ - void pointer to the Widget_t button
137  * @param *button - void pointer to XEvent.xbutton struct
138  * @param *user_data - void pointer to attached user_data
139  * @return void
140  */
141 
142 void _button_released(void *w_, void* button_, void* user_data);
143 
144 /*---------------------------------------------------------------------
145 -----------------------------------------------------------------------
146  toggle button
147 -----------------------------------------------------------------------
148 ----------------------------------------------------------------------*/
149 
150 /**
151  * @brief _toggle_button_pressed - redraw the button and send state via user_callback
152  * @param *w_ - void pointer to the Widget_t button
153  * @param *button - void pointer to XEvent.xbutton struct
154  * @param *user_data - void pointer to attached user_data
155  * @return void
156  */
157 
158 void _toggle_button_pressed(void *w_, void* button, void* user_data);
159 
160 /**
161  * @brief _toggle_button_released - redraw the button and send state via user_callback
162  * @param *w_ - void pointer to the Widget_t button
163  * @param *button - void pointer to XEvent.xbutton struct
164  * @param *user_data - void pointer to attached user_data
165  * @return void
166  */
167 
168 void _toggle_button_released(void *w_, void* button_, void* user_data);
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif // XBUTTON_PRIVATE_H_
_pattern_in
void _pattern_in(Widget_t *w, Color_state st, int height)
_pattern_in - a little pattern to make press state more visible
Definition: xbutton_private.c:46
_draw_check_button
void _draw_check_button(void *w_, void *user_data)
_draw_check_button - internal draw the button to the buffer
Definition: xbutton_private.c:310
_draw_on_off_button
void _draw_on_off_button(void *w_, void *user_data)
_draw_on_off_button - internal draw the on/off button to the buffer
Definition: xbutton_private.c:243
_pattern_out
void _pattern_out(Widget_t *w, Color_state st, int height)
_pattern_in - a little pattern to make press state more visible
Definition: xbutton_private.c:35
_draw_button
void _draw_button(void *w_, void *user_data)
_draw_button - internal draw the button to the buffer
Definition: xbutton_private.c:191
xbutton.h
_draw_switch_image_button
void _draw_switch_image_button(void *w_, void *user_data)
draw switch_image_button - internal draw the button to the buffer
Definition: xbutton_private.c:114
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
_button_released
void _button_released(void *w_, void *button_, void *user_data)
_button_released - redraw the button and send state via user_callback
Definition: xbutton_private.c:394
_button_pressed
void _button_pressed(void *w_, void *button, void *user_data)
_button_pressed - redraw the button and send state via user_callback
Definition: xbutton_private.c:389
_rounded_rectangle
void _rounded_rectangle(cairo_t *cr, float x, float y, float width, float height)
_rounded_rectangle - internal draw a rounded button
Definition: xbutton_private.c:25
_toggle_button_released
void _toggle_button_released(void *w_, void *button_, void *user_data)
_toggle_button_released - redraw the button and send state via user_callback
Definition: xbutton_private.c:411
_draw_ti_button
void _draw_ti_button(void *w_, void *user_data)
_draw_ti_button - internal draw the button to the buffer
Definition: xbutton_private.c:285
_toggle_button_pressed
void _toggle_button_pressed(void *w_, void *button, void *user_data)
_toggle_button_pressed - redraw the button and send state via user_callback
Definition: xbutton_private.c:406
_draw_check_box
void _draw_check_box(void *w_, void *user_data)
_draw_check_box - internal draw the check box to the buffer
Definition: xbutton_private.c:343
Color_state
Color_state
Color_state - select color mode to use on Widget_t.
Definition: xcolor.h:38