app: add GimpToolWidget subclass GimpToolPath, a complete vectors editor
This commit is contained in:
@ -170,6 +170,8 @@ libappdisplay_a_sources = \
|
|||||||
gimptoolhandlegrid.h \
|
gimptoolhandlegrid.h \
|
||||||
gimptoolline.c \
|
gimptoolline.c \
|
||||||
gimptoolline.h \
|
gimptoolline.h \
|
||||||
|
gimptoolpath.c \
|
||||||
|
gimptoolpath.h \
|
||||||
gimptoolrotategrid.c \
|
gimptoolrotategrid.c \
|
||||||
gimptoolrotategrid.h \
|
gimptoolrotategrid.h \
|
||||||
gimptoolsheargrid.c \
|
gimptoolsheargrid.c \
|
||||||
|
@ -325,6 +325,37 @@ gimp_transform_handle_mode_get_type (void)
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gimp_vector_mode_get_type (void)
|
||||||
|
{
|
||||||
|
static const GEnumValue values[] =
|
||||||
|
{
|
||||||
|
{ GIMP_VECTOR_MODE_DESIGN, "GIMP_VECTOR_MODE_DESIGN", "design" },
|
||||||
|
{ GIMP_VECTOR_MODE_EDIT, "GIMP_VECTOR_MODE_EDIT", "edit" },
|
||||||
|
{ GIMP_VECTOR_MODE_MOVE, "GIMP_VECTOR_MODE_MOVE", "move" },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GimpEnumDesc descs[] =
|
||||||
|
{
|
||||||
|
{ GIMP_VECTOR_MODE_DESIGN, NC_("vector-mode", "Design"), NULL },
|
||||||
|
{ GIMP_VECTOR_MODE_EDIT, NC_("vector-mode", "Edit"), NULL },
|
||||||
|
{ GIMP_VECTOR_MODE_MOVE, NC_("vector-mode", "Move"), NULL },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (! type))
|
||||||
|
{
|
||||||
|
type = g_enum_register_static ("GimpVectorMode", values);
|
||||||
|
gimp_type_set_translation_context (type, "vector-mode");
|
||||||
|
gimp_enum_set_value_descriptions (type, descs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gimp_zoom_focus_get_type (void)
|
gimp_zoom_focus_get_type (void)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +146,18 @@ typedef enum
|
|||||||
} GimpTransformHandleMode;
|
} GimpTransformHandleMode;
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_VECTOR_MODE (gimp_vector_mode_get_type ())
|
||||||
|
|
||||||
|
GType gimp_vector_mode_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GIMP_VECTOR_MODE_DESIGN, /*< desc="Design" >*/
|
||||||
|
GIMP_VECTOR_MODE_EDIT, /*< desc="Edit" >*/
|
||||||
|
GIMP_VECTOR_MODE_MOVE /*< desc="Move" >*/
|
||||||
|
} GimpVectorMode;
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ())
|
#define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ())
|
||||||
|
|
||||||
GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
|
GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
|
||||||
|
1839
app/display/gimptoolpath.c
Normal file
1839
app/display/gimptoolpath.c
Normal file
File diff suppressed because it is too large
Load Diff
68
app/display/gimptoolpath.h
Normal file
68
app/display/gimptoolpath.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/* GIMP - The GNU Image Manipulation Program
|
||||||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||||
|
*
|
||||||
|
* gimptoolpath.h
|
||||||
|
* Copyright (C) 2017 Michael Natterer <mitch@gimp.org>
|
||||||
|
*
|
||||||
|
* 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_TOOL_PATH_H__
|
||||||
|
#define __GIMP_TOOL_PATH_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include "gimptoolwidget.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_TOOL_PATH (gimp_tool_path_get_type ())
|
||||||
|
#define GIMP_TOOL_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_PATH, GimpToolPath))
|
||||||
|
#define GIMP_TOOL_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_PATH, GimpToolPathClass))
|
||||||
|
#define GIMP_IS_TOOL_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_PATH))
|
||||||
|
#define GIMP_IS_TOOL_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_PATH))
|
||||||
|
#define GIMP_TOOL_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_PATH, GimpToolPathClass))
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _GimpToolPath GimpToolPath;
|
||||||
|
typedef struct _GimpToolPathPrivate GimpToolPathPrivate;
|
||||||
|
typedef struct _GimpToolPathClass GimpToolPathClass;
|
||||||
|
|
||||||
|
struct _GimpToolPath
|
||||||
|
{
|
||||||
|
GimpToolWidget parent_instance;
|
||||||
|
|
||||||
|
GimpToolPathPrivate *private;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GimpToolPathClass
|
||||||
|
{
|
||||||
|
GimpToolWidgetClass parent_class;
|
||||||
|
|
||||||
|
void (* begin_change) (GimpToolPath *path,
|
||||||
|
const gchar *desc);
|
||||||
|
void (* end_change) (GimpToolPath *path,
|
||||||
|
gboolean success);
|
||||||
|
void (* activate) (GimpToolPath *path,
|
||||||
|
GdkModifierType state);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GType gimp_tool_path_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
GimpToolWidget * gimp_tool_path_new (GimpDisplayShell *shell);
|
||||||
|
|
||||||
|
void gimp_tool_path_set_vectors (GimpToolPath *path,
|
||||||
|
GimpVectors *vectors);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GIMP_TOOL_PATH_H__ */
|
@ -164,37 +164,6 @@ gimp_transform_type_get_type (void)
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
GType
|
|
||||||
gimp_vector_mode_get_type (void)
|
|
||||||
{
|
|
||||||
static const GEnumValue values[] =
|
|
||||||
{
|
|
||||||
{ GIMP_VECTOR_MODE_DESIGN, "GIMP_VECTOR_MODE_DESIGN", "design" },
|
|
||||||
{ GIMP_VECTOR_MODE_EDIT, "GIMP_VECTOR_MODE_EDIT", "edit" },
|
|
||||||
{ GIMP_VECTOR_MODE_MOVE, "GIMP_VECTOR_MODE_MOVE", "move" },
|
|
||||||
{ 0, NULL, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
static const GimpEnumDesc descs[] =
|
|
||||||
{
|
|
||||||
{ GIMP_VECTOR_MODE_DESIGN, NC_("vector-mode", "Design"), NULL },
|
|
||||||
{ GIMP_VECTOR_MODE_EDIT, NC_("vector-mode", "Edit"), NULL },
|
|
||||||
{ GIMP_VECTOR_MODE_MOVE, NC_("vector-mode", "Move"), NULL },
|
|
||||||
{ 0, NULL, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
static GType type = 0;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (! type))
|
|
||||||
{
|
|
||||||
type = g_enum_register_static ("GimpVectorMode", values);
|
|
||||||
gimp_type_set_translation_context (type, "vector-mode");
|
|
||||||
gimp_enum_set_value_descriptions (type, descs);
|
|
||||||
}
|
|
||||||
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gimp_tool_action_get_type (void)
|
gimp_tool_action_get_type (void)
|
||||||
{
|
{
|
||||||
|
@ -83,18 +83,6 @@ typedef enum
|
|||||||
} GimpTransformType;
|
} GimpTransformType;
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_VECTOR_MODE (gimp_vector_mode_get_type ())
|
|
||||||
|
|
||||||
GType gimp_vector_mode_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GIMP_VECTOR_MODE_DESIGN, /*< desc="Design" >*/
|
|
||||||
GIMP_VECTOR_MODE_EDIT, /*< desc="Edit" >*/
|
|
||||||
GIMP_VECTOR_MODE_MOVE /*< desc="Move" >*/
|
|
||||||
} GimpVectorMode;
|
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_TOOL_ACTION (gimp_tool_action_get_type ())
|
#define GIMP_TYPE_TOOL_ACTION (gimp_tool_action_get_type ())
|
||||||
|
|
||||||
GType gimp_tool_action_get_type (void) G_GNUC_CONST;
|
GType gimp_tool_action_get_type (void) G_GNUC_CONST;
|
||||||
|
@ -256,6 +256,7 @@ app/display/gimpnavigationeditor.c
|
|||||||
app/display/gimpstatusbar.c
|
app/display/gimpstatusbar.c
|
||||||
app/display/gimptoolcompass.c
|
app/display/gimptoolcompass.c
|
||||||
app/display/gimptoolhandlegrid.c
|
app/display/gimptoolhandlegrid.c
|
||||||
|
app/display/gimptoolpath.c
|
||||||
app/display/gimptooltransformgrid.c
|
app/display/gimptooltransformgrid.c
|
||||||
|
|
||||||
app/file/file-open.c
|
app/file/file-open.c
|
||||||
|
Reference in New Issue
Block a user