Blender  V2.93
Classes | Macros | Functions | Variables
GHOST_SystemX11.cpp File Reference
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include "GHOST_DisplayManagerX11.h"
#include "GHOST_EventButton.h"
#include "GHOST_EventCursor.h"
#include "GHOST_EventDragnDrop.h"
#include "GHOST_EventKey.h"
#include "GHOST_EventWheel.h"
#include "GHOST_SystemX11.h"
#include "GHOST_TimerManager.h"
#include "GHOST_WindowManager.h"
#include "GHOST_WindowX11.h"
#include "GHOST_Debug.h"
#include "GHOST_ContextGLX.h"
#include <sys/time.h>
#include <unistd.h>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <vector>

Go to the source code of this file.

Classes

struct  init_timestamp_data
 
class  DialogData
 

Macros

#define USE_UNITY_WORKAROUND
 
#define USE_NON_LATIN_KB_WORKAROUND
 
#define GHOST_INTERN_ATOM_IF_EXISTS(atom)
 
#define GHOST_INTERN_ATOM(atom)
 
#define GXMAP(k, x, y)
 
#define MAKE_ID(a, b, c, d)   ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
 
#define XCLIB_XCOUT_NONE   0 /* no context */
 
#define XCLIB_XCOUT_SENTCONVSEL   1 /* sent a request */
 
#define XCLIB_XCOUT_INCR   2 /* in an incr loop */
 
#define XCLIB_XCOUT_FALLBACK   3 /* STRING failed, need fallback to UTF8 */
 
#define XCLIB_XCOUT_FALLBACK_UTF8   4 /* UTF8 failed, move to compound. */
 
#define XCLIB_XCOUT_FALLBACK_COMP   5 /* compound failed, move to text. */
 
#define XCLIB_XCOUT_FALLBACK_TEXT   6
 

Functions

static uchar bit_is_on (const uchar *ptr, int bit)
 
static GHOST_TKey ghost_key_from_keysym (const KeySym key)
 
static GHOST_TKey ghost_key_from_keycode (const XkbDescPtr xkb_descr, const KeyCode keycode)
 
static GHOST_TKey ghost_key_from_keysym_or_keycode (const KeySym key, const XkbDescPtr xkb_descr, const KeyCode keycode)
 
static void SleepTillEvent (Display *display, GHOST_TInt64 maxSleep)
 
static Bool init_timestamp_scanner (Display *, XEvent *event, XPointer arg)
 
static GHOST_TSuccess getCursorPosition_impl (Display *display, GHOST_TInt32 &x, GHOST_TInt32 &y, Window *child_return)
 
int GHOST_X11_ApplicationErrorHandler (Display *display, XErrorEvent *event)
 
int GHOST_X11_ApplicationIOErrorHandler (Display *)
 
Message Box
static void split (const char *text, const char *seps, char ***str, int *count)
 

Variables

static char * txt_cut_buffer = NULL
 
static char * txt_select_buffer = NULL
 

Macro Definition Documentation

◆ GHOST_INTERN_ATOM

#define GHOST_INTERN_ATOM (   atom)
Value:
{ \
m_atom.atom = XInternAtom(m_display, #atom, False); \
} \
(void)0

◆ GHOST_INTERN_ATOM_IF_EXISTS

#define GHOST_INTERN_ATOM_IF_EXISTS (   atom)
Value:
{ \
m_atom.atom = XInternAtom(m_display, #atom, True); \
} \
(void)0

◆ GXMAP

#define GXMAP (   k,
  x,
  y 
)
Value:
case x: \
k = y; \
break
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y

Definition at line 1775 of file GHOST_SystemX11.cpp.

◆ MAKE_ID

#define MAKE_ID (   a,
  b,
  c,
 
)    ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))

Definition at line 1903 of file GHOST_SystemX11.cpp.

◆ USE_NON_LATIN_KB_WORKAROUND

