Blender V5.3
GHOST_IWindow Class Referenceabstract

#include <GHOST_IWindow.hh>

Inherited by GHOST_Window.

Public Member Functions

virtual ~GHOST_IWindow ()=default
virtual bool getValid () const =0
virtual GHOST_TDrawingContextType getDrawingContextType ()=0
virtual GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type)=0
virtual GHOST_IContext * getDrawingContext ()=0
virtual void setTitle (const char *title)=0
virtual std::string getTitle () const =0
virtual void setPath (const char *filepath)=0
virtual GHOST_TWindowDecorationStyleFlags getWindowDecorationStyleFlags ()=0
virtual void setWindowDecorationStyleFlags (GHOST_TWindowDecorationStyleFlags style_flags)=0
virtual void setWindowDecorationStyleSettings (GHOST_WindowDecorationStyleSettings decoration_settings)=0
virtual GHOST_TSuccess applyWindowDecorationStyle ()=0
virtual void getWindowBounds (GHOST_Rect &bounds) const =0
virtual void getClientBounds (GHOST_Rect &bounds) const =0
virtual GHOST_TSuccess setClientWidth (uint32_t width)=0
virtual GHOST_TSuccess setClientHeight (uint32_t height)=0
virtual GHOST_TSuccess setClientSize (uint32_t width, uint32_t height)=0
virtual void screenToClient (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const =0
virtual void clientToScreen (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const =0
virtual void setAcceptDragOperation (bool can_accept)=0
virtual GHOST_TWindowState getState () const =0
virtual GHOST_TSuccess setState (GHOST_TWindowState state)=0
virtual GHOST_TSuccess setModifiedState (bool is_unsaved_changes)=0
virtual GHOST_TSuccess setOrder (GHOST_TWindowOrder order)=0
virtual GHOST_TSuccess swapBufferAcquire ()=0
virtual GHOST_TSuccess swapBufferRelease ()=0
virtual GHOST_TSuccess setSwapInterval (int interval)=0
virtual GHOST_TSuccess getSwapInterval (int &interval_out)=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 user_data)=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 cursor_shape)=0
virtual void getCursorGrabState (GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &axis_flag, GHOST_Rect &bounds, bool &use_software_cursor)=0
virtual GHOST_TSuccess hasCursorShape (GHOST_TStandardCursor cursor_shape)=0
virtual GHOST_TSuccess setCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color)=0
virtual GHOST_TSuccess setCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator)=0
virtual GHOST_TSuccess getCursorBitmap (GHOST_CursorBitmapRef *bitmap)=0
virtual bool getCursorVisibility () const =0
virtual GHOST_TSuccess setCursorVisibility (bool visible)=0
virtual GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode, GHOST_TAxisFlag, GHOST_Rect *, int32_t[2])
virtual float getNativePixelSize ()=0
virtual uint16_t getDPIHint ()=0
virtual bool hasAlpha () const
virtual GHOST_TWindowTiledFlag getTiledEdges () const
virtual GHOST_WindowHDRInfo getHDRInfo ()=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:

  • The screen coordinate system. The origin of the screen is located in the upper left corner of the screen.
  • The client rectangle coordinate system. The client rectangle of a window is the area that is drawable by the application (excluding title bars etc.).

Definition at line 34 of file GHOST_IWindow.hh.

Constructor & Destructor Documentation

◆ ~GHOST_IWindow()

virtual GHOST_IWindow::~GHOST_IWindow ( )
virtualdefault

Destructor.

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_Window, and GHOST_WindowNULL.

Referenced by blender::ghost_event_proc(), blender::playanim_toscreen_ex(), blender::wm_ghostwindow_destroy(), and blender::wm_window_set_drawable().

◆ applyWindowDecorationStyle()

virtual GHOST_TSuccess GHOST_IWindow::applyWindowDecorationStyle ( )
pure virtual

Apply the window decoration style using the current flags and settings.

Implemented in GHOST_Window, GHOST_WindowCocoa, and GHOST_WindowWin32.

Referenced by blender::WM_window_decoration_style_apply().

◆ clientToScreen()

virtual void GHOST_IWindow::clientToScreen ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
pure virtual

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.

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

Referenced by GHOST_System::setCursorPositionClientRelative(), and blender::wm_cursor_position_to_ghost_screen_coords().

◆ endProgressBar()

virtual GHOST_TSuccess GHOST_IWindow::endProgressBar ( )
pure virtual

Hides the progress bar in the icon.

Implemented in GHOST_Window, GHOST_WindowCocoa, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::WM_progress_clear().

