Debian Codegraph @

texk/xdvik/gui/menu.h

raw
1 /*
2 * Copyright (c) 2003-2004 the xdvik development team
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 */
23
24 /*
25 * Common code for Xaw and Motif menu bar creation.
26 */
27 #ifndef MENU_H_
28 #define MENU_H_
29
30 #include "events.h"
31 #include "xdvi.h"
32
33 typedef enum {
34 BT_INVALID = -1, /* error code */
35 BT_NONE = 0,
36 BT_PUSH, /* pushbutton */
37 BT_RADIO, /* radio button (1 of n) */
38 BT_CHECK, /* check button (m of n) */
39 BT_SEP /* separator */
40 } buttonTypeT;
41
42
43 /* structures for menu data */
44 struct button_elems {
45 char *title; /* menu item label string */
46 buttonTypeT type; /* button type */
47 char mnemonic; /* 0 if none */
48 char *accelerator; /* NULL if none */
49 struct button_info *submenu;/* submenu, or NULL */
50 Widget widget; /* the widget in this item, for later use, or 0 */
51 struct xdvi_action *action; /* translated action, for later use, or NULL */
52 };
53
54 struct button_info {
55 size_t size;
56 struct button_elems *elems;
57 };
58
59 #include "xm_menu.h"
60 #include "xaw_menu.h"
61
62 extern void create_menu_buttons(Widget parent,
63 #ifdef MOTIF
64 Widget *child
65 #else
66 int *ret_panel_width
67 #endif
68 );
69
70 extern void set_menu(void *val, XtActionProc proc, Boolean (*cmp)(void *, const char *));
71
72 #endif /* MENU_H_ */