1997-11-25 06:05:25 +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
1998-04-13 13:44:11 +08:00
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
1997-11-25 06:05:25 +08:00
*/
# include <signal.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <sys/param.h>
# include <unistd.h>
1998-05-28 17:03:57 +08:00
# include <gtk/gtk.h>
1998-07-15 10:28:31 +08:00
# include "libgimp/gimpfeatures.h"
1997-11-25 06:05:25 +08:00
# include "appenv.h"
# include "app_procs.h"
# include "batch.h"
1998-07-09 13:31:06 +08:00
# include "gimpbrushlist.h"
1997-11-25 06:05:25 +08:00
# include "color_transfer.h"
# include "curves.h"
1998-06-06 11:49:01 +08:00
# include "devices.h"
1997-11-25 06:05:25 +08:00
# include "gdisplay.h"
# include "colormaps.h"
1998-08-03 03:05:02 +08:00
# include "errorconsole.h"
1997-11-25 06:05:25 +08:00
# include "fileops.h"
# include "gimprc.h"
1998-10-30 18:21:33 +08:00
# include "gimpparasite.h"
1998-07-02 07:06:49 +08:00
# include "gimpset.h"
1997-11-25 06:05:25 +08:00
# include "global_edit.h"
# include "gradient.h"
# include "gximage.h"
# include "hue_saturation.h"
# include "image_render.h"
# include "interface.h"
# include "internal_procs.h"
# include "layers_dialog.h"
# include "levels.h"
# include "menus.h"
# include "paint_funcs.h"
# include "palette.h"
# include "patterns.h"
# include "plug_in.h"
# include "procedural_db.h"
1998-06-23 01:30:40 +08:00
# include "session.h"
1997-11-25 06:05:25 +08:00
# include "temp_buf.h"
# include "tile_swap.h"
# include "tips_dialog.h"
# include "tools.h"
# include "undo.h"
# include "xcf.h"
1998-05-28 17:03:57 +08:00
# include "errors.h"
1998-07-08 18:29:09 +08:00
# include "docindex.h"
1997-11-25 06:05:25 +08:00
1998-05-03 05:50:29 +08:00
# include "config.h"
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
# include "libgimp/gimpintl.h"
1998-06-27 03:31:39 +08:00
# define LOGO_WIDTH_MIN 300
1998-07-20 23:07:13 +08:00
# define LOGO_HEIGHT_MIN 110
1998-02-18 04:14:29 +08:00
# define NAME "The GIMP"
1998-03-19 02:19:32 +08:00
# define BROUGHT "brought to you by"
1998-07-20 23:07:13 +08:00
# define AUTHORS "Spencer Kimball and Peter Mattis"
1998-02-18 04:14:29 +08:00
# define SHOW_NEVER 0
# define SHOW_LATER 1
# define SHOW_NOW 2
1998-07-20 23:07:13 +08:00
1997-11-25 06:05:25 +08:00
/* Function prototype for affirmation dialog when exiting application */
static void really_quit_dialog ( void ) ;
static Argument * quit_invoker ( Argument * args ) ;
1998-01-20 08:12:21 +08:00
static void make_initialization_status_window ( void ) ;
static void destroy_initialization_status_window ( void ) ;
1998-02-18 04:14:29 +08:00
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 ) ;
1997-11-25 06:05:25 +08:00
1998-02-05 13:41:05 +08:00
static gint is_app_exit_finish_done = FALSE ;
1998-07-12 06:23:23 +08:00
int we_are_exiting = FALSE ;
1998-02-05 13:41:05 +08:00
1997-11-25 06:05:25 +08:00
static ProcArg quit_args [ ] =
{
{ PDB_INT32 ,
" kill " ,
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
N_ ( " Flag specifying whether to kill the gimp process or exit normally " ) } ,
1997-11-25 06:05:25 +08:00
} ;
static ProcRecord quit_proc =
{
" gimp_quit " ,
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
N_ ( " Causes the gimp to exit gracefully " ) ,
N_ ( " The internal procedure which can either be used to make the gimp quit normally, or to have the gimp clean up its resources and exit immediately. The normaly shutdown process allows for querying the user to save any dirty images. " ) ,
N_ ( " Spencer Kimball & Peter Mattis " ) ,
N_ ( " Spencer Kimball & Peter Mattis " ) ,
1997-11-25 06:05:25 +08:00
" 1995-1996 " ,
PDB_INTERNAL ,
1 ,
quit_args ,
0 ,
NULL ,
{ { quit_invoker } } ,
} ;
void
gimp_init ( int gimp_argc ,
char * * gimp_argv )
{
/* Initialize the application */
app_init ( ) ;
/* Parse the rest of the command line arguments as images to load */
if ( gimp_argc > 0 )
while ( gimp_argc - - )
{
if ( * gimp_argv )
1998-05-12 17:53:24 +08:00
file_open ( * gimp_argv , * gimp_argv ) ;
1997-11-25 06:05:25 +08:00
gimp_argv + + ;
}
batch_init ( ) ;
1998-05-12 17:53:24 +08:00
/* Handle showing dialogs with gdk_quit_adds here */
if ( ! no_interface & & show_tips )
tips_dialog_create ( ) ;
1997-11-25 06:05:25 +08:00
}
1998-02-18 04:14:29 +08:00
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 ;
1998-04-19 20:19:24 +08:00
static int max_label_length = MAXPATHLEN ;
1998-02-18 04:14:29 +08:00
static int
splash_logo_load_size ( GtkWidget * window )
{
char buf [ 1024 ] ;
FILE * fp ;
if ( logo_pixmap )
return TRUE ;
1998-06-26 08:30:12 +08:00
sprintf ( buf , " %s/gimp1_1_splash.ppm " , DATADIR ) ;
1998-02-18 04:14:29 +08:00
1998-08-01 02:34:05 +08:00
fp = fopen ( buf , " rb " ) ;
1998-02-18 04:14:29 +08:00
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 ;
1998-02-27 07:27:12 +08:00
GdkGC * gc ;
1998-02-18 04:14:29 +08:00
char buf [ 1024 ] ;
unsigned char * pixelrow ;
FILE * fp ;
int count ;
int i ;
if ( logo_pixmap )
return TRUE ;
1998-06-26 08:30:12 +08:00
sprintf ( buf , " %s/gimp1_1_splash.ppm " , DATADIR ) ;
1998-02-18 04:14:29 +08:00
1998-08-01 02:34:05 +08:00
fp = fopen ( buf , " rb " ) ;
1998-02-18 04:14:29 +08:00
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 ) ;
1998-02-27 07:27:12 +08:00
logo_pixmap = gdk_pixmap_new ( window - > window , logo_width , logo_height ,
gtk_preview_get_visual ( ) - > depth ) ;
gc = gdk_gc_new ( logo_pixmap ) ;
1998-02-18 04:14:29 +08:00
gtk_preview_put ( GTK_PREVIEW ( preview ) ,
1998-02-27 07:27:12 +08:00
logo_pixmap , gc ,
1998-02-18 04:14:29 +08:00
0 , 0 , 0 , 0 , logo_width , logo_height ) ;
1998-02-27 07:27:12 +08:00
gdk_gc_destroy ( gc ) ;
1998-02-18 04:14:29 +08:00
1998-02-19 01:04:12 +08:00
gtk_widget_unref ( preview ) ;
1998-02-18 04:14:29 +08:00
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 ,
1998-05-12 17:53:24 +08:00
widget - > style - > fg_gc [ GTK_STATE_NORMAL ] ,
1998-07-20 23:07:13 +08:00
( ( logo_area_width - gdk_string_width ( font , NAME ) ) / 2 ) ,
1998-03-19 02:19:32 +08:00
( 0.25 * logo_area_height ) ,
1998-02-18 04:14:29 +08:00
NAME ) ;
font = gdk_font_load ( " -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* " ) ;
gdk_draw_string ( widget - > window ,
font ,
1998-05-12 17:53:24 +08:00
widget - > style - > fg_gc [ GTK_STATE_NORMAL ] ,
1998-07-20 23:07:13 +08:00
( ( logo_area_width - gdk_string_width ( font , GIMP_VERSION ) ) / 2 ) ,
1998-03-19 02:19:32 +08:00
( 0.45 * logo_area_height ) ,
1998-05-03 05:50:29 +08:00
GIMP_VERSION ) ;
1998-03-19 02:19:32 +08:00
gdk_draw_string ( widget - > window ,
font ,
1998-05-12 17:53:24 +08:00
widget - > style - > fg_gc [ GTK_STATE_NORMAL ] ,
1998-07-20 23:07:13 +08:00
( ( logo_area_width - gdk_string_width ( font , BROUGHT ) ) / 2 ) ,
1998-03-19 02:19:32 +08:00
( 0.65 * logo_area_height ) ,
BROUGHT ) ;
1998-02-18 04:14:29 +08:00
gdk_draw_string ( widget - > window ,
font ,
1998-05-12 17:53:24 +08:00
widget - > style - > fg_gc [ GTK_STATE_NORMAL ] ,
1998-07-20 23:07:13 +08:00
( ( logo_area_width - gdk_string_width ( font , AUTHORS ) ) / 2 ) ,
1998-03-19 02:19:32 +08:00
( 0.80 * logo_area_height ) ,
1998-02-18 04:14:29 +08:00
AUTHORS ) ;
1998-07-20 23:07:13 +08:00
/*
1998-04-19 20:19:24 +08:00
* This is a hack : we try to compute a good guess for the maximum number
1998-07-20 23:07:13 +08:00
* of charcters that will fit into the splash - screen using the given font
1998-04-19 20:19:24 +08:00
*/
1998-11-16 01:02:59 +08:00
max_label_length = 0.92 * ( float ) strlen ( AUTHORS ) *
1998-07-20 23:07:13 +08:00
( ( float ) logo_area_width / ( float ) gdk_string_width ( font , AUTHORS ) ) ;
1998-02-18 04:14:29 +08:00
}
static void
splash_logo_draw ( GtkWidget * widget )
{
gdk_draw_pixmap ( widget - > window ,
widget - > style - > black_gc ,
1998-07-20 23:07:13 +08:00
logo_pixmap ,
1998-02-18 04:14:29 +08:00
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 ) {
1998-07-20 23:07:13 +08:00
case SHOW_NEVER :
1998-02-18 04:14:29 +08:00
case SHOW_LATER :
splash_text_draw ( widget ) ;
break ;
case SHOW_NOW :
splash_logo_draw ( widget ) ;
}
}
1998-01-20 08:12:21 +08:00
static GtkWidget * win_initstatus = NULL ;
static GtkWidget * label1 = NULL ;
static GtkWidget * label2 = NULL ;
static GtkWidget * pbar = NULL ;
static void
destroy_initialization_status_window ( void )
{
if ( win_initstatus )
{
gtk_widget_destroy ( win_initstatus ) ;
1998-05-18 11:07:43 +08:00
if ( logo_pixmap ! = NULL )
gdk_pixmap_unref ( logo_pixmap ) ;
1998-05-18 05:05:24 +08:00
win_initstatus = label1 = label2 = pbar = logo_area = NULL ;
logo_pixmap = NULL ;
1998-01-20 08:12:21 +08:00
}
}
static void
make_initialization_status_window ( void )
{
1998-02-27 15:02:59 +08:00
if ( no_interface = = FALSE )
1998-01-20 08:12:21 +08:00
{
1998-02-27 15:02:59 +08:00
if ( no_splash = = FALSE )
{
GtkWidget * vbox ;
1998-01-20 08:12:21 +08:00
1998-05-18 05:05:24 +08:00
win_initstatus = gtk_window_new ( GTK_WINDOW_DIALOG ) ;
1998-11-15 04:06:30 +08:00
1998-03-13 06:01:43 +08:00
gtk_signal_connect ( GTK_OBJECT ( win_initstatus ) , " delete_event " ,
GTK_SIGNAL_FUNC ( gtk_true ) ,
NULL ) ;
1998-02-27 15:02:59 +08:00
gtk_window_set_wmclass ( GTK_WINDOW ( win_initstatus ) , " gimp_startup " , " Gimp " ) ;
gtk_window_set_title ( GTK_WINDOW ( win_initstatus ) ,
" GIMP Startup " ) ;
1998-01-20 08:12:21 +08:00
1998-07-20 23:07:13 +08:00
if ( no_splash_image = = FALSE & & splash_logo_load_size ( win_initstatus ) )
1998-02-27 15:02:59 +08:00
{
show_logo = SHOW_LATER ;
}
1998-02-18 04:14:29 +08:00
1998-02-27 15:02:59 +08:00
vbox = gtk_vbox_new ( FALSE , 4 ) ;
gtk_container_add ( GTK_CONTAINER ( win_initstatus ) , vbox ) ;
1998-02-27 07:27:12 +08:00
1998-02-27 15:02:59 +08:00
logo_area = gtk_drawing_area_new ( ) ;
1998-02-27 07:27:12 +08:00
1998-02-27 15:02:59 +08:00
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 ) ;
1998-02-18 04:14:29 +08:00
1998-02-27 15:02:59 +08:00
label1 = gtk_label_new ( " " ) ;
gtk_box_pack_start_defaults ( GTK_BOX ( vbox ) , label1 ) ;
label2 = gtk_label_new ( " " ) ;
gtk_box_pack_start_defaults ( GTK_BOX ( vbox ) , label2 ) ;
1998-07-20 23:07:13 +08:00
1998-02-27 15:02:59 +08:00
pbar = gtk_progress_bar_new ( ) ;
gtk_box_pack_start_defaults ( GTK_BOX ( vbox ) , pbar ) ;
1998-07-20 23:07:13 +08:00
1998-02-27 15:02:59 +08:00
gtk_widget_show ( vbox ) ;
gtk_widget_show ( logo_area ) ;
gtk_widget_show ( label1 ) ;
gtk_widget_show ( label2 ) ;
gtk_widget_show ( pbar ) ;
1998-07-20 23:07:13 +08:00
1998-02-27 15:02:59 +08:00
gtk_window_position ( GTK_WINDOW ( win_initstatus ) ,
GTK_WIN_POS_CENTER ) ;
1998-07-20 23:07:13 +08:00
1998-02-27 15:02:59 +08:00
gtk_widget_show ( win_initstatus ) ;
1998-01-25 04:18:36 +08:00
1998-02-27 15:02:59 +08:00
gtk_window_set_policy ( GTK_WINDOW ( win_initstatus ) , FALSE , TRUE , FALSE ) ;
}
1998-01-20 08:12:21 +08:00
}
}
void
app_init_update_status ( char * label1val ,
char * label2val ,
float pct_progress )
{
1998-04-19 20:19:24 +08:00
char * temp ;
1998-02-18 04:14:29 +08:00
if ( no_interface = = FALSE & & no_splash = = FALSE & & win_initstatus )
1998-01-20 08:12:21 +08:00
{
if ( label1val
& & strcmp ( label1val , GTK_LABEL ( label1 ) - > label ) )
{
gtk_label_set ( GTK_LABEL ( label1 ) , label1val ) ;
}
if ( label2val
& & strcmp ( label2val , GTK_LABEL ( label2 ) - > label ) )
{
1998-04-19 20:19:24 +08:00
while ( strlen ( label2val ) > max_label_length )
{
temp = strchr ( label2val , ' / ' ) ;
if ( temp = = NULL ) /* for sanity */
break ;
temp + + ;
label2val = temp ;
}
1998-01-20 08:12:21 +08:00
gtk_label_set ( GTK_LABEL ( label2 ) , label2val ) ;
}
1998-08-12 04:45:57 +08:00
if ( pct_progress > = 0.0 & & pct_progress < = 1.0 & &
gtk_progress_get_current_percentage ( & ( GTK_PROGRESS_BAR ( pbar ) - > progress ) ) ! = pct_progress )
1998-07-20 23:07:13 +08:00
/*
GTK_PROGRESS_BAR ( pbar ) - > percentage ! = pct_progress )
*/
1998-01-20 08:12:21 +08:00
{
1998-08-12 04:45:57 +08:00
gtk_progress_bar_update ( GTK_PROGRESS_BAR ( pbar ) , pct_progress ) ;
1998-01-20 08:12:21 +08:00
}
1998-08-31 04:44:25 +08:00
while ( gtk_events_pending ( ) )
gtk_main_iteration ( ) ;
/* We sync here to make sure things get drawn before continuing,
* is the improved look worth the time ? I ' m not sure . . .
*/
gdk_flush ( ) ;
1998-01-20 08:12:21 +08:00
}
}
/* #define RESET_BAR() app_init_update_status("", "", 0) */
# define RESET_BAR()
1997-11-25 06:05:25 +08:00
void
1998-05-12 17:53:24 +08:00
app_init ( void )
1997-11-25 06:05:25 +08:00
{
char filename [ MAXPATHLEN ] ;
char * gimp_dir ;
char * path ;
1998-04-30 13:30:28 +08:00
gimp_dir = gimp_directory ( ) ;
if ( gimp_dir [ 0 ] ! = ' \000 ' )
{
sprintf ( filename , " %s/gtkrc " , gimp_dir ) ;
if ( ( be_verbose = = TRUE ) | | ( no_splash = = TRUE ) )
1998-11-06 08:51:39 +08:00
g_print ( _ ( " parsing \" %s \" \n " ) , filename ) ;
1998-04-30 13:30:28 +08:00
gtk_rc_parse ( filename ) ;
}
1998-11-15 04:06:30 +08:00
if ( no_interface = = FALSE )
get_standard_colormaps ( ) ;
1998-01-20 08:12:21 +08:00
make_initialization_status_window ( ) ;
1998-02-18 04:14:29 +08:00
if ( no_interface = = FALSE & & no_splash = = FALSE & & win_initstatus ) {
splash_text_draw ( logo_area ) ;
}
1998-07-02 07:06:49 +08:00
/* Create the context of all existing images */
image_context = gimp_set_new ( GIMP_TYPE_IMAGE , TRUE ) ;
1998-07-20 23:07:13 +08:00
1997-11-25 06:05:25 +08:00
/*
* Initialize the procedural database
* We need to do this first because any of the init
* procedures might install or query it as needed .
*/
procedural_db_init ( ) ;
1998-01-20 08:12:21 +08:00
RESET_BAR ( ) ;
1997-11-25 06:05:25 +08:00
internal_procs_init ( ) ;
1998-01-20 08:12:21 +08:00
RESET_BAR ( ) ;
1997-11-25 06:05:25 +08:00
procedural_db_register ( & quit_proc ) ;
1998-02-18 04:14:29 +08:00
RESET_BAR ( ) ;
parse_gimprc ( ) ; /* parse the local GIMP configuration file */
1998-07-12 06:23:23 +08:00
if ( always_restore_session )
restore_session = TRUE ;
1998-02-18 04:14:29 +08:00
/* Now we are ready to draw the splash-screen-image to the start-up window */
if ( no_interface = = FALSE )
{
if ( no_splash_image = = FALSE & & show_logo & & splash_logo_load ( win_initstatus ) ) {
show_logo = SHOW_NOW ;
splash_logo_draw ( logo_area ) ;
}
}
1998-01-20 08:12:21 +08:00
RESET_BAR ( ) ;
1997-11-25 06:05:25 +08:00
file_ops_pre_init ( ) ; /* pre-initialize the file types */
1998-01-20 08:12:21 +08:00
RESET_BAR ( ) ;
1997-11-25 06:05:25 +08:00
xcf_init ( ) ; /* initialize the xcf file format routines */
1998-10-30 18:21:33 +08:00
gimp_init_parasites ( ) ; /* initialize the parasite table */
1998-03-27 02:24:42 +08:00
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
app_init_update_status ( _ ( " Looking for data files " ) , _ ( " Brushes " ) , 0.00 ) ;
1998-03-27 02:24:42 +08:00
brushes_init ( no_data ) ; /* initialize the list of gimp brushes */
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
app_init_update_status ( NULL , _ ( " Patterns " ) , 0.25 ) ;
1998-03-27 02:24:42 +08:00
patterns_init ( no_data ) ; /* initialize the list of gimp patterns */
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
app_init_update_status ( NULL , _ ( " Palettes " ) , 0.50 ) ;
1998-03-27 02:24:42 +08:00
palettes_init ( no_data ) ; /* initialize the list of gimp palettes */
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
app_init_update_status ( NULL , _ ( " Gradients " ) , 0.75 ) ;
1998-03-27 02:24:42 +08:00
gradients_init ( no_data ) ; /* initialize the list of gimp gradients */
1998-04-15 03:24:23 +08:00
app_init_update_status ( NULL , NULL , 1.00 ) ;
1998-03-27 02:24:42 +08:00
1997-11-25 06:05:25 +08:00
plug_in_init ( ) ; /* initialize the plug in structures */
1998-01-20 08:12:21 +08:00
RESET_BAR ( ) ;
1997-11-25 06:05:25 +08:00
file_ops_post_init ( ) ; /* post-initialize the file types */
/* Add the swap file */
if ( swap_path = = NULL )
swap_path = " /tmp " ;
path = g_new ( gchar , strlen ( swap_path ) + 32 ) ;
sprintf ( path , " %s/gimpswap.%ld " , swap_path , ( long ) getpid ( ) ) ;
tile_swap_add ( path , NULL , NULL ) ;
g_free ( path ) ;
1998-01-20 08:12:21 +08:00
destroy_initialization_status_window ( ) ;
1997-11-25 06:05:25 +08:00
/* Things to do only if there is an interface */
if ( no_interface = = FALSE )
{
1998-06-06 11:49:01 +08:00
devices_init ( ) ;
1998-06-23 01:30:40 +08:00
session_init ( ) ;
1997-11-25 06:05:25 +08:00
create_toolbox ( ) ;
gximage_init ( ) ;
render_setup ( transparency_type , transparency_size ) ;
tools_options_dialog_new ( ) ;
tools_select ( RECT_SELECT ) ;
1998-07-29 05:11:47 +08:00
/* FIXME: This needs to go in preferences */
1998-06-20 07:45:54 +08:00
message_handler = MESSAGE_BOX ;
1997-11-25 06:05:25 +08:00
}
color_transfer_init ( ) ;
get_active_brush ( ) ;
get_active_pattern ( ) ;
paint_funcs_setup ( ) ;
1998-01-20 08:12:21 +08:00
1998-07-12 06:23:23 +08:00
if ( no_interface = = FALSE )
1998-08-13 23:25:41 +08:00
{
devices_restore ( ) ; /* Must be done AFTER get_active_{brush|pattern}
* because these functions set the brush / pattern .
*/
session_restore ( ) ;
}
1997-11-25 06:05:25 +08:00
}
1998-02-28 00:55:59 +08:00
int
1998-02-05 13:41:05 +08:00
app_exit_finish_done ( void )
{
return is_app_exit_finish_done ;
}
1998-02-04 06:54:35 +08:00
void
1998-05-12 17:53:24 +08:00
app_exit_finish ( void )
1997-11-25 06:05:25 +08:00
{
1998-02-05 13:41:05 +08:00
if ( app_exit_finish_done ( ) )
return ;
is_app_exit_finish_done = TRUE ;
1998-02-04 06:54:35 +08:00
1998-06-20 07:45:54 +08:00
message_handler = CONSOLE ;
1998-07-12 06:23:23 +08:00
we_are_exiting = TRUE ;
1998-05-30 15:32:37 +08:00
1998-08-13 23:25:41 +08:00
device_status_free ( ) ;
1997-11-25 06:05:25 +08:00
lc_dialog_free ( ) ;
gdisplays_delete ( ) ;
global_edit_free ( ) ;
named_buffers_free ( ) ;
swapping_free ( ) ;
brushes_free ( ) ;
patterns_free ( ) ;
palettes_free ( ) ;
gradients_free ( ) ;
1998-06-23 01:30:40 +08:00
grad_free_gradient_editor ( ) ;
1997-11-25 06:05:25 +08:00
hue_saturation_free ( ) ;
curves_free ( ) ;
levels_free ( ) ;
brush_select_dialog_free ( ) ;
pattern_select_dialog_free ( ) ;
palette_free ( ) ;
paint_funcs_free ( ) ;
plug_in_kill ( ) ;
1998-07-08 06:42:35 +08:00
procedural_db_free ( ) ;
1998-08-03 03:05:02 +08:00
error_console_free ( ) ;
1997-11-25 06:05:25 +08:00
menus_quit ( ) ;
tile_swap_exit ( ) ;
/* Things to do only if there is an interface */
if ( no_interface = = FALSE )
{
gximage_free ( ) ;
render_free ( ) ;
tools_options_dialog_free ( ) ;
1998-06-23 01:30:40 +08:00
save_sessionrc ( ) ;
1997-11-25 06:05:25 +08:00
}
1998-06-23 01:30:40 +08:00
1998-02-04 06:54:35 +08:00
/* gtk_exit (0); */
gtk_main_quit ( ) ;
1997-11-25 06:05:25 +08:00
}
void
app_exit ( int kill_it )
{
/* If it's the user's perogative, and there are dirty images */
if ( kill_it = = 0 & & gdisplays_dirty ( ) & & no_interface = = FALSE )
really_quit_dialog ( ) ;
1998-02-05 13:41:05 +08:00
else if ( no_interface = = FALSE )
1998-07-08 18:29:09 +08:00
{
toolbox_free ( ) ;
1998-07-20 23:07:13 +08:00
close_idea_window ( ) ;
1998-07-08 18:29:09 +08:00
}
1998-02-05 13:41:05 +08:00
else
app_exit_finish ( ) ;
1997-11-25 06:05:25 +08:00
}
/********************************************************
* Routines to query exiting the application *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
really_quit_callback ( GtkButton * button ,
GtkWidget * dialog )
{
gtk_widget_destroy ( dialog ) ;
1998-02-04 06:54:35 +08:00
toolbox_free ( ) ;
1998-07-08 18:29:09 +08:00
close_idea_window ( ) ;
1997-11-25 06:05:25 +08:00
}
static void
1998-03-15 11:15:35 +08:00
really_quit_cancel_callback ( GtkWidget * widget ,
1997-11-25 06:05:25 +08:00
GtkWidget * dialog )
{
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
menus_set_sensitive ( _ ( " <Toolbox>/File/Quit " ) , TRUE ) ;
menus_set_sensitive ( _ ( " <Image>/File/Quit " ) , TRUE ) ;
1997-11-25 06:05:25 +08:00
gtk_widget_destroy ( dialog ) ;
}
static gint
really_quit_delete_callback ( GtkWidget * widget ,
GdkEvent * event ,
1998-07-20 23:07:13 +08:00
gpointer client_data )
1997-11-25 06:05:25 +08:00
{
1998-03-15 11:15:35 +08:00
really_quit_cancel_callback ( widget , ( GtkWidget * ) client_data ) ;
1997-11-25 06:05:25 +08:00
1998-03-13 06:01:43 +08:00
return TRUE ;
1997-11-25 06:05:25 +08:00
}
static void
really_quit_dialog ( )
{
GtkWidget * dialog ;
GtkWidget * button ;
GtkWidget * label ;
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
menus_set_sensitive ( _ ( " <Toolbox>/File/Quit " ) , FALSE ) ;
menus_set_sensitive ( _ ( " <Image>/File/Quit " ) , FALSE ) ;
1997-11-25 06:05:25 +08:00
dialog = gtk_dialog_new ( ) ;
1998-01-26 06:13:00 +08:00
gtk_window_set_wmclass ( GTK_WINDOW ( dialog ) , " really_quit " , " Gimp " ) ;
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
gtk_window_set_title ( GTK_WINDOW ( dialog ) , _ ( " Really Quit? " ) ) ;
1997-11-25 06:05:25 +08:00
gtk_window_position ( GTK_WINDOW ( dialog ) , GTK_WIN_POS_MOUSE ) ;
gtk_container_border_width ( GTK_CONTAINER ( GTK_DIALOG ( dialog ) - > action_area ) , 2 ) ;
gtk_signal_connect ( GTK_OBJECT ( dialog ) , " delete_event " ,
( GtkSignalFunc ) really_quit_delete_callback ,
dialog ) ;
1998-07-20 23:07:13 +08:00
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
button = gtk_button_new_with_label ( _ ( " Yes " ) ) ;
1997-11-25 06:05:25 +08:00
GTK_WIDGET_SET_FLAGS ( button , GTK_CAN_DEFAULT ) ;
gtk_signal_connect ( GTK_OBJECT ( button ) , " clicked " ,
( GtkSignalFunc ) really_quit_callback ,
dialog ) ;
gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) - > action_area ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_grab_default ( button ) ;
gtk_widget_show ( button ) ;
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
button = gtk_button_new_with_label ( _ ( " No " ) ) ;
1997-11-25 06:05:25 +08:00
GTK_WIDGET_SET_FLAGS ( button , GTK_CAN_DEFAULT ) ;
gtk_signal_connect ( GTK_OBJECT ( button ) , " clicked " ,
( GtkSignalFunc ) really_quit_cancel_callback ,
dialog ) ;
gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) - > action_area ) , button , TRUE , TRUE , 0 ) ;
gtk_widget_show ( button ) ;
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
label = gtk_label_new ( _ ( " Some files unsaved. Quit the GIMP? " ) ) ;
1997-11-25 06:05:25 +08:00
gtk_misc_set_padding ( GTK_MISC ( label ) , 10 , 1 ) ;
gtk_box_pack_start ( GTK_BOX ( GTK_DIALOG ( dialog ) - > vbox ) , label , TRUE , TRUE , 0 ) ;
gtk_widget_show ( label ) ;
gtk_widget_show ( dialog ) ;
}
static Argument *
quit_invoker ( Argument * args )
{
Argument * return_args ;
int kill_it ;
kill_it = args [ 0 ] . value . pdb_int ;
app_exit ( kill_it ) ;
return_args = procedural_db_return_args ( & quit_proc , TRUE ) ;
return return_args ;
}
1998-07-21 08:15:24 +08:00