2 #include <proto/exec.h>
4 #include <proto/intuition.h>
5 #include <proto/muimaster.h>
8 #include "muimiamipanel_intern.h"
12 /***********************************************************************/
13 AROS_UFH3(void, MiamiPanelProc
,
14 AROS_UFHA(STRPTR
, argPtr
, A0
),
15 AROS_UFHA(ULONG
, argSize
, D0
),
16 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
20 struct Process
*me
= (struct Process
*)FindTask(NULL
);
21 struct MiamiPanelBase_intern
*MiamiPanelBaseIntern
= ((struct Task
*)me
)->tc_UserData
;
22 register struct MPS_AppMsg
*msg
= NULL
;
23 register Object
*app
= NULL
; //gcc
24 register struct Window
*win
= NULL
;
27 ObtainSemaphore(&MiamiPanelBaseIntern
->mpb_procSem
);
29 WaitPort(&me
->pr_MsgPort
);
30 msg
= (struct MPS_AppMsg
*)GetMsg(&me
->pr_MsgPort
);
32 win
= me
->pr_WindowPtr
;
33 me
->pr_WindowPtr
= (struct Window
*)-1;
35 MiamiPanelBaseIntern
->mpb_port
= CreateMsgPort();
37 struct TagItem appObjecttags
[] = {MPA_Show
, msg
->flags
,
40 app
= MUI_NewObjectA(MiamiPanelBaseIntern
->mpb_appClass
->mcc_Class
, appObjecttags
);
42 res
= ((MiamiPanelBaseIntern
) && (app
));
45 ReplyMsg((struct Message
*)msg
);
47 me
->pr_WindowPtr
= win
;
53 MiamiPanelBaseIntern
->mpb_app
= app
;
55 for (signals
= 0; DoMethod(app
, MUIM_Application_NewInput
, (ULONG
)&signals
) != MUIV_Application_ReturnID_Quit
; )
56 if (signals
&& ((signals
= Wait(signals
| SIGBREAKF_CTRL_C
)) & SIGBREAKF_CTRL_C
))
57 DoMethod(app
, MPM_Quit
);
59 MUI_DisposeObject(app
);
62 ObtainSemaphore(&MiamiPanelBaseIntern
->mpb_libSem
);
64 if (MiamiPanelBaseIntern
->mpb_port
)
66 DeleteMsgPort(MiamiPanelBaseIntern
->mpb_port
);
67 MiamiPanelBaseIntern
->mpb_port
= NULL
;
68 MiamiPanelBaseIntern
->mpb_app
= NULL
;
71 ReleaseSemaphore(&MiamiPanelBaseIntern
->mpb_libSem
);
72 ReleaseSemaphore(&MiamiPanelBaseIntern
->mpb_procSem
);
75 MiamiPanelBaseIntern
->mpb_use
--;
81 /***********************************************************************/