Blender  V3.3
Public Member Functions | Protected Member Functions | List of all members
GHOST_WindowSDL Class Reference

#include <GHOST_WindowSDL.h>

Inheritance diagram for GHOST_WindowSDL:
GHOST_Window GHOST_IWindow

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=NULL)
 
 ~GHOST_WindowSDL ()
 
SDL_Window * getSDLWindow ()
 
GHOST_TSuccess invalidate (void)
 
void validate ()
 
bool getValid () const
 
void getWindowBounds (GHOST_Rect &bounds) const
 
void getClientBounds (GHOST_Rect &bounds) const
 
- 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 voidgetOSWindow () const
 
GHOST_TStandardCursor getCursorShape () const
 
bool isDialog () const
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursorShape)
 
GHOST_TSuccess setCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
GHOST_TSuccess getCursorBitmap (GHOST_CursorBitmapRef *bitmap)
 
bool getCursorVisibility () const
 
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)
 
GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, GHOST_Rect *bounds, int32_t mouse_ungrab_xy[2])
 
GHOST_TSuccess getCursorGrabBounds (GHOST_Rect &bounds)
 
void getCursorGrabState (GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &axis_flag, GHOST_Rect &bounds, bool &use_software_cursor)
 
bool getCursorGrabUseSoftwareDisplay ()
 
virtual GHOST_TSuccess setProgressBar (float)
 
virtual GHOST_TSuccess endProgressBar ()
 
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 ()
 

Protected Member Functions

GHOST_ContextnewDrawingContext (GHOST_TDrawingContextType type)
 
GHOST_TSuccess setWindowCursorGrab (GHOST_TGrabCursorMode mode)
 
GHOST_TSuccess setWindowCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor shape)
 
GHOST_TSuccess setWindowCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
GHOST_TSuccess setWindowCursorVisibility (bool visible)
 
void setTitle (const char *title)
 
std::string getTitle () const
 
GHOST_TSuccess setClientWidth (uint32_t width)
 
GHOST_TSuccess setClientHeight (uint32_t height)
 
GHOST_TSuccess setClientSize (uint32_t width, uint32_t height)
 
