Commit 3ee7c4d0 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

renamed new enums to use "style" instead of the overloaded term "type".

2003-09-21  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: renamed new enums to use "style" instead
	of the overloaded term "type". Also renamed GimpGridType while I was
	on it.

	* app/core/gimpdrawable-stroke.[ch]
	* app/core/gimpgrid.[ch]
	* app/core/gimpscanconvert.[ch]
	* app/display/gimpdisplayshell.c
	* app/vectors/gimpvectors.c
	* app/gui/grid-dialog.c: changed accordingly.
parent 6206f28a
2003-09-21 Sven Neumann <sven@gimp.org>
* app/core/core-enums.[ch]: renamed new enums to use "style" instead
of the overloaded term "type". Also renamed GimpGridType while I was
on it.
* app/core/gimpdrawable-stroke.[ch]
* app/core/gimpgrid.[ch]
* app/core/gimpscanconvert.[ch]
* app/display/gimpdisplayshell.c
* app/vectors/gimpvectors.c
* app/gui/grid-dialog.c: changed accordingly.
2003-09-21 Simon Budig <simon@gimp.org>
Dave Neary <bolsh@gimp.org>
 
......@@ -232,29 +232,29 @@ gimp_gradient_type_get_type (void)
}
static const GEnumValue gimp_grid_type_enum_values[] =
static const GEnumValue gimp_grid_style_enum_values[] =
{
{ GIMP_GRID_TYPE_DOTS, N_("Intersections (dots)"), "dots" },
{ GIMP_GRID_TYPE_INTERSECTIONS, N_("Intersections (crosshairs)"), "intersections" },
{ GIMP_GRID_TYPE_ON_OFF_DASH, N_("Dashed"), "on-off-dash" },
{ GIMP_GRID_TYPE_DOUBLE_DASH, N_("Double Dashed"), "double-dash" },
{ GIMP_GRID_TYPE_SOLID, N_("Solid"), "solid" },
{ GIMP_GRID_DOTS, N_("Intersections (dots)"), "dots" },
{ GIMP_GRID_INTERSECTIONS, N_("Intersections (crosshairs)"), "intersections" },
{ GIMP_GRID_ON_OFF_DASH, N_("Dashed"), "on-off-dash" },
{ GIMP_GRID_DOUBLE_DASH, N_("Double Dashed"), "double-dash" },
{ GIMP_GRID_SOLID, N_("Solid"), "solid" },
{ 0, NULL, NULL }
};
GType
gimp_grid_type_get_type (void)
gimp_grid_style_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpGridType", gimp_grid_type_enum_values);
enum_type = g_enum_register_static ("GimpGridStyle", gimp_grid_style_enum_values);
return enum_type;
}
static const GEnumValue gimp_join_type_enum_values[] =
static const GEnumValue gimp_join_style_enum_values[] =
{
{ GIMP_JOIN_MITER, N_("Miter"), "miter" },
{ GIMP_JOIN_ROUND, N_("Round"), "round" },
......@@ -263,18 +263,18 @@ static const GEnumValue gimp_join_type_enum_values[] =
};
GType
gimp_join_type_get_type (void)
gimp_join_style_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpJoinType", gimp_join_type_enum_values);
enum_type = g_enum_register_static ("GimpJoinStyle", gimp_join_style_enum_values);
return enum_type;
}
static const GEnumValue gimp_cap_type_enum_values[] =
static const GEnumValue gimp_cap_style_enum_values[] =
{
{ GIMP_CAP_BUTT, N_("Butt"), "butt" },
{ GIMP_CAP_ROUND, N_("Round"), "round" },
......@@ -283,12 +283,12 @@ static const GEnumValue gimp_cap_type_enum_values[] =
};
GType
gimp_cap_type_get_type (void)
gimp_cap_style_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpCapType", gimp_cap_type_enum_values);
enum_type = g_enum_register_static ("GimpCapStyle", gimp_cap_style_enum_values);
return enum_type;
}
......
......@@ -181,42 +181,42 @@ typedef enum
} GimpGradientType;
#define GIMP_TYPE_GRID_TYPE (gimp_grid_type_get_type ())
#define GIMP_TYPE_GRID_STYLE (gimp_grid_style_get_type ())
GType gimp_grid_type_get_type (void) G_GNUC_CONST;
GType gimp_grid_style_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_GRID_TYPE_DOTS, /*< desc="Intersections (dots)" >*/
GIMP_GRID_TYPE_INTERSECTIONS, /*< desc="Intersections (crosshairs)" >*/
GIMP_GRID_TYPE_ON_OFF_DASH, /*< desc="Dashed" >*/
GIMP_GRID_TYPE_DOUBLE_DASH, /*< desc="Double Dashed" >*/
GIMP_GRID_TYPE_SOLID /*< desc="Solid" >*/
} GimpGridType;
GIMP_GRID_DOTS, /*< desc="Intersections (dots)" >*/
GIMP_GRID_INTERSECTIONS, /*< desc="Intersections (crosshairs)" >*/
GIMP_GRID_ON_OFF_DASH, /*< desc="Dashed" >*/
GIMP_GRID_DOUBLE_DASH, /*< desc="Double Dashed" >*/
GIMP_GRID_SOLID /*< desc="Solid" >*/
} GimpGridStyle;
#define GIMP_TYPE_JOIN_TYPE (gimp_join_type_get_type ())
#define GIMP_TYPE_JOIN_STYLE (gimp_join_style_get_type ())
GType gimp_join_type_get_type (void) G_GNUC_CONST;
GType gimp_join_style_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_JOIN_MITER, /*< desc="Miter" >*/
GIMP_JOIN_ROUND, /*< desc="Round" >*/
GIMP_JOIN_BEVEL /*< desc="Bevel" >*/
} GimpJoinType;
} GimpJoinStyle;
#define GIMP_TYPE_CAP_TYPE (gimp_cap_type_get_type ())
#define GIMP_TYPE_CAP_STYLE (gimp_cap_style_get_type ())
GType gimp_cap_type_get_type (void) G_GNUC_CONST;
GType gimp_cap_style_type_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_CAP_BUTT, /*< desc="Butt" >*/
GIMP_CAP_ROUND, /*< desc="Round" >*/
GIMP_CAP_SQUARE /*< desc="Square" >*/
} GimpCapType;
} GimpCapStyle;
#define GIMP_TYPE_IMAGE_BASE_TYPE (gimp_image_base_type_get_type ())
......
......@@ -56,8 +56,8 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
GimpRGB *color,
GimpLayerModeEffects paint_mode,
gdouble width,
GimpJoinType jointype,
GimpCapType captype,
GimpJoinStyle join,
GimpCapStyle cap,
gboolean antialias)
{
GimpScanConvert *scan_convert;
......@@ -69,15 +69,15 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
guchar ucolor[4] = { 255, 127, 0, 255 };
guchar bg[1] = { 0, };
PixelRegion maskPR, basePR;
/* what area do we operate on? */
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
w = x2 - x1;
h = y2 - y1;
scan_convert = gimp_scan_convert_new (w, h, antialias ? 1 : 0);
/* For each Stroke in the vector, interpolate it, and add it to the
* ScanConvert */
for (stroke = gimp_vectors_stroke_get_next (vectors, NULL);
......@@ -96,14 +96,14 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
if (coords && coords->len)
{
points = g_new0 (GimpVector2, coords->len);
for (i = 0; i < coords->len; i++)
{
points[i].x = g_array_index (coords, GimpCoords, i).x;
points[i].y = g_array_index (coords, GimpCoords, i).y;
num_coords++;
}
gimp_scan_convert_add_polyline (scan_convert, coords->len,
points, closed);
......@@ -117,7 +117,7 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
return;
}
gimp_scan_convert_stroke (scan_convert, jointype, captype, width);
gimp_scan_convert_stroke (scan_convert, join, cap, width);
/* fill a 1-bpp Tilemanager with black, this will describe the shape
* of the stroke. */
......@@ -125,10 +125,10 @@ gimp_drawable_stroke_vectors (GimpDrawable *drawable,
tile_manager_set_offsets (mask, x1, y1);
pixel_region_init (&maskPR, mask, 0, 0, w, h, TRUE);
color_region (&maskPR, bg);
/* render the stroke into it */
gimp_scan_convert_render (scan_convert, mask);
gimp_scan_convert_free (scan_convert);
bytes = drawable->bytes;
......
......@@ -29,8 +29,8 @@ void gimp_drawable_stroke_vectors (GimpDrawable *drawable,
GimpRGB *color,
GimpLayerModeEffects paint_mode,
gdouble width,
GimpJoinType jointype,
GimpCapType captype,
GimpJoinStyle join,
GimpCapStyle cap,
gboolean antialias);
#endif /* __GIMP_DRAWABLE_STROKE_H__ */
......@@ -156,8 +156,8 @@ gimp_grid_class_init (GimpGridClass *klass)
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TYPE,
"type", NULL,
GIMP_TYPE_GRID_TYPE,
GIMP_GRID_TYPE_INTERSECTIONS,
GIMP_TYPE_GRID_STYLE,
GIMP_GRID_INTERSECTIONS,
0);
}
......
......@@ -40,15 +40,15 @@ struct _GimpGrid
{
GimpObject parent_instance;
gdouble xspacing;
gdouble yspacing;
GimpUnit spacing_unit;
gdouble xoffset;
gdouble yoffset;
GimpUnit offset_unit;
GimpRGB fgcolor;
GimpRGB bgcolor;
GimpGridType type;
gdouble xspacing;
gdouble yspacing;
GimpUnit spacing_unit;
gdouble xoffset;
gdouble yoffset;
GimpUnit offset_unit;
GimpRGB fgcolor;
GimpRGB bgcolor;
GimpGridStyle type;
};
......
......@@ -210,14 +210,14 @@ gimp_scan_convert_add_polyline (GimpScanConvert *sc,
* You cannot add additional polygons after this command.
*/
void
gimp_scan_convert_stroke (GimpScanConvert *sc,
GimpJoinType join,
GimpCapType cap,
gimp_scan_convert_stroke (GimpScanConvert *sc,
GimpJoinStyle join,
GimpCapStyle cap,
gdouble width)
{
ArtSVP *stroke;
ArtPathStrokeJoinType artjoin;
ArtPathStrokeCapType artcap;
ArtPathStrokeJoinType artjoin = 0;
ArtPathStrokeCapType artcap = 0;
g_return_if_fail (sc->svp == NULL);
......@@ -249,7 +249,7 @@ gimp_scan_convert_stroke (GimpScanConvert *sc,
stroke = art_svp_vpath_stroke (sc->vpath, artjoin, artcap,
width, 10.0, 1.0);
sc->svp = stroke;
}
......@@ -278,24 +278,24 @@ gimp_scan_convert_to_channel (GimpScanConvert *sc,
*
* You cannot add additional polygons after this command.
*/
void
void
gimp_scan_convert_render (GimpScanConvert *sc,
TileManager *tile_manager)
{
PixelRegion maskPR;
gpointer pr;
gpointer pr;
gint i, j, x0, y0;
guchar *dest, *d;
g_return_if_fail (sc != NULL);
g_return_if_fail (tile_manager != NULL);
gimp_scan_convert_finish (sc);
tile_manager_get_offsets (tile_manager, &x0, &y0);
pixel_region_init (&maskPR, tile_manager, 0, 0,
pixel_region_init (&maskPR, tile_manager, 0, 0,
tile_manager_width (tile_manager),
tile_manager_height (tile_manager),
TRUE);
......@@ -336,7 +336,7 @@ gimp_scan_convert_render (GimpScanConvert *sc,
/* private function to convert the vpath to a svp when not using
* gimp_scan_convert_stroke
*/
static void
static void
gimp_scan_convert_finish (GimpScanConvert *sc)
{
ArtVpath *pert_vpath;
......@@ -346,7 +346,7 @@ gimp_scan_convert_finish (GimpScanConvert *sc)
/* gimp_scan_convert_stroke (sc, GIMP_JOIN_MITER, GIMP_CAP_BUTT, 15.0);
*/
if (sc->svp)
return; /* We already have a valid SVP */
......@@ -388,7 +388,7 @@ gimp_scan_convert_finish (GimpScanConvert *sc)
svp2 = art_svp_uncross (svp);
art_free (svp);
svp = art_svp_rewind_uncrossed (svp2, ART_WIND_RULE_ODDEVEN);
art_free (svp2);
......
......@@ -60,12 +60,12 @@ void gimp_scan_convert_add_polyline (GimpScanConvert *sc,
*/
void gimp_scan_convert_stroke (GimpScanConvert *sc,
GimpJoinType join,
GimpCapType cap,
GimpJoinStyle join,
GimpCapStyle cap,
gdouble width);
/* Return a new Channel according to the polygonal shapes defined with
* the commands above.
* the commands above.
*
* You cannot add additional polygons after this command.
*/
......
......@@ -152,8 +152,7 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_container_add (GTK_CONTAINER (frame), table);
type = gimp_prop_enum_option_menu_new (G_OBJECT (grid), "type",
GIMP_GRID_TYPE_DOTS,
GIMP_GRID_TYPE_SOLID);
GIMP_GRID_DOTS, GIMP_GRID_SOLID);
g_signal_connect (type, "changed",
G_CALLBACK (grid_changed_cb),
gimage);
......
......@@ -1427,17 +1427,17 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
{
switch (grid->type)
{
case GIMP_GRID_TYPE_ON_OFF_DASH:
case GIMP_GRID_ON_OFF_DASH:
values.line_style = GDK_LINE_ON_OFF_DASH;
break;
case GIMP_GRID_TYPE_DOUBLE_DASH:
case GIMP_GRID_DOUBLE_DASH:
values.line_style = GDK_LINE_DOUBLE_DASH;
break;
case GIMP_GRID_TYPE_DOTS:
case GIMP_GRID_TYPE_INTERSECTIONS:
case GIMP_GRID_TYPE_SOLID:
case GIMP_GRID_DOTS:
case GIMP_GRID_INTERSECTIONS:
case GIMP_GRID_SOLID:
values.line_style = GDK_LINE_SOLID;
break;
}
......@@ -1468,7 +1468,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
switch (grid->type)
{
case GIMP_GRID_TYPE_DOTS:
case GIMP_GRID_DOTS:
for (x = grid->xoffset; x <= width; x += grid->xspacing)
{
for (y = grid->yoffset; y <= height; y += grid->yspacing)
......@@ -1487,7 +1487,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
}
break;
case GIMP_GRID_TYPE_INTERSECTIONS:
case GIMP_GRID_INTERSECTIONS:
for (x = grid->xoffset; x <= width; x += grid->xspacing)
{
for (y = grid->yoffset; y <= height; y += grid->yspacing)
......@@ -1516,9 +1516,9 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
}
break;
case GIMP_GRID_TYPE_ON_OFF_DASH:
case GIMP_GRID_TYPE_DOUBLE_DASH:
case GIMP_GRID_TYPE_SOLID:
case GIMP_GRID_ON_OFF_DASH:
case GIMP_GRID_DOUBLE_DASH:
case GIMP_GRID_SOLID:
for (x = grid->xoffset; x < width; x += grid->xspacing)
{
gimp_display_shell_transform_xy (shell,
......
......@@ -1427,17 +1427,17 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
{
switch (grid->type)
{
case GIMP_GRID_TYPE_ON_OFF_DASH:
case GIMP_GRID_ON_OFF_DASH:
values.line_style = GDK_LINE_ON_OFF_DASH;
break;
case GIMP_GRID_TYPE_DOUBLE_DASH:
case GIMP_GRID_DOUBLE_DASH:
values.line_style = GDK_LINE_DOUBLE_DASH;
break;
case GIMP_GRID_TYPE_DOTS:
case GIMP_GRID_TYPE_INTERSECTIONS:
case GIMP_GRID_TYPE_SOLID:
case GIMP_GRID_DOTS:
case GIMP_GRID_INTERSECTIONS:
case GIMP_GRID_SOLID:
values.line_style = GDK_LINE_SOLID;
break;
}
......@@ -1468,7 +1468,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
switch (grid->type)
{
case GIMP_GRID_TYPE_DOTS:
case GIMP_GRID_DOTS:
for (x = grid->xoffset; x <= width; x += grid->xspacing)
{
for (y = grid->yoffset; y <= height; y += grid->yspacing)
......@@ -1487,7 +1487,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
}
break;
case GIMP_GRID_TYPE_INTERSECTIONS:
case GIMP_GRID_INTERSECTIONS:
for (x = grid->xoffset; x <= width; x += grid->xspacing)
{
for (y = grid->yoffset; y <= height; y += grid->yspacing)
......@@ -1516,9 +1516,9 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell)
}
break;
case GIMP_GRID_TYPE_ON_OFF_DASH:
case GIMP_GRID_TYPE_DOUBLE_DASH:
case GIMP_GRID_TYPE_SOLID:
case GIMP_GRID_ON_OFF_DASH:
case GIMP_GRID_DOUBLE_DASH:
case GIMP_GRID_SOLID:
for (x = grid->xoffset; x < width; x += grid->xspacing)
{
gimp_display_shell_transform_xy (shell,
......
......@@ -152,8 +152,7 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_container_add (GTK_CONTAINER (frame), table);
type = gimp_prop_enum_option_menu_new (G_OBJECT (grid), "type",
GIMP_GRID_TYPE_DOTS,
GIMP_GRID_TYPE_SOLID);
GIMP_GRID_DOTS, GIMP_GRID_SOLID);
g_signal_connect (type, "changed",
G_CALLBACK (grid_changed_cb),
gimage);
......
......@@ -542,10 +542,8 @@ gimp_vectors_stroke (GimpItem *item,
GimpDrawable *drawable,
GimpPaintInfo *paint_info)
{
GimpVectors *vectors;
GimpPaintCore *core;
gboolean retval;
GimpRGB color;
GimpVectors *vectors;
gboolean retval;
vectors = GIMP_VECTORS (item);
......@@ -556,20 +554,26 @@ gimp_vectors_stroke (GimpItem *item,
}
#ifdef LIBART_STROKE
gimp_rgba_set (&color, 0.0, 0.7, 0.5, 1.0);
{
GimpRGB color;
gimp_rgba_set (&color, 0.0, 0.7, 0.5, 1.0);
gimp_drawable_stroke_vectors (drawable, vectors, 0.5, &color,
GIMP_NORMAL_MODE, 15, GIMP_JOIN_MITER,
GIMP_CAP_SQUARE, TRUE);
retval = TRUE;
gimp_drawable_stroke_vectors (drawable, vectors, 0.5, &color,
GIMP_NORMAL_MODE, 15,
GIMP_JOIN_MITER, GIMP_CAP_SQUARE, TRUE);
retval = TRUE;
}
#else
core = g_object_new (paint_info->paint_type, NULL);
{
GimpPaintCore *core = g_object_new (paint_info->paint_type, NULL);
retval = gimp_paint_core_stroke_vectors (core, drawable,
paint_info->paint_options,
vectors);
retval = gimp_paint_core_stroke_vectors (core, drawable,
paint_info->paint_options,
vectors);
g_object_unref (core);
g_object_unref (core);
}
#endif
return retval;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment