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

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

?? 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一区二区三区免费野_久草精品视频
99这里只有精品| 欧美高清你懂得| 欧美三级电影在线观看| 久久久久免费观看| 午夜精品视频一区| 91蝌蚪porny| 国产网红主播福利一区二区| 午夜国产精品一区| 91美女在线看| 中文字幕在线不卡视频| 久88久久88久久久| 69成人精品免费视频| 一区二区三区美女| 91天堂素人约啪| 国产精品久久久久久久岛一牛影视| 午夜免费久久看| 91成人在线免费观看| 国产精品国产自产拍高清av| 黑人巨大精品欧美黑白配亚洲| 欧美精品成人一区二区三区四区| 亚洲欧美综合色| 本田岬高潮一区二区三区| 久久久久久久久岛国免费| 麻豆成人91精品二区三区| 欧美男女性生活在线直播观看| 亚洲欧美日韩一区二区三区在线观看 | 国产乱码精品一区二区三区av | 久久国产精品一区二区| 91精品一区二区三区在线观看| 伊人婷婷欧美激情| 91麻豆国产自产在线观看| 日韩精品视频网| 色屁屁一区二区| 亚洲最色的网站| 欧美日韩国产色站一区二区三区| 亚洲精品国产a久久久久久| 91麻豆福利精品推荐| 亚洲欧美一区二区三区国产精品 | 欧美www视频| 精品午夜久久福利影院| 欧美v亚洲v综合ⅴ国产v| 激情综合网av| 中国色在线观看另类| 色综合久久久久综合体桃花网| 亚洲黄网站在线观看| 欧美老年两性高潮| 七七婷婷婷婷精品国产| 久久免费午夜影院| 99riav一区二区三区| 亚洲一区二区综合| 欧美一二三区在线| 国产精品18久久久久久vr| 欧美国产一区二区在线观看| 91色视频在线| 日韩在线卡一卡二| 国产亚洲精品中文字幕| 91蝌蚪porny成人天涯| 日本欧美久久久久免费播放网| 精品国产99国产精品| gogo大胆日本视频一区| 亚洲成人av一区二区三区| 欧美成人r级一区二区三区| 高清免费成人av| 亚洲成av人影院| 久久久久国产精品免费免费搜索| 91猫先生在线| 国产一区二区三区精品视频| 一区二区三区久久| 久久这里只有精品首页| 在线亚洲一区二区| 久久福利视频一区二区| 亚洲黄色片在线观看| 久久蜜桃一区二区| 欧美日韩亚洲国产综合| 成a人片亚洲日本久久| 日本欧美大码aⅴ在线播放| 中文字幕一区二区三区视频| 91精品国产综合久久久蜜臀图片 | 亚洲欧洲一区二区在线播放| 欧美一级二级在线观看| 色综合夜色一区| 国产精品一品二品| 蜜桃视频一区二区三区| 亚洲黄色性网站| 中文字幕在线观看不卡视频| 欧美大胆人体bbbb| 精品视频全国免费看| 不卡的av在线播放| 国产在线播放一区二区三区| 亚洲国产wwwccc36天堂| 中文字幕视频一区二区三区久| 91精品一区二区三区在线观看| 99国产欧美另类久久久精品| 国产老女人精品毛片久久| 亚洲成a人v欧美综合天堂| 亚洲三级理论片| 国产喷白浆一区二区三区| 欧美成人a∨高清免费观看| 欧美伦理视频网站| 欧美色精品在线视频| 在线亚洲免费视频| 91免费小视频| 成人少妇影院yyyy| 国产一区二区视频在线| 蜜臀久久99精品久久久久宅男 | 亚洲日本va午夜在线影院| 国产偷国产偷亚洲高清人白洁| 日韩一级免费观看| 欧美群妇大交群中文字幕| 91福利社在线观看| 91高清视频在线| 欧美伊人久久久久久午夜久久久久| heyzo一本久久综合| 99精品国产一区二区三区不卡| 99久久er热在这里只有精品66| 波多野结衣亚洲一区| 91色|porny| 日本精品视频一区二区三区| 色噜噜偷拍精品综合在线| 91国产免费观看| 欧美日本韩国一区| 欧美精品乱人伦久久久久久| 欧美日本不卡视频| 精品欧美一区二区久久| 国产女同互慰高潮91漫画| **性色生活片久久毛片| 亚洲欧美国产高清| 偷窥少妇高潮呻吟av久久免费| 香蕉久久夜色精品国产使用方法| 日韩成人免费电影| 看电影不卡的网站| 丰满白嫩尤物一区二区| 日本高清成人免费播放| 欧美日本免费一区二区三区| 精品国产免费一区二区三区四区| 亚洲精品一区二区在线观看| 国产亚洲污的网站| 亚洲女子a中天字幕| 肉色丝袜一区二区| 国产乱国产乱300精品| 91视频免费观看| 欧美一个色资源| 国产精品麻豆久久久| 亚洲成在线观看| 国产原创一区二区| 91网站在线观看视频| 日韩一区二区三区av| 日本一区二区视频在线| 亚洲乱码国产乱码精品精可以看 | 国产69精品久久777的优势| 在线一区二区三区| 久久免费视频色| 亚洲夂夂婷婷色拍ww47| 久久国产精品99久久人人澡| 91理论电影在线观看| 精品日韩欧美在线| 一卡二卡三卡日韩欧美| 国产乱码精品1区2区3区| 欧美日韩国产一级| 中文字幕一区二区三区四区| 奇米综合一区二区三区精品视频| jizzjizzjizz欧美| 久久综合色综合88| 亚洲国产日日夜夜| 懂色一区二区三区免费观看| 91精品国产综合久久精品性色| 国产精品丝袜91| 国内精品国产三级国产a久久| 在线观看av一区| 中文字幕一区日韩精品欧美| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲妇熟xx妇色黄| 99精品久久只有精品| 国产午夜亚洲精品理论片色戒| 日韩精品高清不卡| 欧美视频在线一区| 亚洲九九爱视频| fc2成人免费人成在线观看播放 | 国产麻豆精品在线观看| 欧美日韩精品免费观看视频 | 国产精品成人免费在线| 精品亚洲国产成人av制服丝袜 | 久久99国产精品尤物| 欧美日韩精品免费观看视频| 亚洲精品欧美专区| 99精品欧美一区二区蜜桃免费| 国产日本欧洲亚洲| 国产精品一品二品| 久久久久久久久久电影| 国产一区免费电影| 精品久久五月天| 国产剧情在线观看一区二区| 欧美一级夜夜爽| 美女诱惑一区二区| 精品国产伦一区二区三区观看方式 | 日本网站在线观看一区二区三区| 91高清在线观看| 亚洲r级在线视频| 欧美一区二区美女| 美腿丝袜亚洲三区|