mirror of https://github.com/GNOME/gimp.git
app/base/Makefile.am new files for base_init() and base_exit() which
2001-05-20 Michael Natterer <mitch@gimp.org> * app/base/Makefile.am * app/base/base.[ch]: new files for base_init() and base_exit() which initialize/shutdown the paint_funcs and the tile_cache. * app/app_procs.c: removed the stuff here. * app/widgets/gimpchannellistitem.c: commented out unused code.
This commit is contained in:
parent
a6cce18427
commit
711a8e707e
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2001-05-20 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/base/Makefile.am
|
||||
* app/base/base.[ch]: new files for base_init() and base_exit()
|
||||
which initialize/shutdown the paint_funcs and the tile_cache.
|
||||
|
||||
* app/app_procs.c: removed the stuff here.
|
||||
|
||||
* app/widgets/gimpchannellistitem.c: commented out unused code.
|
||||
|
||||
2001-05-20 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
|
|
|
@ -18,27 +18,14 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
@ -46,11 +33,7 @@
|
|||
#include "core/core-types.h"
|
||||
#include "tools/tools-types.h"
|
||||
|
||||
#include "base/base-config.h"
|
||||
#include "base/temp-buf.h"
|
||||
#include "base/tile-swap.h"
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
#include "base/base.h"
|
||||
|
||||
#include "core/gimpdatafactory.h"
|
||||
|
||||
|
@ -94,8 +77,7 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
static void app_init (void);
|
||||
static void toast_old_temp_files (void);
|
||||
static void app_init (void);
|
||||
|
||||
|
||||
/* FIXME: gimp_busy HACK */
|
||||
|
@ -147,7 +129,6 @@ app_init (void)
|
|||
{
|
||||
const gchar *gtkrc;
|
||||
gchar *filename;
|
||||
gchar *path;
|
||||
|
||||
/* parse the systemwide gtkrc */
|
||||
gtkrc = gimp_gtkrc ();
|
||||
|
@ -244,16 +225,8 @@ app_init (void)
|
|||
|
||||
RESET_BAR();
|
||||
|
||||
/* Add the swap file */
|
||||
if (base_config->swap_path == NULL)
|
||||
base_config->swap_path = g_get_tmp_dir ();
|
||||
|
||||
toast_old_temp_files ();
|
||||
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimpswap.%lu",
|
||||
base_config->swap_path,
|
||||
(unsigned long) getpid ());
|
||||
tile_swap_add (path, NULL, NULL);
|
||||
g_free (path);
|
||||
/* initialize lowlevel stuff */
|
||||
base_init ();
|
||||
|
||||
if (! no_interface)
|
||||
{
|
||||
|
@ -267,7 +240,6 @@ app_init (void)
|
|||
}
|
||||
|
||||
color_transfer_init ();
|
||||
paint_funcs_setup ();
|
||||
|
||||
if (! no_interface)
|
||||
{
|
||||
|
@ -304,15 +276,12 @@ app_exit_finish (void)
|
|||
gdisplays_delete ();
|
||||
global_edit_free ();
|
||||
named_buffers_free ();
|
||||
swapping_free ();
|
||||
context_manager_free ();
|
||||
hue_saturation_free ();
|
||||
curves_free ();
|
||||
levels_free ();
|
||||
paint_funcs_free ();
|
||||
plug_in_kill ();
|
||||
procedural_db_free ();
|
||||
tile_swap_exit ();
|
||||
save_unitrc ();
|
||||
gimp_parasiterc_save ();
|
||||
|
||||
|
@ -321,6 +290,8 @@ app_exit_finish (void)
|
|||
gui_exit ();
|
||||
}
|
||||
|
||||
base_exit ();
|
||||
|
||||
/* There used to be gtk_main_quit() here, but there's a chance
|
||||
* that gtk_main() was never called before we reach this point. --Sven
|
||||
*/
|
||||
|
@ -375,45 +346,3 @@ gimp_unset_busy (void)
|
|||
/* FIXME: gimp_busy HACK */
|
||||
gimp_busy = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
toast_old_temp_files (void)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
GString *filename = g_string_new ("");
|
||||
|
||||
dir = opendir (base_config->swap_path);
|
||||
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
while ((entry = readdir (dir)) != NULL)
|
||||
if (!strncmp (entry->d_name, "gimpswap.", 9))
|
||||
{
|
||||
/* don't try to kill swap files of running processes
|
||||
* yes, I know they might not all be gimp processes, and when you
|
||||
* unlink, it's refcounted, but lets not confuse the user by
|
||||
* "where did my disk space go?" cause the filename is gone
|
||||
* if the kill succeeds, and there running process isn't gimp
|
||||
* we'll probably get it the next time around
|
||||
*/
|
||||
|
||||
gint pid = atoi (entry->d_name + 9);
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill (pid, 0))
|
||||
#endif
|
||||
{
|
||||
/* On Windows, you can't remove open files anyhow,
|
||||
* so no harm trying.
|
||||
*/
|
||||
g_string_sprintf (filename, "%s" G_DIR_SEPARATOR_S "%s",
|
||||
base_config->swap_path, entry->d_name);
|
||||
unlink (filename->str);
|
||||
}
|
||||
}
|
||||
|
||||
closedir (dir);
|
||||
|
||||
g_string_free (filename, TRUE);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
noinst_LTLIBRARIES = libappbase.la
|
||||
|
||||
libappbase_la_SOURCES = \
|
||||
base.c \
|
||||
base.h \
|
||||
base-types.h \
|
||||
base-config.c \
|
||||
base-config.h \
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
/* 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
#include "base-types.h"
|
||||
|
||||
#include "base.h"
|
||||
#include "base-config.h"
|
||||
#include "temp-buf.h"
|
||||
#include "tile-swap.h"
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
|
||||
static void toast_old_temp_files (void);
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
base_init (void)
|
||||
{
|
||||
gchar *path;
|
||||
|
||||
/* Add the swap file */
|
||||
if (base_config->swap_path == NULL)
|
||||
base_config->swap_path = g_get_tmp_dir ();
|
||||
|
||||
toast_old_temp_files ();
|
||||
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimpswap.%lu",
|
||||
base_config->swap_path,
|
||||
(unsigned long) getpid ());
|
||||
tile_swap_add (path, NULL, NULL);
|
||||
g_free (path);
|
||||
|
||||
paint_funcs_setup ();
|
||||
}
|
||||
|
||||
void
|
||||
base_exit (void)
|
||||
{
|
||||
swapping_free ();
|
||||
paint_funcs_free ();
|
||||
tile_swap_exit ();
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
toast_old_temp_files (void)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
GString *filename = g_string_new ("");
|
||||
|
||||
dir = opendir (base_config->swap_path);
|
||||
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
while ((entry = readdir (dir)) != NULL)
|
||||
if (!strncmp (entry->d_name, "gimpswap.", 9))
|
||||
{
|
||||
/* don't try to kill swap files of running processes
|
||||
* yes, I know they might not all be gimp processes, and when you
|
||||
* unlink, it's refcounted, but lets not confuse the user by
|
||||
* "where did my disk space go?" cause the filename is gone
|
||||
* if the kill succeeds, and there running process isn't gimp
|
||||
* we'll probably get it the next time around
|
||||
*/
|
||||
|
||||
gint pid = atoi (entry->d_name + 9);
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill (pid, 0))
|
||||
#endif
|
||||
{
|
||||
/* On Windows, you can't remove open files anyhow,
|
||||
* so no harm trying.
|
||||
*/
|
||||
g_string_sprintf (filename, "%s" G_DIR_SEPARATOR_S "%s",
|
||||
base_config->swap_path, entry->d_name);
|
||||
unlink (filename->str);
|
||||
}
|
||||
}
|
||||
|
||||
closedir (dir);
|
||||
|
||||
g_string_free (filename, TRUE);
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BASE_H__
|
||||
#define __BASE_H__
|
||||
|
||||
|
||||
void base_init (void);
|
||||
void base_exit (void);
|
||||
|
||||
|
||||
#endif /* __BASE_H__ */
|
|
@ -40,9 +40,11 @@
|
|||
static void gimp_channel_list_item_class_init (GimpChannelListItemClass *klass);
|
||||
static void gimp_channel_list_item_init (GimpChannelListItem *list_item);
|
||||
|
||||
/*
|
||||
static void gimp_channel_list_item_drop_color (GtkWidget *widget,
|
||||
const GimpRGB *color,
|
||||
gpointer data);
|
||||
*/
|
||||
|
||||
|
||||
GtkType
|
||||
|
@ -99,6 +101,7 @@ gimp_channel_list_item_init (GimpChannelListItem *list_item)
|
|||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
static void
|
||||
gimp_channel_list_item_drop_color (GtkWidget *widget,
|
||||
const GimpRGB *color,
|
||||
|
@ -121,3 +124,4 @@ gimp_channel_list_item_drop_color (GtkWidget *widget,
|
|||
gdisplays_flush ();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue