GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
widgets
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-2024 Cyril Hrubis <metan@ucw.cz>
6
7
*/
8
36
#ifndef GP_WIDGET_BUTTON_H
37
#define GP_WIDGET_BUTTON_H
38
39
#include <
widgets/gp_widget_class_bool.h
>
40
44
enum
gp_widget_button_type
{
46
GP_BUTTON_LABEL
= 0,
47
49
GP_BUTTON_OK
,
51
GP_BUTTON_CANCEL
,
53
GP_BUTTON_YES
,
55
GP_BUTTON_NO
,
56
58
GP_BUTTON_OPEN
,
60
GP_BUTTON_SAVE
,
62
GP_BUTTON_NEW_DIR
,
63
65
GP_BUTTON_PREV
,
67
GP_BUTTON_NEXT
,
69
GP_BUTTON_FIRST
,
71
GP_BUTTON_LAST
,
73
GP_BUTTON_TOP
,
75
GP_BUTTON_BOTTOM
,
76
78
GP_BUTTON_PLAY
,
80
GP_BUTTON_PAUSE
,
82
GP_BUTTON_STOP
,
84
GP_BUTTON_REC
,
86
GP_BUTTON_FFORWARD
,
88
GP_BUTTON_FBACKWARD
,
90
GP_BUTTON_STEP_FORWARD
,
92
GP_BUTTON_STEP_BACKWARD
,
93
95
GP_BUTTON_RANDOMIZE
,
96
98
GP_BUTTON_UP
,
100
GP_BUTTON_DOWN
,
102
GP_BUTTON_LEFT
,
104
GP_BUTTON_RIGHT
,
105
107
GP_BUTTON_ADD
,
109
GP_BUTTON_REM
,
110
112
GP_BUTTON_CLEAR
,
114
GP_BUTTON_BACKSPACE
,
115
117
GP_BUTTON_ZOOM_IN
,
119
GP_BUTTON_ZOOM_OUT
,
121
GP_BUTTON_ZOOM_FIT
,
123
GP_BUTTON_ZOOM_NORMAL
,
124
126
GP_BUTTON_ROTATE_CW
,
128
GP_BUTTON_ROTATE_CCW
,
129
131
GP_BUTTON_SETTINGS
,
133
GP_BUTTON_HOME
,
135
GP_BUTTON_DOWNLOAD
,
136
137
GP_BUTTON_TYPE_MASK = 0x7fff,
138
GP_BUTTON_ALIGN_MASK = 0x8000,
139
GP_BUTTON_TEXT_LEFT = 0x8000,
140
GP_BUTTON_TEXT_RIGHT = 0x0000,
141
};
142
144
enum
gp_widget_button_event_type
{
146
GP_WIDGET_BUTTON_TRIGGER
,
147
};
148
157
gp_widget
*
gp_widget_button_new
(
const
char
*label,
158
enum
gp_widget_button_type
type);
159
160
172
static
inline
gp_widget
*
gp_widget_button_new2
(
const
char
*label,
173
enum
gp_widget_button_type
type,
174
int
(*on_event)(
gp_widget_event
*ev),
175
void
*priv)
176
{
177
gp_widget
*ret =
gp_widget_button_new
(label, type);
178
179
gp_widget_on_event_set
(ret, on_event, priv);
180
181
return
ret;
182
}
183
192
enum
gp_widget_button_type
gp_widget_button_type_get
(
gp_widget
*self);
193
200
void
gp_widget_button_type_set
(
gp_widget
*self,
enum
gp_widget_button_type
type);
201
209
const
char
*
gp_widget_button_label_get
(
gp_widget
*self);
210
211
#endif
/* GP_WIDGET_BUTTON_H */
gp_widget_button_type
gp_widget_button_type
A button type.
Definition
gp_widget_button.h:44
GP_BUTTON_SETTINGS
@ GP_BUTTON_SETTINGS
A settings button.
Definition
gp_widget_button.h:131
GP_BUTTON_LABEL
@ GP_BUTTON_LABEL
Button with a label without specific type.
Definition
gp_widget_button.h:46
GP_BUTTON_ZOOM_OUT
@ GP_BUTTON_ZOOM_OUT
A zoom out button.
Definition
gp_widget_button.h:119
GP_BUTTON_CLEAR
@ GP_BUTTON_CLEAR
A clear button.
Definition
gp_widget_button.h:112
GP_BUTTON_OPEN
@ GP_BUTTON_OPEN
An open file or directory button.
Definition
gp_widget_button.h:58
GP_BUTTON_NO
@ GP_BUTTON_NO
A No button.
Definition
gp_widget_button.h:55
GP_BUTTON_SAVE
@ GP_BUTTON_SAVE
A save file button.
Definition
gp_widget_button.h:60
GP_BUTTON_FFORWARD
@ GP_BUTTON_FFORWARD
A fast forward button.
Definition
gp_widget_button.h:86
GP_BUTTON_FBACKWARD
@ GP_BUTTON_FBACKWARD
A fast backward button.
Definition
gp_widget_button.h:88
GP_BUTTON_ROTATE_CW
@ GP_BUTTON_ROTATE_CW
A rotate clockwise button.
Definition
gp_widget_button.h:126
GP_BUTTON_DOWNLOAD
@ GP_BUTTON_DOWNLOAD
A download button.
Definition
gp_widget_button.h:135
GP_BUTTON_YES
@ GP_BUTTON_YES
A Yes button.
Definition
gp_widget_button.h:53
GP_BUTTON_LAST
@ GP_BUTTON_LAST
A last button.
Definition
gp_widget_button.h:71
GP_BUTTON_TOP
@ GP_BUTTON_TOP
A top button.
Definition
gp_widget_button.h:73
GP_BUTTON_BACKSPACE
@ GP_BUTTON_BACKSPACE
A backspace button.
Definition
gp_widget_button.h:114
GP_BUTTON_UP
@ GP_BUTTON_UP
An arrow up button.
Definition
gp_widget_button.h:98
GP_BUTTON_ADD
@ GP_BUTTON_ADD
An add button.
Definition
gp_widget_button.h:107
GP_BUTTON_ZOOM_NORMAL
@ GP_BUTTON_ZOOM_NORMAL
A zoom normal button.
Definition
gp_widget_button.h:123
GP_BUTTON_PLAY
@ GP_BUTTON_PLAY
A play button.
Definition
gp_widget_button.h:78
GP_BUTTON_STOP
@ GP_BUTTON_STOP
A stop button.
Definition
gp_widget_button.h:82
GP_BUTTON_PREV
@ GP_BUTTON_PREV
A previous button.
Definition
gp_widget_button.h:65
GP_BUTTON_NEXT
@ GP_BUTTON_NEXT
A next button.
Definition
gp_widget_button.h:67
GP_BUTTON_DOWN
@ GP_BUTTON_DOWN
An arrow down button.
Definition
gp_widget_button.h:100
GP_BUTTON_ROTATE_CCW
@ GP_BUTTON_ROTATE_CCW
A rotate counter clockwise button.
Definition
gp_widget_button.h:128
GP_BUTTON_STEP_FORWARD
@ GP_BUTTON_STEP_FORWARD
A step forward button.
Definition
gp_widget_button.h:90
GP_BUTTON_REM
@ GP_BUTTON_REM
A remove button.
Definition
gp_widget_button.h:109
GP_BUTTON_PAUSE
@ GP_BUTTON_PAUSE
A pause button.
Definition
gp_widget_button.h:80
GP_BUTTON_BOTTOM
@ GP_BUTTON_BOTTOM
A bottom button.
Definition
gp_widget_button.h:75
GP_BUTTON_OK
@ GP_BUTTON_OK
An OK button.
Definition
gp_widget_button.h:49
GP_BUTTON_HOME
@ GP_BUTTON_HOME
A home (directory) button.
Definition
gp_widget_button.h:133
GP_BUTTON_RIGHT
@ GP_BUTTON_RIGHT
An arrow right button.
Definition
gp_widget_button.h:104
GP_BUTTON_LEFT
@ GP_BUTTON_LEFT
An arrow left button.
Definition
gp_widget_button.h:102
GP_BUTTON_NEW_DIR
@ GP_BUTTON_NEW_DIR
A create new directory button.
Definition
gp_widget_button.h:62
GP_BUTTON_ZOOM_FIT
@ GP_BUTTON_ZOOM_FIT
A zoom fit button.
Definition
gp_widget_button.h:121
GP_BUTTON_RANDOMIZE
@ GP_BUTTON_RANDOMIZE
A randomize button.
Definition
gp_widget_button.h:95
GP_BUTTON_ZOOM_IN
@ GP_BUTTON_ZOOM_IN
A zoom in button.
Definition
gp_widget_button.h:117
GP_BUTTON_STEP_BACKWARD
@ GP_BUTTON_STEP_BACKWARD
A step backward button.
Definition
gp_widget_button.h:92
GP_BUTTON_REC
@ GP_BUTTON_REC
A record button.
Definition
gp_widget_button.h:84
GP_BUTTON_FIRST
@ GP_BUTTON_FIRST
A first button.
Definition
gp_widget_button.h:69
GP_BUTTON_CANCEL
@ GP_BUTTON_CANCEL
A Cancel button.
Definition
gp_widget_button.h:51
gp_widget_button_label_get
const char * gp_widget_button_label_get(gp_widget *self)
Gets a button label.
gp_widget_button_type_set
void gp_widget_button_type_set(gp_widget *self, enum gp_widget_button_type type)
Sets a button type.
gp_widget_button_type_get
enum gp_widget_button_type gp_widget_button_type_get(gp_widget *self)
Returns a button type.
gp_widget_button_new2
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.
Definition
gp_widget_button.h:172
gp_widget_button_event_type
gp_widget_button_event_type
A gp_widget_event::sub_type for a button widget.
Definition
gp_widget_button.h:144
GP_WIDGET_BUTTON_TRIGGER
@ GP_WIDGET_BUTTON_TRIGGER
Emitted when button is pressed.
Definition
gp_widget_button.h:146
gp_widget_button_new
gp_widget * gp_widget_button_new(const char *label, enum gp_widget_button_type type)
Allocates and initializes a new button widget.
gp_widget_class_bool.h
A bollean widget class.
gp_widget_on_event_set
void gp_widget_on_event_set(gp_widget *self, int(*on_event)(gp_widget_event *), void *priv)
Sets a widget event handler.
gp_widget_event
Event structure passed to widget event handler.
Definition
gp_widget_event.h:137
gp_widget
A widget base.
Definition
gp_widget.h:28
Generated by
1.9.8