2 Copyright © 2002-2003, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
8 #include <exec/memory.h>
9 #include <clib/alib_protos.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/utility.h>
13 #include <proto/intuition.h>
14 #include <proto/muimaster.h>
20 #include "muimaster_intern.h"
22 #include "support_classes.h"
24 #include "crawling_private.h"
26 extern struct Library
*MUIMasterBase
;
28 IPTR
Crawling__OM_NEW(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
30 obj
= (Object
*) DoSuperNewTags
31 (cl
, obj
, NULL
, TAG_MORE
, (IPTR
) msg
->ops_AttrList
);
35 struct Crawling_DATA
*data
= INST_DATA(cl
, obj
);
37 data
->ehn
.ehn_Events
= 0;
38 data
->ehn
.ehn_Priority
= 0;
39 data
->ehn
.ehn_Flags
= 0;
40 data
->ehn
.ehn_Object
= obj
;
41 data
->ehn
.ehn_Class
= cl
;
48 IPTR
Crawling__MUIM_Setup(struct IClass
*cl
, Object
*obj
,
49 struct MUIP_Setup
*msg
)
51 struct Crawling_DATA
*data
= INST_DATA(cl
, obj
);
54 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
56 data
->ticker
= CRAWLING_INITIAL_DELAY
;
61 IPTR
Crawling__MUIM_Show(struct IClass
*cl
, Object
*obj
,
62 struct MUIP_Show
*msg
)
64 struct Crawling_DATA
*data
= INST_DATA(cl
, obj
);
67 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
69 data
->ehn
.ehn_Events
|= IDCMP_INTUITICKS
;
70 DoMethod(_win(obj
), MUIM_Window_AddEventHandler
, (IPTR
) & data
->ehn
);
75 IPTR
Crawling__MUIM_Hide(struct IClass
*cl
, Object
*obj
,
76 struct MUIP_Hide
*msg
)
78 struct Crawling_DATA
*data
= INST_DATA(cl
, obj
);
80 DoMethod(_win(obj
), MUIM_Window_RemEventHandler
, (IPTR
) & data
->ehn
);
81 data
->ehn
.ehn_Events
&= ~IDCMP_INTUITICKS
;
83 return DoSuperMethodA(cl
, obj
, (Msg
) msg
);
87 IPTR
Crawling__MUIM_HandleEvent(struct IClass
*cl
, Object
*obj
,
88 struct MUIP_HandleEvent
*msg
)
92 if (msg
->imsg
->Class
== IDCMP_INTUITICKS
)
94 struct Crawling_DATA
*data
= INST_DATA(cl
, obj
);
99 if (data
->ticker
== 0)
101 IPTR virty
= 0, virth
= 0;
103 get(obj
, MUIA_Virtgroup_Top
, &virty
);
104 get(obj
, MUIA_Virtgroup_Height
, &virth
);
106 if (virth
>= _mheight(obj
))
109 if (virty
+ _mheight(obj
) > virth
)
112 set(obj
, MUIA_Virtgroup_Top
, virty
);
121 #if ZUNE_BUILTIN_CRAWLING
122 BOOPSI_DISPATCHER(IPTR
, Crawling_Dispatcher
, cl
, obj
, msg
)
124 switch (msg
->MethodID
)
127 return Crawling__OM_NEW(cl
, obj
, (struct opSet
*)msg
);
129 return Crawling__MUIM_Setup(cl
, obj
, (APTR
) msg
);
131 return Crawling__MUIM_Show(cl
, obj
, (APTR
) msg
);
133 return Crawling__MUIM_Hide(cl
, obj
, (APTR
) msg
);
134 case MUIM_HandleEvent
:
135 return Crawling__MUIM_HandleEvent(cl
, obj
, (APTR
) msg
);
137 return DoSuperMethodA(cl
, obj
, msg
);
140 BOOPSI_DISPATCHER_END
142 const struct __MUIBuiltinClass _MUI_Crawling_desc
=
146 sizeof(struct Crawling_DATA
),
147 (void *) Crawling_Dispatcher
149 #endif /* ZUNE_BUILTIN_CRAWLING */