merge with/from trunk at r35190
[blender.git] / intern / ghost / intern / GHOST_SystemX11.cpp
index 5f7c59fa5e64bbad5adb880693e9ab3fd245ebbe..09a4d9d4de262cd8a947c7e8fad44bcf26ef94af 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * $Id$
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file ghost/intern/GHOST_SystemX11.cpp
+ *  \ingroup GHOST
+ */
+
+
 #include "GHOST_SystemX11.h"
 #include "GHOST_WindowX11.h"
 #include "GHOST_WindowManager.h"
 #include <X11/keysym.h>
 #include <X11/XKBlib.h> /* allow detectable autorepeate */
 
+#ifdef WITH_XF86KEYSYM
+#include <X11/XF86keysym.h>
+#endif
+
 #ifdef __sgi
 
 #if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS)
@@ -388,6 +397,10 @@ processEvents(
        
        bool anyProcessed = false;
        
+       if (playingEvents(&anyProcessed)) {
+               return anyProcessed;
+       }
+       
        do {
                GHOST_TimerManager* timerMgr = getTimerManager();
                
@@ -835,7 +848,10 @@ GHOST_SystemX11::
 getModifierKeys(
        GHOST_ModifierKeys& keys
 ) const {
-
+       if (this->playingEvents(NULL)) {
+               return getEventManager()->getModifierKeys(keys);
+       }
+       
        // analyse the masks retuned from XQueryPointer.
 
        memset((void *)m_keyboard_vector,0,sizeof(m_keyboard_vector));
@@ -957,7 +973,11 @@ getCursorPosition(
        Window root_return, child_return;
        int rx,ry,wx,wy;
        unsigned int mask_return;
-
+       
+       if (playingEvents(NULL)) {
+               return getEventManager()->getCursorPosition(x, y);
+       }
+       
        if (XQueryPointer(
                m_display,
                RootWindow(m_display,DefaultScreen(m_display)),
@@ -1157,6 +1177,16 @@ convertXKey(
                        GXMAP(type,XK_KP_Multiply,      GHOST_kKeyNumpadAsterisk);
                        GXMAP(type,XK_KP_Divide,        GHOST_kKeyNumpadSlash);
 
+                       /* Media keys in some keyboards and laptops with XFree86/Xorg */
+#ifdef WITH_XF86KEYSYM
+                       GXMAP(type,XF86XK_AudioPlay,    GHOST_kKeyMediaPlay);
+                       GXMAP(type,XF86XK_AudioStop,    GHOST_kKeyMediaStop);
+                       GXMAP(type,XF86XK_AudioPrev,    GHOST_kKeyMediaFirst);
+                       GXMAP(type,XF86XK_AudioRewind,  GHOST_kKeyMediaFirst);
+                       GXMAP(type,XF86XK_AudioNext,    GHOST_kKeyMediaLast);
+                       GXMAP(type,XF86XK_AudioForward, GHOST_kKeyMediaLast);
+#endif
+
                                /* some extra sun cruft (NICE KEYBOARD!) */
 #ifdef __sun__
                        GXMAP(type,0xffde,                      GHOST_kKeyNumpad1);
@@ -1476,23 +1506,4 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
        }
 }
 
-const GHOST_TUns8* GHOST_SystemX11::getSystemDir() const
-{
-       return (GHOST_TUns8*) PREFIX "/share";
-}
-
-const GHOST_TUns8* GHOST_SystemX11::getUserDir() const
-{
-       char* env = getenv("HOME");
-       if(env) {
-               return (GHOST_TUns8*) env;
-       } else {
-               return NULL;
-       }
-}
-
-const GHOST_TUns8* GHOST_SystemX11::getBinaryDir() const
-{
-       return NULL;
-}