~ubuntu-branches/ubuntu/natty/bluefish/natty-proposed

« back to all changes in this revision

Viewing changes to src/about.c

  • Committer: Bazaar Package Importer
  • Author(s): Davide Puricelli (evo)
  • Date: 2005-04-23 17:05:18 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050423170518-pb8zi3vg32cm6g04
Tags: 1.0-1
* Acknowledge NMU, thanks Leo; closes: #291222.
* Updated debian/ files, thanks Daniel Leidert. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Bluefish HTML Editor
 
2
 * about.c
 
3
 *
 
4
 *Copyright (C) 2004 Eugene Morenko(More) more@irpin.com
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program 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.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
 
 
21
#include <gdk/gdk.h>
 
22
#include <gtk/gtk.h>
 
23
#include <stdio.h>
 
24
#include <stdlib.h>
 
25
#include <string.h>
 
26
#include <unistd.h>                             /* getopt() */
 
27
 
 
28
#include "bluefish.h"
 
29
#include "about.h"
 
30
#include "gtk_easy.h"
 
31
 
 
32
static GtkWidget *info;
 
33
/*
 
34
static GtkWidget *create_header(GdkPixbuf * icon, const char *text)
 
35
{
 
36
        GtkWidget *eventbox, *label, *hbox, *image;
 
37
        GtkStyle *style;
 
38
        char *markup;
 
39
        GdkColormap *cmap;
 
40
        GdkColor color;
 
41
 
 
42
        eventbox = gtk_event_box_new();
 
43
 
 
44
        hbox = gtk_hbox_new(FALSE, 12);
 
45
        gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
 
46
        gtk_container_add(GTK_CONTAINER(eventbox), hbox);
 
47
 
 
48
        if (icon) {
 
49
                image = gtk_image_new_from_pixbuf(icon);
 
50
                gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
 
51
        }
 
52
 
 
53
        style = gtk_widget_get_style(eventbox);
 
54
        cmap = gdk_colormap_get_system();
 
55
        color.red = 0xaaaa;
 
56
        color.green = 0x1112;
 
57
        color.blue = 0x3fea;
 
58
        if (!gdk_color_alloc(cmap, &color)) {
 
59
                g_print("couldn't allocate color");
 
60
        }
 
61
        gtk_widget_modify_bg(eventbox, GTK_STATE_NORMAL, &color);
 
62
 
 
63
        markup = g_strconcat("<span size=\"larger\"  weight=\"bold\">", text, "</span>", NULL);
 
64
        label = gtk_label_new(markup);
 
65
        g_free(markup);
 
66
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
 
67
 
 
68
        gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 
69
 
 
70
        style = gtk_widget_get_style(label);
 
71
        gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &style->fg[GTK_STATE_SELECTED]);
 
72
 
 
73
        gtk_widget_show_all(eventbox);
 
74
        return eventbox;
 
75
}
 
76
*/
 
77
/*
 
78
static GdkPixbuf *inline_icon_at_size(const guint8 * data, int width, int height)
 
79
{
 
80
        GdkPixbuf *base;
 
81
 
 
82
        base = gdk_pixbuf_new_from_inline(-1, data, FALSE, NULL);
 
83
 
 
84
        g_assert(base);
 
85
 
 
86
        if ((width < 0 && height < 0)
 
87
                || (gdk_pixbuf_get_width(base) == width && gdk_pixbuf_get_height(base) == height)) {
 
88
                return base;
 
89
        } else {
 
90
                GdkPixbuf *scaled;
 
91
 
 
92
                scaled =
 
93
                        gdk_pixbuf_scale_simple(base, width > 0 ? width : gdk_pixbuf_get_width(base),
 
94
                                                                        height > 0 ? height : gdk_pixbuf_get_height(base),
 
95
                                                                        GDK_INTERP_BILINEAR);
 
96
 
 
97
                g_object_unref(G_OBJECT(base));
 
98
 
 
99
                return scaled;
 
100
        }
 
101
}*/
 
102
 
 
103
static void add_page(GtkNotebook * notebook, const gchar * name, const gchar * buf,
 
104
                                         gboolean hscrolling) {
 
105
        GtkWidget *textview, *label, *sw;
 
106
        label = gtk_label_new(name);
 
107
        sw = textview_buffer_in_scrolwin(&textview, -1, 200, buf, GTK_WRAP_WORD);
 
108
        gtk_text_view_set_editable(GTK_TEXT_VIEW(textview), FALSE);
 
109
        gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (textview), FALSE);
 
110
        gtk_notebook_append_page(notebook, sw, label);
 
111
}
 
112
 
 
113
static void about_dialog_close_lcb(GtkObject *object,GtkWidget *win) {
 
114
        window_destroy(win);
 
115
}
 
116
 
 
117
void about_dialog_create(gpointer * data, guint * callback_action, GtkWidget * widget) {
 
118
        GtkWidget *vbox, *vbox2, *hbox;
 
119
        GtkWidget *notebook;
 
120
        GtkWidget *info_ok_button;
 
121
        GdkColor color;
 
122
        gchar *I1;
 
123
        gchar *INFO = _("Bluefish is an editor for experienced web designers and programmers. It supports many programming and markup languages, but focuses on editing dynamic and interactive websites. Bluefish is an open source development project, released under the GPL license.\n\nFor more information, visit the Bluefish Website at http://bluefish.openoffice.nl/\n\nThis version of bluefish was compiled with the following options:\n");
 
124
        gchar *AUTHORS = _("Project leader:\n\
 
125
  Olivier Sessink <olivier@bluefish.openoffice.nl>\n\
 
126
\n\
 
127
Developers for this release:\n\
 
128
  Olivier Sessink\n\
 
129
   <olivier@bluefish.openoffice.nl>\n\
 
130
  Jim Hayward\n\
 
131
   <jimhayward@linuxexperience.net>\n\
 
132
  Oskar Świda\n\
 
133
   <swida@aragorn.pb.bialystok.pl>\n\
 
134
  Eugene Morenko(More)\n\
 
135
   <more@irpin.com>\n\
 
136
  Alastair Porter\n\
 
137
   <alastair@linuxexperience.com>\n\
 
138
\n\
 
139
Developers for previous releases:\n\
 
140
  Chris Mazuc\n\
 
141
  Neil Millar\n\
 
142
  Gero Takke\n\
 
143
  Bo Forslund\n\
 
144
  David Arno\n\
 
145
  Pablo De Napoli\n\
 
146
  Santiago Capel Torres\n\
 
147
  Rasmus Toftdahl Olesen\n\
 
148
   <rto@pohldata.dk>\n\
 
149
  Roland Steinbach\n\
 
150
   <roland@netzblick.de>\n\
 
151
  Christian Tellefsen\n\
 
152
   <chris@tellefsen.net>\n\
 
153
  Antti-Juhani Kaijanaho\n\
 
154
\n\
 
155
Documentation:\n\
 
156
  Scott White\n\
 
157
   <wwsw3@earthlink.net>\n\
 
158
  Michèle Garoche\n\
 
159
   <michele.garoche@easyconnect.fr>\n\
 
160
  Anita Lewis\n\
 
161
   <ajreiki@highstream.net>\n\
 
162
  Alastair Porter\n\
 
163
   <alastair@linuxexperience.com>\n\
 
164
  Daniel Blair\n\
 
165
   <joecamel@realcoders.org>\n\
 
166
  Olivier Sessink\n\
 
167
   <olivier@bluefish.openoffice.nl>\n\
 
168
  Denny Reeh\n\
 
169
\n\
 
170
Package Maintainers:\n\
 
171
  Debian:   Davide Puricelli\n\
 
172
   <evo@debian.org>\n\
 
173
  Redhat:   Matthias Haase\n\
 
174
   <matthias_haase@bennewitz.com>\n\
 
175
  Mandrake: Todd Lyons\n\
 
176
   <todd@mrball.net>\n\
 
177
  Fink: Michèle Garoche\n\
 
178
   <michele.garoche@easyconnect.fr>\n\
 
179
\n\
 
180
If you know of anyone missing from this list, please let us know\n\
 
181
<bluefish@bluefish.openoffice.nl>\n\
 
182
\n\
 
183
Thanks to all who helped making this software available.\n\
 
184
");
 
185
        gchar *TRANSLATORS = _("Current translators:\n\n\
 
186
  Brazilian Portuguese - Anderson Rocha\n\
 
187
   <anderson@maxlinux.com.br>\n\n\
 
188
  Bulgarian - Peio Popov\n\
 
189
   <peio@peio.org>\n\n\
 
190
  Chinese - Ting Yang (Dormouse)\n\
 
191
   <mouselinux@163.com>\n\n\
 
192
  Danish - Rasmus Toftdahl Olesen\n\
 
193
   <rto@pohldata.dk>\n\n\
 
194
  Finnish - Juho Roukala\n\
 
195
   <j.mr@luukku.com>\n\n\
 
196
  French - Michèle Garoche\n\
 
197
   <michele.garoche@easyconnect.fr>\n\n\
 
198
  German - Roland Steinbach\n\
 
199
   <roland@netzblick.de>\n\n\
 
200
  Hungarian - Péter Sáska\n\
 
201
   <sasek@ccsystem.hu>\n\n\
 
202
  Italian - Stefano Canepa\n\
 
203
   <sc@linux.it>\n\n\
 
204
  Norwegian - Christian Tellefsen\n\
 
205
   <chris@tellefsen.net>\n\n\
 
206
  Polish - Oskar Swida\n\
 
207
   <swida@aragorn.pb.bialystok.pl>\n\n\
 
208
  Portuguese - Lopo Pizarro\n\
 
209
   <lopopizarro@netcabo.pt>\n\n\
 
210
  Russian - Eugene Rupakov\n\
 
211
   <rupakov@jet.msk.su>\n\n\
 
212
  Serbian - Marko Milenović\n\
 
213
   <raven@sbb.co.yu>\n\n\
 
214
  Spanish - Walter Oscar Echarri\n\
 
215
   <wecharri@arnet.com.ar>\n\n\
 
216
  Swedish - David Smeringe\n\
 
217
   <david.smeringe@telia.com>\n\n\
 
218
  Tamil - Murugapandian Barathee\n\
 
219
   <barathee@yahoo.com>\n\n\
 
220
");
 
221
 
 
222
        info = window_full2(_("About Bluefish"), GTK_WIN_POS_CENTER, 6
 
223
                        ,G_CALLBACK(about_dialog_close_lcb),NULL, TRUE, NULL);
 
224
        gtk_window_set_resizable(GTK_WINDOW(info), FALSE);
 
225
        color.red = 65535;
 
226
        color.blue = 65535;
 
227
        color.green = 65535;
 
228
        gtk_widget_modify_bg(info, GTK_STATE_NORMAL,&color);
 
229
 
 
230
        vbox2 = gtk_vbox_new(FALSE, 0);
 
231
        gtk_container_add(GTK_CONTAINER(info), vbox2);
 
232
        {
 
233
                GError *error=NULL;
 
234
                GtkWidget *image;
 
235
                GdkPixbuf* pixbuf= gdk_pixbuf_new_from_file(BLUEFISH_SPLASH_FILENAME,&error);
 
236
                if (error) {
 
237
                        g_print("ERROR while loading splash screen: %s\n", error->message);
 
238
                        g_error_free(error);
 
239
                } else if (pixbuf) {
 
240
                        image = gtk_image_new_from_pixbuf(pixbuf);
 
241
                        gtk_box_pack_start(GTK_BOX(vbox2), image, FALSE, FALSE, 0);
 
242
                        g_object_unref(pixbuf);
 
243
                }
 
244
        }
 
245
 
 
246
        vbox = gtk_vbox_new(FALSE, 0);
 
247
        gtk_box_pack_start(GTK_BOX(vbox2), vbox, TRUE, TRUE, 0);
 
248
 
 
249
        /* the notebook */
 
250
        notebook = gtk_notebook_new();
 
251
 
 
252
        /* add pages */
 
253
        I1 = g_strconcat(INFO, CONFIGURE_OPTIONS, NULL);
 
254
        add_page(GTK_NOTEBOOK(notebook), _("Info"), I1, TRUE);
 
255
        g_free(I1);
 
256
        add_page(GTK_NOTEBOOK(notebook), _("Authors"), AUTHORS, TRUE);
 
257
        add_page(GTK_NOTEBOOK(notebook), _("Translators"), TRANSLATORS, TRUE);
 
258
 
 
259
        gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
 
260
 
 
261
        hbox = gtk_hbutton_box_new ();
 
262
        gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END);
 
263
        gtk_box_pack_start( GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
 
264
        info_ok_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
 
265
        GTK_WIDGET_SET_FLAGS(info_ok_button, GTK_CAN_DEFAULT);
 
266
        gtk_box_pack_start(GTK_BOX(hbox), info_ok_button, FALSE, FALSE, 0);
 
267
        gtk_widget_grab_default(info_ok_button);
 
268
 
 
269
        g_signal_connect(info_ok_button, "clicked", G_CALLBACK(about_dialog_close_lcb), info);
 
270
 
 
271
        gtk_widget_show_all(info);
 
272
}