2 Copyright © 1999, David Le Corfec.
3 Copyright © 2002, The AROS Development Team.
9 #include <exec/types.h>
12 //#include <libraries/mui.h>
13 #include <proto/exec.h>
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
17 #include <libraries/mui.h>
19 #include <clib/alib_protos.h>
22 struct Library
*MUIMasterBase
;
29 /* On AmigaOS we build a fake library base, because it's not compiled as sharedlibrary yet */
30 #include "muimaster_intern.h"
32 int openmuimaster(void)
34 static struct MUIMasterBase_intern MUIMasterBase_instance
;
35 MUIMasterBase
= (struct Library
*)&MUIMasterBase_instance
;
37 MUIMasterBase_instance
.sysbase
= *((struct ExecBase
**)4);
38 MUIMasterBase_instance
.dosbase
= OpenLibrary("dos.library",37);
39 MUIMasterBase_instance
.utilitybase
= OpenLibrary("utility.library",37);
40 MUIMasterBase_instance
.aslbase
= OpenLibrary("asl.library",37);
41 MUIMasterBase_instance
.gfxbase
= OpenLibrary("graphics.library",37);
42 MUIMasterBase_instance
.layersbase
= OpenLibrary("layers.library",37);
43 MUIMasterBase_instance
.intuibase
= OpenLibrary("intuition.library",37);
44 MUIMasterBase_instance
.cxbase
= OpenLibrary("commodities.library",37);
45 MUIMasterBase_instance
.keymapbase
= OpenLibrary("keymap.library",37);
46 __zune_prefs_init(&__zprefs
);
51 void closemuimaster(void)
57 int openmuimaster(void)
59 if ((MUIMasterBase
= OpenLibrary("muimaster.library", 0))) return 1;
63 void closemuimaster(void)
65 if (MUIMasterBase
) CloseLibrary(MUIMasterBase
);
70 int main (int argc
, char **argv
)
75 if (!openmuimaster()) return 20;
77 app
= ApplicationObject
,
78 SubWindow
, mainWin
= WindowObject
,
79 MUIA_Window_Title
, "Input modes",
80 WindowContents
, VGroup
,
82 MUIA_Numeric_Value
, 50,
90 fprintf(stderr
, "can't create application object.\n");
94 DoMethod(mainWin
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
95 (IPTR
)app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
97 set(mainWin
, MUIA_Window_Open
, TRUE
);
98 if (!XGET(mainWin
, MUIA_Window_Open
))
100 MUI_DisposeObject(app
);
101 fprintf(stderr
, "%s : can't open main window.\n", argv
[0]);
108 while (DoMethod(app
, MUIM_Application_NewInput
, (IPTR
)&sigs
)
109 != MUIV_Application_ReturnID_Quit
)
113 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
);
114 if (sigs
& SIGBREAKF_CTRL_C
) break;
119 set(mainWin
, MUIA_Window_Open
, FALSE
);
120 MUI_DisposeObject(app
);