summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de2259e)
raw | patch | inline | side by side (parent: de2259e)
author | rwst <rwst@users.sourceforge.net> | |
Mon, 13 Feb 2006 19:14:47 +0000 (19:14 +0000) | ||
committer | rwst <rwst@users.sourceforge.net> | |
Mon, 13 Feb 2006 19:14:47 +0000 (19:14 +0000) |
33 files changed:
index 72cae3c47ab89e7f9df2e00fe3c9a470d76920c8..084186bf6c6cc6609954d4b6379ec79d359e95f2 100644 (file)
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
wd.win = dlg = NULL;
wd.stop = 0;
-
+
}
static gboolean
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
)
{
}
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;
}
break;
- default:
+ default:
break;
}
return NR::identity();
}
-static bool
+static bool
clonetiler_is_a_clone_of (SPObject *tile, SPObject *obj)
{
char *id_href = NULL;
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);
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") &&
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 ++) {
// 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;
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;
double power;
if (gamma_picked < 0)
power = 1/(1 + fabs(gamma_picked));
- else
+ else
power = 1 + gamma_picked;
val = pow (val, power);
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) {
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));
}
{
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)
}
}
}
-
+
if (GTK_IS_CONTAINER(w)) {
GList *ch = gtk_container_get_children (GTK_CONTAINER(w));
for (GList *i = ch; i != NULL; i = i->next) {
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);
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) );
}
{
- 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, "%");
}
{
- 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, "%");
}
{
- 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);
}
{
- 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, "%");
}
{
- 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, "%");
}
{
- 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);
}
{
- 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);
}
{
- 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, "%");
}
{
- 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, "%");
}
{
- 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);
}
{
- 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, "%");
}
{
- 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, "%");
}
{
- 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);
}
{
- 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, "°");
}
{
- 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, "°");
}
{
- 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);
}
{
- 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);
}
{
- 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);
}
{
- 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);
}
{
- 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);
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);
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
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);
}
{
- // 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));
}
- // Switch
+ // Switch
GtkWidget* radio;
{
radio = gtk_radio_button_new_with_label (NULL, _("Rows, columns: "));
// Use saved pos
- {
+ {
GtkWidget *hb = gtk_hbox_new(FALSE, VB_MARGIN);
gtk_box_pack_start (GTK_BOX (mainbox), hb, FALSE, FALSE, 0);
gtk_widget_show_all (mainbox);
} // end of if (!dlg)
-
+
gtk_window_present ((GtkWindow *) dlg);
}
index 4e6a937292f6a86158b3c5e45f0e8837a556dd7f..deabcf3839438e6df6f64730e5e82079fbcf66f1 100644 (file)
/**
-* \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
//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);
}
void
sp_dialog_defocus_callback (GtkWindow *win, gpointer data)
{
- sp_dialog_defocus ((GtkWindow *)
+ sp_dialog_defocus ((GtkWindow *)
gtk_widget_get_toplevel ((GtkWidget *) 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 );
}
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;
gtk_main_do_event ((GdkEvent*)&event);
g_object_unref (G_OBJECT (event.window));
- ret = TRUE;
+ ret = TRUE;
}
break;
default: // pass keypress to the canvas
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
sp_dialog_hide (GtkObject *object, gpointer data)
{
GtkWidget *dlg = (GtkWidget *) data;
-
+
if (dlg)
gtk_widget_hide (dlg);
-
+
return TRUE;
}
if (dlg)
gtk_widget_show (dlg);
-
+
return TRUE;
}
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 9f758bf9e39dfe41914d1e3a24b70e1e39f9fd56..42a084dde51cf4e3a34084619e9f490e00f977e8 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
\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 )
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);
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;
gtk_label_set_mnemonic_widget (GTK_LABEL(l), sb);
}
- if (cb)
+ if (cb)
gtk_signal_connect (a, "value_changed", cb, dlg);
return;
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);
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
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);
{
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 );
}
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));
gtk_label_set_markup_with_mnemonic (GTK_LABEL(l), _(" <b>_Export</b> "));
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()
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])) {
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();
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);
}
}
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 );
}
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. */
// 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)) {
sp_export_value_set(base, "ydpi", ydpi);
}
}
-
+
return;
} // end of sp_export_area_toggled()
{
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
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);
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);
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)) {
break;
}
-
+
return;
} // end of sp_export_export_clicked()
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()
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) {
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");
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);
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");
sp_export_detect_size(base);
gtk_object_set_data (base, "update", GUINT_TO_POINTER (FALSE));
-
+
return;
} // end of sp_export_area_y_value_changed()
{
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");
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);
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");
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()
{
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");
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
{
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");
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);
}
index 1c151deebcb7d5f88d0a4f7e8b2e5536a4804738..2aaf6e6c26094f7c656072e21a4b4ba2df6ca58b 100644 (file)
sp_fill_style_widget_update (spw);
- }
+ }
} // end of sp_fill_style_widget_construct()
}
static void
-sp_fill_style_widget_change_subselection ( Inkscape::Application *inkscape,
+sp_fill_style_widget_change_subselection ( Inkscape::Application *inkscape,
SPDesktop *desktop,
SPWidget *spw )
{
// 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;
index a8031b13eb6f9bed49046ea2245930cc03731ee8..7a9b37dcf3acbeb1ad55c98ac3de9f54fe9ea231 100644 (file)
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);
/* 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);
/* 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);
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);
/* 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);
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);
/* 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);
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);
/* 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);
// 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);
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);
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);
} 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();
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;
}
gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE));
-
-
+
+
} // end of sp_item_widget_setup()
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();
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())) {
/**
- * \brief Dialog
+ * \brief 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);
GtkWidget *itemw = sp_item_widget_new ();
gtk_widget_show (itemw);
gtk_container_add (GTK_CONTAINER (dlg), itemw);
-
+
}
gtk_window_present ((GtkWindow *) dlg);
-}
+}
/*
index 05370d1d025ad1de1c6c472cd1dd77984e9ab8f0..b62287affd29445bfeb3319e98ba586b5aabbb5a 100644 (file)
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;
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);
index b4dcd4bce07f4f460f367c2920ad5e2fd079b3c9..8de2dedac5b01f4b784c50428c730258856e7213 100644 (file)
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";
{
if (!dlg) {
-
+
gchar title[500];
sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_TEXT), title);
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 );
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);
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);
{
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);
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);
}
}
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 {
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)) {
// 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);
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));
}
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");
}
} // end of if (docontent)
repr = SP_OBJECT_REPR (text);
-
+
} else {
gtk_widget_set_sensitive (textw, FALSE);
gtk_widget_set_sensitive (apply, FALSE);
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 ();
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 ();
static unsigned
sp_ted_get_selected_text_count (void)
{
- if (!SP_ACTIVE_DESKTOP)
+ if (!SP_ACTIVE_DESKTOP)
return 0;
unsigned int items = 0;
index a6434ae3d62d44aab60d4a45a102b8a63a5ce745..d85f777857147b70991852d9ac8cd8ead54856d1 100644 (file)
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
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;
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;y<ib;y++) {
for (int i = 0; i < 4; i++)
theI[i]->Reset();
-
+
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;
}
index d1d7221f00cd39608273fe7a2df95023b287b1f2..1c1171d35c0c474626f28ac626aada592f0ab71c 100644 (file)
@@ -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;
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);
}
}
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)) {
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;
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;i<tr;i++) {
for (int j=tt;j<tb;j++) {
canvas->tiles[(i-canvas->tLeft)+(j-canvas->tTop)*canvas->tileH]=1;
index 0a278bb6986fcfb884b9d0d0bfa1b659b50ec320..6715f890fc0ebd215b6640e9f6164c5da1dc855c 100644 (file)
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;
index e9488cdb5c3d54dd9e49fca55a6fc36ebbdf1b73..707d0e059947c1494939362e06e7be40d2720d94 100644 (file)
delete ctrlquadr->shp;
ctrlquadr->shp = NULL;
}
-
+
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
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;
}
}
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 d67572e9c7cd5c07e0f3da94afe83684972b416f..54b683bf4094536ae6c62d7f3ea44bc236c0ff21 100644 (file)
--- 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;
}
|| (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 : "" ),
* 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(
index 4aac7780af88a955335a163c6a1e35d0dad6d921..42b2205764ac527054698f319891c13110adce48 100644 (file)
\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
param_shared (const gchar * name, GSList * list)
{
Parameter * output;
-
+
if (name == NULL) {
throw Extension::param_not_exist();
}
Extension::get_param_string (const gchar * name, const Inkscape::XML::Document * doc)
{
Parameter * param;
-
+
param = param_shared(name, parameters);
return param->get_string(doc);
}
Extension::get_param_bool (const gchar * name, const Inkscape::XML::Document * doc)
{
Parameter * param;
-
+
param = param_shared(name, parameters);
return param->get_bool(doc);
}
Extension::get_param_int (const gchar * name, const Inkscape::XML::Document * doc)
{
Parameter * param;
-
+
param = param_shared(name, parameters);
return param->get_int(doc);
}
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);
index 0bc3267f4905f6905441c79edf67f1c012bbf189..aebc94b8d6176a1e9942d27867a05f12d9f431bf 100644 (file)
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.
index adeb36ef657107b5d137a7dd3437ceff633c98b5..6c6563e7ebd0f5ead2921cfc0214403e78c043c6 100644 (file)
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(),
PrintGNOME::init (void)
{
Inkscape::Extension::Extension * ext;
-
+
/* SVG in */
ext = Inkscape::Extension::build_from_mem(
"<inkscape-extension>\n"
index 76163ac49b5654ee2a7ed5cee417da7378105dbe..88da74a1dd689bc5fedc34b7727fc25d9faa7335 100644 (file)
@@ -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;
boolpntr = dynamic_cast<ParamBool *>(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. */
intpntr = dynamic_cast<ParamInt *>(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. */
floatpntr = dynamic_cast<ParamFloat *>(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. */
stringpntr = dynamic_cast<ParamString *>(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. */
boolpntr = dynamic_cast<ParamBool *>(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. */
intpntr = dynamic_cast<ParamInt *>(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. */
floatpntr = dynamic_cast<ParamFloat *>(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. */
stringpntr = dynamic_cast<ParamString *>(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. */
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;
};
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;
};
/**
\brief Creates a Float Adjustment for a float parameter
-
+
Builds a hbox with a label and a float adjustment in it.
*/
Gtk::Widget *
/**
\brief Creates a Int Adjustment for a int parameter
-
+
Builds a hbox with a label and a int adjustment in it.
*/
Gtk::Widget *
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.
*/
/**
\brief Creates a bool check button for a bool parameter
-
+
Builds a hbox with a label and a check button in it.
*/
Gtk::Widget *
/**
\brief Creates a text box for the string parameter
-
+
Builds a hbox with a label and a text box in it.
*/
Gtk::Widget *
ParamBool::string (void)
{
Glib::ustring * mystring;
-
- if (_value)
+
+ if (_value)
mystring = new Glib::ustring("true");
else
mystring = new Glib::ustring("false");
-
+
return mystring;
}
{
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 bd1ef6e31cfde05b6011de31633c8e4a4d6374b2..fffa0acdf77f68741850368dfa348952c2e8c346 100644 (file)
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
if (argc == 1) {
usage();
}
-
- struct SPSlideShow ss;
-
+
+ struct SPSlideShow ss;
+
GtkWidget *w;
int i;
textdomain (GETTEXT_PACKAGE);
LIBXML_TEST_VERSION
-
+
Inkscape::GC::init();
Inkscape::Preferences::loadSkeleton();
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 {
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();
/* 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;
#endif
}
}
-
+
if(!ss.doc)
return 1; /* none of the slides loadable */
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);
return NULL;
}
-static int
+static int
sp_svgview_show_next_cb (GtkWidget *widget, void *data)
{
sp_svgview_show_next(static_cast<struct SPSlideShow *>(data));
return FALSE;
}
-static int
+static int
sp_svgview_show_prev_cb (GtkWidget *widget, void *data)
{
sp_svgview_show_prev(static_cast<struct SPSlideShow *>(data));
return FALSE;
}
-static int
+static int
sp_svgview_goto_first_cb (GtkWidget *widget, void *data)
{
sp_svgview_goto_first(static_cast<struct SPSlideShow *>(data));
return FALSE;
}
-static int
+static int
sp_svgview_goto_last_cb (GtkWidget *widget, void *data)
{
sp_svgview_goto_last(static_cast<struct SPSlideShow *>(data));
static void usage()
{
- fprintf(stderr,
+ fprintf(stderr,
"Usage: inkview [FILES ...]\n"
"\twhere FILES are SVG (.svg or .svgz)"
#ifdef WITH_INKJAR
index 8eed6e84c99f4556ef94b7650d22e4e6c2bdf592..f0e9c5e4e09268f5e69d46c0d2d0e28d04a3df17 100644 (file)
--- 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 bda4012c7b832aa956b121898c206f1967d8870d..d5288117ca057b231fae1a3d322b95dbcdb6e29e 100644 (file)
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
} else {
sc->_seltrans->setShow(Inkscape::SelTrans::SHOW_CONTENT);
}
- }
+ }
}
static bool
return false;
}
-bool
+bool
key_is_a_modifier (guint key) {
return (key == GDK_Alt_L ||
key == GDK_Alt_R ||
index 0ba60a91cac30868e47ed6d025261d3e3b23fd5e..1587b27192938caabc2995bdf1ac5484e5b2ce4d 100644 (file)
@@ -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))
)
{
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));
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));
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]) {
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)) {
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);
sp_document_done(SP_DT_DOCUMENT (desktop));
}
-void sp_selection_to_next_layer ()
+void sp_selection_to_next_layer ()
{
SPDesktop *dt = SP_ACTIVE_DESKTOP;
g_slist_free ((GSList *) items);
}
-void sp_selection_to_prev_layer ()
+void sp_selection_to_prev_layer ()
{
SPDesktop *dt = SP_ACTIVE_DESKTOP;
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);
bool only_in_viewport, bool inlayer, bool onlyvisible, bool onlysensitive);
template <typename D>
-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 {
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);
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);
// 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 5d61d543b08bf97b368fd68ce069ca29c0cd7748..4b93f7cf03d723640c400c8a84712330d096b579 100644 (file)
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
GType sp_anchor_get_type(void)
{
static GType type = 0;
-
+
if (!type) {
GTypeInfo info = {
sizeof(SPAnchorClass),
};
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;
static gint sp_anchor_event(SPItem *item, SPEvent *event)
{
SPAnchor *anchor = SP_ANCHOR(item);
-
+
switch (event->type) {
case SP_EVENT_ACTIVATE:
if (anchor->href) {
default:
break;
}
-
+
return FALSE;
}
diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp
index 61a5ec430064d56d5fbbc74d0292d4259817a690..cc04055410ad8b2f3baf167618fb104b5fc14602 100644 (file)
--- a/src/sp-flowdiv.cpp
+++ b/src/sp-flowdiv.cpp
{
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;
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));
{
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));
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;
}
}
}
-
+
if (((SPObjectClass *) (flowdiv_parent_class))->write)
((SPObjectClass *) (flowdiv_parent_class))->write (object, repr, flags);
-
+
return repr;
}
{
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;
// 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));
{
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));
}
}
}
-
+
if (((SPObjectClass *) (flowtspan_parent_class))->write)
((SPObjectClass *) (flowtspan_parent_class))->write (object, repr, flags);
-
+
return repr;
}
{
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;
{
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));
{
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));
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;
}
}
}
-
+
if (((SPObjectClass *) (flowpara_parent_class))->write)
((SPObjectClass *) (flowpara_parent_class))->write (object, repr, flags);
-
+
return repr;
}
{
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;
{
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;
}
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;
}
{
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;
{
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 4071e4d92610d7068476576ea54d23590e942aee..5c01483c8f36ed762eb3bbba59eeeb13f02e8740 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
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;
}
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);
}
{
if (((SPObjectClass *) (flowregion_parent_class))->remove_child)
(* ((SPObjectClass *) (flowregion_parent_class))->remove_child) (object, child);
-
+
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
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));
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<Shape*>::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);
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));
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;
}
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);
}
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));
}
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;
} 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 900a3dffc8a8bc2939805503bb108489c4dd2154..f54e60dab578434ba9160f32a9f2d75e044c494e 100644 (file)
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
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);
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 86998156720ec511c979cf1196e719436ee78c0b..19b9b19a79c0fe587f7988a5a574ac23c0421035 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
//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");
}
}
"unknown", // PNG_SCALE_UNKNOWN
"meter", // PNG_SCALE_METER
"radian", // PNG_SCALE_RADIAN
- "last", //
+ "last", //
NULL
};
}
}
}
-
+
sp_image_update_canvas_image ((SPImage *) object);
}
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 c093c569bf19059a01a6f6e74465d2fe9e9cb8bb..a2be6daf427e8f05d9b81a00435f5ce9cfc41def 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
// 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;
* 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 5c79eb3342e8581624bae6c04f2302eb8515b0d8..a9730653c247e4ac11f3118113197c9bc2aea9c9 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
// 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;
sp_offset_get_type (void)
{
static GType offset_type = 0;
-
+
if (!offset_type)
{
GTypeInfo offset_info = {
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;
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;
}
sp_offset_finalize(GObject *obj)
{
SPOffset *offset = (SPOffset *) obj;
-
+
delete offset->sourceRef;
offset->_delete_connection.~connection();
offset->_changed_connection.~connection();
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
}
- // 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));
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;
}
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);
}
-
+
}
/**
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)
{
}
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);
}
sp_shape_set_shape ((SPShape *) object);
}
offset->isUpdating=false;
-
+
if (((SPObjectClass *) parent_class)->update)
((SPObjectClass *) parent_class)->update (object, ctx, flags);
}
bool closed = false;
float lastX = 0.0;
float lastY = 0.0;
-
+
for (i = 0; bpath[i].code != NR_END; i++)
{
switch (bpath[i].code)
dest->LineTo (tmp);
}
break;
-
+
case NR_CURVETO:
{
NR::Point tmp(bpath[i].x3, bpath[i].y3);
lastX = bpath[i].x3;
lastY = bpath[i].y3;
break;
-
+
case NR_MOVETO_OPEN:
case NR_MOVETO:
if (closed)
if (closed)
dest->Close ();
}
-
+
return dest;
}
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;
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);
}
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;
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);
res->Fill (theShape, 0);
theRes->ConvertToShape (theShape, fill_positive);
originaux[0] = res;
-
+
theRes->ConvertToForme (orig, 1, originaux);
SPItem *item = 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
// orig->ConvertEvenLines (o_width);
// orig->Simplify (0.5 * o_width);
// }
-
+
delete theShape;
delete theRes;
delete res;
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;
oneCleanPart->MakeOffset(onePart,-offset->rad,join_round,20.0);
onePart->ConvertToShape(oneCleanPart,fill_positive);
// for (int j=0;j<onePart->nbAr;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;
parts[i]=NULL;
} else {
}
-
+
/* int firstP=theShape->nbPt;
for (int j=0;j<onePart->nbPt;j++) theShape->AddPoint(onePart->pts[j].x);
for (int j=0;j<onePart->nbAr;j++) theShape->AddEdge(firstP+onePart->aretes[j].en,firstP+onePart->aretes[j].st);*/
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);
}
}
}
}
// theRes->ConvertToShape (theShape, fill_positive);
// theRes->ConvertToForme (orig);
-
+
/* if (o_width >= 1.0) {
orig->ConvertEvenLines (1.0);
orig->Simplify (1.0);
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)
}
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);
}
}
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;
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;
((Path *) offset->originalPath)->Convert (1.0);
((Path *) offset->originalPath)->Fill (theShape, 0);
theRes->ConvertToShape (theShape, fill_oddEven);
-
+
if (theRes->numberOfEdges() <= 1)
{
-
+
}
else
{
{
nex = -nex;
}
-
+
if (vectors_are_clockwise (nex, nx, prx))
{
// we're in that angle. set the sign, and exit that loop
dist = arDist;
}
}
-
+
delete theShape;
delete theRes;
-
+
return dist;
}
(*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)
{
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);
// the listening functions
static void sp_offset_start_listening(SPOffset *offset,SPObject* to)
{
- if ( to == NULL )
+ if ( to == NULL )
return;
offset->sourceObject = 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;
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);
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)) {
}
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)
index 6274215cfd413c8ccaec71eae5ce659acc67465a..7b96451ac211b2547472d8a9453193713a1e5949 100644 (file)
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);
// 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];
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
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)
} 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);
}
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);
index 5f09d670495774ece2267110728c469394e05d0c..3177700c3601c9f35f127b3c12960bafa97428f4 100644 (file)
@@ -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);
index 4aac04a3c4371c8ade28406c6e78b75102d34cb1..ccb36a3ec6bc0798787de7dc020249e5f9727fb8 100644 (file)
if (SP_OBJECT (ochild) == SP_OBJECT(new_stop)) {
gtk_option_menu_set_history (GTK_OPTION_MENU (mnu), i);
break;
- }
+ }
i++;
}
}
gtk_menu_append (GTK_MENU (m), i);
gtk_widget_set_sensitive (mnu, FALSE);
} else {
-
+
for (; sl != NULL; sl = sl->next){
SPStop *stop;
GtkWidget *i;
SPStop *next = NULL;
next = sp_next_stop(stop);
- if (next != NULL ) {
+ if (next != NULL ) {
adj->upper = next->offset;
} else {
isEndStop = true;
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;
}
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);
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);
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));
index 8b0935e8df38d605b564508471e1441127b8a352..f16bc585265d7b5d2fc7cb3222bdce2064078f7d 100644 (file)
// 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);
}
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
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)) {
index 9d92077da478c1b85469b154c20c3eea852e7d31..c14d89f1142e8dc9696a948190857b4611afe187 100644 (file)
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;
for ( i = 0; i < _trackerList->len; i++ )
{
- SPColorNotebookTracker *entry =
+ SPColorNotebookTracker *entry =
reinterpret_cast< SPColorNotebookTracker* > (g_ptr_array_index (_trackerList, i));
if ( entry )
{
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);
index c3bcefa4950b7c4b9a7df87369ac6a139835f1b8..ecec849796ae39937a19ee16159e285dd4cabc25 100644 (file)
#define __SPW_UTILITIES_C__
-/*
+/*
* Inkscape Widget Utilities
- *
+ *
* Authors:
* Bryce W. Harrington <brycehar@bryceharrington.com>
* bulia byak <buliabyak@users.sf.net>
#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 *
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;
}
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;
}
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;
/**
* 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 *
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;
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) {
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) {