Blender  V2.93
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
GHOST_WindowX11 Class Reference

#include <GHOST_WindowX11.h>

Inherits GHOST_Window.

Public Member Functions

 GHOST_WindowX11 (GHOST_SystemX11 *system, Display *display, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_WindowX11 *parentWindow, GHOST_TDrawingContextType type=GHOST_kDrawingContextTypeNone, const bool is_dialog=false, const bool stereoVisual=false, const bool exclusive=false, const bool alphaBackground=false, const bool is_debug=false)
 
bool getValid () const
 
void setTitle (const char *title)
 
std::string getTitle () const
 
void getWindowBounds (GHOST_Rect &bounds) const
 
void getClientBounds (GHOST_Rect &bounds) const
 
bool isDialog () const
 
GHOST_TSuccess setClientWidth (GHOST_TUns32 width)
 
GHOST_TSuccess setClientHeight (GHOST_TUns32 height)
 
GHOST_TSuccess setClientSize (GHOST_TUns32 width, GHOST_TUns32 height)
 
void screenToClient (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const
 
void clientToScreen (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const
 
GHOST_TWindowState getState () const
 
GHOST_TSuccess setState (GHOST_TWindowState state)
 
GHOST_TSuccess setOrder (GHOST_TWindowOrder order)
 
GHOST_TSuccess invalidate ()
 
GHOST_TSuccess setProgressBar (float progress)
 
GHOST_TSuccess endProgressBar ()
 
 ~GHOST_WindowX11 ()
 
void validate ()
 
Window getXWindow ()
 
GHOST_TabletDataGetTabletData ()
 
GHOST_TSuccess beginFullScreen () const
 
GHOST_TSuccess endFullScreen () const
 
GHOST_TSuccess setDialogHints (GHOST_WindowX11 *parentWindow)
 
GHOST_TUns16 getDPIHint ()
 
- Public Member Functions inherited from GHOST_Window
 GHOST_Window (GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, const bool wantStereoVisual=false, const bool exclusive=false)
 
virtual ~GHOST_Window ()
 
virtual void * getOSWindow () const
 
GHOST_TStandardCursor getCursorShape () const
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursorShape)
 
GHOST_TSuccess setCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
bool getCursorVisibility () const
 
GHOST_TGrabCursorMode getCursorGrabMode () const
 
bool getCursorGrabModeIsWarp () const
 
GHOST_TAxisFlag getCursorGrabAxis () const
 
void getCursorGrabInitPos (GHOST_TInt32 &x, GHOST_TInt32 &y) const
 
void getCursorGrabAccum (GHOST_TInt32 &x, GHOST_TInt32 &y) const
 
void setCursorGrabAccum (GHOST_TInt32 x, GHOST_TInt32 y)
 
GHOST_TSuccess setCursorVisibility (bool visible)
 
GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, GHOST_Rect *bounds, GHOST_TInt32 mouse_ungrab_xy[2])
 
GHOST_TSuccess getCursorGrabBounds (GHOST_Rect &bounds)
 
GHOST_TSuccess setSwapInterval (int interval)
 
GHOST_TSuccess getSwapInterval (int &intervalOut)
 
void setAcceptDragOperation (bool canAccept)
 
bool canAcceptDragOperation () const
 
virtual GHOST_TSuccess setModifiedState (bool isUnsavedChanges)
 
virtual bool getModifiedState ()
 
GHOST_TDrawingContextType getDrawingContextType ()
 
GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type)
 
virtual GHOST_TSuccess swapBuffers ()
 
virtual GHOST_TSuccess activateDrawingContext ()
 
GHOST_TSuccess updateDrawingContext ()
 
virtual unsigned int getDefaultFramebuffer ()
 
GHOST_TUserDataPtr getUserData () const
 
void setUserData (const GHOST_TUserDataPtr userData)
 
float getNativePixelSize (void)
 
- Public Member Functions inherited from GHOST_IWindow
virtual ~GHOST_IWindow ()
 

Public Attributes

bool m_post_init
 
GHOST_TWindowState m_post_state
 

Protected Member Functions

GHOST_ContextnewDrawingContext (GHOST_TDrawingContextType type)
 
GHOST_TSuccess setWindowCursorVisibility (bool visible)
 
GHOST_TSuccess setWindowCursorGrab (GHOST_TGrabCursorMode mode)
 
GHOST_TGrabCursorMode getWindowCursorGrab () const
 
GHOST_TSuccess setWindowCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess setWindowCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
- Protected Member Functions inherited from GHOST_Window
GHOST_TSuccess releaseNativeHandles ()
 

Additional Inherited Members

- Protected Attributes inherited from GHOST_Window
GHOST_TDrawingContextType m_drawingContextType
 
GHOST_TUserDataPtr m_userData
 
bool m_cursorVisible
 
GHOST_TGrabCursorMode m_cursorGrab
 
