static void gimp_blend_tool_start_preview (GimpBlendTool *blend_tool, GimpDisplay *display) { GimpTool *tool = GIMP_TOOL (blend_tool); GimpImage *image = gimp_display_get_image (display); GimpDrawable *drawable = gimp_image_get_active_drawable (image); GimpBlendOptions *options = GIMP_BLEND_TOOL_GET_OPTIONS (blend_tool); GimpContext *context = GIMP_CONTEXT (options); tool->display = display; tool->drawable = drawable; if (blend_tool->grabbed_point != POINT_FILL_MODE) { gimp_blend_tool_create_image_map (blend_tool, drawable); /* Initially sync all of the properties */ gimp_gegl_config_proxy_sync (GIMP_OBJECT (options), blend_tool->render_node); /* Connect signal handlers for the gradient */ gimp_blend_tool_set_gradient (blend_tool, context->gradient); } if (! gimp_draw_tool_is_active (GIMP_DRAW_TOOL (blend_tool))) gimp_draw_tool_start (GIMP_DRAW_TOOL (blend_tool), display); }
static void gimp_blend_tool_dispose (GObject *object) { GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (object); gimp_blend_tool_set_gradient (blend_tool, NULL); G_OBJECT_CLASS (parent_class)->dispose (object); }
static void gimp_blend_tool_options_notify (GimpTool *tool, GimpToolOptions *options, const GParamSpec *pspec) { GimpContext *context = GIMP_CONTEXT (options); GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool); if (! strcmp (pspec->name, "gradient")) { gimp_blend_tool_set_gradient (blend_tool, context->gradient); if (blend_tool->filter) gimp_drawable_filter_apply (blend_tool->filter, NULL); } else if (blend_tool->render_node && gegl_node_find_property (blend_tool->render_node, pspec->name)) { /* Sync any property changes on the config object that match the op */ GValue value = G_VALUE_INIT; g_value_init (&value, pspec->value_type); g_object_get_property (G_OBJECT (options), pspec->name, &value); gegl_node_set_property (blend_tool->render_node, pspec->name, &value); g_value_unset (&value); if (! strcmp (pspec->name, "gradient-type")) { if (gimp_blend_tool_is_shapeburst (blend_tool)) gimp_blend_tool_precalc_shapeburst (blend_tool); gimp_blend_tool_update_graph (blend_tool); } gimp_drawable_filter_apply (blend_tool->filter, NULL); } else if (blend_tool->filter && ! strcmp (pspec->name, "opacity")) { gimp_drawable_filter_set_opacity (blend_tool->filter, gimp_context_get_opacity (context)); } else if (blend_tool->filter && ! strcmp (pspec->name, "paint-mode")) { gimp_drawable_filter_set_mode (blend_tool->filter, gimp_context_get_paint_mode (context)); } }