Commit 07300cf3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/Makefile.am app/gradientP.h removed.

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

	* app/Makefile.am
	* app/gradientP.h
	* app/gradient_header.h: removed.

	* app/gimpgradient.[ch]: new object -- bye bye "gradient_t"

	* app/gradients.[ch]: new files for managing the gradient list.

	* app/gradient.[ch]: containes only the gradient editor now (which
	still badly poked aroung in the GimpGradient structure).

	* app/app_procs.c
	* app/apptypes.h
	* app/devices.c
	* app/gimpcontainerlistview.c
	* app/gimpcontext.[ch]
	* app/gimpcontextpreview.[ch]
	* app/gimpdnd.[ch]
	* app/gradient_select.[ch]
	* app/indicator_area.c
	* app/palette_import.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/tools/airbrush.c
	* app/tools/blend.c
	* app/tools/paint_core.c
	* app/tools/paintbrush.c
	* app/tools/pencil.c
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb: changed accordingly, some
	changes to the preview and view stuff.

	* app/gimppreview.[ch]: removed the "context" attribute again
	because it was overkill (a simple gtk_signal-connect_object does
	the same as doing the autoconnection magic inside the GimpPreview
	object).

	* app/commands.[ch]
	* app/menus.c: example views on the gradient container.
parent 123ee565
2001-02-10 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/gradientP.h
* app/gradient_header.h: removed.
* app/gimpgradient.[ch]: new object -- bye bye "gradient_t"
* app/gradients.[ch]: new files for managing the gradient list.
* app/gradient.[ch]: containes only the gradient editor now (which
still badly poked aroung in the GimpGradient structure).
* app/app_procs.c
* app/apptypes.h
* app/devices.c
* app/gimpcontainerlistview.c
* app/gimpcontext.[ch]
* app/gimpcontextpreview.[ch]
* app/gimpdnd.[ch]
* app/gradient_select.[ch]
* app/indicator_area.c
* app/palette_import.c
* app/pdb/gradient_select_cmds.c
* app/pdb/gradients_cmds.c
* app/tools/airbrush.c
* app/tools/blend.c
* app/tools/paint_core.c
* app/tools/paintbrush.c
* app/tools/pencil.c
* tools/pdbgen/pdb/gradient_select.pdb
* tools/pdbgen/pdb/gradients.pdb: changed accordingly, some
changes to the preview and view stuff.
* app/gimppreview.[ch]: removed the "context" attribute again
because it was overkill (a simple gtk_signal-connect_object does
the same as doing the autoconnection magic inside the GimpPreview
object).
* app/commands.[ch]
* app/menus.c: example views on the gradient container.
2001-02-09 Michael Natterer <mitch@gimp.org>
* app/gimpcontainergridview.[ch]
......
......@@ -124,6 +124,8 @@ gimp_SOURCES = \
gimpdrawable.h \
gimpdrawable-preview.c \
gimpdrawable-preview.h \
gimpgradient.c \
gimpgradient.h \
gimphelp.c \
gimphelp.h \
gimphistogram.c \
......@@ -162,11 +164,11 @@ gimp_SOURCES = \
global_edit.c \
global_edit.h \
gradient.c \
gradientP.h \
gradient_header.h \
gradient.h \
gradients.c \
gradients.h \
gradient_select.h \
gradient_select.c \
gradient.h \
gximage.c \
gximage.h \
image_map.c \
......
......@@ -78,6 +78,7 @@
/* for the example dialogs */
#include "brushes.h"
#include "gradients.h"
#include "patterns.h"
#include "gimpcontainer.h"
#include "gimpcontainerlistview.h"
......@@ -1385,6 +1386,26 @@ patterns_callback (GtkWidget *widget,
NULL);
}
static void
gradients_callback (GtkWidget *widget,
GimpContainerView *view)
{
gtk_drag_dest_unset (GTK_WIDGET (view));
gimp_dnd_viewable_dest_unset (GTK_WIDGET (view),
view->container->children_type);
gimp_container_view_set_container (view, global_gradient_list);
gimp_gtk_drag_dest_set_by_type (GTK_WIDGET (view),
GTK_DEST_DEFAULT_ALL,
view->container->children_type,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_set (GTK_WIDGET (view),
view->container->children_type,
drop_viewable_callback,
NULL);
}
static void
images_callback (GtkWidget *widget,
GimpContainerView *view)
......@@ -1524,7 +1545,6 @@ container_multi_view_new (gboolean list,
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1543,7 +1563,6 @@ container_multi_view_new (gboolean list,
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1558,12 +1577,29 @@ container_multi_view_new (gboolean list,
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (gradients_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"gradient_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
/*
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_image (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1605,6 +1641,16 @@ dialogs_test_image_container_list_view_cmd_callback (GtkWidget *widget,
64);
}
void
dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (TRUE, "Brush List",
global_brush_list,
gimp_context_get_user (),
24);
}
void
dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1616,11 +1662,11 @@ dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *widget,
}
void
dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
dialogs_test_gradient_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (TRUE, "Brush List",
global_brush_list,
container_view_new (TRUE, "Gradient List",
global_gradient_list,
gimp_context_get_user (),
24);
}
......@@ -1635,6 +1681,16 @@ dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *widget,
64);
}
void
dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (FALSE, "Brush Grid",
global_brush_list,
gimp_context_get_user (),
32);
}
void
dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1646,13 +1702,13 @@ dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *widget,
}
void
dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
dialogs_test_gradient_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (FALSE, "Brush Grid",
global_brush_list,
container_view_new (FALSE, "Gradient Grid",
global_gradient_list,
gimp_context_get_user (),
32);
24);
}
void
......
......@@ -129,13 +129,15 @@ void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_gradient_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_gradient_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_multi_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_multi_container_grid_view_cmd_callback (GtkWidget *, gpointer);
......
......@@ -63,7 +63,7 @@
#include "gimpparasite.h"
#include "global_edit.h"
#include "gradient_select.h"
#include "gradient.h"
#include "gradients.h"
#include "gximage.h"
#include "image_render.h"
#include "lc_dialog.h"
......
......@@ -62,6 +62,8 @@ typedef struct _GimpBrush GimpBrush;
typedef struct _GimpBrushGenerated GimpBrushGenerated;
typedef struct _GimpBrushPipe GimpBrushPipe;
typedef struct _GimpGradient GimpGradient;
typedef struct _GimpPattern GimpPattern;
typedef struct _GimpPalette GimpPalette;
......@@ -109,8 +111,6 @@ typedef struct _GimpParasite GimpParasite;
typedef struct _GimpProgress GimpProgress;
typedef struct _gradient_t gradient_t;
typedef struct _Guide Guide;
typedef gpointer ImageMap;
......
......@@ -78,6 +78,7 @@
/* for the example dialogs */
#include "brushes.h"
#include "gradients.h"
#include "patterns.h"
#include "gimpcontainer.h"
#include "gimpcontainerlistview.h"
......@@ -1385,6 +1386,26 @@ patterns_callback (GtkWidget *widget,
NULL);
}
static void
gradients_callback (GtkWidget *widget,
GimpContainerView *view)
{
gtk_drag_dest_unset (GTK_WIDGET (view));
gimp_dnd_viewable_dest_unset (GTK_WIDGET (view),
view->container->children_type);
gimp_container_view_set_container (view, global_gradient_list);
gimp_gtk_drag_dest_set_by_type (GTK_WIDGET (view),
GTK_DEST_DEFAULT_ALL,
view->container->children_type,
GDK_ACTION_COPY);
gimp_dnd_viewable_dest_set (GTK_WIDGET (view),
view->container->children_type,
drop_viewable_callback,
NULL);
}
static void
images_callback (GtkWidget *widget,
GimpContainerView *view)
......@@ -1524,7 +1545,6 @@ container_multi_view_new (gboolean list,
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_brush (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1543,7 +1563,6 @@ container_multi_view_new (gboolean list,
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_pattern (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1558,12 +1577,29 @@ container_multi_view_new (gboolean list,
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_gradient (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
gtk_signal_connect (GTK_OBJECT (preview), "clicked",
GTK_SIGNAL_FUNC (gradients_callback),
view);
gtk_signal_connect_object_while_alive
(GTK_OBJECT (context),
"gradient_changed",
GTK_SIGNAL_FUNC (gimp_preview_set_viewable),
GTK_OBJECT (preview));
/*
preview =
gimp_preview_new_full (GIMP_VIEWABLE (gimp_context_get_image (context)),
32, 32, 1,
FALSE, TRUE, FALSE);
gimp_preview_set_context (GIMP_PREVIEW (preview), context);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), preview,
FALSE, FALSE, 0);
gtk_widget_show (preview);
......@@ -1605,6 +1641,16 @@ dialogs_test_image_container_list_view_cmd_callback (GtkWidget *widget,
64);
}
void
dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (TRUE, "Brush List",
global_brush_list,
gimp_context_get_user (),
24);
}
void
dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1616,11 +1662,11 @@ dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *widget,
}
void
dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
dialogs_test_gradient_container_list_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (TRUE, "Brush List",
global_brush_list,
container_view_new (TRUE, "Gradient List",
global_gradient_list,
gimp_context_get_user (),
24);
}
......@@ -1635,6 +1681,16 @@ dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *widget,
64);
}
void
dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (FALSE, "Brush Grid",
global_brush_list,
gimp_context_get_user (),
32);
}
void
dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1646,13 +1702,13 @@ dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *widget,
}
void
dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
dialogs_test_gradient_container_grid_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
container_view_new (FALSE, "Brush Grid",
global_brush_list,
container_view_new (FALSE, "Gradient Grid",
global_gradient_list,
gimp_context_get_user (),
32);
24);
}
void
......
......@@ -129,13 +129,15 @@ void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_gradient_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_brush_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_pattern_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_gradient_container_grid_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_multi_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_multi_container_grid_view_cmd_callback (GtkWidget *, gpointer);
......
......@@ -32,12 +32,12 @@
#include "gimpbrush.h"
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpgradient.h"
#include "gimpimage.h"
#include "gimpmarshal.h"
#include "gimppattern.h"
#include "gimprc.h"
#include "gradient_header.h"
#include "gradient.h"
#include "gradients.h"
#include "patterns.h"
#include "temp_buf.h"
......@@ -140,7 +140,7 @@ static void gimp_context_copy_pattern (GimpContext *src,
/* gradient */
static void gimp_context_real_set_gradient (GimpContext *context,
gradient_t *gradient);
GimpGradient *gradient);
static void gimp_context_copy_gradient (GimpContext *src,
GimpContext *dest);
......@@ -216,7 +216,7 @@ static GtkType gimp_context_arg_types[] =
GTK_TYPE_NONE,
0,
0,
GTK_TYPE_NONE
0
};
static gchar *gimp_context_signal_names[] =
......@@ -280,9 +280,10 @@ gimp_context_class_init (GimpContextClass *klass)
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_context_arg_types[GIMP_CONTEXT_ARG_IMAGE] = GIMP_TYPE_IMAGE;
gimp_context_arg_types[GIMP_CONTEXT_ARG_BRUSH] = GIMP_TYPE_BRUSH;
gimp_context_arg_types[GIMP_CONTEXT_ARG_PATTERN] = GIMP_TYPE_PATTERN;
gimp_context_arg_types[GIMP_CONTEXT_ARG_IMAGE] = GIMP_TYPE_IMAGE;
gimp_context_arg_types[GIMP_CONTEXT_ARG_BRUSH] = GIMP_TYPE_BRUSH;
gimp_context_arg_types[GIMP_CONTEXT_ARG_PATTERN] = GIMP_TYPE_PATTERN;
gimp_context_arg_types[GIMP_CONTEXT_ARG_GRADIENT] = GIMP_TYPE_GRADIENT;
gtk_object_add_arg_type (gimp_context_arg_names[IMAGE_CHANGED],
GTK_TYPE_POINTER, GTK_ARG_READWRITE,
......@@ -1830,9 +1831,9 @@ gimp_context_refresh_patterns (void)
/*****************************************************************************/
/* gradient ****************************************************************/
static gradient_t *standard_gradient = NULL;
static GimpGradient *standard_gradient = NULL;
gradient_t *
GimpGradient *
gimp_context_get_gradient (GimpContext *context)
{
context_check_current (context);
......@@ -1842,8 +1843,8 @@ gimp_context_get_gradient (GimpContext *context)
}
void
gimp_context_set_gradient (GimpContext *context,
gradient_t *gradient)
gimp_context_set_gradient (GimpContext *context,
GimpGradient *gradient)
{
context_check_current (context);
context_return_if_fail (context);
......@@ -1864,8 +1865,8 @@ gimp_context_gradient_changed (GimpContext *context)
}
static void
gimp_context_real_set_gradient (GimpContext *context,
gradient_t *gradient)
gimp_context_real_set_gradient (GimpContext *context,
GimpGradient *gradient)
{
if (! standard_gradient)
standard_gradient = gradients_get_standard_gradient ();
......@@ -1882,7 +1883,7 @@ gimp_context_real_set_gradient (GimpContext *context,
context->gradient = gradient;
if (gradient && gradient != standard_gradient)
context->gradient_name = g_strdup (gradient->name);
context->gradient_name = g_strdup (GIMP_OBJECT (gradient)->name);
gimp_context_gradient_changed (context);
}
......@@ -1905,21 +1906,26 @@ static void
gimp_context_refresh_gradient (GimpContext *context,
gpointer data)
{
gradient_t *gradient;
GimpGradient *gradient;
if (! context->gradient_name)
context->gradient_name = g_strdup (default_gradient);
if ((gradient = gradient_list_get_gradient (gradients_list,
context->gradient_name)))
gradient = (GimpGradient *)
gimp_container_get_child_by_name (global_gradient_list,
context->gradient_name);
if (gradient)
{
gimp_context_real_set_gradient (context, gradient);
return;
}
if (gradients_list)
gimp_context_real_set_gradient (context,
(gradient_t *) gradients_list->data);
if (gimp_container_num_children (global_gradient_list))
gimp_context_real_set_gradient
(context,
(GimpGradient *)
gimp_container_get_child_by_index (global_gradient_list, 0));
else
gimp_context_real_set_gradient (context, gradients_get_standard_gradient ());
}
......@@ -1931,15 +1937,15 @@ gimp_context_refresh_gradients (void)
}
static void
gimp_context_update_gradient (GimpContext *context,
gradient_t *gradient)
gimp_context_update_gradient (GimpContext *context,
GimpGradient *gradient)
{
if (context->gradient == gradient)
{
if (context->gradient_name)
g_free (context->gradient_name);
context->gradient_name = g_strdup (gradient->name);
context->gradient_name = g_strdup (GIMP_OBJECT (gradient)->name);
gimp_context_gradient_changed (context);
}
......@@ -1948,7 +1954,7 @@ gimp_context_update_gradient (GimpContext *context,
/* Temporary functions */
void
gimp_context_update_gradients (gradient_t *gradient)
gimp_context_update_gradients (GimpGradient *gradient)
{
g_slist_foreach (context_list, (GFunc) gimp_context_update_gradient, gradient);
}
......@@ -100,7 +100,7 @@ struct _GimpContext
GimpPattern *pattern;
gchar *pattern_name;
gradient_t *gradient;
GimpGradient *gradient;
gchar *gradient_name;
};
......@@ -129,7 +129,7 @@ struct _GimpContextClass
void (* pattern_changed) (GimpContext *context,
GimpPattern *pattern);
void (* gradient_changed) (GimpContext *context,
gradient_t *gradient);
GimpGradient *gradient);
};
GtkType gimp_context_get_type (void);
......@@ -271,12 +271,12 @@ void gimp_context_pattern_changed (GimpContext *context);
void gimp_context_refresh_patterns (void);
/* gradient */
gradient_t * gimp_context_get_gradient (GimpContext *context);
GimpGradient * gimp_context_get_gradient (GimpContext *context);
void gimp_context_set_gradient (GimpContext *context,
gradient_t *gradient);
GimpGradient *gradient);
void gimp_context_gradient_changed (GimpContext *context);
void gimp_context_refresh_gradients (void);
void gimp_context_update_gradients (gradient_t *gradient);
void gimp_context_update_gradients (GimpGradient *gradient);
#endif /* __GIMP_CONTEXT_H__ */
......@@ -41,8 +41,8 @@
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimpdnd.h"
#include "gimpgradient.h"
#include "gimpprogress.h"
#include "gradient.h"
#include "paint_funcs.h"
#include "paint_options.h"
#include "pixel_region.h"
......@@ -182,7 +182,7 @@ static void blend_control (Tool *tool,
GDisplay *gdisp);
static void blend_options_drop_gradient (GtkWidget *widget,
gradient_t *gradient,
GimpGradient *gradient,
gpointer data);
static void blend_options_drop_tool (GtkWidget *widget,
ToolType gradient,
......@@ -782,9 +782,9 @@ blend_control (Tool *tool,
static void
blend_options_drop_gradient (GtkWidget *widget,
gradient_t *gradient,
gpointer data)
blend_options_drop_gradient (GtkWidget *widget,
GimpGradient *gradient,
gpointer data)
{
gimp_context_set_gradient (gimp_context_get_user (), gradient);
gtk_option_menu_set_history (GTK_OPTION_MENU (blend_options->blend_mode_w),
......@@ -1384,7 +1384,8 @@ gradient_render_pixel (double x,
if (rbd->blend_mode == CUSTOM_MODE)
{
gradient_get_color_at (gimp_context_get_gradient (NULL), factor, color);
gimp_gradient_get_color_at (gimp_context_get_gradient (NULL),
factor, color);
}
else
{
......
/* 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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <gtk/gtk.h>
#ifdef G_OS_WIN32
#include <io.h>
#endif
#ifndef _O_BINARY
#define _O_BINARY 0
#endif
#include "libgimpcolor/gimpcolor.h"
#include "libgimpmath/gimpmath.h"
#include "apptypes.h"
#include "errors.h"
#include "gimpimage.h"
#include "gimpgradient.h"
#include "gimprc.h"
#include "gradients.h"
#include "temp_buf.h"
#include "libgimp/gimplimits.h"
#include "libgimp/gimpintl.h"
#define EPSILON 1e-10