Blender V4.3
GHOST_SystemCocoa.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#ifndef __APPLE__
13# error Apple OSX only!
14#endif // __APPLE__
15
16// #define __CARBONSOUND__
17
18#include "GHOST_System.hh"
19
21class GHOST_EventKey;
22class GHOST_EventWindow;
24
26 public:
31
35 ~GHOST_SystemCocoa() override;
36
37 /***************************************************************************************
38 * Time(r) functionality.
39 ***************************************************************************************/
40
47 uint64_t getMilliSeconds() const override;
48
49 /***************************************************************************************
50 * Display/window management functionality.
51 ***************************************************************************************/
52
57 uint8_t getNumDisplays() const override;
58
63 void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
64
68 void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
69
86 GHOST_IWindow *createWindow(const char *title,
87 int32_t left,
88 int32_t top,
89 uint32_t width,
90 uint32_t height,
92 GHOST_GPUSettings gpuSettings,
93 const bool exclusive = false,
94 const bool is_dialog = false,
95 const GHOST_IWindow *parentWindow = nullptr) override;
96
103
110
118
119 /***************************************************************************************
120 * Event management functionality.
121 ***************************************************************************************/
122
128 bool processEvents(bool waitForEvent) override;
129
134 void handleQuitRequest();
135
140 bool handleOpenDocumentRequest(void *filepathStr);
141
153 GHOST_TDragnDropTypes draggedObjectType,
154 GHOST_WindowCocoa *window,
155 int mouseX,
156 int mouseY,
157 void *data);
158
159 /***************************************************************************************
160 * Cursor management functionality.
161 ***************************************************************************************/
162
169 GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override;
170
178
184 GHOST_TSuccess getPixelAtCursor(float r_color[3]) const override;
185
186 /***************************************************************************************
187 * Access to mouse button and keyboard states.
188 ***************************************************************************************/
189
196
202 GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
203
204 GHOST_TCapabilityFlag getCapabilities() const override;
205
206 /***************************************************************************************
207 * Clipboard get / set.
208 ***************************************************************************************/
209
215 char *getClipboard(bool selection) const override;
216
222 void putClipboard(const char *buffer, bool selection) const override;
223
227 GHOST_TSuccess hasClipboardImage() const override;
228
235 uint *getClipboardImage(int *r_width, int *r_height) const override;
236
243 GHOST_TSuccess putClipboardImage(uint *rgba, int width, int height) const override;
244
252
258
262 bool hasDialogWindow();
263
268
273 {
274 return false;
275 }
276
285 GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
286 bool handleTabletEvent(void *eventPtr);
287
293 GHOST_TSuccess handleMouseEvent(void *eventPtr);
294
300 GHOST_TSuccess handleKeyEvent(void *eventPtr);
301
311 GHOST_TSuccess showMessageBox(const char *title,
312 const char *message,
313 const char *help_label,
314 const char *continue_label,
315 const char *link,
316 GHOST_DialogOptions dialog_options) const override;
317
318 protected:
324 GHOST_TSuccess init() override;
325
333
337
341
344
347
355};
unsigned int uint
GHOST_TWindowState
GHOST_TEventType
GHOST_TCapabilityFlag
Definition GHOST_Types.h:96
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_TDragnDropTypes
GHOST_TConsoleWindowState
GHOST_DialogOptions
Definition GHOST_Types.h:80
bool processEvents(bool waitForEvent) override
uint * getClipboardImage(int *r_width, int *r_height) const override
GHOST_TSuccess disposeContext(GHOST_IContext *context) override
void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override
GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa *window)
GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_WindowCocoa *window, int mouseX, int mouseY, void *data)
bool m_needDelayedApplicationBecomeActiveEventProcessing
GHOST_TSuccess handleApplicationBecomeActiveEvent()
GHOST_TSuccess hasClipboardImage() const override
GHOST_TSuccess handleMouseEvent(void *eventPtr)
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const override
GHOST_IWindow * createWindow(const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_GPUSettings gpuSettings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parentWindow=nullptr) override
GHOST_TSuccess handleKeyEvent(void *eventPtr)
GHOST_TSuccess init() override
GHOST_TSuccess getPixelAtCursor(float r_color[3]) const override
uint64_t getMilliSeconds() const override
GHOST_TCapabilityFlag getCapabilities() const override
bool setConsoleWindowState(GHOST_TConsoleWindowState) override
GHOST_TSuccess showMessageBox(const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options) const override
uint8_t getNumDisplays() const override
void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override
GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType)
bool handleOpenDocumentRequest(void *filepathStr)
GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) override
char * getClipboard(bool selection) const override
GHOST_TSuccess setMouseCursorPosition(int32_t x, int32_t y)
void putClipboard(const char *buffer, bool selection) const override
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override
GHOST_IWindow * getWindowUnderCursor(int32_t x, int32_t y) override
GHOST_IContext * createOffscreenContext(GHOST_GPUSettings gpuSettings) override
GHOST_TSuccess putClipboardImage(uint *rgba, int width, int height) const override
static ulong state[N]
unsigned int uint32_t
Definition stdint.h:80
signed int int32_t
Definition stdint.h:77
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90