2 Copyright © 2003-2006, The AROS Development Team. All rights reserved.
6 #include <graphics/gfx.h>
7 #include <graphics/view.h>
8 #include <clib/alib_protos.h>
9 #include <libraries/asl.h>
10 #include <libraries/mui.h>
11 #include <proto/exec.h>
12 #include <proto/graphics.h>
13 #include <proto/utility.h>
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
18 #include <proto/alib.h>
21 #include "zunestuff.h"
25 /* #include <aros/debug.h> */
27 extern struct Library
*MUIMasterBase
;
31 struct MUI_SpecialPData
33 Object
*text_popframe
;
34 Object
*text_popimage
;
35 Object
*gauge_popframe
;
37 Object
*popimage
[NBIMAGES
];
40 ULONG Imagecfg
[NBIMAGES
] =
43 MUICFG_Image_HardDisk
,
49 MUICFG_Image_TapePlay
,
50 MUICFG_Image_TapePlayBack
,
51 MUICFG_Image_TapePause
,
52 MUICFG_Image_TapeStop
,
53 MUICFG_Image_TapeRecord
,
55 MUICFG_Image_TapeDown
,
58 static Object
*MakeSpecialPopimage(CONST_STRPTR title
)
63 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Image
,
67 MUIA_Imagedisplay_FreeHoriz
, FALSE
,
68 MUIA_Imagedisplay_FreeVert
, FALSE
,
69 MUIA_Window_Title
, (IPTR
)title
,
74 static IPTR
SpecialP_New(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
76 struct MUI_SpecialPData
*data
;
77 struct MUI_SpecialPData d
;
79 obj
= (Object
*) DoSuperNewTags
82 MUIA_Group_Horiz
, FALSE
,
83 Child
, (IPTR
) ColGroup(2),
86 GroupFrameT(_(MSG_TEXT_FIELDS
)),
88 MUIA_Group_SameWidth
, TRUE
,
90 MUIA_Group_VertSpacing
, 1,
91 Child
, (IPTR
) (d
.text_popframe
= MakePopframe()),
92 Child
, (IPTR
) CLabel(_(MSG_FRAME
)),
95 MUIA_Group_VertSpacing
, 1,
96 Child
, (IPTR
) (d
.text_popimage
= MakeBackgroundPopimage()),
97 Child
, (IPTR
) CLabel(_(MSG_BACKGROUND
)),
100 Child
, (IPTR
) TextObject
,
102 MUIA_Background
, MUII_TextBack
,
103 MUIA_Text_PreParse
, (IPTR
) "\33c",
104 MUIA_Text_Contents
, (IPTR
) _(MSG_EXAMPLE_TEXTFIELD
),
107 Child
, (IPTR
) ColGroup(2),
108 GroupFrameT(_(MSG_PROGRESS_INDICATOR
)),
109 Child
, (IPTR
) FreeLabel(_(MSG_FRAME_COLON
)),
110 Child
, (IPTR
) (d
.gauge_popframe
= MakePopframe()),
111 Child
, (IPTR
) Label(_(MSG_EXAMPLE
)),
112 Child
, (IPTR
) (d
.gauge
= GaugeObject
, MUIA_Gauge_InfoText
, "%ld %%",
113 GaugeFrame
, MUIA_Gauge_Horiz
, TRUE
, End
),
114 Child
, (IPTR
) VSpace(0),
115 Child
, (IPTR
) ScaleObject
, End
,
116 End
, // Progress Indicator
118 Child
, (IPTR
) HGroup
,
119 GroupFrameT(_(MSG_DEVICE_IMAGES
)),
120 Child
, (IPTR
) HSpace(0),
121 Child
, d
.popimage
[0] = MakeSpecialPopimage(_(MSG_DRAWER
)),
122 Child
, d
.popimage
[1] = MakeSpecialPopimage(_(MSG_HARDDISK
)),
123 Child
, d
.popimage
[2] = MakeSpecialPopimage(_(MSG_DISK
)),
124 Child
, d
.popimage
[3] = MakeSpecialPopimage(_(MSG_RAM
)),
125 Child
, d
.popimage
[4] = MakeSpecialPopimage(_(MSG_VOLUME
)),
126 Child
, d
.popimage
[5] = MakeSpecialPopimage(_(MSG_NETWORK
)),
127 Child
, d
.popimage
[6] = MakeSpecialPopimage(_(MSG_ASSIGN
)),
128 Child
, (IPTR
) HSpace(0),
129 End
, // Device Images
130 Child
, (IPTR
) HGroup
,
131 GroupFrameT(_(MSG_TAPE_IMAGES
)),
132 Child
, (IPTR
) HSpace(0),
133 Child
, d
.popimage
[7] = MakeSpecialPopimage(_(MSG_TAPE_PLAY
)),
134 Child
, d
.popimage
[8] = MakeSpecialPopimage(_(MSG_TAPE_PLAYBACK
)),
135 Child
, d
.popimage
[9] = MakeSpecialPopimage(_(MSG_TAPE_PAUSE
)),
136 Child
, d
.popimage
[10] = MakeSpecialPopimage(_(MSG_TAPE_STOP
)),
137 Child
, d
.popimage
[11] = MakeSpecialPopimage(_(MSG_TAPE_RECORD
)),
138 Child
, d
.popimage
[12] = MakeSpecialPopimage(_(MSG_TAPE_UP
)),
139 Child
, d
.popimage
[13] = MakeSpecialPopimage(_(MSG_TAPE_DOWN
)),
140 Child
, (IPTR
) HSpace(0),
143 TAG_MORE
, (IPTR
) msg
->ops_AttrList
);
145 if (!obj
) return FALSE
;
147 data
= INST_DATA(cl
, obj
);
155 * MUIM_Settingsgroup_ConfigToGadgets
157 static IPTR
SpecialP_ConfigToGadgets(struct IClass
*cl
, Object
*obj
,
158 struct MUIP_Settingsgroup_ConfigToGadgets
*msg
)
160 struct MUI_SpecialPData
*data
= INST_DATA(cl
, obj
);
165 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
167 set(data
->text_popframe
, MUIA_Framedisplay_Spec
, (IPTR
)spec
);
168 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
170 set(data
->gauge_popframe
, MUIA_Framedisplay_Spec
, (IPTR
)spec
);
173 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
174 MUICFG_Background_Text
);
175 set(data
->text_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
177 for (i
= 0; i
< NBIMAGES
; i
++)
179 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
181 set(data
->popimage
[i
], MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
189 * MUIM_Settingsgroup_ConfigToGadgets
191 static IPTR
SpecialP_GadgetsToConfig(struct IClass
*cl
, Object
*obj
,
192 struct MUIP_Settingsgroup_GadgetsToConfig
*msg
)
194 struct MUI_SpecialPData
*data
= INST_DATA(cl
, obj
);
199 str
= (STRPTR
)XGET(data
->text_popframe
, MUIA_Framedisplay_Spec
);
200 DoMethod(msg
->configdata
, MUIM_Configdata_SetFramespec
, MUICFG_Frame_Text
,
202 str
= (STRPTR
)XGET(data
->gauge_popframe
, MUIA_Framedisplay_Spec
);
203 DoMethod(msg
->configdata
, MUIM_Configdata_SetFramespec
, MUICFG_Frame_Gauge
,
207 str
= (STRPTR
)XGET(data
->text_popimage
, MUIA_Imagedisplay_Spec
);
208 DoMethod(msg
->configdata
, MUIM_Configdata_SetImspec
, MUICFG_Background_Text
,
211 for (i
= 0; i
< NBIMAGES
; i
++)
213 str
= (STRPTR
)XGET(data
->popimage
[i
], MUIA_Imagedisplay_Spec
);
214 DoMethod(msg
->configdata
, MUIM_Configdata_SetImspec
, Imagecfg
[i
],
221 BOOPSI_DISPATCHER(IPTR
, SpecialP_Dispatcher
, cl
, obj
, msg
)
223 switch (msg
->MethodID
)
225 case OM_NEW
: return SpecialP_New(cl
, obj
, (struct opSet
*)msg
);
226 case MUIM_Settingsgroup_ConfigToGadgets
: return SpecialP_ConfigToGadgets(cl
,obj
,(APTR
)msg
);break;
227 case MUIM_Settingsgroup_GadgetsToConfig
: return SpecialP_GadgetsToConfig(cl
,obj
,(APTR
)msg
);break;
230 return DoSuperMethodA(cl
, obj
, msg
);
232 BOOPSI_DISPATCHER_END
237 const struct __MUIBuiltinClass _MUIP_Special_desc
= {
240 sizeof(struct MUI_SpecialPData
),
241 (void*)SpecialP_Dispatcher