groundwork for window port interface change to add_menu
groundwork only - window port interface change This changes the last parameter for add_menu() from a boolean to an unsigned int, to allow additional itemflags in future beyond just the "preselected" that the original boolean offered. There shouldn't be any functionality changes with this groundwork-only change, and if there are it is unintentional and should be reported.
This commit is contained in:
@@ -490,9 +490,6 @@ enum bodypart_types {
|
||||
#define MENU_FULL 2
|
||||
#define MENU_PARTIAL 3
|
||||
|
||||
#define MENU_SELECTED TRUE
|
||||
#define MENU_UNSELECTED FALSE
|
||||
|
||||
/*
|
||||
* Option flags
|
||||
* Each higher number includes the characteristics of the numbers
|
||||
|
||||
@@ -227,7 +227,7 @@ E void FDECL(mac_curs, (winid, int, int));
|
||||
E void FDECL(mac_putstr, (winid, int, const char *));
|
||||
E void FDECL(mac_start_menu, (winid));
|
||||
E void FDECL(mac_add_menu, (winid, int, const anything *, CHAR_P, CHAR_P, int,
|
||||
const char *, BOOLEAN_P));
|
||||
const char *, unsigned int));
|
||||
E void FDECL(mac_end_menu, (winid, const char *));
|
||||
E int FDECL(mac_select_menu, (winid, int, menu_item **));
|
||||
#ifdef CLIPPING
|
||||
|
||||
@@ -418,7 +418,7 @@ E void FDECL(X11_putstr, (winid, int, const char *));
|
||||
E void FDECL(X11_display_file, (const char *, BOOLEAN_P));
|
||||
E void FDECL(X11_start_menu, (winid));
|
||||
E void FDECL(X11_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
|
||||
const char *, BOOLEAN_P));
|
||||
const char *, unsigned int));
|
||||
E void FDECL(X11_end_menu, (winid, const char *));
|
||||
E int FDECL(X11_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
E void NDECL(X11_update_inventory);
|
||||
|
||||
@@ -82,7 +82,7 @@ extern void curses_display_file(const char *filename, BOOLEAN_P must_exist);
|
||||
extern void curses_start_menu(winid wid);
|
||||
extern void curses_add_menu(winid wid, int glyph, const ANY_P * identifier,
|
||||
CHAR_P accelerator, CHAR_P group_accel, int attr,
|
||||
const char *str, BOOLEAN_P presel);
|
||||
const char *str, unsigned int itemflags);
|
||||
extern void curses_end_menu(winid wid, const char *prompt);
|
||||
extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
||||
extern void curses_update_inventory(void);
|
||||
|
||||
@@ -71,7 +71,7 @@ E void FDECL(Gem_putstr, (winid, int, const char *));
|
||||
E void FDECL(Gem_display_file, (const char *, BOOLEAN_P));
|
||||
E void FDECL(Gem_start_menu, (winid));
|
||||
E void FDECL(Gem_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
|
||||
const char *, BOOLEAN_P));
|
||||
const char *, unsigned int));
|
||||
E void FDECL(Gem_end_menu, (winid, const char *));
|
||||
E int FDECL(Gem_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
E char FDECL(Gem_message_menu, (CHAR_P, int, const char *));
|
||||
|
||||
@@ -32,7 +32,7 @@ struct window_procs {
|
||||
void FDECL((*win_display_file), (const char *, BOOLEAN_P));
|
||||
void FDECL((*win_start_menu), (winid));
|
||||
void FDECL((*win_add_menu), (winid, int, const ANY_P *, CHAR_P, CHAR_P,
|
||||
int, const char *, BOOLEAN_P));
|
||||
int, const char *, unsigned int));
|
||||
void FDECL((*win_end_menu), (winid, const char *));
|
||||
int FDECL((*win_select_menu), (winid, int, MENU_ITEM_P **));
|
||||
char FDECL((*win_message_menu), (CHAR_P, int, const char *));
|
||||
@@ -331,7 +331,7 @@ struct chain_procs {
|
||||
void FDECL((*win_display_file), (CARGS, const char *, BOOLEAN_P));
|
||||
void FDECL((*win_start_menu), (CARGS, winid));
|
||||
void FDECL((*win_add_menu), (CARGS, winid, int, const ANY_P *, CHAR_P,
|
||||
CHAR_P, int, const char *, BOOLEAN_P));
|
||||
CHAR_P, int, const char *, unsigned int));
|
||||
void FDECL((*win_end_menu), (CARGS, winid, const char *));
|
||||
int FDECL((*win_select_menu), (CARGS, winid, int, MENU_ITEM_P **));
|
||||
char FDECL((*win_message_menu), (CARGS, CHAR_P, int, const char *));
|
||||
@@ -405,7 +405,7 @@ extern void FDECL(safe_putmixed, (winid, int, const char *));
|
||||
extern void FDECL(safe_display_file, (const char *, BOOLEAN_P));
|
||||
extern void FDECL(safe_start_menu, (winid));
|
||||
extern void FDECL(safe_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P,
|
||||
int, const char *, BOOLEAN_P));
|
||||
int, const char *, unsigned int));
|
||||
extern void FDECL(safe_end_menu, (winid, const char *));
|
||||
extern int FDECL(safe_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
extern char FDECL(safe_message_menu, (CHAR_P, int, const char *));
|
||||
|
||||
@@ -13,13 +13,14 @@
|
||||
/* menu structure */
|
||||
typedef struct tty_mi {
|
||||
struct tty_mi *next;
|
||||
anything identifier; /* user identifier */
|
||||
long count; /* user count */
|
||||
char *str; /* description string (including accelerator) */
|
||||
int attr; /* string attribute */
|
||||
boolean selected; /* TRUE if selected by user */
|
||||
char selector; /* keyboard accelerator */
|
||||
char gselector; /* group accelerator */
|
||||
anything identifier; /* user identifier */
|
||||
long count; /* user count */
|
||||
char *str; /* description string (including accelerator) */
|
||||
int attr; /* string attribute */
|
||||
boolean selected; /* TRUE if selected by user */
|
||||
unsigned int itemflags; /* */
|
||||
char selector; /* keyboard accelerator */
|
||||
char gselector; /* group accelerator */
|
||||
} tty_menu_item;
|
||||
|
||||
/* descriptor for tty-based windows */
|
||||
@@ -191,7 +192,7 @@ E void FDECL(tty_putstr, (winid, int, const char *));
|
||||
E void FDECL(tty_display_file, (const char *, BOOLEAN_P));
|
||||
E void FDECL(tty_start_menu, (winid));
|
||||
E void FDECL(tty_add_menu, (winid, int, const ANY_P *, CHAR_P, CHAR_P, int,
|
||||
const char *, BOOLEAN_P));
|
||||
const char *, unsigned int));
|
||||
E void FDECL(tty_end_menu, (winid, const char *));
|
||||
E int FDECL(tty_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
E char FDECL(tty_message_menu, (CHAR_P, int, const char *));
|
||||
|
||||
@@ -54,8 +54,9 @@ enum any_types {
|
||||
|
||||
/* menu return list */
|
||||
typedef struct mi {
|
||||
anything item; /* identifier */
|
||||
long count; /* count */
|
||||
anything item; /* identifier */
|
||||
long count; /* count */
|
||||
unsigned itemflags; /* item flags */
|
||||
} menu_item;
|
||||
#define MENU_ITEM_P struct mi
|
||||
|
||||
@@ -105,6 +106,10 @@ typedef struct mi {
|
||||
#define MENU_UNSELECT_PAGE '\\'
|
||||
#define MENU_INVERT_PAGE '~'
|
||||
#define MENU_SEARCH ':'
|
||||
|
||||
#define MENU_ITEMFLAGS_NONE 0x0000000
|
||||
#define MENU_ITEMFLAGS_SELECTED 0x0000001
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#endif /* WINTYPE_H */
|
||||
|
||||
Reference in New Issue
Block a user