|
Blender V5.0
|
#include <GHOST_WindowCocoa.hh>
Inherits GHOST_Window.
Static Public Member Functions | |
| static NSScreen * | getPrimaryScreen () |
Protected Member Functions | |
| GHOST_Context * | newDrawingContext (GHOST_TDrawingContextType type) override |
| GHOST_TSuccess | invalidate () override |
| GHOST_TSuccess | setWindowCursorVisibility (bool visible) override |
| GHOST_TSuccess | setWindowCursorGrab (GHOST_TGrabCursorMode mode) override |
| GHOST_TSuccess | setWindowCursorShape (GHOST_TStandardCursor shape) override |
| GHOST_TSuccess | hasCursorShape (GHOST_TStandardCursor shape) override |
| GHOST_TSuccess | setWindowCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override |
| Protected Member Functions inherited from GHOST_Window | |
| virtual GHOST_TSuccess | setWindowCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator) |
| GHOST_TSuccess | releaseNativeHandles () |
Definition at line 30 of file GHOST_WindowCocoa.hh.
| GHOST_WindowCocoa::GHOST_WindowCocoa | ( | GHOST_SystemCocoa * | systemCocoa, |
| const char * | title, | ||
| int32_t | left, | ||
| int32_t | bottom, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| GHOST_TWindowState | state, | ||
| GHOST_TDrawingContextType | type, | ||
| const GHOST_ContextParams & | context_params, | ||
| bool | dialog, | ||
| GHOST_WindowCocoa * | parent_window, | ||
| const GHOST_GPUDevice & | preferred_device ) |
Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.
| systemCocoa | The associated system class to forward events to. |
| title | The text shown in the title bar of the window. |
| left | The coordinate of the left edge of the window. |
| bottom | The coordinate of the bottom edge of the window. |
| width | The width the window. |
| height | The height the window. |
| state | The state the window is initially opened with. |
| type | The type of drawing context installed in this window. |
| context_params | Parameters to use when initializing the context. |
| preferred_device | Preferred device to use when new device will be created. |
Definition at line 322 of file GHOST_WindowCocoa.mm.
References GHOST_Window::activateDrawingContext(), custom_cursor_, false, GHOST_Window::full_screen_, GHOST_kWindowStateFullScreen, GHOST_TABLET_DATA_NONE, GHOST_Window::GHOST_Window(), GHOST_WindowCocoa(), GHOST_Window::hdr_info_, immediate_draw_, is_dialog_, left, metal_layer_, metal_view_, name, nullptr, opengl_view_, preferred_device_, GHOST_Window::setDrawingContextType(), setNativePixelSize(), setState(), setTitle(), state, system_cocoa_, tablet_, GHOST_Window::updateDrawingContext(), view, and window_.
Referenced by GHOST_WindowCocoa().
|
override |
Destructor. Closes the window and disposes resources allocated.
Definition at line 478 of file GHOST_WindowCocoa.mm.
References custom_cursor_, metal_layer_, metal_view_, opengl_view_, GHOST_Window::releaseNativeHandles(), and window_.
|
overridevirtual |
Apply the window decoration style using the current flags and settings.
Reimplemented from GHOST_Window.
Definition at line 574 of file GHOST_WindowCocoa.mm.
References GHOST_kDecorationColoredTitleBar, GHOST_kSuccess, window_, GHOST_Window::window_decoration_style_flags_, and GHOST_Window::window_decoration_style_settings_.
|
overridevirtual |
Converts a point in client rectangle coordinates to screen coordinates.
| inX | The x-coordinate in the client rectangle. |
| inY | The y-coordinate in the client rectangle. |
| outX | The x-coordinate on the screen. |
| outY | The y-coordinate on the screen. |
Implements GHOST_IWindow.
Definition at line 748 of file GHOST_WindowCocoa.mm.
References clientToScreenIntern(), getClientBounds(), GHOST_Rect::getHeight(), getValid(), and GHOST_ASSERT.
| void GHOST_WindowCocoa::clientToScreenIntern | ( | int32_t | inX, |
| int32_t | inY, | ||
| int32_t & | outX, | ||
| int32_t & | outY ) const |
Converts a point in client rectangle coordinates to screen coordinates. but without the y coordinate conversion needed for ghost compatibility.
| inX | The x-coordinate in the client rectangle. |
| inY | The y-coordinate in the client rectangle. |
| outX | The x-coordinate on the screen. |
| outY | The y-coordinate on the screen. |
Definition at line 777 of file GHOST_WindowCocoa.mm.
Referenced by clientToScreen(), GHOST_SystemCocoa::handleDraggingEvent(), and GHOST_SystemCocoa::handleMouseEvent().
|
overridevirtual |
Hides the progress bar icon
Reimplemented from GHOST_Window.
Definition at line 990 of file GHOST_WindowCocoa.mm.
References GHOST_kFailure, GHOST_kSuccess, and GHOST_Window::progress_bar_visible_.
|
overridevirtual |
Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.
| bounds | The bounding rectangle of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 632 of file GHOST_WindowCocoa.mm.
References bounds(), getValid(), GHOST_ASSERT, and window_.
Referenced by clientToScreen(), GHOST_SystemCocoa::handleMouseEvent(), screenToClient(), setClientHeight(), setClientSize(), setClientWidth(), and setNativePixelSize().
|
inline |
Definition at line 218 of file GHOST_WindowCocoa.hh.
References tablet_.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemCocoa::setCursorPosition().
|
inline |
Definition at line 247 of file GHOST_WindowCocoa.hh.
References immediate_draw_.
|
overridevirtual |
Returns the associated NSWindow object
Reimplemented from GHOST_Window.
Definition at line 528 of file GHOST_WindowCocoa.mm.
References window_.
Referenced by GHOST_SystemCocoa::handleMouseEvent().
|
static |
Return the primary screen, the screen defined as "Main Display" in macOS Settings, source of all screen coordinates.
Definition at line 796 of file GHOST_WindowCocoa.mm.
| NSScreen * GHOST_WindowCocoa::getScreen | ( | ) | const |
Return the screen the window is displayed in.
Definition at line 791 of file GHOST_WindowCocoa.mm.
References window_.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemCocoa::setMouseCursorPosition().
| NSCursor * GHOST_WindowCocoa::getStandardCursor | ( | GHOST_TStandardCursor | cursor | ) | const |
Definition at line 1043 of file GHOST_WindowCocoa.mm.
References NSCursor(Undocumented)::busyButClickableCursor, custom_cursor_, getImageCursor(), GHOST_kStandardCursorBothHandles, GHOST_kStandardCursorBottomSide, GHOST_kStandardCursorCopy, GHOST_kStandardCursorCrosshair, GHOST_kStandardCursorCrosshairA, GHOST_kStandardCursorCrosshairB, GHOST_kStandardCursorCrosshairC, GHOST_kStandardCursorCustom, GHOST_kStandardCursorDefault, GHOST_kStandardCursorDestroy, GHOST_kStandardCursorDownArrow, GHOST_kStandardCursorEraser, GHOST_kStandardCursorEWScroll, GHOST_kStandardCursorEyedropper, GHOST_kStandardCursorHandClosed, GHOST_kStandardCursorHandOpen, GHOST_kStandardCursorHandPoint, GHOST_kStandardCursorHorizontalSplit, GHOST_kStandardCursorKnife, GHOST_kStandardCursorLeftArrow, GHOST_kStandardCursorLeftHandle, GHOST_kStandardCursorLeftRight, GHOST_kStandardCursorLeftSide, GHOST_kStandardCursorMove, GHOST_kStandardCursorNSEWScroll, GHOST_kStandardCursorNSScroll, GHOST_kStandardCursorPencil, GHOST_kStandardCursorRightArrow, GHOST_kStandardCursorRightHandle, GHOST_kStandardCursorRightSide, GHOST_kStandardCursorStop, GHOST_kStandardCursorText, GHOST_kStandardCursorTopSide, GHOST_kStandardCursorUpArrow, GHOST_kStandardCursorUpDown, GHOST_kStandardCursorVerticalSplit, GHOST_kStandardCursorWait, GHOST_kStandardCursorZoomIn, and GHOST_kStandardCursorZoomOut.
Referenced by hasCursorShape(), and loadCursor().
|
overridevirtual |
Returns the state of the window (normal, minimized, maximized).
Implements GHOST_IWindow.
Definition at line 706 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, immediate_draw_, and window_.
|
overridevirtual |
Returns the title displayed in the title bar.
| title | The title displayed in the title bar. |
Implements GHOST_IWindow.
Definition at line 545 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, and window_.
|
overridevirtual |
Returns indication as to whether the window is valid.
Reimplemented from GHOST_Window.
Definition at line 522 of file GHOST_WindowCocoa.mm.
References GHOST_Window::getValid(), metal_view_, opengl_view_, view, and window_.
Referenced by clientToScreen(), getClientBounds(), getState(), getTitle(), getWindowBounds(), invalidate(), screenToClient(), setClientHeight(), setClientSize(), setClientWidth(), setOrder(), setPath(), setState(), and setTitle().
|
inline |
public function to get the window containing the view
Definition at line 237 of file GHOST_WindowCocoa.hh.
References window_.
|
overridevirtual |
Returns the window rectangle dimensions. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
| bounds | The bounding rectangle of the window. |
Implements GHOST_IWindow.
Definition at line 606 of file GHOST_WindowCocoa.mm.
References bounds(), getValid(), GHOST_ASSERT, and window_.
|
overrideprotectedvirtual |
Test if the standard cursor shape is supported by current platform.
Implements GHOST_IWindow.
Definition at line 1223 of file GHOST_WindowCocoa.mm.
References getStandardCursor(), GHOST_kFailure, and GHOST_kSuccess.
|
overrideprotectedvirtual |
Invalidates the contents of this window.
Implements GHOST_IWindow.
Definition at line 937 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, metal_view_, opengl_view_, and view.
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 1164 of file GHOST_WindowCocoa.mm.
References is_dialog_.
Referenced by GHOST_SystemCocoa::handleApplicationBecomeActiveEvent(), and GHOST_SystemCocoa::hasDialogWindow().
| void GHOST_WindowCocoa::loadCursor | ( | bool | visible, |
| GHOST_TStandardCursor | cursor ) const |
Definition at line 1139 of file GHOST_WindowCocoa.mm.
References getStandardCursor(), and GHOST_kStandardCursorDefault.
Referenced by GHOST_SystemCocoa::handleWindowEvent(), setWindowCursorShape(), setWindowCursorVisibility(), and setWindowCustomCursorShape().
|
overrideprotectedvirtual |
| type | The type of rendering context create. |
Implements GHOST_Window.
Definition at line 900 of file GHOST_WindowCocoa.mm.
References GHOST_Window::hdr_info_, metal_layer_, metal_view_, preferred_device_, and GHOST_Window::want_context_params_.
|
overridevirtual |
Converts a point in screen coordinates to client rectangle coordinates
| inX | The x-coordinate on the screen. |
| inY | The y-coordinate on the screen. |
| outX | The x-coordinate in the client rectangle. |
| outY | The y-coordinate in the client rectangle. |
Implements GHOST_IWindow.
Definition at line 733 of file GHOST_WindowCocoa.mm.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_ASSERT, and screenToClientIntern().
Referenced by GHOST_SystemCocoa::handleMouseEvent().
| void GHOST_WindowCocoa::screenToClientIntern | ( | int32_t | inX, |
| int32_t | inY, | ||
| int32_t & | outX, | ||
| int32_t & | outY ) const |
Converts a point in screen coordinates to client rectangle coordinates, but without the y coordinate conversion needed for ghost compatibility.
| inX | The x-coordinate on the screen. |
| inY | The y-coordinate on the screen. |
| outX | The x-coordinate in the client rectangle. |
| outY | The y-coordinate in the client rectangle. |
Definition at line 763 of file GHOST_WindowCocoa.mm.
Referenced by screenToClient().
|
overridevirtual |
Resizes client rectangle height.
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 675 of file GHOST_WindowCocoa.mm.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and size().
|
overridevirtual |
Resizes client rectangle.
| width | The new width of the client area of the window. |
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 691 of file GHOST_WindowCocoa.mm.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and size().
|
overridevirtual |
Resizes client rectangle width.
| width | The new width of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 659 of file GHOST_WindowCocoa.mm.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and size().
|
inline |
Definition at line 243 of file GHOST_WindowCocoa.hh.
References immediate_draw_.
|
overridevirtual |
Sets the window "modified" status, indicating unsaved changes
| is_unsaved_changes | Unsaved changes or not. |
Reimplemented from GHOST_Window.
Definition at line 864 of file GHOST_WindowCocoa.mm.
References GHOST_Window::setModifiedState(), and window_.
| void GHOST_WindowCocoa::setNativePixelSize | ( | ) |
Definition at line 803 of file GHOST_WindowCocoa.mm.
References float, getClientBounds(), GHOST_Rect::getWidth(), metal_view_, GHOST_Window::native_pixel_size_, opengl_view_, and view.
Referenced by GHOST_WindowCocoa(), and GHOST_SystemCocoa::handleWindowEvent().
|
overridevirtual |
Sets the order of the window (bottom, top).
| order | The order of the window. |
Implements GHOST_IWindow.
Definition at line 872 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, and GHOST_kWindowOrderTop.
|
overridevirtual |
Sets the file name represented by this window.
| filepath | The file directory. |
Reimplemented from GHOST_Window.
Definition at line 559 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, and window_.
|
overridevirtual |
Sets the progress bar value displayed in the window/application icon
| progress | The progress percentage (0.0 to 1.0). |
Reimplemented from GHOST_Window.
Definition at line 952 of file GHOST_WindowCocoa.mm.
References GHOST_kSuccess, and GHOST_Window::progress_bar_visible_.
|
overridevirtual |
Sets the state of the window (normal, minimized, maximized).
| state | The state of the window. |
Instead, the menu bar and the dock are hidden, and the window is made border-less and enlarged. Thus, process switch, exposé, spaces, ... still work in full-screen mode.
Implements GHOST_IWindow.
Definition at line 821 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, state, and window_.
Referenced by GHOST_WindowCocoa().
|
overridevirtual |
Sets the title displayed in the title bar.
| title | The title to display in the title bar. |
Implements GHOST_IWindow.
Definition at line 533 of file GHOST_WindowCocoa.mm.
References getValid(), GHOST_ASSERT, and window_.
Referenced by GHOST_WindowCocoa().
|
overrideprotectedvirtual |
Sets the cursor grab on the window using native window system calls.
Reimplemented from GHOST_Window.
Definition at line 1179 of file GHOST_WindowCocoa.mm.
References GHOST_Window::cursor_grab_, GHOST_Window::cursor_grab_bounds_, GHOST_Window::cursor_grab_init_pos_, GHOST_kGrabDisable, GHOST_kGrabHide, GHOST_kGrabNormal, GHOST_kSuccess, GHOST_Window::setCursorGrabAccum(), setWindowCursorVisibility(), and system_cocoa_.
|
overrideprotectedvirtual |
Sets the cursor shape on the window using native window system calls.
Implements GHOST_Window.
Definition at line 1213 of file GHOST_WindowCocoa.mm.
References GHOST_Window::getCursorVisibility(), GHOST_kSuccess, loadCursor(), and window_.
|
overrideprotectedvirtual |
Sets the cursor visibility on the window using native window system calls.
Implements GHOST_Window.
Definition at line 1169 of file GHOST_WindowCocoa.mm.
References GHOST_Window::getCursorShape(), GHOST_kSuccess, loadCursor(), and window_.
Referenced by setWindowCursorGrab().
|
overrideprotectedvirtual |
Sets the cursor shape on the window using native window system calls.
Implements GHOST_Window.
Definition at line 1252 of file GHOST_WindowCocoa.mm.
References custom_cursor_, GHOST_Window::getCursorVisibility(), GHOST_kStandardCursorCustom, GHOST_kSuccess, loadCursor(), mask(), size(), uns16ReverseBits(), window_, and y.
|
protected |
Definition at line 310 of file GHOST_WindowCocoa.hh.
Referenced by getStandardCursor(), GHOST_WindowCocoa(), setWindowCustomCursorShape(), and ~GHOST_WindowCocoa().
|
protected |
Definition at line 314 of file GHOST_WindowCocoa.hh.
Referenced by getImmediateDraw(), getState(), GHOST_WindowCocoa(), and setImmediateDraw().
|
protected |
Definition at line 315 of file GHOST_WindowCocoa.hh.
Referenced by GHOST_WindowCocoa(), and isDialog().
|
protected |
Definition at line 305 of file GHOST_WindowCocoa.hh.
Referenced by GHOST_WindowCocoa(), newDrawingContext(), and ~GHOST_WindowCocoa().
|
protected |
Definition at line 304 of file GHOST_WindowCocoa.hh.
Referenced by getValid(), GHOST_WindowCocoa(), invalidate(), newDrawingContext(), setNativePixelSize(), and ~GHOST_WindowCocoa().
|
protected |
The view, either Metal or OpenGL
Definition at line 303 of file GHOST_WindowCocoa.hh.
Referenced by getValid(), GHOST_WindowCocoa(), invalidate(), setNativePixelSize(), and ~GHOST_WindowCocoa().
|
protected |
Definition at line 316 of file GHOST_WindowCocoa.hh.
Referenced by GHOST_WindowCocoa(), and newDrawingContext().
|
protected |
The mother SystemCocoa class to send events
Definition at line 308 of file GHOST_WindowCocoa.hh.
Referenced by GHOST_WindowCocoa(), and setWindowCursorGrab().
|
protected |
Definition at line 312 of file GHOST_WindowCocoa.hh.
Referenced by GetCocoaTabletData(), and GHOST_WindowCocoa().
|
protected |
The window containing the view
Definition at line 300 of file GHOST_WindowCocoa.hh.
Referenced by applyWindowDecorationStyle(), getClientBounds(), getOSWindow(), getScreen(), getState(), getTitle(), getValid(), getViewWindow(), getWindowBounds(), GHOST_WindowCocoa(), setModifiedState(), setPath(), setState(), setTitle(), setWindowCursorShape(), setWindowCursorVisibility(), setWindowCustomCursorShape(), and ~GHOST_WindowCocoa().