From d88a3b9345cb08c8a8cff58e24b45bc01673c15b Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 7 Jul 2025 15:05:59 +0200 Subject: [PATCH] app: rename enum GimpVectorExtendMode to GimpStrokeExtendMode and give namespace to its values. --- app/display/gimptoolpath.c | 2 +- app/vectors/gimpbezierstroke.c | 24 ++++++++++++------------ app/vectors/gimpbezierstroke.h | 2 +- app/vectors/gimpstroke.c | 6 +++--- app/vectors/gimpstroke.h | 4 ++-- app/vectors/vectors-enums.h | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/display/gimptoolpath.c b/app/display/gimptoolpath.c index b9584f4a45..3261d1c3f9 100644 --- a/app/display/gimptoolpath.c +++ b/app/display/gimptoolpath.c @@ -667,7 +667,7 @@ gimp_tool_path_button_press (GimpToolWidget *widget, private->cur_anchor = gimp_bezier_stroke_extend (private->sel_stroke, &position, private->sel_anchor, - EXTEND_EDITABLE); + GIMP_STROKE_EXTEND_EDITABLE); private->restriction = GIMP_ANCHOR_FEATURE_SYMMETRIC; diff --git a/app/vectors/gimpbezierstroke.c b/app/vectors/gimpbezierstroke.c index cc29ab61c4..656eec71eb 100644 --- a/app/vectors/gimpbezierstroke.c +++ b/app/vectors/gimpbezierstroke.c @@ -230,7 +230,7 @@ gimp_bezier_stroke_new_from_coords (const GimpCoords *coords, last_anchor = gimp_bezier_stroke_extend (stroke, &coords[count], last_anchor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); if (closed) gimp_stroke_close (stroke); @@ -1120,7 +1120,7 @@ GimpAnchor * gimp_bezier_stroke_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode) + GimpStrokeExtendMode extend_mode) { GimpAnchor *anchor = NULL; GList *listneighbor; @@ -1137,18 +1137,18 @@ gimp_bezier_stroke_extend (GimpStroke *stroke, switch (extend_mode) { - case EXTEND_SIMPLE: + case GIMP_STROKE_EXTEND_SIMPLE: break; - case EXTEND_EDITABLE: + case GIMP_STROKE_EXTEND_EDITABLE: anchor = gimp_bezier_stroke_extend (stroke, coords, anchor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); /* we return the GIMP_ANCHOR_ANCHOR */ gimp_bezier_stroke_extend (stroke, coords, anchor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); break; @@ -1258,7 +1258,7 @@ gimp_bezier_stroke_extend (GimpStroke *stroke, switch (extend_mode) { - case EXTEND_SIMPLE: + case GIMP_STROKE_EXTEND_SIMPLE: switch (control_count) { case 0: @@ -1288,29 +1288,29 @@ gimp_bezier_stroke_extend (GimpStroke *stroke, g_queue_push_head (stroke->anchors, anchor); break; - case EXTEND_EDITABLE: + case GIMP_STROKE_EXTEND_EDITABLE: switch (control_count) { case 0: neighbor = gimp_bezier_stroke_extend (stroke, &(neighbor->position), neighbor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); case 1: neighbor = gimp_bezier_stroke_extend (stroke, coords, neighbor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); case 2: anchor = gimp_bezier_stroke_extend (stroke, coords, neighbor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); neighbor = gimp_bezier_stroke_extend (stroke, coords, anchor, - EXTEND_SIMPLE); + GIMP_STROKE_EXTEND_SIMPLE); break; default: g_warning ("inconsistent bezier curve: " diff --git a/app/vectors/gimpbezierstroke.h b/app/vectors/gimpbezierstroke.h index 2fe6b9882f..2fbeabd6e9 100644 --- a/app/vectors/gimpbezierstroke.h +++ b/app/vectors/gimpbezierstroke.h @@ -78,7 +78,7 @@ GimpStroke * gimp_bezier_stroke_new_ellipse (const GimpCoords *center, GimpAnchor * gimp_bezier_stroke_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode); + GimpStrokeExtendMode extend_mode); #endif /* __GIMP_BEZIER_STROKE_H__ */ diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c index c87fc9b31c..a06e91692f 100644 --- a/app/vectors/gimpstroke.c +++ b/app/vectors/gimpstroke.c @@ -114,7 +114,7 @@ static gboolean gimp_stroke_real_is_extendable (GimpStroke *stroke, static GimpAnchor * gimp_stroke_real_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode); + GimpStrokeExtendMode extend_mode); gboolean gimp_stroke_real_connect_stroke (GimpStroke *stroke, GimpAnchor *anchor, @@ -839,7 +839,7 @@ GimpAnchor * gimp_stroke_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode) + GimpStrokeExtendMode extend_mode) { g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL); g_return_val_if_fail (!stroke->closed, NULL); @@ -852,7 +852,7 @@ static GimpAnchor * gimp_stroke_real_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode) + GimpStrokeExtendMode extend_mode) { g_printerr ("gimp_stroke_extend: default implementation\n"); return NULL; diff --git a/app/vectors/gimpstroke.h b/app/vectors/gimpstroke.h index 69e14de74a..e7d58e544b 100644 --- a/app/vectors/gimpstroke.h +++ b/app/vectors/gimpstroke.h @@ -125,7 +125,7 @@ struct _GimpStrokeClass GimpAnchor * (* extend) (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode); + GimpStrokeExtendMode extend_mode); gboolean (* connect_stroke) (GimpStroke *stroke, GimpAnchor *anchor, GimpStroke *extension, @@ -284,7 +284,7 @@ gboolean gimp_stroke_is_extendable (GimpStroke *stroke, GimpAnchor * gimp_stroke_extend (GimpStroke *stroke, const GimpCoords *coords, GimpAnchor *neighbor, - GimpVectorExtendMode extend_mode); + GimpStrokeExtendMode extend_mode); gboolean gimp_stroke_connect_stroke (GimpStroke *stroke, GimpAnchor *anchor, diff --git a/app/vectors/vectors-enums.h b/app/vectors/vectors-enums.h index c0c603b1ea..0be12e8fcc 100644 --- a/app/vectors/vectors-enums.h +++ b/app/vectors/vectors-enums.h @@ -38,9 +38,9 @@ typedef enum typedef enum { - EXTEND_SIMPLE, - EXTEND_EDITABLE -} GimpVectorExtendMode; + GIMP_STROKE_EXTEND_SIMPLE, + GIMP_STROKE_EXTEND_EDITABLE +} GimpStrokeExtendMode; #endif /* __VECTORS_ENUMS_H__ */