1d98bfc0eba3a258a601b18c32fc2fab7e98c134
[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 // This is generated at make time from .svn or .git/svn or autorevision.conf
43 #include <autorevision.h>
44
45 #include "about.h"
46 #include "app.h"
47
48 #include "general.h"
49
50 #endif
51
52 /* === U S I N G =========================================================== */
53
54 using namespace std;
55 using namespace etl;
56 using namespace studio;
57
58 /* === M A C R O S ========================================================= */
59
60 #ifndef VERSION
61 #define VERSION "unknown"
62 #define PACKAGE "synfigstudio"
63 #endif
64
65 #ifdef WIN32
66 #       ifdef IMAGE_DIR
67 #               undef IMAGE_DIR
68 #               define IMAGE_DIR "share\\pixmaps"
69 #       endif
70 #endif
71
72 #ifndef IMAGE_DIR
73 #       define IMAGE_DIR "/usr/local/share/pixmaps"
74 #endif
75
76 #ifndef IMAGE_EXT
77 #       define IMAGE_EXT        "png"
78 #endif
79
80 #define stringify_(x) #x
81 #define stringify(x) stringify_(x)
82
83 /* === G L O B A L S ======================================================= */
84
85 extern const guint gtk_major_version;
86 extern const guint gtk_minor_version;
87 extern const guint gtk_micro_version;
88 extern const guint gtk_binary_age;
89 extern const guint gtk_interface_age;
90
91 /* === P R O C E D U R E S ================================================= */
92
93 /* === M E T H O D S ======================================================= */
94
95 About::About()
96 {
97
98 #ifdef HAVE_GTK_ABOUTDIALOG_SET_PROGRAM_NAME
99         set_program_name(PACKAGE_NAME);
100 #else
101         set_name(PACKAGE_NAME);
102 #endif
103         set_version(VERSION);
104         set_comments(_("2D vector animation studio"));
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         set_wrap_license(true);
125
126         std::vector<Glib::ustring> authors;
127         authors.push_back("Original developers:");
128         authors.push_back("");
129         authors.push_back("Robert B. Quattlebaum Jr (darco)");
130         authors.push_back("Adrian Bentley");
131         authors.push_back("");
132         authors.push_back("Contributors:");
133         authors.push_back("");
134         authors.push_back("Adrian Winchell (SnapSilverlight)");
135         authors.push_back("Andreas Jochens");
136         authors.push_back("Carlos López González (genete)");
137         authors.push_back("Chris Moore (dooglus)");
138         authors.push_back("Chris Norman (PXEGeek)");
139         authors.push_back("Daniel Fort");
140         authors.push_back("David Roden (Bombe)");
141         authors.push_back("Dmitriy Pomerantsev (Atrus)");
142         authors.push_back("Douglas Lau");
143         authors.push_back("IL'dar AKHmetgaleev (AkhIL)");
144         authors.push_back("Luka Pravica");
145         authors.push_back("Martin Michlmayr (tbm)");
146         authors.push_back("Miguel Gea Milvaques (xerakko)");
147         authors.push_back("Paul Wise (pabs)");
148         authors.push_back("Ralf Corsepius");
149         authors.push_back("Yue Shi Lai");
150         set_authors(authors);
151
152         std::vector<Glib::ustring> artists;
153         artists.push_back("Robert B. Quattlebaum Jr. (darco)");
154         artists.push_back("Carlos López González (genete)");
155         artists.push_back("Chris Norman (PXEGeek)");
156         set_artists(artists);
157
158         // TRANSLATORS: change this to your name, separate multiple names with \n
159         set_translator_credits(_("translator-credits"));
160
161         std::string imagepath;
162 #ifdef WIN32
163         imagepath=App::get_base_path()+ETL_DIRECTORY_SEPARATOR+IMAGE_DIR;
164 #else
165         imagepath=IMAGE_DIR;
166 #endif
167         char* synfig_root=getenv("SYNFIG_ROOT");
168         if(synfig_root) {
169                 imagepath=synfig_root;
170                 imagepath+=ETL_DIRECTORY_SEPARATOR;
171
172                 imagepath+="share/pixmaps";
173         }
174         imagepath+=ETL_DIRECTORY_SEPARATOR;
175
176         Gtk::Image *Logo = manage(new class Gtk::Image());
177         Logo->set(imagepath+"synfig_icon."IMAGE_EXT);
178         set_logo(Logo->get_pixbuf());
179
180 #ifdef SHOW_EXTRA_INFO
181
182         string extra_info = get_comments() + "\n";
183         
184         #ifdef DEVEL_VERSION
185                 extra_info += strprintf(_("\nDevelopment version:\n%s\n"),DEVEL_VERSION);
186         #endif
187         
188         extra_info += "\n";
189         
190         extra_info += strprintf(_("Built on %s at %s\n"), __DATE__, __TIME__);
191
192         extra_info += "\n";
193
194         extra_info += strprintf(_("Built with:\n"), ETL_VERSION);
195         extra_info += strprintf(_("ETL %s\n"), ETL_VERSION);
196         extra_info += strprintf(_("Synfig API %s\n"), stringify(SYNFIG_VERSION));
197         extra_info += strprintf(_("Synfig library %d\n"), SYNFIG_LIBRARY_VERSION);
198         extra_info += strprintf(_("GTK+ %d.%d.%d\n"), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
199         #ifdef __GNUC__
200                 extra_info += strprintf(_("GNU G++ %d.%d.%d\n"),__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__);
201         #endif
202
203         extra_info += "\n";
204
205         extra_info += strprintf(_("Using:\n"), synfig::get_version());
206         extra_info += strprintf(_("Synfig %s\n"), synfig::get_version());
207         extra_info += strprintf(_("GTK+ %d.%d.%d"),gtk_major_version,gtk_minor_version,gtk_micro_version);
208
209         #ifdef _DEBUG
210                 extra_info += "\n\nDEBUG BUILD";
211         #endif
212
213         set_comments(extra_info);
214
215 #endif
216
217         // Hide the dialog when you click close
218         signal_response().connect(sigc::mem_fun(*this, &About::close));
219 }
220
221 void About::close(int){
222         hide();
223 }