2010-06-15 05:25:08 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2010-07-01 02:27:52 +08:00
|
|
|
*
|
|
|
|
* gimpcagetool.h
|
|
|
|
* Copyright (C) 2010 Michael Muré <batolettre@gmail.com>
|
2010-06-15 05:25:08 +08:00
|
|
|
*
|
|
|
|
* 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
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2010-06-15 05:25:08 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_CAGE_TOOL_H__
|
|
|
|
#define __GIMP_CAGE_TOOL_H__
|
|
|
|
|
2010-11-05 05:14:58 +08:00
|
|
|
|
2010-07-17 19:33:48 +08:00
|
|
|
#include "gimpdrawtool.h"
|
2010-06-15 05:25:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
#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))
|
|
|
|
|
2010-07-01 02:27:52 +08:00
|
|
|
#define GIMP_CAGE_TOOL_GET_OPTIONS(t) (GIMP_CAGE_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
|
2010-06-15 05:25:08 +08:00
|
|
|
|
2010-11-05 05:14:58 +08:00
|
|
|
|
|
|
|
typedef struct _GimpCageTool GimpCageTool;
|
2010-06-15 05:25:08 +08:00
|
|
|
typedef struct _GimpCageToolClass GimpCageToolClass;
|
|
|
|
|
|
|
|
struct _GimpCageTool
|
|
|
|
{
|
2010-11-05 05:14:58 +08:00
|
|
|
GimpDrawTool parent_instance;
|
2010-08-14 00:25:48 +08:00
|
|
|
|
2010-11-05 05:14:58 +08:00
|
|
|
GimpCageConfig *config;
|
2010-08-14 00:25:48 +08:00
|
|
|
|
2011-01-02 23:15:55 +08:00
|
|
|
gint offset_x; /* used to convert the cage point coords */
|
|
|
|
gint offset_y; /* to drawable coords */
|
2010-08-14 00:25:48 +08:00
|
|
|
|
2011-01-02 23:15:55 +08:00
|
|
|
gdouble cursor_x; /* Hold the cursor x position */
|
|
|
|
gdouble cursor_y; /* Hold the cursor y position */
|
2010-08-14 00:25:48 +08:00
|
|
|
|
2011-01-02 23:15:55 +08:00
|
|
|
gdouble movement_start_x; /* Where the movement started */
|
|
|
|
gdouble movement_start_y; /* Where the movement started */
|
2010-12-17 21:49:37 +08:00
|
|
|
|
2011-01-10 21:55:38 +08:00
|
|
|
gdouble selection_start_x; /* Where the selection started */
|
|
|
|
gdouble selection_start_y; /* Where the selection started */
|
|
|
|
|
2011-01-02 23:15:55 +08:00
|
|
|
gint hovering_handle; /* Handle which the cursor is above */
|
2011-05-03 06:45:39 +08:00
|
|
|
gint hovering_edge; /* Edge which the cursor is above */
|
2010-12-17 21:49:37 +08:00
|
|
|
|
2011-05-25 05:35:28 +08:00
|
|
|
GeglBuffer *coef; /* Gegl buffer where the coefficient of the transformation are stored */
|
2011-01-22 07:44:35 +08:00
|
|
|
gboolean dirty_coef; /* Indicate if the coef are still valid */
|
|
|
|
|
2018-03-25 04:49:01 +08:00
|
|
|
GeglNode *render_node; /* Gegl node graph to render the transformation */
|
2011-01-22 07:44:35 +08:00
|
|
|
GeglNode *cage_node; /* Gegl node that compute the cage transform */
|
|
|
|
GeglNode *coef_node; /* Gegl node that read in the coef buffer */
|
2011-01-02 23:15:55 +08:00
|
|
|
|
|
|
|
gint tool_state; /* Current state in statemachine */
|
|
|
|
|
2016-05-12 07:49:53 +08:00
|
|
|
GimpDrawableFilter *filter; /* For preview */
|
2010-06-15 05:25:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpCageToolClass
|
|
|
|
{
|
2010-11-05 05:14:58 +08:00
|
|
|
GimpDrawToolClass parent_class;
|
2010-06-15 05:25:08 +08:00
|
|
|
};
|
|
|
|
|
2010-11-05 05:14:58 +08:00
|
|
|
|
2010-06-15 05:25:08 +08:00
|
|
|
void gimp_cage_tool_register (GimpToolRegisterCallback callback,
|
2010-11-05 05:14:58 +08:00
|
|
|
gpointer data);
|
2010-06-15 05:25:08 +08:00
|
|
|
|
|
|
|
GType gimp_cage_tool_get_type (void) G_GNUC_CONST;
|
|
|
|
|
2010-11-05 05:14:58 +08:00
|
|
|
|
2010-06-15 05:25:08 +08:00
|
|
|
#endif /* __GIMP_CAGE_TOOL_H__ */
|