Commit 8f57aaed authored by Sven Neumann's avatar Sven Neumann

added the splash-screen image drawn by Jens Lauterbacher to the

        * gimp_splash.ppm: added the splash-screen image drawn
        by Jens Lauterbacher to the distribution

        * app/appenv.h
        * app/app_procs.c
        * app/main.c: added the splash-image to the startup-window;
        new command-line options: --no-splash, --no-splash-image

        * ps_menurc: changed to reflect changes to the
        menu-structure
parent 47ba671e
Tue Feb 17 20:55:12 MET 1998 Sven Neumann <sven@gimp.org>
* gimp_splash.ppm: added the splash-screen image drawn
by Jens Lauterbacher to the distribution
* app/appenv.h
* app/app_procs.c
* app/main.c: added the splash-image to the startup-window;
new command-line options: --no-splash, --no-splash-image
* ps_menurc: changed to reflect changes to the
menu-structure
Tue Feb 17 09:24:44 EST 1998 Adrian Likins <adrian@gimp.org>
* updated all of Sven Neumanns scripts. Including
......
......@@ -2,9 +2,9 @@
SUBDIRS = libgimp plug-ins app docs
EXTRA_DIST = TODO TODO-DIST NOTES gtkrc gimp_logo.ppm rmshm user_install gimp_tips.txt ps-menurc
EXTRA_DIST = TODO TODO-DIST NOTES gtkrc gimp_logo.ppm gimp_splash.ppm rmshm user_install gimp_tips.txt ps-menurc
gimpdata_DATA = gimprc gimprc_user gtkrc gimp_logo.ppm gimp_tips.txt ps-menurc
gimpdata_DATA = gimprc gimprc_user gtkrc gimp_logo.ppm gimp_splash.ppm gimp_tips.txt ps-menurc
gimpdata_SCRIPTS = user_install
......
......@@ -55,11 +55,25 @@
#include "xcf.h"
#include <gtk/gtk.h>
#define LOGO_WIDTH_MIN 350
#define LOGO_HEIGHT_MIN 110
#define NAME "The GIMP"
#define AUTHORS "brought to you by Spencer Kimball and Peter Mattis"
#define SHOW_NEVER 0
#define SHOW_LATER 1
#define SHOW_NOW 2
/* Function prototype for affirmation dialog when exiting application */
static void really_quit_dialog (void);
static Argument* quit_invoker (Argument *args);
static void make_initialization_status_window(void);
static void destroy_initialization_status_window(void);
static int splash_logo_load (GtkWidget *window);
static int splash_logo_load_size (GtkWidget *window);
static void splash_logo_draw (GtkWidget *widget);
static void splash_text_draw (GtkWidget *widget);
static void splash_logo_expose (GtkWidget *widget);
static gint is_app_exit_finish_done = FALSE;
......@@ -107,6 +121,171 @@ gimp_init (int gimp_argc,
batch_init ();
}
static GtkWidget *logo_area = NULL;
static GdkPixmap *logo_pixmap = NULL;
static int logo_width = 0;
static int logo_height = 0;
static int logo_area_width = 0;
static int logo_area_height = 0;
static int show_logo = SHOW_NEVER;
static int
splash_logo_load_size (GtkWidget *window)
{
char buf[1024];
FILE *fp;
if (logo_pixmap)
return TRUE;
sprintf (buf, "%s/gimp_splash.ppm", DATADIR);
fp = fopen (buf, "r");
if (!fp)
return 0;
fgets (buf, 1024, fp);
if (strcmp (buf, "P6\n") != 0)
{
fclose (fp);
return 0;
}
fgets (buf, 1024, fp);
fgets (buf, 1024, fp);
sscanf (buf, "%d %d", &logo_width, &logo_height);
fclose (fp);
return TRUE;
}
static int
splash_logo_load (GtkWidget *window)
{
GtkWidget *preview;
char buf[1024];
unsigned char *pixelrow;
FILE *fp;
int count;
int i;
if (logo_pixmap)
return TRUE;
sprintf (buf, "%s/gimp_splash.ppm", DATADIR);
fp = fopen (buf, "r");
if (!fp)
return 0;
fgets (buf, 1024, fp);
if (strcmp (buf, "P6\n") != 0)
{
fclose (fp);
return 0;
}
fgets (buf, 1024, fp);
fgets (buf, 1024, fp);
sscanf (buf, "%d %d", &logo_width, &logo_height);
fgets (buf, 1024, fp);
if (strcmp (buf, "255\n") != 0)
{
fclose (fp);
return 0;
}
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (preview), logo_width, logo_height);
pixelrow = g_new (guchar, logo_width * 3);
for (i = 0; i < logo_height; i++)
{
count = fread (pixelrow, sizeof (unsigned char), logo_width * 3, fp);
if (count != (logo_width * 3))
{
gtk_widget_destroy (preview);
g_free (pixelrow);
fclose (fp);
return 0;
}
gtk_preview_draw_row (GTK_PREVIEW (preview), pixelrow, 0, i, logo_width);
}
gtk_widget_realize (window);
logo_pixmap = gdk_pixmap_new (window->window, logo_width, logo_height, -1);
gtk_preview_put (GTK_PREVIEW (preview),
logo_pixmap, window->style->black_gc,
0, 0, 0, 0, logo_width, logo_height);
gtk_widget_destroy (preview);
g_free (pixelrow);
fclose (fp);
return TRUE;
}
static void
splash_text_draw (GtkWidget *widget)
{
GdkFont *font = NULL;
font = gdk_font_load ("-Adobe-Helvetica-Bold-R-Normal--*-140-*-*-*-*-*-*");
gdk_draw_string (widget->window,
font,
widget->style->black_gc,
((logo_area_width - gdk_string_width (font, NAME)) / 2),
(0.3 * logo_area_height),
NAME);
font = gdk_font_load ("-Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-*");
gdk_draw_string (widget->window,
font,
widget->style->black_gc,
((logo_area_width - gdk_string_width (font, VERSION)) / 2),
(0.5 * logo_area_height),
VERSION);
gdk_draw_string (widget->window,
font,
widget->style->black_gc,
((logo_area_width - gdk_string_width (font, AUTHORS)) / 2),
(0.7 * logo_area_height),
AUTHORS);
/* gdk_draw_rectangle (widget->window,
widget->style->black_gc,
FALSE,
1, 1, (logo_area_width - 2), (logo_area_height - 2));
*/
}
static void
splash_logo_draw (GtkWidget *widget)
{
gdk_draw_pixmap (widget->window,
widget->style->black_gc,
logo_pixmap,
0, 0,
((logo_area_width - logo_width) / 2), ((logo_area_height - logo_height) / 2),
logo_width, logo_height);
}
static void
splash_logo_expose (GtkWidget *widget)
{
switch (show_logo) {
case SHOW_NEVER:
case SHOW_LATER:
splash_text_draw (widget);
break;
case SHOW_NOW:
splash_logo_draw (widget);
}
}
static GtkWidget *win_initstatus = NULL;
static GtkWidget *label1 = NULL;
static GtkWidget *label2 = NULL;
......@@ -119,12 +298,14 @@ destroy_initialization_status_window(void)
if(win_initstatus)
{
gtk_widget_destroy(win_initstatus);
win_initstatus = label1 = label2 = pbar = NULL;
win_initstatus = label1 = label2 = pbar = logo_area = NULL;
logo_pixmap = NULL;
gtk_idle_remove(idle_tag);
}
}
static void my_idle_proc(void)
static void
my_idle_proc(void)
{
/* Do nothing. This is needed to stop the GIMP
from blocking in gtk_main_iteration() */
......@@ -133,7 +314,7 @@ static void my_idle_proc(void)
static void
make_initialization_status_window(void)
{
if(no_interface == FALSE)
if (no_interface == FALSE && no_splash == FALSE)
{
GtkWidget *vbox;
......@@ -142,9 +323,22 @@ make_initialization_status_window(void)
gtk_window_set_title(GTK_WINDOW(win_initstatus),
"GIMP Startup");
vbox = gtk_vbox_new(TRUE, 5);
if (no_splash_image == FALSE && splash_logo_load_size (win_initstatus))
{
show_logo = TRUE;
}
vbox = gtk_vbox_new(FALSE, 4);
gtk_container_add(GTK_CONTAINER(win_initstatus), vbox);
logo_area = gtk_drawing_area_new ();
gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event",
(GtkSignalFunc) splash_logo_expose, NULL);
logo_area_width = ( logo_width > LOGO_WIDTH_MIN ) ? logo_width : LOGO_WIDTH_MIN;
logo_area_height = ( logo_height > LOGO_HEIGHT_MIN ) ? logo_height : LOGO_HEIGHT_MIN;
gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_area_width, logo_area_height);
gtk_box_pack_start_defaults(GTK_BOX(vbox), logo_area);
label1 = gtk_label_new("");
gtk_box_pack_start_defaults(GTK_BOX(vbox), label1);
label2 = gtk_label_new("");
......@@ -154,6 +348,7 @@ make_initialization_status_window(void)
gtk_box_pack_start_defaults(GTK_BOX(vbox), pbar);
gtk_widget_show(vbox);
gtk_widget_show (logo_area);
gtk_widget_show(label1);
gtk_widget_show(label2);
gtk_widget_show(pbar);
......@@ -172,8 +367,7 @@ app_init_update_status(char *label1val,
char *label2val,
float pct_progress)
{
if(no_interface == FALSE
&& win_initstatus)
if(no_interface == FALSE && no_splash == FALSE && win_initstatus)
{
GdkRectangle area = {0, 0, -1, -1};
if(label1val
......@@ -209,7 +403,10 @@ app_init ()
char *path;
make_initialization_status_window();
if (no_interface == FALSE && no_splash == FALSE && win_initstatus) {
splash_text_draw (logo_area);
}
/*
* Initialize the procedural database
* We need to do this first because any of the init
......@@ -233,12 +430,23 @@ app_init ()
gtk_rc_parse (filename);
}
RESET_BAR();
parse_gimprc (); /* parse the local GIMP configuration file */
/* Now we are ready to draw the splash-screen-image to the start-up window */
if (no_interface == FALSE)
{
get_standard_colormaps ();
if (no_splash_image == FALSE && show_logo && splash_logo_load (win_initstatus)) {
show_logo = SHOW_NOW;
splash_logo_draw (logo_area);
}
}
RESET_BAR();
file_ops_pre_init (); /* pre-initialize the file types */
RESET_BAR();
xcf_init (); /* initialize the xcf file format routines */
RESET_BAR();
parse_gimprc (); /* parse the local GIMP configuration file */
if (no_data == FALSE)
{
RESET_BAR();
......@@ -268,7 +476,6 @@ app_init ()
/* Things to do only if there is an interface */
if (no_interface == FALSE)
{
get_standard_colormaps ();
create_toolbox ();
gximage_init ();
render_setup (transparency_type, transparency_size);
......
......@@ -29,6 +29,8 @@
#define MAXIMUM(x,y) ((x > y) ? x : y)
extern int no_interface;
extern int no_splash;
extern int no_splash_image;
extern int no_data;
extern int be_verbose;
......
......@@ -41,6 +41,8 @@ static void init (void);
/* GLOBAL data */
int no_interface;
int no_data;
int no_splash;
int no_splash_image;
int be_verbose;
int use_shm;
char *prog_name; /* The path name we are invoked with */
......@@ -96,6 +98,8 @@ main (int argc, char **argv)
no_interface = FALSE;
no_data = FALSE;
no_splash = FALSE;
no_splash_image = FALSE;
use_shm = TRUE;
batch_cmds = g_new (char*, argc);
batch_cmds[0] = NULL;
......@@ -136,6 +140,14 @@ main (int argc, char **argv)
{
no_data = TRUE;
}
else if (strcmp (argv[i], "--no-splash") == 0)
{
no_splash = TRUE;
}
else if (strcmp (argv[i], "--no-splash-image") == 0)
{
no_splash_image = TRUE;
}
else if (strcmp (argv[i], "--verbose") == 0)
{
be_verbose = TRUE;
......@@ -166,6 +178,8 @@ main (int argc, char **argv)
g_print (" -n --no-interface Run without a user interface.\n");
g_print (" --no-data Do not load patterns, gradients, palettes, brushes.\n");
g_print (" --verbose Show startup messages.\n");
g_print (" --no-splash Do not show the startup window.\n");
g_print (" --no-splash-image Do not add an image to the startup window.\n");
g_print (" --no-shm Do not use shared memory between GIMP and its plugins.\n");
g_print (" --no-xshm Do not use the X Shared Memory extension.\n");
g_print (" --display <display> Use the designated X display.\n\n");
......
This source diff could not be displayed because it is too large. You can view the blob instead.
(menu-path "<Image>/Image/Adjust/Levels" "<control>L")
(menu-path "<Image>/Image/Colors/Curves" "<control>M")
(menu-path "<Image>/Select/Invert" "<control><shift>I")
(menu-path "<Image>/Select/Sharpen" "")
(menu-path "<Image>/Select/Feather" "<control><shift>D")
(menu-path "<Image>/Image/Map/Invert" "<control>I")
(menu-path "<Image>/Tools/Eraser" "")
(menu-path "<Image>/View/<check>Toggle Guides" "<control>;")
(menu-path "<Image>/Image/Colors/Invert" "<control>I")
(menu-path "<Image>/View/Shrink Wrap" "")
(menu-path "<Image>/Image/Adjust/Desaturate" "<control><shift>U")
(menu-path "<Image>/Image/Colors/Color Balance" "<control>B")
(menu-path "<Image>/Edit/Paste Into" "<control><shift>V")
(menu-path "<Image>/View/<check>Snap To Guides" "<control><shift>:")
(menu-path "<Image>/Select/Toggle" "")
(menu-path "<Image>/Image/Adjust/Curves" "<control>M")
(menu-path "<Image>/Select/Float" "")
(menu-path "<Image>/View/Zoom In" "<control><shift>+")
(menu-path "<Image>/Layers/Raise Layer" "<control>]")
(menu-path "<Image>/Edit/Cut Named" "")
(menu-path "<Image>/Image/Colors/Desaturate" "<control><shift>U")
(menu-path "<Image>/Image/Colors/Hue-Saturation" "<control>U")
(menu-path "<Image>/Edit/Redo" "<control><shift>Z")
(menu-path "<Image>/Filters/Repeat last" "<control>F")
(menu-path "<Image>/View/Zoom Out" "<control>-")
......@@ -23,16 +24,16 @@
(menu-path "<Image>/File/Save" "<control>S")
(menu-path "<Image>/File/Save as" "<control><shift>S")
(menu-path "<Image>/Dialogs/Palette..." "")
(menu-path "<Image>/Layers/Layers & Channels..." "")
(menu-path "<Image>/Dialogs/Layers & Channels..." "")
(menu-path "<Image>/Image/Colors/Levels" "<control>L")
(menu-path "<Image>/Image/Channel Ops/Duplicate" "")
(menu-path "<Image>/Edit/Paste Named" "")
(menu-path "<Image>/Image/Adjust/Color Balance" "<control>B")
(menu-path "<Image>/Edit/Copy Named" "")
(menu-path "<Image>/File/Print..." "<control>P")
(menu-path "<Image>/View/Window Info..." "")
(menu-path "<Image>/Layers/Merge Visible Layers" "<control><shift>E")
(menu-path "<Image>/Edit/Clear" "")
(menu-path "<Image>/Layers/Merge Visible Layers" "<control><shift>E")
(menu-path "<Image>/View/<check>Toggle Rulers" "<control>R")
(menu-path "<Image>/File/Preferences..." "<control>K")
(menu-path "<Image>/Image/Adjust/Hue-Saturation" "<control>U")
(menu-path "<Image>/Filters/Re-show last" "<control><alt>F")
This source diff could not be displayed because it is too large. You can view the blob instead.
(menu-path "<Image>/Image/Adjust/Levels" "<control>L")
(menu-path "<Image>/Image/Colors/Curves" "<control>M")
(menu-path "<Image>/Select/Invert" "<control><shift>I")
(menu-path "<Image>/Select/Sharpen" "")
(menu-path "<Image>/Select/Feather" "<control><shift>D")
(menu-path "<Image>/Image/Map/Invert" "<control>I")
(menu-path "<Image>/Tools/Eraser" "")
(menu-path "<Image>/View/<check>Toggle Guides" "<control>;")
(menu-path "<Image>/Image/Colors/Invert" "<control>I")
(menu-path "<Image>/View/Shrink Wrap" "")
(menu-path "<Image>/Image/Adjust/Desaturate" "<control><shift>U")
(menu-path "<Image>/Image/Colors/Color Balance" "<control>B")
(menu-path "<Image>/Edit/Paste Into" "<control><shift>V")
(menu-path "<Image>/View/<check>Snap To Guides" "<control><shift>:")
(menu-path "<Image>/Select/Toggle" "")
(menu-path "<Image>/Image/Adjust/Curves" "<control>M")
(menu-path "<Image>/Select/Float" "")
(menu-path "<Image>/View/Zoom In" "<control><shift>+")
(menu-path "<Image>/Layers/Raise Layer" "<control>]")
(menu-path "<Image>/Edit/Cut Named" "")
(menu-path "<Image>/Image/Colors/Desaturate" "<control><shift>U")
(menu-path "<Image>/Image/Colors/Hue-Saturation" "<control>U")
(menu-path "<Image>/Edit/Redo" "<control><shift>Z")
(menu-path "<Image>/Filters/Repeat last" "<control>F")
(menu-path "<Image>/View/Zoom Out" "<control>-")
......@@ -23,16 +24,16 @@
(menu-path "<Image>/File/Save" "<control>S")
(menu-path "<Image>/File/Save as" "<control><shift>S")
(menu-path "<Image>/Dialogs/Palette..." "")
(menu-path "<Image>/Layers/Layers & Channels..." "")
(menu-path "<Image>/Dialogs/Layers & Channels..." "")
(menu-path "<Image>/Image/Colors/Levels" "<control>L")
(menu-path "<Image>/Image/Channel Ops/Duplicate" "")
(menu-path "<Image>/Edit/Paste Named" "")
(menu-path "<Image>/Image/Adjust/Color Balance" "<control>B")
(menu-path "<Image>/Edit/Copy Named" "")
(menu-path "<Image>/File/Print..." "<control>P")
(menu-path "<Image>/View/Window Info..." "")
(menu-path "<Image>/Layers/Merge Visible Layers" "<control><shift>E")
(menu-path "<Image>/Edit/Clear" "")
(menu-path "<Image>/Layers/Merge Visible Layers" "<control><shift>E")
(menu-path "<Image>/View/<check>Toggle Rulers" "<control>R")
(menu-path "<Image>/File/Preferences..." "<control>K")
(menu-path "<Image>/Image/Adjust/Hue-Saturation" "<control>U")
(menu-path "<Image>/Filters/Re-show last" "<control><alt>F")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment