Blender V5.0
GHOST_WindowX11 Class Reference

#include <GHOST_WindowX11.hh>

Inherits GHOST_Window.

Public Member Functions

 GHOST_WindowX11 (GHOST_SystemX11 *system, Display *display, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_WindowX11 *parent_window, GHOST_TDrawingContextType type, const bool is_dialog, const GHOST_ContextParams &context_params, const bool exclusive, const GHOST_GPUDevice &preferred_device)
bool getValid () const override
void setTitle (const char *title) override
std::string getTitle () const override
void getWindowBounds (GHOST_Rect &bounds) const override
void getClientBounds (GHOST_Rect &bounds) const override
bool isDialog () const override
GHOST_TSuccess setClientWidth (uint32_t width) override
GHOST_TSuccess setClientHeight (uint32_t height) override
GHOST_TSuccess setClientSize (uint32_t width, uint32_t height) override
void screenToClient (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
void clientToScreen (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
GHOST_TWindowState getState () const override
GHOST_TSuccess setState (GHOST_TWindowState state) override
GHOST_TSuccess setOrder (GHOST_TWindowOrder order) override
GHOST_TSuccess invalidate () override
GHOST_TSuccess setProgressBar (float progress) override
GHOST_TSuccess endProgressBar () override
 ~GHOST_WindowX11 () override
void validate ()
Window getXWindow ()
GHOST_TabletDataGetTabletData ()
GHOST_TSuccess setDialogHints (GHOST_WindowX11 *parent_window)
uint16_t getDPIHint () override
Public Member Functions inherited from GHOST_Window
 GHOST_Window (uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_ContextParams &context_params, const bool exclusive=false)
 ~GHOST_Window () override
void * getOSWindow () const override
GHOST_TSuccess setPath (const char *) override
virtual GHOST_TWindowDecorationStyleFlags getWindowDecorationStyleFlags () override
virtual void setWindowDecorationStyleFlags (GHOST_TWindowDecorationStyleFlags style_flags) override
virtual void setWindowDecorationStyleSettings (GHOST_WindowDecorationStyleSettings decoration_settings) override
virtual GHOST_TSuccess applyWindowDecorationStyle () override
GHOST_TStandardCursor getCursorShape () const override
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursor_shape) override
GHOST_TSuccess setCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override
GHOST_TSuccess setCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator) override
GHOST_TSuccess getCursorBitmap (GHOST_CursorBitmapRef *bitmap) override
bool getCursorVisibility () const override
GHOST_TGrabCursorMode getCursorGrabMode () const
bool getCursorGrabModeIsWarp () const
GHOST_TAxisFlag getCursorGrabAxis () const
void getCursorGrabInitPos (int32_t &x, int32_t &y) const
void getCursorGrabAccum (int32_t &x, int32_t &y) const
void setCursorGrabAccum (int32_t x, int32_t y)
GHOST_TSuccess setCursorVisibility (bool visible) override
GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, GHOST_Rect *bounds, int32_t mouse_ungrab_xy[2]) override
GHOST_TSuccess getCursorGrabBounds (GHOST_Rect &bounds) const override
void getCursorGrabState (GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &wrap_axis, GHOST_Rect &bounds, bool &use_software_cursor) override
bool getCursorGrabUseSoftwareDisplay () override
GHOST_TSuccess setSwapInterval (int interval) override
GHOST_TSuccess getSwapInterval (int &interval_out) override
void setAcceptDragOperation (bool can_accept) override
bool canAcceptDragOperation () const override
GHOST_TSuccess setModifiedState (bool is_unsaved_changes) override
bool getModifiedState () override
GHOST_TDrawingContextType getDrawingContextType () override
GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type) override
GHOST_IContextgetDrawingContext () override
GHOST_TSuccess swapBufferAcquire () override
GHOST_TSuccess swapBufferRelease () override
GHOST_TSuccess activateDrawingContext () override
GHOST_TSuccess updateDrawingContext ()
GHOST_ContextgetContext ()
unsigned int getDefaultFramebuffer () override
GHOST_TUserDataPtr getUserData () const override
void setUserData (const GHOST_TUserDataPtr user_data) override
float getNativePixelSize () override
GHOST_WindowHDRInfo getHDRInfo () override
Public Member Functions inherited from GHOST_IWindow
virtual ~GHOST_IWindow ()=default

