diff options
Diffstat (limited to 'src/nsterm.m')
-rw-r--r-- | src/nsterm.m | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index b0a2994bcf5..19d246d526a 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -65,10 +65,8 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu) #endif #ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 #include "macfont.h" #endif -#endif /* call tracing */ #if 0 @@ -706,7 +704,6 @@ static void ns_update_auto_hide_menu_bar (void) { #ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 block_input (); NSTRACE (ns_update_auto_hide_menu_bar); @@ -739,7 +736,6 @@ ns_update_auto_hide_menu_bar (void) unblock_input (); #endif -#endif } @@ -2358,7 +2354,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, [img setXBMColor: bm_color]; } -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_COCOA [img drawInRect: r fromRect: NSZeroRect operation: NSCompositeSourceOver @@ -3037,7 +3033,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r) /* Draw the image.. do we need to draw placeholder if img ==nil? */ if (img != nil) { -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_COCOA NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); NSRect ir = NSMakeRect (s->slice.x, s->slice.y, s->slice.width, s->slice.height); @@ -3450,8 +3446,7 @@ check_native_fs () #endif /* GNUstep and OSX <= 10.4 does not have cancelTracking. */ -#if defined (NS_IMPL_COCOA) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#ifdef NS_IMPL_COCOA /* Check if menu open should be canceled or continued as normal. */ void ns_check_menu_open (NSMenu *menu) @@ -3514,7 +3509,7 @@ ns_check_pending_open_menu () menu_will_open_state = MENU_OPENING; } } -#endif /* NS_IMPL_COCOA) && >= MAC_OS_X_VERSION_10_5 */ +#endif /* NS_IMPL_COCOA */ static void unwind_apploopnr (Lisp_Object not_used) @@ -4720,14 +4715,12 @@ ns_term_shutdown (int sig) [self antialiasThresholdDidChange:nil]; #ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(antialiasThresholdDidChange:) name:NSAntialiasThresholdChangedNotification object:nil]; #endif -#endif ns_send_appdefined (-2); } @@ -4735,10 +4728,8 @@ ns_term_shutdown (int sig) - (void)antialiasThresholdDidChange:(NSNotification *)notification { #ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 macfont_update_antialias_threshold (); #endif -#endif } @@ -5078,13 +5069,11 @@ not_in_argv (NSString *arg) if (!emacs_event) return; - if (EQ (font->driver->type, Qns)) - nsfont = ((struct nsfont_info *)font)->nsfont; -#ifdef NS_IMPL_COCOA -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - else - nsfont = (NSFont *) macfont_get_nsctfont (font); +#ifdef NS_IMPL_GNUSTEP + nsfont = ((struct nsfont_info *)font)->nsfont; #endif +#ifdef NS_IMPL_COCOA + nsfont = (NSFont *) macfont_get_nsctfont (font); #endif if ((newFont = [sender convertFont: nsfont])) @@ -5136,7 +5125,7 @@ not_in_argv (NSString *arg) int code; unsigned fnKeysym = 0; static NSMutableArray *nsEvArray; -#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_GNUSTEP static BOOL firstTime = YES; #endif int left_is_none; @@ -5367,7 +5356,7 @@ not_in_argv (NSString *arg) } -#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_GNUSTEP /* if we get here we should send the key for input manager processing */ /* Disable warning, there is nothing a user can do about it anyway, and it does not seem to matter. */ @@ -6509,8 +6498,7 @@ if (cols > 0 && rows > 0) /* Hide dock and menubar if we are on the primary screen. */ if (onFirstScreen) { -#if defined (NS_IMPL_COCOA) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_COCOA NSApplicationPresentationOptions options = NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar; @@ -6562,8 +6550,7 @@ if (cols > 0 && rows > 0) if (onFirstScreen) { -#if defined (NS_IMPL_COCOA) && \ - MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +#ifdef NS_IMPL_COCOA [NSApp setPresentationOptions: NSApplicationPresentationDefault]; #else [NSMenu setMenuBarVisible:YES]; @@ -7285,7 +7272,7 @@ if (cols > 0 && rows > 0) if (portion >= whole) { -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 +#ifdef NS_IMPL_COCOA [self setKnobProportion: 1.0]; [self setDoubleValue: 1.0]; #else @@ -7299,7 +7286,7 @@ if (cols > 0 && rows > 0) portion = max ((float)whole*min_portion/pixel_height, portion); pos = (float)position / (whole - portion); por = (CGFloat)portion/whole; -#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 +#ifdef NS_IMPL_COCOA [self setKnobProportion: por]; [self setDoubleValue: pos]; #else @@ -7829,14 +7816,12 @@ baseline level. The default value is nil. */); DEFSYM (Qcocoa, "cocoa"); DEFSYM (Qgnustep, "gnustep"); - syms_of_nsfont (); #ifdef NS_IMPL_COCOA Fprovide (Qcocoa, Qnil); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 syms_of_macfont (); -#endif #else Fprovide (Qgnustep, Qnil); + syms_of_nsfont (); #endif } |