OS X: remove code for OS X <= 10.5, which is already not supported since 2 years.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 27 Dec 2015 17:54:14 +0000 (18:54 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 28 Dec 2015 23:27:18 +0000 (00:27 +0100)
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowCocoa.mm
intern/itasc/kdl/chain.hpp
intern/itasc/kdl/tree.hpp
source/blender/editors/space_file/fsmenu.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/quicktime_export.h

index cd61e3747f72895901ceba54ef0179493815bc98..80559fe53f87eb7a983484b80da3150051482aa8 100644 (file)
@@ -442,10 +442,8 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
                                
                                [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];
                                
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 // make it build with  10.6 deployment target, but as it is not available in 10.6, it will get weaklinked
                                menuItem = [windowMenu addItemWithTitle:@"Enter Full Screen" action:@selector(toggleFullScreen:) keyEquivalent:@"f" ];
                                [menuItem setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask];
-#endif
 
                                menuItem = [windowMenu addItemWithTitle:@"Close" action:@selector(performClose:) keyEquivalent:@"w"];
                                [menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
index 38813e14a1b332a6235276ab718d9977c0ca2590..b3fc8efbab1c626c12ffee3993e8e8171f20984d 100644 (file)
 
 #include <Cocoa/Cocoa.h>
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050
-   //Use of the SetSystemUIMode function (64bit compatible)
-#  include <Carbon/Carbon.h>
-#endif
-
 #include <sys/sysctl.h>
 
 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
@@ -132,14 +127,10 @@ enum {
 
 - (void)windowDidResize:(NSNotification *)notification
 {
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
        //if (![[notification object] inLiveResize]) {
                //Send event only once, at end of resize operation (when user has released mouse button)
-#endif
                systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, associatedWindow);
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
        //}
-#endif
        /* Live resize, send event, gets handled in wm_window.c. Needed because live resize runs in a modal loop, not letting main loop run */
         if ([[notification object] inLiveResize]) {
                systemCocoa->dispatchEvents();
@@ -608,19 +599,15 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
        
        [m_window setAcceptsMouseMovedEvents:YES];
        
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
        NSView *view = [m_window contentView];
        [view setAcceptsTouchEvents:YES];
-#endif
        
        [m_window registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
                                           NSStringPboardType, NSTIFFPboardType, nil]];
        
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
        if (state != GHOST_kWindowStateFullScreen) {
                [m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
        }
-#endif
        
        if (state == GHOST_kWindowStateFullScreen)
                setState(GHOST_kWindowStateFullScreen);
@@ -859,7 +846,6 @@ GHOST_TWindowState GHOST_WindowCocoa::getState() const
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        GHOST_TWindowState state;
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
        NSUInteger masks = [m_window styleMask];
 
        if (masks & NSFullScreenWindowMask) {
@@ -871,9 +857,7 @@ GHOST_TWindowState GHOST_WindowCocoa::getState() const
                        state = GHOST_kWindowStateNormal;
                }
        }
-       else
-#endif
-       if (m_fullScreen) {
+       else if (m_fullScreen) {
                state = GHOST_kWindowStateFullScreen;
        } 
        else if ([m_window isMiniaturized]) {
@@ -988,7 +972,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                
                case GHOST_kWindowStateFullScreen:
                {
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                        NSUInteger masks = [m_window styleMask];
 
                        if (!m_fullScreen && !(masks & NSFullScreenWindowMask)) {
@@ -996,9 +979,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                        [m_window toggleFullScreen:nil];
                                        break;
                                }
-#else
-                       if (!m_fullScreen) {
-#endif
                                NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                        
                                /* This status change needs to be done before Cocoa call to enter fullscreen mode
@@ -1006,12 +986,9 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                 * doesn't know view/window difference. */
                                m_fullScreen = true;
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                                /* Disable toggle for Lion style fullscreen */
                                [m_window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
-#endif
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                                //10.6 provides Cocoa functions to autoshow menu bar, and to change a window style
                                //Hide menu & dock if on primary screen. else only menu
                                if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) {
@@ -1021,38 +998,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                [m_window setStyleMask:NSBorderlessWindowMask];
                                [m_window setFrame:[[m_window screen] frame] display:YES];
                                [m_window makeFirstResponder:m_openGLView];
-#else
-                               //With 10.5, we need to create a new window to change its style to borderless
-                               //Hide menu & dock if needed
-                               if ([[m_window screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) {
-                                       //Cocoa function in 10.5 does not allow to set the menu bar in auto-show mode [NSMenu setMenuBarVisible:NO];
-                                       //One of the very few 64bit compatible Carbon function
-                                       SetSystemUIMode(kUIModeAllHidden,kUIOptionAutoShowMenuBar);
-                               }
-                               //Create a fullscreen borderless window
-                               CocoaWindow *tmpWindow = [[CocoaWindow alloc]
-                                                         initWithContentRect:[[m_window screen] frame]
-                                                         styleMask:NSBorderlessWindowMask
-                                                         backing:NSBackingStoreBuffered
-                                                         defer:YES];
-                               //Copy current window parameters
-                               [tmpWindow setTitle:[m_window title]];
-                               [tmpWindow setRepresentedFilename:[m_window representedFilename]];
-                               [tmpWindow setAcceptsMouseMovedEvents:YES];
-                               [tmpWindow setDelegate:[m_window delegate]];
-                               [tmpWindow setSystemAndWindowCocoa:[m_window systemCocoa] windowCocoa:this];
-                               [tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
-                                                                   NSStringPboardType, NSTIFFPboardType, nil]];
-                               
-                               //Assign the openGL view to the new window
-                               [tmpWindow setContentView:m_openGLView];
-                               
-                               //Show the new window
-                               [tmpWindow makeKeyAndOrderFront:m_openGLView];
-                               //Close and release old window
-                               [m_window close];
-                               m_window = tmpWindow;
-#endif
                        
                                //Tell WM of view new size
                                m_systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, this);
@@ -1064,25 +1009,19 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                case GHOST_kWindowStateNormal:
                default:
                        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                        NSUInteger masks = [m_window styleMask];
 
                        if (masks & NSFullScreenWindowMask) {
                                // Lion style fullscreen
                                [m_window toggleFullScreen:nil];
                        }
-                       else
-#endif
-                       if (m_fullScreen) {
+                       else if (m_fullScreen) {
                                m_fullScreen = false;
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                                /* Enable toggle for into Lion style fullscreen */
                                [m_window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
-#endif
 
                                //Exit fullscreen
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                                //Show again menu & dock if needed
                                if ([[m_window screen] isEqual:[NSScreen mainScreen]]) {
                                        [NSApp setPresentationOptions:NSApplicationPresentationDefault];
@@ -1092,39 +1031,6 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                [m_window setFrame:[[m_window screen] visibleFrame] display:YES];
                                //TODO for 10.6 only : window title is forgotten after the style change
                                [m_window makeFirstResponder:m_openGLView];
-#else
-                               //With 10.5, we need to create a new window to change its style to borderless
-                               //Show menu & dock if needed
-                               if ([[m_window screen] isEqual:[NSScreen mainScreen]]) {
-                                       //Cocoa function in 10.5 does not allow to set the menu bar in auto-show mode [NSMenu setMenuBarVisible:YES];
-                                       SetSystemUIMode(kUIModeNormal, 0); //One of the very few 64bit compatible Carbon function
-                               }
-                               //Create a fullscreen borderless window
-                               CocoaWindow *tmpWindow = [[CocoaWindow alloc]
-                                                         initWithContentRect:[[m_window screen] frame]
-                                                                   styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
-                                                                     backing:NSBackingStoreBuffered
-                                                                       defer:YES];
-                               //Copy current window parameters
-                               [tmpWindow setTitle:[m_window title]];
-                               [tmpWindow setRepresentedFilename:[m_window representedFilename]];
-                               [tmpWindow setAcceptsMouseMovedEvents:YES];
-                               [tmpWindow setDelegate:[m_window delegate]];
-                               [tmpWindow setSystemAndWindowCocoa:[m_window systemCocoa] windowCocoa:this];
-                               [tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
-                                                                   NSStringPboardType, NSTIFFPboardType, nil]];
-                               //Forbid to resize the window below the blender defined minimum one
-                               [tmpWindow setContentMinSize:NSMakeSize(320, 240)];
-                               
-                               //Assign the openGL view to the new window
-                               [tmpWindow setContentView:m_openGLView];
-                               
-                               //Show the new window
-                               [tmpWindow makeKeyAndOrderFront:nil];
-                               //Close and release old window
-                               [m_window close];
-                               m_window = tmpWindow;
-#endif
                        
                                //Tell WM of view new size
                                m_systemCocoa->handleWindowEvent(GHOST_kEventWindowSize, this);
index 1776737fc7deaa0d73332bfe11f595ff24ac6896..81c606b73c028ee3fc7d8338dbcc20d9402b1a61 100644 (file)
@@ -35,17 +35,8 @@ namespace KDL {
      */
     class Chain {
     private:
-#if defined(__APPLE__)
-#  if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050
-               std::vector<Segment> segments;
-#  else
         // Eigen allocator is needed for alignment of Eigen data types
         std::vector<Segment, Eigen::aligned_allocator<Segment> > segments;
-#  endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#else
-        // Eigen allocator is needed for alignment of Eigen data types
-        std::vector<Segment, Eigen::aligned_allocator<Segment> > segments;
-#endif
         unsigned int nrOfJoints;
         unsigned int nrOfSegments;
     public:
index 8f97120096966f334bd38a1074ac4d3afdeb55c5..c8a253fc9017ed6ec144336cbb2fc29c9704b2ac 100644 (file)
 
 #include <string>
 #include <map>
-#if defined(__APPLE__)
-#  if MAC_OS_X_VERSION_MIN_REQUIRED <= 1050
-    //no include
-#  else
-#    include <Eigen/Core>
-#  endif /* MAC_OS_X_VERSION_MIN_REQUIRED */
-#else
-#  include <Eigen/Core>
-#endif
+#include <Eigen/Core>
 
 namespace KDL
 {
     //Forward declaration
     class TreeElement;
-#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1050
-    typedef std::map<std::string,TreeElement> SegmentMap;
-#else
     // Eigen allocator is needed for alignment of Eigen data types
     typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
-#endif
 
     class TreeElement
     {
index 33e6990b179f0a374b76c7543e242cdcd41369bb..e71c05d19c5b7e0476ee54154d249ba9f7f4971d 100644 (file)
@@ -509,56 +509,6 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
 #else
 #ifdef __APPLE__
        {
-#if (MAC_OS_X_VERSION_MIN_REQUIRED <= 1050)
-               OSErr err = noErr;
-               int i;
-               const char *home;
-               
-               /* loop through all the OS X Volumes, and add them to the SYSTEM section */
-               for (i = 1; err != nsvErr; i++) {
-                       FSRef dir;
-                       unsigned char path[FILE_MAX];
-                       
-                       err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, NULL, kFSVolInfoNone, NULL, NULL, &dir);
-                       if (err != noErr)
-                               continue;
-                       
-                       FSRefMakePath(&dir, path, FILE_MAX);
-                       if (!STREQ((char *)path, "/home") && !STREQ((char *)path, "/net")) {
-                               /* /net and /home are meaningless on OSX, home folders are stored in /Users */
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, NULL, FS_INSERT_SORTED);
-                       }
-               }
-
-               /* As 10.4 doesn't provide proper API to retrieve the favorite places,
-                * assume they are the standard ones 
-                * TODO : replace hardcoded paths with proper BKE_appdir_folder_id calls */
-               home = getenv("HOME");
-               if (read_bookmarks && home) {
-                       BLI_snprintf(line, sizeof(line), "%s/", home);
-                       fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       BLI_snprintf(line, sizeof(line), "%s/Desktop/", home);
-                       if (BLI_exists(line)) {
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       }
-                       BLI_snprintf(line, sizeof(line), "%s/Documents/", home);
-                       if (BLI_exists(line)) {
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       }
-                       BLI_snprintf(line, sizeof(line), "%s/Pictures/", home);
-                       if (BLI_exists(line)) {
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       }
-                       BLI_snprintf(line, sizeof(line), "%s/Music/", home);
-                       if (BLI_exists(line)) {
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       }
-                       BLI_snprintf(line, sizeof(line), "%s/Movies/", home);
-                       if (BLI_exists(line)) {
-                               fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED);
-                       }
-               }
-#else /* OSX 10.6+ */
                /* Get mounted volumes better method OSX 10.6 and higher, see: */
                /*https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFURLRef/Reference/reference.html*/
                /* we get all volumes sorted including network and do not relay on user-defined finder visibility, less confusing */
@@ -622,7 +572,6 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
                        CFRelease(pathesArray);
                        CFRelease(list);
                }
-#endif /* OSX 10.6+ */
        }
 #else
        /* unix */
index 9bc4ec444bba7f6255d81fe73d7506f7a866bf61..1ac3c58f888382a450198822ab876694400d6e76 100644 (file)
 #import <QTKit/QTKit.h>
 #include <AudioToolbox/AudioToolbox.h>
 
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= 1040
-#error OSX 10.5 minimum is needed for QTKit
-#endif
-
 #include "quicktime_import.h"
 #include "quicktime_export.h"
 
index 41db83fb1c9f1d16e51b6bbdf57db6fc064e84a6..aaa3f5c90705eea2b5e79d34e1dde32be78372fe 100644 (file)
@@ -80,8 +80,7 @@ void free_qtcomponentdata(void);
 void makeqtstring(struct RenderData *rd, char *string, bool preview);          //for playanim.c
 
 
-
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 && __LP64__)
+#ifdef __APPLE__
 //Include the quicktime codec types constants that are missing in QTKitDefines.h
 enum {
        kRawCodecType                                           = 'raw ',