Check for OSX >= 10.4 to match what the maunal says and what we actually support.
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 7 Oct 2012 10:07:23 +0000 (12:07 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 7 Oct 2012 10:07:23 +0000 (12:07 +0200)
* configure.ac: Check that OSX is 10.4 or newer.

* etc/NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required.

* src/nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
(ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.

* src/nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.

* src/nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.

* src/nsselect.m (ns_string_from_pasteboard): Remove check for >=
MAC_OS_X_VERSION_10_4.

* src/nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
(EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
(struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.

ChangeLog
configure.ac
etc/ChangeLog
etc/NEWS
src/ChangeLog
src/nsfns.m
src/nsimage.m
src/nsmenu.m
src/nsselect.m
src/nsterm.h
src/nsterm.m

index 2d4d7a6..1a7b9f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * configure.ac: Check that OSX is 10.4 or newer.
+
 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
 
        Improve sys_siglist detection.
index 6263952..748f435 100644 (file)
@@ -1510,10 +1510,26 @@ fail;
   AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes],
                  [AC_MSG_ERROR([`--with-ns' was specified, but the include
   files are missing or cannot be compiled.])])
+
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <AppKit/AppKit.h>],
+                                     [
+#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ ; /* OK */
+#else
+#error "OSX 10.4 or newer required"
+#endif
+#endif
+                   ])],
+                   ns_osx_have_104=yes,
+                   ns_osx_have_104=no)
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <Foundation/NSObjCRuntime.h>],
                                      [NSInteger i;])],
                    ns_have_nsinteger=yes,
                    ns_have_nsinteger=no)
+  if test $ns_osx_have_104 = no; then
+     AC_MSG_ERROR([`OSX 10.4 or newer is required']);
+  fi
   if test $ns_have_nsinteger = yes; then
     AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.])
   fi
index ad6c639..001bfe2 100644 (file)
@@ -1,3 +1,7 @@
+2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required.
+
 2012-10-05  Douglas Lewan  <d_lewan2000@yahoo.com>  (tiny change)
 
        * tutorials/TUTORIAL.pt_BR: Fix typo.  (Bug#12557)
index e4086bf..1a7eb82 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -191,6 +191,8 @@ The PCL-CVS commands are still available via the keyboard.
 
 ** NextStep/OSX port changes.
 ---
+*** OSX 10.4 or newer is required to build Emacs.
+---
 *** Fullscreen and frame parameter fullscreen is supported.
 ---
 *** A file dialog is used when open/saved is done from the menu/toolbar.
index 44dc728..45e3c8a 100644 (file)
@@ -1,5 +1,23 @@
 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
 
+       * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
+       MAC_OS_X_VERSION_10_6.
+       (syms_of_nsterm): Remove comment about Panther and above for ns-antialias-text.
+
+       * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
+       (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
+       (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
+
+       * nsselect.m (ns_string_from_pasteboard): Remove check for >=
+       MAC_OS_X_VERSION_10_4.
+
+       * nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.
+
+       * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
+
+       * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
+       (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
+
        * nsterm.m (ns_in_resize): Remove (Bug#12479).
        (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
        (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize
index d66b1c3..7a22ac5 100644 (file)
@@ -1949,32 +1949,29 @@ DEFUN ("ns-list-services", Fns_list_services, Sns_list_services, 0, 0, 0,
 
   check_ns ();
   svcs = [[NSMenu alloc] initWithTitle: @"Services"];
-  [NSApp setServicesMenu: svcs];  /* this and next rebuild on <10.4 */
+  [NSApp setServicesMenu: svcs];
   [NSApp registerServicesMenuSendTypes: ns_send_types
                            returnTypes: ns_return_types];
 
 /* On Tiger, services menu updating was made lazier (waits for user to
    actually click on the menu), so we have to force things along: */
 #ifdef NS_IMPL_COCOA
-  if (NSAppKitVersionNumber >= 744.0)
+  delegate = [svcs delegate];
+  if (delegate != nil)
     {
-      delegate = [svcs delegate];
-      if (delegate != nil)
+      if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)])
+        [delegate menuNeedsUpdate: svcs];
+      if ([delegate respondsToSelector:
+                       @selector (menu:updateItem:atIndex:shouldCancel:)])
         {
-          if ([delegate respondsToSelector: @selector (menuNeedsUpdate:)])
-              [delegate menuNeedsUpdate: svcs];
-          if ([delegate respondsToSelector:
-                            @selector (menu:updateItem:atIndex:shouldCancel:)])
-            {
-              int i, len = [delegate numberOfItemsInMenu: svcs];
-              for (i =0; i<len; i++)
-                  [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""];
-              for (i =0; i<len; i++)
-                  if (![delegate menu: svcs
-                           updateItem: (NSMenuItem *)[svcs itemAtIndex: i]
-                              atIndex: i shouldCancel: NO])
-                    break;
-            }
+          int i, len = [delegate numberOfItemsInMenu: svcs];
+          for (i =0; i<len; i++)
+            [svcs addItemWithTitle: @"" action: NULL keyEquivalent: @""];
+          for (i =0; i<len; i++)
+            if (![delegate menu: svcs
+                     updateItem: (NSMenuItem *)[svcs itemAtIndex: i]
+                        atIndex: i shouldCancel: NO])
+              break;
         }
     }
 #endif
@@ -2075,7 +2072,7 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result)
          *result = Qt;
          // script returned an AppleScript result
          if ((typeUnicodeText == [returnDescriptor descriptorType]) ||
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+#if defined (NS_IMPL_COCOA)
              (typeUTF16ExternalRepresentation
               == [returnDescriptor descriptorType]) ||
 #endif
index 370cf83..884c076 100644 (file)
@@ -403,7 +403,6 @@ static EmacsImage *ImageList = nil;
       if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)])
         {
           bmRep = (NSBitmapImageRep *) rep;
-          onTiger = [bmRep respondsToSelector: @selector (colorAtX:y:)];
 
           if ([bmRep numberOfPlanes] >= 3)
               [bmRep getBitmapDataPlanes: pixmapData];
@@ -435,7 +434,7 @@ static EmacsImage *ImageList = nil;
        | (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8)
        | (pixmapData[2][loc]);
     }
-  else if (onTiger)
+  else
     {
       NSColor *color = [bmRep colorAtX: x y: y];
       CGFloat r, g, b, a;
@@ -445,7 +444,6 @@ static EmacsImage *ImageList = nil;
         | ((int)(b * 255.0));
 
     }
-  return 0;
 }
 
 - (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r
@@ -463,7 +461,7 @@ static EmacsImage *ImageList = nil;
       pixmapData[2][loc] = b;
       pixmapData[3][loc] = a;
     }
-  else if (onTiger)
+  else
     {
       [bmRep setColor:
                [NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0)
@@ -483,7 +481,7 @@ static EmacsImage *ImageList = nil;
 
       pixmapData[3][loc] = a;
     }
-  else if (onTiger)
+  else
     {
       NSColor *color = [bmRep colorAtX: x y: y];
       color = [color colorWithAlphaComponent: (a / 255.0)];
index b60cc00..9af732c 100644 (file)
@@ -722,11 +722,6 @@ extern NSString *NSMenuDidBeginTrackingNotification;
 #ifdef NS_IMPL_GNUSTEP
   if ([[self window] isVisible])
     [self sizeToFit];
-#else
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
-  if ([self supermenu] == nil)
-    [self sizeToFit];
-#endif
 #endif
 }
 
index 95bc1a9..c0c412c 100644 (file)
@@ -295,7 +295,7 @@ ns_string_from_pasteboard (id pb)
       utfStr = [mstr UTF8String];
       length = [mstr lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
 
-#if ! defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
+#if ! defined (NS_IMPL_COCOA)
       if (!utfStr)
         {
           utfStr = [mstr cString];
@@ -306,7 +306,7 @@ ns_string_from_pasteboard (id pb)
   NS_HANDLER
     {
       message1 ("ns_string_from_pasteboard: UTF8String failed\n");
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+#if defined (NS_IMPL_COCOA)
       utfStr = "Conversion failed";
 #else
       utfStr = [str lossyCString];
index f1cd745..958d1ce 100644 (file)
@@ -26,9 +26,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifdef HAVE_NS
 
 #ifdef NS_IMPL_COCOA
-#ifndef MAC_OS_X_VERSION_10_3
-#define MAC_OS_X_VERSION_10_3 1030
-#endif
 #ifndef MAC_OS_X_VERSION_10_4
 #define MAC_OS_X_VERSION_10_4 1040
 #endif
@@ -286,7 +283,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
   int refCount;
   NSBitmapImageRep *bmRep; /* used for accessing pixel data */
   unsigned char *pixmapData[5]; /* shortcut to access pixel data */
-  BOOL onTiger;
   NSColor *stippleMask;
 }
 + allocInitFromFile: (Lisp_Object)file;
@@ -355,7 +351,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* ==========================================================================
 
-   Rendering on Panther and above
+   Rendering
 
    ========================================================================== */
 
@@ -380,7 +376,7 @@ extern NSString *ns_app_name;
 extern EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
 
 /* Apple removed the declaration, but kept the implementation */
-#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+#if defined (NS_IMPL_COCOA)
 @interface NSApplication (EmacsApp)
 - (void)setAppleMenu: (NSMenu *)menu;
 @end
@@ -483,10 +479,9 @@ struct nsfont_info
   float size;
 #ifdef __OBJC__
   NSFont *nsfont;
-  /* cgfont and synthItal are used only on OS X 10.3+ */
-#if defined (NS_IMPL_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
+#if defined (NS_IMPL_COCOA)
   CGFontRef cgfont;
-#else /* GNUstep or OS X < 10.3 */
+#else /* GNUstep */
   void *cgfont;
 #endif
 #else /* ! OBJC */
index 75f33fe..d6689c0 100644 (file)
@@ -569,9 +569,6 @@ ns_menu_bar_should_be_hidden (void)
 static void
 ns_update_auto_hide_menu_bar (void)
 {
-#ifndef MAC_OS_X_VERSION_10_6
-#define MAC_OS_X_VERSION_10_6 1060
-#endif
 #ifdef NS_IMPL_COCOA
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
   block_input ();
@@ -7087,7 +7084,7 @@ allowing it to be used at a lower level for accented character entry.");
   ns_function_modifier = Qnone;
 
   DEFVAR_LISP ("ns-antialias-text", ns_antialias_text,
-               "Non-nil (the default) means to render text antialiased. Only has an effect on OS X Panther and above.");
+               "Non-nil (the default) means to render text antialiased.");
   ns_antialias_text = Qt;
 
   DEFVAR_LISP ("ns-confirm-quit", ns_confirm_quit,