diff options
| author | Stefan Monnier | 2008-07-17 03:33:59 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-07-17 03:33:59 +0000 |
| commit | facfbbbdad272decb23553d827fbc2c0fabaf078 (patch) | |
| tree | 14d37d409d30bdec0cbfc0ed79593021e1e88ab2 /src/nsfns.m | |
| parent | d377ef4a3f6c77c451b647305436d1e8bf914b07 (diff) | |
| download | emacs-facfbbbdad272decb23553d827fbc2c0fabaf078.tar.gz emacs-facfbbbdad272decb23553d827fbc2c0fabaf078.zip | |
* Makefile.in: Undef LIB_STANDARD before defining it to silence warning
in case it was defined already.
USE @GNUSTEP_MAKEFILES@ rather than envvars.
* nsterm.m (ns_term_init): Pass Qt and Qnil rather than YES/NO to
ns_default.
(applicationShouldTerminate, setValuesFromPanel): Use EQ to compare
Lisp_Objects.
* nsterm.h (Fx_display_grayscale_p, Fx_display_planes)
(ns_defined_color, ns_color_to_lisp): Declare.
* nsselect.m (ns_handle_selection_request, ns_handle_selection_clear)
(Fns_own_selection_internal): Make the big ugly hack more explicit, so
it's accepted even with USE_LISP_UNION_TYPE.
* nsmenu.m (ns_update_menubar): Use EQ to compare Lisp_Objects.
(update_frame_tool_bar): Remove apparently obsolete tests for
non-integerness of f->tool_bar_lines.
(windowShouldClose, addButton, clicked, runDialogAt): Make the big ugly
hack more explicit, so it's accepted even with USE_LISP_UNION_TYPE.
* nsfont.m (nsfont_driver): Use just 0 rather than an invalid cast.
(nsfont_open): Don't confuse NULL for Qnil.
* nsfns.m (ns_implicitly_set_icon_type): Use EQ to compare Lisp_Objects.
* menu.h (find_and_call_menu_selection):
* menu.c (find_and_call_menu_selection): Use just int for vector size.
(find_and_return_menu_selection): Always return something.
* frame.h: Include dispextern.h for Display_Info.
(display_x_get_resource): Declare.
* configure.in: Extract and substitute GNUSTEP_MAKEFILES.
Diffstat (limited to 'src/nsfns.m')
| -rw-r--r-- | src/nsfns.m | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index b996ecf89ad..8ec6518aead 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -268,7 +268,7 @@ ns_display_info_for_name (name) | |||
| 268 | dpyinfo = ns_display_list; | 268 | dpyinfo = ns_display_list; |
| 269 | 269 | ||
| 270 | if (dpyinfo == 0) | 270 | if (dpyinfo == 0) |
| 271 | error ("OpenStep on %s not responding.\n", XSTRING (name)->data); | 271 | error ("OpenStep on %s not responding.\n", SDATA (name)); |
| 272 | 272 | ||
| 273 | return dpyinfo; | 273 | return dpyinfo; |
| 274 | } | 274 | } |
| @@ -401,8 +401,8 @@ ns_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 401 | if (face) | 401 | if (face) |
| 402 | { | 402 | { |
| 403 | col = NS_FACE_BACKGROUND (face); | 403 | col = NS_FACE_BACKGROUND (face); |
| 404 | face->background = | 404 | face->background |
| 405 | (EMACS_UINT) [[col colorWithAlphaComponent: alpha] retain]; | 405 | = (EMACS_UINT) [[col colorWithAlphaComponent: alpha] retain]; |
| 406 | [col release]; | 406 | [col release]; |
| 407 | 407 | ||
| 408 | update_face_from_frame_parameter (f, Qbackground_color, arg); | 408 | update_face_from_frame_parameter (f, Qbackground_color, arg); |
| @@ -478,11 +478,11 @@ ns_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 478 | if ([[view window] miniwindowTitle] && | 478 | if ([[view window] miniwindowTitle] && |
| 479 | ([[[view window] miniwindowTitle] | 479 | ([[[view window] miniwindowTitle] |
| 480 | isEqualToString: [NSString stringWithUTF8String: | 480 | isEqualToString: [NSString stringWithUTF8String: |
| 481 | XSTRING (arg)->data]])) | 481 | SDATA (arg)]])) |
| 482 | return; | 482 | return; |
| 483 | 483 | ||
| 484 | [[view window] setMiniwindowTitle: | 484 | [[view window] setMiniwindowTitle: |
| 485 | [NSString stringWithUTF8String: XSTRING (arg)->data]]; | 485 | [NSString stringWithUTF8String: SDATA (arg)]]; |
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | 488 | ||
| @@ -527,11 +527,11 @@ ns_set_name_iconic (struct frame *f, Lisp_Object name, int explicit) | |||
| 527 | if ([[view window] miniwindowTitle] && | 527 | if ([[view window] miniwindowTitle] && |
| 528 | ([[[view window] miniwindowTitle] | 528 | ([[[view window] miniwindowTitle] |
| 529 | isEqualToString: [NSString stringWithUTF8String: | 529 | isEqualToString: [NSString stringWithUTF8String: |
| 530 | XSTRING (name)->data]])) | 530 | SDATA (name)]])) |
| 531 | return; | 531 | return; |
| 532 | 532 | ||
| 533 | [[view window] setMiniwindowTitle: | 533 | [[view window] setMiniwindowTitle: |
| 534 | [NSString stringWithUTF8String: XSTRING (name)->data]]; | 534 | [NSString stringWithUTF8String: SDATA (name)]]; |
| 535 | } | 535 | } |
| 536 | 536 | ||
| 537 | 537 | ||
| @@ -573,10 +573,10 @@ ns_set_name (struct frame *f, Lisp_Object name, int explicit) | |||
| 573 | /* Don't change the name if it's already NAME. */ | 573 | /* Don't change the name if it's already NAME. */ |
| 574 | if ([[[view window] title] | 574 | if ([[[view window] title] |
| 575 | isEqualToString: [NSString stringWithUTF8String: | 575 | isEqualToString: [NSString stringWithUTF8String: |
| 576 | XSTRING (name)->data]]) | 576 | SDATA (name)]]) |
| 577 | return; | 577 | return; |
| 578 | [[view window] setTitle: [NSString stringWithUTF8String: | 578 | [[view window] setTitle: [NSString stringWithUTF8String: |
| 579 | XSTRING (name)->data]]; | 579 | SDATA (name)]]; |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | 582 | ||
| @@ -660,7 +660,7 @@ ns_set_name_as_filename (struct frame *f) | |||
| 660 | title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String] | 660 | title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String] |
| 661 | : [[[view window] title] UTF8String]; | 661 | : [[[view window] title] UTF8String]; |
| 662 | 662 | ||
| 663 | if (title && (! strcmp (title, XSTRING (name)->data))) | 663 | if (title && (! strcmp (title, SDATA (name)))) |
| 664 | { | 664 | { |
| 665 | [pool release]; | 665 | [pool release]; |
| 666 | UNBLOCK_INPUT; | 666 | UNBLOCK_INPUT; |
| @@ -673,7 +673,7 @@ ns_set_name_as_filename (struct frame *f) | |||
| 673 | /* work around a bug observed on 10.3 where | 673 | /* work around a bug observed on 10.3 where |
| 674 | setTitleWithRepresentedFilename does not clear out previous state | 674 | setTitleWithRepresentedFilename does not clear out previous state |
| 675 | if given filename does not exist */ | 675 | if given filename does not exist */ |
| 676 | NSString *str = [NSString stringWithUTF8String: XSTRING (name)->data]; | 676 | NSString *str = [NSString stringWithUTF8String: SDATA (name)]; |
| 677 | if (![[NSFileManager defaultManager] fileExistsAtPath: str]) | 677 | if (![[NSFileManager defaultManager] fileExistsAtPath: str]) |
| 678 | { | 678 | { |
| 679 | [[view window] setTitleWithRepresentedFilename: @""]; | 679 | [[view window] setTitleWithRepresentedFilename: @""]; |
| @@ -685,14 +685,14 @@ ns_set_name_as_filename (struct frame *f) | |||
| 685 | } | 685 | } |
| 686 | #else | 686 | #else |
| 687 | [[view window] setTitleWithRepresentedFilename: | 687 | [[view window] setTitleWithRepresentedFilename: |
| 688 | [NSString stringWithUTF8String: XSTRING (name)->data]]; | 688 | [NSString stringWithUTF8String: SDATA (name)]]; |
| 689 | #endif | 689 | #endif |
| 690 | f->name = name; | 690 | f->name = name; |
| 691 | } | 691 | } |
| 692 | else | 692 | else |
| 693 | { | 693 | { |
| 694 | [[view window] setMiniwindowTitle: | 694 | [[view window] setMiniwindowTitle: |
| 695 | [NSString stringWithUTF8String: XSTRING (name)->data]]; | 695 | [NSString stringWithUTF8String: SDATA (name)]]; |
| 696 | } | 696 | } |
| 697 | [pool release]; | 697 | [pool release]; |
| 698 | UNBLOCK_INPUT; | 698 | UNBLOCK_INPUT; |
| @@ -806,7 +806,7 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 806 | BLOCK_INPUT; | 806 | BLOCK_INPUT; |
| 807 | pool = [[NSAutoreleasePool alloc] init]; | 807 | pool = [[NSAutoreleasePool alloc] init]; |
| 808 | if (f->output_data.ns->miniimage | 808 | if (f->output_data.ns->miniimage |
| 809 | && [[NSString stringWithUTF8String: XSTRING (f->name)->data] | 809 | && [[NSString stringWithUTF8String: SDATA (f->name)] |
| 810 | isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) | 810 | isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) |
| 811 | { | 811 | { |
| 812 | [pool release]; | 812 | [pool release]; |
| @@ -828,10 +828,10 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 828 | { | 828 | { |
| 829 | elt = XCAR (chain); | 829 | elt = XCAR (chain); |
| 830 | /* special case: 't' means go by file type */ | 830 | /* special case: 't' means go by file type */ |
| 831 | if (SYMBOLP (elt) && elt == Qt && XSTRING (f->name)->data[0] == '/') | 831 | if (SYMBOLP (elt) && EQ (elt, Qt) && SDATA (f->name)[0] == '/') |
| 832 | { | 832 | { |
| 833 | NSString *str = | 833 | NSString *str |
| 834 | [NSString stringWithUTF8String: XSTRING (f->name)->data]; | 834 | = [NSString stringWithUTF8String: SDATA (f->name)]; |
| 835 | if ([[NSFileManager defaultManager] fileExistsAtPath: str]) | 835 | if ([[NSFileManager defaultManager] fileExistsAtPath: str]) |
| 836 | image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; | 836 | image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; |
| 837 | } | 837 | } |
| @@ -844,7 +844,7 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 844 | if (image == nil) | 844 | if (image == nil) |
| 845 | image = [[NSImage imageNamed: | 845 | image = [[NSImage imageNamed: |
| 846 | [NSString stringWithUTF8String: | 846 | [NSString stringWithUTF8String: |
| 847 | XSTRING (XCDR (elt))->data]] retain]; | 847 | SDATA (XCDR (elt))]] retain]; |
| 848 | } | 848 | } |
| 849 | } | 849 | } |
| 850 | 850 | ||
| @@ -873,7 +873,7 @@ ns_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 873 | 873 | ||
| 874 | if (!NILP (arg) && SYMBOLP (arg)) | 874 | if (!NILP (arg) && SYMBOLP (arg)) |
| 875 | { | 875 | { |
| 876 | arg =build_string (XSTRING (XSYMBOL (arg)->xname)->data); | 876 | arg =build_string (SDATA (SYMBOL_NAME (arg))); |
| 877 | store_frame_param (f, Qicon_type, arg); | 877 | store_frame_param (f, Qicon_type, arg); |
| 878 | } | 878 | } |
| 879 | 879 | ||
| @@ -889,7 +889,7 @@ ns_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 889 | image = [EmacsImage allocInitFromFile: arg]; | 889 | image = [EmacsImage allocInitFromFile: arg]; |
| 890 | if (image == nil) | 890 | if (image == nil) |
| 891 | image =[NSImage imageNamed: [NSString stringWithUTF8String: | 891 | image =[NSImage imageNamed: [NSString stringWithUTF8String: |
| 892 | XSTRING (arg)->data]]; | 892 | SDATA (arg)]]; |
| 893 | 893 | ||
| 894 | if (image == nil) | 894 | if (image == nil) |
| 895 | { | 895 | { |
| @@ -918,9 +918,9 @@ ns_lisp_to_cursor_type (Lisp_Object arg) | |||
| 918 | { | 918 | { |
| 919 | char *str; | 919 | char *str; |
| 920 | if (XTYPE (arg) == Lisp_String) | 920 | if (XTYPE (arg) == Lisp_String) |
| 921 | str =XSTRING (arg)->data; | 921 | str = SDATA (arg); |
| 922 | else if (XTYPE (arg) == Lisp_Symbol) | 922 | else if (XTYPE (arg) == Lisp_Symbol) |
| 923 | str =XSTRING (XSYMBOL (arg)->xname)->data; | 923 | str = SDATA (SYMBOL_NAME (arg)); |
| 924 | else return -1; | 924 | else return -1; |
| 925 | if (!strcmp (str, "box")) return filled_box; | 925 | if (!strcmp (str, "box")) return filled_box; |
| 926 | if (!strcmp (str, "hollow")) return hollow_box; | 926 | if (!strcmp (str, "hollow")) return hollow_box; |
| @@ -1125,8 +1125,8 @@ be shared by the new frame.") | |||
| 1125 | be set. */ | 1125 | be set. */ |
| 1126 | if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String)) | 1126 | if (EQ (name, Qunbound) || NILP (name) || (XTYPE (name) != Lisp_String)) |
| 1127 | { | 1127 | { |
| 1128 | f->name = | 1128 | f->name |
| 1129 | build_string ([[[NSProcessInfo processInfo] processName] UTF8String]); | 1129 | = build_string ([[[NSProcessInfo processInfo] processName] UTF8String]); |
| 1130 | f->explicit_name =0; | 1130 | f->explicit_name =0; |
| 1131 | } | 1131 | } |
| 1132 | else | 1132 | else |
| @@ -1197,15 +1197,15 @@ be shared by the new frame.") | |||
| 1197 | 1197 | ||
| 1198 | /* default scrollbars on right on Mac */ | 1198 | /* default scrollbars on right on Mac */ |
| 1199 | { | 1199 | { |
| 1200 | Lisp_Object spos = | 1200 | Lisp_Object spos |
| 1201 | #ifdef NS_IMPL_GNUSTEP | 1201 | #ifdef NS_IMPL_GNUSTEP |
| 1202 | Qt; | 1202 | = Qt; |
| 1203 | #else | 1203 | #else |
| 1204 | Qright; | 1204 | = Qright; |
| 1205 | #endif | 1205 | #endif |
| 1206 | x_default_parameter (f, parms, Qvertical_scroll_bars, spos, | 1206 | x_default_parameter (f, parms, Qvertical_scroll_bars, spos, |
| 1207 | "verticalScrollBars", "VerticalScrollBars", | 1207 | "verticalScrollBars", "VerticalScrollBars", |
| 1208 | RES_TYPE_SYMBOL); | 1208 | RES_TYPE_SYMBOL); |
| 1209 | } | 1209 | } |
| 1210 | x_default_parameter (f, parms, Qforeground_color, build_string ("Black"), | 1210 | x_default_parameter (f, parms, Qforeground_color, build_string ("Black"), |
| 1211 | "foreground", "Foreground", RES_TYPE_STRING); | 1211 | "foreground", "Foreground", RES_TYPE_STRING); |
| @@ -1236,30 +1236,31 @@ be shared by the new frame.") | |||
| 1236 | /*PENDING: other terms seem to get away w/o this complexity.. */ | 1236 | /*PENDING: other terms seem to get away w/o this complexity.. */ |
| 1237 | if (NILP (Fassq (Qwidth, parms))) | 1237 | if (NILP (Fassq (Qwidth, parms))) |
| 1238 | { | 1238 | { |
| 1239 | Lisp_Object value = | 1239 | Lisp_Object value |
| 1240 | x_get_arg (dpyinfo, parms, Qwidth, "width", "Width", RES_TYPE_NUMBER); | 1240 | = x_get_arg (dpyinfo, parms, Qwidth, "width", "Width", |
| 1241 | RES_TYPE_NUMBER); | ||
| 1241 | if (! EQ (value, Qunbound)) | 1242 | if (! EQ (value, Qunbound)) |
| 1242 | parms = Fcons (Fcons (Qwidth, value), parms); | 1243 | parms = Fcons (Fcons (Qwidth, value), parms); |
| 1243 | } | 1244 | } |
| 1244 | if (NILP (Fassq (Qheight, parms))) | 1245 | if (NILP (Fassq (Qheight, parms))) |
| 1245 | { | 1246 | { |
| 1246 | Lisp_Object value = | 1247 | Lisp_Object value |
| 1247 | x_get_arg (dpyinfo, parms, Qheight, "height", "Height", | 1248 | = x_get_arg (dpyinfo, parms, Qheight, "height", "Height", |
| 1248 | RES_TYPE_NUMBER); | 1249 | RES_TYPE_NUMBER); |
| 1249 | if (! EQ (value, Qunbound)) | 1250 | if (! EQ (value, Qunbound)) |
| 1250 | parms = Fcons (Fcons (Qheight, value), parms); | 1251 | parms = Fcons (Fcons (Qheight, value), parms); |
| 1251 | } | 1252 | } |
| 1252 | if (NILP (Fassq (Qleft, parms))) | 1253 | if (NILP (Fassq (Qleft, parms))) |
| 1253 | { | 1254 | { |
| 1254 | Lisp_Object value = | 1255 | Lisp_Object value |
| 1255 | x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER); | 1256 | = x_get_arg (dpyinfo, parms, Qleft, "left", "Left", RES_TYPE_NUMBER); |
| 1256 | if (! EQ (value, Qunbound)) | 1257 | if (! EQ (value, Qunbound)) |
| 1257 | parms = Fcons (Fcons (Qleft, value), parms); | 1258 | parms = Fcons (Fcons (Qleft, value), parms); |
| 1258 | } | 1259 | } |
| 1259 | if (NILP (Fassq (Qtop, parms))) | 1260 | if (NILP (Fassq (Qtop, parms))) |
| 1260 | { | 1261 | { |
| 1261 | Lisp_Object value = | 1262 | Lisp_Object value |
| 1262 | x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER); | 1263 | = x_get_arg (dpyinfo, parms, Qtop, "top", "Top", RES_TYPE_NUMBER); |
| 1263 | if (! EQ (value, Qunbound)) | 1264 | if (! EQ (value, Qunbound)) |
| 1264 | parms = Fcons (Fcons (Qtop, value), parms); | 1265 | parms = Fcons (Fcons (Qtop, value), parms); |
| 1265 | } | 1266 | } |
| @@ -1277,8 +1278,8 @@ be shared by the new frame.") | |||
| 1277 | f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor]; | 1278 | f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor]; |
| 1278 | f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor]; | 1279 | f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor]; |
| 1279 | f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor]; | 1280 | f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor]; |
| 1280 | FRAME_NS_DISPLAY_INFO (f)->vertical_scroll_bar_cursor = | 1281 | FRAME_NS_DISPLAY_INFO (f)->vertical_scroll_bar_cursor |
| 1281 | [NSCursor arrowCursor]; | 1282 | = [NSCursor arrowCursor]; |
| 1282 | f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; | 1283 | f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; |
| 1283 | 1284 | ||
| 1284 | [[EmacsView alloc] initFrameFromEmacs: f]; | 1285 | [[EmacsView alloc] initFrameFromEmacs: f]; |
| @@ -1435,12 +1436,12 @@ Set ISLOAD non-nil if file being read for a save.") | |||
| 1435 | NSString *fname; | 1436 | NSString *fname; |
| 1436 | 1437 | ||
| 1437 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : | 1438 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : |
| 1438 | [NSString stringWithUTF8String: XSTRING (prompt)->data]; | 1439 | [NSString stringWithUTF8String: SDATA (prompt)]; |
| 1439 | NSString *dirS = NILP (dir) || !STRINGP (dir) ? | 1440 | NSString *dirS = NILP (dir) || !STRINGP (dir) ? |
| 1440 | [NSString stringWithUTF8String: XSTRING (current_buffer->directory)->data] : | 1441 | [NSString stringWithUTF8String: SDATA (current_buffer->directory)] : |
| 1441 | [NSString stringWithUTF8String: XSTRING (dir)->data]; | 1442 | [NSString stringWithUTF8String: SDATA (dir)]; |
| 1442 | NSString *initS = NILP (init) || !STRINGP (init) ? nil : | 1443 | NSString *initS = NILP (init) || !STRINGP (init) ? nil : |
| 1443 | [NSString stringWithUTF8String: XSTRING (init)->data]; | 1444 | [NSString stringWithUTF8String: SDATA (init)]; |
| 1444 | 1445 | ||
| 1445 | check_ns (); | 1446 | check_ns (); |
| 1446 | 1447 | ||
| @@ -1502,12 +1503,12 @@ If OWNER is nil, Emacs is assumed.") | |||
| 1502 | /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */ | 1503 | /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */ |
| 1503 | 1504 | ||
| 1504 | value =[[[NSUserDefaults standardUserDefaults] | 1505 | value =[[[NSUserDefaults standardUserDefaults] |
| 1505 | objectForKey: [NSString stringWithUTF8String: XSTRING (name)->data]] | 1506 | objectForKey: [NSString stringWithUTF8String: SDATA (name)]] |
| 1506 | UTF8String]; | 1507 | UTF8String]; |
| 1507 | 1508 | ||
| 1508 | if (value) | 1509 | if (value) |
| 1509 | return build_string (value); | 1510 | return build_string (value); |
| 1510 | /*fprintf (stderr, "Nothing found for NS resource '%s'.\n", XSTRING (name)->data); */ | 1511 | /*fprintf (stderr, "Nothing found for NS resource '%s'.\n", SDATA (name)); */ |
| 1511 | return Qnil; | 1512 | return Qnil; |
| 1512 | } | 1513 | } |
| 1513 | 1514 | ||
| @@ -1521,22 +1522,22 @@ If VALUE is nil, the default is removed.") | |||
| 1521 | { | 1522 | { |
| 1522 | check_ns (); | 1523 | check_ns (); |
| 1523 | if (NILP (owner)) | 1524 | if (NILP (owner)) |
| 1524 | owner = | 1525 | owner |
| 1525 | build_string ([[[NSProcessInfo processInfo] processName] UTF8String]); | 1526 | = build_string ([[[NSProcessInfo processInfo] processName] UTF8String]); |
| 1526 | CHECK_STRING (owner); | 1527 | CHECK_STRING (owner); |
| 1527 | CHECK_STRING (name); | 1528 | CHECK_STRING (name); |
| 1528 | if (NILP (value)) | 1529 | if (NILP (value)) |
| 1529 | { | 1530 | { |
| 1530 | [[NSUserDefaults standardUserDefaults] removeObjectForKey: | 1531 | [[NSUserDefaults standardUserDefaults] removeObjectForKey: |
| 1531 | [NSString stringWithUTF8String: XSTRING (name)->data]]; | 1532 | [NSString stringWithUTF8String: SDATA (name)]]; |
| 1532 | } | 1533 | } |
| 1533 | else | 1534 | else |
| 1534 | { | 1535 | { |
| 1535 | CHECK_STRING (value); | 1536 | CHECK_STRING (value); |
| 1536 | [[NSUserDefaults standardUserDefaults] setObject: | 1537 | [[NSUserDefaults standardUserDefaults] setObject: |
| 1537 | [NSString stringWithUTF8String: XSTRING (value)->data] | 1538 | [NSString stringWithUTF8String: SDATA (value)] |
| 1538 | forKey: [NSString stringWithUTF8String: | 1539 | forKey: [NSString stringWithUTF8String: |
| 1539 | XSTRING (name)->data]]; | 1540 | SDATA (name)]]; |
| 1540 | } | 1541 | } |
| 1541 | 1542 | ||
| 1542 | return Qnil; | 1543 | return Qnil; |
| @@ -1763,10 +1764,10 @@ Optional arguments XRM-STRING and MUST-SUCCEED are currently ignored.") | |||
| 1763 | { | 1764 | { |
| 1764 | if (!NILP (must_succeed)) | 1765 | if (!NILP (must_succeed)) |
| 1765 | fatal ("OpenStep on %s not responding.\n", | 1766 | fatal ("OpenStep on %s not responding.\n", |
| 1766 | XSTRING (display)->data); | 1767 | SDATA (display)); |
| 1767 | else | 1768 | else |
| 1768 | error ("OpenStep on %s not responding.\n", | 1769 | error ("OpenStep on %s not responding.\n", |
| 1769 | XSTRING (display)->data); | 1770 | SDATA (display)); |
| 1770 | } | 1771 | } |
| 1771 | 1772 | ||
| 1772 | /* Register our external input/output types, used for determining | 1773 | /* Register our external input/output types, used for determining |
| @@ -1858,17 +1859,17 @@ DEFUN ("ns-emacs-info-panel", Fns_emacs_info_panel, Sns_emacs_info_panel, | |||
| 1858 | 1859 | ||
| 1859 | 1860 | ||
| 1860 | DEFUN ("x-list-fonts", Fns_list_fonts, Sns_list_fonts, 1, 4, 0, | 1861 | DEFUN ("x-list-fonts", Fns_list_fonts, Sns_list_fonts, 1, 4, 0, |
| 1861 | "Return a list of the names of available fonts matching PATTERN.\n\ | 1862 | doc: /* Return a list of the names of available fonts matching PATTERN. |
| 1862 | If optional arguments FACE and FRAME are specified, return only fonts\n\ | 1863 | If optional arguments FACE and FRAME are specified, return only fonts |
| 1863 | the same size as FACE on FRAME.\n\ | 1864 | the same size as FACE on FRAME. |
| 1864 | If optional argument MAX is specified, return at most MAX matches.\n\ | 1865 | If optional argument MAX is specified, return at most MAX matches. |
| 1865 | \n\ | 1866 | |
| 1866 | PATTERN is a regular expression; FACE is a face name - a symbol.\n\ | 1867 | PATTERN is a regular expression; FACE is a face name - a symbol. |
| 1867 | \n\ | 1868 | |
| 1868 | The return value is a list of strings, suitable as arguments to\n\ | 1869 | The return value is a list of strings, suitable as arguments to |
| 1869 | set-face-font.\n\ | 1870 | set-face-font. |
| 1870 | \n\ | 1871 | |
| 1871 | The font names are _NOT_ X names.") | 1872 | The font names are _NOT_ X names. */) |
| 1872 | (pattern, face, frame, max) | 1873 | (pattern, face, frame, max) |
| 1873 | Lisp_Object pattern, face, frame, max; | 1874 | Lisp_Object pattern, face, frame, max; |
| 1874 | { | 1875 | { |
| @@ -1906,7 +1907,7 @@ The font names are _NOT_ X names.") | |||
| 1906 | for (tem = flist; CONSP (tem); tem = XCDR (tem)) | 1907 | for (tem = flist; CONSP (tem); tem = XCDR (tem)) |
| 1907 | { | 1908 | { |
| 1908 | Lisp_Object fname = XCAR (tem); | 1909 | Lisp_Object fname = XCAR (tem); |
| 1909 | olist = Fcons (build_string (ns_xlfd_to_fontname (XSTRING (fname)->data)), | 1910 | olist = Fcons (build_string (ns_xlfd_to_fontname (SDATA (fname))), |
| 1910 | olist); | 1911 | olist); |
| 1911 | } | 1912 | } |
| 1912 | 1913 | ||
| @@ -2039,7 +2040,7 @@ Returns result of service as string or nil if no result.") | |||
| 2039 | CHECK_STRING (service); | 2040 | CHECK_STRING (service); |
| 2040 | check_ns (); | 2041 | check_ns (); |
| 2041 | 2042 | ||
| 2042 | utfStr = XSTRING (service)->data; | 2043 | utfStr = SDATA (service); |
| 2043 | svcName = [NSString stringWithUTF8String: utfStr]; | 2044 | svcName = [NSString stringWithUTF8String: utfStr]; |
| 2044 | 2045 | ||
| 2045 | pb =[NSPasteboard pasteboardWithUniqueName]; | 2046 | pb =[NSPasteboard pasteboardWithUniqueName]; |
| @@ -2063,7 +2064,7 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc, | |||
| 2063 | NSString *utfStr; | 2064 | NSString *utfStr; |
| 2064 | 2065 | ||
| 2065 | CHECK_STRING (str); | 2066 | CHECK_STRING (str); |
| 2066 | utfStr = [[NSString stringWithUTF8String: XSTRING (str)->data] | 2067 | utfStr = [[NSString stringWithUTF8String: SDATA (str)] |
| 2067 | precomposedStringWithCanonicalMapping]; | 2068 | precomposedStringWithCanonicalMapping]; |
| 2068 | return build_string ([utfStr UTF8String]); | 2069 | return build_string ([utfStr UTF8String]); |
| 2069 | } | 2070 | } |
| @@ -2448,7 +2449,7 @@ Text larger than the specified size is clipped. */) | |||
| 2448 | GCPRO4 (string, parms, frame, timeout); | 2449 | GCPRO4 (string, parms, frame, timeout); |
| 2449 | 2450 | ||
| 2450 | CHECK_STRING (string); | 2451 | CHECK_STRING (string); |
| 2451 | str = XSTRING (string)->data; | 2452 | str = SDATA (string); |
| 2452 | f = check_x_frame (frame); | 2453 | f = check_x_frame (frame); |
| 2453 | if (NILP (timeout)) | 2454 | if (NILP (timeout)) |
| 2454 | timeout = make_number (5); | 2455 | timeout = make_number (5); |