Blender V4.3
GHOST_WindowSDL Class Reference

#include <GHOST_WindowSDL.hh>

Inherits GHOST_Window.

Public Member Functions

 GHOST_WindowSDL (GHOST_SystemSDL *system, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type=GHOST_kDrawingContextTypeNone, const bool stereoVisual=false, const bool exclusive=false, const GHOST_IWindow *parentWindow=nullptr)
 
 ~GHOST_WindowSDL ()
 
SDL_Window * getSDLWindow ()
 
GHOST_TSuccess invalidate () override
 
void validate ()
 
bool getValid () const override
 
void getWindowBounds (GHOST_Rect &bounds) const override
 
void getClientBounds (GHOST_Rect &bounds) const override
 
- Public Member Functions inherited from GHOST_Window
 GHOST_Window (uint32_t width, uint32_t height, GHOST_TWindowState state, const bool wantStereoVisual=false, const bool exclusive=false)
 
virtual ~GHOST_Window ()
 
virtual void * getOSWindow () const override
 
virtual GHOST_TSuccess setPath (const char *) override
 
GHOST_TStandardCursor getCursorShape () const override
 
bool isDialog () const override
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursorShape) override
 
GHOST_TSuccess setCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) 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
 
virtual GHOST_TSuccess setProgressBar (float) override
 
virtual GHOST_TSuccess endProgressBar () override
 
GHOST_TSuccess setSwapInterval (int interval) override
 
GHOST_TSuccess getSwapInterval (int &intervalOut) override
 
void setAcceptDragOperation (bool canAccept) override
 
bool canAcceptDragOperation () const override
 
virtual GHOST_TSuccess setModifiedState (bool isUnsavedChanges) override
 
virtual bool getModifiedState () override
 
GHOST_TDrawingContextType getDrawingContextType () override
 
GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type) override
 
virtual GHOST_IContextgetDrawingContext () override
 
virtual GHOST_TSuccess swapBuffers () override
 
virtual GHOST_TSuccess activateDrawingContext () override
 
GHOST_TSuccess updateDrawingContext ()
 
GHOST_ContextgetContext ()
 
virtual unsigned int getDefaultFramebuffer () override
 
GHOST_TUserDataPtr getUserData () const override
 
void setUserData (const GHOST_TUserDataPtr userData) override
 
float getNativePixelSize () override
 
- Public Member Functions inherited from GHOST_IWindow
virtual ~GHOST_IWindow ()
 

Protected Member Functions

GHOST_ContextnewDrawingContext (GHOST_TDrawingContextType type) override
 
GHOST_TSuccess setWindowCursorGrab (GHOST_TGrabCursorMode mode) override
 
GHOST_TSuccess setWindowCursorShape (GHOST_TStandardCursor shape) override
 
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor shape) override
 
GHOST_TSuccess setWindowCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor) override
 
GHOST_TSuccess setWindowCursorVisibility (bool visible) override
 
void setTitle (const char *title) override
 
std::string getTitle () 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_TSuccess setState (GHOST_TWindowState state) override
 
GHOST_TWindowState getState () const override
 
GHOST_TSuccess setOrder (GHOST_TWindowOrder) override
 
GHOST_TSuccess beginFullScreen () const override
 
GHOST_TSuccess endFullScreen () const override
 
uint16_t getDPIHint () override
 
- 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
 
int32_t m_cursorGrabInitPos [2]
 
int32_t 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
 
uint32_t m_fullScreenWidth
 
uint32_t m_fullScreenHeight
 
float m_nativePixelSize
 

Detailed Description

Definition at line 27 of file GHOST_WindowSDL.hh.

Constructor & Destructor Documentation

◆ GHOST_WindowSDL()

GHOST_WindowSDL::GHOST_WindowSDL ( GHOST_SystemSDL * system,
const char * title,
int32_t left,
int32_t top,
uint32_t width,
uint32_t height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false,
const bool exclusive = false,
const GHOST_IWindow * parentWindow = nullptr )

◆ ~GHOST_WindowSDL()

GHOST_WindowSDL::~GHOST_WindowSDL ( )

Definition at line 55 of file GHOST_WindowSDL.cc.

References GHOST_Window::releaseNativeHandles().

Member Function Documentation

◆ beginFullScreen()

GHOST_TSuccess GHOST_WindowSDL::beginFullScreen ( ) const
inlineoverrideprotectedvirtual

Implements GHOST_IWindow.

Definition at line 121 of file GHOST_WindowSDL.hh.

References GHOST_kFailure.

◆ clientToScreen()

void GHOST_WindowSDL::clientToScreen ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overrideprotectedvirtual

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 209 of file GHOST_WindowSDL.cc.

◆ endFullScreen()

GHOST_TSuccess GHOST_WindowSDL::endFullScreen ( ) const
inlineoverrideprotectedvirtual

Implements GHOST_IWindow.

Definition at line 126 of file GHOST_WindowSDL.hh.

References GHOST_kFailure.

◆ getClientBounds()

void GHOST_WindowSDL::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 166 of file GHOST_WindowSDL.cc.

References bounds(), w(), x, and y.

