Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemCocoa.mm
| Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | GHOST_IWindow *GHOST_SystemCocoa::createWindow(const STR_String &title, | ||||
| return window; | return window; | ||||
| } | } | ||||
| /** | /** | ||||
| * Create a new offscreen context. | * Create a new offscreen context. | ||||
| * Never explicitly delete the context, use #disposeContext() instead. | * Never explicitly delete the context, use #disposeContext() instead. | ||||
| * \return The new context (or 0 if creation failed). | * \return The new context (or 0 if creation failed). | ||||
| */ | */ | ||||
| GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext() | GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext( | ||||
| GHOST_PlatformSupportCallbackPtr platform_support_callback) | |||||
| { | { | ||||
| GHOST_Context *context = new GHOST_ContextCGL(false, NULL, NULL, NULL); | GHOST_Context *context = new GHOST_ContextCGL(false, NULL, NULL, NULL); | ||||
| if (context->initializeDrawingContext()) | if (context->initializeDrawingContext()) | ||||
| return context; | return context; | ||||
| else | else | ||||
| delete context; | delete context; | ||||
| return NULL; | return NULL; | ||||
| ▲ Show 20 Lines • Show All 583 Lines • ▼ Show 20 Lines | bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr) | ||||
| /* Discard event if we are in cursor grab sequence, | /* Discard event if we are in cursor grab sequence, | ||||
| * it'll lead to "stuck cursor" situation if the alert panel is raised */ | * it'll lead to "stuck cursor" situation if the alert panel is raised */ | ||||
| if (window && window->getCursorGrabModeIsWarp()) | if (window && window->getCursorGrabModeIsWarp()) | ||||
| return NO; | return NO; | ||||
| // Check open windows if some changes are not saved | // Check open windows if some changes are not saved | ||||
| if (m_windowManager->getAnyModifiedState()) { | if (m_windowManager->getAnyModifiedState()) { | ||||
| @autoreleasepool { | @autoreleasepool | ||||
| { | |||||
| NSAlert *alert = [[NSAlert alloc] init]; | NSAlert *alert = [[NSAlert alloc] init]; | ||||
| NSString *title = [NSString stringWithFormat:@"Opening %@", [filepath lastPathComponent]]; | NSString *title = [NSString stringWithFormat:@"Opening %@", [filepath lastPathComponent]]; | ||||
| NSString *text = @"Current document has not been saved.\nDo you really want to proceed?"; | NSString *text = @"Current document has not been saved.\nDo you really want to proceed?"; | ||||
| [alert addButtonWithTitle:@"Open"]; | [alert addButtonWithTitle:@"Open"]; | ||||
| [alert addButtonWithTitle:@"Cancel"]; | [alert addButtonWithTitle:@"Cancel"]; | ||||
| [alert setMessageText:title]; | [alert setMessageText:title]; | ||||
| [alert setInformativeText:text]; | [alert setInformativeText:text]; | ||||
| [alert setAlertStyle:NSAlertStyleInformational]; | [alert setAlertStyle:NSAlertStyleInformational]; | ||||
| ▲ Show 20 Lines • Show All 589 Lines • Show Last 20 Lines | |||||