Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / system / Wanderer / portable_macros.h
bloba0bbee536fbb10e80ee52f9214d1f0d2bc289ce3
1 #ifndef __PORTABLE_MACROS__
2 #define __PORTABLE_MACROS__
4 #define TAGITEM struct TagItem **
6 #ifndef __AROS__
8 #if !defined(__AROS__) || !defined(__MORPHOS__)
9 #ifdef __amigaos4__
10 #define IPTR uint32
11 #else
12 #define IPTR ULONG
13 #endif
14 #endif
16 #ifndef __AROS__
17 #define STACKED
18 #endif
20 #ifndef __AROS__
21 #include <proto/exec.h>
22 #include <proto/utility.h>
23 #endif
26 #ifndef __AROS__
27 #include <proto/wb.h>
28 #endif
31 #ifndef __AROS__
32 #define AROS_BIG_ENDIAN 1
33 #endif
36 #ifndef __AROS__
37 #include <exec_AROS/lists.h>
38 #endif
41 #ifndef __AROS__
42 #include <workbench/icon.h>
43 #endif
45 #if defined (__MORPHOS__) || (defined (__AMIGA__) && !defined(__PPC__))
46 #include <dos/dostags.h>
47 #endif
49 #ifndef __AROS__
50 #include <SDI_compiler.h>
51 #include <SDI_hook.h>
52 #include <SDI_stdarg.h>
53 #endif
56 #ifndef __AROS__
58 #ifdef __amigaos4__
59 #define UQUAD uint64
60 #define QUAD int64
61 #else
62 #define UQUAD ULONG
63 #define QUAD LONG
64 #endif
66 extern struct Library *MUIMasterBase;
67 #ifdef __amigaos4__
68 extern struct MUIMasterIFace *IMUIMaster;
69 #endif
72 #define AROS_UFHA(type,name,reg) type name
75 #define AROS_UFH0(rettype,name) rettype name()
77 #define AROS_UFH1(rettype,name,a1) rettype name(a1)
79 #define AROS_UFH2(rettype,name,a1,a2) rettype name (a1, a2)
81 #define AROS_UFH3(rettype,name,a1,a2,a3) rettype name (a1, a2, a3)
84 #define AROS_USERFUNC_INIT
85 #define AROS_USERFUNC_EXIT
87 #define MUIB_MUI (TAG_USER) /* Base for legacy MUI identifiers */
88 #define MUIB_RSVD (MUIB_MUI | 0x10400000) /* Base for AROS reserved range */
89 #define MUIB_ZUNE (MUIB_RSVD | 0x00020000) /* Base for Zune core reserved range */
90 #define MUIB_AROS (MUIB_RSVD | 0x00070000) /* Base for AROS core reserved range */
95 #define MAX(a,b) (((a) > (b))?(a):(b))
96 #define MIN(a,b) (((a) > (b))?(b):(a))
98 #define _AndRectRect(rect1, rect2, intersect) \
99 ({ \
100 BOOL res; \
102 if (overlap(*(rect1), *(rect2))) \
104 (intersect)->MinX = MAX((rect1)->MinX, (rect2)->MinX); \
105 (intersect)->MinY = MAX((rect1)->MinY, (rect2)->MinY); \
106 (intersect)->MaxX = MIN((rect1)->MaxX, (rect2)->MaxX); \
107 (intersect)->MaxY = MIN((rect1)->MaxY, (rect2)->MaxY); \
109 res = TRUE; \
111 else \
112 res = FALSE; \
114 res; \
118 #define _DoRectsOverlap(Rect, x1, y1, x2, y2) \
120 y1 <= (Rect)->MaxY && \
121 y2 >= (Rect)->MinY && \
122 x1 <= (Rect)->MaxX && \
123 x2 >= (Rect)->MinX \
126 #define overlap(a,b) _DoRectsOverlap(&(a), (b).MinX, (b).MinY, (b).MaxX, (b).MaxY)
131 #define GET(obj,attr,store) get(obj,attr,store)
132 #define SET(obj,attr,value) set(obj,attr,value)
134 #define XGET(object, attribute) \
135 ({ \
136 IPTR __storage = 0; \
137 GetAttr((attribute), (object), &__storage); \
138 __storage; \
141 #define NNSET(obj,attr,value) nnset(obj,attr,value)
145 #if !defined(__amigaos4__)
147 #define GetHead(_l) \
148 ({ struct List *l = (struct List *)(_l); \
149 l->lh_Head->ln_Succ ? l->lh_Head : (struct Node *)0; \
152 #define GetSucc(_n) \
153 ({ struct Node *n = (struct Node *)(_n); \
154 n->ln_Succ->ln_Succ ? n->ln_Succ : (struct Node *)0; \
157 #define GetTail(_l) \
158 ({ struct List *l = (struct List *)(_l); \
159 l->lh_TailPred->ln_Pred ? l->lh_TailPred : (struct Node *)0; \
162 #define GetPred(_n) \
163 ({ struct Node *n = (struct Node *)(_n); \
164 n->ln_Pred->ln_Pred ? n->ln_Pred : (struct Node *)0; \
166 #endif
169 #define ImageButton(label, imagePath) MUI_MakeObject(MUIO_Button, (IPTR) (label))
171 #define BOOPSI_DISPATCHER(ret, nameDsp, cls, obj, msg) DISPATCHER(nameDsp)
172 #define BOOPSI_DISPATCHER_END
176 #define SendAppWindowMessage(...) sizeof(NULL)
177 #define RegisterWorkbench(...) sizeof(NULL)
178 #define UnregisterWorkbench(...) sizeof(NULL)
179 #define ArosInquire(...) sizeof(NULL)
180 #define AROS_LE2LONG(...) sizeof(NULL)
181 #define ADD2INIT(...)
182 #define ADD2EXIT(...)
183 #define Detach()
184 #define __showerror
186 #define DeinitRastPort FreeRastPort
189 extern struct RastPort *CreateRastPort(void);
190 extern struct RastPort *CloneRastPort(struct RastPort *rp);
191 extern void FreeRastPort(struct RastPort *rp);
192 extern BOOL AndRectRect(struct Rectangle *rect1, struct Rectangle *rect2, struct Rectangle *intersect);
196 #if defined (__AMIGA__) && !defined(__PPC__)
197 #define NP_UserData (NP_Dummy + 26)
198 /* optional value to install into task->tc_UserData. */
199 #endif
202 struct MUIP_CreateDragImage {STACKED ULONG MethodID; STACKED LONG touchx; STACKED LONG touchy; STACKED ULONG flags;};
204 struct MUI_DragImage
206 struct BitMap *bm;
207 WORD width; /* exact width and height of bitmap */
208 WORD height;
209 WORD touchx; /* position of pointer click relative to bitmap */
210 WORD touchy;
211 ULONG flags; /* must be set to 0 */
214 struct MUIP_DeleteDragImage {STACKED ULONG MethodID; STACKED struct MUI_DragImage *di;};
216 struct MUIP_Layout {STACKED ULONG MethodID;};
218 #define MUIA_Prop_DeltaFactor (MUIB_MUI|0x00427c5e) /* MUI: is. LONG */
219 #define MUIM_CreateDragImage (MUIB_MUI|0x0042eb6f) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */
220 #define MUIM_DeleteDragImage (MUIB_MUI|0x00423037) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */
222 #ifndef __AROS__
223 #define MUIM_Application_Execute (MUIB_Wanderer | 0x000000011)
224 #endif
226 extern STRPTR StrDup (CONST_STRPTR str);
228 extern int IconWindowIconDrawerList_Initialize(void);
229 extern int IconWindowIconVolumeList_Initialize(void);
230 extern int WandererPrefs_Initialize(void);
231 extern int Wanderer_Initialize(void);
232 extern int IconWindow_Initialize(void);
235 extern void IconWindowIconDrawerList_Deinitialize(void);
236 extern void IconWindowIconVolumeList_Deinitialize(void);
237 extern void WandererPrefs_Deinitialize(void);
238 extern void Wanderer_Deinitialize(void);
239 extern void IconWindow_Deinitialize(void);
243 extern struct MUI_CustomClass *IconWindowIconVolumeList_CLASS;
244 extern struct MUI_CustomClass *IconWindowIconDrawerList_CLASS;
245 extern struct MUI_CustomClass *WandererPrefs_CLASS;
246 extern struct MUI_CustomClass *IconWindow_CLASS;
249 extern int initIconWindowClass(void);
250 //extern struct MUI_CustomClass *initIconWindowClass(void);
251 extern struct MUI_CustomClass * initIconListClass(void);
252 extern struct MUI_CustomClass * initIconDrawerListClass(void);
253 extern struct MUI_CustomClass *initIconListviewClass(void);
254 extern struct MUI_CustomClass * initIconVolumeListClass(void);
257 extern struct MUI_CustomClass *IconWindow_Class;
258 extern struct MUI_CustomClass *IconList_Class;
259 extern struct MUI_CustomClass *IconDrawerList_Class;
260 extern struct MUI_CustomClass *IconListview_Class;
261 extern struct MUI_CustomClass *IconVolumeList_Class ;
264 #endif
266 #endif
268 #endif