2 Copyright © 2014, The AROS Development Team. All rights reserved.
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
16 #include <libraries/mui.h>
17 #include <clib/alib_protos.h>
19 #include "felsunxi_intern.h"
24 AROS_UFH0(void, FELSunxiTask
) {
27 struct Task
*thistask
;
28 struct FELSunxiDevice
*FELSunxiDevice
;
31 struct Library
*MUIMasterBase
;
33 thistask
= FindTask(NULL
);
34 FELSunxiDevice
= thistask
->tc_UserData
;
36 ps
= FELSunxiDevice
->ps
;
37 MUIMasterBase
= FELSunxiDevice
->MUIMasterBase
;
39 mybug(-1,("FELSunxiTask started\n"));
41 Object
*app
, *wnd
, *b1
, *b2
, *b3
, *tick1
;
43 app
= ApplicationObject
,
44 SubWindow
, wnd
= WindowObject
,
45 MUIA_Window_Title
, "FELSunxi",
46 MUIA_Window_Activate
, TRUE
,
47 WindowContents
, HGroup
,
50 MUIA_Group_SameWidth
, TRUE
,
51 GroupFrameT("FELSunxi"),
52 Child
, b1
= SimpleButton("DRAM"),
53 Child
, b2
= SimpleButton("NAND"),
54 Child
, b3
= SimpleButton("SERIAL"),
56 Child
, tick1
= MUI_MakeObject(MUIO_Checkmark
, NULL
),
57 Child
, MUI_MakeObject(MUIO_Label
,"Show object box", 0),
59 Child
, (IPTR
) VSpace(0),
68 mybug(-1,("Zune app up!\n"));
70 mybug(-1,("FELSunxiTask signaling creator\n"));
71 Signal(FELSunxiDevice
->readysigtask
, 1L<<FELSunxiDevice
->readysignal
);
75 DoMethod(wnd
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, (IPTR
) app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
76 set(wnd
,MUIA_Window_Open
,TRUE
);
80 if( DoMethod(app
, MUIM_Application_NewInput
, (IPTR
) &sigs
) == MUIV_Application_ReturnID_Quit
) {
81 psdReleaseDevBinding(FELSunxiDevice
->pd
);
85 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
86 if(sigs
& SIGBREAKF_CTRL_C
) break;
87 if(sigs
& SIGBREAKF_CTRL_D
) break;
91 MUI_DisposeObject(app
);
94 psdFreeVec(FELSunxiDevice
);
95 /* This is why we copied the bases to stack */
96 CloseLibrary(MUIMasterBase
);