Get and process AmigaGuide help messages

This commit is contained in:
Chris Young 2014-02-10 18:42:50 +00:00
parent e1b5332192
commit 36e0715dfb
3 changed files with 27 additions and 9 deletions

View File

@ -2556,8 +2556,9 @@ void ami_get_msg(void)
struct TimerRequest *timermsg = NULL;
struct MsgPort *printmsgport = ami_print_get_msgport();
ULONG printsig = 0;
ULONG helpsignal = ami_help_signal();
if(printmsgport) printsig = 1L << printmsgport->mp_SigBit;
ULONG signalmask = winsignal | appsig | schedulesig | rxsig | printsig | applibsig | ctrlcsig;
ULONG signalmask = winsignal | appsig | schedulesig | rxsig | printsig | applibsig | ctrlcsig | helpsignal;
signal = Wait(signalmask);
@ -2573,25 +2574,23 @@ void ami_get_msg(void)
if(signal & applibsig)
ami_handle_applib();
if(signal & printsig)
{
if(signal & printsig) {
while(GetMsg(printmsgport)); //ReplyMsg
ami_print_cont();
}
if(signal & schedulesig)
{
if(timermsg = (struct TimerRequest *)GetMsg(msgport))
{
if(signal & schedulesig) {
if(timermsg = (struct TimerRequest *)GetMsg(msgport)) {
ReplyMsg((struct Message *)timermsg);
schedule_run(FALSE);
}
}
if(signal & helpsignal)
ami_help_process();
if(signal & ctrlcsig)
{
ami_quit_netsurf_delayed();
}
}
static void ami_gui_fetch_callback(void *p)
@ -2778,6 +2777,7 @@ void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen)
}
FreeSignal(screen_signal);
screen_signal = -1;
scrn = NULL;
}

View File

@ -66,3 +66,18 @@ void ami_help_new_screen(struct Screen *screen)
if(AmigaGuideObject == NULL) return;
SetAttrs(AmigaGuideObject, AMIGAGUIDE_Screen, screen, TAG_DONE);
}
ULONG ami_help_signal(void)
{
ULONG ag_sig = 0;
if(AmigaGuideObject)
SetAttrs(AmigaGuideObject, AMIGAGUIDE_Signal, &ag_sig, TAG_DONE);
return ag_sig;
}
void ami_help_process(void)
{
ULONG ret = IDoMethod(AmigaGuideObject, AGM_PROCESS, NULL);
printf("ret = %d\n", ret); // should be NULL if closed
}

View File

@ -32,4 +32,7 @@ struct Screen;
void ami_help_open(ULONG node, struct Screen *screen);
void ami_help_free(void);
void ami_help_new_screen(struct Screen *screen);
ULONG ami_help_signal(void);
void ami_help_process(void);
#endif