GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_button.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2023 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
14#ifndef GP_WIDGET_BUTTON_H
15#define GP_WIDGET_BUTTON_H
16
18
32
41
42 GP_BUTTON_OPEN,
43 GP_BUTTON_SAVE,
44 GP_BUTTON_NEW_DIR,
45
46 GP_BUTTON_PREV,
47 GP_BUTTON_NEXT,
48
49 GP_BUTTON_FIRST,
50 GP_BUTTON_LAST,
51 GP_BUTTON_TOP,
52 GP_BUTTON_BOTTOM,
53
54 GP_BUTTON_PLAY,
55 GP_BUTTON_PAUSE,
56 GP_BUTTON_STOP,
57 GP_BUTTON_REC,
58 GP_BUTTON_FFORWARD,
59 GP_BUTTON_FBACKWARD,
60 GP_BUTTON_STEP_FORWARD,
61 GP_BUTTON_STEP_BACKWARD,
62
63 GP_BUTTON_RANDOMIZE,
64
65 GP_BUTTON_UP,
66 GP_BUTTON_DOWN,
67 GP_BUTTON_LEFT,
68 GP_BUTTON_RIGHT,
69
70 GP_BUTTON_ADD,
71 GP_BUTTON_REM,
72
73 GP_BUTTON_CLEAR,
74 GP_BUTTON_BACKSPACE,
75
76 GP_BUTTON_ZOOM_IN,
77 GP_BUTTON_ZOOM_OUT,
78 GP_BUTTON_ZOOM_FIT,
79 GP_BUTTON_ZOOM_NORMAL,
80
81 GP_BUTTON_ROTATE_CW,
82 GP_BUTTON_ROTATE_CCW,
83
84 GP_BUTTON_SETTINGS,
85 GP_BUTTON_HOME,
86 GP_BUTTON_DOWNLOAD,
87
88 GP_BUTTON_TYPE_MASK = 0x7fff,
89 GP_BUTTON_ALIGN_MASK = 0x8000,
90 GP_BUTTON_TEXT_LEFT = 0x8000,
91 GP_BUTTON_TEXT_RIGHT = 0x0000,
92};
93
102gp_widget *gp_widget_button_new(const char *label,
103 enum gp_widget_button_type type);
104
105
117static inline gp_widget *gp_widget_button_new2(const char *label,
118 enum gp_widget_button_type type,
119 int (*on_event)(gp_widget_event *ev),
120 void *priv)
121{
122 gp_widget *ret = gp_widget_button_new(label, type);
123
124 gp_widget_on_event_set(ret, on_event, priv);
125
126 return ret;
127}
128
138
145void gp_widget_button_type_set(gp_widget *self, enum gp_widget_button_type type);
146
147#endif /* GP_WIDGET_BUTTON_H */
A bollean widget class.
gp_widget_button_type
A button type.
@ GP_BUTTON_LABEL
@ GP_BUTTON_NO
@ GP_BUTTON_YES
@ GP_BUTTON_OK
@ GP_BUTTON_CANCEL
void gp_widget_button_type_set(gp_widget *self, enum gp_widget_button_type type)
Sets a button type.
enum gp_widget_button_type gp_widget_button_type_get(gp_widget *self)
Returns a button type.
static gp_widget * gp_widget_button_new2(const char *label, enum gp_widget_button_type type, int(*on_event)(gp_widget_event *ev), void *priv)
Allocates a initialize new button widget.
gp_widget * gp_widget_button_new(const char *label, enum gp_widget_button_type type)
Allocates and initializes a new button widget.
Event structure passed to widget event handler.