GHOST_TAxisFlag m_cursorGrabAxis
 
GHOST_TInt32 m_cursorGrabInitPos [2]
 
GHOST_TInt32 m_cursorGrabAccumPos [2]
 
GHOST_Rect m_cursorGrabBounds
 
GHOST_TStandardCursor m_cursorShape
 
bool m_progressBarVisible
 
bool m_canAcceptDragOperation
 
bool m_isUnsavedChanges
 
bool m_fullScreen
 
bool m_wantStereoVisual
 
GHOST_TUns32 m_fullScreenWidth
 
GHOST_TUns32 m_fullScreenHeight
 
float m_nativePixelSize
 

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 51 of file GHOST_WindowX11.h.

Constructor & Destructor Documentation

◆ GHOST_WindowX11()

GHOST_WindowX11::GHOST_WindowX11 ( GHOST_SystemX11 system,
Display *  display,
const char *  title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  height,
GHOST_TWindowState  state,
GHOST_WindowX11 parentWindow,
GHOST_TDrawingContextType  type = GHOST_kDrawingContextTypeNone,
const bool  is_dialog = false,
const bool  stereoVisual = false,
const bool  exclusive = false,
const bool  alphaBackground = false,
const bool  is_debug = false 
)

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.
parentWindowParent (embedder) window.
typeThe type of drawing context installed in this window.
stereoVisualStereo visual for quad buffered stereo.
alphaBackgroundEnable alpha blending of window with display background.

Definition at line 213 of file GHOST_WindowX11.cpp.

References GHOST_SystemX11::_NET_WM_STATE, GHOST_SystemX11::_NET_WM_STATE_FULLSCREEN, GHOST_SystemX11::_NET_WM_STATE_MAXIMIZED_HORZ, GHOST_SystemX11::_NET_WM_STATE_MAXIMIZED_VERT, BLENDER_ICONS_WM_X11, count, free(), GHOST_kDrawingContextTypeOpenGL, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_PRINT, GHOST_WindowX11(), height, HOST_NAME_MAX, left, len, GHOST_SystemX11::m_atom, m_post_init, m_post_state, GHOST_System::m_windowFocus, NULL, setDialogHints(), GHOST_Window::setDrawingContextType(), setTitle(), state, top, type, width, GHOST_SystemX11::WM_DELETE_WINDOW, GHOST_SystemX11::WM_PROTOCOLS, GHOST_SystemX11::WM_TAKE_FOCUS, and x11_visualinfo_from_glx().

Referenced by GHOST_WindowX11().

◆ ~GHOST_WindowX11()

GHOST_WindowX11::~GHOST_WindowX11 ( )

Destructor. Closes the window and disposes resources allocated.

Definition at line 1227 of file GHOST_WindowX11.cpp.

References GHOST_Window::releaseNativeHandles().

Member Function Documentation

◆ beginFullScreen()

GHOST_TSuccess GHOST_WindowX11::beginFullScreen ( ) const
virtual

Implements GHOST_IWindow.

Definition at line 1630 of file GHOST_WindowX11.cpp.

References err, GHOST_kSuccess, and GHOST_SystemX11::setCursorPosition().

◆ clientToScreen()

void GHOST_WindowX11::clientToScreen ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
virtual

Converts a point in screen coordinates to client rectangle 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 690 of file GHOST_WindowX11.cpp.

Referenced by getClientBounds().

◆ endFullScreen()

GHOST_TSuccess GHOST_WindowX11::endFullScreen ( void  ) const
virtual

Implements GHOST_IWindow.

Definition at line 1672 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

◆ endProgressBar()

GHOST_TSuccess GHOST_WindowX11::endProgressBar ( )
virtual

Hides the progress bar in the icon

Reimplemented from GHOST_Window.

Definition at line 1731 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, GHOST_TaskBarX11::is_valid(), and GHOST_TaskBarX11::set_progress_enabled().

◆ getClientBounds()

void GHOST_WindowX11::getClientBounds ( GHOST_Rect bounds) const
virtual

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 620 of file GHOST_WindowX11.cpp.

References bounds(), and clientToScreen().

Referenced by getWindowBounds().

◆ getDPIHint()

GHOST_TUns16 GHOST_WindowX11::getDPIHint ( )
virtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Reimplemented from GHOST_Window.

Definition at line 1680 of file GHOST_WindowX11.cpp.

References NULL, sqrt(), and type.

◆ getState()

GHOST_TWindowState GHOST_WindowX11::getState ( ) const
virtual

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

Returns
The state of the window.

Implements GHOST_IWindow.

Definition at line 987 of file GHOST_WindowX11.cpp.

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

Referenced by setState().

◆ GetTabletData()

GHOST_TabletData& GHOST_WindowX11::GetTabletData ( )
inline

Definition at line 146 of file GHOST_WindowX11.h.

◆ getTitle()

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

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 603 of file GHOST_WindowX11.cpp.

