RT1050 GUI demo using emWin library

Committer:
alejandroRL
Date:
Thu Sep 20 19:16:34 2018 +0000
Revision:
0:dd702039127a
emWin GUI Demo for RT1050

Who changed what in which revision?

UserRevisionLine numberNew contents of line
alejandroRL 0:dd702039127a 1 /*********************************************************************
alejandroRL 0:dd702039127a 2 * SEGGER Microcontroller GmbH & Co. KG *
alejandroRL 0:dd702039127a 3 * Solutions for real time microcontroller applications *
alejandroRL 0:dd702039127a 4 **********************************************************************
alejandroRL 0:dd702039127a 5 * *
alejandroRL 0:dd702039127a 6 * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG *
alejandroRL 0:dd702039127a 7 * *
alejandroRL 0:dd702039127a 8 * Internet: www.segger.com Support: support@segger.com *
alejandroRL 0:dd702039127a 9 * *
alejandroRL 0:dd702039127a 10 **********************************************************************
alejandroRL 0:dd702039127a 11
alejandroRL 0:dd702039127a 12 ** emWin V5.38 - Graphical user interface for embedded applications **
alejandroRL 0:dd702039127a 13 All Intellectual Property rights in the Software belongs to SEGGER.
alejandroRL 0:dd702039127a 14 emWin is protected by international copyright laws. Knowledge of the
alejandroRL 0:dd702039127a 15 source code may not be used to write a similar product. This file may
alejandroRL 0:dd702039127a 16 only be used in accordance with the following terms:
alejandroRL 0:dd702039127a 17
alejandroRL 0:dd702039127a 18 The software has been licensed to NXP Semiconductors USA, Inc. whose
alejandroRL 0:dd702039127a 19 registered office is situated at 411 E. Plumeria Drive, San Jose,
alejandroRL 0:dd702039127a 20 CA 95134, USA solely for the purposes of creating libraries for
alejandroRL 0:dd702039127a 21 NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and
alejandroRL 0:dd702039127a 22 distributed under the terms and conditions of the NXP End User License
alejandroRL 0:dd702039127a 23 Agreement.
alejandroRL 0:dd702039127a 24 Full source code is available at: www.segger.com
alejandroRL 0:dd702039127a 25
alejandroRL 0:dd702039127a 26 We appreciate your understanding and fairness.
alejandroRL 0:dd702039127a 27 ----------------------------------------------------------------------
alejandroRL 0:dd702039127a 28 Licensing information
alejandroRL 0:dd702039127a 29
alejandroRL 0:dd702039127a 30 Licensor: SEGGER Microcontroller Systems LLC
alejandroRL 0:dd702039127a 31 Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
alejandroRL 0:dd702039127a 32 Licensed SEGGER software: emWin
alejandroRL 0:dd702039127a 33 License number: GUI-00186
alejandroRL 0:dd702039127a 34 License model: emWin License Agreement, dated August 20th 2011
alejandroRL 0:dd702039127a 35 Licensed product: -
alejandroRL 0:dd702039127a 36 Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4
alejandroRL 0:dd702039127a 37 Licensed number of seats: -
alejandroRL 0:dd702039127a 38 ----------------------------------------------------------------------
alejandroRL 0:dd702039127a 39 File : WM.h
alejandroRL 0:dd702039127a 40 Purpose : Windows manager include
alejandroRL 0:dd702039127a 41 ----------------------------------------------------------------------
alejandroRL 0:dd702039127a 42 */
alejandroRL 0:dd702039127a 43
alejandroRL 0:dd702039127a 44 #ifndef WM_H /* Make sure we only include it once */
alejandroRL 0:dd702039127a 45 #define WM_H
alejandroRL 0:dd702039127a 46
alejandroRL 0:dd702039127a 47
alejandroRL 0:dd702039127a 48 #include "GUI_ConfDefaults.h"
alejandroRL 0:dd702039127a 49 #include "GUI_Type.h" /* Needed because of typedefs only */
alejandroRL 0:dd702039127a 50 #include "WM_GUI.h" /* Some functions needed by GUI routines */
alejandroRL 0:dd702039127a 51 #include "GUI.h"
alejandroRL 0:dd702039127a 52
alejandroRL 0:dd702039127a 53 #if defined(__cplusplus)
alejandroRL 0:dd702039127a 54 extern "C" { /* Make sure we have C-declarations in C++ programs */
alejandroRL 0:dd702039127a 55 #endif
alejandroRL 0:dd702039127a 56
alejandroRL 0:dd702039127a 57 /* Static memory devices */
alejandroRL 0:dd702039127a 58 #ifndef WM_SUPPORT_STATIC_MEMDEV
alejandroRL 0:dd702039127a 59 #define WM_SUPPORT_STATIC_MEMDEV GUI_SUPPORT_MEMDEV
alejandroRL 0:dd702039127a 60 #endif
alejandroRL 0:dd702039127a 61
alejandroRL 0:dd702039127a 62 /* Support for transparency. Switching it off makes Wm smaller and faster */
alejandroRL 0:dd702039127a 63 #ifndef WM_SUPPORT_TRANSPARENCY
alejandroRL 0:dd702039127a 64 #define WM_SUPPORT_TRANSPARENCY 1 /* Should be defined outside of GUI_WINSUPPORT because of '#if GUI_WINSUPPORT && WM_SUPPORT_TRANSPARENCY' in some files */
alejandroRL 0:dd702039127a 65 #endif
alejandroRL 0:dd702039127a 66
alejandroRL 0:dd702039127a 67 /* This is for tests only. It will fill the invalid area of a window.
alejandroRL 0:dd702039127a 68 Can be used for debugging. */
alejandroRL 0:dd702039127a 69 #ifndef WM_SUPPORT_DIAG
alejandroRL 0:dd702039127a 70 #ifdef WIN32 /* In simulation */
alejandroRL 0:dd702039127a 71 #define WM_SUPPORT_DIAG GUI_WINSUPPORT
alejandroRL 0:dd702039127a 72 #else
alejandroRL 0:dd702039127a 73 #define WM_SUPPORT_DIAG 0
alejandroRL 0:dd702039127a 74 #endif
alejandroRL 0:dd702039127a 75 #endif
alejandroRL 0:dd702039127a 76
alejandroRL 0:dd702039127a 77 /* Make sure we actually have configured windows. If we have not,
alejandroRL 0:dd702039127a 78 there is no point for a windows manager and it will therefor not
alejandroRL 0:dd702039127a 79 generate any code !
alejandroRL 0:dd702039127a 80 */
alejandroRL 0:dd702039127a 81
alejandroRL 0:dd702039127a 82 #if GUI_WINSUPPORT
alejandroRL 0:dd702039127a 83
alejandroRL 0:dd702039127a 84 /*********************************************************************
alejandroRL 0:dd702039127a 85 *
alejandroRL 0:dd702039127a 86 * Config defaults
alejandroRL 0:dd702039127a 87 */
alejandroRL 0:dd702039127a 88 #ifndef WM_ASSERT
alejandroRL 0:dd702039127a 89 #define WM_ASSERT(expr) GUI_DEBUG_ASSERT(expr)
alejandroRL 0:dd702039127a 90 #endif
alejandroRL 0:dd702039127a 91
alejandroRL 0:dd702039127a 92 #ifndef WM_SUPPORT_TOUCH
alejandroRL 0:dd702039127a 93 #define WM_SUPPORT_TOUCH GUI_SUPPORT_TOUCH
alejandroRL 0:dd702039127a 94 #endif
alejandroRL 0:dd702039127a 95
alejandroRL 0:dd702039127a 96 /* Allow older API calls */
alejandroRL 0:dd702039127a 97 #ifndef WM_COMPATIBLE_MODE
alejandroRL 0:dd702039127a 98 #define WM_COMPATIBLE_MODE 1
alejandroRL 0:dd702039127a 99 #endif
alejandroRL 0:dd702039127a 100
alejandroRL 0:dd702039127a 101 /* Send a message if visibility of a window has changed */
alejandroRL 0:dd702039127a 102 #ifndef WM_SUPPORT_NOTIFY_VIS_CHANGED
alejandroRL 0:dd702039127a 103 #define WM_SUPPORT_NOTIFY_VIS_CHANGED 0
alejandroRL 0:dd702039127a 104 #endif
alejandroRL 0:dd702039127a 105
alejandroRL 0:dd702039127a 106 #ifndef WM_SUPPORT_CPP
alejandroRL 0:dd702039127a 107 #if defined (_MSC_VER)
alejandroRL 0:dd702039127a 108 #define WM_SUPPORT_CPP 1
alejandroRL 0:dd702039127a 109 #else
alejandroRL 0:dd702039127a 110 #define WM_SUPPORT_CPP 0
alejandroRL 0:dd702039127a 111 #endif
alejandroRL 0:dd702039127a 112 #endif
alejandroRL 0:dd702039127a 113
alejandroRL 0:dd702039127a 114 /*********************************************************************
alejandroRL 0:dd702039127a 115 *
alejandroRL 0:dd702039127a 116 * Locking macros
alejandroRL 0:dd702039127a 117 */
alejandroRL 0:dd702039127a 118 #define WM_LOCK() GUI_LOCK()
alejandroRL 0:dd702039127a 119 #define WM_UNLOCK() GUI_UNLOCK()
alejandroRL 0:dd702039127a 120
alejandroRL 0:dd702039127a 121 #define WM_LOCK_H(hWin) (WM_Obj *)GUI_LOCK_H(hWin)
alejandroRL 0:dd702039127a 122
alejandroRL 0:dd702039127a 123 /*********************************************************************
alejandroRL 0:dd702039127a 124 *
alejandroRL 0:dd702039127a 125 * Data types
alejandroRL 0:dd702039127a 126 */
alejandroRL 0:dd702039127a 127 typedef struct WM_WINDOW_INFO WM_WINDOW_INFO;
alejandroRL 0:dd702039127a 128
alejandroRL 0:dd702039127a 129 struct WM_WINDOW_INFO {
alejandroRL 0:dd702039127a 130 GUI_HMEM hWin;
alejandroRL 0:dd702039127a 131 GUI_HMEM hParent;
alejandroRL 0:dd702039127a 132 GUI_HMEM hFirstChild;
alejandroRL 0:dd702039127a 133 GUI_HMEM hNext;
alejandroRL 0:dd702039127a 134 GUI_RECT Rect;
alejandroRL 0:dd702039127a 135 U32 Status;
alejandroRL 0:dd702039127a 136 U32 DebugId;
alejandroRL 0:dd702039127a 137 WM_WINDOW_INFO * pNext;
alejandroRL 0:dd702039127a 138 };
alejandroRL 0:dd702039127a 139
alejandroRL 0:dd702039127a 140 typedef struct {
alejandroRL 0:dd702039127a 141 int Key, PressedCnt;
alejandroRL 0:dd702039127a 142 } WM_KEY_INFO;
alejandroRL 0:dd702039127a 143
alejandroRL 0:dd702039127a 144 typedef struct {
alejandroRL 0:dd702039127a 145 int NumItems, v, PageSize;
alejandroRL 0:dd702039127a 146 } WM_SCROLL_STATE;
alejandroRL 0:dd702039127a 147
alejandroRL 0:dd702039127a 148 typedef struct {
alejandroRL 0:dd702039127a 149 int Done;
alejandroRL 0:dd702039127a 150 int ReturnValue;
alejandroRL 0:dd702039127a 151 } WM_DIALOG_STATUS;
alejandroRL 0:dd702039127a 152
alejandroRL 0:dd702039127a 153 typedef struct {
alejandroRL 0:dd702039127a 154 int x,y;
alejandroRL 0:dd702039127a 155 U8 State;
alejandroRL 0:dd702039127a 156 U8 StatePrev;
alejandroRL 0:dd702039127a 157 } WM_PID_STATE_CHANGED_INFO;
alejandroRL 0:dd702039127a 158
alejandroRL 0:dd702039127a 159 typedef struct {
alejandroRL 0:dd702039127a 160 int Cmd;
alejandroRL 0:dd702039127a 161 int dx, dy, da;
alejandroRL 0:dd702039127a 162 int xPos, yPos;
alejandroRL 0:dd702039127a 163 int Period;
alejandroRL 0:dd702039127a 164 int SnapX;
alejandroRL 0:dd702039127a 165 int SnapY;
alejandroRL 0:dd702039127a 166 int FinalMove;
alejandroRL 0:dd702039127a 167 U32 Flags;
alejandroRL 0:dd702039127a 168 GUI_PID_STATE * pState;
alejandroRL 0:dd702039127a 169 GUI_HMEM hContext;
alejandroRL 0:dd702039127a 170 } WM_MOTION_INFO;
alejandroRL 0:dd702039127a 171
alejandroRL 0:dd702039127a 172 typedef struct {
alejandroRL 0:dd702039127a 173 I32 FactorMin; // Minimum factor to be used (<< 16)
alejandroRL 0:dd702039127a 174 I32 FactorMax; // Maximum factor to be used (<< 16)
alejandroRL 0:dd702039127a 175 U32 xSize; // Native xSize of window to be zoomed in pixels
alejandroRL 0:dd702039127a 176 U32 ySize; // Native ySize of window to be zoomed in pixels
alejandroRL 0:dd702039127a 177 U32 xSizeParent; // xSize of parent window
alejandroRL 0:dd702039127a 178 U32 ySizeParent; // ySize of parent window
alejandroRL 0:dd702039127a 179 I32 Factor0; // Primary factor when starting zoom gesture (<< 16)
alejandroRL 0:dd702039127a 180 int xPos0; // Primary window position in x when starting the gesture
alejandroRL 0:dd702039127a 181 int yPos0; // Primary window position in y when starting the gesture
alejandroRL 0:dd702039127a 182 GUI_POINT Center0; // Primary center point when starting the gesture
alejandroRL 0:dd702039127a 183 } WM_ZOOM_INFO;
alejandroRL 0:dd702039127a 184
alejandroRL 0:dd702039127a 185 typedef struct {
alejandroRL 0:dd702039127a 186 int Flags; // Information regarding gesture type
alejandroRL 0:dd702039127a 187 GUI_POINT Point; // Relative movement
alejandroRL 0:dd702039127a 188 GUI_POINT Center; // Center point for zooming
alejandroRL 0:dd702039127a 189 I32 Angle; // Angle between the touch points
alejandroRL 0:dd702039127a 190 I32 Factor; // Current zoom factor
alejandroRL 0:dd702039127a 191 WM_ZOOM_INFO * pZoomInfo; // Pointer to WM_ZOOM_INFO structure
alejandroRL 0:dd702039127a 192 } WM_GESTURE_INFO;
alejandroRL 0:dd702039127a 193
alejandroRL 0:dd702039127a 194 typedef struct {
alejandroRL 0:dd702039127a 195 int dx, dy;
alejandroRL 0:dd702039127a 196 } WM_MOVE_INFO;
alejandroRL 0:dd702039127a 197
alejandroRL 0:dd702039127a 198 /*********************************************************************
alejandroRL 0:dd702039127a 199 *
alejandroRL 0:dd702039127a 200 * Gesture flags for multi touch support
alejandroRL 0:dd702039127a 201 */
alejandroRL 0:dd702039127a 202 #define WM_GF_BEGIN (1 << 0)
alejandroRL 0:dd702039127a 203 #define WM_GF_END (1 << 1)
alejandroRL 0:dd702039127a 204 #define WM_GF_PAN (1 << 2)
alejandroRL 0:dd702039127a 205 #define WM_GF_ZOOM (1 << 3)
alejandroRL 0:dd702039127a 206 #define WM_GF_ROTATE (1 << 4)
alejandroRL 0:dd702039127a 207 #define WM_GF_DTAP (1 << 5)
alejandroRL 0:dd702039127a 208
alejandroRL 0:dd702039127a 209 /*********************************************************************
alejandroRL 0:dd702039127a 210 *
alejandroRL 0:dd702039127a 211 * Messages Ids
alejandroRL 0:dd702039127a 212 *
alejandroRL 0:dd702039127a 213 * The following is the list of windows messages.
alejandroRL 0:dd702039127a 214 */
alejandroRL 0:dd702039127a 215 #define WM_CREATE 0x0001 /* The first message received, right after client has actually been created */
alejandroRL 0:dd702039127a 216 #define WM_MOVE 0x0003 /* window has been moved (Same as WIN32) */
alejandroRL 0:dd702039127a 217
alejandroRL 0:dd702039127a 218 #define WM_SIZE 0x0005 /* Is sent to a window after its size has changed (Same as WIN32, do not change !) */
alejandroRL 0:dd702039127a 219
alejandroRL 0:dd702039127a 220 #define WM_DELETE 11 /* Delete (Destroy) command: This tells the client to free its data strutures since the window
alejandroRL 0:dd702039127a 221 it is associates with no longer exists.*/
alejandroRL 0:dd702039127a 222 #define WM_TOUCH 0x0240 /* Touch screen message */
alejandroRL 0:dd702039127a 223 #define WM_TOUCH_CHILD 13 /* Touch screen message to ancestors */
alejandroRL 0:dd702039127a 224 #define WM_KEY 14 /* Key has been pressed */
alejandroRL 0:dd702039127a 225
alejandroRL 0:dd702039127a 226 #define WM_PAINT 0x000F /* Repaint window (because content is (partially) invalid */
alejandroRL 0:dd702039127a 227
alejandroRL 0:dd702039127a 228 #if GUI_SUPPORT_MOUSE
alejandroRL 0:dd702039127a 229 #define WM_MOUSEOVER 16 /* Mouse has moved, no key pressed */
alejandroRL 0:dd702039127a 230 #define WM_MOUSEOVER_END 18 /* Mouse has moved, no key pressed */
alejandroRL 0:dd702039127a 231 #endif
alejandroRL 0:dd702039127a 232
alejandroRL 0:dd702039127a 233 #define WM_PID_STATE_CHANGED 17 /* Pointer input device state has changed */
alejandroRL 0:dd702039127a 234
alejandroRL 0:dd702039127a 235 #define WM_GET_INSIDE_RECT 20 /* get inside rectangle: client rectangle minus pixels lost to effect */
alejandroRL 0:dd702039127a 236 #define WM_GET_ID 21 /* Get id of widget */
alejandroRL 0:dd702039127a 237 #define WM_SET_ID 22 /* Set id of widget */
alejandroRL 0:dd702039127a 238 #define WM_GET_CLIENT_WINDOW 23 /* Get window handle of client window. Default is the same as window */
alejandroRL 0:dd702039127a 239 #define WM_CAPTURE_RELEASED 24 /* Let window know that mouse capture is over */
alejandroRL 0:dd702039127a 240
alejandroRL 0:dd702039127a 241 #define WM_INIT_DIALOG 29 /* Inform dialog that it is ready for init */
alejandroRL 0:dd702039127a 242
alejandroRL 0:dd702039127a 243 #define WM_SET_FOCUS 30 /* Inform window that it has gotten or lost the focus */
alejandroRL 0:dd702039127a 244 #define WM_GET_ACCEPT_FOCUS 31 /* Find out if window can accept the focus */
alejandroRL 0:dd702039127a 245 #define WM_NOTIFY_CHILD_HAS_FOCUS 32 /* Sent to parent when child receives / loses focus */
alejandroRL 0:dd702039127a 246
alejandroRL 0:dd702039127a 247 #define WM_NOTIFY_OWNER_KEY 33 /* Some widgets (e.g. listbox) notify owner when receiving key messages */
alejandroRL 0:dd702039127a 248
alejandroRL 0:dd702039127a 249 #define WM_GET_BKCOLOR 34 /* Return back ground color (only frame window and similar) */
alejandroRL 0:dd702039127a 250 #define WM_GET_SCROLL_STATE 35 /* Query state of scroll bar */
alejandroRL 0:dd702039127a 251
alejandroRL 0:dd702039127a 252 #define WM_SET_SCROLL_STATE 36 /* Set scroll info ... only effective for scrollbars */
alejandroRL 0:dd702039127a 253
alejandroRL 0:dd702039127a 254 #define WM_NOTIFY_CLIENTCHANGE 37 /* Client area may have changed */
alejandroRL 0:dd702039127a 255 #define WM_NOTIFY_PARENT 38 /* Notify parent. Information is detailed as notification code */
alejandroRL 0:dd702039127a 256 #define WM_NOTIFY_PARENT_REFLECTION 39 /* Notify parent reflection.
alejandroRL 0:dd702039127a 257 Sometimes send back as a result of the WM_NOTIFY_PARENT message
alejandroRL 0:dd702039127a 258 to let child react on behalf of its parent.
alejandroRL 0:dd702039127a 259 Information is detailed as notification code */
alejandroRL 0:dd702039127a 260 #define WM_NOTIFY_ENABLE 40 /* Enable or disable widget */
alejandroRL 0:dd702039127a 261 #define WM_NOTIFY_VIS_CHANGED 41 /* Visibility of a window has or may have changed */
alejandroRL 0:dd702039127a 262
alejandroRL 0:dd702039127a 263 #define WM_HANDLE_DIALOG_STATUS 42 /* Set or get dialog status */
alejandroRL 0:dd702039127a 264 #define WM_GET_RADIOGROUP 43 /* Send to all siblings and children of a radio control when
alejandroRL 0:dd702039127a 265 selection changed */
alejandroRL 0:dd702039127a 266 #define WM_MENU 44 /* Send to owner window of menu widget */
alejandroRL 0:dd702039127a 267 #define WM_SCREENSIZE_CHANGED 45 /* Send to all windows when size of screen has changed */
alejandroRL 0:dd702039127a 268 #define WM_PRE_PAINT 46 /* Send to a window before it receives a WM_PAINT message */
alejandroRL 0:dd702039127a 269 #define WM_POST_PAINT 47 /* Send to a window after (the last) WM_PAINT message */
alejandroRL 0:dd702039127a 270
alejandroRL 0:dd702039127a 271 #define WM_MOTION 48 /* Automatic motion messages */
alejandroRL 0:dd702039127a 272
alejandroRL 0:dd702039127a 273 #define WM_GET_WINDOW_ID 49 /* Return widget type specific Id (DebugId) */
alejandroRL 0:dd702039127a 274
alejandroRL 0:dd702039127a 275 #define WM_PRE_BANDING 50
alejandroRL 0:dd702039127a 276 #define WM_POST_BANDING 51
alejandroRL 0:dd702039127a 277
alejandroRL 0:dd702039127a 278 #define WM_GESTURE 0x0119 /* Gesture message */
alejandroRL 0:dd702039127a 279
alejandroRL 0:dd702039127a 280 #define WM_TIMER 0x0113 /* Timer has expired (Keep the same as WIN32) */
alejandroRL 0:dd702039127a 281 #define WM_WIDGET 0x0300 /* 256 messages reserved for Widget messages */
alejandroRL 0:dd702039127a 282 #define WM_USER 0x0400 /* Reserved for user messages ... (Keep the same as WIN32) */
alejandroRL 0:dd702039127a 283
alejandroRL 0:dd702039127a 284 /*********************************************************************
alejandroRL 0:dd702039127a 285 *
alejandroRL 0:dd702039127a 286 * Motion messages
alejandroRL 0:dd702039127a 287 */
alejandroRL 0:dd702039127a 288 #define WM_MOTION_INIT 0
alejandroRL 0:dd702039127a 289 #define WM_MOTION_MOVE 1
alejandroRL 0:dd702039127a 290 #define WM_MOTION_GETPOS 2
alejandroRL 0:dd702039127a 291 #define WM_MOTION_GETCONTEXT 3
alejandroRL 0:dd702039127a 292
alejandroRL 0:dd702039127a 293 /*********************************************************************
alejandroRL 0:dd702039127a 294 *
alejandroRL 0:dd702039127a 295 * Motion flags
alejandroRL 0:dd702039127a 296 */
alejandroRL 0:dd702039127a 297 #define WM_MOTION_MANAGE_BY_WINDOW (1 << 0) // Window movement is managed by window itself
alejandroRL 0:dd702039127a 298
alejandroRL 0:dd702039127a 299 /*********************************************************************
alejandroRL 0:dd702039127a 300 *
alejandroRL 0:dd702039127a 301 * Notification codes
alejandroRL 0:dd702039127a 302 *
alejandroRL 0:dd702039127a 303 * The following is the list of notification codes send
alejandroRL 0:dd702039127a 304 * with the WM_NOTIFY_PARENT message
alejandroRL 0:dd702039127a 305 */
alejandroRL 0:dd702039127a 306 #define WM_NOTIFICATION_CLICKED 1
alejandroRL 0:dd702039127a 307 #define WM_NOTIFICATION_RELEASED 2
alejandroRL 0:dd702039127a 308 #define WM_NOTIFICATION_MOVED_OUT 3
alejandroRL 0:dd702039127a 309 #define WM_NOTIFICATION_SEL_CHANGED 4
alejandroRL 0:dd702039127a 310 #define WM_NOTIFICATION_VALUE_CHANGED 5
alejandroRL 0:dd702039127a 311 #define WM_NOTIFICATION_SCROLLBAR_ADDED 6 /* Scroller added */
alejandroRL 0:dd702039127a 312 #define WM_NOTIFICATION_CHILD_DELETED 7 /* Inform window that child is about to be deleted */
alejandroRL 0:dd702039127a 313 #define WM_NOTIFICATION_GOT_FOCUS 8
alejandroRL 0:dd702039127a 314 #define WM_NOTIFICATION_LOST_FOCUS 9
alejandroRL 0:dd702039127a 315 #define WM_NOTIFICATION_SCROLL_CHANGED 10
alejandroRL 0:dd702039127a 316
alejandroRL 0:dd702039127a 317 #define WM_NOTIFICATION_WIDGET 11 /* Space for widget defined notifications */
alejandroRL 0:dd702039127a 318 #define WM_NOTIFICATION_USER 16 /* Space for application (user) defined notifications */
alejandroRL 0:dd702039127a 319
alejandroRL 0:dd702039127a 320 /*********************************************************************
alejandroRL 0:dd702039127a 321 *
alejandroRL 0:dd702039127a 322 * Memory management
alejandroRL 0:dd702039127a 323 */
alejandroRL 0:dd702039127a 324 #define WM_HWIN GUI_HWIN
alejandroRL 0:dd702039127a 325 #define WM_HWIN_NULL GUI_HMEM_NULL
alejandroRL 0:dd702039127a 326 #define WM_HMEM GUI_HMEM
alejandroRL 0:dd702039127a 327 #define WM_HMEM_NULL GUI_HMEM_NULL
alejandroRL 0:dd702039127a 328 #define WM_HTIMER GUI_HMEM
alejandroRL 0:dd702039127a 329
alejandroRL 0:dd702039127a 330 /*********************************************************************
alejandroRL 0:dd702039127a 331 *
alejandroRL 0:dd702039127a 332 * Window defines
alejandroRL 0:dd702039127a 333 */
alejandroRL 0:dd702039127a 334 #define WM_HBKWIN WM_GetDesktopWindow() /* Handle of background window */
alejandroRL 0:dd702039127a 335 #define WM_UNATTACHED ((WM_HMEM) - 1) /* Do not attach to a window */
alejandroRL 0:dd702039127a 336
alejandroRL 0:dd702039127a 337 /*********************************************************************
alejandroRL 0:dd702039127a 338 *
alejandroRL 0:dd702039127a 339 * Window create flags.
alejandroRL 0:dd702039127a 340 *
alejandroRL 0:dd702039127a 341 * These flags can be passed to the create window
alejandroRL 0:dd702039127a 342 * function as flag-parameter. The flags are combinable using the
alejandroRL 0:dd702039127a 343 * binary or operator.
alejandroRL 0:dd702039127a 344 */
alejandroRL 0:dd702039127a 345 #define WM_CF_HASTRANS (1UL << 0) /* Has transparency. Needs to be defined for windows which do not fill the entire
alejandroRL 0:dd702039127a 346 section of their (client) rectangle. */
alejandroRL 0:dd702039127a 347 #define WM_CF_HIDE (0UL << 1) /* Hide window after creation (default !) */
alejandroRL 0:dd702039127a 348 #define WM_CF_SHOW (1UL << 1) /* Show window after creation */
alejandroRL 0:dd702039127a 349 #define WM_CF_MEMDEV (1UL << 2) /* Use memory device for redraws */
alejandroRL 0:dd702039127a 350 #define WM_CF_STAYONTOP (1UL << 3) /* Stay on top */
alejandroRL 0:dd702039127a 351 #define WM_CF_DISABLED (1UL << 4) /* Disabled: Does not receive PID (mouse & touch) input */
alejandroRL 0:dd702039127a 352
alejandroRL 0:dd702039127a 353 /* Create only flags ... Not available as status flags */
alejandroRL 0:dd702039127a 354 #define WM_CF_ACTIVATE (1UL << 5) /* If automatic activation upon creation of window is desired */
alejandroRL 0:dd702039127a 355 #define WM_CF_FGND (0UL << 6) /* Put window in foreground after creation (default !) */
alejandroRL 0:dd702039127a 356 #define WM_CF_BGND (1UL << 6) /* Put window in background after creation */
alejandroRL 0:dd702039127a 357
alejandroRL 0:dd702039127a 358 /* Anchor flags */
alejandroRL 0:dd702039127a 359 #define WM_CF_ANCHOR_RIGHT (1UL << 7) /* Right anchor ... If parent is resized, distance to right will remain const (left is default) */
alejandroRL 0:dd702039127a 360 #define WM_CF_ANCHOR_BOTTOM (1UL << 8) /* Bottom anchor ... If parent is resized, distance to bottom will remain const (top is default) */
alejandroRL 0:dd702039127a 361 #define WM_CF_ANCHOR_LEFT (1UL << 9) /* Left anchor ... If parent is resized, distance to left will remain const (left is default) */
alejandroRL 0:dd702039127a 362 #define WM_CF_ANCHOR_TOP (1UL << 10) /* Top anchor ... If parent is resized, distance to top will remain const (top is default) */
alejandroRL 0:dd702039127a 363
alejandroRL 0:dd702039127a 364 #define WM_CF_CONST_OUTLINE (1UL << 11) /* Constant outline. This is relevant for transparent windows only. If a window is transparent
alejandroRL 0:dd702039127a 365 and does not have a constant outline, its background is invalided instead of the window itself.
alejandroRL 0:dd702039127a 366 This causes add. computation time when redrawing. */
alejandroRL 0:dd702039127a 367 #define WM_CF_LATE_CLIP (1UL << 12)
alejandroRL 0:dd702039127a 368 #define WM_CF_MEMDEV_ON_REDRAW (1UL << 13)
alejandroRL 0:dd702039127a 369
alejandroRL 0:dd702039127a 370 #define WM_SF_INVALID_DRAW (1UL << 14)
alejandroRL 0:dd702039127a 371 #define WM_SF_DELETE (1UL << 15) /* Marks the window to be deleted within WM_Exec() when no callback routine is executed */
alejandroRL 0:dd702039127a 372
alejandroRL 0:dd702039127a 373 #define WM_CF_STATIC (1UL << 16) /* Use static memory device for redraws */
alejandroRL 0:dd702039127a 374
alejandroRL 0:dd702039127a 375 #define WM_CF_MOTION_X (1UL << 17) /* Window can be moved automatically in X axis */
alejandroRL 0:dd702039127a 376 #define WM_CF_MOTION_Y (1UL << 18) /* Window can be moved automatically in Y axis */
alejandroRL 0:dd702039127a 377
alejandroRL 0:dd702039127a 378 #define WM_CF_GESTURE (1UL << 19) /* Marks the window to be a able to receive gesture messages */
alejandroRL 0:dd702039127a 379
alejandroRL 0:dd702039127a 380 #define WM_CF_ZOOM (1UL << 20) /* Window can be scaled automatically by multi touch gesture input */
alejandroRL 0:dd702039127a 381
alejandroRL 0:dd702039127a 382 #define WM_CF_MOTION_R (1UL << 21) // Window can be rotated
alejandroRL 0:dd702039127a 383
alejandroRL 0:dd702039127a 384 /*********************************************************************
alejandroRL 0:dd702039127a 385 *
alejandroRL 0:dd702039127a 386 * Window manager types
alejandroRL 0:dd702039127a 387 */
alejandroRL 0:dd702039127a 388 typedef struct WM_Obj WM_Obj;
alejandroRL 0:dd702039127a 389 typedef struct WM_MESSAGE WM_MESSAGE;
alejandroRL 0:dd702039127a 390
alejandroRL 0:dd702039127a 391 typedef void WM_CALLBACK( WM_MESSAGE * pMsg);
alejandroRL 0:dd702039127a 392
alejandroRL 0:dd702039127a 393 struct WM_MESSAGE {
alejandroRL 0:dd702039127a 394 int MsgId; /* type of message */
alejandroRL 0:dd702039127a 395 WM_HWIN hWin; /* Destination window */
alejandroRL 0:dd702039127a 396 WM_HWIN hWinSrc; /* Source window */
alejandroRL 0:dd702039127a 397 union {
alejandroRL 0:dd702039127a 398 const void * p; /* Some messages need more info ... Pointer is declared "const" because some systems (M16C) have 4 byte const, byte 2 byte default ptrs */
alejandroRL 0:dd702039127a 399 int v;
alejandroRL 0:dd702039127a 400 GUI_COLOR Color;
alejandroRL 0:dd702039127a 401 } Data;
alejandroRL 0:dd702039127a 402 };
alejandroRL 0:dd702039127a 403
alejandroRL 0:dd702039127a 404 struct WM_Obj {
alejandroRL 0:dd702039127a 405 GUI_RECT Rect; /* Outer dimensions of window */
alejandroRL 0:dd702039127a 406 GUI_RECT InvalidRect; /* Invalid rectangle */
alejandroRL 0:dd702039127a 407 WM_CALLBACK* cb; /* Ptr to notification callback */
alejandroRL 0:dd702039127a 408 WM_HWIN hNextLin; /* Next window in linear list */
alejandroRL 0:dd702039127a 409 WM_HWIN hParent;
alejandroRL 0:dd702039127a 410 WM_HWIN hFirstChild;
alejandroRL 0:dd702039127a 411 WM_HWIN hNext;
alejandroRL 0:dd702039127a 412 #if WM_SUPPORT_STATIC_MEMDEV
alejandroRL 0:dd702039127a 413 GUI_MEMDEV_Handle hMem; /* Static memory device */
alejandroRL 0:dd702039127a 414 #endif
alejandroRL 0:dd702039127a 415 U32 Status; /* Status flags */
alejandroRL 0:dd702039127a 416 #if WM_SUPPORT_CPP
alejandroRL 0:dd702039127a 417 void * ObjPtr;
alejandroRL 0:dd702039127a 418 #endif
alejandroRL 0:dd702039127a 419 };
alejandroRL 0:dd702039127a 420
alejandroRL 0:dd702039127a 421 typedef void WM_tfPollPID(void);
alejandroRL 0:dd702039127a 422 typedef void WM_tfForEach(WM_HWIN hWin, void * pData);
alejandroRL 0:dd702039127a 423
alejandroRL 0:dd702039127a 424 typedef void (* WM_tfInvalidateParent) (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop);
alejandroRL 0:dd702039127a 425 typedef void (* WM_tfInvalidateDrawFunc)(WM_HWIN hWin);
alejandroRL 0:dd702039127a 426 typedef void (* WM_tfPaint1Func) (WM_HWIN hWin);
alejandroRL 0:dd702039127a 427
alejandroRL 0:dd702039127a 428 typedef struct {
alejandroRL 0:dd702039127a 429 WM_HMEM hTimer;
alejandroRL 0:dd702039127a 430 WM_HWIN hWin;
alejandroRL 0:dd702039127a 431 int UserId;
alejandroRL 0:dd702039127a 432 } WM_TIMER_OBJ;
alejandroRL 0:dd702039127a 433
alejandroRL 0:dd702039127a 434 /*********************************************************************
alejandroRL 0:dd702039127a 435 *
alejandroRL 0:dd702039127a 436 * General control routines
alejandroRL 0:dd702039127a 437 */
alejandroRL 0:dd702039127a 438 void WM_Activate (void);
alejandroRL 0:dd702039127a 439 void WM_Deactivate(void);
alejandroRL 0:dd702039127a 440 void WM_Init (void);
alejandroRL 0:dd702039127a 441 int WM_Exec (void); /* Execute all jobs ... Return 0 if nothing was done. */
alejandroRL 0:dd702039127a 442 int WM_Exec1 (void); // Execute only one job
alejandroRL 0:dd702039127a 443 U32 WM_SetCreateFlags(U32 Flags);
alejandroRL 0:dd702039127a 444 WM_tfPollPID * WM_SetpfPollPID(WM_tfPollPID * pf);
alejandroRL 0:dd702039127a 445
alejandroRL 0:dd702039127a 446 /*********************************************************************
alejandroRL 0:dd702039127a 447 *
alejandroRL 0:dd702039127a 448 * Window manager interface
alejandroRL 0:dd702039127a 449 */
alejandroRL 0:dd702039127a 450 void WM_AttachWindow (WM_HWIN hWin, WM_HWIN hParent);
alejandroRL 0:dd702039127a 451 void WM_AttachWindowAt (WM_HWIN hWin, WM_HWIN hParent, int x, int y);
alejandroRL 0:dd702039127a 452 int WM_CheckScrollPos (WM_SCROLL_STATE * pScrollState, int Pos, int LowerDist, int UpperDist); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 453 void WM_ClrHasTrans (WM_HWIN hWin);
alejandroRL 0:dd702039127a 454 WM_HWIN WM_CreateWindow (int x0, int y0, int xSize, int ySize, U32 Style, WM_CALLBACK * cb, int NumExtraBytes);
alejandroRL 0:dd702039127a 455 WM_HWIN WM_CreateWindowAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hWinParent, U32 Style, WM_CALLBACK* cb, int NumExtraBytes);
alejandroRL 0:dd702039127a 456 void WM_DeleteWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 457 void WM_DetachWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 458 void WM_EnableGestures (WM_HWIN hWin, int OnOff);
alejandroRL 0:dd702039127a 459 int WM_GetHasTrans (WM_HWIN hWin);
alejandroRL 0:dd702039127a 460 WM_HWIN WM_GetFocussedWindow (void);
alejandroRL 0:dd702039127a 461 int WM_GetInvalidRect (WM_HWIN hWin, GUI_RECT * pRect);
alejandroRL 0:dd702039127a 462 int WM_GetStayOnTop (WM_HWIN hWin);
alejandroRL 0:dd702039127a 463 void WM_HideWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 464 void WM_InvalidateArea (const GUI_RECT * pRect);
alejandroRL 0:dd702039127a 465 void WM_InvalidateRect (WM_HWIN hWin, const GUI_RECT * pRect);
alejandroRL 0:dd702039127a 466 void WM_InvalidateWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 467 void WM_InvalidateWindowAndDescsEx(WM_HWIN hWin, const GUI_RECT * pInvalidRect, U16 Flags);
alejandroRL 0:dd702039127a 468 void WM_InvalidateWindowAndDescs (WM_HWIN hWin); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 469 int WM_IsEnabled (WM_HWIN hObj);
alejandroRL 0:dd702039127a 470 char WM_IsCompletelyCovered (WM_HWIN hWin); /* Checks if the window is completely covered by other windows */
alejandroRL 0:dd702039127a 471 char WM_IsCompletelyVisible (WM_HWIN hWin); /* Is the window completely visible ? */
alejandroRL 0:dd702039127a 472 int WM_IsFocussable (WM_HWIN hWin);
alejandroRL 0:dd702039127a 473 int WM_IsVisible (WM_HWIN hWin);
alejandroRL 0:dd702039127a 474 int WM_IsWindow (WM_HWIN hWin); /* Check validity */
alejandroRL 0:dd702039127a 475 void WM_SetAnchor (WM_HWIN hWin, U16 AnchorFlags);
alejandroRL 0:dd702039127a 476 void WM_SetHasTrans (WM_HWIN hWin);
alejandroRL 0:dd702039127a 477 void WM_SetId (WM_HWIN hObj, int Id);
alejandroRL 0:dd702039127a 478 void WM_SetStayOnTop (WM_HWIN hWin, int OnOff);
alejandroRL 0:dd702039127a 479 void WM_SetTransState (WM_HWIN hWin, unsigned State);
alejandroRL 0:dd702039127a 480 void WM_ShowWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 481 void WM_ValidateRect (WM_HWIN hWin, const GUI_RECT * pRect);
alejandroRL 0:dd702039127a 482 void WM_ValidateWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 483
alejandroRL 0:dd702039127a 484 /* Gesture support */
alejandroRL 0:dd702039127a 485 void WM_GESTURE_Enable (int OnOff);
alejandroRL 0:dd702039127a 486 int WM_GESTURE_EnableEx(int OnOff, int MaxFactor);
alejandroRL 0:dd702039127a 487 void WM_GESTURE_Exec (void);
alejandroRL 0:dd702039127a 488 I32 WM_GESTURE_SetThresholdAngle(I32 ThresholdAngle);
alejandroRL 0:dd702039127a 489 I32 WM_GESTURE_SetThresholdDist (I32 ThresholdDist);
alejandroRL 0:dd702039127a 490
alejandroRL 0:dd702039127a 491 /* Motion support */
alejandroRL 0:dd702039127a 492 void WM_MOTION_Enable (int OnOff);
alejandroRL 0:dd702039127a 493 void WM_MOTION_SetMovement (WM_HWIN hWin, int Axis, I32 Speed, I32 Dist);
alejandroRL 0:dd702039127a 494 void WM_MOTION_SetMotion (WM_HWIN hWin, int Axis, I32 Speed, I32 Deceleration);
alejandroRL 0:dd702039127a 495 void WM_MOTION_SetMoveable (WM_HWIN hWin, U32 Flags, int OnOff);
alejandroRL 0:dd702039127a 496 void WM_MOTION_SetDeceleration (WM_HWIN hWin, int Axis, I32 Deceleration);
alejandroRL 0:dd702039127a 497 unsigned WM_MOTION_SetDefaultPeriod(unsigned Period);
alejandroRL 0:dd702039127a 498 void WM_MOTION_SetSpeed (WM_HWIN hWin, int Axis, I32 Velocity);
alejandroRL 0:dd702039127a 499
alejandroRL 0:dd702039127a 500 /* Motion support, private interface */
alejandroRL 0:dd702039127a 501 WM_HMEM WM_MOTION__CreateContext(void);
alejandroRL 0:dd702039127a 502 void WM_MOTION__DeleteContext(WM_HMEM hContext);
alejandroRL 0:dd702039127a 503
alejandroRL 0:dd702039127a 504 /* Motion support, private function(s) */
alejandroRL 0:dd702039127a 505 void WM__SetMotionCallback (void(* cbMotion) (GUI_PID_STATE * pState, void * p));
alejandroRL 0:dd702039127a 506
alejandroRL 0:dd702039127a 507 /* Static memory devices */
alejandroRL 0:dd702039127a 508 #if (GUI_SUPPORT_MEMDEV)
alejandroRL 0:dd702039127a 509 #define GUI_MEMDEV_EDGE_LEFT 0
alejandroRL 0:dd702039127a 510 #define GUI_MEMDEV_EDGE_RIGHT 1
alejandroRL 0:dd702039127a 511 #define GUI_MEMDEV_EDGE_TOP 2
alejandroRL 0:dd702039127a 512 #define GUI_MEMDEV_EDGE_BOTTOM 3
alejandroRL 0:dd702039127a 513
alejandroRL 0:dd702039127a 514 int GUI_MEMDEV_BlendWinBk (WM_HWIN hWin, int Period, U32 BlendColor, U8 BlendIntens);
alejandroRL 0:dd702039127a 515 int GUI_MEMDEV_BlurAndBlendWinBk(WM_HWIN hWin, int Period, U8 BlurDepth, U32 BlendColor, U8 BlendIntens);
alejandroRL 0:dd702039127a 516 int GUI_MEMDEV_BlurWinBk (WM_HWIN hWin, int Period, U8 BlurDepth);
alejandroRL 0:dd702039127a 517 void GUI_MEMDEV_CreateStatic (WM_HWIN hWin);
alejandroRL 0:dd702039127a 518 GUI_MEMDEV_Handle GUI_MEMDEV_CreateWindowDevice(WM_HWIN hWin);
alejandroRL 0:dd702039127a 519 int GUI_MEMDEV_FadeInWindow (WM_HWIN hWin, int Period);
alejandroRL 0:dd702039127a 520 int GUI_MEMDEV_FadeOutWindow (WM_HWIN hWin, int Period);
alejandroRL 0:dd702039127a 521 GUI_MEMDEV_Handle GUI_MEMDEV_GetStaticDevice (WM_HWIN hWin);
alejandroRL 0:dd702039127a 522 GUI_MEMDEV_Handle GUI_MEMDEV_GetWindowDevice (WM_HWIN hWin);
alejandroRL 0:dd702039127a 523 int GUI_MEMDEV_MoveInWindow (WM_HWIN hWin, int x, int y, int a180, int Period);
alejandroRL 0:dd702039127a 524 int GUI_MEMDEV_MoveOutWindow (WM_HWIN hWin, int x, int y, int a180, int Period);
alejandroRL 0:dd702039127a 525 void GUI_MEMDEV_Paint1Static (WM_HWIN hWin); /* not to be documented */
alejandroRL 0:dd702039127a 526 int GUI_MEMDEV_ShiftInWindow (WM_HWIN hWin, int Period, int Direction);
alejandroRL 0:dd702039127a 527 int GUI_MEMDEV_ShiftOutWindow (WM_HWIN hWin, int Period, int Direction);
alejandroRL 0:dd702039127a 528 int GUI_MEMDEV_SwapWindow (WM_HWIN hWin, int Period, int Edge);
alejandroRL 0:dd702039127a 529
alejandroRL 0:dd702039127a 530 void GUI_MEMDEV__CreateStatic (WM_HWIN hWin);
alejandroRL 0:dd702039127a 531 #endif
alejandroRL 0:dd702039127a 532
alejandroRL 0:dd702039127a 533 /* Move/resize windows */
alejandroRL 0:dd702039127a 534 void WM_MoveWindow (WM_HWIN hWin, int dx, int dy);
alejandroRL 0:dd702039127a 535 void WM_ResizeWindow (WM_HWIN hWin, int dx, int dy);
alejandroRL 0:dd702039127a 536 void WM_MoveTo (WM_HWIN hWin, int x, int y);
alejandroRL 0:dd702039127a 537 void WM_MoveChildTo (WM_HWIN hWin, int x, int y);
alejandroRL 0:dd702039127a 538 void WM_SetSize (WM_HWIN hWin, int XSize, int YSize);
alejandroRL 0:dd702039127a 539 void WM_SetWindowPos (WM_HWIN hWin, int xPos, int yPos, int xSize, int ySize);
alejandroRL 0:dd702039127a 540 int WM_SetXSize (WM_HWIN hWin, int xSize);
alejandroRL 0:dd702039127a 541 int WM_SetYSize (WM_HWIN hWin, int ySize);
alejandroRL 0:dd702039127a 542 int WM_SetScrollbarH (WM_HWIN hWin, int OnOff); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 543 int WM_SetScrollbarV (WM_HWIN hWin, int OnOff); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 544
alejandroRL 0:dd702039127a 545 /* ToolTip support */
alejandroRL 0:dd702039127a 546 #define WM_TOOLTIP_PI_FIRST 0
alejandroRL 0:dd702039127a 547 #define WM_TOOLTIP_PI_SHOW 1
alejandroRL 0:dd702039127a 548 #define WM_TOOLTIP_PI_NEXT 2
alejandroRL 0:dd702039127a 549
alejandroRL 0:dd702039127a 550 #define WM_TOOLTIP_CI_BK 0
alejandroRL 0:dd702039127a 551 #define WM_TOOLTIP_CI_FRAME 1
alejandroRL 0:dd702039127a 552 #define WM_TOOLTIP_CI_TEXT 2
alejandroRL 0:dd702039127a 553
alejandroRL 0:dd702039127a 554 typedef WM_HMEM WM_TOOLTIP_HANDLE;
alejandroRL 0:dd702039127a 555
alejandroRL 0:dd702039127a 556 typedef struct {
alejandroRL 0:dd702039127a 557 int Id;
alejandroRL 0:dd702039127a 558 const char * pText;
alejandroRL 0:dd702039127a 559 } TOOLTIP_INFO;
alejandroRL 0:dd702039127a 560
alejandroRL 0:dd702039127a 561 int WM_TOOLTIP_AddTool (WM_TOOLTIP_HANDLE hToolTip, WM_HWIN hTool, const char * pText);
alejandroRL 0:dd702039127a 562 WM_TOOLTIP_HANDLE WM_TOOLTIP_Create (WM_HWIN hDlg, const TOOLTIP_INFO * pInfo, unsigned NumItems);
alejandroRL 0:dd702039127a 563 void WM_TOOLTIP_Delete (WM_TOOLTIP_HANDLE hToolTip);
alejandroRL 0:dd702039127a 564 GUI_COLOR WM_TOOLTIP_SetDefaultColor (unsigned Index, GUI_COLOR Color);
alejandroRL 0:dd702039127a 565 const GUI_FONT * WM_TOOLTIP_SetDefaultFont (const GUI_FONT * pFont);
alejandroRL 0:dd702039127a 566 unsigned WM_TOOLTIP_SetDefaultPeriod(unsigned Index, unsigned Period);
alejandroRL 0:dd702039127a 567
alejandroRL 0:dd702039127a 568 /* ToolTip support, private */
alejandroRL 0:dd702039127a 569 void WM__SetToolTipCallback(void(* cbToolTip)(GUI_PID_STATE * pState, WM_HWIN));
alejandroRL 0:dd702039127a 570
alejandroRL 0:dd702039127a 571 /* Timer */
alejandroRL 0:dd702039127a 572 #ifdef GUI_X_CREATE_TIMER
alejandroRL 0:dd702039127a 573 int WM_CreateTimer (WM_HWIN hWin, int UserID, int Period, int Mode); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 574 void WM_DeleteTimer (WM_HWIN hWin, int UserId); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 575 #else
alejandroRL 0:dd702039127a 576 WM_HMEM WM_CreateTimer (WM_HWIN hWin, int UserID, int Period, int Mode); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 577 void WM_DeleteTimer (WM_HMEM hTimer); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 578 void WM_RestartTimer(WM_HMEM hTimer, int Period);
alejandroRL 0:dd702039127a 579 #endif
alejandroRL 0:dd702039127a 580 int WM_GetTimerId(WM_HTIMER hTimer);
alejandroRL 0:dd702039127a 581
alejandroRL 0:dd702039127a 582 /* Diagnostics */
alejandroRL 0:dd702039127a 583 int WM_GetNumWindows(void);
alejandroRL 0:dd702039127a 584 int WM_GetNumInvalidWindows(void);
alejandroRL 0:dd702039127a 585
alejandroRL 0:dd702039127a 586 /* Scroll state related functions */
alejandroRL 0:dd702039127a 587 void WM_CheckScrollBounds(WM_SCROLL_STATE * pScrollState); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 588 int WM_GetScrollPosH (WM_HWIN hWin);
alejandroRL 0:dd702039127a 589 int WM_GetScrollPosV (WM_HWIN hWin);
alejandroRL 0:dd702039127a 590 void WM_SetScrollPosH (WM_HWIN hWin, unsigned ScrollPos);
alejandroRL 0:dd702039127a 591 void WM_SetScrollPosV (WM_HWIN hWin, unsigned ScrollPos);
alejandroRL 0:dd702039127a 592 int WM_SetScrollValue (WM_SCROLL_STATE * pScrollState, int v); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 593
alejandroRL 0:dd702039127a 594 /* Get / Set (new) callback function */
alejandroRL 0:dd702039127a 595 WM_CALLBACK * WM_SetCallback(WM_HWIN hWin, WM_CALLBACK * cb);
alejandroRL 0:dd702039127a 596 WM_CALLBACK * WM_GetCallback(WM_HWIN hWin);
alejandroRL 0:dd702039127a 597
alejandroRL 0:dd702039127a 598 /* Get size/origin of a window */
alejandroRL 0:dd702039127a 599 void WM_GetClientRect (GUI_RECT * pRect);
alejandroRL 0:dd702039127a 600 void WM_GetClientRectEx (WM_HWIN hWin, GUI_RECT * pRect);
alejandroRL 0:dd702039127a 601 void WM_GetInsideRect (GUI_RECT * pRect);
alejandroRL 0:dd702039127a 602 void WM_GetInsideRectEx (WM_HWIN hWin, GUI_RECT * pRect);
alejandroRL 0:dd702039127a 603 void WM_GetInsideRectExScrollbar(WM_HWIN hWin, GUI_RECT * pRect); /* not to be documented (may change in future version) */
alejandroRL 0:dd702039127a 604 void WM_GetWindowRect (GUI_RECT * pRect);
alejandroRL 0:dd702039127a 605 void WM_GetWindowRectEx (WM_HWIN hWin, GUI_RECT * pRect);
alejandroRL 0:dd702039127a 606 int WM_GetOrgX (void);
alejandroRL 0:dd702039127a 607 int WM_GetOrgY (void);
alejandroRL 0:dd702039127a 608 int WM_GetWindowOrgX (WM_HWIN hWin);
alejandroRL 0:dd702039127a 609 int WM_GetWindowOrgY (WM_HWIN hWin);
alejandroRL 0:dd702039127a 610 int WM_GetWindowSizeX (WM_HWIN hWin);
alejandroRL 0:dd702039127a 611 int WM_GetWindowSizeY (WM_HWIN hWin);
alejandroRL 0:dd702039127a 612 WM_HWIN WM_GetFirstChild (WM_HWIN hWin);
alejandroRL 0:dd702039127a 613 WM_HWIN WM_GetNextSibling (WM_HWIN hWin);
alejandroRL 0:dd702039127a 614 WM_HWIN WM_GetParent (WM_HWIN hWin);
alejandroRL 0:dd702039127a 615 WM_HWIN WM_GetPrevSibling (WM_HWIN hWin);
alejandroRL 0:dd702039127a 616 int WM_GetId (WM_HWIN hWin);
alejandroRL 0:dd702039127a 617 WM_HWIN WM_GetScrollbarV (WM_HWIN hWin);
alejandroRL 0:dd702039127a 618 WM_HWIN WM_GetScrollbarH (WM_HWIN hWin);
alejandroRL 0:dd702039127a 619 WM_HWIN WM_GetScrollPartner (WM_HWIN hWin);
alejandroRL 0:dd702039127a 620 WM_HWIN WM_GetClientWindow (WM_HWIN hObj);
alejandroRL 0:dd702039127a 621 GUI_COLOR WM_GetBkColor (WM_HWIN hObj);
alejandroRL 0:dd702039127a 622
alejandroRL 0:dd702039127a 623 /* Change Z-Order of windows */
alejandroRL 0:dd702039127a 624 void WM_BringToBottom(WM_HWIN hWin);
alejandroRL 0:dd702039127a 625 void WM_BringToTop(WM_HWIN hWin);
alejandroRL 0:dd702039127a 626
alejandroRL 0:dd702039127a 627 GUI_COLOR WM_SetDesktopColor (GUI_COLOR Color);
alejandroRL 0:dd702039127a 628 GUI_COLOR WM_SetDesktopColorEx(GUI_COLOR Color, unsigned int LayerIndex);
alejandroRL 0:dd702039127a 629 void WM_SetDesktopColors (GUI_COLOR Color);
alejandroRL 0:dd702039127a 630
alejandroRL 0:dd702039127a 631 /* Select window used for drawing operations */
alejandroRL 0:dd702039127a 632 WM_HWIN WM_SelectWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 633 WM_HWIN WM_GetActiveWindow (void);
alejandroRL 0:dd702039127a 634 void WM_Paint (WM_HWIN hObj);
alejandroRL 0:dd702039127a 635 void WM_Update (WM_HWIN hWin);
alejandroRL 0:dd702039127a 636 void WM_PaintWindowAndDescs (WM_HWIN hWin);
alejandroRL 0:dd702039127a 637 void WM_UpdateWindowAndDescs (WM_HWIN hWin);
alejandroRL 0:dd702039127a 638
alejandroRL 0:dd702039127a 639 /* Get foreground/background windows */
alejandroRL 0:dd702039127a 640 WM_HWIN WM_GetDesktopWindow (void);
alejandroRL 0:dd702039127a 641 WM_HWIN WM_GetDesktopWindowEx(unsigned int LayerIndex);
alejandroRL 0:dd702039127a 642
alejandroRL 0:dd702039127a 643 /* Reduce clipping area of a window */
alejandroRL 0:dd702039127a 644 const GUI_RECT * WM_SetUserClipRect(const GUI_RECT * pRect);
alejandroRL 0:dd702039127a 645 void WM_SetDefault (void);
alejandroRL 0:dd702039127a 646
alejandroRL 0:dd702039127a 647 /* Use of memory devices */
alejandroRL 0:dd702039127a 648 void WM_EnableMemdev (WM_HWIN hWin);
alejandroRL 0:dd702039127a 649 void WM_DisableMemdev (WM_HWIN hWin);
alejandroRL 0:dd702039127a 650
alejandroRL 0:dd702039127a 651 /* Automatic use of multiple buffers */
alejandroRL 0:dd702039127a 652 int WM_MULTIBUF_Enable (int OnOff);
alejandroRL 0:dd702039127a 653 int WM_MULTIBUF_EnableEx(int OnOff, U32 LayerMask);
alejandroRL 0:dd702039127a 654
alejandroRL 0:dd702039127a 655 extern const GUI_MULTIBUF_API * WM_MULTIBUF__pAPI;
alejandroRL 0:dd702039127a 656
alejandroRL 0:dd702039127a 657 typedef void (* T_WM_EXEC_GESTURE)(void);
alejandroRL 0:dd702039127a 658
alejandroRL 0:dd702039127a 659 extern T_WM_EXEC_GESTURE WM__pExecGestures;
alejandroRL 0:dd702039127a 660
alejandroRL 0:dd702039127a 661 /* ... */
alejandroRL 0:dd702039127a 662 int WM_OnKey(int Key, int Pressed);
alejandroRL 0:dd702039127a 663 void WM_MakeModal(WM_HWIN hWin);
alejandroRL 0:dd702039127a 664 int WM_SetModalLayer(int LayerIndex);
alejandroRL 0:dd702039127a 665 int WM_GetModalLayer(void);
alejandroRL 0:dd702039127a 666
alejandroRL 0:dd702039127a 667 /*********************************************************************
alejandroRL 0:dd702039127a 668 *
alejandroRL 0:dd702039127a 669 * Message related functions
alejandroRL 0:dd702039127a 670 *
alejandroRL 0:dd702039127a 671 * Please note that some of these functions do not yet show up in the
alejandroRL 0:dd702039127a 672 * documentation, as they should not be required by application program.
alejandroRL 0:dd702039127a 673 */
alejandroRL 0:dd702039127a 674 void WM_NotifyParent (WM_HWIN hWin, int Notification);
alejandroRL 0:dd702039127a 675 void WM_SendMessage (WM_HWIN hWin, WM_MESSAGE * p);
alejandroRL 0:dd702039127a 676 void WM_SendMessageNoPara (WM_HWIN hWin, int MsgId); /* not to be documented (may change in future */
alejandroRL 0:dd702039127a 677 void WM_DefaultProc (WM_MESSAGE * pMsg);
alejandroRL 0:dd702039127a 678 int WM_BroadcastMessage (WM_MESSAGE * pMsg);
alejandroRL 0:dd702039127a 679 void WM_SetScrollState (WM_HWIN hWin, const WM_SCROLL_STATE * pState);
alejandroRL 0:dd702039127a 680 void WM_SetEnableState (WM_HWIN hItem, int State);
alejandroRL 0:dd702039127a 681 void WM_SendToParent (WM_HWIN hWin, WM_MESSAGE * pMsg);
alejandroRL 0:dd702039127a 682 int WM_HasFocus (WM_HWIN hWin);
alejandroRL 0:dd702039127a 683 int WM_SetFocus (WM_HWIN hWin);
alejandroRL 0:dd702039127a 684 WM_HWIN WM_SetFocusOnNextChild (WM_HWIN hParent); /* Set the focus to the next child */
alejandroRL 0:dd702039127a 685 WM_HWIN WM_SetFocusOnPrevChild (WM_HWIN hParent); /* Set the focus to the previous child */
alejandroRL 0:dd702039127a 686 WM_HWIN WM_GetDialogItem (WM_HWIN hWin, int Id);
alejandroRL 0:dd702039127a 687 void WM_EnableWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 688 void WM_DisableWindow (WM_HWIN hWin);
alejandroRL 0:dd702039127a 689 void WM_GetScrollState (WM_HWIN hObj, WM_SCROLL_STATE * pScrollState);
alejandroRL 0:dd702039127a 690
alejandroRL 0:dd702039127a 691 /*********************************************************************
alejandroRL 0:dd702039127a 692 *
alejandroRL 0:dd702039127a 693 * Managing user data
alejandroRL 0:dd702039127a 694 */
alejandroRL 0:dd702039127a 695 int WM_GetUserData (WM_HWIN hWin, void * pDest, int SizeOfBuffer);
alejandroRL 0:dd702039127a 696 int WM_SetUserData (WM_HWIN hWin, const void * pSrc, int SizeOfBuffer);
alejandroRL 0:dd702039127a 697 int WM__GetUserDataEx(WM_HWIN hWin, void * pDest, int NumBytes, int SizeOfObject);
alejandroRL 0:dd702039127a 698 int WM__SetUserDataEx(WM_HWIN hWin, const void * pSrc, int NumBytes, int SizeOfObject);
alejandroRL 0:dd702039127a 699
alejandroRL 0:dd702039127a 700 /*********************************************************************
alejandroRL 0:dd702039127a 701 *
alejandroRL 0:dd702039127a 702 * Capturing input focus
alejandroRL 0:dd702039127a 703 */
alejandroRL 0:dd702039127a 704 int WM_HasCaptured (WM_HWIN hWin);
alejandroRL 0:dd702039127a 705 void WM_SetCapture (WM_HWIN hObj, int AutoRelease);
alejandroRL 0:dd702039127a 706 void WM_SetCaptureMove(WM_HWIN hWin, const GUI_PID_STATE * pState, int MinVisibility, int LimitTop); /* Not yet documented */
alejandroRL 0:dd702039127a 707 void WM_ReleaseCapture(void);
alejandroRL 0:dd702039127a 708
alejandroRL 0:dd702039127a 709 /*********************************************************************
alejandroRL 0:dd702039127a 710 *
alejandroRL 0:dd702039127a 711 * Misc routines
alejandroRL 0:dd702039127a 712 */
alejandroRL 0:dd702039127a 713 int WM_HandlePID (void);
alejandroRL 0:dd702039127a 714 WM_HWIN WM_Screen2hWin (int x, int y);
alejandroRL 0:dd702039127a 715 WM_HWIN WM_Screen2hWinEx (WM_HWIN hStop, int x, int y);
alejandroRL 0:dd702039127a 716 void WM_ForEachDesc (WM_HWIN hWin, WM_tfForEach * pcb, void * pData);
alejandroRL 0:dd702039127a 717 void WM_SetScreenSize (int xSize, int ySize);
alejandroRL 0:dd702039127a 718 int WM_PollSimMsg (void);
alejandroRL 0:dd702039127a 719 int WM_GetWindowInfo (WM_WINDOW_INFO * pInfo, int FirstWindow);
alejandroRL 0:dd702039127a 720
alejandroRL 0:dd702039127a 721 /*********************************************************************
alejandroRL 0:dd702039127a 722 *
alejandroRL 0:dd702039127a 723 * Diagnostics routines
alejandroRL 0:dd702039127a 724 */
alejandroRL 0:dd702039127a 725 #if (WM_SUPPORT_DIAG)
alejandroRL 0:dd702039127a 726 void WM_DIAG_EnableInvalidationColoring(int OnOff);
alejandroRL 0:dd702039127a 727 #endif
alejandroRL 0:dd702039127a 728
alejandroRL 0:dd702039127a 729 /*********************************************************************
alejandroRL 0:dd702039127a 730 *
alejandroRL 0:dd702039127a 731 * Macros for compatibility with older versions
alejandroRL 0:dd702039127a 732 */
alejandroRL 0:dd702039127a 733 #if WM_COMPATIBLE_MODE
alejandroRL 0:dd702039127a 734 #define HBWIN WM_HWIN
alejandroRL 0:dd702039127a 735 #define HBWIN_NULL WM_HWIN_NULL
alejandroRL 0:dd702039127a 736
alejandroRL 0:dd702039127a 737 #define WM_HideWin WM_HideWindow
alejandroRL 0:dd702039127a 738 #define WM_ShowWin WM_ShowWindow
alejandroRL 0:dd702039127a 739 #define WM_GetKey GUI_GetKey
alejandroRL 0:dd702039127a 740 #define WM_WaitKey GUI_WaitKey
alejandroRL 0:dd702039127a 741
alejandroRL 0:dd702039127a 742 #define WM_ExecIdle WM_Exec
alejandroRL 0:dd702039127a 743 #define WM_ExecIdle1 WM_Exec1
alejandroRL 0:dd702039127a 744
alejandroRL 0:dd702039127a 745 #define WM_Invalidate WM_InvalidateWindow
alejandroRL 0:dd702039127a 746 #define WM_GetWinRect WM_GetWindowRect
alejandroRL 0:dd702039127a 747 #define WM_GetWinOrgX WM_GetWindowOrgX
alejandroRL 0:dd702039127a 748 #define WM_GetWinOrgY WM_GetWindowOrgY
alejandroRL 0:dd702039127a 749 #define WM_GetWinSizeX WM_GetWindowSizeX
alejandroRL 0:dd702039127a 750 #define WM_GetWinSizeY WM_GetWindowSizeY
alejandroRL 0:dd702039127a 751 #define WM_GetXSize WM_GetWindowSizeX
alejandroRL 0:dd702039127a 752 #define WM_GetYSize WM_GetWindowSizeY
alejandroRL 0:dd702039127a 753 #define WM_SelWin WM_SelectWindow
alejandroRL 0:dd702039127a 754 #define WM_GetBackgroundWindow WM_GetDesktopWindow
alejandroRL 0:dd702039127a 755 #define WM_GetForegroundWindow 0
alejandroRL 0:dd702039127a 756 #define WM_SetForegroundWindow WM_BringToTop
alejandroRL 0:dd702039127a 757 #define WM_SetUserClipArea WM_SetUserClipRect
alejandroRL 0:dd702039127a 758
alejandroRL 0:dd702039127a 759
alejandroRL 0:dd702039127a 760 #define WM_Start()
alejandroRL 0:dd702039127a 761 #define WM_Stop()
alejandroRL 0:dd702039127a 762 #define WM_SetBkWindowColor(Color) WM_SetDesktopColor(Color)
alejandroRL 0:dd702039127a 763
alejandroRL 0:dd702039127a 764 #endif
alejandroRL 0:dd702039127a 765
alejandroRL 0:dd702039127a 766
alejandroRL 0:dd702039127a 767 #endif /* GUI_WINSUPPORT */
alejandroRL 0:dd702039127a 768
alejandroRL 0:dd702039127a 769 #if defined(__cplusplus)
alejandroRL 0:dd702039127a 770 }
alejandroRL 0:dd702039127a 771 #endif
alejandroRL 0:dd702039127a 772
alejandroRL 0:dd702039127a 773 #endif /* WM_H */
alejandroRL 0:dd702039127a 774
alejandroRL 0:dd702039127a 775 /*************************** End of file ****************************/