47 #ifndef LEGATO_WIDGET_H 48 #define LEGATO_WIDGET_H 62 #define DEFAULT_BORDER_MARGIN 4
98 #if LE_ARC_WIDGET_ENABLED == 1 101 #if LE_BARGRAPH_WIDGET_ENABLED == 1 104 #if LE_BUTTON_WIDGET_ENABLED == 1 107 #if LE_CHECKBOX_WIDGET_ENABLED == 1 110 #if LE_CIRCLE_WIDGET_ENABLED == 1 113 #if LE_CIRCULARGAUGE_WIDGET_ENABLED == 1 114 LE_WIDGET_CIRCULAR_GAUGE,
116 #if LE_CIRCULARSLIDER_WIDGET_ENABLED == 1 117 LE_WIDGET_CIRCULAR_SLIDER,
119 #if LE_DRAWSURFACE_WIDGET_ENABLED == 1 120 LE_WIDGET_DRAWSURFACE,
122 #if LE_IMAGE_WIDGET_ENABLED == 1 125 #if LE_IMAGEROTATE_WIDGET_ENABLED == 1 126 LE_WIDGET_IMAGEROTATE,
128 #if LE_IMAGESCALE_WIDGET_ENABLED == 1 129 LE_WIDGET_IMAGESCALE,
131 #if LE_IMAGESEQUENCE_WIDGET_ENABLED == 1 132 LE_WIDGET_IMAGESEQUENCE,
134 #if LE_GRADIENT_WIDGET_ENABLED == 1 137 #if LE_GROUPBOX_WIDGET_ENABLED == 1 140 #if LE_KEYPAD_WIDGET_ENABLED == 1 && LE_BUTTON_WIDGET_ENABLED == 1 143 #if LE_LABEL_WIDGET_ENABLED == 1 146 #if LE_LINE_WIDGET_ENABLED == 1 149 #if LE_LINEGRAPH_WIDGET_ENABLED == 1 150 LE_WIDGET_LINE_GRAPH,
152 #if LE_LIST_WIDGET_ENABLED == 1 && LE_SCROLLBAR_WIDGET_ENABLED == 1 155 #if LE_LISTWHEEL_WIDGET_ENABLED == 1 158 #if LE_PIECHART_WIDGET_ENABLED == 1 161 #if LE_PROGRESSBAR_WIDGET_ENABLED == 1 162 LE_WIDGET_PROGRESSBAR,
164 #if LE_RADIALMENU_WIDGET_ENABLED == 1 165 LE_WIDGET_RADIAL_MENU,
167 #if LE_RADIOBUTTON_WIDGET_ENABLED == 1 168 LE_WIDGET_RADIOBUTTON,
170 #if LE_RECTANGLE_WIDGET_ENABLED == 1 173 #if LE_SCROLLBAR_WIDGET_ENABLED == 1 176 #if LE_SLIDER_WIDGET_ENABLED == 1 179 #if LE_TEXTFIELD_WIDGET_ENABLED == 1 182 #if LE_TOUCHTEST_WIDGET_ENABLED == 1 185 #if LE_WINDOW_WIDGET_ENABLED == 1 251 LE_WIDGET_BORDER_NONE,
252 LE_WIDGET_BORDER_LINE,
253 LE_WIDGET_BORDER_BEVEL,
254 LE_WIDGET_BORDER_LAST = LE_WIDGET_BORDER_BEVEL
280 LE_WIDGET_DIRTY_STATE_CLEAN,
281 LE_WIDGET_DIRTY_STATE_CHILD,
282 LE_WIDGET_DIRTY_STATE_DIRTY,
306 LE_WIDGET_DRAW_STATE_READY,
307 LE_WIDGET_DRAW_STATE_DONE,
479 #define LE_WIDGET_VTABLE(THIS_TYPE) \ 480 leWidgetType (*getType)(const THIS_TYPE* _this); \ 481 int32_t (*getX)(const THIS_TYPE* _this); \ 482 leResult (*setX)(THIS_TYPE* _this, int32_t x); \ 483 int32_t (*getY)(const THIS_TYPE* _this); \ 484 leResult (*setY)(THIS_TYPE* _this, int32_t y); \ 485 leResult (*setPosition)(THIS_TYPE* _this, int32_t x, int32_t y); \ 486 leResult (*translate)(THIS_TYPE* _this, int32_t x, int32_t y); \ 487 uint32_t (*getWidth)(const THIS_TYPE* _this); \ 488 leResult (*setWidth)(THIS_TYPE* _this, uint32_t w); \ 489 uint32_t (*getHeight)(const THIS_TYPE* _this); \ 490 leResult (*setHeight)(THIS_TYPE* _this, uint32_t h); \ 491 leResult (*setSize)(THIS_TYPE* _this, uint32_t w, uint32_t h); \ 492 leResult (*resize)(THIS_TYPE* _this, int32_t w, int32_t h); \ 493 leBool (*getAlphaEnabled)(const THIS_TYPE* _this); \ 494 leBool (*getCumulativeAlphaEnabled)(const THIS_TYPE* _this); \ 495 leResult (*setAlphaEnabled)(THIS_TYPE* _this, leBool enbl); \ 496 uint32_t (*getAlphaAmount)(const THIS_TYPE* _this); \ 497 uint32_t (*getCumulativeAlphaAmount)(const THIS_TYPE* _this); \ 498 leResult (*setAlphaAmount)(THIS_TYPE* _this, uint32_t a); \ 499 leBool (*isOpaque)(const THIS_TYPE* _this); \ 500 leBool (*getEnabled)(const THIS_TYPE* _this); \ 501 leResult (*setEnabled)(THIS_TYPE* _this, leBool enbl); \ 502 leBool (*getVisible)(const THIS_TYPE* _this); \ 503 leResult (*setVisible)(THIS_TYPE* _this, leBool vis); \ 504 void (*localRect)(const THIS_TYPE* _this, leRect* res); \ 505 void (*rectToParent)(const THIS_TYPE* _this, leRect* res); \ 506 void (*rectToScreen)(const THIS_TYPE* _this, leRect* res); \ 507 leResult (*addChild)(THIS_TYPE* _this, leWidget* chld); \ 508 leResult (*insertChild)(THIS_TYPE* _this, leWidget* chld, uint32_t idx); \ 509 leResult (*removeChild)(THIS_TYPE* _this, leWidget* chld); \ 510 leResult (*removeChildAt)(THIS_TYPE* _this, uint32_t idx); \ 511 void (*removeAllChildren)(THIS_TYPE* _this); \ 512 leResult (*setChildIndex)(THIS_TYPE* _this, leWidget* chld, uint32_t idx); \ 513 leWidget* (*getRootWidget)(const THIS_TYPE* _this); \ 514 leResult (*setParent)(THIS_TYPE* _this, leWidget* pnt); \ 515 uint32_t (*getChildCount)(const THIS_TYPE* _this); \ 516 leWidget* (*getChildAtIndex)(const THIS_TYPE* _this, uint32_t idx); \ 517 uint32_t (*getIndexOfChild)(const THIS_TYPE* _this, const leWidget* chld); \ 518 leBool (*containsDescendant)(const THIS_TYPE* _this, const leWidget* wgt); \ 519 leScheme* (*getScheme)(const THIS_TYPE* _this); \ 520 leResult (*setScheme)(THIS_TYPE* _this, const leScheme* schm); \ 521 leBorderType (*getBorderType)(const THIS_TYPE* _this); \ 522 leResult (*setBorderType)(THIS_TYPE* _this, leBorderType type); \ 523 leBackgroundType (*getBackgroundType)(const THIS_TYPE* _this); \ 524 leResult (*setBackgroundType)(THIS_TYPE* _this, leBackgroundType type); \ 525 leHAlignment (*getHAlignment)(const THIS_TYPE* _this); \ 526 leResult (*setHAlignment)(THIS_TYPE* _this, leHAlignment halgn); \ 527 leVAlignment (*getVAlignment)(const THIS_TYPE* _this); \ 528 leResult (*setVAlignment)(THIS_TYPE* _this, leVAlignment valgn); \ 529 leResult (*getMargins)(const THIS_TYPE* _this, leMargin* mg); \ 530 leResult (*setMargins)(THIS_TYPE* _this, uint32_t l, uint32_t t, uint32_t r, uint32_t b); \ 531 uint32_t (*getCornerRadius)(const THIS_TYPE* _this); \ 532 leResult (*setCornerRadius)(THIS_TYPE* _this, uint32_t rad); \ 533 leBool (*hasFocus)(const THIS_TYPE* _this); \ 534 leResult (*setFocus)(THIS_TYPE* _this); \ 536 void (*invalidate)(const THIS_TYPE* _this); \ 537 void (*invalidateContents)(const THIS_TYPE* _this); \ 538 leResult (*installEventFilter)(THIS_TYPE* _this, leWidgetEventFilter fltr); \ 539 leResult (*removeEventFilter)(THIS_TYPE* _this, leWidgetEventFilter fltr); \ 540 void (*update)(THIS_TYPE* _this, uint32_t dt); \ 542 void (*moveEvent)(THIS_TYPE* _this, leWidget_MoveEvent* evt); \ 543 void (*resizeEvent)(THIS_TYPE* _this, leWidget_ResizeEvent* evt); \ 544 void (*focusGainedEvent)(THIS_TYPE* _this); \ 545 void (*focusLostEvent)(THIS_TYPE* _this); \ 546 void (*languageChangeEvent)(THIS_TYPE* _this); \ 547 void (*touchDownEvent)(THIS_TYPE* _this, leWidgetEvent_TouchDown* evt); \ 548 void (*touchUpEvent)(THIS_TYPE* _this, leWidgetEvent_TouchUp* evt); \ 549 void (*touchMoveEvent)(THIS_TYPE* _this, leWidgetEvent_TouchMove* evt); \ 551 void (*_destructor)(THIS_TYPE* _this); \ 553 void (*_handleEvent)(THIS_TYPE* _this, leEvent* evt); \ 554 void (*_validateChildren)(THIS_TYPE* _this); \ 555 void (*_increaseDirtyState)(THIS_TYPE* _this, uint32_t state); \ 556 void (*_setDirtyState)(THIS_TYPE* _this, uint32_t state); \ 557 void (*_clearDirtyState)(THIS_TYPE* _this); \ 558 void (*_invalidateBorderAreas)(const THIS_TYPE* _this); \ 559 void (*_damageArea)(const THIS_TYPE* _this, leRect* rect); \ 560 void (*_paint)(THIS_TYPE* _this); \ 562 typedef struct leWidgetVTable
570 typedef void (* leWidget_DrawFunction_FnPtr)(
void*);
574 LE_WIDGET_ENABLED = 0x1,
575 LE_WIDGET_VISIBLE = 0x2,
576 LE_WIDGET_ALPHAENABLED = 0x4,
577 LE_WIDGET_ISROOT = 0x8,
578 LE_WIDGET_IGNOREEVENTS = 0x10,
579 LE_WIDGET_IGNOREPICK = 0x20
582 typedef struct leWidgetStyle
584 uint8_t backgroundType;
589 uint8_t cornerRadius;
592 typedef struct leWidgetStatus
626 const leWidgetVTable* fn;
635 leWidgetStatus status;
642 leWidget_DrawFunction_FnPtr drawFunc;
2288 leBackgroundType type);
2828 void _leWidget_ValidateChildren(
leWidget*);
2829 void _leWidget_IncreaseDirtyState(
leWidget*, uint32_t);
2830 void _leWidget_SetDirtyState(
leWidget*, uint32_t);
2831 void _leWidget_ClearDirtyState(
leWidget*);
2832 void _leWidget_InvalidateBorderAreas(
const leWidget*);
2839 void _leWidget_FocusLostEvent(
leWidget*);
2840 void _leWidget_FocusGainedEvent(
leWidget*);
2841 void _leWidget_LanguageChangeEvent(
leWidget*);
This struct represents a rectange array.
Definition: legato_rectarray.h:74
Common macros and definitions used by Legato.
Legato event definitions.
leEventID
This enum represents valid event IDs.
Definition: legato_event.h:68
leResult
This enum represents function call results.
Definition: legato_common.h:123
This struct represents a rectangle.
Definition: legato_common.h:394
This struct represents the four margin settings for objects.
Definition: legato_common.h:220
leHAlignment
This enum represents the horizontal alignment mode of objects.
Definition: legato_common.h:195
This struct represents a array.
Definition: legato_array.h:64
An array implementation for storing pointers.
leBool
This enum represents booleans.
Definition: legato_common.h:146
Rectangle functions and definitions.
This enum presents a event. An event contains valid event ids.
Definition: legato_event.h:91
Definition: legato_scheme.h:154
Schemes support various properties that make it possible to customize the color of widgets...
leVAlignment
This enum represents the vertical alignment mode of objects.
Definition: legato_common.h:170