Blender
V3.3
|
#include <GHOST_Wintab.h>
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 62 of file GHOST_Wintab.h.
GHOST_Wintab::~GHOST_Wintab | ( | ) |
Definition at line 202 of file GHOST_Wintab.cpp.
References WINTAB_PRINTF.
bool GHOST_Wintab::devicesPresent | ( | ) |
Whether Wintab devices are present.
Definition at line 297 of file GHOST_Wintab.cpp.
Referenced by GHOST_WindowWin32::usingTabletAPI().
void GHOST_Wintab::disable | ( | ) |
Disables the Wintab context and unwinds Wintab state.
Definition at line 213 of file GHOST_Wintab.cpp.
References loseFocus().
Referenced by GHOST_SystemWin32::s_wndProc().
void GHOST_Wintab::enable | ( | ) |
Enables Wintab context.
Definition at line 207 of file GHOST_Wintab.cpp.
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 222 of file GHOST_Wintab.cpp.
Referenced by GHOST_WindowWin32::loadWintab(), and GHOST_SystemWin32::s_wndProc().
|
static |
Definition at line 489 of file GHOST_Wintab.cpp.
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 307 of file GHOST_Wintab.cpp.
References KDL::cos(), fabs(), float(), GHOST_kButtonMaskNone, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kTabletModeEraser, GHOST_kTabletModeNone, GHOST_kTabletModeStylus, M_PI, M_PI_2, usdtokens::out(), and KDL::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 302 of file GHOST_Wintab.cpp.
Referenced by GHOST_WindowWin32::getTabletData(), and GHOST_SystemWin32::processWintabEvent().
void GHOST_Wintab::leaveRange | ( | ) |
Clean up when Wintab leaves tracking range.
Definition at line 242 of file GHOST_Wintab.cpp.
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 11 of file GHOST_Wintab.cpp.
References enable(), FALSE, 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 228 of file GHOST_Wintab.cpp.
References GHOST_TabletData::Active, 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 433 of file GHOST_Wintab.cpp.
References blender::math::abs(), and usdtokens::out().
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 288 of file GHOST_Wintab.cpp.
References WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::s_wndProc().
void GHOST_Wintab::remapCoordinates | ( | ) |
Handle Wintab coordinate changes when DisplayChange events occur.
Definition at line 252 of file GHOST_Wintab.cpp.
Referenced by GHOST_SystemWin32::s_wndProc().
Definition at line 484 of file GHOST_Wintab.cpp.
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 async mismatch causes mouse movement to replay and snap back, which is only an issue while drawing.
Definition at line 467 of file GHOST_Wintab.cpp.
References blender::math::abs(), and mapWintabToSysCoordinates().
Referenced by GHOST_SystemWin32::processWintabEvent().
bool GHOST_Wintab::trustCoordinates | ( | ) |
Whether Wintab coordinates should be trusted.
Definition at line 462 of file GHOST_Wintab.cpp.
Referenced by GHOST_SystemWin32::processWintabEvent().
void GHOST_Wintab::updateCursorInfo | ( | ) |
Updates cached Wintab properties for current cursor.
Definition at line 264 of file GHOST_Wintab.cpp.
References WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::s_wndProc().