4 #include <libraries/mui.h>
6 #include <proto/intuition.h>
7 #include <dos/dosextens.h>
9 static inline LONG
xget(void *object
, ULONG attr
)
16 static inline int sxget(void *object
, LONG attr
)
23 #define nfset(obj, attr, val) \
24 SetAttrs(obj, MUIA_Group_Forward, FALSE, \
28 #define getstr(obj) ((char *)xget(obj, MUIA_String_Contents))
31 #define isDir(fib) ((fib)->fib_DirEntryType > 0)
33 static inline LONG
isDirPath(char *path
)
35 BPTR lock
= Lock(path
, ACCESS_READ
);
38 struct FileInfoBlock fib
;
39 if (Examine(lock
, &fib
))
48 /// Morphos specific hook stuff
51 * Hook, called with the following:
52 * n - name of the hook (_hook appened at the end)
61 #define M_RHOOK(n, y, z) \
62 static int n##_GATE(void); \
63 static int n##_GATE2(struct Hook *h, y, z); \
64 static struct EmulLibEntry n = { \
65 TRAP_LIB, 0, (void (*)(void))n##_GATE }; \
66 static int n##_GATE(void) { \
67 return (n##_GATE2((void *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
68 static struct Hook n##Hook = { {0, 0}, (void *)&n , NULL , NULL }; \
69 static int n##_GATE2(struct Hook *h, y, z)
71 #define M_HOOK(n, y, z) \
72 static void n##_GATE(void); \
73 static void n##_GATE2(struct Hook *h, y, z); \
74 static struct EmulLibEntry n = { \
75 TRAP_LIB, 0, (void (*)(void))n##_GATE }; \
76 static void n##_GATE(void) { \
77 return (n##_GATE2((void *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
78 static struct Hook n##Hook = { {0, 0}, (void *)&n , NULL , NULL }; \
79 static void n##_GATE2(struct Hook *h, y, z)
84 static struct EmulLibEntry n ## Func = { \
85 TRAP_LIB, 0, (void (*)(void))n }; \
86 static const struct Hook n ## Hook = { { NULL,NULL }, (void*)&n ## Func,NULL,NULL };\
90 #define M_HOOK(n, y, z) \
91 static void ASM SAVEDS n##_func(__reg(a0, struct Hook *h), \
92 __reg(a2, y), __reg(a1, z));
93 static struct Hook n
## Hook =
95 0, 0, ( HOOKFUNC
) n
##_func
99 static void ASM SAVEDS n
##_func( __reg( a0, struct Hook *h ), \
100 __reg( a2, y ), __reg( a1, z ) )
101 #endif /* !__MORPHOS__ */
105 #define FORTAG(_tagp) \
107 struct TagItem *tag, *_tags = _tagp; \
108 while ((tag = NextTagItem(&_tags))) switch ((int)tag->ti_Tag)
111 #define FORCHILD(_o, _a) \
113 APTR child, _cstate = (APTR)((struct MinList *)xget(_o, _a))->mlh_Head; \
114 while ((child = NextObject(&_cstate)))
118 #define SUCCCHILD ({ APTR _succcstate = _cstate; \
119 NextObject(&_succcstate);})
121 #define INITTAGS (((struct opSet *)msg)->ops_AttrList)
124 #define NextObject(cstate) \
126 struct Node **nptr = (struct Node **)cstate;\
127 struct Node *this = *nptr;\
128 APTR next = this->ln_Succ;\
132 next = BASEOBJECT(this);\
138 #define MADF_VISIBLE (1<<14)
141 #ifndef MADF_DISABLED
142 #define MADF_DISABLED (1<<15)
146 #define _isvisible(obj) (_flags(obj) & MADF_VISIBLE)
149 #define METHOD static ULONG
150 #define PUBLIC_METHOD ULONG
159 #ifndef MUIA_Pendisplay_RGBcolor
160 #define MUIA_Pendisplay_RGBcolor 0x8042a1a9 /* V11 isg struct MUI_RGBcolor * */
164 #define MUIM_Text 0x8042ee70 /* private */ /* V20 */
165 #define MUIM_TextDim 0x80422ad7 /* private */ /* V20 */
167 struct MUIP_Text
{ ULONG MethodID
; LONG left
;LONG top
;LONG width
;LONG height
;STRPTR text
;LONG len
;STRPTR preparse
;ULONG flags
; }; /* private */
168 struct MUIP_TextDim
{ ULONG MethodID
; STRPTR text
;LONG len
;STRPTR preparse
;ULONG flags
; }; /* private */
171 #ifndef MUIA_List_AutoLineHeight
172 #define MUIA_List_AutoLineHeight 0x8042bc08 /* V20 i.. BOOL */ /* private */
175 #ifndef MUIM_Group_GetChild
176 #define MUIM_Group_GetChild 0x8042c556 /* private */ /* V20 */
178 #define MUIV_Group_GetChild_First MUIV_Family_GetChild_First
179 #define MUIV_Group_GetChild_Last MUIV_Family_GetChild_Last
180 #define MUIV_Group_GetChild_Next MUIV_Family_GetChild_Next
181 #define MUIV_Group_GetChild_Previous MUIV_Family_GetChild_Previous
182 #define MUIV_Group_GetChild_Iterate MUIV_Family_GetChild_Iterate
185 #ifndef MUIM_Group_ExitChange2
186 #define MUIM_Group_ExitChange2 0x8042e541 /* private */ /* V12 */
189 #ifndef MUIA_CustomBackfill
190 #define MUIA_CustomBackfill 0x80420a63 /* V11 isg BOOL */ /* private */
193 #ifndef MUIA_Window_OverrideStoredDimension
194 #define MUIA_Window_OverrideStoredDimension 0x8042c0f5 /* V20 is. BOOL */ /* private */
197 #ifndef MUIM_Backfill
198 #define MUIM_Backfill 0x80428d73 /* private */ /* V11 */
199 struct MUIP_Backfill
{ ULONG MethodID
; LONG left
; LONG top
; LONG right
; LONG bottom
; LONG xoffset
; LONG yoffset
; LONG brightness
; }; /* private */
202 #ifndef MUIA_Image_FontMatchString
203 #define MUIA_Image_FontMatchString 0x804263c1 /* V20 is. char * */ /* private */
206 // this one is really internal
207 #ifndef MUIM_Group_Balance
208 #define MUIM_Group_Balance 0x80425906 /* private */ /* V11 */
209 struct MUIP_Group_Balance
{ ULONG MethodID
; Object
*bal
; LONG clickx
; LONG clicky
; LONG mode
; LONG mousex
; LONG mousey
; }; /* private */
212 #ifndef MUIM_Window_HandleRMB
213 #define MUIM_Window_HandleRMB 0x80421786 /* private */ /* V20 */
216 #ifndef MUIM_Application_KillPushMethod
217 #define MUIM_Application_KillPushMethod 0x80429954 /* private */ /* V15 */
220 #ifndef MUIM_Virtgroup_MakeVisible
221 #define MUIM_Virtgroup_MakeVisible 0x8042d2d2 /* private */ /* V4 */
222 struct MUIP_Virtgroup_MakeVisible
{ ULONG MethodID
; Object
*obj
; ULONG flags
; }; /* private */
226 #define _parent(obj) ((Object*)xget(obj, MUIA_Parent))
229 #ifndef MUIA_Title_Sortable
230 #define MUIA_Title_Sortable 0x804211f1 /* V20 isg BOOL */ /* private */
233 #ifndef MUIA_Window_OverrideStoredPosition
234 #define MUIA_Window_OverrideStoredPosition 0x8042fc00 /* V20 is. BOOL */ /* private */
237 #ifndef MUIA_Group_ChildCount
238 #define MUIA_Group_ChildCount 0x80420322 /* V20 ..g LONG */ /* private */
242 #define MUIA_Alpha 0x8042c819 /* V20 isg LONG */ /* private */
245 #ifndef MUIF_PUSHMETHOD_VERIFY
246 #define MUIF_PUSHMETHOD_VERIFY (1<<30UL)