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