void screenToClient (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
 
void clientToScreen (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
 
GHOST_TSuccess setState (GHOST_TWindowState state)
 
GHOST_TWindowState getState () const
 
GHOST_TSuccess setOrder (GHOST_TWindowOrder)
 
GHOST_TSuccess beginFullScreen () const
 
GHOST_TSuccess endFullScreen () const
 
uint16_t getDPIHint ()
 
- 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 25 of file GHOST_WindowSDL.h.

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 = NULL 
)

◆ ~GHOST_WindowSDL()

GHOST_WindowSDL::~GHOST_WindowSDL ( )

Definition at line 54 of file GHOST_WindowSDL.cpp.

References GHOST_Window::releaseNativeHandles().

Member Function Documentation

◆ beginFullScreen()

GHOST_TSuccess GHOST_WindowSDL::beginFullScreen ( ) const
inlineprotectedvirtual

Implements GHOST_IWindow.

Definition at line 119 of file GHOST_WindowSDL.h.

References GHOST_kFailure.

◆ clientToScreen()

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

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 198 of file GHOST_WindowSDL.cpp.

◆ endFullScreen()

GHOST_TSuccess GHOST_WindowSDL::endFullScreen ( void  ) const
inlineprotectedvirtual

Implements GHOST_IWindow.

Definition at line 124 of file GHOST_WindowSDL.h.

References GHOST_kFailure.

◆ getClientBounds()

void GHOST_WindowSDL::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 155 of file GHOST_WindowSDL.cpp.

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

Referenced by getWindowBounds().

◆ getDPIHint()

uint16_t GHOST_WindowSDL::getDPIHint ( )
protectedvirtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Reimplemented from GHOST_Window.

Definition at line 633 of file GHOST_WindowSDL.cpp.

◆ getSDLWindow()

SDL_Window* GHOST_WindowSDL::getSDLWindow ( )
inline

Definition at line 50 of file GHOST_WindowSDL.h.

Referenced by GHOST_DisplayManagerSDL::setCurrentDisplaySetting().

◆ getState()

GHOST_TWindowState GHOST_WindowSDL::getState ( ) const
protectedvirtual

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

Returns
The state of the window.

Implements GHOST_IWindow.

Definition at line 119 of file GHOST_WindowSDL.cpp.

References GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, and GHOST_kWindowStateNormal.

◆ getTitle()

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

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 145 of file GHOST_WindowSDL.cpp.

◆ getValid()

bool GHOST_WindowSDL::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 135 of file GHOST_WindowSDL.cpp.

References GHOST_Window::getValid().

◆ getWindowBounds()

void GHOST_WindowSDL::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 150 of file GHOST_WindowSDL.cpp.

References bounds(), and getClientBounds().

◆ hasCursorShape()

GHOST_TSuccess GHOST_WindowSDL::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 603 of file GHOST_WindowSDL.cpp.

References getStandardCursorShape(), GHOST_kFailure, and GHOST_kSuccess.

◆ invalidate()

GHOST_TSuccess GHOST_WindowSDL::invalidate ( void  )
virtual

Invalidates the contents of this window.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 85 of file GHOST_WindowSDL.cpp.

References GHOST_SystemSDL::addDirtyWindow(), and GHOST_kSuccess.

◆ newDrawingContext()

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

Implements GHOST_Window.

Definition at line 65 of file GHOST_WindowSDL.cpp.

References blender::compositor::context, GHOST_kDrawingContextTypeOpenGL, GHOST_OPENGL_SDL_CONTEXT_FLAGS, GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY, GHOST_Window::m_wantStereoVisual, and type.

◆ screenToClient()

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

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 189 of file GHOST_WindowSDL.cpp.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowSDL::setClientHeight ( uint32_t  height)
protectedvirtual

Resizes client rectangle height.

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

Implements GHOST_IWindow.

Definition at line 175 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess, height, and width.

◆ setClientSize()

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

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 183 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess, height, and width.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowSDL::setClientWidth ( uint32_t  width)
protectedvirtual

Resizes client rectangle width.

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

Implements GHOST_IWindow.

Definition at line 167 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess, height, and width.

◆ setOrder()

GHOST_TSuccess GHOST_WindowSDL::setOrder ( GHOST_TWindowOrder  order)
inlineprotectedvirtual

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

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

Implements GHOST_IWindow.

Definition at line 112 of file GHOST_WindowSDL.h.

References GHOST_kSuccess.

◆ setState()

GHOST_TSuccess GHOST_WindowSDL::setState ( GHOST_TWindowState  state)
protectedvirtual

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 95 of file GHOST_WindowSDL.cpp.

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

◆ setTitle()

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

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implements GHOST_IWindow.

Definition at line 140 of file GHOST_WindowSDL.cpp.

Referenced by GHOST_WindowSDL().

◆ setWindowCursorGrab()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorGrab ( GHOST_TGrabCursorMode  )
protectedvirtual

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

Reimplemented from GHOST_Window.

Definition at line 587 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess.

◆ setWindowCursorShape()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorShape ( GHOST_TStandardCursor  shape)
protectedvirtual

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

Implements GHOST_Window.

Definition at line 592 of file GHOST_WindowSDL.cpp.

References getStandardCursorShape(), GHOST_kStandardCursorDefault, and GHOST_kSuccess.

◆ setWindowCursorVisibility()

GHOST_TSuccess GHOST_WindowSDL::setWindowCursorVisibility ( bool  visible)
protectedvirtual

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

Implements GHOST_Window.

Definition at line 627 of file GHOST_WindowSDL.cpp.

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

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

Implements GHOST_Window.

Definition at line 608 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess, mask(), 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 62 of file GHOST_WindowSDL.h.


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