app: s/num_segs/n_segs/

This commit is contained in:
Michael Natterer 2010-08-24 17:36:42 +02:00
parent bb40aef9bf
commit 0d39da7ce8
1 changed files with 37 additions and 34 deletions

View File

@ -49,12 +49,16 @@
struct _Selection
{
GimpDisplayShell *shell; /* shell that owns the selection */
GdkSegment *segs_in; /* gdk segments of area boundary */
gint n_segs_in; /* number of segments in segs1 */
GdkSegment *segs_out; /* gdk segments of area boundary */
gint n_segs_out; /* number of segments in segs2 */
GdkSegment *segs_layer; /* gdk segments of layer boundary */
gint num_segs_in; /* number of segments in segs1 */
gint num_segs_out; /* number of segments in segs2 */
gint num_segs_layer; /* number of segments in segs3 */
gint n_segs_layer; /* number of segments in segs3 */
guint index; /* index of current stipple pattern */
gint paused; /* count of pause requests */
gboolean visible; /* visility of the display shell */
@ -89,7 +93,7 @@ static void selection_render_points (Selection *selection);
static void selection_transform_segs (Selection *selection,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
gint num_segs);
gint n_segs);
static void selection_generate_segs (Selection *selection);
static void selection_free_segs (Selection *selection);
@ -305,7 +309,7 @@ selection_draw (Selection *selection)
for (j = 0; j < 8; j++)
sum += selection->num_points_in[j];
g_print ("%d segments, %d points\n", selection->num_segs_in, sum);
g_print ("%d segments, %d points\n", selection->n_segs_in, sum);
}
#endif
@ -351,7 +355,7 @@ selection_draw (Selection *selection)
if (selection->segs_in)
gimp_canvas_draw_segments (canvas, GIMP_CANVAS_STYLE_SELECTION_IN,
selection->segs_in,
selection->num_segs_in);
selection->n_segs_in);
#endif /* USE_DRAWPOINTS */
}
@ -377,13 +381,12 @@ selection_undraw (Selection *selection)
static void
selection_layer_draw (Selection *selection)
{
if (selection->segs_layer)
{
GimpCanvas *canvas = GIMP_CANVAS (selection->shell->canvas);
GimpImage *image = gimp_display_get_image (selection->shell->display);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (selection->segs_layer)
{
GimpCanvasStyle style;
if (GIMP_IS_LAYER_MASK (drawable))
@ -395,7 +398,7 @@ selection_layer_draw (Selection *selection)
gimp_canvas_draw_segments (canvas, style,
selection->segs_layer,
selection->num_segs_layer);
selection->n_segs_layer);
}
}
@ -404,7 +407,7 @@ selection_layer_undraw (Selection *selection)
{
selection_stop (selection);
if (selection->segs_layer && selection->num_segs_layer == 4)
if (selection->segs_layer && selection->n_segs_layer == 4)
{
gint x1 = selection->segs_layer[0].x1 - 1;
gint y1 = selection->segs_layer[0].y1 - 1;
@ -473,7 +476,7 @@ selection_render_points (Selection *selection)
selection->num_points_in[i] = 0;
}
for (i = 0; i < selection->num_segs_in; i++)
for (i = 0; i < selection->n_segs_in; i++)
{
gint x, y;
gint dx, dy;
@ -570,16 +573,16 @@ static void
selection_transform_segs (Selection *selection,
const BoundSeg *src_segs,
GdkSegment *dest_segs,
gint num_segs)
gint n_segs)
{
gint xclamp = selection->shell->disp_width + 1;
gint yclamp = selection->shell->disp_height + 1;
gint i;
gimp_display_shell_transform_segments (selection->shell,
src_segs, dest_segs, num_segs, FALSE);
src_segs, dest_segs, n_segs, FALSE);
for (i = 0; i < num_segs; i++)
for (i = 0; i < n_segs; i++)
{
dest_segs[i].x1 = CLAMP (dest_segs[i].x1, -1, xclamp);
dest_segs[i].y1 = CLAMP (dest_segs[i].y1, -1, yclamp);
@ -622,14 +625,14 @@ selection_generate_segs (Selection *selection)
*/
gimp_channel_boundary (gimp_image_get_mask (image),
&segs_in, &segs_out,
&selection->num_segs_in, &selection->num_segs_out,
&selection->n_segs_in, &selection->n_segs_out,
0, 0, 0, 0);
if (selection->num_segs_in)
if (selection->n_segs_in)
{
selection->segs_in = g_new (GdkSegment, selection->num_segs_in);
selection->segs_in = g_new (GdkSegment, selection->n_segs_in);
selection_transform_segs (selection, segs_in,
selection->segs_in, selection->num_segs_in);
selection->segs_in, selection->n_segs_in);
#ifdef USE_DRAWPOINTS
selection_render_points (selection);
@ -641,11 +644,11 @@ selection_generate_segs (Selection *selection)
}
/* Possible secondary boundary representation */
if (selection->num_segs_out)
if (selection->n_segs_out)
{
selection->segs_out = g_new (GdkSegment, selection->num_segs_out);
selection->segs_out = g_new (GdkSegment, selection->n_segs_out);
selection_transform_segs (selection, segs_out,
selection->segs_out, selection->num_segs_out);
selection->segs_out, selection->n_segs_out);
}
else
{
@ -658,15 +661,15 @@ selection_generate_segs (Selection *selection)
{
BoundSeg *segs;
segs = gimp_layer_boundary (layer, &selection->num_segs_layer);
segs = gimp_layer_boundary (layer, &selection->n_segs_layer);
if (selection->num_segs_layer)
if (selection->n_segs_layer)
{
selection->segs_layer = g_new (GdkSegment, selection->num_segs_layer);
selection->segs_layer = g_new (GdkSegment, selection->n_segs_layer);
selection_transform_segs (selection, segs,
selection->segs_layer,
selection->num_segs_layer);
selection->n_segs_layer);
g_free (segs);
}
@ -682,21 +685,21 @@ selection_free_segs (Selection *selection)
{
g_free (selection->segs_in);
selection->segs_in = NULL;
selection->num_segs_in = 0;
selection->n_segs_in = 0;
}
if (selection->segs_out)
{
g_free (selection->segs_out);
selection->segs_out = NULL;
selection->num_segs_out = 0;
selection->n_segs_out = 0;
}
if (selection->segs_layer)
{
g_free (selection->segs_layer);
selection->segs_layer = NULL;
selection->num_segs_layer = 0;
selection->n_segs_layer = 0;
}
for (j = 0; j < 8; j++)
@ -737,7 +740,7 @@ selection_start_timeout (Selection *selection)
if (selection->segs_out)
gimp_canvas_draw_segments (canvas, GIMP_CANVAS_STYLE_SELECTION_OUT,
selection->segs_out,
selection->num_segs_out);
selection->n_segs_out);
if (selection->segs_in && selection->visible)