⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wm.h

📁 非常好的 uc gui 学习工具,适合于初学都。 VC 的仿真环境
💻 H
📖 第 1 页 / 共 2 页
字号:

void WM_Activate  (void);
void WM_Deactivate(void);
void WM_Init      (void);
int  WM_Exec      (void);    /* Execute all jobs ... Return 0 if nothing was done. */
int  WM_Exec1     (void);    /* Execute one job  ... Return 0 if nothing was done. */
U16  WM_SetCreateFlags(U16 Flags);
void WM_SetCapture(WM_HWIN hObj, int AutoRelease);
void WM_ReleaseCapture(void);

/*********************************************************************
*
*           Window manager interface
*
**********************************************************************
*/

/* Create/delete windows */
WM_HWIN WM_CreateWindow           (int x0, int y0, 
                                   int xSize, int ySize,
                                   U16 Style, WM_CALLBACK* cb, int NumExtraBytes);
WM_HWIN WM_CreateWindowAsChild    (int x0, int y0, 
                                   int xSize, int ySize, 
                                   WM_HWIN hWinParent, 
                                   U16 Style, WM_CALLBACK* cb, int NumExtraBytes);
void WM_DeleteWindow              (WM_HWIN hWin);

/* Check validity */
int WM_IsWindow                   (WM_HWIN hWin);

/* Show/hide windows */
void WM_HideWindow                (WM_HWIN hWin);
void WM_ShowWindow                (WM_HWIN hWin);

/* Set/clear the has transparency flag */
void WM_SetHasTrans               (WM_HWIN hWin);
void WM_ClrHasTrans               (WM_HWIN hWin);
int  WM_GetHasTrans               (WM_HWIN hWin);

/* Invalidate/validate windows or rectangles */
void WM_InvalidateArea            (GUI_RECT* pRect);
void WM_InvalidateRect            (WM_HWIN hWin, const GUI_RECT*pRect);
void WM_InvalidateWindow          (WM_HWIN hWin);
void WM_ValidateRect              (WM_HWIN hWin, const GUI_RECT*pRect);
void WM_ValidateWindow            (WM_HWIN hWin);

/* Move/resize windows */
void WM_MoveWindow                (WM_HWIN hWin, int dx, int dy);
void WM_ResizeWindow              (WM_HWIN hWin, int XSize, int YSize);
void WM_MoveTo                    (WM_HWIN hWin, int x, int y);
void WM_SetSize                   (WM_HWIN hWin, int XSize, int YSize);

/* Set (new) callback function */
WM_CALLBACK* WM_SetCallback       (WM_HWIN Win, WM_CALLBACK* cb);

/* Get size/origin of a window */
void WM_GetClientRect             (GUI_RECT* pRect);
void WM_GetInsideRect             (WM_HWIN hWin, GUI_RECT* pRect);
void WM_GetWindowRect             (GUI_RECT* pRect);
int  WM_GetOrgX                   (void);
int  WM_GetOrgY                   (void);
int  WM_GetWindowOrgX             (WM_HWIN hWin);
int  WM_GetWindowOrgY             (WM_HWIN hWin);
int  WM_GetWindowSizeX            (WM_HWIN hWin);
int  WM_GetWindowSizeY            (WM_HWIN hWin);
WM_HWIN WM_GetFirstChild          (WM_HWIN hWin);
WM_HWIN WM_GetNextSibling         (WM_HWIN hWin);
WM_HWIN WM_GetParent              (WM_HWIN hWin);
int  WM_GetId                     (WM_HWIN hWin);
WM_HWIN WM_GetClientWindow        (WM_HWIN hObj);
GUI_COLOR WM_GetBkColor           (WM_HWIN hObj);

/* Change Z-Order of windows */
void WM_BringToBottom(WM_HWIN hWin);
void WM_BringToTop(WM_HWIN hWin);

GUI_COLOR WM_SetDesktopColor(GUI_COLOR Color);

/* Select window used for drawing operations */
WM_HWIN WM_SelectWindow           (WM_HWIN  hWin);
WM_HWIN WM_GetActiveWindow        (void);
void    WM_Paint                  (WM_HWIN hObj);

/* Get foreground/background windows */
WM_HWIN WM_GetDesktopWindow    (void);

/* Reduce clipping area of a window */
const GUI_RECT* WM_SetUserClipRect(const GUI_RECT* pRect);
void            WM_SetDefault     (void);

/* Use of memory devices */
void WM_EnableMemdev              (WM_HWIN hWin);
void WM_DisableMemdev             (WM_HWIN hWin);

int WM_OnKey(int Key, int Pressed);


/******************************************************************
*
*           Message related funcions
*
*******************************************************************
  Please note that some of these functions do not yet show up in the
  documentation, as they should not be required by application program.
*/

void      WM_NotifyParent         (WM_HWIN hWin, int Notification);
void      WM_SendMessage          (WM_HWIN hWin, WM_MESSAGE* p);
void      WM_DefaultProc          (WM_MESSAGE* pMsg);
int       WM_BroadcastMessage     (WM_MESSAGE* pMsg);
void      WM_SetScrollState       (WM_HWIN hWin, const WM_SCROLL_STATE* pState);
void      WM_SetEnableState       (WM_HWIN hItem, int State);
void      WM_SendToParent         (WM_HWIN hWin, WM_MESSAGE* pMsg);
int       WM_HasCaptured(WM_HWIN hWin);
int       WM_SetFocus(WM_HWIN hWin);
WM_HWIN   WM_GetFocussedChild(WM_HWIN hDialog);
WM_HWIN   WM_SetFocusOnNextChild(WM_HWIN hParent);     /* Set the focus to the next child */
WM_HWIN   WM_GetDialogItem(WM_HWIN hWin, int Id);
void      WM_EnableWindow (WM_HWIN hWin);
void      WM_DisableWindow(WM_HWIN hWin);
void      WM_GetScrollState(WM_HWIN hObj, WM_SCROLL_STATE* pScrollState);


