mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00

2001-08-17 Michael Natterer <mitch@gimp.org> * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include <glib-object.h> instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated.
117 lines
3.1 KiB
C
117 lines
3.1 KiB
C
/* 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.
|
|
*/
|
|
|
|
/* Session-managment stuff Copyright (C) 1998 Sven Neumann <sven@gimp.org>
|
|
|
|
I include a short description here on what is done and what problems
|
|
are left:
|
|
|
|
Since everything saved in sessionrc changes often (with each session?)
|
|
the whole file is rewritten each time the gimp exits. I don't see any
|
|
use in implementing a more flexible scheme like it is used for gimprc.
|
|
|
|
Right now session-managment is limited to window geometry. Restoring
|
|
openend images is planned, but I'm still not sure how to deal with dirty
|
|
images.
|
|
|
|
Dialogs are now reopened if the gimp is called with the command-line-option
|
|
--restore-session or if the related entry is set in gimprc.
|
|
Probably there should alternatively be a list of dialogs in the preferences
|
|
that should always be opened on start-up.
|
|
|
|
Please point me into the right direction to make this work with Gnome-SM.
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
#include "gui-types.h"
|
|
|
|
#include "widgets/gimpdialogfactory.h"
|
|
|
|
#include "color-notebook.h"
|
|
#include "session.h"
|
|
|
|
#include "app_procs.h"
|
|
#include "appenv.h"
|
|
#include "gimprc.h"
|
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
void
|
|
session_init (void)
|
|
{
|
|
gchar *filename;
|
|
|
|
filename = gimp_personal_rc_file ("sessionrc");
|
|
app_init_update_status (NULL, filename, -1);
|
|
|
|
if (! gimprc_parse_file (filename))
|
|
{
|
|
/* always show L&C&P, Tool Options and Brushes on first invocation */
|
|
|
|
/* TODO */
|
|
}
|
|
|
|
g_free (filename);
|
|
}
|
|
|
|
void
|
|
session_restore (void)
|
|
{
|
|
if (restore_session)
|
|
gimp_dialog_factories_session_restore ();
|
|
}
|
|
|
|
void
|
|
session_save (void)
|
|
{
|
|
gchar *filename;
|
|
FILE *fp;
|
|
|
|
filename = gimp_personal_rc_file ("sessionrc");
|
|
|
|
fp = fopen (filename, "wt");
|
|
g_free (filename);
|
|
if (!fp)
|
|
return;
|
|
|
|
fprintf (fp, ("# GIMP sessionrc\n"
|
|
"# This file takes session-specific info (that is info,\n"
|
|
"# you want to keep between two gimp-sessions). You are\n"
|
|
"# not supposed to edit it manually, but of course you\n"
|
|
"# can do. This file will be entirely rewritten every time\n"
|
|
"# you quit the gimp. If this file isn't found, defaults\n"
|
|
"# are used.\n\n"));
|
|
|
|
gimp_dialog_factories_session_save (fp);
|
|
|
|
/* save last tip shown */
|
|
fprintf (fp, "(last-tip-shown %d)\n\n", gimprc.last_tip + 1);
|
|
|
|
color_history_write (fp);
|
|
|
|
fclose (fp);
|
|
}
|