Blender  V2.93
Public Member Functions | List of all members
GHOST_IWindow Class Referenceabstract

#include <GHOST_IWindow.h>

Inherited by GHOST_Window.

Public Member Functions

virtual ~GHOST_IWindow ()
 
virtual bool getValid () const =0
 
virtual void * getOSWindow () const =0
 
virtual GHOST_TDrawingContextType getDrawingContextType ()=0
 
virtual GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type)=0
 
virtual void setTitle (const char *title)=0
 
virtual std::string getTitle () const =0
 
virtual void getWindowBounds (GHOST_Rect &bounds) const =0
 
virtual void getClientBounds (GHOST_Rect &bounds) const =0
 
virtual GHOST_TSuccess setClientWidth (GHOST_TUns32 width)=0
 
virtual GHOST_TSuccess setClientHeight (GHOST_TUns32 height)=0
 
virtual GHOST_TSuccess setClientSize (GHOST_TUns32 width, GHOST_TUns32 height)=0
 
virtual void screenToClient (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const =0
 
virtual void clientToScreen (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const =0
 
virtual void setAcceptDragOperation (bool canAccept)=0
 
virtual bool canAcceptDragOperation () const =0
 
virtual GHOST_TWindowState getState () const =0
 
virtual GHOST_TSuccess setState (GHOST_TWindowState state)=0
 
virtual GHOST_TSuccess setModifiedState (bool isUnsavedChanges)=0
 
virtual bool getModifiedState ()=0
 
virtual GHOST_TSuccess setOrder (GHOST_TWindowOrder order)=0
 
virtual GHOST_TSuccess swapBuffers ()=0
 
virtual GHOST_TSuccess setSwapInterval (int interval)=0
 
virtual GHOST_TSuccess getSwapInterval (int &intervalOut)=0
 
virtual GHOST_TSuccess activateDrawingContext ()=0
 
virtual unsigned int getDefaultFramebuffer ()=0
 
virtual GHOST_TSuccess invalidate ()=0
 
virtual GHOST_TUserDataPtr getUserData () const =0
 
virtual void setUserData (const GHOST_TUserDataPtr userData)=0
 
virtual bool isDialog () const =0
 
virtual GHOST_TSuccess setProgressBar (float progress)=0
 
virtual GHOST_TSuccess endProgressBar ()=0
 
virtual GHOST_TStandardCursor getCursorShape () const =0
 
virtual GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursorShape)=0
 
virtual GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor cursorShape)=0
 
virtual GHOST_TSuccess setCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)=0
 
virtual bool getCursorVisibility () const =0
 
virtual GHOST_TSuccess setCursorVisibility (bool visible)=0
 
virtual GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode, GHOST_TAxisFlag, GHOST_Rect *, GHOST_TInt32[2])
 
virtual GHOST_TSuccess beginFullScreen () const =0
 
virtual GHOST_TSuccess endFullScreen () const =0
 
virtual float getNativePixelSize (void)=0
 
virtual GHOST_TUns16 getDPIHint ()=0
 

Detailed Description

Interface for GHOST windows.

You can create a window with the system's GHOST_ISystem::createWindow method.

See also
GHOST_ISystem::createWindow

There are two coordinate systems:

Definition at line 47 of file GHOST_IWindow.h.

Constructor & Destructor Documentation

◆ ~GHOST_IWindow()

virtual GHOST_IWindow::~GHOST_IWindow ( )
inlinevirtual

Destructor.

Definition at line 52 of file GHOST_IWindow.h.

Member Function Documentation

◆ activateDrawingContext()

virtual GHOST_TSuccess GHOST_IWindow::activateDrawingContext ( )
pure virtual

Activates the drawing context of this window.

Returns
A boolean success indicator.

Implemented in GHOST_WindowNULL, and GHOST_Window.

Referenced by GHOST_ActivateWindowDrawingContext(), and View().

◆ beginFullScreen()

