From 335f5ae44485d32ac632bd8d27d5ac00acd63477 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 7 Oct 2012 12:07:23 +0200 Subject: [PATCH] Check for OSX >= 10.4 to match what the maunal says and what we actually support. * 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 | 4 ++++ configure.ac | 16 ++++++++++++++++ etc/ChangeLog | 4 ++++ etc/NEWS | 2 ++ src/ChangeLog | 18 ++++++++++++++++++ src/nsfns.m | 35 ++++++++++++++++------------------- src/nsimage.m | 8 +++----- src/nsmenu.m | 5 ----- src/nsselect.m | 4 ++-- src/nsterm.h | 13 ++++--------- src/nsterm.m | 5 +---- 11 files changed, 70 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d4d7a66eb..1a7b9f6182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Jan Djärv + + * configure.ac: Check that OSX is 10.4 or newer. + 2012-10-07 Paul Eggert Improve sys_siglist detection. diff --git a/configure.ac b/configure.ac index 626395220b..748f435aec 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ], + [ +#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 ], [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 diff --git a/etc/ChangeLog b/etc/ChangeLog index ad6c6395e4..001bfe271a 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Jan Djärv + + * NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required. + 2012-10-05 Douglas Lewan (tiny change) * tutorials/TUTORIAL.pt_BR: Fix typo. (Bug#12557) diff --git a/etc/NEWS b/etc/NEWS index e4086bf038..1a7eb82967 100644 --- 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. diff --git a/src/ChangeLog b/src/ChangeLog index 44dc728627..45e3c8a8a5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,23 @@ 2012-10-07 Jan Djärv + * 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 diff --git a/src/nsfns.m b/src/nsfns.m index d66b1c32b0..7a22ac547c 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -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= MAC_OS_X_VERSION_10_4 +#if defined (NS_IMPL_COCOA) (typeUTF16ExternalRepresentation == [returnDescriptor descriptorType]) || #endif diff --git a/src/nsimage.m b/src/nsimage.m index 370cf832c7..884c0763fd 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -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)]; diff --git a/src/nsmenu.m b/src/nsmenu.m index b60cc005c5..9af732c6c4 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -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 } diff --git a/src/nsselect.m b/src/nsselect.m index 95bc1a9595..c0c412c6fb 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -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]; diff --git a/src/nsterm.h b/src/nsterm.h index f1cd7458bd..958d1ce785 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -26,9 +26,6 @@ along with GNU Emacs. If not, see . */ #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 . */ 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 . */ /* ========================================================================== - 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 */ diff --git a/src/nsterm.m b/src/nsterm.m index 75f33fea75..d6689c08aa 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -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, -- 2.20.1