2000-02-25 00:11:26 +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-12-17 05:37:03 +08:00
1999-02-21 07:20:54 +08:00
# include "config.h"
1997-11-25 06:05:25 +08:00
# include <errno.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
2001-08-17 22:27:31 +08:00
# include <glib-object.h>
1997-11-25 06:05:25 +08:00
2001-05-10 06:34:59 +08:00
# include "core/core-types.h"
2000-12-29 23:22:01 +08:00
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
# include "core/gimp.h"
2001-05-09 10:32:03 +08:00
# include "core/gimpimage.h"
2001-07-04 02:38:56 +08:00
2001-12-01 08:14:14 +08:00
# include "pdb/procedural_db.h"
2002-03-21 01:46:13 +08:00
# include "plug-in/plug-ins.h"
2001-12-19 08:13:16 +08:00
# include "plug-in/plug-in-proc.h"
2001-12-01 08:14:14 +08:00
2001-07-04 02:38:56 +08:00
# include "xcf.h"
# include "xcf-private.h"
# include "xcf-load.h"
# include "xcf-read.h"
# include "xcf-save.h"
2001-05-09 10:32:03 +08:00
2000-04-28 01:27:28 +08:00
# include "libgimp/gimpintl.h"
1997-11-25 06:05:25 +08:00
2001-07-05 03:31:35 +08:00
typedef GimpImage * GimpXcfLoaderFunc ( Gimp * gimp ,
XcfInfo * info ) ;
1997-11-25 06:05:25 +08:00
2001-07-05 03:31:35 +08:00
static Argument * xcf_load_invoker ( Gimp * gimp ,
Argument * args ) ;
static Argument * xcf_save_invoker ( Gimp * gimp ,
Argument * args ) ;
1997-11-25 06:05:25 +08:00
static ProcArg xcf_load_args [ ] =
{
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" dummy_param " ,
1998-12-16 08:37:09 +08:00
" dummy parameter " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_STRING ,
1997-11-25 06:05:25 +08:00
" filename " ,
1998-12-16 08:37:09 +08:00
" The name of the file to load " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_STRING ,
1997-11-25 06:05:25 +08:00
" raw_filename " ,
1998-12-16 08:37:09 +08:00
" The name of the file to load " } ,
1997-11-25 06:05:25 +08:00
} ;
static ProcArg xcf_load_return_vals [ ] =
{
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1998-12-16 08:37:09 +08:00
" Output image " } ,
1997-11-25 06:05:25 +08:00
} ;
static PlugInProcDef xcf_plug_in_load_proc =
{
" gimp_xcf_load " ,
1999-10-27 10:01:27 +08:00
" <Load>/XCF (GIMP) " ,
1997-11-25 06:05:25 +08:00
NULL ,
" xcf " ,
" " ,
" 0,string,gimp \\ 040xcf \\ 040 " ,
NULL , /* ignored for load */
0 , /* ignored for load */
{
" gimp_xcf_load " ,
1998-12-16 08:37:09 +08:00
" loads file saved in the .xcf file format " ,
" The xcf file format has been designed specifically for loading and saving tiled and layered images in the GIMP. This procedure will load the specified file. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
1997-11-25 06:05:25 +08:00
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
3 ,
xcf_load_args ,
1 ,
xcf_load_return_vals ,
{ { xcf_load_invoker } } ,
} ,
NULL , /* fill me in at runtime */
2001-12-28 01:58:30 +08:00
NULL , /* fill me in at runtime */
NULL , /* fill me in at runtime */
0
1997-11-25 06:05:25 +08:00
} ;
static ProcArg xcf_save_args [ ] =
{
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_INT32 ,
1997-11-25 06:05:25 +08:00
" dummy_param " ,
1998-12-16 08:37:09 +08:00
" dummy parameter " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_IMAGE ,
1997-11-25 06:05:25 +08:00
" image " ,
1998-12-16 08:37:09 +08:00
" Input image " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_DRAWABLE ,
1997-11-25 06:05:25 +08:00
" drawable " ,
1998-12-16 08:37:09 +08:00
" Active drawable of input image " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_STRING ,
1997-11-25 06:05:25 +08:00
" filename " ,
1998-12-16 08:37:09 +08:00
" The name of the file to save the image in " } ,
2001-05-21 21:58:46 +08:00
{ GIMP_PDB_STRING ,
1997-11-25 06:05:25 +08:00
" raw_filename " ,
1998-12-16 08:37:09 +08:00
" The name of the file to load " } ,
1997-11-25 06:05:25 +08:00
} ;
static PlugInProcDef xcf_plug_in_save_proc =
{
" gimp_xcf_save " ,
1999-10-27 10:01:27 +08:00
" <Save>/XCF (GIMP) " ,
1997-11-25 06:05:25 +08:00
NULL ,
" xcf " ,
" " ,
NULL ,
" RGB*, GRAY*, INDEXED* " ,
0 , /* fill me in at runtime */
{
" gimp_xcf_save " ,
1998-12-16 08:37:09 +08:00
" saves file in the .xcf file format " ,
" The xcf file format has been designed specifically for loading and saving tiled and layered images in the GIMP. This procedure will save the specified image in the xcf file format. " ,
" Spencer Kimball & Peter Mattis " ,
" Spencer Kimball & Peter Mattis " ,
1997-11-25 06:05:25 +08:00
" 1995-1996 " ,
2001-05-21 21:58:46 +08:00
GIMP_INTERNAL ,
1997-11-25 06:05:25 +08:00
5 ,
xcf_save_args ,
0 ,
NULL ,
{ { xcf_save_invoker } } ,
} ,
NULL , /* fill me in at runtime */
2001-12-28 01:58:30 +08:00
NULL , /* fill me in at runtime */
NULL , /* fill me in at runtime */
0
1997-11-25 06:05:25 +08:00
} ;
2001-07-04 02:38:56 +08:00
static GimpXcfLoaderFunc * xcf_loaders [ ] =
1997-11-25 06:05:25 +08:00
{
2001-07-04 02:38:56 +08:00
xcf_load_image , /* version 0 */
2002-11-06 18:07:31 +08:00
xcf_load_image , /* version 1 */
xcf_load_image /* version 2 */
1997-11-25 06:05:25 +08:00
} ;
2001-07-04 02:38:56 +08:00
static gint n_xcf_loaders = sizeof ( xcf_loaders ) / sizeof ( xcf_loaders [ 0 ] ) ;
1997-11-25 06:05:25 +08:00
void
2001-07-05 03:31:35 +08:00
xcf_init ( Gimp * gimp )
1997-11-25 06:05:25 +08:00
{
2001-10-19 01:27:36 +08:00
g_return_if_fail ( GIMP_IS_GIMP ( gimp ) ) ;
1997-11-25 06:05:25 +08:00
/* So this is sort of a hack, but its better than it was before. To do this
* right there would be a file load - save handler type and the whole interface
* would change but there isn ' t , and currently the plug - in structure contains
* all the load - save info , so it makes sense to use that for the XCF load / save
* handlers , even though they are internal . The only thing it requires is
2001-07-04 02:38:56 +08:00
* using a PlugInProcDef struct . - josh
*/
2001-07-05 03:31:35 +08:00
procedural_db_register ( gimp , & xcf_plug_in_save_proc . db_info ) ;
procedural_db_register ( gimp , & xcf_plug_in_load_proc . db_info ) ;
2001-07-04 02:38:56 +08:00
xcf_plug_in_save_proc . image_types_val =
2002-03-21 01:46:13 +08:00
plug_ins_image_types_parse ( xcf_plug_in_save_proc . image_types ) ;
2001-07-04 02:38:56 +08:00
xcf_plug_in_load_proc . image_types_val =
2002-03-21 01:46:13 +08:00
plug_ins_image_types_parse ( xcf_plug_in_load_proc . image_types ) ;
2001-07-04 02:38:56 +08:00
2002-03-21 01:46:13 +08:00
plug_ins_add_internal ( & xcf_plug_in_save_proc ) ;
plug_ins_add_internal ( & xcf_plug_in_load_proc ) ;
1997-11-25 06:05:25 +08:00
}
2001-07-04 02:38:56 +08:00
void
2001-10-19 01:27:36 +08:00
xcf_exit ( Gimp * gimp )
2001-07-04 02:38:56 +08:00
{
2001-10-19 01:27:36 +08:00
g_return_if_fail ( GIMP_IS_GIMP ( gimp ) ) ;
2001-07-04 02:38:56 +08:00
}
1997-11-25 06:05:25 +08:00
static Argument *
2001-07-05 03:31:35 +08:00
xcf_load_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
2001-03-08 10:01:52 +08:00
XcfInfo info ;
Argument * return_args ;
GimpImage * gimage ;
gchar * filename ;
gboolean success ;
gchar id [ 14 ] ;
1997-11-25 06:05:25 +08:00
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
gimp_set_busy ( gimp ) ;
1999-01-11 07:36:29 +08:00
1997-11-25 06:05:25 +08:00
gimage = NULL ;
success = FALSE ;
filename = args [ 1 ] . value . pdb_pointer ;
1998-05-30 03:42:32 +08:00
info . fp = fopen ( filename , " rb " ) ;
2001-07-04 02:38:56 +08:00
1997-11-25 06:05:25 +08:00
if ( info . fp )
{
2001-07-04 02:38:56 +08:00
info . cp = 0 ;
info . filename = filename ;
info . active_layer = NULL ;
info . active_channel = NULL ;
1998-01-22 15:02:57 +08:00
info . floating_sel_drawable = NULL ;
2001-07-04 02:38:56 +08:00
info . floating_sel = NULL ;
info . floating_sel_offset = 0 ;
info . swap_num = 0 ;
info . ref_count = NULL ;
info . compression = COMPRESS_NONE ;
1997-11-25 06:05:25 +08:00
success = TRUE ;
2001-07-04 02:38:56 +08:00
1997-11-25 06:05:25 +08:00
info . cp + = xcf_read_int8 ( info . fp , ( guint8 * ) id , 14 ) ;
2001-07-04 02:38:56 +08:00
1997-11-25 06:05:25 +08:00
if ( strncmp ( id , " gimp xcf " , 9 ) ! = 0 )
2001-07-04 02:38:56 +08:00
{
success = FALSE ;
}
1997-11-25 06:05:25 +08:00
else if ( strcmp ( id + 9 , " file " ) = = 0 )
{
info . file_version = 0 ;
}
else if ( id [ 9 ] = = ' v ' )
{
info . file_version = atoi ( id + 10 ) ;
}
2001-07-04 02:38:56 +08:00
else
{
success = FALSE ;
}
1997-11-25 06:05:25 +08:00
if ( success )
{
2001-07-04 02:38:56 +08:00
if ( info . file_version < n_xcf_loaders )
1997-11-25 06:05:25 +08:00
{
2001-07-05 03:31:35 +08:00
gimage = ( * ( xcf_loaders [ info . file_version ] ) ) ( gimp , & info ) ;
2001-07-04 02:38:56 +08:00
if ( ! gimage )
1998-04-13 17:17:27 +08:00
success = FALSE ;
1997-11-25 06:05:25 +08:00
}
else
{
2001-07-04 02:38:56 +08:00
g_message ( _ ( " XCF error: unsupported XCF file version %d "
" encountered " ) , info . file_version ) ;
1997-11-25 06:05:25 +08:00
success = FALSE ;
}
}
2001-07-04 02:38:56 +08:00
1997-12-17 01:26:00 +08:00
fclose ( info . fp ) ;
1997-11-25 06:05:25 +08:00
}
2001-07-04 02:38:56 +08:00
return_args = procedural_db_return_args ( & xcf_plug_in_load_proc . db_info ,
success ) ;
1997-11-25 06:05:25 +08:00
if ( success )
2001-04-13 22:50:43 +08:00
return_args [ 1 ] . value . pdb_int = gimp_image_get_ID ( gimage ) ;
1997-11-25 06:05:25 +08:00
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
gimp_unset_busy ( gimp ) ;
1999-01-11 07:36:29 +08:00
1997-11-25 06:05:25 +08:00
return return_args ;
}
2001-03-08 10:01:52 +08:00
static Argument *
2001-07-05 03:31:35 +08:00
xcf_save_invoker ( Gimp * gimp ,
Argument * args )
1997-11-25 06:05:25 +08:00
{
2001-03-08 10:01:52 +08:00
XcfInfo info ;
Argument * return_args ;
GimpImage * gimage ;
gchar * filename ;
gboolean success ;
1997-11-25 06:05:25 +08:00
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
gimp_set_busy ( gimp ) ;
1999-01-11 07:36:29 +08:00
1997-11-25 06:05:25 +08:00
success = FALSE ;
2001-07-11 20:39:49 +08:00
gimage = gimp_image_get_by_ID ( gimp , args [ 1 ] . value . pdb_int ) ;
1997-11-25 06:05:25 +08:00
filename = args [ 3 ] . value . pdb_pointer ;
1998-05-30 03:42:32 +08:00
info . fp = fopen ( filename , " wb " ) ;
2001-07-04 02:38:56 +08:00
1997-11-25 06:05:25 +08:00
if ( info . fp )
{
2001-07-04 02:38:56 +08:00
info . cp = 0 ;
info . filename = filename ;
info . active_layer = NULL ;
info . active_channel = NULL ;
1998-01-22 15:02:57 +08:00
info . floating_sel_drawable = NULL ;
2001-07-04 02:38:56 +08:00
info . floating_sel = NULL ;
info . floating_sel_offset = 0 ;
info . swap_num = 0 ;
info . ref_count = NULL ;
info . compression = COMPRESS_RLE ;
1997-11-25 06:05:25 +08:00
xcf_save_choose_format ( & info , gimage ) ;
success = xcf_save_image ( & info , gimage ) ;
fclose ( info . fp ) ;
}
else
{
2001-07-04 02:38:56 +08:00
g_message ( _ ( " open failed on %s: %s \n " ) , filename , g_strerror ( errno ) ) ;
1997-11-25 06:05:25 +08:00
}
2001-07-04 02:38:56 +08:00
return_args = procedural_db_return_args ( & xcf_plug_in_save_proc . db_info ,
success ) ;
1997-11-25 06:05:25 +08:00
removed the gimp_busy boolean, check whether user_installation is needed
2001-07-10 Michael Natterer <mitch@gimp.org>
* app/app_procs.[ch]: removed the gimp_busy boolean, check whether
user_installation is needed here, not in user_install.c, parse
gtkrc an friends only if(!no_interface), create the Gimp object
before parsing gimp's rc files an pas it to the parse functions,
many other cleanups.
* app/appenums.h: added MessageHandlerType and StackTraceMode.
* app/appenv.h: removed MessageHandlerType, declare all global
variables from main.c (no more hidden global stuff please).
* app/errors.[ch]: added the fatal message func here (from main.c),
removed the StackTraceMode enum.
* app/gimprc.[ch]: renamed functions to gimprc_*(), pass a Gimp
pointer to some functions.
* app/gimpunit.c
* app/unitrc.h: ok, this is ugly: renamed all functions to
_gimp_unit_*() and made them public. The unit list is part
of the Gimp object now, so pass a Gimp* to all functions.
* app/libgimp_glue.[ch]: added EEKy wrappers for all gimp_unit_*()
functions which are used by widgets.
* app/main.c: cleaned up the global variables, removed the fatal
message handler, call app_init() directly, not via the
user_install stuff, misc. cleanups.
* app/user_install.[ch]: removed the check if user_installation is
needed (done by app_procs.c now).
* app/core/gimp.[ch]: added the user_unit list and the "busy"
boolean. Moved gimp_[set|unset]_busy() here. Added
gimp_initialize() which is called after unitrc and gimprc are
parsed.
* app/batch.c
* app/colormaps.c
* app/devices.c
* app/disp_callbacks.c
* app/gdisplay_ops.c
* app/gimphelp.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/core/gimpcontext.c
* app/core/gimpdatafiles.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage.c
* app/core/gimpparasite.c
* app/core/gimpparasitelist.h
* app/gui/file-open-dialog.c
* app/gui/gui.[ch]
* app/gui/info-dialog.c
* app/gui/info-window.c
* app/gui/preferences-dialog.c
* app/gui/session.c
* app/gui/tips-dialog.c
* app/gui/toolbox.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimptransformtool.c
* app/tools/tool_manager.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcursor.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/xcf/xcf.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/app.pl
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/unit.pdb
* app/pdb/image_cmds.c
* app/pdb/message_cmds.c
* app/pdb/unit_cmds.c: changed accordingly, minor cleanups.
2001-07-11 03:16:16 +08:00
gimp_unset_busy ( gimp ) ;
1999-01-11 07:36:29 +08:00
1997-11-25 06:05:25 +08:00
return return_args ;
}