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:
nhmall
2022-06-23 14:01:35 -04:00
parent da3c5dfe87
commit 736e9f14f8
17 changed files with 196 additions and 24 deletions
+14 -1
View File
@@ -117,7 +117,7 @@ struct window_procs X11_procs = {
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
@@ -141,6 +141,8 @@ struct window_procs X11_procs = {
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,
};
/*
@@ -1270,6 +1272,17 @@ X11_update_inventory(int arg)
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)