Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / workbench / libs / muimaster / tutorial / examples / muizunesupport.h
blob742fcd751cbcc713f0acaacaffbed85e79032772
1 /*
2 Copyright © 2003-2011, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #ifndef _ZUNE_MUISUPPORT_H
9 #define _ZUNE_MUISUPPORT_H
11 #include <string.h>
13 #include <exec/memory.h>
15 #include <libraries/asl.h>
16 #include <libraries/mui.h>
17 #include <prefs/prefhdr.h>
19 #include <clib/alib_protos.h>
20 #include <proto/exec.h>
21 #include <proto/dos.h>
22 #include <proto/intuition.h>
23 #include <proto/utility.h>
24 #include <proto/iffparse.h>
26 #ifdef __AROS__
27 #include <proto/muimaster.h>
28 #endif
30 Object *MakeLabel(STRPTR str);
31 LONG xget(Object * obj, ULONG attr);
33 #define getstring(obj) (char *) xget(obj, MUIA_String_Contents)
35 #define SimpleText(text) TextObject, MUIA_Text_Contents, (IPTR) text, End
38 #ifndef __AROS__
40 struct Library *MUIMasterBase;
42 /* On AmigaOS we build a fake library base, because it's not compiled as sharedlibrary yet */
43 #include "muimaster_intern.h"
45 int open_muimaster(void)
47 static struct MUIMasterBase_intern MUIMasterBase_instance;
48 MUIMasterBase = (struct Library*)&MUIMasterBase_instance;
50 MUIMasterBase_instance.sysbase = *((struct ExecBase **)4);
51 MUIMasterBase_instance.dosbase = (void *)OpenLibrary("dos.library", 37);
52 MUIMasterBase_instance.utilitybase = (void *)OpenLibrary("utility.library", 37);
53 MUIMasterBase_instance.aslbase = OpenLibrary("asl.library", 37);
54 MUIMasterBase_instance.gfxbase = (void *)OpenLibrary("graphics.library", 37);
55 MUIMasterBase_instance.layersbase = OpenLibrary("layers.library", 37);
56 MUIMasterBase_instance.intuibase = (void *)OpenLibrary("intuition.library", 37);
57 MUIMasterBase_instance.cxbase = OpenLibrary("commodities.library",37);
58 MUIMasterBase_instance.keymapbase = OpenLibrary("keymap.library", 37);
59 MUIMasterBase_instance.gadtoolsbase = OpenLibrary("gadtools.library", 37);
60 MUIMasterBase_instance.iffparsebase = OpenLibrary("iffparse.library", 37);
61 MUIMasterBase_instance.diskfontbase = OpenLibrary("diskfont.library", 37);
62 __zune_prefs_init(&__zprefs);
63 InitSemaphore(&MUIMB(MUIMasterBase)->ZuneSemaphore);
64 return 1;
67 #else
69 int open_muimaster(void)
71 return 1;
74 #endif
76 void close_muimaster(void)
80 /****************************************************************
81 Open needed libraries
82 *****************************************************************/
83 int open_libs(void)
85 if (open_muimaster())
87 return 1;
90 return 0;
94 /****************************************************************
95 Close opened libraries
96 *****************************************************************/
97 void close_libs(void)
99 close_muimaster();
103 /****************************************************************
104 Create a simple label
105 *****************************************************************/
106 Object *MakeLabel(STRPTR str)
108 return (MUI_MakeObject(MUIO_Label, str, 0));
112 /****************************************************************
113 Easy getting an attributes value
114 *****************************************************************/
115 LONG xget(Object * obj, ULONG attr)
117 LONG x = 0;
118 get(obj, attr, &x);
119 return x;
123 #endif /* _ZUNE_MUISUPPORT_H */