#define USE_NON_LATIN_KB_WORKAROUND

Definition at line 94 of file GHOST_SystemX11.cpp.

◆ USE_UNITY_WORKAROUND

#define USE_UNITY_WORKAROUND

Definition at line 90 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_FALLBACK

#define XCLIB_XCOUT_FALLBACK   3 /* STRING failed, need fallback to UTF8 */

Definition at line 1934 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_FALLBACK_COMP

#define XCLIB_XCOUT_FALLBACK_COMP   5 /* compound failed, move to text. */

Definition at line 1936 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_FALLBACK_TEXT

#define XCLIB_XCOUT_FALLBACK_TEXT   6

Definition at line 1937 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_FALLBACK_UTF8

#define XCLIB_XCOUT_FALLBACK_UTF8   4 /* UTF8 failed, move to compound. */

Definition at line 1935 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_INCR

#define XCLIB_XCOUT_INCR   2 /* in an incr loop */

Definition at line 1933 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_NONE

#define XCLIB_XCOUT_NONE   0 /* no context */

Definition at line 1931 of file GHOST_SystemX11.cpp.

◆ XCLIB_XCOUT_SENTCONVSEL

#define XCLIB_XCOUT_SENTCONVSEL   1 /* sent a request */

Definition at line 1932 of file GHOST_SystemX11.cpp.

Function Documentation

◆ bit_is_on()

static uchar bit_is_on ( const uchar ptr,
int  bit 
)
static

Definition at line 96 of file GHOST_SystemX11.cpp.

References ptr.

◆ getCursorPosition_impl()

static GHOST_TSuccess getCursorPosition_impl ( Display *  display,
GHOST_TInt32 x,
GHOST_TInt32 y,
Window *  child_return 
)
static

◆ ghost_key_from_keycode()

static GHOST_TKey ghost_key_from_keycode ( const XkbDescPtr  xkb_descr,
const KeyCode  keycode 
)
static

◆ ghost_key_from_keysym()

static GHOST_TKey ghost_key_from_keysym ( const KeySym  key)
static

◆ ghost_key_from_keysym_or_keycode()

static GHOST_TKey ghost_key_from_keysym_or_keycode ( const KeySym  key,
const XkbDescPtr  xkb_descr,
const KeyCode  keycode 
)
static

◆ GHOST_X11_ApplicationErrorHandler()

int GHOST_X11_ApplicationErrorHandler ( Display *  display,
XErrorEvent *  event 
)

These callbacks can be used for debugging, so we can breakpoint on an X11 error.

Dummy function to get around IO Handler exiting if device invalid Basically it will not crash blender now if you have a X device that is configured but not plugged in.

Definition at line 2520 of file GHOST_SystemX11.cpp.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::isDebugEnabled().

Referenced by GHOST_SystemX11::GHOST_SystemX11().

◆ GHOST_X11_ApplicationIOErrorHandler()

int GHOST_X11_ApplicationIOErrorHandler ( Display *  display)

◆ init_timestamp_scanner()

static Bool init_timestamp_scanner ( Display *  ,
XEvent *  event,
XPointer  arg 
)
static

Definition at line 599 of file GHOST_SystemX11.cpp.

References data.

◆ SleepTillEvent()

static void SleepTillEvent ( Display *  display,
GHOST_TInt64  maxSleep 
)
static

Definition at line 571 of file GHOST_SystemX11.cpp.

References NULL, and select().

Referenced by GHOST_SystemX11::processEvents().

◆ split()

static void split ( const char *  text,
const char *  seps,
char ***  str,
int *  count 
)
static

Definition at line 2365 of file GHOST_SystemX11.cpp.

References count, data, free(), NULL, and str.

Referenced by GHOST_SystemX11::showMessageBox().

Variable Documentation

◆ txt_cut_buffer

char* txt_cut_buffer = NULL
static

◆ txt_select_buffer

char* txt_select_buffer = NULL
static