4 #include <libraries/mui.h>
6 #include <proto/intuition.h>
7 #include <dos/dosextens.h>
10 #define _parent(obj) ((Object*)xget(obj, MUIA_Parent))
14 IPTR
DoSuperNew(struct IClass
*cl
, Object
*obj
, IPTR tag1
, ...);
17 static inline LONG
xget(void *object
, ULONG attr
)
24 static inline int sxget(void *object
, LONG attr
)
31 #if !defined(__AROS__)
32 #define nfset(obj, attr, val) \
33 SetAttrs(obj, MUIA_Group_Forward, FALSE, \
38 #define getstr(obj) ((char *)xget(obj, MUIA_String_Contents))
41 #define isDir(fib) ((fib)->fib_DirEntryType > 0)
43 static inline LONG
isDirPath(char *path
)
45 BPTR lock
= Lock(path
, ACCESS_READ
);
48 struct FileInfoBlock fib
;
49 if (Examine(lock
, &fib
))
58 /* find container (parent object) which contains object with given attribute supported */
60 static inline Object
*objFindContainerByAttribute(Object
*obj
, ULONG attribute
)
66 unsigned int ret
= get(obj
, attribute
, &v
);
76 /// Morphos specific hook stuff
79 * Hook, called with the following:
80 * n - name of the hook (_hook appened at the end)
89 #define M_RHOOK(n, y, z) \
90 static int n##_GATE(void); \
91 static int n##_GATE2(struct Hook *h, y, z); \
92 static struct EmulLibEntry n = { \
93 TRAP_LIB, 0, (void (*)(void))n##_GATE }; \
94 static int n##_GATE(void) { \
95 return (n##_GATE2((void *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
96 static struct Hook n##Hook = { {0, 0}, (void *)&n , NULL , NULL }; \
97 static int n##_GATE2(struct Hook *h, y, z)
99 #define M_HOOK(n, y, z) \
100 static void n##_GATE(void); \
101 static void n##_GATE2(struct Hook *h, y, z); \
102 static struct EmulLibEntry n = { \
103 TRAP_LIB, 0, (void (*)(void))n##_GATE }; \
104 static void n##_GATE(void) { \
105 return (n##_GATE2((void *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
106 static struct Hook n##Hook = { {0, 0}, (void *)&n , NULL , NULL }; \
107 static void n##_GATE2(struct Hook *h, y, z)
112 static struct EmulLibEntry n ## Func = { \
113 TRAP_LIB, 0, (void (*)(void))n }; \
114 static const struct Hook n ## Hook = { { NULL,NULL }, (void*)&n ## Func,NULL,NULL };\
119 #define M_HOOK(n, y, z) \
120 static void n##_func(struct Hook *h, y, z); \
121 static struct Hook n ## Hook = \
123 0, 0, HookEntry, ( HOOKFUNC ) n##_func \
126 static void n##_func( struct Hook *h, y, z )
129 #define M_HOOK(n, y, z) \
130 static void ASM SAVEDS n##_func(__reg(a0, struct Hook *h), \
131 __reg(a2, y), __reg(a1, z)); \
132 static struct Hook n ## Hook = \
134 0, 0, ( HOOKFUNC ) n##_func \
138 static void ASM SAVEDS n##_func( __reg( a0, struct Hook *h ), \
139 __reg( a2, y ), __reg( a1, z ) )
140 #endif /* !__MORPHOS__ */
144 #define FORTAG(_tagp) \
146 struct TagItem *tag, *_tags = _tagp; \
147 while ((tag = NextTagItem(&_tags))) switch ((int)tag->ti_Tag)
150 #define FORCHILD(_o, _a) \
152 APTR child, _cstate = (APTR)((struct MinList *)xget(_o, _a))->mlh_Head; \
153 while ((child = NextObject(&_cstate)))
157 #define SUCCCHILD ({ APTR _succcstate = _cstate; \
158 NextObject(&_succcstate);})
160 #define INITTAGS (((struct opSet *)msg)->ops_AttrList)
163 #define NextObject(cstate) \
165 struct Node **nptr = (struct Node **)cstate;\
166 struct Node *this = *nptr;\
167 APTR next = this->ln_Succ;\
171 next = BASEOBJECT(this);\
177 #define MADF_VISIBLE (1<<14)
180 #ifndef MADF_DISABLED
181 #define MADF_DISABLED (1<<15)
185 #define _isvisible(obj) (_flags(obj) & MADF_VISIBLE)
188 #define METHOD static ULONG
189 #define PUBLIC_METHOD ULONG
191 #if !defined(__AROS__)
200 #ifndef MUIA_Pendisplay_RGBcolor
201 #define MUIA_Pendisplay_RGBcolor 0x8042a1a9 /* V11 isg struct MUI_RGBcolor * */
205 #define MUIM_Text 0x8042ee70 /* private */ /* V20 */
206 #define MUIM_TextDim 0x80422ad7 /* private */ /* V20 */
208 struct MUIP_Text
{ ULONG MethodID
; LONG left
;LONG top
;LONG width
;LONG height
;STRPTR text
;LONG len
;STRPTR preparse
;ULONG flags
; }; /* private */
209 struct MUIP_TextDim
{ ULONG MethodID
; STRPTR text
;LONG len
;STRPTR preparse
;ULONG flags
; }; /* private */
212 #ifndef MUIA_List_AutoLineHeight
213 #define MUIA_List_AutoLineHeight 0x8042bc08 /* V20 i.. BOOL */ /* private */
216 #ifndef MUIM_Group_GetChild
217 #define MUIM_Group_GetChild 0x8042c556 /* private */ /* V20 */
219 #define MUIV_Group_GetChild_First MUIV_Family_GetChild_First
220 #define MUIV_Group_GetChild_Last MUIV_Family_GetChild_Last
221 #define MUIV_Group_GetChild_Next MUIV_Family_GetChild_Next
222 #define MUIV_Group_GetChild_Previous MUIV_Family_GetChild_Previous
223 #define MUIV_Group_GetChild_Iterate MUIV_Family_GetChild_Iterate
226 #ifndef MUIM_Group_ExitChange2
227 #define MUIM_Group_ExitChange2 0x8042e541 /* private */ /* V12 */
230 #ifndef MUIA_CustomBackfill
231 #define MUIA_CustomBackfill 0x80420a63 /* V11 isg BOOL */ /* private */
234 #ifndef MUIA_Window_OverrideStoredDimension
235 #define MUIA_Window_OverrideStoredDimension 0x8042c0f5 /* V20 is. BOOL */ /* private */
238 #ifndef MUIM_Backfill
239 #define MUIM_Backfill 0x80428d73 /* private */ /* V11 */
240 struct MUIP_Backfill
{ ULONG MethodID
; LONG left
; LONG top
; LONG right
; LONG bottom
; LONG xoffset
; LONG yoffset
; LONG brightness
; }; /* private */
243 #ifndef MUIA_Image_FontMatchString
244 #define MUIA_Image_FontMatchString 0x804263c1 /* V20 is. char * */ /* private */
247 // this one is really internal
248 #ifndef MUIM_Group_Balance
249 #define MUIM_Group_Balance 0x80425906 /* private */ /* V11 */
250 struct MUIP_Group_Balance
{ ULONG MethodID
; Object
*bal
; LONG clickx
; LONG clicky
; LONG mode
; LONG mousex
; LONG mousey
; }; /* private */
253 #ifndef MUIM_Window_HandleRMB
254 #define MUIM_Window_HandleRMB 0x80421786 /* private */ /* V20 */
257 #ifndef MUIM_Application_KillPushMethod
258 #define MUIM_Application_KillPushMethod 0x80429954 /* private */ /* V15 */
261 #ifndef MUIM_Virtgroup_MakeVisible
262 #define MUIM_Virtgroup_MakeVisible 0x8042d2d2 /* private */ /* V4 */
263 struct MUIP_Virtgroup_MakeVisible
{ ULONG MethodID
; Object
*obj
; ULONG flags
; }; /* private */
266 #ifndef MUIA_Title_Sortable
267 #define MUIA_Title_Sortable 0x804211f1 /* V20 isg BOOL */ /* private */
270 #ifndef MUIA_Window_OverrideStoredPosition
271 #define MUIA_Window_OverrideStoredPosition 0x8042fc00 /* V20 is. BOOL */ /* private */
274 #ifndef MUIA_Group_ChildCount
275 #define MUIA_Group_ChildCount 0x80420322 /* V20 ..g LONG */ /* private */
279 #define MUIA_Alpha 0x8042c819 /* V20 isg LONG */ /* private */
282 #ifndef MUIF_PUSHMETHOD_VERIFY
284 #define MUIF_PUSHMETHOD_VERIFY (1<<30UL)
287 #ifndef MUIA_Menuitem_CopyStrings
289 #define MUIA_Menuitem_CopyStrings 0x8042dc1b /* V16 ..g BOOL */
294 #define CODESET_UTF8 1