char, int, const char *, unsigned int);
extern void X11_end_menu(winid, const char *);
extern int X11_select_menu(winid, int, MENU_ITEM_P **);
-extern void X11_update_inventory(int);
extern void X11_mark_synch(void);
extern void X11_wait_synch(void);
#ifdef CLIPPING
#endif
extern void X11_preference_update(const char *);
+extern void X11_update_inventory(int);
+extern perminvent_info *X11_update_invent_slot(winid, int, perminvent_info *);
#endif /* WINX_H */
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(int);
extern void curses_mark_synch(void);
extern void curses_wait_synch(void);
extern void curses_cliparound(int x, int y);
extern void genl_outrip(winid tmpwin, int how, time_t when);
extern void curses_preference_update(const char *pref);
extern void curs_reset_windows(boolean, boolean);
+extern void curses_update_inventory(int);
+extern perminvent_info *curses_update_invent_slot(winid, int, perminvent_info *);
/* curswins.c */
void (*win_end_menu)(winid, const char *);
int (*win_select_menu)(winid, int, MENU_ITEM_P **);
char (*win_message_menu)(char, int, const char *);
- void (*win_update_inventory)(int);
void (*win_mark_synch)(void);
void (*win_wait_synch)(void);
#ifdef CLIPPING
void (*win_status_update)(int, genericptr_t, int, int, int,
unsigned long *);
boolean (*win_can_suspend)(void);
+ void (*win_update_inventory)(int);
+ perminvent_info *(*win_update_invent_slot)(winid, int, perminvent_info *);
};
extern
*/
#define status_enablefield (*windowprocs.win_status_enablefield)
#define status_update (*windowprocs.win_status_update)
+#define update_invent_slot (*windowprocs.win_update_invent_slot)
/*
* WINCAP
extern void safe_end_menu(winid, const char *);
extern int safe_select_menu(winid, int, MENU_ITEM_P **);
extern char safe_message_menu(char, int, const char *);
-extern void safe_update_inventory(int);
extern void safe_mark_synch(void);
extern void safe_wait_synch(void);
#ifdef CLIPPING
extern void stdio_nonl_raw_print(const char *);
extern void stdio_raw_print_bold(const char *);
extern void stdio_wait_synch(void);
+extern void safe_update_inventory(int);
+extern perminvent_info *safe_update_invent_slot(winid, int, perminvent_info *);
extern int stdio_nhgetch(void);
#endif /* SAFEPROCS */
#endif /* WINPROCS_H */
E void tty_end_menu(winid, const char *);
E int tty_select_menu(winid, int, MENU_ITEM_P **);
E char tty_message_menu(char, int, const char *);
-E void tty_update_inventory(int);
E void tty_mark_synch(void);
E void tty_wait_synch(void);
#ifdef CLIPPING
E char *tty_getmsghistory(boolean);
E void tty_putmsghistory(const char *, boolean);
+E void tty_update_inventory(int);
+E perminvent_info *tty_update_invent_slot(winid, int, perminvent_info *);
#ifdef TTY_PERM_INVENT
E void tty_refresh_inventory(int start, int stop, int y);
#define MENU_BEHAVE_STANDARD 0x0000000U
+struct to_core {
+ boolean active;
+ boolean use_update_inventory; /* disable the newer slot interface */
+ int slotcount;
+ int low_slot_num, high_slot_num;
+ int max_slot_text;
+};
+
+struct from_core {
+ long piflags;
+ int slot; /* which inventory slot; 0 means info exchange only */
+ int invlet;
+ const char *text; /* the text to display */
+};
+
+struct perminvent_info_t {
+ struct to_core tocore;
+ struct from_core fromcore;
+};
+
+typedef struct perminvent_info_t perminvent_info;
+
/* clang-format on */
#endif /* WINTYPE_H */
static void hup_void_fdecl_winid(winid);
static void hup_void_fdecl_winid_ulong(winid, unsigned long);
static void hup_void_fdecl_constchar_p(const char *);
+static perminvent_info *hup_update_invent_slot(winid, int, perminvent_info *);
static struct window_procs hup_procs = {
"hup", 0L, 0L,
hup_curs, hup_putstr, hup_putstr, /* putmixed */
hup_display_file, hup_void_fdecl_winid_ulong, /* start_menu */
hup_add_menu, hup_end_menu, hup_select_menu, genl_message_menu,
- hup_void_fdecl_int, /* update_inventory */
hup_void_ndecl, /* mark_synch */
hup_void_ndecl, /* wait_synch */
#ifdef CLIPPING
hup_void_ndecl, /* status_finish */
genl_status_enablefield, hup_status_update,
genl_can_suspend_no,
+ hup_void_fdecl_int, /* update_inventory */
+ hup_update_invent_slot, /* update_invent_slot */
};
static void (*previnterface_exit_nhwindows)(const char *) = 0;
return;
}
+/*ARGUSED*/
+perminvent_info *
+hup_update_invent_slot(
+ winid window UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED)
+{
+ return (perminvent_info *) 0;
+}
+
#endif /* HANGUPHANDLING */
*/
}
+perminvent_info *NetHackQtBind::qt_update_invent_slot(
+ winid wid UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED)
+{
+ NetHackQtWindow* window UNUSED =id_to_window[(int)wid];
+ return (perminvent_info *) 0;
+}
+
void NetHackQtBind::qt_mark_synch()
{
}
nethack_qt_::NetHackQtBind::qt_end_menu,
nethack_qt_::NetHackQtBind::qt_select_menu,
genl_message_menu, /* no need for Qt-specific handling */
- nethack_qt_::NetHackQtBind::qt_update_inventory,
nethack_qt_::NetHackQtBind::qt_mark_synch,
nethack_qt_::NetHackQtBind::qt_wait_synch,
#ifdef CLIPPING
genl_status_update,
#endif
genl_can_suspend_yes,
+ nethack_qt_::NetHackQtBind::qt_update_inventory,
+ nethack_qt_::NetHackQtBind::qt_update_invent_slot,
};
#ifndef WIN32
const char *str, unsigned int itemflags);
static void qt_end_menu(winid wid, const char *prompt);
static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
- static void qt_update_inventory(int);
static void qt_mark_synch();
static void qt_wait_synch();
static void qt_outrip(winid wid, int how, time_t when);
static int qt_kbhit();
+ static void qt_update_inventory(int);
+ static perminvent_info *qt_update_invent_slot(winid, int, perminvent_info *);
static QWidget *mainWidget() { return main; }
X11_putstr, genl_putmixed, X11_display_file, X11_start_menu, X11_add_menu,
X11_end_menu, X11_select_menu,
genl_message_menu, /* no need for X-specific handling */
- X11_update_inventory, X11_mark_synch, X11_wait_synch,
+ X11_mark_synch, X11_wait_synch,
#ifdef CLIPPING
X11_cliparound,
#endif
X11_status_init, X11_status_finish, X11_status_enablefield,
X11_status_update,
genl_can_suspend_no, /* XXX may not always be correct */
+ X11_update_inventory,
+ X11_update_invent_slot,
};
/*
return;
}
+perminvent_info *
+X11_update_invent_slot(
+ winid window UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED)
+{
+ return (perminvent_info *) 0;
+}
+
/* The current implementation has all of the saved lines on the screen. */
int
X11_doprev_message(void)
void chainin_end_menu(winid, const char *);
int chainin_select_menu(winid, int, MENU_ITEM_P **);
char chainin_message_menu(char, int, const char *);
-void chainin_update_inventory(int);
void chainin_mark_synch(void);
void chainin_wait_synch(void);
#ifdef CLIPPING
unsigned long *);
boolean chainin_can_suspend(void);
+void chainin_update_inventory(int);
+perminvent_info *chainin_update_invent_slot(winid, int, perminvent_info *);
void *chainin_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
void chainin_procs_init(int dir);
return rv;
}
+perminvent_info *
+chainin_update_invent_slot(
+ winid window, /* window to use, must be of type NHW_MENU */
+ int inventory_slot, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi)
+{
+ boolean rv;
+
+ rv = (*cibase->nprocs->win_update_invent_slot)(cibase->ndata, window,
+ inventory_slot, pi);
+ return rv;
+}
+
struct window_procs chainin_procs = {
"-chainin", 0, /* wincap */
0, /* wincap2 */
chainin_status_init, chainin_status_finish, chainin_status_enablefield,
chainin_status_update,
chainin_can_suspend,
+ chainin_update_inventory,
+ chainin_update_invent_slot,
};
void chainout_end_menu(void *,winid, const char *);
int chainout_select_menu(void *,winid, int, MENU_ITEM_P **);
char chainout_message_menu(void *,char, int, const char *);
-void chainout_update_inventory(void *,int);
void chainout_mark_synch(void *);
void chainout_wait_synch(void *);
#ifdef CLIPPING
unsigned long *);
boolean chainout_can_suspend(void *);
+void chainout_update_inventory(void *, int);
+perminvent_info *chainout_update_invent_slot(void *, winid, int, perminvent_info *);
void chainout_procs_init(int dir);
void *chainout_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
return rv;
}
+perminvent_info *
+chainout_update_invent_slot(
+ winid window, /* window to use, must be of type NHW_MENU */
+ int inventory_slot, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi)
+{
+ struct chainout_data *tdp = vp;
+ boolean rv;
+
+ rv = (*tdp->nprocs->win_update_invent_slot)(window,
+ inventory_slot, pi);
+ return rv;
+}
+
struct chain_procs chainout_procs = {
"-chainout", 0, /* wincap */
0, /* wincap2 */
chainout_status_init, chainout_status_finish, chainout_status_enablefield,
chainout_status_update,
chainout_can_suspend,
+ chainout_update_inventory,
+ chainout_update_invent_slot,
};
curses_end_menu,
curses_select_menu,
genl_message_menu,
- curses_update_inventory,
curses_mark_synch,
curses_wait_synch,
#ifdef CLIPPING
genl_status_enablefield,
curses_status_update,
genl_can_suspend_yes,
+ curses_update_inventory,
+ curses_update_invent_slot,
};
/*
}
}
+perminvent_info *
+curses_update_invent_slot(
+ winid window UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED)
+{
+ return (perminvent_info *) 0;
+}
+
/*
mark_synch() -- Don't go beyond this point in I/O on any channel until
all channels are caught up to here. Can be an empty call
safe_create_nhwindow, safe_clear_nhwindow, safe_display_nhwindow,
safe_destroy_nhwindow, safe_curs, safe_putstr, safe_putmixed,
safe_display_file, safe_start_menu, safe_add_menu, safe_end_menu,
- safe_select_menu, safe_message_menu, safe_update_inventory,
+ safe_select_menu, safe_message_menu,
safe_mark_synch,
safe_wait_synch,
#ifdef CLIPPING
safe_status_finish, safe_status_enablefield,
safe_status_update,
safe_can_suspend,
+ safe_update_inventory,
+ safe_update_invent_slot,
};
struct window_procs *
return '\033';
}
-void
-safe_update_inventory(int arg UNUSED)
-{
- return;
-}
-
void
safe_mark_synch(void)
{
{
}
+void
+safe_update_inventory(int arg UNUSED)
+{
+ return;
+}
+
+perminvent_info *
+safe_update_invent_slot(
+ winid window, /* window to use, must be of type NHW_MENU */
+ int inventory_slot, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi)
+{
+ return (perminvent_info *) 0;
+}
+
/**************************************************************
* These are some optionally selectable routines that add
* some base functionality over the safe_* versions above.
display_inventory(NULL, FALSE);
}
}
+perminvent_info *
+shim_update_invent_slot(
+ winid window UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED) {
+ return (perminvent_info *) 0;
+}
#else /* !__EMSCRIPTEN__ */
-VDECLCB(shim_update_inventory,(int a1 UNUSED), "v")
+VDECLCB(shim_update_inventory,(int a1 UNUSED)
+DECLB(perminvent_info *, shim_update_invent_slot,
+ (winid window, int inventory_slot, perminvent_info *pi),
+ "viip",
+ A2P window UNUSED, A2P inventory_slot UNUSED, P2V pi UNUSED)
#endif
/* Interface definition used in windows.c */
shim_create_nhwindow, shim_clear_nhwindow, shim_display_nhwindow,
shim_destroy_nhwindow, shim_curs, shim_putstr, genl_putmixed,
shim_display_file, shim_start_menu, shim_add_menu, shim_end_menu,
- shim_select_menu, shim_message_menu, shim_update_inventory, shim_mark_synch,
+ shim_select_menu, shim_message_menu, shim_mark_synch,
shim_wait_synch,
#ifdef CLIPPING
shim_cliparound,
genl_status_update,
#endif
genl_can_suspend_yes,
+ shim_update_inventory,
+ shim_update_invent_slot,
};
#ifdef __EMSCRIPTEN__
tty_destroy_nhwindow, tty_curs, tty_putstr,
tty_putmixed,
tty_display_file, tty_start_menu, tty_add_menu, tty_end_menu,
- tty_select_menu, tty_message_menu, tty_update_inventory, tty_mark_synch,
+ tty_select_menu, tty_message_menu, tty_mark_synch,
tty_wait_synch,
#ifdef CLIPPING
tty_cliparound,
genl_status_update,
#endif
genl_can_suspend_yes,
+ tty_update_inventory,
+ tty_update_invent_slot,
};
winid BASE_WINDOW;
return;
}
+perminvent_info *
+tty_update_invent_slot(
+ winid window UNUSED, /* window to use, must be of type NHW_MENU */
+ int inventory_slot UNUSED, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi UNUSED)
+{
+ return (perminvent_info *) 0;
+}
+
#ifdef TTY_PERM_INVENT
/* put the formatted object description for one item into a particular row
genl_putmixed, mswin_display_file, mswin_start_menu, mswin_add_menu,
mswin_end_menu, mswin_select_menu,
genl_message_menu, /* no need for X-specific handling */
- mswin_update_inventory, mswin_mark_synch, mswin_wait_synch,
+ mswin_mark_synch, mswin_wait_synch,
#ifdef CLIPPING
mswin_cliparound,
#endif
mswin_status_init, mswin_status_finish, mswin_status_enablefield,
mswin_status_update,
genl_can_suspend_yes,
+ mswin_update_inventory,
+ mswin_update_invent_slot,
};
/*
display_inventory(NULL, FALSE);
}
+perminvent_info *
+mswin_update_invent_slot(
+ winid window, /* window to use, must be of type NHW_MENU */
+ int inventory_slot, /* slot id: 0 - info return to core */
+ /* 1 - gold slot */
+ /* 2 - 29 obj slots */
+ perminvent_info *pi)
+{
+ return (perminvent_info *) 0;
+}
+
/*
mark_synch() -- Don't go beyond this point in I/O on any channel until
all channels are caught up to here. Can be an empty call
const char *str, unsigned int itemflags);
void mswin_end_menu(winid wid, const char *prompt);
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
-void mswin_update_inventory(int);
void mswin_mark_synch(void);
void mswin_wait_synch(void);
void mswin_cliparound(int x, int y);
void mswin_status_enablefield(int fieldidx, const char *nm, const char *fmt,
boolean enable);
void mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color, unsigned long *colormasks);
+void mswin_update_inventory(int);
+perminvent_info *mswin_update_invent_slot(winid, int, perminvent_info *);
/* helper function */
HWND mswin_hwnd_from_winid(winid wid);