From e1b5332192f85945e86ec5f581d4914b0c9601b0 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 10 Feb 2014 18:34:09 +0000 Subject: Add ability to process AmigaGuide messages whilst the help system is running --- amiga/agclass/amigaguide_class.c | 30 +++++++++++++++++++++++++++++- amiga/agclass/amigaguide_class.h | 7 +++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/amiga/agclass/amigaguide_class.c b/amiga/agclass/amigaguide_class.c index dfac7ad7a..770c3175d 100755 --- a/amiga/agclass/amigaguide_class.c +++ b/amiga/agclass/amigaguide_class.c @@ -34,7 +34,7 @@ uint32 om_set(Class *, Object *, struct opSet *); uint32 om_get(Class *, Object *, struct opGet *); uint32 agm_open(Class *, Object *, Msg); uint32 agm_close(Class *, Object *, Msg); - +uint32 agm_process(Class *, Object *, Msg); /* *************************** class initialization and disposal ***************************** */ @@ -107,6 +107,9 @@ static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg) case AGM_CLOSE: return agm_close(cl, o, msg); + case AGM_PROCESS: + return agm_process(cl, o, msg); + default: return IIntuition->IDoSuperMethodA(cl, o, msg); } @@ -289,6 +292,11 @@ uint32 om_get(Class *cl, Object *o, struct opGet *msg) retVal = 1; break; + case AMIGAGUIDE_Signal: + *(msg->opg_Storage) = (uint32)lod->agSignal; + retVal = 1; + break; + default: retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg); } @@ -344,3 +352,23 @@ uint32 agm_close(Class *cl, Object *o, Msg msg) return (uint32)lod->agHandle; } + + +uint32 agm_process(Class *cl, Object *o, Msg msg) +{ + struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o); + + if (lod->agHandle) { + while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) ) { + switch(lod->agm->agm_Type) { + default: + printf("%d\n", lod->agm->agm_Type); + break; + } + } + IAmigaGuide->ReplyAmigaGuideMsg(lod->agm); + } + + return (uint32)lod->agHandle; +} + diff --git a/amiga/agclass/amigaguide_class.h b/amiga/agclass/amigaguide_class.h index f122f35f7..ee7e55e60 100755 --- a/amiga/agclass/amigaguide_class.h +++ b/amiga/agclass/amigaguide_class.h @@ -27,10 +27,13 @@ #define AMIGAGUIDE_BaseName (AMIGAGUIDE_Dummy + 4) // Basename of the application that opens the help file. #define AMIGAGUIDE_ContextArray (AMIGAGUIDE_Dummy + 5) // Context node array (must be NULL-terminated). #define AMIGAGUIDE_ContextID (AMIGAGUIDE_Dummy + 6) // Index value of the node to display. +#define AMIGAGUIDE_Signal (AMIGAGUIDE_Dummy + 7) // Signal mask to wait on // method definition -#define AGM_OPEN WM_OPEN -#define AGM_CLOSE WM_CLOSE +#define AGM_Dummy AMIGAGUIDE_Dummy + 100 +#define AGM_OPEN AGM_Dummy + 1 +#define AGM_CLOSE AGM_Dummy + 2 +#define AGM_PROCESS AGM_Dummy + 3 // function prototypes Class *initAGClass(void); -- cgit v1.2.3