Referenced by getWindowBounds().

◆ getDPIHint()

uint16_t GHOST_WindowSDL::getDPIHint ( )
overrideprotectedvirtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Reimplemented from GHOST_Window.

Definition at line 644 of file GHOST_WindowSDL.cc.

References int.

◆ getSDLWindow()

SDL_Window * GHOST_WindowSDL::getSDLWindow ( )
inline

◆ getState()

GHOST_TWindowState GHOST_WindowSDL::getState ( ) const
overrideprotectedvirtual

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

Returns
The state of the window.

Implements GHOST_IWindow.

Definition at line 130 of file GHOST_WindowSDL.cc.

References GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, and GHOST_kWindowStateNormal.

◆ getTitle()

std::string GHOST_WindowSDL::getTitle ( ) const
overrideprotectedvirtual

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 156 of file GHOST_WindowSDL.cc.

◆ getValid()

bool GHOST_WindowSDL::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 146 of file GHOST_WindowSDL.cc.

References GHOST_Window::getValid().

◆ getWindowBounds()

void GHOST_WindowSDL::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 161 of file GHOST_WindowSDL.cc.

References bounds(), and getClientBounds().

◆ hasCursorShape()

GHOST_TSuccess GHOST_WindowSDL::hasCursorShape ( GHOST_TStandardCursor cursorShape)
overrideprotectedvirtual

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

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 614 of file GHOST_WindowSDL.cc.

References getStandardCursorShape(), GHOST_kFailure, and GHOST_kSuccess.

◆ invalidate()

GHOST_TSuccess GHOST_WindowSDL::invalidate ( )
overridevirtual

Invalidates the contents of this window.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 96 of file GHOST_WindowSDL.cc.

References GHOST_SystemSDL::addDirtyWindow(), and GHOST_kSuccess.

◆ newDrawingContext()

GHOST_Context * GHOST_WindowSDL::newDrawingContext ( GHOST_TDrawingContextType type)
overrideprotectedvirtual
Parameters
typeThe type of rendering context create.
Returns
Indication of success.

Implements GHOST_Window.

Definition at line 66 of file GHOST_WindowSDL.cc.

References GHOST_OPENGL_SDL_CONTEXT_FLAGS, GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY, and GHOST_Window::m_wantStereoVisual.

◆ screenToClient()

void GHOST_WindowSDL::screenToClient ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overrideprotectedvirtual

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 200 of file GHOST_WindowSDL.cc.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowSDL::setClientHeight ( uint32_t height)
overrideprotectedvirtual

Resizes client rectangle height.

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

Implements GHOST_IWindow.

Definition at line 186 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess.

◆ setClientSize()

GHOST_TSuccess GHOST_WindowSDL::setClientSize ( uint32_t width,
uint32_t height )
overrideprotectedvirtual

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 194 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowSDL::setClientWidth ( uint32_t width)
overrideprotectedvirtual

Resizes client rectangle width.

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

Implements GHOST_IWindow.

Definition at line 178 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess.

◆ setOrder()

GHOST_TSuccess GHOST_WindowSDL::setOrder ( GHOST_TWindowOrder order)
inlineoverrideprotectedvirtual

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

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

Implements GHOST_IWindow.

Definition at line 114 of file GHOST_WindowSDL.hh.

References GHOST_kSuccess.

◆ setState()

GHOST_TSuccess GHOST_WindowSDL::setState ( GHOST_TWindowState state)
overrideprotectedvirtual

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 106 of file GHOST_WindowSDL.cc.

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

◆ setTitle()

void GHOST_WindowSDL::setTitle ( const char * title)
overrideprotectedvirtual

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implements GHOST_IWindow.

Definition at line 151 of file GHOST_WindowSDL.cc.

Referenced by GHOST_WindowSDL().

◆ setWindowCursorGrab()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorGrab ( GHOST_TGrabCursorMode )
overrideprotectedvirtual

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

Reimplemented from GHOST_Window.

Definition at line 598 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess.

◆ setWindowCursorShape()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorShape ( GHOST_TStandardCursor shape)
overrideprotectedvirtual

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

Implements GHOST_Window.

Definition at line 603 of file GHOST_WindowSDL.cc.

References getStandardCursorShape(), GHOST_kStandardCursorDefault, and GHOST_kSuccess.

◆ setWindowCursorVisibility()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorVisibility ( bool visible)
overrideprotectedvirtual

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

Implements GHOST_Window.

Definition at line 638 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess.

◆ setWindowCustomCursorShape()

GHOST_TSuccess GHOST_WindowSDL::setWindowCustomCursorShape ( uint8_t * bitmap,
uint8_t * mask,
int szx,
int szy,
int hotX,
int hotY,
bool canInvertColor )
overrideprotectedvirtual

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

Implements GHOST_Window.

Definition at line 619 of file GHOST_WindowSDL.cc.

References GHOST_kSuccess, and sdl_ghost_CreateCursor().

◆ validate()

void GHOST_WindowSDL::validate ( )
inline

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

Definition at line 64 of file GHOST_WindowSDL.hh.


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