Public Attributes

bool post_init_
GHOST_TWindowState post_state_

Protected Member Functions

GHOST_ContextnewDrawingContext (GHOST_TDrawingContextType type) override
GHOST_TSuccess setWindowCursorVisibility (bool visible) override
GHOST_TSuccess setWindowCursorGrab (GHOST_TGrabCursorMode mode) override
GHOST_TGrabCursorMode getWindowCursorGrab () const
GHOST_TSuccess setWindowCursorShape (GHOST_TStandardCursor shape) override
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor shape) override
GHOST_TSuccess setWindowCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override
Protected Member Functions inherited from GHOST_Window
virtual GHOST_TSuccess setWindowCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator)
GHOST_TSuccess releaseNativeHandles ()

Additional Inherited Members

Protected Attributes inherited from GHOST_Window
GHOST_TDrawingContextType drawing_context_type_
GHOST_TUserDataPtr user_data_
bool cursor_visible_
GHOST_TGrabCursorMode cursor_grab_
GHOST_TAxisFlag cursor_grab_axis_
int32_t cursor_grab_init_pos_ [2]
int32_t cursor_grab_accum_pos_ [2]
GHOST_Rect cursor_grab_bounds_
GHOST_TStandardCursor cursor_shape_
bool progress_bar_visible_
bool can_accept_drag_operation_
bool is_unsaved_changes_
bool full_screen_
GHOST_TWindowDecorationStyleFlags window_decoration_style_flags_
GHOST_WindowDecorationStyleSettings window_decoration_style_settings_
GHOST_ContextParams want_context_params_
uint32_t full_screen_width_
uint32_t full_screen_height_
float native_pixel_size_
GHOST_WindowHDRInfo hdr_info_ = GHOST_WINDOW_HDR_INFO_NONE

Detailed Description

X11 implementation of GHOST_IWindow. Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

Definition at line 33 of file GHOST_WindowX11.hh.

Constructor & Destructor Documentation

◆ GHOST_WindowX11()

GHOST_WindowX11::GHOST_WindowX11 ( GHOST_SystemX11 * system,
Display * display,
const char * title,
int32_t left,
int32_t top,
uint32_t width,
uint32_t height,
GHOST_TWindowState state,
GHOST_WindowX11 * parent_window,
GHOST_TDrawingContextType type,
const bool is_dialog,
const GHOST_ContextParams & context_params,
const bool exclusive,
const GHOST_GPUDevice & preferred_device )

Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.

Parameters
titleThe text shown in the title bar of the window.
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 the window is initially opened with.
parent_windowParent (embedder) window.
typeThe type of drawing context installed in this window.
context_paramsParameters to use when initializing the context.
preferred_devicePreferred device to use when new device will be created.

Definition at line 102 of file GHOST_WindowX11.cc.

References ARRAY_SIZE, BLENDER_ICONS_WM_X11, count, Display, ELEM, false, free(), GHOST_ISystem::getUseWindowFrame(), GHOST_DialogError, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_PRINT, GHOST_TABLET_DATA_NONE, GHOST_Window::GHOST_Window(), GHOST_WindowX11(), HOST_NAME_MAX, if(), left, len, nullptr, post_init_, post_state_, setDialogHints(), GHOST_Window::setDrawingContextType(), setTitle(), GHOST_SystemX11::showMessageBox(), state, top, and GHOST_System::window_focus_.

Referenced by getWindowCursorGrab(), GHOST_WindowX11(), and setDialogHints().

◆ ~GHOST_WindowX11()

GHOST_WindowX11::~GHOST_WindowX11 ( )
override

Destructor. Closes the window and disposes resources allocated.

Definition at line 1153 of file GHOST_WindowX11.cc.

References None, GHOST_Window::releaseNativeHandles(), and Window.

Member Function Documentation

◆ clientToScreen()

void GHOST_WindowX11::clientToScreen ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overridevirtual

Converts a point in client rectangle coordinates to screen coordinates.

Parameters
inXThe x-coordinate in the client rectangle.
inYThe y-coordinate in the client rectangle.
outXThe x-coordinate on the screen.
outYThe y-coordinate on the screen.

Implements GHOST_IWindow.

