1 /*
2   FXiTe - The Free eXtensIble Text Editor
3   Copyright (c) 2009-2013 Jeffrey Pohlmeyer <yetanothergeek@gmail.com>
4 
5   This program is free software; you can redistribute it and/or modify it
6   under the terms of the GNU General Public License version 3 as
7   published by the Free Software Foundation.
8 
9   This software is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   GNU General Public License for more details.
13 
14   You should have received a copy of the GNU General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18 
19 
20 #include <fx.h>
21 #include <Scintilla.h>
22 #include <FXScintilla.h>
23 #include <lua.h>
24 
25 #include "fxasq.h"
26 #include "intl.h"
27 #include "appname.h"
28 
29 static const char *Scintilla_Copyright =" \
30 The Scintilla editing control and the PDF/HTML export code are\n\
31 copyright 1998-2013 by Neil Hodgson <neilh@scintilla.org>\n\
32 and are released under the following license:\n\
33 \n\
34 All Rights Reserved\n\
35 Permission to use, copy, modify, and distribute this software and its\n\
36 documentation for any purpose and without fee is hereby granted,\n\
37 provided that the above copyright notice appear in all copies and that\n\
38 both that copyright notice and this permission notice appear in\n\
39 supporting documentation.\n\
40 Neil Hodgson disclaims all warranties with regard to this\n\
41 software, including all implied warranties of merchantability\n\
42 and fitness, in no event shall Neil Hodgson be liable for any\n\
43 special, indirect or consequential damages or any damages\n\
44 whatsoever resulting from loss of use, data or profits,\n\
45 whether in an action of contract, negligence or other\n\
46 tortious action, arising out of or in connection with the use\n\
47 or performance of this software.\n\
48 \n\
49 For more information, visit http://scintilla.org/\
50 ";
51 
52 #ifdef FOX_1_6
53 // Fox 1.6 message box won't accept strings longer than ~1000 chars,
54 // so split the license across two dialogs...
55 static const char* Lua_License ="\
56 The Lua scripting engine is released under the following license:\n\
57 \n\
58 Copyright (C) 1994-2008 Lua.org, PUC-Rio.\n\
59 Permission is hereby granted, free of charge, to any person obtaining a copy\n\
60 of this software and associated documentation files (the \"Software\"), to deal\n\
61 in the Software without restriction, including without limitation the rights\n\
62 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\
63 copies of the Software, and to permit persons to whom the Software is\n\
64 furnished to do so, subject to the following conditions:\n\
65 ";
66 static const char* Lua_License_2 ="\
67 The preceeding copyright notice and this permission notice shall be included in\n\
68 all copies or substantial portions of the Software.\n\
69 The software is provided \"AS IS\", without warranty of any kind, express or\n\
70 implied, including but not limited to the warranties of merchantability,\n\
71 fitness for a particular purpose and noninfringement.  In no event shall the\n\
72 authors or copyright holders be liable for any claim, damages or other\n\
73 liability, whether in an action of contract, tort or otherwise, arising from,\n\
74 out of or in connection with the software or the use or other dealings in\n\
75 the software.\n\
76 \n\
77 For more information, visit http://www.lua.org/license.html .\
78 ";
79 #else
80 static const char* Lua_License ="\
81 The Lua scripting engine is released under the following license:\n\
82 \n\
83 Copyright (C) 1994-2008 Lua.org, PUC-Rio.\n\
84 Permission is hereby granted, free of charge, to any person obtaining a copy\n\
85 of this software and associated documentation files (the \"Software\"), to deal\n\
86 in the Software without restriction, including without limitation the rights\n\
87 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\
88 copies of the Software, and to permit persons to whom the Software is\n\
89 furnished to do so, subject to the following conditions:\n\
90 The above copyright notice and this permission notice shall be included in\n\
91 all copies or substantial portions of the Software.\n\
92 The software is provided \"AS IS\", without warranty of any kind, express or\n\
93 implied, including but not limited to the warranties of merchantability,\n\
94 fitness for a particular purpose and noninfringement.  In no event shall the\n\
95 authors or copyright holders be liable for any claim, damages or other\n\
96 liability, whether in an action of contract, tort or otherwise, arising from,\n\
97 out of or in connection with the software or the use or other dealings in\n\
98 the software.\n\
99 \n\
100 For more information, visit http://www.lua.org/license.html .\
101 ";
102 #endif
103 
104 static const char* Fox_LGPL="\
105    This software uses the FOX Toolkit Library, released   \n\
106 under the GNU Lesser General Public License and \n\
107 the FOX Library License addendum.\n\
108 \n\
109 For more details, visit http://www.fox-toolkit.org\
110 ";
111 
112 #define App_About "\
113 Free eXtensIble Text Editor (FXiTe) %s %s\n\n\
114 Copyright (c) 2009-2013 Jeffrey Pohlmeyer\n\
115 <%s>\n\n\
116 %s\
117 GNU GENERAL PUBLIC LICENSE Version 3\n\n\
118 %s FOX-%d.%d.%d; FXScintilla-%s; %s\n\
119 "
120 
121 
VersionInfo()122 void AppAbout::VersionInfo()
123 {
124   printf(App_About, _("Version"), VERSION, "yetanothergeek@gmail.com",
125     _("This program is free software, under the terms of the\n"),
126     _("Running"),
127     fxversion[0],fxversion[1],fxversion[2],
128     FXScintilla::version().text(),
129     LUA_RELEASE);
130 }
131 
AboutBox()132 void AppAbout::AboutBox()
133 {
134   int i=0;
135   while (1) {
136     const char *btns[]={
137       _(" About &Scintilla "),
138       _(" About &Lua "),
139       _(" About &FOX "),
140       _(" &Close   "),NULL};
141     const char*btn[]={_("    &Close    "), NULL};
142     FxAsqWin*dlg=NULL;
143     FXString msg;
144     int rv=-1;
145     dlg=new FxAsqWin(_("About " EXE_NAME), btns, i++);
146     msg.format(App_About, _("Version"), VERSION, "yetanothergeek@gmail.com",
147       _("  This program is free software, under the terms of the  \n"),
148       _("Running"),
149       fxversion[0],fxversion[1],fxversion[2],
150       FXScintilla::version().text(),
151       LUA_RELEASE);
152     dlg->Label(msg.text(), JUSTIFY_CENTER_X);
153     rv=dlg->Run(NULL);
154     delete dlg;
155     switch (rv) {
156       case 0: {
157         dlg=new FxAsqWin(_("About Scintilla"), btn);
158         dlg->Label(Scintilla_Copyright);
159         dlg->Run();
160         delete dlg;
161         break;
162       }
163       case 1: {
164         dlg=new FxAsqWin(_("About Lua"), btn);
165         dlg->Label(Lua_License);
166   #ifdef FOX_1_6
167         dlg->Label(Lua_License_2);
168   #endif
169         dlg->Run();
170         delete dlg;
171         break;
172       }
173       case 2: {
174         dlg=new FxAsqWin(_("About FOX Toolkit"), btn);
175         dlg->Label(Fox_LGPL,JUSTIFY_CENTER_X);
176         dlg->Run();
177         delete dlg;
178         break;
179       }
180       default: { return; }
181     }
182   }
183 }
184 
185