diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 05:10:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-16 05:10:06 +0400 |
commit | f2cfe4b2e9212a536a880bde606eb7ce88e0e94a (patch) | |
tree | 24c985799ce09a1b6af7bf6b7b38e9f569e4a905 | |
parent | 761ac8987799050c860f2b649d626aaa4258a8bd (diff) |
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.
-rw-r--r-- | intern/ghost/intern/GHOST_Debug.h | 17 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.h | 9 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 5 |
3 files changed, 22 insertions, 9 deletions
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h index f0db1b3de8d..9292235a9c7 100644 --- a/intern/ghost/intern/GHOST_Debug.h +++ b/intern/ghost/intern/GHOST_Debug.h @@ -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"); \ } \ diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h index 5b2ffced29c..907fac3cfab 100644 --- a/intern/ghost/intern/GHOST_WindowX11.h +++ b/intern/ghost/intern/GHOST_WindowX11.h @@ -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) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 48cad9e020b..c7cd91dfa3e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -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 } |