Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / desktop / internalwindowopsclass.c
blobfa07c69bbf25e3bf1352ac9b39301a7d18169f04
1 /*
2 Copyright © 1995-2003, 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>
15 #include <libraries/desktop.h>
17 #include "support.h"
18 #include "desktop_intern.h"
20 #include <proto/dos.h>
21 #include <proto/intuition.h>
22 #include <proto/utility.h>
24 #include "internalwindowopsclass.h"
25 #include "iconcontainerclass.h"
27 #include "desktop_intern_protos.h"
29 IPTR internalWindowOpsNew(Class * cl, Object * obj, struct opSet * msg)
31 IPTR retval = 0;
32 struct InternalWindowOpsClassData *data;
33 //struct TagItem *tag;
35 retval = DoSuperMethodA(cl, obj, (Msg) msg);
36 if (retval)
38 obj = (Object *) retval;
39 data = INST_DATA(cl, obj);
42 return retval;
45 IPTR internalWindowOpsSet(Class * cl, Object * obj, struct opSet * msg)
47 struct InternalWindowOpsClassData *data;
48 IPTR retval = 1;
49 struct TagItem *tag,
50 *tstate = msg->ops_AttrList;
52 data = (struct InternalWindowOpsClassData *) INST_DATA(cl, obj);
54 while ((tag = NextTagItem(&tstate)))
56 switch (tag->ti_Tag)
58 default:
59 break;
63 retval = DoSuperMethodA(cl, obj, (Msg) msg);
65 return retval;
68 IPTR internalWindowOpsGet(Class * cl, Object * obj, struct opGet * msg)
70 IPTR retval = 1;
71 struct InternalWindowOpsClassData *data;
73 data = (struct InternalWindowOpsClassData *) INST_DATA(cl, obj);
75 switch (msg->opg_AttrID)
77 default:
78 retval = DoSuperMethodA(cl, obj, (Msg) msg);
79 break;
82 return retval;
85 IPTR internalWindowOpsDispose(Class * cl, Object * obj, Msg msg)
87 IPTR retval;
89 retval = DoSuperMethodA(cl, obj, msg);
91 return retval;
94 IPTR internalWindowOpsExecute(Class * cl, Object * obj,
95 struct opExecute * msg)
97 IPTR retval = 0;
98 struct InternalWindowOpsClassData *data;
99 Object *iconcontainer = NULL;
101 data = (struct InternalWindowOpsClassData *) INST_DATA(cl, obj);
103 GetAttr(MUIA_Window_RootObject, msg->target, (IPTR *) &iconcontainer);
105 switch (msg->operationCode)
107 // close
108 case (DOC_WINDOWOP | 1):
109 // SetAttrs(msg->target, ICA_Open, FALSE, TAG_END);
110 SetAttrs(msg->target, MUIA_Window_Open, FALSE, TAG_END);
111 break;
112 // view by
113 case (DOC_WINDOWOP | 2):
114 break;
115 // large icons
116 case (DOC_WINDOWOP | 3):
117 SetAttrs(iconcontainer, ICA_ViewMode, ICAVM_LARGE);
118 break;
119 // small icons
120 case (DOC_WINDOWOP | 4):
121 SetAttrs(iconcontainer, ICA_ViewMode, ICAVM_SMALL);
122 break;
123 // detail
124 case (DOC_WINDOWOP | 5):
125 SetAttrs(iconcontainer, ICA_ViewMode, ICAVM_DETAIL);
126 break;
129 return retval;
132 BOOPSI_DISPATCHER(IPTR, internalWindowOpsDispatcher, cl, obj, msg)
134 ULONG retval = 0;
136 switch (msg->MethodID)
138 case OM_NEW:
139 retval = internalWindowOpsNew(cl, obj, (struct opSet *) msg);
140 break;
141 case OM_SET:
142 retval = internalWindowOpsSet(cl, obj, (struct opSet *) msg);
143 break;
144 case OM_GET:
145 retval = internalWindowOpsGet(cl, obj, (struct opGet *) msg);
146 break;
147 case OM_DISPOSE:
148 retval = internalWindowOpsDispose(cl, obj, msg);
149 break;
150 case OPM_Execute:
151 retval =
152 internalWindowOpsExecute(cl, obj, (struct opExecute *) msg);
153 break;
154 default:
155 retval = DoSuperMethodA(cl, obj, msg);
156 break;
159 return retval;
161 BOOPSI_DISPATCHER_END