2 Copyright © 2003-2004, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
8 #include <proto/intuition.h>
9 #include <proto/muimaster.h>
10 #include <proto/diskfont.h>
11 #include <proto/utility.h>
12 #include <graphics/text.h>
13 #include <libraries/mui.h>
14 #include <zune/customclasses.h>
16 #include "presentation.h"
18 /*** Instance data **********************************************************/
19 struct Presentation_DATA
22 struct MUI_EventHandlerNode ssd_EHN
;
25 /*** Macros *****************************************************************/
26 #define SETUP_INST_DATA struct Presentation_DATA *data = INST_DATA(CLASS, self)
28 /*** Methods ****************************************************************/
29 Object
*Presentation__OM_NEW
31 Class
*CLASS
, Object
*self
, struct opSet
*message
34 self
= (Object
*) DoSuperNewTags
40 /* Add content here ... */
42 TAG_MORE
, (IPTR
) message
->ops_AttrList
48 IPTR Presentation__OM_ADDMEMBER
50 Class
*CLASS
, Object
*self
, struct opMember
*message
53 IPTR success
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
58 data
->ssd_ChildCount
++;
64 IPTR Presentation__OM_REMMEMBER
66 Class
*CLASS
, Object
*self
, struct opMember
*message
69 IPTR success
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
74 data
->ssd_ChildCount
--;
80 IPTR Presentation__OM_SET
82 Class
*CLASS
, Object
*self
, struct opSet
*message
86 const struct TagItem
*tstate
= message
->ops_AttrList
;
89 while ((tag
= NextTagItem(&tstate
)) != NULL
)
93 case MUIA_Group_ActivePage
:
96 case MUIV_Group_ActivePage_Next
:
99 XGET(self
, MUIA_Group_ActivePage
)
100 >= data
->ssd_ChildCount
- 1
103 tag
->ti_Tag
= TAG_IGNORE
;
107 case MUIV_Group_ActivePage_Prev
:
108 if (XGET(self
, MUIA_Group_ActivePage
) <= 0)
110 tag
->ti_Tag
= TAG_IGNORE
;
118 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
121 IPTR Presentation__MUIM_Setup
123 Class
*CLASS
, Object
*self
, struct MUIP_Setup
*message
126 if (DoSuperMethodA(CLASS
, self
, (Msg
) message
))
130 data
->ssd_EHN
.ehn_Events
= IDCMP_RAWKEY
;
131 data
->ssd_EHN
.ehn_Priority
= 0;
132 data
->ssd_EHN
.ehn_Flags
= 0;
133 data
->ssd_EHN
.ehn_Object
= self
;
134 data
->ssd_EHN
.ehn_Class
= CLASS
;
138 _win(self
), MUIM_Window_AddEventHandler
, (IPTR
) &data
->ssd_EHN
147 IPTR Presentation__MUIM_Cleanup
149 Class
*CLASS
, Object
*self
, struct MUIP_Cleanup
*message
156 _win(self
), MUIM_Window_RemEventHandler
, (IPTR
) &data
->ssd_EHN
159 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
162 IPTR Presentation__MUIM_HandleEvent
164 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
167 if (message
->imsg
!= NULL
)
169 switch (message
->imsg
->Class
)
172 switch (message
->imsg
->Code
)
175 /* Next slide --------------------------------------*/
178 self
, MUIA_Group_ActivePage
,
179 MUIV_Group_ActivePage_Next
184 /* Previous slide ----------------------------------*/
187 self
, MUIA_Group_ActivePage
,
188 MUIV_Group_ActivePage_Prev
196 return MUI_EventHandlerRC_Eat
;
199 /*** Setup ******************************************************************/
202 Presentation
, NULL
, MUIC_Group
, NULL
,
203 OM_NEW
, struct opSet
*,
204 OM_ADDMEMBER
, struct opMember
*,
205 OM_REMMEMBER
, struct opMember
*,
206 OM_SET
, struct opSet
*,
207 MUIM_Setup
, struct MUIP_Setup
*,
208 MUIM_Cleanup
, struct MUIP_Cleanup
*,
209 MUIM_HandleEvent
, struct MUIP_HandleEvent
*