|
Blender V4.3
|
#include <GHOST_Wintab.hh>
Public Member Functions | |
| ~GHOST_Wintab () | |
| void | enable () |
| void | disable () |
| void | gainFocus () |
| void | loseFocus () |
| void | leaveRange () |
| void | remapCoordinates () |
| void | mapWintabToSysCoordinates (int x_in, int y_in, int &x_out, int &y_out) |
| void | updateCursorInfo () |
| void | processInfoChange (LPARAM lParam) |
| bool | devicesPresent () |
| void | getInput (std::vector< GHOST_WintabInfoWin32 > &outWintabInfo) |
| bool | trustCoordinates () |
| bool | testCoordinates (int sysX, int sysY, int wtX, int wtY) |
| GHOST_TabletData | getLastTabletData () |
Static Public Member Functions | |
| static GHOST_Wintab * | loadWintab (HWND hwnd) |
| static void | setDebug (bool debug) |
| static bool | getDebug () |
Definition at line 74 of file GHOST_Wintab.hh.
| GHOST_Wintab::~GHOST_Wintab | ( | ) |
Definition at line 206 of file GHOST_Wintab.cc.
References WINTAB_PRINTF.
| bool GHOST_Wintab::devicesPresent | ( | ) |
Whether Wintab devices are present.
Definition at line 301 of file GHOST_Wintab.cc.
Referenced by GHOST_WindowWin32::usingTabletAPI().
| void GHOST_Wintab::disable | ( | ) |
Disables the Wintab context and unwinds Wintab state.
Definition at line 217 of file GHOST_Wintab.cc.
References loseFocus().
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::enable | ( | ) |
Enables Wintab context.
Definition at line 211 of file GHOST_Wintab.cc.
Referenced by GHOST_WindowWin32::loadWintab(), loadWintab(), and GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::gainFocus | ( | ) |
Brings Wintab context to the top of the overlap order.
Definition at line 226 of file GHOST_Wintab.cc.
Referenced by GHOST_WindowWin32::loadWintab(), and GHOST_SystemWin32::s_wndProc().
|
static |
Definition at line 494 of file GHOST_Wintab.cc.
| void GHOST_Wintab::getInput | ( | std::vector< GHOST_WintabInfoWin32 > & | outWintabInfo | ) |
Translate Wintab packets into GHOST_WintabInfoWin32 structs.
| outWintabInfo | Storage to return resulting GHOST_WintabInfoWin32 data. |
Definition at line 311 of file GHOST_Wintab.cc.
References GHOST_TabletData::Active, cos(), fabs(), float, GHOST_kButtonMaskNone, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kTabletModeEraser, GHOST_kTabletModeNone, GHOST_kTabletModeStylus, M_PI, M_PI_2, and GHOST_WintabInfoWin32::tabletData.
Referenced by GHOST_SystemWin32::processWintabEvent().
| GHOST_TabletData GHOST_Wintab::getLastTabletData | ( | ) |
Retrieve the most recent tablet data, or none if pen is not in range.
Definition at line 306 of file GHOST_Wintab.cc.
Referenced by GHOST_WindowWin32::getTabletData(), and GHOST_SystemWin32::processWintabEvent().
| void GHOST_Wintab::leaveRange | ( | ) |
Clean up when Wintab leaves tracking range.
Definition at line 246 of file GHOST_Wintab.cc.
References GHOST_TABLET_DATA_NONE.
Referenced by loseFocus(), and GHOST_SystemWin32::s_wndProc().
|
static |
Loads Wintab if available.
| hwnd | Window to attach Wintab context to. |
Definition at line 13 of file GHOST_Wintab.cc.
References enable(), FALSE, max, min, and WINTAB_PRINTF.
Referenced by GHOST_WindowWin32::loadWintab().
| void GHOST_Wintab::loseFocus | ( | ) |
Puts Wintab context at bottom of overlap order and unwinds Wintab state.
Definition at line 232 of file GHOST_Wintab.cc.
References GHOST_TabletData::Active, GHOST_kTabletModeNone, and leaveRange().
Referenced by disable(), and GHOST_SystemWin32::s_wndProc().
Maps Wintab to Win32 display coordinates.
| x_in | The tablet x coordinate. |
| y_in | The tablet y coordinate. |
| x_out | Output for the Win32 mapped x coordinate. |
| y_out | Output for the Win32 mapped y coordinate. |
Definition at line 438 of file GHOST_Wintab.cc.
References abs().
Referenced by GHOST_SystemWin32::processWintabEvent(), and testCoordinates().
| void GHOST_Wintab::processInfoChange | ( | LPARAM | lParam | ) |
Handle Wintab info changes such as change in number of connected tablets.
| lParam | LPARAM of the event. |
Definition at line 292 of file GHOST_Wintab.cc.
References WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::remapCoordinates | ( | ) |
Handle Wintab coordinate changes when DisplayChange events occur.
Definition at line 256 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::s_wndProc().
|
static |
Definition at line 489 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::initDebug().
Tests whether Wintab coordinates can be trusted by comparing Win32 and Wintab reported cursor position.
| sysX | System cursor x position. |
| sysY | System cursor y position. |
| wtX | Wintab cursor x position. |
| wtY | Wintab cursor y position. |
NOTE: Only test coordinates on button press, not release. This prevents issues when asynchronous mismatch causes mouse movement to replay and snap back, which is only an issue while drawing.
Definition at line 472 of file GHOST_Wintab.cc.
References abs(), and mapWintabToSysCoordinates().
Referenced by GHOST_SystemWin32::processWintabEvent().
| bool GHOST_Wintab::trustCoordinates | ( | ) |
Whether Wintab coordinates should be trusted.
Definition at line 467 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::processWintabEvent().
| void GHOST_Wintab::updateCursorInfo | ( | ) |
Updates cached Wintab properties for current cursor.
Definition at line 268 of file GHOST_Wintab.cc.
References Pressure, and WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::s_wndProc().