Commit f15a7bc7 authored by Marek Dvoroznak's avatar Marek Dvoroznak Committed by Michael Natterer

app: add NPD tool basics

parent 783bbab8
......@@ -132,6 +132,10 @@ libapptools_a_sources = \
gimpmoveoptions.h \
gimpmovetool.c \
gimpmovetool.h \
gimpnpointdeformationoptions.c \
gimpnpointdeformationoptions.h \
gimpnpointdeformationtool.c \
gimpnpointdeformationtool.h \
gimppaintbrushtool.c \
gimppaintbrushtool.h \
gimppaintoptions-gui.c \
......
......@@ -70,6 +70,7 @@
#include "gimpmagnifytool.h"
#include "gimpmeasuretool.h"
#include "gimpmovetool.h"
#include "gimpnpointdeformationtool.h"
#include "gimppaintbrushtool.h"
#include "gimppenciltool.h"
#include "gimpperspectiveclonetool.h"
......@@ -154,6 +155,7 @@ gimp_tools_init (Gimp *gimp)
/* transform tools */
gimp_n_point_deformation_tool_register,
gimp_warp_tool_register,
gimp_cage_tool_register,
gimp_flip_tool_register,
......
/* GIMP - The GNU Image Manipulation Program
*
* gimpnpointdeformationoptions.h
* Copyright (C) 2013 Marek Dvoroznak <dvoromar@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 <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
#include "gimpnpointdeformationoptions.h"
#include "gimptooloptions-gui.h"
#include "gimp-intl.h"
static void gimp_n_point_deformation_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_n_point_deformation_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GimpNPointDeformationOptions, gimp_n_point_deformation_options,
GIMP_TYPE_TOOL_OPTIONS)
#define parent_class gimp_n_point_deformation_options_parent_class
static void
gimp_n_point_deformation_options_class_init (GimpNPointDeformationOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gimp_n_point_deformation_options_set_property;
object_class->get_property = gimp_n_point_deformation_options_get_property;
}
static void
gimp_n_point_deformation_options_init (GimpNPointDeformationOptions *options)
{
}
static void
gimp_n_point_deformation_options_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
// GimpNPointDeformationOptions *options = GIMP_N_POINT_DEFORMATION_OPTIONS (object);
}
static void
gimp_n_point_deformation_options_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
// GimpNPointDeformationOptions *options = GIMP_N_POINT_DEFORMATION_OPTIONS (object);
}
GtkWidget *
gimp_n_point_deformation_options_gui (GimpToolOptions *tool_options)
{
// GObject *config = G_OBJECT (tool_options);
GtkWidget *vbox = gimp_tool_options_gui (tool_options);
return vbox;
}
/* GIMP - The GNU Image Manipulation Program
*
* gimpnpointdeformationoptions.h
* Copyright (C) 2013 Marek Dvoroznak <dvoromar@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_N_POINT_DEFORMATION_OPTIONS_H__
#define __GIMP_N_POINT_DEFORMATION_OPTIONS_H__
#include "core/gimptooloptions.h"
#define GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS (gimp_n_point_deformation_options_get_type ())
#define GIMP_N_POINT_DEFORMATION_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS, GimpNPointDeformationOptions))
#define GIMP_N_POINT_DEFORMATION_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS, GimpNPointDeformationOptionsClass))
#define GIMP_IS_N_POINT_DEFORMATION_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS))
#define GIMP_IS_N_POINT_DEFORMATION_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS))
#define GIMP_N_POINT_DEFORMATION_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_N_POINT_DEFORMATION_OPTIONS, GimpNPointDeformationOptionsClass))
typedef struct _GimpNPointDeformationOptions GimpNPointDeformationOptions;
typedef struct _GimpNPointDeformationOptionsClass GimpNPointDeformationOptionsClass;
struct _GimpNPointDeformationOptions
{
GimpToolOptions parent_instance;
};
struct _GimpNPointDeformationOptionsClass
{
GimpToolOptionsClass parent_class;
};
GType gimp_n_point_deformation_options_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_n_point_deformation_options_gui (GimpToolOptions *tool_options);
#endif /* __GIMP_N_POINT_DEFORMATION_OPTIONS_H__ */
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
*
* gimpnpointdeformationtool.h
* Copyright (C) 2013 Marek Dvoroznak <dvoromar@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_N_POINT_DEFORMATION_TOOL_H__
#define __GIMP_N_POINT_DEFORMATION_TOOL_H__
#include "gimpdrawtool.h"
//#include <npd/npd_common.h>
#define GIMP_TYPE_N_POINT_DEFORMATION_TOOL (gimp_n_point_deformation_tool_get_type ())
#define GIMP_N_POINT_DEFORMATION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_N_POINT_DEFORMATION_TOOL, GimpNPointDeformationTool))
#define GIMP_N_POINT_DEFORMATION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_N_POINT_DEFORMATION_TOOL, GimpNPointDeformationToolClass))
#define GIMP_IS_N_POINT_DEFORMATION_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_N_POINT_DEFORMATION_TOOL))
#define GIMP_IS_N_POINT_DEFORMATION_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_N_POINT_DEFORMATION_TOOL))
#define GIMP_N_POINT_DEFORMATION_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_N_POINT_DEFORMATION_TOOL, GimpNPointDeformationToolClass))
#define GIMP_N_POINT_DEFORMATION_TOOL_GET_OPTIONS(t) (GIMP_N_POINT_DEFORMATION_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
typedef struct _GimpNPointDeformationTool GimpNPointDeformationTool;
typedef struct _GimpNPointDeformationToolClass GimpNPointDeformationToolClass;
struct _GimpNPointDeformationTool
{
GimpDrawTool parent_instance;
GeglNode *graph;
GeglNode *node;
GeglNode *sink;
GeglBuffer *shadow, *buf;
GimpDrawable *drawable;
// NPDModel *model;
// NPDControlPoint *selected_cp; /* last selected control point */
GSList *selected_cps; /* list of selected control points */
// NPDControlPoint *hovering_cp;
GSList *previous_cp_positions; /* list of NPDPoints holding previous control points positions */
gdouble movement_start_x;
gdouble movement_start_y;
gdouble cursor_x;
gdouble cursor_y;
// gdouble delta_x;
// gdouble delta_y;
gboolean active;
};
struct _GimpNPointDeformationToolClass
{
GimpDrawToolClass parent_class;
};
void gimp_n_point_deformation_tool_register (GimpToolRegisterCallback callback,
gpointer data);
GType gimp_n_point_deformation_tool_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_N_POINT_DEFORMATION_TOOL_H__ */
......@@ -288,6 +288,7 @@
#define GIMP_HELP_TOOL_LEVELS "gimp-tool-levels"
#define GIMP_HELP_TOOL_MEASURE "gimp-tool-measure"
#define GIMP_HELP_TOOL_MOVE "gimp-tool-move"
#define GIMP_HELP_TOOL_N_POINT_DEFORMATION "gimp-tool-n-point-deformation"
#define GIMP_HELP_TOOL_PATH "gimp-tool-path"
#define GIMP_HELP_TOOL_PAINTBRUSH "gimp-tool-paintbrush"
#define GIMP_HELP_TOOL_PENCIL "gimp-tool-pencil"
......
......@@ -187,6 +187,7 @@ icons16_DATA = \
16/gimp-tool-levels.png \
16/gimp-tool-measure.png \
16/gimp-tool-move.png \
16/gimp-tool-n-point-deformation.png \
16/gimp-tool-options.png \
16/gimp-tool-paintbrush.png \
16/gimp-tool-path.png \
......@@ -296,6 +297,7 @@ icons22_DATA = \
22/gimp-tool-levels.png \
22/gimp-tool-measure.png \
22/gimp-tool-move.png \
22/gimp-tool-n-point-deformation.png \
22/gimp-tool-paintbrush.png \
22/gimp-tool-path.png \
22/gimp-tool-pencil.png \
......
......@@ -262,6 +262,7 @@ static const GtkStockItem gimp_stock_items[] =
{ GIMP_STOCK_TOOL_LEVELS, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_MEASURE, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_MOVE, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_N_POINT_DEFORMATION, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PAINTBRUSH, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PATH, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PENCIL, NULL, 0, 0, LIBGIMP_DOMAIN },
......
......@@ -132,6 +132,7 @@ G_BEGIN_DECLS
#define GIMP_STOCK_TOOL_LEVELS "gimp-tool-levels"
#define GIMP_STOCK_TOOL_MEASURE "gimp-tool-measure"
#define GIMP_STOCK_TOOL_MOVE "gimp-tool-move"
#define GIMP_STOCK_TOOL_N_POINT_DEFORMATION "gimp-tool-n-point-deformation"
#define GIMP_STOCK_TOOL_PAINTBRUSH "gimp-tool-paintbrush"
#define GIMP_STOCK_TOOL_PATH "gimp-tool-path"
#define GIMP_STOCK_TOOL_PENCIL "gimp-tool-pencil"
......
......@@ -605,6 +605,7 @@
<menuitem action="tools-flip" />
<menuitem action="tools-cage" />
<menuitem action="tools-warp" />
<menuitem action="tools-n-point-deformation" />
</menu>
<menu action="tools-color-menu" name="Color Tools">
<menuitem action="tools-color-balance" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment