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
+17 -2
View File
@@ -183,8 +183,21 @@ void shim_update_inventory(int a1 UNUSED) {
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 */
@@ -212,7 +225,7 @@ struct window_procs shim_procs = {
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,
@@ -243,6 +256,8 @@ struct window_procs shim_procs = {
genl_status_update,
#endif
genl_can_suspend_yes,
shim_update_inventory,
shim_update_invent_slot,
};
#ifdef __EMSCRIPTEN__