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
@@ -100,7 +100,7 @@ struct window_procs mswin_procs = {
genl_putmixed, mswin_display_file, mswin_start_menu, mswin_add_menu,
mswin_end_menu, mswin_select_menu,
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
mswin_cliparound,
#endif
@@ -119,6 +119,8 @@ struct window_procs mswin_procs = {
mswin_status_init, mswin_status_finish, mswin_status_enablefield,
mswin_status_update,
genl_can_suspend_yes,
mswin_update_inventory,
mswin_update_invent_slot,
};
/*
@@ -1241,6 +1243,17 @@ mswin_update_inventory(int arg)
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
all channels are caught up to here. Can be an empty call
+2 -1
View File
@@ -161,7 +161,6 @@ void mswin_add_menu(winid wid, const glyph_info *glyphinfo,
const char *str, unsigned int itemflags);
void mswin_end_menu(winid wid, const char *prompt);
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
void mswin_update_inventory(int);
void mswin_mark_synch(void);
void mswin_wait_synch(void);
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,
boolean enable);
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 */
HWND mswin_hwnd_from_winid(winid wid);