Index: trunk/src/event.h =================================================================== --- trunk/src/event.h (revision 23662) +++ trunk/src/event.h (revision 23663) @@ -28,6 +28,7 @@ #define PCB_EVENT_H #include "config.h" #include "unit.h" +#include "global_typedefs.h" typedef enum { PCB_EVENT_GUI_INIT, /* finished initializing the GUI called right before the main loop of the GUI; args: (void) */ @@ -92,9 +93,8 @@ PCB_EVARG_ANGLE /* format char: a */ } pcb_event_argtype_t; - /* An argument is its type and value */ -typedef struct { +struct pcb_event_arg_s { pcb_event_argtype_t type; union { int i; @@ -104,7 +104,7 @@ pcb_coord_t c; pcb_angle_t a; } d; -} pcb_event_arg_t; +}; /* Initialize the event system */ void pcb_events_init(void); Index: trunk/src/global_typedefs.h =================================================================== --- trunk/src/global_typedefs.h (revision 23662) +++ trunk/src/global_typedefs.h (revision 23663) @@ -76,6 +76,8 @@ typedef struct pcb_hid_dad_subdialog_s pcb_hid_dad_subdialog_t; +typedef struct pcb_event_arg_s pcb_event_arg_t; + #include "pcb_bool.h" #include "unit.h" Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 23662) +++ trunk/src/hid_dad.h (revision 23663) @@ -32,6 +32,7 @@ #include "compat_misc.h" #include "hid_attrib.h" #include "pcb-printf.h" +#include "global_typedefs.h" /*** Helpers for building dynamic attribute dialogs (DAD) ***/ @@ -594,7 +595,18 @@ /* sub-dialogs e.g. for the file selector dialog */ struct pcb_hid_dad_subdialog_s { + /* filled in by the sub-dialog's creator */ PCB_DAD_DECL_NOINIT(dlg) + + /* filled in by the parent dialog's code, the subdialog's code should + call this to query/change properties of the parent dialog. cmd and + argc/argv are all specific to the given dialog. Returns 0 on success, + return payload may be placed in res (if it is not NULL). Parent poke: + close() - cancel/close the dialog */ + int (*parent_poke)(pcb_hid_dad_subdialog_t *sub, const char *cmd, pcb_event_arg_t *res, int argc, pcb_event_arg_t *argv[]); + + void *parent_ctx; /* used by the parent dialog code */ + void *sub_ctx; /* used by the sub-dialog's creator */ }; #endif