1 /***************************************************************************
3 openurl.library - universal URL display and browser launcher library
4 Copyright (C) 1998-2005 by Troels Walsted Hansen, et al.
5 Copyright (C) 2005-2013 by openurl.library Open Source Team
7 This library is free software; it has been placed in the public domain
8 and you can freely redistribute it and/or modify it. Please note, however,
9 that some components may be under the LGPL or GPL license.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 openurl.library project: http://sourceforge.net/projects/openurllib/
19 ***************************************************************************/
25 #define CATCOMP_NUMBERS
32 #include <libraries/openurl.h>
36 /***********************************************************************/
38 ** If Urltext.mcc is present use it,
39 ** otherwise falls back to a text object
42 static Object
*ourltext(CONST_STRPTR url
, CONST_STRPTR text
)
49 MUIA_Urltext_Text
, text
,
50 MUIA_Urltext_Url
, url
,
51 MUIA_Urltext_SetMax
, FALSE
,
52 MUIA_Urltext_NoOpenURLPrefs
, TRUE
,
58 MUIA_Text_SetMax
, FALSE
,
59 MUIA_Text_Contents
, (text
!= NULL
) ? text
: url
,
67 /***********************************************************************/
69 static IPTR
mNew(struct IClass
*cl
,Object
*obj
,struct opSet
*msg
)
74 strlcpy(buf
, "OpenURL-Prefs " LIB_REV_STRING
" [" SYSTEMSHORT
"/" CPU
"] (" LIB_DATE
")\n" LIB_COPYRIGHT
, sizeof(buf
));
76 if ((obj
= (Object
*)DoSuperNew(cl
,obj
,
77 MUIA_Window_Title
, getString(MSG_About_WinTitle
),
78 MUIA_Window_ScreenTitle
, getString(MSG_App_ScreenTitle
),
79 MUIA_Window_IconifyGadget
, FALSE
,
80 MUIA_Window_MenuGadget
, FALSE
,
81 MUIA_Window_SnapshotGadget
, FALSE
,
82 MUIA_Window_ConfigGadget
, FALSE
,
83 MUIA_Window_SizeGadget
, FALSE
,
84 MUIA_Window_CloseGadget
, FALSE
,
85 MUIA_Window_AllowTopMenus
, FALSE
,
87 WindowContents
, VGroup
,
88 MUIA_Background
, MUII_RequesterBack
,
93 MUIA_Text_Contents
, getString(MSG_About_Descr
),
98 Child
, RectangleObject
, MUIA_FixHeight
, 4, End
,
103 MUIA_Text_PreParse
, "\33c",
104 MUIA_Text_Contents
, buf
,
111 Child
, ourltext("http://sourceforge.net/projects/openurllib",NULL
),
115 //Child, RectangleObject, MUIA_FixHeight, 4, End,
117 Child
, RectangleObject
, MUIA_Rectangle_HBar
, TRUE
, End
,
120 Child
, RectangleObject
, MUIA_Weight
, 200, End
,
121 Child
, ok
= obutton(MSG_About_OK
,0),
122 Child
, RectangleObject
, MUIA_Weight
, 200, End
,
125 TAG_MORE
, msg
->ops_AttrList
)))
127 superset(cl
,obj
,MUIA_Window_ActiveObject
,ok
);
129 DoMethod(ok
,MUIM_Notify
,MUIA_Pressed
,FALSE
,(IPTR
)obj
,3,
130 MUIM_Set
,MUIA_Window_CloseRequest
,TRUE
);
136 /***********************************************************************/
138 SDISPATCHER(dispatcher
)
140 switch(msg
->MethodID
)
142 case OM_NEW
: return mNew(cl
,obj
,(APTR
)msg
);
143 default: return DoSuperMethodA(cl
,obj
,msg
);
147 /***********************************************************************/
149 BOOL
initAboutClass(void)
151 BOOL success
= FALSE
;
155 if((g_aboutClass
= MUI_CreateCustomClass(NULL
, MUIC_Window
, NULL
, 0, ENTRY(dispatcher
))) != NULL
)
162 /***********************************************************************/
164 void disposeAboutClass(void)
168 if(g_aboutClass
!= NULL
)
169 MUI_DeleteCustomClass(g_aboutClass
);
174 /***********************************************************************/