X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fmenu.h;h=b2e845c6fa45f81e45c365742e436f6263f2fb1c;hp=84352eb5d2f66f72767c2d4651b604c6cacc3477;hb=c0f109a299a82a33c16bd7af942a12ce9aefaaf0;hpb=b6d7123594f6959ad0a6602b3952d9e6abe261a0 diff --git a/menu/menu.h b/menu/menu.h index 84352eb5..b2e845c6 100644 --- a/menu/menu.h +++ b/menu/menu.h @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 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 +31,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: menu.h,v 1.19 2007/02/24 17:32:13 tom Exp $ */ +/* $Id: menu.h,v 1.24 2020/02/02 23:34:34 tom Exp $ */ #ifndef ETI_MENU #define ETI_MENU @@ -56,17 +57,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 +90,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 +138,9 @@ typedef struct tagMENU Menu_Options opt; /* Menu options */ unsigned short status; /* Internal state of menu */ - -} MENU; +} +#endif /* !NCURSES_OPAQUE_MENU */ +MENU; /* Define keys */ @@ -249,6 +260,10 @@ extern NCURSES_EXPORT(bool) item_visible (const ITEM *); 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