Blender  V3.3
Public Member Functions | Public Attributes | List of all members
GHOST_SystemX11 Class Reference

#include <GHOST_SystemX11.h>

Inheritance diagram for GHOST_SystemX11:
GHOST_System GHOST_ISystem

Public Member Functions

 GHOST_SystemX11 ()
 
 ~GHOST_SystemX11 ()
 
GHOST_TSuccess init ()
 
uint64_t getMilliSeconds () const
 
uint8_t getNumDisplays () const
 
void getMainDisplayDimensions (uint32_t &width, uint32_t &height) const
 
void getAllDisplayDimensions (uint32_t &width, uint32_t &height) const
 
GHOST_IWindowcreateWindow (const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_GLSettings glSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=0)
 
GHOST_IContextcreateOffscreenContext (GHOST_GLSettings glSettings)
 
GHOST_TSuccess disposeContext (GHOST_IContext *context)
 
bool processEvents (bool waitForEvent)
 
GHOST_TSuccess getCursorPosition (int32_t &x, int32_t &y) const
 
GHOST_TSuccess setCursorPosition (int32_t x, int32_t y)
 
GHOST_TSuccess getModifierKeys (GHOST_ModifierKeys &keys) const
 
GHOST_TSuccess getButtons (GHOST_Buttons &buttons) const
 
void addDirtyWindow (GHOST_WindowX11 *bad_wind)
 
Display * getXDisplay ()
 
void getClipboard_xcout (const XEvent *evt, Atom sel, Atom target, unsigned char **txt, unsigned long *len, unsigned int *context) const
 
char * getClipboard (bool selection) const
 
void putClipboard (const char *buffer, bool selection) const
 
int setConsoleWindowState (GHOST_TConsoleWindowState)
 
Message Box
GHOST_TSuccess showMessageBox (const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options) const
 
- Public Member Functions inherited from GHOST_System
GHOST_ITimerTaskinstallTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=NULL)
 
GHOST_TSuccess removeTimer (GHOST_ITimerTask *timerTask)
 
GHOST_TSuccess disposeWindow (GHOST_IWindow *window)
 
bool validWindow (GHOST_IWindow *window)
 
GHOST_TSuccess beginFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window, const bool stereoVisual, const bool alphaBackground)
 
GHOST_TSuccess updateFullScreen (const GHOST_DisplaySetting &setting, GHOST_IWindow **window)
 
GHOST_TSuccess endFullScreen (void)
 
bool getFullScreen (void)
 
bool useNativePixel (void)
 
bool supportsCursorWarp (void)
 
bool supportsWindowPosition (void)
 
void useWindowFocus (const bool use_focus)
 
GHOST_IWindowgetWindowUnderCursor (int32_t x, int32_t y)
 
void dispatchEvents ()
 
GHOST_TSuccess addEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess removeEventConsumer (GHOST_IEventConsumer *consumer)
 
GHOST_TSuccess getCursorPositionClientRelative (const GHOST_IWindow *window, int32_t &x, int32_t &y) const
 
GHOST_TSuccess setCursorPositionClientRelative (GHOST_IWindow *window, int32_t x, int32_t y)
 
GHOST_TSuccess getModifierKeyState (GHOST_TModifierKey mask, bool &isDown) const
 
GHOST_TSuccess getButtonState (GHOST_TButton mask, bool &isDown) const
 
void setMultitouchGestures (const bool use)
 
virtual void setTabletAPI (GHOST_TTabletAPI api)
 
GHOST_TTabletAPI getTabletAPI (void)
 
GHOST_TSuccess pushEvent (GHOST_IEvent *event)
 
GHOST_TimerManagergetTimerManager () const
 
GHOST_EventManagergetEventManager () const
 
GHOST_WindowManagergetWindowManager () const
 
virtual void initDebug (GHOST_Debug debug)
 
virtual bool isDebugEnabled ()
 

Public Attributes

struct {
   Atom   WM_STATE
 
   Atom   WM_CHANGE_STATE
 
   Atom   _NET_WM_STATE
 
   Atom   _NET_WM_STATE_MAXIMIZED_HORZ
 
