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

View File

@@ -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()
{
}
@@ -1053,7 +1064,6 @@ struct window_procs Qt_procs = {
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
@@ -1100,6 +1110,8 @@ struct window_procs Qt_procs = {
genl_status_update,
#endif
genl_can_suspend_yes,
nethack_qt_::NetHackQtBind::qt_update_inventory,
nethack_qt_::NetHackQtBind::qt_update_invent_slot,
};
#ifndef WIN32