virtual GHOST_TSuccess GHOST_IWindow::beginFullScreen ( ) const
pure virtual

◆ canAcceptDragOperation()

virtual bool GHOST_IWindow::canAcceptDragOperation ( ) const
pure virtual

Returns acceptance of the dropped object Usually called by the "object dropped" event handling function

Implemented in GHOST_Window.

◆ clientToScreen()

virtual void GHOST_IWindow::clientToScreen ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
pure 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.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_ClientToScreen().

◆ endFullScreen()

virtual GHOST_TSuccess GHOST_IWindow::endFullScreen ( ) const
pure virtual

◆ endProgressBar()

virtual GHOST_TSuccess GHOST_IWindow::endProgressBar ( )
pure virtual

Hides the progress bar in the icon

Implemented in GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowCocoa, and GHOST_Window.

Referenced by GHOST_EndProgressBar().

◆ getClientBounds()

virtual void GHOST_IWindow::getClientBounds ( GHOST_Rect bounds) const
pure 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.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_GetClientBounds(), GHOST_Window::setCursorGrab(), and View().

◆ getCursorShape()

virtual GHOST_TStandardCursor GHOST_IWindow::getCursorShape ( ) const
pure virtual

Returns the current cursor shape.

Returns
The current cursor shape.

Implemented in GHOST_Window.

Referenced by GHOST_GetCursorShape().

◆ getCursorVisibility()

virtual bool GHOST_IWindow::getCursorVisibility ( ) const
pure virtual

Returns the visibility state of the cursor.

Returns
The visibility state of the cursor.

Implemented in GHOST_Window.

Referenced by GHOST_GetCursorVisibility(), and Application::processEvent().

◆ getDefaultFramebuffer()

virtual unsigned int GHOST_IWindow::getDefaultFramebuffer ( )
pure virtual

Gets the OpenGL frame-buffer associated with the window's contents.

Returns
The name of an OpenGL frame-buffer object.

Implemented in GHOST_Window.

Referenced by GHOST_GetDefaultOpenGLFramebuffer().

◆ getDPIHint()

virtual GHOST_TUns16 GHOST_IWindow::getDPIHint ( )
pure virtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Implemented in GHOST_WindowWin32, GHOST_WindowX11, GHOST_WindowSDL, and GHOST_Window.

Referenced by GHOST_GetDPIHint().

◆ getDrawingContextType()

virtual GHOST_TDrawingContextType GHOST_IWindow::getDrawingContextType ( )
pure virtual

Returns the type of drawing context used in this window.

Returns
The current type of drawing context.

Implemented in GHOST_Window.

Referenced by GHOST_GetDrawingContextType().

◆ getModifiedState()

virtual bool GHOST_IWindow::getModifiedState ( )
pure virtual

Gets the window "modified" status, indicating unsaved changes

Returns
True if there are unsaved changes

Implemented in GHOST_Window.

◆ getNativePixelSize()

virtual float GHOST_IWindow::getNativePixelSize ( void  )
pure virtual

Implemented in GHOST_Window.

Referenced by GHOST_GetNativePixelSize().

◆ getOSWindow()

virtual void* GHOST_IWindow::getOSWindow ( ) const
pure virtual

Returns the associated OS object/handle

Returns
The associated OS object/handle

Implemented in GHOST_WindowCocoa, and GHOST_Window.

◆ getState()

virtual GHOST_TWindowState GHOST_IWindow::getState ( ) const
pure virtual

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

Returns
The state of the window.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_GetWindowState().

◆ getSwapInterval()

virtual GHOST_TSuccess GHOST_IWindow::getSwapInterval ( int &  intervalOut)
pure virtual

Gets the current swap interval for swapBuffers.

Parameters
intervalOutpointer to location to return swap interval. (left untouched if there is an error)
Returns
A boolean success indicator of if swap interval was successfully read.

Implemented in GHOST_Window.

Referenced by GHOST_GetSwapInterval().

