Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / desktop / presentation.c
bloba558d9e1e484c7dd2bccce5388d9b99f4f6704ae
1 /*
2 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define MUIMASTER_YES_INLINE_STDARG
8 #define DEBUG 1
9 #include <aros/debug.h>
11 #include <exec/types.h>
12 #include <intuition/classes.h>
13 #include <intuition/classusr.h>
14 #include <libraries/mui.h>
16 #include "support.h"
17 #include "worker.h"
18 #include "desktop_intern.h"
20 #include <proto/dos.h>
21 #include <proto/intuition.h>
22 #include <proto/utility.h>
24 #include "desktop_intern_protos.h"
26 #include "presentation.h"
28 IPTR presentationNew(Class * cl, Object * obj, struct opSet * msg)
30 IPTR retval = 0;
31 struct PresentationClassData *data;
32 struct TagItem *tag,
33 *tstate = msg->ops_AttrList;
34 Object *observer = NULL;
36 while ((tag = NextTagItem(&tstate)) != NULL)
38 switch (tag->ti_Tag)
40 case PA_Observer:
41 observer = (Object *) tag->ti_Data;
42 break;
44 default:
45 continue; /* Don't supress non-processed tags */
48 tag->ti_Tag = TAG_IGNORE;
51 retval = DoSuperMethodA(cl, obj, (Msg) msg);
52 if (retval)
54 obj = (Object *) retval;
55 data = INST_DATA(cl, obj);
56 data->observer = observer;
59 return retval;
62 IPTR presentationSet(Class * cl, Object * obj, struct opSet * msg)
64 struct PresentationClassData *data;
65 IPTR retval = 1;
66 struct TagItem *tag,
67 *tstate = msg->ops_AttrList;
69 data = (struct PresentationClassData *) INST_DATA(cl, obj);
71 while ((tag = NextTagItem(&tstate)))
73 switch (tag->ti_Tag)
75 case PA_Observer:
76 data->observer = (Object *) tag->ti_Data;
77 break;
78 default:
79 break;
83 retval = DoSuperMethodA(cl, obj, (Msg) msg);
85 return retval;
88 IPTR presentationGet(Class * cl, Object * obj, struct opGet * msg)
90 IPTR retval = 1;
91 struct PresentationClassData *data;
93 data = (struct PresentationClassData *) INST_DATA(cl, obj);
95 switch (msg->opg_AttrID)
97 default:
98 retval = DoSuperMethodA(cl, obj, (Msg) msg);
99 break;
102 return retval;
105 IPTR presentationDispose(Class * cl, Object * obj, Msg msg)
107 IPTR retval;
109 SetAttrs(obj, PA_Disused, TRUE, TAG_END);
111 retval = DoSuperMethodA(cl, obj, msg);
113 return retval;
116 IPTR parentConnectParent(Class * cl, Object * obj,
117 struct MUIP_ConnectParent * msg)
119 IPTR retval;
121 retval = DoSuperMethodA(cl, obj, (Msg) msg);
122 SetAttrs(obj, PA_InTree, TRUE, TAG_END);
123 return retval;
126 BOOPSI_DISPATCHER(IPTR, presentationDispatcher, cl, obj, msg)
128 ULONG retval = 0;
130 switch (msg->MethodID)
132 case OM_NEW:
133 retval = presentationNew(cl, obj, (struct opSet *) msg);
134 break;
135 case OM_SET:
136 retval = presentationSet(cl, obj, (struct opSet *) msg);
137 break;
138 case OM_GET:
139 retval = presentationGet(cl, obj, (struct opGet *) msg);
140 break;
141 case OM_DISPOSE:
142 retval = presentationDispose(cl, obj, msg);
143 break;
144 case MUIM_ConnectParent:
145 retval =
146 parentConnectParent(cl, obj,
147 (struct MUIP_ConnectParent *) msg);
148 break;
149 default:
150 retval = DoSuperMethodA(cl, obj, msg);
151 break;
154 return retval;
156 BOOPSI_DISPATCHER_END