43 #ifndef LEGATO_BUTTON_H 44 #define LEGATO_BUTTON_H 48 #if LE_BUTTON_WIDGET_ENABLED == 1 76 typedef enum leButtonState
80 LE_BUTTON_STATE_TOGGLED
87 typedef struct leButtonWidget leButtonWidget;
100 typedef void (*leButtonWidget_PressedEvent)(leButtonWidget*);
113 typedef void (*leButtonWidget_ReleasedEvent)(leButtonWidget*);
122 typedef struct leButtonWidget leButtonWidget;
124 #define LE_BUTTONWIDGET_VTABLE(THIS_TYPE) \ 125 LE_WIDGET_VTABLE(THIS_TYPE) \ 127 leBool (*getToggleable)(const THIS_TYPE* _this); \ 128 leResult (*setToggleable)(THIS_TYPE* _this, leBool toggleable); \ 129 leBool (*getPressed)(const THIS_TYPE* _this); \ 130 leResult (*setPressed)(THIS_TYPE* _this, leBool pressed); \ 131 leString* (*getString)(const THIS_TYPE* _this); \ 132 leResult (*setString)(THIS_TYPE* _this, const leString* str); \ 133 leImage* (*getPressedImage)(const THIS_TYPE* _this); \ 134 leResult (*setPressedImage)(THIS_TYPE* _this, leImage* img); \ 135 leImage* (*getReleasedImage)(const THIS_TYPE* _this); \ 136 leResult (*setReleasedImage)(THIS_TYPE* _this, leImage* img); \ 137 leRelativePosition (*getImagePosition)(const THIS_TYPE* _this); \ 138 leResult (*setImagePosition)(THIS_TYPE* _this, leRelativePosition pos); \ 139 uint32_t (*getImageMargin)(const THIS_TYPE* _this); \ 140 leResult (*setImageMargin)(THIS_TYPE* _this, uint32_t mg); \ 141 int32_t (*getPressedOffset)(const THIS_TYPE* _this); \ 142 leResult (*setPressedOffset)(THIS_TYPE* _this, int32_t offs); \ 143 leButtonWidget_PressedEvent (*getPressedEventCallback)(const THIS_TYPE* _this); \ 144 leResult (*setPressedEventCallback)(THIS_TYPE* _this, leButtonWidget_PressedEvent cb); \ 145 leButtonWidget_ReleasedEvent (*getReleasedEventCallback)(const THIS_TYPE* _this); \ 146 leResult (*setReleasedEventCallback)(THIS_TYPE* _this, leButtonWidget_ReleasedEvent cb); \ 149 typedef struct leButtonWidgetVTable
151 LE_BUTTONWIDGET_VTABLE(leButtonWidget)
152 } leButtonWidgetVTable;
179 typedef struct leButtonWidget
183 const leButtonWidgetVTable* fn;
194 uint32_t imageMargin;
195 int32_t pressedOffset;
197 leButtonWidget_PressedEvent pressedEvent;
198 leButtonWidget_ReleasedEvent releasedEvent;
218 leButtonWidget* leButtonWidget_New(
void);
230 void leButtonWidget_Constructor(leButtonWidget* wgt);
233 #define THIS_TYPE struct leWidget 245 virtual leBool getToggleable(
const leButtonWidget* _this);
260 virtual leResult setToggleable(leButtonWidget* _this,
273 virtual leBool getPressed(
const leButtonWidget* _this);
288 virtual leResult setPressed(leButtonWidget* _this,
302 virtual leString* getString(
const leButtonWidget* _this);
318 virtual leResult setString(leButtonWidget* _this,
331 virtual leImage* getPressedImage(
const leButtonWidget* _this);
347 virtual leResult setPressedImage(leButtonWidget* _this,
361 virtual leImage* getReleasedImage(
const leButtonWidget* _this);
376 virtual leResult setReleasedImage(leButtonWidget* _this,
406 virtual leResult setImagePosition(leButtonWidget* _this,
419 virtual uint32_t getImageMargin(
const leButtonWidget* _this);
434 virtual leResult setImageMargin(leButtonWidget* _this,
449 virtual int32_t getPressedOffset(
const leButtonWidget* _this);
465 virtual leResult setPressedOffset(leButtonWidget* _this,
478 virtual leButtonWidget_PressedEvent getPressedEventCallback(
const leButtonWidget* _this);
493 virtual leResult setPressedEventCallback(leButtonWidget* _this,
494 leButtonWidget_PressedEvent cb);
506 virtual leButtonWidget_ReleasedEvent getReleasedEventCallback(
const leButtonWidget* _this);
522 virtual leResult setReleasedEventCallback(leButtonWidget* _this,
523 leButtonWidget_ReleasedEvent cb);
Common macros and definitions used by Legato.
Image functions and defintions.
Definition: legato_image.h:181
This struct represents a string.
Definition: legato_string.h:107
leResult
This enum represents function call results.
Definition: legato_common.h:123
leRelativePosition
This enum represents the relative position modes for objects.
Definition: legato_common.h:302
leBool
This enum represents booleans.
Definition: legato_common.h:146
Fixed string functions and definitions.