MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_widget.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
3 *
4 * Subject to your compliance with these terms, you may use Microchip software
5 * and any derivatives exclusively with Microchip products. It is your
6 * responsibility to comply with third party license terms applicable to your
7 * use of third party software (including open source software) that may
8 * accompany Microchip software.
9 *
10 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
11 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
12 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
13 * PARTICULAR PURPOSE.
14 *
15 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
16 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
17 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
18 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
19 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
20 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
21 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
22 *******************************************************************************/
23 
24 /*******************************************************************************
25  Module for Microchip Graphics Library - Legato User Interface Library
26 
27  Company:
28  Microchip Technology Inc.
29 
30  File Name:
31  legato_widget.h
32 
33  Summary:
34 
35 
36  Description:
37  This module implements top level widget control functions.
38 *******************************************************************************/
39 
47 #ifndef LEGATO_WIDGET_H
48 #define LEGATO_WIDGET_H
49 
50 
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 
62 /* internal use only */#define DEFAULT_BORDER_MARGIN 4
71 // *****************************************************************************
72 // *****************************************************************************
73 // Section: Data Types and Constants
74 // *****************************************************************************
75 // *****************************************************************************
76 
77 /*
78 Enumeration:
79  leWidgetType
80 
81  Summary:
82  Specifies the different widget types used in the library
83 
84  Description:
85  This enumeration specifies the different widget types
86  used in the library.
87 
88  Remarks:
89  None.
90  */
95 typedef enum leWidgetType
96 {
97  LE_WIDGET_WIDGET,
98 #if LE_ARC_WIDGET_ENABLED == 1
99  LE_WIDGET_ARC,
100 #endif
101 #if LE_BARGRAPH_WIDGET_ENABLED == 1
102  LE_WIDGET_BAR_GRAPH,
103 #endif
104 #if LE_BUTTON_WIDGET_ENABLED == 1
105  LE_WIDGET_BUTTON,
106 #endif
107 #if LE_CHECKBOX_WIDGET_ENABLED == 1
108  LE_WIDGET_CHECKBOX,
109 #endif
110 #if LE_CIRCLE_WIDGET_ENABLED == 1
111  LE_WIDGET_CIRCLE,
112 #endif
113 #if LE_CIRCULARGAUGE_WIDGET_ENABLED == 1
114  LE_WIDGET_CIRCULAR_GAUGE,
115 #endif
116 #if LE_CIRCULARSLIDER_WIDGET_ENABLED == 1
117  LE_WIDGET_CIRCULAR_SLIDER,
118 #endif
119 #if LE_DRAWSURFACE_WIDGET_ENABLED == 1
120  LE_WIDGET_DRAWSURFACE,
121 #endif
122 #if LE_IMAGE_WIDGET_ENABLED == 1
123  LE_WIDGET_IMAGE,
124 #endif
125 #if LE_IMAGEROTATE_WIDGET_ENABLED == 1
126  LE_WIDGET_IMAGEROTATE,
127 #endif
128 #if LE_IMAGESCALE_WIDGET_ENABLED == 1
129  LE_WIDGET_IMAGESCALE,
130 #endif
131 #if LE_IMAGESEQUENCE_WIDGET_ENABLED == 1
132  LE_WIDGET_IMAGESEQUENCE,
133 #endif
134 #if LE_GRADIENT_WIDGET_ENABLED == 1
135  LE_WIDGET_GRADIENT,
136 #endif
137 #if LE_GROUPBOX_WIDGET_ENABLED == 1
138  LE_WIDGET_GROUPBOX,
139 #endif
140 #if LE_KEYPAD_WIDGET_ENABLED == 1 && LE_BUTTON_WIDGET_ENABLED == 1
141  LE_WIDGET_KEYPAD,
142 #endif
143 #if LE_LABEL_WIDGET_ENABLED == 1
144  LE_WIDGET_LABEL,
145 #endif
146 #if LE_LINE_WIDGET_ENABLED == 1
147  LE_WIDGET_LINE,
148 #endif
149 #if LE_LINEGRAPH_WIDGET_ENABLED == 1
150  LE_WIDGET_LINE_GRAPH,
151 #endif
152 #if LE_LIST_WIDGET_ENABLED == 1 && LE_SCROLLBAR_WIDGET_ENABLED == 1
153  LE_WIDGET_LIST,
154 #endif
155 #if LE_LISTWHEEL_WIDGET_ENABLED == 1
156  LE_WIDGET_LISTWHEEL,
157 #endif
158 #if LE_PIECHART_WIDGET_ENABLED == 1
159  LE_WIDGET_PIE_CHART,
160 #endif
161 #if LE_PROGRESSBAR_WIDGET_ENABLED == 1
162  LE_WIDGET_PROGRESSBAR,
163 #endif
164 #if LE_RADIALMENU_WIDGET_ENABLED == 1
165  LE_WIDGET_RADIAL_MENU,
166 #endif
167 #if LE_RADIOBUTTON_WIDGET_ENABLED == 1
168  LE_WIDGET_RADIOBUTTON,
169 #endif
170 #if LE_RECTANGLE_WIDGET_ENABLED == 1
171  LE_WIDGET_RECTANGLE,
172 #endif
173 #if LE_SCROLLBAR_WIDGET_ENABLED == 1
174  LE_WIDGET_SCROLLBAR,
175 #endif
176 #if LE_SLIDER_WIDGET_ENABLED == 1
177  LE_WIDGET_SLIDER,
178 #endif
179 #if LE_TEXTFIELD_WIDGET_ENABLED == 1
180  LE_WIDGET_TEXTFIELD,
181 #endif
182 #if LE_TOUCHTEST_WIDGET_ENABLED == 1
183  LE_WIDGET_TOUCHTEST,
184 #endif
185 #if LE_WINDOW_WIDGET_ENABLED == 1
186  LE_WIDGET_WINDOW,
187 #endif
188  // begin custom types, not essential but good for identifying base pointers
189 
190  // end custom types
191  //LE_WIDGET_LAST = LE_WIDGET_WINDOW, // change this if adding custom
192  //LE_WIDGET_TYPE_COUNT = LE_WIDGET_LAST + 1
193 } leWidgetType;
194 
195 /*
196 Enumeration:
197  leBackgroundType
198 
199  Summary:
200  Specifies the different background types used for the widgets in the library
201 
202  Description:
203  Specifies the different background types used for the widgets in the library
204 
205  None - No background fill. Widget must defer to its parent to erase dirty
206  pixels. This may cause additional overhead as clean pixels may be
207  repainted as well.
208 
209  Fill - a scheme color is used to fill the widget rectangle.
210 
211  Cache - a local framebuffer cache is maintained by the widget and used to
212  clean up dirty pixels. Will not cause a parent repaint event but
213  will use additional memory to contain the cache.
214 
215  Remarks:
216  None.
217  */
225 typedef enum leBackgroundType
226 {
231 
232 /*
233 Enumeration:
234  leBorderType
235 
236  Summary:
237  Specifies the different border types used for the widgets in the library
238 
239  Description:
240  Specifies the different border types used for the widgets in the library
241 
242  Remarks:
243  None.
244  */
249 typedef enum leBorderType
250 {
251  LE_WIDGET_BORDER_NONE,
252  LE_WIDGET_BORDER_LINE,
253  LE_WIDGET_BORDER_BEVEL,
254  LE_WIDGET_BORDER_LAST = LE_WIDGET_BORDER_BEVEL
255 } leBorderType;
256 
257 /*
258 Enumeration:
259  leWidgetDirtyState
260 
261  Summary:
262  Specifies the different dirty states the widget can be assigned
263 
264  Description:
265  Specifies the different dirty states the widget can be assigned
266  This decides whether the particular widget would be re-drawn or not.
267  Dirty widget are re-drawn and clean are not painted over.
268 
269  Remarks:
270  None.
271  */
278 typedef enum leWidgetDirtyState
279 {
280  LE_WIDGET_DIRTY_STATE_CLEAN,
281  LE_WIDGET_DIRTY_STATE_CHILD,
282  LE_WIDGET_DIRTY_STATE_DIRTY,
284 
285 /*
286 Enumeration:
287  leWidgetDrawState
288 
289  Summary:
290  Specifies the different draw states the widget can be assigned
291 
292  Description:
293  Specifies the different draw states the widget can be assigned
294 
295  Remarks:
296  None.
297  */
304 typedef enum leWidgetDrawState
305 {
306  LE_WIDGET_DRAW_STATE_READY,
307  LE_WIDGET_DRAW_STATE_DONE,
308 
309  // widget-specific draw states start here
311 
316 typedef struct leWidget_MoveEvent
317 {
318  leEvent evt;
319 
320  int32_t oldX;
321  int32_t oldY;
322  int32_t newX;
323  int32_t newY;
325 
330 typedef struct leWidget_ResizeEvent
331 {
332  leEvent evt;
333 
334  uint32_t oldWidth;
335  uint32_t oldHeight;
336  uint32_t newWidth;
337  uint32_t newHeight;
339 
340 typedef struct leWidget leWidget;
341 
342 // *****************************************************************************
343 /* Structure:
344  leWidgetEvent
345 
346  Summary:
347  Basic widget event definition
348 */
353 typedef struct leWidgetEvent
354 {
355  leEventID id;
356  leBool accepted;
357  leWidget* owner;
358 } leWidgetEvent;
359 
360 
361 // *****************************************************************************
362 /* Structure:
363  leInput_TouchDownEvent_t
364 
365  Summary:
366  Register and handle the touch press detect event
367 
368  Description:
369  Register and handle the touch press detect event
370 
371  Remarks:
372  None.
373 */
379 {
381 
382  int32_t touchID;
383  int32_t x;
384  int32_t y;
386 
387 // *****************************************************************************
388 /* Structure:
389  leInput_TouchUpEvent
390 
391  Summary:
392  Register and handle the touch release detect event
393 
394  Description:
395  Register and handle the touch release detect event
396 
397  Remarks:
398  None.
399 */
404 typedef struct leWidgetEvent_TouchUp
405 {
407 
408  int32_t touchID;
409  int32_t x;
410  int32_t y;
412 
413 // *****************************************************************************
414 /* Structure:
415  leInput_TouchMoveEvent
416 
417  Summary:
418  Register and handle the touch coordinates changed event
419 
420  Description:
421  Register and handle the touch coordinates changed event
422 
423  Remarks:
424  None.
425 */
431 {
433 
434  uint32_t touchID;
435  int32_t prevX;
436  int32_t prevY;
437  int32_t x;
438  int32_t y;
440 
441 void leWidgetEvent_Accept(leWidgetEvent* evt, leWidget* owner);
442 
443 // *****************************************************************************
444 /* Struct Definition:
445  leWidgetEventFilter
446 
447  Summary:
448  Struct that defines an event filter. Event filters allow a
449  receiver to discard undesirable events
450 */
455 typedef struct
456 {
468  leBool (* filterEvent)(leWidget* target, leWidgetEvent* evt, void* data);
469  void* data;
471 
472 /* internal use only */
477 typedef struct leWidget leWidget;
478 
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); \
535  /* internal functions follow */ \
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); \
541  \
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); \
550  \
551  void (*_destructor)(THIS_TYPE* _this); \
552  \
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); \
561 
562 typedef struct leWidgetVTable
563 {
564  LE_WIDGET_VTABLE(leWidget)
565 } leWidgetVTable;
566 
567 typedef struct leWidget leWidget;
568 typedef struct leRectArray leRectArray;
569 
570 typedef void (* leWidget_DrawFunction_FnPtr)(void*);
571 
572 enum leWidgetFlags
573 {
574  LE_WIDGET_ENABLED = 0x1, // indicates that the widget is enabled
575  LE_WIDGET_VISIBLE = 0x2, // indicates that the widget is visible
576  LE_WIDGET_ALPHAENABLED = 0x4, // indicates that the widget is using alpha blending
577  LE_WIDGET_ISROOT = 0x8, // indicates that this widget is a root widget
578  LE_WIDGET_IGNOREEVENTS = 0x10, // indicates that the widget should ignore input/focus events
579  LE_WIDGET_IGNOREPICK = 0x20 // indicates that the widget should be ignored for pick tests
580 };
581 
582 typedef struct leWidgetStyle
583 {
584  uint8_t backgroundType; // the widget background type
585  uint8_t borderType; // the widget border type
586  uint8_t halign; // horizontal alignment of the widget
587  uint8_t valign; // vertical alignment of the widget
588  uint8_t alphaAmount; // the global alpha amount to apply to this widget (cumulative with parent widgets)
589  uint8_t cornerRadius; //corner radius, draws round corners if > 0
590 } leWidgetStyle;
591 
592 typedef struct leWidgetStatus
593 {
594  uint8_t dirtyState;
595  uint8_t drawState;
596 
597 } leWidgetStatus;
598 
605 /* Structure:
606  leWidget
607 
608  Summary:
609  Specifies Graphics widget structure to manage all properties and events associated with the widget
610 
611  Description:
612  Specifies Graphics widget structure to manage all properties and events associated with the widget.
613  It also contains information about the parent and children for the widget to manage the tree structure that the library supports.
614 
615 
616  Remarks:
617  None.
618 
619 */
624 typedef struct leWidget
625 {
626  const leWidgetVTable* fn;
627 
628  uint32_t id; // the id of the widget
629  leWidgetType type; // the type of the widget
630 
631  leRect rect; // the bounding rectangle of the widget
632 
633  uint32_t flags; // widget state flags
634  leWidgetStyle style; // widget style values
635  leWidgetStatus status; // widget status values
636 
637  leMargin margin; // the margin settings for the widget
638 
639  uint32_t drawCount; // number of times this widget has been drawn
640  // for the active screen
641 
642  leWidget_DrawFunction_FnPtr drawFunc; // the next draw function to call
643 
644  const leScheme* scheme; // the widget's color scheme
645 
646  leWidgetEventFilter eventFilters[LE_WIDGET_MAX_EVENT_FILTERS];
647 
648  leWidget* parent; // pointer to the widget's parent
649  leArray children; // pointers for the widget's children
650 } leWidget;
651 
652 // *****************************************************************************
653 // *****************************************************************************
654 // Section: Routines
655 // *****************************************************************************
656 // *****************************************************************************
657 
658 /* Function:
659  leWidget* leWidget_New()
660 
661  Summary:
662  Create a new widget.
663 
664 
665  Description:
666  Create a new widget, allocate memory for the widget through the current
667  active context. Returns a widget object pointer. Application is
668  responsible for managing the widget pointer until the widget is added
669  to a widget tree.
670 
671  Parameters:
672 
673 
674  Returns:
675  lawidget*
676 
677 */
688 leWidget* leWidget_New(void);
689 
700 void leWidget_Constructor(leWidget* wgt);
701 
702 /* Function:
703  void leWidget_Delete(leWidget* wgt)
704 
705  Summary:
706  Delete the widget object specified
707 
708  Description:
709  Delete a widget object specified, de-allocate memory for the widget
710  through the current active context. All child widgets are also
711  destructed and freed.
712 
713  Parameters:
714  leWidget* wgt - the widget to be freed
715 
716  Returns:
717  void
718 
719  Remarks:
720  All widgets that are dynamically allocated using should be freed using
721  this function regardless of widget type. This ensures tha all widget
722  destructors are properly called.
723 
724 */
735 void leWidget_Delete(leWidget* wgt);
736 
737 // *****************************************************************************
738 /* Virtual Member Function:
739  leWidgetType getType(const leWidgetWidget* _this)
740 
741  Summary:
742  Gets the widget type
743 
744  Description:
745  Gets the widget type
746 
747  Parameters:
748  const leWidgetWidget* _this - The widget to operate on
749 
750  Remarks:
751  Usage - _this->fn->getType(_this);
752 
753  Returns:
754  leWidgetType - the type
755 */
767 leWidgetType _leWidget_GetType(const leWidget* _this);
768 
769 // *****************************************************************************
770 /* Virtual Member Function:
771  int32_t getX(const leWidgetWidget* _this)
772 
773  Summary:
774  Gets the widget X position
775 
776  Description:
777  Gets the widget X position
778 
779  Parameters:
780  const leWidgetWidget* _this - The widget to operate on
781 
782  Remarks:
783  Usage - _this->fn->getX(_this);
784 
785  Returns:
786  int32_t - the x value
787 */
799 int32_t _leWidget_GetX(const leWidget* _this);
800 
801 // *****************************************************************************
802 /* Virtual Member Function:
803  leResult setX(leWidgetWidget* _this,
804  int32_t x)
805 
806  Summary:
807  Sets the widget X position
808 
809  Description:
810  Sets the widget X position
811 
812  Parameters:
813  leWidgetWidget* _this - The widget to operate on
814  int32_t x - the X value
815 
816  Remarks:
817  Usage - _this->fn->setX(_this, x);
818 
819  Returns:
820  leResult - the result of the operation
821 */
836  int32_t x);
837 
838 // *****************************************************************************
839 /* Virtual Member Function:
840  int32_t getY(const leWidgetWidget* _this)
841 
842  Summary:
843  Gets the widget Y position
844 
845  Description:
846  Gets the widget Y position
847 
848  Parameters:
849  const leWidgetWidget* _this - The widget to operate on
850 
851  Remarks:
852  Usage - _this->fn->getY(_this);
853 
854  Returns:
855  int32_t - the y value
856 */
868 int32_t _leWidget_GetY(const leWidget* _this);
869 
870 // *****************************************************************************
871 /* Virtual Member Function:
872  leResult setY(leWidgetWidget* _this,
873  int32_t y)
874 
875  Summary:
876  Sets the widget Y position
877 
878  Description:
879  Sets the widget Y position
880 
881  Parameters:
882  leWidgetWidget* _this - The widget to operate on
883  int32_t y - the Y value
884 
885  Remarks:
886  Usage - _this->fn->setY(_this, y);
887 
888  Returns:
889  leResult - the result of the operation
890 */
905  int32_t y);
906 
907 // *****************************************************************************
908 /* Virtual Member Function:
909  leResult setPosition(leWidgetWidget* _this,
910  int32_t x,
911  int32_t y)
912 
913  Summary:
914  Sets the widget position
915 
916  Description:
917  Sets the widget position
918 
919  Parameters:
920  leWidgetWidget* _this - The widget to operate on
921  int32_t x - the X value
922  int32_t y - the Y value
923 
924  Remarks:
925  Usage - _this->fn->setPosition(_this, x, y);
926 
927  Returns:
928  leResult - the result of the operation
929 */
945  int32_t x,
946  int32_t y);
947 
948 // *****************************************************************************
949 /* Virtual Member Function:
950  leResult translate(leWidgetWidget* _this,
951  int32_t x,
952  int32_t y)
953 
954  Summary:
955  Translate the widget position
956 
957  Description:
958  Translate the widget position
959 
960  Parameters:
961  leWidgetWidget* _this - The widget to operate on
962  int32_t x - the X value
963  int32_t y - the Y value
964 
965  Remarks:
966  Usage - _this->fn->translate(_this, x, y);
967 
968  Returns:
969  leResult - the result of the operation
970 */
986  int32_t x,
987  int32_t y);
988 
989 // *****************************************************************************
990 /* Virtual Member Function:
991  uint32_t getWidth(const leWidgetWidget* _this)
992 
993  Summary:
994  Gets the widget width
995 
996  Description:
997  Gets the widget width
998 
999  Parameters:
1000  const leWidgetWidget* _this - The widget to operate on
1001 
1002  Remarks:
1003  Usage - _this->fn->getWidth(_this);
1004 
1005  Returns:
1006  uint32_t - the width value
1007 */
1019 uint32_t _leWidget_GetWidth(const leWidget* _this);
1020 
1021 // *****************************************************************************
1022 /* Virtual Member Function:
1023  leResult setWidth(leWidgetWidget* _this,
1024  uint32_t w)
1025 
1026  Summary:
1027  Sets the widget width
1028 
1029  Description:
1030  Sets the widget width
1031 
1032  Parameters:
1033  leWidgetWidget* _this - The widget to operate on
1034  uint32_t w - the width value
1035 
1036  Remarks:
1037  Usage - _this->fn->setWidth(_this, w);
1038 
1039  Returns:
1040  leResult - the result of the operation
1041 */
1057  uint32_t width);
1058 
1059 // *****************************************************************************
1060 /* Virtual Member Function:
1061  uint32_t getHeight(const leWidgetWidget* _this)
1062 
1063  Summary:
1064  Gets the widget height
1065 
1066  Description:
1067  Gets the widget height
1068 
1069  Parameters:
1070  const leWidgetWidget* _this - The widget to operate on
1071 
1072  Remarks:
1073  Usage - _this->fn->getHeight(_this);
1074 
1075  Returns:
1076  uint32_t - the height value
1077 */
1089 uint32_t _leWidget_GetHeight(const leWidget* _this);
1090 
1091 // *****************************************************************************
1092 /* Virtual Member Function:
1093  leResult setHeight(leWidgetWidget* _this,
1094  uint32_t h)
1095 
1096  Summary:
1097  Sets the widget height
1098 
1099  Description:
1100  Sets the widget height
1101 
1102  Parameters:
1103  leWidgetWidget* _this - The widget to operate on
1104  uint32_t h - the height value
1105 
1106  Remarks:
1107  Usage - _this->fn->setHeight(_this, h);
1108 
1109  Returns:
1110  leResult - the result of the operation
1111 */
1127  uint32_t height);
1128 
1129 // *****************************************************************************
1130 /* Virtual Member Function:
1131  leResult setSize(leWidgetWidget* _this,
1132  uint32_t w,
1133  uint32_t h)
1134 
1135  Summary:
1136  Sets the widget size
1137 
1138  Description:
1139  Sets the widget size
1140 
1141  Parameters:
1142  leWidgetWidget* _this - The widget to operate on
1143  uint32_t w - the width value
1144  uint32_t h - the height value
1145 
1146  Remarks:
1147  Usage - _this->fn->setSize(_this, w, h);
1148 
1149  Returns:
1150  leResult - the result of the operation
1151 */
1167  uint32_t width,
1168  uint32_t height);
1169 
1170 // *****************************************************************************
1171 /* Virtual Member Function:
1172  leResult resize(leWidgetWidget* _this,
1173  int32_t w,
1174  int32_t h)
1175 
1176  Summary:
1177  Resizes the widget
1178 
1179  Description:
1180  Resizes the widget
1181 
1182  Parameters:
1183  leWidgetWidget* _this - The widget to operate on
1184  int32_t w - the width value
1185  int32_t h - the height value
1186 
1187  Remarks:
1188  Usage - _this->fn->resize(_this, w, h);
1189 
1190  Returns:
1191  leResult - the result of the operation
1192 */
1210  int32_t width,
1211  int32_t height);
1212 
1213 // *****************************************************************************
1214 /* Virtual Member Function:
1215  leBool getAlphaEnabled(const leWidgetWidget* _this)
1216 
1217  Summary:
1218  Gets the widget alpha enabled flag
1219 
1220  Description:
1221  Gets the widget alpha enabled flag
1222 
1223  Parameters:
1224  const leWidgetWidget* _this - The widget to operate on
1225 
1226  Remarks:
1227  Usage - _this->fn->getAlphaEnabled(_this);
1228 
1229  Returns:
1230  leBool - true if alpha blending is enabled
1231 */
1244 
1245 // *****************************************************************************
1246 /* Virtual Member Function:
1247  leBool getCumulativeAlphaEnabled(const leWidgetWidget* _this)
1248 
1249  Summary:
1250  Determines if any widget in this widget's hierarchy has its alpha flag
1251  enabled
1252 
1253  Description:
1254  Determines if any widget in this widget's hierarchy has its alpha flag
1255  enabled
1256 
1257  Parameters:
1258  const leWidgetWidget* _this - The widget to operate on
1259 
1260  Remarks:
1261  Usage - _this->fn->getCumulativeAlphaEnabled(_this);
1262 
1263  Returns:
1264  leBool - true if alpha blending is enabled
1265 */
1278 
1279 // *****************************************************************************
1280 /* Virtual Member Function:
1281  leResult setAlphaEnabled(leWidgetWidget* _this,
1282  leBool enbl)
1283 
1284  Summary:
1285  Sets the widget's alpha flag enable state
1286 
1287  Description:
1288  Sets the widget's alpha flag enable state
1289 
1290  Parameters:
1291  leWidgetWidget* _this - The widget to operate on
1292  leBool enbl -
1293 
1294  Remarks:
1295  Usage - _this->fn->setAlphaEnabled(_this, enbl);
1296 
1297  Returns:
1298  leResult - the result of the operation
1299 */
1313  leBool enable);
1314 
1315 // *****************************************************************************
1316 /* Virtual Member Function:
1317  uint32_t getAlphaAmount(const leWidgetWidget* _this)
1318 
1319  Summary:
1320  Gets the widget alpha blending value
1321 
1322  Description:
1323  Gets the widget alpha blending value
1324 
1325  Parameters:
1326  const leWidgetWidget* _this - The widget to operate on
1327 
1328  Remarks:
1329  Usage - _this->fn->getAlphaAmount(_this);
1330 
1331  Returns:
1332  uint32_t - the alpha amount
1333 */
1345 uint32_t _leWidget_GetAlphaAmount(const leWidget* _this);
1346 
1347 // *****************************************************************************
1348 /* Virtual Member Function:
1349  uint32_t getCumulativeAlphaAmount(const leWidgetWidget* _this)
1350 
1351  Summary:
1352  Gets the cumulative amount of alpha blending applied to this widget
1353 
1354  Description:
1355  Gets the cumulative amount of alpha blending applied to this widget
1356 
1357  Parameters:
1358  const leWidgetWidget* _this - The widget to operate on
1359 
1360  Remarks:
1361  Usage - _this->fn->getCumulativeAlphaAmount(_this);
1362 
1363  Returns:
1364  uint32_t - the alpha amount
1365 */
1377 uint32_t _leWidget_GetCumulativeAlphaAmount(const leWidget* _this);
1378 
1379 // *****************************************************************************
1380 /* Virtual Member Function:
1381  leResult setAlphaAmount(leWidgetWidget* _this,
1382  uint32_t a)
1383 
1384  Summary:
1385  Sets this widget's alpha amount
1386 
1387  Description:
1388  Sets this widget's alpha amount
1389 
1390  Parameters:
1391  leWidgetWidget* _this - The widget to operate on
1392  uint32_t a - the alpha amount
1393 
1394  Remarks:
1395  Usage - _this->fn->setAlphaAmount(_this, a);
1396 
1397  Returns:
1398  leResult - the result of the operation
1399 */
1413  uint32_t alpha);
1414 
1415 // *****************************************************************************
1416 /* Virtual Member Function:
1417  leBool isOpaque(const leWidgetWidget* _this)
1418 
1419  Summary:
1420  Determines if this widget is opaque
1421 
1422  Description:
1423  Determines if this widget is opaque
1424 
1425  Parameters:
1426  const leWidgetWidget* _this - The widget to operate on
1427 
1428  Remarks:
1429  Usage - _this->fn->isOpaque(_this);
1430 
1431  Returns:
1432  leBool - true if opaque
1433 */
1445 leBool _leWidget_IsOpaque(const leWidget* _this);
1446 
1447 // *****************************************************************************
1448 /* Virtual Member Function:
1449  leBool getEnabled(const leWidgetWidget* _this)
1450 
1451  Summary:
1452  Gets this widget's enabled flag
1453 
1454  Description:
1455  Gets this widget's enabled flag
1456 
1457  Parameters:
1458  const leWidgetWidget* _this - The widget to operate on
1459 
1460  Remarks:
1461  Usage - _this->fn->getEnabled(_this);
1462 
1463  Returns:
1464  leBool - the setting value
1465 */
1477 leBool _leWidget_GetEnabled(const leWidget* _this);
1478 
1479 // *****************************************************************************
1480 /* Virtual Member Function:
1481  leResult setEnabled(leWidgetWidget* _this,
1482  leBool enbl)
1483 
1484  Summary:
1485  Sets this widget's enabled flag
1486 
1487  Description:
1488  Sets this widget's enabled flag
1489 
1490  Parameters:
1491  leWidgetWidget* _this - The widget to operate on
1492  leBool enbl - the setting value
1493 
1494  Remarks:
1495  Usage - _this->fn->setEnabled(_this, enbl);
1496 
1497  Returns:
1498  leResult - the result of the operation
1499 */
1514 
1515 // *****************************************************************************
1516 /* Virtual Member Function:
1517  leBool getVisible(const leWidgetWidget* _this)
1518 
1519  Summary:
1520  Gets this widget's visible flag
1521 
1522  Description:
1523  Gets this widget's visible flag
1524 
1525  Parameters:
1526  const leWidgetWidget* _this - The widget to operate on
1527 
1528  Remarks:
1529  Usage - _this->fn->getVisible(_this);
1530 
1531  Returns:
1532  leBool - the visibility setting
1533 */
1545 leBool _leWidget_GetVisible(const leWidget* _this);
1546 
1547 // *****************************************************************************
1548 /* Virtual Member Function:
1549  leResult setVisible(leWidgetWidget* _this,
1550  leBool vis)
1551 
1552  Summary:
1553  Sets this widget's visible flag
1554 
1555  Description:
1556  Sets this widget's visible flag
1557 
1558  Parameters:
1559  leWidgetWidget* _this - The widget to operate on
1560  leBool vis - the visibility setting
1561 
1562  Remarks:
1563  Usage - _this->fn->setVisible(_this, vis);
1564 
1565  Returns:
1566  leResult - the result of the operation
1567 */
1582 leResult _leWidget_SetVisible(leWidget* _this, leBool visible);
1583 
1584 // *****************************************************************************
1585 /* Virtual Member Function:
1586  leRect localRect(const leWidgetWidget* _this)
1587 
1588  Summary:
1589  Gets the widget's bounding rectangle in local space
1590 
1591  Description:
1592  Gets the widget's bounding rectangle in local space
1593 
1594  Parameters:
1595  const leWidgetWidget* _this - The widget to operate on
1596 
1597  Remarks:
1598  Usage - _this->fn->localRect(_this);
1599 
1600  Returns:
1601  leRect - the bounding rectangle
1602 */
1615 void _leWidget_LocalRect(const leWidget* _this,
1616  leRect* res);
1617 
1618 // *****************************************************************************
1619 /* Virtual Member Function:
1620  leRect rectToParent(const leWidgetWidget* _this)
1621 
1622  Summary:
1623  Gets the widget's bounding rectangle in parent space
1624 
1625  Description:
1626  Gets the widget's bounding rectangle in parent space
1627 
1628  Parameters:
1629  const leWidgetWidget* _this - The widget to operate on
1630 
1631  Remarks:
1632  Usage - _this->fn->rectToParent(_this);
1633 
1634  Returns:
1635  leRect - the bounding rectangle
1636 */
1650 void _leWidget_RectToParentSpace(const leWidget* _this,
1651  leRect* res);
1652 
1653 // *****************************************************************************
1654 /* Virtual Member Function:
1655  void rectToScreen(const leWidgetWidget* _this, leRect* res)
1656 
1657  Summary:
1658  Gets the widget's bounding rectangle in screen space
1659 
1660  Description:
1661  Gets the widget's bounding rectangle in screen space
1662 
1663  Parameters:
1664  const leWidgetWidget* _this - The widget to operate on
1665  leRect* res - the resultant rectangle
1666 
1667  Remarks:
1668  Usage - _this->fn->rectToScreen(_this);
1669 
1670  Returns:
1671  void
1672 */
1686 void _leWidget_RectToScreenSpace(const leWidget* _this,
1687  leRect* res);
1688 
1689 // *****************************************************************************
1690 /* Virtual Member Function:
1691  leResult addChild(leWidgetWidget* _this,
1692  leWidget* chld)
1693 
1694  Summary:
1695  Adds a child widget to this widget
1696 
1697  Description:
1698  Adds a child widget to this widget
1699 
1700  Parameters:
1701  leWidgetWidget* _this - The widget to operate on
1702  leWidget* chld - the child widget
1703 
1704  Remarks:
1705  Usage - _this->fn->addChild(_this, chld);
1706 
1707  Returns:
1708  leResult - the result of the operation
1709 */
1724  leWidget* child);
1725 
1741  leWidget* child,
1742  uint32_t idx);
1743 
1744 // *****************************************************************************
1745 /* Virtual Member Function:
1746  leResult removeChild(leWidgetWidget* _this,
1747  leWidget* chld)
1748 
1749  Summary:
1750  Removes a child widget from this widget
1751 
1752  Description:
1753  Removes a child widget from this widget
1754 
1755  Parameters:
1756  leWidgetWidget* _this - The widget to operate on
1757  leWidget* chld - the child widget
1758 
1759  Remarks:
1760  Usage - _this->fn->removeChild(_this, chld);
1761 
1762  Returns:
1763  leResult - the result of the operation
1764 */
1779  leWidget* child);
1780 
1795  uint32_t idx);
1796 
1797 // *****************************************************************************
1798 /* Virtual Member Function:
1799  void removeAllChildren(leWidgetWidget* _this)
1800 
1801  Summary:
1802  Removes all children from this widget
1803 
1804  Description:
1805  Removes all children from this widget
1806 
1807  Parameters:
1808  leWidgetWidget* _this - The widget to operate on
1809 
1810  Remarks:
1811  Usage - _this->fn->removeAllChildren(_this);
1812 
1813  Returns:
1814  void
1815 */
1828 
1829 // *****************************************************************************
1830 /* Virtual Member Function:
1831  void setChildIndex(leWidgetWidget* _this,
1832  leWidget* child,
1833  uint32_t idx)
1834 
1835  Summary:
1836  Sets a child's index
1837 
1838  Description:
1839  Sets a child's index
1840 
1841  Parameters:
1842  leWidgetWidget* _this - The widget to operate on
1843  leWidget8 child - The child to manipulate
1844  uint32_t idx - The new index for the child
1845 
1846  Remarks:
1847  Usage - _this->fn->setChildIndex(_this, chld, 5);
1848 
1849  Returns:
1850  leResult
1851 */
1864 void _leWidget_setChildIndex(leWidget* _this,
1865  leWidget* child,
1866  uint32_t idx);
1867 
1868 // *****************************************************************************
1869 /* Virtual Member Function:
1870  leWidget* getRootWidget(const leWidgetWidget* _this)
1871 
1872  Summary:
1873  Gets the topmost ancestor for this widget
1874 
1875  Description:
1876  Gets the topmost ancestor for this widget
1877 
1878  Parameters:
1879  const leWidgetWidget* _this - The widget to operate on
1880 
1881  Remarks:
1882  Usage - _this->fn->getRootWidget(_this);
1883 
1884  Returns:
1885  leWidget* - the root widget
1886 */
1899 
1900 // *****************************************************************************
1901 /* Virtual Member Function:
1902  leResult setParent(leWidgetWidget* _this,
1903  leWidget* pnt)
1904 
1905  Summary:
1906  Sets this widget's parent
1907 
1908  Description:
1909  Sets this widget's parent
1910 
1911  Parameters:
1912  leWidgetWidget* _this - The widget to operate on
1913  leWidget* pnt - the parent widget
1914 
1915  Remarks:
1916  Usage - _this->fn->setParent(_this, pnt);
1917 
1918  Returns:
1919  leResult - the result of the operation
1920 */
1935  leWidget* parent);
1936 
1937 // *****************************************************************************
1938 /* Virtual Member Function:
1939  uint32_t getChildCount(const leWidgetWidget* _this)
1940 
1941  Summary:
1942  Gets the number of children this widget owns
1943 
1944  Description:
1945  Gets the number of children this widget owns
1946 
1947  Parameters:
1948  const leWidgetWidget* _this - The widget to operate on
1949 
1950  Remarks:
1951  Usage - _this->fn->getChildCount(_this);
1952 
1953  Returns:
1954  uint32_t - the child count
1955 */
1967 uint32_t _leWidget_GetChildCount(const leWidget* _this);
1968 
1969 // *****************************************************************************
1970 /* Virtual Member Function:
1971  leWidget* getChildAtIndex(const leWidgetWidget* _this,
1972  uint32_t idx)
1973 
1974  Summary:
1975  Gets a widget child at a given index
1976 
1977  Description:
1978  Gets a widget child at a given index
1979 
1980  Parameters:
1981  const leWidgetWidget* _this - The widget to operate on
1982  uint32_t idx - the index
1983 
1984  Remarks:
1985  Usage - _this->fn->getChildAtIndex(_this, idx);
1986 
1987  Returns:
1988  leWidget* - the child widget
1989 */
2003  uint32_t idx);
2004 
2005 // *****************************************************************************
2006 /* Virtual Member Function:
2007  uint32_t getIndexOfChild(const leWidgetWidget* _this,
2008  const leWidget* chld)
2009 
2010  Summary:
2011  Get the index of a given child widget
2012 
2013  Description:
2014  Get the index of a given child widget
2015 
2016  Parameters:
2017  const leWidgetWidget* _this - The widget to operate on
2018  const leWidget* chld - the child widget
2019 
2020  Remarks:
2021  Usage - _this->fn->getIndexOfChild(_this, chld);
2022 
2023  Returns:
2024  uint32_t -
2025 */
2039 uint32_t _leWidget_GetIndexOfChild(const leWidget* _this,
2040  const leWidget* child);
2041 
2042 // *****************************************************************************
2043 /* Virtual Member Function:
2044  leBool containsDescendant(const leWidgetWidget* _this,
2045  const leWidget* wgt)
2046 
2047  Summary:
2048  Determines of a widget's descendant tree contains a given widget
2049 
2050  Description:
2051  Determines of a widget's descendant tree contains a given widget
2052 
2053  Parameters:
2054  const leWidgetWidget* _this - The widget to operate on
2055  const leWidget* wgt - the widget
2056 
2057  Remarks:
2058  Usage - _this->fn->containsDescendant(_this, wgt);
2059 
2060  Returns:
2061  leBool - LE_TRUE if the widget is a descentdent of this
2062 */
2078  const leWidget* wgt);
2079 
2080 // *****************************************************************************
2081 /* Virtual Member Function:
2082  leScheme* getScheme(const leWidgetWidget* _this)
2083 
2084  Summary:
2085  Gets this widget's scheme
2086 
2087  Description:
2088  Gets this widget's scheme
2089 
2090  Parameters:
2091  const leWidgetWidget* _this - The widget to operate on
2092 
2093  Remarks:
2094  Usage - _this->fn->getScheme(_this);
2095 
2096  Returns:
2097  leScheme* - the scheme pointer
2098 */
2110 leScheme* _leWidget_GetScheme(const leWidget* _this);
2111 
2112 // *****************************************************************************
2113 /* Virtual Member Function:
2114  leResult setScheme(const leWidgetWidget* _this,
2115  leScheme* schm)
2116 
2117  Summary:
2118  Sets this widget's scheme
2119 
2120  Description:
2121  Sets this widget's scheme
2122 
2123  Parameters:
2124  leWidgetWidget* _this - The widget to operate on
2125  const leScheme* schm - the scheme pointer
2126 
2127  Remarks:
2128  Usage - _this->fn->setScheme(_this, schm);
2129 
2130  Returns:
2131  leResult - the result of the operation
2132 */
2148  const leScheme* scheme);
2149 
2150 // *****************************************************************************
2151 /* Virtual Member Function:
2152  leBorderType getBorderType(const leWidgetWidget* _this)
2153 
2154  Summary:
2155  Gets this widget's border type
2156 
2157  Description:
2158  Gets this widget's border type
2159 
2160  Parameters:
2161  const leWidgetWidget* _this - The widget to operate on
2162 
2163  Remarks:
2164  Usage - _this->fn->getBorderType(_this);
2165 
2166  Returns:
2167  leBorderType - the type
2168 */
2180 leBorderType _leWidget_GetBorderType(const leWidget* _this);
2181 
2182 // *****************************************************************************
2183 /* Virtual Member Function:
2184  leResult setBorderType(leWidgetWidget* _this,
2185  leBorderType type)
2186 
2187  Summary:
2188  Sets this widget's border type
2189 
2190  Description:
2191  Sets this widget's border type
2192 
2193  Parameters:
2194  leWidgetWidget* _this - The widget to operate on
2195  leBorderType type - the type
2196 
2197  Remarks:
2198  Usage - _this->fn->setBorderType(_this, type);
2199 
2200  Returns:
2201  leResult - the result of the operation
2202 */
2218  leBorderType type);
2219 
2220 // *****************************************************************************
2221 /* Virtual Member Function:
2222  leBackgroundType getBackgroundType(const leWidgetWidget* _this)
2223 
2224  Summary:
2225  Gets this widget's background type
2226 
2227  Description:
2228  Gets this widget's background type
2229 
2230  Parameters:
2231  const leWidgetWidget* _this - The widget to operate on
2232 
2233  Remarks:
2234  Usage - _this->fn->getBackgroundType(_this);
2235 
2236  Returns:
2237  leBackgroundType - the type
2238 */
2250 leBackgroundType _leWidget_GetBackgroundType(const leWidget* _this);
2251 
2252 // *****************************************************************************
2253 /* Virtual Member Function:
2254  leResult setBackgroundType(leWidgetWidget* _this,
2255  leBackgroundType type)
2256 
2257  Summary:
2258  Sets this widget's background type
2259 
2260  Description:
2261  Sets this widget's background type
2262 
2263  Parameters:
2264  leWidgetWidget* _this - The widget to operate on
2265  leBackgroundType type - the type
2266 
2267  Remarks:
2268  Usage - _this->fn->setBackgroundType(_this, type);
2269 
2270  Returns:
2271  leResult - the result of the operation
2272 */
2288  leBackgroundType type);
2289 
2290 // *****************************************************************************
2291 /* Virtual Member Function:
2292  leHAlignment getHAlignment(const leWidgetWidget* _this)
2293 
2294  Summary:
2295  Gets this widget's horizontal alignment setting
2296 
2297  Description:
2298  Gets this widget's horizontal alignment setting
2299 
2300  Parameters:
2301  const leWidgetWidget* _this - The widget to operate on
2302 
2303  Remarks:
2304  Usage - _this->fn->getHAlignment(_this);
2305 
2306  Returns:
2307  leHAlignment - the horizontal alignment
2308 */
2321 
2322 // *****************************************************************************
2323 /* Virtual Member Function:
2324  leResult setHAlignment(leWidgetWidget* _this,
2325  leHAlignment halgn)
2326 
2327  Summary:
2328  Sets this widget's horizontal alignment setting
2329 
2330  Description:
2331  Sets this widget's horizontal alignment setting
2332 
2333  Parameters:
2334  leWidgetWidget* _this - The widget to operate on
2335  leHAlignment halgn - the horizontal alignment
2336 
2337  Remarks:
2338  Usage - _this->fn->setHAlignment(_this, halgn);
2339 
2340  Returns:
2341  leResult - the result of the operation
2342 */
2358  leHAlignment align);
2359 
2360 // *****************************************************************************
2361 /* Virtual Member Function:
2362  leVAlignment getVAlignment(const leWidgetWidget* _this)
2363 
2364  Summary:
2365  Gets this widget's vertical alignment setting
2366 
2367  Description:
2368  Gets this widget's vertical alignment setting
2369 
2370  Parameters:
2371  const leWidgetWidget* _this - The widget to operate on
2372 
2373  Remarks:
2374  Usage - _this->fn->getVAlignment(_this);
2375 
2376  Returns:
2377  leVAlignment - the vertical alignment
2378 */
2391 
2392 // *****************************************************************************
2393 /* Virtual Member Function:
2394  leResult setVAlignment(leWidgetWidget* _this,
2395  leVAlignment valgn)
2396 
2397  Summary:
2398  Sets this widget's vertical alignment setting
2399 
2400  Description:
2401  Sets this widget's vertical alignment setting
2402 
2403  Parameters:
2404  leWidgetWidget* _this - The widget to operate on
2405  leVAlignment valgn - the vertical alignment
2406 
2407  Remarks:
2408  Usage - _this->fn->setVAlignment(_this, valgn);
2409 
2410  Returns:
2411  leResult - the result of the operation
2412 */
2428  leVAlignment align);
2429 
2430 // *****************************************************************************
2431 /* Virtual Member Function:
2432  leMargin getMargins(const leWidgetWidget* _this)
2433 
2434  Summary:
2435  Gets this widget's margins
2436 
2437  Description:
2438  Gets this widget's margins
2439 
2440  Parameters:
2441  const leWidgetWidget* _this - The widget to operate on
2442 
2443  Remarks:
2444  Usage - _this->fn->getMargins(_this);
2445 
2446  Returns:
2447  leMargin - the margin value
2448 */
2461 leResult _leWidget_GetMargins(const leWidget* _this, leMargin* mg);
2462 
2463 // *****************************************************************************
2464 /* Virtual Member Function:
2465  leResult setMargins(leWidgetWidget* _this,
2466  uint32_t l,
2467  uint32_t t,
2468  uint32_t r,
2469  uint32_t b)
2470 
2471  Summary:
2472  Sets this widget's margins
2473 
2474  Description:
2475  Sets this widget's margins
2476 
2477  Parameters:
2478  leWidgetWidget* _this - The widget to operate on
2479  uint32_t l - the left margin value
2480  uint32_t t - the top margin value
2481  uint32_t r - the right margin value
2482  uint32_t b - the bottom margin value
2483 
2484  Remarks:
2485  Usage - _this->fn->setMargins(_this, l, t, r, b);
2486 
2487  Returns:
2488  leResult - the result of the operation
2489 */
2507  uint32_t l,
2508  uint32_t t,
2509  uint32_t r,
2510  uint32_t b);
2511 
2512 // *****************************************************************************
2513 /* Virtual Member Function:
2514  uint32_t getCornerRadius(const leWidgetWidget* _this)
2515 
2516  Summary:
2517  Gets this widget's corner radius value
2518 
2519  Description:
2520  Gets this widget's corner radius value
2521 
2522  Parameters:
2523  const leWidgetWidget* _this - The widget to operate on
2524 
2525  Remarks:
2526  Usage - _this->fn->getCornerRadius(_this);
2527 
2528  Returns:
2529  uint32_t - the radius value
2530 */
2542 uint32_t _leWidget_GetCornerRadius(const leWidget* _this);
2543 
2544 // *****************************************************************************
2545 /* Virtual Member Function:
2546  leResult setCornerRadius(leWidgetWidget* _this,
2547  uint32_t rad)
2548 
2549  Summary:
2550  Sets this widget's corner radius value
2551 
2552  Description:
2553  Sets this widget's corner radius value
2554 
2555  Parameters:
2556  leWidgetWidget* _this - The widget to operate on
2557  uint32_t rad - the radius value
2558 
2559  Remarks:
2560  Usage - _this->fn->setCornerRadius(_this, rad);
2561 
2562  Returns:
2563  leResult - the result of the operation
2564 */
2580  uint32_t radius);
2581 
2582 // *****************************************************************************
2583 /* Virtual Member Function:
2584  leBool hasFocus(const leWidgetWidget* _this)
2585 
2586  Summary:
2587  Indicates if this widget currently has input focus
2588 
2589  Description:
2590  Indicates if this widget currently has input focus
2591 
2592  Parameters:
2593  const leWidgetWidget* _this - The widget to operate on
2594 
2595  Remarks:
2596  Usage - _this->fn->hasFocus(_this);
2597 
2598  Returns:
2599  leBool - true if focused
2600 */
2612 leBool _leWidget_HasFocus(const leWidget* _this);
2613 
2614 // *****************************************************************************
2615 /* Virtual Member Function:
2616  leResult setFocus(leWidgetWidget* _this)
2617 
2618  Summary:
2619  Attempts to focus this widget
2620 
2621  Description:
2622  Attempts to focus this widget
2623 
2624  Parameters:
2625  leWidgetWidget* _this - The widget to operate on
2626 
2627  Remarks:
2628  Usage - _this->fn->setFocus(_this);
2629 
2630  Returns:
2631  leResult - the result of the operation
2632 */
2648 
2649 // *****************************************************************************
2650 /* Virtual Member Function:
2651  void invalidate(const leWidgetWidget* _this)
2652 
2653  Summary:
2654  Invalidates this widget so it will redraw itself
2655 
2656  Description:
2657  Invalidates this widget so it will redraw itself
2658 
2659  Parameters:
2660  const leWidgetWidget* _this - The widget to operate on
2661 
2662  Remarks:
2663  Usage - _this->fn->invalidate(_this);
2664 
2665  Returns:
2666  void
2667 */
2680 void _leWidget_Invalidate(const leWidget* _this);
2681 
2682 // *****************************************************************************
2683 /* Virtual Member Function:
2684  void invalidateContents(const leWidgetWidget* _this)
2685 
2686  Summary:
2687  Invalidates the contents of this widget
2688 
2689  Description:
2690  Invalidates the contents of this widget
2691 
2692  Parameters:
2693  const leWidgetWidget* _this - The widget to operate on
2694 
2695  Remarks:
2696  Usage - _this->fn->invalidateContents(_this);
2697 
2698  Returns:
2699  void
2700 */
2712 void _leWidget_InvalidateContents(const leWidget* _this);
2713 
2714 // *****************************************************************************
2715 /* Virtual Member Function:
2716  leResult installEventFilter(leWidgetWidget* _this,
2717  leWidgetEventFilter fltr)
2718 
2719  Summary:
2720  Installs a widget event filter
2721 
2722  Description:
2723  Installs a widget event filter
2724 
2725  Parameters:
2726  leWidgetWidget* _this - The widget to operate on
2727  leWidgetEventFilter fltr - the callback pointer
2728 
2729  Remarks:
2730  Usage - _this->fn->installEventFilter(_this, fltr);
2731 
2732  Returns:
2733  leResult - the result of the operation
2734 */
2750  leWidgetEventFilter fltr);
2751 
2752 // *****************************************************************************
2753 /* Virtual Member Function:
2754  leResult removeEventFilter(leWidgetWidget* _this,
2755  leWidgetEventFilter fltr)
2756 
2757  Summary:
2758  Removes a widget event filter
2759 
2760  Description:
2761  Removes a widget event filter
2762 
2763  Parameters:
2764  leWidgetWidget* _this - The widget to operate on
2765  leWidgetEventFilter fltr - the callback pointer
2766 
2767  Remarks:
2768  Usage - _this->fn->removeEventFilter(_this, fltr);
2769 
2770  Returns:
2771  leResult - the result of the operation
2772 */
2788  leWidgetEventFilter fltr);
2789 
2790 // *****************************************************************************
2791 /* Virtual Member Function:
2792  void update(leWidgetWidget* _this,
2793  uint32_t dt)
2794 
2795  Summary:
2796  The widget update/tasks function
2797 
2798  Description:
2799  The widget update/tasks function
2800 
2801  Parameters:
2802  leWidgetWidget* _this - The widget to operate on
2803  uint32_t dt -
2804 
2805  Remarks:
2806  Usage - _this->fn->update(_this, dt);
2807 
2808  Returns:
2809  void
2810 */
2825 void _leWidget_Update(leWidget* _this, uint32_t dt);
2826 
2827 void _leWidget_HandleEvent(leWidget*, leEvent*);
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*);
2833 void _leWidget_DamageArea(const leWidget*, leRect*);
2834 void _leWidget_TouchDownEvent(leWidget*, leWidgetEvent_TouchDown*);
2835 void _leWidget_TouchUpEvent(leWidget*, leWidgetEvent_TouchUp*);
2836 void _leWidget_TouchMoveEvent(leWidget*, leWidgetEvent_TouchMove*);
2837 void _leWidget_MoveEvent(leWidget*, leWidget_MoveEvent*);
2838 void _leWidget_ResizeEvent(leWidget*, leWidget_ResizeEvent*);
2839 void _leWidget_FocusLostEvent(leWidget*);
2840 void _leWidget_FocusGainedEvent(leWidget*);
2841 void _leWidget_LanguageChangeEvent(leWidget*);
2842 
2843 #ifdef __cplusplus
2844 }
2845 #endif
2846 
2847 #endif /* LEGATO_WIDGET_H */
leHAlignment _leWidget_GetHAlignment(const leWidget *_this)
Get widget horizontal alignment.
Definition: legato_widget.c:1205
This struct represents a rectange array.
Definition: legato_rectarray.h:74
void _leWidget_setChildIndex(leWidget *_this, leWidget *child, uint32_t idx)
Sets a child's index.
leBool _leWidget_IsOpaque(const leWidget *_this)
Determine is widget is opaque.
Definition: legato_widget.c:677
leScheme * _leWidget_GetScheme(const leWidget *_this)
Get widget scheme.
Definition: legato_widget.c:1128
leBool _leWidget_GetEnabled(const leWidget *_this)
Get widget enabled flag.
Definition: legato_widget.c:701
leBorderType
Used to define widget border types.
Definition: legato_widget.h:249
Definition: legato_widget.h:228
Common macros and definitions used by Legato.
Definition: legato_widget.h:229
leResult _leWidget_InsertChild(leWidget *_this, leWidget *child, uint32_t idx)
Adds child to widget at index.
Definition: legato_widget.c:859
leResult _leWidget_SetHAlignment(leWidget *_this, leHAlignment align)
Set widget scheme.
Definition: legato_widget.c:1212
leBackgroundType _leWidget_GetBackgroundType(const leWidget *_this)
Get widget background type.
Definition: legato_widget.c:1180
leResult _leWidget_SetParent(leWidget *_this, leWidget *parent)
Set parent widget.
Definition: legato_widget.c:1026
Legato event definitions.
leBool _leWidget_ContainsDescendant(const leWidget *_this, const leWidget *wgt)
Determine widget exists.
Definition: legato_widget.c:1100
leResult _leWidget_SetY(leWidget *_this, int32_t y)
Set widget y position.
Definition: legato_widget.c:234
leResult _leWidget_SetCornerRadius(leWidget *_this, uint32_t radius)
Set widget scheme.
Definition: legato_widget.c:1311
leResult _leWidget_SetBackgroundType(leWidget *_this, leBackgroundType type)
Set widget scheme.
Definition: legato_widget.c:1187
struct leWidgetEvent leWidgetEvent
Used to define widget event.
leResult _leWidget_RemoveEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Remove event filter.
Definition: legato_widget.c:1470
leEventID
This enum represents valid event IDs.
Definition: legato_event.h:68
void _leWidget_Update(leWidget *_this, uint32_t dt)
Update widget.
Definition: legato_widget.c:1723
leVAlignment _leWidget_GetVAlignment(const leWidget *_this)
Get widget vertical alignment.
Definition: legato_widget.c:1233
uint32_t _leWidget_GetHeight(const leWidget *_this)
Get widget height.
Definition: legato_widget.c:385
void _leWidget_InvalidateContents(const leWidget *_this)
Invalidate widget contents.
Definition: legato_widget.c:1442
leResult
This enum represents function call results.
Definition: legato_common.h:123
leResult _leWidget_SetBorderType(leWidget *_this, leBorderType type)
Set widget scheme.
Definition: legato_widget.c:1161
int32_t _leWidget_GetX(const leWidget *_this)
Get widget x position.
Definition: legato_widget.c:191
struct leWidget_ResizeEvent leWidget_ResizeEvent
Used to define widget resize event.
int32_t _leWidget_GetY(const leWidget *_this)
Get widget y position.
Definition: legato_widget.c:227
leResult _leWidget_Resize(leWidget *_this, int32_t width, int32_t height)
Resize widget.
Definition: legato_widget.c:478
leBool _leWidget_GetVisible(const leWidget *_this)
Get widget visible status.
Definition: legato_widget.c:731
void _leWidget_LocalRect(const leWidget *_this, leRect *res)
Get widget rectangle.
Definition: legato_widget.c:763
This struct represents a rectangle.
Definition: legato_common.h:394
Used to define widget touch move event.
Definition: legato_widget.h:430
leWidgetDirtyState
Used to define widget dirty state.
Definition: legato_widget.h:278
leResult _leWidget_SetFocus(leWidget *_this)
Set widget scheme.
Definition: legato_widget.c:1341
uint32_t _leWidget_GetChildCount(const leWidget *_this)
Get child count.
Definition: legato_widget.c:1071
struct leWidgetEvent_TouchDown leWidgetEvent_TouchDown
Used to define widget touch down event.
leResult _leWidget_SetScheme(leWidget *_this, const leScheme *scheme)
Set widget scheme.
Definition: legato_widget.c:1135
leWidget * leWidget_New(void)
Create widget.
Definition: legato_widget.c:158
leResult _leWidget_AddChild(leWidget *_this, leWidget *child)
Add child to widget.
Definition: legato_widget.c:822
leResult _leWidget_RemoveChild(leWidget *_this, leWidget *child)
Remove child from widget.
Definition: legato_widget.c:897
void leWidget_Delete(leWidget *wgt)
Delete widget.
Definition: legato_widget.c:174
leResult _leWidget_SetX(leWidget *_this, int32_t x)
Set widget x position.
Definition: legato_widget.c:198
leBool _leWidget_GetAlphaEnabled(const leWidget *_this)
Get alpha enable status.
Definition: legato_widget.c:529
leResult _leWidget_SetSize(leWidget *_this, uint32_t width, uint32_t height)
Set widget height.
Definition: legato_widget.c:429
leBool _leWidget_HasFocus(const leWidget *_this)
Determines the focus status.
Definition: legato_widget.c:1334
This struct represents the four margin settings for objects.
Definition: legato_common.h:220
Used to define widget move event.
Definition: legato_widget.h:316
uint32_t _leWidget_GetIndexOfChild(const leWidget *_this, const leWidget *child)
Get index of child.
Definition: legato_widget.c:1089
void _leWidget_Invalidate(const leWidget *_this)
Invalidate widget.
Definition: legato_widget.c:1374
leResult _leWidget_SetPosition(leWidget *_this, int32_t x, int32_t y)
Set widget x and y position.
Definition: legato_widget.c:263
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
Used to define a widget.
Definition: legato_widget.h:624
leResult _leWidget_SetMargins(leWidget *_this, uint32_t l, uint32_t t, uint32_t r, uint32_t b)
Set widget margins.
Definition: legato_widget.c:1274
uint32_t _leWidget_GetAlphaAmount(const leWidget *_this)
Get alpha amount.
Definition: legato_widget.c:599
leWidgetType
Used to define widget types.
Definition: legato_widget.h:95
leWidgetType _leWidget_GetType(const leWidget *_this)
Get widget type.
Definition: legato_widget.c:184
leBorderType _leWidget_GetBorderType(const leWidget *_this)
Get widget bordertype.
Definition: legato_widget.c:1154
Used to define widget resize event.
Definition: legato_widget.h:330
leResult _leWidget_SetAlphaAmount(leWidget *_this, uint32_t alpha)
Set alpha amount.
Definition: legato_widget.c:646
leResult _leWidget_SetHeight(leWidget *_this, uint32_t height)
Set widget height.
Definition: legato_widget.c:392
void _leWidget_RectToParentSpace(const leWidget *_this, leRect *res)
Get widget rectangle.
Definition: legato_widget.c:774
leBool _leWidget_GetCumulativeAlphaEnabled(const leWidget *_this)
Get cumulative alpha enable status.
Definition: legato_widget.c:547
leBackgroundType
Used to define widget background types.
Definition: legato_widget.h:225
void _leWidget_RemoveAllChildren(leWidget *_this)
Remove all children from widget.
Definition: legato_widget.c:968
struct leWidget leWidget
Used to define a widget.
Definition: legato_widget.h:340
leResult _leWidget_SetEnabled(leWidget *_this, leBool enable)
Set widget enabled flag.
Definition: legato_widget.c:706
void leWidget_Constructor(leWidget *wgt)
Initialize widget.
Definition: legato_widget.c:71
leResult _leWidget_SetWidth(leWidget *_this, uint32_t width)
Set the widget width.
Definition: legato_widget.c:348
struct leWidget_MoveEvent leWidget_MoveEvent
Used to define widget move event.
leResult _leWidget_SetAlphaEnabled(leWidget *_this, leBool enable)
Set cumulative alpha enable status.
Definition: legato_widget.c:566
An array implementation for storing pointers.
leBool
This enum represents booleans.
Definition: legato_common.h:146
Used to define widget touch event filter.
Definition: legato_widget.h:455
leResult _leWidget_GetMargins(const leWidget *_this, leMargin *mg)
Get widget margins.
Definition: legato_widget.c:1261
leWidgetDrawState
Used to define widget dirty state.
Definition: legato_widget.h:304
Used to define widget event.
Definition: legato_widget.h:353
uint32_t _leWidget_GetWidth(const leWidget *_this)
Get widget width.
Definition: legato_widget.c:341
Rectangle functions and definitions.
void _leWidget_RectToScreenSpace(const leWidget *_this, leRect *res)
Get widget rectangle.
Definition: legato_widget.c:790
struct leWidgetEvent_TouchMove leWidgetEvent_TouchMove
Used to define widget touch move event.
uint32_t _leWidget_GetCornerRadius(const leWidget *_this)
Get widget corner radius.
Definition: legato_widget.c:1304
Definition: legato_widget.h:227
struct leWidgetEvent_TouchUp leWidgetEvent_TouchUp
Used to define widget touch up event.
leResult _leWidget_InstallEventFilter(leWidget *_this, leWidgetEventFilter fltr)
Install event filter.
Definition: legato_widget.c:1447
Definition: scheme.py:1
leResult _leWidget_Translate(leWidget *_this, int32_t x, int32_t y)
Translate widget x and y position.
Definition: legato_widget.c:302
This enum presents a event. An event contains valid event ids.
Definition: legato_event.h:91
Definition: legato_scheme.h:154
Used to define widget touch up event.
Definition: legato_widget.h:404
leWidget * _leWidget_GetChildAtIndex(const leWidget *_this, uint32_t idx)
Get child at index.
Definition: legato_widget.c:1078
leResult _leWidget_SetVAlignment(leWidget *_this, leVAlignment align)
Set widget vertical alignment.
Definition: legato_widget.c:1240
Used to define widget touch down event.
Definition: legato_widget.h:378
uint32_t _leWidget_GetCumulativeAlphaAmount(const leWidget *_this)
Get cumulative alpha amount.
Definition: legato_widget.c:612
leResult _leWidget_SetVisible(leWidget *_this, leBool visible)
Set widget visible status.
Definition: legato_widget.c:738
Schemes support various properties that make it possible to customize the color of widgets...
Definition: event.py:1
leWidget * _leWidget_GetRootWidget(const leWidget *_this)
Get root widget.
Definition: legato_widget.c:1007
leVAlignment
This enum represents the vertical alignment mode of objects.
Definition: legato_common.h:170
leResult _leWidget_RemoveChildAt(leWidget *_this, uint32_t idx)
Remove child from widget at index.
Definition: legato_widget.c:935