Commit 1bcd3e18 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/Makefile.am removed.

2001-07-07  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/context_manager.[ch]: removed.

	* app/app_procs.c: call tool_mananger instead of context_manager
	functions, pass "the_gimp" to some more functions.

	* app/drawable.[ch]: pass a GimpContext to drawable_fill().

	* app/errors.c: behave according to "stack_trace_mode" when using
	the debugging signal handler.

	* app/gimprc.[ch]: removed the core/ config variables.

	* app/selection.c: set the selection's state to INVISIBLE in
	selection_pause().

	* app/core/Makefile.am
	* app/core/gimpcoreconfig.[ch]: new files (the configuration
	variables used by core/).

	* app/core/gimpcontext.[ch]: removed the global contexts (user,
	default, ...) and their functions. It's no longer possible to pass
	NULL to the context functions to manipulate the current context
	(gimpcontext.c doesn't know the current context any more).

	* app/core/gimp.[ch]: added them here. The functions are now called
	gimp_[set|get]_*_context(). Added gimp_create_context() which is
	the only function to create contexts now.

	* app/gui/dialogs.[ch]
	* app/gui/gui.[ch]: pass "gimp" to all functions.

	* app/tools/tool_manager.[ch]
	* app/tools/tools.[ch]: pass "gimp" to lots of functions. Added
	the "global_tool_context" logic and the global/non-global paint
	options switching from the context_manager. Pass "gimp" to all
	tools' "register" functions.

	* app/tools/*: changed accordingly.

	* app/devices.c
	* app/disp_callbacks.c
	* app/file-open.[ch]
	* app/file-save.c
	* app/gdisplay.c
	* app/gimage.c
	* app/libgimp_glue.c
	* app/module_db.c
	* app/nav_window.c
	* app/plug_in.c
	* app/qmask.c
	* app/undo.c
	* app/base/base-config.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpdrawable-offset.c
	* app/core/gimpgradient.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage.c
	* app/core/gimppalette.c
	* app/core/gimptoolinfo.[ch]
	* app/core/gimpundo.c
	* app/gui/brush-select.c
	* app/gui/channels-commands.c
	* app/gui/color-area.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/gradient-select.c
	* app/gui/info-window.c
	* app/gui/layers-commands.c
	* app/gui/menus.c
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.c
	* app/gui/palette-select.c
	* app/gui/paths-dialog.c
	* app/gui/pattern-select.c
	* app/gui/preferences-dialog.c
	* app/gui/resize-dialog.c
	* app/gui/test-commands.c
	* app/gui/tool-options-dialog.c
	* app/gui/toolbox.c
	* app/gui/tools-commands.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/widgets/gimpchannellistview.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpdrawablelistview.[ch]
	* app/widgets/gimpimagedock.c
	* app/widgets/gimplayerlistview.c
	* app/pdb/brushes_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/palette_cmds.c
	* app/pdb/patterns_cmds.c
	* app/pdb/procedural_db.c
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/patterns.pdb: changed accordingly: remove usage
	of gimp_context_[get|set]_*(NULL), create contexts with
	gimp_create_context(). Get the user/current context with
	gimp_get_[user|current]_context(). Added/removed access to the
	global "the_gimp" variable in some places. Get the core's config
	variables from "core_config".
parent 94dbfa07
2001-07-07 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/context_manager.[ch]: removed.
* app/app_procs.c: call tool_mananger instead of context_manager
functions, pass "the_gimp" to some more functions.
* app/drawable.[ch]: pass a GimpContext to drawable_fill().
* app/errors.c: behave according to "stack_trace_mode" when using
the debugging signal handler.
* app/gimprc.[ch]: removed the core/ config variables.
* app/selection.c: set the selection's state to INVISIBLE in
selection_pause().
* app/core/Makefile.am
* app/core/gimpcoreconfig.[ch]: new files (the configuration
variables used by core/).
* app/core/gimpcontext.[ch]: removed the global contexts (user,
default, ...) and their functions. It's no longer possible to pass
NULL to the context functions to manipulate the current context
(gimpcontext.c doesn't know the current context any more).
* app/core/gimp.[ch]: added them here. The functions are now called
gimp_[set|get]_*_context(). Added gimp_create_context() which is
the only function to create contexts now.
* app/gui/dialogs.[ch]
* app/gui/gui.[ch]: pass "gimp" to all functions.
* app/tools/tool_manager.[ch]
* app/tools/tools.[ch]: pass "gimp" to lots of functions. Added
the "global_tool_context" logic and the global/non-global paint
options switching from the context_manager. Pass "gimp" to all
tools' "register" functions.
* app/tools/*: changed accordingly.
* app/devices.c
* app/disp_callbacks.c
* app/file-open.[ch]
* app/file-save.c
* app/gdisplay.c
* app/gimage.c
* app/libgimp_glue.c
* app/module_db.c
* app/nav_window.c
* app/plug_in.c
* app/qmask.c
* app/undo.c
* app/base/base-config.c
* app/core/gimpbrushpipe.c
* app/core/gimpdrawable-offset.c
* app/core/gimpgradient.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.c
* app/core/gimpimage-new.c
* app/core/gimpimage.c
* app/core/gimppalette.c
* app/core/gimptoolinfo.[ch]
* app/core/gimpundo.c
* app/gui/brush-select.c
* app/gui/channels-commands.c
* app/gui/color-area.c
* app/gui/dialogs-constructors.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradient-select.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/palette-editor.c
* app/gui/palette-import-dialog.c
* app/gui/palette-select.c
* app/gui/paths-dialog.c
* app/gui/pattern-select.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.c
* app/gui/test-commands.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* app/widgets/gimpchannellistview.c
* app/widgets/gimpdnd.c
* app/widgets/gimpdrawablelistview.[ch]
* app/widgets/gimpimagedock.c
* app/widgets/gimplayerlistview.c
* app/pdb/brushes_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/gradient_select_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/palette_cmds.c
* app/pdb/patterns_cmds.c
* app/pdb/procedural_db.c
* tools/pdbgen/pdb/brushes.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/palette.pdb
* tools/pdbgen/pdb/patterns.pdb: changed accordingly: remove usage
of gimp_context_[get|set]_*(NULL), create contexts with
gimp_create_context(). Get the user/current context with
gimp_get_[user|current]_context(). Added/removed access to the
global "the_gimp" variable in some places. Get the core's config
variables from "core_config".
2001-07-06 Dave Neary <dneary@eircom.net>
* app/gimprc.c: Removed some C89 & gcc extention stuff which broke
......
......@@ -79,8 +79,6 @@ gimp_SOURCES = @STRIP_BEGIN@ \
##
## stuff for core/
##
context_manager.c \
context_manager.h \
datafiles.c \
datafiles.h \
drawable.c \
......
......@@ -25,6 +25,7 @@
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
......@@ -37,6 +38,7 @@
#include "gdisplay.h"
#include "menus.h"
#include "app_procs.h"
#include "drawable.h"
#include "libgimp/gimpintl.h"
......@@ -314,7 +316,9 @@ new_channel_query_ok_callback (GtkWidget *widget,
channel_name,
&channel_color);
drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL);
drawable_fill (GIMP_DRAWABLE (new_channel),
gimp_get_user_context (the_gimp),
TRANSPARENT_FILL);
gimp_image_add_channel (gimage, new_channel, -1);
gdisplays_flush ();
......
......@@ -30,6 +30,7 @@
#include "paint-funcs/paint-funcs.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimplayer.h"
......@@ -42,6 +43,7 @@
#include "menus.h"
#include "resize-dialog.h"
#include "app_procs.h"
#include "drawable.h"
#include "gdisplay.h"
#include "floating_sel.h"
......@@ -542,7 +544,9 @@ new_layer_query_ok_callback (GtkWidget *widget,
layer_name, OPAQUE_OPACITY, NORMAL_MODE);
if (layer)
{
drawable_fill (GIMP_DRAWABLE (layer), fill_type);
drawable_fill (GIMP_DRAWABLE (layer),
gimp_get_user_context (the_gimp),
fill_type);
gimp_image_add_layer (gimage, layer, -1);
/* End the group undo */
......
......@@ -89,6 +89,7 @@
#include "base/tile.h"
#include "base/tile-manager.h"
#include "core/gimpcoreconfig.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
......@@ -322,18 +323,19 @@ plug_in_init (void)
plug_in_init_shm ();
/* search for binaries in the plug-in directory path */
gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE,
gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE,
plug_in_init_file, NULL);
/* read the pluginrc file for cached data */
filename = NULL;
if (gimprc.pluginrc_path)
if (core_config->pluginrc_path)
{
if (g_path_is_absolute (gimprc.pluginrc_path))
filename = g_strdup (gimprc.pluginrc_path);
if (g_path_is_absolute (core_config->pluginrc_path))
filename = g_strdup (core_config->pluginrc_path);
else
filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s",
gimp_directory (), gimprc.pluginrc_path);
gimp_directory (),
core_config->pluginrc_path);
}
else
filename = gimp_personal_rc_file ("pluginrc");
......@@ -853,7 +855,7 @@ plug_in_new (gchar *name)
if (! g_path_is_absolute (name))
{
path = plug_in_search_in_path (gimprc.plug_in_path, name);
path = plug_in_search_in_path (core_config->plug_in_path, name);
if (! path)
{
......
......@@ -29,6 +29,7 @@
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
......@@ -36,6 +37,7 @@
#include "widgets/gimpcolorpanel.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......@@ -238,7 +240,10 @@ qmask_activate (GtkWidget *widget,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
drawable_fill (GIMP_DRAWABLE (gmask),
gimp_get_user_context (gimg->gimp),
TRANSPARENT_FILL);
}
else
{
......
......@@ -29,6 +29,7 @@
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
......@@ -36,6 +37,7 @@
#include "widgets/gimpcolorpanel.h"
#include "app_procs.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
......@@ -238,7 +240,10 @@ qmask_activate (GtkWidget *widget,
"Qmask",
&color);
gimp_image_add_channel (gimg, gmask, 0);
drawable_fill (GIMP_DRAWABLE (gmask), TRANSPARENT_FILL);
drawable_fill (GIMP_DRAWABLE (gmask),
gimp_get_user_context (gimg->gimp),
TRANSPARENT_FILL);
}
else
{
......
......@@ -42,14 +42,14 @@ void
tools_default_colors_cmd_callback (GtkWidget *widget,
gpointer data)
{
gimp_context_set_default_colors (gimp_context_get_user ());
gimp_context_set_default_colors (gimp_get_user_context (the_gimp));
}
void
tools_swap_colors_cmd_callback (GtkWidget *widget,
gpointer data)
{
gimp_context_swap_colors (gimp_context_get_user ());
gimp_context_swap_colors (gimp_get_user_context (the_gimp));
}
void
......@@ -61,19 +61,19 @@ tools_swap_contexts_cmd_callback (GtkWidget *widget,
if (! swap_context)
{
swap_context = gimp_context_new (the_gimp,
"Swap Context",
gimp_context_get_user ());
temp_context = gimp_context_new (the_gimp,
"Temp Context",
NULL);
swap_context = gimp_create_context (the_gimp,
"Swap Context",
gimp_get_user_context (the_gimp));
temp_context = gimp_create_context (the_gimp,
"Temp Context",
NULL);
}
gimp_context_copy_args (gimp_context_get_user (),
gimp_context_copy_args (gimp_get_user_context (the_gimp),
temp_context,
GIMP_CONTEXT_ALL_ARGS_MASK);
gimp_context_copy_args (swap_context,
gimp_context_get_user (),
gimp_get_user_context (the_gimp),
GIMP_CONTEXT_ALL_ARGS_MASK);
gimp_context_copy_args (temp_context,
swap_context,
......@@ -91,10 +91,10 @@ tools_select_cmd_callback (GtkWidget *widget,
tool_type = (GtkType) action;
tool_info = tool_manager_get_info_by_type (tool_type);
tool_info = tool_manager_get_info_by_type (the_gimp, tool_type);
gdisp = gdisplay_active ();
gimp_context_set_tool (gimp_context_get_user (), tool_info);
gimp_context_set_tool (gimp_get_user_context (the_gimp), tool_info);
#ifdef __GNUC__
#warning FIXME (let the tool manager to this stuff)
......
......@@ -40,7 +40,7 @@
#include "xcf/xcf.h"
#include "tools/tools.h"
#include "tools/tool_manager.h"
#include "gui/color-notebook.h"
#include "gui/file-open-dialog.h"
......@@ -51,7 +51,6 @@
#include "app_procs.h"
#include "batch.h"
#include "colormaps.h"
#include "context_manager.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
#include "gimprc.h"
......@@ -143,8 +142,7 @@ app_init (gint gimp_argc,
gtk_object_ref (GTK_OBJECT (the_gimp));
gtk_object_sink (GTK_OBJECT (the_gimp));
/* Initialize the context system before loading any data */
context_manager_init ();
tool_manager_init (the_gimp);
/* Initialize the procedural database
* We need to do this first because any of the init
......@@ -191,7 +189,7 @@ app_init (gint gimp_argc,
if (! no_interface)
{
gui_restore ();
gui_restore (the_gimp);
}
/* Parse the rest of the command line arguments as images to load */
......@@ -207,7 +205,7 @@ app_init (gint gimp_argc,
if (! no_interface)
{
gui_post_init ();
gui_post_init (the_gimp);
}
}
......@@ -233,20 +231,19 @@ app_exit_finish (void)
if (! no_interface)
{
gui_shutdown ();
gui_shutdown (the_gimp);
}
module_db_free ();
gdisplays_delete ();
context_manager_free ();
plug_in_kill ();
save_unitrc ();
tools_exit ();
tool_manager_exit (the_gimp);
if (! no_interface)
{
gui_exit ();
gui_exit (the_gimp);
}
xcf_exit ();
......@@ -276,7 +273,7 @@ gimp_set_busy (void)
/* FIXME: gimp_busy HACK */
gimp_busy = TRUE;
gui_set_busy ();
gui_set_busy (the_gimp);
}
static gboolean
......@@ -307,7 +304,7 @@ gimp_set_busy_until_idle (void)
void
gimp_unset_busy (void)
{
gui_unset_busy ();
gui_unset_busy (the_gimp);
/* FIXME: gimp_busy HACK */
gimp_busy = FALSE;
......
......@@ -27,12 +27,13 @@
static GimpBaseConfig static_base_config =
{
NULL, /* temp_path */
NULL, /* swap_path */
33554432, /* tile_cache_size */
FALSE, /* stingy_memory_usage */
LINEAR_INTERPOLATION, /* interpolation_type */
1, /* num_processors */
.temp_path = NULL,
.swap_path = NULL,
.tile_cache_size = 33554432,
.stingy_memory_use = FALSE,
.interpolation_type = LINEAR_INTERPOLATION,
.num_processors = 1
};
......
......@@ -104,9 +104,10 @@ static GimpImageMapToolClass *parent_class = NULL;
/* functions */
void
gimp_color_balance_tool_register (void)
gimp_color_balance_tool_register (Gimp *gimp)
{
tool_manager_register_tool (GIMP_TYPE_COLOR_BALANCE_TOOL,
tool_manager_register_tool (gimp,
GIMP_TYPE_COLOR_BALANCE_TOOL,
FALSE,
"gimp:color_balance_tool",
_("Color Balance"),
......
......@@ -79,7 +79,7 @@ struct _ColorBalanceDialog
};
void gimp_color_balance_tool_register (void);
void gimp_color_balance_tool_register (Gimp *gimp);
GtkType gimp_color_balance_tool_get_type (void);
......
......@@ -200,9 +200,10 @@ static CRMatrix CR_basis =
/* functions */
void
gimp_curves_tool_register (void)
gimp_curves_tool_register (Gimp *gimp)
{
tool_manager_register_tool (GIMP_TYPE_CURVES_TOOL,
tool_manager_register_tool (gimp,
GIMP_TYPE_CURVES_TOOL,
FALSE,
"gimp:curves_tool",
_("Curves"),
......
......@@ -85,7 +85,7 @@ struct _CurvesDialog
};
void gimp_curves_tool_register (void);
void gimp_curves_tool_register (Gimp *gimp);
GtkType gimp_curves_tool_get_type (void);
......
......@@ -128,9 +128,10 @@ static gint default_colors[6][3] =
/* functions */
void
gimp_hue_saturation_tool_register (void)
gimp_hue_saturation_tool_register (Gimp *gimp)
{
tool_manager_register_tool (GIMP_TYPE_HUE_SATURATION_TOOL,
tool_manager_register_tool (gimp,
GIMP_TYPE_HUE_SATURATION_TOOL,
FALSE,
"gimp:hue_saturation_tool",
_("Hue-Saturation"),
......
......@@ -80,7 +80,7 @@ struct _HueSaturationDialog
};
void gimp_hue_saturation_tool_register (void);
void gimp_hue_saturation_tool_register (Gimp *gimp);
GtkType gimp_hue_saturation_tool_get_type (void);
......
......@@ -111,9 +111,10 @@ static GimpImageMapToolClass *parent_class = NULL;
/* functions */
void
gimp_threshold_tool_register (void)
gimp_threshold_tool_register (Gimp *gimp)
{
tool_manager_register_tool (GIMP_TYPE_THRESHOLD_TOOL,
tool_manager_register_tool (gimp,
GIMP_TYPE_THRESHOLD_TOOL,
FALSE,
"gimp:threshold_tool",
_("Threshold"),
......
......@@ -67,7 +67,7 @@ struct _ThresholdDialog
};
void gimp_threshold_tool_register (void);
void gimp_threshold_tool_register (Gimp *gimp);
GtkType gimp_threshold_tool_get_type (void);
......
/* 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"
#include <gtk/gtk.h>
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimptoolinfo.h"
#include "tools/gimptool.h"
#include "tools/paint_options.h"
#include "tools/tool_manager.h"
#include "tools/tools.h"
#include "gui/brush-select.h"
#include "appenv.h"
#include "app_procs.h"
#include "context_manager.h"
#include "gdisplay.h"
#include "gimprc.h"
#define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \
GIMP_CONTEXT_PAINT_MODE_MASK
/*
* the global tool context
*/
GimpContext *global_tool_context = NULL;
static void
context_manager_display_changed (GimpContext *context,
GDisplay *display,
gpointer data)
{
gdisplay_set_menu_sensitivity (display);
}
static void
context_manager_tool_changed (GimpContext *user_context,
GimpToolInfo *tool_info,
gpointer data)
{
if (! tool_info)
return;
/* FIXME: gimp_busy HACK */
if (gimp_busy)
{
/* there may be contexts waiting for the user_context's "tool_changed"
* signal, so stop emitting it.
*/
gtk_signal_emit_stop_by_name (GTK_OBJECT (user_context), "tool_changed");
if (GTK_OBJECT (active_tool)->klass->type != tool_info->tool_type)
{
gtk_signal_handler_block_by_func (GTK_OBJECT (user_context),
context_manager_tool_changed,
NULL);
/* explicitly set the current tool */
gimp_context_set_tool (user_context,
tool_manager_get_info_by_tool (active_tool));
gtk_signal_handler_unblock_by_func (GTK_OBJECT (user_context),
context_manager_tool_changed,
NULL);
}
}
else
{
GimpTool *new_tool = NULL;
GimpContext *tool_context = NULL;
if (tool_info->tool_type != GTK_TYPE_NONE)
{
new_tool = gtk_type_new (tool_info->tool_type);
}
else
{
g_warning ("%s(): tool_info contains no valid GtkType",
G_GNUC_FUNCTION);
return;
}
if (! gimprc.global_paint_options)
{
if (active_tool &&
(tool_context = tool_manager_get_info_by_tool (active_tool)->context))