make.tmpl: add missing compiler attribute to build_progs
[AROS.git] / external / openurl / prefs / about.c
blob871b6cbf770a226952e8971fc5fcd50d6f0ed708
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/
17 $Id$
19 ***************************************************************************/
21 #include <stdio.h>
23 #include "openurl.h"
25 #define CATCOMP_NUMBERS
26 #include "locale.h"
28 #include "SDI_hook.h"
30 #include "version.h"
32 #include <libraries/openurl.h>
34 #include "debug.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)
44 Object *o;
46 ENTER();
48 o = UrltextObject,
49 MUIA_Urltext_Text, text,
50 MUIA_Urltext_Url, url,
51 MUIA_Urltext_SetMax, FALSE,
52 MUIA_Urltext_NoOpenURLPrefs, TRUE,
53 End;
55 if(o == NULL)
57 o = TextObject,
58 MUIA_Text_SetMax, FALSE,
59 MUIA_Text_Contents, (text != NULL) ? text : url,
60 End;
63 RETURN(o);
64 return o;
67 /***********************************************************************/
69 static IPTR mNew(struct IClass *cl,Object *obj,struct opSet *msg)
71 TEXT buf[256];
72 Object *ok;
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,
90 Child, HGroup,
91 Child, HSpace(0),
92 Child, TextObject,
93 MUIA_Text_Contents, getString(MSG_About_Descr),
94 End,
95 Child, HSpace(0),
96 End,
98 Child, RectangleObject, MUIA_FixHeight, 4, End,
100 Child, HGroup,
101 Child, HSpace(0),
102 Child, TextObject,
103 MUIA_Text_PreParse, "\33c",
104 MUIA_Text_Contents, buf,
105 End,
106 Child, HSpace(0),
107 End,
109 Child, HGroup,
110 Child, HSpace(0),
111 Child, ourltext("http://sourceforge.net/projects/openurllib",NULL),
112 Child, HSpace(0),
113 End,
115 //Child, RectangleObject, MUIA_FixHeight, 4, End,
117 Child, RectangleObject, MUIA_Rectangle_HBar, TRUE, End,
119 Child, HGroup,
120 Child, RectangleObject, MUIA_Weight, 200, End,
121 Child, ok = obutton(MSG_About_OK,0),
122 Child, RectangleObject, MUIA_Weight, 200, End,
123 End,
124 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);
133 return (IPTR)obj;
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;
153 ENTER();
155 if((g_aboutClass = MUI_CreateCustomClass(NULL, MUIC_Window, NULL, 0, ENTRY(dispatcher))) != NULL)
156 success = TRUE;
158 RETURN(success);
159 return success;
162 /***********************************************************************/
164 void disposeAboutClass(void)
166 ENTER();
168 if(g_aboutClass != NULL)
169 MUI_DeleteCustomClass(g_aboutClass);
171 LEAVE();
174 /***********************************************************************/