diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.h')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.h | 164 |
1 files changed, 91 insertions, 73 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h index 86916b3aeeb..00b626511ab 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.h +++ b/intern/ghost/intern/GHOST_SystemWin32.h @@ -64,6 +64,8 @@ class GHOST_SystemWin32 : public GHOST_System { ** Time(r) functionality ***************************************************************************************/ + GHOST_TUns64 millisSinceStart(__int64 ms) const; + /** * This method converts performance counter measurements into milliseconds since the start of the * system process. @@ -111,19 +113,19 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Create a new window. * The new window is added to the list of windows managed. - * Never explicitly delete the window, use disposeWindow() instead. - * \param title The name of the window + * Never explicitly delete the window, use #disposeWindow() instead. + * \param title: The name of the window. * (displayed in the title bar of the window if the OS supports it). - * \param left The coordinate of the left edge of the window. - * \param top The coordinate of the top edge of the window. - * \param width The width the window. - * \param height The height the window. - * \param state The state of the window when opened. - * \param type The type of drawing context installed in this window. + * \param left: The coordinate of the left edge of the window. + * \param top: The coordinate of the top edge of the window. + * \param width: The width the window. + * \param height: The height the window. + * \param state: The state of the window when opened. + * \param type: The type of drawing context installed in this window. * \param glSettings: Misc OpenGL settings. * \param exclusive: Use to show the window ontop and ignore others (used fullscreen). - * \param parentWindow Parent window - * \return The new window (or 0 if creation failed). + * \param parentWindow: Parent window. + * \return The new window (or 0 if creation failed). */ GHOST_IWindow *createWindow(const char *title, GHOST_TInt32 left, @@ -140,14 +142,14 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Create a new offscreen context. * Never explicitly delete the window, use disposeContext() instead. - * \return The new context (or 0 if creation failed). + * \return The new context (or 0 if creation failed). */ GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings); /** * Dispose of a context. - * \param context Pointer to the context to be disposed. - * \return Indication of success. + * \param context: Pointer to the context to be disposed. + * \return Indication of success. */ GHOST_TSuccess disposeContext(GHOST_IContext *context); @@ -156,15 +158,15 @@ class GHOST_SystemWin32 : public GHOST_System { * Never explicitly delete the context, use disposeContext() instead. * This is for GHOST internal, Win32 specific use, so it can be called statically. * - * \return The new context (or 0 if creation failed). + * \return The new context (or 0 if creation failed). */ static GHOST_ContextD3D *createOffscreenContextD3D(); /** * Dispose of a DirectX context. * This is for GHOST internal, Win32 specific use, so it can be called statically. - * \param context Pointer to the context to be disposed. - * \return Indication of success. + * \param context: Pointer to the context to be disposed. + * \return Indication of success. */ static GHOST_TSuccess disposeContextD3D(GHOST_ContextD3D *context); @@ -174,7 +176,7 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Gets events from the system and stores them in the queue. - * \param waitForEvent Flag to wait for an event (or return immediately). + * \param waitForEvent: Flag to wait for an event (or return immediately). * \return Indication of the presence of events. */ bool processEvents(bool waitForEvent); @@ -185,17 +187,17 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Returns the current location of the cursor (location in screen coordinates) - * \param x The x-coordinate of the cursor. - * \param y The y-coordinate of the cursor. - * \return Indication of success. + * \param x: The x-coordinate of the cursor. + * \param y: The y-coordinate of the cursor. + * \return Indication of success. */ GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const; /** * Updates the location of the cursor (location in screen coordinates). - * \param x The x-coordinate of the cursor. - * \param y The y-coordinate of the cursor. - * \return Indication of success. + * \param x: The x-coordinate of the cursor. + * \param y: The y-coordinate of the cursor. + * \return Indication of success. */ GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); @@ -205,40 +207,40 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Returns the state of all modifier keys. - * \param keys The state of all modifier keys (true == pressed). - * \return Indication of success. + * \param keys: The state of all modifier keys (true == pressed). + * \return Indication of success. */ GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const; /** * Returns the state of the mouse buttons (outside the message queue). - * \param buttons The state of the buttons. - * \return Indication of success. + * \param buttons: The state of the buttons. + * \return Indication of success. */ GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const; /** * Returns unsigned char from CUT_BUFFER0 - * \param selection Used by X11 only - * \return Returns the Clipboard + * \param selection: Used by X11 only. + * \return Returns the Clipboard. */ GHOST_TUns8 *getClipboard(bool selection) const; /** - * Puts buffer to system clipboard - * \param selection Used by X11 only - * \return No return + * Puts buffer to system clipboard. + * \param selection: Used by X11 only. + * \return No return. */ void putClipboard(GHOST_TInt8 *buffer, bool selection) const; /** * Show a system message box - * \param title The title of the message box - * \param message The message to display - * \param help_label Help button label - * \param continue_label Continue button label - * \param link An optional hyperlink - * \param dialog_options Options how to display the message + * \param title: The title of the message box. + * \param message: The message to display. + * \param help_label: Help button label. + * \param continue_label: Continue button label. + * \param link: An optional hyperlink. + * \param dialog_options: Options how to display the message. */ GHOST_TSuccess showMessageBox(const char *title, const char *message, @@ -265,6 +267,16 @@ class GHOST_SystemWin32 : public GHOST_System { int mouseY, void *data); + /*************************************************************************************** + ** Modify tablet API + ***************************************************************************************/ + + /** + * Set which tablet API to use. + * \param api: Enum indicating which API to use. + */ + void setTabletAPI(GHOST_TTabletAPI api) override; + protected: /** * Initializes the system. @@ -281,27 +293,27 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Converts raw WIN32 key codes from the wndproc to GHOST keys. - * \param vKey The virtual key from hardKey - * \param ScanCode The ScanCode of pressed key (similar to PS/2 Set 1) - * \param extend Flag if key is not primly (left or right) + * \param vKey: The virtual key from #hardKey. + * \param ScanCode: The ScanCode of pressed key (similar to PS/2 Set 1). + * \param extend: Flag if key is not primly (left or right). * \return The GHOST key (GHOST_kKeyUnknown if no match). */ GHOST_TKey convertKey(short vKey, short ScanCode, short extend) const; /** * Catches raw WIN32 key codes from WM_INPUT in the wndproc. - * \param raw RawInput structure with detailed info about the key event - * \param keyDown Pointer flag that specify if a key is down - * \param vk Pointer to virtual key + * \param raw: RawInput structure with detailed info about the key event. + * \param keyDown: Pointer flag that specify if a key is down. + * \param vk: Pointer to virtual key. * \return The GHOST key (GHOST_kKeyUnknown if no match). */ GHOST_TKey hardKey(RAWINPUT const &raw, bool *r_keyDown, bool *r_is_repeated_modifier); /** * Creates mouse button event. - * \param type The type of event to create. - * \param window The window receiving the event (the active window). - * \param mask The button mask of this event. + * \param type: The type of event to create. + * \param window: The window receiving the event (the active window). + * \param mask: The button mask of this event. * \return The event created. */ static GHOST_EventButton *processButtonEvent(GHOST_TEventType type, @@ -310,34 +322,40 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Creates tablet events from Wintab events. - * \param type The type of pointer event - * \param window The window receiving the event (the active window). + * \param type: The type of pointer event. + * \param window: The window receiving the event (the active window). + * \param mask: The button mask of the calling event. + * \param mousePressed: Whether the mouse is currently pressed. + * \return True if the method handled the event. */ - static GHOST_TSuccess processWintabEvents(GHOST_TEventType type, GHOST_WindowWin32 *window); + static GHOST_TSuccess processWintabEvent(GHOST_TEventType type, + GHOST_WindowWin32 *window, + GHOST_TButtonMask mask, + bool mousePressed); /** * Creates tablet events from pointer events. - * \param type The type of pointer event - * \param window The window receiving the event (the active window). - * \param wParam The wParam from the wndproc - * \param lParam The lParam from the wndproc - * \param eventhandled true if the method handled the event + * \param type: The type of pointer event. + * \param window: The window receiving the event (the active window). + * \param wParam: The wParam from the wndproc. + * \param lParam: The lParam from the wndproc. + * \param eventhandled: True if the method handled the event. */ - static void processPointerEvents( + static void processPointerEvent( UINT type, GHOST_WindowWin32 *window, WPARAM wParam, LPARAM lParam, bool &eventhandled); /** * Creates cursor event. - * \param window The window receiving the event (the active window). + * \param window: The window receiving the event (the active window). * \return The event created. */ static GHOST_EventCursor *processCursorEvent(GHOST_WindowWin32 *window); /** * Handles a mouse wheel event. - * \param window The window receiving the event (the active window). - * \param wParam The wParam from the wndproc - * \param lParam The lParam from the wndproc + * \param window: The window receiving the event (the active window). + * \param wParam: The wParam from the wndproc. + * \param lParam: The lParam from the wndproc. */ static void processWheelEvent(GHOST_WindowWin32 *window, WPARAM wParam, LPARAM lParam); @@ -345,23 +363,23 @@ class GHOST_SystemWin32 : public GHOST_System { * Creates a key event and updates the key data stored locally (m_modifierKeys). * In most cases this is a straightforward conversion of key codes. * For the modifier keys however, we want to distinguish left and right keys. - * \param window The window receiving the event (the active window). - * \param raw RawInput structure with detailed info about the key event + * \param window: The window receiving the event (the active window). + * \param raw: RawInput structure with detailed info about the key event. */ static GHOST_EventKey *processKeyEvent(GHOST_WindowWin32 *window, RAWINPUT const &raw); /** * Process special keys (VK_OEM_*), to see if current key layout * gives us anything special, like ! on french AZERTY. - * \param vKey The virtual key from hardKey - * \param scanCode The ScanCode of pressed key (simular to PS/2 Set 1) + * \param vKey: The virtual key from #hardKey. + * \param scanCode: The ScanCode of pressed key (similar to PS/2 Set 1). */ GHOST_TKey processSpecialKey(short vKey, short scanCode) const; /** * Creates a window event. - * \param type The type of event to create. - * \param window The window receiving the event (the active window). + * \param type: The type of event to create. + * \param window: The window receiving the event (the active window). * \return The event created. */ static GHOST_Event *processWindowEvent(GHOST_TEventType type, GHOST_WindowWin32 *window); @@ -369,9 +387,9 @@ class GHOST_SystemWin32 : public GHOST_System { #ifdef WITH_INPUT_IME /** * Creates a IME event. - * \param type The type of event to create. - * \param window The window receiving the event (the active window). - * \param data IME data. + * \param type: The type of event to create. + * \param window: The window receiving the event (the active window). + * \param data: IME data. * \return The event created. */ static GHOST_Event *processImeEvent(GHOST_TEventType type, @@ -381,7 +399,7 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Handles minimum window size. - * \param minmax The MINMAXINFO structure. + * \param minmax: The MINMAXINFO structure. */ static void processMinMaxInfo(MINMAXINFO *minmax); @@ -390,7 +408,7 @@ class GHOST_SystemWin32 : public GHOST_System { * Handles Motion and Button events from a SpaceNavigator or related device. * Instead of returning an event object, this function communicates directly * with the GHOST_NDOFManager. - * \param raw RawInput structure with detailed info about the NDOF event + * \param raw: RawInput structure with detailed info about the NDOF event. * \return Whether an event was generated and sent. */ bool processNDOF(RAWINPUT const &raw); @@ -398,7 +416,7 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Returns the local state of the modifier keys (from the message queue). - * \param keys The state of the keys. + * \param keys: The state of the keys. */ inline void retrieveModifierKeys(GHOST_ModifierKeys &keys) const; @@ -421,7 +439,7 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Toggles console - * \param action + * \param action: * - 0 - Hides * - 1 - Shows * - 2 - Toggles |