[gimp/soc-2010-cage] empty gobject for GimpCage (data structure), GimpOperationCage (Gegl op) and GimpCageTool (frontend)



commit a29441ed35817660c25a0d60f0e285813fa42153
Author: Michael Muré <batolettre gmail com>
Date:   Mon Jun 14 23:25:08 2010 +0200

    empty gobject for GimpCage (data structure), GimpOperationCage (Gegl op) and GimpCageTool (frontend)

 app/core/Makefile.am         |    2 +
 app/core/core-types.h        |    1 +
 app/core/gimpcage.c          |   34 ++++++++++++++++++
 app/core/gimpcage.h          |   58 ++++++++++++++++++++++++++++++
 app/core/makefile.msc        |    1 +
 app/gegl/Makefile.am         |    3 ++
 app/gegl/gimp-gegl-types.h   |    1 +
 app/gegl/gimpoperationcage.c |   66 +++++++++++++++++++++++++++++++++++
 app/gegl/gimpoperationcage.h |   51 +++++++++++++++++++++++++++
 app/gegl/makefile.msc        |    1 +
 app/tools/Makefile.am        |    2 +
 app/tools/gimp-tools.c       |    2 +
 app/tools/gimpcagetool.c     |   79 ++++++++++++++++++++++++++++++++++++++++++
 app/tools/gimpcagetool.h     |   51 +++++++++++++++++++++++++++
 app/tools/makefile.msc       |    1 +
 15 files changed, 353 insertions(+), 0 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 5cbeaad..b07d92f 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -72,6 +72,8 @@ libappcore_a_sources = \
 	gimpbrushpipe-load.h			\
 	gimpbuffer.c				\
 	gimpbuffer.h				\
+	gimpcage.c				\
+	gimpcage.h				\
 	gimpchannel.c				\
 	gimpchannel.h				\
 	gimpchannel-combine.c			\
diff --git a/app/core/core-types.h b/app/core/core-types.h
index ace5370..5b95018 100644
--- a/app/core/core-types.h
+++ b/app/core/core-types.h
@@ -102,6 +102,7 @@ typedef struct _GimpBrush            GimpBrush;
 typedef struct _GimpBrushClipboard   GimpBrushClipboard;
 typedef struct _GimpBrushGenerated   GimpBrushGenerated;
 typedef struct _GimpBrushPipe        GimpBrushPipe;
+typedef struct _GimpCage             GimpCage;
 typedef struct _GimpCurve            GimpCurve;
 typedef struct _GimpDynamics         GimpDynamics;
 typedef struct _GimpDynamicsOutput   GimpDynamicsOutput;
diff --git a/app/core/gimpcage.c b/app/core/gimpcage.c
new file mode 100644
index 0000000..ccafad9
--- /dev/null
+++ b/app/core/gimpcage.c
@@ -0,0 +1,34 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ * Copyright (C) 1999 Adrian Likins and Tor Lillqvist
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gimpcage.h"
+
+#include "core-types.h"
+
+
+static void
+gimp_cage_class_init (GimpCageClass *klass)
+{
+
+}
+
+static void
+gimp_cage_init (GimpCage *self)
+{
+
+}
diff --git a/app/core/gimpcage.h b/app/core/gimpcage.h
new file mode 100644
index 0000000..65aac2a
--- /dev/null
+++ b/app/core/gimpcage.h
@@ -0,0 +1,58 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattisbvf
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_CAGE_H__
+#define __GIMP_CAGE_H__
+
+#include <glib-object.h>
+
+#define GIMP_TYPE_CAGE            (gimp_cage_get_type ())
+#define GIMP_CAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CAGE, GimpCage))
+#define GIMP_CAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CAGE, GimpCageClass))
+#define GIMP_IS_CAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CAGE))
+#define GIMP_IS_CAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CAGE))
+#define GIMP_CAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CAGE, GimpCageClass))
+
+
+typedef struct _GimpCageClass GimpCageClass;
+
+struct _GimpCage
+{
+  GObject    parent_instance;
+  
+  gint            cageVerticeNumber;
+  gfloat         *cageVerticeX;
+  gfloat         *cageVerticeY;
+  
+  gint            pointNumber;
+  gfloat        **CoordsVerticeX;
+  gfloat        **CoordsVerticeY;
+  gfloat        **CoordsEdgeX;
+  gfloat        **CoordsEdgeY;
+
+};
+
+
+struct _GimpCageClass
+{
+  GObjectClass parent_class;
+};
+
+GType         gimp_cage_get_type          (void) G_GNUC_CONST;
+
+
+#endif /* __GIMP_CAGE_H__ */
diff --git a/app/core/makefile.msc b/app/core/makefile.msc
index 258c1ad..1d1f0c5 100644
--- a/app/core/makefile.msc
+++ b/app/core/makefile.msc
@@ -58,6 +58,7 @@ OBJECTS = \
 	gimpbrushpipe-load.obj \
 	gimpbrushpipe.obj \
 	gimpbuffer.obj \
