diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemCocoa.mm')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 60 |
1 files changed, 12 insertions, 48 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index ccbac91f0b4..236002e9744 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -254,27 +254,6 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) } -#pragma mark defines for 10.6 api not documented in 10.5 - -#pragma mark Utility functions - -#define FIRSTFILEBUFLG 512 -static bool g_hasFirstFile = false; -static char g_firstFileBuf[512]; - -//TODO:Need to investigate this. Function called too early in creator.c to have g_hasFirstFile == true -extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) -{ - if (g_hasFirstFile) { - strncpy(buf, g_firstFileBuf, FIRSTFILEBUFLG - 1); - buf[FIRSTFILEBUFLG - 1] = '\0'; - return 1; - } - else { - return 0; - } -} - #pragma mark Cocoa objects /** @@ -338,8 +317,6 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) #pragma mark initialization/finalization -char GHOST_user_locale[128]; // Global current user locale - GHOST_SystemCocoa::GHOST_SystemCocoa() { int mib[2]; @@ -377,15 +354,6 @@ GHOST_SystemCocoa::GHOST_SystemCocoa() rstring = NULL; m_ignoreWindowSizedMessages = false; - - //Get current locale - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - CFLocaleRef myCFLocale = CFLocaleCopyCurrent(); - NSLocale * myNSLocale = (NSLocale *) myCFLocale; - [myNSLocale autorelease]; - NSString *nsIdentifier = [myNSLocale localeIdentifier]; - strncpy(GHOST_user_locale, [nsIdentifier UTF8String], sizeof(GHOST_user_locale) - 1); - [pool drain]; } GHOST_SystemCocoa::~GHOST_SystemCocoa() @@ -567,25 +535,21 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( window = new GHOST_WindowCocoa (this, title, left, bottom, width, height, state, type, stereoVisual, numOfAASamples); - if (window) { - if (window->getValid()) { - // Store the pointer to the window - GHOST_ASSERT(m_windowManager, "m_windowManager not initialized"); - m_windowManager->addWindow(window); - m_windowManager->setActiveWindow(window); - //Need to tell window manager the new window is the active one (Cocoa does not send the event activate upon window creation) - pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window)); - pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window)); - } - else { - GHOST_PRINT("GHOST_SystemCocoa::createWindow(): window invalid\n"); - delete window; - window = 0; - } + if (window->getValid()) { + // Store the pointer to the window + GHOST_ASSERT(m_windowManager, "m_windowManager not initialized"); + m_windowManager->addWindow(window); + m_windowManager->setActiveWindow(window); + //Need to tell window manager the new window is the active one (Cocoa does not send the event activate upon window creation) + pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window)); + pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window)); } else { - GHOST_PRINT("GHOST_SystemCocoa::createWindow(): could not create window\n"); + GHOST_PRINT("GHOST_SystemCocoa::createWindow(): window invalid\n"); + delete window; + window = 0; } + [pool drain]; return window; } |