2 Copyright © 1999, David Le Corfec.
3 Copyright © 2002, The AROS Development Team.
9 #include <exec/types.h>
11 //#include <libraries/mui.h>
12 #include <clib/alib_protos.h>
13 #include <proto/exec.h>
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
17 #include <libraries/mui.h>
21 struct Library
*MUIMasterBase
;
28 /* On AmigaOS we build a fake library base, because it's not compiled as sharedlibrary yet */
29 #include "muimaster_intern.h"
31 int openmuimaster(void)
33 static struct MUIMasterBase_intern MUIMasterBase_instance
;
34 MUIMasterBase
= (struct Library
*)&MUIMasterBase_instance
;
36 MUIMasterBase_instance
.sysbase
= *((struct ExecBase
**)4);
37 MUIMasterBase_instance
.dosbase
= OpenLibrary("dos.library",37);
38 MUIMasterBase_instance
.utilitybase
= OpenLibrary("utility.library",37);
39 MUIMasterBase_instance
.aslbase
= OpenLibrary("asl.library",37);
40 MUIMasterBase_instance
.gfxbase
= OpenLibrary("graphics.library",37);
41 MUIMasterBase_instance
.layersbase
= OpenLibrary("layers.library",37);
42 MUIMasterBase_instance
.intuibase
= OpenLibrary("intuition.library",37);
43 MUIMasterBase_instance
.cxbase
= OpenLibrary("commodities.library",37);
44 MUIMasterBase_instance
.keymapbase
= OpenLibrary("keymap.library",37);
45 __zune_prefs_init(&__zprefs
);
50 void closemuimaster(void)
56 int openmuimaster(void)
58 if ((MUIMasterBase
= OpenLibrary("muimaster.library", 0))) return 1;
62 void closemuimaster(void)
64 if (MUIMasterBase
) CloseLibrary(MUIMasterBase
);
74 if (!openmuimaster()) return 20;
76 obj
= MUI_NewObjectA(MUIC_Notify
, NULL
);
77 printf("new Notify object = %p\n", obj
);
80 set(obj
, MUIA_UserData
, 21);
81 get(obj
, MUIA_UserData
, &val
);
82 printf("object UserData = %ld (should be 21)\n", (long)val
);
84 DoMethod(obj
, MUIM_Notify
, MUIA_UserData
, MUIV_EveryTime
, MUIV_Notify_Self
,
85 3, MUIM_Set
, MUIA_ObjectID
, 19);
86 printf("MUIM_Notify OK\n");
88 set(obj
, MUIA_ObjectID
, 12);
89 get(obj
, MUIA_ObjectID
, &val
);
90 printf("id = %ld (should be 12)\n", (long)val
);
92 set(obj
, MUIA_UserData
, 22);
93 get(obj
, MUIA_ObjectID
, &val
);
94 printf("id = %ld (should be 19) after notification\n", (long)val
);
96 set(obj
, MUIA_ObjectID
, 14);
97 set(obj
, MUIA_UserData
, 22);
98 get(obj
, MUIA_ObjectID
, &val
);
99 printf("id = %ld (should be 14) after notification\n", (long)val
);
101 MUI_DisposeObject(obj
);