📄 wm.h
字号:
/*
*********************************************************************************************************
* uC/GUI
* Universal graphic software for embedded applications
*
* (c) Copyright 2002, Micrium Inc., Weston, FL
* (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
* 礐/GUI is protected by international copyright laws. Knowledge of the
* source code may not be used to write a similar product. This file may
* only be used in accordance with a license and should not be redistributed
* in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File : WM.h
Purpose : Windows manager include
----------------------------------------------------------------------
*/
#ifndef WM_H /* Make sure we only include it once */
#define WM_H
#include "GUIType.h" /* Needed because of typedefs only */
#include "WM_GUI.h" /* Some functions needed by GUI routines */
/* Make sure we actually have configured windows. If we have not,
there is no point for a windows manager and it will therefor not
generate any code !
*/
#if GUI_WINSUPPORT
/*
*************************************************************
* *
* Defaults for configuration switches *
* *
*************************************************************
*/
#ifndef WM_ASSERT
#define WM_ASSERT(expr) GUI_DEBUG_ASSERT(expr)
#endif
#ifndef WM_SUPPORT_TOUCH
#define WM_SUPPORT_TOUCH GUI_SUPPORT_TOUCH
#endif
#ifndef WM_SUPPORT_OBSTRUCT
#define WM_SUPPORT_OBSTRUCT 1
#endif
#ifndef WM_SUPPORT_TRANSPARENCY
#define WM_SUPPORT_TRANSPARENCY 1
#endif
#ifndef WM_COMPATIBLE_MODE
#define WM_COMPATIBLE_MODE 1
#endif
/*
*************************************************************
* *
* Configuration check *
* *
*************************************************************
*/
/*
*************************************************************
* *
* Locking macros *
* *
*************************************************************
For performance reasons, the windows manager uses the same locking mechanisms
as the GUI layer. The advantage is that wiht a single call to GUI_LOCK both
the graphic level and the WM level are covered.
*/
#define WM_LOCK() GUI_LOCK()
#define WM_UNLOCK() GUI_UNLOCK()
/************************************************************
*
* Data types
*
*************************************************************
*/
typedef struct {
int Key, PressedCnt;
} WM_KEY_INFO;
typedef struct {
int NumItems, v, PageSize;
} WM_SCROLL_STATE;
/*********************************************************************
*
* Messages Ids
The following is the list of windows messages.
*/
#define WM_CREATE 0x0001 /* The first message received, right after client has actually been created */
#define WM_COVER 2 /* Window has been partially covered. Normally, there is no reaction to this event. */
#define WM_MOVE 0x0003 /* window has been moved (Same as WIN32) */
#define WM_DELETE 4 /* Delete (Destroy) command: This tells the client to free its data strutures since the window
it is associates with no longer exists.*/
#define WM_SIZE 0x0005 /* Is sent to a window after its size has changed (Same as WIN32) */
#define WM_SHOW 8 /* windows has just received the show command */
#define WM_HIDE 9 /* windows has just received the hide command */
#define WM_FGND 10 /* window has been made top of window stack */
#define WM_BGND 11 /* window has just been put to bottom of stack */
#define WM_TOUCH 12 /* touch screen message */
#define WM_KEY 13 /* Key has been pressed */
#if GUI_SUPPORT_MOUSE
#define WM_MOUSEOVER 14 /* Mouse has moved, no key pressed */
#endif
#define WM_PAINT 0x000F /* Repaint window (because content is (partially) invalid */
#define WM_GET_INSIDE_RECT 102 /* get inside rectangle: client rectangle minus pixels lost to effect */
#define WM_GETORG 104
#define WM_GET_ID 105 /* Get id of widget */
#define WM_SET_ID 106 /* Set id of widget */
#define WM_GET_CLIENT_WINDOW 107 /* Get window handle of client window. Default is the same as window */
#define WM_CAPTURE_RELEASED 108 /* Let window know that mouse capture is over */
#define WM_INIT_DIALOG 109 /* Inform dialog that it is ready for init */
#define WM_SET_FOCUS 110 /* Inform window that it has gotten or lost the focus */
#define WM_GET_ACCEPT_FOCUS 111 /* Find out if window can accept the focus */
#define WM_NOTIFY_CHILD_HAS_FOCUS 112
#define WM_GET_BKCOLOR 114 /* Return back ground color (only frame window and similar) */
#define WM_SET_ENABLE 115 /* Enable or disable widget */
#define WM_GET_SCROLL_STATE 116 /* Query state of scroll bar */
#define WM_SET_SCROLL_STATE 119 /* Set scroll info ... only effective for scrollbars */
#define WM_NOTIFY_PARENT 121 /* Notify parent. Information is detailed as notification code */
#define WM_NOTIFY_PARENT_REFLECTION 122 /* Notify parent reflection.
Sometimes send back as a result of the WM_NOTIFY_PARENT message
to let child react on behalf of its parent.
Information is detailed as notification code */
#define WM_TIMER 0x0113 /* Timer has expired (Keep the same as WIN32) */
#define WM_USER 0x0400 /* Reserved for user messages ... (Keep the same as WIN32) */
/*********************************************************************
*
* Notification codes
The following is the list of notification codes send
with the WM_NOTIFY_PARENT message
*/
#define WM_NOTIFICATION_CLICKED 1
#define WM_NOTIFICATION_RELEASED 2
#define WM_NOTIFICATION_MOVED_OUT 3
#define WM_NOTIFICATION_SEL_CHANGED 4
#define WM_NOTIFICATION_VALUE_CHANGED 5
#define WM_NOTIFICATION_SCROLLBAR_ADDED 6 /* Scroller added */
/*********************************************************************
*
* Memory management
*/
#define WM_HWIN GUI_HWIN
#define WM_HWIN_NULL GUI_HMEM_NULL
#define WM_HMEM GUI_HMEM
#define WM_HMEM_NULL GUI_HMEM_NULL
/*********************************************************************
*
* Window defines
*/
#define WM_HBKWIN WM_GetDesktopWindow() /* Handle of background window */
#define WM_UNATTACHED ((WM_HMEM)-1) /* Do not attach to a window */
/*
*******************************************************************
* *
* Windows manager types *
* *
*******************************************************************
*/
/* Windows create flags. These flags can be passed to the create window
function as flag-parameter. The flags are combinable using the
binary or operator.
*/
#define WM_CF_HASTRANS (1<<0) /* Has transparency. Needs to be defined for windows which do not fill the entire
section of their (client) rectangle. */
#define WM_CF_HIDE (0<<1) /* Hide window after creation (default !) */
#define WM_CF_SHOW (1<<1) /* Show window after creation */
#define WM_CF_FGND (0<<2) /* Put window in foreground after creation (default !) */
#define WM_CF_BGND (1<<2) /* Put window in background after creation */
#define WM_CF_MEMDEV (1<<3) /* Use memory device for redraws */
#define WM_CF_STAYONTOP (1<<4) /* Stay on top */
#define WM_CF_RIGHTANKER (1<<5) /* Right anker ... If parent is resized, distance to right will remain const (left is default) */
#define WM_CF_BOTTOMANKER (1<<6) /* Bottom anker ... If parent is resized, distance to bottom will remain const (top is default) */
#define WM_CF_ACTIVATE (1<<7) /* If automatic activation upon creation of window is desired */
typedef struct {
int MsgId; /* type of message */
WM_HWIN hWin; /* Destination window */
WM_HWIN hWinSrc; /* Source window */
union {
void* p; /* Some messages need more info ... */
int v;
GUI_COLOR Color;
} Data;
} WM_MESSAGE;
typedef void WM_CALLBACK( WM_MESSAGE* pMsg);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -