1998-05-03 05:50:29 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#include <string.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <time.h>
|
1998-07-15 10:28:31 +08:00
|
|
|
|
1998-05-03 05:50:29 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-08-24 08:33:11 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
1998-07-15 10:28:31 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-02-21 20:18:09 +08:00
|
|
|
|
2003-08-21 23:54:47 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2001-05-09 03:29:15 +08:00
|
|
|
#include "widgets/gimpdnd.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "about-dialog.h"
|
2001-06-05 08:22:25 +08:00
|
|
|
#include "authors.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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")
|
|
|
|
};
|
1998-05-03 05:50:29 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GtkWidget *about_dialog;
|
|
|
|
GtkWidget *logo_area;
|
|
|
|
GdkPixmap *logo_pixmap;
|
|
|
|
GdkRectangle pixmaparea;
|
2003-05-22 01:38:14 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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 };
|
2003-05-22 01:38:14 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
static gboolean about_dialog_load_logo (GtkWidget *window);
|
|
|
|
static void about_dialog_destroy (GtkObject *object,
|
2003-12-29 10:57:07 +08:00
|
|
|
gpointer data);
|
2000-07-16 20:49:04 +08:00
|
|
|
static void about_dialog_unmap (GtkWidget *widget,
|
2001-12-18 07:41:01 +08:00
|
|
|
gpointer data);
|
2000-07-16 20:49:04 +08:00
|
|
|
static gint about_dialog_logo_expose (GtkWidget *widget,
|
2003-12-29 10:57:07 +08:00
|
|
|
GdkEventExpose *event,
|
|
|
|
gpointer data);
|
2000-07-16 20:49:04 +08:00
|
|
|
static gint about_dialog_button (GtkWidget *widget,
|
2003-12-29 10:57:07 +08:00
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data);
|
2000-08-24 08:33:11 +08:00
|
|
|
static gint about_dialog_key (GtkWidget *widget,
|
2003-12-29 10:57:07 +08:00
|
|
|
GdkEventKey *event,
|
|
|
|
gpointer data);
|
2001-09-20 03:06:36 +08:00
|
|
|
static gboolean about_dialog_timer (gpointer data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2003-05-22 01:38:14 +08:00
|
|
|
static gboolean double_speed = FALSE;
|
2001-10-25 21:30:01 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
static PangoFontDescription *font_desc = NULL;
|
2001-09-03 21:13:48 +08:00
|
|
|
static gchar **scroll_text = authors;
|
|
|
|
static gint nscroll_texts = G_N_ELEMENTS (authors);
|
|
|
|
static gint shuffle_array[G_N_ELEMENTS (authors)];
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2001-10-25 21:30:01 +08:00
|
|
|
|
2001-04-19 00:39:34 +08:00
|
|
|
GtkWidget *
|
2000-07-16 20:49:04 +08:00
|
|
|
about_dialog_create (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
GdkModifierType mask;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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;
|
2001-04-19 00:39:34 +08:00
|
|
|
return NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
widget = gtk_drawing_area_new ();
|
|
|
|
about_info.logo_area = widget;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
g_signal_connect (widget, "expose_event",
|
2001-08-15 00:33:28 +08:00
|
|
|
G_CALLBACK (about_dialog_logo_expose),
|
|
|
|
NULL);
|
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
/* for future enhancements */
|
|
|
|
gdk_window_get_pointer (NULL, NULL, NULL, &mask);
|
|
|
|
|
|
|
|
if (! GTK_WIDGET_VISIBLE (about_info.about_dialog))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
if (! double_speed)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-26 22:27:53 +08:00
|
|
|
GRand *gr = g_rand_new ();
|
2003-12-29 10:57:07 +08:00
|
|
|
gint i;
|
2003-01-26 22:27:53 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
for (i = 0; i < nscroll_texts; i++)
|
2000-07-19 16:42:39 +08:00
|
|
|
{
|
|
|
|
shuffle_array[i] = i;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
for (i = 0; i < nscroll_texts; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-07-19 16:42:39 +08:00
|
|
|
gint j;
|
|
|
|
|
configure.in app/core/gimpbrushpipe.c app/gui/about-dialog.c
2002-11-20 Dave Neary <bolsh@gimp.org>
* configure.in
* app/core/gimpbrushpipe.c
* app/gui/about-dialog.c
* app/paint-funcs/paint-funcs-generic.h
* app/paint-funcs/paint-funcs.c
* libgimpmath/gimpmath.h
* libgimpwidgets/gimpwidgets.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/blur.c
* plug-ins/common/cubism.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/gqbist.c
* plug-ins/common/jigsaw.c
* plug-ins/common/lic.c
* plug-ins/common/noisify.c
* plug-ins/common/nova.c
* plug-ins/common/papertile.c
* plug-ins/common/plasma.c
* plug-ins/common/randomize.c
* plug-ins/common/sample_colorize.c
* plug-ins/common/scatter_hsv.c
* plug-ins/common/shift.c
* plug-ins/common/sinus.c
* plug-ins/common/smooth_palette.c
* plug-ins/common/snoise.c
* plug-ins/common/sparkle.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/spread.c
* plug-ins/common/warp.c
* plug-ins/common/wind.c
* plug-ins/flame/cmap.c
* plug-ins/flame/flame.c
* plug-ins/flame/libifs.c
* plug-ins/gflare/gflare.c
* plug-ins/gimpressionist/gimpressionist.c
* plug-ins/gimpressionist/gimpressionist.h
* plug-ins/gimpressionist/plasma.c
* plug-ins/gimpressionist/repaint.c
* plug-ins/ifscompose/ifscompose_utils.c
* plug-ins/maze/algorithms.c
* plug-ins/maze/maze.c
* plug-ins/maze/maze.h
* plug-ins/mosaic/mosaic.c: Change all occurrences of RAND_MAX,
G_MAXRAND, rand(), srand(), lrand48(), srand48(), random(),
srandom(), RAND_FUNC and SRAND_FUNC to the appropriate g_rand*
equivalent. Programs which require seed setting for reproducible
results, and anything in the core, gets a dedicated GRand * for
the lifetime required. Programs which only ever used random
numbers for tossing a coin, rolling a dice, etc use g_random
functions. For the rest, judgement was used. Where it was easy, a
GRand * object was used and g_rand_* functions were
preferred. This fixes bug #67386 in HEAD.
2002-11-20 17:27:48 +08:00
|
|
|
j = g_rand_int_range (gr, 0, nscroll_texts);
|
2003-12-29 10:57:07 +08:00
|
|
|
if (i != j)
|
2000-07-19 16:42:39 +08:00
|
|
|
{
|
|
|
|
gint t;
|
|
|
|
|
|
|
|
t = shuffle_array[j];
|
|
|
|
shuffle_array[j] = shuffle_array[i];
|
|
|
|
shuffle_array[i] = t;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2003-01-26 22:27:53 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
pango_layout_set_text (about_info.layout, "", -1);
|
2001-09-03 21:13:48 +08:00
|
|
|
|
2003-01-26 22:27:53 +08:00
|
|
|
g_rand_free (gr);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
2002-10-25 09:11:24 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
gtk_window_present (GTK_WINDOW (about_info.about_dialog));
|
2001-04-19 00:39:34 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
return about_info.about_dialog;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
static gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
about_dialog_load_logo (GtkWidget *window)
|
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
gchar *filename;
|
2001-12-18 07:41:01 +08:00
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GdkGC *gc;
|
configure.in app/core/gimpbrushpipe.c app/gui/about-dialog.c
2002-11-20 Dave Neary <bolsh@gimp.org>
* configure.in
* app/core/gimpbrushpipe.c
* app/gui/about-dialog.c
* app/paint-funcs/paint-funcs-generic.h
* app/paint-funcs/paint-funcs.c
* libgimpmath/gimpmath.h
* libgimpwidgets/gimpwidgets.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/blur.c
* plug-ins/common/cubism.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/gqbist.c
* plug-ins/common/jigsaw.c
* plug-ins/common/lic.c
* plug-ins/common/noisify.c
* plug-ins/common/nova.c
* plug-ins/common/papertile.c
* plug-ins/common/plasma.c
* plug-ins/common/randomize.c
* plug-ins/common/sample_colorize.c
* plug-ins/common/scatter_hsv.c
* plug-ins/common/shift.c
* plug-ins/common/sinus.c
* plug-ins/common/smooth_palette.c
* plug-ins/common/snoise.c
* plug-ins/common/sparkle.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/spread.c
* plug-ins/common/warp.c
* plug-ins/common/wind.c
* plug-ins/flame/cmap.c
* plug-ins/flame/flame.c
* plug-ins/flame/libifs.c
* plug-ins/gflare/gflare.c
* plug-ins/gimpressionist/gimpressionist.c
* plug-ins/gimpressionist/gimpressionist.h
* plug-ins/gimpressionist/plasma.c
* plug-ins/gimpressionist/repaint.c
* plug-ins/ifscompose/ifscompose_utils.c
* plug-ins/maze/algorithms.c
* plug-ins/maze/maze.c
* plug-ins/maze/maze.h
* plug-ins/mosaic/mosaic.c: Change all occurrences of RAND_MAX,
G_MAXRAND, rand(), srand(), lrand48(), srand48(), random(),
srandom(), RAND_FUNC and SRAND_FUNC to the appropriate g_rand*
equivalent. Programs which require seed setting for reproducible
results, and anything in the core, gets a dedicated GRand * for
the lifetime required. Programs which only ever used random
numbers for tossing a coin, rolling a dice, etc use g_random
functions. For the rest, judgement was used. Where it was easy, a
GRand * object was used and g_rand_* functions were
preferred. This fixes bug #67386 in HEAD.
2002-11-20 17:27:48 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (about_info.logo_pixmap)
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
|
2001-11-15 02:44:55 +08:00
|
|
|
filename = g_build_filename (gimp_data_directory (), "images",
|
2001-12-18 07:41:01 +08:00
|
|
|
"gimp_logo.png", NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-18 07:41:01 +08:00
|
|
|
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
|
|
|
|
g_free (filename);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-18 07:41:01 +08:00
|
|
|
if (! pixbuf)
|
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
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);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-12-18 07:41:01 +08:00
|
|
|
gtk_widget_realize (window);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
about_info.logo_pixmap = gdk_pixmap_new (window->window,
|
|
|
|
about_info.pixmaparea.width,
|
|
|
|
about_info.pixmaparea.height,
|
2001-12-18 07:41:01 +08:00
|
|
|
gtk_widget_get_visual (window)->depth);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
gc = gdk_gc_new (about_info.logo_pixmap);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
gdk_draw_pixbuf (GDK_DRAWABLE (about_info.logo_pixmap),
|
|
|
|
gc, pixbuf,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
about_info.pixmaparea.width,
|
|
|
|
about_info.pixmaparea.height,
|
2003-02-22 09:33:42 +08:00
|
|
|
GDK_RGB_DITHER_NORMAL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (gc);
|
|
|
|
g_object_unref (pixbuf);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-07-16 20:49:04 +08:00
|
|
|
about_dialog_destroy (GtkObject *object,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
about_info.about_dialog = NULL;
|
2001-12-18 07:41:01 +08:00
|
|
|
about_dialog_unmap (NULL, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-07-16 20:49:04 +08:00
|
|
|
about_dialog_unmap (GtkWidget *widget,
|
2001-12-18 07:41:01 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
if (about_info.timer)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
g_source_remove (about_info.timer);
|
|
|
|
about_info.timer = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
static gint
|
1997-11-25 06:05:25 +08:00
|
|
|
about_dialog_logo_expose (GtkWidget *widget,
|
2000-07-16 20:49:04 +08:00
|
|
|
GdkEventExpose *event,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
gint width, height;
|
|
|
|
|
|
|
|
if (!about_info.timer)
|
|
|
|
about_info.timer = g_timeout_add (30, about_dialog_timer, NULL);
|
|
|
|
|
|
|
|
/* only operate on the region covered by the pixmap */
|
|
|
|
if (! gdk_rectangle_intersect (&(about_info.pixmaparea),
|
|
|
|
&(event->area),
|
|
|
|
&(event->area)))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gdk_gc_set_clip_rectangle (widget->style->black_gc, &(event->area));
|
|
|
|
|
|
|
|
gdk_draw_drawable (widget->window,
|
|
|
|
widget->style->white_gc,
|
|
|
|
about_info.logo_pixmap,
|
|
|
|
event->area.x, event->area.y,
|
|
|
|
event->area.x, event->area.y,
|
|
|
|
event->area.width, event->area.height);
|
|
|
|
|
|
|
|
if (about_info.visible == TRUE)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
gint layout_x, layout_y;
|
|
|
|
|
|
|
|
pango_layout_get_pixel_size (about_info.layout, &width, &height);
|
|
|
|
|
|
|
|
layout_x = about_info.textarea.x +
|
|
|
|
(about_info.textarea.width - width) / 2;
|
|
|
|
layout_y = about_info.textarea.y +
|
|
|
|
(about_info.textarea.height - height) / 2;
|
|
|
|
|
|
|
|
if (about_info.textrange[1] > 0)
|
|
|
|
{
|
|
|
|
GdkRegion *covered_region = NULL;
|
|
|
|
GdkRegion *rect_region;
|
|
|
|
|
|
|
|
covered_region = gdk_pango_layout_get_clip_region
|
|
|
|
(about_info.layout,
|
|
|
|
layout_x, layout_y,
|
|
|
|
about_info.textrange, 1);
|
|
|
|
|
|
|
|
rect_region = gdk_region_rectangle (&(event->area));
|
|
|
|
|
|
|
|
gdk_region_intersect (covered_region, rect_region);
|
|
|
|
gdk_region_destroy (rect_region);
|
|
|
|
|
|
|
|
gdk_gc_set_clip_region (about_info.logo_area->style->text_gc[GTK_STATE_NORMAL],
|
|
|
|
covered_region);
|
|
|
|
gdk_region_destroy (covered_region);
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_draw_layout (widget->window,
|
|
|
|
widget->style->text_gc[GTK_STATE_NORMAL],
|
|
|
|
layout_x, layout_y,
|
|
|
|
about_info.layout);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
gdk_gc_set_clip_rectangle (widget->style->black_gc, NULL);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
static gint
|
1997-11-25 06:05:25 +08:00
|
|
|
about_dialog_button (GtkWidget *widget,
|
2000-07-16 20:49:04 +08:00
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
gtk_widget_hide (about_info.about_dialog);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-08-24 08:33:11 +08:00
|
|
|
static gint
|
|
|
|
about_dialog_key (GtkWidget *widget,
|
|
|
|
GdkEventKey *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
/* placeholder */
|
2000-08-24 08:33:11 +08:00
|
|
|
switch (event->keyval)
|
|
|
|
{
|
|
|
|
case GDK_a:
|
|
|
|
case GDK_A:
|
2003-12-29 10:57:07 +08:00
|
|
|
case GDK_b:
|
|
|
|
case GDK_B:
|
2000-08-24 08:33:11 +08:00
|
|
|
default:
|
2003-12-29 10:57:07 +08:00
|
|
|
break;
|
2000-08-24 08:33:11 +08:00
|
|
|
}
|
2003-12-29 10:57:07 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
|
|
|
insert_spacers (const gchar *string)
|
|
|
|
{
|
|
|
|
gchar *normalized, *ptr;
|
|
|
|
gunichar unichr;
|
|
|
|
GString *str;
|
|
|
|
|
|
|
|
str = g_string_new (NULL);
|
2000-08-24 08:33:11 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
normalized = g_utf8_normalize (string, -1, G_NORMALIZE_DEFAULT_COMPOSE);
|
|
|
|
ptr = normalized;
|
|
|
|
|
|
|
|
while ((unichr = g_utf8_get_char (ptr)))
|
2000-08-24 08:33:11 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
g_string_append_unichar (str, unichr);
|
|
|
|
g_string_append_unichar (str, 0x200b); /* ZERO WIDTH SPACE */
|
|
|
|
ptr = g_utf8_next_char (ptr);
|
|
|
|
}
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
g_free (normalized);
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
return g_string_free (str, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mix_gradient (PangoColor *gradient, guint ncolors,
|
|
|
|
PangoColor *target, gdouble pos)
|
|
|
|
{
|
|
|
|
gint index;
|
|
|
|
|
|
|
|
g_return_if_fail (gradient != NULL);
|
|
|
|
g_return_if_fail (ncolors > 1);
|
|
|
|
g_return_if_fail (target != NULL);
|
|
|
|
g_return_if_fail (pos >= 0.0 && pos <= 1.0);
|
|
|
|
|
|
|
|
if (pos == 1.0)
|
|
|
|
{
|
|
|
|
target->red = gradient[ncolors-1].red;
|
|
|
|
target->green = gradient[ncolors-1].green;
|
|
|
|
target->blue = gradient[ncolors-1].blue;
|
|
|
|
return;
|
2000-08-24 08:33:11 +08:00
|
|
|
}
|
2003-12-29 10:57:07 +08:00
|
|
|
|
|
|
|
index = (int) floor (pos * (ncolors-1));
|
|
|
|
pos = pos * (ncolors - 1) - index;
|
|
|
|
|
|
|
|
target->red = gradient[index].red * (1.0 - pos) + gradient[index+1].red * pos;
|
|
|
|
target->green = gradient[index].green * (1.0 - pos) + gradient[index+1].green * pos;
|
|
|
|
target->blue = gradient[index].blue * (1.0 - pos) + gradient[index+1].blue * pos;
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2000-08-24 08:33:11 +08:00
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
static void
|
2003-12-29 10:57:07 +08:00
|
|
|
mix_colors (PangoColor *start, PangoColor *end,
|
|
|
|
PangoColor *target,
|
|
|
|
gdouble pos)
|
2000-07-16 20:49:04 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
g_return_if_fail (start != NULL);
|
|
|
|
g_return_if_fail (end != NULL);
|
|
|
|
g_return_if_fail (target != NULL);
|
|
|
|
g_return_if_fail (pos >= 0.0 && pos <= 1.0);
|
|
|
|
|
|
|
|
target->red = start->red * (1.0 - pos) + end->red * pos;
|
|
|
|
target->green = start->green * (1.0 - pos) + end->green * pos;
|
|
|
|
target->blue = start->blue * (1.0 - pos) + end->blue * pos;
|
|
|
|
}
|
2001-09-20 03:06:36 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
static void
|
|
|
|
decorate_text (PangoLayout *layout, gint anim_type, gdouble time)
|
|
|
|
{
|
|
|
|
gint letter_count = 0;
|
|
|
|
gint text_length = 0;
|
|
|
|
gint text_bytelen = 0;
|
|
|
|
gint cluster_start, cluster_end;
|
|
|
|
const gchar *text;
|
|
|
|
const gchar *ptr;
|
|
|
|
gunichar unichr;
|
|
|
|
PangoAttrList *attrlist = NULL;
|
|
|
|
PangoAttribute *attr;
|
|
|
|
PangoRectangle irect = {0, 0, 0, 0};
|
|
|
|
PangoRectangle lrect = {0, 0, 0, 0};
|
|
|
|
PangoColor mix;
|
|
|
|
|
|
|
|
mix_colors (&(about_info.background),
|
|
|
|
&(about_info.foreground),
|
|
|
|
&mix, time);
|
|
|
|
|
|
|
|
text = pango_layout_get_text (layout);
|
|
|
|
text_length = g_utf8_strlen (text, -1);
|
|
|
|
text_bytelen = strlen (text);
|
|
|
|
|
|
|
|
attrlist = pango_attr_list_new ();
|
|
|
|
|
|
|
|
about_info.textrange[0] = 0;
|
|
|
|
about_info.textrange[1] = text_bytelen;
|
|
|
|
|
|
|
|
switch (anim_type)
|
|
|
|
{
|
|
|
|
case 0: /* Fade in */
|
|
|
|
attr = pango_attr_foreground_new (mix.red, mix.green, mix.blue);
|
|
|
|
attr->start_index = 0;
|
|
|
|
attr->end_index = text_bytelen;
|
|
|
|
pango_attr_list_insert (attrlist, attr);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: /* Fade in, spread */
|
|
|
|
attr = pango_attr_foreground_new (mix.red, mix.green, mix.blue);
|
|
|
|
attr->start_index = 0;
|
|
|
|
attr->end_index = text_bytelen;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
|
|
|
|
|
|
|
ptr = text;
|
|
|
|
|
|
|
|
cluster_start = 0;
|
|
|
|
while ((unichr = g_utf8_get_char (ptr)))
|
|
|
|
{
|
|
|
|
ptr = g_utf8_next_char (ptr);
|
|
|
|
cluster_end = (ptr - text);
|
|
|
|
|
|
|
|
if (unichr == 0x200b)
|
|
|
|
{
|
|
|
|
lrect.width = (1.0 - time) * 15.0 * PANGO_SCALE + 0.5;
|
|
|
|
attr = pango_attr_shape_new (&irect, &lrect);
|
|
|
|
attr->start_index = cluster_start;
|
|
|
|
attr->end_index = cluster_end;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
|
|
|
}
|
|
|
|
cluster_start = cluster_end;
|
|
|
|
}
|
|
|
|
break;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
case 2: /* Fade in, sinewave */
|
|
|
|
attr = pango_attr_foreground_new (mix.red, mix.green, mix.blue);
|
|
|
|
attr->start_index = 0;
|
|
|
|
attr->end_index = text_bytelen;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
|
|
|
|
|
|
|
ptr = text;
|
|
|
|
|
|
|
|
cluster_start = 0;
|
|
|
|
while ((unichr = g_utf8_get_char (ptr)))
|
|
|
|
{
|
|
|
|
if (unichr == 0x200b)
|
|
|
|
{
|
|
|
|
cluster_end = ptr - text;
|
|
|
|
attr = pango_attr_rise_new ((1.0 -time) * 18000 *
|
|
|
|
sin (4.0 * time +
|
|
|
|
(float) letter_count * 0.7));
|
|
|
|
attr->start_index = cluster_start;
|
|
|
|
attr->end_index = cluster_end;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
|
|
|
|
|
|
|
letter_count++;
|
|
|
|
cluster_start = cluster_end;
|
|
|
|
}
|
|
|
|
|
|
|
|
ptr = g_utf8_next_char (ptr);
|
|
|
|
}
|
|
|
|
break;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
case 3: /* letterwise Fade in */
|
|
|
|
ptr = text;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
letter_count = 0;
|
|
|
|
cluster_start = 0;
|
|
|
|
while ((unichr = g_utf8_get_char (ptr)))
|
|
|
|
{
|
|
|
|
gint border;
|
|
|
|
gdouble pos;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
border = (text_length + 15) * time - 15;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (letter_count < border)
|
|
|
|
pos = 0;
|
|
|
|
else if (letter_count > border + 15)
|
|
|
|
pos = 1;
|
|
|
|
else
|
|
|
|
pos = ((gdouble) (letter_count - border)) / 15;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
mix_colors (&(about_info.foreground),
|
|
|
|
&(about_info.background),
|
|
|
|
&mix, pos);
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
ptr = g_utf8_next_char (ptr);
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
cluster_end = ptr - text;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
attr = pango_attr_foreground_new (mix.red, mix.green, mix.blue);
|
|
|
|
attr->start_index = cluster_start;
|
|
|
|
attr->end_index = cluster_end;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (pos < 1.0)
|
|
|
|
about_info.textrange[1] = cluster_end;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
letter_count++;
|
|
|
|
cluster_start = cluster_end;
|
|
|
|
}
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
break;
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
case 4: /* letterwise Fade in, triangular */
|
|
|
|
ptr = text;
|
2000-07-19 16:42:39 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
letter_count = 0;
|
|
|
|
cluster_start = 0;
|
|
|
|
while ((unichr = g_utf8_get_char (ptr)))
|
|
|
|
{
|
|
|
|
gint border;
|
|
|
|
gdouble pos;
|
|
|
|
|
|
|
|
border = (text_length + 15) * time - 15;
|
|
|
|
|
|
|
|
if (letter_count < border)
|
|
|
|
pos = 1.0;
|
|
|
|
else if (letter_count > border + 15)
|
|
|
|
pos = 0.0;
|
|
|
|
else
|
|
|
|
pos = 1.0 - ((gdouble) (letter_count - border)) / 15;
|
|
|
|
|
|
|
|
mix_gradient (gradient, G_N_ELEMENTS (gradient), &mix, pos);
|
|
|
|
|
|
|
|
ptr = g_utf8_next_char (ptr);
|
|
|
|
|
|
|
|
cluster_end = ptr - text;
|
|
|
|
|
|
|
|
attr = pango_attr_foreground_new (mix.red, mix.green, mix.blue);
|
|
|
|
attr->start_index = cluster_start;
|
|
|
|
attr->end_index = cluster_end;
|
|
|
|
pango_attr_list_change (attrlist, attr);
|
|
|
|
|
|
|
|
if (pos > 0.0)
|
|
|
|
about_info.textrange[1] = cluster_end;
|
2000-07-19 16:42:39 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
letter_count++;
|
|
|
|
cluster_start = cluster_end;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_printerr ("Unknown animation type %d\n", anim_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pango_layout_set_attributes (layout, attrlist);
|
|
|
|
pango_attr_list_unref (attrlist);
|
2000-07-19 16:42:39 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
}
|
|
|
|
|
2001-09-20 03:06:36 +08:00
|
|
|
static gboolean
|
1997-11-25 06:05:25 +08:00
|
|
|
about_dialog_timer (gpointer data)
|
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
static gint count = -1;
|
|
|
|
gboolean return_val;
|
|
|
|
gint width, height;
|
|
|
|
gdouble size;
|
|
|
|
gchar *text;
|
1997-11-25 06:05:25 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (count == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-29 10:57:07 +08:00
|
|
|
size = 13.0;
|
|
|
|
text = NULL;
|
|
|
|
if (about_info.state == 0)
|
|
|
|
{
|
|
|
|
about_info.visible = TRUE;
|
|
|
|
if (about_info.index >= G_N_ELEMENTS (founders))
|
|
|
|
{
|
|
|
|
about_info.index = 0;
|
|
|
|
about_info.state++;
|
|
|
|
|
|
|
|
/* skip the translators section when the translator
|
|
|
|
* did not provide a translation with his name
|
|
|
|
*/
|
|
|
|
if (gettext (translators[1]) == translators[1])
|
|
|
|
about_info.index = G_N_ELEMENTS (translators) - 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (about_info.index == 0)
|
|
|
|
{
|
|
|
|
gchar *tmp;
|
|
|
|
tmp = g_strdup_printf (gettext (founders[0]), GIMP_VERSION);
|
|
|
|
text = insert_spacers (tmp);
|
|
|
|
g_free (tmp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
text = insert_spacers (gettext (founders[about_info.index]));
|
|
|
|
}
|
|
|
|
about_info.index++;
|
|
|
|
}
|
|
|
|
}
|
1997-12-08 18:36:19 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (about_info.state == 1)
|
|
|
|
{
|
|
|
|
about_info.visible = TRUE;
|
|
|
|
if (about_info.index >= G_N_ELEMENTS (translators))
|
|
|
|
{
|
|
|
|
about_info.index = 0;
|
|
|
|
about_info.state++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
text = insert_spacers (gettext (translators[about_info.index]));
|
|
|
|
about_info.index++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (about_info.state == 2)
|
|
|
|
{
|
|
|
|
about_info.visible = TRUE;
|
|
|
|
|
|
|
|
about_info.index += 1;
|
|
|
|
if (about_info.index == nscroll_texts)
|
|
|
|
about_info.index = 0;
|
|
|
|
|
|
|
|
text = insert_spacers (scroll_text[shuffle_array[about_info.index]]);
|
|
|
|
}
|
1997-12-08 18:36:19 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (text == NULL)
|
|
|
|
{
|
|
|
|
g_printerr ("TEXT == NULL\n");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
pango_layout_set_text (about_info.layout, text, -1);
|
|
|
|
pango_layout_set_attributes (about_info.layout, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
pango_font_description_set_size (font_desc, size * PANGO_SCALE);
|
|
|
|
pango_layout_set_font_description (about_info.layout, font_desc);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
pango_layout_get_pixel_size (about_info.layout, &width, &height);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
while (width >= about_info.textarea.width && size >= 6.0)
|
|
|
|
{
|
|
|
|
size -= 0.5;
|
|
|
|
pango_font_description_set_size (font_desc, size * PANGO_SCALE);
|
|
|
|
pango_layout_set_font_description (about_info.layout, font_desc);
|
1997-12-08 18:36:19 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
pango_layout_get_pixel_size (about_info.layout, &width, &height);
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
count++;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-29 10:57:07 +08:00
|
|
|
if (count < 16)
|
|
|
|
{
|
|
|
|
decorate_text (about_info.layout, 4, ((float) count) / 15.0);
|
|
|
|
}
|
|
|
|
else if (count == 16)
|
|
|
|
{
|
|
|
|
about_info.timer = g_timeout_add (800, about_dialog_timer, NULL);
|
|
|
|
return_val = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2003-12-29 10:57:07 +08:00
|
|
|
else if (count == 17)
|
|
|
|
{
|
|
|
|
about_info.timer = g_timeout_add (30, about_dialog_timer, NULL);
|
|
|
|
return_val = FALSE;
|
|
|
|
}
|
|
|
|
else if (count < 33)
|
|
|
|
{
|
|
|
|
decorate_text (about_info.layout, 1, 1.0 - ((float) (count-17)) / 15.0);
|
|
|
|
}
|
|
|
|
else if (count == 33)
|
|
|
|
{
|
|
|
|
about_info.timer = g_timeout_add (300, about_dialog_timer, NULL);
|
|
|
|
return_val = FALSE;
|
|
|
|
about_info.visible = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
count = 0;
|
|
|
|
about_info.timer = g_timeout_add (30, about_dialog_timer, NULL);
|
|
|
|
return_val = FALSE;
|
|
|
|
about_info.visible = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_queue_draw_area (about_info.logo_area,
|
|
|
|
about_info.textarea.x,
|
|
|
|
about_info.textarea.y,
|
|
|
|
about_info.textarea.width,
|
|
|
|
about_info.textarea.height);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|