GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_class_int.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
17#ifndef GP_WIDGET_CLASS_INT_H
18#define GP_WIDGET_CLASS_INT_H
19
20#include <core/gp_compiler.h>
21
31
32typedef struct gp_widget_int {
33 int64_t min;
34 int64_t max;
35 int64_t val;
36
37 int alert:1;
38 int dir:2;
39
40 char payload[] GP_ALIGNED;
41} gp_widget_class_int;
42
50#define GP_WIDGET_CLASS_INT(widget) ((gp_widget_class_int *)GP_WIDGET_PAYLOAD(widget))
51
59#define GP_WIDGET_CLASS_INT_PAYLOAD(widget) \
60 ((void*)(((gp_widget_class_int *)GP_WIDGET_PAYLOAD(widget))->payload))
61
70
79void gp_widget_int_set(gp_widget *self, int64_t min, int64_t max, int64_t val);
80
87void gp_widget_int_val_set(gp_widget *self, int64_t val);
88
95void gp_widget_int_max_set(gp_widget *self, int64_t max);
96
104
111void gp_widget_int_min_set(gp_widget *self, int64_t min);
112
120
128void gp_widget_int_set_range(gp_widget *self, int64_t min, int64_t max);
129
130#endif /* GP_WIDGET_CLASS_INT_H */
A compiler dependent macros.
int64_t gp_widget_int_min_get(gp_widget *self)
Gets an integer class widget minimum.
void gp_widget_int_set_range(gp_widget *self, int64_t min, int64_t max)
Sets an integer class widget limits.
void gp_widget_int_max_set(gp_widget *self, int64_t max)
Sets an integer class widget maximum.
int64_t gp_widget_int_val_get(gp_widget *self)
Returns an integer class widget value.
int64_t gp_widget_int_max_get(gp_widget *self)
Gets an integer class widget maximum.
gp_widget_int_flags
A widget int direction.
@ GP_WIDGET_VERT
Widget is vertical.
@ GP_WIDGET_HORIZ
Widget is horizontal.
void gp_widget_int_set(gp_widget *self, int64_t min, int64_t max, int64_t val)
Sets an integer class widget value and limits.
void gp_widget_int_val_set(gp_widget *self, int64_t val)
Sets an integer class widget value.
void gp_widget_int_min_set(gp_widget *self, int64_t min)
Sets an integer class widget minimum.
A widget base.
Definition gp_widget.h:29