groundwork for an interface change
Add a new window-port interface function
perminvent_info *
update_invent_slot(winid window, int slot, perminvent_info *);
That should be nice and flexible and allow exchanges of useful
information between the core and the window port. Information
to be exchange can be easily modified in include/wintype.h as
things evolve.
Information useful to the core can be exchanged from the
window-port in struct to_core.
Information useful from the core to the window-port can be
passed in struct from_core.
I'm not going to update any docs until much later after things
are fully working and settled.
This also doesn't fix or have anything to do with existing
TTY_PERM_INVENT issues.
This commit is contained in:
+2
-1
@@ -450,7 +450,6 @@ extern void X11_add_menu(winid, const glyph_info *, const ANY_P *, char,
|
|||||||
char, int, const char *, unsigned int);
|
char, int, const char *, unsigned int);
|
||||||
extern void X11_end_menu(winid, const char *);
|
extern void X11_end_menu(winid, const char *);
|
||||||
extern int X11_select_menu(winid, int, MENU_ITEM_P **);
|
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_mark_synch(void);
|
||||||
extern void X11_wait_synch(void);
|
extern void X11_wait_synch(void);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -487,5 +486,7 @@ extern void genl_outrip(winid, int, time_t);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void X11_preference_update(const char *);
|
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 */
|
#endif /* WINX_H */
|
||||||
|
|||||||
+2
-1
@@ -89,7 +89,6 @@ extern void curses_add_menu(winid wid, const glyph_info *,
|
|||||||
const char *str, unsigned int itemflags);
|
const char *str, unsigned int itemflags);
|
||||||
extern void curses_end_menu(winid wid, const char *prompt);
|
extern void curses_end_menu(winid wid, const char *prompt);
|
||||||
extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
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_mark_synch(void);
|
||||||
extern void curses_wait_synch(void);
|
extern void curses_wait_synch(void);
|
||||||
extern void curses_cliparound(int x, int y);
|
extern void curses_cliparound(int x, int y);
|
||||||
@@ -113,6 +112,8 @@ extern void curses_outrip(winid wid, int how, time_t when);
|
|||||||
extern void genl_outrip(winid tmpwin, int how, time_t when);
|
extern void genl_outrip(winid tmpwin, int how, time_t when);
|
||||||
extern void curses_preference_update(const char *pref);
|
extern void curses_preference_update(const char *pref);
|
||||||
extern void curs_reset_windows(boolean, boolean);
|
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 */
|
/* curswins.c */
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -37,7 +37,6 @@ struct window_procs {
|
|||||||
void (*win_end_menu)(winid, const char *);
|
void (*win_end_menu)(winid, const char *);
|
||||||
int (*win_select_menu)(winid, int, MENU_ITEM_P **);
|
int (*win_select_menu)(winid, int, MENU_ITEM_P **);
|
||||||
char (*win_message_menu)(char, int, const char *);
|
char (*win_message_menu)(char, int, const char *);
|
||||||
void (*win_update_inventory)(int);
|
|
||||||
void (*win_mark_synch)(void);
|
void (*win_mark_synch)(void);
|
||||||
void (*win_wait_synch)(void);
|
void (*win_wait_synch)(void);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -83,6 +82,8 @@ struct window_procs {
|
|||||||
void (*win_status_update)(int, genericptr_t, int, int, int,
|
void (*win_status_update)(int, genericptr_t, int, int, int,
|
||||||
unsigned long *);
|
unsigned long *);
|
||||||
boolean (*win_can_suspend)(void);
|
boolean (*win_can_suspend)(void);
|
||||||
|
void (*win_update_inventory)(int);
|
||||||
|
perminvent_info *(*win_update_invent_slot)(winid, int, perminvent_info *);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern
|
extern
|
||||||
@@ -164,6 +165,7 @@ extern
|
|||||||
*/
|
*/
|
||||||
#define status_enablefield (*windowprocs.win_status_enablefield)
|
#define status_enablefield (*windowprocs.win_status_enablefield)
|
||||||
#define status_update (*windowprocs.win_status_update)
|
#define status_update (*windowprocs.win_status_update)
|
||||||
|
#define update_invent_slot (*windowprocs.win_update_invent_slot)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WINCAP
|
* WINCAP
|
||||||
@@ -421,7 +423,6 @@ extern void safe_add_menu(winid, const glyph_info *, const ANY_P *,
|
|||||||
extern void safe_end_menu(winid, const char *);
|
extern void safe_end_menu(winid, const char *);
|
||||||
extern int safe_select_menu(winid, int, MENU_ITEM_P **);
|
extern int safe_select_menu(winid, int, MENU_ITEM_P **);
|
||||||
extern char safe_message_menu(char, int, const char *);
|
extern char safe_message_menu(char, int, const char *);
|
||||||
extern void safe_update_inventory(int);
|
|
||||||
extern void safe_mark_synch(void);
|
extern void safe_mark_synch(void);
|
||||||
extern void safe_wait_synch(void);
|
extern void safe_wait_synch(void);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -468,6 +469,8 @@ extern void stdio_raw_print(const char *);
|
|||||||
extern void stdio_nonl_raw_print(const char *);
|
extern void stdio_nonl_raw_print(const char *);
|
||||||
extern void stdio_raw_print_bold(const char *);
|
extern void stdio_raw_print_bold(const char *);
|
||||||
extern void stdio_wait_synch(void);
|
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);
|
extern int stdio_nhgetch(void);
|
||||||
#endif /* SAFEPROCS */
|
#endif /* SAFEPROCS */
|
||||||
#endif /* WINPROCS_H */
|
#endif /* WINPROCS_H */
|
||||||
|
|||||||
+2
-1
@@ -242,7 +242,6 @@ E void tty_add_menu(winid, const glyph_info *, const ANY_P *, char, char,
|
|||||||
E void tty_end_menu(winid, const char *);
|
E void tty_end_menu(winid, const char *);
|
||||||
E int tty_select_menu(winid, int, MENU_ITEM_P **);
|
E int tty_select_menu(winid, int, MENU_ITEM_P **);
|
||||||
E char tty_message_menu(char, int, const char *);
|
E char tty_message_menu(char, int, const char *);
|
||||||
E void tty_update_inventory(int);
|
|
||||||
E void tty_mark_synch(void);
|
E void tty_mark_synch(void);
|
||||||
E void tty_wait_synch(void);
|
E void tty_wait_synch(void);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -284,6 +283,8 @@ E void genl_outrip(winid, int, time_t);
|
|||||||
|
|
||||||
E char *tty_getmsghistory(boolean);
|
E char *tty_getmsghistory(boolean);
|
||||||
E void tty_putmsghistory(const char *, 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
|
#ifdef TTY_PERM_INVENT
|
||||||
E void tty_refresh_inventory(int start, int stop, int y);
|
E void tty_refresh_inventory(int start, int stop, int y);
|
||||||
|
|||||||
@@ -162,6 +162,28 @@ typedef struct gi {
|
|||||||
|
|
||||||
#define MENU_BEHAVE_STANDARD 0x0000000U
|
#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 */
|
/* clang-format on */
|
||||||
|
|
||||||
#endif /* WINTYPE_H */
|
#endif /* WINTYPE_H */
|
||||||
|
|||||||
+15
-1
@@ -536,6 +536,7 @@ static void hup_void_fdecl_int(int);
|
|||||||
static void hup_void_fdecl_winid(winid);
|
static void hup_void_fdecl_winid(winid);
|
||||||
static void hup_void_fdecl_winid_ulong(winid, unsigned long);
|
static void hup_void_fdecl_winid_ulong(winid, unsigned long);
|
||||||
static void hup_void_fdecl_constchar_p(const char *);
|
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 = {
|
static struct window_procs hup_procs = {
|
||||||
"hup", 0L, 0L,
|
"hup", 0L, 0L,
|
||||||
@@ -551,7 +552,6 @@ static struct window_procs hup_procs = {
|
|||||||
hup_curs, hup_putstr, hup_putstr, /* putmixed */
|
hup_curs, hup_putstr, hup_putstr, /* putmixed */
|
||||||
hup_display_file, hup_void_fdecl_winid_ulong, /* start_menu */
|
hup_display_file, hup_void_fdecl_winid_ulong, /* start_menu */
|
||||||
hup_add_menu, hup_end_menu, hup_select_menu, genl_message_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, /* mark_synch */
|
||||||
hup_void_ndecl, /* wait_synch */
|
hup_void_ndecl, /* wait_synch */
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -584,6 +584,8 @@ static struct window_procs hup_procs = {
|
|||||||
hup_void_ndecl, /* status_finish */
|
hup_void_ndecl, /* status_finish */
|
||||||
genl_status_enablefield, hup_status_update,
|
genl_status_enablefield, hup_status_update,
|
||||||
genl_can_suspend_no,
|
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;
|
static void (*previnterface_exit_nhwindows)(const char *) = 0;
|
||||||
@@ -837,6 +839,18 @@ hup_void_fdecl_constchar_p(const char *string UNUSED)
|
|||||||
return;
|
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 */
|
#endif /* HANGUPHANDLING */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+13
-1
@@ -490,6 +490,17 @@ void NetHackQtBind::qt_update_inventory(int arg UNUSED)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
void NetHackQtBind::qt_mark_synch()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1053,7 +1064,6 @@ struct window_procs Qt_procs = {
|
|||||||
nethack_qt_::NetHackQtBind::qt_end_menu,
|
nethack_qt_::NetHackQtBind::qt_end_menu,
|
||||||
nethack_qt_::NetHackQtBind::qt_select_menu,
|
nethack_qt_::NetHackQtBind::qt_select_menu,
|
||||||
genl_message_menu, /* no need for Qt-specific handling */
|
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_mark_synch,
|
||||||
nethack_qt_::NetHackQtBind::qt_wait_synch,
|
nethack_qt_::NetHackQtBind::qt_wait_synch,
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -1100,6 +1110,8 @@ struct window_procs Qt_procs = {
|
|||||||
genl_status_update,
|
genl_status_update,
|
||||||
#endif
|
#endif
|
||||||
genl_can_suspend_yes,
|
genl_can_suspend_yes,
|
||||||
|
nethack_qt_::NetHackQtBind::qt_update_inventory,
|
||||||
|
nethack_qt_::NetHackQtBind::qt_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
|||||||
+2
-1
@@ -58,7 +58,6 @@ public:
|
|||||||
const char *str, unsigned int itemflags);
|
const char *str, unsigned int itemflags);
|
||||||
static void qt_end_menu(winid wid, const char *prompt);
|
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 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_mark_synch();
|
||||||
static void qt_wait_synch();
|
static void qt_wait_synch();
|
||||||
|
|
||||||
@@ -89,6 +88,8 @@ public:
|
|||||||
|
|
||||||
static void qt_outrip(winid wid, int how, time_t when);
|
static void qt_outrip(winid wid, int how, time_t when);
|
||||||
static int qt_kbhit();
|
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; }
|
static QWidget *mainWidget() { return main; }
|
||||||
|
|
||||||
|
|||||||
+14
-1
@@ -117,7 +117,7 @@ struct window_procs X11_procs = {
|
|||||||
X11_putstr, genl_putmixed, X11_display_file, X11_start_menu, X11_add_menu,
|
X11_putstr, genl_putmixed, X11_display_file, X11_start_menu, X11_add_menu,
|
||||||
X11_end_menu, X11_select_menu,
|
X11_end_menu, X11_select_menu,
|
||||||
genl_message_menu, /* no need for X-specific handling */
|
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
|
#ifdef CLIPPING
|
||||||
X11_cliparound,
|
X11_cliparound,
|
||||||
#endif
|
#endif
|
||||||
@@ -141,6 +141,8 @@ struct window_procs X11_procs = {
|
|||||||
X11_status_init, X11_status_finish, X11_status_enablefield,
|
X11_status_init, X11_status_finish, X11_status_enablefield,
|
||||||
X11_status_update,
|
X11_status_update,
|
||||||
genl_can_suspend_no, /* XXX may not always be correct */
|
genl_can_suspend_no, /* XXX may not always be correct */
|
||||||
|
X11_update_inventory,
|
||||||
|
X11_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1270,6 +1272,17 @@ X11_update_inventory(int arg)
|
|||||||
return;
|
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. */
|
/* The current implementation has all of the saved lines on the screen. */
|
||||||
int
|
int
|
||||||
X11_doprev_message(void)
|
X11_doprev_message(void)
|
||||||
|
|||||||
+19
-1
@@ -29,7 +29,6 @@ void chainin_add_menu(winid, const glyph_info *, const ANY_P *,
|
|||||||
void chainin_end_menu(winid, const char *);
|
void chainin_end_menu(winid, const char *);
|
||||||
int chainin_select_menu(winid, int, MENU_ITEM_P **);
|
int chainin_select_menu(winid, int, MENU_ITEM_P **);
|
||||||
char chainin_message_menu(char, int, const char *);
|
char chainin_message_menu(char, int, const char *);
|
||||||
void chainin_update_inventory(int);
|
|
||||||
void chainin_mark_synch(void);
|
void chainin_mark_synch(void);
|
||||||
void chainin_wait_synch(void);
|
void chainin_wait_synch(void);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -75,6 +74,8 @@ void chainin_status_update(int, genericptr_t, int, int, int,
|
|||||||
unsigned long *);
|
unsigned long *);
|
||||||
|
|
||||||
boolean chainin_can_suspend(void);
|
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_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
|
||||||
void chainin_procs_init(int dir);
|
void chainin_procs_init(int dir);
|
||||||
@@ -576,6 +577,21 @@ chainin_can_suspend(void)
|
|||||||
return rv;
|
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 = {
|
struct window_procs chainin_procs = {
|
||||||
"-chainin", 0, /* wincap */
|
"-chainin", 0, /* wincap */
|
||||||
0, /* wincap2 */
|
0, /* wincap2 */
|
||||||
@@ -621,4 +637,6 @@ struct window_procs chainin_procs = {
|
|||||||
chainin_status_init, chainin_status_finish, chainin_status_enablefield,
|
chainin_status_init, chainin_status_finish, chainin_status_enablefield,
|
||||||
chainin_status_update,
|
chainin_status_update,
|
||||||
chainin_can_suspend,
|
chainin_can_suspend,
|
||||||
|
chainin_update_inventory,
|
||||||
|
chainin_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|||||||
+20
-1
@@ -29,7 +29,6 @@ void chainout_add_menu(void *,winid, const glyph_info *, const ANY_P *,
|
|||||||
void chainout_end_menu(void *,winid, const char *);
|
void chainout_end_menu(void *,winid, const char *);
|
||||||
int chainout_select_menu(void *,winid, int, MENU_ITEM_P **);
|
int chainout_select_menu(void *,winid, int, MENU_ITEM_P **);
|
||||||
char chainout_message_menu(void *,char, int, const char *);
|
char chainout_message_menu(void *,char, int, const char *);
|
||||||
void chainout_update_inventory(void *,int);
|
|
||||||
void chainout_mark_synch(void *);
|
void chainout_mark_synch(void *);
|
||||||
void chainout_wait_synch(void *);
|
void chainout_wait_synch(void *);
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -75,6 +74,8 @@ void chainout_status_update(void *,int, genericptr_t, int, int, int,
|
|||||||
unsigned long *);
|
unsigned long *);
|
||||||
|
|
||||||
boolean chainout_can_suspend(void *);
|
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_init(int dir);
|
||||||
void *chainout_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
|
void *chainout_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
|
||||||
@@ -698,6 +699,22 @@ chainout_can_suspend(void *vp)
|
|||||||
return rv;
|
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 = {
|
struct chain_procs chainout_procs = {
|
||||||
"-chainout", 0, /* wincap */
|
"-chainout", 0, /* wincap */
|
||||||
0, /* wincap2 */
|
0, /* wincap2 */
|
||||||
@@ -744,4 +761,6 @@ struct chain_procs chainout_procs = {
|
|||||||
chainout_status_init, chainout_status_finish, chainout_status_enablefield,
|
chainout_status_init, chainout_status_finish, chainout_status_enablefield,
|
||||||
chainout_status_update,
|
chainout_status_update,
|
||||||
chainout_can_suspend,
|
chainout_can_suspend,
|
||||||
|
chainout_update_inventory,
|
||||||
|
chainout_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|||||||
+13
-1
@@ -77,7 +77,6 @@ struct window_procs curses_procs = {
|
|||||||
curses_end_menu,
|
curses_end_menu,
|
||||||
curses_select_menu,
|
curses_select_menu,
|
||||||
genl_message_menu,
|
genl_message_menu,
|
||||||
curses_update_inventory,
|
|
||||||
curses_mark_synch,
|
curses_mark_synch,
|
||||||
curses_wait_synch,
|
curses_wait_synch,
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -117,6 +116,8 @@ struct window_procs curses_procs = {
|
|||||||
genl_status_enablefield,
|
genl_status_enablefield,
|
||||||
curses_status_update,
|
curses_status_update,
|
||||||
genl_can_suspend_yes,
|
genl_can_suspend_yes,
|
||||||
|
curses_update_inventory,
|
||||||
|
curses_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -693,6 +694,17 @@ curses_update_inventory(int arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
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
|
all channels are caught up to here. Can be an empty call
|
||||||
|
|||||||
+20
-7
@@ -74,7 +74,7 @@ struct window_procs safe_procs = {
|
|||||||
safe_create_nhwindow, safe_clear_nhwindow, safe_display_nhwindow,
|
safe_create_nhwindow, safe_clear_nhwindow, safe_display_nhwindow,
|
||||||
safe_destroy_nhwindow, safe_curs, safe_putstr, safe_putmixed,
|
safe_destroy_nhwindow, safe_curs, safe_putstr, safe_putmixed,
|
||||||
safe_display_file, safe_start_menu, safe_add_menu, safe_end_menu,
|
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_mark_synch,
|
||||||
safe_wait_synch,
|
safe_wait_synch,
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
@@ -100,6 +100,8 @@ struct window_procs safe_procs = {
|
|||||||
safe_status_finish, safe_status_enablefield,
|
safe_status_finish, safe_status_enablefield,
|
||||||
safe_status_update,
|
safe_status_update,
|
||||||
safe_can_suspend,
|
safe_can_suspend,
|
||||||
|
safe_update_inventory,
|
||||||
|
safe_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct window_procs *
|
struct window_procs *
|
||||||
@@ -270,12 +272,6 @@ safe_message_menu(
|
|||||||
return '\033';
|
return '\033';
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
safe_update_inventory(int arg UNUSED)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
safe_mark_synch(void)
|
safe_mark_synch(void)
|
||||||
{
|
{
|
||||||
@@ -476,6 +472,23 @@ safe_status_update(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
* These are some optionally selectable routines that add
|
||||||
* some base functionality over the safe_* versions above.
|
* some base functionality over the safe_* versions above.
|
||||||
|
|||||||
+17
-2
@@ -183,8 +183,21 @@ void shim_update_inventory(int a1 UNUSED) {
|
|||||||
display_inventory(NULL, FALSE);
|
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__ */
|
#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
|
#endif
|
||||||
|
|
||||||
/* Interface definition used in windows.c */
|
/* Interface definition used in windows.c */
|
||||||
@@ -212,7 +225,7 @@ struct window_procs shim_procs = {
|
|||||||
shim_create_nhwindow, shim_clear_nhwindow, shim_display_nhwindow,
|
shim_create_nhwindow, shim_clear_nhwindow, shim_display_nhwindow,
|
||||||
shim_destroy_nhwindow, shim_curs, shim_putstr, genl_putmixed,
|
shim_destroy_nhwindow, shim_curs, shim_putstr, genl_putmixed,
|
||||||
shim_display_file, shim_start_menu, shim_add_menu, shim_end_menu,
|
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,
|
shim_wait_synch,
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
shim_cliparound,
|
shim_cliparound,
|
||||||
@@ -243,6 +256,8 @@ struct window_procs shim_procs = {
|
|||||||
genl_status_update,
|
genl_status_update,
|
||||||
#endif
|
#endif
|
||||||
genl_can_suspend_yes,
|
genl_can_suspend_yes,
|
||||||
|
shim_update_inventory,
|
||||||
|
shim_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
|
|||||||
+14
-1
@@ -135,7 +135,7 @@ struct window_procs tty_procs = {
|
|||||||
tty_destroy_nhwindow, tty_curs, tty_putstr,
|
tty_destroy_nhwindow, tty_curs, tty_putstr,
|
||||||
tty_putmixed,
|
tty_putmixed,
|
||||||
tty_display_file, tty_start_menu, tty_add_menu, tty_end_menu,
|
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,
|
tty_wait_synch,
|
||||||
#ifdef CLIPPING
|
#ifdef CLIPPING
|
||||||
tty_cliparound,
|
tty_cliparound,
|
||||||
@@ -166,6 +166,8 @@ struct window_procs tty_procs = {
|
|||||||
genl_status_update,
|
genl_status_update,
|
||||||
#endif
|
#endif
|
||||||
genl_can_suspend_yes,
|
genl_can_suspend_yes,
|
||||||
|
tty_update_inventory,
|
||||||
|
tty_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
winid BASE_WINDOW;
|
winid BASE_WINDOW;
|
||||||
@@ -3597,6 +3599,17 @@ tty_update_inventory(int arg UNUSED)
|
|||||||
return;
|
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
|
#ifdef TTY_PERM_INVENT
|
||||||
|
|
||||||
/* put the formatted object description for one item into a particular row
|
/* put the formatted object description for one item into a particular row
|
||||||
|
|||||||
+14
-1
@@ -100,7 +100,7 @@ struct window_procs mswin_procs = {
|
|||||||
genl_putmixed, mswin_display_file, mswin_start_menu, mswin_add_menu,
|
genl_putmixed, mswin_display_file, mswin_start_menu, mswin_add_menu,
|
||||||
mswin_end_menu, mswin_select_menu,
|
mswin_end_menu, mswin_select_menu,
|
||||||
genl_message_menu, /* no need for X-specific handling */
|
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
|
#ifdef CLIPPING
|
||||||
mswin_cliparound,
|
mswin_cliparound,
|
||||||
#endif
|
#endif
|
||||||
@@ -119,6 +119,8 @@ struct window_procs mswin_procs = {
|
|||||||
mswin_status_init, mswin_status_finish, mswin_status_enablefield,
|
mswin_status_init, mswin_status_finish, mswin_status_enablefield,
|
||||||
mswin_status_update,
|
mswin_status_update,
|
||||||
genl_can_suspend_yes,
|
genl_can_suspend_yes,
|
||||||
|
mswin_update_inventory,
|
||||||
|
mswin_update_invent_slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1241,6 +1243,17 @@ mswin_update_inventory(int arg)
|
|||||||
display_inventory(NULL, FALSE);
|
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
|
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
|
all channels are caught up to here. Can be an empty call
|
||||||
|
|||||||
+2
-1
@@ -161,7 +161,6 @@ void mswin_add_menu(winid wid, const glyph_info *glyphinfo,
|
|||||||
const char *str, unsigned int itemflags);
|
const char *str, unsigned int itemflags);
|
||||||
void mswin_end_menu(winid wid, const char *prompt);
|
void mswin_end_menu(winid wid, const char *prompt);
|
||||||
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
||||||
void mswin_update_inventory(int);
|
|
||||||
void mswin_mark_synch(void);
|
void mswin_mark_synch(void);
|
||||||
void mswin_wait_synch(void);
|
void mswin_wait_synch(void);
|
||||||
void mswin_cliparound(int x, int y);
|
void mswin_cliparound(int x, int y);
|
||||||
@@ -193,6 +192,8 @@ void mswin_status_finish(void);
|
|||||||
void mswin_status_enablefield(int fieldidx, const char *nm, const char *fmt,
|
void mswin_status_enablefield(int fieldidx, const char *nm, const char *fmt,
|
||||||
boolean enable);
|
boolean enable);
|
||||||
void mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color, unsigned long *colormasks);
|
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 */
|
/* helper function */
|
||||||
HWND mswin_hwnd_from_winid(winid wid);
|
HWND mswin_hwnd_from_winid(winid wid);
|
||||||
|
|||||||
Reference in New Issue
Block a user