comparison src/xmenu.c @ 23302:dcff2a4b6cb4

(single_submenu) [! HAVE_MULTILINGUAL_MENU]: Make strings unibyte. (xmenu_show) [! HAVE_MULTILINGUAL_MENU]: Likewise.
author Kenichi Handa <handa@m17n.org>
date Tue, 22 Sep 1998 10:33:09 +0000
parents fa9ff387d260
children 825f11b1c34d
comparison
equal deleted inserted replaced
23301:5f08a9f278b1 23302:dcff2a4b6cb4
60 #endif 60 #endif
61 61
62 #include "dispextern.h" 62 #include "dispextern.h"
63 63
64 #ifdef HAVE_X_WINDOWS 64 #ifdef HAVE_X_WINDOWS
65 #undef HAVE_MULTILINGUAL_MENU
65 #ifdef USE_X_TOOLKIT 66 #ifdef USE_X_TOOLKIT
66 #include <X11/Xlib.h> 67 #include <X11/Xlib.h>
67 #include <X11/IntrinsicP.h> 68 #include <X11/IntrinsicP.h>
68 #include <X11/CoreP.h> 69 #include <X11/CoreP.h>
69 #include <X11/StringDefs.h> 70 #include <X11/StringDefs.h>
1369 /* Create a new pane. */ 1370 /* Create a new pane. */
1370 Lisp_Object pane_name, prefix; 1371 Lisp_Object pane_name, prefix;
1371 char *pane_string; 1372 char *pane_string;
1372 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; 1373 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
1373 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; 1374 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
1375 #ifndef HAVE_MULTILINGUAL_MENU
1376 if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name))
1377 pane_name = string_make_unibyte (pane_name);
1378 #endif
1374 pane_string = (NILP (pane_name) 1379 pane_string = (NILP (pane_name)
1375 ? "" : (char *) XSTRING (pane_name)->data); 1380 ? "" : (char *) XSTRING (pane_name)->data);
1376 /* If there is just one top-level pane, put all its items directly 1381 /* If there is just one top-level pane, put all its items directly
1377 under the top-level menu. */ 1382 under the top-level menu. */
1378 if (menu_items_n_panes == 1) 1383 if (menu_items_n_panes == 1)
1407 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; 1412 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME];
1408 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; 1413 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
1409 descrip 1414 descrip
1410 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; 1415 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
1411 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION]; 1416 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION];
1412 1417 #ifndef HAVE_MULTILINGUAL_MENU
1418 if (STRING_MULTIBYTE (item_name))
1419 item_name = string_make_unibyte (item_name);
1420 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1421 descrip = string_make_unibyte (descrip);
1422 #endif
1413 wv = xmalloc_widget_value (); 1423 wv = xmalloc_widget_value ();
1414 if (prev_wv) 1424 if (prev_wv)
1415 prev_wv->next = wv; 1425 prev_wv->next = wv;
1416 else 1426 else
1417 save_wv->contents = wv; 1427 save_wv->contents = wv;
1903 /* Create a new pane. */ 1913 /* Create a new pane. */
1904 Lisp_Object pane_name, prefix; 1914 Lisp_Object pane_name, prefix;
1905 char *pane_string; 1915 char *pane_string;
1906 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; 1916 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
1907 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; 1917 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
1918 #ifndef HAVE_MULTILINGUAL_MENU
1919 if (!NILP (pane_name) && STRING_MULTIBYTE (pane_name))
1920 pane_name = string_make_unibyte (pane_name);
1921 #endif
1908 pane_string = (NILP (pane_name) 1922 pane_string = (NILP (pane_name)
1909 ? "" : (char *) XSTRING (pane_name)->data); 1923 ? "" : (char *) XSTRING (pane_name)->data);
1910 /* If there is just one top-level pane, put all its items directly 1924 /* If there is just one top-level pane, put all its items directly
1911 under the top-level menu. */ 1925 under the top-level menu. */
1912 if (menu_items_n_panes == 1) 1926 if (menu_items_n_panes == 1)
1945 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME]; 1959 item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME];
1946 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE]; 1960 enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
1947 descrip 1961 descrip
1948 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; 1962 = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
1949 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION]; 1963 def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION];
1964 #ifndef HAVE_MULTILINGUAL_MENU
1965 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
1966 item_name = string_make_unibyte (item_name);
1967 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1968 item_name = string_make_unibyte (descrip);
1969 #endif
1950 1970
1951 wv = xmalloc_widget_value (); 1971 wv = xmalloc_widget_value ();
1952 if (prev_wv) 1972 if (prev_wv)
1953 prev_wv->next = wv; 1973 prev_wv->next = wv;
1954 else 1974 else
1980 wv_sep2->next = first_wv->contents; 2000 wv_sep2->next = first_wv->contents;
1981 2001
1982 wv_sep1->name = "--"; 2002 wv_sep1->name = "--";
1983 wv_sep1->next = wv_sep2; 2003 wv_sep1->next = wv_sep2;
1984 2004
2005 #ifndef HAVE_MULTILINGUAL_MENU
2006 if (STRING_MULTIBYTE (title))
2007 title = string_make_unibyte (title);
2008 #endif
1985 wv_title->name = (char *) XSTRING (title)->data; 2009 wv_title->name = (char *) XSTRING (title)->data;
1986 wv_title->enabled = True; 2010 wv_title->enabled = True;
1987 wv_title->next = wv_sep1; 2011 wv_title->next = wv_sep1;
1988 first_wv->contents = wv_title; 2012 first_wv->contents = wv_title;
1989 } 2013 }