GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
widgets
gp_widget_switch.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
29
#ifndef GP_WIDGET_SWITCH_H
30
#define GP_WIDGET_SWITCH_H
31
32
#include <
widgets/gp_widget_class_bool.h
>
33
#include <
widgets/gp_widget_stock.h
>
34
48
gp_widget
*
gp_widget_switch_new
(
const
char
*on_label,
gp_widget_stock_type
on_stock,
49
const
char
*off_label,
gp_widget_stock_type
off_stock,
50
bool
set);
51
67
static
inline
gp_widget
*
gp_widget_switch_new_ev
(
const
char
*on_label,
68
gp_widget_stock_type
on_stock,
69
const
char
*off_label,
70
gp_widget_stock_type
off_stock,
71
bool
set,
72
int
(*on_event)(
gp_widget_event
*ev),
73
void
*priv)
74
{
75
gp_widget
*ret =
gp_widget_switch_new
(on_label, on_stock, off_label, off_stock, set);
76
77
gp_widget_on_event_set
(ret, on_event, priv);
78
79
return
ret;
80
}
81
82
#endif
/* GP_WIDGET_SWITCH_H */
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_stock.h
A stock image widget.
gp_widget_stock_type
gp_widget_stock_type
Stock image type.
Definition
gp_widget_stock.h:34
gp_widget_switch_new_ev
static gp_widget * gp_widget_switch_new_ev(const char *on_label, gp_widget_stock_type on_stock, const char *off_label, gp_widget_stock_type off_stock, bool set, int(*on_event)(gp_widget_event *ev), void *priv)
Allocate and initialize new switch widget.
Definition
gp_widget_switch.h:67
gp_widget_switch_new
gp_widget * gp_widget_switch_new(const char *on_label, gp_widget_stock_type on_stock, const char *off_label, gp_widget_stock_type off_stock, bool set)
Allocate and initialize new switch widget.
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