diff options
| author | Gerd Moellmann | 2001-03-22 13:34:00 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-22 13:34:00 +0000 |
| commit | f61a541bca6d9358333c3e8e72b6a632a3f0a14c (patch) | |
| tree | 387199c5bef1896f8b74d26da684859876ec1fc8 /src | |
| parent | 823ba8d8b3d90ba15abc60f56df62369a2d52fb1 (diff) | |
| download | emacs-f61a541bca6d9358333c3e8e72b6a632a3f0a14c.tar.gz emacs-f61a541bca6d9358333c3e8e72b6a632a3f0a14c.zip | |
Include widget.h.
(single_submenu): Return int. Some cleanup.
(set_frame_menubar): Call x_set_menu_resources_from_menu_face.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/xmenu.c | 72 |
2 files changed, 42 insertions, 39 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2a5130151f5..0e3cda1ee29 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2001-03-22 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xfaces.c (xm_set_menu_resources_from_menu_face): Remove | ||
| 4 | #ifndef LESSTIF_VERSION. | ||
| 5 | |||
| 6 | * xmenu.c: Include widget.h. | ||
| 7 | (single_submenu): Return int. Some cleanup. | ||
| 8 | (set_frame_menubar): Call x_set_menu_resources_from_menu_face. | ||
| 9 | |||
| 1 | 2001-03-21 Gerd Moellmann <gerd@gnu.org> | 10 | 2001-03-21 Gerd Moellmann <gerd@gnu.org> |
| 2 | 11 | ||
| 3 | * xterm.c (x_update_window_end): Handle overwritten mouse face | 12 | * xterm.c (x_update_window_end): Handle overwritten mouse face |
diff --git a/src/xmenu.c b/src/xmenu.c index 9d048cb8406..de74d6b1645 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 44 | #include "window.h" | 44 | #include "window.h" |
| 45 | #include "blockinput.h" | 45 | #include "blockinput.h" |
| 46 | #include "buffer.h" | 46 | #include "buffer.h" |
| 47 | #include "widget.h" | ||
| 47 | 48 | ||
| 48 | #ifdef MSDOS | 49 | #ifdef MSDOS |
| 49 | #include "msdos.h" | 50 | #include "msdos.h" |
| @@ -123,12 +124,16 @@ void popup_get_selection (); | |||
| 123 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | 124 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| 124 | Lisp_Object, Lisp_Object, Lisp_Object, | 125 | Lisp_Object, Lisp_Object, Lisp_Object, |
| 125 | Lisp_Object, Lisp_Object)); | 126 | Lisp_Object, Lisp_Object)); |
| 126 | static Lisp_Object xmenu_show (); | 127 | static int update_frame_menubar P_ ((struct frame *)); |
| 127 | static void keymap_panes (); | 128 | static Lisp_Object xmenu_show P_ ((struct frame *, int, int, int, int, |
| 128 | static void single_keymap_panes (); | 129 | Lisp_Object, char **)); |
| 129 | static void single_menu_item (); | 130 | static void keymap_panes P_ ((Lisp_Object *, int, int)); |
| 130 | static void list_of_panes (); | 131 | static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| 131 | static void list_of_items (); | 132 | int, int)); |
| 133 | static void single_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object *, | ||
| 134 | int, int, int *)); | ||
| 135 | static void list_of_panes P_ ((Lisp_Object)); | ||
| 136 | static void list_of_items P_ ((Lisp_Object)); | ||
| 132 | 137 | ||
| 133 | /* This holds a Lisp vector that holds the results of decoding | 138 | /* This holds a Lisp vector that holds the results of decoding |
| 134 | the keymaps or alist-of-alists that specify a menu. | 139 | the keymaps or alist-of-alists that specify a menu. |
| @@ -1539,55 +1544,42 @@ single_submenu (item_key, item_name, maps) | |||
| 1539 | 1544 | ||
| 1540 | return first_wv; | 1545 | return first_wv; |
| 1541 | } | 1546 | } |
| 1542 | |||
| 1543 | extern void EmacsFrameSetCharSize (); | ||
| 1544 | 1547 | ||
| 1545 | /* Recompute all the widgets of frame F, when the menu bar | ||
| 1546 | has been changed. */ | ||
| 1547 | 1548 | ||
| 1548 | static void | 1549 | |
| 1550 | /* Recompute all the widgets of frame F, when the menu bar has been | ||
| 1551 | changed. Value is non-zero if widgets were updated. */ | ||
| 1552 | |||
| 1553 | static int | ||
| 1549 | update_frame_menubar (f) | 1554 | update_frame_menubar (f) |
| 1550 | FRAME_PTR f; | 1555 | FRAME_PTR f; |
| 1551 | { | 1556 | { |
| 1552 | struct x_output *x = f->output_data.x; | 1557 | struct x_output *x = f->output_data.x; |
| 1553 | int columns, rows; | 1558 | int columns, rows; |
| 1554 | int menubar_changed; | ||
| 1555 | 1559 | ||
| 1556 | /* We assume the menubar contents has changed if the global flag is set, | 1560 | if (!x->menubar_widget || XtIsManaged (x->menubar_widget)) |
| 1557 | or if the current buffer has changed, or if the menubar has never | 1561 | return 0; |
| 1558 | been updated before. | ||
| 1559 | */ | ||
| 1560 | menubar_changed = (x->menubar_widget | ||
| 1561 | && !XtIsManaged (x->menubar_widget)); | ||
| 1562 | |||
| 1563 | if (! (menubar_changed)) | ||
| 1564 | return; | ||
| 1565 | 1562 | ||
| 1566 | BLOCK_INPUT; | 1563 | BLOCK_INPUT; |
| 1567 | /* Save the size of the frame because the pane widget doesn't accept to | 1564 | /* Save the size of the frame because the pane widget doesn't accept |
| 1568 | resize itself. So force it. */ | 1565 | to resize itself. So force it. */ |
| 1569 | columns = f->width; | 1566 | columns = f->width; |
| 1570 | rows = f->height; | 1567 | rows = f->height; |
| 1571 | 1568 | ||
| 1572 | /* Do the voodoo which means "I'm changing lots of things, don't try to | 1569 | /* Do the voodoo which means "I'm changing lots of things, don't try |
| 1573 | refigure sizes until I'm done." */ | 1570 | to refigure sizes until I'm done." */ |
| 1574 | lw_refigure_widget (x->column_widget, False); | 1571 | lw_refigure_widget (x->column_widget, False); |
| 1575 | 1572 | ||
| 1576 | /* the order in which children are managed is the top to | 1573 | /* The order in which children are managed is the top to bottom |
| 1577 | bottom order in which they are displayed in the paned window. | 1574 | order in which they are displayed in the paned window. First, |
| 1578 | First, remove the text-area widget. | 1575 | remove the text-area widget. */ |
| 1579 | */ | ||
| 1580 | XtUnmanageChild (x->edit_widget); | 1576 | XtUnmanageChild (x->edit_widget); |
| 1581 | 1577 | ||
| 1582 | /* remove the menubar that is there now, and put up the menubar that | 1578 | /* Remove the menubar that is there now, and put up the menubar that |
| 1583 | should be there. | 1579 | should be there. */ |
| 1584 | */ | 1580 | XtManageChild (x->menubar_widget); |
| 1585 | if (menubar_changed) | 1581 | XtMapWidget (x->menubar_widget); |
| 1586 | { | 1582 | XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, NULL); |
| 1587 | XtManageChild (x->menubar_widget); | ||
| 1588 | XtMapWidget (x->menubar_widget); | ||
| 1589 | XtVaSetValues (x->menubar_widget, XtNmappedWhenManaged, 1, NULL); | ||
| 1590 | } | ||
| 1591 | 1583 | ||
| 1592 | /* Re-manage the text-area widget, and then thrash the sizes. */ | 1584 | /* Re-manage the text-area widget, and then thrash the sizes. */ |
| 1593 | XtManageChild (x->edit_widget); | 1585 | XtManageChild (x->edit_widget); |
| @@ -1597,6 +1589,7 @@ update_frame_menubar (f) | |||
| 1597 | /* Force the pane widget to resize itself with the right values. */ | 1589 | /* Force the pane widget to resize itself with the right values. */ |
| 1598 | EmacsFrameSetCharSize (x->edit_widget, columns, rows); | 1590 | EmacsFrameSetCharSize (x->edit_widget, columns, rows); |
| 1599 | UNBLOCK_INPUT; | 1591 | UNBLOCK_INPUT; |
| 1592 | return 1; | ||
| 1600 | } | 1593 | } |
| 1601 | 1594 | ||
| 1602 | /* Set the contents of the menubar widgets of frame F. | 1595 | /* Set the contents of the menubar widgets of frame F. |
| @@ -1842,7 +1835,8 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1842 | } | 1835 | } |
| 1843 | 1836 | ||
| 1844 | free_menubar_widget_value_tree (first_wv); | 1837 | free_menubar_widget_value_tree (first_wv); |
| 1845 | update_frame_menubar (f); | 1838 | if (!update_frame_menubar (f)) |
| 1839 | x_set_menu_resources_from_menu_face (f, menubar_widget); | ||
| 1846 | 1840 | ||
| 1847 | UNBLOCK_INPUT; | 1841 | UNBLOCK_INPUT; |
| 1848 | } | 1842 | } |