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 <mui/Rawimage_mcc.h>
12 #include <proto/exec.h>
13 #include <proto/graphics.h>
14 #include <proto/utility.h>
15 #include <proto/intuition.h>
16 #include <proto/muimaster.h>
19 #include <proto/alib.h>
22 #include "zunestuff.h"
26 /* #include <aros/debug.h> */
28 extern struct Library
*MUIMasterBase
;
30 struct MUI_StringsPData
32 Object
*string_popframe
;
33 Object
*popup_popimage
;
34 Object
*popfile_popimage
;
35 Object
*popdrawer_popimage
;
36 Object
*inactive_bg_popimage
;
37 Object
*inactive_text_poppen
;
38 Object
*active_bg_popimage
;
39 Object
*active_text_poppen
;
40 Object
*cursor_poppen
;
41 Object
*marked_bg_poppen
;
42 Object
*marked_text_poppen
;
45 Object
*MakePopupPopimage(CONST_STRPTR title
)
50 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Image
,
54 MUIA_Imagedisplay_FreeHoriz
, FALSE
,
55 MUIA_Imagedisplay_FreeVert
, FALSE
,
56 MUIA_Window_Title
, (IPTR
)title
,
61 static IPTR
StringsP_New(struct IClass
*cl
, Object
*obj
, struct opSet
*msg
)
63 struct MUI_StringsPData
*data
;
64 struct MUI_StringsPData d
;
66 obj
= (Object
*) DoSuperNewTags
69 MUIA_Group_Horiz
, FALSE
,
73 GroupFrameT(_(MSG_STRING_FRAME
)),
74 Child
, (IPTR
) (d
.string_popframe
= MakePopframe()),
77 GroupFrameT(_(MSG_SPECIAL_POPUP_BUTTONS
)),
78 MUIA_Group_SameWidth
, TRUE
,
80 MUIA_Group_VertSpacing
, 1,
81 Child
, (IPTR
) (d
.popup_popimage
= MakePopupPopimage(_(MSG_POPUP
))),
82 Child
, (IPTR
) CLabel(_(MSG_DEFAULT
)),
85 MUIA_Group_VertSpacing
, 1,
86 Child
, (IPTR
) (d
.popfile_popimage
= MakePopupPopimage(_(MSG_POPUP_FILE
))),
87 Child
, (IPTR
) CLabel(_(MSG_FILE
)),
90 MUIA_Group_VertSpacing
, 1,
91 Child
, (IPTR
) (d
.popdrawer_popimage
= MakePopupPopimage(_(MSG_POPUP_DRAWER
))),
92 Child
, (IPTR
) CLabel(_(MSG_DRAWER
)),
94 End
, // Special Popup Buttons
98 GroupFrameT(_(MSG_INACTIVE_STRING_COLORS
)),
99 MUIA_Group_SameWidth
, TRUE
,
100 Child
, (IPTR
) VGroup
,
101 MUIA_Group_VertSpacing
, 1,
102 Child
, (IPTR
) (d
.inactive_bg_popimage
= MakeBackgroundPopimage()),
103 Child
, (IPTR
) CLabel(_(MSG_BACKGROUND
)),
105 Child
, (IPTR
) VGroup
,
106 MUIA_Group_VertSpacing
, 1,
107 Child
, (IPTR
) (d
.inactive_text_poppen
= MakePoppen()),
108 Child
, (IPTR
) CLabel(_(MSG_TEXT
)),
110 End
, // Inactive String Colors
112 GroupFrameT(_(MSG_ACTIVE_STRING_COLORS
)),
113 MUIA_Group_SameWidth
, TRUE
,
114 Child
, (IPTR
) VGroup
,
115 MUIA_Group_VertSpacing
, 1,
116 Child
, (IPTR
) (d
.active_bg_popimage
= MakeBackgroundPopimage()),
117 Child
, (IPTR
) CLabel(_(MSG_BACKGROUND
)),
119 Child
, (IPTR
) VGroup
,
120 MUIA_Group_VertSpacing
, 1,
121 Child
, (IPTR
) (d
.active_text_poppen
= MakePoppen()),
122 Child
, (IPTR
) CLabel(_(MSG_TEXT
)),
124 End
, // Inactive String Colors
127 GroupFrameT(_(MSG_CURSOR
)),
128 Child
, (IPTR
) (d
.cursor_poppen
= MakePoppen()),
131 GroupFrameT(_(MSG_MARKED_STRING_COLORS
)),
132 MUIA_Group_SameWidth
, TRUE
,
133 Child
, (IPTR
) VGroup
,
134 MUIA_Group_VertSpacing
, 1,
135 Child
, (IPTR
) (d
.marked_bg_poppen
= MakePoppen()),
136 Child
, (IPTR
) CLabel(_(MSG_BACKGROUND
)),
138 Child
, (IPTR
) VGroup
,
139 MUIA_Group_VertSpacing
, 1,
140 Child
, (IPTR
) (d
.marked_text_poppen
= MakePoppen()),
141 Child
, (IPTR
) CLabel(_(MSG_TEXT
)),
143 End
, // Marked String Colors
144 End
, // Cursor + Marked
148 Child
, (IPTR
) StringObject
,
151 MUIA_String_Contents
, _(MSG_EXAMPLE_STRING_GADGET
),
152 MUIA_String_Format
, MUIV_String_Format_Center
,
154 TAG_MORE
, (IPTR
) msg
->ops_AttrList
);
156 if (!obj
) return FALSE
;
158 data
= INST_DATA(cl
, obj
);
166 * MUIM_Settingsgroup_ConfigToGadgets
168 static IPTR
StringsP_ConfigToGadgets(struct IClass
*cl
, Object
*obj
,
169 struct MUIP_Settingsgroup_ConfigToGadgets
*msg
)
171 struct MUI_StringsPData
*data
= INST_DATA(cl
, obj
);
175 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
176 MUICFG_Frame_String
);
177 set(data
->string_popframe
, MUIA_Framedisplay_Spec
, (IPTR
)spec
);
180 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
182 set(data
->popup_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
183 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
184 MUICFG_Image_PopFile
);
185 set(data
->popfile_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
186 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
187 MUICFG_Image_PopDrawer
);
188 set(data
->popdrawer_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
191 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
192 MUICFG_String_Background
);
193 set(data
->inactive_bg_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
194 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
196 set(data
->inactive_text_poppen
, MUIA_Pendisplay_Spec
, (IPTR
)spec
);
198 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
199 MUICFG_String_ActiveBackground
);
200 set(data
->active_bg_popimage
, MUIA_Imagedisplay_Spec
, (IPTR
)spec
);
201 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
202 MUICFG_String_ActiveText
);
203 set(data
->active_text_poppen
, MUIA_Pendisplay_Spec
, (IPTR
)spec
);
205 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
206 MUICFG_String_Cursor
);
207 set(data
->cursor_poppen
, MUIA_Pendisplay_Spec
, (IPTR
)spec
);
209 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
210 MUICFG_String_MarkedText
);
211 set(data
->marked_text_poppen
, MUIA_Pendisplay_Spec
, (IPTR
)spec
);
213 spec
= (STRPTR
)DoMethod(msg
->configdata
, MUIM_Configdata_GetString
,
214 MUICFG_String_MarkedBackground
);
215 set(data
->marked_bg_poppen
, MUIA_Pendisplay_Spec
, (IPTR
)spec
);
221 * MUIM_Settingsgroup_ConfigToGadgets
223 static IPTR
StringsP_GadgetsToConfig(struct IClass
*cl
, Object
*obj
,
224 struct MUIP_Settingsgroup_GadgetsToConfig
*msg
)
226 struct MUI_StringsPData
*data
= INST_DATA(cl
, obj
);
230 str
= (STRPTR
)XGET(data
->string_popframe
, MUIA_Framedisplay_Spec
);
231 DoMethod(msg
->configdata
, MUIM_Configdata_SetFramespec
, MUICFG_Frame_String
,
235 str
= (STRPTR
)XGET(data
->popup_popimage
, MUIA_Imagedisplay_Spec
);
236 DoMethod(msg
->configdata
, MUIM_Configdata_SetImspec
, MUICFG_Image_PopUp
,
238 str
= (STRPTR
)XGET(data
->popfile_popimage
, MUIA_Imagedisplay_Spec
);
239 DoMethod(msg
->configdata
, MUIM_Configdata_SetImspec
, MUICFG_Image_PopFile
,
241 str
= (STRPTR
)XGET(data
->popdrawer_popimage
, MUIA_Imagedisplay_Spec
);
242 DoMethod(msg
->configdata
, MUIM_Configdata_SetImspec
, MUICFG_Image_PopDrawer
,
246 str
= (STRPTR
)XGET(data
->inactive_bg_popimage
, MUIA_Imagedisplay_Spec
);
247 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
248 MUICFG_String_Background
, (IPTR
)str
);
249 str
= (STRPTR
)XGET(data
->inactive_text_poppen
, MUIA_Pendisplay_Spec
);
250 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
251 MUICFG_String_Text
, (IPTR
)str
);
253 str
= (STRPTR
)XGET(data
->active_bg_popimage
, MUIA_Imagedisplay_Spec
);
254 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
255 MUICFG_String_ActiveBackground
, (IPTR
)str
);
256 str
= (STRPTR
)XGET(data
->active_text_poppen
, MUIA_Pendisplay_Spec
);
257 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
258 MUICFG_String_ActiveText
, (IPTR
)str
);
260 str
= (STRPTR
)XGET(data
->cursor_poppen
, MUIA_Pendisplay_Spec
);
261 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
262 MUICFG_String_Cursor
, (IPTR
)str
);
264 str
= (STRPTR
)XGET(data
->marked_text_poppen
, MUIA_Pendisplay_Spec
);
265 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
266 MUICFG_String_MarkedText
, (IPTR
)str
);
268 str
= (STRPTR
)XGET(data
->marked_bg_poppen
, MUIA_Pendisplay_Spec
);
269 DoMethod(msg
->configdata
, MUIM_Configdata_SetPenspec
,
270 MUICFG_String_MarkedBackground
, (IPTR
)str
);
276 BOOPSI_DISPATCHER(IPTR
, StringsP_Dispatcher
, cl
, obj
, msg
)
278 switch (msg
->MethodID
)
280 case OM_NEW
: return StringsP_New(cl
, obj
, (struct opSet
*)msg
);
281 case MUIM_Settingsgroup_ConfigToGadgets
: return StringsP_ConfigToGadgets(cl
,obj
,(APTR
)msg
);break;
282 case MUIM_Settingsgroup_GadgetsToConfig
: return StringsP_GadgetsToConfig(cl
,obj
,(APTR
)msg
);break;
285 return DoSuperMethodA(cl
, obj
, msg
);
287 BOOPSI_DISPATCHER_END
292 const struct __MUIBuiltinClass _MUIP_Strings_desc
= {
295 sizeof(struct MUI_StringsPData
),
296 (void*)StringsP_Dispatcher
300 static const UBYTE icon32
[] =
302 0x00, 0x00, 0x00, 0x18, // width
303 0x00, 0x00, 0x00, 0x13, // height
305 0x00, 0x00, 0x00, 0x78, // number of bytes
307 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0xe5, 0x44,
308 0x0a, 0x8c, 0x00, 0x02, 0x69, 0xf5, 0x22, 0xa2, 0x22, 0x22, 0x00, 0x00,
309 0x20, 0x02, 0x00, 0x20, 0x00, 0x00, 0x40, 0x42, 0x40, 0x00, 0x00, 0xa0,
310 0x00, 0x90, 0x20, 0x00, 0x00, 0x88, 0x94, 0xd4, 0xcd, 0x46, 0xd4, 0xe2,
311 0xaa, 0x6c, 0x15, 0x67, 0x9d, 0xe8, 0xf9, 0x9b, 0xd6, 0x52, 0xa0, 0x3d,
312 0x77, 0x69, 0x68, 0xf4, 0x40, 0x86, 0x79, 0x99, 0x85, 0xe9, 0x81, 0x03,
313 0x67, 0xd1, 0x10, 0x7d, 0x14, 0x43, 0x82, 0x88, 0x69, 0x51, 0x4e, 0x73,
314 0x50, 0x10, 0x80, 0xc8, 0x25, 0xb6, 0x89, 0x14, 0x21, 0x04, 0x08, 0x01,
315 0x54, 0x92, 0xd5, 0x45, 0xb8, 0x20, 0x19, 0x48, 0x84, 0x20, 0x92, 0x42,
316 0x11, 0xfe, 0x2e, 0xe4, 0x8a, 0x70, 0xa1, 0x21, 0xca, 0x88, 0x15, 0x18,
320 Object
*stringsclass_get_icon(void)
322 return RawimageObject
,
323 MUIA_Rawimage_Data
, icon32
,