Back to index

tetex-bin  3.0
menu.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2004 the xdvik development team
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to
00006  * deal in the Software without restriction, including without limitation the
00007  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00008  * sell copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017  * PAUL VOJTA OR ANY OTHER AUTHOR OF THIS SOFTWARE BE LIABLE FOR ANY CLAIM,
00018  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00020  * OTHER DEALINGS IN THE SOFTWARE.
00021  *
00022  */
00023 
00024 /*
00025  * Common code for Xaw and Motif menu bar creation.
00026  */
00027 #ifndef MENU_H_
00028 #define MENU_H_
00029 
00030 #include "xdvi-config.h"
00031 #include "events.h"
00032 #include "xdvi.h"
00033 
00034 typedef enum {
00035     BT_INVALID = -1, /* error code */
00036     BT_NONE = 0,
00037     BT_PUSH,  /* pushbutton */
00038     BT_RADIO, /* radio button (1 of n) */
00039     BT_CHECK, /* check button (m of n) */
00040     BT_SEP    /* separator */
00041 } buttonTypeT;
00042 
00043 
00044 /* structures for menu data */
00045 struct button_elems {
00046     char *title;            /* menu item label string */
00047     buttonTypeT type;              /* button type */
00048     char mnemonic;          /* 0 if none */
00049     char *accelerator;             /* NULL if none */
00050     struct button_info *submenu;/* submenu, or NULL */
00051     Widget widget;          /* the widget in this item, for later use, or 0 */
00052     struct xdvi_action *action; /* translated action, for later use, or NULL */
00053 };
00054 
00055 struct button_info {
00056     size_t size;
00057     struct button_elems *elems;
00058 };
00059 
00060 #include "xm_menu.h" 
00061 #include "xaw_menu.h"
00062 
00063 extern void create_menu_buttons(Widget parent,
00064 #ifdef MOTIF
00065                             Widget *child
00066 #else
00067                             int *ret_panel_width
00068 #endif
00069                             );
00070 
00071 extern void set_menu(void *val, XtActionProc proc, Boolean (*cmp)());
00072 
00073 #endif /* MENU_H_ */