diff options
| author | Adrian Robert | 2008-07-19 22:23:30 +0000 |
|---|---|---|
| committer | Adrian Robert | 2008-07-19 22:23:30 +0000 |
| commit | 5c976973f295b44a9951c9a924aacd432cc4fb31 (patch) | |
| tree | d130fac7e200e8108e243a98c47dfb4ffe249775 /src | |
| parent | 0d1794fdb0262dc3b3f4d4f0909851a6c6c9ffdc (diff) | |
| download | emacs-5c976973f295b44a9951c9a924aacd432cc4fb31.tar.gz emacs-5c976973f295b44a9951c9a924aacd432cc4fb31.zip | |
fix bug with quickdraw smoothing; also, in Makefile, clean out ns_appdir in 'clean' target
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 3 | ||||
| -rw-r--r-- | src/nsfont.m | 2 | ||||
| -rw-r--r-- | src/nsterm.h | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 39 |
4 files changed, 25 insertions, 21 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index a44a39011fb..05fec55cd39 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -1355,9 +1355,12 @@ mostlyclean: | |||
| 1355 | rm -f buildobj.lst | 1355 | rm -f buildobj.lst |
| 1356 | clean: mostlyclean | 1356 | clean: mostlyclean |
| 1357 | rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} | 1357 | rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} |
| 1358 | #ifdef HAVE_NS | ||
| 1359 | rm -fr ${ns_appdir} | ||
| 1358 | #ifdef NS_IMPL_GNUSTEP | 1360 | #ifdef NS_IMPL_GNUSTEP |
| 1359 | rm -f *.d | 1361 | rm -f *.d |
| 1360 | #endif | 1362 | #endif |
| 1363 | #endif | ||
| 1361 | /* bootstrap-clean is used to clean up just before a bootstrap. | 1364 | /* bootstrap-clean is used to clean up just before a bootstrap. |
| 1362 | It should remove all files generated during a compilation/bootstrap, | 1365 | It should remove all files generated during a compilation/bootstrap, |
| 1363 | but not things like config.status or TAGS. */ | 1366 | but not things like config.status or TAGS. */ |
diff --git a/src/nsfont.m b/src/nsfont.m index bf15ee84933..132b1aaf29b 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -1060,7 +1060,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1060 | CGContextSetShouldAntialias (gcontext, 0); | 1060 | CGContextSetShouldAntialias (gcontext, 0); |
| 1061 | else | 1061 | else |
| 1062 | CGContextSetShouldAntialias (gcontext, 1); | 1062 | CGContextSetShouldAntialias (gcontext, 1); |
| 1063 | if (ns_use_qd_smoothing) | 1063 | if (EQ (ns_use_qd_smoothing, Qt)) |
| 1064 | CGContextSetFontRenderingMode (gcontext, 2); /* 0 is Cocoa, 2 is QD */ | 1064 | CGContextSetFontRenderingMode (gcontext, 2); /* 0 is Cocoa, 2 is QD */ |
| 1065 | 1065 | ||
| 1066 | CGContextSetTextMatrix (gcontext, fliptf); | 1066 | CGContextSetTextMatrix (gcontext, fliptf); |
diff --git a/src/nsterm.h b/src/nsterm.h index 2a70ae31d53..ace45249468 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -331,7 +331,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 331 | IBOutlet NSButton *smoothFontsCheck; | 331 | IBOutlet NSButton *smoothFontsCheck; |
| 332 | IBOutlet NSButton *useQuickdrawCheck; | 332 | IBOutlet NSButton *useQuickdrawCheck; |
| 333 | IBOutlet NSButton *useSysHiliteCheck; | 333 | IBOutlet NSButton *useSysHiliteCheck; |
| 334 | BOOL prevUseHighlightColor; | 334 | Lisp_Object prevUseHighlightColor; |
| 335 | #endif | 335 | #endif |
| 336 | float prevExpandSpace; | 336 | float prevExpandSpace; |
| 337 | float prevBlinkRate; | 337 | float prevBlinkRate; |
diff --git a/src/nsterm.m b/src/nsterm.m index f0d8b5af734..3d8ff3129f8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -180,7 +180,7 @@ Lisp_Object ns_cursor_blink_mode; | |||
| 180 | Lisp_Object ns_expand_space; | 180 | Lisp_Object ns_expand_space; |
| 181 | 181 | ||
| 182 | /* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */ | 182 | /* Control via default 'GSFontAntiAlias' on OS X and GNUstep. */ |
| 183 | int ns_antialias_text; | 183 | Lisp_Object ns_antialias_text; |
| 184 | 184 | ||
| 185 | /* On OS X picks up the default NSGlobalDomain AppleAntiAliasingThreshold, | 185 | /* On OS X picks up the default NSGlobalDomain AppleAntiAliasingThreshold, |
| 186 | the maximum font size to NOT antialias. On GNUstep there is currently | 186 | the maximum font size to NOT antialias. On GNUstep there is currently |
| @@ -189,10 +189,10 @@ float ns_antialias_threshold; | |||
| 189 | 189 | ||
| 190 | /* Controls use of an undocumented CG function to do Quickdraw-style font | 190 | /* Controls use of an undocumented CG function to do Quickdraw-style font |
| 191 | smoothing (less heavy) instead of regular Quartz smoothing. */ | 191 | smoothing (less heavy) instead of regular Quartz smoothing. */ |
| 192 | int ns_use_qd_smoothing; | 192 | Lisp_Object ns_use_qd_smoothing; |
| 193 | 193 | ||
| 194 | /* Used to pick up AppleHighlightColor on OS X */ | 194 | /* Used to pick up AppleHighlightColor on OS X */ |
| 195 | int ns_use_system_highlight_color; | 195 | Lisp_Object ns_use_system_highlight_color; |
| 196 | NSString *ns_selection_color; | 196 | NSString *ns_selection_color; |
| 197 | 197 | ||
| 198 | 198 | ||
| @@ -3488,10 +3488,10 @@ ns_set_default_prefs () | |||
| 3488 | ns_cursor_blink_rate = Qnil; | 3488 | ns_cursor_blink_rate = Qnil; |
| 3489 | ns_cursor_blink_mode = Qnil; | 3489 | ns_cursor_blink_mode = Qnil; |
| 3490 | ns_expand_space = make_float (0.0); | 3490 | ns_expand_space = make_float (0.0); |
| 3491 | ns_antialias_text = YES; | 3491 | ns_antialias_text = Qt; |
| 3492 | ns_antialias_threshold = 10.0; | 3492 | ns_antialias_threshold = 10.0; /* not exposed to lisp side */ |
| 3493 | ns_use_qd_smoothing = NO; | 3493 | ns_use_qd_smoothing = Qnil; |
| 3494 | ns_use_system_highlight_color = YES; | 3494 | ns_use_system_highlight_color = Qt; |
| 3495 | } | 3495 | } |
| 3496 | 3496 | ||
| 3497 | 3497 | ||
| @@ -3807,9 +3807,10 @@ handling_signal = 0; | |||
| 3807 | ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp); | 3807 | ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp); |
| 3808 | ns_default ("UseQuickdrawSmoothing", &ns_use_qd_smoothing, | 3808 | ns_default ("UseQuickdrawSmoothing", &ns_use_qd_smoothing, |
| 3809 | Qt, Qnil, NO, NO); | 3809 | Qt, Qnil, NO, NO); |
| 3810 | fprintf(stderr, "qd smoothing: %d (%d, %d)\n", ns_use_qd_smoothing, EQ(ns_use_qd_smoothing, Qt), NILP(ns_use_qd_smoothing)); | ||
| 3810 | ns_default ("UseSystemHighlightColor", &ns_use_system_highlight_color, | 3811 | ns_default ("UseSystemHighlightColor", &ns_use_system_highlight_color, |
| 3811 | Qt, Qnil, NO, NO); | 3812 | Qt, Qnil, NO, NO); |
| 3812 | if (ns_use_system_highlight_color == YES) | 3813 | if (EQ (ns_use_system_highlight_color, Qt)) |
| 3813 | { | 3814 | { |
| 3814 | ns_selection_color = [[NSUserDefaults standardUserDefaults] | 3815 | ns_selection_color = [[NSUserDefaults standardUserDefaults] |
| 3815 | stringForKey: @"AppleHighlightColor"]; | 3816 | stringForKey: @"AppleHighlightColor"]; |
| @@ -4018,13 +4019,13 @@ panel to control this setting."); | |||
| 4018 | or shrunk (negative). Zero (the default) means standard line height.\n\ | 4019 | or shrunk (negative). Zero (the default) means standard line height.\n\ |
| 4019 | (This variable should only be read, never set.)"); | 4020 | (This variable should only be read, never set.)"); |
| 4020 | 4021 | ||
| 4021 | DEFVAR_BOOL ("ns-antialias-text", &ns_antialias_text, | 4022 | DEFVAR_LISP ("ns-antialias-text", &ns_antialias_text, |
| 4022 | "Non-nil (the default) means to render text antialiased. Only has an effect on OS X Panther and above."); | 4023 | "Non-nil (the default) means to render text antialiased. Only has an effect on OS X Panther and above."); |
| 4023 | 4024 | ||
| 4024 | DEFVAR_BOOL ("ns-use-qd-smoothing", &ns_use_qd_smoothing, | 4025 | DEFVAR_LISP ("ns-use-qd-smoothing", &ns_use_qd_smoothing, |
| 4025 | "Whether to render text using QuickDraw (less heavy) antialiasing. Only has an effect on OS X Panther and above. Default is nil (use Quartz smoothing)."); | 4026 | "Whether to render text using QuickDraw (less heavy) antialiasing. Only has an effect on OS X Panther and above. Default is nil (use Quartz smoothing)."); |
| 4026 | 4027 | ||
| 4027 | DEFVAR_BOOL ("ns-use-system-highlight-color", | 4028 | DEFVAR_LISP ("ns-use-system-highlight-color", |
| 4028 | &ns_use_system_highlight_color, | 4029 | &ns_use_system_highlight_color, |
| 4029 | "Whether to use the system default (on OS X only) for the highlight color. Nil means to use standard emacs (prior to version 21) 'grey'."); | 4030 | "Whether to use the system default (on OS X only) for the highlight color. Nil means to use standard emacs (prior to version 21) 'grey'."); |
| 4030 | 4031 | ||
| @@ -6158,9 +6159,9 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) | |||
| 6158 | parse_solitary_modifier (ns_control_modifier)); | 6159 | parse_solitary_modifier (ns_control_modifier)); |
| 6159 | selectItemWithTag (functionModMenu, | 6160 | selectItemWithTag (functionModMenu, |
| 6160 | parse_solitary_modifier (ns_function_modifier)); | 6161 | parse_solitary_modifier (ns_function_modifier)); |
| 6161 | [smoothFontsCheck setState: ns_antialias_text ? YES : NO]; | 6162 | [smoothFontsCheck setState: (NILP (ns_antialias_text) ? NO : YES)]; |
| 6162 | [useQuickdrawCheck setState: ns_use_qd_smoothing ? YES : NO]; | 6163 | [useQuickdrawCheck setState: (NILP (ns_use_qd_smoothing) ? NO : YES)]; |
| 6163 | [useSysHiliteCheck setState: prevUseHighlightColor ? YES : NO]; | 6164 | [useSysHiliteCheck setState: (NILP (prevUseHighlightColor) ? NO : YES)]; |
| 6164 | #endif | 6165 | #endif |
| 6165 | } | 6166 | } |
| 6166 | 6167 | ||
| @@ -6230,13 +6231,13 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) | |||
| 6230 | #ifdef NS_IMPL_COCOA | 6231 | #ifdef NS_IMPL_COCOA |
| 6231 | ns_control_modifier = ns_mod_to_lisp (ctrlTag); | 6232 | ns_control_modifier = ns_mod_to_lisp (ctrlTag); |
| 6232 | ns_function_modifier = ns_mod_to_lisp (fnTag); | 6233 | ns_function_modifier = ns_mod_to_lisp (fnTag); |
| 6233 | ns_antialias_text = [smoothFontsCheck state]; | 6234 | ns_antialias_text = [smoothFontsCheck state] ? Qt : Qnil; |
| 6234 | ns_use_qd_smoothing = [useQuickdrawCheck state]; | 6235 | ns_use_qd_smoothing = [useQuickdrawCheck state] ? Qt : Qnil; |
| 6235 | ns_use_system_highlight_color = [useSysHiliteCheck state]; | 6236 | ns_use_system_highlight_color = [useSysHiliteCheck state] ? Qt : Qnil; |
| 6236 | if (ns_use_system_highlight_color != prevUseHighlightColor) | 6237 | if (! EQ (ns_use_system_highlight_color, prevUseHighlightColor)) |
| 6237 | { | 6238 | { |
| 6238 | prevUseHighlightColor = ns_use_system_highlight_color; | 6239 | prevUseHighlightColor = ns_use_system_highlight_color; |
| 6239 | if (ns_use_system_highlight_color == YES) | 6240 | if (EQ (ns_use_system_highlight_color, Qt)) |
| 6240 | { | 6241 | { |
| 6241 | ns_selection_color = [[NSUserDefaults standardUserDefaults] | 6242 | ns_selection_color = [[NSUserDefaults standardUserDefaults] |
| 6242 | stringForKey: @"AppleHighlightColor"]; | 6243 | stringForKey: @"AppleHighlightColor"]; |