libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xbutton.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_H_
24 #define XBUTTON_H_
25 
26 #include "xputty.h"
27 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /**
34  * @brief add_button - add a button to a Widget_t
35  * connect to func.value_changed_callback to implement your actions
36  * @param *parent - pointer to the Widget_t request the button
37  * @param *label - Label to show on the button
38  * @param x,y,width,height - the position/geometry to create the button
39  * @return Widget_t* - pointer to the Widget_t button struct
40  */
41 
42 Widget_t* add_button(Widget_t *parent, const char * label,
43  int x, int y, int width, int height);
44 
45 /**
46  * @brief add_on_off_button - add a button with default on/off label to a Widget_t
47  * connect to func.value_changed_callback to implement your actions
48  * @param *parent - pointer to the Widget_t request the button
49  * @param *label - Label (ignored)
50  * @param x,y,width,height - the position/geometry to create the button
51  * @return Widget_t* - pointer to the Widget_t button struct
52  */
53 
54 Widget_t* add_on_off_button(Widget_t *parent, const char * label,
55  int x, int y, int width, int height);
56 
57 /**
58  * @brief add_toggle_button - add a button to a Widget_t
59  * connect to func.value_changed_callback to implement your actions
60  * @param *parent - pointer to the Widget_t request the button
61  * @param *label - Label to show on the button
62  * @param x,y,width,height - the position/geometry to create the button
63  * @return Widget_t* - pointer to the Widget_t button struct
64  */
65 
66 Widget_t* add_toggle_button(Widget_t *parent, const char * label,
67  int x, int y, int width, int height);
68 
69 /**
70  * @brief add_image_toggle_button - add a button to a Widget_t
71  * connect to func.value_changed_callback to implement your actions
72  * @param *parent - pointer to the Widget_t request the button
73  * @param *label - Label to show on the button
74  * @param x,y,width,height - the position/geometry to create the button
75  * @return Widget_t* - pointer to the Widget_t button struct
76  */
77 
78 Widget_t* add_image_toggle_button(Widget_t *parent, const char * label,
79  int x, int y, int width, int height);
80 
81 /**
82  * @brief add_switch_image_button - add a button to a Widget_t
83  * connect to func.value_changed_callback to implement your actions
84  * @param *parent - pointer to the Widget_t request the button
85  * @param *label - Label to show on the button
86  * @param x,y,width,height - the position/geometry to create the button
87  * @return Widget_t* - pointer to the Widget_t button struct
88  */
89 
90 Widget_t* add_switch_image_button(Widget_t *parent, const char * label,
91  int x, int y, int width, int height);
92 
93 /**
94  * @brief add_check_button - add a button to a Widget_t
95  * connect to func.value_changed_callback to implement your actions
96  * @param *parent - pointer to the Widget_t request the button
97  * @param *label - Label to show on the button
98  * @param x,y,width,height - the position/geometry to create the button
99  * @return Widget_t* - pointer to the Widget_t button struct
100  */
101 
102 Widget_t* add_check_button(Widget_t *parent, const char * label,
103  int x, int y, int width, int height);
104 
105 /**
106  * @brief add_check_box - add a check box to a Widget_t
107  * connect to func.value_changed_callback to implement your actions
108  * @param *parent - pointer to the Widget_t request the button
109  * @param *label - Label to show on the button
110  * @param x,y,width,height - the position/geometry to create the button
111  * @return Widget_t* - pointer to the Widget_t button struct
112  */
113 
114 Widget_t* add_check_box(Widget_t *parent, const char * label,
115  int x, int y, int width, int height);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif // XBUTTON_H_
add_switch_image_button
Widget_t * add_switch_image_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_switch_image_button - add a button to a Widget_t connect to func.value_changed_callback to implem...
Definition: xbutton.c:89
add_image_toggle_button
Widget_t * add_image_toggle_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_image_toggle_button - add a button to a Widget_t connect to func.value_changed_callback to implem...
Definition: xbutton.c:73
xputty.h
add_check_box
Widget_t * add_check_box(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_check_box - add a check box to a Widget_t connect to func.value_changed_callback to implement you...
Definition: xbutton.c:125
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
add_on_off_button
Widget_t * add_on_off_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_on_off_button - add a button with default on/off label to a Widget_t connect to func....
Definition: xbutton.c:42
add_toggle_button
Widget_t * add_toggle_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_toggle_button - add a button to a Widget_t connect to func.value_changed_callback to implement yo...
Definition: xbutton.c:57
add_check_button
Widget_t * add_check_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_check_button - add a button to a Widget_t connect to func.value_changed_callback to implement you...
Definition: xbutton.c:105
add_button
Widget_t * add_button(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_button - add a button to a Widget_t connect to func.value_changed_callback to implement your acti...
Definition: xbutton.c:26