Remove obsolete includes.
[synfig.git] / synfig-studio / src / gtkmm / about.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file about.cpp
3 **      \brief About dialog implementation
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2008 Paul Wise
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include <vector>
33
34 #include <gtkmm/aboutdialog.h>
35
36 #include <ETL/stringf>
37
38 #include <synfig/general.h>
39
40 // This is generated at make time from .svn or .git/svn or autorevision.conf
41 #include <autorevision.h>
42
43 #include "about.h"
44 #include "app.h"
45
46 #include "general.h"
47
48 #endif
49
50 /* === U S I N G =========================================================== */
51
52 using namespace std;
53 using namespace etl;
54 using namespace studio;
55
56 /* === M A C R O S ========================================================= */
57
58 #ifndef VERSION
59 #define VERSION "unknown"
60 #define PACKAGE "synfigstudio"
61 #endif
62
63 #ifdef WIN32
64 #       ifdef IMAGE_DIR
65 #               undef IMAGE_DIR
66 #               define IMAGE_DIR "share\\pixmaps"
67 #       endif
68 #endif
69
70 #ifndef IMAGE_DIR
71 #       define IMAGE_DIR "/usr/local/share/pixmaps"
72 #endif
73
74 #ifndef IMAGE_EXT
75 #       define IMAGE_EXT        "png"
76 #endif
77
78 #define stringify_(x) #x
79 #define stringify(x) stringify_(x)
80
81 /* === G L O B A L S ======================================================= */
82
83 extern const guint gtk_major_version;
84 extern const guint gtk_minor_version;
85 extern const guint gtk_micro_version;
86 extern const guint gtk_binary_age;
87 extern const guint gtk_interface_age;
88
89 /* === P R O C E D U R E S ================================================= */
90
91 /* === M E T H O D S ======================================================= */
92
93 About::About()
94 {
95
96 #ifdef HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME
97         set_program_name(PACKAGE_NAME);
98 #else
99         set_name(PACKAGE_NAME);
100 #endif
101         set_version(VERSION);
102         set_comments(_("2D vector animation studio"));
103
104         set_url_hook(sigc::mem_fun(*this, &About::on_link_clicked));
105         set_website("http://www.synfig.org/");
106         set_website_label(_("Visit the Synfig website"));
107
108         set_copyright(_("Copyright 2001-2008\nRobert B. Quattlebaum Jr.,\nAdrian Bentley and Synfig contributors"));
109         Glib::ustring license =
110                 "This program is free software; you can redistribute it and/or modify "
111                 "it under the terms of the GNU General Public License as published by "
112                 "the Free Software Foundation; either version 2 of the License, or "
113                 "(at your option) any later version.\n\n"
114
115                 "This program is distributed in the hope that it will be useful, "
116                 "but WITHOUT ANY WARRANTY; without even the implied warranty of "
117                 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
118                 "GNU General Public License for more details.\n\n"
119
120                 "You should have received a copy of the GNU General Public License along "
121                 "with this program; if not, write to the Free Software Foundation, Inc., "
122                 "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or visit: http://www.gnu.org/";
123         set_license(license);
124 #ifdef HAVE_GTK_ABOUTDIALOG_SET_WRAP_LICENSE
125         set_wrap_license(true);
126 #endif
127
128         std::vector<Glib::ustring> authors;
129         authors.push_back("Original developers:");
130         authors.push_back("");
131         authors.push_back("Robert B. Quattlebaum Jr (darco)");
132         authors.push_back("Adrian Bentley");
133         authors.push_back("");
134         authors.push_back("Contributors:");
135         authors.push_back("");
136         authors.push_back("Adrian Winchell (SnapSilverlight)");
137         authors.push_back("Andreas Jochens");
138         authors.push_back("Carlos López González (genete)");
139         authors.push_back("Chris Moore (dooglus)");
140         authors.push_back("Chris Norman (pixelgeek)");
141         authors.push_back("Daniel Fort");
142         authors.push_back("Daniel Hornung (rubikcube)");
143         authors.push_back("David Roden (Bombe)");
144         authors.push_back("Dmitriy Pomerantsev (Atrus)");
145         authors.push_back("Douglas Lau");
146         authors.push_back("Gerald Young (Yoyobuae)");
147         authors.push_back("Gerco Ballintijn");
148         authors.push_back("IL'dar AKHmetgaleev (AkhIL)");
149         authors.push_back("Luka Pravica");
150         authors.push_back("Martin Michlmayr (tbm)");
151         authors.push_back("Miguel Gea Milvaques (xerakko)");
152         authors.push_back("Paul Wise (pabs)");
153         authors.push_back("Ralf Corsepius");
154         authors.push_back("Yue Shi Lai");
155         set_authors(authors);
156
157         std::vector<Glib::ustring> artists;
158         artists.push_back("Robert B. Quattlebaum Jr. (darco)");
159         artists.push_back("Aurore D (rore)");
160         artists.push_back("Carlos López González (genete)");
161         artists.push_back("Chris Norman (pixelgeek)");
162         artists.push_back("Daniel Hornung (rubikcube)");
163         artists.push_back("Franco Iacomella (Yaco)");
164
165         set_artists(artists);
166
167         // TRANSLATORS: change this to your name, separate multiple names with \n
168         set_translator_credits(_("translator-credits"));
169
170         std::string imagepath;
171 #ifdef WIN32
172         imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR;
173 #else
174         imagepath=IMAGE_DIR;
175 #endif
176         char* synfig_root=getenv("SYNFIG_ROOT");
177         if(synfig_root) {
178                 imagepath=synfig_root;
179                 imagepath+=ETL_DIRECTORY_SEPARATOR;
180                 imagepath+="share";
181                 imagepath+=ETL_DIRECTORY_SEPARATOR;
182                 imagepath+="pixmaps";
183         }
184         imagepath+=ETL_DIRECTORY_SEPARATOR;
185
186         Gtk::Image *Logo = manage(new class Gtk::Image());
187         Logo->set(imagepath+"synfig_icon."IMAGE_EXT);
188         set_logo(Logo->get_pixbuf());
189
190 #ifdef SHOW_EXTRA_INFO
191
192         string extra_info = get_comments() + "\n";
193
194         #ifdef DEVEL_VERSION
195                 extra_info += strprintf(_("\nDevelopment version:\n%s\n"),DEVEL_VERSION);
196         #endif
197
198         extra_info += "\n";
199
200         extra_info += strprintf(_("Built on %s" /* at %s */ "\n"), __DATE__ /* , __TIME__ */ );
201
202         extra_info += "\n";
203
204         extra_info += strprintf(_("Built with:\n"), ETL_VERSION);
205         extra_info += strprintf(_("ETL %s\n"), ETL_VERSION);
206         extra_info += strprintf(_("Synfig API %s\n"), stringify(SYNFIG_VERSION));
207         extra_info += strprintf(_("Synfig library %d\n"), SYNFIG_LIBRARY_VERSION);
208         extra_info += strprintf(_("GTK+ %d.%d.%d\n"), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
209         #ifdef __GNUC__
210                 extra_info += strprintf(_("GNU G++ %d.%d.%d\n"),__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__);
211         #endif
212
213         extra_info += "\n";
214
215         extra_info += strprintf(_("Using:\n"), synfig::get_version());
216         extra_info += strprintf(_("Synfig %s\n"), synfig::get_version());
217         extra_info += strprintf(_("GTK+ %d.%d.%d"),gtk_major_version,gtk_minor_version,gtk_micro_version);
218
219         #ifdef _DEBUG
220                 extra_info += "\n\nDEBUG BUILD";
221         #endif
222
223         set_comments(extra_info);
224
225 #endif
226
227         // Hide the dialog when you click close
228         signal_response().connect(sigc::mem_fun(*this, &About::close));
229 }
230
231 void About::close(int){
232         hide();
233 }
234
235 void About::on_link_clicked(Gtk::AboutDialog&, const Glib::ustring &url)
236 {
237         App::open_url(url);
238 }