Mercurial > emacs
comparison src/w32menu.c @ 46370:40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Mon, 15 Jul 2002 00:00:41 +0000 |
parents | 1fb8f75062c6 |
children | 52f36f4b0e4f |
comparison
equal
deleted
inserted
replaced
46369:dd1d3b1d0053 | 46370:40db0673e6f0 |
---|---|
516 } | 516 } |
517 | 517 |
518 enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; | 518 enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; |
519 item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; | 519 item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; |
520 | 520 |
521 if (!NILP (map) && XSTRING (item_string)->data[0] == '@') | 521 if (!NILP (map) && SREF (item_string, 0) == '@') |
522 { | 522 { |
523 if (!NILP (enabled)) | 523 if (!NILP (enabled)) |
524 /* An enabled separate pane. Remember this to handle it later. */ | 524 /* An enabled separate pane. Remember this to handle it later. */ |
525 *pending_maps_ptr = Fcons (Fcons (map, Fcons (item_string, key)), | 525 *pending_maps_ptr = Fcons (Fcons (map, Fcons (item_string, key)), |
526 *pending_maps_ptr); | 526 *pending_maps_ptr); |
1199 pane_name = ENCODE_SYSTEM (pane_name); | 1199 pane_name = ENCODE_SYSTEM (pane_name); |
1200 AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 1200 AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
1201 } | 1201 } |
1202 #endif | 1202 #endif |
1203 pane_string = (NILP (pane_name) | 1203 pane_string = (NILP (pane_name) |
1204 ? "" : (char *) XSTRING (pane_name)->data); | 1204 ? "" : (char *) SDATA (pane_name)); |
1205 /* If there is just one top-level pane, put all its items directly | 1205 /* If there is just one top-level pane, put all its items directly |
1206 under the top-level menu. */ | 1206 under the top-level menu. */ |
1207 if (menu_items_n_panes == 1) | 1207 if (menu_items_n_panes == 1) |
1208 pane_string = ""; | 1208 pane_string = ""; |
1209 | 1209 |
1263 if (prev_wv) | 1263 if (prev_wv) |
1264 prev_wv->next = wv; | 1264 prev_wv->next = wv; |
1265 else | 1265 else |
1266 save_wv->contents = wv; | 1266 save_wv->contents = wv; |
1267 | 1267 |
1268 wv->name = (char *) XSTRING (item_name)->data; | 1268 wv->name = (char *) SDATA (item_name); |
1269 if (!NILP (descrip)) | 1269 if (!NILP (descrip)) |
1270 wv->key = (char *) XSTRING (descrip)->data; | 1270 wv->key = (char *) SDATA (descrip); |
1271 wv->value = 0; | 1271 wv->value = 0; |
1272 /* The EMACS_INT cast avoids a warning. There's no problem | 1272 /* The EMACS_INT cast avoids a warning. There's no problem |
1273 as long as pointers have enough bits to hold small integers. */ | 1273 as long as pointers have enough bits to hold small integers. */ |
1274 wv->call_data = (!NILP (def) ? (void *) (EMACS_INT) i : 0); | 1274 wv->call_data = (!NILP (def) ? (void *) (EMACS_INT) i : 0); |
1275 wv->enabled = !NILP (enable); | 1275 wv->enabled = !NILP (enable); |
1446 { | 1446 { |
1447 Lisp_Object string; | 1447 Lisp_Object string; |
1448 string = XVECTOR (items)->contents[i + 1]; | 1448 string = XVECTOR (items)->contents[i + 1]; |
1449 if (NILP (string)) | 1449 if (NILP (string)) |
1450 break; | 1450 break; |
1451 wv->name = (char *) XSTRING (string)->data; | 1451 wv->name = (char *) SDATA (string); |
1452 wv = wv->next; | 1452 wv = wv->next; |
1453 } | 1453 } |
1454 | 1454 |
1455 f->menu_bar_vector = menu_items; | 1455 f->menu_bar_vector = menu_items; |
1456 f->menu_bar_items_used = menu_items_used; | 1456 f->menu_bar_items_used = menu_items_used; |
1469 string = XVECTOR (items)->contents[i + 1]; | 1469 string = XVECTOR (items)->contents[i + 1]; |
1470 if (NILP (string)) | 1470 if (NILP (string)) |
1471 break; | 1471 break; |
1472 | 1472 |
1473 wv = xmalloc_widget_value (); | 1473 wv = xmalloc_widget_value (); |
1474 wv->name = (char *) XSTRING (string)->data; | 1474 wv->name = (char *) SDATA (string); |
1475 wv->value = 0; | 1475 wv->value = 0; |
1476 wv->enabled = 1; | 1476 wv->enabled = 1; |
1477 wv->button_type = BUTTON_TYPE_NONE; | 1477 wv->button_type = BUTTON_TYPE_NONE; |
1478 wv->help = Qnil; | 1478 wv->help = Qnil; |
1479 /* This prevents lwlib from assuming this | 1479 /* This prevents lwlib from assuming this |
1660 pane_name = ENCODE_SYSTEM (pane_name); | 1660 pane_name = ENCODE_SYSTEM (pane_name); |
1661 AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 1661 AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
1662 } | 1662 } |
1663 #endif | 1663 #endif |
1664 pane_string = (NILP (pane_name) | 1664 pane_string = (NILP (pane_name) |
1665 ? "" : (char *) XSTRING (pane_name)->data); | 1665 ? "" : (char *) SDATA (pane_name)); |
1666 /* If there is just one top-level pane, put all its items directly | 1666 /* If there is just one top-level pane, put all its items directly |
1667 under the top-level menu. */ | 1667 under the top-level menu. */ |
1668 if (menu_items_n_panes == 1) | 1668 if (menu_items_n_panes == 1) |
1669 pane_string = ""; | 1669 pane_string = ""; |
1670 | 1670 |
1725 wv = xmalloc_widget_value (); | 1725 wv = xmalloc_widget_value (); |
1726 if (prev_wv) | 1726 if (prev_wv) |
1727 prev_wv->next = wv; | 1727 prev_wv->next = wv; |
1728 else | 1728 else |
1729 save_wv->contents = wv; | 1729 save_wv->contents = wv; |
1730 wv->name = (char *) XSTRING (item_name)->data; | 1730 wv->name = (char *) SDATA (item_name); |
1731 if (!NILP (descrip)) | 1731 if (!NILP (descrip)) |
1732 wv->key = (char *) XSTRING (descrip)->data; | 1732 wv->key = (char *) SDATA (descrip); |
1733 wv->value = 0; | 1733 wv->value = 0; |
1734 /* Use the contents index as call_data, since we are | 1734 /* Use the contents index as call_data, since we are |
1735 restricted to 16-bits. */ | 1735 restricted to 16-bits. */ |
1736 wv->call_data = !NILP (def) ? (void *) (EMACS_INT) i : 0; | 1736 wv->call_data = !NILP (def) ? (void *) (EMACS_INT) i : 0; |
1737 wv->enabled = !NILP (enable); | 1737 wv->enabled = !NILP (enable); |
1771 | 1771 |
1772 #ifndef HAVE_MULTILINGUAL_MENU | 1772 #ifndef HAVE_MULTILINGUAL_MENU |
1773 if (STRING_MULTIBYTE (title)) | 1773 if (STRING_MULTIBYTE (title)) |
1774 title = ENCODE_SYSTEM (title); | 1774 title = ENCODE_SYSTEM (title); |
1775 #endif | 1775 #endif |
1776 wv_title->name = (char *) XSTRING (title)->data; | 1776 wv_title->name = (char *) SDATA (title); |
1777 wv_title->enabled = TRUE; | 1777 wv_title->enabled = TRUE; |
1778 wv_title->title = TRUE; | 1778 wv_title->title = TRUE; |
1779 wv_title->button_type = BUTTON_TYPE_NONE; | 1779 wv_title->button_type = BUTTON_TYPE_NONE; |
1780 wv_title->help = Qnil; | 1780 wv_title->help = Qnil; |
1781 wv_title->next = wv_sep; | 1781 wv_title->next = wv_sep; |
1904 Lisp_Object pane_name, prefix; | 1904 Lisp_Object pane_name, prefix; |
1905 char *pane_string; | 1905 char *pane_string; |
1906 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; | 1906 pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; |
1907 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; | 1907 prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; |
1908 pane_string = (NILP (pane_name) | 1908 pane_string = (NILP (pane_name) |
1909 ? "" : (char *) XSTRING (pane_name)->data); | 1909 ? "" : (char *) SDATA (pane_name)); |
1910 prev_wv = xmalloc_widget_value (); | 1910 prev_wv = xmalloc_widget_value (); |
1911 prev_wv->value = pane_string; | 1911 prev_wv->value = pane_string; |
1912 if (keymaps && !NILP (prefix)) | 1912 if (keymaps && !NILP (prefix)) |
1913 prev_wv->name++; | 1913 prev_wv->name++; |
1914 prev_wv->enabled = 1; | 1914 prev_wv->enabled = 1; |
1953 | 1953 |
1954 wv = xmalloc_widget_value (); | 1954 wv = xmalloc_widget_value (); |
1955 prev_wv->next = wv; | 1955 prev_wv->next = wv; |
1956 wv->name = (char *) button_names[nb_buttons]; | 1956 wv->name = (char *) button_names[nb_buttons]; |
1957 if (!NILP (descrip)) | 1957 if (!NILP (descrip)) |
1958 wv->key = (char *) XSTRING (descrip)->data; | 1958 wv->key = (char *) SDATA (descrip); |
1959 wv->value = (char *) XSTRING (item_name)->data; | 1959 wv->value = (char *) SDATA (item_name); |
1960 wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; | 1960 wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; |
1961 wv->enabled = !NILP (enable); | 1961 wv->enabled = !NILP (enable); |
1962 wv->help = Qnil; | 1962 wv->help = Qnil; |
1963 prev_wv = wv; | 1963 prev_wv = wv; |
1964 | 1964 |