Definition at line 580 of file GHOST_WindowX11.cc.

References Window.

Referenced by getClientBounds().

◆ endProgressBar()

GHOST_TSuccess GHOST_WindowX11::endProgressBar ( )
overridevirtual

Hides the progress bar in the icon.

Reimplemented from GHOST_Window.

Definition at line 1565 of file GHOST_WindowX11.cc.

References GHOST_kFailure.

◆ getClientBounds()

void GHOST_WindowX11::getClientBounds ( GHOST_Rect & bounds) const
overridevirtual

Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.

Parameters
boundsThe bounding rectangle of the client area of the window.

Implements GHOST_IWindow.

Definition at line 513 of file GHOST_WindowX11.cc.

References bounds(), clientToScreen(), and Window.

Referenced by getWindowBounds().

◆ getDPIHint()

uint16_t GHOST_WindowX11::getDPIHint ( )
overridevirtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Reimplemented from GHOST_Window.

Definition at line 1515 of file GHOST_WindowX11.cc.

References sqrt, and STREQ.

◆ getState()

GHOST_TWindowState GHOST_WindowX11::getState ( ) const
overridevirtual

Returns the state of the window (normal, minimized, maximized).

Returns
The state of the window.

Implements GHOST_IWindow.

Definition at line 900 of file GHOST_WindowX11.cc.

References ELEM, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and state.

Referenced by setState().

◆ GetTabletData()

GHOST_TabletData & GHOST_WindowX11::GetTabletData ( )
inline

Definition at line 121 of file GHOST_WindowX11.hh.

◆ getTitle()

std::string GHOST_WindowX11::getTitle ( ) const
overridevirtual

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 496 of file GHOST_WindowX11.cc.

References name.

◆ getValid()

bool GHOST_WindowX11::getValid ( ) const
overridevirtual

Returns indication as to whether the window is valid.

Returns
The validity of the window.

Reimplemented from GHOST_Window.

Definition at line 477 of file GHOST_WindowX11.cc.

References GHOST_Window::getValid().

Referenced by GHOST_SystemX11::createWindow().

◆ getWindowBounds()

void GHOST_WindowX11::getWindowBounds ( GHOST_Rect & bounds) const
overridevirtual

Returns the window rectangle dimensions. These are screen coordinates.

Parameters
boundsThe bounding rectangle of the window.

Implements GHOST_IWindow.

Definition at line 506 of file GHOST_WindowX11.cc.

References bounds(), and getClientBounds().

◆ getWindowCursorGrab()

GHOST_TGrabCursorMode GHOST_WindowX11::getWindowCursorGrab ( ) const
protected

◆ getXWindow()

Window GHOST_WindowX11::getXWindow ( )

◆ hasCursorShape()

GHOST_TSuccess GHOST_WindowX11::hasCursorShape ( GHOST_TStandardCursor cursor_shape)
overrideprotectedvirtual

Test if the standard cursor shape is supported by current platform.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1469 of file GHOST_WindowX11.cc.

References Cursor.

◆ invalidate()

GHOST_TSuccess GHOST_WindowX11::invalidate ( )
overridevirtual

Invalidates the contents of this window.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1120 of file GHOST_WindowX11.cc.

References GHOST_kSuccess.

◆ isDialog()

bool GHOST_WindowX11::isDialog ( ) const
overridevirtual

Reimplemented from GHOST_Window.

Definition at line 1082 of file GHOST_WindowX11.cc.

References ret, and Success.

◆ newDrawingContext()

GHOST_Context * GHOST_WindowX11::newDrawingContext ( GHOST_TDrawingContextType type)
overrideprotectedvirtual

◆ screenToClient()

void GHOST_WindowX11::screenToClient ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overridevirtual

Converts a point in screen coordinates to client rectangle coordinates

Parameters
inXThe x-coordinate on the screen.
inYThe y-coordinate on the screen.
outXThe x-coordinate in the client rectangle.
outYThe y-coordinate in the client rectangle.

Implements GHOST_IWindow.

Definition at line 567 of file GHOST_WindowX11.cc.

References Window.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowX11::setClientHeight ( uint32_t height)
overridevirtual

Resizes client rectangle height.

Parameters
heightThe new height of the client area of the window.

Implements GHOST_IWindow.

