亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wm.c

?? ucos 移植 stm32 在iar5.2通過運行良好
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
*********************************************************************************************************
*                                                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.C
Purpose     : Windows manager core
----------------------------------------------------------------------
*/

#include <stddef.h>           /* needed for definition of NULL */
#include <string.h>           /* required for memset */

#define WM_C
#include "WM_Intern_ConfDep.h"

#if GUI_WINSUPPORT    /* If 0, WM will not generate any code */

/*********************************************************************
*
*                 Macros for internal use
*
**********************************************************************
*/

#define ASSIGN_IF_LESS(v0,v1) if (v1<v0) v0=v1

/*********************************************************************
*
*              Local typedefs
*
**********************************************************************
*/

typedef struct {
  GUI_RECT ClientRect;
  GUI_RECT CurRect;
  int Cnt;
  int EntranceCnt;
} WM_IVR_CONTEXT;

/*********************************************************************
*
*              global data
*
**********************************************************************
*/

U8                     WM_IsActive;
U16                    WM__CreateFlags;
WM_HWIN                WM__hCapture;
WM_HWIN                WM__hWinFocus;
char                   WM__CaptureReleaseAuto;
WM_tfPollPID*          WM_pfPollPID;
U8                     WM__PaintCallbackCnt;      /* Public for assertions only */
GUI_PID_STATE          WM_PID__StateLast;

#if WM_SUPPORT_TRANSPARENCY
  int                    WM__TransWindowCnt;
  WM_HWIN                WM__hATransWindow;
#endif

#if WM_SUPPORT_DIAG
  void (*WM__pfShowInvalid)(WM_HWIN hWin);
#endif

/*********************************************************************
*
*              static data
*
**********************************************************************
*/

static WM_HWIN        NextDrawWin;
static WM_IVR_CONTEXT _ClipContext;
static char           _IsInited;

/*********************************************************************
*
*       Static routines
*
**********************************************************************
*/
/*********************************************************************
*
*       _CheckCriticalHandles
*
* Purpose:
*   Checks the critical handles and resets the matching one
*/
static void _CheckCriticalHandles(WM_HWIN hWin) {
  WM_CRITICAL_HANDLE * pCH;
  for (pCH = WM__pFirstCriticalHandle; pCH; pCH = pCH->pNext) {
    if (pCH->hWin == hWin) {
      pCH->hWin = 0;
    }
  }
}

/*********************************************************************
*
*       _DesktopHandle2Index
*
* Function:
*   Convert the given desktop window into the display index.
*
* Return value:
*   Desktop index if window handle is valid.
*   else: -1
*/
static int _DesktopHandle2Index(WM_HWIN hDesktop) {
#if GUI_NUM_LAYERS > 1
  int i;
  for (i = 0; i < GUI_NUM_LAYERS; i++) {
    if (hDesktop == WM__ahDesktopWin[i]) {
      return i;
    }
  }
#else
  if (hDesktop == WM__ahDesktopWin[0]) {
    return 0;
  }
#endif
  return -1;
}

/*********************************************************************
*
*       _Invalidate1Abs
*
*  Invalidate given window, using absolute coordinates
*/
static void _Invalidate1Abs(WM_HWIN hWin, const GUI_RECT*pRect) {
  GUI_RECT r;
  WM_Obj* pWin;
  int Status;
  pWin = WM_H2P(hWin);
  Status = pWin->Status;
  if ((Status & WM_SF_ISVIS) == 0) {
    return;   /* Window is not visible... we are done */
  }
  if ((Status & (WM_SF_HASTRANS | WM_SF_CONST_OUTLINE)) == WM_SF_HASTRANS) {
    return;   /* Window is transparent; transparency may change... we are done, since background will be invalidated */
  }
  if (WM__RectIsNZ(pRect) == 0) {
    return;   /* Nothing to do ... */
  }
  /* Calc affected area */
  GUI__IntersectRects(&r, pRect, &pWin->Rect);
  if (WM__RectIsNZ(&r)) {
    #if WM_SUPPORT_NOTIFY_VIS_CHANGED
      WM__SendMsgNoData(hWin, WM_NOTIFY_VIS_CHANGED);             /* Notify window that visibility may have changed */
    #endif

    if (pWin->Status & WM_SF_INVALID) {
      GUI_MergeRect(&pWin->InvalidRect, &pWin->InvalidRect, &r);
    } else {
      pWin->InvalidRect = r;
      pWin->Status |= WM_SF_INVALID;
      WM__NumInvalidWindows++;
      /* Optional code: Call external routine to notify that drawing is required */
      #ifdef GUI_X_REDRAW
      {
        GUI_RECT r;
        r = pWin->Rect;
        if (WM__ClipAtParentBorders(&r,  hWin)) {
          GUI_X_REDRAW(); /* Call hook function to signal an invalidation */
        }
      }
      #endif
      GUI_X_SIGNAL_EVENT();
    }
    /* Debug code: shows invalid areas */
    #if (WM_SUPPORT_DIAG)
      if (WM__pfShowInvalid) {
        (WM__pfShowInvalid)(hWin);
      }
    #endif
  }
}

