mirror of https://github.com/GNOME/gimp.git
gimpcagetool: beginning of the link tool/gegl op
This commit is contained in:
parent
c24029c230
commit
fcd156014a
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <gegl.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdkkeysyms.h>
|
#include <gdk/gdkkeysyms.h>
|
||||||
|
|
||||||
|
@ -32,8 +33,15 @@
|
||||||
#include "tools/tools-enums.h"
|
#include "tools/tools-enums.h"
|
||||||
#include "gimptoolcontrol.h"
|
#include "gimptoolcontrol.h"
|
||||||
|
|
||||||
|
#include "core/gimp.h"
|
||||||
|
#include "core/gimpimage.h"
|
||||||
|
#include "core/gimplayer.h"
|
||||||
|
#include "display/gimpdisplay.h"
|
||||||
#include "core/gimp-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
|
|
||||||
|
#include "core/gimpdrawable.h"
|
||||||
|
#include "core/gimpdrawable-operation.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
|
||||||
#include "gimpcagetool.h"
|
#include "gimpcagetool.h"
|
||||||
|
@ -81,8 +89,12 @@ static void gimp_cage_tool_oper_update (GimpTool *tool,
|
||||||
gboolean proximity,
|
gboolean proximity,
|
||||||
GimpDisplay *display);
|
GimpDisplay *display);
|
||||||
static void gimp_cage_tool_draw (GimpDrawTool *draw_tool);
|
static void gimp_cage_tool_draw (GimpDrawTool *draw_tool);
|
||||||
static void gimp_cage_tool_switch_to_deform (GimpCageTool *ct);
|
static void gimp_cage_tool_switch_to_deform
|
||||||
static void gimp_cage_tool_remove_last_handle (GimpCageTool *ct);
|
(GimpCageTool *ct);
|
||||||
|
static void gimp_cage_tool_remove_last_handle
|
||||||
|
(GimpCageTool *ct);
|
||||||
|
static void gimp_cage_tool_process (GimpCageTool *ct,
|
||||||
|
GimpImage *image);
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpCageTool, gimp_cage_tool, GIMP_TYPE_DRAW_TOOL)
|
G_DEFINE_TYPE (GimpCageTool, gimp_cage_tool, GIMP_TYPE_DRAW_TOOL)
|
||||||
|
|
||||||
|
@ -250,6 +262,8 @@ gimp_cage_tool_button_press (GimpTool *tool,
|
||||||
{
|
{
|
||||||
ct->cage_complete = TRUE;
|
ct->cage_complete = TRUE;
|
||||||
gimp_cage_tool_switch_to_deform (ct);
|
gimp_cage_tool_switch_to_deform (ct);
|
||||||
|
|
||||||
|
gimp_cage_tool_process (ct, display);
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (ct));
|
gimp_draw_tool_resume (GIMP_DRAW_TOOL (ct));
|
||||||
|
@ -519,3 +533,28 @@ gimp_cage_tool_remove_last_handle (GimpCageTool *ct)
|
||||||
gimp_cage_remove_last_cage_point (cage);
|
gimp_cage_remove_last_cage_point (cage);
|
||||||
gimp_draw_tool_resume (GIMP_DRAW_TOOL (ct));
|
gimp_draw_tool_resume (GIMP_DRAW_TOOL (ct));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_cage_tool_process (GimpCageTool *ct,
|
||||||
|
GimpDisplay *display)
|
||||||
|
{
|
||||||
|
GimpImage *image = gimp_display_get_image (display);
|
||||||
|
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
||||||
|
GimpProgress *progress = gimp_progress_start (GIMP_PROGRESS (display),
|
||||||
|
_("Blending"),
|
||||||
|
FALSE);
|
||||||
|
|
||||||
|
|
||||||
|
if (GIMP_IS_LAYER (drawable))
|
||||||
|
{
|
||||||
|
GeglNode *node;
|
||||||
|
|
||||||
|
node = g_object_new (GEGL_TYPE_NODE,
|
||||||
|
"operation", "gegl:cage",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gimp_drawable_apply_operation (drawable, progress, _("Cage transform"),
|
||||||
|
node, TRUE);
|
||||||
|
g_object_unref (node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue