Commit 50966720 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/core/gimpbrush.c app/paint/gimppaintcore.c app/tools/gimpcurvestool.c

2003-07-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrush.c
	* app/paint/gimppaintcore.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimptool.c
	* app/tools/tool_manager.h: removed trailing whitespace.
parent e8a7307a
2003-07-10 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrush.c
* app/paint/gimppaintcore.c
* app/tools/gimpcurvestool.c
* app/tools/gimptool.c: removed trailing whitespace.
2003-07-10 Michael Natterer <mitch@gimp.org>
* app/base/boundary.[ch]: added "guchar threshold" parameters all
......@@ -118,7 +118,7 @@ gimp_brush_get_type (void)
};
brush_type = g_type_register_static (GIMP_TYPE_DATA,
"GimpBrush",
"GimpBrush",
&brush_info, 0);
}
......@@ -140,7 +140,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
parent_class = g_type_class_peek_parent (klass);
brush_signals[SPACING_CHANGED] =
brush_signals[SPACING_CHANGED] =
g_signal_new ("spacing_changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
......@@ -578,7 +578,7 @@ gimp_brush_load_brush (gint fd,
/* spacing is not defined in version 1 */
header.spacing = 25;
}
/* Read in the brush name */
if ((bn_size = (header.header_size - sizeof (header))))
{
......@@ -595,13 +595,13 @@ gimp_brush_load_brush (gint fd,
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in brush file '%s'."),
g_message (_("Invalid UTF-8 string in brush file '%s'."),
filename);
g_free (name);
name = NULL;
}
}
if (!name)
name = g_strdup (_("Unnamed"));
......@@ -668,7 +668,3 @@ gimp_brush_load_brush (gint fd,
return brush;
}
......@@ -118,7 +118,7 @@ gimp_brush_get_type (void)
};
brush_type = g_type_register_static (GIMP_TYPE_DATA,
"GimpBrush",
"GimpBrush",
&brush_info, 0);
}
......@@ -140,7 +140,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
parent_class = g_type_class_peek_parent (klass);
brush_signals[SPACING_CHANGED] =
brush_signals[SPACING_CHANGED] =
g_signal_new ("spacing_changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
......@@ -578,7 +578,7 @@ gimp_brush_load_brush (gint fd,
/* spacing is not defined in version 1 */
header.spacing = 25;
}
/* Read in the brush name */
if ((bn_size = (header.header_size - sizeof (header))))
{
......@@ -595,13 +595,13 @@ gimp_brush_load_brush (gint fd,
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in brush file '%s'."),
g_message (_("Invalid UTF-8 string in brush file '%s'."),
filename);
g_free (name);
name = NULL;
}
}
if (!name)
name = g_strdup (_("Unnamed"));
......@@ -668,7 +668,3 @@ gimp_brush_load_brush (gint fd,
return brush;
}
......@@ -415,7 +415,7 @@ gimp_paint_core_start (GimpPaintCore *core,
core->last_paint.x = -1e6;
core->last_paint.y = -1e6;
return TRUE;
}
......@@ -499,7 +499,7 @@ gimp_paint_core_cleanup (GimpPaintCore *core)
* gimp_paint_core_constrain_helper:
* @dx: the (fixed) delta-x
* @dy: a suggested delta-y
*
*
* Returns an adjusted dy' near dy such that the slope (dx,dy') is a
* multiple of 15 degrees.
**/
......@@ -603,7 +603,7 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
gimp_avoid_exact_integer (&core->last_coords.y);
gimp_avoid_exact_integer (&core->cur_coords.x);
gimp_avoid_exact_integer (&core->cur_coords.y);
delta.x = core->cur_coords.x - core->last_coords.x;
delta.y = core->cur_coords.y - core->last_coords.y;
delta.pressure = core->cur_coords.pressure - core->last_coords.pressure;
......@@ -654,7 +654,7 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
* brush position's x or y coordinate - note that st_factor may
* be negative!)
*/
if (delta.x*delta.x > delta.y*delta.y)
{
st_factor = delta.x;
......@@ -665,7 +665,7 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
st_factor = delta.y;
st_offset = core->last_coords.y - 0.5;
}
if (fabs (st_factor) > dist / core->spacing)
{
/* The stripe principle leads to brush positions that are spaced
......@@ -710,7 +710,7 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
* tricky to see just why. Do not change this algorithm unless you
* are sure you know what you're doing!
*/
/* Basic case: round the beginning and ending point to nearest
* stripe center.
*/
......@@ -719,7 +719,7 @@ gimp_paint_core_interpolate (GimpPaintCore *core,
t0 = (s0 - st_offset) / st_factor;
tn = (sn - st_offset) / st_factor;
x = (gint) floor (core->last_coords.x + t0 * delta.x);
y = (gint) floor (core->last_coords.y + t0 * delta.y);
if (t0 < 0.0 && !( x == (gint) floor (core->last_coords.x) &&
......@@ -829,11 +829,11 @@ gimp_paint_core_get_color_from_gradient (GimpPaintCore *core,
pos = 1.0;
/* for the once modes, set pos close to 1.0 after the first chunk */
if ((mode == GIMP_GRADIENT_ONCE_FORWARD ||
if ((mode == GIMP_GRADIENT_ONCE_FORWARD ||
mode == GIMP_GRADIENT_ONCE_BACKWARD) && pos >= 1.0)
pos = 0.9999999;
if ((((gint) pos & 1) && mode != GIMP_GRADIENT_LOOP_SAWTOOTH) ||
if ((((gint) pos & 1) && mode != GIMP_GRADIENT_LOOP_SAWTOOTH) ||
mode == GIMP_GRADIENT_ONCE_BACKWARD)
pos = 1.0 - (pos - (gint) pos);
else
......
......@@ -185,7 +185,7 @@ gimp_curves_tool_get_type (void)
};
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
"GimpCurvesTool",
"GimpCurvesTool",
&tool_info, 0);
}
......@@ -373,13 +373,13 @@ gimp_curves_tool_color_picked (GimpColorTool *color_tool,
c_tool->col_value[GIMP_HISTOGRAM_RED] = r;
c_tool->col_value[GIMP_HISTOGRAM_GREEN] = g;
c_tool->col_value[GIMP_HISTOGRAM_BLUE] = b;
if (gimp_drawable_has_alpha (drawable))
c_tool->col_value[GIMP_HISTOGRAM_ALPHA] = a;
if (gimp_drawable_is_indexed (drawable))
c_tool->col_value[GIMP_HISTOGRAM_ALPHA] = color_index;
c_tool->col_value[GIMP_HISTOGRAM_VALUE] = MAX (MAX (r, g), b);
gtk_widget_queue_draw (c_tool->graph);
......@@ -412,14 +412,14 @@ curves_add_point (GimpCurvesTool *c_tool,
closest_point = i;
}
}
if (distance > MIN_DISTANCE)
closest_point = (curvex + 8) / 16;
c_tool->curves->points[cchan][closest_point][0] = curvex;
c_tool->curves->points[cchan][closest_point][1] = c_tool->curves->curve[cchan][curvex];
break;
case GIMP_CURVE_FREE:
c_tool->curves->curve[cchan][x] = 255 - y;
break;
......@@ -433,7 +433,7 @@ gimp_curves_tool_map (GimpImageMapTool *image_map_tool)
c_tool = GIMP_CURVES_TOOL (image_map_tool);
gimp_lut_setup (c_tool->lut,
gimp_lut_setup (c_tool->lut,
(GimpLutFunc) curves_lut_func,
c_tool->curves,
gimp_drawable_bytes (image_map_tool->drawable));
......@@ -560,7 +560,7 @@ gimp_curves_tool_dialog (GimpImageMapTool *image_map_tool)
hbox = gtk_hbox_new (FALSE, 6);
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
/* Horizontal button box for load / save */
frame = gtk_frame_new (_("All Channels"));
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
......@@ -638,12 +638,12 @@ curves_update (GimpCurvesTool *c_tool,
{
GimpHistogramChannel sel_channel;
gint i, j;
if (c_tool->color)
{
sel_channel = c_tool->channel;
}
else
else
{
if (c_tool->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
......@@ -769,7 +769,7 @@ curves_channel_callback (GtkWidget *widget,
{
if (c_tool->channel > 1)
c_tool->channel = 2;
else
else
c_tool->channel = 1;
}
......@@ -930,7 +930,7 @@ curves_graph_events (GtkWidget *widget,
c_tool->last = y;
break;
}
gtk_grab_add (widget);
curves_calculate_curve (c_tool->curves, c_tool->channel);
......@@ -1071,29 +1071,29 @@ curve_print_loc (GimpCurvesTool *c_tool)
{
c_tool->cursor_layout = gtk_widget_create_pango_layout (c_tool->graph,
"x:888 y:888");
pango_layout_get_pixel_extents (c_tool->cursor_layout,
pango_layout_get_pixel_extents (c_tool->cursor_layout,
NULL, &c_tool->cursor_rect);
}
x = RADIUS * 2 + 2;
y = RADIUS * 2 + 2;
w = c_tool->cursor_rect.width + 4;
h = c_tool->cursor_rect.height + 4;
gdk_draw_rectangle (c_tool->graph->window,
gdk_draw_rectangle (c_tool->graph->window,
c_tool->graph->style->bg_gc[GTK_STATE_ACTIVE],
TRUE,
x, y, w + 1, h + 1);
gdk_draw_rectangle (c_tool->graph->window,
gdk_draw_rectangle (c_tool->graph->window,
c_tool->graph->style->black_gc,
FALSE,
x, y, w, h);
g_snprintf (buf, sizeof (buf), "x:%3d y:%3d",
c_tool->cursor_x, 255 - c_tool->cursor_y);
pango_layout_set_text (c_tool->cursor_layout, buf, 11);
gdk_draw_layout (c_tool->graph->window,
gdk_draw_layout (c_tool->graph->window,
c_tool->graph->style->black_gc,
x + 2, y + 2,
c_tool->cursor_layout);
......@@ -1116,7 +1116,7 @@ curves_graph_expose (GtkWidget *widget,
{
sel_channel = c_tool->channel;
}
else
else
{
if (c_tool->channel == 2)
sel_channel = GIMP_HISTOGRAM_ALPHA;
......@@ -1155,7 +1155,7 @@ curves_graph_expose (GtkWidget *widget,
gdk_draw_lines (widget->window,
c_tool->graph->style->black_gc,
points, 256);
/* Draw the points */
for (i = 0; i < 17; i++)
{
......@@ -1168,7 +1168,7 @@ curves_graph_expose (GtkWidget *widget,
RADIUS * 2, RADIUS * 2, 0, 23040);
}
}
if (c_tool->col_value[sel_channel] >= 0)
{
/* draw the color line */
......@@ -1178,31 +1178,31 @@ curves_graph_expose (GtkWidget *widget,
RADIUS,
c_tool->col_value[sel_channel] + RADIUS,
GRAPH_HEIGHT + RADIUS);
/* and xpos indicator */
g_snprintf (buf, sizeof (buf), "x:%d",
c_tool->col_value[sel_channel]);
if (! c_tool->xpos_layout)
c_tool->xpos_layout = gtk_widget_create_pango_layout (c_tool->graph,
buf);
else
pango_layout_set_text (c_tool->xpos_layout, buf, -1);
pango_layout_get_pixel_size (c_tool->xpos_layout, &offset, &height);
if ((c_tool->col_value[sel_channel] + RADIUS) < 127)
offset = RADIUS + 4;
else
offset = - (offset + 2);
gdk_draw_layout (widget->window,
c_tool->graph->style->black_gc,
c_tool->col_value[sel_channel] + offset,
GRAPH_HEIGHT - height - 2,
c_tool->xpos_layout);
}
curve_print_loc (c_tool);
}
......@@ -1317,7 +1317,7 @@ curves_read_from_file (GimpCurvesTool *c_tool,
gchar buf[50];
gint index[5][17];
gint value[5][17];
if (! fgets (buf, 50, file))
return FALSE;
......@@ -1371,7 +1371,7 @@ curves_write_to_file (GimpCurvesTool *c_tool,
for (i = 0; i < 5; i++)
if (c_tool->curves->curve_type[i] == GIMP_CURVE_FREE)
{
{
/* pick representative points from the curve
and make them control points */
for (j = 0; j <= 8; j++)
......@@ -1379,7 +1379,7 @@ curves_write_to_file (GimpCurvesTool *c_tool,
index = CLAMP0255 (j * 32);
c_tool->curves->points[i][j * 2][0] = index;
c_tool->curves->points[i][j * 2][1] = c_tool->curves->curve[i][index];
}
}
}
fprintf (file, "# GIMP Curves File\n");
......@@ -1388,9 +1388,9 @@ curves_write_to_file (GimpCurvesTool *c_tool,
{
for (j = 0; j < 17; j++)
fprintf (file, "%d %d ",
c_tool->curves->points[i][j][0],
c_tool->curves->points[i][j][0],
c_tool->curves->points[i][j][1]);
fprintf (file, "\n");
}
}
......@@ -101,7 +101,7 @@ gimp_tool_get_type (void)
};
tool_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpTool",
"GimpTool",
&tool_info, 0);
}
......@@ -144,7 +144,7 @@ static void
gimp_tool_finalize (GObject *object)
{
GimpTool *tool = GIMP_TOOL (object);
if (tool->control)
{
g_object_unref (tool->control);
......@@ -252,7 +252,7 @@ gimp_tool_real_cursor_update (GimpTool *tool,
/* public functions */
void
gimp_tool_initialize (GimpTool *tool,
gimp_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
......@@ -262,8 +262,8 @@ gimp_tool_initialize (GimpTool *tool,
}
void
gimp_tool_control (GimpTool *tool,
GimpToolAction action,
gimp_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
......
......@@ -26,7 +26,7 @@ void tool_manager_exit (Gimp *gimp);
void tool_manager_restore (Gimp *gimp);
void tool_manager_save (Gimp *gimp);
GimpTool * tool_manager_get_active (Gimp *gimp);
GimpTool * tool_manager_get_active (Gimp *gimp);
void tool_manager_select_tool (Gimp *gimp,
GimpTool *tool);
......
Markdown is supported
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