|
Blender V4.3
|
#include <GHOST_Window.hh>
Inherits GHOST_IWindow.
Inherited by GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.
Protected Member Functions | |
| virtual GHOST_Context * | newDrawingContext (GHOST_TDrawingContextType type)=0 |
| virtual GHOST_TSuccess | setWindowCursorVisibility (bool visible)=0 |
| virtual GHOST_TSuccess | setWindowCursorGrab (GHOST_TGrabCursorMode) |
| virtual GHOST_TSuccess | setWindowCursorShape (GHOST_TStandardCursor shape)=0 |
| virtual GHOST_TSuccess | setWindowCustomCursorShape (uint8_t *bitmap, uint8_t *mask, int szx, int szy, int hotX, int hotY, bool canInvertColor)=0 |
| GHOST_TSuccess | releaseNativeHandles () |
Platform independent implementation of GHOST_IWindow. Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. Implements part of the GHOST_IWindow interface and adds some methods to be implemented by sub-classes of this class.
Definition at line 23 of file GHOST_Window.hh.
| GHOST_Window::GHOST_Window | ( | uint32_t | width, |
| uint32_t | height, | ||
| GHOST_TWindowState | state, | ||
| const bool | wantStereoVisual = false, | ||
| const bool | exclusive = false ) |
Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.
| width | The width of the window. |
| height | The height of the window. |
| state | The state the window is initially opened with. |
| wantStereoVisual | Stereo visual for quad buffered stereo. |
| exclusive | Use to show the window on top and ignore others (used full-screen). |
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 19 of file GHOST_Window.cc.
References GHOST_kWindowStateFullScreen, m_fullScreen, m_fullScreenHeight, m_fullScreenWidth, and state.
|
virtual |
implementation. virtual bool getValid() const = 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(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 GHOST_TWindowState getState() const = 0; virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0; virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0; virtual GHOST_TSuccess swapBuffers() = 0; virtual GHOST_TSuccess setSwapInterval() = 0; virtual GHOST_TSuccess getSwapInterval(int& intervalOut) = 0; virtual GHOST_TSuccess activateDrawingContext() = 0; virtual GHOST_TSuccess invalidate() = 0; Destructor. Closes the window and disposes resources allocated.
Definition at line 48 of file GHOST_Window.cc.
|
overridevirtual |
Activates the drawing context of this window.
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowNULL.
Definition at line 117 of file GHOST_Window.cc.
References GHOST_Context::activateDrawingContext().
Referenced by GHOST_WindowCocoa::GHOST_WindowCocoa().
|
overridevirtual |
Returns acceptance of the dropped object Usually called by the "object dropped" event handling function
Implements GHOST_IWindow.
Definition at line 240 of file GHOST_Window.cc.
References m_canAcceptDragOperation.
Referenced by GHOST_DropTargetWin32::DragOver(), and GHOST_DropTargetWin32::Drop().
|
inlineoverridevirtual |
Hides the progress bar in the icon
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 184 of file GHOST_Window.hh.
References GHOST_kFailure.
| GHOST_Context * GHOST_Window::getContext | ( | ) |
Get the drawing context associated with this window.
Definition at line 100 of file GHOST_Window.cc.
Referenced by blender::gpu::MTLContext::MTLContext().
|
overridevirtual |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowWayland.
Definition at line 229 of file GHOST_Window.cc.
References GHOST_kFailure.
Definition at line 459 of file GHOST_Window.hh.
References m_cursorGrabAccumPos.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemWin32::processCursorEvent().
|
inline |
Definition at line 448 of file GHOST_Window.hh.
References m_cursorGrabAxis.
Referenced by getCursorPositionClientRelative_impl(), GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemWin32::processCursorEvent().
|
overridevirtual |
Gets the cursor grab region, if unset the window is used. reset when grab is disabled.
Implements GHOST_IWindow.
Definition at line 174 of file GHOST_Window.cc.
References bounds(), GHOST_kFailure, GHOST_kGrabHide, GHOST_kGrabWrap, GHOST_kSuccess, m_cursorGrab, and m_cursorGrabBounds.
Referenced by getCursorPositionClientRelative_impl(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemWin32::processCursorEvent(), and GHOST_WindowWayland::setWindowCursorGrab().
Definition at line 453 of file GHOST_Window.hh.
References m_cursorGrabInitPos.
Referenced by GHOST_SystemCocoa::handleMouseEvent().
|
inline |
Definition at line 438 of file GHOST_Window.hh.
References m_cursorGrab.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemWin32::processCursorEvent().
|
inline |
Definition at line 443 of file GHOST_Window.hh.
References GHOST_kGrabHide, GHOST_kGrabWrap, and m_cursorGrab.
Referenced by getCursorPositionClientRelative_impl(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), and GHOST_SystemWin32::processCursorEvent().
|
overridevirtual |
Implements GHOST_IWindow.
Definition at line 183 of file GHOST_Window.cc.
References bounds(), getCursorGrabUseSoftwareDisplay(), GHOST_kAxisNone, GHOST_kGrabDisable, GHOST_kGrabWrap, m_cursorGrab, m_cursorGrabAxis, and m_cursorGrabBounds.
|
overridevirtual |
Return true when a software cursor should be used.
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowWayland.
Definition at line 204 of file GHOST_Window.cc.
Referenced by getCursorGrabState().
|
inlineoverridevirtual |
Returns the current cursor shape.
Implements GHOST_IWindow.
Definition at line 471 of file GHOST_Window.hh.
References m_cursorShape.
Referenced by gwl_window_pending_actions_handle(), GHOST_SystemCocoa::handleWindowEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_WindowCocoa::setWindowCursorVisibility(), and GHOST_WindowX11::setWindowCursorVisibility().
|
inlineoverridevirtual |
Returns the visibility state of the cursor.
Implements GHOST_IWindow.
Definition at line 433 of file GHOST_Window.hh.
References m_cursorVisible.
Referenced by GHOST_SystemCocoa::handleWindowEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_WindowCocoa::setWindowCursorShape(), and GHOST_WindowCocoa::setWindowCustomCursorShape().
|
overridevirtual |
Gets the OpenGL frame-buffer associated with the window's contents.
Implements GHOST_IWindow.
Definition at line 105 of file GHOST_Window.cc.
References GHOST_Context::getDefaultFramebuffer().
|
inlineoverridevirtual |
Returns the recommended DPI for this window.
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 313 of file GHOST_Window.hh.
|
overridevirtual |
Returns the drawing context used in this window.
Implements GHOST_IWindow.
Definition at line 80 of file GHOST_Window.cc.
|
inlineoverridevirtual |
Returns the type of drawing context used in this window.
Implements GHOST_IWindow.
Definition at line 428 of file GHOST_Window.hh.
References m_drawingContextType.
|
overridevirtual |
Gets the window "modified" status, indicating unsaved changes
Implements GHOST_IWindow.
Definition at line 252 of file GHOST_Window.cc.
References m_isUnsavedChanges.
|
inlineoverridevirtual |
Implements GHOST_IWindow.
Definition at line 301 of file GHOST_Window.hh.
References m_nativePixelSize.
|
overridevirtual |
Returns the associated OS object/handle
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, and GHOST_WindowWin32.
Definition at line 53 of file GHOST_Window.cc.
|
overridevirtual |
Gets the current swap interval for swapBuffers.
Implements GHOST_IWindow.
Definition at line 95 of file GHOST_Window.cc.
References GHOST_Context::getSwapInterval().
|
inlineoverridevirtual |
Returns the window user data.
Implements GHOST_IWindow.
Definition at line 287 of file GHOST_Window.hh.
References m_userData.
|
inlineoverridevirtual |
Returns indication as to whether the window is valid.
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 76 of file GHOST_Window.hh.
Referenced by GHOST_WindowCocoa::getValid(), GHOST_WindowSDL::getValid(), GHOST_WindowWayland::getValid(), GHOST_WindowWin32::getValid(), and GHOST_WindowX11::getValid().
|
inlineoverridevirtual |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, GHOST_WindowWayland, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 98 of file GHOST_Window.hh.
|
protectedpure virtual |
Tries to install a rendering context in this window.
| type | The type of rendering context installed. |
Implemented in GHOST_WindowCocoa, GHOST_WindowSDL, and GHOST_WindowX11.
Referenced by setDrawingContextType().
|
protected |
Definition at line 127 of file GHOST_Window.cc.
References GHOST_Context::releaseNativeHandles().
Referenced by GHOST_WindowCocoa::~GHOST_WindowCocoa(), GHOST_WindowSDL::~GHOST_WindowSDL(), GHOST_WindowWayland::~GHOST_WindowWayland(), GHOST_WindowWin32::~GHOST_WindowWin32(), and GHOST_WindowX11::~GHOST_WindowX11().
|
overridevirtual |
Tells if the ongoing drag & drop object can be accepted upon mouse drop.
Implements GHOST_IWindow.
Definition at line 235 of file GHOST_Window.cc.
References m_canAcceptDragOperation.
Referenced by GHOST_DropTargetWin32::DragEnter().
|
overridevirtual |
Sets the cursor grab.
| mode | The new grab state of the cursor. |
Reimplemented from GHOST_IWindow.
Definition at line 141 of file GHOST_Window.cc.
References bounds(), GHOST_IWindow::getClientBounds(), GHOST_kFailure, GHOST_kGrabDisable, GHOST_kSuccess, m_cursorGrab, m_cursorGrabAxis, m_cursorGrabBounds, m_cursorGrabInitPos, GHOST_Rect::m_l, GHOST_Rect::m_r, and setWindowCursorGrab().
Definition at line 465 of file GHOST_Window.hh.
References m_cursorGrabAccumPos, x, and y.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemWin32::processCursorEvent(), GHOST_WindowCocoa::setWindowCursorGrab(), and GHOST_WindowX11::setWindowCursorGrab().
|
overridevirtual |
Set the shape of the cursor.
| cursorShape | The new cursor shape type id. |
Implements GHOST_IWindow.
Definition at line 210 of file GHOST_Window.cc.
References GHOST_kFailure, GHOST_kSuccess, m_cursorShape, and setWindowCursorShape().
|
overridevirtual |
Shows or hides the cursor.
| visible | The new visibility state of the cursor. |
Implements GHOST_IWindow.
Definition at line 132 of file GHOST_Window.cc.
References GHOST_kFailure, GHOST_kSuccess, m_cursorVisible, and setWindowCursorVisibility().
|
overridevirtual |
Set the shape of the cursor to a custom cursor.
| bitmap | The bitmap data for the cursor. |
| mask | The mask data for the cursor. |
| hotX | The X coordinate of the cursor hot-spot. |
| hotY | The Y coordinate of the cursor hot-spot. |
Implements GHOST_IWindow.
Definition at line 219 of file GHOST_Window.cc.
References GHOST_kFailure, GHOST_kStandardCursorCustom, GHOST_kSuccess, m_cursorShape, and setWindowCustomCursorShape().
|
overridevirtual |
Tries to install a rendering context in this window. Child classes do not need to overload this method, They should overload newDrawingContext instead.
| type | The type of rendering context installed. |
Implements GHOST_IWindow.
Definition at line 58 of file GHOST_Window.cc.
References GHOST_kDrawingContextTypeNone, GHOST_kFailure, GHOST_kSuccess, m_drawingContextType, m_wantStereoVisual, and newDrawingContext().
Referenced by GHOST_WindowCocoa::GHOST_WindowCocoa(), GHOST_WindowSDL::GHOST_WindowSDL(), GHOST_WindowWayland::GHOST_WindowWayland(), GHOST_WindowWin32::GHOST_WindowWin32(), and GHOST_WindowX11::GHOST_WindowX11().
|
overridevirtual |
Sets the window "modified" status, indicating unsaved changes
| isUnsavedChanges | Unsaved changes or not. |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa.
Definition at line 245 of file GHOST_Window.cc.
References GHOST_kSuccess, and m_isUnsavedChanges.
Referenced by GHOST_WindowCocoa::setModifiedState().
|
inlineoverridevirtual |
Sets the file name represented by this window.
| filepath | The file directory. |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, and GHOST_WindowNULL.
Definition at line 87 of file GHOST_Window.hh.
References GHOST_kFailure.
|
inlineoverridevirtual |
Sets the progress bar value displayed in the window/application icon
| progress | The progress percentage (0.0 to 1.0). |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowCocoa, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 176 of file GHOST_Window.hh.
References GHOST_kFailure.
|
overridevirtual |
Sets the swap interval for swapBuffers.
| interval | The swap interval to use. |
Implements GHOST_IWindow.
Definition at line 90 of file GHOST_Window.cc.
References GHOST_Context::setSwapInterval().
Referenced by GHOST_WindowWayland::GHOST_WindowWayland().
|
inlineoverridevirtual |
Changes the window user data.
| userData | The window user data. |
Implements GHOST_IWindow.
Definition at line 296 of file GHOST_Window.hh.
References m_userData.
|
inlineprotectedvirtual |
Sets the cursor grab on the window using native window system calls.
Reimplemented in GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, and GHOST_WindowX11.
Definition at line 349 of file GHOST_Window.hh.
References GHOST_kSuccess.
Referenced by setCursorGrab().
|
protectedpure virtual |
Sets the cursor shape on the window using native window system calls.
Implemented in GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, and GHOST_WindowX11.
Referenced by setCursorShape().
|
protectedpure virtual |
Sets the cursor visibility on the window using native window system calls.
Implemented in GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, and GHOST_WindowX11.
Referenced by setCursorVisibility().
|
protectedpure virtual |
Sets the cursor shape on the window using native window system calls.
Implemented in GHOST_WindowCocoa, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWayland, and GHOST_WindowX11.
Referenced by setCustomCursorShape().
|
overridevirtual |
Swaps front and back buffers of a window.
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowNULL, and GHOST_WindowWayland.
Definition at line 85 of file GHOST_Window.cc.
References GHOST_Context::swapBuffers().
Referenced by GHOST_WindowWayland::swapBuffers().
| GHOST_TSuccess GHOST_Window::updateDrawingContext | ( | ) |
Updates the drawing context of this window. Needed whenever the window is changed.
Definition at line 122 of file GHOST_Window.cc.
References GHOST_Context::updateDrawingContext().
Referenced by GHOST_WindowCocoa::GHOST_WindowCocoa(), and GHOST_SystemCocoa::handleWindowEvent().
|
protected |
The acceptance of the "drop candidate" of the current drag & drop operation.
Definition at line 405 of file GHOST_Window.hh.
Referenced by canAcceptDragOperation(), and setAcceptDragOperation().
|
protected |
The current grabbed state of the cursor
Definition at line 384 of file GHOST_Window.hh.
Referenced by getCursorGrabBounds(), getCursorGrabMode(), getCursorGrabModeIsWarp(), getCursorGrabState(), GHOST_WindowWayland::getCursorGrabUseSoftwareDisplay(), setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), GHOST_WindowWayland::setWindowCursorGrab(), and GHOST_WindowX11::setWindowCursorGrab().
|
protected |
Accumulated offset from m_cursorGrabInitPos.
Definition at line 393 of file GHOST_Window.hh.
Referenced by getCursorGrabAccum(), and setCursorGrabAccum().
|
protected |
Grab cursor axis.
Definition at line 387 of file GHOST_Window.hh.
Referenced by getCursorGrabAxis(), getCursorGrabState(), setCursorGrab(), and GHOST_WindowWayland::setWindowCursorGrab().
|
protected |
Wrap the cursor within this region.
Definition at line 396 of file GHOST_Window.hh.
Referenced by getCursorGrabBounds(), getCursorGrabState(), setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), and GHOST_WindowX11::setWindowCursorGrab().
|
protected |
Initial grab location.
Definition at line 390 of file GHOST_Window.hh.
Referenced by getCursorGrabInitPos(), setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), GHOST_WindowWayland::setWindowCursorGrab(), and GHOST_WindowX11::setWindowCursorGrab().
|
protected |
The current shape of the cursor
Definition at line 399 of file GHOST_Window.hh.
Referenced by GHOST_WindowWayland::cursor_shape_refresh(), getCursorShape(), setCursorShape(), setCustomCursorShape(), GHOST_WindowWayland::setWindowCursorShape(), and GHOST_WindowWayland::setWindowCustomCursorShape().
|
protected |
The current visibility of the cursor
Definition at line 381 of file GHOST_Window.hh.
Referenced by getCursorVisibility(), and setCursorVisibility().
|
protected |
The drawing context installed in this window.
Definition at line 375 of file GHOST_Window.hh.
Referenced by getDrawingContextType(), and setDrawingContextType().
|
protected |
Stores whether this is a full screen window.
Definition at line 411 of file GHOST_Window.hh.
Referenced by GHOST_Window(), and GHOST_WindowCocoa::GHOST_WindowCocoa().
|
protected |
|
protected |
|
protected |
Modified state : are there unsaved changes
Definition at line 408 of file GHOST_Window.hh.
Referenced by getModifiedState(), and setModifiedState().
|
protected |
Definition at line 422 of file GHOST_Window.hh.
Referenced by getNativePixelSize(), and GHOST_WindowCocoa::setNativePixelSize().
|
protected |
The presence of progress indicator with the application icon
Definition at line 402 of file GHOST_Window.hh.
Referenced by GHOST_WindowCocoa::endProgressBar(), and GHOST_WindowCocoa::setProgressBar().
|
protected |
The window user data
Definition at line 378 of file GHOST_Window.hh.
Referenced by getUserData(), and setUserData().
|
protected |
Whether to attempt to initialize a context with a stereo frame-buffer.
Definition at line 414 of file GHOST_Window.hh.
Referenced by GHOST_WindowCocoa::newDrawingContext(), GHOST_WindowSDL::newDrawingContext(), GHOST_WindowX11::newDrawingContext(), and setDrawingContextType().