summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2007-07-26 08:27:43 +0000
committernicholasbishop <nicholasbishop@users.sourceforge.net>2007-07-26 08:27:43 +0000
commitfbaeeaf7e6e739c6869599e6c7b7c87988729f66 (patch)
tree67c3bec3301c76a07e15cf75e7f23e82d833ea44 /src
parentboiler plate code for feTurbulence: (diff)
downloadinkscape-fbaeeaf7e6e739c6869599e6c7b7c87988729f66.tar.gz
inkscape-fbaeeaf7e6e739c6869599e6c7b7c87988729f66.zip
Added attr-widgets, missing from my last commit
(bzr r3306)
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget/attr-widget.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/ui/widget/attr-widget.h b/src/ui/widget/attr-widget.h
new file mode 100644
index 000000000..73e96eaca
--- /dev/null
+++ b/src/ui/widget/attr-widget.h
@@ -0,0 +1,66 @@
+/**
+ * \brief Very basic interface for classes that control attributes
+ *
+ * Authors:
+ * Nicholas Bishop <nicholasbishop@gmail.com>
+ *
+ * Copyright (C) 2007 Authors
+ *
+ * Released under GNU GPL. Read the file 'COPYING' for more information.
+ */
+
+#ifndef INKSCAPE_UI_WIDGET_ATTR_WIDGET_H
+#define INKSCAPE_UI_WIDGET_ATTR_WIDGET_H
+
+#include "attributes.h"
+#include "sp-object.h"
+#include "xml/node.h"
+
+namespace Inkscape {
+namespace UI {
+namespace Widget {
+
+class AttrWidget
+{
+public:
+ AttrWidget(const SPAttributeEnum a)
+ : _attr(a)
+ {}
+
+ virtual ~AttrWidget()
+ {}
+
+ virtual Glib::ustring get_as_attribute() const = 0;
+ virtual void set_from_attribute(SPObject*) = 0;
+
+protected:
+ const gchar* attribute_value(SPObject* o) const
+ {
+ const gchar* name = (const gchar*)sp_attribute_name(_attr);
+ if(name && o) {
+ const gchar* val = SP_OBJECT_REPR(o)->attribute(name);
+ return val;
+ }
+ return 0;
+ }
+
+private:
+ const SPAttributeEnum _attr;
+};
+
+}
+}
+}
+
+#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :