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-2024 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
36#ifndef GP_WIDGET_BUTTON_H
37#define GP_WIDGET_BUTTON_H
38
40
142
148
158 enum gp_widget_button_type type);
159
160
172static 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
193
201
202#endif /* GP_WIDGET_BUTTON_H */
gp_widget_button_type
A button type.
@ GP_BUTTON_SETTINGS
A settings button.
@ GP_BUTTON_LABEL
Button with a label without specific type.
@ GP_BUTTON_ZOOM_OUT
A zoom out button.
@ GP_BUTTON_CLEAR
A clear button.
@ GP_BUTTON_OPEN
An open file or directory button.
@ GP_BUTTON_NO
A No button.
@ GP_BUTTON_SAVE
A save file button.
@ GP_BUTTON_FFORWARD
A fast forward button.
@ GP_BUTTON_FBACKWARD
A fast backward button.
@ GP_BUTTON_ROTATE_CW
A rotate clockwise button.
@ GP_BUTTON_DOWNLOAD
A download button.
@ GP_BUTTON_YES
A Yes button.
@ GP_BUTTON_LAST
A last button.
@ GP_BUTTON_TOP
A top button.
@ GP_BUTTON_BACKSPACE
A backspace button.
@ GP_BUTTON_UP
An arrow up button.
@ GP_BUTTON_ADD
An add button.
@ GP_BUTTON_ZOOM_NORMAL
A zoom normal button.
@ GP_BUTTON_PLAY
A play button.
@ GP_BUTTON_STOP
A stop button.
@ GP_BUTTON_PREV
A previous button.
@ GP_BUTTON_NEXT
A next button.
@ GP_BUTTON_DOWN
An arrow down button.
@ GP_BUTTON_ROTATE_CCW
A rotate counter clockwise button.
@ GP_BUTTON_STEP_FORWARD
A step forward button.
@ GP_BUTTON_REM
A remove button.
@ GP_BUTTON_PAUSE
A pause button.
@ GP_BUTTON_BOTTOM
A bottom button.
@ GP_BUTTON_OK
An OK button.
@ GP_BUTTON_HOME
A home (directory) button.
@ GP_BUTTON_RIGHT
An arrow right button.
@ GP_BUTTON_LEFT
An arrow left button.
@ GP_BUTTON_NEW_DIR
A create new directory button.
@ GP_BUTTON_ZOOM_FIT
A zoom fit button.
@ GP_BUTTON_RANDOMIZE
A randomize button.
@ GP_BUTTON_ZOOM_IN
A zoom in button.
@ GP_BUTTON_STEP_BACKWARD
A step backward button.
@ GP_BUTTON_REC
A record button.
@ GP_BUTTON_FIRST
A first button.
@ GP_BUTTON_CANCEL
A Cancel button.
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_button_event_type
A gp_widget_event::sub_type for a button widget.
@ GP_WIDGET_BUTTON_TRIGGER
Emitted when button is pressed.
gp_widget * gp_widget_button_new(const char *label, enum gp_widget_button_type type)
Allocates and initializes a new button widget.
A bollean widget class.
void gp_widget_on_event_set(gp_widget *self, int(*on_event)(gp_widget_event *), void *priv)
Sets a widget event handler.
Event structure passed to widget event handler.
A widget base.
Definition gp_widget.h:28