Definition at line 548 of file GHOST_WindowX11.cc.

References GHOST_kSuccess.

◆ setClientSize()

GHOST_TSuccess GHOST_WindowX11::setClientSize ( uint32_t width,
uint32_t height )
overridevirtual

Resizes client rectangle.

Parameters
widthThe new width of the client area of the window.
heightThe new height of the client area of the window.

Implements GHOST_IWindow.

Definition at line 557 of file GHOST_WindowX11.cc.

References GHOST_kSuccess.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowX11::setClientWidth ( uint32_t width)
overridevirtual

Resizes client rectangle width.

Parameters
widthThe new width of the client area of the window.

Implements GHOST_IWindow.

Definition at line 538 of file GHOST_WindowX11.cc.

References GHOST_kSuccess.

◆ setDialogHints()

◆ setOrder()

GHOST_TSuccess GHOST_WindowX11::setOrder ( GHOST_TWindowOrder order)
overridevirtual

Sets the order of the window (bottom, top).

Parameters
orderThe order of the window.
Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1025 of file GHOST_WindowX11.cc.

References GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowOrderBottom, GHOST_kWindowOrderTop, None, and Window.

◆ setProgressBar()

GHOST_TSuccess GHOST_WindowX11::setProgressBar ( float )
overridevirtual

Sets the progress bar value displayed in the window/application icon

Parameters
progressThe progress percentage (0.0 to 1.0).

Reimplemented from GHOST_Window.

Definition at line 1560 of file GHOST_WindowX11.cc.

References GHOST_kFailure.

◆ setState()

GHOST_TSuccess GHOST_WindowX11::setState ( GHOST_TWindowState state)
overridevirtual

Sets the state of the window (normal, minimized, maximized).

Parameters
stateThe state of the window.
Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 926 of file GHOST_WindowX11.cc.

References getState(), GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and state.

◆ setTitle()

void GHOST_WindowX11::setTitle ( const char * title)
overridevirtual

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implements GHOST_IWindow.

Definition at line 482 of file GHOST_WindowX11.cc.

References name.

Referenced by GHOST_WindowX11().

◆ setWindowCursorGrab()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorGrab ( GHOST_TGrabCursorMode mode)
overrideprotectedvirtual

◆ setWindowCursorShape()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorShape ( GHOST_TStandardCursor shape)
overrideprotectedvirtual

Sets the cursor shape on the window using native window system calls.

Implements GHOST_Window.

Definition at line 1454 of file GHOST_WindowX11.cc.

References Cursor, GHOST_kFailure, GHOST_kStandardCursorDefault, and GHOST_kSuccess.

◆ setWindowCursorVisibility()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorVisibility ( bool visible)
overrideprotectedvirtual

Sets the cursor visibility on the window using native window system calls.

Implements GHOST_Window.

Definition at line 1366 of file GHOST_WindowX11.cc.

References Cursor, GHOST_Window::getCursorShape(), GHOST_kFailure, and GHOST_kSuccess.

Referenced by setWindowCursorGrab().

◆ setWindowCustomCursorShape()

GHOST_TSuccess GHOST_WindowX11::setWindowCustomCursorShape ( const uint8_t * bitmap,
const uint8_t * mask,
const int size[2],
const int hot_spot[2],
bool can_invert_color )
overrideprotectedvirtual

Sets the cursor shape on the window using native window system calls (Arbitrary size/color).

Implements GHOST_Window.

Definition at line 1475 of file GHOST_WindowX11.cc.

References GHOST_kFailure, GHOST_kSuccess, L, mask(), and size().

◆ validate()

void GHOST_WindowX11::validate ( )

X11 system specific calls

The reverse of invalidate! Tells this window that all events for it have been pushed into the GHOST event queue.

called by the X11 system implementation when expose events for the window have been pushed onto the GHOST queue

Definition at line 1148 of file GHOST_WindowX11.cc.

Member Data Documentation

◆ post_init_

bool GHOST_WindowX11::post_init_

Definition at line 151 of file GHOST_WindowX11.hh.

Referenced by GHOST_WindowX11().

◆ post_state_

GHOST_TWindowState GHOST_WindowX11::post_state_

Definition at line 152 of file GHOST_WindowX11.hh.

Referenced by GHOST_WindowX11().


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