◆ 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::gpu::GLContext::activate(), GHOST_System::getWindowUnderCursor(), blender::gpu::GLContext::GLContext(), blender::playanim_window_size_get(), GHOST_Window::setCursorGrab(), and blender::wm_window_update_size_position().

◆ getCursorBitmap()

virtual GHOST_TSuccess GHOST_IWindow::getCursorBitmap ( GHOST_CursorBitmapRef * bitmap)
pure virtual

◆ getCursorGrabState()

virtual void GHOST_IWindow::getCursorGrabState ( GHOST_TGrabCursorMode & mode,
GHOST_TAxisFlag & axis_flag,
GHOST_Rect & bounds,
bool & use_software_cursor )
pure virtual

◆ getCursorShape()

virtual GHOST_TStandardCursor GHOST_IWindow::getCursorShape ( ) const
pure virtual

Returns the current cursor shape.

Returns
The current cursor shape.

Implemented in GHOST_Window.

◆ 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 blender::wm_software_cursor_needed_for_window().

◆ 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 blender::gpu::GLContext::GLContext().

◆ getDPIHint()

◆ getDrawingContext()

virtual GHOST_IContext * GHOST_IWindow::getDrawingContext ( )
pure virtual

Returns the drawing context used in this window.

Returns
The current drawing context.

Implemented in GHOST_Window.

Referenced by blender::GPU_context_create(), blender::wm_main_playanim_intern(), and blender::wm_window_ghostwindow_add().

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

◆ getHDRInfo()

virtual GHOST_WindowHDRInfo GHOST_IWindow::getHDRInfo ( )
pure virtual

Returns high dynamic range color information about this window.

Returns
HDR info.

Implemented in GHOST_Window.

References w(), x, and y.

Referenced by blender::WM_window_support_hdr_color().

◆ getNativePixelSize()

◆ getState()

◆ getSwapInterval()

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

Gets the current swap interval for #swapBuffers.

Parameters
interval_outpointer 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 blender::wm_window_get_swap_interval().

◆ getTiledEdges()

virtual GHOST_TWindowTiledFlag GHOST_IWindow::getTiledEdges ( ) const
inlinevirtual

Returns which of the window's edges the compositor has tiled, as a bit-mask of GHOST_TWindowTiledFlag. Zero when the window is free floating, or on backends that don't report tiling.

Reimplemented in GHOST_WindowWayland.

Definition at line 374 of file GHOST_IWindow.hh.

References GHOST_kWindowTiledNone.

◆ getTitle()

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

Returns the title displayed in the title bar.

Returns
The title displayed in the title bar.

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

Referenced by blender::WM_window_csd_draw_titlebar().

◆ 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 blender::ghost_event_proc(), and blender::WM_window_find_under_cursor().

◆ 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_Window, GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by GHOST_SystemCocoa::createWindow().

◆ 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

◆ getWindowDecorationStyleFlags()

virtual GHOST_TWindowDecorationStyleFlags GHOST_IWindow::getWindowDecorationStyleFlags ( )
pure virtual

Return the current window decoration style flags.

Implemented in GHOST_Window.

Referenced by blender::WM_window_decoration_style_flags_get().

◆ hasAlpha()

virtual bool GHOST_IWindow::hasAlpha ( ) const
inlinevirtual

True when the window's frame-buffer has an alpha channel the compositor blends against the desktop. Only requested for client-side-decorations (see WITH_GHOST_CSD) and only true when the driver supports it; callers must handle this returning false.

Reimplemented in GHOST_Window.

Definition at line 364 of file GHOST_IWindow.hh.

◆ hasCursorShape()

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

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

Returns
Indication of success.

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

Referenced by blender::WM_cursor_set().

◆ invalidate()

virtual GHOST_TSuccess GHOST_IWindow::invalidate ( )
pure virtual

Invalidates the contents of this window.

Returns
Indication of success.

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

◆ isDialog()

virtual bool GHOST_IWindow::isDialog ( ) const
pure virtual

◆ screenToClient()

virtual void GHOST_IWindow::screenToClient ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by GHOST_System::getCursorPositionClientRelative(), blender::ghost_event_proc(), and blender::wm_cursor_position_from_ghost_screen_coords().

◆ setAcceptDragOperation()

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

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

Implemented in GHOST_Window.

◆ setClientHeight()

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

Resizes client rectangle height.

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

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

◆ setClientSize()

