Blender V4.3
GHOST_SystemCocoa.mm File Reference
#include "GHOST_SystemCocoa.hh"
#include "GHOST_DisplayManagerCocoa.hh"
#include "GHOST_EventButton.hh"
#include "GHOST_EventCursor.hh"
#include "GHOST_EventDragnDrop.hh"
#include "GHOST_EventKey.hh"
#include "GHOST_EventString.hh"
#include "GHOST_EventTrackpad.hh"
#include "GHOST_EventWheel.hh"
#include "GHOST_TimerManager.hh"
#include "GHOST_TimerTask.hh"
#include "GHOST_WindowCocoa.hh"
#include "GHOST_WindowManager.hh"
#include "AssertMacros.h"
import <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <mach/mach_time.h>

Go to the source code of this file.

Classes

class  CocoaAppDelegate
 

Macros

#define FIRSTFILEBUFLG   512
 

Functions

static GHOST_TButton convertButton (int button)
 
static GHOST_TKey convertKey (int rawCode, unichar recvChar)
 
int GHOST_HACK_getFirstFile (char buf[FIRSTFILEBUFLG])
 
static NSSize getNSImagePixelSize (NSImage *image)
 
static ImBufNSImageToImBuf (NSImage *image)
 
static NSURL * NSPasteboardGetImageFile ()
 

Variables

static bool g_hasFirstFile = false
 
static char g_firstFileBuf [FIRSTFILEBUFLG]
 
 __pad0__
 

Macro Definition Documentation

◆ FIRSTFILEBUFLG

#define FIRSTFILEBUFLG   512

Definition at line 342 of file GHOST_SystemCocoa.mm.

Referenced by GHOST_HACK_getFirstFile().

Function Documentation

◆ convertButton()

◆ convertKey()

static GHOST_TKey convertKey ( int rawCode,
unichar recvChar )
static

Converts Mac raw-key codes (same for Cocoa & Carbon) into GHOST key codes

Parameters
rawCodeThe raw physical key code
recvCharthe character ignoring modifiers (except for shift)
Returns
Ghost key code

Definition at line 84 of file GHOST_SystemCocoa.mm.

References GHOST_kKey0, GHOST_kKey1, GHOST_kKey2, GHOST_kKey3, GHOST_kKey4, GHOST_kKey5, GHOST_kKey6, GHOST_kKey7, GHOST_kKey8, GHOST_kKey9, GHOST_kKeyA, GHOST_kKeyAccentGrave, GHOST_kKeyB, GHOST_kKeyBackslash, GHOST_kKeyBackSpace, GHOST_kKeyC, GHOST_kKeyComma, GHOST_kKeyD, GHOST_kKeyDelete, GHOST_kKeyDownArrow, GHOST_kKeyDownPage, GHOST_kKeyE, GHOST_kKeyEnd, GHOST_kKeyEnter, GHOST_kKeyEqual, GHOST_kKeyEsc, GHOST_kKeyF, GHOST_kKeyF1, GHOST_kKeyF10, GHOST_kKeyF11, GHOST_kKeyF12, GHOST_kKeyF13, GHOST_kKeyF14, GHOST_kKeyF15, GHOST_kKeyF16, GHOST_kKeyF17, GHOST_kKeyF18, GHOST_kKeyF19, GHOST_kKeyF2, GHOST_kKeyF20, GHOST_kKeyF3, GHOST_kKeyF4, GHOST_kKeyF5, GHOST_kKeyF6, GHOST_kKeyF7, GHOST_kKeyF8, GHOST_kKeyF9, GHOST_kKeyG, GHOST_kKeyH, GHOST_kKeyHome, GHOST_kKeyI, GHOST_kKeyJ, GHOST_kKeyK, GHOST_kKeyL, GHOST_kKeyLeftArrow, GHOST_kKeyLeftBracket, GHOST_kKeyM, GHOST_kKeyMinus, GHOST_kKeyN, GHOST_kKeyNumpad0, GHOST_kKeyNumpad1, GHOST_kKeyNumpad2, GHOST_kKeyNumpad3, GHOST_kKeyNumpad4, GHOST_kKeyNumpad5, GHOST_kKeyNumpad6, GHOST_kKeyNumpad7, GHOST_kKeyNumpad8, GHOST_kKeyNumpad9, GHOST_kKeyNumpadAsterisk, GHOST_kKeyNumpadEnter, GHOST_kKeyNumpadMinus, GHOST_kKeyNumpadPeriod, GHOST_kKeyNumpadPlus, GHOST_kKeyNumpadSlash, GHOST_kKeyO, GHOST_kKeyP, GHOST_kKeyPeriod, GHOST_kKeyPlus, GHOST_kKeyQ, GHOST_kKeyQuote, GHOST_kKeyR, GHOST_kKeyRightArrow, GHOST_kKeyRightBracket, GHOST_kKeyS, GHOST_kKeySemicolon, GHOST_kKeySlash, GHOST_kKeySpace, GHOST_kKeyT, GHOST_kKeyTab, GHOST_kKeyU, GHOST_kKeyUnknown, GHOST_kKeyUpArrow, GHOST_kKeyUpPage, GHOST_kKeyV, GHOST_kKeyW, GHOST_kKeyX, GHOST_kKeyY, and GHOST_kKeyZ.

Referenced by GHOST_SystemCocoa::handleKeyEvent().

◆ getNSImagePixelSize()

static NSSize getNSImagePixelSize ( NSImage * image)
static

Get the true pixel size of an NSImage object.

Parameters
imageNSImage to obtain the size of.
Returns
Contained image size in pixels.

Definition at line 1257 of file GHOST_SystemCocoa.mm.

Referenced by GHOST_SystemCocoa::getClipboardImage(), and NSImageToImBuf().

◆ GHOST_HACK_getFirstFile()

int GHOST_HACK_getFirstFile ( char buf[FIRSTFILEBUFLG])

Definition at line 348 of file GHOST_SystemCocoa.mm.

References FIRSTFILEBUFLG, g_firstFileBuf, and g_hasFirstFile.

Referenced by main().

◆ NSImageToImBuf()

static ImBuf * NSImageToImBuf ( NSImage * image)
static

Convert an NSImage to an ImBuf.

Parameters
imageNSImage to convert.
Returns
Pointer to the resulting allocated ImBuf. Caller must free.

Definition at line 1271 of file GHOST_SystemCocoa.mm.

References ImBuf::byte_buffer, ImBufByteBuffer::data, getNSImagePixelSize(), IB_rect, and IMB_allocImBuf().

Referenced by GHOST_SystemCocoa::getClipboardImage(), and GHOST_SystemCocoa::handleDraggingEvent().

◆ NSPasteboardGetImageFile()

static NSURL * NSPasteboardGetImageFile ( )
static

Variable Documentation

◆ __pad0__

__pad0__

Definition at line 368 of file GHOST_SystemCocoa.mm.

◆ g_firstFileBuf

char g_firstFileBuf[FIRSTFILEBUFLG]
static

Definition at line 344 of file GHOST_SystemCocoa.mm.

Referenced by GHOST_HACK_getFirstFile().

◆ g_hasFirstFile

bool g_hasFirstFile = false
static

Definition at line 343 of file GHOST_SystemCocoa.mm.

Referenced by GHOST_HACK_getFirstFile().