diff options
Diffstat (limited to 'src/dialogs/clonetiler.cpp')
| -rw-r--r-- | src/dialogs/clonetiler.cpp | 260 |
1 files changed, 129 insertions, 131 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index c27c2b666..ce0fc15df 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -68,7 +68,7 @@ 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 gchar const *prefs_path = "dialogs.clonetiler"; +static Glib::ustring const prefs_path = "/dialogs/clonetiler/"; #define SB_MARGIN 1 #define VB_MARGIN 4 @@ -125,10 +125,10 @@ clonetiler_dialog_delete (GtkObject */*object*/, GdkEvent * /*event*/, gpointer if (y<0) y=0; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt(prefs_path, "x", x); - prefs->setInt(prefs_path, "y", y); - prefs->setInt(prefs_path, "w", w); - prefs->setInt(prefs_path, "h", h); + prefs->setInt(prefs_path + "x", x); + prefs->setInt(prefs_path + "y", y); + prefs->setInt(prefs_path + "w", w); + prefs->setInt(prefs_path + "h", h); return FALSE; // which means, go ahead and destroy it @@ -151,7 +151,7 @@ on_picker_color_changed (guint rgba) gchar c[32]; sp_svg_write_color(c, sizeof(c), rgba); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setString(prefs_path, "initial_color", c); + prefs->setString(prefs_path + "initial_color", c); is_updating = false; } @@ -1134,89 +1134,87 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) clonetiler_remove (NULL, NULL, false); - double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "shiftx_per_i", 0, -10000, 10000); - double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "shifty_per_i", 0, -10000, 10000); - double shiftx_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "shiftx_per_j", 0, -10000, 10000); - double shifty_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "shifty_per_j", 0, -10000, 10000); - double shiftx_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "shiftx_rand", 0, 0, 1000); - double shifty_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "shifty_rand", 0, 0, 1000); - double shiftx_exp = prefs->getDoubleLimited(prefs_path, "shiftx_exp", 1, 0, 10); - double shifty_exp = prefs->getDoubleLimited(prefs_path, "shifty_exp", 1, 0, 10); - bool shiftx_alternate = prefs->getBool(prefs_path, "shiftx_alternate"); - bool shifty_alternate = prefs->getBool(prefs_path, "shifty_alternate"); - bool shiftx_cumulate = prefs->getBool(prefs_path, "shiftx_cumulate"); - bool shifty_cumulate = prefs->getBool(prefs_path, "shifty_cumulate"); - bool shiftx_excludew = prefs->getBool(prefs_path, "shiftx_excludew"); - bool shifty_excludeh = prefs->getBool(prefs_path, "shifty_excludeh"); - - double scalex_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "scalex_per_i", 0, -100, 1000); - double scaley_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "scaley_per_i", 0, -100, 1000); - double scalex_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "scalex_per_j", 0, -100, 1000); - double scaley_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "scaley_per_j", 0, -100, 1000); - double scalex_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "scalex_rand", 0, 0, 1000); - double scaley_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "scaley_rand", 0, 0, 1000); - double scalex_exp = prefs->getDoubleLimited(prefs_path, "scalex_exp", 1, 0, 10); - double scaley_exp = prefs->getDoubleLimited(prefs_path, "scaley_exp", 1, 0, 10); - double scalex_log = prefs->getDoubleLimited(prefs_path, "scalex_log", 0, 0, 10); - double scaley_log = prefs->getDoubleLimited(prefs_path, "scaley_log", 0, 0, 10); - bool scalex_alternate = prefs->getBool(prefs_path, "scalex_alternate"); - bool scaley_alternate = prefs->getBool(prefs_path, "scaley_alternate"); - bool scalex_cumulate = prefs->getBool(prefs_path, "scalex_cumulate"); - bool scaley_cumulate = prefs->getBool(prefs_path, "scaley_cumulate"); - - double rotate_per_i = prefs->getDoubleLimited(prefs_path, "rotate_per_i", 0, -180, 180); - double rotate_per_j = prefs->getDoubleLimited(prefs_path, "rotate_per_j", 0, -180, 180); - double rotate_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "rotate_rand", 0, 0, 100); - bool rotate_alternatei = prefs->getBool(prefs_path, "rotate_alternatei"); - bool rotate_alternatej = prefs->getBool(prefs_path, "rotate_alternatej"); - bool rotate_cumulatei = prefs->getBool(prefs_path, "rotate_cumulatei"); - bool rotate_cumulatej = prefs->getBool(prefs_path, "rotate_cumulatej"); - - double blur_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "blur_per_i", 0, 0, 100); - double blur_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "blur_per_j", 0, 0, 100); - bool blur_alternatei = prefs->getBool(prefs_path, "blur_alternatei"); - bool blur_alternatej = prefs->getBool(prefs_path, "blur_alternatej"); - double blur_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "blur_rand", 0, 0, 100); - - double opacity_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "opacity_per_i", 0, 0, 100); - double opacity_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "opacity_per_j", 0, 0, 100); - bool opacity_alternatei = prefs->getBool(prefs_path, "opacity_alternatei"); - bool opacity_alternatej = prefs->getBool(prefs_path, "opacity_alternatej"); - double opacity_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "opacity_rand", 0, 0, 100); - - Glib::ustring initial_color = prefs->getString(prefs_path, "initial_color"); - double hue_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "hue_per_j", 0, -100, 100); - double hue_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "hue_per_i", 0, -100, 100); - double hue_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "hue_rand", 0, 0, 100); - double saturation_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "saturation_per_j", 0, -100, 100); - double saturation_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "saturation_per_i", 0, -100, 100); - double saturation_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "saturation_rand", 0, 0, 100); - double lightness_per_j = 0.01 * prefs->getDoubleLimited(prefs_path, "lightness_per_j", 0, -100, 100); - double lightness_per_i = 0.01 * prefs->getDoubleLimited(prefs_path, "lightness_per_i", 0, -100, 100); - double lightness_rand = 0.01 * prefs->getDoubleLimited(prefs_path, "lightness_rand", 0, 0, 100); - bool color_alternatej = prefs->getBool(prefs_path, "color_alternatej"); - bool color_alternatei = prefs->getBool(prefs_path, "color_alternatei"); - - int type = prefs->getInt(prefs_path, "symmetrygroup", 0); - - bool keepbbox = prefs->getBool(prefs_path, "keepbbox", true); - - int imax = prefs->getInt(prefs_path, "imax", 2); - int jmax = prefs->getInt(prefs_path, "jmax", 2); - - bool fillrect = prefs->getBool(prefs_path, "fillrect"); - double fillwidth = prefs->getDoubleLimited(prefs_path, "fillwidth", 50, 0, 1e6); - double fillheight = prefs->getDoubleLimited(prefs_path, "fillheight", 50, 0, 1e6); - - bool dotrace = prefs->getBool(prefs_path, "dotrace"); - int pick = prefs->getInt(prefs_path, "pick"); - bool pick_to_presence = prefs->getBool(prefs_path, "pick_to_presence"); - bool pick_to_size = prefs->getBool(prefs_path, "pick_to_size"); - bool pick_to_color = prefs->getBool(prefs_path, "pick_to_color"); - bool pick_to_opacity = prefs->getBool(prefs_path, "pick_to_opacity"); - double rand_picked = 0.01 * prefs->getDoubleLimited(prefs_path, "rand_picked", 0, 0, 100); - bool invert_picked = prefs->getBool(prefs_path, "invert_picked"); - double gamma_picked = prefs->getDoubleLimited(prefs_path, "gamma_picked", 0, -10, 10); + double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_i", 0, -10000, 10000); + double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_i", 0, -10000, 10000); + double shiftx_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_j", 0, -10000, 10000); + double shifty_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_j", 0, -10000, 10000); + double shiftx_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_rand", 0, 0, 1000); + double shifty_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_rand", 0, 0, 1000); + double shiftx_exp = prefs->getDoubleLimited(prefs_path + "shiftx_exp", 1, 0, 10); + double shifty_exp = prefs->getDoubleLimited(prefs_path + "shifty_exp", 1, 0, 10); + bool shiftx_alternate = prefs->getBool(prefs_path + "shiftx_alternate"); + bool shifty_alternate = prefs->getBool(prefs_path + "shifty_alternate"); + bool shiftx_cumulate = prefs->getBool(prefs_path + "shiftx_cumulate"); + bool shifty_cumulate = prefs->getBool(prefs_path + "shifty_cumulate"); + bool shiftx_excludew = prefs->getBool(prefs_path + "shiftx_excludew"); + bool shifty_excludeh = prefs->getBool(prefs_path + "shifty_excludeh"); + + double scalex_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "scalex_per_i", 0, -100, 1000); + double scaley_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "scaley_per_i", 0, -100, 1000); + double scalex_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "scalex_per_j", 0, -100, 1000); + double scaley_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "scaley_per_j", 0, -100, 1000); + double scalex_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "scalex_rand", 0, 0, 1000); + double scaley_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "scaley_rand", 0, 0, 1000); + double scalex_exp = prefs->getDoubleLimited(prefs_path + "scalex_exp", 1, 0, 10); + double scaley_exp = prefs->getDoubleLimited(prefs_path + "scaley_exp", 1, 0, 10); + double scalex_log = prefs->getDoubleLimited(prefs_path + "scalex_log", 0, 0, 10); + double scaley_log = prefs->getDoubleLimited(prefs_path + "scaley_log", 0, 0, 10); + bool scalex_alternate = prefs->getBool(prefs_path + "scalex_alternate"); + bool scaley_alternate = prefs->getBool(prefs_path + "scaley_alternate"); + bool scalex_cumulate = prefs->getBool(prefs_path + "scalex_cumulate"); + bool scaley_cumulate = prefs->getBool(prefs_path + "scaley_cumulate"); + + double rotate_per_i = prefs->getDoubleLimited(prefs_path + "rotate_per_i", 0, -180, 180); + double rotate_per_j = prefs->getDoubleLimited(prefs_path + "rotate_per_j", 0, -180, 180); + double rotate_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "rotate_rand", 0, 0, 100); + bool rotate_alternatei = prefs->getBool(prefs_path + "rotate_alternatei"); + bool rotate_alternatej = prefs->getBool(prefs_path + "rotate_alternatej"); + bool rotate_cumulatei = prefs->getBool(prefs_path + "rotate_cumulatei"); + bool rotate_cumulatej = prefs->getBool(prefs_path + "rotate_cumulatej"); + + double blur_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "blur_per_i", 0, 0, 100); + double blur_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "blur_per_j", 0, 0, 100); + bool blur_alternatei = prefs->getBool(prefs_path + "blur_alternatei"); + bool blur_alternatej = prefs->getBool(prefs_path + "blur_alternatej"); + double blur_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "blur_rand", 0, 0, 100); + + double opacity_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "opacity_per_i", 0, 0, 100); + double opacity_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "opacity_per_j", 0, 0, 100); + bool opacity_alternatei = prefs->getBool(prefs_path + "opacity_alternatei"); + bool opacity_alternatej = prefs->getBool(prefs_path + "opacity_alternatej"); + double opacity_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "opacity_rand", 0, 0, 100); + + Glib::ustring initial_color = prefs->getString(prefs_path + "initial_color"); + double hue_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "hue_per_j", 0, -100, 100); + double hue_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "hue_per_i", 0, -100, 100); + double hue_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "hue_rand", 0, 0, 100); + double saturation_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "saturation_per_j", 0, -100, 100); + double saturation_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "saturation_per_i", 0, -100, 100); + double saturation_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "saturation_rand", 0, 0, 100); + double lightness_per_j = 0.01 * prefs->getDoubleLimited(prefs_path + "lightness_per_j", 0, -100, 100); + double lightness_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "lightness_per_i", 0, -100, 100); + double lightness_rand = 0.01 * prefs->getDoubleLimited(prefs_path + "lightness_rand", 0, 0, 100); + bool color_alternatej = prefs->getBool(prefs_path + "color_alternatej"); + bool color_alternatei = prefs->getBool(prefs_path + "color_alternatei"); + + int type = prefs->getInt(prefs_path + "symmetrygroup", 0); + bool keepbbox = prefs->getBool(prefs_path + "keepbbox", true); + int imax = prefs->getInt(prefs_path + "imax", 2); + int jmax = prefs->getInt(prefs_path + "jmax", 2); + + bool fillrect = prefs->getBool(prefs_path + "fillrect"); + double fillwidth = prefs->getDoubleLimited(prefs_path + "fillwidth", 50, 0, 1e6); + double fillheight = prefs->getDoubleLimited(prefs_path + "fillheight", 50, 0, 1e6); + + bool dotrace = prefs->getBool(prefs_path + "dotrace"); + int pick = prefs->getInt(prefs_path + "pick"); + bool pick_to_presence = prefs->getBool(prefs_path + "pick_to_presence"); + bool pick_to_size = prefs->getBool(prefs_path + "pick_to_size"); + bool pick_to_color = prefs->getBool(prefs_path + "pick_to_color"); + bool pick_to_opacity = prefs->getBool(prefs_path + "pick_to_opacity"); + double rand_picked = 0.01 * prefs->getDoubleLimited(prefs_path + "rand_picked", 0, 0, 100); + bool invert_picked = prefs->getBool(prefs_path + "invert_picked"); + double gamma_picked = prefs->getDoubleLimited(prefs_path + "gamma_picked", 0, -10, 10); if (dotrace) { clonetiler_trace_setup (sp_desktop_document(desktop), 1.0, SP_ITEM (obj)); @@ -1245,7 +1243,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) x0 = sp_repr_get_double_attribute (obj_repr, "inkscape:tile-x0", 0); y0 = sp_repr_get_double_attribute (obj_repr, "inkscape:tile-y0", 0); } else { - bool prefs_bbox = prefs->getBool("tools", "bounding_box", false); + bool prefs_bbox = prefs->getBool("/tools/bounding_box", false); SPItem::BBoxType bbox_type = ( prefs_bbox ? SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX ); boost::optional<Geom::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)), @@ -1546,7 +1544,7 @@ clonetiler_checkbox_toggled (GtkToggleButton *tb, gpointer *data) { const gchar *attr = (const gchar *) data; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool(prefs_path, attr, gtk_toggle_button_get_active(tb)); + prefs->setBool(prefs_path + attr, gtk_toggle_button_get_active(tb)); } static GtkWidget * @@ -1558,7 +1556,7 @@ clonetiler_checkbox (GtkTooltips *tt, const char *tip, const char *attr) gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, tip, NULL); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - bool value = prefs->getBool(prefs_path, attr); + bool value = prefs->getBool(prefs_path + attr); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(b), value); gtk_box_pack_end (GTK_BOX (hb), b, FALSE, TRUE, 0); @@ -1576,7 +1574,7 @@ clonetiler_value_changed (GtkAdjustment *adj, gpointer data) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); const gchar *pref = (const gchar *) data; - prefs->setDouble(prefs_path, pref, adj->value); + prefs->setDouble(prefs_path + pref, adj->value); } static GtkWidget * @@ -1602,7 +1600,7 @@ clonetiler_spinbox (GtkTooltips *tt, const char *tip, const char *attr, double l gtk_box_pack_start (GTK_BOX (hb), sb, FALSE, FALSE, SB_MARGIN); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - double value = prefs->getDoubleLimited(prefs_path, attr, exponent? 1.0 : 0.0, lower, upper); + double value = prefs->getDoubleLimited(prefs_path + attr, exponent? 1.0 : 0.0, lower, upper); gtk_adjustment_set_value (GTK_ADJUSTMENT (a), value); gtk_signal_connect(GTK_OBJECT(a), "value_changed", GTK_SIGNAL_FUNC(clonetiler_value_changed), (gpointer) attr); @@ -1628,7 +1626,7 @@ clonetiler_symgroup_changed( GtkMenuItem */*item*/, gpointer data ) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gint group_new = GPOINTER_TO_INT (data); - prefs->setInt(prefs_path, "symmetrygroup", group_new); + prefs->setInt(prefs_path + "symmetrygroup", group_new); } static void @@ -1636,14 +1634,14 @@ clonetiler_xy_changed (GtkAdjustment *adj, gpointer data) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); const gchar *pref = (const gchar *) data; - prefs->setInt(prefs_path, pref, (int) floor(adj->value + 0.5)); + prefs->setInt(prefs_path + pref, (int) floor(adj->value + 0.5)); } static void clonetiler_keep_bbox_toggled( GtkToggleButton *tb, gpointer /*data*/ ) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool(prefs_path, "keepbbox", gtk_toggle_button_get_active(tb)); + prefs->setBool(prefs_path + "keepbbox", gtk_toggle_button_get_active(tb)); } static void @@ -1651,7 +1649,7 @@ clonetiler_pick_to (GtkToggleButton *tb, gpointer data) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); const gchar *pref = (const gchar *) data; - prefs->setBool(prefs_path, pref, gtk_toggle_button_get_active(tb)); + prefs->setBool(prefs_path + pref, gtk_toggle_button_get_active(tb)); } @@ -1752,7 +1750,7 @@ clonetiler_pick_switched( GtkToggleButton */*tb*/, gpointer data ) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); guint v = GPOINTER_TO_INT (data); - prefs->setInt(prefs_path, "pick", v); + prefs->setInt(prefs_path + "pick", v); } @@ -1770,7 +1768,7 @@ clonetiler_switch_to_create( GtkToggleButton */*tb*/, GtkWidget *dlg ) } Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool(prefs_path, "fillrect", false); + prefs->setBool(prefs_path + "fillrect", false); } @@ -1788,7 +1786,7 @@ clonetiler_switch_to_fill( GtkToggleButton */*tb*/, GtkWidget *dlg ) } Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool(prefs_path, "fillrect", true); + prefs->setBool(prefs_path + "fillrect", true); } @@ -1802,7 +1800,7 @@ clonetiler_fill_width_changed (GtkAdjustment *adj, GtkWidget *u) gdouble const pixels = sp_units_get_pixels (raw_dist, unit); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble(prefs_path, "fillwidth", pixels); + prefs->setDouble(prefs_path + "fillwidth", pixels); } static void @@ -1813,7 +1811,7 @@ clonetiler_fill_height_changed (GtkAdjustment *adj, GtkWidget *u) gdouble const pixels = sp_units_get_pixels (raw_dist, unit); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble(prefs_path, "fillheight", pixels); + prefs->setDouble(prefs_path + "fillheight", pixels); } @@ -1823,7 +1821,7 @@ clonetiler_do_pick_toggled( GtkToggleButton *tb, gpointer /*data*/ ) GtkWidget *vvb = (GtkWidget *) g_object_get_data (G_OBJECT(dlg), "dotrace"); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool(prefs_path, "dotrace", gtk_toggle_button_get_active (tb)); + prefs->setBool(prefs_path + "dotrace", gtk_toggle_button_get_active (tb)); if (vvb) gtk_widget_set_sensitive (vvb, gtk_toggle_button_get_active (tb)); @@ -1843,13 +1841,13 @@ clonetiler_dialog (void) dlg = sp_window_new (title, TRUE); if (x == -1000 || y == -1000) { - x = prefs->getInt(prefs_path, "x", -1000); - y = prefs->getInt(prefs_path, "y", -1000); + x = prefs->getInt(prefs_path + "x", -1000); + y = prefs->getInt(prefs_path + "y", -1000); } if (w ==0 || h == 0) { - w = prefs->getInt(prefs_path, "w", 0); - h = prefs->getInt(prefs_path, "h", 0); + w = prefs->getInt(prefs_path + "w", 0); + h = prefs->getInt(prefs_path + "h", 0); } // if (x<0) x=0; @@ -1913,7 +1911,7 @@ clonetiler_dialog (void) gtk_box_pack_start (GTK_BOX (vb), om, FALSE, FALSE, SB_MARGIN); GtkWidget *m = gtk_menu_new (); - int current = prefs->getInt(prefs_path, "symmetrygroup", 0); + int current = prefs->getInt(prefs_path + "symmetrygroup", 0); struct SymGroups { int group; @@ -2461,7 +2459,7 @@ clonetiler_dialog (void) GtkWidget *l = gtk_label_new (_("Initial color: ")); gtk_box_pack_start (GTK_BOX (hb), l, FALSE, FALSE, 0); - guint32 rgba = 0x000000ff | sp_svg_read_color (prefs->getString(prefs_path, "initial_color").data(), 0x000000ff); + guint32 rgba = 0x000000ff | sp_svg_read_color (prefs->getString(prefs_path + "initial_color").data(), 0x000000ff); color_picker = new Inkscape::UI::Widget::ColorPicker (*new Glib::ustring(_("Initial color of tiled clones")), *new Glib::ustring(_("Initial color for clones (works only if the original has unset fill or stroke)")), rgba, false); _color_changed_connection = color_picker->connectChanged (sigc::ptr_fun(on_picker_color_changed)); @@ -2593,7 +2591,7 @@ clonetiler_dialog (void) GtkWidget *b = gtk_check_button_new_with_label (_("Trace the drawing under the tiles")); g_object_set_data (G_OBJECT(b), "uncheckable", GINT_TO_POINTER(TRUE)); - bool old = prefs->getBool(prefs_path, "dotrace"); + bool old = prefs->getBool(prefs_path + "dotrace"); gtk_toggle_button_set_active ((GtkToggleButton *) b, old); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("For each clone, pick a value from the drawing in that clone's location and apply it to the clone"), NULL); gtk_box_pack_start (GTK_BOX (hb), b, FALSE, FALSE, 0); @@ -2625,7 +2623,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 1, 1); 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->getInt(prefs_path, "pick", 0) == PICK_COLOR); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_COLOR); } { radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("Opacity")); @@ -2633,7 +2631,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 2, 1); 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->getInt(prefs_path, "pick", 0) == PICK_OPACITY); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_OPACITY); } { radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("R")); @@ -2641,7 +2639,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 1, 2); 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->getInt(prefs_path, "pick", 0) == PICK_R); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_R); } { radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("G")); @@ -2649,7 +2647,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 2, 2); 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->getInt(prefs_path, "pick", 0) == PICK_G); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_G); } { radio = gtk_radio_button_new_with_label (gtk_radio_button_group (GTK_RADIO_BUTTON (radio)), _("B")); @@ -2657,7 +2655,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 3, 2); 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->getInt(prefs_path, "pick", 0) == PICK_B); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_B); } { //TRANSLATORS: only translate "string" in "context|string". @@ -2667,7 +2665,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 1, 3); 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->getInt(prefs_path, "pick", 0) == PICK_H); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_H); } { //TRANSLATORS: only translate "string" in "context|string". @@ -2677,7 +2675,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 2, 3); 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->getInt(prefs_path, "pick", 0) == PICK_S); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_S); } { //TRANSLATORS: only translate "string" in "context|string". @@ -2687,7 +2685,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 3, 3); 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->getInt(prefs_path, "pick", 0) == PICK_L); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), prefs->getInt(prefs_path + "pick", 0) == PICK_L); } } @@ -2748,7 +2746,7 @@ clonetiler_dialog (void) { GtkWidget *b = gtk_check_button_new_with_label (_("Presence")); - bool old = prefs->getBool(prefs_path, "pick_to_presence", true); + bool old = prefs->getBool(prefs_path + "pick_to_presence", true); gtk_toggle_button_set_active ((GtkToggleButton *) b, old); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Each clone is created with the probability determined by the picked value in that point"), NULL); clonetiler_table_attach (table, b, 0.0, 1, 1); @@ -2758,7 +2756,7 @@ clonetiler_dialog (void) { GtkWidget *b = gtk_check_button_new_with_label (_("Size")); - bool old = prefs->getBool(prefs_path, "pick_to_size"); + bool old = prefs->getBool(prefs_path + "pick_to_size"); gtk_toggle_button_set_active ((GtkToggleButton *) b, old); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Each clone's size is determined by the picked value in that point"), NULL); clonetiler_table_attach (table, b, 0.0, 2, 1); @@ -2768,7 +2766,7 @@ clonetiler_dialog (void) { GtkWidget *b = gtk_check_button_new_with_label (_("Color")); - bool old = prefs->getBool(prefs_path, "pick_to_color", 0); + bool old = prefs->getBool(prefs_path + "pick_to_color", 0); gtk_toggle_button_set_active ((GtkToggleButton *) b, old); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Each clone is painted by the picked color (the original must have unset fill or stroke)"), NULL); clonetiler_table_attach (table, b, 0.0, 1, 2); @@ -2778,7 +2776,7 @@ clonetiler_dialog (void) { GtkWidget *b = gtk_check_button_new_with_label (_("Opacity")); - bool old = prefs->getBool(prefs_path, "pick_to_opacity", 0); + bool old = prefs->getBool(prefs_path + "pick_to_opacity", 0); gtk_toggle_button_set_active ((GtkToggleButton *) b, old); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Each clone's opacity is determined by the picked value in that point"), NULL); clonetiler_table_attach (table, b, 0.0, 2, 2); @@ -2786,7 +2784,7 @@ clonetiler_dialog (void) GTK_SIGNAL_FUNC(clonetiler_pick_to), (gpointer) "pick_to_opacity"); } } - gtk_widget_set_sensitive (vvb, prefs->getBool(prefs_path, "dotrace")); + gtk_widget_set_sensitive (vvb, prefs->getBool(prefs_path + "dotrace")); } } @@ -2804,7 +2802,7 @@ clonetiler_dialog (void) { GtkObject *a = gtk_adjustment_new(0.0, 1, 500, 1, 10, 10); - int value = prefs->getInt(prefs_path, "jmax", 2); + int value = prefs->getInt(prefs_path + "jmax", 2); gtk_adjustment_set_value (GTK_ADJUSTMENT (a), value); GtkWidget *sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, 0); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), sb, _("How many rows in the tiling"), NULL); @@ -2824,7 +2822,7 @@ clonetiler_dialog (void) { GtkObject *a = gtk_adjustment_new(0.0, 1, 500, 1, 10, 10); - int value = prefs->getInt(prefs_path, "imax", 2); + int value = prefs->getInt(prefs_path + "imax", 2); gtk_adjustment_set_value (GTK_ADJUSTMENT (a), value); GtkWidget *sb = gtk_spin_button_new (GTK_ADJUSTMENT (a), 1.0, 0); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), sb, _("How many columns in the tiling"), NULL); @@ -2851,7 +2849,7 @@ clonetiler_dialog (void) GtkObject *a = gtk_adjustment_new (0.0, -1e6, 1e6, 1.0, 10.0, 10.0); sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a)); - double value = prefs->getDouble(prefs_path, "fillwidth", 50.0); + double value = prefs->getDouble(prefs_path + "fillwidth", 50.0); SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); gdouble const units = sp_pixels_get_units (value, unit); gtk_adjustment_set_value (GTK_ADJUSTMENT (a), units); @@ -2875,7 +2873,7 @@ clonetiler_dialog (void) GtkObject *a = gtk_adjustment_new (0.0, -1e6, 1e6, 1.0, 10.0, 10.0); sp_unit_selector_add_adjustment (SP_UNIT_SELECTOR (u), GTK_ADJUSTMENT (a)); - double value = prefs->getDouble(prefs_path, "fillheight", 50.0); + double value = prefs->getDouble(prefs_path + "fillheight", 50.0); SPUnit const &unit = *sp_unit_selector_get_unit(SP_UNIT_SELECTOR(u)); gdouble const units = sp_pixels_get_units (value, unit); gtk_adjustment_set_value (GTK_ADJUSTMENT (a), units); @@ -2902,7 +2900,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 1, 1); gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_switch_to_create), (gpointer) dlg); } - if (!prefs->getBool(prefs_path, "fillrect")) { + if (!prefs->getBool(prefs_path + "fillrect")) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE); gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (radio)); } @@ -2912,7 +2910,7 @@ clonetiler_dialog (void) clonetiler_table_attach (table, radio, 0.0, 2, 1); gtk_signal_connect (GTK_OBJECT (radio), "toggled", GTK_SIGNAL_FUNC (clonetiler_switch_to_fill), (gpointer) dlg); } - if (prefs->getBool(prefs_path, "fillrect")) { + if (prefs->getBool(prefs_path + "fillrect")) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE); gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (radio)); } @@ -2925,7 +2923,7 @@ clonetiler_dialog (void) gtk_box_pack_start (GTK_BOX (mainbox), hb, FALSE, FALSE, 0); GtkWidget *b = gtk_check_button_new_with_label (_("Use saved size and position of the tile")); - bool keepbbox = prefs->getBool(prefs_path, "keepbbox", true); + bool keepbbox = prefs->getBool(prefs_path + "keepbbox", true); gtk_toggle_button_set_active ((GtkToggleButton *) b, keepbbox); gtk_tooltips_set_tip (GTK_TOOLTIPS (tt), b, _("Pretend that the size and position of the tile are the same as the last time you tiled it (if any), instead of using the current size"), NULL); gtk_box_pack_start (GTK_BOX (hb), b, FALSE, FALSE, 0); |
