]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - menu/menu.h
ncurses 6.1 - patch 20191026
[ncurses.git] / menu / menu.h
index d827072248f9ad75a5249d2654a2b160a7aecd37..476ab3cdbef4f6e27e168edbc72385a142cb650d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998,2000 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            *
  *                                                                          *
  * 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                                    *
 
 /****************************************************************************
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
- *   Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en             *
  ****************************************************************************/
 
  ****************************************************************************/
 
+/* $Id: menu.h,v 1.23 2017/02/11 16:54:04 tom Exp $ */
+
 #ifndef ETI_MENU
 #define ETI_MENU
 
 #ifndef ETI_MENU
 #define ETI_MENU
 
@@ -55,17 +56,23 @@ typedef int Item_Options;
 #define O_IGNORECASE    (0x08)
 #define O_SHOWMATCH     (0x10)
 #define O_NONCYCLIC     (0x20)
 #define O_IGNORECASE    (0x08)
 #define O_SHOWMATCH     (0x10)
 #define O_NONCYCLIC     (0x20)
+#define O_MOUSE_MENU    (0x40)
 
 /* Item options: */
 #define O_SELECTABLE    (0x01)
 
 
 /* Item options: */
 #define O_SELECTABLE    (0x01)
 
+#if !NCURSES_OPAQUE_MENU
 typedef struct
 {
   const char* str;
   unsigned short length;
 } TEXT;
 typedef struct
 {
   const char* str;
   unsigned short length;
 } TEXT;
+#endif /* !NCURSES_OPAQUE_MENU */
+
+struct tagMENU;
 
 typedef struct tagITEM 
 
 typedef struct tagITEM 
+#if !NCURSES_OPAQUE_MENU
 {
   TEXT           name;        /* name of menu item                         */
   TEXT           description; /* description of item, optional in display  */ 
 {
   TEXT           name;        /* name of menu item                         */
   TEXT           description; /* description of item, optional in display  */ 
@@ -77,16 +84,19 @@ typedef struct tagITEM
   short          x;
   bool           value;       /* Selection value                           */
                              
   short          x;
   bool           value;       /* Selection value                           */
                              
-  struct tagITEM *left;       /* neighbour items                           */
+  struct tagITEM *left;       /* neighbor items                            */
   struct tagITEM *right;
   struct tagITEM *up;
   struct tagITEM *down;
 
   struct tagITEM *right;
   struct tagITEM *up;
   struct tagITEM *down;
 
-} ITEM;
+}
+#endif /* !NCURSES_OPAQUE_MENU */
+ITEM;
 
 typedef void (*Menu_Hook)(struct tagMENU *);
 
 typedef struct tagMENU 
 
 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               */
 {
   short          height;                /* Nr. of chars high               */
   short          width;                 /* Nr. of chars wide               */
@@ -127,8 +137,9 @@ typedef struct tagMENU
 
   Menu_Options   opt;                   /* Menu options                    */
   unsigned short status;                /* Internal state of menu          */
 
   Menu_Options   opt;                   /* Menu options                    */
   unsigned short status;                /* Internal state of menu          */
-
-} MENU;
+}
+#endif /* !NCURSES_OPAQUE_MENU */
+MENU;
 
 
 /* Define keys */
 
 
 /* Define keys */
@@ -216,23 +227,23 @@ extern NCURSES_EXPORT(int)        pos_menu_cursor (const MENU *);
 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)     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_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_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_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(int)     set_menu_userptr (MENU *,void *);
 extern NCURSES_EXPORT(int)     set_menu_win (MENU *,WINDOW *);
 extern NCURSES_EXPORT(int)     set_top_row (MENU *,int);
@@ -248,6 +259,10 @@ extern NCURSES_EXPORT(bool)        item_visible (const ITEM *);
 
 extern NCURSES_EXPORT(void)    menu_format (const MENU *,int *,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
 #ifdef __cplusplus
   }
 #endif