virtual GHOST_TSuccess GHOST_IWindow::setClientSize ( uint32_t width,
uint32_t 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::playanim_window_zoom(), and blender::wm_window_set_size().

◆ setClientWidth()

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

Resizes client rectangle width.

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

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

◆ setCursorGrab()

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

Grabs the cursor for a modal operation.

Parameters
modeThe new grab mode of the cursor.
Returns
Indication of success.

Reimplemented in GHOST_Window.

Definition at line 340 of file GHOST_IWindow.hh.

References GHOST_kSuccess.

Referenced by blender::WM_cursor_grab_disable(), and blender::WM_cursor_grab_enable().

◆ setCursorShape()

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

Set the shape of the cursor.

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

Implemented in GHOST_Window.

Referenced by blender::WM_cursor_set().

◆ 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 blender::WM_cursor_set().

◆ setCustomCursorGenerator()

virtual GHOST_TSuccess GHOST_IWindow::setCustomCursorGenerator ( GHOST_CursorGenerator * cursor_generator)
pure virtual

Set the cursor generator.

Parameters
cursor_generatorAn object which generates cursors. Ownership is transferred to GHOST which is responsible for calling it's free method.

Implemented in GHOST_Window.

Referenced by blender::window_set_custom_cursor_generator(), and blender::wm_cursor_text_generator().

◆ setCustomCursorShape()

virtual GHOST_TSuccess GHOST_IWindow::setCustomCursorShape ( const uint8_t * bitmap,
const uint8_t * mask,
const int size[2],
const int hot_spot[2],
bool can_invert_color )
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.
sizeThe X,Y size of the cursor in pixels.
hot_spotThe X,Y coordinate of the cursor hot-spot.
Returns
Indication of success.

Implemented in GHOST_Window.

References mask().

Referenced by blender::window_set_custom_cursor_pixmap(), blender::wm_cursor_text_pixmap(), blender::wm_cursor_time_large(), and blender::wm_cursor_time_small().

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

◆ setModifiedState()

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

Sets the window "modified" status, indicating unsaved changes.

Parameters
is_unsaved_changesUnsaved changes or not.
Returns
Indication of success.

Implemented in GHOST_Window, and GHOST_WindowCocoa.

Referenced by blender::wm_window_title_state_refresh().

◆ 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::wm_window_lower(), and blender::wm_window_raise().

◆ setPath()

virtual void GHOST_IWindow::setPath ( const char * filepath)
pure virtual

Sets the file name represented by this window.

Parameters
filepathThe file directory.

Implemented in GHOST_Window, GHOST_WindowCocoa, and GHOST_WindowNULL.

Referenced by blender::wm_window_ghostwindow_ensure(), and blender::WM_window_title_refresh().

◆ 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_WindowCocoa, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::WM_progress_set().

◆ 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

References state.

Referenced by blender::wm_window_fullscreen_toggle_exec(), blender::wm_window_ghostwindow_add(), blender::WM_window_open(), and blender::wm_window_raise().

◆ 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 blender::wm_window_set_swap_interval().

◆ 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_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.

Referenced by blender::WM_window_title_refresh(), and blender::WM_window_title_set().

◆ setUserData()

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

Changes the window user data.

Parameters
user_dataThe window user data.

Implemented in GHOST_Window.

Referenced by blender::wm_file_read_setup_wm_substitute_old_window(), and blender::wm_window_ghostwindow_add().

◆ setWindowDecorationStyleFlags()

virtual void GHOST_IWindow::setWindowDecorationStyleFlags ( GHOST_TWindowDecorationStyleFlags style_flags)
pure virtual

Set the window decoration style flags.

Parameters
style_flagsWindow decoration style flags.

Implemented in GHOST_Window.

Referenced by blender::WM_window_decoration_style_flags_set().

◆ setWindowDecorationStyleSettings()

virtual void GHOST_IWindow::setWindowDecorationStyleSettings ( GHOST_WindowDecorationStyleSettings decoration_settings)
pure virtual

Set the window decoration style settings.

Parameters
decoration_settingsWindow decoration style settings.

Implemented in GHOST_Window.

Referenced by blender::wm_window_decoration_style_set_from_theme().

◆ swapBufferAcquire()

virtual GHOST_TSuccess GHOST_IWindow::swapBufferAcquire ( )
pure virtual

Acquire the next buffer of the swap chain.

Returns
A boolean success indicator.

Implemented in GHOST_Window.

Referenced by blender::playanim_toscreen_ex(), blender::wm_main_playanim_intern(), and blender::wm_window_swap_buffer_acquire().

◆ swapBufferRelease()

virtual GHOST_TSuccess GHOST_IWindow::swapBufferRelease ( )
pure virtual

Swaps front and back buffers of a window.

Returns
A boolean success indicator.

Implemented in GHOST_Window, GHOST_WindowNULL, and GHOST_WindowWayland.

Referenced by blender::playanim_toscreen_ex(), blender::wm_main_playanim_intern(), and blender::wm_window_swap_buffer_release().


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