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

📄 ew_vxworksadaptor.h

📁 基于Windml2.0的窗口系统原代码 , 以及和MFC CDC兼容的CDC
💻 H
字号:
#ifndef EW_VxWorksAdaptor_H_
#define EW_VxWorksAdaptor_H_
#include "EW_osadaptor.h"
#include "cmouse.h"
#include "ugl/uglucode.h"
#include "ugl/ugl.h"
#include "ugl/uglinput.h"
#include "ugl/uglwin.h"
#include "ugl/uglevent.h"
#include "cdc_objects.h"
#include "kernelLib.h"
#include "wdLib.h"

#define UGL_BUTTON1_DOWN(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 1) != 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 1) != 0) ? \
      UGL_TRUE : UGL_FALSE)

#define UGL_BUTTON1_UP(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 1) == 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 1) != 0) ? \
      UGL_TRUE : UGL_FALSE)

#define UGL_BUTTON1_DRAG(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 1) != 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 1) == 0) ? \
      UGL_TRUE : UGL_FALSE)

#define UGL_BUTTON2_DOWN(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 2) != 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 2) != 0) ? \
      UGL_TRUE : UGL_FALSE)

#define UGL_BUTTON2_UP(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 2) == 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 2) != 0) ? \
      UGL_TRUE : UGL_FALSE)

#define UGL_BUTTON2_DRAG(pEvent) \
    (((pEvent)->header.type == UGL_EVENT_TYPE_POINTER && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonState & 2) != 0 && \
      (((UGL_INPUT_EVENT *)(pEvent))->type.pointer.buttonChange & 2) == 0) ? \
      UGL_TRUE : UGL_FALSE)
      
class EW_VxWorksAdaptor : public EW_OSAdaptor
{

public:
    //##ModelId=3F4E099D01F1
    /*! \brief 程序初始化
     *
     *  调用WindML函数注册窗口类,创建窗口,刷新窗口\n
     *  发送\ref EW_MSG_STARTUP消息
     *  \return 初始化是否成功\n
     *          true    成功\n
     *          false   失败
     */
    bool InitInstance();

    //##ModelId=3F4E09F802BB
    /*! \brief 程序退出
     *
     *  发送\ref EW_MSG_HALT消息,释放对象
     *  \return 退出是否成功\n
     *          true    成功\n
     *          false   失败
     */
    bool ExitInstance();

    //##ModelId=3F4E09F8031F
    /*! \brief 程序运行过程,执行消息循环
     *
     *  执行WindML的消息循环
     *  \return 退出是否成功\n
     *          true    成功\n
     *          false   失败
     */
    bool Execute();
    
public:
	void OnExit() { m_bIsExit = true; }

public:
	void GetScreenSize(int *width , int *height);
	
	CDC *GetDC() ;
	
	CDC *GetMemDC() ;
	
	
private:
	//程序退出状态标志		
	bool m_bIsExit;
	
private:
	/*
	here are these attributes
	windml mouse,
	windml appid,
	windml root window
	windml event router id
	*/
	
	//windml root window
	UGL_WINDOW_ID m_RootWindowId;
	//windml appid,
	UGL_APP_ID	m_appID;
	//windml mouse,		
	CMouse m_Mouse;	
	//windml event router id
	UGL_EVENT_ROUTER_ID m_eventRouterId;
	
	UGL_MODE_INFO m_modeInfo;
			    
private:
	//windml消息处理的源头
	void ProcessEvent(UGL_EVENT event);    
	
	static WDOG_ID m_WatchDogId; 
	
	static int OnTimer();
   
};
#endif //EW_VxWorksAdaptor_H_

⌨️ 快捷键说明

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