took gimpcontextpreview.[ch] out of the build but still left the sources

2001-02-12  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am: took gimpcontextpreview.[ch] out of the build
	but still left the sources there as reference.

	* app/app_procs.c: initialize the render stuff before creating the
	toolbox (needed for the previews).

	* app/devices.c
	* app/indicator_area.c: use GimpPreviews instead of
	GimpContextPreviews.

	* app/context_manager.[ch]: create the global data lists here
	because they now must exist before any context is created.

	* app/brushes.[ch]
	* app/gradients.[ch]
	* app/palettes.[ch]
	* app/patterns.[ch]: removed them here.

	* app/gimpcontainer.[ch]: added a "freeze_count" and emit the
	"freeze" and "thaw" signals accordingly.

	* app/gimpcontext.[ch]: greatly simplified the way how the
	contexts connect to the data lists (simply keep them connected all
	the time). Also removed all those ugly explicit update functions
	because "thaw" callbacks do this job now.

	* app/gimpdata.c: a GimpData object now becomes dirty on
	"name_changed"; "dirty" now triggers "invalidate_preview" because
	the context does not dispatch these signals any more soon.

	* app/brush_select.c
	* app/convert.c
	* app/gimpdnd.c
	* app/gradient_editor.c
	* app/gradient_select.c
	* app/pattern_select.c
	* app/gradient_editor.c
	* app/gradient_select.c
	* app/gradients.[ch]
	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/convert_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c
	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb: changed accordingly.
This commit is contained in:
Michael Natterer
2001-02-12 03:27:28 +00:00
committed by Michael Natterer
parent 6fc9702bb3
commit d6a2d391e9
70 changed files with 1229 additions and 1033 deletions

View File

@ -29,15 +29,16 @@
#include "apptypes.h"
#include "appenv.h"
#include "context_manager.h"
#include "brushes.h"
#include "devices.h"
#include "dialog_handler.h"
#include "gimpbrush.h"
#include "gimpcontext.h"
#include "gimpcontextpreview.h"
#include "gimpdnd.h"
#include "gimpgradient.h"
#include "gimppattern.h"
#include "gimppreview.h"
#include "gimplist.h"
#include "gimprc.h"
#include "gradients.h"
@ -751,7 +752,7 @@ device_status_create (void)
GimpRGB color;
GList *list;
gint i;
if (deviceD == NULL)
{
deviceD = g_new (DeviceInfoDialog, 1);
@ -888,23 +889,45 @@ device_status_create (void)
/* the brush */
deviceD->brushes[i] =
gimp_context_preview_new (GCP_BRUSH,
CELL_SIZE, CELL_SIZE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_brush),
GUINT_TO_POINTER (device_info->device));
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->brushes[i],
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (device_info->context)),
CELL_SIZE, CELL_SIZE, 0,
FALSE, FALSE, TRUE);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (device_info->context),
"brush_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (deviceD->brushes[i]));
gimp_gtk_drag_dest_set_by_type (deviceD->brushes[i],
GTK_DEST_DEFAULT_ALL,
GIMP_TYPE_BRUSH,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_set (deviceD->brushes[i],
GIMP_TYPE_BRUSH,
device_status_drop_brush,
NULL);
gtk_table_attach (GTK_TABLE (deviceD->table), deviceD->brushes[i],
4, 5, i, i+1,
0, 0, 2, 2);
/* the pattern */
deviceD->patterns[i] =
gimp_context_preview_new (GCP_PATTERN,
CELL_SIZE, CELL_SIZE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_pattern),
GUINT_TO_POINTER (device_info->device));
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (device_info->context)),
CELL_SIZE, CELL_SIZE, 0,
FALSE, FALSE, TRUE);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (device_info->context),
"pattern_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (deviceD->patterns[i]));
gimp_gtk_drag_dest_set_by_type (deviceD->patterns[i],
GTK_DEST_DEFAULT_ALL,
GIMP_TYPE_PATTERN,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_set (deviceD->patterns[i],
GIMP_TYPE_PATTERN,
device_status_drop_pattern,
NULL);
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
5, 6, i, i+1,
0, 0, 2, 2);
@ -912,11 +935,22 @@ device_status_create (void)
/* the gradient */
deviceD->gradients[i] =
gimp_context_preview_new (GCP_GRADIENT,
CELL_SIZE * 2, CELL_SIZE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_gradient),
GUINT_TO_POINTER (device_info->device));
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (device_info->context)),
CELL_SIZE * 2, CELL_SIZE, 0,
FALSE, FALSE, TRUE);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (device_info->context),
"gradient_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (deviceD->gradients[i]));
gimp_gtk_drag_dest_set_by_type (deviceD->gradients[i],
GTK_DEST_DEFAULT_ALL,
GIMP_TYPE_GRADIENT,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_set (deviceD->gradients[i],
GIMP_TYPE_GRADIENT,
device_status_drop_gradient,
NULL);
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
6, 7, i, i+1,
0, 0, 2, 2);
@ -1085,25 +1119,16 @@ device_status_update (guint32 deviceid)
if (gimp_context_get_brush (device_info->context))
{
gimp_context_preview_update
(GIMP_CONTEXT_PREVIEW (deviceD->brushes[i]),
gimp_context_get_brush (device_info->context));
gtk_widget_show (deviceD->brushes[i]);
}
if (gimp_context_get_pattern (device_info->context))
{
gimp_context_preview_update
(GIMP_CONTEXT_PREVIEW (deviceD->patterns[i]),
gimp_context_get_pattern (device_info->context));
gtk_widget_show (deviceD->patterns[i]);
}
if (gimp_context_get_gradient (device_info->context))
{
gimp_context_preview_update
(GIMP_CONTEXT_PREVIEW (deviceD->gradients[i]),
gimp_context_get_gradient (device_info->context));
gtk_widget_show (deviceD->gradients[i]);
}
}