Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG_patch mbed-rtos mbed
STemWin_Addons/inc/WIDGET.h@0:c00e6c923941, 2015-11-02 (annotated)
- Committer:
- NirT
- Date:
- Mon Nov 02 23:38:08 2015 +0000
- Revision:
- 0:c00e6c923941
Error: Incomplete type is not allowed in "patch/LwIP/src/include/lwip/dhcp.h", Line: 83, Col: 4; ; and more like this.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NirT | 0:c00e6c923941 | 1 | /********************************************************************* |
NirT | 0:c00e6c923941 | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
NirT | 0:c00e6c923941 | 3 | * Solutions for real time microcontroller applications * |
NirT | 0:c00e6c923941 | 4 | ********************************************************************** |
NirT | 0:c00e6c923941 | 5 | * * |
NirT | 0:c00e6c923941 | 6 | * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG * |
NirT | 0:c00e6c923941 | 7 | * * |
NirT | 0:c00e6c923941 | 8 | * Internet: www.segger.com Support: support@segger.com * |
NirT | 0:c00e6c923941 | 9 | * * |
NirT | 0:c00e6c923941 | 10 | ********************************************************************** |
NirT | 0:c00e6c923941 | 11 | |
NirT | 0:c00e6c923941 | 12 | ** emWin V5.28 - Graphical user interface for embedded applications ** |
NirT | 0:c00e6c923941 | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
NirT | 0:c00e6c923941 | 14 | emWin is protected by international copyright laws. Knowledge of the |
NirT | 0:c00e6c923941 | 15 | source code may not be used to write a similar product. This file may |
NirT | 0:c00e6c923941 | 16 | only be used in accordance with the following terms: |
NirT | 0:c00e6c923941 | 17 | |
NirT | 0:c00e6c923941 | 18 | The software has been licensed to STMicroelectronics International |
NirT | 0:c00e6c923941 | 19 | N.V. a Dutch company with a Swiss branch and its headquarters in Plan- |
NirT | 0:c00e6c923941 | 20 | les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the |
NirT | 0:c00e6c923941 | 21 | purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_ |
NirT | 0:c00e6c923941 | 22 | troller products commercialized by Licensee only, sublicensed and dis_ |
NirT | 0:c00e6c923941 | 23 | tributed under the terms and conditions of the End User License Agree_ |
NirT | 0:c00e6c923941 | 24 | ment supplied by STMicroelectronics International N.V. |
NirT | 0:c00e6c923941 | 25 | Full source code is available at: www.segger.com |
NirT | 0:c00e6c923941 | 26 | |
NirT | 0:c00e6c923941 | 27 | We appreciate your understanding and fairness. |
NirT | 0:c00e6c923941 | 28 | ---------------------------------------------------------------------- |
NirT | 0:c00e6c923941 | 29 | File : WIDGET.h |
NirT | 0:c00e6c923941 | 30 | Purpose : Widget interface |
NirT | 0:c00e6c923941 | 31 | ---------------------------END-OF-HEADER------------------------------ |
NirT | 0:c00e6c923941 | 32 | */ |
NirT | 0:c00e6c923941 | 33 | |
NirT | 0:c00e6c923941 | 34 | #ifndef WIDGET_H /* Avoid multiple inclusion */ |
NirT | 0:c00e6c923941 | 35 | #define WIDGET_H |
NirT | 0:c00e6c923941 | 36 | |
NirT | 0:c00e6c923941 | 37 | #if defined(__cplusplus) |
NirT | 0:c00e6c923941 | 38 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
NirT | 0:c00e6c923941 | 39 | #endif |
NirT | 0:c00e6c923941 | 40 | |
NirT | 0:c00e6c923941 | 41 | #include "WM_Intern.h" /* Window manager, including some internals, which speed things up */ |
NirT | 0:c00e6c923941 | 42 | |
NirT | 0:c00e6c923941 | 43 | #if GUI_WINSUPPORT |
NirT | 0:c00e6c923941 | 44 | |
NirT | 0:c00e6c923941 | 45 | /********************************************************************* |
NirT | 0:c00e6c923941 | 46 | * |
NirT | 0:c00e6c923941 | 47 | * Typedefs |
NirT | 0:c00e6c923941 | 48 | * |
NirT | 0:c00e6c923941 | 49 | ********************************************************************** |
NirT | 0:c00e6c923941 | 50 | */ |
NirT | 0:c00e6c923941 | 51 | typedef struct { |
NirT | 0:c00e6c923941 | 52 | WM_HWIN hWin; |
NirT | 0:c00e6c923941 | 53 | int Cmd; /* WIDGET_ITEM_GET_XSIZE, WIDGET_ITEM_GET_YSIZE, WIDGET_ITEM_DRAW, */ |
NirT | 0:c00e6c923941 | 54 | int ItemIndex; |
NirT | 0:c00e6c923941 | 55 | int Col; |
NirT | 0:c00e6c923941 | 56 | int x0, y0, x1, y1; |
NirT | 0:c00e6c923941 | 57 | void * p; |
NirT | 0:c00e6c923941 | 58 | } WIDGET_ITEM_DRAW_INFO; |
NirT | 0:c00e6c923941 | 59 | |
NirT | 0:c00e6c923941 | 60 | typedef int WIDGET_DRAW_ITEM_FUNC(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
NirT | 0:c00e6c923941 | 61 | typedef void WIDGET_PAINT (WM_HWIN hObj); |
NirT | 0:c00e6c923941 | 62 | typedef void WIDGET_CREATE (WM_HWIN hObj); |
NirT | 0:c00e6c923941 | 63 | |
NirT | 0:c00e6c923941 | 64 | typedef struct { |
NirT | 0:c00e6c923941 | 65 | WIDGET_PAINT * pfPaint; |
NirT | 0:c00e6c923941 | 66 | WIDGET_CREATE * pfCreate; |
NirT | 0:c00e6c923941 | 67 | void * pSkinPrivate; |
NirT | 0:c00e6c923941 | 68 | } WIDGET_SKIN; |
NirT | 0:c00e6c923941 | 69 | |
NirT | 0:c00e6c923941 | 70 | /********************************************************************* |
NirT | 0:c00e6c923941 | 71 | * |
NirT | 0:c00e6c923941 | 72 | * Important: WIDGET_DRAW_ITEM_FUNC needs to be defined |
NirT | 0:c00e6c923941 | 73 | * in SCROLLBAR.h! |
NirT | 0:c00e6c923941 | 74 | * |
NirT | 0:c00e6c923941 | 75 | ********************************************************************** |
NirT | 0:c00e6c923941 | 76 | */ |
NirT | 0:c00e6c923941 | 77 | #include "SCROLLBAR.h" |
NirT | 0:c00e6c923941 | 78 | |
NirT | 0:c00e6c923941 | 79 | /********************************************************************* |
NirT | 0:c00e6c923941 | 80 | * |
NirT | 0:c00e6c923941 | 81 | * Defines |
NirT | 0:c00e6c923941 | 82 | * |
NirT | 0:c00e6c923941 | 83 | ********************************************************************** |
NirT | 0:c00e6c923941 | 84 | */ |
NirT | 0:c00e6c923941 | 85 | /********************************************************************* |
NirT | 0:c00e6c923941 | 86 | * |
NirT | 0:c00e6c923941 | 87 | * Unique widget id's |
NirT | 0:c00e6c923941 | 88 | */ |
NirT | 0:c00e6c923941 | 89 | #define BUTTON_ID 0x42555454UL /* BUTT */ |
NirT | 0:c00e6c923941 | 90 | #define CHECKBOX_ID 0x43484543UL /* CHEC */ |
NirT | 0:c00e6c923941 | 91 | #define DROPDOWN_ID 0x44524f50UL /* DROP */ |
NirT | 0:c00e6c923941 | 92 | #define EDIT_ID 0x45444954UL /* EDIT */ |
NirT | 0:c00e6c923941 | 93 | #define FRAMEWIN_ID 0x4652414dUL /* FRAM */ |
NirT | 0:c00e6c923941 | 94 | #define FRAMECLNT_ID 0x46524143UL /* FRAC */ |
NirT | 0:c00e6c923941 | 95 | #define GRAPH_ID 0x47524150UL /* GRAP */ |
NirT | 0:c00e6c923941 | 96 | #define HEADER_ID 0x48454144UL /* HEAD */ |
NirT | 0:c00e6c923941 | 97 | #define LISTBOX_ID 0x4C495342UL /* LISB */ |
NirT | 0:c00e6c923941 | 98 | #define LISTVIEW_ID 0x4C495356UL /* LISV */ |
NirT | 0:c00e6c923941 | 99 | #define LISTWHEEL_ID 0x4C495357UL /* LISW */ |
NirT | 0:c00e6c923941 | 100 | #define MENU_ID 0x4d454e55UL /* MENU */ |
NirT | 0:c00e6c923941 | 101 | #define MULTIEDIT_ID 0x4d554c45UL /* MULE */ |
NirT | 0:c00e6c923941 | 102 | #define MULTIPAGE_ID 0x4d554c50UL /* MULP */ |
NirT | 0:c00e6c923941 | 103 | #define MPAGECLNT_ID 0x4d50434CUL /* MPCL */ |
NirT | 0:c00e6c923941 | 104 | #define PROGBAR_ID 0x50524f47UL /* PROG */ |
NirT | 0:c00e6c923941 | 105 | #define RADIO_ID 0x52414449UL /* RADI */ |
NirT | 0:c00e6c923941 | 106 | #define SCROLLBAR_ID 0x5343524fUL /* SCRO */ |
NirT | 0:c00e6c923941 | 107 | #define SLIDER_ID 0x534c4944UL /* SLID */ |
NirT | 0:c00e6c923941 | 108 | #define TEXT_ID 0x54455854UL /* TEXT */ |
NirT | 0:c00e6c923941 | 109 | #define TREEVIEW_ID 0x54524545UL /* TREE */ |
NirT | 0:c00e6c923941 | 110 | #define ICONVIEW_ID 0x49434f4eUL /* ICON */ |
NirT | 0:c00e6c923941 | 111 | #define IMAGE_ID 0x494d4147UL /* IMAG */ |
NirT | 0:c00e6c923941 | 112 | #define SPINBOX_ID 0x5350494eUL /* SPIN */ |
NirT | 0:c00e6c923941 | 113 | #define KNOB_ID 0x4b4e4f42UL /* KNOB */ |
NirT | 0:c00e6c923941 | 114 | #define WINDOW_ID 0x57494e44UL /* WIND */ |
NirT | 0:c00e6c923941 | 115 | |
NirT | 0:c00e6c923941 | 116 | #define WIDGET_LOCK(hWin) ((WIDGET*)GUI_LOCK_H(hWin)) |
NirT | 0:c00e6c923941 | 117 | |
NirT | 0:c00e6c923941 | 118 | /********************************************************************* |
NirT | 0:c00e6c923941 | 119 | * |
NirT | 0:c00e6c923941 | 120 | * Config switches |
NirT | 0:c00e6c923941 | 121 | */ |
NirT | 0:c00e6c923941 | 122 | |
NirT | 0:c00e6c923941 | 123 | #ifndef WIDGET_USE_PARENT_EFFECT |
NirT | 0:c00e6c923941 | 124 | #define WIDGET_USE_PARENT_EFFECT 0 |
NirT | 0:c00e6c923941 | 125 | #endif |
NirT | 0:c00e6c923941 | 126 | #ifndef WIDGET_USE_FLEX_SKIN |
NirT | 0:c00e6c923941 | 127 | #define WIDGET_USE_FLEX_SKIN 1 |
NirT | 0:c00e6c923941 | 128 | #endif |
NirT | 0:c00e6c923941 | 129 | #if !defined(WIDGET_USE_SCHEME_SMALL) && !defined(WIDGET_USE_SCHEME_MEDIUM) && !defined(WIDGET_USE_SCHEME_LARGE) |
NirT | 0:c00e6c923941 | 130 | #define WIDGET_USE_SCHEME_SMALL 1 |
NirT | 0:c00e6c923941 | 131 | #define WIDGET_USE_SCHEME_MEDIUM 0 |
NirT | 0:c00e6c923941 | 132 | #define WIDGET_USE_SCHEME_LARGE 0 |
NirT | 0:c00e6c923941 | 133 | #endif |
NirT | 0:c00e6c923941 | 134 | #ifndef WIDGET_USE_SCHEME_SMALL |
NirT | 0:c00e6c923941 | 135 | #define WIDGET_USE_SCHEME_SMALL 0 |
NirT | 0:c00e6c923941 | 136 | #endif |
NirT | 0:c00e6c923941 | 137 | #ifndef WIDGET_USE_SCHEME_MEDIUM |
NirT | 0:c00e6c923941 | 138 | #define WIDGET_USE_SCHEME_MEDIUM 0 |
NirT | 0:c00e6c923941 | 139 | #endif |
NirT | 0:c00e6c923941 | 140 | #ifndef WIDGET_USE_SCHEME_LARGE |
NirT | 0:c00e6c923941 | 141 | #define WIDGET_USE_SCHEME_LARGE 0 |
NirT | 0:c00e6c923941 | 142 | #endif |
NirT | 0:c00e6c923941 | 143 | #if (WIDGET_USE_SCHEME_SMALL + WIDGET_USE_SCHEME_MEDIUM + WIDGET_USE_SCHEME_LARGE) > 1 |
NirT | 0:c00e6c923941 | 144 | #error Only one scheme can be selected! |
NirT | 0:c00e6c923941 | 145 | #endif |
NirT | 0:c00e6c923941 | 146 | |
NirT | 0:c00e6c923941 | 147 | /********************************************************************* |
NirT | 0:c00e6c923941 | 148 | * |
NirT | 0:c00e6c923941 | 149 | * States |
NirT | 0:c00e6c923941 | 150 | */ |
NirT | 0:c00e6c923941 | 151 | |
NirT | 0:c00e6c923941 | 152 | #define WIDGET_STATE_FOCUS (1 << 0) |
NirT | 0:c00e6c923941 | 153 | #define WIDGET_STATE_VERTICAL (1 << 3) |
NirT | 0:c00e6c923941 | 154 | #define WIDGET_STATE_FOCUSSABLE (1 << 4) |
NirT | 0:c00e6c923941 | 155 | |
NirT | 0:c00e6c923941 | 156 | #define WIDGET_STATE_USER0 (1 << 8) /* Freely available for derived widget */ |
NirT | 0:c00e6c923941 | 157 | #define WIDGET_STATE_USER1 (1 << 9) /* Freely available for derived widget */ |
NirT | 0:c00e6c923941 | 158 | #define WIDGET_STATE_USER2 (1 << 10) /* Freely available for derived widget */ |
NirT | 0:c00e6c923941 | 159 | |
NirT | 0:c00e6c923941 | 160 | /********************************************************************* |
NirT | 0:c00e6c923941 | 161 | * |
NirT | 0:c00e6c923941 | 162 | * Skinning message identifiers |
NirT | 0:c00e6c923941 | 163 | */ |
NirT | 0:c00e6c923941 | 164 | #define WIDGET_ITEM_CREATE 0 |
NirT | 0:c00e6c923941 | 165 | #define WIDGET_ITEM_DRAW 1 |
NirT | 0:c00e6c923941 | 166 | #define WIDGET_ITEM_DRAW_ARROW 2 |
NirT | 0:c00e6c923941 | 167 | #define WIDGET_ITEM_DRAW_ARROW_L 3 |
NirT | 0:c00e6c923941 | 168 | #define WIDGET_ITEM_DRAW_ARROW_R 4 |
NirT | 0:c00e6c923941 | 169 | #define WIDGET_ITEM_DRAW_BACKGROUND 5 |
NirT | 0:c00e6c923941 | 170 | #define WIDGET_ITEM_DRAW_BITMAP 6 |
NirT | 0:c00e6c923941 | 171 | #define WIDGET_ITEM_DRAW_BUTTON 7 |
NirT | 0:c00e6c923941 | 172 | #define WIDGET_ITEM_DRAW_BUTTON_L 8 |
NirT | 0:c00e6c923941 | 173 | #define WIDGET_ITEM_DRAW_BUTTON_R 9 |
NirT | 0:c00e6c923941 | 174 | #define WIDGET_ITEM_DRAW_FOCUS 10 |
NirT | 0:c00e6c923941 | 175 | #define WIDGET_ITEM_DRAW_FRAME 11 |
NirT | 0:c00e6c923941 | 176 | #define WIDGET_ITEM_DRAW_OVERLAP 12 |
NirT | 0:c00e6c923941 | 177 | #define WIDGET_ITEM_DRAW_OVERLAY 13 |
NirT | 0:c00e6c923941 | 178 | #define WIDGET_ITEM_DRAW_SEP 14 |
NirT | 0:c00e6c923941 | 179 | #define WIDGET_ITEM_DRAW_SHAFT 15 |
NirT | 0:c00e6c923941 | 180 | #define WIDGET_ITEM_DRAW_SHAFT_L 16 |
NirT | 0:c00e6c923941 | 181 | #define WIDGET_ITEM_DRAW_SHAFT_R 17 |
NirT | 0:c00e6c923941 | 182 | #define WIDGET_ITEM_DRAW_TEXT 18 |
NirT | 0:c00e6c923941 | 183 | #define WIDGET_ITEM_DRAW_THUMB 19 |
NirT | 0:c00e6c923941 | 184 | #define WIDGET_ITEM_DRAW_TICKS 20 |
NirT | 0:c00e6c923941 | 185 | #define WIDGET_ITEM_GET_BORDERSIZE_B 21 |
NirT | 0:c00e6c923941 | 186 | #define WIDGET_ITEM_GET_BORDERSIZE_L 22 |
NirT | 0:c00e6c923941 | 187 | #define WIDGET_ITEM_GET_BORDERSIZE_R 23 |
NirT | 0:c00e6c923941 | 188 | #define WIDGET_ITEM_GET_BORDERSIZE_T 24 |
NirT | 0:c00e6c923941 | 189 | #define WIDGET_ITEM_GET_BUTTONSIZE 25 |
NirT | 0:c00e6c923941 | 190 | #define WIDGET_ITEM_GET_XSIZE 26 |
NirT | 0:c00e6c923941 | 191 | #define WIDGET_ITEM_GET_YSIZE 27 |
NirT | 0:c00e6c923941 | 192 | #define WIDGET_ITEM_GET_RADIUS 28 |
NirT | 0:c00e6c923941 | 193 | #define WIDGET_ITEM_APPLY_PROPS 29 // Not to be documented. Use this message identifier to update the |
NirT | 0:c00e6c923941 | 194 | // properties of attached widgets from <WIDGET>_DrawSkinFlex(). |
NirT | 0:c00e6c923941 | 195 | |
NirT | 0:c00e6c923941 | 196 | #define WIDGET_DRAW_OVERLAY WIDGET_ITEM_DRAW_OVERLAY |
NirT | 0:c00e6c923941 | 197 | #define WIDGET_DRAW_BACKGROUND WIDGET_ITEM_DRAW_BACKGROUND |
NirT | 0:c00e6c923941 | 198 | |
NirT | 0:c00e6c923941 | 199 | /********************************************************************* |
NirT | 0:c00e6c923941 | 200 | * |
NirT | 0:c00e6c923941 | 201 | * Messages |
NirT | 0:c00e6c923941 | 202 | */ |
NirT | 0:c00e6c923941 | 203 | |
NirT | 0:c00e6c923941 | 204 | #define WM_WIDGET_SET_EFFECT (WM_WIDGET + 0) |
NirT | 0:c00e6c923941 | 205 | |
NirT | 0:c00e6c923941 | 206 | /********************************************************************* |
NirT | 0:c00e6c923941 | 207 | * |
NirT | 0:c00e6c923941 | 208 | * Create flags |
NirT | 0:c00e6c923941 | 209 | */ |
NirT | 0:c00e6c923941 | 210 | |
NirT | 0:c00e6c923941 | 211 | #define WIDGET_CF_VERTICAL WIDGET_STATE_VERTICAL |
NirT | 0:c00e6c923941 | 212 | |
NirT | 0:c00e6c923941 | 213 | /********************************************************************* |
NirT | 0:c00e6c923941 | 214 | * |
NirT | 0:c00e6c923941 | 215 | * Widget object |
NirT | 0:c00e6c923941 | 216 | * |
NirT | 0:c00e6c923941 | 217 | * The widget object is the base class for most widgets |
NirT | 0:c00e6c923941 | 218 | */ |
NirT | 0:c00e6c923941 | 219 | typedef struct { |
NirT | 0:c00e6c923941 | 220 | int EffectSize; |
NirT | 0:c00e6c923941 | 221 | void (* pfDrawUp) (void); |
NirT | 0:c00e6c923941 | 222 | void (* pfDrawUpRect) (const GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 223 | void (* pfDrawDown) (void); |
NirT | 0:c00e6c923941 | 224 | void (* pfDrawDownRect)(const GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 225 | void (* pfDrawFlat) (void); |
NirT | 0:c00e6c923941 | 226 | void (* pfDrawFlatRect)(const GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 227 | } WIDGET_EFFECT; |
NirT | 0:c00e6c923941 | 228 | |
NirT | 0:c00e6c923941 | 229 | typedef struct { |
NirT | 0:c00e6c923941 | 230 | WM_Obj Win; |
NirT | 0:c00e6c923941 | 231 | const WIDGET_EFFECT* pEffect; |
NirT | 0:c00e6c923941 | 232 | I16 Id; |
NirT | 0:c00e6c923941 | 233 | U16 State; |
NirT | 0:c00e6c923941 | 234 | #if GUI_DEBUG_LEVEL > 1 |
NirT | 0:c00e6c923941 | 235 | U32 DebugId; |
NirT | 0:c00e6c923941 | 236 | #endif |
NirT | 0:c00e6c923941 | 237 | } WIDGET; |
NirT | 0:c00e6c923941 | 238 | |
NirT | 0:c00e6c923941 | 239 | |
NirT | 0:c00e6c923941 | 240 | /********************************************************************* |
NirT | 0:c00e6c923941 | 241 | * |
NirT | 0:c00e6c923941 | 242 | * GUI_DRAW |
NirT | 0:c00e6c923941 | 243 | * |
NirT | 0:c00e6c923941 | 244 | * The GUI_DRAW object is used as base class for selfdrawing, |
NirT | 0:c00e6c923941 | 245 | * non-windows objects. They are used as content of different widgets, |
NirT | 0:c00e6c923941 | 246 | * such as the bitmap or header widgets. |
NirT | 0:c00e6c923941 | 247 | */ |
NirT | 0:c00e6c923941 | 248 | /* Declare Object struct */ |
NirT | 0:c00e6c923941 | 249 | typedef struct GUI_DRAW GUI_DRAW; |
NirT | 0:c00e6c923941 | 250 | typedef void GUI_DRAW_SELF_CB (WM_HWIN hWin); |
NirT | 0:c00e6c923941 | 251 | typedef WM_HMEM GUI_DRAW_HANDLE; |
NirT | 0:c00e6c923941 | 252 | |
NirT | 0:c00e6c923941 | 253 | /* Declare Object constants (member functions etc) */ |
NirT | 0:c00e6c923941 | 254 | typedef struct { |
NirT | 0:c00e6c923941 | 255 | void (* pfDraw) (GUI_DRAW_HANDLE hDrawObj, WM_HWIN hObj, int x, int y); |
NirT | 0:c00e6c923941 | 256 | int (* pfGetXSize)(GUI_DRAW_HANDLE hDrawObj); |
NirT | 0:c00e6c923941 | 257 | int (* pfGetYSize)(GUI_DRAW_HANDLE hDrawObj); |
NirT | 0:c00e6c923941 | 258 | } GUI_DRAW_CONSTS; |
NirT | 0:c00e6c923941 | 259 | |
NirT | 0:c00e6c923941 | 260 | /* Declare Object */ |
NirT | 0:c00e6c923941 | 261 | struct GUI_DRAW { |
NirT | 0:c00e6c923941 | 262 | const GUI_DRAW_CONSTS* pConsts; |
NirT | 0:c00e6c923941 | 263 | union { |
NirT | 0:c00e6c923941 | 264 | const void * pData; |
NirT | 0:c00e6c923941 | 265 | GUI_DRAW_SELF_CB* pfDraw; |
NirT | 0:c00e6c923941 | 266 | } Data; |
NirT | 0:c00e6c923941 | 267 | I16 xOff, yOff; |
NirT | 0:c00e6c923941 | 268 | }; |
NirT | 0:c00e6c923941 | 269 | |
NirT | 0:c00e6c923941 | 270 | /* GUI_DRAW_ API */ |
NirT | 0:c00e6c923941 | 271 | void GUI_DRAW__Draw (GUI_DRAW_HANDLE hDrawObj, WM_HWIN hObj, int x, int y); |
NirT | 0:c00e6c923941 | 272 | int GUI_DRAW__GetXSize(GUI_DRAW_HANDLE hDrawObj); |
NirT | 0:c00e6c923941 | 273 | int GUI_DRAW__GetYSize(GUI_DRAW_HANDLE hDrawObj); |
NirT | 0:c00e6c923941 | 274 | |
NirT | 0:c00e6c923941 | 275 | /* GUI_DRAW_ Constructurs for different objects */ |
NirT | 0:c00e6c923941 | 276 | WM_HMEM GUI_DRAW_BITMAP_Create (const GUI_BITMAP* pBitmap, int x, int y); |
NirT | 0:c00e6c923941 | 277 | WM_HMEM GUI_DRAW_BMP_Create (const void* pBMP, int x, int y); |
NirT | 0:c00e6c923941 | 278 | WM_HMEM GUI_DRAW_STREAMED_Create(const GUI_BITMAP_STREAM * pBitmap, int x, int y); |
NirT | 0:c00e6c923941 | 279 | WM_HMEM GUI_DRAW_SELF_Create(GUI_DRAW_SELF_CB* pfDraw, int x, int y); |
NirT | 0:c00e6c923941 | 280 | |
NirT | 0:c00e6c923941 | 281 | /********************************************************************* |
NirT | 0:c00e6c923941 | 282 | * |
NirT | 0:c00e6c923941 | 283 | * Global data |
NirT | 0:c00e6c923941 | 284 | * |
NirT | 0:c00e6c923941 | 285 | ********************************************************************** |
NirT | 0:c00e6c923941 | 286 | */ |
NirT | 0:c00e6c923941 | 287 | |
NirT | 0:c00e6c923941 | 288 | extern const WIDGET_EFFECT WIDGET_Effect_3D; |
NirT | 0:c00e6c923941 | 289 | extern const WIDGET_EFFECT WIDGET_Effect_3D1L; |
NirT | 0:c00e6c923941 | 290 | extern const WIDGET_EFFECT WIDGET_Effect_3D2L; |
NirT | 0:c00e6c923941 | 291 | extern const WIDGET_EFFECT WIDGET_Effect_None; |
NirT | 0:c00e6c923941 | 292 | extern const WIDGET_EFFECT WIDGET_Effect_Simple; |
NirT | 0:c00e6c923941 | 293 | |
NirT | 0:c00e6c923941 | 294 | /********************************************************************* |
NirT | 0:c00e6c923941 | 295 | * |
NirT | 0:c00e6c923941 | 296 | * Internal API routines |
NirT | 0:c00e6c923941 | 297 | * |
NirT | 0:c00e6c923941 | 298 | ********************************************************************** |
NirT | 0:c00e6c923941 | 299 | */ |
NirT | 0:c00e6c923941 | 300 | |
NirT | 0:c00e6c923941 | 301 | void WIDGET__DrawFocusRect (WIDGET * pWidget, const GUI_RECT * pRect, int Dist); |
NirT | 0:c00e6c923941 | 302 | void WIDGET__DrawHLine (WIDGET * pWidget, int y, int x0, int x1); |
NirT | 0:c00e6c923941 | 303 | void WIDGET__DrawTriangle (WIDGET * pWidget, int x, int y, int Size, int Inc); |
NirT | 0:c00e6c923941 | 304 | void WIDGET__DrawVLine (WIDGET * pWidget, int x, int y0, int y1); |
NirT | 0:c00e6c923941 | 305 | void WIDGET__EFFECT_DrawDownRect(WIDGET * pWidget, GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 306 | void WIDGET__EFFECT_DrawDown (WIDGET * pWidget); |
NirT | 0:c00e6c923941 | 307 | void WIDGET__EFFECT_DrawUpRect (WIDGET * pWidget, GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 308 | void WIDGET__FillRectEx (WIDGET * pWidget, const GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 309 | int WIDGET__GetWindowSizeX (WM_HWIN hWin); |
NirT | 0:c00e6c923941 | 310 | GUI_COLOR WIDGET__GetBkColor (WM_HWIN hObj); |
NirT | 0:c00e6c923941 | 311 | int WIDGET__GetXSize (const WIDGET * pWidget); |
NirT | 0:c00e6c923941 | 312 | int WIDGET__GetYSize (const WIDGET * pWidget); |
NirT | 0:c00e6c923941 | 313 | void WIDGET__GetClientRect (WIDGET * pWidget, GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 314 | void WIDGET__GetInsideRect (WIDGET * pWidget, GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 315 | void WIDGET__Init (WIDGET * pWidget, int Id, U16 State); |
NirT | 0:c00e6c923941 | 316 | void WIDGET__RotateRect90 (WIDGET * pWidget, GUI_RECT * pDest, const GUI_RECT * pRect); |
NirT | 0:c00e6c923941 | 317 | void WIDGET__SetScrollState (WM_HWIN hWin, const WM_SCROLL_STATE * pVState, const WM_SCROLL_STATE * pState); |
NirT | 0:c00e6c923941 | 318 | void WIDGET__FillStringInRect (const char * pText, const GUI_RECT * pFillRect, const GUI_RECT * pTextRectMax, const GUI_RECT * pTextRectAct); |
NirT | 0:c00e6c923941 | 319 | |
NirT | 0:c00e6c923941 | 320 | /********************************************************************* |
NirT | 0:c00e6c923941 | 321 | * |
NirT | 0:c00e6c923941 | 322 | * API routines |
NirT | 0:c00e6c923941 | 323 | * |
NirT | 0:c00e6c923941 | 324 | ********************************************************************** |
NirT | 0:c00e6c923941 | 325 | */ |
NirT | 0:c00e6c923941 | 326 | void WIDGET_SetState (WM_HWIN hObj, int State); |
NirT | 0:c00e6c923941 | 327 | void WIDGET_AndState (WM_HWIN hObj, int State); |
NirT | 0:c00e6c923941 | 328 | void WIDGET_OrState (WM_HWIN hObj, int State); |
NirT | 0:c00e6c923941 | 329 | int WIDGET_HandleActive (WM_HWIN hObj, WM_MESSAGE* pMsg); |
NirT | 0:c00e6c923941 | 330 | int WIDGET_GetState (WM_HWIN hObj); |
NirT | 0:c00e6c923941 | 331 | int WIDGET_SetWidth (WM_HWIN hObj, int Width); |
NirT | 0:c00e6c923941 | 332 | |
NirT | 0:c00e6c923941 | 333 | void WIDGET_EFFECT_3D_DrawUp(void); |
NirT | 0:c00e6c923941 | 334 | |
NirT | 0:c00e6c923941 | 335 | const WIDGET_EFFECT* WIDGET_SetDefaultEffect(const WIDGET_EFFECT* pEffect); |
NirT | 0:c00e6c923941 | 336 | |
NirT | 0:c00e6c923941 | 337 | void WIDGET_SetEffect (WM_HWIN hObj, const WIDGET_EFFECT* pEffect); |
NirT | 0:c00e6c923941 | 338 | |
NirT | 0:c00e6c923941 | 339 | const WIDGET_EFFECT* WIDGET_GetDefaultEffect(void); |
NirT | 0:c00e6c923941 | 340 | |
NirT | 0:c00e6c923941 | 341 | void WIDGET_EFFECT_3D_SetColor (unsigned Index, GUI_COLOR Color); |
NirT | 0:c00e6c923941 | 342 | void WIDGET_EFFECT_3D1L_SetColor (unsigned Index, GUI_COLOR Color); |
NirT | 0:c00e6c923941 | 343 | void WIDGET_EFFECT_3D2L_SetColor (unsigned Index, GUI_COLOR Color); |
NirT | 0:c00e6c923941 | 344 | void WIDGET_EFFECT_Simple_SetColor(unsigned Index, GUI_COLOR Color); |
NirT | 0:c00e6c923941 | 345 | |
NirT | 0:c00e6c923941 | 346 | GUI_COLOR WIDGET_EFFECT_3D_GetColor (unsigned Index); |
NirT | 0:c00e6c923941 | 347 | GUI_COLOR WIDGET_EFFECT_3D1L_GetColor (unsigned Index); |
NirT | 0:c00e6c923941 | 348 | GUI_COLOR WIDGET_EFFECT_3D2L_GetColor (unsigned Index); |
NirT | 0:c00e6c923941 | 349 | GUI_COLOR WIDGET_EFFECT_Simple_GetColor(unsigned Index); |
NirT | 0:c00e6c923941 | 350 | |
NirT | 0:c00e6c923941 | 351 | int WIDGET_EFFECT_3D_GetNumColors(void); |
NirT | 0:c00e6c923941 | 352 | int WIDGET_EFFECT_3D1L_GetNumColors(void); |
NirT | 0:c00e6c923941 | 353 | int WIDGET_EFFECT_3D2L_GetNumColors(void); |
NirT | 0:c00e6c923941 | 354 | int WIDGET_EFFECT_Simple_GetNumColors(void); |
NirT | 0:c00e6c923941 | 355 | |
NirT | 0:c00e6c923941 | 356 | /********************************************************************* |
NirT | 0:c00e6c923941 | 357 | * |
NirT | 0:c00e6c923941 | 358 | * Compatibility macros |
NirT | 0:c00e6c923941 | 359 | * |
NirT | 0:c00e6c923941 | 360 | ********************************************************************** |
NirT | 0:c00e6c923941 | 361 | */ |
NirT | 0:c00e6c923941 | 362 | #define WIDGET_SetDefaultEffect_3D() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D) |
NirT | 0:c00e6c923941 | 363 | #define WIDGET_SetDefaultEffect_3D1L() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D1L) |
NirT | 0:c00e6c923941 | 364 | #define WIDGET_SetDefaultEffect_3D2L() WIDGET_SetDefaultEffect(&WIDGET_Effect_3D2L) |
NirT | 0:c00e6c923941 | 365 | #define WIDGET_SetDefaultEffect_None() WIDGET_SetDefaultEffect(&WIDGET_Effect_None) |
NirT | 0:c00e6c923941 | 366 | #define WIDGET_SetDefaultEffect_Simple() WIDGET_SetDefaultEffect(&WIDGET_Effect_Simple) |
NirT | 0:c00e6c923941 | 367 | |
NirT | 0:c00e6c923941 | 368 | #endif /* GUI_WINSUPPORT */ |
NirT | 0:c00e6c923941 | 369 | |
NirT | 0:c00e6c923941 | 370 | #if defined(__cplusplus) |
NirT | 0:c00e6c923941 | 371 | } |
NirT | 0:c00e6c923941 | 372 | #endif |
NirT | 0:c00e6c923941 | 373 | |
NirT | 0:c00e6c923941 | 374 | #endif /* SLIDER_H */ |
NirT | 0:c00e6c923941 | 375 | |
NirT | 0:c00e6c923941 | 376 | |
NirT | 0:c00e6c923941 | 377 | |
NirT | 0:c00e6c923941 | 378 |