|
11 | 11 |
|
12 | 12 | /* Proper way to check for the OS X version we are compiling for, from |
13 | 13 | http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development */ |
14 | | -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 |
15 | | -#define COMPILING_FOR_10_6 |
16 | | -#endif |
17 | 14 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 |
18 | 15 | #define COMPILING_FOR_10_7 |
19 | 16 | #endif |
@@ -204,11 +201,7 @@ - (void)masterCloses:(NSNotification*)notification; |
204 | 201 | - (void)close; |
205 | 202 | @end |
206 | 203 |
|
207 | | -#ifdef COMPILING_FOR_10_6 |
208 | 204 | @interface View : NSView <NSWindowDelegate> |
209 | | -#else |
210 | | -@interface View : NSView |
211 | | -#endif |
212 | 205 | { PyObject* canvas; |
213 | 206 | NSRect rubberband; |
214 | 207 | BOOL inside; |
@@ -1379,29 +1372,21 @@ -(void)save_figure:(id)sender |
1379 | 1372 | [[NSString alloc] |
1380 | 1373 | initWithCString: default_filename |
1381 | 1374 | encoding: NSUTF8StringEncoding]; |
1382 | | -#ifdef COMPILING_FOR_10_6 |
1383 | 1375 | [panel setNameFieldStringValue: ns_default_filename]; |
1384 | 1376 | result = [panel runModal]; |
1385 | | -#else |
1386 | | - result = [panel runModalForDirectory: nil file: ns_default_filename]; |
1387 | | -#endif |
1388 | 1377 | [ns_default_filename release]; |
1389 | 1378 | #ifdef COMPILING_FOR_10_10 |
1390 | 1379 | if (result == NSModalResponseOK) |
1391 | 1380 | #else |
1392 | 1381 | if (result == NSOKButton) |
1393 | 1382 | #endif |
1394 | 1383 | { |
1395 | | -#ifdef COMPILING_FOR_10_6 |
1396 | 1384 | NSURL* url = [panel URL]; |
1397 | 1385 | NSString* filename = [url path]; |
1398 | 1386 | if (!filename) { |
1399 | 1387 | PyErr_SetString(PyExc_RuntimeError, "Failed to obtain filename"); |
1400 | 1388 | return 0; |
1401 | 1389 | } |
1402 | | -#else |
1403 | | - NSString* filename = [panel filename]; |
1404 | | -#endif |
1405 | 1390 | unsigned int n = [filename length]; |
1406 | 1391 | unichar* buffer = malloc(n*sizeof(unichar)); |
1407 | 1392 | [filename getCharacters: buffer]; |
@@ -2581,26 +2566,6 @@ static void context_cleanup(const void* info) |
2581 | 2566 | Timer_new, /* tp_new */ |
2582 | 2567 | }; |
2583 | 2568 |
|
2584 | | -#ifndef COMPILING_FOR_10_6 |
2585 | | -static bool verify_framework(void) |
2586 | | -{ |
2587 | | - ProcessSerialNumber psn; |
2588 | | - if (CGMainDisplayID()!=0 |
2589 | | - && GetCurrentProcess(&psn)==noErr |
2590 | | - && SetFrontProcess(&psn)==noErr) return true; |
2591 | | - PyErr_SetString(PyExc_ImportError, |
2592 | | - "Python is not installed as a framework. The Mac OS X backend will " |
2593 | | - "not be able to function correctly if Python is not installed as a " |
2594 | | - "framework. See the Python documentation for more information on " |
2595 | | - "installing Python as a framework on Mac OS X. Please either reinstall " |
2596 | | - "Python as a framework, or try one of the other backends. If you are " |
2597 | | - "using (Ana)Conda please install python.app and replace the use of " |
2598 | | - "'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the " |
2599 | | - "Matplotlib FAQ for more information."); |
2600 | | - return false; |
2601 | | -} |
2602 | | -#endif |
2603 | | - |
2604 | 2569 | static struct PyMethodDef methods[] = { |
2605 | 2570 | {"event_loop_is_running", |
2606 | 2571 | (PyCFunction)event_loop_is_running, |
@@ -2650,12 +2615,6 @@ static bool verify_framework(void) |
2650 | 2615 | || PyType_Ready(&TimerType) < 0) |
2651 | 2616 | return NULL; |
2652 | 2617 |
|
2653 | | -#ifndef COMPILING_FOR_10_6 |
2654 | | - /* if >=10.6 invoke setActivationPolicy in lazy_init */ |
2655 | | - if (!verify_framework()) |
2656 | | - return NULL; |
2657 | | -#endif |
2658 | | - |
2659 | 2618 | module = PyModule_Create(&moduledef); |
2660 | 2619 | if (!module) |
2661 | 2620 | return NULL; |
|
0 commit comments