mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
Compare commits
102 Commits
9cc7ebba01
...
soc-2013-c
Author | SHA1 | Date | |
---|---|---|---|
|
7f21332564 | ||
|
3f7109a0d4 | ||
|
ca52dd7392 | ||
|
61fde4961d | ||
|
d2f65f3152 | ||
|
e429dba7ab | ||
|
b34c75959f | ||
|
6350319f23 | ||
|
1175823bc8 | ||
|
ab97ae55ca | ||
|
c4d69b105a | ||
|
d35fdff6aa | ||
|
cdec50aba2 | ||
|
28abea1a77 | ||
|
39a55b0aca | ||
|
cebf0942ef | ||
|
02b20b58f8 | ||
|
b86edb353b | ||
|
a397583bd3 | ||
|
a9e30328fc | ||
|
a7aa4354da | ||
|
9570a0e912 | ||
|
e5bc43cd04 | ||
|
e84113c58b | ||
|
6bbc2a2d35 | ||
|
91c022379a | ||
|
4373240fcd | ||
|
a0b8909f44 | ||
|
a95dd2ec40 | ||
|
2cb7110350 | ||
|
b0661c2731 | ||
|
fb594d49c1 | ||
|
eb07c48a09 | ||
|
8ac989826c | ||
|
a41b3f8ecb | ||
|
294da02527 | ||
|
a6b5a88bcb | ||
|
fda0646ba3 | ||
|
5f82464d2c | ||
|
7529786c79 | ||
|
1340ac7803 | ||
|
d527497753 | ||
|
1f09c8fd3b | ||
|
5b66fbeda9 | ||
|
ef5a277648 | ||
|
2cf47c0ed7 | ||
|
9899b535d2 | ||
|
a333b5ea9f | ||
|
099ca3ab04 | ||
|
78b0ecca68 | ||
|
de7d503fa6 | ||
|
cc1f9943da | ||
|
6e1ba8af48 | ||
|
2f1e2e1c17 | ||
|
520dbb97ec | ||
|
2f33cd2b72 | ||
|
c1bf659f7c | ||
|
8ab74b05bb | ||
|
27ce67c81b | ||
|
bcb6bfd190 | ||
|
3e5b0d2ddd | ||
|
42ae6366d9 | ||
|
0aecb9ad7f | ||
|
d67459f182 | ||
|
b715ac919c | ||
|
de6052807c | ||
|
c359df6348 | ||
|
1b4283fe1b | ||
|
b8c9dd6c30 | ||
|
d05c9152bf | ||
|
d86c80c336 | ||
|
f2f8e5d7db | ||
|
e6f12791b9 | ||
|
c355e6399a | ||
|
03397ae9f9 | ||
|
016669bfa6 | ||
|
6247c0790c | ||
|
fb40054eed | ||
|
814add81dc | ||
|
31b14c2cbf | ||
|
0f2d1c1c99 | ||
|
cfb39e6df3 | ||
|
c2d8e13780 | ||
|
094e575bab | ||
|
72c909441d | ||
|
67551bd0cd | ||
|
c5e603d988 | ||
|
ca57ccbf65 | ||
|
428ce9a129 | ||
|
56cf78b1f1 | ||
|
087507a495 | ||
|
c482cd2b91 | ||
|
bfca31d4d3 | ||
|
6d8e91774a | ||
|
055c3f33a3 | ||
|
9edbb1e174 | ||
|
d97ee14868 | ||
|
e225fa7eb5 | ||
|
e5594a461c | ||
|
aba9fd7656 | ||
|
a3d6b03a6f | ||
|
637052d545 |
@@ -8,6 +8,41 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
/* enumerations from "./core-enums.h" */
|
||||
GType
|
||||
gimp_shape_type_get_type (void)
|
||||
{
|
||||
static const GEnumValue values[] =
|
||||
{
|
||||
{ GIMP_SHAPE_RECTANGLE, "GIMP_SHAPE_RECTANGLE", "rectangle" },
|
||||
{ GIMP_SHAPE_ELLIPSE, "GIMP_SHAPE_ELLIPSE", "ellipse" },
|
||||
{ GIMP_SHAPE_ROUNDED_RECT, "GIMP_SHAPE_ROUNDED_RECT", "rounded-rect" },
|
||||
{ GIMP_SHAPE_N_POLYGON, "GIMP_SHAPE_N_POLYGON", "n-polygon" },
|
||||
{ GIMP_SHAPE_SINGLE_ROW, "GIMP_SHAPE_SINGLE_ROW", "single-row" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static const GimpEnumDesc descs[] =
|
||||
{
|
||||
{ GIMP_SHAPE_RECTANGLE, "GIMP_SHAPE_RECTANGLE", NULL },
|
||||
{ GIMP_SHAPE_ELLIPSE, "GIMP_SHAPE_ELLIPSE", NULL },
|
||||
{ GIMP_SHAPE_ROUNDED_RECT, "GIMP_SHAPE_ROUNDED_RECT", NULL },
|
||||
{ GIMP_SHAPE_N_POLYGON, "GIMP_SHAPE_N_POLYGON", NULL },
|
||||
{ GIMP_SHAPE_SINGLE_ROW, "GIMP_SHAPE_SINGLE_ROW", NULL },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
static GType type = 0;
|
||||
|
||||
if (G_UNLIKELY (! type))
|
||||
{
|
||||
type = g_enum_register_static ("GimpShapeType", values);
|
||||
gimp_type_set_translation_context (type, "shape-type");
|
||||
gimp_enum_set_value_descriptions (type, descs);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gimp_component_mask_get_type (void)
|
||||
{
|
||||
|
@@ -34,7 +34,18 @@
|
||||
/*
|
||||
* these enums are registered with the type system
|
||||
*/
|
||||
#define GIMP_TYPE_SHAPE_TYPE (gimp_shape_type_get_type ())
|
||||
|
||||
GType gimp_shape_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_SHAPE_RECTANGLE,
|
||||
GIMP_SHAPE_ELLIPSE,
|
||||
GIMP_SHAPE_ROUNDED_RECT,
|
||||
GIMP_SHAPE_N_POLYGON,
|
||||
GIMP_SHAPE_SINGLE_ROW
|
||||
} GimpShapeType;
|
||||
|
||||
#define GIMP_TYPE_COMPONENT_MASK (gimp_component_mask_get_type ())
|
||||
|
||||
|
@@ -166,6 +166,12 @@ libapptools_a_sources = \
|
||||
gimpseamlesscloneoptions.h \
|
||||
gimpseamlessclonetool.c \
|
||||
gimpseamlessclonetool.h \
|
||||
gimpselectbycolortool.c \
|
||||
gimpselectbycolortool.h \
|
||||
gimpselectbycontenttool.c \
|
||||
gimpselectbycontenttool.h \
|
||||
gimpselectbyshapetool.c \
|
||||
gimpselectbyshapetool.h \
|
||||
gimpselectionoptions.c \
|
||||
gimpselectionoptions.h \
|
||||
gimpselectiontool.c \
|
||||
|
@@ -79,6 +79,9 @@
|
||||
#include "gimprectangleselecttool.h"
|
||||
#include "gimprotatetool.h"
|
||||
#include "gimpseamlessclonetool.h"
|
||||
#include "gimpselectbycolortool.h"
|
||||
#include "gimpselectbyshapetool.h"
|
||||
#include "gimpselectbycontenttool.h"
|
||||
#include "gimpscaletool.h"
|
||||
#include "gimpsheartool.h"
|
||||
#include "gimpsmudgetool.h"
|
||||
@@ -181,12 +184,15 @@ gimp_tools_init (Gimp *gimp)
|
||||
gimp_foreground_select_tool_register,
|
||||
#if 0
|
||||
gimp_iscissors_tool_register,
|
||||
gimp_select_by_content_tool_register,
|
||||
#endif
|
||||
gimp_by_color_select_tool_register,
|
||||
gimp_fuzzy_select_tool_register,
|
||||
gimp_free_select_tool_register,
|
||||
gimp_ellipse_select_tool_register,
|
||||
gimp_rectangle_select_tool_register
|
||||
gimp_rectangle_select_tool_register,
|
||||
gimp_select_by_color_tool_register,
|
||||
gimp_select_by_shape_tool_register
|
||||
};
|
||||
|
||||
GList *default_order = NULL;
|
||||
|
@@ -25,10 +25,16 @@
|
||||
|
||||
#include "tools-types.h"
|
||||
|
||||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimppropwidgets.h"
|
||||
|
||||
#include "gimpiscissorstool.h"
|
||||
#include "gimpiscissorsoptions.h"
|
||||
#include "gimpselectbycontenttool.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
@@ -36,7 +42,8 @@
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_INTERACTIVE
|
||||
PROP_INTERACTIVE,
|
||||
PROP_MAGNETIC
|
||||
};
|
||||
|
||||
|
||||
@@ -70,6 +77,13 @@ gimp_iscissors_options_class_init (GimpIscissorsOptionsClass *klass)
|
||||
"as you drag a control node"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MAGNETIC,
|
||||
"magnetic",
|
||||
N_("Make the selection magnetic "
|
||||
"as you drag a control node"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -91,6 +105,10 @@ gimp_iscissors_options_set_property (GObject *object,
|
||||
options->interactive = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_MAGNETIC:
|
||||
options->magnetic = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
@@ -111,6 +129,10 @@ gimp_iscissors_options_get_property (GObject *object,
|
||||
g_value_set_boolean (value, options->interactive);
|
||||
break;
|
||||
|
||||
case PROP_MAGNETIC:
|
||||
options->magnetic = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
@@ -123,11 +145,28 @@ gimp_iscissors_options_gui (GimpToolOptions *tool_options)
|
||||
GObject *config = G_OBJECT (tool_options);
|
||||
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
|
||||
GtkWidget *button;
|
||||
GtkWidget *frame;
|
||||
|
||||
button = gimp_prop_check_button_new (config, "interactive",
|
||||
GType tool_type;
|
||||
|
||||
tool_type = tool_options->tool_info->tool_type;
|
||||
|
||||
/*if (g_type_is_a (tool_type, GIMP_TYPE_SELECT_BY_CONTENT_TOOL))
|
||||
{
|
||||
|
||||
button = gimp_prop_check_button_new (config, "interactive",
|
||||
_("Interactive boundary"));
|
||||
|
||||
frame = gimp_prop_expanding_frame_new (config, "magnetic",
|
||||
_("Magnetic Path"),
|
||||
button, NULL);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
}*/
|
||||
|
||||
button = gimp_prop_check_button_new (config, "interactive",
|
||||
_("Interactive boundary"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ struct _GimpIscissorsOptions
|
||||
GimpSelectionOptions parent_instance;
|
||||
|
||||
gboolean interactive;
|
||||
gboolean magnetic;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -25,14 +25,18 @@
|
||||
|
||||
#include "tools-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "widgets/gimppropwidgets.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "gimprectangleoptions.h"
|
||||
#include "gimprectangleselectoptions.h"
|
||||
#include "gimprectangleselecttool.h"
|
||||
#include "gimptooloptions-gui.h"
|
||||
#include "gimpselectbyshapetool.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
@@ -40,7 +44,10 @@
|
||||
enum
|
||||
{
|
||||
PROP_ROUND_CORNERS = GIMP_RECTANGLE_OPTIONS_PROP_LAST + 1,
|
||||
PROP_CORNER_RADIUS
|
||||
PROP_CORNER_RADIUS,
|
||||
PROP_SHAPE_TYPE,
|
||||
PROP_LINE_ORIENTATION,
|
||||
PROP_N_SIDES
|
||||
};
|
||||
|
||||
|
||||
@@ -91,6 +98,26 @@ gimp_rectangle_select_options_class_init (GimpRectangleSelectOptionsClass *klass
|
||||
0.0, 100.0, 5.0,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_SHAPE_TYPE,
|
||||
"shape-type",
|
||||
N_("Select shape of the selection"),
|
||||
GIMP_TYPE_SHAPE_TYPE,
|
||||
GIMP_SHAPE_RECTANGLE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_LINE_ORIENTATION,
|
||||
"line-orientation",
|
||||
N_("Choice between horizontal and vertical"),
|
||||
GIMP_TYPE_ORIENTATION_TYPE,
|
||||
GIMP_ORIENTATION_HORIZONTAL,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_N_SIDES,
|
||||
"n-sides",
|
||||
N_("Number of sides, in the polygon"),
|
||||
0, 8, 1,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
gimp_rectangle_options_install_properties (object_class);
|
||||
}
|
||||
|
||||
@@ -117,6 +144,18 @@ gimp_rectangle_select_options_set_property (GObject *object,
|
||||
options->corner_radius = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_SHAPE_TYPE:
|
||||
options->shape_type = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_LINE_ORIENTATION:
|
||||
options->line_orientation = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_N_SIDES:
|
||||
options->n_sides = g_value_get_int (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
gimp_rectangle_options_set_property (object, property_id, value, pspec);
|
||||
break;
|
||||
@@ -141,24 +180,53 @@ gimp_rectangle_select_options_get_property (GObject *object,
|
||||
g_value_set_double (value, options->corner_radius);
|
||||
break;
|
||||
|
||||
case PROP_SHAPE_TYPE:
|
||||
g_value_set_enum (value, options->shape_type);
|
||||
break;
|
||||
|
||||
case PROP_LINE_ORIENTATION:
|
||||
g_value_set_enum (value, options->line_orientation);
|
||||
break;
|
||||
|
||||
case PROP_N_SIDES:
|
||||
g_value_set_int (value, options->n_sides);
|
||||
break;
|
||||
|
||||
default:
|
||||
gimp_rectangle_options_get_property (object, property_id, value, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_select_by_shape_options_shape_type(GBinding *binding,
|
||||
const GValue *source_value,
|
||||
GValue *target_value,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint type = g_value_get_enum (source_value);
|
||||
|
||||
g_value_set_boolean (target_value,
|
||||
type == GPOINTER_TO_INT (user_data));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_rectangle_select_options_gui (GimpToolOptions *tool_options)
|
||||
{
|
||||
GObject *config = G_OBJECT (tool_options);
|
||||
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
|
||||
GtkWidget *combo;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *inner_vbox;
|
||||
|
||||
/* the round corners frame */
|
||||
if (tool_options->tool_info->tool_type == GIMP_TYPE_RECTANGLE_SELECT_TOOL)
|
||||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *toggle;
|
||||
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "corner-radius",
|
||||
_("Radius"),
|
||||
@@ -177,14 +245,72 @@ gimp_rectangle_select_options_gui (GimpToolOptions *tool_options)
|
||||
G_BINDING_SYNC_CREATE);
|
||||
}
|
||||
|
||||
/* the rectangle options */
|
||||
{
|
||||
GtkWidget *vbox_rectangle;
|
||||
/* for select by shape tool */
|
||||
if (tool_options->tool_info->tool_type == GIMP_TYPE_SELECT_BY_SHAPE_TOOL)
|
||||
{
|
||||
combo = gimp_prop_enum_combo_box_new (config, "shape-type", 0, 0);
|
||||
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Shape"));
|
||||
g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
vbox_rectangle = gimp_rectangle_options_gui (tool_options);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), vbox_rectangle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (vbox_rectangle);
|
||||
}
|
||||
frame = gimp_frame_new (NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
return vbox;
|
||||
inner_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
|
||||
gtk_container_add (GTK_CONTAINER (frame), inner_vbox);
|
||||
gtk_widget_show (inner_vbox);
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "corner-radius",
|
||||
_("Radius"),
|
||||
1.0, 10.0, 1);
|
||||
gtk_box_pack_start (GTK_BOX (inner_vbox), scale, FALSE, FALSE, 0);
|
||||
|
||||
g_object_bind_property_full (config, "shape-type",
|
||||
scale, "visible",
|
||||
G_BINDING_SYNC_CREATE,
|
||||
gimp_select_by_shape_options_shape_type,
|
||||
NULL,
|
||||
GINT_TO_POINTER (GIMP_SHAPE_ROUNDED_RECT),
|
||||
NULL);
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "n-sides",
|
||||
_("Number of Sides in Polygon ?"),
|
||||
1.0, 10.0, 1);
|
||||
gtk_box_pack_start (GTK_BOX (inner_vbox), scale, TRUE, TRUE, 0);
|
||||
|
||||
g_object_bind_property_full (config, "shape-type",
|
||||
scale, "visible",
|
||||
G_BINDING_SYNC_CREATE,
|
||||
gimp_select_by_shape_options_shape_type,
|
||||
NULL,
|
||||
GINT_TO_POINTER (GIMP_SHAPE_N_POLYGON),
|
||||
NULL);
|
||||
|
||||
combo = gimp_prop_enum_combo_box_new (config, "line_orientation", 0, 0);
|
||||
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Line Orientation"));
|
||||
g_object_set (combo, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
g_object_bind_property_full (config, "shape-type",
|
||||
combo, "visible",
|
||||
G_BINDING_SYNC_CREATE,
|
||||
gimp_select_by_shape_options_shape_type,
|
||||
NULL,
|
||||
GINT_TO_POINTER (GIMP_SHAPE_SINGLE_ROW),
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* the rectangle options */
|
||||
{
|
||||
GtkWidget *vbox_rectangle;
|
||||
|
||||
vbox_rectangle = gimp_rectangle_options_gui (tool_options);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), vbox_rectangle, FALSE, FALSE, 0);
|
||||
gtk_widget_show (vbox_rectangle);
|
||||
}
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
@@ -39,6 +39,9 @@ struct _GimpRectangleSelectOptions
|
||||
|
||||
gboolean round_corners;
|
||||
gdouble corner_radius;
|
||||
gint n_sides;
|
||||
GimpShapeType shape_type;
|
||||
GimpOrientationType line_orientation;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1,227 +1,304 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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 "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimppropwidgets.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "gimpregionselectoptions.h"
|
||||
#include "gimpregionselecttool.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_SELECT_TRANSPARENT,
|
||||
PROP_SAMPLE_MERGED,
|
||||
PROP_THRESHOLD,
|
||||
PROP_SELECT_CRITERION
|
||||
};
|
||||
|
||||
|
||||
static void gimp_region_select_options_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_region_select_options_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gimp_region_select_options_reset (GimpToolOptions *tool_options);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpRegionSelectOptions, gimp_region_select_options,
|
||||
GIMP_TYPE_SELECTION_OPTIONS)
|
||||
|
||||
#define parent_class gimp_region_select_options_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_region_select_options_class_init (GimpRegionSelectOptionsClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GimpToolOptionsClass *options_class = GIMP_TOOL_OPTIONS_CLASS (klass);
|
||||
|
||||
object_class->set_property = gimp_region_select_options_set_property;
|
||||
object_class->get_property = gimp_region_select_options_get_property;
|
||||
|
||||
options_class->reset = gimp_region_select_options_reset;
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SELECT_TRANSPARENT,
|
||||
"select-transparent",
|
||||
N_("Allow completely transparent regions "
|
||||
"to be selected"),
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_MERGED,
|
||||
"sample-merged",
|
||||
N_("Base selection on all visible layers"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_THRESHOLD,
|
||||
"threshold",
|
||||
N_("Maximum color difference"),
|
||||
0.0, 255.0, 15.0,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_SELECT_CRITERION,
|
||||
"select-criterion",
|
||||
N_("Selection criterion"),
|
||||
GIMP_TYPE_SELECT_CRITERION,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_init (GimpRegionSelectOptions *options)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpRegionSelectOptions *options = GIMP_REGION_SELECT_OPTIONS (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_SELECT_TRANSPARENT:
|
||||
options->select_transparent = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_SAMPLE_MERGED:
|
||||
options->sample_merged = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD:
|
||||
options->threshold = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_SELECT_CRITERION:
|
||||
options->select_criterion = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpRegionSelectOptions *options = GIMP_REGION_SELECT_OPTIONS (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_SELECT_TRANSPARENT:
|
||||
g_value_set_boolean (value, options->select_transparent);
|
||||
break;
|
||||
|
||||
case PROP_SAMPLE_MERGED:
|
||||
g_value_set_boolean (value, options->sample_merged);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD:
|
||||
g_value_set_double (value, options->threshold);
|
||||
break;
|
||||
|
||||
case PROP_SELECT_CRITERION:
|
||||
g_value_set_enum (value, options->select_criterion);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_reset (GimpToolOptions *tool_options)
|
||||
{
|
||||
GParamSpec *pspec;
|
||||
|
||||
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool_options),
|
||||
"threshold");
|
||||
|
||||
if (pspec)
|
||||
G_PARAM_SPEC_DOUBLE (pspec)->default_value =
|
||||
tool_options->tool_info->gimp->config->default_threshold;
|
||||
|
||||
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_region_select_options_gui (GimpToolOptions *tool_options)
|
||||
{
|
||||
GObject *config = G_OBJECT (tool_options);
|
||||
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
|
||||
GtkWidget *button;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *combo;
|
||||
|
||||
/* the select transparent areas toggle */
|
||||
button = gimp_prop_check_button_new (config, "select-transparent",
|
||||
_("Select transparent areas"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* the sample merged toggle */
|
||||
button = gimp_prop_check_button_new (config, "sample-merged",
|
||||
_("Sample merged"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* the threshold scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "threshold",
|
||||
_("Threshold"),
|
||||
1.0, 16.0, 1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
/* the select criterion combo */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
|
||||
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Select by"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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 "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimppropwidgets.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "gimpregionselectoptions.h"
|
||||
#include "gimpregionselecttool.h"
|
||||
#include "gimpselectbycolortool.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_SELECT_TRANSPARENT,
|
||||
PROP_SAMPLE_MERGED,
|
||||
PROP_THRESHOLD,
|
||||
PROP_CONTINUOUS, //continuous
|
||||
PROP_SELECT_CRITERION,
|
||||
PROP_MULTIPLE_COLOR,
|
||||
PROP_BRUSH_SIZE
|
||||
};
|
||||
|
||||
|
||||
static void gimp_region_select_options_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static void gimp_region_select_options_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void gimp_region_select_options_reset (GimpToolOptions *tool_options);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpRegionSelectOptions, gimp_region_select_options,
|
||||
GIMP_TYPE_SELECTION_OPTIONS)
|
||||
|
||||
#define parent_class gimp_region_select_options_parent_class
|
||||
|
||||
|
||||
static void
|
||||
gimp_region_select_options_class_init (GimpRegionSelectOptionsClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GimpToolOptionsClass *options_class = GIMP_TOOL_OPTIONS_CLASS (klass);
|
||||
|
||||
object_class->set_property = gimp_region_select_options_set_property;
|
||||
object_class->get_property = gimp_region_select_options_get_property;
|
||||
|
||||
options_class->reset = gimp_region_select_options_reset;
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SELECT_TRANSPARENT,
|
||||
"select-transparent",
|
||||
N_("Allow completely transparent regions "
|
||||
"to be selected"),
|
||||
TRUE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAMPLE_MERGED,
|
||||
"sample-merged",
|
||||
N_("Base selection on all visible layers"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_THRESHOLD,
|
||||
"threshold",
|
||||
N_("Maximum color difference"),
|
||||
0.0, 255.0, 15.0,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CONTINUOUS,
|
||||
"continuous",
|
||||
N_("Select only continuous region"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_SELECT_CRITERION,
|
||||
"select-criterion",
|
||||
N_("Selection criterion"),
|
||||
GIMP_TYPE_SELECT_CRITERION,
|
||||
GIMP_SELECT_CRITERION_COMPOSITE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_MULTIPLE_COLOR,
|
||||
"multiple-color",
|
||||
N_("Allows multiple color"),
|
||||
FALSE,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
|
||||
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BRUSH_SIZE,
|
||||
"brush-size",
|
||||
N_("Radius of Brush"),
|
||||
0.0, 6000.0, 10.0,
|
||||
GIMP_PARAM_STATIC_STRINGS);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_init (GimpRegionSelectOptions *options)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpRegionSelectOptions *options = GIMP_REGION_SELECT_OPTIONS (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_SELECT_TRANSPARENT:
|
||||
options->select_transparent = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_SAMPLE_MERGED:
|
||||
options->sample_merged = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD:
|
||||
options->threshold = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
case PROP_CONTINUOUS:
|
||||
options->continuous = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_SELECT_CRITERION:
|
||||
options->select_criterion = g_value_get_enum (value);
|
||||
break;
|
||||
|
||||
case PROP_MULTIPLE_COLOR:
|
||||
options->multiple_color = g_value_get_boolean (value);
|
||||
break;
|
||||
|
||||
case PROP_BRUSH_SIZE:
|
||||
options->brush_size = g_value_get_double (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GimpRegionSelectOptions *options = GIMP_REGION_SELECT_OPTIONS (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_SELECT_TRANSPARENT:
|
||||
g_value_set_boolean (value, options->select_transparent);
|
||||
break;
|
||||
|
||||
case PROP_SAMPLE_MERGED:
|
||||
g_value_set_boolean (value, options->sample_merged);
|
||||
break;
|
||||
|
||||
case PROP_THRESHOLD:
|
||||
g_value_set_double (value, options->threshold);
|
||||
break;
|
||||
|
||||
case PROP_CONTINUOUS:
|
||||
g_value_set_boolean (value, options->continuous);
|
||||
break;
|
||||
|
||||
case PROP_SELECT_CRITERION:
|
||||
g_value_set_enum (value, options->select_criterion);
|
||||
break;
|
||||
|
||||
case PROP_MULTIPLE_COLOR:
|
||||
g_value_set_boolean (value, options->multiple_color);
|
||||
break;
|
||||
|
||||
case PROP_BRUSH_SIZE:
|
||||
g_value_set_double (value, options->brush_size);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_region_select_options_reset (GimpToolOptions *tool_options)
|
||||
{
|
||||
GParamSpec *pspec;
|
||||
|
||||
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (tool_options),
|
||||
"threshold");
|
||||
|
||||
if (pspec)
|
||||
G_PARAM_SPEC_DOUBLE (pspec)->default_value =
|
||||
tool_options->tool_info->gimp->config->default_threshold;
|
||||
|
||||
GIMP_TOOL_OPTIONS_CLASS (parent_class)->reset (tool_options);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_region_select_options_gui (GimpToolOptions *tool_options)
|
||||
{
|
||||
GObject *config = G_OBJECT (tool_options);
|
||||
GtkWidget *vbox = gimp_selection_options_gui (tool_options);
|
||||
GtkWidget *button;
|
||||
GtkWidget *scale;
|
||||
GtkWidget *combo;
|
||||
|
||||
GType tool_type;
|
||||
|
||||
tool_type = tool_options->tool_info->tool_type;
|
||||
|
||||
/* the select transparent areas toggle */
|
||||
button = gimp_prop_check_button_new (config, "select-transparent",
|
||||
_("Select transparent areas"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* the sample merged toggle */
|
||||
button = gimp_prop_check_button_new (config, "sample-merged",
|
||||
_("Sample merged"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* the threshold scale */
|
||||
scale = gimp_prop_spin_scale_new (config, "threshold",
|
||||
_("Threshold"),
|
||||
1.0, 16.0, 1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
||||
gtk_widget_show (scale);
|
||||
|
||||
if (g_type_is_a (tool_type, GIMP_TYPE_SELECT_BY_COLOR_TOOL))
|
||||
{
|
||||
GtkWidget *frame;
|
||||
|
||||
/* the continuous toggle */
|
||||
button = gimp_prop_check_button_new (config, "continuous",
|
||||
_("Continuous"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
/*multiple color*/
|
||||
|
||||
scale = gimp_prop_spin_scale_new (config, "brush-size",
|
||||
_("Brush Size"),
|
||||
1.0, 10.0, 1);
|
||||
|
||||
frame = gimp_prop_expanding_frame_new (config, "multiple-color",
|
||||
_("Multiple Color"),
|
||||
scale, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* the select criterion combo */
|
||||
combo = gimp_prop_enum_combo_box_new (config, "select-criterion", 0, 0);
|
||||
gimp_int_combo_box_set_label (GIMP_INT_COMBO_BOX (combo), _("Select by"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
|
||||
gtk_widget_show (combo);
|
||||
|
||||
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
@@ -1,52 +1,55 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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_REGION_SELECT_OPTIONS_H__
|
||||
#define __GIMP_REGION_SELECT_OPTIONS_H__
|
||||
|
||||
|
||||
#include "gimpselectionoptions.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_REGION_SELECT_OPTIONS (gimp_region_select_options_get_type ())
|
||||
#define GIMP_REGION_SELECT_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptions))
|
||||
#define GIMP_REGION_SELECT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptionsClass))
|
||||
#define GIMP_IS_REGION_SELECT_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS))
|
||||
#define GIMP_IS_REGION_SELECT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_REGION_SELECT_OPTIONS))
|
||||
#define GIMP_REGION_SELECT_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptionsClass))
|
||||
|
||||
|
||||
typedef struct _GimpRegionSelectOptions GimpRegionSelectOptions;
|
||||
typedef struct _GimpToolOptionsClass GimpRegionSelectOptionsClass;
|
||||
|
||||
struct _GimpRegionSelectOptions
|
||||
{
|
||||
GimpSelectionOptions parent_instance;
|
||||
|
||||
gboolean select_transparent;
|
||||
gboolean sample_merged;
|
||||
gdouble threshold;
|
||||
GimpSelectCriterion select_criterion;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_region_select_options_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_region_select_options_gui (GimpToolOptions *tool_options);
|
||||
|
||||
|
||||
#endif /* __GIMP_REGION_SELECT_OPTIONS_H__ */
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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_REGION_SELECT_OPTIONS_H__
|
||||
#define __GIMP_REGION_SELECT_OPTIONS_H__
|
||||
|
||||
|
||||
#include "gimpselectionoptions.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_REGION_SELECT_OPTIONS (gimp_region_select_options_get_type ())
|
||||
#define GIMP_REGION_SELECT_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptions))
|
||||
#define GIMP_REGION_SELECT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptionsClass))
|
||||
#define GIMP_IS_REGION_SELECT_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS))
|
||||
#define GIMP_IS_REGION_SELECT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_REGION_SELECT_OPTIONS))
|
||||
#define GIMP_REGION_SELECT_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_REGION_SELECT_OPTIONS, GimpRegionSelectOptionsClass))
|
||||
|
||||
|
||||
typedef struct _GimpRegionSelectOptions GimpRegionSelectOptions;
|
||||
typedef struct _GimpToolOptionsClass GimpRegionSelectOptionsClass;
|
||||
|
||||
struct _GimpRegionSelectOptions
|
||||
{
|
||||
GimpSelectionOptions parent_instance;
|
||||
|
||||
gboolean select_transparent;
|
||||
gboolean sample_merged;
|
||||
gdouble threshold;
|
||||
gboolean continuous;
|
||||
GimpSelectCriterion select_criterion;
|
||||
gboolean multiple_color;
|
||||
gdouble brush_size;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_region_select_options_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_region_select_options_gui (GimpToolOptions *tool_options);
|
||||
|
||||
|
||||
#endif /* __GIMP_REGION_SELECT_OPTIONS_H__ */
|
||||
|
151
app/tools/gimpselectbycolortool.c
Normal file
151
app/tools/gimpselectbycolortool.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpselectbycolortool.c
|
||||
*
|
||||
* 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 <gegl.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "tools-types.h"
|
||||
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-contiguous-region.h"
|
||||
#include "core/gimpitem.h"
|
||||
#include "core/gimppickable.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "display/gimpdisplay.h"
|
||||
|
||||
#include "gimpselectbycolortool.h"
|
||||
#include "gimpregionselectoptions.h"
|
||||
#include "gimptoolcontrol.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
static GeglBuffer * gimp_select_by_color_tool_get_mask (GimpRegionSelectTool *region_select,
|
||||
GimpDisplay *display);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GimpSelectByColorTool, gimp_select_by_color_tool,
|
||||
GIMP_TYPE_REGION_SELECT_TOOL)
|
||||
|
||||
#define parent_class gimp_select_by_color_tool_parent_class
|
||||
|
||||
|
||||
void
|
||||
gimp_select_by_color_tool_register (GimpToolRegisterCallback callback,
|
||||
gpointer data)
|
||||
{
|
||||
(* callback) (GIMP_TYPE_SELECT_BY_COLOR_TOOL,
|
||||
GIMP_TYPE_REGION_SELECT_OPTIONS,
|
||||
gimp_region_select_options_gui,
|
||||
0,
|
||||
"gimp-select_by_color-tool",
|
||||
_("Select by Color"),
|
||||
_("Select by Color Tool: Select regions with similar colors; Both Over Continous and Closed Place"),
|
||||
N_("_Select By Color"), "<shift>X",
|
||||
NULL, GIMP_HELP_TOOL_SELECT_BY_COLOR,
|
||||
GIMP_STOCK_TOOL_SELECT_BY_COLOR,
|
||||
data);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_select_by_color_tool_class_init (GimpSelectByColorToolClass *klass)
|
||||
{
|
||||
GimpRegionSelectToolClass *region_class;
|
||||
|
||||
region_class = GIMP_REGION_SELECT_TOOL_CLASS (klass);
|
||||
|
||||
region_class->undo_desc = C_("command", "Select by Color");
|
||||
region_class->get_mask = gimp_select_by_color_tool_get_mask;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_select_by_color_tool_init (GimpSelectByColorTool *select_by_color)
|
||||
{
|
||||
GimpTool *tool = GIMP_TOOL (select_by_color);
|
||||
|
||||
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_HAND);
|
||||
}
|
||||
|
||||
static GeglBuffer *
|
||||
gimp_select_by_color_tool_get_mask (GimpRegionSelectTool *region_select,
|
||||
GimpDisplay *display)
|
||||
{
|
||||
GimpTool *tool = GIMP_TOOL (region_select);
|
||||
GimpSelectionOptions *sel_options = GIMP_SELECTION_TOOL_GET_OPTIONS (tool);
|
||||
GimpRegionSelectOptions *options = GIMP_REGION_SELECT_TOOL_GET_OPTIONS (tool);
|
||||
GimpImage *image = gimp_display_get_image (display);
|
||||
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
||||
GimpPickable *pickable;
|
||||
GimpRGB color;
|
||||
gint x, y;
|
||||
|
||||
x = region_select->x;
|
||||
y = region_select->y;
|
||||
|
||||
if (! options->sample_merged)
|
||||
{
|
||||
gint off_x, off_y;
|
||||
|
||||
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
|
||||
|
||||
x -= off_x;
|
||||
y -= off_y;
|
||||
|
||||
pickable = GIMP_PICKABLE (drawable);
|
||||
}
|
||||
else
|
||||
{
|
||||
pickable = GIMP_PICKABLE (gimp_image_get_projection (image));
|
||||
}
|
||||
|
||||
gimp_pickable_flush (pickable);
|
||||
|
||||
if(! options->continuous)
|
||||
{
|
||||
return gimp_image_contiguous_region_by_seed (image, drawable,
|
||||
options->sample_merged,
|
||||
sel_options->antialias,
|
||||
options->threshold / 255.0,
|
||||
options->select_transparent,
|
||||
options->select_criterion,
|
||||
x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gimp_pickable_get_color_at (pickable, x, y, &color))
|
||||
return gimp_image_contiguous_region_by_color (image, drawable,
|
||||
options->sample_merged,
|
||||
sel_options->antialias,
|
||||
options->threshold / 255.0,
|
||||
options->select_transparent,
|
||||
options->select_criterion,
|
||||
&color);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
55
app/tools/gimpselectbycolortool.h
Normal file
55
app/tools/gimpselectbycolortool.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* gimpselectbycolortool.h
|
||||
*
|
||||
* 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_SELECT_BY_COLOR_TOOL_H__
|
||||
#define __GIMP_SELECT_BY_COLOR_TOOL_H__
|
||||
|
||||
|
||||
#include "gimpregionselecttool.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_SELECT_BY_COLOR_TOOL (gimp_select_by_color_tool_get_type ())
|
||||
#define GIMP_SELECT_BY_COLOR_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SELECT_BY_COLOR_TOOL, GimpSelectByColorTool))
|
||||
#define GIMP_SELECT_BY_COLOR_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SELECT_BY_COLOR_TOOL, GimpSelectByColorToolClass))
|
||||
#define GIMP_IS_SELECT_BY_COLOR_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_SELECT_BY_COLOR_TOOL))
|
||||
#define GIMP_IS_SELECT_BY_COLOR_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SELECT_BY_COLOR_TOOL))
|
||||
#define GIMP_SELECT_BY_COLOR_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_SELECT_BY_COLOR_TOOL, GimpSelectByColorToolClass))
|
||||
|
||||
|
||||
typedef struct _GimpSelectByColorTool GimpSelectByColorTool;
|
||||
typedef struct _GimpSelectByColorToolClass GimpSelectByColorToolClass;
|
||||
|
||||
struct _GimpSelectByColorTool
|
||||
{
|
||||
GimpRegionSelectTool parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpSelectByColorToolClass
|
||||
{
|
||||
GimpRegionSelectToolClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
void gimp_select_by_color_tool_register (GimpToolRegisterCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GType gimp_select_by_color_tool_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
#endif /* __GIMP_SELECT_BY_COLOR_TOOL_H__ */
|
3275
app/tools/gimpselectbycontenttool.c
Normal file
3275
app/tools/gimpselectbycontenttool.c
Normal file
File diff suppressed because it is too large
Load Diff
114
app/tools/gimpselectbycontenttool.h
Normal file
114
app/tools/gimpselectbycontenttool.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
|
||||
#ifndef __GIMP_SELECT_BY_CONTENT_TOOL_H__
|
||||
#define __GIMP_SELECT_BY_CONTENT_TOOL_H__
|
||||
|
||||
|
||||
#include "gimpselectiontool.h"
|
||||
|
||||
/* The possible states... */
|
||||
typedef enum
|
||||
{
|
||||
NO_ACTION,
|
||||
SEED_PLACEMENT,
|
||||
SEED_ADJUSTMENT,
|
||||
WAITING
|
||||
} SelectByContentState;
|
||||
|
||||
/* For oper_update & cursor_update */
|
||||
typedef enum
|
||||
{
|
||||
ISCISSORS_OP_NONE,
|
||||
ISCISSORS_OP_SELECT,
|
||||
ISCISSORS_OP_MOVE_POINT,
|
||||
ISCISSORS_OP_ADD_POINT,
|
||||
ISCISSORS_OP_CONNECT,
|
||||
ISCISSORS_OP_IMPOSSIBLE
|
||||
} SelectByContentOps;
|
||||
|
||||
typedef struct _ICurve ICurve;
|
||||
|
||||
#define GIMP_TYPE_SELECT_BY_CONTENT_TOOL (gimp_select_by_content_tool_get_type ())
|
||||
#define GIMP_SELECT_BY_CONTENT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SELECT_BY_CONTENT_TOOL, GimpSelectByContentTool))
|
||||
#define GIMP_SELECT_BY_CONTENT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SELECT_BY_CONTENT_TOOL, GimpSelectByContentToolClass))
|
||||
#define GIMP_IS_SELECT_BY_CONTENT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_SELECT_BY_CONTENT_TOOL))
|
||||
#define GIMP_IS_SELECT_BY_CONTENT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SELECT_BY_CONTENT_TOOL))
|
||||
#define GIMP_SELECT_BY_CONTENT_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_SELECT_BY_CONTENT_TOOL, GimpSelectByContentToolClass))
|
||||
|
||||
#define GIMP_SELECT_BY_CONTENT_TOOL_GET_OPTIONS(t) (GIMP_SELECT_BY_CONTENT_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
|
||||
|
||||
|
||||
typedef struct _GimpSelectByContentTool GimpSelectByContentTool;
|
||||
typedef struct _GimpSelectByContentToolClass GimpSelectByContentToolClass;
|
||||
|
||||
struct _GimpSelectByContentTool
|
||||
{
|
||||
GimpSelectionTool parent_instance;
|
||||
|
||||
SelectByContentOps op;
|
||||
|
||||
gint x, y; /* upper left hand coordinate */
|
||||
gint ix, iy; /* initial coordinates */
|
||||
gint nx, ny; /* new coordinates */
|
||||
|
||||
TempBuf *dp_buf; /* dynamic programming buffer */
|
||||
|
||||
ICurve *livewire; /* livewire boundary curve */
|
||||
|
||||
ICurve *curve1; /* 1st curve connected to current point */
|
||||
ICurve *curve2; /* 2nd curve connected to current point */
|
||||
|
||||
GQueue *curves; /* the list of curves */
|
||||
|
||||
gboolean first_point; /* is this the first point? */
|
||||
gboolean connected; /* is the region closed? */
|
||||
|
||||
SelectByContentState state; /* state of iscissors */
|
||||
|
||||
/* XXX might be useful */
|
||||
GimpChannel *mask; /* selection mask */
|
||||
TileManager *gradient_map; /* lazily filled gradient map */
|
||||
};
|
||||
|
||||
struct _GimpSelectByContentToolClass
|
||||
{
|
||||
GimpSelectionToolClass parent_class;
|
||||
|
||||
void (* select) (GimpSelectByContentTool *select_by_content_tool,
|
||||
GimpDisplay *display);
|
||||
};
|
||||
|
||||
|
||||
void gimp_select_by_content_tool_register (GimpToolRegisterCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GType gimp_select_by_content_tool_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void gimp_select_by_content_tool_select (GimpSelectByContentTool *free_sel,
|
||||
GimpDisplay *display);
|
||||
|
||||
void gimp_select_by_content_tool_get_points (GimpSelectByContentTool *free_sel,
|
||||
const GimpVector2 **points,
|
||||
gint *n_points);
|
||||
|
||||
|
||||
#endif /* __GIMP_SELECT_BY_CONTENT_TOOL_H__ */
|
||||
|
||||
#endif
|
1073
app/tools/gimpselectbyshapetool.c
Normal file
1073
app/tools/gimpselectbyshapetool.c
Normal file
File diff suppressed because it is too large
Load Diff
64
app/tools/gimpselectbyshapetool.h
Normal file
64
app/tools/gimpselectbyshapetool.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* GIMP - The GNU Image Manipulation Program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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_SELECT_BY_SHAPE_TOOL_H__
|
||||
#define __GIMP_SELECT_BY_SHAPE_TOOL_H__
|
||||
|
||||
|
||||
#include "gimpselectiontool.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_SELECT_BY_SHAPE_TOOL (gimp_select_by_shape_tool_get_type ())
|
||||
#define GIMP_SELECT_BY_SHAPE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_SELECT_BY_SHAPE_TOOL, GimpSelectByShapeTool))
|
||||
#define GIMP_SELECT_BY_SHAPE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SELECT_BY_SHAPE_TOOL, GimpSelectByShapeToolClass))
|
||||
#define GIMP_IS_SELECT_BY_SHAPE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_SELECT_BY_SHAPE_TOOL))
|
||||
#define GIMP_IS_SELECT_BY_SHAPE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SELECT_BY_SHAPE_TOOL))
|
||||
#define GIMP_SELECT_BY_SHAPE_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_SELECT_BY_SHAPE_TOOL, GimpSelectByShapeToolClass))
|
||||
|
||||
#define GIMP_SELECT_BY_SHAPE_TOOL_GET_OPTIONS(t) (GIMP_RECTANGLE_SELECT_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
|
||||
|
||||
|
||||
typedef struct _GimpSelectByShapeTool GimpSelectByShapeTool;
|
||||
typedef struct _GimpSelectByShapeToolClass GimpSelectByShapeToolClass;
|
||||
|
||||
struct _GimpSelectByShapeTool
|
||||
{
|
||||
GimpSelectionTool parent_instance;
|
||||
|
||||
gpointer priv;
|
||||
};
|
||||
|
||||
struct _GimpSelectByShapeToolClass
|
||||
{
|
||||
GimpSelectionToolClass parent_class;
|
||||
|
||||
void (* select) (GimpSelectByShapeTool *rect_select,
|
||||
GimpChannelOps operation,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h);
|
||||
};
|
||||
|
||||
|
||||
void gimp_select_by_shape_tool_register (GimpToolRegisterCallback callback,
|
||||
gpointer data);
|
||||
|
||||
GType gimp_select_by_shape_tool_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
#endif /* __GIMP_SELECT_BY_SHAPE_TOOL_H__ */
|
@@ -293,6 +293,9 @@
|
||||
#define GIMP_HELP_TOOL_ROTATE "gimp-tool-rotate"
|
||||
#define GIMP_HELP_TOOL_SCALE "gimp-tool-scale"
|
||||
#define GIMP_HELP_TOOL_SEAMLESS_CLONE "gimp-tool-seamless-clone"
|
||||
#define GIMP_HELP_TOOL_SELECT_BY_COLOR "gimp-tool-select-by-color"
|
||||
#define GIMP_HELP_TOOL_SELECT_BY_CONTENT "gimp-tool-select-by-content"
|
||||
#define GIMP_HELP_TOOL_SELECT_BY_SHAPE "gimp-tool-select-by-shape"
|
||||
#define GIMP_HELP_TOOL_SHEAR "gimp-tool-shear"
|
||||
#define GIMP_HELP_TOOL_SMUDGE "gimp-tool-smudge"
|
||||
#define GIMP_HELP_TOOL_TEXT "gimp-tool-text"
|
||||
|
@@ -10865,6 +10865,7 @@ GimpOffsetType
|
||||
GimpOrientationType
|
||||
GimpRotationType
|
||||
GimpSelectCriterion
|
||||
GimpShapeType
|
||||
GimpStrokeMethod
|
||||
GimpThumbnailSize
|
||||
GimpUndoEvent
|
||||
@@ -10899,6 +10900,7 @@ GIMP_TYPE_OFFSET_TYPE
|
||||
GIMP_TYPE_ORIENTATION_TYPE
|
||||
GIMP_TYPE_ROTATION_TYPE
|
||||
GIMP_TYPE_SELECT_CRITERION
|
||||
GIMP_TYPE_SHAPE_TYPE
|
||||
GIMP_TYPE_STROKE_METHOD
|
||||
GIMP_TYPE_THUMBNAIL_SIZE
|
||||
GIMP_TYPE_UNDO_EVENT
|
||||
@@ -10932,6 +10934,7 @@ gimp_offset_type_get_type
|
||||
gimp_orientation_type_get_type
|
||||
gimp_rotation_type_get_type
|
||||
gimp_select_criterion_get_type
|
||||
gimp_shape_type_get_type
|
||||
gimp_stroke_method_get_type
|
||||
gimp_thumbnail_size_get_type
|
||||
gimp_undo_event_get_type
|
||||
|
@@ -78,6 +78,7 @@ GimpOffsetType
|
||||
GimpOrientationType
|
||||
GimpRotationType
|
||||
GimpSelectCriterion
|
||||
GimpShapeType
|
||||
gimp_enums_get_type_names
|
||||
<SUBSECTION Standard>
|
||||
GIMP_TYPE_BRUSH_APPLICATION_MODE
|
||||
@@ -99,6 +100,7 @@ GIMP_TYPE_OFFSET_TYPE
|
||||
GIMP_TYPE_ORIENTATION_TYPE
|
||||
GIMP_TYPE_ROTATION_TYPE
|
||||
GIMP_TYPE_SELECT_CRITERION
|
||||
GIMP_TYPE_SHAPE_TYPE
|
||||
gimp_brush_application_mode_get_type
|
||||
gimp_brush_generated_shape_get_type
|
||||
gimp_convert_dither_type_get_type
|
||||
@@ -118,6 +120,7 @@ gimp_offset_type_get_type
|
||||
gimp_orientation_type_get_type
|
||||
gimp_rotation_type_get_type
|
||||
gimp_select_criterion_get_type
|
||||
gimp_shape_type_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@@ -746,6 +746,7 @@ EXPORTS
|
||||
gimp_selection_shrink
|
||||
gimp_selection_translate
|
||||
gimp_selection_value
|
||||
gimp_shape_type_get_type
|
||||
gimp_shear
|
||||
gimp_shm_ID
|
||||
gimp_shm_addr
|
||||
|
@@ -48,6 +48,7 @@ static const GimpGetTypeFunc get_type_funcs[] =
|
||||
gimp_rotation_type_get_type,
|
||||
gimp_run_mode_get_type,
|
||||
gimp_select_criterion_get_type,
|
||||
gimp_shape_type_get_type,
|
||||
gimp_size_type_get_type,
|
||||
gimp_stack_trace_mode_get_type,
|
||||
gimp_text_direction_get_type,
|
||||
@@ -107,6 +108,7 @@ static const gchar * const type_names[] =
|
||||
"GimpRotationType",
|
||||
"GimpRunMode",
|
||||
"GimpSelectCriterion",
|
||||
"GimpShapeType",
|
||||
"GimpSizeType",
|
||||
"GimpStackTraceMode",
|
||||
"GimpTextDirection",
|
||||
|
@@ -319,6 +319,20 @@ typedef enum
|
||||
} GimpSelectCriterion;
|
||||
|
||||
|
||||
#define GIMP_TYPE_SHAPE_TYPE (gimp_shape_type_get_type ())
|
||||
|
||||
GType gimp_shape_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_SHAPE_RECTANGLE,
|
||||
GIMP_SHAPE_ELLIPSE,
|
||||
GIMP_SHAPE_ROUNDED_RECT,
|
||||
GIMP_SHAPE_N_POLYGON,
|
||||
GIMP_SHAPE_SINGLE_ROW
|
||||
} GimpShapeType;
|
||||
|
||||
|
||||
void gimp_enums_init (void);
|
||||
|
||||
const gchar ** gimp_enums_get_type_names (gint *n_type_names);
|
||||
|
@@ -339,6 +339,9 @@ static const GtkStockItem gimp_stock_items[] =
|
||||
{ GIMP_STOCK_TOOL_ROTATE, N_("_Rotate"), 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SCALE, N_("_Scale"), 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SEAMLESS_CLONE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_COLOR, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_SHAPE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_CONTENT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SHEAR, N_("_Shear"), 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_SMUDGE, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
{ GIMP_STOCK_TOOL_TEXT, NULL, 0, 0, LIBGIMP_DOMAIN },
|
||||
@@ -497,6 +500,9 @@ gimp_stock_button_pixbufs[] =
|
||||
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_22 },
|
||||
{ GIMP_STOCK_TOOL_SCALE, stock_tool_scale_22 },
|
||||
{ GIMP_STOCK_TOOL_SEAMLESS_CLONE, stock_tool_clone_22 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_COLOR, stock_tool_select_by_color_22 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_CONTENT, stock_tool_select_by_content_22 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_SHAPE, stock_tool_select_by_shape_22 },
|
||||
{ GIMP_STOCK_TOOL_SHEAR, stock_tool_shear_22 },
|
||||
{ GIMP_STOCK_TOOL_SMUDGE, stock_tool_smudge_22 },
|
||||
{ GIMP_STOCK_TOOL_TEXT, stock_tool_text_22 },
|
||||
@@ -667,6 +673,9 @@ gimp_stock_menu_pixbufs[] =
|
||||
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_16 },
|
||||
{ GIMP_STOCK_TOOL_SCALE, stock_tool_scale_16 },
|
||||
{ GIMP_STOCK_TOOL_SEAMLESS_CLONE, stock_tool_clone_16 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_COLOR, stock_tool_select_by_color_16 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_CONTENT, stock_tool_select_by_content_16 },
|
||||
{ GIMP_STOCK_TOOL_SELECT_BY_SHAPE, stock_tool_select_by_shape_16 },
|
||||
{ GIMP_STOCK_TOOL_SHEAR, stock_tool_shear_16 },
|
||||
{ GIMP_STOCK_TOOL_SMUDGE, stock_tool_smudge_16 },
|
||||
{ GIMP_STOCK_TOOL_TEXT, stock_tool_text_16 },
|
||||
|
@@ -139,6 +139,9 @@ G_BEGIN_DECLS
|
||||
#define GIMP_STOCK_TOOL_ROTATE "gimp-tool-rotate"
|
||||
#define GIMP_STOCK_TOOL_SCALE "gimp-tool-scale"
|
||||
#define GIMP_STOCK_TOOL_SEAMLESS_CLONE "gimp-tool-seamless-clone"
|
||||
#define GIMP_STOCK_TOOL_SELECT_BY_COLOR "gimp-tool-select-by-color"
|
||||
#define GIMP_STOCK_TOOL_SELECT_BY_CONTENT "gimp-tool-select-by-content"
|
||||
#define GIMP_STOCK_TOOL_SELECT_BY_SHAPE "gimp-tool-select-by-shape"
|
||||
#define GIMP_STOCK_TOOL_SHEAR "gimp-tool-shear"
|
||||
#define GIMP_STOCK_TOOL_SMUDGE "gimp-tool-smudge"
|
||||
#define GIMP_STOCK_TOOL_TEXT "gimp-tool-text"
|
||||
|
@@ -386,6 +386,9 @@ app/tools/gimpseamlesscloneoptions.c
|
||||
app/tools/gimpseamlessclonetool.c
|
||||
app/tools/gimpselectionoptions.c
|
||||
app/tools/gimpselectiontool.c
|
||||
app/tools/gimpselectbycontenttool.c
|
||||
app/tools/gimpselectbyshapetool.c
|
||||
app/tools/gimpselectbycolortool.c
|
||||
app/tools/gimpsheartool.c
|
||||
app/tools/gimpsmudgetool.c
|
||||
app/tools/gimptextoptions.c
|
||||
|
@@ -339,6 +339,12 @@ STOCK_TOOL_IMAGES = \
|
||||
tools/stock-tool-rotate-22.png \
|
||||
tools/stock-tool-scale-16.png \
|
||||
tools/stock-tool-scale-22.png \
|
||||
tools/stock-tool-select-by-color-16.png \
|
||||
tools/stock-tool-select-by-color-22.png \
|
||||
tools/stock-tool-select-by-content-16.png \
|
||||
tools/stock-tool-select-by-content-22.png \
|
||||
tools/stock-tool-select-by-shape-16.png \
|
||||
tools/stock-tool-select-by-shape-22.png \
|
||||
tools/stock-tool-shear-16.png \
|
||||
tools/stock-tool-shear-22.png \
|
||||
tools/stock-tool-smudge-16.png \
|
||||
|
BIN
themes/Default/images/tools/stock-tool-select-by-color-16.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-color-16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 599 B |
BIN
themes/Default/images/tools/stock-tool-select-by-color-22.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-color-22.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 689 B |
BIN
themes/Default/images/tools/stock-tool-select-by-content-16.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-content-16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 686 B |
BIN
themes/Default/images/tools/stock-tool-select-by-content-22.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-content-22.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 959 B |
BIN
themes/Default/images/tools/stock-tool-select-by-shape-16.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-shape-16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 327 B |
BIN
themes/Default/images/tools/stock-tool-select-by-shape-22.png
Normal file
BIN
themes/Default/images/tools/stock-tool-select-by-shape-22.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 877 B |
@@ -415,6 +415,18 @@ package Gimp::CodeGen::enums;
|
||||
symbols => [ qw(GIMP_VECTORS_STROKE_TYPE_BEZIER) ],
|
||||
mapping => { GIMP_VECTORS_STROKE_TYPE_BEZIER => '0' }
|
||||
},
|
||||
GimpShapeType =>
|
||||
{ contig => 1,
|
||||
header => 'core/core-enums.h',
|
||||
symbols => [ qw(GIMP_SHAPE_RECTANGLE GIMP_SHAPE_ELLIPSE
|
||||
GIMP_SHAPE_ROUNDED_RECT GIMP_SHAPE_N_POLYGON
|
||||
GIMP_SHAPE_SINGLE_ROW) ],
|
||||
mapping => { GIMP_SHAPE_RECTANGLE => '0',
|
||||
GIMP_SHAPE_ELLIPSE => '1',
|
||||
GIMP_SHAPE_ROUNDED_RECT => '2',
|
||||
GIMP_SHAPE_N_POLYGON => '3',
|
||||
GIMP_SHAPE_SINGLE_ROW => '4' }
|
||||
},
|
||||
GimpComponentType =>
|
||||
{ contig => 0,
|
||||
header => 'core/core-enums.h',
|
||||
|
Reference in New Issue
Block a user