+	gimpcage.obj \
 	gimpchannel-combine.obj \
 	gimpchannel-select.obj \
 	gimpchannel.obj \
diff --git a/app/gegl/Makefile.am b/app/gegl/Makefile.am
index 0936761..1510805 100644
--- a/app/gegl/Makefile.am
+++ b/app/gegl/Makefile.am
@@ -51,6 +51,9 @@ libappgegl_a_SOURCES = \
 	gimpoperationcolorbalance.h	\
 	gimpoperationcolorize.c		\
 	gimpoperationcolorize.h		\
+	##right place ?
+	gimpoperationcage.h			\
+	gimpoperationcage.c			\
 	gimpoperationcurves.c		\
 	gimpoperationcurves.h		\
 	gimpoperationdesaturate.c	\
diff --git a/app/gegl/gimp-gegl-types.h b/app/gegl/gimp-gegl-types.h
index dcf18c2..9dc279b 100644
--- a/app/gegl/gimp-gegl-types.h
+++ b/app/gegl/gimp-gegl-types.h
@@ -31,6 +31,7 @@ typedef struct _GimpOperationTileSource       GimpOperationTileSource;
 typedef struct _GimpOperationPointFilter      GimpOperationPointFilter;
 typedef struct _GimpOperationColorBalance     GimpOperationColorBalance;
 typedef struct _GimpOperationColorize         GimpOperationColorize;
+typedef struct _GimpOperationCage             GimpOperationCage;
 typedef struct _GimpOperationCurves           GimpOperationCurves;
 typedef struct _GimpOperationDesaturate       GimpOperationDesaturate;
 typedef struct _GimpOperationHueSaturation    GimpOperationHueSaturation;