References NULL.

◆ getValid()

bool GHOST_WindowX11::getValid ( ) const
virtual

Returns indication as to whether the window is valid.

Returns
The validity of the window.

Reimplemented from GHOST_Window.

Definition at line 578 of file GHOST_WindowX11.cpp.

References GHOST_Window::getValid().

Referenced by GHOST_SystemX11::createWindow().

◆ getWindowBounds()

void GHOST_WindowX11::getWindowBounds ( GHOST_Rect bounds) const
virtual

Returns the window rectangle dimensions. These are screen coordinates.

Parameters
boundsThe bounding rectangle of the window.

Implements GHOST_IWindow.

Definition at line 613 of file GHOST_WindowX11.cpp.

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  cursorShape)
protectedvirtual

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

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1585 of file GHOST_WindowX11.cpp.

◆ invalidate()

GHOST_TSuccess GHOST_WindowX11::invalidate ( )
virtual

Invalidates the contents of this window.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1189 of file GHOST_WindowX11.cpp.

References GHOST_SystemX11::addDirtyWindow(), and GHOST_kSuccess.

◆ isDialog()

bool GHOST_WindowX11::isDialog ( ) const
virtual

Reimplemented from GHOST_Window.

Definition at line 1151 of file GHOST_WindowX11.cpp.

References NULL, and ret.

◆ newDrawingContext()

GHOST_Context * GHOST_WindowX11::newDrawingContext ( GHOST_TDrawingContextType  type)
protectedvirtual

◆ screenToClient()

void GHOST_WindowX11::screenToClient ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
virtual

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 674 of file GHOST_WindowX11.cpp.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowX11::setClientHeight ( GHOST_TUns32  height)
virtual

Resizes client rectangle height.

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

Implements GHOST_IWindow.

Definition at line 655 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess, and height.

◆ setClientSize()

GHOST_TSuccess GHOST_WindowX11::setClientSize ( GHOST_TUns32  width,
GHOST_TUns32  height 
)
virtual

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 664 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess, height, and width.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowX11::setClientWidth ( GHOST_TUns32  width)
virtual

Resizes client rectangle width.

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

Implements GHOST_IWindow.

Definition at line 645 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess, and width.

◆ setDialogHints()

GHOST_TSuccess GHOST_WindowX11::setDialogHints ( GHOST_WindowX11 parentWindow)

◆ setOrder()

GHOST_TSuccess GHOST_WindowX11::setOrder ( GHOST_TWindowOrder  order)
virtual

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

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

Implements GHOST_IWindow.

Definition at line 1095 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowOrderBottom, GHOST_kWindowOrderTop, and order.

◆ setProgressBar()

GHOST_TSuccess GHOST_WindowX11::setProgressBar ( float  )
virtual

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 1720 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, GHOST_TaskBarX11::is_valid(), GHOST_TaskBarX11::set_progress(), and GHOST_TaskBarX11::set_progress_enabled().

◆ setState()

GHOST_TSuccess GHOST_WindowX11::setState ( GHOST_TWindowState  state)
virtual

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 1009 of file GHOST_WindowX11.cpp.

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

◆ setTitle()

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

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implements GHOST_IWindow.

Definition at line 583 of file GHOST_WindowX11.cpp.

Referenced by GHOST_WindowX11().

◆ setWindowCursorGrab()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorGrab ( GHOST_TGrabCursorMode  mode)
protectedvirtual

◆ setWindowCursorShape()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorShape ( GHOST_TStandardCursor  shape)
protectedvirtual

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

Implements GHOST_Window.

Definition at line 1570 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kStandardCursorDefault, and GHOST_kSuccess.

◆ setWindowCursorVisibility()

GHOST_TSuccess GHOST_WindowX11::setWindowCursorVisibility ( bool  visible)
protectedvirtual

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

Implements GHOST_Window.

Definition at line 1482 of file GHOST_WindowX11.cpp.

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

Referenced by setWindowCursorGrab().

◆ setWindowCustomCursorShape()

GHOST_TSuccess GHOST_WindowX11::setWindowCustomCursorShape ( GHOST_TUns8 bitmap,
GHOST_TUns8 mask,
int  sizex,
int  sizey,
int  hotX,
int  hotY,
bool  canInvertColor 
)
protectedvirtual

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

Implements GHOST_Window.

Definition at line 1591 of file GHOST_WindowX11.cpp.

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

◆ 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 1217 of file GHOST_WindowX11.cpp.

Member Data Documentation

◆ m_post_init

bool GHOST_WindowX11::m_post_init

Definition at line 176 of file GHOST_WindowX11.h.

Referenced by GHOST_WindowX11().

◆ m_post_state

GHOST_TWindowState GHOST_WindowX11::m_post_state

Definition at line 177 of file GHOST_WindowX11.h.

Referenced by GHOST_WindowX11().


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