From: rwst Date: Mon, 13 Feb 2006 19:14:47 +0000 (+0000) Subject: bulk whitespace removal patch #1198588 by gigaclon X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1391834bee278d740c12201a5f258cd1eda044c1;p=inkscape.git bulk whitespace removal patch #1198588 by gigaclon --- diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 72cae3c47..084186bf6 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -58,7 +58,7 @@ static GtkWidget *dlg = NULL; static win_data wd; // impossible original values to make sure they are read from prefs -static gint x = -1000, y = -1000, w = 0, h = 0; +static gint x = -1000, y = -1000, w = 0, h = 0; static gchar *prefs_path = "dialogs.clonetiler"; #define SB_MARGIN 1 @@ -103,7 +103,7 @@ clonetiler_dialog_destroy (GtkObject *object, gpointer data) wd.win = dlg = NULL; wd.stop = 0; - + } static gboolean @@ -219,11 +219,11 @@ clonetiler_get_transform ( double w, double h, // values from the dialog: - double d_x_per_x, double d_y_per_x, double d_x_per_y, double d_y_per_y, + double d_x_per_x, double d_y_per_x, double d_x_per_y, double d_y_per_y, int alternate_x, int alternate_y, double rand_x, double rand_y, - double d_per_x_exp, double d_per_y_exp, + double d_per_x_exp, double d_per_y_exp, double d_rot_per_x, double d_rot_per_y, int alternate_rotx, int alternate_roty, double rand_rot, - double d_scalex_per_x, double d_scaley_per_x, double d_scalex_per_y, double d_scaley_per_y, + double d_scalex_per_x, double d_scaley_per_x, double d_scalex_per_y, double d_scaley_per_y, int alternate_scalex, int alternate_scaley, double rand_scalex, double rand_scaley ) { @@ -494,11 +494,11 @@ clonetiler_get_transform ( } NR::Matrix ori (NR::translate (width * (2*(x/3) + y%2) + dx, (height/2) * y + dy)); if (x % 3 == 0) { - return d_s_r * ori; + return d_s_r * ori; } else if (x % 3 == 1) { - return d_s_r * rotate_m120_c * dia1 * ori; + return d_s_r * rotate_m120_c * dia1 * ori; } else if (x % 3 == 2) { - return d_s_r * rotate_120_c * dia2 * ori; + return d_s_r * rotate_120_c * dia2 * ori; } } break; @@ -676,14 +676,14 @@ clonetiler_get_transform ( } break; - default: + default: break; } return NR::identity(); } -static bool +static bool clonetiler_is_a_clone_of (SPObject *tile, SPObject *obj) { char *id_href = NULL; @@ -693,11 +693,11 @@ clonetiler_is_a_clone_of (SPObject *tile, SPObject *obj) id_href = g_strdup_printf("#%s", obj_repr->attribute("id")); } - if (SP_IS_USE(tile) && + if (SP_IS_USE(tile) && SP_OBJECT_REPR(tile)->attribute("xlink:href") && - (!id_href || !strcmp(id_href, SP_OBJECT_REPR(tile)->attribute("xlink:href"))) && + (!id_href || !strcmp(id_href, SP_OBJECT_REPR(tile)->attribute("xlink:href"))) && SP_OBJECT_REPR(tile)->attribute("inkscape:tiled-clone-of") && - (!id_href || !strcmp(id_href, SP_OBJECT_REPR(tile)->attribute("inkscape:tiled-clone-of")))) + (!id_href || !strcmp(id_href, SP_OBJECT_REPR(tile)->attribute("inkscape:tiled-clone-of")))) { if (id_href) g_free (id_href); @@ -1046,7 +1046,7 @@ clonetiler_apply (GtkWidget *widget, void *) double w; double h; - if (keepbbox && + if (keepbbox && obj_repr->attribute("inkscape:tile-w") && obj_repr->attribute("inkscape:tile-h") && obj_repr->attribute("inkscape:tile-cx") && @@ -1074,14 +1074,14 @@ clonetiler_apply (GtkWidget *widget, void *) NR::Point cur = NR::Point (0, 0); NR::Rect bbox_original = NR::Rect (NR::Point (c[NR::X] - w/2, c[NR::Y] - h/2), NR::Point (c[NR::X] + w/2, c[NR::Y] + h/2)); - for (int x = 0; - fillrect? + for (int x = 0; + fillrect? (fabs(cur[NR::X]) < fillwidth && x < 200) // prevent "freezing" with too large fillrect, arbitrarily limit rows - : (x < xmax); + : (x < xmax); x ++) { - for (int y = 0; + for (int y = 0; fillrect? - (fabs(cur[NR::Y]) < fillheight && y < 200) // prevent "freezing" with too large fillrect, arbitrarily limit cols + (fabs(cur[NR::Y]) < fillheight && y < 200) // prevent "freezing" with too large fillrect, arbitrarily limit cols : (y < ymax); y ++) { @@ -1090,9 +1090,9 @@ clonetiler_apply (GtkWidget *widget, void *) // Get transform from symmetry, shift, scale, rotation NR::Matrix t = clonetiler_get_transform (type, x, y, c[NR::X], c[NR::Y], w, h, d_x_per_x, d_y_per_x, d_x_per_y, d_y_per_y, alternate_x, alternate_y, rand_x, rand_y, - d_per_x_exp, d_per_y_exp, + d_per_x_exp, d_per_y_exp, d_rot_per_x, d_rot_per_y, alternate_rotx, alternate_roty, rand_rot, - d_scalex_per_x, d_scaley_per_x, d_scalex_per_y, d_scaley_per_y, + d_scalex_per_x, d_scaley_per_x, d_scalex_per_y, d_scaley_per_y, alternate_scalex, alternate_scaley, rand_scalex, rand_scaley); cur = c * t - c; @@ -1124,7 +1124,7 @@ clonetiler_apply (GtkWidget *widget, void *) float rgb[3]; sp_color_hsl_to_rgb_floatv (rgb, hsl[0], hsl[1], hsl[2]); sp_svg_write_color(color_string, 32, SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1.0)); - } + } // Opacity tab double opacity = 1.0; @@ -1187,7 +1187,7 @@ clonetiler_apply (GtkWidget *widget, void *) double power; if (gamma_picked < 0) power = 1/(1 + fabs(gamma_picked)); - else + else power = 1 + gamma_picked; val = pow (val, power); @@ -1208,7 +1208,7 @@ clonetiler_apply (GtkWidget *widget, void *) g = CLAMP (g, 0, 1); b = CLAMP (b, 0, 1); - // recompose tweaked color + // recompose tweaked color rgba = SP_RGBA32_F_COMPOSE(r, g, b, a); if (pick_to_presence) { @@ -1298,12 +1298,12 @@ clonetiler_checkbox (GtkTooltips *tt, const char *tip, const char *attr) GtkWidget *b = gtk_check_button_new (); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, tip, NULL); - + int value = prefs_get_int_attribute (prefs_path, attr, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(b), value); gtk_box_pack_end (GTK_BOX (hb), b, FALSE, TRUE, 0); - gtk_signal_connect ( GTK_OBJECT (b), "clicked", + gtk_signal_connect ( GTK_OBJECT (b), "clicked", GTK_SIGNAL_FUNC (clonetiler_checkbox_toggled), (gpointer) attr); g_object_set_data (G_OBJECT(b), "uncheckable", GINT_TO_POINTER(TRUE)); @@ -1328,13 +1328,13 @@ clonetiler_spinbox (GtkTooltips *tt, const char *tip, const char *attr, double l GtkObject *a; if (exponent) a = gtk_adjustment_new(1.0, lower, upper, 0.01, 0.05, 0.1); - else + else a = gtk_adjustment_new(0.0, lower, upper, 0.1, 0.5, 2); GtkWidget *sb; if (exponent) sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 0.01, 2); - else + else sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 0.1, 1); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), sb, tip, NULL); @@ -1348,7 +1348,7 @@ clonetiler_spinbox (GtkTooltips *tt, const char *tip, const char *attr, double l if (exponent) g_object_set_data (G_OBJECT(sb), "oneable", GINT_TO_POINTER(TRUE)); - else + else g_object_set_data (G_OBJECT(sb), "zeroable", GINT_TO_POINTER(TRUE)); } @@ -1367,7 +1367,7 @@ clonetiler_symgroup_changed (GtkMenuItem *item, gpointer data) { gint group_new = GPOINTER_TO_INT (data); prefs_set_int_attribute ( prefs_path, "symmetrygroup", group_new ); -} +} static void clonetiler_xy_changed (GtkAdjustment *adj, gpointer data) @@ -1415,7 +1415,7 @@ clonetiler_reset_recursive (GtkWidget *w) } } } - + if (GTK_IS_CONTAINER(w)) { GList *ch = gtk_container_get_children (GTK_CONTAINER(w)); for (GList *i = ch; i != NULL; i = i->next) { @@ -1619,7 +1619,7 @@ clonetiler_dialog (void) GtkWidget *mainbox = gtk_vbox_new(FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (mainbox), 6); gtk_container_add (GTK_CONTAINER (dlg), mainbox); - + GtkWidget *nb = gtk_notebook_new (); gtk_box_pack_start (GTK_BOX (mainbox), nb, FALSE, FALSE, 0); @@ -1676,7 +1676,7 @@ clonetiler_dialog (void) GtkWidget *item = gtk_menu_item_new (); gtk_container_add (GTK_CONTAINER (item), l); - gtk_signal_connect ( GTK_OBJECT (item), "activate", + gtk_signal_connect ( GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (clonetiler_symgroup_changed), GINT_TO_POINTER (sg.group) ); @@ -1707,7 +1707,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Horizontal shift per row (in % of tile width)"), "d_x_per_y", -100, 1000, "%"); @@ -1715,7 +1715,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Horizontal shift per column (in % of tile width)"), "d_x_per_x", -100, 1000, "%"); @@ -1723,7 +1723,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the horizontal shift by this percentage"), "rand_x", 0, 1000, "%"); clonetiler_table_attach (table, l, 0, 2, 4); @@ -1740,7 +1740,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Vertical shift per row (in % of tile height)"), "d_y_per_y", -100, 1000, "%"); @@ -1748,7 +1748,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Vertical shift per column (in % of tile height)"), "d_y_per_x", -100, 1000, "%"); @@ -1756,7 +1756,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the vertical shift by this percentage"), "rand_y", 0, 1000, "%"); clonetiler_table_attach (table, l, 0, 3, 4); @@ -1771,14 +1771,14 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Whether rows are spaced evenly (1), converge (<1) or diverge (>1)"), "d_per_y_exp", 0, 10, "", true); clonetiler_table_attach (table, l, 0, 4, 2); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Whether columns are spaced evenly (1), converge (<1) or diverge (>1)"), "d_per_x_exp", 0, 10, "", true); clonetiler_table_attach (table, l, 0, 4, 3); @@ -1821,7 +1821,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Horizontal scale per row (in % of tile width)"), "d_scalex_per_y", -100, 1000, "%"); @@ -1829,7 +1829,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Horizontal scale per column (in % of tile width)"), "d_scalex_per_x", -100, 1000, "%"); @@ -1837,7 +1837,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the horizontal scale by this percentage"), "rand_scalex", 0, 1000, "%"); clonetiler_table_attach (table, l, 0, 2, 4); @@ -1852,7 +1852,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Vertical scale per row (in % of tile height)"), "d_scaley_per_y", -100, 1000, "%"); @@ -1860,7 +1860,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Vertical scale per column (in % of tile height)"), "d_scaley_per_x", -100, 1000, "%"); @@ -1868,7 +1868,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the vertical scale by this percentage"), "rand_scaley", 0, 1000, "%"); clonetiler_table_attach (table, l, 0, 3, 4); @@ -1911,7 +1911,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Rotate tiles by this angle for each row"), "d_rot_per_y", -180, 180, "°"); @@ -1919,7 +1919,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, // xgettext:no-c-format _("Rotate tiles by this angle for each column"), "d_rot_per_x", -180, 180, "°"); @@ -1927,7 +1927,7 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the rotation angle by this percentage"), "rand_rot", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 4); @@ -1969,21 +1969,21 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Decrease tile opacity by this percentage for each row"), "d_opacity_per_y", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 2); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Decrease tile opacity by this percentage for each column"), "d_opacity_per_x", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 3); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the tile opacity by this percentage"), "rand_opacity", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 4); @@ -2041,21 +2041,21 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the tile hue by this percentage for each row"), "d_hue_per_y", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 2); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the tile hue by this percentage for each column"), "d_hue_per_x", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 3); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the tile hue by this percentage"), "rand_hue", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 2, 4); @@ -2071,21 +2071,21 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the color saturation by this percentage for each row"), "d_saturation_per_y", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 3, 2); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the color saturation by this percentage for each column"), "d_saturation_per_x", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 3, 3); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the color saturation by this percentage"), "rand_saturation", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 3, 4); @@ -2100,21 +2100,21 @@ clonetiler_dialog (void) } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the color lightness by this percentage for each row"), "d_lightness_per_y", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 4, 2); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Change the color lightness by this percentage for each column"), "d_lightness_per_x", -100, 100, "%"); clonetiler_table_attach (table, l, 0, 4, 3); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the color lightness by this percentage"), "rand_lightness", 0, 100, "%"); clonetiler_table_attach (table, l, 0, 4, 4); @@ -2145,7 +2145,7 @@ clonetiler_dialog (void) GtkWidget *vb = clonetiler_new_tab (nb, _("_Trace")); - { + { GtkWidget *hb = gtk_hbox_new(FALSE, VB_MARGIN); gtk_box_pack_start (GTK_BOX (vb), hb, FALSE, FALSE, 0); @@ -2181,7 +2181,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (NULL, _("Color")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the visible color and opacity"), NULL); clonetiler_table_attach (table, radio, 0.0, 1, 1); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_COLOR)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_COLOR); } @@ -2189,7 +2189,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("Opacity")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the total accumulated opacity"), NULL); clonetiler_table_attach (table, radio, 0.0, 2, 1); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_OPACITY)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_OPACITY); } @@ -2197,7 +2197,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("R")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the Red component of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 1, 2); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_R)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_R); } @@ -2205,7 +2205,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("G")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the Green component of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 2, 2); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_G)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_G); } @@ -2213,7 +2213,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("B")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the Blue component of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 3, 2); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_B)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_B); } @@ -2223,7 +2223,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), Q_("clonetiler|H")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the hue of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 1, 3); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_H)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_H); } @@ -2233,7 +2233,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), Q_("clonetiler|S")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the saturation of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 2, 3); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_S)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_S); } @@ -2243,7 +2243,7 @@ clonetiler_dialog (void) radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), Q_("clonetiler|L")); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), radio, _("Pick the lightness of the color"), NULL); clonetiler_table_attach (table, radio, 0.0, 3, 3); - gtk_signal_connect (GTK_OBJECT (radio), "toggled", + gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_pick_switched), GINT_TO_POINTER(PICK_L)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs_get_int_attribute(prefs_path, "pick", 0) == PICK_L); } @@ -2265,7 +2265,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, l, 1.0, 1, 1); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Shift the mid-range of the picked value upwards (>0) or downwards (<0)"), "gamma_picked", -10, 10, ""); clonetiler_table_attach (table, l, 0.0, 1, 2); @@ -2277,7 +2277,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, l, 1.0, 1, 3); } { - GtkWidget *l = clonetiler_spinbox (tt, + GtkWidget *l = clonetiler_spinbox (tt, _("Randomize the picked value by this percentage"), "rand_picked", 0, 100, "%"); clonetiler_table_attach (table, l, 0.0, 1, 4); @@ -2429,7 +2429,7 @@ clonetiler_dialog (void) } { - // Height spinbutton + // Height spinbutton GtkObject *a = gtk_adjustment_new (0.0, -SP_DESKTOP_SCROLL_LIMIT, SP_DESKTOP_SCROLL_LIMIT, 1.0, 10.0, 10.0); sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a)); @@ -2452,7 +2452,7 @@ clonetiler_dialog (void) } - // Switch + // Switch GtkWidget* radio; { radio = gtk_radio_button_new_with_label (NULL, _("Rows, columns: ")); @@ -2478,7 +2478,7 @@ clonetiler_dialog (void) // Use saved pos - { + { GtkWidget *hb = gtk_hbox_new(FALSE, VB_MARGIN); gtk_box_pack_start (GTK_BOX (mainbox), hb, FALSE, FALSE, 0); @@ -2561,7 +2561,7 @@ clonetiler_dialog (void) gtk_widget_show_all (mainbox); } // end of if (!dlg) - + gtk_window_present ((GtkWindow *) dlg); } diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp index 4e6a93729..deabcf383 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/dialogs/dialog-events.cpp @@ -28,11 +28,11 @@ /** -* \brief This function is called to zero the transientize semaphore by a +* \brief This function is called to zero the transientize semaphore by a * timeout. */ -gboolean -sp_allow_again (gpointer *wd) +gboolean +sp_allow_again (gpointer *wd) { ((win_data *) wd)->stop = 0; return FALSE; // so that it is only called once @@ -51,7 +51,7 @@ sp_dialog_defocus (GtkWindow *win) //find out the document window we're transient for w = gtk_window_get_transient_for ((GtkWindow *) win); //switch to it - + if (w) { gtk_window_present (w); } @@ -66,7 +66,7 @@ sp_dialog_defocus (GtkWindow *win) void sp_dialog_defocus_callback (GtkWindow *win, gpointer data) { - sp_dialog_defocus ((GtkWindow *) + sp_dialog_defocus ((GtkWindow *) gtk_widget_get_toplevel ((GtkWidget *) data)); } @@ -75,7 +75,7 @@ sp_dialog_defocus_callback (GtkWindow *win, gpointer data) void sp_dialog_defocus_on_enter (GtkWidget *w) { - g_signal_connect ( G_OBJECT (w), "activate", + g_signal_connect ( G_OBJECT (w), "activate", G_CALLBACK (sp_dialog_defocus_callback), w ); } @@ -91,26 +91,26 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) return FALSE; } - gboolean ret = FALSE; + gboolean ret = FALSE; switch (event->type) { - + case GDK_KEY_PRESS: - + switch (get_group0_keyval (&event->key)) { - case GDK_Escape: + case GDK_Escape: sp_dialog_defocus (win); - ret = TRUE; + ret = TRUE; break; case GDK_F4: case GDK_w: case GDK_W: // close dialog if (MOD__CTRL_ONLY) { - - /* this code sends a delete_event to the dialog, - * instead of just destroying it, so that the - * dialog can do some housekeeping, such as remember + + /* this code sends a delete_event to the dialog, + * instead of just destroying it, so that the + * dialog can do some housekeeping, such as remember * its position. */ GdkEventAny event; @@ -122,7 +122,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) gtk_main_do_event ((GdkEvent*)&event); g_object_unref (G_OBJECT (event.window)); - ret = TRUE; + ret = TRUE; } break; default: // pass keypress to the canvas @@ -131,15 +131,15 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) default: ; } - - return ret; - + + return ret; + } /** - * \brief Make the argument dialog transient to the currently active document + * \brief Make the argument dialog transient to the currently active document window. */ void @@ -214,10 +214,10 @@ gboolean sp_dialog_hide (GtkObject *object, gpointer data) { GtkWidget *dlg = (GtkWidget *) data; - + if (dlg) gtk_widget_hide (dlg); - + return TRUE; } @@ -230,7 +230,7 @@ sp_dialog_unhide (GtkObject *object, gpointer data) if (dlg) gtk_widget_show (dlg); - + return TRUE; } diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index 9f758bf9e..42a084dde 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -174,12 +174,12 @@ sp_export_dialog_delete ( GtkObject *object, GdkEvent *event, gpointer data ) \param sensitive Whether the spin button is sensitive or not \param cb Callback for when this spin button is changed (optional) \param dlg Export dialog the spin button is being placed in - + */ static void -sp_export_spinbutton_new ( gchar *key, float val, float min, float max, +sp_export_spinbutton_new ( gchar *key, float val, float min, float max, float step, float page, GtkWidget *us, - GtkWidget *t, int x, int y, + GtkWidget *t, int x, int y, const gchar *ll, const gchar *lr, int digits, unsigned int sensitive, GCallback cb, GtkWidget *dlg ) @@ -187,29 +187,29 @@ sp_export_spinbutton_new ( gchar *key, float val, float min, float max, GtkObject *a = gtk_adjustment_new (val, min, max, step, page, page); gtk_object_set_data (a, "key", key); gtk_object_set_data (GTK_OBJECT (dlg), (const gchar *)key, a); - + if (us) { - sp_unit_selector_add_adjustment ( SP_UNIT_SELECTOR (us), + sp_unit_selector_add_adjustment ( SP_UNIT_SELECTOR (us), GTK_ADJUSTMENT (a) ); } - + int pos = 0; GtkWidget *l = NULL; if (ll) { - + l = gtk_label_new_with_mnemonic ((const gchar *)ll); gtk_misc_set_alignment (GTK_MISC (l), 1.0, 0.5); - gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, + gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 ); gtk_widget_set_sensitive (l, sensitive); pos += 1; - + } GtkWidget *sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, digits); - gtk_table_attach ( GTK_TABLE (t), sb, x + pos, x + pos + 1, y, y + 1, + gtk_table_attach ( GTK_TABLE (t), sb, x + pos, x + pos + 1, y, y + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 ); gtk_widget_set_size_request (sb, 80, -1); gtk_widget_set_sensitive (sb, sensitive); @@ -218,10 +218,10 @@ sp_export_spinbutton_new ( gchar *key, float val, float min, float max, if (ll) { gtk_label_set_mnemonic_widget (GTK_LABEL(l), sb); } if (lr) { - + l = gtk_label_new_with_mnemonic ((const gchar *)lr); gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5); - gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, + gtk_table_attach ( GTK_TABLE (t), l, x + pos, x + pos + 1, y, y + 1, (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0 ); gtk_widget_set_sensitive (l, sensitive); pos += 1; @@ -229,7 +229,7 @@ sp_export_spinbutton_new ( gchar *key, float val, float min, float max, gtk_label_set_mnemonic_widget (GTK_LABEL(l), sb); } - if (cb) + if (cb) gtk_signal_connect (a, "value_changed", cb, dlg); return; @@ -334,53 +334,53 @@ sp_export_dialog (void) sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_FILE_EXPORT), title); dlg = sp_window_new (title, TRUE); - + if (x == -1000 || y == -1000) { x = prefs_get_int_attribute (prefs_path, "x", 0); y = prefs_get_int_attribute (prefs_path, "y", 0); } - + if (w ==0 || h == 0) { w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } - + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER); } - - if (w && h) + + if (w && h) gtk_window_resize ((GtkWindow *) dlg, w, h); - + sp_transientize (dlg); wd.win = dlg; wd.stop = 0; - - g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", + + g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd); - - gtk_signal_connect ( GTK_OBJECT (dlg), "event", + + gtk_signal_connect ( GTK_OBJECT (dlg), "event", GTK_SIGNAL_FUNC (sp_dialog_event_handler), dlg); - - gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", + + gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (sp_export_dialog_destroy), dlg); - - gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", + + gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", G_CALLBACK (sp_export_dialog_delete), dlg); - - g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", + + g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (sp_export_dialog_delete), dlg); - - g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", + + g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg); - - g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", + + g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg); GtkTooltips *tt = gtk_tooltips_new(); - + vb = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vb), 0); gtk_container_add (GTK_CONTAINER (dlg), vb); @@ -442,7 +442,7 @@ sp_export_dialog (void) GtkWidget *fe = gtk_entry_new (); /* - * set the default filename to be that of the current path + document + * set the default filename to be that of the current path + document * with .png extension * * One thing to notice here is that this filename may get @@ -487,13 +487,13 @@ sp_export_dialog (void) name = g_strconcat(uri, ".png", NULL); gtk_entry_set_text (GTK_ENTRY (fe), name); g_free(name); - } + } doc_export_name = g_strdup(gtk_entry_get_text(GTK_ENTRY(fe))); } - g_signal_connect ( G_OBJECT (fe), "changed", + g_signal_connect ( G_OBJECT (fe), "changed", G_CALLBACK (sp_export_filename_modified), dlg); - + hb = gtk_hbox_new (FALSE, 5); gtk_container_add (GTK_CONTAINER (frame), hb); gtk_container_set_border_width (GTK_CONTAINER (hb), 4); @@ -501,7 +501,7 @@ sp_export_dialog (void) { GtkWidget *b = gtk_button_new_with_mnemonic (_("_Browse...")); gtk_box_pack_end (GTK_BOX (hb), b, FALSE, FALSE, 4); - g_signal_connect ( G_OBJECT (b), "clicked", + g_signal_connect ( G_OBJECT (b), "clicked", G_CALLBACK (sp_export_browse_clicked), NULL ); } @@ -510,7 +510,7 @@ sp_export_dialog (void) gtk_object_set_data (GTK_OBJECT (dlg), "filename-modified", (gpointer)FALSE); original_name = g_strdup(gtk_entry_get_text (GTK_ENTRY (fe))); // pressing enter in the filename field is the same as clicking export: - g_signal_connect ( G_OBJECT (fe), "activate", + g_signal_connect ( G_OBJECT (fe), "activate", G_CALLBACK (sp_export_export_clicked), dlg ); // focus is in the filename initially: gtk_widget_grab_focus (GTK_WIDGET (fe)); @@ -529,19 +529,19 @@ sp_export_dialog (void) gtk_label_set_markup_with_mnemonic (GTK_LABEL(l), _(" _Export ")); gtk_container_add (GTK_CONTAINER(b), l); gtk_tooltips_set_tip (tt, b, _("Export the bitmap file with these settings"), NULL); - gtk_signal_connect ( GTK_OBJECT (b), "clicked", + gtk_signal_connect ( GTK_OBJECT (b), "clicked", GTK_SIGNAL_FUNC (sp_export_export_clicked), dlg ); gtk_box_pack_end (GTK_BOX (hb), b, FALSE, FALSE, 0); } gtk_widget_show_all (vb); - + } // end of if (!dlg) sp_export_find_default_selection(dlg); gtk_window_present ((GtkWindow *) dlg); - + return; } // end of sp_export_dialog() @@ -560,7 +560,7 @@ sp_export_find_default_selection(GtkWidget * dlg) int i = SELECTION_NUMBER_OF; what = prefs_get_string_attribute ("dialogs.export.exportarea", "value"); - + if (what != NULL) { for (i = 0; i < SELECTION_NUMBER_OF; i++) { if (!strcmp (what, selection_names[i])) { @@ -600,8 +600,8 @@ sp_export_selection_changed ( Inkscape::Application *inkscape, if ((current_key == SELECTION_DRAWING || current_key == SELECTION_PAGE) && (SP_DT_SELECTION(SP_ACTIVE_DESKTOP))->isEmpty() == false && was_empty) { - gtk_toggle_button_set_active - ( GTK_TOGGLE_BUTTON ( gtk_object_get_data (base, selection_names[SELECTION_SELECTION])), + gtk_toggle_button_set_active + ( GTK_TOGGLE_BUTTON ( gtk_object_get_data (base, selection_names[SELECTION_SELECTION])), TRUE ); } was_empty = (SP_DT_SELECTION(SP_ACTIVE_DESKTOP))->isEmpty(); @@ -637,7 +637,7 @@ sp_export_selection_modified ( Inkscape::Application *inkscape, doc = SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP); sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), &bbox); - if (!(bbox.x0 > bbox.x1 && bbox.y0 > bbox.y1)) { + if (!(bbox.x0 > bbox.x1 && bbox.y0 > bbox.y1)) { sp_export_set_area (base, bbox.x0, bbox.y0, bbox.x1, bbox.y1); } } @@ -684,8 +684,8 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) gtk_object_set_data(GTK_OBJECT(base), "selection-type", (gpointer)key); if (old_key != key) { - gtk_toggle_button_set_active - ( GTK_TOGGLE_BUTTON ( gtk_object_get_data (base, selection_names[old_key])), + gtk_toggle_button_set_active + ( GTK_TOGGLE_BUTTON ( gtk_object_get_data (base, selection_names[old_key])), FALSE ); } @@ -694,7 +694,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) SPDocument *doc; NRRect bbox; doc = SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP); - + /* Notice how the switch is used to 'fall through' here to get various backups. If you modify this without noticing you'll probabaly screw something up. */ @@ -849,7 +849,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) // std::cout << "Directory from dialog" << std::endl; directory = g_dirname(file_entry_text); } - + if (directory == NULL) { /* Grab document directory */ if (SP_DOCUMENT_URI(SP_ACTIVE_DOCUMENT)) { @@ -892,7 +892,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) sp_export_value_set(base, "ydpi", ydpi); } } - + return; } // end of sp_export_area_toggled() @@ -917,23 +917,23 @@ sp_export_progress_callback (float value, void *data) { GtkWidget *prg; int evtcount; - - if (g_object_get_data ((GObject *) data, "cancel")) + + if (g_object_get_data ((GObject *) data, "cancel")) return FALSE; - + prg = (GtkWidget *) g_object_get_data ((GObject *) data, "progress"); gtk_progress_bar_set_fraction ((GtkProgressBar *) prg, value); - + evtcount = 0; while ((evtcount < 16) && gdk_events_pending ()) { gtk_main_iteration_do (FALSE); evtcount += 1; } - + gtk_main_iteration_do (FALSE); return TRUE; - + } // end of sp_export_progress_callback() /// Called when export button is clicked @@ -1023,7 +1023,7 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base) g_free(safeFile); g_free(error); } - + /* Reset the filename so that it can be changed again by changing selections and all that */ g_free(original_name); @@ -1060,7 +1060,7 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base) sp_repr_set_svg_double(repr, "inkscape:export-ydpi", ydpi); modified = TRUE; } - + if (modified) repr->setAttribute("sodipodi:modified", "TRUE"); sp_document_set_undo_sensitive(doc, saved); @@ -1081,7 +1081,7 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base) if (repr->attribute("id") == NULL || !(g_strrstr(filename, repr->attribute("id")) != NULL && - (!SP_DOCUMENT_URI(SP_ACTIVE_DOCUMENT) || + (!SP_DOCUMENT_URI(SP_ACTIVE_DOCUMENT) || strcmp(g_dirname(filename), g_dirname(SP_DOCUMENT_URI(SP_ACTIVE_DOCUMENT))) == 0))) { temp_string = repr->attribute("inkscape:export-filename"); if (temp_string == NULL || strcmp(temp_string, filename)) { @@ -1113,7 +1113,7 @@ sp_export_export_clicked (GtkButton *button, GtkObject *base) break; } - + return; } // end of sp_export_export_clicked() @@ -1149,14 +1149,14 @@ sp_export_browse_clicked (GtkButton *button, gpointer userdata) G_CALLBACK (gtk_widget_destroy), (gpointer) fs ); - g_signal_connect_swapped ( GTK_OBJECT + g_signal_connect_swapped ( GTK_OBJECT (GTK_FILE_SELECTION (fs)->cancel_button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) fs ); gtk_widget_show (fs); - + return; } // end of sp_export_browse_clicked() @@ -1213,7 +1213,7 @@ sp_export_bbox_equal(NR::Rect const &one, NR::Rect const &two) that, so for this to work for them - it needs to check on that level of accuracy. - \todo finish writing this up + \todo finish writing this up */ static void sp_export_detect_size(GtkObject * base) { @@ -1307,13 +1307,13 @@ sp_export_area_x_value_changed (GtkAdjustment *adj, GtkObject *base) if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data - (base, "units"))) + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + (base, "units"))) { return; } - + gtk_object_set_data ( base, "update", GUINT_TO_POINTER (TRUE) ); x0 = sp_export_value_get_px (base, "x0"); @@ -1326,7 +1326,7 @@ sp_export_area_x_value_changed (GtkAdjustment *adj, GtkObject *base) const gchar *key; width = SP_EXPORT_MIN_SIZE; key = (const gchar *)gtk_object_get_data (GTK_OBJECT (adj), "key"); - + if (!strcmp (key, "x0")) { x1 = x0 + width * DPI_BASE / xdpi; sp_export_value_set_px (base, "x1", x1); @@ -1354,13 +1354,13 @@ sp_export_area_y_value_changed (GtkAdjustment *adj, GtkObject *base) if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data - (base, "units"))) + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + (base, "units"))) { return; } - + gtk_object_set_data (base, "update", GUINT_TO_POINTER (TRUE)); y0 = sp_export_value_get_px (base, "y0"); @@ -1388,7 +1388,7 @@ sp_export_area_y_value_changed (GtkAdjustment *adj, GtkObject *base) sp_export_detect_size(base); gtk_object_set_data (base, "update", GUINT_TO_POINTER (FALSE)); - + return; } // end of sp_export_area_y_value_changed() @@ -1398,14 +1398,14 @@ sp_export_area_width_value_changed (GtkAdjustment *adj, GtkObject *base) { float x0, x1, xdpi, width, bmwidth; - if (gtk_object_get_data (base, "update")) + if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data (base, "units"))) { return; } - + gtk_object_set_data (base, "update", GUINT_TO_POINTER (TRUE)); x0 = sp_export_value_get_px (base, "x0"); @@ -1415,7 +1415,7 @@ sp_export_area_width_value_changed (GtkAdjustment *adj, GtkObject *base) bmwidth = floor (width * xdpi / DPI_BASE + 0.5); if (bmwidth < SP_EXPORT_MIN_SIZE) { - + bmwidth = SP_EXPORT_MIN_SIZE; width = bmwidth * DPI_BASE / xdpi; sp_export_value_set_px (base, "width", width); @@ -1438,12 +1438,12 @@ sp_export_area_height_value_changed (GtkAdjustment *adj, GtkObject *base) if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data (base, "units"))) { return; } - + gtk_object_set_data (base, "update", GUINT_TO_POINTER (TRUE)); y0 = sp_export_value_get_px (base, "y0"); @@ -1462,7 +1462,7 @@ sp_export_area_height_value_changed (GtkAdjustment *adj, GtkObject *base) sp_export_value_set (base, "bmheight", bmheight); gtk_object_set_data (base, "update", GUINT_TO_POINTER (FALSE)); - + return; } // end of sp_export_area_height_value_changed() @@ -1495,14 +1495,14 @@ sp_export_bitmap_width_value_changed (GtkAdjustment *adj, GtkObject *base) { float x0, x1, bmwidth, xdpi; - if (gtk_object_get_data (base, "update")) + if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data (base, "units"))) { return; } - + gtk_object_set_data (base, "update", GUINT_TO_POINTER (TRUE)); x0 = sp_export_value_get_px (base, "x0"); @@ -1535,7 +1535,7 @@ sp_export_bitmap_width_value_changed (GtkAdjustment *adj, GtkObject *base) units change, we also assume that everyone is being updated appropriately and there is nothing for us to do. - If we're the highest level function, we set the update flag, and + If we're the highest level function, we set the update flag, and continue on our way. All of the values are grabbed using the \c sp_export_value_get functions @@ -1557,14 +1557,14 @@ sp_export_xdpi_value_changed (GtkAdjustment *adj, GtkObject *base) { float x0, x1, xdpi, bmwidth; - if (gtk_object_get_data (base, "update")) + if (gtk_object_get_data (base, "update")) return; - - if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data + + if (sp_unit_selector_update_test ((SPUnitSelector *)gtk_object_get_data (base, "units"))) { return; } - + gtk_object_set_data (base, "update", GUINT_TO_POINTER (TRUE)); x0 = sp_export_value_get_px (base, "x0"); @@ -1578,9 +1578,9 @@ sp_export_xdpi_value_changed (GtkAdjustment *adj, GtkObject *base) if (bmwidth < SP_EXPORT_MIN_SIZE) { bmwidth = SP_EXPORT_MIN_SIZE; - if (x1 != x0) + if (x1 != x0) xdpi = bmwidth * DPI_BASE / (x1 - x0); - else + else xdpi = DPI_BASE; sp_export_value_set (base, "xdpi", xdpi); } diff --git a/src/dialogs/fill-style.cpp b/src/dialogs/fill-style.cpp index 1c151deeb..2aaf6e6c2 100644 --- a/src/dialogs/fill-style.cpp +++ b/src/dialogs/fill-style.cpp @@ -130,7 +130,7 @@ sp_fill_style_widget_construct ( SPWidget *spw, SPPaintSelector *psel ) sp_fill_style_widget_update (spw); - } + } } // end of sp_fill_style_widget_construct() @@ -149,7 +149,7 @@ sp_fill_style_widget_modify_selection ( SPWidget *spw, } static void -sp_fill_style_widget_change_subselection ( Inkscape::Application *inkscape, +sp_fill_style_widget_change_subselection ( Inkscape::Application *inkscape, SPDesktop *desktop, SPWidget *spw ) { @@ -398,7 +398,7 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, // on release, toggle undo_label so that the next drag will not be lumped with this one if (undo_label == undo_label_1) undo_label = undo_label_2; - else + else undo_label = undo_label_1; break; diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index a8031b13e..7a9b37dcf 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -46,7 +46,7 @@ static GtkWidget *dlg = NULL; static win_data wd; // impossible original values to make sure they are read from prefs -static gint x = -1000, y = -1000, w = 0, h = 0; +static gint x = -1000, y = -1000, w = 0, h = 0; static gchar *prefs_path = "dialogs.object"; static void sp_item_widget_modify_selection (SPWidget *spw, Inkscape::Selection *selection, guint flags, GtkWidget *itemw); @@ -94,11 +94,11 @@ sp_item_widget_new (void) /* Create container widget */ spw = sp_widget_new_global (INKSCAPE); - gtk_signal_connect ( GTK_OBJECT (spw), "modify_selection", - GTK_SIGNAL_FUNC (sp_item_widget_modify_selection), + gtk_signal_connect ( GTK_OBJECT (spw), "modify_selection", + GTK_SIGNAL_FUNC (sp_item_widget_modify_selection), spw ); - gtk_signal_connect ( GTK_OBJECT (spw), "change_selection", - GTK_SIGNAL_FUNC (sp_item_widget_change_selection), + gtk_signal_connect ( GTK_OBJECT (spw), "change_selection", + GTK_SIGNAL_FUNC (sp_item_widget_change_selection), spw ); vb = gtk_vbox_new (FALSE, 0); @@ -114,8 +114,8 @@ sp_item_widget_new (void) /* Create the label for the object id */ l = gtk_label_new_with_mnemonic (_("_Id")); gtk_misc_set_alignment (GTK_MISC (l), 1, 0.5); - gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 0, 1, - (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 0, 1, + (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "id_label", l); @@ -123,8 +123,8 @@ sp_item_widget_new (void) tf = gtk_entry_new (); gtk_tooltips_set_tip (tt, tf, _("The id= attribute (only letters, digits, and the characters .-_: allowed)"), NULL); gtk_entry_set_max_length (GTK_ENTRY (tf), 64); - gtk_table_attach ( GTK_TABLE (t), tf, 1, 2, 0, 1, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), tf, 1, 2, 0, 1, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "id", tf); gtk_label_set_mnemonic_widget (GTK_LABEL(l), tf); @@ -136,18 +136,18 @@ sp_item_widget_new (void) /* Button for setting the object's id, label, title and description. */ pb = gtk_button_new_with_mnemonic (_("_Set")); - gtk_table_attach ( GTK_TABLE (t), pb, 2, 3, 0, 1, - (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), pb, 2, 3, 0, 1, + (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); - gtk_signal_connect ( GTK_OBJECT (pb), "clicked", - GTK_SIGNAL_FUNC (sp_item_widget_label_changed), + gtk_signal_connect ( GTK_OBJECT (pb), "clicked", + GTK_SIGNAL_FUNC (sp_item_widget_label_changed), spw ); /* Create the label for the object label */ l = gtk_label_new_with_mnemonic (_("_Label")); gtk_misc_set_alignment (GTK_MISC (l), 1, 0.5); - gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 1, 2, - (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 1, 2, + (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "label_label", l); @@ -155,8 +155,8 @@ sp_item_widget_new (void) tf = gtk_entry_new (); gtk_tooltips_set_tip (tt, tf, _("A freeform label for the object"), NULL); gtk_entry_set_max_length (GTK_ENTRY (tf), 256); - gtk_table_attach ( GTK_TABLE (t), tf, 1, 2, 1, 2, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), tf, 1, 2, 1, 2, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "label", tf); gtk_label_set_mnemonic_widget (GTK_LABEL(l), tf); @@ -167,8 +167,8 @@ sp_item_widget_new (void) /* Create the label for the object title */ l = gtk_label_new (_("Title")); gtk_misc_set_alignment (GTK_MISC (l), 1, 0.5); - gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 2, 3, - (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), l, 0, 1, 2, 3, + (GtkAttachOptions)( GTK_SHRINK | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "title_label", l); @@ -176,15 +176,15 @@ sp_item_widget_new (void) tf = gtk_entry_new (); gtk_widget_set_sensitive (GTK_WIDGET (tf), FALSE); gtk_entry_set_max_length (GTK_ENTRY (tf), 256); - gtk_table_attach ( GTK_TABLE (t), tf, 1, 3, 2, 3, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), tf, 1, 3, 2, 3, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "title", tf); /* Create the frame for the object description */ f = gtk_frame_new (_("Description")); - gtk_table_attach ( GTK_TABLE (t), f, 0, 3, 3, 4, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), f, 0, 3, 3, 4, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), 0, 0 ); gtk_object_set_data (GTK_OBJECT (spw), "desc_frame", l); @@ -211,8 +211,8 @@ sp_item_widget_new (void) /* Hide */ cb = gtk_check_button_new_with_mnemonic (_("_Hide")); gtk_tooltips_set_tip (tt, cb, _("Check to make the object invisible"), NULL); - gtk_table_attach ( GTK_TABLE (t), cb, 0, 1, 0, 1, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), cb, 0, 1, 0, 1, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); g_signal_connect (G_OBJECT(cb), "toggled", G_CALLBACK(sp_item_widget_hidden_toggled), spw); gtk_object_set_data(GTK_OBJECT(spw), "hidden", cb); @@ -221,11 +221,11 @@ sp_item_widget_new (void) // TRANSLATORS: "Lock" is a verb here cb = gtk_check_button_new_with_mnemonic (_("L_ock")); gtk_tooltips_set_tip (tt, cb, _("Check to make the object insensitive (not selectable by mouse)"), NULL); - gtk_table_attach ( GTK_TABLE (t), cb, 1, 2, 0, 1, - (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), + gtk_table_attach ( GTK_TABLE (t), cb, 1, 2, 0, 1, + (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)0, 0, 0 ); - gtk_signal_connect ( GTK_OBJECT (cb), "toggled", - GTK_SIGNAL_FUNC (sp_item_widget_sensitivity_toggled), + gtk_signal_connect ( GTK_OBJECT (cb), "toggled", + GTK_SIGNAL_FUNC (sp_item_widget_sensitivity_toggled), spw ); gtk_object_set_data (GTK_OBJECT (spw), "sensitive", cb); @@ -234,15 +234,15 @@ sp_item_widget_new (void) sp_item_widget_setup (SP_WIDGET (spw), SP_DT_SELECTION (SP_ACTIVE_DESKTOP)); return (GtkWidget *) spw; - + } //end of sp_item_widget_new() static void -sp_item_widget_modify_selection ( SPWidget *spw, - Inkscape::Selection *selection, - guint flags, +sp_item_widget_modify_selection ( SPWidget *spw, + Inkscape::Selection *selection, + guint flags, GtkWidget *itemw ) { sp_item_widget_setup (spw, selection); @@ -251,8 +251,8 @@ sp_item_widget_modify_selection ( SPWidget *spw, static void -sp_item_widget_change_selection ( SPWidget *spw, - Inkscape::Selection *selection, +sp_item_widget_change_selection ( SPWidget *spw, + Inkscape::Selection *selection, GtkWidget *itemw ) { sp_item_widget_setup (spw, selection); @@ -276,7 +276,7 @@ sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection ) } else { gtk_widget_set_sensitive (GTK_WIDGET (spw), TRUE); } - + gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (TRUE)); SPItem *item = selection->singleItem(); @@ -290,21 +290,21 @@ sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection ) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), item->isExplicitlyHidden()); if (SP_OBJECT_IS_CLONED (item)) { - + /* ID */ w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id")); gtk_entry_set_text (GTK_ENTRY (w), ""); gtk_widget_set_sensitive (w, FALSE); w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "id_label")); gtk_label_set_text (GTK_LABEL (w), _("Ref")); - + /* Label */ w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "label")); gtk_entry_set_text (GTK_ENTRY (w), ""); gtk_widget_set_sensitive (w, FALSE); w = GTK_WIDGET(gtk_object_get_data (GTK_OBJECT (spw), "label_label")); gtk_label_set_text (GTK_LABEL (w), _("Ref")); - + } else { SPObject *obj = (SPObject*)item; @@ -323,8 +323,8 @@ sp_item_widget_setup ( SPWidget *spw, Inkscape::Selection *selection ) } gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE)); - - + + } // end of sp_item_widget_setup() @@ -368,7 +368,7 @@ sp_item_widget_hidden_toggled(GtkWidget *widget, SPWidget *spw) static void sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) { - if (gtk_object_get_data (GTK_OBJECT (spw), "blocked")) + if (gtk_object_get_data (GTK_OBJECT (spw), "blocked")) return; SPItem *item = SP_DT_SELECTION(SP_ACTIVE_DESKTOP)->singleItem(); @@ -401,7 +401,7 @@ sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) g_assert(label != NULL); /* Give feedback on success of setting the drawing object's label - * using the widget's label text + * using the widget's label text */ SPObject *obj = (SPObject*)item; if (strcmp (label, obj->defaultLabel())) { @@ -430,7 +430,7 @@ sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) /** - * \brief Dialog + * \brief Dialog * */ void @@ -446,26 +446,26 @@ sp_item_dialog (void) x = prefs_get_int_attribute (prefs_path, "x", 0); y = prefs_get_int_attribute (prefs_path, "y", 0); } - + if (w ==0 || h == 0) { w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } - + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER); } - + if (w && h) { gtk_window_resize ((GtkWindow *) dlg, w, h); } - + sp_transientize (dlg); wd.win = dlg; wd.stop = 0; - + g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd); gtk_signal_connect ( GTK_OBJECT (dlg), "event", GTK_SIGNAL_FUNC (sp_dialog_event_handler), dlg); gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (sp_item_dialog_destroy), dlg); @@ -478,11 +478,11 @@ sp_item_dialog (void) GtkWidget *itemw = sp_item_widget_new (); gtk_widget_show (itemw); gtk_container_add (GTK_CONTAINER (dlg), itemw); - + } gtk_window_present ((GtkWindow *) dlg); -} +} /* diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp index 05370d1d0..b62287aff 100644 --- a/src/dialogs/object-attributes.cpp +++ b/src/dialogs/object-attributes.cpp @@ -71,8 +71,8 @@ window_destroyed (GtkObject *window, GtkObject *object) static void -sp_object_attr_show_dialog ( SPObject *object, - const SPAttrDesc *desc, +sp_object_attr_show_dialog ( SPObject *object, + const SPAttrDesc *desc, const gchar *tag ) { const gchar **labels, **attrs; @@ -99,10 +99,10 @@ sp_object_attr_show_dialog ( SPObject *object, gtk_widget_show (t); gtk_container_add (GTK_CONTAINER (w), t); - g_signal_connect ( G_OBJECT (w), "destroy", + g_signal_connect ( G_OBJECT (w), "destroy", G_CALLBACK (window_destroyed), object ); - - g_signal_connect ( G_OBJECT (object), "release", + + g_signal_connect ( G_OBJECT (object), "release", G_CALLBACK (object_released), w ); gtk_widget_show (w); diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index b4dcd4bce..8de2dedac 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -78,7 +78,7 @@ static const gchar *spacings[] = {"50%", "80%", "90%", "100%", "110%", "120%", " static GtkWidget *dlg = NULL; static win_data wd; // impossible original values to make sure they are read from prefs -static gint x = -1000, y = -1000, w = 0, h = 0; +static gint x = -1000, y = -1000, w = 0, h = 0; static gchar const *prefs_path = "dialogs.textandfont"; @@ -136,7 +136,7 @@ sp_text_edit_dialog (void) { if (!dlg) { - + gchar title[500]; sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_TEXT), title); @@ -145,32 +145,32 @@ sp_text_edit_dialog (void) x = prefs_get_int_attribute (prefs_path, "x", 0); y = prefs_get_int_attribute (prefs_path, "y", 0); } - + if (w ==0 || h == 0) { w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } - + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER); } - - if (w && h) + + if (w && h) gtk_window_resize ((GtkWindow *) dlg, w, h); - + sp_transientize (dlg); wd.win = dlg; wd.stop = 0; g_signal_connect ( G_OBJECT (INKSCAPE), "activate_desktop", G_CALLBACK (sp_transientize_callback), &wd ); - + gtk_signal_connect ( GTK_OBJECT (dlg), "event", GTK_SIGNAL_FUNC (sp_dialog_event_handler), dlg ); - + gtk_signal_connect ( GTK_OBJECT (dlg), "destroy", G_CALLBACK (sp_text_edit_dialog_destroy), dlg ); gtk_signal_connect ( GTK_OBJECT (dlg), "delete_event", G_CALLBACK (sp_text_edit_dialog_delete), dlg ); g_signal_connect ( G_OBJECT (INKSCAPE), "shut_down", G_CALLBACK (sp_text_edit_dialog_delete), dlg ); - + g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_hide", G_CALLBACK (sp_dialog_hide), dlg ); g_signal_connect ( G_OBJECT (INKSCAPE), "dialogs_unhide", G_CALLBACK (sp_dialog_unhide), dlg ); @@ -325,8 +325,8 @@ sp_text_edit_dialog (void) g_list_free (sl); } - g_signal_connect ( (GObject *) ((GtkCombo *) c)->entry, - "changed", + g_signal_connect ( (GObject *) ((GtkCombo *) c)->entry, + "changed", (GCallback) sp_text_edit_dialog_line_spacing_changed, dlg ); gtk_box_pack_start (GTK_BOX (row), c, FALSE, FALSE, VB_MARGIN); @@ -378,7 +378,7 @@ sp_text_edit_dialog (void) gtk_text_view_set_editable (GTK_TEXT_VIEW (txt), TRUE); gtk_container_add (GTK_CONTAINER (scroller), txt); gtk_box_pack_start (GTK_BOX (vb), scroller, TRUE, TRUE, 0); - g_signal_connect ( G_OBJECT (tb), "changed", + g_signal_connect ( G_OBJECT (tb), "changed", G_CALLBACK (sp_text_edit_dialog_text_changed), dlg ); g_signal_connect (G_OBJECT (txt), "focus-in-event", G_CALLBACK (text_view_focus_in), dlg); g_signal_connect (G_OBJECT (txt), "focus-out-event", G_CALLBACK (text_view_focus_out), dlg); @@ -393,8 +393,8 @@ sp_text_edit_dialog (void) { GtkWidget *b = gtk_button_new_with_label (_("Set as default")); - g_signal_connect ( G_OBJECT (b), "clicked", - G_CALLBACK (sp_text_edit_dialog_set_default), + g_signal_connect ( G_OBJECT (b), "clicked", + G_CALLBACK (sp_text_edit_dialog_set_default), dlg ); gtk_box_pack_start (GTK_BOX (hb), b, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (dlg), "default", b); @@ -481,7 +481,7 @@ sp_text_edit_dialog_update_object_text ( SPItem *text ) gtk_text_buffer_get_bounds (tb, &start, &end); str = gtk_text_buffer_get_text (tb, &start, &end, TRUE); sp_te_set_repr_text_multiline (text, str); - g_free (str); + g_free (str); gtk_text_buffer_set_modified (tb, FALSE); } } @@ -538,9 +538,9 @@ sp_get_text_dialog_style () sp_repr_css_set_property (css, "text-align", "end"); } } - + b = (GtkWidget*)g_object_get_data (G_OBJECT (dlg), INKSCAPE_STOCK_WRITING_MODE_LR ); - + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (b))) { sp_repr_css_set_property (css, "writing-mode", "lr"); } else { @@ -591,7 +591,7 @@ sp_text_edit_dialog_apply (GtkButton *button, GtkWidget *dlg) sp_desktop_set_style(desktop, css, true); - for (; item_list != NULL; item_list = item_list->next) { + for (; item_list != NULL; item_list = item_list->next) { // apply style to the reprs of all text objects in the selection if (SP_IS_TEXT (item_list->data)) { @@ -604,8 +604,8 @@ sp_text_edit_dialog_apply (GtkButton *button, GtkWidget *dlg) // no need to set sodipodi:linespacing, because Inkscape never supported it on flowtext ++items; } - - if (items == 0) { + + if (items == 0) { // no text objects; apply style to prefs for new objects sp_repr_css_change (inkscape_get_repr (INKSCAPE, "tools.text"), css, "style"); gtk_widget_set_sensitive (def, FALSE); @@ -615,7 +615,7 @@ sp_text_edit_dialog_apply (GtkButton *button, GtkWidget *dlg) if (SP_IS_TEXT (item) || SP_IS_FLOWTEXT(item)) { sp_text_edit_dialog_update_object_text (item); } - } + } // complete the transaction sp_document_done (SP_DT_DOCUMENT (SP_ACTIVE_DESKTOP)); @@ -636,13 +636,13 @@ sp_text_edit_dialog_close (GtkButton *button, GtkWidget *dlg) } static void -sp_text_edit_dialog_read_selection ( GtkWidget *dlg, - gboolean dostyle, +sp_text_edit_dialog_read_selection ( GtkWidget *dlg, + gboolean dostyle, gboolean docontent ) { - if (g_object_get_data (G_OBJECT (dlg), "blocked")) + if (g_object_get_data (G_OBJECT (dlg), "blocked")) return; - + g_object_set_data (G_OBJECT (dlg), "blocked", GINT_TO_POINTER (TRUE)); GtkWidget *notebook = (GtkWidget*)g_object_get_data (G_OBJECT (dlg), "notebook"); @@ -689,7 +689,7 @@ sp_text_edit_dialog_read_selection ( GtkWidget *dlg, } } // end of if (docontent) repr = SP_OBJECT_REPR (text); - + } else { gtk_widget_set_sensitive (textw, FALSE); gtk_widget_set_sensitive (apply, FALSE); @@ -767,7 +767,7 @@ sp_text_edit_dialog_text_changed (GtkTextBuffer *tb, GtkWidget *dlg) GtkTextIter start, end; gchar *str; - if (g_object_get_data (G_OBJECT (dlg), "blocked")) + if (g_object_get_data (G_OBJECT (dlg), "blocked")) return; SPItem *text = sp_ted_get_selected_text_item (); @@ -797,13 +797,13 @@ sp_text_edit_dialog_text_changed (GtkTextBuffer *tb, GtkWidget *dlg) static void -sp_text_edit_dialog_font_changed ( SPFontSelector *fsel, - font_instance *font, +sp_text_edit_dialog_font_changed ( SPFontSelector *fsel, + font_instance *font, GtkWidget *dlg ) { GtkWidget *preview, *apply, *def; - if (g_object_get_data (G_OBJECT (dlg), "blocked")) + if (g_object_get_data (G_OBJECT (dlg), "blocked")) return; SPItem *text = sp_ted_get_selected_text_item (); @@ -849,7 +849,7 @@ sp_text_edit_dialog_line_spacing_changed (GtkEditable *editable, GtkWidget *dlg) { GtkWidget *apply, *def; - if (g_object_get_data ((GObject *) dlg, "blocked")) + if (g_object_get_data ((GObject *) dlg, "blocked")) return; SPItem *text = sp_ted_get_selected_text_item (); @@ -887,7 +887,7 @@ sp_ted_get_selected_text_item (void) static unsigned sp_ted_get_selected_text_count (void) { - if (!SP_ACTIVE_DESKTOP) + if (!SP_ACTIVE_DESKTOP) return 0; unsigned int items = 0; diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index a6434ae3d..d85f77785 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -34,7 +34,7 @@ static void sp_canvas_bpath_destroy (GtkObject *object); static void sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags); static void sp_canvas_bpath_render (SPCanvasItem *item, SPCanvasBuf *buf); static double sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item); - + static SPCanvasItemClass *parent_class; GtkType @@ -97,7 +97,7 @@ sp_canvas_bpath_destroy (GtkObject *object) delete cbp->fill_shp; cbp->fill_shp = NULL; } - + if (cbp->stroke_shp) { delete cbp->stroke_shp; cbp->stroke_shp = NULL; @@ -126,7 +126,7 @@ sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i delete cbp->fill_shp; cbp->fill_shp = NULL; } - + if (cbp->stroke_shp) { delete cbp->stroke_shp; cbp->stroke_shp = NULL; @@ -179,7 +179,7 @@ sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i thePath->Stroke(cbp->stroke_shp,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit ); // thePath->Stroke(theShape,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit ); // cbp->stroke_shp->ConvertToShape(theShape,fill_nonZero); - + cbp->stroke_shp->CalcBBox(); if ( cbp->stroke_shp->leftX < cbp->stroke_shp->rightX ) { if ( dbox.x0 >= dbox.x1 ) { @@ -197,7 +197,7 @@ sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i delete thePath; } - + item->x1 = (int)dbox.x0; item->y1 = (int)dbox.y0; item->x2 = (int)dbox.x1; @@ -233,7 +233,7 @@ static double sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item) { SPCanvasBPath *cbp = SP_CANVAS_BPATH (item); - + if (cbp->fill_shp && (cbp->fill_shp->PtWinding(p) > 0 )) { *actual_item = item; return 0.0; @@ -248,7 +248,7 @@ sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_it if (cbp->fill_shp) { return distance(cbp->fill_shp, p); } - + return BIGVAL; } @@ -326,10 +326,10 @@ bpath_run_A8_OR (raster_info &dest,void *data,int st,float vst,int en,float ven) b = NR_RGBA32_B (tempCol.col); a = NR_RGBA32_A (tempCol.col); if (a == 0) return; - + vst*=a; ven*=a; - + if ( vst < 0 ) vst=0; if ( vst > 255 ) vst=255; if ( ven < 0 ) ven=0; @@ -409,7 +409,7 @@ void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,cha if ( it < area.y0 ) it=area.y0; if ( ir > area.x1 ) ir=area.x1; if ( ib > area.y1 ) ib=area.y1; - + /* // version par FloatLigne int curPt; float curY; @@ -449,27 +449,27 @@ void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,cha int curPt; float curY; theS->BeginQuickRaster(curY, curPt); - + BitLigne* theI[4]; for (int i=0;i<4;i++) theI[i]=new BitLigne(il,ir); IntLigne* theIL=new IntLigne(); - + theS->DirectQuickScan(curY,curPt,(float)(it),true,0.25); - + char* mdata=(char*)destBuf; uint32_t* ligStart=((uint32_t*)(mdata+(3*(il-area.x0)+stride*(it-area.y0)))); for (int y=it;yReset(); - + for (int i = 0; i < 4; i++) - theS->QuickScan(curY, curPt, ((float)(y+0.25*(i+1))), + theS->QuickScan(curY, curPt, ((float)(y+0.25*(i+1))), fill_oddEven, theI[i], 0.25); - + theIL->Copy(4,theI); // theI[0]->Affiche(); // theIL->Affiche(); - + raster_info dest; dest.startPix=il; dest.endPix=ir; @@ -481,5 +481,5 @@ void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,cha } theS->EndQuickRaster(); for (int i=0;i<4;i++) delete theI[i]; - delete theIL; + delete theIL; } diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index d1d7221f0..1c1171d35 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -495,7 +495,7 @@ sp_canvas_item_grab (SPCanvasItem *item, guint event_mask, GdkCursor *cursor, gu /* fixme: But Canvas actualle does get key events, so all we need is routing these here */ gdk_pointer_grab (SP_CANVAS_WINDOW (item->canvas), FALSE, (GdkEventMask)(event_mask & (~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK))), - NULL, cursor, etime); + NULL, cursor, etime); item->canvas->grabbed_item = item; item->canvas->grabbed_event_mask = event_mask; @@ -587,7 +587,7 @@ sp_canvas_item_grab_focus (SPCanvasItem *item) ev.focus_change.window = SP_CANVAS_WINDOW (item->canvas); ev.focus_change.send_event = FALSE; ev.focus_change.in = TRUE; - + emit_event (item->canvas, &ev); } } @@ -995,7 +995,7 @@ shutdown_transients (SPCanvas *canvas) canvas->tiles=NULL; canvas->tLeft=canvas->tTop=canvas->tRight=canvas->tBottom=0; canvas->tileH=canvas->tileV=0; - + if (canvas->grabbed_item) { canvas->grabbed_item = NULL; gdk_pointer_ungrab (GDK_CURRENT_TIME); @@ -1825,7 +1825,7 @@ sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear) canvas->y0 = iy; sp_canvas_resize_tiles(canvas,canvas->x0,canvas->y0,canvas->x0+canvas->widget.allocation.width,canvas->y0+canvas->widget.allocation.height); - + if (!clear) { // scrolling without zoom; redraw only the newly exposed areas if ((dx != 0) || (dy != 0)) { @@ -1861,7 +1861,7 @@ sp_canvas_update_now (SPCanvas *canvas) g_return_if_fail (canvas != NULL); g_return_if_fail (SP_IS_CANVAS (canvas)); - if (!(canvas->need_update || + if (!(canvas->need_update || canvas->need_redraw)) return; @@ -2051,9 +2051,9 @@ void sp_canvas_dirty_rect(SPCanvas* canvas,int nl,int nt,int nr,int nb) if ( tr > canvas->tRight ) tr=canvas->tRight; if ( tt < canvas->tTop ) tt=canvas->tTop; if ( tb > canvas->tBottom ) tb=canvas->tBottom; - + canvas->need_redraw = TRUE; - + for (int i=tl;itiles[(i-canvas->tLeft)+(j-canvas->tTop)*canvas->tileH]=1; diff --git a/src/display/sp-ctrlline.cpp b/src/display/sp-ctrlline.cpp index 0a278bb69..6715f890f 100644 --- a/src/display/sp-ctrlline.cpp +++ b/src/display/sp-ctrlline.cpp @@ -97,7 +97,7 @@ sp_ctrlline_destroy (GtkObject *object) delete ctrlline->shp; ctrlline->shp = NULL; } - + if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -141,7 +141,7 @@ sp_ctrlline_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int f Path* thePath = new Path; thePath->MoveTo(NR::Point(cl->s.x, cl->s.y) * affine); thePath->LineTo(NR::Point(cl->e.x, cl->e.y) * affine); - + thePath->Convert(1.0); if ( cl->shp == NULL ) cl->shp=new Shape; thePath->Stroke(cl->shp,false,0.5,join_straight,butt_straight,20.0,false); @@ -158,7 +158,7 @@ sp_ctrlline_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int f } } delete thePath; - + item->x1 = (int)dbox.x0; item->y1 = (int)dbox.y0; item->x2 = (int)dbox.x1; diff --git a/src/display/sp-ctrlquadr.cpp b/src/display/sp-ctrlquadr.cpp index e9488cdb5..707d0e059 100644 --- a/src/display/sp-ctrlquadr.cpp +++ b/src/display/sp-ctrlquadr.cpp @@ -94,7 +94,7 @@ sp_ctrlquadr_destroy (GtkObject *object) delete ctrlquadr->shp; ctrlquadr->shp = NULL; } - + if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -141,7 +141,7 @@ sp_ctrlquadr_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int thePath->LineTo(cl->p3 * affine); thePath->LineTo(cl->p4 * affine); thePath->LineTo(cl->p1 * affine); - + thePath->Convert(1.0); if ( cl->shp == NULL ) cl->shp=new Shape; @@ -160,7 +160,7 @@ sp_ctrlquadr_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int } } delete thePath; - + item->x1 = (int)dbox.x0; item->y1 = (int)dbox.y0; item->x2 = (int)dbox.x1; diff --git a/src/event-context.cpp b/src/event-context.cpp index d67572e9c..54b683bf4 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -346,7 +346,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, case GDK_BUTTON_PRESS: // save drag origin - xp = (gint) event->button.x; + xp = (gint) event->button.x; yp = (gint) event->button.y; within_tolerance = true; @@ -522,7 +522,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, ret = TRUE; } break; - case GDK_Left: // Ctrl Left + case GDK_Left: // Ctrl Left case GDK_KP_Left: case GDK_KP_4: if (MOD__CTRL_ONLY) { @@ -570,7 +570,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, if (MOD__SHIFT_ONLY) { sp_event_root_menu_popup(desktop, NULL, event); ret= TRUE; - } + } break; case GDK_space: sp_toggle_selector(desktop); @@ -605,13 +605,13 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context, } else if (event->scroll.state & GDK_CONTROL_MASK) { double rel_zoom; switch (event->scroll.direction) { - case GDK_SCROLL_UP: + case GDK_SCROLL_UP: rel_zoom = zoom_inc; break; - case GDK_SCROLL_DOWN: + case GDK_SCROLL_DOWN: rel_zoom = 1 / zoom_inc; break; - default: + default: rel_zoom = 0.0; break; } @@ -914,7 +914,7 @@ sp_event_show_modifier_tip(Inkscape::MessageContext *message_context, || (keyval == GDK_Meta_L) || (keyval == GDK_Meta_R)); - gchar *tip = g_strdup_printf("%s%s%s%s%s", + gchar *tip = g_strdup_printf("%s%s%s%s%s", ( ctrl ? ctrl_tip : "" ), ( ctrl && (shift || alt) ? "; " : "" ), ( shift ? shift_tip : "" ), @@ -936,7 +936,7 @@ sp_event_show_modifier_tip(Inkscape::MessageContext *message_context, * work regardless of layouts (e.g., in Cyrillic). */ guint -get_group0_keyval(GdkEventKey *event) +get_group0_keyval(GdkEventKey *event) { guint keyval = 0; gdk_keymap_translate_keyboard_state( diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 4aac7780a..42b220576 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -313,7 +313,7 @@ Extension::get_name (void) \return None \brief This function diactivates the extension (which makes it unusable, but not deleted) - + This function is used to removed an extension from functioning, but not delete it completely. It sets the state to \c STATE_DEACTIVATED to mark to the world that it has been deactivated. It also removes @@ -377,7 +377,7 @@ Parameter * param_shared (const gchar * name, GSList * list) { Parameter * output; - + if (name == NULL) { throw Extension::param_not_exist(); } @@ -407,7 +407,7 @@ const gchar * Extension::get_param_string (const gchar * name, const Inkscape::XML::Document * doc) { Parameter * param; - + param = param_shared(name, parameters); return param->get_string(doc); } @@ -426,7 +426,7 @@ bool Extension::get_param_bool (const gchar * name, const Inkscape::XML::Document * doc) { Parameter * param; - + param = param_shared(name, parameters); return param->get_bool(doc); } @@ -445,7 +445,7 @@ int Extension::get_param_int (const gchar * name, const Inkscape::XML::Document * doc) { Parameter * param; - + param = param_shared(name, parameters); return param->get_int(doc); } @@ -553,7 +553,7 @@ Extension::error_file_open (void) error_file.open(filename); if (!error_file.is_open()) { g_warning(_("Could not create extension error log file '%s'"), - filename); + filename); } g_free(filename); g_free(ext_error_file); diff --git a/src/extension/implementation/plugin.cpp b/src/extension/implementation/plugin.cpp index 0bc3267f4..aebc94b8d 100644 --- a/src/extension/implementation/plugin.cpp +++ b/src/extension/implementation/plugin.cpp @@ -34,7 +34,7 @@ Plugin::Plugin(void) return; } -/** +/** \brief Oh, so someone actually wants to use this plugin! We better go and grab it then! \param module Unused except to pass to the plugin's load function. diff --git a/src/extension/internal/gnome.cpp b/src/extension/internal/gnome.cpp index adeb36ef6..6c6563e7e 100644 --- a/src/extension/internal/gnome.cpp +++ b/src/extension/internal/gnome.cpp @@ -239,7 +239,7 @@ PrintGNOME::fill(Inkscape::Extension::Print *mod, dpbox.y0 = pbox->y0; dpbox.x1 = pbox->x1; dpbox.y1 = pbox->y1; - painter = sp_paint_server_painter_new(SP_STYLE_FILL_SERVER(style), + painter = sp_paint_server_painter_new(SP_STYLE_FILL_SERVER(style), // FIXME: the second matrix below must be the parent (context) transform. // I don't know what it must be for gnome-print. --bb ctm, NR::identity(), @@ -394,7 +394,7 @@ void PrintGNOME::init (void) { Inkscape::Extension::Extension * ext; - + /* SVG in */ ext = Inkscape::Extension::build_from_mem( "\n" diff --git a/src/extension/parameter.cpp b/src/extension/parameter.cpp index 76163ac49..88da74a1d 100644 --- a/src/extension/parameter.cpp +++ b/src/extension/parameter.cpp @@ -236,13 +236,13 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * Parameter * param = NULL; if (!strcmp(type, "boolean")) { param = new ParamBool(name, guitext, in_ext, in_repr); - } else if (!strcmp(type, "int")) { + } else if (!strcmp(type, "int")) { param = new ParamInt(name, guitext, in_ext, in_repr); - } else if (!strcmp(type, "float")) { + } else if (!strcmp(type, "float")) { param = new ParamFloat(name, guitext, in_ext, in_repr); - } else if (!strcmp(type, "string")) { + } else if (!strcmp(type, "string")) { param = new ParamString(name, guitext, in_ext, in_repr); - } + } /* Note: param could equal NULL */ return param; @@ -348,7 +348,7 @@ Parameter::get_bool (const Inkscape::XML::Document * doc) boolpntr = dynamic_cast(this); if (boolpntr == NULL) throw Extension::param_wrong_type(); - return boolpntr->get(doc); + return boolpntr->get(doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -359,7 +359,7 @@ Parameter::get_int (const Inkscape::XML::Document * doc) intpntr = dynamic_cast(this); if (intpntr == NULL) throw Extension::param_wrong_type(); - return intpntr->get(doc); + return intpntr->get(doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -370,7 +370,7 @@ Parameter::get_float (const Inkscape::XML::Document * doc) floatpntr = dynamic_cast(this); if (floatpntr == NULL) throw Extension::param_wrong_type(); - return floatpntr->get(doc); + return floatpntr->get(doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -381,7 +381,7 @@ Parameter::get_string (const Inkscape::XML::Document * doc) stringpntr = dynamic_cast(this); if (stringpntr == NULL) throw Extension::param_wrong_type(); - return stringpntr->get(doc); + return stringpntr->get(doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -392,7 +392,7 @@ Parameter::set_bool (bool in, Inkscape::XML::Document * doc) boolpntr = dynamic_cast(this); if (boolpntr == NULL) throw Extension::param_wrong_type(); - return boolpntr->set(in, doc); + return boolpntr->set(in, doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -403,7 +403,7 @@ Parameter::set_int (int in, Inkscape::XML::Document * doc) intpntr = dynamic_cast(this); if (intpntr == NULL) throw Extension::param_wrong_type(); - return intpntr->set(in, doc); + return intpntr->set(in, doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -414,7 +414,7 @@ Parameter::set_float (float in, Inkscape::XML::Document * doc) floatpntr = dynamic_cast(this); if (floatpntr == NULL) throw Extension::param_wrong_type(); - return floatpntr->set(in, doc); + return floatpntr->set(in, doc); } /** \brief Wrapper to cast to the object and use it's function. */ @@ -425,7 +425,7 @@ Parameter::set_string (const gchar * in, Inkscape::XML::Document * doc) stringpntr = dynamic_cast(this); if (stringpntr == NULL) throw Extension::param_wrong_type(); - return stringpntr->set(in, doc); + return stringpntr->set(in, doc); } /** \brief Initialize the object, to do that, copy the data. */ @@ -504,7 +504,7 @@ public: describing the parameter. */ ParamFloatAdjustment (ParamFloat * param) : Gtk::Adjustment(0.0, param->min(), param->max(), 0.1), _pref(param) { - this->set_value(_pref->get(NULL) /* \todo fix */); + this->set_value(_pref->get(NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed)); return; }; @@ -535,7 +535,7 @@ public: describing the parameter. */ ParamIntAdjustment (ParamInt * param) : Gtk::Adjustment(0.0, param->min(), param->max(), 1.0), _pref(param) { - this->set_value(_pref->get(NULL) /* \todo fix */); + this->set_value(_pref->get(NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamIntAdjustment::val_changed)); return; }; @@ -559,7 +559,7 @@ ParamIntAdjustment::val_changed (void) /** \brief Creates a Float Adjustment for a float parameter - + Builds a hbox with a label and a float adjustment in it. */ Gtk::Widget * @@ -583,7 +583,7 @@ ParamFloat::get_widget (void) /** \brief Creates a Int Adjustment for a int parameter - + Builds a hbox with a label and a int adjustment in it. */ Gtk::Widget * @@ -615,7 +615,7 @@ private: public: /** \brief Initialize the check button \param param Which parameter to adjust on changing the check button - + This function sets the value of the checkbox to be that of the parameter, and then sets up a callback to \c on_toggle. */ @@ -642,7 +642,7 @@ ParamBoolCheckButton::on_toggle (void) /** \brief Creates a bool check button for a bool parameter - + Builds a hbox with a label and a check button in it. */ Gtk::Widget * @@ -696,7 +696,7 @@ ParamStringEntry::changed_text (void) /** \brief Creates a text box for the string parameter - + Builds a hbox with a label and a text box in it. */ Gtk::Widget * @@ -722,12 +722,12 @@ Glib::ustring * ParamBool::string (void) { Glib::ustring * mystring; - - if (_value) + + if (_value) mystring = new Glib::ustring("true"); else mystring = new Glib::ustring("false"); - + return mystring; } @@ -757,7 +757,7 @@ ParamString::string (void) { Glib::ustring * mystring = new Glib::ustring(""); *mystring += "\""; - *mystring += _value; + *mystring += _value; *mystring += "\""; return mystring; } diff --git a/src/inkview.cpp b/src/inkview.cpp index bd1ef6e31..fffa0acdf 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -161,9 +161,9 @@ main (int argc, const char **argv) if (argc == 1) { usage(); } - - struct SPSlideShow ss; - + + struct SPSlideShow ss; + GtkWidget *w; int i; @@ -172,7 +172,7 @@ main (int argc, const char **argv) textdomain (GETTEXT_PACKAGE); LIBXML_TEST_VERSION - + Inkscape::GC::init(); Inkscape::Preferences::loadSkeleton(); @@ -202,8 +202,8 @@ main (int argc, const char **argv) for (i = 1; i < argc; i++) { struct stat st; - if (stat (argv[i], &st) - || !S_ISREG (st.st_mode) + if (stat (argv[i], &st) + || !S_ISREG (st.st_mode) || (st.st_size < 64)) { fprintf(stderr, "could not open file %s\n", argv[i]); } else { @@ -232,8 +232,8 @@ main (int argc, const char **argv) ss.size <<= 1; ss.slides = nr_renew (ss.slides, char *, ss.size); } - - ss.doc = sp_document_new_from_mem ((const gchar *)gba->data, + + ss.doc = sp_document_new_from_mem ((const gchar *)gba->data, gba->len, TRUE); gchar *last_filename = jar_file_reader.get_last_filename(); @@ -253,12 +253,12 @@ main (int argc, const char **argv) /* Expand */ ss.size <<= 1; ss.slides = nr_renew (ss.slides, char *, ss.size); - + } - + ss.slides[ss.length++] = strdup (argv[i]); ss.doc = sp_document_new (ss.slides[ss.current], TRUE, false); - + if (!ss.doc && ++ss.current >= ss.length) { /* No loadable documents */ return 1; @@ -268,7 +268,7 @@ main (int argc, const char **argv) #endif } } - + if(!ss.doc) return 1; /* none of the slides loadable */ @@ -313,29 +313,29 @@ sp_svgview_control_show (struct SPSlideShow *ss) t = gtk_table_new (1, 4, TRUE); gtk_container_add ((GtkContainer *) ctrlwin, t); b = gtk_button_new_from_stock (GTK_STOCK_GOTO_FIRST); - gtk_table_attach ((GtkTable *) t, b, 0, 1, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + gtk_table_attach ((GtkTable *) t, b, 0, 1, 0, 1, + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); - g_signal_connect ((GObject *) b, "clicked", (GCallback) sp_svgview_goto_first_cb, ss); + g_signal_connect ((GObject *) b, "clicked", (GCallback) sp_svgview_goto_first_cb, ss); b = gtk_button_new_from_stock (GTK_STOCK_GO_BACK); gtk_table_attach ((GtkTable *) t, b, 1, 2, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); - g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_prev_cb, ss); + g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_prev_cb, ss); b = gtk_button_new_from_stock (GTK_STOCK_GO_FORWARD); gtk_table_attach ((GtkTable *) t, b, 2, 3, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); - g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_next_cb, ss); + g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_next_cb, ss); b = gtk_button_new_from_stock (GTK_STOCK_GOTO_LAST); gtk_table_attach ((GtkTable *) t, b, 3, 4, 0, 1, - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), - (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), + (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0); - g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_last_cb, ss); + g_signal_connect (G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_last_cb, ss); gtk_widget_show_all (ctrlwin); } else { gtk_window_present ((GtkWindow *) ctrlwin); @@ -344,28 +344,28 @@ sp_svgview_control_show (struct SPSlideShow *ss) return NULL; } -static int +static int sp_svgview_show_next_cb (GtkWidget *widget, void *data) { sp_svgview_show_next(static_cast(data)); return FALSE; } -static int +static int sp_svgview_show_prev_cb (GtkWidget *widget, void *data) { sp_svgview_show_prev(static_cast(data)); return FALSE; } -static int +static int sp_svgview_goto_first_cb (GtkWidget *widget, void *data) { sp_svgview_goto_first(static_cast(data)); return FALSE; } -static int +static int sp_svgview_goto_last_cb (GtkWidget *widget, void *data) { sp_svgview_goto_last(static_cast(data)); @@ -458,7 +458,7 @@ is_jar(char const *filename) static void usage() { - fprintf(stderr, + fprintf(stderr, "Usage: inkview [FILES ...]\n" "\twhere FILES are SVG (.svg or .svgz)" #ifdef WITH_INKJAR diff --git a/src/libnr/nr-compose.cpp b/src/libnr/nr-compose.cpp index 8eed6e84c..f0e9c5e4e 100644 --- a/src/libnr/nr-compose.cpp +++ b/src/libnr/nr-compose.cpp @@ -210,8 +210,8 @@ nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_P (unsigned char *px, int w, int h, int rs, co } else { // calculate premultiplied from two premultiplieds: d[0] = NR_COMPOSEPPP(NR_PREMUL (s[0], alpha), a, NR_PREMUL (d[0], d[3]), 0); // last parameter not used - d[1] = NR_COMPOSEPPP(NR_PREMUL (s[1], alpha), a, NR_PREMUL (d[1], d[3]), 0); - d[2] = NR_COMPOSEPPP(NR_PREMUL (s[2], alpha), a, NR_PREMUL (d[2], d[3]), 0); + d[1] = NR_COMPOSEPPP(NR_PREMUL (s[1], alpha), a, NR_PREMUL (d[1], d[3]), 0); + d[2] = NR_COMPOSEPPP(NR_PREMUL (s[2], alpha), a, NR_PREMUL (d[2], d[3]), 0); // total opacity: d[3] = (65025 - (255 - a) * (255 - d[3]) + 127) / 255; // un-premultiply channels: @@ -498,8 +498,8 @@ nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_P_A8 (unsigned char *px, int w, int h, int rs, } else { // calculate premultiplied from two premultiplieds: d[0] = NR_COMPOSEPPP(NR_PREMUL (s[0], m[0]), a, NR_PREMUL (d[0], d[3]), 0); // last parameter not used - d[1] = NR_COMPOSEPPP(NR_PREMUL (s[1], m[0]), a, NR_PREMUL (d[1], d[3]), 0); - d[2] = NR_COMPOSEPPP(NR_PREMUL (s[2], m[0]), a, NR_PREMUL (d[2], d[3]), 0); + d[1] = NR_COMPOSEPPP(NR_PREMUL (s[1], m[0]), a, NR_PREMUL (d[1], d[3]), 0); + d[2] = NR_COMPOSEPPP(NR_PREMUL (s[2], m[0]), a, NR_PREMUL (d[2], d[3]), 0); // total opacity: d[3] = (65025 - (255 - a) * (255 - d[3]) + 127) / 255; // un-premultiply channels: diff --git a/src/select-context.cpp b/src/select-context.cpp index bda4012c7..d5288117c 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -191,7 +191,7 @@ sp_select_context_set(SPEventContext *ec, gchar const *key, gchar const *val) } else { sc->_seltrans->setShow(Inkscape::SelTrans::SHOW_CONTENT); } - } + } } static bool @@ -238,7 +238,7 @@ sp_select_context_abort(SPEventContext *event_context) return false; } -bool +bool key_is_a_modifier (guint key) { return (key == GDK_Alt_L || key == GDK_Alt_R || diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0ba60a91c..1587b2719 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -129,7 +129,7 @@ void sp_selection_copy_impl (const GSList *items, GSList **clip, GSList **defs_c /** Add gradients/patterns/markers referenced by copied objects to defs */ -void +void paste_defs (GSList **defs_clip, SPDocument *doc) { if (!defs_clip) @@ -299,7 +299,7 @@ get_all_items (GSList *list, SPObject *from, SPDesktop *desktop, bool onlyvisibl for (SPObject *child = sp_object_first_child(SP_OBJECT(from)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) { if (SP_IS_ITEM(child) && !desktop->isLayer(SP_ITEM(child)) && - (!onlysensitive || !SP_ITEM(child)->isLocked()) && + (!onlysensitive || !SP_ITEM(child)->isLocked()) && (!onlyvisible || !desktop->itemIsHidden(SP_ITEM(child))) && (!exclude || !g_slist_find ((GSList *) exclude, child)) ) @@ -809,7 +809,7 @@ void sp_copy_gradient (GSList **defs_clip, SPGradient *gradient) { SPGradient *ref = gradient; - while (ref) { + while (ref) { // climb up the refs, copying each one in the chain Inkscape::XML::Node *grad_repr = SP_OBJECT_REPR(ref)->duplicate(); *defs_clip = g_slist_prepend (*defs_clip, grad_repr); @@ -858,9 +858,9 @@ void sp_copy_textpath_path (GSList **defs_clip, SPTextPath *tp, const GSList *it void sp_copy_stuff_used_by_item (GSList **defs_clip, SPItem *item, const GSList *items) { - SPStyle *style = SP_OBJECT_STYLE (item); + SPStyle *style = SP_OBJECT_STYLE (item); - if (style && (style->fill.type == SP_PAINT_TYPE_PAINTSERVER)) { + if (style && (style->fill.type == SP_PAINT_TYPE_PAINTSERVER)) { SPObject *server = SP_OBJECT_STYLE_FILL_SERVER(item); if (SP_IS_LINEARGRADIENT (server) || SP_IS_RADIALGRADIENT (server)) sp_copy_gradient (defs_clip, SP_GRADIENT(server)); @@ -868,7 +868,7 @@ void sp_copy_stuff_used_by_item (GSList **defs_clip, SPItem *item, const GSList sp_copy_pattern (defs_clip, SP_PATTERN(server)); } - if (style && (style->stroke.type == SP_PAINT_TYPE_PAINTSERVER)) { + if (style && (style->stroke.type == SP_PAINT_TYPE_PAINTSERVER)) { SPObject *server = SP_OBJECT_STYLE_STROKE_SERVER(item); if (SP_IS_LINEARGRADIENT (server) || SP_IS_RADIALGRADIENT (server)) sp_copy_gradient (defs_clip, SP_GRADIENT(server)); @@ -876,7 +876,7 @@ void sp_copy_stuff_used_by_item (GSList **defs_clip, SPItem *item, const GSList sp_copy_pattern (defs_clip, SP_PATTERN(server)); } - if (SP_IS_SHAPE (item)) { + if (SP_IS_SHAPE (item)) { SPShape *shape = SP_SHAPE (item); for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) { if (shape->marker[i]) { @@ -959,7 +959,7 @@ void sp_selection_copy() const GSList *items = g_slist_copy ((GSList *) selection->itemList()); // 0. Copy text to system clipboard - // FIXME: for non-texts, put serialized XML as text to the clipboard; + // FIXME: for non-texts, put serialized XML as text to the clipboard; //for this sp_repr_write_stream needs to be rewritten with iostream instead of FILE Glib::ustring text; if (tools_isactive (desktop, TOOLS_TEXT)) { @@ -998,8 +998,8 @@ void sp_selection_copy() sp_repr_css_attr_unref (style_clipboard); style_clipboard = NULL; } - - //clear main clipboard + + //clear main clipboard while (clipboard) { Inkscape::GC::release((Inkscape::XML::Node *) clipboard->data); clipboard = g_slist_remove(clipboard, clipboard->data); @@ -1103,7 +1103,7 @@ void sp_selection_paste_style() sp_document_done(SP_DT_DOCUMENT (desktop)); } -void sp_selection_to_next_layer () +void sp_selection_to_next_layer () { SPDesktop *dt = SP_ACTIVE_DESKTOP; @@ -1135,7 +1135,7 @@ void sp_selection_to_next_layer () g_slist_free ((GSList *) items); } -void sp_selection_to_prev_layer () +void sp_selection_to_prev_layer () { SPDesktop *dt = SP_ACTIVE_DESKTOP; @@ -1153,7 +1153,7 @@ void sp_selection_to_prev_layer () if (next) { GSList *temp_clip = NULL; sp_selection_copy_impl (items, &temp_clip, NULL, NULL); // we're in the same doc, so no need to copy defs - sp_selection_delete_impl (items); + sp_selection_delete_impl (items); GSList *copied = sp_selection_paste_impl (SP_DT_DOCUMENT (dt), next, &temp_clip, NULL); selection->setReprList((GSList const *) copied); g_slist_free (copied); @@ -1562,7 +1562,7 @@ SPItem *next_item(SPDesktop *desktop, GSList *path, SPObject *root, bool only_in_viewport, bool inlayer, bool onlyvisible, bool onlysensitive); template -SPItem *next_item_from_list(SPDesktop *desktop, GSList const *items, SPObject *root, +SPItem *next_item_from_list(SPDesktop *desktop, GSList const *items, SPObject *root, bool only_in_viewport, bool inlayer, bool onlyvisible, bool onlysensitive); struct Forward { @@ -2026,7 +2026,7 @@ sp_selection_untile() SPStyle *style = SP_OBJECT_STYLE (item); - if (!style || style->fill.type != SP_PAINT_TYPE_PAINTSERVER) + if (!style || style->fill.type != SP_PAINT_TYPE_PAINTSERVER) continue; SPObject *server = SP_OBJECT_STYLE_FILL_SERVER(item); @@ -2046,7 +2046,7 @@ sp_selection_untile() SPItem *i = SP_ITEM (desktop->currentLayer()->appendChildRepr(copy)); // FIXME: relink clones to the new canvas objects - // use SPObject::setid when mental finishes it to steal ids of + // use SPObject::setid when mental finishes it to steal ids of // this is needed to make sure the new item has curve (simply requestDisplayUpdate does not work) sp_document_ensure_up_to_date (document); @@ -2105,7 +2105,7 @@ sp_selection_create_bitmap_copy () // multiple times, and this is done so that they don't clash) GTimeVal cu; g_get_current_time (&cu); - guint current = (int) (cu.tv_sec * 1000000 + cu.tv_usec) % 1024; + guint current = (int) (cu.tv_sec * 1000000 + cu.tv_usec) % 1024; // Create the filename gchar *filename = g_strdup_printf ("%s-%s-%u.png", document->name, SP_OBJECT_REPR(items->data)->attribute("id"), current); diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp index 5d61d543b..4b93f7cf0 100644 --- a/src/sp-anchor.cpp +++ b/src/sp-anchor.cpp @@ -41,7 +41,7 @@ static SPGroupClass *parent_class; GType sp_anchor_get_type(void) { static GType type = 0; - + if (!type) { GTypeInfo info = { sizeof(SPAnchorClass), @@ -57,17 +57,17 @@ GType sp_anchor_get_type(void) }; type = g_type_register_static(SP_TYPE_GROUP, "SPAnchor", &info, (GTypeFlags) 0); } - + return type; } static void sp_anchor_class_init(SPAnchorClass *ac) { - SPObjectClass *sp_object_class = (SPObjectClass *) ac; + SPObjectClass *sp_object_class = (SPObjectClass *) ac; SPItemClass *item_class = (SPItemClass *) ac; - + parent_class = (SPGroupClass *) g_type_class_ref(SP_TYPE_GROUP); - + sp_object_class->build = sp_anchor_build; sp_object_class->release = sp_anchor_release; sp_object_class->set = sp_anchor_set; @@ -187,7 +187,7 @@ static gchar *sp_anchor_description(SPItem *item) static gint sp_anchor_event(SPItem *item, SPEvent *event) { SPAnchor *anchor = SP_ANCHOR(item); - + switch (event->type) { case SP_EVENT_ACTIVATE: if (anchor->href) { @@ -204,7 +204,7 @@ static gint sp_anchor_event(SPItem *item, SPEvent *event) default: break; } - + return FALSE; } diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp index 61a5ec430..cc0405541 100644 --- a/src/sp-flowdiv.cpp +++ b/src/sp-flowdiv.cpp @@ -88,12 +88,12 @@ sp_flowdiv_class_init (SPFlowdivClass *klass) { GObjectClass * object_class; SPObjectClass * sp_object_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; - + flowdiv_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM); - + sp_object_class->build = sp_flowdiv_build; sp_object_class->set = sp_flowdiv_set; sp_object_class->release = sp_flowdiv_release; @@ -121,10 +121,10 @@ sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags) if (((SPObjectClass *) (flowdiv_parent_class))->update) ((SPObjectClass *) (flowdiv_parent_class))->update (object, ctx, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + GSList* l = NULL; for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -152,13 +152,13 @@ sp_flowdiv_modified (SPObject *object, guint flags) { SPObject *child; GSList *l; - + if (((SPObjectClass *) (flowdiv_parent_class))->modified) ((SPObjectClass *) (flowdiv_parent_class))->modified (object, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -195,7 +195,7 @@ static Inkscape::XML::Node * sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) { // SPFlowdiv *group = SP_FLOWDIV (object); - + if ( flags&SP_OBJECT_WRITE_BUILD ) { if ( repr == NULL ) repr = sp_repr_new ("svg:flowDiv"); GSList *l = NULL; @@ -226,10 +226,10 @@ sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } } } - + if (((SPObjectClass *) (flowdiv_parent_class))->write) ((SPObjectClass *) (flowdiv_parent_class))->write (object, repr, flags); - + return repr; } @@ -265,12 +265,12 @@ sp_flowtspan_class_init (SPFlowtspanClass *klass) { GObjectClass * object_class; SPObjectClass * sp_object_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; flowtspan_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM); - + sp_object_class->build = sp_flowtspan_build; sp_object_class->set = sp_flowtspan_set; sp_object_class->release = sp_flowtspan_release; @@ -296,13 +296,13 @@ sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags) // SPFlowtspan *group=SP_FLOWTSPAN (object); SPItemCtx *ictx=(SPItemCtx *) ctx; SPItemCtx cctx=*ictx; - + if (((SPObjectClass *) (flowtspan_parent_class))->update) ((SPObjectClass *) (flowtspan_parent_class))->update (object, ctx, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + GSList* l = NULL; for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -330,13 +330,13 @@ sp_flowtspan_modified (SPObject *object, guint flags) { SPObject *child; GSList *l; - + if (((SPObjectClass *) (flowtspan_parent_class))->modified) ((SPObjectClass *) (flowtspan_parent_class))->modified (object, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -397,10 +397,10 @@ sp_flowtspan_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } } } - + if (((SPObjectClass *) (flowtspan_parent_class))->write) ((SPObjectClass *) (flowtspan_parent_class))->write (object, repr, flags); - + return repr; } @@ -437,12 +437,12 @@ sp_flowpara_class_init (SPFlowparaClass *klass) { GObjectClass * object_class; SPObjectClass * sp_object_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; - + flowpara_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM); - + sp_object_class->build = sp_flowpara_build; sp_object_class->set = sp_flowpara_set; sp_object_class->release = sp_flowpara_release; @@ -467,13 +467,13 @@ sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx=(SPItemCtx *) ctx; SPItemCtx cctx=*ictx; - + if (((SPObjectClass *) (flowpara_parent_class))->update) ((SPObjectClass *) (flowpara_parent_class))->update (object, ctx, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + GSList* l = NULL; for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -501,13 +501,13 @@ sp_flowpara_modified (SPObject *object, guint flags) { SPObject *child; GSList *l; - + if (((SPObjectClass *) (flowpara_parent_class))->modified) ((SPObjectClass *) (flowpara_parent_class))->modified (object, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -539,7 +539,7 @@ static Inkscape::XML::Node * sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) { // SPFlowpara *group = SP_FLOWPARA (object); - + if ( flags&SP_OBJECT_WRITE_BUILD ) { if ( repr == NULL ) repr = sp_repr_new ("svg:flowPara"); GSList *l = NULL; @@ -570,10 +570,10 @@ sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) } } } - + if (((SPObjectClass *) (flowpara_parent_class))->write) ((SPObjectClass *) (flowpara_parent_class))->write (object, repr, flags); - + return repr; } @@ -608,12 +608,12 @@ sp_flowline_class_init (SPFlowlineClass *klass) { GObjectClass * object_class; SPObjectClass * sp_object_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; - + flowline_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT); - + sp_object_class->release = sp_flowline_release; sp_object_class->write = sp_flowline_write; sp_object_class->modified = sp_flowline_modified; @@ -635,7 +635,7 @@ sp_flowline_modified (SPObject *object, guint flags) { if (((SPObjectClass *) (flowline_parent_class))->modified) ((SPObjectClass *) (flowline_parent_class))->modified (object, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; } @@ -646,10 +646,10 @@ sp_flowline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags) if ( repr == NULL ) repr = sp_repr_new ("svg:flowLine"); } else { } - + if (((SPObjectClass *) (flowline_parent_class))->write) ((SPObjectClass *) (flowline_parent_class))->write (object, repr, flags); - + return repr; } @@ -684,12 +684,12 @@ sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass) { GObjectClass * object_class; SPObjectClass * sp_object_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; - + flowregionbreak_parent_class = (SPObjectClass *)g_type_class_ref (SP_TYPE_OBJECT); - + sp_object_class->release = sp_flowregionbreak_release; sp_object_class->write = sp_flowregionbreak_write; sp_object_class->modified = sp_flowregionbreak_modified; @@ -711,7 +711,7 @@ sp_flowregionbreak_modified (SPObject *object, guint flags) { if (((SPObjectClass *) (flowregionbreak_parent_class))->modified) ((SPObjectClass *) (flowregionbreak_parent_class))->modified (object, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; } @@ -722,9 +722,9 @@ sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Node *repr, guint fla if ( repr == NULL ) repr = sp_repr_new ("svg:flowLine"); } else { } - + if (((SPObjectClass *) (flowregionbreak_parent_class))->write) ((SPObjectClass *) (flowregionbreak_parent_class))->write (object, repr, flags); - + return repr; } diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 4071e4d92..5c01483c8 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -82,21 +82,21 @@ sp_flowregion_class_init (SPFlowregionClass *klass) GObjectClass * object_class; SPObjectClass * sp_object_class; SPItemClass * item_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; item_class = (SPItemClass *) klass; - + flowregion_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM); - + object_class->dispose = sp_flowregion_dispose; - + sp_object_class->child_added = sp_flowregion_child_added; sp_object_class->remove_child = sp_flowregion_remove_child; sp_object_class->update = sp_flowregion_update; sp_object_class->modified = sp_flowregion_modified; sp_object_class->write = sp_flowregion_write; - + item_class->description = sp_flowregion_description; } @@ -119,12 +119,12 @@ static void sp_flowregion_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { SPItem *item; - + item = SP_ITEM (object); - + if (((SPObjectClass *) (flowregion_parent_class))->child_added) (* ((SPObjectClass *) (flowregion_parent_class))->child_added) (object, child, ref); - + object->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -135,7 +135,7 @@ sp_flowregion_remove_child (SPObject * object, Inkscape::XML::Node * child) { if (((SPObjectClass *) (flowregion_parent_class))->remove_child) (* ((SPObjectClass *) (flowregion_parent_class))->remove_child) (object, child); - + object->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -147,17 +147,17 @@ sp_flowregion_update (SPObject *object, SPCtx *ctx, unsigned int flags) SPObject *child; SPItemCtx *ictx, cctx; GSList *l; - + group = SP_FLOWREGION (object); ictx = (SPItemCtx *) ctx; cctx = *ictx; - + if (((SPObjectClass *) (flowregion_parent_class))->update) ((SPObjectClass *) (flowregion_parent_class))->update (object, ctx, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -186,14 +186,14 @@ sp_flowregion_update (SPObject *object, SPCtx *ctx, unsigned int flags) void SPFlowregion::UpdateComputed(void) { SPObject* object=SP_OBJECT(this); - + NR::Matrix itr_mat=sp_item_i2root_affine (SP_ITEM(object)); itr_mat=itr_mat.inverse(); - + for (std::vector::iterator it = computed.begin() ; it != computed.end() ; it++) delete *it; computed.clear(); - + for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { Shape *shape = NULL; GetDest(child,&shape,itr_mat); @@ -207,12 +207,12 @@ sp_flowregion_modified (SPObject *object, guint flags) SPFlowregion *group; SPObject *child; GSList *l; - - group = SP_FLOWREGION (object); - + + group = SP_FLOWREGION (object); + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -298,21 +298,21 @@ sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) GObjectClass * object_class; SPObjectClass * sp_object_class; SPItemClass * item_class; - + object_class = (GObjectClass *) klass; sp_object_class = (SPObjectClass *) klass; item_class = (SPItemClass *) klass; - + flowregionexclude_parent_class = (SPItemClass *)g_type_class_ref (SP_TYPE_ITEM); - + object_class->dispose = sp_flowregionexclude_dispose; - + sp_object_class->child_added = sp_flowregionexclude_child_added; sp_object_class->remove_child = sp_flowregionexclude_remove_child; sp_object_class->update = sp_flowregionexclude_update; sp_object_class->modified = sp_flowregionexclude_modified; sp_object_class->write = sp_flowregionexclude_write; - + item_class->description = sp_flowregionexclude_description; } @@ -336,12 +336,12 @@ static void sp_flowregionexclude_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { SPItem *item; - + item = SP_ITEM (object); - + if (((SPObjectClass *) (flowregionexclude_parent_class))->child_added) (* ((SPObjectClass *) (flowregionexclude_parent_class))->child_added) (object, child, ref); - + object->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -352,7 +352,7 @@ sp_flowregionexclude_remove_child (SPObject * object, Inkscape::XML::Node * chil { if (((SPObjectClass *) (flowregionexclude_parent_class))->remove_child) (* ((SPObjectClass *) (flowregionexclude_parent_class))->remove_child) (object, child); - + object->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -364,17 +364,17 @@ sp_flowregionexclude_update (SPObject *object, SPCtx *ctx, unsigned int flags) SPObject *child; SPItemCtx *ictx, cctx; GSList *l; - + group = SP_FLOWREGIONEXCLUDE (object); ictx = (SPItemCtx *) ctx; cctx = *ictx; - + if (((SPObjectClass *) (flowregionexclude_parent_class))->update) ((SPObjectClass *) (flowregionexclude_parent_class))->update (object, ctx, flags); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -402,14 +402,14 @@ sp_flowregionexclude_update (SPObject *object, SPCtx *ctx, unsigned int flags) void SPFlowregionExclude::UpdateComputed(void) { SPObject* object=SP_OBJECT(this); - + if (computed) { delete computed; computed = NULL; } NR::Matrix itr_mat=sp_item_i2root_affine (SP_ITEM(object)); itr_mat=itr_mat.inverse(); - + for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { GetDest(child,&computed,itr_mat); } @@ -421,12 +421,12 @@ sp_flowregionexclude_modified (SPObject *object, guint flags) SPFlowregionExclude *group; SPObject *child; GSList *l; - + group = SP_FLOWREGIONEXCLUDE (object); - + if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; - + l = NULL; for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) { g_object_ref (G_OBJECT (child)); @@ -502,11 +502,11 @@ static void UnionShape(Shape **base_shape, Shape const *add_shape) } static void GetDest(SPObject* child,Shape **computed,NR::Matrix itr_mat) -{ +{ if ( child == NULL ) return; - + SPCurve *curve=NULL; - + SPObject* u_child=child; if ( SP_IS_USE(u_child) ) { u_child=SP_USE(u_child)->child; @@ -516,7 +516,7 @@ static void GetDest(SPObject* child,Shape **computed,NR::Matrix itr_mat) } else if ( SP_IS_TEXT (u_child) ) { curve = SP_TEXT (u_child)->getNormalizedBpath (); } - + if ( curve ) { Path* temp=new Path; NR::Matrix tr_mat=sp_item_i2root_affine (SP_ITEM(u_child)); diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 900a3dffc..f54e60dab 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -172,7 +172,7 @@ sp_flowtext_update(SPObject *object, SPCtx *ctx, unsigned flags) group->rebuildLayout(); - // pass the bbox of the flowtext object as paintbox (used for paintserver fills) + // pass the bbox of the flowtext object as paintbox (used for paintserver fills) NRRect paintbox; sp_item_invoke_bbox(group, &paintbox, NR::identity(), TRUE); for (SPItemView *v = group->display; v != NULL; v = v->next) { @@ -350,7 +350,7 @@ sp_flowtext_show(SPItem *item, NRArena *arena, unsigned/* key*/, unsigned /*flag NRArenaGroup *flowed = NRArenaGroup::create(arena); nr_arena_group_set_transparent(flowed, FALSE); - // pass the bbox of the flowtext object as paintbox (used for paintserver fills) + // pass the bbox of the flowtext object as paintbox (used for paintserver fills) NRRect paintbox; sp_item_invoke_bbox(item, &paintbox, NR::identity(), TRUE); group->layout.show(flowed, &paintbox); @@ -503,7 +503,7 @@ void SPFlowtext::convert_to_text() sp_repr_set_svg_double(repr, "y", anchor_point[NR::Y]); for (Inkscape::Text::Layout::iterator it = group->layout.begin() ; it != group->layout.end() ; ) { - + Inkscape::XML::Node *line_tspan = sp_repr_new("svg:tspan"); line_tspan->setAttribute("sodipodi:role", "line"); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 869981567..19b9b19a7 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -118,7 +118,7 @@ public: //g_message( " __read %d bytes", (int)got ); if ( !gdk_pixbuf_loader_write( loader, scratch + used, got, &err ) ) { - //g_message("_error writing pixbuf data"); + //g_message("_error writing pixbuf data"); } } @@ -306,7 +306,7 @@ GdkPixbuf* pixbuf_new_from_file( const char *filename, GError **error ) "unknown", // PNG_SCALE_UNKNOWN "meter", // PNG_SCALE_METER "radian", // PNG_SCALE_RADIAN - "last", // + "last", // NULL }; @@ -729,7 +729,7 @@ sp_image_update (SPObject *object, SPCtx *ctx, unsigned int flags) } } } - + sp_image_update_canvas_image ((SPImage *) object); } @@ -788,13 +788,13 @@ sp_image_print (SPItem *item, SPPrintContext *ctx) if (!image->pixbuf) return; if ((image->width.computed <= 0.0) || (image->height.computed <= 0.0)) return; - + px = gdk_pixbuf_get_pixels (image->pixbuf); w = gdk_pixbuf_get_width (image->pixbuf); h = gdk_pixbuf_get_height (image->pixbuf); rs = gdk_pixbuf_get_rowstride (image->pixbuf); pixskip = gdk_pixbuf_get_n_channels (image->pixbuf) * gdk_pixbuf_get_bits_per_sample (image->pixbuf) / 8; - + if (image->aspect_align == SP_ASPECT_NONE) { /* fixme: (Lauris) */ nr_matrix_set_translate (&tp, image->x.computed, image->y.computed); diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index c093c569b..a2be6daf4 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -539,7 +539,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) // Merging transform NR::Matrix ctrans; NR::Matrix const g(gitem->transform); - if (SP_IS_USE(citem) && sp_use_get_original (SP_USE(citem)) && + if (SP_IS_USE(citem) && sp_use_get_original (SP_USE(citem)) && SP_OBJECT_PARENT (sp_use_get_original (SP_USE(citem))) == SP_OBJECT(group)) { // make sure a clone's effective transform is the same as was under group ctrans = g.inverse() * citem->transform * g; @@ -626,7 +626,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) * some API for list aspect of SPGroup */ -GSList * +GSList * sp_item_group_item_list (SPGroup * group) { GSList *s; diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index 5c79eb334..a9730653c 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -99,7 +99,7 @@ static void sp_offset_source_modified (SPObject *iSource, guint flags, SPItem *i // slow= source path->polygon->offset of polygon->polygon->path // fast= source path->offset of source path->polygon->path // fast is not mathematically correct, because computing the offset of a single -// cubic bezier patch is not trivial; in particular, there are problems with holes +// cubic bezier patch is not trivial; in particular, there are problems with holes // reappearing in offset when the radius becomes too large static bool use_slow_but_correct_offset_method=false; @@ -114,7 +114,7 @@ GType sp_offset_get_type (void) { static GType offset_type = 0; - + if (!offset_type) { GTypeInfo offset_info = { @@ -146,9 +146,9 @@ sp_offset_class_init(SPOffsetClass *klass) SPObjectClass *sp_object_class = (SPObjectClass *) klass; SPItemClass *item_class = (SPItemClass *) klass; SPShapeClass *shape_class = (SPShapeClass *) klass; - + parent_class = (SPShapeClass *) g_type_class_ref (SP_TYPE_SHAPE); - + gobject_class->finalize = sp_offset_finalize; sp_object_class->build = sp_offset_build; @@ -156,10 +156,10 @@ sp_offset_class_init(SPOffsetClass *klass) sp_object_class->set = sp_offset_set; sp_object_class->update = sp_offset_update; sp_object_class->release = sp_offset_release; - + item_class->description = sp_offset_description; item_class->snappoints = sp_offset_snappoints; - + shape_class->set_shape = sp_offset_set_shape; } @@ -194,7 +194,7 @@ static void sp_offset_finalize(GObject *obj) { SPOffset *offset = (SPOffset *) obj; - + delete offset->sourceRef; offset->_delete_connection.~connection(); offset->_changed_connection.~connection(); @@ -253,11 +253,11 @@ static Inkscape::XML::Node * sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) { SPOffset *offset = SP_OFFSET (object); - + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = sp_repr_new ("svg:path"); } - + if (flags & SP_OBJECT_WRITE_EXT) { /** \todo * Fixme: we may replace these attributes by @@ -270,7 +270,7 @@ sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) } - // Make sure the object has curve + // Make sure the object has curve SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset)); if (curve == NULL) { sp_offset_set_shape (SP_SHAPE (offset)); @@ -280,11 +280,11 @@ sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) char *d = sp_svg_write_path (((SPShape *) offset)->curve->bpath); repr->setAttribute("d", d); g_free (d); - + if (((SPObjectClass *) (parent_class))->write) ((SPObjectClass *) (parent_class))->write (object, repr, flags | SP_SHAPE_WRITE_PATH); - + return repr; } @@ -295,23 +295,23 @@ static void sp_offset_release(SPObject *object) { SPOffset *offset = (SPOffset *) object; - + if (offset->original) free (offset->original); if (offset->originalPath) delete ((Path *) offset->originalPath); offset->original = NULL; offset->originalPath = NULL; - + sp_offset_quit_listening(offset); - + offset->_changed_connection.disconnect(); g_free(offset->sourceHref); offset->sourceHref = NULL; offset->sourceRef->detach(); - + if (((SPObjectClass *) parent_class)->release) { ((SPObjectClass *) parent_class)->release (object); } - + } /** @@ -322,9 +322,9 @@ static void sp_offset_set(SPObject *object, unsigned key, gchar const *value) { SPOffset *offset = SP_OFFSET (object); - + if ( offset->sourceDirty ) refresh_offset_source(offset); - + /* fixme: we should really collect updates */ switch (key) { @@ -340,15 +340,15 @@ sp_offset_set(SPObject *object, unsigned key, gchar const *value) } NArtBpath *bpath; SPCurve *curve; - + offset->original = strdup (value); - + bpath = sp_svg_read_path (offset->original); curve = sp_curve_new_from_bpath (bpath); // curve se chargera de detruire bpath g_assert (curve != NULL); offset->originalPath = bpath_to_liv_path (curve->bpath); sp_curve_unref (curve); - + offset->knotSet = false; if ( offset->isUpdating == false ) object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } @@ -405,7 +405,7 @@ sp_offset_update(SPObject *object, SPCtx *ctx, guint flags) sp_shape_set_shape ((SPShape *) object); } offset->isUpdating=false; - + if (((SPObjectClass *) parent_class)->update) ((SPObjectClass *) parent_class)->update (object, ctx, flags); } @@ -446,7 +446,7 @@ bpath_to_liv_path(NArtBpath *bpath) bool closed = false; float lastX = 0.0; float lastY = 0.0; - + for (i = 0; bpath[i].code != NR_END; i++) { switch (bpath[i].code) @@ -459,7 +459,7 @@ bpath_to_liv_path(NArtBpath *bpath) dest->LineTo (tmp); } break; - + case NR_CURVETO: { NR::Point tmp(bpath[i].x3, bpath[i].y3); @@ -474,7 +474,7 @@ bpath_to_liv_path(NArtBpath *bpath) lastX = bpath[i].x3; lastY = bpath[i].y3; break; - + case NR_MOVETO_OPEN: case NR_MOVETO: if (closed) @@ -494,7 +494,7 @@ bpath_to_liv_path(NArtBpath *bpath) if (closed) dest->Close (); } - + return dest; } @@ -505,7 +505,7 @@ static void sp_offset_set_shape(SPShape *shape) { SPOffset *offset = SP_OFFSET (shape); - + if ( offset->originalPath == NULL ) { // oops : no path?! (the offset object should do harakiri) return; @@ -514,12 +514,12 @@ sp_offset_set_shape(SPShape *shape) g_print ("rad=%g\n", offset->rad); #endif // au boulot - + if ( fabs(offset->rad) < 0.01 ) { // grosso modo: 0 // just put the source shape as the offseted one, no one will notice // it's also useless to compute the offset with a 0 radius - + const char *res_d = SP_OBJECT(shape)->repr->attribute("inkscape:original"); if ( res_d ) { NArtBpath *bpath = sp_svg_read_path (res_d); @@ -530,14 +530,14 @@ sp_offset_set_shape(SPShape *shape) } return; } - + // extra paraniac careful check. the preceding if () should take care of this case if (fabs (offset->rad) < 0.01) offset->rad = (offset->rad < 0) ? -0.01 : 0.01; - + Path *orig = new Path; orig->Copy ((Path *) offset->originalPath); - + if ( use_slow_but_correct_offset_method == false ) { // version par outline Shape *theShape = new Shape; @@ -558,7 +558,7 @@ sp_offset_set_shape(SPShape *shape) o_width = -offset->rad; orig->OutsideOutline (res, -o_width, join_round, butt_straight, 20.0); } - + if (o_width >= 1.0) { // res->ConvertForOffset (1.0, orig, offset->rad); @@ -572,7 +572,7 @@ sp_offset_set_shape(SPShape *shape) res->Fill (theShape, 0); theRes->ConvertToShape (theShape, fill_positive); originaux[0] = res; - + theRes->ConvertToForme (orig, 1, originaux); SPItem *item = shape; @@ -580,13 +580,13 @@ sp_offset_set_shape(SPShape *shape) if (!bbox.isEmpty()) { gdouble size = L2(bbox.dimensions()); gdouble const exp = NR::expansion(item->transform); - if (exp != 0) + if (exp != 0) size /= exp; orig->Coalesce (size * 0.001); //g_print ("coa %g exp %g item %p\n", size * 0.001, exp, item); } - + // if (o_width >= 1.0) // { // orig->Coalesce (0.1); // small treshhold, since we only want to get rid of small segments @@ -600,7 +600,7 @@ sp_offset_set_shape(SPShape *shape) // orig->ConvertEvenLines (o_width); // orig->Simplify (0.5 * o_width); // } - + delete theShape; delete theRes; delete res; @@ -664,7 +664,7 @@ sp_offset_set_shape(SPShape *shape) onePart->ConvertToShape(oneCleanPart,fill_positive); // there aren't intersections in that one, but maybe duplicate points and null edges oneCleanPart->MakeOffset(onePart,offset->rad,join_round,20.0); onePart->ConvertToShape(oneCleanPart,fill_positive); - + onePart->CalcBBox(); double typicalSize=0.5*((onePart->rightX-onePart->leftX)+(onePart->bottomY-onePart->topY)); if ( typicalSize < 0.05 ) typicalSize=0.05; @@ -691,7 +691,7 @@ sp_offset_set_shape(SPShape *shape) oneCleanPart->MakeOffset(onePart,-offset->rad,join_round,20.0); onePart->ConvertToShape(oneCleanPart,fill_positive); // for (int j=0;jnbAr;j++) onePart->Inverse(j); // pas oublier de reinverser - + onePart->CalcBBox(); double typicalSize=0.5*((onePart->rightX-onePart->leftX)+(onePart->bottomY-onePart->topY)); if ( typicalSize < 0.05 ) typicalSize=0.05; @@ -707,7 +707,7 @@ sp_offset_set_shape(SPShape *shape) parts[i]=NULL; } else { } - + /* int firstP=theShape->nbPt; for (int j=0;jnbPt;j++) theShape->AddPoint(onePart->pts[j].x); for (int j=0;jnbAr;j++) theShape->AddEdge(firstP+onePart->aretes[j].en,firstP+onePart->aretes[j].st);*/ @@ -724,9 +724,9 @@ sp_offset_set_shape(SPShape *shape) if ( parts[i] ) { parts[i]->ConvertWithBackData(1.0); if ( holes[i] ) { - parts[i]->Fill(theShape,i,true,true,true); + parts[i]->Fill(theShape,i,true,true,true); } else { - parts[i]->Fill(theShape,i,true,true,false); + parts[i]->Fill(theShape,i,true,true,false); } } } @@ -741,7 +741,7 @@ sp_offset_set_shape(SPShape *shape) } // theRes->ConvertToShape (theShape, fill_positive); // theRes->ConvertToForme (orig); - + /* if (o_width >= 1.0) { orig->ConvertEvenLines (1.0); orig->Simplify (1.0); @@ -749,13 +749,13 @@ sp_offset_set_shape(SPShape *shape) orig->ConvertEvenLines (1.0*o_width); orig->Simplify (1.0 * o_width); }*/ - + if ( parts ) free(parts); if ( holes ) free(holes); delete res; delete theShape; delete theRes; - } + } { char *res_d = NULL; if (orig->descr_cmd.size() <= 1) @@ -766,17 +766,17 @@ sp_offset_set_shape(SPShape *shape) } else { - + res_d = orig->svg_dump_path (); - } + } delete orig; - + NArtBpath *bpath = sp_svg_read_path (res_d); SPCurve *c = sp_curve_new_from_bpath (bpath); g_assert(c != NULL); sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE); sp_curve_unref (c); - + free (res_d); } } @@ -821,7 +821,7 @@ vectors_are_clockwise (NR::Point A, NR::Point B, NR::Point C) double bc_c = dot(B, C); double ca_s = dot(C, rot90(A)); double ca_c = dot(C, A); - + double ab_a = acos (ab_c); if (ab_c <= -1.0) ab_a = M_PI; @@ -843,9 +843,9 @@ vectors_are_clockwise (NR::Point A, NR::Point B, NR::Point C) ca_a = 0; if (ca_s < 0) ca_a = 2 * M_PI - ca_a; - + double lim = 2 * M_PI - ca_a; - + if (ab_a < lim) return true; return false; @@ -882,10 +882,10 @@ sp_offset_distance_to_original (SPOffset * offset, NR::Point px) ((Path *) offset->originalPath)->Convert (1.0); ((Path *) offset->originalPath)->Fill (theShape, 0); theRes->ConvertToShape (theShape, fill_oddEven); - + if (theRes->numberOfEdges() <= 1) { - + } else { @@ -930,7 +930,7 @@ sp_offset_distance_to_original (SPOffset * offset, NR::Point px) { nex = -nex; } - + if (vectors_are_clockwise (nex, nx, prx)) { // we're in that angle. set the sign, and exit that loop @@ -988,10 +988,10 @@ sp_offset_distance_to_original (SPOffset * offset, NR::Point px) dist = arDist; } } - + delete theShape; delete theRes; - + return dist; } @@ -1007,13 +1007,13 @@ sp_offset_top_point (SPOffset * offset, NR::Point *px) (*px) = NR::Point(0, 0); if (offset == NULL) return; - + if (offset->knotSet) { (*px) = offset->knot; return; } - + SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset)); if (curve == NULL) { @@ -1022,25 +1022,25 @@ sp_offset_top_point (SPOffset * offset, NR::Point *px) if (curve == NULL) return; } - + Path *finalPath = bpath_to_liv_path (curve->bpath); if (finalPath == NULL) { sp_curve_unref (curve); return; } - + Shape *theShape = new Shape; - + finalPath->Convert (1.0); finalPath->Fill (theShape, 0); - + if (theShape->hasPoints()) { theShape->SortPoints (); *px = theShape->getPoint(0).x; } - + delete theShape; delete finalPath; sp_curve_unref (curve); @@ -1049,7 +1049,7 @@ sp_offset_top_point (SPOffset * offset, NR::Point *px) // the listening functions static void sp_offset_start_listening(SPOffset *offset,SPObject* to) { - if ( to == NULL ) + if ( to == NULL ) return; offset->sourceObject = to; @@ -1062,7 +1062,7 @@ static void sp_offset_start_listening(SPOffset *offset,SPObject* to) static void sp_offset_quit_listening(SPOffset *offset) { - if ( offset->sourceObject == NULL ) + if ( offset->sourceObject == NULL ) return; g_signal_handler_disconnect (offset->sourceObject, offset->_modified_connection); @@ -1087,7 +1087,7 @@ sp_offset_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPOffset *offse static void sp_offset_move_compensate(NR::Matrix const *mp, SPItem *original, SPOffset *self) -{ +{ guint mode = prefs_get_int_attribute("options.clonecompensation", "value", SP_CLONE_COMPENSATION_PARALLEL); if (mode == SP_CLONE_COMPENSATION_NONE) return; @@ -1121,7 +1121,7 @@ static void sp_offset_delete_self(SPObject */*deleted*/, SPOffset *offset) { guint const mode = prefs_get_int_attribute("options.cloneorphans", "value", SP_CLONE_ORPHANS_UNLINK); - + if (mode == SP_CLONE_ORPHANS_UNLINK) { // leave it be. just forget about the source sp_offset_quit_listening(offset); @@ -1148,13 +1148,13 @@ refresh_offset_source(SPOffset* offset) if ( offset == NULL ) return; offset->sourceDirty=false; Path *orig = NULL; - + // le mauvais cas: pas d'attribut d => il faut verifier que c'est une SPShape puis prendre le contour // The bad case: no d attribute. Must check that it's an SPShape and then take the outline. SPObject *refobj=offset->sourceObject; if ( refobj == NULL ) return; SPItem *item = SP_ITEM (refobj); - + SPCurve *curve=NULL; if (!SP_IS_SHAPE (item) && !SP_IS_TEXT (item)) return; if (SP_IS_SHAPE (item)) { @@ -1169,18 +1169,18 @@ refresh_offset_source(SPOffset* offset) } orig = bpath_to_liv_path (curve->bpath); sp_curve_unref (curve); - - + + // Finish up. { SPCSSAttr *css; const gchar *val; Shape *theShape = new Shape; Shape *theRes = new Shape; - + orig->ConvertWithBackData (1.0); orig->Fill (theShape, 0); - + css = sp_repr_css_attr (offset->sourceRepr , "style"); val = sp_repr_css_property (css, "fill-rule", NULL); if (val && strcmp (val, "nonzero") == 0) diff --git a/src/widgets/dash-selector.cpp b/src/widgets/dash-selector.cpp index 6274215cf..7b96451ac 100644 --- a/src/widgets/dash-selector.cpp +++ b/src/widgets/dash-selector.cpp @@ -116,7 +116,7 @@ sp_dash_selector_init (SPDashSelector *dsel) GtkWidget *sb = gtk_spin_button_new (GTK_ADJUSTMENT (dsel->offset), 0.1, 2); gtk_tooltips_set_tip (tt, sb, _("Pattern offset"), NULL); - sp_dialog_defocus_on_enter (sb); + sp_dialog_defocus_on_enter (sb); gtk_widget_show (sb); gtk_box_pack_start (GTK_BOX (dsel), sb, FALSE, FALSE, 0); gtk_signal_connect (dsel->offset, "value_changed", GTK_SIGNAL_FUNC (sp_dash_selector_offset_value_changed), dsel); @@ -264,7 +264,7 @@ sp_dash_selector_menu_item_new (SPDashSelector *dsel, double *pattern) // FIXME: all of the below twibblering is due to the limitations of gdk_gc_set_dashes (only integers, no zeroes). // Perhaps would make sense to rework this with manually drawn dashes. - + // Fill in the integer array of pixel-lengths, for display gint8 pixels_i[64]; gdouble pixels_d[64]; @@ -284,7 +284,7 @@ sp_dash_selector_menu_item_new (SPDashSelector *dsel, double *pattern) gdouble pixels = DASH_PREVIEW_WIDTH * pattern[i_s]; if (pixels > 0.0) - pixels_d [i_p] += pixels; + pixels_d [i_p] += pixels; else { if (i_p >= 1) { // dash is zero, skip this element in the array, and set pointer backwards so the next dash is added to the previous @@ -300,13 +300,13 @@ sp_dash_selector_menu_item_new (SPDashSelector *dsel, double *pattern) n_pixel_dashes = i_p; gdouble longest_dash = 0.0; - + // after summation, convert double dash lengths to ints for (i_p = 0; i_p < n_pixel_dashes; i_p ++) { pixels_i [i_p] = (gint8) (pixels_d [i_p] + 0.5); // zero-length dashes are already eliminated, so the <1 dash is short but not zero; // we approximate it with a one-pixel mark - if (pixels_i [i_p] < 1) + if (pixels_i [i_p] < 1) pixels_i [i_p] = 1; if (i_p % 2 == 0) { // it's a dash if (pixels_d [i_p] > longest_dash) @@ -329,21 +329,21 @@ sp_dash_selector_menu_item_new (SPDashSelector *dsel, double *pattern) } else if (all_odd_are_zero (pattern, n_source_dashes)) { // draw solid line, only dashes are non-zero gdk_gc_set_line_attributes (gc, DASH_PREVIEW_WIDTH, - GDK_LINE_SOLID, GDK_CAP_BUTT, + GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_draw_line (pixmap, gc, 4, 8, DASH_PREVIEW_LENGTH, 8); } else { // regular pattern with both gaps and dashes non-zero - gdk_gc_set_line_attributes (gc, DASH_PREVIEW_WIDTH, - GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, + gdk_gc_set_line_attributes (gc, DASH_PREVIEW_WIDTH, + GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_gc_set_dashes (gc, 0, pixels_i, n_pixel_dashes); gdk_draw_line (pixmap, gc, 4, 8, DASH_PREVIEW_LENGTH, 8); } } else { // no pattern, draw solid line - gdk_gc_set_line_attributes (gc, DASH_PREVIEW_WIDTH, - GDK_LINE_SOLID, GDK_CAP_BUTT, + gdk_gc_set_line_attributes (gc, DASH_PREVIEW_WIDTH, + GDK_LINE_SOLID, GDK_CAP_BUTT, GDK_JOIN_MITER); gdk_draw_line (pixmap, gc, 4, 8, DASH_PREVIEW_LENGTH, 8); } @@ -351,9 +351,9 @@ sp_dash_selector_menu_item_new (SPDashSelector *dsel, double *pattern) gdk_gc_unref (gc); GtkWidget *px = gtk_pixmap_new (pixmap, NULL); - + gdk_pixmap_unref (pixmap); - + gtk_widget_show (px); gtk_container_add (GTK_CONTAINER (mi), px); diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 5f09d6704..3177700c3 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -250,7 +250,7 @@ sp_gradient_selector_set_vector (SPGradientSelector *sel, SPDocument *doc, SPGra g_return_if_fail (!vector || (SP_OBJECT_DOCUMENT (vector) == doc)); if (vector && !SP_GRADIENT_HAS_STOPS (vector)) - return; + return; sp_gradient_vector_selector_set_gradient (SP_GRADIENT_VECTOR_SELECTOR (sel->vectors), doc, vector); diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 4aac04a3c..ccb36a3ec 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -482,7 +482,7 @@ select_stop_in_list( GtkWidget *mnu, SPGradient *gradient, SPStop *new_stop) if (SP_OBJECT (ochild) == SP_OBJECT(new_stop)) { gtk_option_menu_set_history (GTK_OPTION_MENU (mnu), i); break; - } + } i++; } } @@ -519,7 +519,7 @@ update_stop_list( GtkWidget *mnu, SPGradient *gradient, SPStop *new_stop) gtk_menu_append (GTK_MENU (m), i); gtk_widget_set_sensitive (mnu, FALSE); } else { - + for (; sl != NULL; sl = sl->next){ SPStop *stop; GtkWidget *i; @@ -596,7 +596,7 @@ sp_grad_edit_select (GtkOptionMenu *mnu, GtkWidget *tbl) SPStop *next = NULL; next = sp_next_stop(stop); - if (next != NULL ) { + if (next != NULL ) { adj->upper = next->offset; } else { isEndStop = true; @@ -663,7 +663,7 @@ sp_grd_ed_add_stop (GtkWidget *widget, GtkWidget *vb) SPStop *stop = (SPStop *) g_object_get_data (G_OBJECT(gtk_menu_get_active (GTK_MENU(gtk_option_menu_get_menu (mnu)))), "stop"); - if (stop == NULL) + if (stop == NULL) return; Inkscape::XML::Node *new_stop_repr = NULL; @@ -688,7 +688,7 @@ sp_grd_ed_add_stop (GtkWidget *widget, GtkWidget *vb) } SPStop *newstop = (SPStop *) SP_OBJECT_DOCUMENT(gradient)->getObjectByRepr(new_stop_repr); - + newstop->offset = (stop->offset + next->offset) * 0.5 ; guint32 const c1 = sp_stop_get_rgba32(stop); @@ -878,7 +878,7 @@ sp_gradient_vector_editor_new (SPGradient *gradient, SPStop *stop) w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } - if (x != 0 || y != 0) + if (x != 0 || y != 0) gtk_window_move ((GtkWindow *) dlg, x, y); else gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER); @@ -903,8 +903,8 @@ sp_gradient_vector_editor_new (SPGradient *gradient, SPStop *stop) gtk_container_add (GTK_CONTAINER (dlg), wid); } else { // FIXME: temp fix for 0.38 - // Simply load_gradient into the editor does not work for multi-stop gradients, - // as the stop list and other widgets are in a wrong state and crash readily. + // Simply load_gradient into the editor does not work for multi-stop gradients, + // as the stop list and other widgets are in a wrong state and crash readily. // Instead we just delete the window (by sending the delete signal) // and call sp_gradient_vector_editor_new again, so it creates the window anew. @@ -951,7 +951,7 @@ sp_gradient_vector_widget_load_gradient (GtkWidget *widget, SPGradient *gradient SPStop *stop = SP_STOP(g_object_get_data (G_OBJECT(gtk_menu_get_active (GTK_MENU(gtk_option_menu_get_menu (mnu)))), "stop")); guint32 const c = sp_stop_get_rgba32(stop); - /// get the color selector + /// get the color selector SPColorSelector *csel = SP_COLOR_SELECTOR(g_object_get_data (G_OBJECT (widget), "cselector")); // set alpha csel->base->setAlpha(SP_RGBA32_A_F (c)); diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index 8b0935e8d..f16bc5852 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -298,7 +298,7 @@ sp_paint_selector_new (bool is_fill) // This silliness is here because I don't know how to pass a parameter to the // GtkObject "constructor" (sp_paint_selector_init). Remove it when paint_selector // becomes a normal class. - sp_paint_selector_show_fillrule (psel, is_fill); + sp_paint_selector_show_fillrule (psel, is_fill); return GTK_WIDGET (psel); } @@ -480,7 +480,7 @@ static void sp_paint_selector_clear_frame(SPPaintSelector *psel) { g_return_if_fail ( psel != NULL); - + if (psel->selector) { /* before we destroy the frame contents, we must detach @@ -939,7 +939,7 @@ sp_style_determine_paint_selector_mode (SPStyle *style, bool isfill) case SP_PAINT_TYPE_PAINTSERVER: { SPPaintServer *server = isfill? SP_STYLE_FILL_SERVER (style) : SP_STYLE_STROKE_SERVER (style); - + if (SP_IS_LINEARGRADIENT (server)) { return SP_PAINT_SELECTOR_MODE_GRADIENT_LINEAR; } else if (SP_IS_RADIALGRADIENT (server)) { diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 9d92077da..c14d89f11 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -197,7 +197,7 @@ void ColorNotebook::init() SP_TYPE_COLOR_SCALES; SP_TYPE_COLOR_WHEEL_SELECTOR; - /* REJON: Comment out the next line to not use the normal GTK Color + /* REJON: Comment out the next line to not use the normal GTK Color wheel. */ // SP_TYPE_COLOR_GTKSELECTOR; @@ -245,7 +245,7 @@ void ColorNotebook::init() for ( i = 0; i < _trackerList->len; i++ ) { - SPColorNotebookTracker *entry = + SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (g_ptr_array_index (_trackerList, i)); if ( entry ) { @@ -300,7 +300,7 @@ void ColorNotebook::init() gtk_widget_show (align); gtk_container_add (GTK_CONTAINER (align), _btn); - // uncomment to reenable the "show/hide modes" menu, + // uncomment to reenable the "show/hide modes" menu, // but first fix it so it remembers its settings in prefs and does not take that much space (entire vertical column!) //gtk_table_attach (GTK_TABLE (table), align, 2, 3, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD); diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index c3bcefa49..ecec84979 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -1,8 +1,8 @@ #define __SPW_UTILITIES_C__ -/* +/* * Inkscape Widget Utilities - * + * * Authors: * Bryce W. Harrington * bulia byak @@ -23,8 +23,8 @@ #include "helper/unit-menu.h" -/** - * Creates a label widget with the given text, at the given col, row +/** + * Creates a label widget with the given text, at the given col, row * position in the table. */ GtkWidget * @@ -36,7 +36,7 @@ spw_label(GtkWidget * table, const gchar *label_text, int col, int row) g_assert(label_widget != NULL); gtk_misc_set_alignment (GTK_MISC (label_widget), 1.0, 0.5); gtk_widget_show (label_widget); - gtk_table_attach (GTK_TABLE (table), label_widget, col, col+1, row, row+1, + gtk_table_attach (GTK_TABLE (table), label_widget, col, col+1, row, row+1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0); return label_widget; } @@ -53,7 +53,7 @@ spw_hbox(GtkWidget * table, int width, int col, int row) hb = gtk_hbox_new (FALSE, 4); g_assert(hb != NULL); gtk_widget_show (hb); - gtk_table_attach (GTK_TABLE (table), hb, col, col+width, row, row+1, + gtk_table_attach (GTK_TABLE (table), hb, col, col+width, row, row+1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 0, 0); return hb; } @@ -132,7 +132,7 @@ spw_dropdown(GtkWidget * dialog, GtkWidget * table, spw_label(table, label_text, 0, row); gtk_widget_show (selector); - gtk_table_attach (GTK_TABLE (table), selector, 1, 2, row, row+1, + gtk_table_attach (GTK_TABLE (table), selector, 1, 2, row, row+1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 0, 0); gtk_object_set_data (GTK_OBJECT (dialog), key, selector); return selector; @@ -140,7 +140,7 @@ spw_dropdown(GtkWidget * dialog, GtkWidget * table, /** * Creates a unit selector widget, used for selecting whether one wishes - * to measure screen elements in millimeters, points, etc. This is a + * to measure screen elements in millimeters, points, etc. This is a * compound unit that includes a label as well as the dropdown selector. */ GtkWidget * @@ -166,7 +166,7 @@ spw_unit_selector(GtkWidget * dialog, GtkWidget * table, sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, 4); g_assert(sb != NULL); gtk_widget_show (sb); - gtk_table_attach (GTK_TABLE (table), sb, 1, 2, row, row+1, + gtk_table_attach (GTK_TABLE (table), sb, 1, 2, row, row+1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 0, 0); g_signal_connect (G_OBJECT (a), "value_changed", cb, dialog); return sb; @@ -216,7 +216,7 @@ sp_search_by_data_recursive (GtkWidget *w, gpointer key) r = gtk_object_get_data (GTK_OBJECT(w), (gchar *) key); } if (r) return r; - + if (GTK_IS_CONTAINER(w)) { GList *ch = gtk_container_get_children (GTK_CONTAINER(w)); for (GList *i = ch; i != NULL; i = i->next) { @@ -241,7 +241,7 @@ sp_search_by_value_recursive (GtkWidget *w, gchar *key, gchar *value) r = (gchar *) gtk_object_get_data (GTK_OBJECT(w), key); } if (r && !strcmp (r, value)) return w; - + if (GTK_IS_CONTAINER(w)) { GList *ch = gtk_container_get_children (GTK_CONTAINER(w)); for (GList *i = ch; i != NULL; i = i->next) {