1 #ifndef __PORTABLE_MACROS__
2 #define __PORTABLE_MACROS__
5 #define TAGITEM const struct TagItem **
7 #define TAGITEM struct TagItem **
12 #if !defined(__AROS__) || !defined(__MORPHOS__)
25 #include <proto/exec.h>
26 #include <proto/utility.h>
36 #define AROS_BIG_ENDIAN 1
41 #include <exec_AROS/lists.h>
46 #include <workbench/icon.h>
49 #if defined (__MORPHOS__) || (defined (__AMIGA__) && !defined(__PPC__))
50 #include <dos/dostags.h>
54 #include <SDI_compiler.h>
56 #include <SDI_stdarg.h>
70 extern struct Library
*MUIMasterBase
;
72 extern struct MUIMasterIFace
*IMUIMaster
;
76 #define AROS_UFHA(type,name,reg) type name
79 #define AROS_UFH0(rettype,name) rettype name()
81 #define AROS_UFH1(rettype,name,a1) rettype name(a1)
83 #define AROS_UFH2(rettype,name,a1,a2) rettype name (a1, a2)
85 #define AROS_UFH3(rettype,name,a1,a2,a3) rettype name (a1, a2, a3)
88 #define AROS_USERFUNC_INIT
89 #define AROS_USERFUNC_EXIT
91 #define MUIB_MUI (TAG_USER) /* Base for legacy MUI identifiers */
92 #define MUIB_RSVD (MUIB_MUI | 0x10400000) /* Base for AROS reserved range */
93 #define MUIB_ZUNE (MUIB_RSVD | 0x00020000) /* Base for Zune core reserved range */
94 #define MUIB_AROS (MUIB_RSVD | 0x00070000) /* Base for AROS core reserved range */
99 #define MAX(a,b) (((a) > (b))?(a):(b))
100 #define MIN(a,b) (((a) > (b))?(b):(a))
102 #define _AndRectRect(rect1, rect2, intersect) \
106 if (overlap(*(rect1), *(rect2))) \
108 (intersect)->MinX = MAX((rect1)->MinX, (rect2)->MinX); \
109 (intersect)->MinY = MAX((rect1)->MinY, (rect2)->MinY); \
110 (intersect)->MaxX = MIN((rect1)->MaxX, (rect2)->MaxX); \
111 (intersect)->MaxY = MIN((rect1)->MaxY, (rect2)->MaxY); \
122 #define _DoRectsOverlap(Rect, x1, y1, x2, y2) \
124 y1 <= (Rect)->MaxY && \
125 y2 >= (Rect)->MinY && \
126 x1 <= (Rect)->MaxX && \
130 #define overlap(a,b) _DoRectsOverlap(&(a), (b).MinX, (b).MinY, (b).MaxX, (b).MaxY)
135 #define GET(obj,attr,store) get(obj,attr,store)
136 #define SET(obj,attr,value) set(obj,attr,value)
138 #define XGET(object, attribute) \
140 IPTR __storage = 0; \
141 GetAttr((attribute), (object), &__storage); \
145 #define NNSET(obj,attr,value) nnset(obj,attr,value)
149 #if !defined(__amigaos4__)
151 #define GetHead(_l) \
152 ({ struct List *l = (struct List *)(_l); \
153 l->lh_Head->ln_Succ ? l->lh_Head : (struct Node *)0; \
156 #define GetSucc(_n) \
157 ({ struct Node *n = (struct Node *)(_n); \
158 n->ln_Succ->ln_Succ ? n->ln_Succ : (struct Node *)0; \
161 #define GetTail(_l) \
162 ({ struct List *l = (struct List *)(_l); \
163 l->lh_TailPred->ln_Pred ? l->lh_TailPred : (struct Node *)0; \
166 #define GetPred(_n) \
167 ({ struct Node *n = (struct Node *)(_n); \
168 n->ln_Pred->ln_Pred ? n->ln_Pred : (struct Node *)0; \
173 #define ImageButton(label, imagePath) MUI_MakeObject(MUIO_Button, (IPTR) (label))
175 #define BOOPSI_DISPATCHER(ret, nameDsp, cls, obj, msg) DISPATCHER(nameDsp)
176 #define BOOPSI_DISPATCHER_END
180 #define SendAppWindowMessage(...) sizeof(NULL)
181 #define RegisterWorkbench(...) sizeof(NULL)
182 #define UnregisterWorkbench(...) sizeof(NULL)
183 #define ArosInquire(...) sizeof(NULL)
184 #define AROS_LE2LONG(...) sizeof(NULL)
185 #define ADD2INIT(...)
186 #define ADD2EXIT(...)
190 #define DeinitRastPort FreeRastPort
193 extern struct RastPort
*CreateRastPort(void);
194 extern struct RastPort
*CloneRastPort(struct RastPort
*rp
);
195 extern void FreeRastPort(struct RastPort
*rp
);
196 extern BOOL
AndRectRect(struct Rectangle
*rect1
, struct Rectangle
*rect2
, struct Rectangle
*intersect
);
200 #if defined (__AMIGA__) && !defined(__PPC__)
201 #define NP_UserData (NP_Dummy + 26)
202 /* optional value to install into task->tc_UserData. */
206 struct MUIP_CreateDragImage
{STACKED ULONG MethodID
; STACKED LONG touchx
; STACKED LONG touchy
; STACKED ULONG flags
;};
211 WORD width
; /* exact width and height of bitmap */
213 WORD touchx
; /* position of pointer click relative to bitmap */
215 ULONG flags
; /* must be set to 0 */
218 struct MUIP_DeleteDragImage
{STACKED ULONG MethodID
; STACKED
struct MUI_DragImage
*di
;};
220 struct MUIP_Layout
{STACKED ULONG MethodID
;};
222 #define MUIA_Prop_DeltaFactor (MUIB_MUI|0x00427c5e) /* MUI: is. LONG */
223 #define MUIM_CreateDragImage (MUIB_MUI|0x0042eb6f) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */
224 #define MUIM_DeleteDragImage (MUIB_MUI|0x00423037) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */
227 #define MUIM_Application_Execute (MUIB_Wanderer | 0x000000011)
230 extern STRPTR
StrDup (CONST_STRPTR str
);
232 extern int IconWindowIconDrawerList_Initialize(void);
233 extern int IconWindowIconVolumeList_Initialize(void);
234 extern int WandererPrefs_Initialize(void);
235 extern int Wanderer_Initialize(void);
236 extern int IconWindow_Initialize(void);
239 extern void IconWindowIconDrawerList_Deinitialize(void);
240 extern void IconWindowIconVolumeList_Deinitialize(void);
241 extern void WandererPrefs_Deinitialize(void);
242 extern void Wanderer_Deinitialize(void);
243 extern void IconWindow_Deinitialize(void);
247 extern struct MUI_CustomClass
*IconWindowIconVolumeList_CLASS
;
248 extern struct MUI_CustomClass
*IconWindowIconDrawerList_CLASS
;
249 extern struct MUI_CustomClass
*WandererPrefs_CLASS
;
250 extern struct MUI_CustomClass
*IconWindow_CLASS
;
253 extern int initIconWindowClass(void);
254 //extern struct MUI_CustomClass *initIconWindowClass(void);
255 extern struct MUI_CustomClass
* initIconListClass(void);
256 extern struct MUI_CustomClass
* initIconDrawerListClass(void);
257 extern struct MUI_CustomClass
*initIconListviewClass(void);
258 extern struct MUI_CustomClass
* initIconVolumeListClass(void);
261 extern struct MUI_CustomClass
*IconWindow_Class
;
262 extern struct MUI_CustomClass
*IconList_Class
;
263 extern struct MUI_CustomClass
*IconDrawerList_Class
;
264 extern struct MUI_CustomClass
*IconListview_Class
;
265 extern struct MUI_CustomClass
*IconVolumeList_Class
;