|
Blender V4.5
|
#include <GHOST_SystemX11.hh>
Inherits GHOST_System.
Classes | |
| struct | [struct].m_atom |
Public Member Functions | |
| GHOST_SystemX11 () | |
| ~GHOST_SystemX11 () override | |
| GHOST_TSuccess | init () override |
| uint64_t | getMilliSeconds () const override |
| uint8_t | getNumDisplays () const override |
| void | getMainDisplayDimensions (uint32_t &width, uint32_t &height) const override |
| void | getAllDisplayDimensions (uint32_t &width, uint32_t &height) const override |
| GHOST_IWindow * | createWindow (const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_GPUSettings gpuSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=nullptr) override |
| GHOST_IContext * | createOffscreenContext (GHOST_GPUSettings gpuSettings) override |
| GHOST_TSuccess | disposeContext (GHOST_IContext *context) override |
| bool | processEvents (bool waitForEvent) override |
| GHOST_TSuccess | getCursorPosition (int32_t &x, int32_t &y) const override |
| GHOST_TSuccess | setCursorPosition (int32_t x, int32_t y) override |
| GHOST_TSuccess | getPixelAtCursor (float r_color[3]) const override |
| GHOST_TSuccess | getModifierKeys (GHOST_ModifierKeys &keys) const override |
| GHOST_TSuccess | getButtons (GHOST_Buttons &buttons) const override |
| GHOST_TCapabilityFlag | getCapabilities () const override |
| void | addDirtyWindow (GHOST_WindowX11 *bad_wind) |
| Display * | getXDisplay () |
| uint64_t | ms_from_input_time (const Time timestamp) const |
| 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 override |
| void | putClipboard (const char *buffer, bool selection) const override |
| bool | setConsoleWindowState (GHOST_TConsoleWindowState) override |
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 override |
| Public Member Functions inherited from GHOST_System | |
| GHOST_ITimerTask * | installTimer (uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData=nullptr) override |
| GHOST_TSuccess | removeTimer (GHOST_ITimerTask *timerTask) override |
| GHOST_TSuccess | disposeWindow (GHOST_IWindow *window) override |
| bool | validWindow (GHOST_IWindow *window) override |
| bool | useNativePixel () override |
| void | useWindowFocus (const bool use_focus) override |
| void | setAutoFocus (const bool auto_focus) override |
| GHOST_IWindow * | getWindowUnderCursor (int32_t x, int32_t y) override |
| void | dispatchEvents () override |
| GHOST_TSuccess | addEventConsumer (GHOST_IEventConsumer *consumer) override |
| GHOST_TSuccess | removeEventConsumer (GHOST_IEventConsumer *consumer) override |
| GHOST_TSuccess | getCursorPositionClientRelative (const GHOST_IWindow *window, int32_t &x, int32_t &y) const override |
| GHOST_TSuccess | setCursorPositionClientRelative (GHOST_IWindow *window, int32_t x, int32_t y) override |
| uint32_t | getCursorPreferredLogicalSize () const override |
| GHOST_TSuccess | getModifierKeyState (GHOST_TModifierKey mask, bool &isDown) const override |
| GHOST_TSuccess | getButtonState (GHOST_TButton mask, bool &isDown) const override |
| void | setMultitouchGestures (const bool use) override |
| void | setTabletAPI (GHOST_TTabletAPI api) override |
| GHOST_TTabletAPI | getTabletAPI () |
| GHOST_TSuccess | pushEvent (const GHOST_IEvent *event) |
| GHOST_TimerManager * | getTimerManager () const |
| GHOST_EventManager * | getEventManager () const |
| GHOST_WindowManager * | getWindowManager () const |
| GHOST_TSuccess | hasClipboardImage () const override |
| uint * | getClipboardImage (int *r_width, int *r_height) const override |
| GHOST_TSuccess | putClipboardImage (uint *rgba, int width, int height) const override |
| void | initDebug (GHOST_Debug debug) override |
| bool | isDebugEnabled () override |
Public Attributes | |
| struct | m_atom |
| Public Attributes inherited from GHOST_System | |
| bool | m_nativePixel |
| bool | m_windowFocus |
| bool | m_autoFocus |
X11 Implementation of GHOST_System class.
Definition at line 60 of file GHOST_SystemX11.hh.
| GHOST_SystemX11::GHOST_SystemX11 | ( | ) |
Constructor this class should only be instantiated by GHOST_ISystem.
Definition at line 105 of file GHOST_SystemX11.cc.
References GHOST_INTERN_ATOM, GHOST_INTERN_ATOM_IF_EXISTS, GHOST_System::GHOST_System(), GHOST_X11_ApplicationErrorHandler(), GHOST_X11_ApplicationIOErrorHandler(), m_atom, and nullptr.
Referenced by GHOST_ISystem::createSystem().
|
override |
Destructor.
Definition at line 226 of file GHOST_SystemX11.cc.
| 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 1832 of file GHOST_SystemX11.cc.
References GHOST_ASSERT.
|
overridevirtual |
Create a new off-screen context. Never explicitly delete the context, use disposeContext() instead.
Implements GHOST_System.
Definition at line 404 of file GHOST_SystemX11.cc.
References GHOST_GPUSettings::context_type, GHOST_GPUSettings::flags, GHOST_ContextGLX::GHOST_ContextGLX(), GHOST_ContextVK::GHOST_ContextVK(), GHOST_gpuDebugContext, GHOST_OPENGL_GLX_CONTEXT_FLAGS, GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY, and GHOST_GPUSettings::preferred_device.
|
overridevirtual |
Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.
| title | The name of the window. (displayed in the title bar of the window if the OS supports it). |
| left | The coordinate of the left edge of the window. |
| top | The coordinate of the top edge of the window. |
| width | The width the window. |
| height | The height the window. |
| state | The state of the window when opened. |
| stereoVisual | Create a stereo visual for quad buffered stereo. |
| exclusive | Use to show the window on top and ignore others (used full-screen). |
| parentWindow | Parent (embedder) window. |
Implements GHOST_ISystem.
Definition at line 353 of file GHOST_SystemX11.cc.
References GHOST_WindowManager::addWindow(), GHOST_GPUSettings::context_type, GHOST_GPUSettings::flags, getMilliSeconds(), GHOST_WindowX11::getValid(), GHOST_Event::GHOST_Event(), GHOST_gpuDebugContext, GHOST_gpuStereoVisual, GHOST_kEventWindowSize, GHOST_WindowX11::GHOST_WindowX11(), GHOST_System::m_windowManager, GHOST_GPUSettings::preferred_device, GHOST_System::pushEvent(), GHOST_WindowManager::setActiveWindow(), and state.
|
overridevirtual |
Dispose of a context.
| context | Pointer to the context to be disposed. |
Implements GHOST_ISystem.
Definition at line 457 of file GHOST_SystemX11.cc.
References GHOST_kSuccess.
|
overridevirtual |
Returns the dimensions of all displays on this system.
Implements GHOST_ISystem.
Definition at line 345 of file GHOST_SystemX11.cc.
Referenced by getMainDisplayDimensions().
|
overridevirtual |
Returns the state of the mouse buttons (outside the message queue).
| buttons | The state of the buttons. |
Implements GHOST_System.
Definition at line 1699 of file GHOST_SystemX11.cc.
References GHOST_kButtonMaskButton4, GHOST_kButtonMaskButton5, GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, GHOST_kFailure, GHOST_kSuccess, and GHOST_Buttons::set().
|
overridevirtual |
Return features supported by the system back-end.
The resulting value doesn't change at run-time.
Implements GHOST_ISystem.
Definition at line 1820 of file GHOST_SystemX11.cc.
References GHOST_CAPABILITY_FLAG_ALL, GHOST_kCapabilityClipboardImages, GHOST_kCapabilityInputIME, and GHOST_kCapabilityWindowDecorationStyles.
|
overridevirtual |
Returns unsigned char from CUT_BUFFER0
| selection | Get selection, X11 only feature. |
Implements GHOST_System.
Definition at line 2243 of file GHOST_SystemX11.cc.
References free(), getClipboard_xcout(), GHOST_WindowManager::getWindows(), GHOST_WindowX11::getXWindow(), m_atom, GHOST_System::m_windowManager, 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.
| void GHOST_SystemX11::getClipboard_xcout | ( | const XEvent * | evt, |
| Atom | sel, | ||
| Atom | target, | ||
| unsigned char ** | txt, | ||
| unsigned long * | len, | ||
| unsigned int * | context ) const |
Helped function for get data from the clipboard.
Definition at line 2043 of file GHOST_SystemX11.cc.
References free(), GHOST_WindowManager::getWindows(), GHOST_WindowX11::getXWindow(), len(), m_atom, GHOST_System::m_windowManager, XCLIB_XCOUT_FALLBACK_COMP, XCLIB_XCOUT_FALLBACK_TEXT, XCLIB_XCOUT_FALLBACK_UTF8, XCLIB_XCOUT_INCR, XCLIB_XCOUT_NONE, and XCLIB_XCOUT_SENTCONVSEL.
Referenced by getClipboard().
|
overridevirtual |
Returns the current location of the cursor (location in screen coordinates)
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Definition at line 1756 of file GHOST_SystemX11.cc.
References getCursorPosition_impl(), x, and y.
Referenced by getPixelAtCursor(), and setCursorPosition().
|
overridevirtual |
Returns the dimensions of the main display on this system.
Implements GHOST_ISystem.
Definition at line 335 of file GHOST_SystemX11.cc.
References getAllDisplayDimensions().
|
overridevirtual |
Returns the system time. Returns the number of milliseconds since the start of the system process.
Implements GHOST_ISystem.
Definition at line 260 of file GHOST_SystemX11.cc.
References GHOST_ASSERT.
Referenced by createWindow(), ms_from_input_time(), and processEvents().
|
overridevirtual |
Returns the state of all modifier keys.
| keys | The state of all modifier keys (true == pressed). |
Implements GHOST_System.
Definition at line 1650 of file GHOST_SystemX11.cc.
References GHOST_kModifierKeyLeftAlt, GHOST_kModifierKeyLeftControl, GHOST_kModifierKeyLeftHyper, GHOST_kModifierKeyLeftOS, GHOST_kModifierKeyLeftShift, GHOST_kModifierKeyRightAlt, GHOST_kModifierKeyRightControl, GHOST_kModifierKeyRightHyper, GHOST_kModifierKeyRightOS, GHOST_kModifierKeyRightShift, GHOST_kSuccess, and GHOST_ModifierKeys::set().
|
overridevirtual |
Returns the number of displays on this system.
Implements GHOST_ISystem.
Definition at line 330 of file GHOST_SystemX11.cc.
|
overridevirtual |
Get the color of the pixel at the current mouse cursor location
| r_color | returned sRGB float colors |
Reimplemented from GHOST_System.
Definition at line 1611 of file GHOST_SystemX11.cc.
References getCursorPosition(), GHOST_kFailure, GHOST_kSuccess, x, and y.
|
inline |
return a pointer to the X11 display structure
Definition at line 191 of file GHOST_SystemX11.hh.
References Display.
|
overridevirtual |
Initialize the system.
Reimplemented from GHOST_System.
Definition at line 246 of file GHOST_SystemX11.cc.
References GHOST_kFailure, GHOST_kSuccess, GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(), and GHOST_System::init().
| uint64_t GHOST_SystemX11::ms_from_input_time | ( | const Time | timestamp | ) | const |
Use this function instead of GHOST_System::getMilliSeconds, passing in the time-stamp from X to input to get the event time-stamp with an offset applied to make it compatible with getMilliSeconds.
Definition at line 271 of file GHOST_SystemX11.cc.
References getMilliSeconds(), UINT32_MAX, and UNLIKELY.
Referenced by processEvents().
|
overridevirtual |
Retrieves events from the system and stores them in the queue.
| waitForEvent | Flag to wait for an event (or return immediately). |
Implements GHOST_ISystem.
Definition at line 590 of file GHOST_SystemX11.cc.
References ARRAY_SIZE, ELEM, GHOST_TimerManager::fireTimers(), getMilliSeconds(), GHOST_System::getTimerManager(), GHOST_EventKey::GHOST_EventKey(), GHOST_kEventKeyDown, ghost_key_from_keysym(), GHOST_kFireTimeNever, GHOST_PRINT, i, ms_from_input_time(), GHOST_TimerManager::nextFireTime(), processEvents(), GHOST_System::pushEvent(), and SleepTillEvent().
Referenced by processEvents().
|
overridevirtual |
Puts buffer to system clipboard
| buffer | The buffer to copy to the clipboard. |
| selection | Set the selection into the clipboard, X11 only feature. |
Implements GHOST_System.
Definition at line 2355 of file GHOST_SystemX11.cc.
References free(), GHOST_WindowManager::getWindows(), GHOST_WindowX11::getXWindow(), m_atom, GHOST_System::m_windowManager, txt_cut_buffer, and txt_select_buffer.
|
inlineoverridevirtual |
|
overridevirtual |
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).
| x | The x-coordinate of the cursor. |
| y | The y-coordinate of the cursor. |
Implements GHOST_ISystem.
Definition at line 1762 of file GHOST_SystemX11.cc.
References getCursorPosition(), getCursorPosition_impl(), GHOST_kFailure, GHOST_kSuccess, x, and y.
|
overridevirtual |
Show a system message box
| title | The title of the message box. |
| message | The message to display. |
| help_label | Help button label. |
| continue_label | Continue button label. |
| link | An optional hyperlink. |
| dialog_options | Options how to display the message. |
Reimplemented from GHOST_System.
Definition at line 2500 of file GHOST_SystemX11.cc.
References DialogData::drawButton(), e, free(), GHOST_kSuccess, GHOST_PRINTF, DialogData::height, i, DialogData::isInsideButton(), DialogData::line_height, DialogData::padding_x, split(), and DialogData::width.
Referenced by GHOST_WindowX11::GHOST_WindowX11().
| struct GHOST_SystemX11::[struct].m_atom GHOST_SystemX11::m_atom |
Referenced by getClipboard(), getClipboard_xcout(), GHOST_SystemX11(), and putClipboard().