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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wm.c

?? ucCos移植到廣州友善nano2410
?? 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一区二区三区免费野_久草精品视频
亚洲一区二区精品久久av| 亚洲成人黄色影院| 欧美日韩国产小视频在线观看| 久久av资源站| 亚洲va在线va天堂| 国产精品―色哟哟| 精品日韩av一区二区| 91视频在线观看| 激情综合五月天| 天天色天天爱天天射综合| 伊人夜夜躁av伊人久久| 国产清纯在线一区二区www| 欧美一级二级在线观看| 欧美亚洲国产一区二区三区| 成人一二三区视频| 国产一区二区三区四区五区入口| 亚洲成人免费在线观看| 亚洲乱码日产精品bd| 国产日韩欧美一区二区三区乱码| 日韩精品中午字幕| 91精品国产91久久综合桃花| 欧美在线视频你懂得| www.亚洲色图| 懂色av一区二区在线播放| 激情五月激情综合网| 免费成人av资源网| 免费高清视频精品| 免费成人av在线| 欧美aaaaa成人免费观看视频| 亚洲自拍偷拍网站| 国产精品久久毛片av大全日韩| 久久网这里都是精品| 欧美r级在线观看| 91精品国产手机| 91.成人天堂一区| 欧美日韩亚洲高清一区二区| 欧美在线免费视屏| 欧美视频在线观看一区| 91久久精品一区二区| 91激情五月电影| 在线亚洲人成电影网站色www| 91丝袜美女网| 欧美在线影院一区二区| 欧美日韩国产综合视频在线观看| 欧美精品aⅴ在线视频| 91精品国产入口| 精品国产在天天线2019| 久久久蜜桃精品| 国产午夜精品美女毛片视频| 国产区在线观看成人精品| 中文字幕中文字幕一区| 一区二区三区在线免费观看| 亚洲一级电影视频| 丝袜美腿亚洲一区二区图片| 麻豆国产一区二区| 国产成人自拍在线| 91丨porny丨首页| 欧美精品乱人伦久久久久久| 日韩精品中文字幕在线不卡尤物| 久久久久久9999| 一区在线播放视频| 亚洲成人福利片| 韩国成人福利片在线播放| 粉嫩一区二区三区性色av| 色综合久久久久久久久| 欧美高清性hdvideosex| 精品国产乱码久久久久久蜜臀| 国产精品女同一区二区三区| 亚洲自拍偷拍网站| 国内偷窥港台综合视频在线播放| 成人在线综合网| 欧美日韩一区不卡| 国产调教视频一区| 一个色综合网站| 精品一区二区三区在线播放| 成人av动漫网站| 欧美精品一二三区| 国产亚洲精品bt天堂精选| 夜夜揉揉日日人人青青一国产精品| 免费观看在线综合色| 91蜜桃视频在线| 日韩免费在线观看| 亚洲免费观看高清在线观看| 麻豆一区二区三区| 91久久一区二区| 国产丝袜欧美中文另类| 亚洲18影院在线观看| 国产成人日日夜夜| 欧美日韩国产首页在线观看| 国产欧美日韩另类一区| 日韩国产欧美在线视频| 成人国产精品免费网站| 精品日产卡一卡二卡麻豆| 亚洲欧洲制服丝袜| 国产白丝网站精品污在线入口| 欧美日韩三级视频| 中文字幕一区视频| 韩国欧美一区二区| 欧美主播一区二区三区| 国产精品久久久久婷婷二区次| 日韩经典一区二区| 一本一本久久a久久精品综合麻豆| 精品91自产拍在线观看一区| 婷婷国产在线综合| 91国偷自产一区二区开放时间 | 日本成人中文字幕| 99久久99久久久精品齐齐| 欧美成人高清电影在线| 亚洲一区二区三区中文字幕| 国产91丝袜在线观看| 精品福利二区三区| 日韩精品一区第一页| 在线观看国产91| 一区二区三区在线影院| 91在线小视频| 欧美国产禁国产网站cc| 国产真实乱子伦精品视频| 欧美一区二区视频在线观看2020 | 久久不见久久见免费视频7| 欧美日韩一区二区三区视频| 亚洲视频 欧洲视频| 成人午夜激情影院| 国产午夜精品一区二区三区四区| 九九精品视频在线看| 日韩一区二区三区四区| 天天综合色天天综合| 欧美日韩一区精品| 亚洲一卡二卡三卡四卡无卡久久| 在线观看视频欧美| 亚洲综合男人的天堂| 欧洲一区二区av| 亚洲一区二区3| 欧美精选在线播放| 丝袜亚洲另类欧美| 日韩精品一区二| 国产一区二区三区在线观看免费 | 国产无遮挡一区二区三区毛片日本| 久久电影网站中文字幕| 日韩免费观看高清完整版在线观看| 青青草伊人久久| 日韩一级免费观看| 九九久久精品视频| 久久精品一区蜜桃臀影院| 丰满亚洲少妇av| 国产精品九色蝌蚪自拍| 一本大道久久精品懂色aⅴ| 亚洲激情图片qvod| 欧美在线观看你懂的| 婷婷成人综合网| www激情久久| 丁香婷婷综合五月| 亚洲欧美色图小说| 欧美理论片在线| 久久97超碰国产精品超碰| 久久久久亚洲综合| 成人av电影在线网| 亚洲国产乱码最新视频| 精品国产伦一区二区三区免费 | 一区二区三区在线影院| 欧美日韩www| 国产一区不卡在线| 国产精品久久久久久久岛一牛影视| 色噜噜夜夜夜综合网| 美日韩一区二区| 国产精品美女久久久久久久 | 国产麻豆精品在线| ...xxx性欧美| 欧美一区二区三区免费在线看| 麻豆国产精品官网| 综合色中文字幕| 欧美日韩亚洲丝袜制服| 国产高清久久久| 一区二区三区欧美激情| 日韩欧美在线不卡| av在线不卡电影| 日韩精品91亚洲二区在线观看 | 欧美一区二区三区免费视频| 国产高清精品网站| 日韩精品亚洲专区| 中文字幕一区在线观看| 日韩欧美一级在线播放| 91蜜桃婷婷狠狠久久综合9色| 麻豆国产一区二区| 亚洲综合丝袜美腿| 久久久久久久综合日本| 欧美三级三级三级| 成人a免费在线看| 蜜桃视频一区二区| 亚洲精品视频观看| 久久久久久一级片| 欧美一区二区三区在线视频 | 欧美不卡一区二区三区四区| 99久久亚洲一区二区三区青草| 青青国产91久久久久久| 一区二区三区国产精品| 国产午夜精品美女毛片视频| 91精品黄色片免费大全| 色狠狠色狠狠综合| jlzzjlzz亚洲女人18| 九九**精品视频免费播放|