minor changes to ghost

- use WITH_ASSERT_ABORT define, so GHOST_ASSERT will abort.
- rename XTablet -> GHOST_TabletX11, was confusing since it was named like an xlib struct.
This commit is contained in:
Campbell Barton 2013-01-16 01:10:06 +00:00
parent 761ac89877
commit f2cfe4b2e9
3 changed files with 22 additions and 9 deletions

@ -58,12 +58,23 @@
# define GHOST_PRINTF(x, ...)
#endif // GHOST_DEBUG
#ifdef GHOST_DEBUG
#ifdef WITH_ASSERT_ABORT
# include <stdio.h> //for fprintf()
# include <stdlib.h> //for abort()
# define GHOST_ASSERT(x, info) \
{ \
if (!(x)) { \
fprintf(stderr, "GHOST_ASSERT failed: "); \
fprintf(stderr, info); \
fprintf(stderr, "\n"); \
abort(); \
} \
} (void)0
#elif defined(GHOST_DEBUG)
# define GHOST_ASSERT(x, info) \
{ \
if (!(x)) { \
GHOST_PRINT("assertion failed: "); \
GHOST_PRINT("GHOST_ASSERT failed: "); \
GHOST_PRINT(info); \
GHOST_PRINT("\n"); \
} \

@ -196,9 +196,8 @@ public:
getXWindow(
);
#ifdef WITH_X11_XINPUT
class XTablet
typedef struct GHOST_TabletX11
{
public:
GHOST_TabletData CommonData;
XDevice *StylusDevice;
@ -212,9 +211,9 @@ public:
int PressureLevels;
int XtiltLevels, YtiltLevels;
};
} GHOST_TabletX11;
XTablet& GetXTablet()
GHOST_TabletX11 &GetXTablet()
{
return m_xtablet;
}
@ -388,7 +387,7 @@ private:
#ifdef WITH_X11_XINPUT
/* Tablet devices */
XTablet m_xtablet;
GHOST_TabletX11 m_xtablet;
#endif
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)

@ -2756,7 +2756,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* initialize and copy state (only mouse x y and modifiers) */
event = *evt;
switch (type) {
/* mouse move, also to inactive window (X11 does this) */
case GHOST_kEventCursorMove:
@ -3100,4 +3100,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
}
#if 0
WM_event_print(&event);
#endif
}