|
Blender V5.0
|
#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 248 of file GHOST_Wintab.cc.
References WINTAB_PRINTF.
| bool GHOST_Wintab::devicesPresent | ( | ) |
Whether Wintab devices are present.
Definition at line 343 of file GHOST_Wintab.cc.
| void GHOST_Wintab::disable | ( | ) |
Disables the Wintab context and unwinds Wintab state.
Definition at line 259 of file GHOST_Wintab.cc.
References loseFocus().
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::enable | ( | ) |
Enables Wintab context.
Definition at line 253 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::gainFocus | ( | ) |
Brings Wintab context to the top of the overlap order.
Definition at line 268 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::s_wndProc().
|
static |
Definition at line 540 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 353 of file GHOST_Wintab.cc.
References cos, fabs(), float, GHOST_kButtonMaskNone, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kTabletModeEraser, GHOST_kTabletModeNone, GHOST_kTabletModeStylus, i, M_PI, M_PI_2, out, and sin.
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 348 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::processWintabEvent().
| void GHOST_Wintab::leaveRange | ( | ) |
Clean up when Wintab leaves tracking range.
Definition at line 288 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 157 of file GHOST_Wintab.cc.
References access_violation_exception_filter().
Referenced by GHOST_WindowWin32::loadWintab().
| void GHOST_Wintab::loseFocus | ( | ) |
Puts Wintab context at bottom of overlap order and unwinds Wintab state.
Definition at line 274 of file GHOST_Wintab.cc.
References GHOST_kTabletModeNone, and leaveRange().
Referenced by disable(), and GHOST_SystemWin32::s_wndProc().
| void GHOST_Wintab::mapWintabToSysCoordinates | ( | int | x_in, |
| int | y_in, | ||
| int & | x_out, | ||
| int & | y_out ) |
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 484 of file GHOST_Wintab.cc.
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 334 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 298 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::s_wndProc().
|
static |
Definition at line 535 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::initDebug().
| bool GHOST_Wintab::testCoordinates | ( | int | sysX, |
| int | sysY, | ||
| int | wtX, | ||
| int | wtY ) |
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 518 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 513 of file GHOST_Wintab.cc.
Referenced by GHOST_SystemWin32::processWintabEvent().
| void GHOST_Wintab::updateCursorInfo | ( | ) |
Updates cached Wintab properties for current cursor.
Definition at line 310 of file GHOST_Wintab.cc.
References Pressure, and WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::s_wndProc().