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

#include <GHOST_WindowSDL.h>

Inherits GHOST_Window.

Public Member Functions

 GHOST_WindowSDL (GHOST_SystemSDL *system, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 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 (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
 
bool isDialog () 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)
 
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 (GHOST_TUns8 *bitmap, GHOST_TUns8 *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 (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_TSuccess setState (GHOST_TWindowState state)
 
GHOST_TWindowState getState () const
 
GHOST_TSuccess setOrder (GHOST_TWindowOrder order)
 
GHOST_TSuccess beginFullScreen () const
 
GHOST_TSuccess endFullScreen () const
 
GHOST_TUns16 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
 
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

Definition at line 39 of file GHOST_WindowSDL.h.

Constructor & Destructor Documentation

◆ GHOST_WindowSDL()

GHOST_WindowSDL::GHOST_WindowSDL ( GHOST_SystemSDL system,
const char *  title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  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 68 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 139 of file GHOST_WindowSDL.h.

References GHOST_kFailure.

◆ clientToScreen()

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

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

◆ endFullScreen()

GHOST_TSuccess GHOST_WindowSDL::endFullScreen ( void  ) const
inlineprotectedvirtual

Implements GHOST_IWindow.

Definition at line 144 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 166 of file GHOST_WindowSDL.cpp.

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

Referenced by getWindowBounds().

◆ getDPIHint()

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

References NULL.

◆ getSDLWindow()

SDL_Window* GHOST_WindowSDL::getSDLWindow ( )
inline

Definition at line 64 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 133 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 156 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 146 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 161 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 620 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 99 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 79 of file GHOST_WindowSDL.cpp.

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

◆ screenToClient()

void GHOST_WindowSDL::screenToClient ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 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 200 of file GHOST_WindowSDL.cpp.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowSDL::setClientHeight ( GHOST_TUns32  height)
protectedvirtual

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.cpp.

References GHOST_kSuccess, height, NULL, and width.

◆ setClientSize()

GHOST_TSuccess GHOST_WindowSDL::setClientSize ( GHOST_TUns32  width,
GHOST_TUns32  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 194 of file GHOST_WindowSDL.cpp.

References GHOST_kSuccess, height, and width.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowSDL::setClientWidth ( GHOST_TUns32  width)
protectedvirtual

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.cpp.

References GHOST_kSuccess, height, NULL, 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 132 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 109 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 151 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 604 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 609 of file GHOST_WindowSDL.cpp.

References getStandardCursorShape(), GHOST_kStandardCursorDefault, GHOST_kSuccess, and NULL.

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

References GHOST_kSuccess.

◆ setWindowCustomCursorShape()

GHOST_TSuccess GHOST_WindowSDL::setWindowCustomCursorShape ( GHOST_TUns8 bitmap,
GHOST_TUns8 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 625 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 76 of file GHOST_WindowSDL.h.


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