◆ getTitle()

virtual std::string GHOST_IWindow::getTitle ( ) const
pure virtual

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_GetTitle(), and Application::processEvent().

◆ getUserData()

virtual GHOST_TUserDataPtr GHOST_IWindow::getUserData ( ) const
pure virtual

Returns the window user data.

Returns
The window user data.

Implemented in GHOST_Window.

Referenced by GHOST_GetWindowUserData().

◆ getValid()

virtual bool GHOST_IWindow::getValid ( ) const
pure virtual

Returns indication as to whether the window is valid.

Returns
The validity of the window.

Implemented in GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, GHOST_WindowCocoa, and GHOST_Window.

Referenced by GHOST_WindowManager::beginFullScreen(), GHOST_SystemCocoa::createWindow(), and GHOST_GetValid().

◆ getWindowBounds()

virtual void GHOST_IWindow::getWindowBounds ( GHOST_Rect bounds) const
pure virtual

Returns the window rectangle dimensions. These are screen coordinates.

Parameters
boundsThe bounding rectangle of the window.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_GetWindowBounds().

◆ hasCursorShape()

virtual GHOST_TSuccess GHOST_IWindow::hasCursorShape ( GHOST_TStandardCursor  cursorShape)
pure virtual

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

Returns
Indication of success.

Implemented in GHOST_WindowNULL, GHOST_WindowX11, GHOST_WindowSDL, GHOST_WindowCocoa, and GHOST_WindowWayland.

Referenced by GHOST_HasCursorShape().

◆ invalidate()

virtual GHOST_TSuccess GHOST_IWindow::invalidate ( )
pure virtual

Invalidates the contents of this window.

Returns
Indication of success.

Implemented in GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by gearsTimerProc(), and GHOST_InvalidateWindow().

◆ isDialog()

virtual bool GHOST_IWindow::isDialog ( ) const
pure virtual

◆ screenToClient()

virtual void GHOST_IWindow::screenToClient ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
pure 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.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_ScreenToClient().

◆ setAcceptDragOperation()

virtual void GHOST_IWindow::setAcceptDragOperation ( bool  canAccept)
pure virtual

Tells if the ongoing drag'n'drop object can be accepted upon mouse drop

Implemented in GHOST_Window.

Referenced by GHOST_setAcceptDragOperation().

◆ setClientHeight()

virtual GHOST_TSuccess GHOST_IWindow::setClientHeight ( GHOST_TUns32  height)
pure virtual

Resizes client rectangle height.

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

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetClientHeight().

◆ setClientSize()

virtual GHOST_TSuccess GHOST_IWindow::setClientSize ( GHOST_TUns32  width,
GHOST_TUns32  height 
)
pure 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.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetClientSize().

◆ setClientWidth()

virtual GHOST_TSuccess GHOST_IWindow::setClientWidth ( GHOST_TUns32  width)
pure virtual

Resizes client rectangle width.

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

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetClientWidth().

◆ setCursorGrab()

virtual GHOST_TSuccess GHOST_IWindow::setCursorGrab ( GHOST_TGrabCursorMode  ,
GHOST_TAxisFlag  ,
GHOST_Rect ,
GHOST_TInt32  [2] 
)
inlinevirtual

Grabs the cursor for a modal operation.

Parameters
grabThe new grab state of the cursor.
Returns
Indication of success.

Reimplemented in GHOST_Window.

Definition at line 319 of file GHOST_IWindow.h.

References GHOST_kSuccess.

Referenced by GHOST_SetCursorGrab().

◆ setCursorShape()

virtual GHOST_TSuccess GHOST_IWindow::setCursorShape ( GHOST_TStandardCursor  cursorShape)
pure virtual

Set the shape of the cursor.

Parameters
cursorShapeThe new cursor shape type id.
Returns
Indication of success.

Implemented in GHOST_Window.

Referenced by GHOST_SetCursorShape(), and Application::processEvent().

