diff options
| author | Jan Djärv | 2012-07-13 20:03:10 +0200 |
|---|---|---|
| committer | Jan Djärv | 2012-07-13 20:03:10 +0200 |
| commit | 0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279 (patch) | |
| tree | f30ab901e9631069f4c7b8a62a6b704a2e7c53d1 /src | |
| parent | b55b9f85db85737b365e32585542046b349c1f2e (diff) | |
| download | emacs-0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279.tar.gz emacs-0dc8cf5002ba3f79bf840de5b83c0f4f2e4e6279.zip | |
Remove compiler warnings in objective-C files.
* nsfns.m (x_set_icon_name, ns_set_name_internal)
(ns_set_name_as_filename, ns_implicitly_set_icon_type)
(x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
(Fns_get_resource, Fns_set_resource, Fx_open_connection)
(Fns_font_name, Fns_perform_service)
(Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
(Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
(ns_set_name): Remove unused variable view.
(x_set_menu_bar_lines): Remove unused variable olines.
(x_set_tool_bar_lines): Remove unused variable root_window.
(Fns_list_colors): Put () around assignment in while statement.
(Fns_perform_service): Remove unused variable len.
(Fns_display_usable_bounds): Remove unused variable top.
(syms_of_nsfns): Remove unused variable i.
* nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
(ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
where appropriate.
(ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
around assignment in loop statement.
(nsfont_open): Remove unused variable i.
(nsfont_open): Remove unused variable len.
(nsfont_draw): Remove unused variable cs.
* nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
appropriate.
(setXBMColor): Remove unused variable len.
(setPixmapData): Put () around assignment in loop statement.
* nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
(initFromContents): Use SSDATA where appropriate.
(ns_update_menubar): Add braces to ambigous if-else.
(initWithTitle): Put () around assignment in if statement.
(ns_menu_show): Remove unused variables window and keymap.
(update_frame_tool_bar): Remove unused variable selected_p.
(initWithContentRect): Remove unused variable this_cmd_name.
* nsterm.h (menuDown): Add id as type to argument sender.
(ns_display_info_for_name): Add Lisp_Object argument.
(ns_term_init): Add Lisp_Object argument.
(ns_map_event_to_object): Add void argument.
(ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
prototype with arguments and only declare if __OBJC__.
(nxatoms_of_nsselect): Add void argument.
(ns_lisp_to_cursor_type): Add Lisp_Object argument.
(ns_alloc_autorelease_pool): Add void argument.
(ns_release_autorelease_pool): Add void* argument.
(ns_get_defaults_value): Add const char* argument.
* nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
(x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
(ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
(ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
where appropriate.
(ns_exec_path, ns_load_path, changeFont): Put () around assignment used
as boolean expression.
(x_set_window_size): Remove unused variable toolbar.
(ns_get_color_default, ns_mod_to_lisp): Remove.
(ns_mouse_position): Remove unused variables xchar and ychar.
(ns_compute_glyph_string_overhangs): Remove unused variable face.
(ns_set_vertical_scroll_bar): Remove unused variable count.
(ns_delete_terminal): Remove unused variable i.
(ns_term_init): Remove unused variables r, g and b.
(mouseDown): Remove unused variable window.
(windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
(initFrameFromEmacs): Remove unused variable vbextra.
(mouseEntered): Remove unused variables p and dpyinfo.
(mouseExited): Remove unused variables p and r.
(ns_define_frame_cursor, ns_clear_frame_area)
(ns_draw_window_cursor, ns_initialize_display_info): Make static.
(menuDown): Assign [sender tag] to variable and cast the variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 72 | ||||
| -rw-r--r-- | src/nsfns.m | 77 | ||||
| -rw-r--r-- | src/nsfont.m | 29 | ||||
| -rw-r--r-- | src/nsimage.m | 11 | ||||
| -rw-r--r-- | src/nsmenu.m | 34 | ||||
| -rw-r--r-- | src/nsterm.h | 25 | ||||
| -rw-r--r-- | src/nsterm.m | 110 |
7 files changed, 190 insertions, 168 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e9d2d7f7d37..4a7c481b8b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,77 @@ | |||
| 1 | 2012-07-13 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2012-07-13 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP. | ||
| 4 | (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE. | ||
| 5 | (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init) | ||
| 6 | (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA | ||
| 7 | where appropriate. | ||
| 8 | (ns_exec_path, ns_load_path, changeFont): Put () around assignment used | ||
| 9 | as boolean expression. | ||
| 10 | (x_set_window_size): Remove unused variable toolbar. | ||
| 11 | (ns_get_color_default, ns_mod_to_lisp): Remove. | ||
| 12 | (ns_mouse_position): Remove unused variables xchar and ychar. | ||
| 13 | (ns_compute_glyph_string_overhangs): Remove unused variable face. | ||
| 14 | (ns_set_vertical_scroll_bar): Remove unused variable count. | ||
| 15 | (ns_delete_terminal): Remove unused variable i. | ||
| 16 | (ns_term_init): Remove unused variables r, g and b. | ||
| 17 | (mouseDown): Remove unused variable window. | ||
| 18 | (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP. | ||
| 19 | (initFrameFromEmacs): Remove unused variable vbextra. | ||
| 20 | (mouseEntered): Remove unused variables p and dpyinfo. | ||
| 21 | (mouseExited): Remove unused variables p and r. | ||
| 22 | (ns_define_frame_cursor, ns_clear_frame_area) | ||
| 23 | (ns_draw_window_cursor, ns_initialize_display_info): Make static. | ||
| 24 | (menuDown): Assign [sender tag] to variable and cast the variable. | ||
| 25 | |||
| 26 | * nsterm.h (menuDown): Add id as type to argument sender. | ||
| 27 | (ns_display_info_for_name): Add Lisp_Object argument. | ||
| 28 | (ns_term_init): Add Lisp_Object argument. | ||
| 29 | (ns_map_event_to_object): Add void argument. | ||
| 30 | (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct | ||
| 31 | prototype with arguments and only declare if __OBJC__. | ||
| 32 | (nxatoms_of_nsselect): Add void argument. | ||
| 33 | (ns_lisp_to_cursor_type): Add Lisp_Object argument. | ||
| 34 | (ns_alloc_autorelease_pool): Add void argument. | ||
| 35 | (ns_release_autorelease_pool): Add void* argument. | ||
| 36 | (ns_get_defaults_value): Add const char* argument. | ||
| 37 | |||
| 38 | * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog) | ||
| 39 | (initFromContents): Use SSDATA where appropriate. | ||
| 40 | (ns_update_menubar): Add braces to ambigous if-else. | ||
| 41 | (initWithTitle): Put () around assignment in if statement. | ||
| 42 | (ns_menu_show): Remove unused variables window and keymap. | ||
| 43 | (update_frame_tool_bar): Remove unused variable selected_p. | ||
| 44 | (initWithContentRect): Remove unused variable this_cmd_name. | ||
| 45 | |||
| 46 | * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where | ||
| 47 | appropriate. | ||
| 48 | (setXBMColor): Remove unused variable len. | ||
| 49 | (setPixmapData): Put () around assignment in loop statement. | ||
| 50 | |||
| 51 | * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script) | ||
| 52 | (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA | ||
| 53 | where appropriate. | ||
| 54 | (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put () | ||
| 55 | around assignment in loop statement. | ||
| 56 | (nsfont_open): Remove unused variable i. | ||
| 57 | (nsfont_open): Remove unused variable len. | ||
| 58 | (nsfont_draw): Remove unused variable cs. | ||
| 59 | |||
| 60 | * nsfns.m (x_set_icon_name, ns_set_name_internal) | ||
| 61 | (ns_set_name_as_filename, ns_implicitly_set_icon_type) | ||
| 62 | (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name) | ||
| 63 | (Fns_get_resource, Fns_set_resource, Fx_open_connection) | ||
| 64 | (Fns_font_name, Fns_perform_service) | ||
| 65 | (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript) | ||
| 66 | (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate. | ||
| 67 | (ns_set_name): Remove unused variable view. | ||
| 68 | (x_set_menu_bar_lines): Remove unused variable olines. | ||
| 69 | (x_set_tool_bar_lines): Remove unused variable root_window. | ||
| 70 | (Fns_list_colors): Put () around assignment in while statement. | ||
| 71 | (Fns_perform_service): Remove unused variable len. | ||
| 72 | (Fns_display_usable_bounds): Remove unused variable top. | ||
| 73 | (syms_of_nsfns): Remove unused variable i. | ||
| 74 | |||
| 3 | * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to | 75 | * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to |
| 4 | memcpy (Bug#11907). | 76 | memcpy (Bug#11907). |
| 5 | 77 | ||
diff --git a/src/nsfns.m b/src/nsfns.m index 47943e5d98a..7c8f673d9ae 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -471,11 +471,11 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 471 | if ([[view window] miniwindowTitle] && | 471 | if ([[view window] miniwindowTitle] && |
| 472 | ([[[view window] miniwindowTitle] | 472 | ([[[view window] miniwindowTitle] |
| 473 | isEqualToString: [NSString stringWithUTF8String: | 473 | isEqualToString: [NSString stringWithUTF8String: |
| 474 | SDATA (arg)]])) | 474 | SSDATA (arg)]])) |
| 475 | return; | 475 | return; |
| 476 | 476 | ||
| 477 | [[view window] setMiniwindowTitle: | 477 | [[view window] setMiniwindowTitle: |
| 478 | [NSString stringWithUTF8String: SDATA (arg)]]; | 478 | [NSString stringWithUTF8String: SSDATA (arg)]]; |
| 479 | } | 479 | } |
| 480 | 480 | ||
| 481 | static void | 481 | static void |
| @@ -490,7 +490,7 @@ ns_set_name_internal (FRAME_PTR f, Lisp_Object name) | |||
| 490 | encoded_name = ENCODE_UTF_8 (name); | 490 | encoded_name = ENCODE_UTF_8 (name); |
| 491 | UNGCPRO; | 491 | UNGCPRO; |
| 492 | 492 | ||
| 493 | str = [NSString stringWithUTF8String: SDATA (encoded_name)]; | 493 | str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; |
| 494 | 494 | ||
| 495 | /* Don't change the name if it's already NAME. */ | 495 | /* Don't change the name if it's already NAME. */ |
| 496 | if (! [[[view window] title] isEqualToString: str]) | 496 | if (! [[[view window] title] isEqualToString: str]) |
| @@ -501,7 +501,7 @@ ns_set_name_internal (FRAME_PTR f, Lisp_Object name) | |||
| 501 | else | 501 | else |
| 502 | encoded_icon_name = ENCODE_UTF_8 (f->icon_name); | 502 | encoded_icon_name = ENCODE_UTF_8 (f->icon_name); |
| 503 | 503 | ||
| 504 | str = [NSString stringWithUTF8String: SDATA (encoded_icon_name)]; | 504 | str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; |
| 505 | 505 | ||
| 506 | if ([[view window] miniwindowTitle] && | 506 | if ([[view window] miniwindowTitle] && |
| 507 | ! [[[view window] miniwindowTitle] isEqualToString: str]) | 507 | ! [[[view window] miniwindowTitle] isEqualToString: str]) |
| @@ -512,7 +512,6 @@ ns_set_name_internal (FRAME_PTR f, Lisp_Object name) | |||
| 512 | static void | 512 | static void |
| 513 | ns_set_name (struct frame *f, Lisp_Object name, int explicit) | 513 | ns_set_name (struct frame *f, Lisp_Object name, int explicit) |
| 514 | { | 514 | { |
| 515 | NSView *view; | ||
| 516 | NSTRACE (ns_set_name); | 515 | NSTRACE (ns_set_name); |
| 517 | 516 | ||
| 518 | if (ns_in_resize) | 517 | if (ns_in_resize) |
| @@ -641,14 +640,14 @@ ns_set_name_as_filename (struct frame *f) | |||
| 641 | title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String] | 640 | title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String] |
| 642 | : [[[view window] title] UTF8String]; | 641 | : [[[view window] title] UTF8String]; |
| 643 | 642 | ||
| 644 | if (title && (! strcmp (title, SDATA (encoded_name)))) | 643 | if (title && (! strcmp (title, SSDATA (encoded_name)))) |
| 645 | { | 644 | { |
| 646 | [pool release]; | 645 | [pool release]; |
| 647 | UNBLOCK_INPUT; | 646 | UNBLOCK_INPUT; |
| 648 | return; | 647 | return; |
| 649 | } | 648 | } |
| 650 | 649 | ||
| 651 | str = [NSString stringWithUTF8String: SDATA (encoded_name)]; | 650 | str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; |
| 652 | if (str == nil) str = @"Bad coding"; | 651 | if (str == nil) str = @"Bad coding"; |
| 653 | 652 | ||
| 654 | if (FRAME_ICONIFIED_P (f)) | 653 | if (FRAME_ICONIFIED_P (f)) |
| @@ -663,7 +662,7 @@ ns_set_name_as_filename (struct frame *f) | |||
| 663 | encoded_filename = ENCODE_UTF_8 (filename); | 662 | encoded_filename = ENCODE_UTF_8 (filename); |
| 664 | UNGCPRO; | 663 | UNGCPRO; |
| 665 | 664 | ||
| 666 | fstr = [NSString stringWithUTF8String: SDATA (encoded_filename)]; | 665 | fstr = [NSString stringWithUTF8String: SSDATA (encoded_filename)]; |
| 667 | if (fstr == nil) fstr = @""; | 666 | if (fstr == nil) fstr = @""; |
| 668 | #ifdef NS_IMPL_COCOA | 667 | #ifdef NS_IMPL_COCOA |
| 669 | /* work around a bug observed on 10.3 and later where | 668 | /* work around a bug observed on 10.3 and later where |
| @@ -706,7 +705,6 @@ void | |||
| 706 | x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | 705 | x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) |
| 707 | { | 706 | { |
| 708 | int nlines; | 707 | int nlines; |
| 709 | int olines = FRAME_MENU_BAR_LINES (f); | ||
| 710 | if (FRAME_MINIBUF_ONLY_P (f)) | 708 | if (FRAME_MINIBUF_ONLY_P (f)) |
| 711 | return; | 709 | return; |
| 712 | 710 | ||
| @@ -737,7 +735,6 @@ void | |||
| 737 | x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | 735 | x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) |
| 738 | { | 736 | { |
| 739 | int nlines; | 737 | int nlines; |
| 740 | Lisp_Object root_window; | ||
| 741 | 738 | ||
| 742 | if (FRAME_MINIBUF_ONLY_P (f)) | 739 | if (FRAME_MINIBUF_ONLY_P (f)) |
| 743 | return; | 740 | return; |
| @@ -780,7 +777,7 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 780 | BLOCK_INPUT; | 777 | BLOCK_INPUT; |
| 781 | pool = [[NSAutoreleasePool alloc] init]; | 778 | pool = [[NSAutoreleasePool alloc] init]; |
| 782 | if (f->output_data.ns->miniimage | 779 | if (f->output_data.ns->miniimage |
| 783 | && [[NSString stringWithUTF8String: SDATA (f->name)] | 780 | && [[NSString stringWithUTF8String: SSDATA (f->name)] |
| 784 | isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) | 781 | isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]]) |
| 785 | { | 782 | { |
| 786 | [pool release]; | 783 | [pool release]; |
| @@ -802,10 +799,10 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 802 | { | 799 | { |
| 803 | elt = XCAR (chain); | 800 | elt = XCAR (chain); |
| 804 | /* special case: 't' means go by file type */ | 801 | /* special case: 't' means go by file type */ |
| 805 | if (SYMBOLP (elt) && EQ (elt, Qt) && SDATA (f->name)[0] == '/') | 802 | if (SYMBOLP (elt) && EQ (elt, Qt) && SSDATA (f->name)[0] == '/') |
| 806 | { | 803 | { |
| 807 | NSString *str | 804 | NSString *str |
| 808 | = [NSString stringWithUTF8String: SDATA (f->name)]; | 805 | = [NSString stringWithUTF8String: SSDATA (f->name)]; |
| 809 | if ([[NSFileManager defaultManager] fileExistsAtPath: str]) | 806 | if ([[NSFileManager defaultManager] fileExistsAtPath: str]) |
| 810 | image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; | 807 | image = [[[NSWorkspace sharedWorkspace] iconForFile: str] retain]; |
| 811 | } | 808 | } |
| @@ -818,7 +815,7 @@ ns_implicitly_set_icon_type (struct frame *f) | |||
| 818 | if (image == nil) | 815 | if (image == nil) |
| 819 | image = [[NSImage imageNamed: | 816 | image = [[NSImage imageNamed: |
| 820 | [NSString stringWithUTF8String: | 817 | [NSString stringWithUTF8String: |
| 821 | SDATA (XCDR (elt))]] retain]; | 818 | SSDATA (XCDR (elt))]] retain]; |
| 822 | } | 819 | } |
| 823 | } | 820 | } |
| 824 | 821 | ||
| @@ -847,7 +844,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 847 | 844 | ||
| 848 | if (!NILP (arg) && SYMBOLP (arg)) | 845 | if (!NILP (arg) && SYMBOLP (arg)) |
| 849 | { | 846 | { |
| 850 | arg =build_string (SDATA (SYMBOL_NAME (arg))); | 847 | arg =build_string (SSDATA (SYMBOL_NAME (arg))); |
| 851 | store_frame_param (f, Qicon_type, arg); | 848 | store_frame_param (f, Qicon_type, arg); |
| 852 | } | 849 | } |
| 853 | 850 | ||
| @@ -863,7 +860,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | |||
| 863 | image = [EmacsImage allocInitFromFile: arg]; | 860 | image = [EmacsImage allocInitFromFile: arg]; |
| 864 | if (image == nil) | 861 | if (image == nil) |
| 865 | image =[NSImage imageNamed: [NSString stringWithUTF8String: | 862 | image =[NSImage imageNamed: [NSString stringWithUTF8String: |
| 866 | SDATA (arg)]]; | 863 | SSDATA (arg)]]; |
| 867 | 864 | ||
| 868 | if (image == nil) | 865 | if (image == nil) |
| 869 | { | 866 | { |
| @@ -892,9 +889,9 @@ ns_lisp_to_cursor_type (Lisp_Object arg) | |||
| 892 | { | 889 | { |
| 893 | char *str; | 890 | char *str; |
| 894 | if (XTYPE (arg) == Lisp_String) | 891 | if (XTYPE (arg) == Lisp_String) |
| 895 | str = SDATA (arg); | 892 | str = SSDATA (arg); |
| 896 | else if (XTYPE (arg) == Lisp_Symbol) | 893 | else if (XTYPE (arg) == Lisp_Symbol) |
| 897 | str = SDATA (SYMBOL_NAME (arg)); | 894 | str = SSDATA (SYMBOL_NAME (arg)); |
| 898 | else return -1; | 895 | else return -1; |
| 899 | if (!strcmp (str, "box")) return FILLED_BOX_CURSOR; | 896 | if (!strcmp (str, "box")) return FILLED_BOX_CURSOR; |
| 900 | if (!strcmp (str, "hollow")) return HOLLOW_BOX_CURSOR; | 897 | if (!strcmp (str, "hollow")) return HOLLOW_BOX_CURSOR; |
| @@ -1493,12 +1490,12 @@ Optional arg INIT, if non-nil, provides a default file name to use. */) | |||
| 1493 | Lisp_Object fname; | 1490 | Lisp_Object fname; |
| 1494 | 1491 | ||
| 1495 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : | 1492 | NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : |
| 1496 | [NSString stringWithUTF8String: SDATA (prompt)]; | 1493 | [NSString stringWithUTF8String: SSDATA (prompt)]; |
| 1497 | NSString *dirS = NILP (dir) || !STRINGP (dir) ? | 1494 | NSString *dirS = NILP (dir) || !STRINGP (dir) ? |
| 1498 | [NSString stringWithUTF8String: SDATA (BVAR (current_buffer, directory))] : | 1495 | [NSString stringWithUTF8String: SSDATA (BVAR (current_buffer, directory))] : |
| 1499 | [NSString stringWithUTF8String: SDATA (dir)]; | 1496 | [NSString stringWithUTF8String: SSDATA (dir)]; |
| 1500 | NSString *initS = NILP (init) || !STRINGP (init) ? nil : | 1497 | NSString *initS = NILP (init) || !STRINGP (init) ? nil : |
| 1501 | [NSString stringWithUTF8String: SDATA (init)]; | 1498 | [NSString stringWithUTF8String: SSDATA (init)]; |
| 1502 | 1499 | ||
| 1503 | check_ns (); | 1500 | check_ns (); |
| 1504 | 1501 | ||
| @@ -1568,9 +1565,9 @@ If OWNER is nil, Emacs is assumed. */) | |||
| 1568 | if (NILP (owner)) | 1565 | if (NILP (owner)) |
| 1569 | owner = build_string([ns_app_name UTF8String]); | 1566 | owner = build_string([ns_app_name UTF8String]); |
| 1570 | CHECK_STRING (name); | 1567 | CHECK_STRING (name); |
| 1571 | /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */ | 1568 | /*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SSDATA (name)); */ |
| 1572 | 1569 | ||
| 1573 | value = ns_get_defaults_value (SDATA (name)); | 1570 | value = ns_get_defaults_value (SSDATA (name)); |
| 1574 | 1571 | ||
| 1575 | if (value) | 1572 | if (value) |
| 1576 | return build_string (value); | 1573 | return build_string (value); |
| @@ -1591,15 +1588,15 @@ If VALUE is nil, the default is removed. */) | |||
| 1591 | if (NILP (value)) | 1588 | if (NILP (value)) |
| 1592 | { | 1589 | { |
| 1593 | [[NSUserDefaults standardUserDefaults] removeObjectForKey: | 1590 | [[NSUserDefaults standardUserDefaults] removeObjectForKey: |
| 1594 | [NSString stringWithUTF8String: SDATA (name)]]; | 1591 | [NSString stringWithUTF8String: SSDATA (name)]]; |
| 1595 | } | 1592 | } |
| 1596 | else | 1593 | else |
| 1597 | { | 1594 | { |
| 1598 | CHECK_STRING (value); | 1595 | CHECK_STRING (value); |
| 1599 | [[NSUserDefaults standardUserDefaults] setObject: | 1596 | [[NSUserDefaults standardUserDefaults] setObject: |
| 1600 | [NSString stringWithUTF8String: SDATA (value)] | 1597 | [NSString stringWithUTF8String: SSDATA (value)] |
| 1601 | forKey: [NSString stringWithUTF8String: | 1598 | forKey: [NSString stringWithUTF8String: |
| 1602 | SDATA (name)]]; | 1599 | SSDATA (name)]]; |
| 1603 | } | 1600 | } |
| 1604 | 1601 | ||
| 1605 | return Qnil; | 1602 | return Qnil; |
| @@ -1795,10 +1792,10 @@ terminate Emacs if we can't open the connection. | |||
| 1795 | { | 1792 | { |
| 1796 | if (!NILP (must_succeed)) | 1793 | if (!NILP (must_succeed)) |
| 1797 | fatal ("OpenStep on %s not responding.\n", | 1794 | fatal ("OpenStep on %s not responding.\n", |
| 1798 | SDATA (display)); | 1795 | SSDATA (display)); |
| 1799 | else | 1796 | else |
| 1800 | error ("OpenStep on %s not responding.\n", | 1797 | error ("OpenStep on %s not responding.\n", |
| 1801 | SDATA (display)); | 1798 | SSDATA (display)); |
| 1802 | } | 1799 | } |
| 1803 | 1800 | ||
| 1804 | /* Register our external input/output types, used for determining | 1801 | /* Register our external input/output types, used for determining |
| @@ -1897,14 +1894,14 @@ font descriptor. If string contains `fontset' and not | |||
| 1897 | { | 1894 | { |
| 1898 | char *nm; | 1895 | char *nm; |
| 1899 | CHECK_STRING (name); | 1896 | CHECK_STRING (name); |
| 1900 | nm = SDATA (name); | 1897 | nm = SSDATA (name); |
| 1901 | 1898 | ||
| 1902 | if (nm[0] != '-') | 1899 | if (nm[0] != '-') |
| 1903 | return name; | 1900 | return name; |
| 1904 | if (strstr (nm, "fontset") && !strstr (nm, "fontset-startup")) | 1901 | if (strstr (nm, "fontset") && !strstr (nm, "fontset-startup")) |
| 1905 | return name; | 1902 | return name; |
| 1906 | 1903 | ||
| 1907 | return build_string (ns_xlfd_to_fontname (SDATA (name))); | 1904 | return build_string (ns_xlfd_to_fontname (SSDATA (name))); |
| 1908 | } | 1905 | } |
| 1909 | 1906 | ||
| 1910 | 1907 | ||
| @@ -1927,14 +1924,14 @@ The optional argument FRAME is currently ignored. */) | |||
| 1927 | BLOCK_INPUT; | 1924 | BLOCK_INPUT; |
| 1928 | 1925 | ||
| 1929 | colorlists = [[NSColorList availableColorLists] objectEnumerator]; | 1926 | colorlists = [[NSColorList availableColorLists] objectEnumerator]; |
| 1930 | while (clist = [colorlists nextObject]) | 1927 | while ((clist = [colorlists nextObject])) |
| 1931 | { | 1928 | { |
| 1932 | if ([[clist name] length] < 7 || | 1929 | if ([[clist name] length] < 7 || |
| 1933 | [[clist name] rangeOfString: @"PANTONE"].location == 0) | 1930 | [[clist name] rangeOfString: @"PANTONE"].location == 0) |
| 1934 | { | 1931 | { |
| 1935 | NSEnumerator *cnames = [[clist allKeys] reverseObjectEnumerator]; | 1932 | NSEnumerator *cnames = [[clist allKeys] reverseObjectEnumerator]; |
| 1936 | NSString *cname; | 1933 | NSString *cname; |
| 1937 | while (cname = [cnames nextObject]) | 1934 | while ((cname = [cnames nextObject])) |
| 1938 | list = Fcons (build_string ([cname UTF8String]), list); | 1935 | list = Fcons (build_string ([cname UTF8String]), list); |
| 1939 | /* for (i = [[clist allKeys] count] - 1; i >= 0; i--) | 1936 | /* for (i = [[clist allKeys] count] - 1; i >= 0; i--) |
| 1940 | list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i] | 1937 | list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i] |
| @@ -2014,12 +2011,11 @@ there was no result. */) | |||
| 2014 | id pb; | 2011 | id pb; |
| 2015 | NSString *svcName; | 2012 | NSString *svcName; |
| 2016 | char *utfStr; | 2013 | char *utfStr; |
| 2017 | int len; | ||
| 2018 | 2014 | ||
| 2019 | CHECK_STRING (service); | 2015 | CHECK_STRING (service); |
| 2020 | check_ns (); | 2016 | check_ns (); |
| 2021 | 2017 | ||
| 2022 | utfStr = SDATA (service); | 2018 | utfStr = SSDATA (service); |
| 2023 | svcName = [NSString stringWithUTF8String: utfStr]; | 2019 | svcName = [NSString stringWithUTF8String: utfStr]; |
| 2024 | 2020 | ||
| 2025 | pb =[NSPasteboard pasteboardWithUniqueName]; | 2021 | pb =[NSPasteboard pasteboardWithUniqueName]; |
| @@ -2044,7 +2040,7 @@ DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc, | |||
| 2044 | NSString *utfStr; | 2040 | NSString *utfStr; |
| 2045 | 2041 | ||
| 2046 | CHECK_STRING (str); | 2042 | CHECK_STRING (str); |
| 2047 | utfStr = [NSString stringWithUTF8String: SDATA (str)]; | 2043 | utfStr = [NSString stringWithUTF8String: SSDATA (str)]; |
| 2048 | if (![utfStr respondsToSelector: | 2044 | if (![utfStr respondsToSelector: |
| 2049 | @selector (precomposedStringWithCanonicalMapping)]) | 2045 | @selector (precomposedStringWithCanonicalMapping)]) |
| 2050 | { | 2046 | { |
| @@ -2074,7 +2070,7 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result) | |||
| 2074 | 2070 | ||
| 2075 | NSAppleScript* scriptObject = | 2071 | NSAppleScript* scriptObject = |
| 2076 | [[NSAppleScript alloc] initWithSource: | 2072 | [[NSAppleScript alloc] initWithSource: |
| 2077 | [NSString stringWithUTF8String: SDATA (script)]]; | 2073 | [NSString stringWithUTF8String: SSDATA (script)]]; |
| 2078 | 2074 | ||
| 2079 | returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; | 2075 | returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; |
| 2080 | [scriptObject release]; | 2076 | [scriptObject release]; |
| @@ -2173,7 +2169,7 @@ In case the execution fails, an error is signaled. */) | |||
| 2173 | else if (!STRINGP (result)) | 2169 | else if (!STRINGP (result)) |
| 2174 | error ("AppleScript error %d", status); | 2170 | error ("AppleScript error %d", status); |
| 2175 | else | 2171 | else |
| 2176 | error ("%s", SDATA (result)); | 2172 | error ("%s", SSDATA (result)); |
| 2177 | } | 2173 | } |
| 2178 | #endif | 2174 | #endif |
| 2179 | 2175 | ||
| @@ -2400,7 +2396,6 @@ frame, a display name (a string), or terminal ID. If omitted or nil, | |||
| 2400 | that stands for the selected frame's display. */) | 2396 | that stands for the selected frame's display. */) |
| 2401 | (Lisp_Object display) | 2397 | (Lisp_Object display) |
| 2402 | { | 2398 | { |
| 2403 | int top; | ||
| 2404 | NSScreen *screen; | 2399 | NSScreen *screen; |
| 2405 | NSRect vScreen; | 2400 | NSRect vScreen; |
| 2406 | 2401 | ||
| @@ -2558,7 +2553,7 @@ Text larger than the specified size is clipped. */) | |||
| 2558 | GCPRO4 (string, parms, frame, timeout); | 2553 | GCPRO4 (string, parms, frame, timeout); |
| 2559 | 2554 | ||
| 2560 | CHECK_STRING (string); | 2555 | CHECK_STRING (string); |
| 2561 | str = SDATA (string); | 2556 | str = SSDATA (string); |
| 2562 | f = check_x_frame (frame); | 2557 | f = check_x_frame (frame); |
| 2563 | if (NILP (timeout)) | 2558 | if (NILP (timeout)) |
| 2564 | timeout = make_number (5); | 2559 | timeout = make_number (5); |
| @@ -2692,8 +2687,6 @@ Value is t if tooltip was open, nil otherwise. */) | |||
| 2692 | void | 2687 | void |
| 2693 | syms_of_nsfns (void) | 2688 | syms_of_nsfns (void) |
| 2694 | { | 2689 | { |
| 2695 | int i; | ||
| 2696 | |||
| 2697 | Qfontsize = intern_c_string ("fontsize"); | 2690 | Qfontsize = intern_c_string ("fontsize"); |
| 2698 | staticpro (&Qfontsize); | 2691 | staticpro (&Qfontsize); |
| 2699 | 2692 | ||
diff --git a/src/nsfont.m b/src/nsfont.m index 7a44182a93e..6f9294e082a 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -100,7 +100,7 @@ ns_get_family (Lisp_Object font_spec) | |||
| 100 | return nil; | 100 | return nil; |
| 101 | else | 101 | else |
| 102 | { | 102 | { |
| 103 | char *tmp = xstrdup (SDATA (SYMBOL_NAME (tem))); | 103 | char *tmp = xstrdup (SSDATA (SYMBOL_NAME (tem))); |
| 104 | NSString *family; | 104 | NSString *family; |
| 105 | ns_unescape_name (tmp); | 105 | ns_unescape_name (tmp); |
| 106 | family = [NSString stringWithUTF8String: tmp]; | 106 | family = [NSString stringWithUTF8String: tmp]; |
| @@ -293,13 +293,13 @@ ns_charset_covers(NSCharacterSet *set1, NSCharacterSet *set2, float pct) | |||
| 293 | static NSString | 293 | static NSString |
| 294 | *ns_lang_to_script (Lisp_Object lang) | 294 | *ns_lang_to_script (Lisp_Object lang) |
| 295 | { | 295 | { |
| 296 | if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ja")) | 296 | if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ja")) |
| 297 | return @"han"; | 297 | return @"han"; |
| 298 | /* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts | 298 | /* NOTE: ja given for any hanzi that's also a kanji, but Chinese fonts |
| 299 | have more characters. */ | 299 | have more characters. */ |
| 300 | else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "zh")) | 300 | else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "zh")) |
| 301 | return @"han"; | 301 | return @"han"; |
| 302 | else if (!strcmp (SDATA (SYMBOL_NAME (lang)), "ko")) | 302 | else if (!strcmp (SSDATA (SYMBOL_NAME (lang)), "ko")) |
| 303 | return @"hangul"; | 303 | return @"hangul"; |
| 304 | else | 304 | else |
| 305 | return @""; | 305 | return @""; |
| @@ -313,7 +313,7 @@ static NSString | |||
| 313 | { | 313 | { |
| 314 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); | 314 | Lisp_Object script = assq_no_quit (XCAR (otf), Votf_script_alist); |
| 315 | return CONSP (script) | 315 | return CONSP (script) |
| 316 | ? [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (XCDR ((script))))] | 316 | ? [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (XCDR ((script))))] |
| 317 | : @""; | 317 | : @""; |
| 318 | } | 318 | } |
| 319 | 319 | ||
| @@ -326,10 +326,10 @@ static NSString | |||
| 326 | while CONSP (rts) | 326 | while CONSP (rts) |
| 327 | { | 327 | { |
| 328 | r = XCAR (XCAR (rts)); | 328 | r = XCAR (XCAR (rts)); |
| 329 | if (!strncmp(SDATA(r), reg, strlen(SDATA(r)))) | 329 | if (!strncmp(SSDATA(r), reg, strlen(SSDATA(r)))) |
| 330 | { | 330 | { |
| 331 | script = XCDR (XCAR (rts)); | 331 | script = XCDR (XCAR (rts)); |
| 332 | return [NSString stringWithUTF8String: SDATA (SYMBOL_NAME (script))]; | 332 | return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (script))]; |
| 333 | } | 333 | } |
| 334 | rts = XCDR (rts); | 334 | rts = XCDR (rts); |
| 335 | } | 335 | } |
| @@ -355,7 +355,7 @@ static NSString | |||
| 355 | Lisp_Object key = XCAR (tmp), val = XCDR (tmp); | 355 | Lisp_Object key = XCAR (tmp), val = XCDR (tmp); |
| 356 | if (EQ (key, QCscript) && SYMBOLP (val)) | 356 | if (EQ (key, QCscript) && SYMBOLP (val)) |
| 357 | return [NSString stringWithUTF8String: | 357 | return [NSString stringWithUTF8String: |
| 358 | SDATA (SYMBOL_NAME (val))]; | 358 | SSDATA (SYMBOL_NAME (val))]; |
| 359 | if (EQ (key, QClang) && SYMBOLP (val)) | 359 | if (EQ (key, QClang) && SYMBOLP (val)) |
| 360 | return ns_lang_to_script (val); | 360 | return ns_lang_to_script (val); |
| 361 | if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val))) | 361 | if (EQ (key, QCotf) && CONSP (val) && SYMBOLP (XCAR (val))) |
| @@ -373,7 +373,7 @@ static NSString | |||
| 373 | if (EQ (reg, Qiso10646_1)) | 373 | if (EQ (reg, Qiso10646_1)) |
| 374 | reg = Qiso8859_1; | 374 | reg = Qiso8859_1; |
| 375 | #endif | 375 | #endif |
| 376 | return ns_registry_to_script (SDATA (SYMBOL_NAME (reg))); | 376 | return ns_registry_to_script (SSDATA (SYMBOL_NAME (reg))); |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | return @""; | 379 | return @""; |
| @@ -464,7 +464,7 @@ static NSSet | |||
| 464 | while (1) | 464 | while (1) |
| 465 | { | 465 | { |
| 466 | NSEnumerator *allFamiliesEnum = [allFamilies objectEnumerator]; | 466 | NSEnumerator *allFamiliesEnum = [allFamilies objectEnumerator]; |
| 467 | while (family = [allFamiliesEnum nextObject]) | 467 | while ((family = [allFamiliesEnum nextObject])) |
| 468 | { | 468 | { |
| 469 | NSCharacterSet *fset = [[fontMgr fontWithFamily: family | 469 | NSCharacterSet *fset = [[fontMgr fontWithFamily: family |
| 470 | traits: 0 weight: 5 size: 12.0] coveredCharacterSet]; | 470 | traits: 0 weight: 5 size: 12.0] coveredCharacterSet]; |
| @@ -528,7 +528,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) | |||
| 528 | NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, | 528 | NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, |
| 529 | [matchingDescs count]); | 529 | [matchingDescs count]); |
| 530 | 530 | ||
| 531 | for (dEnum = [matchingDescs objectEnumerator]; desc = [dEnum nextObject]; ) | 531 | for (dEnum = [matchingDescs objectEnumerator]; (desc = [dEnum nextObject]);) |
| 532 | { | 532 | { |
| 533 | if (![cFamilies containsObject: | 533 | if (![cFamilies containsObject: |
| 534 | [desc objectForKey: NSFontFamilyAttribute]]) | 534 | [desc objectForKey: NSFontFamilyAttribute]]) |
| @@ -664,7 +664,7 @@ nsfont_list_family (Lisp_Object frame) | |||
| 664 | [[[NSFontManager sharedFontManager] availableFontFamilies] | 664 | [[[NSFontManager sharedFontManager] availableFontFamilies] |
| 665 | objectEnumerator]; | 665 | objectEnumerator]; |
| 666 | NSString *family; | 666 | NSString *family; |
| 667 | while (family = [families nextObject]) | 667 | while ((family = [families nextObject])) |
| 668 | list = Fcons (intern ([family UTF8String]), list); | 668 | list = Fcons (intern ([family UTF8String]), list); |
| 669 | /* FIXME: escape the name? */ | 669 | /* FIXME: escape the name? */ |
| 670 | 670 | ||
| @@ -692,7 +692,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 692 | Lisp_Object tem; | 692 | Lisp_Object tem; |
| 693 | NSRect brect; | 693 | NSRect brect; |
| 694 | Lisp_Object font_object; | 694 | Lisp_Object font_object; |
| 695 | int i; | ||
| 696 | int fixLeopardBug; | 695 | int fixLeopardBug; |
| 697 | static NSMutableDictionary *fontCache = nil; | 696 | static NSMutableDictionary *fontCache = nil; |
| 698 | NSNumber *cached; | 697 | NSNumber *cached; |
| @@ -719,7 +718,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 719 | } | 718 | } |
| 720 | 719 | ||
| 721 | tem = AREF (font_entity, FONT_ADSTYLE_INDEX); | 720 | tem = AREF (font_entity, FONT_ADSTYLE_INDEX); |
| 722 | synthItal = !NILP (tem) && !strncmp ("synthItal", SDATA (SYMBOL_NAME (tem)), | 721 | synthItal = !NILP (tem) && !strncmp ("synthItal", SSDATA (SYMBOL_NAME (tem)), |
| 723 | 9); | 722 | 9); |
| 724 | family = ns_get_family (font_entity); | 723 | family = ns_get_family (font_entity); |
| 725 | if (family == nil) | 724 | if (family == nil) |
| @@ -812,7 +811,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 812 | 811 | ||
| 813 | { | 812 | { |
| 814 | const char *fontName = [[nsfont fontName] UTF8String]; | 813 | const char *fontName = [[nsfont fontName] UTF8String]; |
| 815 | int len = strlen (fontName); | ||
| 816 | 814 | ||
| 817 | /* The values specified by fonts are not always exact. For | 815 | /* The values specified by fonts are not always exact. For |
| 818 | * example, a 6x8 font could specify that the descender is | 816 | * example, a 6x8 font could specify that the descender is |
| @@ -1060,7 +1058,6 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1060 | NS to render the string, it will come out differently from the individual | 1058 | NS to render the string, it will come out differently from the individual |
| 1061 | character widths added up because of layout processing. */ | 1059 | character widths added up because of layout processing. */ |
| 1062 | { | 1060 | { |
| 1063 | XCharStruct *cs; | ||
| 1064 | int cwidth, twidth = 0; | 1061 | int cwidth, twidth = 0; |
| 1065 | int hi, lo; | 1062 | int hi, lo; |
| 1066 | /* FIXME: composition: no vertical displacement is considered. */ | 1063 | /* FIXME: composition: no vertical displacement is considered. */ |
diff --git a/src/nsimage.m b/src/nsimage.m index 82a176975ff..1479294948b 100644 --- a/src/nsimage.m +++ b/src/nsimage.m | |||
| @@ -96,7 +96,7 @@ ns_load_image (struct frame *f, struct image *img, | |||
| 96 | { | 96 | { |
| 97 | NSData *data; | 97 | NSData *data; |
| 98 | 98 | ||
| 99 | data = [NSData dataWithBytes: SDATA (spec_data) | 99 | data = [NSData dataWithBytes: SSDATA (spec_data) |
| 100 | length: SBYTES (spec_data)]; | 100 | length: SBYTES (spec_data)]; |
| 101 | eImg = [[EmacsImage alloc] initWithData: data]; | 101 | eImg = [[EmacsImage alloc] initWithData: data]; |
| 102 | [eImg setPixmapData]; | 102 | [eImg setPixmapData]; |
| @@ -171,7 +171,7 @@ static EmacsImage *ImageList = nil; | |||
| 171 | 171 | ||
| 172 | /* look for an existing image of the same name */ | 172 | /* look for an existing image of the same name */ |
| 173 | while (image != nil && | 173 | while (image != nil && |
| 174 | [[image name] compare: [NSString stringWithUTF8String: SDATA (file)]] | 174 | [[image name] compare: [NSString stringWithUTF8String: SSDATA (file)]] |
| 175 | != NSOrderedSame) | 175 | != NSOrderedSame) |
| 176 | image = [image imageListNext]; | 176 | image = [image imageListNext]; |
| 177 | 177 | ||
| @@ -187,7 +187,7 @@ static EmacsImage *ImageList = nil; | |||
| 187 | return nil; | 187 | return nil; |
| 188 | 188 | ||
| 189 | image = [[EmacsImage alloc] initByReferencingFile: | 189 | image = [[EmacsImage alloc] initByReferencingFile: |
| 190 | [NSString stringWithUTF8String: SDATA (found)]]; | 190 | [NSString stringWithUTF8String: SSDATA (found)]]; |
| 191 | 191 | ||
| 192 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 | 192 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 |
| 193 | imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; | 193 | imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; |
| @@ -205,7 +205,7 @@ static EmacsImage *ImageList = nil; | |||
| 205 | [image setScalesWhenResized: YES]; | 205 | [image setScalesWhenResized: YES]; |
| 206 | [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; | 206 | [image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])]; |
| 207 | 207 | ||
| 208 | [image setName: [NSString stringWithUTF8String: SDATA (file)]]; | 208 | [image setName: [NSString stringWithUTF8String: SSDATA (file)]]; |
| 209 | [image reference]; | 209 | [image reference]; |
| 210 | ImageList = [image imageListSetNext: ImageList]; | 210 | ImageList = [image imageListSetNext: ImageList]; |
| 211 | 211 | ||
| @@ -334,7 +334,6 @@ static EmacsImage *ImageList = nil; | |||
| 334 | - setXBMColor: (NSColor *)color | 334 | - setXBMColor: (NSColor *)color |
| 335 | { | 335 | { |
| 336 | NSSize s = [self size]; | 336 | NSSize s = [self size]; |
| 337 | int len = (int) s.width * s.height; | ||
| 338 | unsigned char *planes[5]; | 337 | unsigned char *planes[5]; |
| 339 | CGFloat r, g, b, a; | 338 | CGFloat r, g, b, a; |
| 340 | NSColor *rgbColor; | 339 | NSColor *rgbColor; |
| @@ -400,7 +399,7 @@ static EmacsImage *ImageList = nil; | |||
| 400 | NSImageRep *rep; | 399 | NSImageRep *rep; |
| 401 | 400 | ||
| 402 | reps = [[self representations] objectEnumerator]; | 401 | reps = [[self representations] objectEnumerator]; |
| 403 | while (rep = (NSImageRep *) [reps nextObject]) | 402 | while ((rep = (NSImageRep *) [reps nextObject])) |
| 404 | { | 403 | { |
| 405 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) | 404 | if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)]) |
| 406 | { | 405 | { |
diff --git a/src/nsmenu.m b/src/nsmenu.m index f3bd9dd3ecb..c919f350c6c 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -249,7 +249,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 249 | /* FIXME: we'd like to only parse the needed submenu, but this | 249 | /* FIXME: we'd like to only parse the needed submenu, but this |
| 250 | was causing crashes in the _common parsing code.. need to make | 250 | was causing crashes in the _common parsing code.. need to make |
| 251 | sure proper initialization done.. */ | 251 | sure proper initialization done.. */ |
| 252 | /* if (submenu && strcmp (submenuTitle, SDATA (string))) | 252 | /* if (submenu && strcmp (submenuTitle, SSDATA (string))) |
| 253 | continue; */ | 253 | continue; */ |
| 254 | 254 | ||
| 255 | submenu_start[i] = menu_items_used; | 255 | submenu_start[i] = menu_items_used; |
| @@ -318,8 +318,8 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 318 | if (!EQ (previous_items[i], AREF (menu_items, i))) | 318 | if (!EQ (previous_items[i], AREF (menu_items, i))) |
| 319 | if (!(STRINGP (previous_items[i]) | 319 | if (!(STRINGP (previous_items[i]) |
| 320 | && STRINGP (AREF (menu_items, i)) | 320 | && STRINGP (AREF (menu_items, i)) |
| 321 | && !strcmp (SDATA (previous_items[i]), | 321 | && !strcmp (SSDATA (previous_items[i]), |
| 322 | SDATA (AREF (menu_items, i))))) | 322 | SSDATA (AREF (menu_items, i))))) |
| 323 | break; | 323 | break; |
| 324 | if (i == previous_menu_items_used) | 324 | if (i == previous_menu_items_used) |
| 325 | { | 325 | { |
| @@ -356,7 +356,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 356 | string = AREF (items, i + 1); | 356 | string = AREF (items, i + 1); |
| 357 | if (NILP (string)) | 357 | if (NILP (string)) |
| 358 | break; | 358 | break; |
| 359 | /* if (submenu && strcmp (submenuTitle, SDATA (string))) | 359 | /* if (submenu && strcmp (submenuTitle, SSDATA (string))) |
| 360 | continue; */ | 360 | continue; */ |
| 361 | 361 | ||
| 362 | wv->name = SSDATA (string); | 362 | wv->name = SSDATA (string); |
| @@ -422,11 +422,13 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) | |||
| 422 | if (EQ (string, make_number (0))) // FIXME: Why??? --Stef | 422 | if (EQ (string, make_number (0))) // FIXME: Why??? --Stef |
| 423 | continue; | 423 | continue; |
| 424 | if (NILP (string)) | 424 | if (NILP (string)) |
| 425 | if (previous_strings[i][0]) | 425 | { |
| 426 | break; | 426 | if (previous_strings[i][0]) |
| 427 | else | 427 | break; |
| 428 | continue; | 428 | else |
| 429 | if (memcmp (previous_strings[i], SDATA (string), | 429 | continue; |
| 430 | } | ||
| 431 | else if (memcmp (previous_strings[i], SDATA (string), | ||
| 430 | min (10, SBYTES (string) + 1))) | 432 | min (10, SBYTES (string) + 1))) |
| 431 | break; | 433 | break; |
| 432 | } | 434 | } |
| @@ -528,7 +530,7 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p) | |||
| 528 | /* override designated initializer */ | 530 | /* override designated initializer */ |
| 529 | - initWithTitle: (NSString *)title | 531 | - initWithTitle: (NSString *)title |
| 530 | { | 532 | { |
| 531 | if (self = [super initWithTitle: title]) | 533 | if ((self = [super initWithTitle: title])) |
| 532 | [self setAutoenablesItems: NO]; | 534 | [self setAutoenablesItems: NO]; |
| 533 | return self; | 535 | return self; |
| 534 | } | 536 | } |
| @@ -793,7 +795,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 793 | { | 795 | { |
| 794 | EmacsMenu *pmenu; | 796 | EmacsMenu *pmenu; |
| 795 | NSPoint p; | 797 | NSPoint p; |
| 796 | Lisp_Object window, tem, keymap; | 798 | Lisp_Object tem; |
| 797 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); | 799 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); |
| 798 | widget_value *wv, *first_wv = 0; | 800 | widget_value *wv, *first_wv = 0; |
| 799 | 801 | ||
| @@ -990,7 +992,7 @@ ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, | |||
| 990 | } | 992 | } |
| 991 | 993 | ||
| 992 | pmenu = [[EmacsMenu alloc] initWithTitle: | 994 | pmenu = [[EmacsMenu alloc] initWithTitle: |
| 993 | [NSString stringWithUTF8String: SDATA (title)]]; | 995 | [NSString stringWithUTF8String: SSDATA (title)]]; |
| 994 | [pmenu fillWithWidgetValue: first_wv->contents]; | 996 | [pmenu fillWithWidgetValue: first_wv->contents]; |
| 995 | free_menubar_widget_value_tree (first_wv); | 997 | free_menubar_widget_value_tree (first_wv); |
| 996 | unbind_to (specpdl_count, Qnil); | 998 | unbind_to (specpdl_count, Qnil); |
| @@ -1043,7 +1045,6 @@ update_frame_tool_bar (FRAME_PTR f) | |||
| 1043 | i * TOOL_BAR_ITEM_NSLOTS + (IDX)) | 1045 | i * TOOL_BAR_ITEM_NSLOTS + (IDX)) |
| 1044 | 1046 | ||
| 1045 | BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); | 1047 | BOOL enabled_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_ENABLED_P)); |
| 1046 | BOOL selected_p = !NILP (TOOLPROP (TOOL_BAR_ITEM_SELECTED_P)); | ||
| 1047 | int idx; | 1048 | int idx; |
| 1048 | ptrdiff_t img_id; | 1049 | ptrdiff_t img_id; |
| 1049 | struct image *img; | 1050 | struct image *img; |
| @@ -1473,7 +1474,6 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1473 | { | 1474 | { |
| 1474 | NSSize spacing = {SPACER, SPACER}; | 1475 | NSSize spacing = {SPACER, SPACER}; |
| 1475 | NSRect area; | 1476 | NSRect area; |
| 1476 | char this_cmd_name[80]; | ||
| 1477 | id cell; | 1477 | id cell; |
| 1478 | static NSImageView *imgView; | 1478 | static NSImageView *imgView; |
| 1479 | static FlippedView *contentView; | 1479 | static FlippedView *contentView; |
| @@ -1581,11 +1581,11 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1581 | item = XCAR (list); | 1581 | item = XCAR (list); |
| 1582 | if (XTYPE (item) == Lisp_String) | 1582 | if (XTYPE (item) == Lisp_String) |
| 1583 | { | 1583 | { |
| 1584 | [window addString: SDATA (item) row: row++]; | 1584 | [window addString: SSDATA (item) row: row++]; |
| 1585 | } | 1585 | } |
| 1586 | else if (XTYPE (item) == Lisp_Cons) | 1586 | else if (XTYPE (item) == Lisp_Cons) |
| 1587 | { | 1587 | { |
| 1588 | [window addButton: SDATA (XCAR (item)) | 1588 | [window addButton: SSDATA (XCAR (item)) |
| 1589 | value: XCDR (item) row: row++]; | 1589 | value: XCDR (item) row: row++]; |
| 1590 | } | 1590 | } |
| 1591 | else if (NILP (item)) | 1591 | else if (NILP (item)) |
| @@ -1675,7 +1675,7 @@ void process_dialog (id window, Lisp_Object list) | |||
| 1675 | 1675 | ||
| 1676 | if (XTYPE (head) == Lisp_String) | 1676 | if (XTYPE (head) == Lisp_String) |
| 1677 | [title setStringValue: | 1677 | [title setStringValue: |
| 1678 | [NSString stringWithUTF8String: SDATA (head)]]; | 1678 | [NSString stringWithUTF8String: SSDATA (head)]]; |
| 1679 | else if (isQ == YES) | 1679 | else if (isQ == YES) |
| 1680 | [title setStringValue: @"Question"]; | 1680 | [title setStringValue: @"Question"]; |
| 1681 | else | 1681 | else |
diff --git a/src/nsterm.h b/src/nsterm.h index abfdfd4803a..b20621a53d7 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -89,7 +89,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /* AppKit-side interface */ | 91 | /* AppKit-side interface */ |
| 92 | - menuDown: sender; | 92 | - menuDown: (id)sender; |
| 93 | - toolbarClicked: (id)item; | 93 | - toolbarClicked: (id)item; |
| 94 | - toggleToolbar: (id)sender; | 94 | - toggleToolbar: (id)sender; |
| 95 | - (void)keyDown: (NSEvent *)theEvent; | 95 | - (void)keyDown: (NSEvent *)theEvent; |
| @@ -535,7 +535,7 @@ struct ns_display_info | |||
| 535 | extern struct ns_display_info *x_display_list; | 535 | extern struct ns_display_info *x_display_list; |
| 536 | 536 | ||
| 537 | extern Lisp_Object ns_display_name_list; | 537 | extern Lisp_Object ns_display_name_list; |
| 538 | extern struct ns_display_info *ns_display_info_for_name (); | 538 | extern struct ns_display_info *ns_display_info_for_name (Lisp_Object name); |
| 539 | 539 | ||
| 540 | struct ns_display_info *check_x_display_info (Lisp_Object frame); | 540 | struct ns_display_info *check_x_display_info (Lisp_Object frame); |
| 541 | FRAME_PTR check_x_frame (Lisp_Object frame); | 541 | FRAME_PTR check_x_frame (Lisp_Object frame); |
| @@ -697,7 +697,7 @@ struct x_output | |||
| 697 | (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \ | 697 | (! (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) ? 0 \ |
| 698 | : FRAME_SCROLL_BAR_COLS (f)) | 698 | : FRAME_SCROLL_BAR_COLS (f)) |
| 699 | 699 | ||
| 700 | extern struct ns_display_info *ns_term_init (); | 700 | extern struct ns_display_info *ns_term_init (Lisp_Object display_name); |
| 701 | extern void ns_term_shutdown (int sig); | 701 | extern void ns_term_shutdown (int sig); |
| 702 | 702 | ||
| 703 | /* constants for text rendering */ | 703 | /* constants for text rendering */ |
| @@ -725,13 +725,15 @@ extern void ns_clear_frame (struct frame *f); | |||
| 725 | extern const char *ns_xlfd_to_fontname (const char *xlfd); | 725 | extern const char *ns_xlfd_to_fontname (const char *xlfd); |
| 726 | 726 | ||
| 727 | extern void check_ns (void); | 727 | extern void check_ns (void); |
| 728 | extern Lisp_Object ns_map_event_to_object (); | 728 | extern Lisp_Object ns_map_event_to_object (void); |
| 729 | extern Lisp_Object ns_string_from_pasteboard (); | 729 | #ifdef __OBJC__ |
| 730 | extern void ns_string_to_pasteboard (); | 730 | extern Lisp_Object ns_string_from_pasteboard (id pb); |
| 731 | extern void ns_string_to_pasteboard (id pb, Lisp_Object str); | ||
| 732 | #endif | ||
| 731 | extern Lisp_Object ns_get_local_selection (Lisp_Object selection_name, | 733 | extern Lisp_Object ns_get_local_selection (Lisp_Object selection_name, |
| 732 | Lisp_Object target_type); | 734 | Lisp_Object target_type); |
| 733 | extern void nxatoms_of_nsselect (); | 735 | extern void nxatoms_of_nsselect (void); |
| 734 | extern int ns_lisp_to_cursor_type (); | 736 | extern int ns_lisp_to_cursor_type (Lisp_Object arg); |
| 735 | extern Lisp_Object ns_cursor_type_to_lisp (int arg); | 737 | extern Lisp_Object ns_cursor_type_to_lisp (int arg); |
| 736 | extern Lisp_Object Qnone; | 738 | extern Lisp_Object Qnone; |
| 737 | extern void ns_set_name_as_filename (struct frame *f); | 739 | extern void ns_set_name_as_filename (struct frame *f); |
| @@ -756,9 +758,9 @@ extern void ns_free_indexed_color (unsigned long idx, struct frame *f); | |||
| 756 | /* C access to ObjC functionality */ | 758 | /* C access to ObjC functionality */ |
| 757 | extern void ns_release_object (void *obj); | 759 | extern void ns_release_object (void *obj); |
| 758 | extern void ns_retain_object (void *obj); | 760 | extern void ns_retain_object (void *obj); |
| 759 | extern void *ns_alloc_autorelease_pool (); | 761 | extern void *ns_alloc_autorelease_pool (void); |
| 760 | extern void ns_release_autorelease_pool (); | 762 | extern void ns_release_autorelease_pool (void *); |
| 761 | extern const char *ns_get_defaults_value (); | 763 | extern const char *ns_get_defaults_value (const char *key); |
| 762 | 764 | ||
| 763 | /* in nsmenu */ | 765 | /* in nsmenu */ |
| 764 | extern void update_frame_tool_bar (FRAME_PTR f); | 766 | extern void update_frame_tool_bar (FRAME_PTR f); |
| @@ -794,6 +796,7 @@ extern void x_set_tool_bar_lines (struct frame *f, | |||
| 794 | extern void x_activate_menubar (struct frame *); | 796 | extern void x_activate_menubar (struct frame *); |
| 795 | extern void free_frame_menubar (struct frame *); | 797 | extern void free_frame_menubar (struct frame *); |
| 796 | extern void x_free_frame_resources (struct frame *); | 798 | extern void x_free_frame_resources (struct frame *); |
| 799 | extern void x_destroy_window (struct frame *); | ||
| 797 | 800 | ||
| 798 | #define NSAPP_DATA2_RUNASSCRIPT 10 | 801 | #define NSAPP_DATA2_RUNASSCRIPT 10 |
| 799 | extern void ns_run_ascript (void); | 802 | extern void ns_run_ascript (void); |
diff --git a/src/nsterm.m b/src/nsterm.m index 0fceb873ae2..ff978d89d0e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -169,7 +169,9 @@ static EmacsScroller *last_mouse_scroll_bar = nil; | |||
| 169 | static struct frame *ns_updating_frame; | 169 | static struct frame *ns_updating_frame; |
| 170 | static NSView *focus_view = NULL; | 170 | static NSView *focus_view = NULL; |
| 171 | static int ns_window_num = 0; | 171 | static int ns_window_num = 0; |
| 172 | #ifdef NS_IMPL_GNUSTEP | ||
| 172 | static NSRect uRect; | 173 | static NSRect uRect; |
| 174 | #endif | ||
| 173 | static BOOL gsaved = NO; | 175 | static BOOL gsaved = NO; |
| 174 | BOOL ns_in_resize = NO; | 176 | BOOL ns_in_resize = NO; |
| 175 | static BOOL ns_fake_keydown = NO; | 177 | static BOOL ns_fake_keydown = NO; |
| @@ -347,7 +349,7 @@ ns_exec_path (void) | |||
| 347 | pathEnum = [paths objectEnumerator]; | 349 | pathEnum = [paths objectEnumerator]; |
| 348 | resourcePaths = @""; | 350 | resourcePaths = @""; |
| 349 | 351 | ||
| 350 | while (resourcePath = [pathEnum nextObject]) | 352 | while ((resourcePath = [pathEnum nextObject])) |
| 351 | { | 353 | { |
| 352 | if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) | 354 | if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) |
| 353 | if (isDir) | 355 | if (isDir) |
| @@ -387,7 +389,7 @@ ns_load_path (void) | |||
| 387 | /* Hack to skip site-lisp. */ | 389 | /* Hack to skip site-lisp. */ |
| 388 | if (no_site_lisp) resourcePath = [pathEnum nextObject]; | 390 | if (no_site_lisp) resourcePath = [pathEnum nextObject]; |
| 389 | 391 | ||
| 390 | while (resourcePath = [pathEnum nextObject]) | 392 | while ((resourcePath = [pathEnum nextObject])) |
| 391 | { | 393 | { |
| 392 | if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) | 394 | if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) |
| 393 | if (isDir) | 395 | if (isDir) |
| @@ -1111,7 +1113,7 @@ x_free_frame_resources (struct frame *f) | |||
| 1111 | NSView *view = FRAME_NS_VIEW (f); | 1113 | NSView *view = FRAME_NS_VIEW (f); |
| 1112 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); | 1114 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); |
| 1113 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 1115 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 1114 | NSTRACE (x_destroy_window); | 1116 | NSTRACE (x_free_frame_resources); |
| 1115 | check_ns (); | 1117 | check_ns (); |
| 1116 | 1118 | ||
| 1117 | [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */ | 1119 | [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */ |
| @@ -1218,7 +1220,6 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) | |||
| 1218 | -------------------------------------------------------------------------- */ | 1220 | -------------------------------------------------------------------------- */ |
| 1219 | { | 1221 | { |
| 1220 | EmacsView *view = FRAME_NS_VIEW (f); | 1222 | EmacsView *view = FRAME_NS_VIEW (f); |
| 1221 | EmacsToolbar *toolbar = [view toolbar]; | ||
| 1222 | NSWindow *window = [view window]; | 1223 | NSWindow *window = [view window]; |
| 1223 | NSRect wr = [window frame]; | 1224 | NSRect wr = [window frame]; |
| 1224 | int tb = FRAME_EXTERNAL_TOOL_BAR (f); | 1225 | int tb = FRAME_EXTERNAL_TOOL_BAR (f); |
| @@ -1503,21 +1504,6 @@ ns_get_color (const char *name, NSColor **col) | |||
| 1503 | } | 1504 | } |
| 1504 | 1505 | ||
| 1505 | 1506 | ||
| 1506 | static NSColor * | ||
| 1507 | ns_get_color_default (const char *name, NSColor *dflt) | ||
| 1508 | /* -------------------------------------------------------------------------- | ||
| 1509 | Parse a color or use a default value | ||
| 1510 | -------------------------------------------------------------------------- */ | ||
| 1511 | { | ||
| 1512 | NSColor * col; | ||
| 1513 | |||
| 1514 | if (ns_get_color (name, &col)) | ||
| 1515 | return dflt; | ||
| 1516 | else | ||
| 1517 | return col; | ||
| 1518 | } | ||
| 1519 | |||
| 1520 | |||
| 1521 | int | 1507 | int |
| 1522 | ns_lisp_to_color (Lisp_Object color, NSColor **col) | 1508 | ns_lisp_to_color (Lisp_Object color, NSColor **col) |
| 1523 | /* -------------------------------------------------------------------------- | 1509 | /* -------------------------------------------------------------------------- |
| @@ -1526,9 +1512,9 @@ ns_lisp_to_color (Lisp_Object color, NSColor **col) | |||
| 1526 | { | 1512 | { |
| 1527 | NSTRACE (ns_lisp_to_color); | 1513 | NSTRACE (ns_lisp_to_color); |
| 1528 | if (STRINGP (color)) | 1514 | if (STRINGP (color)) |
| 1529 | return ns_get_color (SDATA (color), col); | 1515 | return ns_get_color (SSDATA (color), col); |
| 1530 | else if (SYMBOLP (color)) | 1516 | else if (SYMBOLP (color)) |
| 1531 | return ns_get_color (SDATA (SYMBOL_NAME (color)), col); | 1517 | return ns_get_color (SSDATA (SYMBOL_NAME (color)), col); |
| 1532 | return 1; | 1518 | return 1; |
| 1533 | } | 1519 | } |
| 1534 | 1520 | ||
| @@ -1773,7 +1759,6 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, | |||
| 1773 | { | 1759 | { |
| 1774 | id view; | 1760 | id view; |
| 1775 | NSPoint position; | 1761 | NSPoint position; |
| 1776 | int xchar, ychar; | ||
| 1777 | Lisp_Object frame, tail; | 1762 | Lisp_Object frame, tail; |
| 1778 | struct frame *f; | 1763 | struct frame *f; |
| 1779 | struct ns_display_info *dpyinfo; | 1764 | struct ns_display_info *dpyinfo; |
| @@ -1867,7 +1852,7 @@ ns_frame_up_to_date (struct frame *f) | |||
| 1867 | } | 1852 | } |
| 1868 | 1853 | ||
| 1869 | 1854 | ||
| 1870 | void | 1855 | static void |
| 1871 | ns_define_frame_cursor (struct frame *f, Cursor cursor) | 1856 | ns_define_frame_cursor (struct frame *f, Cursor cursor) |
| 1872 | /* -------------------------------------------------------------------------- | 1857 | /* -------------------------------------------------------------------------- |
| 1873 | External (RIF): set frame mouse pointer type. | 1858 | External (RIF): set frame mouse pointer type. |
| @@ -1992,7 +1977,7 @@ ns_clear_frame (struct frame *f) | |||
| 1992 | } | 1977 | } |
| 1993 | 1978 | ||
| 1994 | 1979 | ||
| 1995 | void | 1980 | static void |
| 1996 | ns_clear_frame_area (struct frame *f, int x, int y, int width, int height) | 1981 | ns_clear_frame_area (struct frame *f, int x, int y, int width, int height) |
| 1997 | /* -------------------------------------------------------------------------- | 1982 | /* -------------------------------------------------------------------------- |
| 1998 | External (RIF): Clear section of frame | 1983 | External (RIF): Clear section of frame |
| @@ -2195,8 +2180,7 @@ ns_compute_glyph_string_overhangs (struct glyph_string *s) | |||
| 2195 | External (RIF); compute left/right overhang of whole string and set in s | 2180 | External (RIF); compute left/right overhang of whole string and set in s |
| 2196 | -------------------------------------------------------------------------- */ | 2181 | -------------------------------------------------------------------------- */ |
| 2197 | { | 2182 | { |
| 2198 | struct face *face = FACE_FROM_ID (s->f, s->first_glyph->face_id); | 2183 | struct font *font = s->font; |
| 2199 | struct font *font = s->font; /*face->font; */ | ||
| 2200 | 2184 | ||
| 2201 | if (s->char2b) | 2185 | if (s->char2b) |
| 2202 | { | 2186 | { |
| @@ -2313,7 +2297,7 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row, | |||
| 2313 | } | 2297 | } |
| 2314 | 2298 | ||
| 2315 | 2299 | ||
| 2316 | void | 2300 | static void |
| 2317 | ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, | 2301 | ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, |
| 2318 | int x, int y, int cursor_type, int cursor_width, | 2302 | int x, int y, int cursor_type, int cursor_width, |
| 2319 | int on_p, int active_p) | 2303 | int on_p, int active_p) |
| @@ -3627,7 +3611,6 @@ ns_set_vertical_scroll_bar (struct window *window, | |||
| 3627 | BOOL barOnVeryLeft, barOnVeryRight; | 3611 | BOOL barOnVeryLeft, barOnVeryRight; |
| 3628 | int top, left, height, width, sb_width, sb_left; | 3612 | int top, left, height, width, sb_width, sb_left; |
| 3629 | EmacsScroller *bar; | 3613 | EmacsScroller *bar; |
| 3630 | static int count = 0; | ||
| 3631 | 3614 | ||
| 3632 | /* optimization; display engine sends WAY too many of these.. */ | 3615 | /* optimization; display engine sends WAY too many of these.. */ |
| 3633 | if (!NILP (window->vertical_scroll_bar)) | 3616 | if (!NILP (window->vertical_scroll_bar)) |
| @@ -3809,43 +3792,23 @@ static Lisp_Object ns_string_to_lispmod (const char *s) | |||
| 3809 | Convert modifier name to lisp symbol | 3792 | Convert modifier name to lisp symbol |
| 3810 | -------------------------------------------------------------------------- */ | 3793 | -------------------------------------------------------------------------- */ |
| 3811 | { | 3794 | { |
| 3812 | if (!strncmp (SDATA (SYMBOL_NAME (Qmeta)), s, 10)) | 3795 | if (!strncmp (SSDATA (SYMBOL_NAME (Qmeta)), s, 10)) |
| 3813 | return Qmeta; | 3796 | return Qmeta; |
| 3814 | else if (!strncmp (SDATA (SYMBOL_NAME (Qsuper)), s, 10)) | 3797 | else if (!strncmp (SSDATA (SYMBOL_NAME (Qsuper)), s, 10)) |
| 3815 | return Qsuper; | 3798 | return Qsuper; |
| 3816 | else if (!strncmp (SDATA (SYMBOL_NAME (Qcontrol)), s, 10)) | 3799 | else if (!strncmp (SSDATA (SYMBOL_NAME (Qcontrol)), s, 10)) |
| 3817 | return Qcontrol; | 3800 | return Qcontrol; |
| 3818 | else if (!strncmp (SDATA (SYMBOL_NAME (Qalt)), s, 10)) | 3801 | else if (!strncmp (SSDATA (SYMBOL_NAME (Qalt)), s, 10)) |
| 3819 | return Qalt; | 3802 | return Qalt; |
| 3820 | else if (!strncmp (SDATA (SYMBOL_NAME (Qhyper)), s, 10)) | 3803 | else if (!strncmp (SSDATA (SYMBOL_NAME (Qhyper)), s, 10)) |
| 3821 | return Qhyper; | 3804 | return Qhyper; |
| 3822 | else if (!strncmp (SDATA (SYMBOL_NAME (Qnone)), s, 10)) | 3805 | else if (!strncmp (SSDATA (SYMBOL_NAME (Qnone)), s, 10)) |
| 3823 | return Qnone; | 3806 | return Qnone; |
| 3824 | else | 3807 | else |
| 3825 | return Qnil; | 3808 | return Qnil; |
| 3826 | } | 3809 | } |
| 3827 | 3810 | ||
| 3828 | 3811 | ||
| 3829 | static Lisp_Object ns_mod_to_lisp (int m) | ||
| 3830 | /* -------------------------------------------------------------------------- | ||
| 3831 | Convert modifier code (see lisp.h) to lisp symbol | ||
| 3832 | -------------------------------------------------------------------------- */ | ||
| 3833 | { | ||
| 3834 | if (m == CHAR_META) | ||
| 3835 | return Qmeta; | ||
| 3836 | else if (m == CHAR_SUPER) | ||
| 3837 | return Qsuper; | ||
| 3838 | else if (m == CHAR_CTL) | ||
| 3839 | return Qcontrol; | ||
| 3840 | else if (m == CHAR_ALT) | ||
| 3841 | return Qalt; | ||
| 3842 | else if (m == CHAR_HYPER) | ||
| 3843 | return Qhyper; | ||
| 3844 | else /* if (m == 0) */ | ||
| 3845 | return Qnone; | ||
| 3846 | } | ||
| 3847 | |||
| 3848 | |||
| 3849 | static void | 3812 | static void |
| 3850 | ns_default (const char *parameter, Lisp_Object *result, | 3813 | ns_default (const char *parameter, Lisp_Object *result, |
| 3851 | Lisp_Object yesval, Lisp_Object noval, | 3814 | Lisp_Object yesval, Lisp_Object noval, |
| @@ -3874,7 +3837,7 @@ ns_default (const char *parameter, Lisp_Object *result, | |||
| 3874 | } | 3837 | } |
| 3875 | 3838 | ||
| 3876 | 3839 | ||
| 3877 | void | 3840 | static void |
| 3878 | ns_initialize_display_info (struct ns_display_info *dpyinfo) | 3841 | ns_initialize_display_info (struct ns_display_info *dpyinfo) |
| 3879 | /* -------------------------------------------------------------------------- | 3842 | /* -------------------------------------------------------------------------- |
| 3880 | Initialize global info and storage for display. | 3843 | Initialize global info and storage for display. |
| @@ -3963,7 +3926,6 @@ static void | |||
| 3963 | ns_delete_terminal (struct terminal *terminal) | 3926 | ns_delete_terminal (struct terminal *terminal) |
| 3964 | { | 3927 | { |
| 3965 | struct ns_display_info *dpyinfo = terminal->display_info.ns; | 3928 | struct ns_display_info *dpyinfo = terminal->display_info.ns; |
| 3966 | int i; | ||
| 3967 | 3929 | ||
| 3968 | /* Protect against recursive calls. delete_frame in | 3930 | /* Protect against recursive calls. delete_frame in |
| 3969 | delete_terminal calls us back when it deletes our last frame. */ | 3931 | delete_terminal calls us back when it deletes our last frame. */ |
| @@ -4124,7 +4086,6 @@ ns_term_init (Lisp_Object display_name) | |||
| 4124 | if ( cl == nil ) | 4086 | if ( cl == nil ) |
| 4125 | { | 4087 | { |
| 4126 | Lisp_Object color_file, color_map, color; | 4088 | Lisp_Object color_file, color_map, color; |
| 4127 | int r,g,b; | ||
| 4128 | unsigned long c; | 4089 | unsigned long c; |
| 4129 | char *name; | 4090 | char *name; |
| 4130 | 4091 | ||
| @@ -4141,7 +4102,7 @@ ns_term_init (Lisp_Object display_name) | |||
| 4141 | for ( ; CONSP (color_map); color_map = XCDR (color_map)) | 4102 | for ( ; CONSP (color_map); color_map = XCDR (color_map)) |
| 4142 | { | 4103 | { |
| 4143 | color = XCAR (color_map); | 4104 | color = XCAR (color_map); |
| 4144 | name = SDATA (XCAR (color)); | 4105 | name = SSDATA (XCAR (color)); |
| 4145 | c = XINT (XCDR (color)); | 4106 | c = XINT (XCDR (color)); |
| 4146 | [cl setColor: | 4107 | [cl setColor: |
| 4147 | [NSColor colorWithCalibratedRed: RED_FROM_ULONG (c) / 255.0 | 4108 | [NSColor colorWithCalibratedRed: RED_FROM_ULONG (c) / 255.0 |
| @@ -4253,7 +4214,7 @@ ns_term_shutdown (int sig) | |||
| 4253 | 4214 | ||
| 4254 | /* code not reached in emacs.c after this is called by shut_down_emacs: */ | 4215 | /* code not reached in emacs.c after this is called by shut_down_emacs: */ |
| 4255 | if (STRINGP (Vauto_save_list_file_name)) | 4216 | if (STRINGP (Vauto_save_list_file_name)) |
| 4256 | unlink (SDATA (Vauto_save_list_file_name)); | 4217 | unlink (SSDATA (Vauto_save_list_file_name)); |
| 4257 | 4218 | ||
| 4258 | if (sig == 0 || sig == SIGTERM) | 4219 | if (sig == 0 || sig == SIGTERM) |
| 4259 | { | 4220 | { |
| @@ -4600,7 +4561,7 @@ ns_term_shutdown (int sig) | |||
| 4600 | { | 4561 | { |
| 4601 | [ns_pending_service_names addObject: userData]; | 4562 | [ns_pending_service_names addObject: userData]; |
| 4602 | [ns_pending_service_args addObject: [NSString stringWithUTF8String: | 4563 | [ns_pending_service_args addObject: [NSString stringWithUTF8String: |
| 4603 | SDATA (ns_string_from_pasteboard (pboard))]]; | 4564 | SSDATA (ns_string_from_pasteboard (pboard))]]; |
| 4604 | } | 4565 | } |
| 4605 | 4566 | ||
| 4606 | 4567 | ||
| @@ -4664,8 +4625,8 @@ ns_term_shutdown (int sig) | |||
| 4664 | if (!emacs_event) | 4625 | if (!emacs_event) |
| 4665 | return; | 4626 | return; |
| 4666 | 4627 | ||
| 4667 | if (newFont = [sender convertFont: | 4628 | if ((newFont = [sender convertFont: |
| 4668 | ((struct nsfont_info *)face->font)->nsfont]) | 4629 | ((struct nsfont_info *)face->font)->nsfont])) |
| 4669 | { | 4630 | { |
| 4670 | SET_FRAME_GARBAGED (emacsframe); /* now needed as of 2008/10 */ | 4631 | SET_FRAME_GARBAGED (emacsframe); /* now needed as of 2008/10 */ |
| 4671 | 4632 | ||
| @@ -5141,7 +5102,6 @@ ns_term_shutdown (int sig) | |||
| 5141 | - (void)mouseDown: (NSEvent *)theEvent | 5102 | - (void)mouseDown: (NSEvent *)theEvent |
| 5142 | { | 5103 | { |
| 5143 | NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; | 5104 | NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; |
| 5144 | Lisp_Object window; | ||
| 5145 | 5105 | ||
| 5146 | NSTRACE (mouseDown); | 5106 | NSTRACE (mouseDown); |
| 5147 | 5107 | ||
| @@ -5371,9 +5331,9 @@ ns_term_shutdown (int sig) | |||
| 5371 | 5331 | ||
| 5372 | - (void)windowDidResize: (NSNotification *)notification | 5332 | - (void)windowDidResize: (NSNotification *)notification |
| 5373 | { | 5333 | { |
| 5334 | #ifdef NS_IMPL_GNUSTEP | ||
| 5374 | NSWindow *theWindow = [notification object]; | 5335 | NSWindow *theWindow = [notification object]; |
| 5375 | 5336 | ||
| 5376 | #ifdef NS_IMPL_GNUSTEP | ||
| 5377 | /* in GNUstep, at least currently, it's possible to get a didResize | 5337 | /* in GNUstep, at least currently, it's possible to get a didResize |
| 5378 | without getting a willResize.. therefore we need to act as if we got | 5338 | without getting a willResize.. therefore we need to act as if we got |
| 5379 | the willResize now */ | 5339 | the willResize now */ |
| @@ -5493,7 +5453,6 @@ ns_term_shutdown (int sig) | |||
| 5493 | Lisp_Object tem; | 5453 | Lisp_Object tem; |
| 5494 | NSWindow *win; | 5454 | NSWindow *win; |
| 5495 | NSButton *toggleButton; | 5455 | NSButton *toggleButton; |
| 5496 | int vbextra = NS_SCROLL_BAR_WIDTH (f); | ||
| 5497 | NSSize sz; | 5456 | NSSize sz; |
| 5498 | NSColor *col; | 5457 | NSColor *col; |
| 5499 | NSString *name; | 5458 | NSString *name; |
| @@ -5546,7 +5505,7 @@ ns_term_shutdown (int sig) | |||
| 5546 | 5505 | ||
| 5547 | tem = f->name; | 5506 | tem = f->name; |
| 5548 | name = [NSString stringWithUTF8String: | 5507 | name = [NSString stringWithUTF8String: |
| 5549 | NILP (tem) ? (unsigned char *)"Emacs" : SDATA (tem)]; | 5508 | NILP (tem) ? "Emacs" : SSDATA (tem)]; |
| 5550 | [win setTitle: name]; | 5509 | [win setTitle: name]; |
| 5551 | 5510 | ||
| 5552 | /* toolbar support */ | 5511 | /* toolbar support */ |
| @@ -5565,7 +5524,7 @@ ns_term_shutdown (int sig) | |||
| 5565 | tem = f->icon_name; | 5524 | tem = f->icon_name; |
| 5566 | if (!NILP (tem)) | 5525 | if (!NILP (tem)) |
| 5567 | [win setMiniwindowTitle: | 5526 | [win setMiniwindowTitle: |
| 5568 | [NSString stringWithUTF8String: SDATA (tem)]]; | 5527 | [NSString stringWithUTF8String: SSDATA (tem)]]; |
| 5569 | 5528 | ||
| 5570 | { | 5529 | { |
| 5571 | NSScreen *screen = [win screen]; | 5530 | NSScreen *screen = [win screen]; |
| @@ -5710,18 +5669,13 @@ ns_term_shutdown (int sig) | |||
| 5710 | 5669 | ||
| 5711 | - (void)mouseEntered: (NSEvent *)theEvent | 5670 | - (void)mouseEntered: (NSEvent *)theEvent |
| 5712 | { | 5671 | { |
| 5713 | NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; | ||
| 5714 | struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); | ||
| 5715 | NSTRACE (mouseEntered); | 5672 | NSTRACE (mouseEntered); |
| 5716 | |||
| 5717 | last_mouse_movement_time = EV_TIMESTAMP (theEvent); | 5673 | last_mouse_movement_time = EV_TIMESTAMP (theEvent); |
| 5718 | } | 5674 | } |
| 5719 | 5675 | ||
| 5720 | 5676 | ||
| 5721 | - (void)mouseExited: (NSEvent *)theEvent | 5677 | - (void)mouseExited: (NSEvent *)theEvent |
| 5722 | { | 5678 | { |
| 5723 | NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; | ||
| 5724 | NSRect r; | ||
| 5725 | Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL; | 5679 | Mouse_HLInfo *hlinfo = emacsframe ? MOUSE_HL_INFO (emacsframe) : NULL; |
| 5726 | 5680 | ||
| 5727 | NSTRACE (mouseExited); | 5681 | NSTRACE (mouseExited); |
| @@ -5744,10 +5698,14 @@ ns_term_shutdown (int sig) | |||
| 5744 | NSTRACE (menuDown); | 5698 | NSTRACE (menuDown); |
| 5745 | if (context_menu_value == -1) | 5699 | if (context_menu_value == -1) |
| 5746 | context_menu_value = [sender tag]; | 5700 | context_menu_value = [sender tag]; |
| 5747 | else | 5701 | else |
| 5748 | find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, | 5702 | { |
| 5749 | emacsframe->menu_bar_vector, | 5703 | NSInteger tag = [sender tag]; |
| 5750 | (void *)[sender tag]); | 5704 | find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, |
| 5705 | emacsframe->menu_bar_vector, | ||
| 5706 | (void *)tag); | ||
| 5707 | } | ||
| 5708 | |||
| 5751 | ns_send_appdefined (-1); | 5709 | ns_send_appdefined (-1); |
| 5752 | return self; | 5710 | return self; |
| 5753 | } | 5711 | } |