Mercurial > emacs
comparison src/xmenu.c @ 112434:9de5a68b57e1
Promote SSDATA macro from gtkutil.c and xsmfns.c to lisp.h.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 22 Jan 2011 18:56:06 -0800 |
parents | 417b1e4d63cd |
children |
comparison
equal
deleted
inserted
replaced
112433:7b649f6eac4f | 112434:9de5a68b57e1 |
---|---|
880 #ifdef USE_LUCID | 880 #ifdef USE_LUCID |
881 static void | 881 static void |
882 apply_systemfont_to_dialog (Widget w) | 882 apply_systemfont_to_dialog (Widget w) |
883 { | 883 { |
884 const char *fn = xsettings_get_system_normal_font (); | 884 const char *fn = xsettings_get_system_normal_font (); |
885 if (fn) | 885 if (fn) |
886 { | 886 { |
887 XrmDatabase db = XtDatabase (XtDisplay (w)); | 887 XrmDatabase db = XtDatabase (XtDisplay (w)); |
888 if (db) | 888 if (db) |
889 XrmPutStringResource (&db, "*dialog.faceName", fn); | 889 XrmPutStringResource (&db, "*dialog.faceName", fn); |
890 } | 890 } |
1104 { | 1104 { |
1105 Lisp_Object string; | 1105 Lisp_Object string; |
1106 string = XVECTOR (items)->contents[i + 1]; | 1106 string = XVECTOR (items)->contents[i + 1]; |
1107 if (NILP (string)) | 1107 if (NILP (string)) |
1108 break; | 1108 break; |
1109 wv->name = (char *) SDATA (string); | 1109 wv->name = SSDATA (string); |
1110 update_submenu_strings (wv->contents); | 1110 update_submenu_strings (wv->contents); |
1111 wv = wv->next; | 1111 wv = wv->next; |
1112 } | 1112 } |
1113 | 1113 |
1114 } | 1114 } |
1133 string = XVECTOR (items)->contents[i + 1]; | 1133 string = XVECTOR (items)->contents[i + 1]; |
1134 if (NILP (string)) | 1134 if (NILP (string)) |
1135 break; | 1135 break; |
1136 | 1136 |
1137 wv = xmalloc_widget_value (); | 1137 wv = xmalloc_widget_value (); |
1138 wv->name = (char *) SDATA (string); | 1138 wv->name = SSDATA (string); |
1139 wv->value = 0; | 1139 wv->value = 0; |
1140 wv->enabled = 1; | 1140 wv->enabled = 1; |
1141 wv->button_type = BUTTON_TYPE_NONE; | 1141 wv->button_type = BUTTON_TYPE_NONE; |
1142 wv->help = Qnil; | 1142 wv->help = Qnil; |
1143 /* This prevents lwlib from assuming this | 1143 /* This prevents lwlib from assuming this |
1678 pane_name = ENCODE_MENU_STRING (pane_name); | 1678 pane_name = ENCODE_MENU_STRING (pane_name); |
1679 ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name); | 1679 ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name); |
1680 } | 1680 } |
1681 #endif | 1681 #endif |
1682 pane_string = (NILP (pane_name) | 1682 pane_string = (NILP (pane_name) |
1683 ? "" : (char *) SDATA (pane_name)); | 1683 ? "" : SSDATA (pane_name)); |
1684 /* If there is just one top-level pane, put all its items directly | 1684 /* If there is just one top-level pane, put all its items directly |
1685 under the top-level menu. */ | 1685 under the top-level menu. */ |
1686 if (menu_items_n_panes == 1) | 1686 if (menu_items_n_panes == 1) |
1687 pane_string = ""; | 1687 pane_string = ""; |
1688 | 1688 |
1743 wv = xmalloc_widget_value (); | 1743 wv = xmalloc_widget_value (); |
1744 if (prev_wv) | 1744 if (prev_wv) |
1745 prev_wv->next = wv; | 1745 prev_wv->next = wv; |
1746 else | 1746 else |
1747 save_wv->contents = wv; | 1747 save_wv->contents = wv; |
1748 wv->name = (char *) SDATA (item_name); | 1748 wv->name = SSDATA (item_name); |
1749 if (!NILP (descrip)) | 1749 if (!NILP (descrip)) |
1750 wv->key = (char *) SDATA (descrip); | 1750 wv->key = SSDATA (descrip); |
1751 wv->value = 0; | 1751 wv->value = 0; |
1752 /* If this item has a null value, | 1752 /* If this item has a null value, |
1753 make the call_data null so that it won't display a box | 1753 make the call_data null so that it won't display a box |
1754 when the mouse is on it. */ | 1754 when the mouse is on it. */ |
1755 wv->call_data | 1755 wv->call_data |
1796 #ifndef HAVE_MULTILINGUAL_MENU | 1796 #ifndef HAVE_MULTILINGUAL_MENU |
1797 if (STRING_MULTIBYTE (title)) | 1797 if (STRING_MULTIBYTE (title)) |
1798 title = ENCODE_MENU_STRING (title); | 1798 title = ENCODE_MENU_STRING (title); |
1799 #endif | 1799 #endif |
1800 | 1800 |
1801 wv_title->name = (char *) SDATA (title); | 1801 wv_title->name = SSDATA (title); |
1802 wv_title->enabled = TRUE; | 1802 wv_title->enabled = TRUE; |
1803 wv_title->button_type = BUTTON_TYPE_NONE; | 1803 wv_title->button_type = BUTTON_TYPE_NONE; |
1804 wv_title->help = Qnil; | 1804 wv_title->help = Qnil; |
1805 wv_title->next = wv_sep1; | 1805 wv_title->next = wv_sep1; |
1806 first_wv->contents = wv_title; | 1806 first_wv->contents = wv_title; |
2017 Lisp_Object pane_name, prefix; | 2017 Lisp_Object pane_name, prefix; |
2018 const char *pane_string; | 2018 const char *pane_string; |
2019 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; | 2019 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; |
2020 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; | 2020 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; |
2021 pane_string = (NILP (pane_name) | 2021 pane_string = (NILP (pane_name) |
2022 ? "" : (char *) SDATA (pane_name)); | 2022 ? "" : SSDATA (pane_name)); |
2023 prev_wv = xmalloc_widget_value (); | 2023 prev_wv = xmalloc_widget_value (); |
2024 prev_wv->value = pane_string; | 2024 prev_wv->value = pane_string; |
2025 if (keymaps && !NILP (prefix)) | 2025 if (keymaps && !NILP (prefix)) |
2026 prev_wv->name++; | 2026 prev_wv->name++; |
2027 prev_wv->enabled = 1; | 2027 prev_wv->enabled = 1; |
2064 | 2064 |
2065 wv = xmalloc_widget_value (); | 2065 wv = xmalloc_widget_value (); |
2066 prev_wv->next = wv; | 2066 prev_wv->next = wv; |
2067 wv->name = (char *) button_names[nb_buttons]; | 2067 wv->name = (char *) button_names[nb_buttons]; |
2068 if (!NILP (descrip)) | 2068 if (!NILP (descrip)) |
2069 wv->key = (char *) SDATA (descrip); | 2069 wv->key = SSDATA (descrip); |
2070 wv->value = (char *) SDATA (item_name); | 2070 wv->value = SSDATA (item_name); |
2071 wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; | 2071 wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; |
2072 wv->enabled = !NILP (enable); | 2072 wv->enabled = !NILP (enable); |
2073 wv->help = Qnil; | 2073 wv->help = Qnil; |
2074 prev_wv = wv; | 2074 prev_wv = wv; |
2075 | 2075 |
2315 maxlines = max (maxlines, lines); | 2315 maxlines = max (maxlines, lines); |
2316 lines = 0; | 2316 lines = 0; |
2317 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 2317 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
2318 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 2318 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
2319 pane_string = (NILP (pane_name) | 2319 pane_string = (NILP (pane_name) |
2320 ? "" : (char *) SDATA (pane_name)); | 2320 ? "" : SSDATA (pane_name)); |
2321 if (keymaps && !NILP (prefix)) | 2321 if (keymaps && !NILP (prefix)) |
2322 pane_string++; | 2322 pane_string++; |
2323 | 2323 |
2324 lpane = XMenuAddPane (FRAME_X_DISPLAY (f), menu, pane_string, TRUE); | 2324 lpane = XMenuAddPane (FRAME_X_DISPLAY (f), menu, pane_string, TRUE); |
2325 if (lpane == XM_FAILURE) | 2325 if (lpane == XM_FAILURE) |
2580 | 2580 |
2581 #ifdef HAVE_MENUS | 2581 #ifdef HAVE_MENUS |
2582 defsubr (&Sx_popup_dialog); | 2582 defsubr (&Sx_popup_dialog); |
2583 #endif | 2583 #endif |
2584 } | 2584 } |
2585 |