Blender V5.0
GHOST_WindowCocoa Class Reference

#include <GHOST_WindowCocoa.hh>

Inherits GHOST_Window.

Public Member Functions

 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)
 ~GHOST_WindowCocoa () override
bool getValid () const override
void * getOSWindow () const override
void setTitle (const char *title) override
std::string getTitle () const override
GHOST_TSuccess setPath (const char *filepath) override
GHOST_TSuccess applyWindowDecorationStyle () override
void getWindowBounds (GHOST_Rect &bounds) const override
void getClientBounds (GHOST_Rect &bounds) const override
GHOST_TSuccess setClientWidth (uint32_t width) override
GHOST_TSuccess setClientHeight (uint32_t height) override
GHOST_TSuccess setClientSize (uint32_t width, uint32_t height) override
GHOST_TWindowState getState () const override
GHOST_TSuccess setModifiedState (bool is_unsaved_changes) override
void screenToClient (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
void clientToScreen (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
void clientToScreenIntern (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
void screenToClientIntern (int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
NSScreen * getScreen () const
GHOST_TSuccess setState (GHOST_TWindowState state) override
GHOST_TSuccess setOrder (GHOST_TWindowOrder order) override
NSCursor * getStandardCursor (GHOST_TStandardCursor cursor) const
void loadCursor (bool visible, GHOST_TStandardCursor cursor) const
bool isDialog () const override
GHOST_TabletDataGetCocoaTabletData ()
GHOST_TSuccess setProgressBar (float progress) override
GHOST_TSuccess endProgressBar () override
void setNativePixelSize ()
BlenderWindowgetViewWindow () const
void setImmediateDraw (bool value)
bool getImmediateDraw () const
Public Member Functions inherited from GHOST_Window
 GHOST_Window (uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_ContextParams &context_params, const bool exclusive=false)
 ~GHOST_Window () override
virtual GHOST_TWindowDecorationStyleFlags getWindowDecorationStyleFlags () override
virtual void setWindowDecorationStyleFlags (GHOST_TWindowDecorationStyleFlags style_flags) override
virtual void setWindowDecorationStyleSettings (GHOST_WindowDecorationStyleSettings decoration_settings) override
GHOST_TStandardCursor getCursorShape () const override
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursor_shape) override
GHOST_TSuccess setCustomCursorShape (const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override
GHOST_TSuccess setCustomCursorGenerator (GHOST_CursorGenerator *cursor_generator) override
GHOST_TSuccess getCursorBitmap (GHOST_CursorBitmapRef *bitmap) override
bool getCursorVisibility () const override
GHOST_TGrabCursorMode getCursorGrabMode () const
bool getCursorGrabModeIsWarp () const
GHOST_TAxisFlag getCursorGrabAxis () const
void getCursorGrabInitPos (int32_t &x, int32_t &y) const
void getCursorGrabAccum (int32_t &x, int32_t &y) const
void setCursorGrabAccum (int32_t x, int32_t y)
GHOST_TSuccess setCursorVisibility (bool visible) override
GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, GHOST_Rect *bounds, int32_t mouse_ungrab_xy[2]) override
GHOST_TSuccess getCursorGrabBounds (GHOST_Rect &bounds) const override
void getCursorGrabState (GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &wrap_axis, GHOST_Rect &bounds, bool &use_software_cursor) override
bool getCursorGrabUseSoftwareDisplay () override
GHOST_TSuccess setSwapInterval (int interval) override
GHOST_TSuccess getSwapInterval (int &interval_out) override
void setAcceptDragOperation (bool can_accept) override
bool canAcceptDragOperation () const override
bool getModifiedState () override
GHOST_TDrawingContextType getDrawingContextType () override
GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type) override
GHOST_IContextgetDrawingContext () override
GHOST_TSuccess swapBufferAcquire () override
GHOST_TSuccess swapBufferRelease () override
GHOST_TSuccess activateDrawingContext () override
GHOST_TSuccess updateDrawingContext ()
GHOST_ContextgetContext ()
unsigned int getDefaultFramebuffer () override
GHOST_TUserDataPtr getUserData () const override
void setUserData (const GHOST_TUserDataPtr user_data) override
float getNativePixelSize () override
uint16_t getDPIHint () override
GHOST_WindowHDRInfo getHDRInfo () override
Public Member Functions inherited from GHOST_IWindow
virtual ~GHOST_IWindow ()=default

Static Public Member Functions

static NSScreen * getPrimaryScreen ()

Protected Member Functions

GHOST_ContextnewDrawingContext (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 ()

Protected Attributes

BlenderWindowwindow_
CocoaOpenGLView * opengl_view_
CocoaMetalView * metal_view_
CAMetalLayer * metal_layer_
GHOST_SystemCocoasystem_cocoa_
NSCursor * custom_cursor_
GHOST_TabletData tablet_
bool immediate_draw_
bool is_dialog_
GHOST_GPUDevice preferred_device_
Protected Attributes inherited from GHOST_Window
GHOST_TDrawingContextType drawing_context_type_
GHOST_TUserDataPtr user_data_
bool cursor_visible_
GHOST_TGrabCursorMode cursor_grab_
GHOST_TAxisFlag cursor_grab_axis_
int32_t cursor_grab_init_pos_ [2]
int32_t cursor_grab_accum_pos_ [2]
GHOST_Rect cursor_grab_bounds_
GHOST_TStandardCursor cursor_shape_
bool progress_bar_visible_
bool can_accept_drag_operation_
bool is_unsaved_changes_
bool full_screen_
GHOST_TWindowDecorationStyleFlags window_decoration_style_flags_
GHOST_WindowDecorationStyleSettings window_decoration_style_settings_
GHOST_ContextParams want_context_params_
uint32_t full_screen_width_
uint32_t full_screen_height_
float native_pixel_size_
GHOST_WindowHDRInfo hdr_info_ = GHOST_WINDOW_HDR_INFO_NONE

Detailed Description

Definition at line 30 of file GHOST_WindowCocoa.hh.

Constructor & Destructor Documentation

◆ GHOST_WindowCocoa()

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.

Parameters
systemCocoaThe associated system class to forward events to.
titleThe text shown in the title bar of the window.
leftThe coordinate of the left edge of the window.
bottomThe coordinate of the bottom edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state the window is initially opened with.
typeThe type of drawing context installed in this window.
context_paramsParameters to use when initializing the context.
preferred_devicePreferred 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().

◆ ~GHOST_WindowCocoa()

GHOST_WindowCocoa::~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_.

Member Function Documentation

◆ applyWindowDecorationStyle()

GHOST_TSuccess GHOST_WindowCocoa::applyWindowDecorationStyle ( )
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_.

◆ clientToScreen()

void GHOST_WindowCocoa::clientToScreen ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overridevirtual

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.

Implements GHOST_IWindow.

Definition at line 748 of file GHOST_WindowCocoa.mm.

References clientToScreenIntern(), getClientBounds(), GHOST_Rect::getHeight(), getValid(), and GHOST_ASSERT.

◆ clientToScreenIntern()

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.

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.

Definition at line 777 of file GHOST_WindowCocoa.mm.

Referenced by clientToScreen(), GHOST_SystemCocoa::handleDraggingEvent(), and GHOST_SystemCocoa::handleMouseEvent().

◆ endProgressBar()

GHOST_TSuccess GHOST_WindowCocoa::endProgressBar ( )
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_.

◆ getClientBounds()

void GHOST_WindowCocoa::getClientBounds ( GHOST_Rect & bounds) const
overridevirtual

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 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().

◆ GetCocoaTabletData()

GHOST_TabletData & GHOST_WindowCocoa::GetCocoaTabletData ( )
inline

◆ getImmediateDraw()

bool GHOST_WindowCocoa::getImmediateDraw ( ) const
inline

Definition at line 247 of file GHOST_WindowCocoa.hh.

References immediate_draw_.

◆ getOSWindow()

void * GHOST_WindowCocoa::getOSWindow ( ) const
overridevirtual

Returns the associated NSWindow object

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().

◆ getPrimaryScreen()

NSScreen * GHOST_WindowCocoa::getPrimaryScreen ( )
static

Return the primary screen, the screen defined as "Main Display" in macOS Settings, source of all screen coordinates.

Note
This function is placed in WindowCocoa since SystemCocoa cannot include Obj-C types.
Returns
The primary screen NSScreen object

Definition at line 796 of file GHOST_WindowCocoa.mm.

◆ getScreen()

NSScreen * GHOST_WindowCocoa::getScreen ( ) const

Return the screen the window is displayed in.

Returns
The current screen NSScreen object

Definition at line 791 of file GHOST_WindowCocoa.mm.

References window_.

Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemCocoa::setMouseCursorPosition().

◆ getStandardCursor()

NSCursor * GHOST_WindowCocoa::getStandardCursor ( GHOST_TStandardCursor cursor) const

◆ getState()

GHOST_TWindowState GHOST_WindowCocoa::getState ( ) const
overridevirtual

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

Returns
The state of the window.

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

◆ getTitle()

std::string GHOST_WindowCocoa::getTitle ( ) const
overridevirtual

Returns the title displayed in the title bar.

Parameters
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 545 of file GHOST_WindowCocoa.mm.

References getValid(), GHOST_ASSERT, and window_.

◆ getValid()

bool GHOST_WindowCocoa::getValid ( ) const
overridevirtual

Returns indication as to whether the window is valid.

Returns
The validity of the window.

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().

◆ getViewWindow()

BlenderWindow * GHOST_WindowCocoa::getViewWindow ( ) const
inline

public function to get the window containing the view

Definition at line 237 of file GHOST_WindowCocoa.hh.

References window_.

◆ getWindowBounds()

void GHOST_WindowCocoa::getWindowBounds ( GHOST_Rect & bounds) const
overridevirtual

Returns the window rectangle dimensions. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

Parameters
boundsThe bounding rectangle of the window.

Implements GHOST_IWindow.

Definition at line 606 of file GHOST_WindowCocoa.mm.

References bounds(), getValid(), GHOST_ASSERT, and window_.

◆ hasCursorShape()

GHOST_TSuccess GHOST_WindowCocoa::hasCursorShape ( GHOST_TStandardCursor cursor_shape)
overrideprotectedvirtual

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

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 1223 of file GHOST_WindowCocoa.mm.

References getStandardCursor(), GHOST_kFailure, and GHOST_kSuccess.

◆ invalidate()

GHOST_TSuccess GHOST_WindowCocoa::invalidate ( )
overrideprotectedvirtual

Invalidates the contents of this window.

Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 937 of file GHOST_WindowCocoa.mm.

References getValid(), GHOST_ASSERT, GHOST_kSuccess, metal_view_, opengl_view_, and view.

◆ isDialog()

bool GHOST_WindowCocoa::isDialog ( ) const
overridevirtual

◆ loadCursor()

void GHOST_WindowCocoa::loadCursor ( bool visible,
GHOST_TStandardCursor cursor ) const

◆ newDrawingContext()

GHOST_Context * GHOST_WindowCocoa::newDrawingContext ( GHOST_TDrawingContextType type)
overrideprotectedvirtual
Parameters
typeThe type of rendering context create.
Returns
Indication of success.

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

◆ screenToClient()

void GHOST_WindowCocoa::screenToClient ( int32_t inX,
int32_t inY,
int32_t & outX,
int32_t & outY ) const
overridevirtual

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 733 of file GHOST_WindowCocoa.mm.

References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_ASSERT, and screenToClientIntern().

Referenced by GHOST_SystemCocoa::handleMouseEvent().

◆ screenToClientIntern()

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.

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.

Definition at line 763 of file GHOST_WindowCocoa.mm.

Referenced by screenToClient().

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowCocoa::setClientHeight ( uint32_t height)
overridevirtual

Resizes client rectangle height.

Parameters
heightThe 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().

◆ setClientSize()

GHOST_TSuccess GHOST_WindowCocoa::setClientSize ( uint32_t width,
uint32_t height )
overridevirtual

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 691 of file GHOST_WindowCocoa.mm.

References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and size().

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowCocoa::setClientWidth ( uint32_t width)
overridevirtual

Resizes client rectangle width.

Parameters
widthThe 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().

◆ setImmediateDraw()

void GHOST_WindowCocoa::setImmediateDraw ( bool value)
inline

Definition at line 243 of file GHOST_WindowCocoa.hh.

References immediate_draw_.

◆ setModifiedState()

GHOST_TSuccess GHOST_WindowCocoa::setModifiedState ( bool is_unsaved_changes)
overridevirtual

Sets the window "modified" status, indicating unsaved changes

Parameters
is_unsaved_changesUnsaved changes or not.
Returns
Indication of success.

Reimplemented from GHOST_Window.

Definition at line 864 of file GHOST_WindowCocoa.mm.

References GHOST_Window::setModifiedState(), and window_.

◆ setNativePixelSize()

void GHOST_WindowCocoa::setNativePixelSize ( )

◆ setOrder()

GHOST_TSuccess GHOST_WindowCocoa::setOrder ( GHOST_TWindowOrder order)
overridevirtual

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

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

Implements GHOST_IWindow.

Definition at line 872 of file GHOST_WindowCocoa.mm.

References getValid(), GHOST_ASSERT, GHOST_kSuccess, and GHOST_kWindowOrderTop.

◆ setPath()

GHOST_TSuccess GHOST_WindowCocoa::setPath ( const char * filepath)
overridevirtual

Sets the file name represented by this window.

Parameters
filepathThe file directory.

Reimplemented from GHOST_Window.

Definition at line 559 of file GHOST_WindowCocoa.mm.

References getValid(), GHOST_ASSERT, GHOST_kSuccess, and window_.

◆ setProgressBar()

GHOST_TSuccess GHOST_WindowCocoa::setProgressBar ( float progress)
overridevirtual

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

Parameters
progressThe 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_.

◆ setState()

GHOST_TSuccess GHOST_WindowCocoa::setState ( GHOST_TWindowState state)
overridevirtual

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

Parameters
stateThe state of the window.
Returns
Indication of success.
Note
Full-screen switch is not actual full-screen with display capture. As this capture removes all OS X window manager features.

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().

◆ setTitle()

void GHOST_WindowCocoa::setTitle ( const char * title)
overridevirtual

Sets the title displayed in the title bar.

Parameters
titleThe 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().

◆ setWindowCursorGrab()

GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorGrab ( GHOST_TGrabCursorMode mode)
overrideprotectedvirtual

◆ setWindowCursorShape()

GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorShape ( GHOST_TStandardCursor shape)
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_.

◆ setWindowCursorVisibility()

GHOST_TSuccess GHOST_WindowCocoa::setWindowCursorVisibility ( bool visible)
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().

◆ setWindowCustomCursorShape()

GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape ( const uint8_t * bitmap,
const uint8_t * mask,
const int size[2],
const int hot_spot[2],
bool can_invert_color )
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.

Member Data Documentation

◆ custom_cursor_

NSCursor* GHOST_WindowCocoa::custom_cursor_
protected

◆ immediate_draw_

bool GHOST_WindowCocoa::immediate_draw_
protected

◆ is_dialog_

bool GHOST_WindowCocoa::is_dialog_
protected

Definition at line 315 of file GHOST_WindowCocoa.hh.

Referenced by GHOST_WindowCocoa(), and isDialog().

◆ metal_layer_

CAMetalLayer* GHOST_WindowCocoa::metal_layer_
protected

Definition at line 305 of file GHOST_WindowCocoa.hh.

Referenced by GHOST_WindowCocoa(), newDrawingContext(), and ~GHOST_WindowCocoa().

◆ metal_view_

CocoaMetalView* GHOST_WindowCocoa::metal_view_
protected

◆ opengl_view_

CocoaOpenGLView* GHOST_WindowCocoa::opengl_view_
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().

◆ preferred_device_

GHOST_GPUDevice GHOST_WindowCocoa::preferred_device_
protected

Definition at line 316 of file GHOST_WindowCocoa.hh.

Referenced by GHOST_WindowCocoa(), and newDrawingContext().

◆ system_cocoa_

GHOST_SystemCocoa* GHOST_WindowCocoa::system_cocoa_
protected

The mother SystemCocoa class to send events

Definition at line 308 of file GHOST_WindowCocoa.hh.

Referenced by GHOST_WindowCocoa(), and setWindowCursorGrab().

◆ tablet_

GHOST_TabletData GHOST_WindowCocoa::tablet_
protected

Definition at line 312 of file GHOST_WindowCocoa.hh.

Referenced by GetCocoaTabletData(), and GHOST_WindowCocoa().

◆ window_


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