/*********************************************************************
*
*       _GetTopLevelWindow
*/
#if GUI_NUM_LAYERS > 1
static WM_HWIN _GetTopLevelWindow(WM_HWIN hWin) {
  WM_Obj* pWin;
  WM_HWIN hTop;
  while (hTop = hWin, pWin = WM_H2P(hWin), (hWin = pWin->hParent) != 0) {
  }
  return hTop;
}
#endif

/*********************************************************************
*
*       ResetNextDrawWin

  When drawing, we have to start at the bottom window !
*/
static void ResetNextDrawWin(void) {
  NextDrawWin = WM_HWIN_NULL;
}


/*********************************************************************
*
*       _GethDrawWin
*
* Return Window being drawn.
* Normally same as pAWin, except if overlaying transparent window is drawn
*
*/
static WM_HWIN _GethDrawWin(void) {
  WM_HWIN h;
  #if WM_SUPPORT_TRANSPARENCY
    if (WM__hATransWindow) {
      h = WM__hATransWindow;
    } else
  #endif
  {
    h = GUI_Context.hAWin;
  }
  return h;
}





/*********************************************************************
*
*       _SetClipRectUserIntersect
*/
static void _SetClipRectUserIntersect(const GUI_RECT* prSrc) {
  if (GUI_Context.WM__pUserClipRect == NULL) {
    LCD_SetClipRectEx(prSrc);
  } else {
    GUI_RECT r;
    r = *GUI_Context.WM__pUserClipRect;             
    WM__Client2Screen(WM_H2P(_GethDrawWin()), &r);     /* Convert User ClipRect into screen coordinates */
    /* Set intersection as clip rect */    
    GUI__IntersectRect(&r, prSrc);
    LCD_SetClipRectEx(&r);
  }
}


/*********************************************************************
*
*       Public routines
*
**********************************************************************
*/
/*********************************************************************
*
*       WM__ClipAtParentBorders
*
* Function:
*   Iterates over the window itself and all its ancestors.
*   Intersects all rectangles to
*   find out which part is actually visible.
*   Reduces the rectangle to the visible area.
*   This routines takes into account both the rectangles of the
*   ancestors as well as the WM_SF_ISVIS flag.
*
* Parameters
*   hWin    Obvious
*   pRect   Pointer to the rectangle to be clipped. May not be NULL.
*           The parameter is IN/OUT.
*           Note that the rectangle is clipped only if the return
*           value indicates a valid rectangle remains.
*
* Return value:
*   1: Something is or may be visible.
*   0: Nothing is visible (outside of ancestors, no desktop, hidden)
*/
int WM__ClipAtParentBorders(GUI_RECT* pRect, WM_HWIN hWin) {
  WM_Obj* pWin;

  /* Iterate up the window hierarchy.
     If the window is invisible, we are done.
     Clip at parent boarders.
     We are done with iterating if hWin has no parent.
  */
  do {
    pWin = WM_H2P(hWin);
    if ((pWin->Status & WM_SF_ISVIS) == 0) {
      return 0;                     /* Invisible */
    }
    GUI__IntersectRect(pRect, &pWin->Rect);  /* And clip on borders */
    if (pWin->hParent == 0) {
      break;   /* hWin is now the top level window which has no parent */
    }
    hWin = pWin->hParent;                    /* Go one level up (parent)*/
  } while (1);                               /* Only way out is in the loop. Required for efficiency, no bug, even though some compilers may complain. */
  
  /* Now check if the top level window is a desktop window. If it is not,
    then the window is not visible.
  */
  if (_DesktopHandle2Index(hWin) < 0) {
    return 0;           /* No desktop - (unattached) - Nothing to draw */
  }
  return 1;               /* Something may be visible */
}

/*********************************************************************
*
*       WM__ActivateClipRect
*/
void  WM__ActivateClipRect(void) {
  if (WM_IsActive) {
    _SetClipRectUserIntersect(&_ClipContext.CurRect);
  } else {    /* Window manager disabled, typically because meory device is active */
    GUI_RECT r;
    WM_Obj *pAWin;
    pAWin = WM_H2P(GUI_Context.hAWin);
    r = pAWin->Rect;
    #if WM_SUPPORT_TRANSPARENCY
      if (WM__hATransWindow) {
        WM__ClipAtParentBorders(&r, WM__hATransWindow);
      }
    #endif
    /* Take UserClipRect into account */
    _SetClipRectUserIntersect(&r);
  }
}




