[gimp] app: move enum GimpRectangleGuide from tools/ to display/
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: move enum GimpRectangleGuide from tools/ to display/
- Date: Fri, 20 May 2011 17:42:06 +0000 (UTC)
commit 0dcdfe9e80daf0c412ecf8e9e0c34886bd2b80ac
Author: Michael Natterer <mitch gimp org>
Date: Fri May 20 19:41:48 2011 +0200
app: move enum GimpRectangleGuide from tools/ to display/
and rename it to enum GimpGuidesType.
app/display/display-enums.c | 37 +++++++++++++++++++++++++++++++++++++
app/display/display-enums.h | 15 +++++++++++++++
app/tools/gimprectangleoptions.c | 4 ++--
app/tools/gimprectangleoptions.h | 2 +-
app/tools/gimprectangletool.c | 14 +++++++-------
app/tools/tools-enums.c | 37 -------------------------------------
app/tools/tools-enums.h | 15 ---------------
7 files changed, 62 insertions(+), 62 deletions(-)
---
diff --git a/app/display/display-enums.c b/app/display/display-enums.c
index 325bb7f..9810441 100644
--- a/app/display/display-enums.c
+++ b/app/display/display-enums.c
@@ -40,6 +40,43 @@ gimp_cursor_precision_get_type (void)
}
GType
+gimp_guides_type_get_type (void)
+{
+ static const GEnumValue values[] =
+ {
+ { GIMP_GUIDES_NONE, "GIMP_GUIDES_NONE", "none" },
+ { GIMP_GUIDES_CENTER_LINES, "GIMP_GUIDES_CENTER_LINES", "center-lines" },
+ { GIMP_GUIDES_THIRDS, "GIMP_GUIDES_THIRDS", "thirds" },
+ { GIMP_GUIDES_FIFTHS, "GIMP_GUIDES_FIFTHS", "fifths" },
+ { GIMP_GUIDES_GOLDEN, "GIMP_GUIDES_GOLDEN", "golden" },
+ { GIMP_GUIDES_DIAGONALS, "GIMP_GUIDES_DIAGONALS", "diagonals" },
+ { 0, NULL, NULL }
+ };
+
+ static const GimpEnumDesc descs[] =
+ {
+ { GIMP_GUIDES_NONE, NC_("guides-type", "No guides"), NULL },
+ { GIMP_GUIDES_CENTER_LINES, NC_("guides-type", "Center lines"), NULL },
+ { GIMP_GUIDES_THIRDS, NC_("guides-type", "Rule of thirds"), NULL },
+ { GIMP_GUIDES_FIFTHS, NC_("guides-type", "Rule of fifths"), NULL },
+ { GIMP_GUIDES_GOLDEN, NC_("guides-type", "Golden sections"), NULL },
+ { GIMP_GUIDES_DIAGONALS, NC_("guides-type", "Diagonal lines"), NULL },
+ { 0, NULL, NULL }
+ };
+
+ static GType type = 0;
+
+ if (G_UNLIKELY (! type))
+ {
+ type = g_enum_register_static ("GimpGuidesType", values);
+ gimp_type_set_translation_context (type, "guides-type");
+ gimp_enum_set_value_descriptions (type, descs);
+ }
+
+ return type;
+}
+
+GType
gimp_handle_type_get_type (void)
{
static const GEnumValue values[] =
diff --git a/app/display/display-enums.h b/app/display/display-enums.h
index 6e7f4a3..f1a794b 100644
--- a/app/display/display-enums.h
+++ b/app/display/display-enums.h
@@ -31,6 +31,21 @@ typedef enum
} GimpCursorPrecision;
+#define GIMP_TYPE_GUIDES_TYPE (gimp_guides_type_get_type ())
+
+GType gimp_guides_type_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+ GIMP_GUIDES_NONE, /*< desc="No guides" >*/
+ GIMP_GUIDES_CENTER_LINES, /*< desc="Center lines" >*/
+ GIMP_GUIDES_THIRDS, /*< desc="Rule of thirds" >*/
+ GIMP_GUIDES_FIFTHS, /*< desc="Rule of fifths" >*/
+ GIMP_GUIDES_GOLDEN, /*< desc="Golden sections" >*/
+ GIMP_GUIDES_DIAGONALS /*< desc="Diagonal lines" >*/
+} GimpGuidesType;
+
+
#define GIMP_TYPE_HANDLE_TYPE (gimp_handle_type_get_type ())
GType gimp_handle_type_get_type (void) G_GNUC_CONST;
diff --git a/app/tools/gimprectangleoptions.c b/app/tools/gimprectangleoptions.c
index 8906cfc..8ef6732 100644
--- a/app/tools/gimprectangleoptions.c
+++ b/app/tools/gimprectangleoptions.c
@@ -120,8 +120,8 @@ gimp_rectangle_options_iface_base_init (GimpRectangleOptionsInterface *iface)
g_param_spec_enum ("guide",
NULL,
N_("Composition guides such as rule of thirds"),
- GIMP_TYPE_RECTANGLE_GUIDE,
- GIMP_RECTANGLE_GUIDE_NONE,
+ GIMP_TYPE_GUIDES_TYPE,
+ GIMP_GUIDES_NONE,
GIMP_CONFIG_PARAM_FLAGS |
GIMP_PARAM_STATIC_STRINGS));
diff --git a/app/tools/gimprectangleoptions.h b/app/tools/gimprectangleoptions.h
index 7c22b97..84c3d43 100644
--- a/app/tools/gimprectangleoptions.h
+++ b/app/tools/gimprectangleoptions.h
@@ -80,7 +80,7 @@ struct _GimpRectangleOptionsPrivate
gboolean shrink_merged;
gboolean highlight;
- GimpRectangleGuide guide;
+ GimpGuidesType guide;
gdouble x;
gdouble y;
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index ec40c94..0d4c81b 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -201,7 +201,7 @@ struct _GimpRectangleToolPrivate
gint suppress_updates;
/* Synced with options->guide, only exists for drawing. */
- GimpRectangleGuide guide;
+ GimpGuidesType guide;
};
@@ -1868,10 +1868,10 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
switch (GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool)->guide)
{
- case GIMP_RECTANGLE_GUIDE_NONE:
+ case GIMP_GUIDES_NONE:
break;
- case GIMP_RECTANGLE_GUIDE_CENTER_LINES:
+ case GIMP_GUIDES_CENTER_LINES:
gimp_draw_tool_add_line (draw_tool,
x1, (y1 + y2) / 2,
x2, (y1 + y2) / 2);
@@ -1881,7 +1881,7 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
(x1 + x2) / 2, y2);
break;
- case GIMP_RECTANGLE_GUIDE_THIRDS:
+ case GIMP_GUIDES_THIRDS:
gimp_draw_tool_add_line (draw_tool,
x1, (2 * y1 + y2) / 3,
x2, (2 * y1 + y2) / 3);
@@ -1897,7 +1897,7 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
(x1 + 2 * x2) / 3, y2);
break;
- case GIMP_RECTANGLE_GUIDE_FIFTHS:
+ case GIMP_GUIDES_FIFTHS:
gimp_draw_tool_add_line (draw_tool,
x1, y1 + (y2 - y1) / 5,
x2, y1 + (y2 - y1) / 5);
@@ -1925,7 +1925,7 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
x1 + 4 * (x2 - x1) / 5, y2);
break;
- case GIMP_RECTANGLE_GUIDE_GOLDEN:
+ case GIMP_GUIDES_GOLDEN:
gimp_draw_tool_add_line (draw_tool,
x1,
(2 * y1 + (1 + SQRT5) * y2) / (3 + SQRT5),
@@ -1952,7 +1952,7 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
/* This code implements the method of diagonals discovered by
* Edwin Westhoff - see http://www.diagonalmethod.info/
*/
- case GIMP_RECTANGLE_GUIDE_DIAGONALS:
+ case GIMP_GUIDES_DIAGONALS:
{
/* the side of the largest square that can be
* fitted in whole into the rectangle (x1, y1), (x2, y2)
diff --git a/app/tools/tools-enums.c b/app/tools/tools-enums.c
index 281de15..990b4f5 100644
--- a/app/tools/tools-enums.c
+++ b/app/tools/tools-enums.c
@@ -74,43 +74,6 @@ gimp_button_release_type_get_type (void)
}
GType
-gimp_rectangle_guide_get_type (void)
-{
- static const GEnumValue values[] =
- {
- { GIMP_RECTANGLE_GUIDE_NONE, "GIMP_RECTANGLE_GUIDE_NONE", "none" },
- { GIMP_RECTANGLE_GUIDE_CENTER_LINES, "GIMP_RECTANGLE_GUIDE_CENTER_LINES", "center-lines" },
- { GIMP_RECTANGLE_GUIDE_THIRDS, "GIMP_RECTANGLE_GUIDE_THIRDS", "thirds" },
- { GIMP_RECTANGLE_GUIDE_FIFTHS, "GIMP_RECTANGLE_GUIDE_FIFTHS", "fifths" },
- { GIMP_RECTANGLE_GUIDE_GOLDEN, "GIMP_RECTANGLE_GUIDE_GOLDEN", "golden" },
- { GIMP_RECTANGLE_GUIDE_DIAGONALS, "GIMP_RECTANGLE_GUIDE_DIAGONALS", "diagonals" },
- { 0, NULL, NULL }
- };
-
- static const GimpEnumDesc descs[] =
- {
- { GIMP_RECTANGLE_GUIDE_NONE, NC_("rectangle-guide", "No guides"), NULL },
- { GIMP_RECTANGLE_GUIDE_CENTER_LINES, NC_("rectangle-guide", "Center lines"), NULL },
- { GIMP_RECTANGLE_GUIDE_THIRDS, NC_("rectangle-guide", "Rule of thirds"), NULL },
- { GIMP_RECTANGLE_GUIDE_FIFTHS, NC_("rectangle-guide", "Rule of fifths"), NULL },
- { GIMP_RECTANGLE_GUIDE_GOLDEN, NC_("rectangle-guide", "Golden sections"), NULL },
- { GIMP_RECTANGLE_GUIDE_DIAGONALS, NC_("rectangle-guide", "Diagonal lines"), NULL },
- { 0, NULL, NULL }
- };
-
- static GType type = 0;
-
- if (G_UNLIKELY (! type))
- {
- type = g_enum_register_static ("GimpRectangleGuide", values);
- gimp_type_set_translation_context (type, "rectangle-guide");
- gimp_enum_set_value_descriptions (type, descs);
- }
-
- return type;
-}
-
-GType
gimp_rectangle_constraint_get_type (void)
{
static const GEnumValue values[] =
diff --git a/app/tools/tools-enums.h b/app/tools/tools-enums.h
index a8d3b28..b3a3318 100644
--- a/app/tools/tools-enums.h
+++ b/app/tools/tools-enums.h
@@ -47,21 +47,6 @@ typedef enum
} GimpButtonReleaseType;
-#define GIMP_TYPE_RECTANGLE_GUIDE (gimp_rectangle_guide_get_type ())
-
-GType gimp_rectangle_guide_get_type (void) G_GNUC_CONST;
-
-typedef enum
-{
- GIMP_RECTANGLE_GUIDE_NONE, /*< desc="No guides" >*/
- GIMP_RECTANGLE_GUIDE_CENTER_LINES, /*< desc="Center lines" >*/
- GIMP_RECTANGLE_GUIDE_THIRDS, /*< desc="Rule of thirds" >*/
- GIMP_RECTANGLE_GUIDE_FIFTHS, /*< desc="Rule of fifths" >*/
- GIMP_RECTANGLE_GUIDE_GOLDEN, /*< desc="Golden sections" >*/
- GIMP_RECTANGLE_GUIDE_DIAGONALS /*< desc="Diagonal lines" >*/
-} GimpRectangleGuide;
-
-
#define GIMP_TYPE_RECTANGLE_CONSTRAINT (gimp_rectangle_constraint_get_type ())
GType gimp_rectangle_constraint_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]