index 25143b9475198de67c19056492f6415e236600a2..7869a1f72da94d39fee074628b9455b54a01f02d 100644 (file)
}
void
-RegisteredCheckButton::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right)
+RegisteredCheckButton::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in)
{
_button = new Gtk::CheckButton;
_tt.set_tip (*_button, tip);
_key = key;
_wr = ≀
_toggled_connection = _button->signal_toggled().connect (sigc::mem_fun (*this, &RegisteredCheckButton::on_toggled));
+
+ repr = repr_in;
}
void
SPDocument *doc = sp_desktop_document(dt);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
+
_wr->setUpdating (true);
bool saved = sp_document_get_undo_sensitive (doc);
sp_document_set_undo_sensitive (doc, saved);
sp_document_done (doc, SP_VERB_NONE,
/* TODO: annotate */ "registered-widget.cpp:103");
-
+
_wr->setUpdating (false);
}
}
void
-RegisteredUnitMenu::init (const Glib::ustring& label, const Glib::ustring& key, Registry& wr)
+RegisteredUnitMenu::init (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in)
{
_label = new Gtk::Label (label, 1.0, 0.5);
_label->set_use_underline (true);
@@ -128,9 +132,11 @@ RegisteredUnitMenu::init (const Glib::ustring& label, const Glib::ustring& key,
_wr = ≀
_key = key;
_changed_connection = _sel->signal_changed().connect (sigc::mem_fun (*this, &RegisteredUnitMenu::on_changed));
+
+ repr = repr_in;
}
-void
+void
RegisteredUnitMenu::setUnit (const SPUnit* unit)
{
_sel->setUnit (sp_unit_get_abbreviation (unit));
return;
SPDesktop *dt = SP_ACTIVE_DESKTOP;
- if (!dt)
+ if (!dt)
return;
Inkscape::SVGOStringStream os;
SPDocument *doc = sp_desktop_document(dt);
bool saved = sp_document_get_undo_sensitive (doc);
sp_document_set_undo_sensitive (doc, false);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), os.str().c_str());
doc->rroot->setAttribute("sodipodi:modified", "true");
sp_document_set_undo_sensitive (doc, saved);
- sp_document_done (doc, SP_VERB_NONE,
+ sp_document_done (doc, SP_VERB_NONE,
/* TODO: annotate */ "registered-widget.cpp:162");
-
+
_wr->setUpdating (false);
}
}
void
-RegisteredScalarUnit::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, const RegisteredUnitMenu &rum, Registry& wr)
+RegisteredScalarUnit::init (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, const RegisteredUnitMenu &rum, Registry& wr, Inkscape::XML::Node* repr_in)
{
_widget = new ScalarUnit (label, tip, UNIT_TYPE_LINEAR, "", "", rum._sel);
_widget->initScalar (-1e6, 1e6);
@@ -187,6 +194,8 @@ RegisteredScalarUnit::init (const Glib::ustring& label, const Glib::ustring& tip
_um = rum._sel;
_value_changed_connection = _widget->signal_value_changed().connect (sigc::mem_fun (*this, &RegisteredScalarUnit::on_value_changed));
_wr = ≀
+
+ repr = repr_in;
}
ScalarUnit*
return _widget;
}
-void
+void
RegisteredScalarUnit::setValue (double val)
{
_widget->setValue (val);
return;
SPDesktop *dt = SP_ACTIVE_DESKTOP;
- if (!dt)
+ if (!dt)
return;
Inkscape::SVGOStringStream os;
SPDocument *doc = sp_desktop_document(dt);
bool saved = sp_document_get_undo_sensitive (doc);
sp_document_set_undo_sensitive (doc, false);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), os.str().c_str());
doc->rroot->setAttribute("sodipodi:modified", "true");
sp_document_set_undo_sensitive (doc, saved);
- sp_document_done (doc, SP_VERB_NONE,
+ sp_document_done (doc, SP_VERB_NONE,
/* TODO: annotate */ "registered-widget.cpp:230");
-
+
_wr->setUpdating (false);
}
}
void
-RegisteredColorPicker::init (const Glib::ustring& label, const Glib::ustring& title, const Glib::ustring& tip, const Glib::ustring& ckey, const Glib::ustring& akey, Registry& wr)
+RegisteredColorPicker::init (const Glib::ustring& label, const Glib::ustring& title, const Glib::ustring& tip, const Glib::ustring& ckey, const Glib::ustring& akey, Registry& wr, Inkscape::XML::Node* repr_in)
{
_label = new Gtk::Label (label, 1.0, 0.5);
_label->set_use_underline (true);
@@ -255,9 +265,11 @@ RegisteredColorPicker::init (const Glib::ustring& label, const Glib::ustring& ti
_akey = akey;
_wr = ≀
_changed_connection = _cp->connectChanged (sigc::mem_fun (*this, &RegisteredColorPicker::on_changed));
+
+ repr = repr_in;
}
-void
+void
RegisteredColorPicker::setRgba32 (guint32 rgba)
{
_cp->setRgba32 (rgba);
return;
_wr->setUpdating (true);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(SP_ACTIVE_DESKTOP));
gchar c[32];
sp_svg_write_color(c, 32, rgba);
repr->setAttribute(_ckey.c_str(), c);
RegisteredSuffixedInteger::RegisteredSuffixedInteger()
: _label(0), _sb(0),
- _adj(0.0,0.0,100.0,1.0,1.0,1.0),
+ _adj(0.0,0.0,100.0,1.0,1.0,1.0),
_suffix(0)
{
}
}
void
-RegisteredSuffixedInteger::init (const Glib::ustring& label, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr)
+RegisteredSuffixedInteger::init (const Glib::ustring& label, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in)
{
_key = key;
_label = new Gtk::Label (label);
@@ -314,9 +327,11 @@ RegisteredSuffixedInteger::init (const Glib::ustring& label, const Glib::ustring
_changed_connection = _adj.signal_value_changed().connect (sigc::mem_fun(*this, &RegisteredSuffixedInteger::on_value_changed));
_wr = ≀
+
+ repr = repr_in;
}
-void
+void
RegisteredSuffixedInteger::setValue (int i)
{
_adj.set_value (i);
return;
_wr->setUpdating (true);
-
+
SPDesktop* dt = SP_ACTIVE_DESKTOP;
- Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
Inkscape::SVGOStringStream os;
int value = int(_adj.get_value());
os << value;
repr->setAttribute(_key.c_str(), os.str().c_str());
- sp_document_done(sp_desktop_document(dt), SP_VERB_NONE,
+ sp_document_done(sp_desktop_document(dt), SP_VERB_NONE,
/* TODO: annotate */ "registered-widget.cpp:341");
-
+
_wr->setUpdating (false);
}
}
void
-RegisteredRadioButtonPair::init (const Glib::ustring& label,
-const Glib::ustring& label1, const Glib::ustring& label2,
-const Glib::ustring& tip1, const Glib::ustring& tip2,
-const Glib::ustring& key, Registry& wr)
+RegisteredRadioButtonPair::init (const Glib::ustring& label,
+const Glib::ustring& label1, const Glib::ustring& label2,
+const Glib::ustring& tip1, const Glib::ustring& tip2,
+const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in)
{
_hbox = new Gtk::HBox;
_hbox->add (*manage (new Gtk::Label (label)));
_key = key;
_wr = ≀
_changed_connection = _rb1->signal_toggled().connect (sigc::mem_fun (*this, &RegisteredRadioButtonPair::on_value_changed));
+
+ repr = repr_in;
}
-void
+void
RegisteredRadioButtonPair::setValue (bool second)
{
if (second) _rb2->set_active();
return;
SPDesktop *dt = SP_ACTIVE_DESKTOP;
- if (!dt)
+ if (!dt)
return;
_wr->setUpdating (true);
-
+
bool second = _rb2->get_active();
SPDocument *doc = sp_desktop_document(dt);
bool saved = sp_document_get_undo_sensitive (doc);
sp_document_set_undo_sensitive (doc, false);
- Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
+ if (!repr)
+ repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
repr->setAttribute(_key.c_str(), second ? "true" : "false");
doc->rroot->setAttribute("sodipodi:modified", "true");
sp_document_set_undo_sensitive (doc, saved);
- sp_document_done (doc, SP_VERB_NONE,
+ sp_document_done (doc, SP_VERB_NONE,
/* TODO: annotate */ "registered-widget.cpp:405");
-
+
_wr->setUpdating (false);
}