/*********************************************************************
*
*       WM__InsertWindowIntoList
*
* Routine describtion
*   This routine inserts the window in the list of child windows for
*   a particular parent window.
*   The window is placed on top of all siblings with the same level.
*/
void WM__InsertWindowIntoList(WM_HWIN hWin, WM_HWIN hParent) {
  int OnTop;
  WM_HWIN hi;
  WM_Obj * pWin;
  WM_Obj * pParent;
  WM_Obj * pi;

  if (hParent) {
    pWin = WM_H2P(hWin);
    pWin->hNext = 0;
    pWin->hParent = hParent;
    pParent = WM_H2P(hParent);
    OnTop   = pWin->Status & WM_CF_STAYONTOP;
    hi = pParent->hFirstChild;
    /* Put it at beginning of the list if there is no child */
    if (hi == 0) {   /* No child yet ... Makes things easy ! */
      pParent->hFirstChild = hWin;
      return;                         /* Early out ... We are done */
    }
    /* Put it at beginning of the list if first child is a TOP window and new one is not */
    pi = WM_H2P(hi);
    if (!OnTop) {
      if (pi->Status & WM_SF_STAYONTOP) {
        pWin->hNext = hi;
        pParent->hFirstChild = hWin;
        return;                         /* Early out ... We are done */
      }
    }
    /* Put it at the end of the list or before the last non "STAY-ON-TOP" child */
    do {
      WM_Obj* pNext;
      WM_HWIN hNext;
      if ((hNext = pi->hNext) == 0) {   /* End of sibling list ? */
        pi->hNext = hWin;             /* Then modify this last element to point to new one and we are done */
        break;
      }
      pNext = WM_H2P(hNext);
      if (!OnTop) {
        if (pNext->Status & WM_SF_STAYONTOP) {
          pi->hNext = hWin;
          pWin->hNext = hNext;
          break;
        }
      }
      pi = pNext;
    }  while (1);
    #if WM_SUPPORT_NOTIFY_VIS_CHANGED
      WM__NotifyVisChanged(hWin, &pWin->Rect);
    #endif
  }
}

/*********************************************************************
*
*       WM__RemoveWindowFromList
*/
void WM__RemoveWindowFromList(WM_HWIN hWin) {
  WM_HWIN hi, hParent;
  WM_Obj * pWin, * pParent, * pi;
  
  pWin = WM_H2P(hWin);
  hParent = pWin->hParent;
  if (hParent) {
    pParent = WM_H2P(hParent);
    hi = pParent->hFirstChild;
    if (hi == hWin) {
      pi = WM_H2P(hi);
      pParent->hFirstChild = pi->hNext;
    } else {
      while (hi) {
        pi = WM_H2P(hi);
        if (pi->hNext == hWin) {
          pi->hNext = pWin->hNext;
          break;
        }
        hi = pi->hNext;
      }
    }
  }
}

