diff options
Diffstat (limited to 'menu')
-rw-r--r-- | menu/Makefile.in | 19 | ||||
-rw-r--r-- | menu/llib-lmenu | 4 | ||||
-rw-r--r-- | menu/llib-lmenut | 4 | ||||
-rw-r--r-- | menu/llib-lmenutw | 6 | ||||
-rw-r--r-- | menu/llib-lmenuw | 6 | ||||
-rw-r--r-- | menu/m_driver.c | 12 | ||||
-rw-r--r-- | menu/m_global.c | 60 | ||||
-rw-r--r-- | menu/m_hook.c | 7 | ||||
-rw-r--r-- | menu/m_item_use.c | 16 | ||||
-rw-r--r-- | menu/m_req_name.c | 42 | ||||
-rw-r--r-- | menu/m_trace.c | 7 | ||||
-rw-r--r-- | menu/m_userptr.c | 16 | ||||
-rw-r--r-- | menu/menu.h | 20 | ||||
-rw-r--r-- | menu/menu.priv.h | 22 |
14 files changed, 135 insertions, 106 deletions
diff --git a/menu/Makefile.in b/menu/Makefile.in index ad1f47a22e8d..40d6122a8cff 100644 --- a/menu/Makefile.in +++ b/menu/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.57 2013/08/04 20:23:27 tom Exp $ +# $Id: Makefile.in,v 1.65 2018/01/15 19:28:45 tom Exp $ ############################################################################## -# Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. # +# Copyright (c) 1998-2015,2018 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 "Software"), # @@ -42,7 +42,7 @@ # turn off _all_ suffix rules; we'll generate our own .SUFFIXES: -SHELL = /bin/sh +SHELL = @SHELL@ VPATH = @srcdir@ THIS = Makefile @@ -51,6 +51,7 @@ o = .@OBJEXT@ MODEL = @DFT_LWR_MODEL@ DESTDIR = @DESTDIR@ +top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -61,7 +62,10 @@ includesubdir = @includesubdir@ INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir) +PACKAGE = @PACKAGE@ + LIBTOOL = @LIBTOOL@ +LIBTOOL_OPTS = @LIBTOOL_OPTS@ @EXPORT_SYMS@ LIBTOOL_CLEAN = @LIB_CLEAN@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ @@ -71,7 +75,7 @@ LT_UNDEF = @LT_UNDEF@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ -INSTALL_PROG = @INSTALL_PROGRAM@ +INSTALL_PROG = @INSTALL_PROGRAM@ @INSTALL_OPT_S@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ @@ -87,7 +91,7 @@ CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ -CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ +CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -103,9 +107,11 @@ LINK = $(LIBTOOL_LINK) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ SHLIB_DIRS = -L../lib -SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ +SHLIB_LIST = $(SHLIB_DIRS) -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@ RPATH_LIST = @RPATH_LIST@ +RESULTING_SYMS = @RESULTING_SYMS@ +VERSIONED_SYMS = @VERSIONED_SYMS@ MK_SHARED_LIB = @MK_SHARED_LIB@ NCURSES_MAJOR = @NCURSES_MAJOR@ @@ -165,6 +171,7 @@ mostlyclean :: clean :: mostlyclean -rm -f $(AUTO_SRC) + -rm -rf .libs *.dSYM distclean :: clean -rm -f Makefile diff --git a/menu/llib-lmenu b/menu/llib-lmenu index 13ecaf8bdd79..96f067fc678a 100644 --- a/menu/llib-lmenu +++ b/menu/llib-lmenu @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2015 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1996-2005,2010 * + * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ /* LINTLIBRARY */ diff --git a/menu/llib-lmenut b/menu/llib-lmenut index 951719f41e6e..a28708905c81 100644 --- a/menu/llib-lmenut +++ b/menu/llib-lmenut @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2010 Free Software Foundation, Inc. * + * Copyright (c) 2010,2015 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2010 * + * Author: Thomas E. Dickey 2010-on * ****************************************************************************/ /* LINTLIBRARY */ diff --git a/menu/llib-lmenutw b/menu/llib-lmenutw index 0cd559ebd269..a28708905c81 100644 --- a/menu/llib-lmenutw +++ b/menu/llib-lmenutw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2010 Free Software Foundation, Inc. * + * Copyright (c) 2010,2015 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2010 * + * Author: Thomas E. Dickey 2010-on * ****************************************************************************/ /* LINTLIBRARY */ @@ -237,8 +237,6 @@ const char *item_description( /* ./m_item_new.c */ -#include <wctype.h> - #undef new_item ITEM *new_item( const char *name, diff --git a/menu/llib-lmenuw b/menu/llib-lmenuw index 0998f9b0b866..73bfa55e55a6 100644 --- a/menu/llib-lmenuw +++ b/menu/llib-lmenuw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-2010,2015 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2002-2005,2010 * + * Author: Thomas E. Dickey 2002-on * ****************************************************************************/ /* LINTLIBRARY */ @@ -237,8 +237,6 @@ const char *item_description( /* ./m_item_new.c */ -#include <wctype.h> - #undef new_item ITEM *new_item( const char *name, diff --git a/menu/m_driver.c b/menu/m_driver.c index 1a7a3911bbbf..6db94bf77174 100644 --- a/menu/m_driver.c +++ b/menu/m_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2020 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 * @@ -37,7 +37,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_driver.c,v 1.31 2012/03/10 23:43:41 tom Exp $") +MODULE_ID("$Id: m_driver.c,v 1.33 2020/01/18 17:02:13 tom Exp $") /* Macros */ @@ -138,7 +138,7 @@ _nc_Match_Next_Character_In_Item_Name /* we artificially position one item back, because in the do...while loop we start with the next item. This means, that with a new pattern search we always start the scan with the actual item. If - we do a NEXT_PATTERN oder PREV_PATTERN search, we start with the + we do a NEXT_PATTERN or PREV_PATTERN search, we start with the one after or before the actual item. */ if (--idx < 0) idx = menu->nitems - 1; @@ -530,7 +530,11 @@ menu_driver(MENU * menu, int c) } } else - result = E_REQUEST_DENIED; + { + if (menu->opt & O_MOUSE_MENU) + ungetmouse(&event); /* let someone else handle this */ + result = E_REQUEST_DENIED; + } } #endif /* NCURSES_MOUSE_VERSION */ else diff --git a/menu/m_global.c b/menu/m_global.c index d85f207ed57e..7b4517f36609 100644 --- a/menu/m_global.c +++ b/menu/m_global.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2020 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 * @@ -37,7 +37,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_global.c,v 1.27 2012/06/10 00:09:15 tom Exp $") +MODULE_ID("$Id: m_global.c,v 1.29 2020/01/18 17:05:17 tom Exp $") static char mark[] = "-"; /* *INDENT-OFF* */ @@ -53,7 +53,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { 0, /* length of widest description */ 1, /* length of mark */ 1, /* length of one item */ - 1, /* Spacing for descriptor */ + 1, /* Spacing for descriptor */ 1, /* Spacing for columns */ 1, /* Spacing for rows */ (char *)0, /* buffer used to store match chars */ @@ -68,7 +68,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { 0, /* Top row of menu */ (chtype)A_REVERSE, /* Attribute for selection */ (chtype)A_NORMAL, /* Attribute for nonselection */ - (chtype)A_UNDERLINE, /* Attribute for inactive */ + (chtype)A_UNDERLINE, /* Attribute for inactive */ ' ', /* Pad character */ (Menu_Hook)0, /* Menu init */ (Menu_Hook)0, /* Menu term */ @@ -77,7 +77,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = { (void *)0, /* userptr */ mark, /* mark */ ALL_MENU_OPTS, /* options */ - 0 /* status */ + 0 /* status */ }; NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { @@ -98,9 +98,9 @@ NCURSES_EXPORT_VAR(ITEM) _nc_Default_Item = { /* *INDENT-ON* */ /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : static void ComputeMaximum_NameDesc_Lenths(MENU *menu) -| +| | Description : Calculates the maximum name and description lengths | of the items connected to the menu | @@ -132,10 +132,10 @@ ComputeMaximum_NameDesc_Lengths(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : static void ResetConnectionInfo(MENU *, ITEM **) -| -| Description : Reset all informations in the menu and the items in +| +| Description : Reset all information in the menu and the items in | the item array that indicates a connection | | Return Values : - @@ -160,7 +160,7 @@ ResetConnectionInfo(MENU * menu, ITEM ** items) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : bool _nc_Connect_Items(MENU *menu, ITEM **items) | | Description : Connect the items in the item array to the menu. @@ -218,16 +218,16 @@ _nc_Connect_Items(MENU * menu, ITEM ** items) } } - /* If we fall through to this point, we have to reset all items connection + /* If we fall through to this point, we have to reset all items connection and inform about a reject connection */ ResetConnectionInfo(menu, items); return (FALSE); } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Disconnect_Items(MENU *menu) -| +| | Description : Disconnect the menus item array from the menu | | Return Values : - @@ -240,9 +240,9 @@ _nc_Disconnect_Items(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int _nc_Calculate_Text_Width(const TEXT * item) -| +| | Description : Calculate the number of columns for a TEXT. | | Return Values : the width @@ -328,9 +328,9 @@ calculate_actual_width(MENU * menu, bool name) #endif /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Calculate_Item_Length_and_Width(MENU *menu) -| +| | Description : Calculate the length of an item and the width of the | whole menu. | @@ -366,9 +366,9 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Link_Item(MENU *menu) -| +| | Description : Statically calculate for every item its four neighbors. | This depends on the orientation of the menu. This | static approach simplifies navigation in the menu a lot. @@ -495,9 +495,9 @@ _nc_Link_Items(MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_Show_Menu(const MENU* menu) -| +| | Description : Update the window that is associated with the menu | | Return Values : - @@ -530,12 +530,12 @@ _nc_Show_Menu(const MENU * menu) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void _nc_New_TopRow_and_CurrentItem( -| MENU *menu, -| int new_toprow, +| MENU *menu, +| int new_toprow, | ITEM *new_current_item) -| +| | Description : Redisplay the menu so that the given row becomes the | top row and the given item becomes the new current | item. @@ -568,7 +568,9 @@ _nc_New_TopRow_and_CurrentItem( cur_item = menu->curitem; assert(cur_item); - menu->toprow = (short)new_toprow; + menu->toprow = (short)(((menu->rows - menu->frows) >= 0) + ? min(menu->rows - menu->frows, new_toprow) + : 0); menu->curitem = new_current_item; if (mterm_called) @@ -590,7 +592,9 @@ _nc_New_TopRow_and_CurrentItem( } else { /* if we are not posted, this is quite simple */ - menu->toprow = (short)new_toprow; + menu->toprow = (short)(((menu->rows - menu->frows) >= 0) + ? min(menu->rows - menu->frows, new_toprow) + : 0); menu->curitem = new_current_item; } } diff --git a/menu/m_hook.c b/menu/m_hook.c index 671fab65e50e..9c8451314752 100644 --- a/menu/m_hook.c +++ b/menu/m_hook.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2018 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 * @@ -37,13 +37,14 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_hook.c,v 1.16 2012/03/10 23:43:41 tom Exp $") +MODULE_ID("$Id: m_hook.c,v 1.18 2018/12/16 00:13:36 tom Exp $") /* "Template" macro to generate function to set application specific hook */ #define GEN_HOOK_SET_FUNCTION( typ, name ) \ NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\ {\ - T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), (void *) menu, func));\ + TR_FUNC_BFR(1);\ + T((T_CALLED("set_" #typ "_" #name "(%p,%s)"), (void *) menu, TR_FUNC_ARG(0, func)));\ (Normalize_Menu(menu) -> typ ## name = func );\ RETURN(E_OK);\ } diff --git a/menu/m_item_use.c b/menu/m_item_use.c index 8cf294bc29e3..7cea30c92ff8 100644 --- a/menu/m_item_use.c +++ b/menu/m_item_use.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2020 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 * @@ -37,14 +37,14 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_item_use.c,v 1.17 2010/01/23 21:20:10 tom Exp $") +MODULE_ID("$Id: m_item_use.c,v 1.18 2020/01/18 17:02:13 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_item_userptr(ITEM *item, void *userptr) -| +| | Description : Set the pointer that is reserved in any item to store -| application relevant informations. +| application relevant information. | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ @@ -57,11 +57,11 @@ set_item_userptr(ITEM * item, void *userptr) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void *item_userptr(const ITEM *item) -| +| | Description : Return the pointer that is reserved in any item to store -| application relevant informations. +| application relevant information. | | Return Values : Value of the pointer. If no such pointer has been set, | NULL is returned. diff --git a/menu/m_req_name.c b/menu/m_req_name.c index e5f2888ed6f2..cc0066d540b8 100644 --- a/menu/m_req_name.c +++ b/menu/m_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2015 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 * @@ -37,27 +37,29 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_req_name.c,v 1.22 2012/07/21 23:27:32 tom Exp $") +MODULE_ID("$Id: m_req_name.c,v 1.23 2015/04/04 18:00:23 tom Exp $") -static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] = +#define DATA(s) { s } + +static const char request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1][14] = { - "LEFT_ITEM", - "RIGHT_ITEM", - "UP_ITEM", - "DOWN_ITEM", - "SCR_ULINE", - "SCR_DLINE", - "SCR_DPAGE", - "SCR_UPAGE", - "FIRST_ITEM", - "LAST_ITEM", - "NEXT_ITEM", - "PREV_ITEM", - "TOGGLE_ITEM", - "CLEAR_PATTERN", - "BACK_PATTERN", - "NEXT_MATCH", - "PREV_MATCH" + DATA("LEFT_ITEM"), + DATA("RIGHT_ITEM"), + DATA("UP_ITEM"), + DATA("DOWN_ITEM"), + DATA("SCR_ULINE"), + DATA("SCR_DLINE"), + DATA("SCR_DPAGE"), + DATA("SCR_UPAGE"), + DATA("FIRST_ITEM"), + DATA("LAST_ITEM"), + DATA("NEXT_ITEM"), + DATA("PREV_ITEM"), + DATA("TOGGLE_ITEM"), + DATA("CLEAR_PATTERN"), + DATA("BACK_PATTERN"), + DATA("NEXT_MATCH"), + DATA("PREV_MATCH") }; #define A_SIZE (sizeof(request_names)/sizeof(request_names[0])) diff --git a/menu/m_trace.c b/menu/m_trace.c index 094ff86c67a9..49ca41884ddc 100644 --- a/menu/m_trace.c +++ b/menu/m_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 2004-2016,2018 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 * @@ -32,7 +32,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_trace.c,v 1.4 2010/01/23 21:20:10 tom Exp $") +MODULE_ID("$Id: m_trace.c,v 1.6 2018/12/16 00:13:36 tom Exp $") NCURSES_EXPORT(ITEM *) _nc_retrace_item(ITEM * code) @@ -65,7 +65,8 @@ _nc_retrace_menu(MENU * code) NCURSES_EXPORT(Menu_Hook) _nc_retrace_menu_hook(Menu_Hook code) { - T((T_RETURN("%p"), code)); + TR_FUNC_BFR(1); + T((T_RETURN("%s"), TR_FUNC_ARG(0, code))); return code; } diff --git a/menu/m_userptr.c b/menu/m_userptr.c index a7359c99d0eb..3172a57fa1aa 100644 --- a/menu/m_userptr.c +++ b/menu/m_userptr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2020 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 * @@ -37,14 +37,14 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_userptr.c,v 1.17 2010/01/23 21:20:10 tom Exp $") +MODULE_ID("$Id: m_userptr.c,v 1.18 2020/01/18 17:04:37 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : int set_menu_userptr(MENU *menu, void *userptr) -| +| | Description : Set the pointer that is reserved in any menu to store -| application relevant informations. +| application relevant information. | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ @@ -57,11 +57,11 @@ set_menu_userptr(MENU * menu, void *userptr) } /*--------------------------------------------------------------------------- -| Facility : libnmenu +| Facility : libnmenu | Function : void *menu_userptr(const MENU *menu) -| +| | Description : Return the pointer that is reserved in any menu to -| store application relevant informations. +| store application relevant information. | | Return Values : Value of the pointer. If no such pointer has been set, | NULL is returned diff --git a/menu/menu.h b/menu/menu.h index 4eeac018bdb3..476ab3cdbef4 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2009 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 * @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */ +/* $Id: menu.h,v 1.23 2017/02/11 16:54:04 tom Exp $ */ #ifndef ETI_MENU #define ETI_MENU @@ -56,17 +56,23 @@ typedef int Item_Options; #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 */ @@ -83,11 +89,14 @@ typedef struct tagITEM 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 */ @@ -128,8 +137,9 @@ typedef struct tagMENU Menu_Options opt; /* Menu options */ unsigned short status; /* Internal state of menu */ - -} MENU; +} +#endif /* !NCURSES_OPAQUE_MENU */ +MENU; /* Define keys */ diff --git a/menu/menu.priv.h b/menu/menu.priv.h index 763ca4a675fd..87b5770e8465 100644 --- a/menu/menu.priv.h +++ b/menu/menu.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2012 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 * @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: menu.priv.h,v 1.24 2012/03/10 23:43:41 tom Exp $ */ +/* $Id: menu.priv.h,v 1.27 2017/02/11 16:50:12 tom Exp $ */ /*************************************************************************** * Module menu.priv.h * @@ -42,6 +42,9 @@ /* *INDENT-OFF* */ #include "curses.priv.h" + +#define NCURSES_OPAQUE_MENU 0 + #include "mf_common.h" #include "menu.h" @@ -78,7 +81,8 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu; O_ROWMAJOR | \ O_IGNORECASE | \ O_SHOWMATCH | \ - O_NONCYCLIC ) + O_NONCYCLIC | \ + O_MOUSE_MENU ) #define ALL_ITEM_OPTS (O_SELECTABLE) @@ -130,12 +134,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i #ifdef TRACE -#define returnItem(code) TRACE_RETURN(code,item) -#define returnItemPtr(code) TRACE_RETURN(code,item_ptr) -#define returnItemOpts(code) TRACE_RETURN(code,item_opts) -#define returnMenu(code) TRACE_RETURN(code,menu) -#define returnMenuHook(code) TRACE_RETURN(code,menu_hook) -#define returnMenuOpts(code) TRACE_RETURN(code,menu_opts) +#define returnItem(code) TRACE_RETURN1(code,item) +#define returnItemPtr(code) TRACE_RETURN1(code,item_ptr) +#define returnItemOpts(code) TRACE_RETURN1(code,item_opts) +#define returnMenu(code) TRACE_RETURN1(code,menu) +#define returnMenuHook(code) TRACE_RETURN1(code,menu_hook) +#define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts) extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *); extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); |