diff --git a/app/gegl/gimpoperationcage.c b/app/gegl/gimpoperationcage.c
new file mode 100644
index 0000000..1567d16
--- /dev/null
+++ b/app/gegl/gimpoperationcage.c
@@ -0,0 +1,66 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationcage.c
+ * Copyright (C) 2010 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+
+#include "libgimpcolor/gimpcolor.h"
+#include "libgimpmath/gimpmath.h"
+
+#include "gimp-gegl-types.h"
+
+#include "core/gimpcage.h"
+
+#include "gimpoperationcage.h"
+
+
+static gboolean gimp_operation_cage_process (GeglOperation       *operation,
+                                               void                *in_buf,
+                                               void                *out_buf,
+                                               glong                samples,
+                                               const GeglRectangle *roi);
+
+G_DEFINE_TYPE (GimpOperationCage, gimp_operation_cage,
+               GEGL_TYPE_OPERATION_FILTER)
+
+#define parent_class gimp_operation_cage_parent_class
+
+
+static void
+gimp_operation_cage_class_init (GimpOperationCageClass *klass)
+{
+  
+}
+
+static void
+gimp_operation_cage_init (GimpOperationCage *self)
+{
+}
+
+static gboolean
+gimp_operation_cage_process (GeglOperation       *operation,
+                               void                *in_buf,
+                               void                *out_buf,
+                               glong                samples,
+                               const GeglRectangle *roi)
+{
+  
+}
diff --git a/app/gegl/gimpoperationcage.h b/app/gegl/gimpoperationcage.h
new file mode 100644
index 0000000..259d917
--- /dev/null
+++ b/app/gegl/gimpoperationcage.h
@@ -0,0 +1,51 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
+ *
+ * gimpoperationcage.h
+ * Copyright (C) 2010 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_OPERATION_CAGE_H__
+#define __GIMP_OPERATION_CAGE_H__
+
+#include <gegl-plugin.h>
+#include <operation/gegl-operation-filter.h>
+
+#define GIMP_TYPE_OPERATION_CAGE            (gimp_operation_cage_get_type ())
+#define GIMP_OPERATION_CAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_CAGE, GimpOperationCage))
+#define GIMP_OPERATION_CAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  GIMP_TYPE_OPERATION_CAGE, GimpOperationCageClass))
+#define GIMP_IS_OPERATION_CAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_CAGE))
+#define GIMP_IS_OPERATION_CAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  GIMP_TYPE_OPERATION_CAGE))
+#define GIMP_OPERATION_CAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  GIMP_TYPE_OPERATION_CAGE, GimpOperationCageClass))
+
+
+typedef struct _GimpOperationCageClass GimpOperationCageClass;
+
+struct _GimpOperationCage
+{
+  GeglOperationFilter  parent_instance;
+};
+
+struct _GimpOperationCageClass
+{
+  GeglOperationFilter  parent_class;
+};
+
+
+GType   gimp_operation_cage_get_type (void) G_GNUC_CONST;
+
+
+#endif /* __GIMP_OPERATION_CAGE_H__ */
diff --git a/app/gegl/makefile.msc b/app/gegl/makefile.msc
index c3af8b0..5fab774 100644
--- a/app/gegl/makefile.msc
+++ b/app/gegl/makefile.msc
@@ -36,6 +36,7 @@ OBJECTS = \
 	gimphuesaturationconfig.obj \
 	gimplevelsconfig.obj \
 	gimpoperationcolorbalance.obj \
+	gimpoperationcage.obj  \
 	gimpoperationcurves.obj \
 	gimpoperationhuesaturation.obj \
 	gimpoperationlevels.obj \
diff --git a/app/tools/Makefile.am b/app/tools/Makefile.am
index 57a1f55..015f1af 100644
--- a/app/tools/Makefile.am
+++ b/app/tools/Makefile.am
@@ -42,6 +42,8 @@ libapptools_a_sources = \
 	gimpbucketfilltool.h		\
 	gimpbycolorselecttool.c		\
 	gimpbycolorselecttool.h		\
+	gimpcagetool.c				\
+	gimpcagetool.h				\
 	gimpclonetool.c			\
 	gimpclonetool.h			\
 	gimpcoloroptions.c		\
diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c
index 12e7cf6..9b1c8c9 100644
--- a/app/tools/gimp-tools.c
+++ b/app/tools/gimp-tools.c
@@ -42,6 +42,7 @@
 #include "gimpbrightnesscontrasttool.h"
 #include "gimpbucketfilltool.h"
 #include "gimpbycolorselecttool.h"
+#include "gimpcagetool.h"
 #include "gimpclonetool.h"
 #include "gimpcolorbalancetool.h"
 #include "gimpcolorizetool.h"
@@ -153,6 +154,7 @@ gimp_tools_init (Gimp *gimp)
     gimp_crop_tool_register,
     gimp_align_tool_register,
     gimp_move_tool_register,
+    gimp_cage_tool_register,
 
     /*  non-modifying tools  */
 
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
new file mode 100644
index 0000000..98560b9
--- /dev/null
+++ b/app/tools/gimpcagetool.c
@@ -0,0 +1,79 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "config.h"
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+
+
+#include "libgimpmath/gimpmath.h"
+#include "libgimpwidgets/gimpwidgets.h"
+
+#include "tools-types.h"
+
+#include "core/gimp-transform-utils.h"
+
+
+#include "widgets/gimphelp-ids.h"
+
+
+
+#include "gimpcagetool.h"
+
+#include "gimptransformoptions.h"
+
+#include "gimp-intl.h"
+
+
+G_DEFINE_TYPE (GimpCageTool, gimp_cage_tool, GIMP_TYPE_TRANSFORM_TOOL)
+
+#define parent_class gimp_cage_tool_parent_class
+
+
+void
+gimp_cage_tool_register (GimpToolRegisterCallback  callback,
+                           gpointer                  data)
+{
+  (* callback) (GIMP_TYPE_CAGE_TOOL,
+                GIMP_TYPE_TRANSFORM_OPTIONS,
+                gimp_transform_options_gui,
+                GIMP_CONTEXT_BACKGROUND_MASK,
+                "gimp-cage-tool",
+                _("Rotate"),
+                _("Rotate Tool: Rotate the layer, selection or path"),
+                N_("_Rotate"), "<shift>R",
+                NULL, GIMP_HELP_TOOL_ROTATE,
+                GIMP_STOCK_TOOL_ROTATE,
+                data);
+}
+
+static void
+gimp_cage_tool_class_init (GimpCageToolClass *klass)
+{
+
+}
+
+static void
+gimp_cage_tool_init (GimpCageTool *self)
+{
+
+}
+
+
diff --git a/app/tools/gimpcagetool.h b/app/tools/gimpcagetool.h
new file mode 100644
index 0000000..055f3fc
--- /dev/null
+++ b/app/tools/gimpcagetool.h
@@ -0,0 +1,51 @@
+/* GIMP - The GNU Image Manipulation Program
+ * Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_CAGE_TOOL_H__
+#define __GIMP_CAGE_TOOL_H__
+
+#include "gimptransformtool.h"
+
+
+#define GIMP_TYPE_CAGE_TOOL            (gimp_cage_tool_get_type ())
+#define GIMP_CAGE_TOOL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CAGE_TOOL, GimpCageTool))
+#define GIMP_CAGE_TOOL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CAGE_TOOL, GimpCageToolClass))
+#define GIMP_IS_CAGE_TOOL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CAGE_TOOL))
+#define GIMP_IS_CAGE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CAGE_TOOL))
+#define GIMP_CAGE_TOOL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CAGE_TOOL, GimpCageToolClass))
+
+
+typedef struct _GimpCageToolClass GimpCageToolClass;
+typedef struct _GimpCageTool GimpCageTool;
+
+struct _GimpCageTool
+{
+  GimpTransformTool    parent_instance;
+};
+
+
+struct _GimpCageToolClass
+{
+  GimpTransformToolClass parent_class;
+};
+
+void    gimp_cage_tool_register (GimpToolRegisterCallback  callback,
+                                   gpointer                  data);
+
+GType   gimp_cage_tool_get_type (void) G_GNUC_CONST;
+
+#endif  /*  __GIMP_CAGE_TOOL_H__  */
diff --git a/app/tools/makefile.msc b/app/tools/makefile.msc
index a46c8e3..9a1c8bc 100644
--- a/app/tools/makefile.msc
+++ b/app/tools/makefile.msc
@@ -36,6 +36,7 @@ OBJECTS = \
 	gimpbucketfilloptions.obj \
 	gimpbucketfilltool.obj \
 	gimpbycolorselecttool.obj \
+	gimpcagetool.obj \
 	gimpclonetool.obj \
 	gimpcolorbalancetool.obj \
 	gimpcolorizetool.obj \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]