Commit 39019452 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig
Browse files

Redone to have a fancy graphical effect. Will be tweaked further.

2003-12-29  Simon Budig  <simon@gimp.org>

	* app/gui/about-dialog.c: Redone to have a fancy graphical
	effect. Will be tweaked further.
parent f84276c4
2003-12-29 Simon Budig <simon@gimp.org>
* app/gui/about-dialog.c: Redone to have a fancy graphical
effect. Will be tweaked further.
2003-12-28 Simon Budig <simon@gimp.org>
 
* app/core/core-enums.h: Some default dash pattern enum.
......@@ -42,349 +42,193 @@
#include "gimp-intl.h"
static gchar *founders[] =
{
N_("Version %s brought to you by"),
"Spencer Kimball & Peter Mattis"
};
static gchar *translators[] =
{
N_("Translation by"),
N_("<Translator: insert your name here>"),
N_("Contributions by")
};
#define ANIMATION_STEPS 16
#define ANIMATION_SIZE 2
static char * wilber2_xpm[] = {
"95 95 9 1",
" c None",
". c #FFFFFF",
"+ c #B6B6B6",
"@ c #494949",
"# c #DBDBDB",
"$ c #6D6D6D",
"% c #929292",
"& c #242424",
"* c #000000",
" .+. ",
" .+. .+@# ..+. ",
" #@+. .$@# .%&. ",
" #&+. .&@#. .+&$. ..#. ",
" .++. +*$.. .$*%. .%*%. ..%%. ",
" .$@. #@*%. .#*&. .#&@. .%*%. ",
" .$&+. .#&&+ .%*&# .#&*# #&@.. ",
" .+*&+. .#*&+ .#&*$. .#@*&# #&$. ",
" .+#. ..%&&+. .%*&# .%**+. .$**%. .+&@. ..++. ",
" .%@#. ..@*$. #@*&#. .$**+. #**@.. ..+@*@. .#$&%. ",
" .+&$.. .@*%. .@**%. .#&*@.. #&*@. .%**&+. .%*%.. ",
" #&*@+. #&*@.. .+&*&+. .%**%. .$*&#. #&*&+. .$*#. ",
" .#+.+$*&+. #&*&%.. .+&*&+..#&*&#..+**%. #&*@. ..+&*# ",
" ... .@&...@*%. .%***$#. .%**&# .@**%. #&*@. .@*@. .+@&*&. .... ",
" +%..#&$+..@*@.. ..+@**&+..#&**+ .@**$..#**&# .$*&# #&**@+. .#+@%. ",
" +&%.+*@+#.@**%#.. .#@**@. #&**+.#&**+..%**&. .$*&+ +**$#. .$*@#. ",
" #@&$@**%+#%***@%#...+**&#.+&*@##@**$..%&**$..#&**+ .+**+. .#&&#. ",
" .+@&***@##.%&***&%. #&*&#.@*&+#@**$.#@**&%..#$**&+ .%*&# ..#+$*%. ",
" ..+&**&#...#+&**&#.#&*$.%**@.#&**+.%**&+.#$&***$. .$*&# .#$&**&+. ",
" .@***%.....+&**+.%**+.%**@.#&**+.$**@..@***&%#..+&*&# .%***@%. ",
" ... .$***@......$**+.@**+.+***+.@**$.%**@.+&**$#..#%&**&#..$**%#.. ..... ",
" #$#. .$***&%.....#@*#.@**@#.$**&+#&**+#&*&#+**&#.%&*****%.#$@*@.. ..%@&+ ",
" #@@++#.. .$****&$+....#$#.%***@+#$**&+%**@.$**+#&*@.#&***&@%#%$+$*%. .%*&%. ",
" .+&*&&$. .@******&%.....++#%&**&+#@**$#***#%**$#&*&#+**&%##+@%##&*+. .#+++@&+.. ",
" .+%$**+..$********$.....#+++@**&+%**&#&**#%**@#@*&#%**$#$&*%..%*&# .+&****$. ",
" ...@*&%#%*****@$@*@#....#&$+&**$+**&+***#@**$#&*&+%**&***@..#&*$. .@***&@#. ",
" .+***&&*****&##+@@+....%&&&**@+**&@**@%***+$**&+$*****@#..#@%#..+&*@+#.. ",
" .@**********%..#@&+...#&$%&*&@**&**&@***@%&***&*****&+.........$*&#. ",
" ... ..+++%&*****@...#&@...#&@##@*********************@%&%....++###$**$. ..##.. ",
" +$+..#.. ..+*****&#...+&+..+@&$.#&@%+%$$@&&**&***&&@$+#%&#...$&*&&&**&+. .....#@&&%. ",
" #@&@@&$#. #@*****@#...%$...#@&.+$#......##++%%%%+#.+$@&%...+&*******@. .#%$++@*$%#. ",
" .#&*&**$#..#++#.#******&+..#%....+%....................#&@%+....@**&$$@&$#..#@*****$... ",
" ..#.%**&@&***&+.$*******&%%++%$@&$.............##++#..#+......+**&#........$***&&@#. ",
" ..@********@##&*************&%..........+##....+$%#.......+@**%.#++#...%&*@+##.. ",
" .#@@@%%$&**+.+&************%..........%&&@$.....$$#.....+&**&##@**&$%@**&#. ",
" .......+&*&##@***********@...........%$%+@+.....$%.#%$$@***%#@*********%. ",
" .%***&&***********+...............+@#....#$+#+##+@&%#$***@@&***$.. ... ..... ",
" .##..#+#. ..###.#&**************&#........#$#.....%#.....#@.....#$%$&*&%#.#%$+....+%#..+@@%# ",
" #@@$$&*@#..+@&&@+.%&*&&@&*********@+#......+*@$$+..........@#.....#&***%..##... ..$&*&$$&&&@+ ",
" .#@**@**&@&*****&#.####.#%*******@&*&$+....+%+++$$#.....##.%+......&**@#+@&@%...#$******&+... ",
" ..+#.%&****&&***$#.#+$&@&******&+##%@&@#........$+.....%&@%%......@&$#+&****@%$@**@%%$$#. ",
" ..%&&$+##+@**&@&***********&#....%&#..#......#.....@**&%...#+.@+#+&**********$#..... ",
" ..##.. .#&***************&#....+&#.#$........+.#%****%...$*%&@&***@%+$****@#. ",
" .....+&**&@%%$*******&#....+@#.#&&@$@$..#*&&*****#.+#$*******$#...+@@%#. ",
" .#%@$#.+%%##++%&******&#...#@+...+%+$$$%.#&******&.#&&&**&**&$##%%#.......#.. ",
" .###...+&***&#...+@&*********&+...$%.....#.......%&*****%.#@****%%%+#%&**&+. .#%&@+..#+#..",
".##.+@*&%%$******&++$&************%..+&#.....+#.......%@&**&+..#+@**@%%%@*****&+##+@***&$%&*&%#",
"#$&&*&&*****&$$@*******&&&********@..%$.......%%#......#$@++@$%$@&&*************&&***&&***&$$$#",
".#%@@##$**&$#...%****&$##+&*******&#.%$........%@%%%%%$$%#..#+++%$$@@&***&*********&+##%@$#....",
" .......+$+.. ..%&&@+#+@&*********$.+@.........#+++++#.............+&**$+$****&**@#. ..... ",
" ... ..#+#.##..$*************$#&$..........%$@$$%...........#&**@+$&****$+#.. ",
" .#$&*&%#.#$***************$@*$.......+@&@@@$+..........#@***********@# .... ",
" .#$*****@@&**&@%%***********&&*%.....$@%#...............%************&#..#%%#. ",
" ..+#.#$***&&*****&%#+@**************&#....#.................#&*************$%$&**&#... ",
" ..#@*&&&**@+##%&**&+#@*****************@+....................#@&********************&%%@. ",
" .#+%@*&****$#. ..+$%##$*******************&&$%+###............#$&@***********&&**&$+%&***&. ",
" #$&*&%#%@&$#...##....+&**@%@***************@@@&&&@@$+#......#%@**@&*********&@@$%#...+@@%%. ",
" ..#++....#....%&&@%+%&**%#+&***********&%@*@##&&@&***&@%%%%$&****&$********@$@#... ..... ",
" .%*********@#$************&@+&&@$.&*+%****************&%@&**&@$@$#. ",
" .#&**&&****&#+&***&*******&+$&*$#$%&*$$*$&***&**********&@@@@$@&*@+###++#. ",
" ....#@**$##+$&$+.@**&+%&********&&*%.#@&&@@*@$*&&***************$+#@***&&&**$.. ",
" .#%%$&**%.. .....+**&#+&***********@+..#&%+*&$&&+%****************$.+*********%.... ",
" .#@*****@#..#+%+#+&**%#&***&*********&$+.+#.@$#+++&***@***$%@@&&&**&#.%@@@%+%&*&%%%$. ",
" ..#%*&@&&@#..#@**&&&**&#%***%%&**********&@+#.####+&****%***@+####+@*&+...#....#@*****. ",
" #$&*@#.###. .$********%.@**$#@**************&@@@&****&**%$****@$%#.#**$.. .#%%+%.. ",
" #%$%#. #&**@%%$@+.#&*&#$***$%&*****************&$**@#$******@#.&**$#..... .... ",
" ..... .+**$#......%**@#&**$+&**&@&**********&**@%***%#+$@&***%.@***&@@@%#. ",
" ...#@*@#...+%%$&**$#&*&#$**&%@**&$**&$&*&%**&#@***$+..+@**$.+&*******%. ",
" .#%$&**%..#$******&+#&*@.@**$+&**%@**$%**@+***++@****@#.#&*$..#%$$$@**@.. ",
" #@****@#..%****&&&+.#**@#&**+%**@+&**+%**&#@**@+#%&***@#.&*@........%&*%##. ",
" .+*&@@$+. .@**@+###..%**@.@**#%**@#&**++**&++&**&%##$***+.&**%.. ..$**&@+. ",
" ..+@&#.... .&*&#...#+$&**$.$**++**@#@**%.&**@#+&***$.#@*&+.@***$+#.. .#%$@&@# ",
" .$*&$. .#**%..#$*****&#.$**%#@*&+%**&#+&**@##@***#.$*&#.+&*****@+. ....+@% ",
" #++#.. ..$*&+..%***&@%+.#@**$.$**$.@**$.+&**$.#&**%.@*&#..+$@&***@. .## ",
" ..+$**&# .$**@#...+@***+.%**@.+***#.%**&#.@**##@**+. ...#+&*&# ",
" .$****$. .@**+..#@****$..$**@.#&**+.#**&##@*@..@**&+.. .#**+.. ",
" #&*@$+.. .$*@. .@***$#.#%&**%.#&**+.+**$.+**%..+&**&$+.. .@*&%+. ",
" .+*$#.. .@*@. .&**%..#@**&%##@**$.#@*&#.$**$. .+@&**&$. .+@&*&#. ",
" .#@*+. .#&*@. .&*&#..%**&+..$**$#.%**$..%**&#. ..+$**&# ..#%*%. ",
" #&&%. .#@**$. .@*&. .@**$. +**&#..@**%..#&**@#.. ..$**+ ..$@. ",
" #+#.. .+&**&+. .%*&. .$**+. +**@# .$**@#..+@**&%.. .#&*+. ..#. ",
" .$*@%#. .%*&# .+**%. #&*&#..+&*&+. .#%&**%. #&*$#. ",
" .@&#.. ..$**+ .&*$. .$**+. .+&*&+. ..%**$. .%&*@+. ",
" .#@&. ..%**&# .$*&#...@*&#. .+&*&#. .#&*%. ..#%*$. ",
" .$&$. .%**@+. .%**%. .+**$. .$**%. #&*+. ..@@. ",
" #@%#. .$*@#. ..@**+. #**&. .%**+. #&*%.. .+$# ",
" ##.. .%*+. .%**$. .+**$. .%*&# .%&&%. ... ",
" .+*%. #@*$.. .@*@#. .@*$. ..#&&# ",
" #@&+. .$*+. .@*%. .%&@#. .%&# ",
" +&%. .+*%. .$*%. ..%*$. .+@# ",
" ##.. .+*$. .#&&# .#@@. .#. ",
" .$&#. .$&# .@$. ",
" .$%. .@@. .%+. ",
" .#.. .%+. .... ",
" ... "};
typedef struct
{
GtkWidget *about_dialog;
GtkWidget *logo_area;
GdkPixmap *logo_pixmap;
GdkRectangle pixmaparea;
GdkRectangle textarea;
gdouble text_size;
gdouble min_text_size;
PangoLayout *layout;
PangoColor foreground;
PangoColor background;
gint timer;
gint index;
gboolean visible;
gint textrange[2];
gint state;
} GimpAboutInfo;
PangoColor gradient[] =
{
{ 31868, 33153, 32382 },
{ 10000, 10000, 10000 },
{ 65535, 65535, 65535 },
};
static GimpAboutInfo about_info = { 0 };
static gboolean about_dialog_load_logo (GtkWidget *window);
static void about_dialog_destroy (GtkObject *object,
gpointer data);
gpointer data);
static void about_dialog_unmap (GtkWidget *widget,
gpointer data);
static gint about_dialog_logo_expose (GtkWidget *widget,
GdkEventExpose *event,
gpointer data);
GdkEventExpose *event,
gpointer data);
static gint about_dialog_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
GdkEventButton *event,
gpointer data);
static gint about_dialog_key (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
static void about_dialog_tool_drop (GtkWidget *widget,
GimpViewable *viewable,
gpointer data);
GdkEventKey *event,
gpointer data);
static gboolean about_dialog_timer (gpointer data);
static gboolean double_speed = FALSE;
static GtkWidget *about_dialog = NULL;
static GtkWidget *logo_area = NULL;
static GtkWidget *scroll_area = NULL;
static GdkPixmap *logo_pixmap = NULL;
static GdkPixmap *scroll_pixmap = NULL;
static PangoLayout *scroll_layout = NULL;
static guchar *dissolve_map = NULL;
static gint dissolve_width;
static gint dissolve_height;
static gint logo_width = 0;
static gint logo_height = 0;
static gboolean do_animation = FALSE;
static gboolean do_scrolling = FALSE;
static gint scroll_state = 0;
static gint frame = 0;
static gint offset = 0;
static gint timer = 0;
static gint hadja_state = 0;
static PangoFontDescription *font_desc = NULL;
static gchar **scroll_text = authors;
static gint nscroll_texts = G_N_ELEMENTS (authors);
static gint scroll_text_widths[G_N_ELEMENTS (authors)];
static gint cur_scroll_text = 0;
static gint cur_scroll_index = 0;
static gint shuffle_array[G_N_ELEMENTS (authors)];
static gchar *drop_text[] =
{
"We are The GIMP." ,
"Prepare to be manipulated.",
"Resistance is futile."
};
static gchar *hadja_text[] =
{
"Hadjaha!",
"Nej!",
"Tvärtom!"
};
GtkWidget *
about_dialog_create (void)
{
GtkWidget *vbox;
GtkWidget *aboutframe;
GtkWidget *label;
GtkWidget *alignment;
gint max_width;
gint width;
gint height;
gint i;
gchar *label_text;
if (! about_dialog)
{
about_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint (GTK_WINDOW (about_dialog),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_role (GTK_WINDOW (about_dialog), "gimp-about");
gtk_window_set_title (GTK_WINDOW (about_dialog), _("About The GIMP"));
gtk_window_set_position (GTK_WINDOW (about_dialog), GTK_WIN_POS_CENTER);
gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE);
gimp_help_connect (about_dialog, gimp_standard_help_func,
GIMP_HELP_ABOUT_DIALOG, NULL);
g_signal_connect (about_dialog, "destroy",
G_CALLBACK (about_dialog_destroy),
NULL);
g_signal_connect (about_dialog, "unmap",
G_CALLBACK (about_dialog_unmap),
NULL);
g_signal_connect (about_dialog, "button_press_event",
G_CALLBACK (about_dialog_button),
NULL);
g_signal_connect (about_dialog, "key_press_event",
G_CALLBACK (about_dialog_key),
NULL);
/* dnd stuff */
gtk_drag_dest_set (about_dialog,
GTK_DEST_DEFAULT_MOTION |
GTK_DEST_DEFAULT_DROP,
NULL, 0,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_add (about_dialog,
GIMP_TYPE_TOOL_INFO,
about_dialog_tool_drop, NULL);
GdkModifierType mask;
gtk_widget_set_events (about_dialog, GDK_BUTTON_PRESS_MASK);
if (! about_dialog_load_logo (about_dialog))
{
gtk_widget_destroy (about_dialog);
about_dialog = NULL;
if (! about_info.about_dialog)
{
GtkWidget *widget;
about_info.textarea.x = 0;
about_info.textarea.y = 265;
about_info.textarea.width = 300;
about_info.textarea.height = 60;
about_info.foreground.red = 65535;
about_info.foreground.green = 65535;
about_info.foreground.blue = 65535;
about_info.background.red = 31868;
about_info.background.green = 33153;
about_info.background.blue = 32382;
about_info.visible = FALSE;
about_info.state = 0;
widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
about_info.about_dialog = widget;
gtk_window_set_type_hint (GTK_WINDOW (widget),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_wmclass (GTK_WINDOW (widget), "about_dialog", "Gimp");
gtk_window_set_title (GTK_WINDOW (widget), _("About The GIMP"));
gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_CENTER);
/* The window must not be resizeable, since otherwise
* the copying of nonexisting parts of the image pixmap
* would result in an endless loop due to the X-Server
* generating expose events on the pixmap. */
gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
g_signal_connect (widget, "destroy",
G_CALLBACK (about_dialog_destroy),
NULL);
g_signal_connect (widget, "unmap",
G_CALLBACK (about_dialog_unmap),
NULL);
g_signal_connect (widget, "button_press_event",
G_CALLBACK (about_dialog_button),
NULL);
g_signal_connect (widget, "key_press_event",
G_CALLBACK (about_dialog_key),
NULL);
gtk_widget_set_events (widget, GDK_BUTTON_PRESS_MASK);
if (! about_dialog_load_logo (widget))
{
gtk_widget_destroy (widget);
about_info.about_dialog = NULL;
return NULL;
}
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 1);
gtk_container_add (GTK_CONTAINER (about_dialog), vbox);
gtk_widget_show (vbox);
aboutframe = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
gtk_container_set_border_width (GTK_CONTAINER (aboutframe), 0);
gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0);
gtk_widget_show (aboutframe);
widget = gtk_drawing_area_new ();
about_info.logo_area = widget;
logo_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (logo_area, logo_width, logo_height);
gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK);
gtk_container_add (GTK_CONTAINER (aboutframe), logo_area);
gtk_widget_show (logo_area);
gtk_widget_set_size_request (widget,
about_info.pixmaparea.width,
about_info.pixmaparea.height);
gtk_widget_set_events (widget, GDK_EXPOSURE_MASK);
gtk_container_add (GTK_CONTAINER (about_info.about_dialog),
widget);
gtk_widget_show (widget);
g_signal_connect (logo_area, "expose_event",
g_signal_connect (widget, "expose_event",
G_CALLBACK (about_dialog_logo_expose),
NULL);
gtk_widget_realize (logo_area);
gdk_window_set_background (logo_area->window, &logo_area->style->black);
label_text = g_strdup_printf (_("Version %s brought to you by"),
GIMP_VERSION);
label = gtk_label_new (label_text);
g_free (label_text);
label_text = NULL;
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
label = gtk_label_new ("Spencer Kimball & Peter Mattis");
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0);
gtk_widget_show (alignment);
aboutframe = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN);
gtk_container_set_border_width (GTK_CONTAINER (aboutframe), 0);
gtk_container_add (GTK_CONTAINER (alignment), aboutframe);
gtk_widget_show (aboutframe);
scroll_layout = gtk_widget_create_pango_layout (aboutframe, NULL);
g_object_weak_ref (G_OBJECT (aboutframe),
(GWeakNotify) g_object_unref, scroll_layout);
max_width = 0;
for (i = 0; i < nscroll_texts; i++)
{
pango_layout_set_text (scroll_layout, scroll_text[i], -1);
pango_layout_get_pixel_size (scroll_layout,
&scroll_text_widths[i], &height);
max_width = MAX (max_width, scroll_text_widths[i]);
}
for (i = 0; i < (sizeof (drop_text) / sizeof (drop_text[0])); i++)
{
pango_layout_set_text (scroll_layout, drop_text[i], -1);
pango_layout_get_pixel_size (scroll_layout, &width, NULL);
max_width = MAX (max_width, width);
}
for (i = 0; i < (sizeof (hadja_text) / sizeof (hadja_text[0])); i++)
{
pango_layout_set_text (scroll_layout, hadja_text[i], -1);
pango_layout_get_pixel_size (scroll_layout, &width, NULL);
max_width = MAX (max_width, width);
}
scroll_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (scroll_area, max_width + 6, height + 1);
gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK);
gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area);
gtk_widget_show (scroll_area);
label =
gtk_label_new (_("Visit http://www.gimp.org/ for more information"));
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
gtk_widget_realize (scroll_area);
gdk_window_set_background (scroll_area->window,
&scroll_area->style->white);
gtk_widget_realize (widget);
gdk_window_set_background (widget->window,
&(widget->style)->black);
about_info.layout = gtk_widget_create_pango_layout (about_info.logo_area, NULL);
g_object_weak_ref (G_OBJECT (about_info.logo_area),
(GWeakNotify) g_object_unref, about_info.layout);
font_desc = pango_font_description_from_string ("Bitstream Vera Sans,"
"Trebuchet MS,"
"Helvetica,"
"Sans,"
"Bold 13");
pango_layout_set_font_description (about_info.layout, font_desc);
pango_layout_set_justify (about_info.layout, PANGO_ALIGN_CENTER);
}
if (! GTK_WIDGET_VISIBLE (about_dialog))
/* for future enhancements */
gdk_window_get_pointer (NULL, NULL, NULL, &mask);
if (! GTK_WIDGET_VISIBLE (about_info.about_dialog))
{
do_animation = TRUE;
do_scrolling = FALSE;
scroll_state = 0;
frame = 0;
offset = 0;
cur_scroll_text = 0;
if (! double_speed && hadja_state != 7)
if (! double_speed)
{
GRand *gr = g_rand_new ();
gint i;
for (i = 0; i < nscroll_texts; i++)
for (i = 0; i < nscroll_texts; i++)
{
shuffle_array[i] = i;
}
for (i = 0; i < nscroll_texts; i++)
for (i = 0; i < nscroll_texts; i++)
{
gint j;
j = g_rand_int_range (gr, 0, nscroll_texts);
if (i != j)
if (i != j)
{
gint t;
......@@ -394,17 +238,15 @@ about_dialog_create (void)
}
}
cur_scroll_text = g_rand_int_range (gr, 0, nscroll_texts);
pango_layout_set_text (scroll_layout,
scroll_text[cur_scroll_text], -1);
pango_layout_set_text (about_info.layout, "", -1);
g_rand_free (gr);
}
}
gtk_window_present (GTK_WINDOW (about_dialog));
gtk_window_present (GTK_WINDOW (about_info.about_dialog));
return about_dialog;
return about_info.about_dialog;
}
static gboolean
......@@ -413,58 +255,43 @@ about_dialog_load_logo (GtkWidget *window)
gchar *filename;
GdkPixbuf *pixbuf;
GdkGC *gc;
gint i, j, k;
GRand *gr;
if (logo_pixmap)
if (about_info.logo_pixmap)
return TRUE;
filename = g_build_filename (gimp_data_directory (), "images",
"gimp_logo.png", NULL);
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
if (! pixbuf)
return FALSE;
logo_width = gdk_pixbuf_get_width (pixbuf);
logo_height = gdk_pixbuf_get_height (pixbuf);
about_info.pixmaparea.x = 0;
about_info.pixmaparea.y = 0;
about_info.pixmaparea.width = gdk_pixbuf_get_width (pixbuf);
about_info.pixmaparea.height = gdk_pixbuf_get_height (pixbuf);
gtk_widget_realize (window);
logo_pixmap = gdk_pixmap_new (window->window,
logo_width, logo_height,
about_info.logo_pixmap = gdk_pixmap_new (window->window,
about_info.pixmaparea.width,
about_info.pixmaparea.height,
gtk_widget_get_visual (window)->depth);
gc = gdk_gc_new (logo_pixmap);
gc = gdk_gc_new (about_info.logo_pixmap);
gdk_draw_pixbuf (GDK_DRAWABLE (logo_pixmap), gc, pixbuf,
0, 0, 0, 0, logo_width, logo_height,
gdk_draw_pixbuf (GDK_DRAWABLE (about_info.logo_pixmap),
gc, pixbuf,
0, 0, 0, 0,
about_info.pixmaparea.width,
about_info.pixmaparea.height,
GDK_RGB_DITHER_NORMAL, 0, 0);
g_object_unref (gc);
g_object_unref (pixbuf);
dissolve_width =
(logo_width / ANIMATION_SIZE) +
(logo_width % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_height =
(logo_height / ANIMATION_SIZE) +
(logo_height % ANIMATION_SIZE == 0 ? 0 : 1);
dissolve_map = g_new (guchar, dissolve_width * dissolve_height);
gr = g_rand_new ();
for (i = 0, k = 0; i < dissolve_height; i++)
for (j = 0; j < dissolve_width; j++, k++)
dissolve_map[k] = g_rand_int_range (gr, 0, ANIMATION_STEPS);
g_rand_free (gr);
return TRUE;
}
......@@ -472,7 +299,7 @@ static void
about_dialog_destroy (GtkObject *object,
gpointer data)
{
about_dialog = NULL;
about_info.about_dialog = NULL;
about_dialog_unmap (NULL, NULL);
}
......@@ -480,10 +307,10 @@ static void
about_dialog_unmap (GtkWidget *widget,
gpointer data)
{
if (timer)
if (about_info.timer)
{
g_source_remove (timer);
timer = 0;
g_source_remove (about_info.timer);
about_info.timer = 0;
}