/*********************************************************************
*
*           Misc routines
*
**********************************************************************

*/

int       WM_HandleHID   (void);
WM_HWIN   WM_Screen2hWin   (int x, int y);
int       WM__InitIVRSearch(const GUI_RECT* pMaxRect);
int       WM__GetNextIVR   (void);
int       WM__GetOrgX(void);
int       WM__GetOrgY(void);


/*
      *************************************************
      *                                               *
      *        Macros for lower levels                *
      *                                               *
      *************************************************

These are the core macro of this module. They make sure that the
windows manager is called an that we iterate over all the rect-
angles that thw windows manager has registered as visible
and invalid (IVR, for InValid Rectangle). Using these macros makes
the code in the actual routines easier to read.
*/

#define WM_ITERATE_START(pRect)                   \
  {                                               \
    GUI_LOCK();                                   \
    if (WM__InitIVRSearch(pRect))                 \
      do {

#define WM_ITERATE_END()                          \
    } while (WM__GetNextIVR());                   \
    GUI_UNLOCK();                                 \
  }

#define WM_ADDORGX(x)    x += WM__GetOrgX()
#define WM_ADDORGY(y)    y += WM__GetOrgY()
#define WM_ADDORG(x0,y0) WM_ADDORGX(x0); WM_ADDORGY(y0)
#define WM_SUBORGX(x)    x-=WM__GetOrgX()
#define WM_SUBORGY(y)    y-=WM__GetOrgY()
#define WM_SUBORG(x0,y0) WM_SUBORGX(x0); WM_SUBORGY(y0)

/*
      *************************************************
      *                                               *
      *  Macros for compatibility with older versions *
      *                                               *
      *************************************************
*/

#if WM_COMPATIBLE_MODE
  #define HBWIN             WM_HWIN
  #define HBWIN_NULL        WM_HWIN_NULL

  #define WM_HideWin        WM_HideWindow
  #define WM_ShowWin        WM_ShowWindow
  #define WM_GetKey         GUI_GetKey
  #define WM_WaitKey        GUI_WaitKey

  #define WM_ExecIdle       WM_Exec
  #define WM_ExecIdle1      WM_Exec1

  #define WM_HideBWin       WM_HideWindow
  #define WM_ShowBWin       WM_ShowWindow
  #define WM_DeleteBWin     WM_DeleteWindow
  #define WM_Invalidate     WM_InvalidateWindow
  #define WM_InvalidateBWin WM_InvalidateWindow
  #define WM_MoveBWin       WM_MoveWindow
  #define WM_ResizeBWin     WM_ResizeWindow
  #define WM_GetWinRect     WM_GetWindowRect
  #define WM_GetWinOrgX     WM_GetWindowOrgX
  #define WM_GetWinOrgY     WM_GetWindowOrgY
  #define WM_GetWinSizeX    WM_GetWindowSizeX
  #define WM_GetWinSizeY    WM_GetWindowSizeY
  #define WM_GetXSize       WM_GetWindowSizeX
  #define WM_GetYSize       WM_GetWindowSizeY
  #define WM_SetFGndBWin    WM_SetForegroundWindow
  #define WM_SetBGndBWin    WM_SetBackgroundWindow
  #define WM_SelWin         WM_SelectWindow
  #define WM_SetActiveBWin  WM_SelectWindow
  #define WM_GetActiveBWin  WM_GetActiveWindow
  #define WM_GetBGndBWin    WM_GetDesktopWindow
  #define WM_GetBackgroundWindow  WM_GetDesktopWindow
  #define WM_GetFGndBWin            0
  #define WM_GetForegroundWindow    0
  #define WM_SetForegroundWindow    WM_BringToTop
  #define WM_SetUserClipArea WM_SetUserClipRect

  #define WM_CreateBWin(x0,y0,xsize,ysize, Style,cb) WM_CreateWindow(x0,y0,xsize,ysize, Style,cb, 0)

  #define WM_Start()
  #define WM_Stop()
  #define WM_SetBkWindowColor(Color)  WM_SetDesktopColor(Color)

#endif

/*
  *****************************************************************
  *
  *              Internal types and declarations
  *
  *****************************************************************

  The following could be placed in a file of its own as it is not
  used outside of the window manager

*/
/* Basic Windows status flags.
   For module-internally use only !
*/
#define WM_SF_HASTRANS    (1<<0)
#define WM_SF_INVALID     (1<<1)
#define WM_SF_INUSE       (1<<2)    /* mark entry in array as used */
#define WM_SF_MEMDEV      (1<<3)
#define WM_SF_STAYONTOP   WM_CF_STAYONTOP
#define WM_SF_ISVIS       (1<<7)    /* Is visible flag */

#define WM_HANDLE2PTR(hWin) ((WM_Obj*)WM_HMEM2Ptr(hWin))    /* older form ... to be eliminated */
#define WM_H2P(hWin)        ((WM_Obj*)WM_HMEM2Ptr(hWin))

/*
  *****************************************************************
  *
  *              WM_ module internal data
  *
  *****************************************************************
*/
#ifdef WM_C
  #define EXTERN
#else
  #define EXTERN extern
#endif

EXTERN U16     WM__NumWindows;
EXTERN U16     WM__NumInvalidWindows;
EXTERN WM_HWIN WM__FirstWin;

#undef EXTERN

#endif   /* GUI_WINSUPPORT */
#endif   /* WM_H */
#endif   /* WM_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -