rework TTY_PERM_INVENT; update window port interface

Change the inner workings of the experimental TTY_PERM_INVENT.

Switch to delivering the content to tty for the experimental perm_invent
via the existing window port interface (start_menu(), add_menu(), end_menu).

This also adds a new window port interface call ctrl_nhwindow() for
delivering information to the window port, and/or obtaining specific
information from the window port. The information and requests can
be extended as required. To be documented later once the changes settle
down.

Due to the intrusive nature of these changes and the possibility of
some bugs in the new code, I'm going to leave TTY_PERM_INVENT commented
out in the repository for a day or two.  Anyone wishing to test it out
can do so by uncommenting TTY_PERM_INVENT in config.h.
This commit is contained in:
nhmall
2022-07-03 00:34:08 -04:00
parent 67e80cc329
commit c84e0ba6e1
28 changed files with 602 additions and 616 deletions

View File

@@ -536,7 +536,7 @@ static void hup_void_fdecl_int(int);
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 win_request_info *hup_ctrl_nhwindow(winid, int, win_request_info *);
static struct window_procs hup_procs = {
WPID(hup), 0L, 0L,
@@ -585,7 +585,7 @@ static struct window_procs hup_procs = {
genl_status_enablefield, hup_status_update,
genl_can_suspend_no,
hup_void_fdecl_int, /* update_inventory */
hup_update_invent_slot, /* update_invent_slot */
hup_ctrl_nhwindow,
};
static void (*previnterface_exit_nhwindows)(const char *) = 0;
@@ -841,15 +841,13 @@ hup_void_fdecl_constchar_p(const char *string UNUSED)
}
/*ARGUSED*/
perminvent_info *
hup_update_invent_slot(
win_request_info *
hup_ctrl_nhwindow(
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)
int request UNUSED,
win_request_info *wri UNUSED)
{
return (perminvent_info *) 0;
return (win_request_info *) 0;
}
#endif /* HANGUPHANDLING */