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:
@@ -29,7 +29,6 @@ void chainin_add_menu(winid, const glyph_info *, const ANY_P *,
|
||||
void chainin_end_menu(winid, const char *);
|
||||
int chainin_select_menu(winid, int, MENU_ITEM_P **);
|
||||
char chainin_message_menu(char, int, const char *);
|
||||
void chainin_update_inventory(int);
|
||||
void chainin_mark_synch(void);
|
||||
void chainin_wait_synch(void);
|
||||
#ifdef CLIPPING
|
||||
@@ -75,6 +74,8 @@ void chainin_status_update(int, genericptr_t, int, int, int,
|
||||
unsigned long *);
|
||||
|
||||
boolean chainin_can_suspend(void);
|
||||
void chainin_update_inventory(int);
|
||||
perminvent_info *chainin_update_invent_slot(winid, int, perminvent_info *);
|
||||
|
||||
void *chainin_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
|
||||
void chainin_procs_init(int dir);
|
||||
@@ -576,6 +577,21 @@ chainin_can_suspend(void)
|
||||
return rv;
|
||||
}
|
||||
|
||||
perminvent_info *
|
||||
chainin_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)
|
||||
{
|
||||
boolean rv;
|
||||
|
||||
rv = (*cibase->nprocs->win_update_invent_slot)(cibase->ndata, window,
|
||||
inventory_slot, pi);
|
||||
return rv;
|
||||
}
|
||||
|
||||
struct window_procs chainin_procs = {
|
||||
"-chainin", 0, /* wincap */
|
||||
0, /* wincap2 */
|
||||
@@ -621,4 +637,6 @@ struct window_procs chainin_procs = {
|
||||
chainin_status_init, chainin_status_finish, chainin_status_enablefield,
|
||||
chainin_status_update,
|
||||
chainin_can_suspend,
|
||||
chainin_update_inventory,
|
||||
chainin_update_invent_slot,
|
||||
};
|
||||
|
||||
@@ -29,7 +29,6 @@ void chainout_add_menu(void *,winid, const glyph_info *, const ANY_P *,
|
||||
void chainout_end_menu(void *,winid, const char *);
|
||||
int chainout_select_menu(void *,winid, int, MENU_ITEM_P **);
|
||||
char chainout_message_menu(void *,char, int, const char *);
|
||||
void chainout_update_inventory(void *,int);
|
||||
void chainout_mark_synch(void *);
|
||||
void chainout_wait_synch(void *);
|
||||
#ifdef CLIPPING
|
||||
@@ -75,6 +74,8 @@ void chainout_status_update(void *,int, genericptr_t, int, int, int,
|
||||
unsigned long *);
|
||||
|
||||
boolean chainout_can_suspend(void *);
|
||||
void chainout_update_inventory(void *, int);
|
||||
perminvent_info *chainout_update_invent_slot(void *, winid, int, perminvent_info *);
|
||||
|
||||
void chainout_procs_init(int dir);
|
||||
void *chainout_procs_chain(int cmd, int n, void *me, void *nextprocs, void *nextdata);
|
||||
@@ -698,6 +699,22 @@ chainout_can_suspend(void *vp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
perminvent_info *
|
||||
chainout_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)
|
||||
{
|
||||
struct chainout_data *tdp = vp;
|
||||
boolean rv;
|
||||
|
||||
rv = (*tdp->nprocs->win_update_invent_slot)(window,
|
||||
inventory_slot, pi);
|
||||
return rv;
|
||||
}
|
||||
|
||||
struct chain_procs chainout_procs = {
|
||||
"-chainout", 0, /* wincap */
|
||||
0, /* wincap2 */
|
||||
@@ -744,4 +761,6 @@ struct chain_procs chainout_procs = {
|
||||
chainout_status_init, chainout_status_finish, chainout_status_enablefield,
|
||||
chainout_status_update,
|
||||
chainout_can_suspend,
|
||||
chainout_update_inventory,
|
||||
chainout_update_invent_slot,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user