   Atom   _NET_WM_STATE_MAXIMIZED_VERT
 
   Atom   _NET_WM_STATE_FULLSCREEN
 
   Atom   _MOTIF_WM_HINTS
 
   Atom   WM_TAKE_FOCUS
 
   Atom   WM_PROTOCOLS
 
   Atom   WM_DELETE_WINDOW
 
   Atom   TARGETS
 
   Atom   STRING
 
   Atom   COMPOUND_TEXT
 
   Atom   TEXT
 
   Atom   CLIPBOARD
 
   Atom   PRIMARY
 
   Atom   XCLIP_OUT
 
   Atom   INCR
 
   Atom   UTF8_STRING
 
m_atom
 
- Public Attributes inherited from GHOST_System
bool m_nativePixel
 
bool m_windowFocus
 

Additional Inherited Members

- Static Public Member Functions inherited from GHOST_ISystem
static GHOST_TSuccess createSystem ()
 
static GHOST_TSuccess disposeSystem ()
 
static GHOST_ISystemgetSystem ()
 
static GHOST_TBacktraceFn getBacktraceFn ()
 
static void setBacktraceFn (GHOST_TBacktraceFn backtrace_fn)
 
- Protected Member Functions inherited from GHOST_System
 GHOST_System ()
 
virtual ~GHOST_System ()
 
virtual GHOST_TSuccess exit ()
 
GHOST_TSuccess createFullScreenWindow (GHOST_Window **window, const GHOST_DisplaySetting &settings, const bool stereoVisual, const bool alphaBackground=0)
 
- Protected Member Functions inherited from GHOST_ISystem
 GHOST_ISystem ()
 
virtual ~GHOST_ISystem ()
 
- Protected Attributes inherited from GHOST_System
GHOST_DisplayManagerm_displayManager
 
GHOST_TimerManagerm_timerManager
 
GHOST_WindowManagerm_windowManager
 
GHOST_EventManagerm_eventManager
 
GHOST_DisplaySetting m_preFullScreenSetting
 
bool m_multitouchGestures
 
GHOST_TTabletAPI m_tabletAPI
 
bool m_is_debug_enabled
 
- Static Protected Attributes inherited from GHOST_ISystem
static GHOST_ISystemm_system = nullptr
 
static GHOST_TBacktraceFn m_backtrace_fn = nullptr
 

Detailed Description

X11 Implementation of GHOST_System class.

See also
GHOST_System.

Definition at line 60 of file GHOST_SystemX11.h.

Constructor & Destructor Documentation

◆ GHOST_SystemX11()

GHOST_SystemX11::GHOST_SystemX11 ( )

◆ ~GHOST_SystemX11()

GHOST_SystemX11::~GHOST_SystemX11 ( )

Destructor.

Definition at line 225 of file GHOST_SystemX11.cpp.

Member Function Documentation

◆ addDirtyWindow()

void GHOST_SystemX11::addDirtyWindow ( GHOST_WindowX11 bad_wind)

Flag a window as dirty. This will generate a GHOST window update event on a call to processEvents()

Definition at line 1750 of file GHOST_SystemX11.cpp.

References GHOST_ASSERT.

Referenced by GHOST_WindowX11::invalidate().

◆ createOffscreenContext()

GHOST_IContext * GHOST_SystemX11::createOffscreenContext ( GHOST_GLSettings  glSettings)
virtual

Create a new off-screen context. Never explicitly delete the context, use disposeContext() instead.

Returns
The new context (or 0 if creation failed).

Implements GHOST_System.

Definition at line 383 of file GHOST_SystemX11.cpp.

References blender::compositor::context, GHOST_GLSettings::flags, GHOST_glDebugContext, GHOST_OPENGL_EGL_CONTEXT_FLAGS, GHOST_OPENGL_EGL_RESET_NOTIFICATION_STRATEGY, GHOST_OPENGL_GLX_CONTEXT_FLAGS, and GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY.

◆ createWindow()

GHOST_IWindow * GHOST_SystemX11::createWindow ( const char *  title,
int32_t  left,
int32_t  top,
uint32_t  width,
uint32_t  height,
GHOST_TWindowState  state,
GHOST_TDrawingContextType  type,
GHOST_GLSettings  glSettings,
const bool  exclusive = false,
const bool  is_dialog = false,
const GHOST_IWindow parentWindow = 0 
)
virtual

Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.

Parameters
titleThe name of the window. (displayed in the title bar of the window if the OS supports it).
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state of the window when opened.
typeThe type of drawing context installed in this window.
stereoVisualCreate a stereo visual for quad buffered stereo.
exclusiveUse to show the window ontop and ignore others (used full*screen).
parentWindowParent (embedder) window.
Returns
The new window (or 0 if creation failed).

Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.

Parameters
titleThe name of the window (displayed in the title bar of the window if the OS supports it).
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state of the window when opened.
typeThe type of drawing context installed in this window.
glSettingsMisc OpenGL settings.
exclusiveUse to show the window on top and ignore others (used full-screen).
parentWindowParent window.
Returns
The new window (or 0 if creation failed).

Implements GHOST_ISystem.

Definition at line 326 of file GHOST_SystemX11.cpp.

References GHOST_WindowManager::addWindow(), GHOST_GLSettings::flags, getMilliSeconds(), GHOST_WindowX11::getValid(), GHOST_glAlphaBackground, GHOST_glDebugContext, GHOST_glStereoVisual, GHOST_kEventWindowSize, height, left, GHOST_System::m_windowManager, GHOST_System::pushEvent(), GHOST_WindowManager::setActiveWindow(), state, top, type, and width.

◆ disposeContext()

GHOST_TSuccess GHOST_SystemX11::disposeContext ( GHOST_IContext context)
virtual

Dispose of a context.

Parameters
contextPointer to the context to be disposed.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 498 of file GHOST_SystemX11.cpp.

References blender::compositor::context, and GHOST_kSuccess.

◆ getAllDisplayDimensions()

void GHOST_SystemX11::getAllDisplayDimensions ( uint32_t width,
uint32_t height 
) const
virtual

Returns the dimensions of all displays on this system.

Returns
The dimension of the main display.

Returns the dimensions of the main display on this system.

Returns
The dimension of the main display.

Implements GHOST_ISystem.

Definition at line 301 of file GHOST_SystemX11.cpp.

References height, and width.

Referenced by getMainDisplayDimensions().

◆ getButtons()

GHOST_TSuccess GHOST_SystemX11::getButtons ( GHOST_Buttons buttons) const
virtual

Returns the state of the mouse buttons (outside the message queue).

Parameters
buttonsThe state of the buttons.
Returns
Indication of success.

Implements GHOST_System.

Definition at line 1631 of file GHOST_SystemX11.cpp.

References GHOST_kButtonMaskButton4, GHOST_kButtonMaskButton5, GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, GHOST_kFailure, GHOST_kSuccess, and GHOST_Buttons::set().

◆ getClipboard()

char * GHOST_SystemX11::getClipboard ( bool  selection) const
virtual

Returns unsigned char from CUT_BUFFER0

Parameters
selectionGet selection, X11 only feature.
Returns
Returns the Clipboard indicated by Flag.

Implements GHOST_System.

Definition at line 2160 of file GHOST_SystemX11.cpp.

References blender::compositor::context, free(), getClipboard_xcout(), GHOST_WindowManager::getWindows(), GHOST_WindowX11::getXWindow(), m_atom, GHOST_System::m_windowManager, None, txt_cut_buffer, txt_select_buffer, XCLIB_XCOUT_FALLBACK, XCLIB_XCOUT_FALLBACK_COMP, XCLIB_XCOUT_FALLBACK_TEXT, XCLIB_XCOUT_FALLBACK_UTF8, and XCLIB_XCOUT_NONE.

◆ getClipboard_xcout()

void GHOST_SystemX11::getClipboard_xcout ( const XEvent *  evt,
Atom  sel,
Atom  target,
unsigned char **  txt,
unsigned long *  len,
unsigned int *  context 
) const

◆ getCursorPosition()

GHOST_TSuccess GHOST_SystemX11::getCursorPosition ( int32_t x,
int32_t y 
) const
virtual

Returns the current location of the cursor (location in screen coordinates)

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 1686 of file GHOST_SystemX11.cpp.

References getCursorPosition_impl(), x, and y.

Referenced by setCursorPosition(), and GHOST_WindowX11::setWindowCursorGrab().

◆ getMainDisplayDimensions()

void GHOST_SystemX11::getMainDisplayDimensions ( uint32_t width,
uint32_t height 
) const
virtual

Returns the dimensions of the main display on this system.

Returns
The dimension of the main display.

Implements GHOST_ISystem.

Definition at line 287 of file GHOST_SystemX11.cpp.

References getAllDisplayDimensions(), height, and width.

◆ getMilliSeconds()

uint64_t GHOST_SystemX11::getMilliSeconds ( ) const
virtual

Inherited from GHOST_ISystem

Returns the system time. Returns the number of milliseconds since the start of the system process.

Returns
The number of milliseconds.

Reimplemented from GHOST_System.

Definition at line 267 of file GHOST_SystemX11.cpp.

References GHOST_ASSERT.

Referenced by createWindow(), and processEvents().

◆ getModifierKeys()

GHOST_TSuccess GHOST_SystemX11::getModifierKeys ( GHOST_ModifierKeys keys) const
virtual

Returns the state of all modifier keys.

Parameters
keysThe state of all modifier keys (true == pressed).
Returns
Indication of success.

Implements GHOST_System.

Definition at line 1590 of file GHOST_SystemX11.cpp.

References GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyOS, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightShift, GHOST_kSuccess, and GHOST_ModifierKeys::set().

◆ getNumDisplays()

uint8_t GHOST_SystemX11::getNumDisplays ( ) const
virtual

Returns the number of displays on this system.

Returns
The number of displays.

Implements GHOST_ISystem.

Definition at line 278 of file GHOST_SystemX11.cpp.

Referenced by GHOST_DisplayManagerX11::getNumDisplays().

◆ getXDisplay()

Display* GHOST_SystemX11::getXDisplay ( )
inline

◆ init()

GHOST_TSuccess GHOST_SystemX11::init ( )
virtual

Initialize the system.

Returns
Indication of success.

Reimplemented from GHOST_System.

Definition at line 249 of file GHOST_SystemX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, GHOST_System::init(), and GHOST_System::m_displayManager.

◆ processEvents()

bool GHOST_SystemX11::processEvents ( bool  waitForEvent)
virtual

Retrieves events from the system and stores them in the queue.

Parameters
waitForEventFlag to wait for an event (or return immediately).
Returns
Indication of the presence of events.

Implements GHOST_ISystem.

Definition at line 630 of file GHOST_SystemX11.cpp.

References ARRAY_SIZE, ELEM, GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_System::getTimerManager(), GHOST_kEventKeyDown, ghost_key_from_keysym(), GHOST_kFireTimeNever, GHOST_PRINT, next, GHOST_TimerManager::nextFireTime(), GHOST_System::pushEvent(), and SleepTillEvent().

◆ putClipboard()

void GHOST_SystemX11::putClipboard ( const char *  buffer,
bool  selection 
) const
virtual

Puts buffer to system clipboard

Parameters
bufferThe buffer to copy to the clipboard.
selectionSet the selection into the clipboard, X11 only feature.

Implements GHOST_System.

Definition at line 2270 of file GHOST_SystemX11.cpp.

References buffer, free(), GHOST_WindowManager::getWindows(), GHOST_WindowX11::getXWindow(), m_atom, GHOST_System::m_windowManager, txt_cut_buffer, and txt_select_buffer.

◆ setConsoleWindowState()

int GHOST_SystemX11::setConsoleWindowState ( GHOST_TConsoleWindowState  )
inlinevirtual
See also
GHOST_ISystem

Implements GHOST_ISystem.

Definition at line 256 of file GHOST_SystemX11.h.

◆ setCursorPosition()

GHOST_TSuccess GHOST_SystemX11::setCursorPosition ( int32_t  x,
int32_t  y 
)
virtual

Updates the location of the cursor (location in screen coordinates). Not all operating systems allow the cursor to be moved (without the input device being moved).

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Implements GHOST_ISystem.

Definition at line 1692 of file GHOST_SystemX11.cpp.

References getCursorPosition(), getCursorPosition_impl(), GHOST_kFailure, GHOST_kSuccess, None, x, and y.

Referenced by GHOST_WindowX11::beginFullScreen(), and GHOST_WindowX11::setWindowCursorGrab().

◆ showMessageBox()

GHOST_TSuccess GHOST_SystemX11::showMessageBox ( const char *  title,
const char *  message,
const char *  help_label,
const char *  continue_label,
const char *  link,
GHOST_DialogOptions  dialog_options 
) const
virtual

Show a system message box

Parameters
titleThe title of the message box.
messageThe message to display.
help_labelHelp button label.
continue_labelContinue button label.
linkAn optional hyperlink.
dialog_optionsOptions how to display the message.

Reimplemented from GHOST_System.

Definition at line 2411 of file GHOST_SystemX11.cpp.

References DialogData::drawButton(), e, free(), GHOST_kSuccess, GHOST_PRINTF, DialogData::height, DialogData::isInsideButton(), DialogData::line_height, DialogData::padding_x, split(), and DialogData::width.

Member Data Documentation

◆ _MOTIF_WM_HINTS

Atom GHOST_SystemX11::_MOTIF_WM_HINTS

Definition at line 295 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::setDialogHints().

◆ _NET_WM_STATE

Atom GHOST_SystemX11::_NET_WM_STATE

Definition at line 291 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ _NET_WM_STATE_FULLSCREEN

Atom GHOST_SystemX11::_NET_WM_STATE_FULLSCREEN

Definition at line 294 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ _NET_WM_STATE_MAXIMIZED_HORZ

Atom GHOST_SystemX11::_NET_WM_STATE_MAXIMIZED_HORZ

Definition at line 292 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ _NET_WM_STATE_MAXIMIZED_VERT

Atom GHOST_SystemX11::_NET_WM_STATE_MAXIMIZED_VERT

Definition at line 293 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ CLIPBOARD

Atom GHOST_SystemX11::CLIPBOARD

Definition at line 305 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ COMPOUND_TEXT

Atom GHOST_SystemX11::COMPOUND_TEXT

Definition at line 303 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ INCR

Atom GHOST_SystemX11::INCR

Definition at line 308 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ 

struct { ... } GHOST_SystemX11::m_atom

◆ PRIMARY

Atom GHOST_SystemX11::PRIMARY

Definition at line 306 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ STRING

Atom GHOST_SystemX11::STRING

Definition at line 302 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ TARGETS

Atom GHOST_SystemX11::TARGETS

Definition at line 301 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ TEXT

Atom GHOST_SystemX11::TEXT

Definition at line 304 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ UTF8_STRING

Atom GHOST_SystemX11::UTF8_STRING

Definition at line 309 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ WM_CHANGE_STATE

Atom GHOST_SystemX11::WM_CHANGE_STATE

Definition at line 290 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ WM_DELETE_WINDOW

Atom GHOST_SystemX11::WM_DELETE_WINDOW

Definition at line 298 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ WM_PROTOCOLS

Atom GHOST_SystemX11::WM_PROTOCOLS

Definition at line 297 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ WM_STATE

Atom GHOST_SystemX11::WM_STATE

Atom used for ICCCM, WM-spec and Motif. We only need get this atom at the start, it's relative to the display not the window and are public for every window that need it.

Definition at line 289 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().

◆ WM_TAKE_FOCUS

Atom GHOST_SystemX11::WM_TAKE_FOCUS

Definition at line 296 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11(), and GHOST_WindowX11::GHOST_WindowX11().

◆ XCLIP_OUT

Atom GHOST_SystemX11::XCLIP_OUT

Definition at line 307 of file GHOST_SystemX11.h.

Referenced by GHOST_SystemX11().


The documentation for this class was generated from the following files: