diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-02-10 18:34:09 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2014-02-10 18:34:09 +0000 |
commit | e1b5332192f85945e86ec5f581d4914b0c9601b0 (patch) | |
tree | d2fba403ea414dd290e236d30adc3627ad6f435a /amiga/agclass | |
parent | 4aa59f538276ce9413121d6d2e6eeed8ae5c0900 (diff) | |
download | netsurf-e1b5332192f85945e86ec5f581d4914b0c9601b0.tar.gz netsurf-e1b5332192f85945e86ec5f581d4914b0c9601b0.tar.bz2 |
Add ability to process AmigaGuide messages whilst the help system is running
Diffstat (limited to 'amiga/agclass')
-rwxr-xr-x | amiga/agclass/amigaguide_class.c | 30 | ||||
-rwxr-xr-x | 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); |