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