[gimp/cage: 60/130] app: rename GIMP_INK_BLOB_TYPE_ELLIPSE to GIMP_INK_BLOB_TYPE_CIRCLE
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/cage: 60/130] app: rename GIMP_INK_BLOB_TYPE_ELLIPSE to GIMP_INK_BLOB_TYPE_CIRCLE
- Date: Thu, 30 Dec 2010 17:53:01 +0000 (UTC)
commit 91556c2e6a348d747723b6836a7d63dbf294e92e
Author: Michael Natterer <mitch gimp org>
Date: Sun Nov 14 16:29:42 2010 +0100
app: rename GIMP_INK_BLOB_TYPE_ELLIPSE to GIMP_INK_BLOB_TYPE_CIRCLE
- TYPE_SQUARE is also named SQUARE and not RECTANGLE
- serialization doesn't suffer from the changed name because it's the
default value that never gets serialized
- a lot of messy code in the ink options can be replaced by a one-liner
because the enum names now match their resp. stock items
app/paint/gimpink.c | 2 +-
app/paint/gimpinkoptions.c | 2 +-
app/paint/paint-enums.c | 4 +-
app/paint/paint-enums.h | 2 +-
app/tools/gimpinkoptions-gui.c | 69 +++++----------------------------------
app/widgets/gimpblobeditor.c | 4 +-
6 files changed, 16 insertions(+), 67 deletions(-)
---
diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c
index 75b6868..ee3bd95 100644
--- a/app/paint/gimpink.c
+++ b/app/paint/gimpink.c
@@ -438,7 +438,7 @@ ink_pen_ellipse (GimpInkOptions *options,
switch (options->blob_type)
{
- case GIMP_INK_BLOB_TYPE_ELLIPSE:
+ case GIMP_INK_BLOB_TYPE_CIRCLE:
blob_function = blob_ellipse;
break;
diff --git a/app/paint/gimpinkoptions.c b/app/paint/gimpinkoptions.c
index ce1da3f..56eeaa1 100644
--- a/app/paint/gimpinkoptions.c
+++ b/app/paint/gimpinkoptions.c
@@ -93,7 +93,7 @@ gimp_ink_options_class_init (GimpInkOptionsClass *klass)
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_BLOB_TYPE,
"blob-type", NULL,
GIMP_TYPE_INK_BLOB_TYPE,
- GIMP_INK_BLOB_TYPE_ELLIPSE,
+ GIMP_INK_BLOB_TYPE_CIRCLE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_BLOB_ASPECT,
"blob-aspect", _("Ink Blob Aspect Ratio"),
diff --git a/app/paint/paint-enums.c b/app/paint/paint-enums.c
index d777890..b565a95 100644
--- a/app/paint/paint-enums.c
+++ b/app/paint/paint-enums.c
@@ -133,7 +133,7 @@ gimp_ink_blob_type_get_type (void)
{
static const GEnumValue values[] =
{
- { GIMP_INK_BLOB_TYPE_ELLIPSE, "GIMP_INK_BLOB_TYPE_ELLIPSE", "ellipse" },
+ { GIMP_INK_BLOB_TYPE_CIRCLE, "GIMP_INK_BLOB_TYPE_CIRCLE", "circle" },
{ GIMP_INK_BLOB_TYPE_SQUARE, "GIMP_INK_BLOB_TYPE_SQUARE", "square" },
{ GIMP_INK_BLOB_TYPE_DIAMOND, "GIMP_INK_BLOB_TYPE_DIAMOND", "diamond" },
{ 0, NULL, NULL }
@@ -141,7 +141,7 @@ gimp_ink_blob_type_get_type (void)
static const GimpEnumDesc descs[] =
{
- { GIMP_INK_BLOB_TYPE_ELLIPSE, "GIMP_INK_BLOB_TYPE_ELLIPSE", NULL },
+ { GIMP_INK_BLOB_TYPE_CIRCLE, "GIMP_INK_BLOB_TYPE_CIRCLE", NULL },
{ GIMP_INK_BLOB_TYPE_SQUARE, "GIMP_INK_BLOB_TYPE_SQUARE", NULL },
{ GIMP_INK_BLOB_TYPE_DIAMOND, "GIMP_INK_BLOB_TYPE_DIAMOND", NULL },
{ 0, NULL, NULL }
diff --git a/app/paint/paint-enums.h b/app/paint/paint-enums.h
index 77f7163..8a92931 100644
--- a/app/paint/paint-enums.h
+++ b/app/paint/paint-enums.h
@@ -88,7 +88,7 @@ GType gimp_ink_blob_type_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
- GIMP_INK_BLOB_TYPE_ELLIPSE,
+ GIMP_INK_BLOB_TYPE_CIRCLE,
GIMP_INK_BLOB_TYPE_SQUARE,
GIMP_INK_BLOB_TYPE_DIAMOND
} GimpInkBlobType;
diff --git a/app/tools/gimpinkoptions-gui.c b/app/tools/gimpinkoptions-gui.c
index cf1f268..1123b92 100644
--- a/app/tools/gimpinkoptions-gui.c
+++ b/app/tools/gimpinkoptions-gui.c
@@ -36,9 +36,6 @@
#include "gimp-intl.h"
-static GtkWidget * blob_image_new (GimpInkBlobType blob_type);
-
-
GtkWidget *
gimp_ink_options_gui (GimpToolOptions *tool_options)
{
@@ -48,7 +45,7 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
GtkWidget *frame;
GtkWidget *vbox2;
GtkWidget *scale;
- GtkWidget *blob_vbox;
+ GtkWidget *blob_box;
GtkWidget *hbox;
GtkWidget *editor;
GtkSizeGroup *size_group;
@@ -118,41 +115,16 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
/* Blob type radiobuttons */
- blob_vbox = gimp_prop_enum_radio_box_new (config, "blob-type",
- 0, 0);
- gtk_box_pack_start (GTK_BOX (hbox), blob_vbox, FALSE, FALSE, 0);
- gtk_widget_show (blob_vbox);
-
- gtk_size_group_add_widget (size_group, blob_vbox);
-
- {
- GList *children;
- GList *list;
- GimpInkBlobType blob_type;
-
- children = gtk_container_get_children (GTK_CONTAINER (blob_vbox));
-
- for (list = children, blob_type = GIMP_INK_BLOB_TYPE_ELLIPSE;
- list;
- list = g_list_next (list), blob_type++)
- {
- GtkWidget *radio = GTK_WIDGET (list->data);
- GtkWidget *blob;
-
- gtk_button_set_relief (GTK_BUTTON (radio), GTK_RELIEF_NONE);
- gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (radio), FALSE);
-
- gtk_container_remove (GTK_CONTAINER (radio),
- gtk_bin_get_child (GTK_BIN (radio)));
+ blob_box = gimp_prop_enum_stock_box_new (config, "blob-type",
+ "gimp-shape", 0, 0);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (blob_box),
+ GTK_ORIENTATION_VERTICAL);
+ gtk_box_pack_start (GTK_BOX (hbox), blob_box, FALSE, FALSE, 0);
+ gtk_widget_show (blob_box);
- blob = blob_image_new (blob_type);
- gtk_container_add (GTK_CONTAINER (radio), blob);
- gtk_widget_show (blob);
- }
-
- g_list_free (children);
- }
+ gtk_size_group_add_widget (size_group, blob_box);
+ /* Blob editor */
frame = gtk_aspect_frame_new (NULL, 0.0, 0.5, 1.0, FALSE);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
@@ -170,26 +142,3 @@ gimp_ink_options_gui (GimpToolOptions *tool_options)
return vbox;
}
-
-static GtkWidget *
-blob_image_new (GimpInkBlobType blob_type)
-{
- const gchar *stock_id = NULL;
-
- switch (blob_type)
- {
- case GIMP_INK_BLOB_TYPE_ELLIPSE:
- stock_id = GIMP_STOCK_SHAPE_CIRCLE;
- break;
-
- case GIMP_INK_BLOB_TYPE_SQUARE:
- stock_id = GIMP_STOCK_SHAPE_SQUARE;
- break;
-
- case GIMP_INK_BLOB_TYPE_DIAMOND:
- stock_id = GIMP_STOCK_SHAPE_DIAMOND;
- break;
- }
-
- return gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
-}
diff --git a/app/widgets/gimpblobeditor.c b/app/widgets/gimpblobeditor.c
index 6b294b0..4569f8c 100644
--- a/app/widgets/gimpblobeditor.c
+++ b/app/widgets/gimpblobeditor.c
@@ -87,7 +87,7 @@ gimp_blob_editor_class_init (GimpBlobEditorClass *klass)
g_param_spec_enum ("blob-type",
NULL, NULL,
GIMP_TYPE_INK_BLOB_TYPE,
- GIMP_INK_BLOB_TYPE_ELLIPSE,
+ GIMP_INK_BLOB_TYPE_CIRCLE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class, PROP_ASPECT,
@@ -336,7 +336,7 @@ gimp_blob_editor_draw_blob (GimpBlobEditor *editor,
switch (editor->type)
{
- case GIMP_INK_BLOB_TYPE_ELLIPSE:
+ case GIMP_INK_BLOB_TYPE_CIRCLE:
function = blob_ellipse;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]