aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2014-05-29 21:16:00 +0400
committerDmitry Antipov2014-05-29 21:16:00 +0400
commitf1b447932d63948a97b21f7d5fbf5230cd6599f4 (patch)
treee5b5b122512e38f4c8872ca25ce8e092363459ef /src
parentbd5b233d48ad58fcbc2fa01afcde9dc250e40117 (diff)
downloademacs-f1b447932d63948a97b21f7d5fbf5230cd6599f4.tar.gz
emacs-f1b447932d63948a97b21f7d5fbf5230cd6599f4.zip
* xmenu.c (xdialog_show): Remove prototype, rename to
x_dialog_show, remove 2nd arg because it's always zero and simplify accordingly. (xw_popup_dialog): Adjust user. * w32menu.c (w32_dialog_show): Adjust prototype, remove 2nd arg because it's always zero and simplify accordingly. (w32_popup_dialog): Adjust user.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/w32menu.c34
-rw-r--r--src/xmenu.c38
3 files changed, 24 insertions, 58 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c90dc9964b7..2153091e301 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12014-05-29 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * xmenu.c (xdialog_show): Remove prototype, rename to
4 x_dialog_show, remove 2nd arg because it's always zero
5 and simplify accordingly.
6 (xw_popup_dialog): Adjust user.
7 * w32menu.c (w32_dialog_show): Adjust prototype, remove
8 2nd arg because it's always zero and simplify accordingly.
9 (w32_popup_dialog): Adjust user.
10
12014-05-29 Eli Zaretskii <eliz@gnu.org> 112014-05-29 Eli Zaretskii <eliz@gnu.org>
2 12
3 * w32heap.c (report_temacs_memory_usage): New function. 13 * w32heap.c (report_temacs_memory_usage): New function.
diff --git a/src/w32menu.c b/src/w32menu.c
index a4acdfd9e91..2c69fc78053 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -103,7 +103,7 @@ Lisp_Object Qdebug_on_next_call, Qunsupported__w32_dialog;
103void set_frame_menubar (struct frame *, bool, bool); 103void set_frame_menubar (struct frame *, bool, bool);
104 104
105#ifdef HAVE_DIALOGS 105#ifdef HAVE_DIALOGS
106static Lisp_Object w32_dialog_show (struct frame *, int, Lisp_Object, char**); 106static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **);
107#else 107#else
108static int is_simple_dialog (Lisp_Object); 108static int is_simple_dialog (Lisp_Object);
109static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); 109static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object);
@@ -141,7 +141,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
141 141
142 /* Display them in a dialog box. */ 142 /* Display them in a dialog box. */
143 block_input (); 143 block_input ();
144 selection = w32_dialog_show (f, 0, title, header, &error_name); 144 selection = w32_dialog_show (f, title, header, &error_name);
145 unblock_input (); 145 unblock_input ();
146 146
147 discard_menu_items (); 147 discard_menu_items ();
@@ -904,9 +904,8 @@ static char * button_names [] = {
904 "button6", "button7", "button8", "button9", "button10" }; 904 "button6", "button7", "button8", "button9", "button10" };
905 905
906static Lisp_Object 906static Lisp_Object
907w32_dialog_show (struct frame *f, int keymaps, 907w32_dialog_show (struct frame *f, Lisp_Object title,
908 Lisp_Object title, Lisp_Object header, 908 Lisp_Object header, char **error)
909 char **error)
910{ 909{
911 int i, nb_buttons = 0; 910 int i, nb_buttons = 0;
912 char dialog_name[6]; 911 char dialog_name[6];
@@ -930,16 +929,13 @@ w32_dialog_show (struct frame *f, int keymaps,
930 /* Create a tree of widget_value objects 929 /* Create a tree of widget_value objects
931 representing the text label and buttons. */ 930 representing the text label and buttons. */
932 { 931 {
933 Lisp_Object pane_name, prefix; 932 Lisp_Object pane_name;
934 char *pane_string; 933 char *pane_string;
935 pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); 934 pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME);
936 prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX);
937 pane_string = (NILP (pane_name) 935 pane_string = (NILP (pane_name)
938 ? "" : SSDATA (pane_name)); 936 ? "" : SSDATA (pane_name));
939 prev_wv = xmalloc_widget_value (); 937 prev_wv = xmalloc_widget_value ();
940 prev_wv->value = pane_string; 938 prev_wv->value = pane_string;
941 if (keymaps && !NILP (prefix))
942 prev_wv->name++;
943 prev_wv->enabled = 1; 939 prev_wv->enabled = 1;
944 prev_wv->name = "message"; 940 prev_wv->name = "message";
945 prev_wv->help = Qnil; 941 prev_wv->help = Qnil;
@@ -1052,32 +1048,18 @@ w32_dialog_show (struct frame *f, int keymaps,
1052 the proper value. */ 1048 the proper value. */
1053 if (menu_item_selection != 0) 1049 if (menu_item_selection != 0)
1054 { 1050 {
1055 Lisp_Object prefix;
1056
1057 prefix = Qnil;
1058 i = 0; 1051 i = 0;
1059 while (i < menu_items_used) 1052 while (i < menu_items_used)
1060 { 1053 {
1061 Lisp_Object entry; 1054 Lisp_Object entry;
1062 1055
1063 if (EQ (AREF (menu_items, i), Qt)) 1056 if (EQ (AREF (menu_items, i), Qt))
1064 { 1057 i += MENU_ITEMS_PANE_LENGTH;
1065 prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
1066 i += MENU_ITEMS_PANE_LENGTH;
1067 }
1068 else 1058 else
1069 { 1059 {
1070 entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1060 entry = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
1071 if (menu_item_selection == i) 1061 if (menu_item_selection == i)
1072 { 1062 return entry;
1073 if (keymaps != 0)
1074 {
1075 entry = Fcons (entry, Qnil);
1076 if (!NILP (prefix))
1077 entry = Fcons (prefix, entry);
1078 }
1079 return entry;
1080 }
1081 i += MENU_ITEMS_ITEM_LENGTH; 1063 i += MENU_ITEMS_ITEM_LENGTH;
1082 } 1064 }
1083 } 1065 }
diff --git a/src/xmenu.c b/src/xmenu.c
index 9b1ac540c21..683e9c6cd90 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -110,11 +110,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
110 110
111static Lisp_Object Qdebug_on_next_call; 111static Lisp_Object Qdebug_on_next_call;
112 112
113#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
114static Lisp_Object xdialog_show (struct frame *, bool, Lisp_Object, Lisp_Object,
115 const char **);
116#endif
117
118/* Flag which when set indicates a dialog or menu has been posted by 113/* Flag which when set indicates a dialog or menu has been posted by
119 Xt on behalf of one of the widget sets. */ 114 Xt on behalf of one of the widget sets. */
120static int popup_activated_flag; 115static int popup_activated_flag;
@@ -1839,11 +1834,8 @@ static const char * button_names [] = {
1839 "button6", "button7", "button8", "button9", "button10" }; 1834 "button6", "button7", "button8", "button9", "button10" };
1840 1835
1841static Lisp_Object 1836static Lisp_Object
1842xdialog_show (struct frame *f, 1837x_dialog_show (struct frame *f, Lisp_Object title,
1843 bool keymaps, 1838 Lisp_Object header, const char **error_name)
1844 Lisp_Object title,
1845 Lisp_Object header,
1846 const char **error_name)
1847{ 1839{
1848 int i, nb_buttons=0; 1840 int i, nb_buttons=0;
1849 char dialog_name[6]; 1841 char dialog_name[6];
@@ -1870,16 +1862,13 @@ xdialog_show (struct frame *f,
1870 /* Create a tree of widget_value objects 1862 /* Create a tree of widget_value objects
1871 representing the text label and buttons. */ 1863 representing the text label and buttons. */
1872 { 1864 {
1873 Lisp_Object pane_name, prefix; 1865 Lisp_Object pane_name;
1874 const char *pane_string; 1866 const char *pane_string;
1875 pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME); 1867 pane_name = AREF (menu_items, MENU_ITEMS_PANE_NAME);
1876 prefix = AREF (menu_items, MENU_ITEMS_PANE_PREFIX);
1877 pane_string = (NILP (pane_name) 1868 pane_string = (NILP (pane_name)
1878 ? "" : SSDATA (pane_name)); 1869 ? "" : SSDATA (pane_name));
1879 prev_wv = xmalloc_widget_value (); 1870 prev_wv = xmalloc_widget_value ();
1880 prev_wv->value = (char *) pane_string; 1871 prev_wv->value = (char *) pane_string;
1881 if (keymaps && !NILP (prefix))
1882 prev_wv->name++;
1883 prev_wv->enabled = 1; 1872 prev_wv->enabled = 1;
1884 prev_wv->name = "message"; 1873 prev_wv->name = "message";
1885 prev_wv->help = Qnil; 1874 prev_wv->help = Qnil;
@@ -1982,20 +1971,13 @@ xdialog_show (struct frame *f,
1982 the proper value. */ 1971 the proper value. */
1983 if (menu_item_selection != 0) 1972 if (menu_item_selection != 0)
1984 { 1973 {
1985 Lisp_Object prefix;
1986
1987 prefix = Qnil;
1988 i = 0; 1974 i = 0;
1989 while (i < menu_items_used) 1975 while (i < menu_items_used)
1990 { 1976 {
1991 Lisp_Object entry; 1977 Lisp_Object entry;
1992 1978
1993 if (EQ (AREF (menu_items, i), Qt)) 1979 if (EQ (AREF (menu_items, i), Qt))
1994 { 1980 i += MENU_ITEMS_PANE_LENGTH;
1995 prefix
1996 = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
1997 i += MENU_ITEMS_PANE_LENGTH;
1998 }
1999 else if (EQ (AREF (menu_items, i), Qquote)) 1981 else if (EQ (AREF (menu_items, i), Qquote))
2000 { 1982 {
2001 /* This is the boundary between left-side elts and 1983 /* This is the boundary between left-side elts and
@@ -2007,15 +1989,7 @@ xdialog_show (struct frame *f,
2007 entry 1989 entry
2008 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE); 1990 = AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
2009 if (menu_item_selection == aref_addr (menu_items, i)) 1991 if (menu_item_selection == aref_addr (menu_items, i))
2010 { 1992 return entry;
2011 if (keymaps != 0)
2012 {
2013 entry = list1 (entry);
2014 if (!NILP (prefix))
2015 entry = Fcons (prefix, entry);
2016 }
2017 return entry;
2018 }
2019 i += MENU_ITEMS_ITEM_LENGTH; 1993 i += MENU_ITEMS_ITEM_LENGTH;
2020 } 1994 }
2021 } 1995 }
@@ -2052,7 +2026,7 @@ xw_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
2052 2026
2053 /* Display them in a dialog box. */ 2027 /* Display them in a dialog box. */
2054 block_input (); 2028 block_input ();
2055 selection = xdialog_show (f, 0, title, header, &error_name); 2029 selection = x_dialog_show (f, title, header, &error_name);
2056 unblock_input (); 2030 unblock_input ();
2057 2031
2058 unbind_to (specpdl_count, Qnil); 2032 unbind_to (specpdl_count, Qnil);