summaryrefslogtreecommitdiffstats
path: root/src/widgets/sp-attribute-widget.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2011-12-17 07:33:41 +0000
committerKris <Kris.De.Gussem@hotmail.com>2011-12-17 07:33:41 +0000
commitc21a3c75d968aac77597843426ce65d7757bbdb3 (patch)
tree4bb03a9adf17cc07d28a1077ed80da73961b33f5 /src/widgets/sp-attribute-widget.cpp
parentfix compiler warnings (diff)
downloadinkscape-c21a3c75d968aac77597843426ce65d7757bbdb3.tar.gz
inkscape-c21a3c75d968aac77597843426ce65d7757bbdb3.zip
Dropped unused SPAttributeWidget
(bzr r10778)
Diffstat (limited to 'src/widgets/sp-attribute-widget.cpp')
-rw-r--r--src/widgets/sp-attribute-widget.cpp152
1 files changed, 0 insertions, 152 deletions
diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp
index 1c7d36b4d..d2c52e2ae 100644
--- a/src/widgets/sp-attribute-widget.cpp
+++ b/src/widgets/sp-attribute-widget.cpp
@@ -22,158 +22,6 @@
using Inkscape::DocumentUndo;
-static void sp_attribute_widget_object_modified ( SPObject *object,
- guint flags,
- SPAttributeWidget *spaw );
-
-
-SPAttributeWidget::SPAttributeWidget () :
- blocked(0),
- hasobj(0),
- _attribute(),
- modified_connection()
-{
- src.object = NULL;
-}
-
-SPAttributeWidget::~SPAttributeWidget ()
-{
- if (hasobj)
- {
- if (src.object)
- {
- modified_connection.disconnect();
- src.object = NULL;
- }
- }
- else
- {
- if (src.repr)
- {
- src.repr = Inkscape::GC::release(src.repr);
- }
- }
-}
-
-void SPAttributeWidget::set_object(SPObject *object, const gchar *attribute)
-{
- if (hasobj) {
- if (src.object) {
- modified_connection.disconnect();
- src.object = NULL;
- }
- } else {
-
- if (src.repr) {
- src.repr = Inkscape::GC::release(src.repr);
- }
- }
-
- hasobj = true;
-
- if (object) {
- const gchar *val;
-
- blocked = true;
- src.object = object;
-
- modified_connection = object->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_attribute_widget_object_modified), this));
-
- _attribute = attribute;
-
- val = object->getRepr()->attribute(attribute);
- set_text (val ? val : (const gchar *) "");
- blocked = false;
- }
- gtk_widget_set_sensitive (GTK_WIDGET(this), (src.object != NULL));
-}
-
-void SPAttributeWidget::set_repr(Inkscape::XML::Node *repr, const gchar *attribute)
-{
- if (hasobj) {
- if (src.object) {
- modified_connection.disconnect();
- src.object = NULL;
- }
- } else {
-
- if (src.repr) {
- src.repr = Inkscape::GC::release(src.repr);
- }
- }
-
- hasobj = false;
-
- if (repr) {
- const gchar *val;
-
- blocked = true;
- src.repr = Inkscape::GC::anchor(repr);
- attribute = g_strdup (attribute);
-
- val = repr->attribute(attribute);
- set_text (val ? val : (const gchar *) "");
- blocked = false;
- }
- gtk_widget_set_sensitive (GTK_WIDGET (this), (src.repr != NULL));
-}
-
-void SPAttributeWidget::on_changed (void)
-{
- if (!blocked)
- {
- Glib::ustring text1;
- const gchar *text;
- blocked = true;
- text1 = get_text ();
- text = text1.c_str();
- if (!*text)
- text = NULL;
-
- if (hasobj && src.object) {
- src.object->getRepr()->setAttribute(_attribute.c_str(), text, false);
- DocumentUndo::done(src.object->document, SP_VERB_NONE,
- _("Set attribute"));
-
- } else if (src.repr) {
- src.repr->setAttribute(_attribute.c_str(), text, false);
- /* TODO: Warning! Undo will not be flushed in given case */
- }
- blocked = false;
- }
-}
-
-static void sp_attribute_widget_object_modified ( SPObject */*object*/,
- guint flags,
- SPAttributeWidget *spaw )
-{
-
- if (flags && SP_OBJECT_MODIFIED_FLAG) {
-
- const gchar *val;
- Glib::ustring text;
- Glib::ustring attr = spaw->get_attribute();
- val = spaw->src.object->getRepr()->attribute(attr.c_str());
- text = spaw->get_text();
-
- if (val || !text.empty()) {
-
- if (!val || text.empty() || (text == val)) {
- /* We are different */
- spaw->set_blocked(true);
- spaw->set_text(val ? val : (const gchar *) "");
- spaw->set_blocked(false);
- } // end of if()
-
- } // end of if()
-
- } //end of if()
-
-} // end of sp_attribute_widget_object_modified()
-
-
-
-/* SPAttributeTable */
static void sp_attribute_table_object_modified (SPObject *object, guint flags, SPAttributeTable *spaw);
static void sp_attribute_table_entry_changed (Gtk::Editable *editable, SPAttributeTable *spat);