/*********************************************************************
*
*       WM__DetachWindow

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线免费视频| 美腿丝袜亚洲三区| 久久这里都是精品| 精品欧美乱码久久久久久1区2区| 国内精品视频一区二区三区八戒| 看电影不卡的网站| 国产美女视频一区| 亚洲国产成人精品视频| 麻豆成人综合网| 国产91富婆露脸刺激对白| 国产精品理论片在线观看| 亚洲伊人伊色伊影伊综合网| 青青草97国产精品免费观看无弹窗版| 日韩国产一区二| 国产九色精品成人porny | 一区二区三区成人| 亚洲精品大片www| 精品欧美一区二区三区精品久久| 久久这里只有精品首页| 亚洲精品乱码久久久久| 亚洲午夜羞羞片| 国产精品一区二区三区四区| 91色porny| 欧美性一区二区| 久久人人爽爽爽人久久久| 美女视频免费一区| 制服丝袜亚洲色图| 日韩在线观看一区二区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产精品久久久久一区 | 欧美视频你懂的| 一区二区三区在线看| 91免费观看视频在线| 亚洲国产精品黑人久久久| 丰满少妇久久久久久久 | 精品国产一二三| 日本女人一区二区三区| 日韩视频在线你懂得| 麻豆视频观看网址久久| 欧美一级在线免费| 久久激情综合网| 精品免费99久久| 国产一区二区三区免费| 久久久久久亚洲综合影院红桃 | 悠悠色在线精品| 欧美综合亚洲图片综合区| 一区二区三区欧美| 欧美日韩国产免费| 日本vs亚洲vs韩国一区三区二区 | 精品国产麻豆免费人成网站| 国产一区二区三区在线观看免费视频| 日韩欧美国产一区二区三区 | 日韩av中文在线观看| 欧美大度的电影原声| 精品在线免费视频| 国产调教视频一区| 色婷婷综合久久久中文字幕| 亚洲国产成人av| 久久综合九色综合欧美98| 成人午夜电影网站| 亚洲综合精品自拍| 欧美大胆一级视频| 99久久久免费精品国产一区二区| 亚洲人成在线播放网站岛国| 欧美伦理影视网| 国产成人一级电影| 一区二区三区在线播放| 日韩一卡二卡三卡四卡| 成人视屏免费看| 午夜精品一区二区三区免费视频| 欧美成va人片在线观看| 99精品视频一区| 看片的网站亚洲| 亚洲人成伊人成综合网小说| 日韩一区二区免费高清| 91丝袜美腿高跟国产极品老师 | 一区二区免费在线| 久久亚洲精品国产精品紫薇| 色94色欧美sute亚洲线路一ni | 成人99免费视频| 爽爽淫人综合网网站| 国产精品网曝门| 欧美一区二区三区成人| 99久久er热在这里只有精品15 | 亚洲一卡二卡三卡四卡无卡久久| 精品欧美乱码久久久久久| 91久久精品国产91性色tv| 国内精品写真在线观看 | 亚洲欧美日韩国产手机在线| 欧美一区二区三区婷婷月色| 91美女福利视频| 国产精品一区2区| 亚洲va韩国va欧美va精品| 国产精品卡一卡二卡三| www国产精品av| 日韩一区二区三区在线| 欧美性极品少妇| 成人动漫av在线| 国产一区二区0| 日本一道高清亚洲日美韩| 亚洲午夜精品在线| 亚洲视频免费看| 国产情人综合久久777777| 日韩三区在线观看| 欧美午夜精品一区二区蜜桃| aaa欧美色吧激情视频| 国内精品伊人久久久久av影院| 亚洲一区二区三区四区在线观看| 欧美国产日韩亚洲一区| 精品日韩欧美在线| 911精品产国品一二三产区| 成人精品一区二区三区四区 | 亚洲国产综合在线| 国产精品久久久久久久浪潮网站| 日韩欧美国产综合| 91精品国产91久久久久久一区二区| 97久久精品人人爽人人爽蜜臀| 国产成人精品网址| 国产一区二区免费看| 国产麻豆精品久久一二三| 蜜桃精品视频在线| 男女男精品视频| 免费高清在线视频一区·| 亚洲成人免费视| 精品日韩av一区二区| 日本道在线观看一区二区| 色菇凉天天综合网| 在线观看不卡视频| 欧美日韩国产综合一区二区| 欧美色综合天天久久综合精品| 欧美最猛性xxxxx直播| 欧美色成人综合| 欧美精品乱码久久久久久按摩| 欧美精品在线一区二区三区| 日韩一本二本av| www久久精品| 国产精品福利一区| 亚洲精品你懂的| 午夜免费久久看| 久久er99热精品一区二区| 国产夫妻精品视频| 91亚洲国产成人精品一区二区三 | 91麻豆精东视频| 在线观看日韩av先锋影音电影院| 欧美最猛性xxxxx直播| 欧美一区二区在线视频| 久久蜜臀精品av| 亚洲精品伦理在线| 免费欧美高清视频| 成人综合婷婷国产精品久久免费| 一本色道亚洲精品aⅴ| 欧美精品色一区二区三区| 久久免费的精品国产v∧| 亚洲日本va在线观看| 男女性色大片免费观看一区二区 | 欧美三级视频在线播放| 欧美电影免费观看高清完整版在线 | 午夜国产精品影院在线观看| 久久er精品视频| av动漫一区二区| 亚洲成av人片在线观看| 久久国产福利国产秒拍| 欧美偷拍一区二区| 国产精品色在线| 一区二区三区在线播放| 久久成人精品无人区| 97成人超碰视| 欧美mv日韩mv国产网站app| 亚洲日本乱码在线观看| 国产精品一级黄| 国内精品在线播放| 色综合天天天天做夜夜夜夜做| 日韩免费观看高清完整版| 日本成人在线网站| 国产精品成人午夜| 肉色丝袜一区二区| 99精品国产99久久久久久白柏 | 91在线视频网址| 精品国产伦理网| 丝袜美腿成人在线| 99热精品国产| 久久亚洲私人国产精品va媚药| 天堂av在线一区| 欧美亚洲一区二区在线| 国产精品久久久久久久久动漫| 日本欧美一区二区三区乱码| 欧美这里有精品| 亚洲精品日韩专区silk| 不卡的电影网站| 久久亚洲一区二区三区四区| 另类综合日韩欧美亚洲| 欧美一区二区大片| 视频一区二区三区入口| 欧美色偷偷大香| 一区二区三区四区不卡视频| 91影院在线观看| 最新日韩在线视频| 国产**成人网毛片九色| 欧美激情一区二区三区蜜桃视频| 国产精品一卡二卡在线观看|