◆ setCursorVisibility()

virtual GHOST_TSuccess GHOST_IWindow::setCursorVisibility ( bool  visible)
pure virtual

Shows or hides the cursor.

Parameters
visibleThe new visibility state of the cursor.
Returns
Indication of success.

Implemented in GHOST_Window.

Referenced by GHOST_SetCursorVisibility(), and Application::processEvent().

◆ setCustomCursorShape()

virtual GHOST_TSuccess GHOST_IWindow::setCustomCursorShape ( GHOST_TUns8 bitmap,
GHOST_TUns8 mask,
int  sizex,
int  sizey,
int  hotX,
int  hotY,
bool  canInvertColor 
)
pure virtual

Set the shape of the cursor to a custom cursor.

Parameters
bitmapThe bitmap data for the cursor.
maskThe mask data for the cursor.
hotXThe X coordinate of the cursor hot-spot.
hotYThe Y coordinate of the cursor hot-spot.
Returns
Indication of success.

Implemented in GHOST_Window.

Referenced by GHOST_SetCustomCursorShape().

◆ setDrawingContextType()

virtual GHOST_TSuccess GHOST_IWindow::setDrawingContextType ( GHOST_TDrawingContextType  type)
pure virtual

Tries to install a rendering context in this window.

Parameters
typeThe type of rendering context installed.
Returns
Indication as to whether installation has succeeded.

Implemented in GHOST_Window.

Referenced by GHOST_SetDrawingContextType().

◆ setModifiedState()

virtual GHOST_TSuccess GHOST_IWindow::setModifiedState ( bool  isUnsavedChanges)
pure virtual

Sets the window "modified" status, indicating unsaved changes

Parameters
isUnsavedChangesUnsaved changes or not.
Returns
Indication of success.

Implemented in GHOST_WindowCocoa, and GHOST_Window.

Referenced by GHOST_SetWindowModifiedState().

◆ setOrder()

virtual GHOST_TSuccess GHOST_IWindow::setOrder ( GHOST_TWindowOrder  order)
pure virtual

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

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

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetWindowOrder().

◆ setProgressBar()

virtual GHOST_TSuccess GHOST_IWindow::setProgressBar ( float  progress)
pure virtual

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

Parameters
progressThe progress percentage (0.0 to 1.0).

Implemented in GHOST_Window, GHOST_WindowX11, GHOST_WindowWin32, and GHOST_WindowCocoa.

Referenced by GHOST_SetProgressBar().

◆ setState()

virtual GHOST_TSuccess GHOST_IWindow::setState ( GHOST_TWindowState  state)
pure virtual

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

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

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetWindowState().

◆ setSwapInterval()

virtual GHOST_TSuccess GHOST_IWindow::setSwapInterval ( int  interval)
pure virtual

Sets the swap interval for swapBuffers.

Parameters
intervalThe swap interval to use.
Returns
A boolean success indicator.

Implemented in GHOST_Window.

Referenced by GHOST_SetSwapInterval().

◆ setTitle()

virtual void GHOST_IWindow::setTitle ( const char *  title)
pure virtual

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implemented in GHOST_WindowWayland, GHOST_WindowX11, GHOST_WindowWin32, GHOST_WindowSDL, GHOST_WindowNULL, and GHOST_WindowCocoa.

Referenced by GHOST_SetTitle(), and Application::processEvent().

◆ setUserData()

virtual void GHOST_IWindow::setUserData ( const GHOST_TUserDataPtr  userData)
pure virtual

Changes the window user data.

Parameters
userDataThe window user data.

Implemented in GHOST_Window.

Referenced by GHOST_SetWindowUserData().

◆ swapBuffers()

virtual GHOST_TSuccess GHOST_IWindow::swapBuffers ( )
pure virtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implemented in GHOST_WindowNULL, and GHOST_Window.

Referenced by GHOST_SwapWindowBuffers(), and Application::processEvent().


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