GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A widget base. More...
#include <gp_widget.h>
Data Fields | |
unsigned int | type |
A widget type enum gp_widget_type. | |
unsigned int | widget_class |
A widget class enum gp_widget_class. | |
gp_widget * | parent |
Parent widget in the widget tree. | |
int(* | on_event )(gp_widget_event *) |
An application event handler. | |
void * | priv |
A pointer to arbitrary application data. | |
unsigned int | x |
A relative offset to the parent widget in pixels. | |
unsigned int | w |
Current widget size in pixels. | |
unsigned int | min_w |
Cached widget minimal size in pixel. | |
unsigned int | align:16 |
Widget alignment in parent container, enum gp_widget_alignment. | |
unsigned int | no_shrink:1 |
Widget no-shrink flag. | |
unsigned int | redraw:1 |
Internal widget repaint flag. | |
unsigned int | focused:1 |
Set if widget is focused. | |
unsigned int | resized:1 |
Internal widget resize flag. | |
unsigned int | no_events:1 |
Internal widget flag. | |
unsigned int | disabled:1 |
Internal disabled flag. | |
uint32_t | event_mask |
A mask to enable and disable a widget events. | |
char | payload_data [] |
Private widget data area. | |
A widget base.
Definition at line 28 of file gp_widget.h.
unsigned int gp_widget::disabled |
Internal disabled flag.
If set widget is 'grayed out' and no events are processed.
Definition at line 142 of file gp_widget.h.
uint32_t gp_widget::event_mask |
A mask to enable and disable a widget events.
This mask decides for which kind of enum gp_widget_event_type will be the gp_widget::on_event called.
Definition at line 150 of file gp_widget.h.
Referenced by gp_widget_send_event().
unsigned int gp_widget::no_events |
Internal widget flag.
If set the widget cannot get focused and will not process input events even if ops->event is implemented.
Definition at line 135 of file gp_widget.h.
unsigned int gp_widget::no_shrink |
Widget no-shrink flag.
If set widget will not shrink, i.e. will be resized only when the new minimal size is bigger than the previous one.
By default this is set to 0.
Definition at line 97 of file gp_widget.h.
int(* gp_widget::on_event) (gp_widget_event *) |
An application event handler.
This function is supplied by the application. Changes in widget state are propagated to the application by this function.
Definition at line 61 of file gp_widget.h.
Referenced by gp_widget_send_event(), and gp_widget_send_widget_event().
gp_widget* gp_widget::parent |
Parent widget in the widget tree.
It's set to NULL unless widget has been inserted into a container widget, e.g. grid, tabs, etc.
Definition at line 54 of file gp_widget.h.
char gp_widget::payload_data[] |
Private widget data area.
If widget is a class widget this points to the class structure, e.g. gp_widget_class_bool, otherwise it points to the widget private data.
Definition at line 161 of file gp_widget.h.
void* gp_widget::priv |
A pointer to arbitrary application data.
Useful for event handlers and other user defined functions. The library will not access or modify the memory pointed to by this.
Definition at line 69 of file gp_widget.h.
unsigned int gp_widget::redraw |
Internal widget repaint flag.
This flag is used internally by the widget code to mark it to be repainted.
Definition at line 106 of file gp_widget.h.
Referenced by gp_widget_should_redraw().
unsigned int gp_widget::resized |
Internal widget resize flag.
If set widget resize is schedulled before we attemp to repaint it.
Definition at line 127 of file gp_widget.h.
unsigned int gp_widget::type |
A widget type enum gp_widget_type.
Widget type e.g. button or text box. The type is used to locate the struct gp_widget_ops in a global widget ops table.
It's also used to assert that we are dealing with a correct widget in the API functions, e.g. button functions check that the widget type is set to button at the start of each function.
Definition at line 39 of file gp_widget.h.
Referenced by gp_widget_send_event(), and gp_widget_send_widget_event().
unsigned int gp_widget::widget_class |
A widget class enum gp_widget_class.
Widget classes define widgets with exacly same API but different UI and implementation. E.g. GP_WIDGET_CLASS_CHOICE can be rendered as a radio button or a spin button.
Definition at line 47 of file gp_widget.h.