Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_WindowWin32.h
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
| typedef BOOL(API * GHOST_WIN32_RegisterTouchWindow)(HWND hwnd, ULONG ulFlags); | typedef BOOL(API * GHOST_WIN32_RegisterTouchWindow)(HWND hwnd, ULONG ulFlags); | ||||
| // typedefs for user32 functions to allow dynamic loading of Windows 10 DPI scaling functions | // typedefs for user32 functions to allow dynamic loading of Windows 10 DPI scaling functions | ||||
| typedef UINT(API * GHOST_WIN32_GetDpiForWindow)(HWND); | typedef UINT(API * GHOST_WIN32_GetDpiForWindow)(HWND); | ||||
| #ifndef USER_DEFAULT_SCREEN_DPI | #ifndef USER_DEFAULT_SCREEN_DPI | ||||
| #define USER_DEFAULT_SCREEN_DPI 96 | #define USER_DEFAULT_SCREEN_DPI 96 | ||||
| #endif // USER_DEFAULT_SCREEN_DPI | #endif // USER_DEFAULT_SCREEN_DPI | ||||
| // typedefs for user32 functions to allow pointer functions | |||||
| enum tagPOINTER_INPUT_TYPE { | |||||
| PT_POINTER = 1, // Generic pointer | |||||
| PT_TOUCH = 2, // Touch | |||||
| PT_PEN = 3, // Pen | |||||
| PT_MOUSE = 4, // Mouse | |||||
| #if(WINVER >= 0x0603) | |||||
| PT_TOUCHPAD = 5, // Touchpad | |||||
| #endif /* WINVER >= 0x0603 */ | |||||
| }; | |||||
| typedef enum tagPOINTER_BUTTON_CHANGE_TYPE { | |||||
| POINTER_CHANGE_NONE, | |||||
| POINTER_CHANGE_FIRSTBUTTON_DOWN, | |||||
| POINTER_CHANGE_FIRSTBUTTON_UP, | |||||
| POINTER_CHANGE_SECONDBUTTON_DOWN, | |||||
| POINTER_CHANGE_SECONDBUTTON_UP, | |||||
| POINTER_CHANGE_THIRDBUTTON_DOWN, | |||||
| POINTER_CHANGE_THIRDBUTTON_UP, | |||||
| POINTER_CHANGE_FOURTHBUTTON_DOWN, | |||||
| POINTER_CHANGE_FOURTHBUTTON_UP, | |||||
| POINTER_CHANGE_FIFTHBUTTON_DOWN, | |||||
| POINTER_CHANGE_FIFTHBUTTON_UP, | |||||
| } POINTER_BUTTON_CHANGE_TYPE; | |||||
| typedef DWORD POINTER_INPUT_TYPE; | |||||
| typedef UINT32 POINTER_FLAGS; | |||||
| typedef struct tagPOINTER_INFO { | |||||
| POINTER_INPUT_TYPE pointerType; | |||||
| UINT32 pointerId; | |||||
| UINT32 frameId; | |||||
| POINTER_FLAGS pointerFlags; | |||||
| HANDLE sourceDevice; | |||||
| HWND hwndTarget; | |||||
| POINT ptPixelLocation; | |||||
| POINT ptHimetricLocation; | |||||
| POINT ptPixelLocationRaw; | |||||
| POINT ptHimetricLocationRaw; | |||||
| DWORD dwTime; | |||||
| UINT32 historyCount; | |||||
| INT32 InputData; | |||||
| DWORD dwKeyStates; | |||||
| UINT64 PerformanceCount; | |||||
| POINTER_BUTTON_CHANGE_TYPE ButtonChangeType; | |||||
| } POINTER_INFO; | |||||
| typedef UINT32 PEN_FLAGS; | |||||
| #define PEN_FLAG_NONE 0x00000000 // Default | |||||
| #define PEN_FLAG_BARREL 0x00000001 // The barrel button is pressed | |||||
| #define PEN_FLAG_INVERTED 0x00000002 // The pen is inverted | |||||
| #define PEN_FLAG_ERASER 0x00000004 // The eraser button is pressed | |||||
| typedef UINT32 PEN_MASK; | |||||
| #define PEN_MASK_NONE 0x00000000 // Default - none of the optional fields are valid | |||||
| #define PEN_MASK_PRESSURE 0x00000001 // The pressure field is valid | |||||
| #define PEN_MASK_ROTATION 0x00000002 // The rotation field is valid | |||||
| #define PEN_MASK_TILT_X 0x00000004 // The tiltX field is valid | |||||
| #define PEN_MASK_TILT_Y 0x00000008 // The tiltY field is valid | |||||
| typedef struct tagPOINTER_PEN_INFO { | |||||
| POINTER_INFO pointerInfo; | |||||
| PEN_FLAGS penFlags; | |||||
| PEN_MASK penMask; | |||||
| UINT32 pressure; | |||||
| UINT32 rotation; | |||||
| INT32 tiltX; | |||||
| INT32 tiltY; | |||||
| } POINTER_PEN_INFO; | |||||
| typedef BOOL (API * GHOST_WIN32_GetPointerInfo)(UINT32 pointerId, POINTER_INFO *pointerInfo); | |||||
| typedef BOOL (API * GHOST_WIN32_GetPointerPenInfo)(UINT32 pointerId, POINTER_PEN_INFO *penInfo); | |||||
| /** | /** | ||||
| * GHOST window on M$ Windows OSs. | * GHOST window on M$ Windows OSs. | ||||
| * \author Maarten Gribnau | * \author Maarten Gribnau | ||||
| * \date May 10, 2001 | * \date May 10, 2001 | ||||
| */ | */ | ||||
| class GHOST_WindowWin32 : public GHOST_Window { | class GHOST_WindowWin32 : public GHOST_Window { | ||||
| public: | public: | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | public: | ||||
| * Loads the windows equivalent of a standard GHOST cursor. | * Loads the windows equivalent of a standard GHOST cursor. | ||||
| * \param visible Flag for cursor visibility. | * \param visible Flag for cursor visibility. | ||||
| * \param cursorShape The cursor shape. | * \param cursorShape The cursor shape. | ||||
| */ | */ | ||||
| void loadCursor(bool visible, GHOST_TStandardCursor cursorShape) const; | void loadCursor(bool visible, GHOST_TStandardCursor cursorShape) const; | ||||
| const GHOST_TabletData *GetTabletData() | const GHOST_TabletData *GetTabletData() | ||||
| { | { | ||||
| return m_tabletData; | return &m_tabletData; | ||||
| } | } | ||||
| void processWin32PointerEvent(WPARAM wParam); | |||||
| void processWin32TabletActivateEvent(WORD state); | void processWin32TabletActivateEvent(WORD state); | ||||
| void processWin32TabletInitEvent(); | void processWin32TabletInitEvent(); | ||||
| void processWin32TabletEvent(WPARAM wParam, LPARAM lParam); | void processWin32TabletEvent(WPARAM wParam, LPARAM lParam); | ||||
| void bringTabletContextToFront(); | void bringTabletContextToFront(); | ||||
| GHOST_TSuccess beginFullScreen() const {return GHOST_kFailure;} | GHOST_TSuccess beginFullScreen() const {return GHOST_kFailure;} | ||||
| GHOST_TSuccess endFullScreen() const {return GHOST_kFailure;} | GHOST_TSuccess endFullScreen() const {return GHOST_kFailure;} | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | private: | ||||
| bool m_wantAlphaBackground; | bool m_wantAlphaBackground; | ||||
| /** ITaskbarList3 structure for progress bar*/ | /** ITaskbarList3 structure for progress bar*/ | ||||
| ITaskbarList3 *m_Bar; | ITaskbarList3 *m_Bar; | ||||
| static const wchar_t *s_windowClassName; | static const wchar_t *s_windowClassName; | ||||
| static const int s_maxTitleLength; | static const int s_maxTitleLength; | ||||
| /** Tablet data for GHOST */ | |||||
| GHOST_TabletData m_tabletData; | |||||
| /* Wintab API */ | |||||
| struct { | |||||
| /** WinTab dll handle */ | /** WinTab dll handle */ | ||||
| HMODULE m_wintab; | HMODULE handle; | ||||
| /** Tablet data for GHOST */ | /** API functions */ | ||||
| GHOST_TabletData *m_tabletData; | GHOST_WIN32_WTInfo info; | ||||
| GHOST_WIN32_WTOpen open; | |||||
| GHOST_WIN32_WTClose close; | |||||
| GHOST_WIN32_WTPacket packet; | |||||
| GHOST_WIN32_WTEnable enable; | |||||
| GHOST_WIN32_WTOverlap overlap; | |||||
| /** Stores the Tablet context if detected Tablet features using WinTab.dll */ | /** Stores the Tablet context if detected Tablet features using WinTab.dll */ | ||||
| HCTX m_tablet; | HCTX tablet; | ||||
| LONG m_maxPressure; | LONG maxPressure; | ||||
| LONG m_maxAzimuth, m_maxAltitude; | LONG maxAzimuth, maxAltitude; | ||||
| } m_wintab; | |||||
| GHOST_TWindowState m_normal_state; | GHOST_TWindowState m_normal_state; | ||||
| /** user32 dll handle*/ | /** user32 dll handle*/ | ||||
| HMODULE m_user32; | HMODULE m_user32; | ||||
| GHOST_WIN32_GetPointerInfo m_fpGetPointerInfo; | |||||
| GHOST_WIN32_GetPointerPenInfo m_fpGetPointerPenInfo; | |||||
| /** Hwnd to parent window */ | /** Hwnd to parent window */ | ||||
| GHOST_TEmbedderWindowID m_parentWindowHwnd; | GHOST_TEmbedderWindowID m_parentWindowHwnd; | ||||
| #ifdef WITH_INPUT_IME | #ifdef WITH_INPUT_IME | ||||
| /** Handle input method editors event */ | /** Handle input method editors event */ | ||||
| GHOST_ImeWin32 m_imeInput; | GHOST_ImeWin32 m_imeInput; | ||||
| #endif | #endif | ||||
| bool m_debug_context; | bool m_debug_context; | ||||
| }; | }; | ||||
| #endif // __GHOST_WINDOWWIN32_H__ | #endif // __GHOST_WINDOWWIN32_H__ | ||||