#ifndef __MENU_H__
#define __MENU_H__

#include <X11/Xlib.h>
#include <Xm/XmAll.h>

/* timeout callback function */
typedef void (*TimeOutFunc)(char *, unsigned long *);
/* all callback functions have this form */
typedef void (*CallbackFunc)(Widget, char *, int);

/* macros */
#define MANAGE(w)  XtManageChild((w))
#define UNMANAGE(w)  XtUnmanageChild((w))

void MakeRootShell(int argc, char *argv[], int width, int height);
void GetResolution(int *width, int *height);
void CurrentForm(int which);
void RemanageFormDialog();
Boolean GetDisplayRect(XRectangle *rect);
void AddTimeOut(int timeout, TimeOutFunc timeout_func);
XmStringCharSet *GetCharSet();
void RunMainLoop(int timeout, TimeOutFunc timeout_func);
void SetWidgetFont(Widget *w, char *font_name);
Widget MakeMessageDialog(char *msg,
			 CallbackFunc ok_func, char *ok_func_param,
			 CallbackFunc cancel_func, char *cancel_func_param);
Widget MakeFileSelectionDialog(char *msg,
			       CallbackFunc ok_func, char *ok_func_param,
			       CallbackFunc cancel_func, char *cancel_func_param);
Widget MakeButton(char *name, CallbackFunc func, char *func_param);
Widget MakeToggle(char *name, CallbackFunc func, char *func_param, int toggle_on);
Widget MakeScrollbar(int horizontal, CallbackFunc func, char *func_param, int min, int max, int curr_value);
Widget MakeLabel(char *name);
Widget MakeSeparator();
void WidgetLeftPosition(Widget *w, int left);
void WidgetBottomPosition(Widget *w, int bottom);
void WidgetRightPosition(Widget *w, int right);
void WidgetTopPosition(Widget *w, int top);
void WidgetPosition(Widget *w, int left, int bottom, int right, int top);
void WidgetLeftAttachment(Widget *w, Widget *attach);
void WidgetBottomAttachment(Widget *w, Widget *attach);
void WidgetRightAttachment(Widget *w, Widget *attach);
void WidgetTopAttachment(Widget *w, Widget *attach);
void WidgetAttachment(Widget *w,
		      Widget *attach_left, Widget *attach_bottom,
		      Widget *attach_right, Widget *attach_top);
void WidgetLeftAttachedToForm(Widget *w);
void WidgetBottomAttachedToForm(Widget *w);
void WidgetRightAttachedToForm(Widget *w);
void WidgetTopAttachedToForm(Widget *w);

#endif /* __MENU_H__ */