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

📄 wmtouch.lst

📁 Keil C下通过的UCGUI,UCGUI的移植源代码
💻 LST
字号:
C51 COMPILER V8.05a   WMTOUCH                                                              04/11/2008 14:19:58 PAGE 1   


C51 COMPILER V8.05a, COMPILATION OF MODULE WMTOUCH
OBJECT MODULE PLACED IN WMTouch.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\WM\WMTouch.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND PRI
                    -NT(.\WMTouch.lst) OBJECT(WMTouch.obj)

line level    source

   1          /*
   2          *********************************************************************************************************
   3          *                                                uC/GUI
   4          *                        Universal graphic software for embedded applications
   5          *
   6          *                       (c) Copyright 2002, Micrium Inc., Weston, FL
   7          *                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
   8          *
   9          *              礐/GUI is protected by international copyright laws. Knowledge of the
  10          *              source code may not be used to write a similar product. This file may
  11          *              only be used in accordance with a license and should not be redistributed
  12          *              in any way. We appreciate your understanding and fairness.
  13          *
  14          ----------------------------------------------------------------------
  15          File        : WMTouch.c
  16          Purpose     : Windows manager, touch support
  17          ----------------------------------------------------------------------
  18          */
  19          
  20          
  21          #include <stddef.h>           /* needed for definition of NULL */
  22          #include "WM_Intern.h"
  23          #include "gui\Core\GUIDebug.h"
  24          
  25          #if (GUI_WINSUPPORT)
              
              /****************************************************************
              *
              *          static data
              *
              *****************************************************************
              */
              static WM_HWIN _hWinLast;
              
              /****************************************************************
              *
              *          Static code
              *
              *****************************************************************
              */
              void _cbDeleteWindow(WM_HWIN hWin) {
                if (hWin == _hWinLast) {
                  _hWinLast = 0;
                }
              }
              
              /****************************************************************
              *
              *       Public code
              *
              *****************************************************************
              */
              
              /****************************************************************
C51 COMPILER V8.05a   WMTOUCH                                                              04/11/2008 14:19:58 PAGE 2   

              *
              *       WM_HandlePID       
              *
              * Polls the touch screen. If something has changed,
              * sends a message to the concerned window.
              *
              * Return value:
              *   0 if nothing has been done
              *   1 if touch message has been sent
              */
              int WM_HandlePID(void) {
                int r = 0;
                static GUI_PID_STATE StateLast;
                GUI_PID_STATE State, StateNew;
                GUI_PID_GetState(&StateNew);
                WM_LOCK();
                WM__pfDeleteWindowHook = _cbDeleteWindow;   /* TBD in the future... Hook function management in order to
             - allow multiple hook functions */
                if ((StateLast.x != StateNew.x) || (StateLast.y != StateNew.y) || (StateLast.Pressed != StateNew.Pressed
             -)) {
                  State = StateNew;
                  #if GUI_SUPPORT_CURSOR
                    GUI_CURSOR_SetPosition(State.x, State.y);
                  #endif
                  /* Send message if pressed or just released */
                  if (StateLast.Pressed | State.Pressed) {
                    WM_MESSAGE Msg;
                    WM_HWIN hWin;
                    r = 1;
                    Msg.MsgId = WM_TOUCH;
                    Msg.Data.p = (void*)&State;
                    if (WM__hCapture == 0) {
                      hWin = WM_Screen2hWin(State.x, State.y);
                    } else {
                      hWin = WM__hCapture;
                    }
                    /* Tell window if it is no longer pressed */
                    if (_hWinLast != hWin) {
                      if (_hWinLast != 0) {
                        if (State.Pressed) {
                          Msg.Data.p = NULL;    /* no longer in this window */
                        } else {     /* "Clicked" in this window */
                          StateLast.Pressed =0;
                          Msg.Data.p = (void*)&StateLast;
                        }
                        GUI_DEBUG_LOG1 ("\nSending WM_Touch to LastWindow %d (out of area)", _hWinLast);
                        WM_SendMessage(_hWinLast, &Msg);
                        _hWinLast = 0;
                      }
                    }
                    if (hWin) {           /* Sending WM_Touch to Window */
                      /* convert screen into window coordinates */
                      WM_Obj* pWin = WM_H2P(hWin);
                      State.x -= pWin->Rect.x0;
                      State.y -= pWin->Rect.y0;
                      WM_SendMessage(hWin, &Msg);
                      /* Remember window */
                      if (State.Pressed) {
                        _hWinLast = hWin;
                      } else {
                        /* Handle automatic captue release */
                        if (WM__CaptureReleaseAuto) {
C51 COMPILER V8.05a   WMTOUCH                                                              04/11/2008 14:19:58 PAGE 3   

                          WM_ReleaseCapture();
                        }
                        _hWinLast = 0;
                      }
                    }
                  }
                  StateLast = StateNew;
                }
                WM_UNLOCK();
                return r;
              }
              
              #else
 128          
 129          void WM_Touch_c(void) {} /* avoid empty object files */
 130          
 131          #endif  /* (GUI_WINSUPPORT & GUI_SUPPORT_TOUCH) */
 132          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =      1    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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