diff options
| author | Stefan Monnier | 2001-10-30 03:44:08 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-30 03:44:08 +0000 |
| commit | cc45fb4031a234b9c99549e54c4b0612af3d28cd (patch) | |
| tree | 94a6b8549bedf7aacd736a51e062208a07c64af0 | |
| parent | b2123f814237f1fb529c3ebfed6ba40f790e08b9 (diff) | |
| download | emacs-cc45fb4031a234b9c99549e54c4b0612af3d28cd.tar.gz emacs-cc45fb4031a234b9c99549e54c4b0612af3d28cd.zip | |
Include coding.h and charset.h.
(Fx_popup_menu): Use FRAME_PTR and FRAME_FONT and FRAME_LINE_HEIGHT.
(Fx_popup_dialog): Use FRAME_PTR and enum scroll_bar_part.
(single_submenu, xmenu_show): Use ENCODE_SYSTEM.
Explicitly set wv->help. Use `TRUE' rather than `True'.
(menu_help_callback): Use empty_string.
| -rw-r--r-- | src/xmenu.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 341993ad3df..e974dfe312c 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -46,6 +46,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 46 | #include "window.h" | 46 | #include "window.h" |
| 47 | #include "blockinput.h" | 47 | #include "blockinput.h" |
| 48 | #include "buffer.h" | 48 | #include "buffer.h" |
| 49 | #include "charset.h" | ||
| 50 | #include "coding.h" | ||
| 49 | 51 | ||
| 50 | #ifdef MSDOS | 52 | #ifdef MSDOS |
| 51 | #include "msdos.h" | 53 | #include "msdos.h" |
| @@ -111,9 +113,6 @@ extern XtAppContext Xt_app_con; | |||
| 111 | 113 | ||
| 112 | static Lisp_Object xdialog_show (); | 114 | static Lisp_Object xdialog_show (); |
| 113 | void popup_get_selection (); | 115 | void popup_get_selection (); |
| 114 | #endif | ||
| 115 | |||
| 116 | #ifdef USE_X_TOOLKIT | ||
| 117 | 116 | ||
| 118 | /* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ | 117 | /* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ |
| 119 | 118 | ||
| @@ -697,7 +696,7 @@ cached information about equivalent key sequences. */) | |||
| 697 | Lisp_Object title; | 696 | Lisp_Object title; |
| 698 | char *error_name; | 697 | char *error_name; |
| 699 | Lisp_Object selection; | 698 | Lisp_Object selection; |
| 700 | struct frame *f = NULL; | 699 | FRAME_PTR f = NULL; |
| 701 | Lisp_Object x, y, window; | 700 | Lisp_Object x, y, window; |
| 702 | int keymaps = 0; | 701 | int keymaps = 0; |
| 703 | int for_click = 0; | 702 | int for_click = 0; |
| @@ -767,9 +766,9 @@ cached information about equivalent key sequences. */) | |||
| 767 | CHECK_LIVE_WINDOW (window, 0); | 766 | CHECK_LIVE_WINDOW (window, 0); |
| 768 | f = XFRAME (WINDOW_FRAME (XWINDOW (window))); | 767 | f = XFRAME (WINDOW_FRAME (XWINDOW (window))); |
| 769 | 768 | ||
| 770 | xpos = (FONT_WIDTH (f->output_data.x->font) | 769 | xpos = (FONT_WIDTH (FRAME_FONT (f)) |
| 771 | * XFASTINT (XWINDOW (window)->left)); | 770 | * XFASTINT (XWINDOW (window)->left)); |
| 772 | ypos = (f->output_data.x->line_height | 771 | ypos = (FRAME_LINE_HEIGHT (f) |
| 773 | * XFASTINT (XWINDOW (window)->top)); | 772 | * XFASTINT (XWINDOW (window)->top)); |
| 774 | } | 773 | } |
| 775 | else | 774 | else |
| @@ -899,7 +898,7 @@ on the left of the dialog box and all following items on the right. | |||
| 899 | (position, contents) | 898 | (position, contents) |
| 900 | Lisp_Object position, contents; | 899 | Lisp_Object position, contents; |
| 901 | { | 900 | { |
| 902 | struct frame * f = NULL; | 901 | FRAME_PTR f = NULL; |
| 903 | Lisp_Object window; | 902 | Lisp_Object window; |
| 904 | 903 | ||
| 905 | check_x (); | 904 | check_x (); |
| @@ -913,7 +912,7 @@ on the left of the dialog box and all following items on the right. | |||
| 913 | /* Use the mouse's current position. */ | 912 | /* Use the mouse's current position. */ |
| 914 | FRAME_PTR new_f = SELECTED_FRAME (); | 913 | FRAME_PTR new_f = SELECTED_FRAME (); |
| 915 | Lisp_Object bar_window; | 914 | Lisp_Object bar_window; |
| 916 | int part; | 915 | enum scroll_bar_part part; |
| 917 | unsigned long time; | 916 | unsigned long time; |
| 918 | Lisp_Object x, y; | 917 | Lisp_Object x, y; |
| 919 | 918 | ||
| @@ -1449,7 +1448,7 @@ single_submenu (item_key, item_name, maps) | |||
| 1449 | #ifndef HAVE_MULTILINGUAL_MENU | 1448 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1450 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 1449 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 1451 | { | 1450 | { |
| 1452 | pane_name = string_make_unibyte (pane_name); | 1451 | pane_name = ENCODE_SYSTEM (pane_name); |
| 1453 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 1452 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 1454 | } | 1453 | } |
| 1455 | #endif | 1454 | #endif |
| @@ -1500,13 +1499,13 @@ single_submenu (item_key, item_name, maps) | |||
| 1500 | #ifndef HAVE_MULTILINGUAL_MENU | 1499 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1501 | if (STRING_MULTIBYTE (item_name)) | 1500 | if (STRING_MULTIBYTE (item_name)) |
| 1502 | { | 1501 | { |
| 1503 | item_name = string_make_unibyte (item_name); | 1502 | item_name = ENCODE_SYSTEM (item_name); |
| 1504 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; | 1503 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; |
| 1505 | } | 1504 | } |
| 1506 | 1505 | ||
| 1507 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 1506 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
| 1508 | { | 1507 | { |
| 1509 | descrip = string_make_unibyte (descrip); | 1508 | descrip = ENCODE_SYSTEM (descrip); |
| 1510 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; | 1509 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; |
| 1511 | } | 1510 | } |
| 1512 | #endif /* not HAVE_MULTILINGUAL_MENU */ | 1511 | #endif /* not HAVE_MULTILINGUAL_MENU */ |
| @@ -1537,8 +1536,10 @@ single_submenu (item_key, item_name, maps) | |||
| 1537 | 1536 | ||
| 1538 | wv->selected = !NILP (selected); | 1537 | wv->selected = !NILP (selected); |
| 1539 | if (STRINGP (help)) | 1538 | if (STRINGP (help)) |
| 1540 | wv->help = XSTRING (help)->data; | 1539 | wv->help = (char *) XSTRING (help)->data; |
| 1541 | 1540 | else | |
| 1541 | wv->help = NULL; | ||
| 1542 | |||
| 1542 | prev_wv = wv; | 1543 | prev_wv = wv; |
| 1543 | 1544 | ||
| 1544 | i += MENU_ITEMS_ITEM_LENGTH; | 1545 | i += MENU_ITEMS_ITEM_LENGTH; |
| @@ -1617,6 +1618,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1617 | Lisp_Object items; | 1618 | Lisp_Object items; |
| 1618 | widget_value *wv, *first_wv, *prev_wv = 0; | 1619 | widget_value *wv, *first_wv, *prev_wv = 0; |
| 1619 | int i; | 1620 | int i; |
| 1621 | |||
| 1620 | LWLIB_ID id; | 1622 | LWLIB_ID id; |
| 1621 | 1623 | ||
| 1622 | XSETFRAME (Vmenu_updating_frame, f); | 1624 | XSETFRAME (Vmenu_updating_frame, f); |
| @@ -2040,7 +2042,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2040 | #ifndef HAVE_MULTILINGUAL_MENU | 2042 | #ifndef HAVE_MULTILINGUAL_MENU |
| 2041 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 2043 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 2042 | { | 2044 | { |
| 2043 | pane_name = string_make_unibyte (pane_name); | 2045 | pane_name = ENCODE_SYSTEM (pane_name); |
| 2044 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 2046 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 2045 | } | 2047 | } |
| 2046 | #endif | 2048 | #endif |
| @@ -2093,13 +2095,13 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2093 | #ifndef HAVE_MULTILINGUAL_MENU | 2095 | #ifndef HAVE_MULTILINGUAL_MENU |
| 2094 | if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) | 2096 | if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) |
| 2095 | { | 2097 | { |
| 2096 | item_name = string_make_unibyte (item_name); | 2098 | item_name = ENCODE_SYSTEM (item_name); |
| 2097 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; | 2099 | AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; |
| 2098 | } | 2100 | } |
| 2099 | 2101 | ||
| 2100 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) | 2102 | if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) |
| 2101 | { | 2103 | { |
| 2102 | descrip = string_make_unibyte (descrip); | 2104 | descrip = ENCODE_SYSTEM (descrip); |
| 2103 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; | 2105 | AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; |
| 2104 | } | 2106 | } |
| 2105 | #endif /* not HAVE_MULTILINGUAL_MENU */ | 2107 | #endif /* not HAVE_MULTILINGUAL_MENU */ |
| @@ -2130,9 +2132,12 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2130 | abort (); | 2132 | abort (); |
| 2131 | 2133 | ||
| 2132 | wv->selected = !NILP (selected); | 2134 | wv->selected = !NILP (selected); |
| 2133 | if (STRINGP (help)) | 2135 | |
| 2134 | wv->help = XSTRING (help)->data; | 2136 | if (STRINGP (help)) |
| 2135 | 2137 | wv->help = (char *) XSTRING (help)->data; | |
| 2138 | else | ||
| 2139 | wv->help = NULL; | ||
| 2140 | |||
| 2136 | prev_wv = wv; | 2141 | prev_wv = wv; |
| 2137 | 2142 | ||
| 2138 | i += MENU_ITEMS_ITEM_LENGTH; | 2143 | i += MENU_ITEMS_ITEM_LENGTH; |
| @@ -2154,11 +2159,11 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2154 | 2159 | ||
| 2155 | #ifndef HAVE_MULTILINGUAL_MENU | 2160 | #ifndef HAVE_MULTILINGUAL_MENU |
| 2156 | if (STRING_MULTIBYTE (title)) | 2161 | if (STRING_MULTIBYTE (title)) |
| 2157 | title = string_make_unibyte (title); | 2162 | title = ENCODE_SYSTEM (title); |
| 2158 | #endif | 2163 | #endif |
| 2159 | 2164 | ||
| 2160 | wv_title->name = (char *) XSTRING (title)->data; | 2165 | wv_title->name = (char *) XSTRING (title)->data; |
| 2161 | wv_title->enabled = True; | 2166 | wv_title->enabled = TRUE; |
| 2162 | wv_title->button_type = BUTTON_TYPE_NONE; | 2167 | wv_title->button_type = BUTTON_TYPE_NONE; |
| 2163 | wv_title->next = wv_sep1; | 2168 | wv_title->next = wv_sep1; |
| 2164 | first_wv->contents = wv_title; | 2169 | first_wv->contents = wv_title; |
| @@ -2538,7 +2543,7 @@ menu_help_callback (help_string, pane, item) | |||
| 2538 | pane_name = first_item[MENU_ITEMS_PANE_NAME]; | 2543 | pane_name = first_item[MENU_ITEMS_PANE_NAME]; |
| 2539 | else if (EQ (first_item[0], Qquote)) | 2544 | else if (EQ (first_item[0], Qquote)) |
| 2540 | /* This shouldn't happen, see xmenu_show. */ | 2545 | /* This shouldn't happen, see xmenu_show. */ |
| 2541 | pane_name = build_string (""); | 2546 | pane_name = empty_string; |
| 2542 | else | 2547 | else |
| 2543 | pane_name = first_item[MENU_ITEMS_ITEM_NAME]; | 2548 | pane_name = first_item[MENU_ITEMS_ITEM_NAME]; |
| 2544 | 2549 | ||