/****************************************************************************
- * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.h,v 1.18 2003/11/08 20:48:24 tom Exp $ */
+/* $Id: menu.h,v 1.23 2017/02/11 16:54:04 tom Exp $ */
#ifndef ETI_MENU
#define ETI_MENU
#define O_IGNORECASE (0x08)
#define O_SHOWMATCH (0x10)
#define O_NONCYCLIC (0x20)
+#define O_MOUSE_MENU (0x40)
/* Item options: */
#define O_SELECTABLE (0x01)
+#if !NCURSES_OPAQUE_MENU
typedef struct
{
const char* str;
unsigned short length;
} TEXT;
+#endif /* !NCURSES_OPAQUE_MENU */
+
+struct tagMENU;
typedef struct tagITEM
+#if !NCURSES_OPAQUE_MENU
{
TEXT name; /* name of menu item */
TEXT description; /* description of item, optional in display */
struct tagITEM *up;
struct tagITEM *down;
-} ITEM;
+}
+#endif /* !NCURSES_OPAQUE_MENU */
+ITEM;
typedef void (*Menu_Hook)(struct tagMENU *);
typedef struct tagMENU
+#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
{
short height; /* Nr. of chars high */
short width; /* Nr. of chars wide */
Menu_Options opt; /* Menu options */
unsigned short status; /* Internal state of menu */
-
-} MENU;
+}
+#endif /* !NCURSES_OPAQUE_MENU */
+MENU;
/* Define keys */
extern NCURSES_EXPORT(int) post_menu (MENU *);
extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *);
extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item);
-extern NCURSES_EXPORT(int) set_item_init (MENU *,void(*)(MENU *));
+extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook);
extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options);
-extern NCURSES_EXPORT(int) set_item_term (MENU *,void(*)(MENU *));
+extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook);
extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *);
extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool);
extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype);
extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype);
extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int);
extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype);
-extern NCURSES_EXPORT(int) set_menu_init (MENU *,void(*)(MENU *));
+extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook);
extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **);
extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *);
extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options);
extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int);
extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *);
extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *);
-extern NCURSES_EXPORT(int) set_menu_term (MENU *,void(*)(MENU *));
+extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook);
extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *);
extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *);
extern NCURSES_EXPORT(int) set_top_row (MENU *,int);
extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *);
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+#endif
+
#ifdef __cplusplus
}
#endif