From: Jan Djärv Date: Sun, 20 Jul 2014 13:18:47 +0000 (+0200) Subject: * macfont.h (macfont_update_antialias_threshold): Declare. X-Git-Tag: emacs-24.3.93~56 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=880b716696b4d8737e7199d6487f17b7e6825dd4;p=emacs.git * macfont.h (macfont_update_antialias_threshold): Declare. * macfont.m (macfont_update_antialias_threshold): Remove static. * nsterm.h (EmacsApp): Add antialiasThresholdDidChange. * nsterm.m (applicationDidFinishLaunching:): Call antialiasThresholdDidChange, register for antialias changes. (antialiasThresholdDidChange:): New method for EmacsApp. Fixes: debbugs:17534 --- diff --git a/src/ChangeLog b/src/ChangeLog index 8dda7baa6a4..f39526f4f4b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2014-07-20 Jan Djärv + + * nsterm.m (applicationDidFinishLaunching:): Call + antialiasThresholdDidChange, register for antialias changes (Bug#17534). + (antialiasThresholdDidChange:): New method for EmacsApp. + + * nsterm.h (EmacsApp): Add antialiasThresholdDidChange. + + * macfont.m (macfont_update_antialias_threshold): Remove static. + + * macfont.h (macfont_update_antialias_threshold): Declare. + 2014-07-17 Eli Zaretskii * w32select.c (setup_windows_coding_system): Apply diff --git a/src/macfont.h b/src/macfont.h index 8b451357e42..7421cd63a79 100644 --- a/src/macfont.h +++ b/src/macfont.h @@ -144,4 +144,5 @@ typedef const struct _EmacsScreenFont *ScreenFontRef; /* opaque */ extern void mac_register_font_driver (struct frame *f); extern void *macfont_get_nsctfont (struct font *font); +extern void macfont_update_antialias_threshold (void); diff --git a/src/macfont.m b/src/macfont.m index 075b512e686..1bb3fb14134 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -729,7 +729,7 @@ static const struct static CGFloat macfont_antialias_threshold; -static void +void macfont_update_antialias_threshold (void) { int threshold; diff --git a/src/nsterm.h b/src/nsterm.h index 74789634a90..8c3e4e5c314 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -111,6 +111,7 @@ typedef float EmacsCGFloat; #endif } - (void)logNotification: (NSNotification *)notification; +- (void)antialiasThresholdDidChange:(NSNotification *)notification; - (void)sendEvent: (NSEvent *)theEvent; - (void)showPreferencesWindow: (id)sender; - (BOOL) openFile: (NSString *)fileName; diff --git a/src/nsterm.m b/src/nsterm.m index c7cb4faa3b7..4b1ebb2b516 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4668,9 +4668,30 @@ ns_term_shutdown (int sig) ((EmacsApp *)self)->applicationDidFinishLaunchingCalled = YES; #endif [NSApp setServicesProvider: NSApp]; + + [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); } +- (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 +} + /* Termination sequences: C-x C-c: