diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-15 21:57:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-15 21:57:08 -0400 |
commit | 84fb0a8dceda063d58b946cb891c3e21214c8f75 (patch) | |
tree | 1802e90cff0548e201397392c8aebd9f8f5f83dd /libs | |
parent | fe344859073b00ff63b0fd0b68c26af6cd96aae3 (diff) |
remove all XML related API from canvas. it may have been useful during development, but it is just a distraction - we will NEVER be saving or restoring canvas state via XML or any kind of serialized state
Diffstat (limited to 'libs')
35 files changed, 1 insertions, 449 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index da34a73c21..c3f051cf4d 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -46,35 +46,6 @@ Canvas::Canvas () set_epoch (); } -/** Construct a new Canvas from an XML tree - * @param tree XML Tree. - */ -Canvas::Canvas (XMLTree const * tree) - : _root (this) - , _log_renders (true) - , _scroll_offset_x (0) - , _scroll_offset_y (0) -{ - set_epoch (); - - /* XXX: little bit hacky */ - _root.set_state (tree->root()->child ("Group")); - - XMLNodeList const & children = tree->root()->children (); - for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - if ((*i)->name() == ("Render")) { - _renders.push_back ( - Rect ( - atof ((*i)->property ("x0")->value().c_str()), - atof ((*i)->property ("y0")->value().c_str()), - atof ((*i)->property ("x1")->value().c_str()), - atof ((*i)->property ("x1")->value().c_str()) - ) - ); - } - } -} - void Canvas::scroll_to (Coord x, Coord y) { @@ -255,27 +226,6 @@ Canvas::queue_draw_item_area (Item* item, Rect area) request_redraw (canvas_area); } -/** @return An XML description of the canvas and its objects */ -XMLTree * -Canvas::get_state () const -{ - XMLTree* tree = new XMLTree (); - XMLNode* node = new XMLNode ("Canvas"); - node->add_child_nocopy (*_root.get_state ()); - - for (list<Rect>::const_iterator i = _renders.begin(); i != _renders.end(); ++i) { - XMLNode* render = new XMLNode ("Render"); - render->add_property ("x0", string_compose ("%1", i->x0)); - render->add_property ("y0", string_compose ("%1", i->y0)); - render->add_property ("x1", string_compose ("%1", i->x1)); - render->add_property ("y1", string_compose ("%1", i->y1)); - node->add_child_nocopy (*render); - } - - tree->set_root (node); - return tree; -} - /** Construct a GtkCanvas */ GtkCanvas::GtkCanvas () : _current_item (0) @@ -285,18 +235,6 @@ GtkCanvas::GtkCanvas () add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK); } -/** Construct a GtkCanvas from an XML tree. - * @param tree XML Tree. - */ -GtkCanvas::GtkCanvas (XMLTree const * tree) - : Canvas (tree) - , _current_item (0) - , _grabbed_item (0) -{ - /* these are the events we want to know about */ - add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK); -} - /** Handler for button presses on the canvas. * @param ev GDK event. */ diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h index 1dd339b0b4..9c0f690f93 100644 --- a/libs/canvas/canvas/canvas.h +++ b/libs/canvas/canvas/canvas.h @@ -32,8 +32,6 @@ #include "pbd/signals.h" #include "canvas/root_group.h" -class XMLTree; - namespace ArdourCanvas { @@ -54,7 +52,6 @@ class Canvas { public: Canvas (); - Canvas (XMLTree const *); virtual ~Canvas () {} /** called to request a redraw of an area of the canvas */ @@ -79,9 +76,7 @@ public: void item_changed (Item *, boost::optional<Rect>); void item_moved (Item *, boost::optional<Rect>); - XMLTree* get_state () const; - - virtual Cairo::RefPtr<Cairo::Context> context () = 0; + virtual Cairo::RefPtr<Cairo::Context> context () = 0; std::list<Rect> const & renders () const { return _renders; @@ -115,7 +110,6 @@ class GtkCanvas : public Canvas, public Gtk::EventBox { public: GtkCanvas (); - GtkCanvas (XMLTree const *); void request_redraw (Rect const &); void request_size (Duple); diff --git a/libs/canvas/canvas/curve.h b/libs/canvas/canvas/curve.h index 733808dc14..d63510c545 100644 --- a/libs/canvas/canvas/curve.h +++ b/libs/canvas/canvas/curve.h @@ -13,8 +13,6 @@ public: void compute_bounding_box () const; void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; - XMLNode* get_state () const; - void set_state (XMLNode const *); void set (Points const &); diff --git a/libs/canvas/canvas/fill.h b/libs/canvas/canvas/fill.h index 0745bae2cc..26095abe27 100644 --- a/libs/canvas/canvas/fill.h +++ b/libs/canvas/canvas/fill.h @@ -11,9 +11,6 @@ class Fill : virtual public Item public: Fill (Group *); - void add_fill_state (XMLNode *) const; - void set_fill_state (XMLNode const *); - Color fill_color () const { return _fill_color; } diff --git a/libs/canvas/canvas/group.h b/libs/canvas/canvas/group.h index ee50f649f3..b875dbbdeb 100644 --- a/libs/canvas/canvas/group.h +++ b/libs/canvas/canvas/group.h @@ -18,8 +18,6 @@ public: void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const; virtual void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); void add (Item *); void remove (Item *); diff --git a/libs/canvas/canvas/image.h b/libs/canvas/canvas/image.h index e23e9221a3..b3a1ce6f9f 100644 --- a/libs/canvas/canvas/image.h +++ b/libs/canvas/canvas/image.h @@ -35,8 +35,6 @@ public: void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); private: Cairo::Format _format; diff --git a/libs/canvas/canvas/item.h b/libs/canvas/canvas/item.h index 7f1321b260..76a93d2c05 100644 --- a/libs/canvas/canvas/item.h +++ b/libs/canvas/canvas/item.h @@ -30,8 +30,6 @@ #include "canvas/types.h" -class XMLNode; - namespace ArdourCanvas { @@ -70,15 +68,9 @@ public: /** Update _bounding_box and _bounding_box_dirty */ virtual void compute_bounding_box () const = 0; - virtual XMLNode* get_state () const = 0; - virtual void set_state (XMLNode const *) = 0; - void grab (); void ungrab (); - void add_item_state (XMLNode *) const; - void set_item_state (XMLNode const *); - void unparent (); void reparent (Group *); diff --git a/libs/canvas/canvas/item_factory.h b/libs/canvas/canvas/item_factory.h deleted file mode 100644 index 149dbaac01..0000000000 --- a/libs/canvas/canvas/item_factory.h +++ /dev/null @@ -1,9 +0,0 @@ -namespace ArdourCanvas -{ - -class Item; -class Group; - -Item* create_item (Group *, XMLNode const *); - -} diff --git a/libs/canvas/canvas/line.h b/libs/canvas/canvas/line.h index 85983d55b6..fd0e702f4a 100644 --- a/libs/canvas/canvas/line.h +++ b/libs/canvas/canvas/line.h @@ -14,8 +14,6 @@ public: void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); void set (Duple, Duple); void set_x0 (Coord); diff --git a/libs/canvas/canvas/line_set.h b/libs/canvas/canvas/line_set.h index ec27e6a72e..3c0cdec0c9 100644 --- a/libs/canvas/canvas/line_set.h +++ b/libs/canvas/canvas/line_set.h @@ -14,8 +14,6 @@ public: void compute_bounding_box () const; void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; - XMLNode* get_state () const; - void set_state (XMLNode const *) {} void set_height (Distance); diff --git a/libs/canvas/canvas/outline.h b/libs/canvas/canvas/outline.h index 52b1f01061..82b6d6e251 100644 --- a/libs/canvas/canvas/outline.h +++ b/libs/canvas/canvas/outline.h @@ -13,9 +13,6 @@ public: Outline (Group *); virtual ~Outline () {} - void add_outline_state (XMLNode *) const; - void set_outline_state (XMLNode const *); - Color outline_color () const { return _outline_color; } diff --git a/libs/canvas/canvas/pixbuf.h b/libs/canvas/canvas/pixbuf.h index 0da7e4e7ea..408ee2c38b 100644 --- a/libs/canvas/canvas/pixbuf.h +++ b/libs/canvas/canvas/pixbuf.h @@ -18,8 +18,6 @@ public: void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); void set (Glib::RefPtr<Gdk::Pixbuf>); diff --git a/libs/canvas/canvas/poly_item.h b/libs/canvas/canvas/poly_item.h index 51f907699d..1b6f1028ee 100644 --- a/libs/canvas/canvas/poly_item.h +++ b/libs/canvas/canvas/poly_item.h @@ -13,9 +13,6 @@ public: void compute_bounding_box () const; - void add_poly_item_state (XMLNode *) const; - void set_poly_item_state (XMLNode const *); - virtual void set (Points const &); Points const & get () const; diff --git a/libs/canvas/canvas/poly_line.h b/libs/canvas/canvas/poly_line.h index e870e51876..b89b1f2c93 100644 --- a/libs/canvas/canvas/poly_line.h +++ b/libs/canvas/canvas/poly_line.h @@ -12,8 +12,6 @@ public: PolyLine (Group *); void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; - XMLNode* get_state () const; - void set_state (XMLNode const *); }; } diff --git a/libs/canvas/canvas/polygon.h b/libs/canvas/canvas/polygon.h index 3a624d867d..5f5cca00cf 100644 --- a/libs/canvas/canvas/polygon.h +++ b/libs/canvas/canvas/polygon.h @@ -13,8 +13,6 @@ public: Polygon (Group *); void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; - XMLNode* get_state () const; - void set_state (XMLNode const *); }; } diff --git a/libs/canvas/canvas/rectangle.h b/libs/canvas/canvas/rectangle.h index dd8232c439..4b64db2a97 100644 --- a/libs/canvas/canvas/rectangle.h +++ b/libs/canvas/canvas/rectangle.h @@ -17,8 +17,6 @@ public: void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); Rect const & get () const { return _rect; diff --git a/libs/canvas/canvas/text.h b/libs/canvas/canvas/text.h index e0be922e94..e5ba3de463 100644 --- a/libs/canvas/canvas/text.h +++ b/libs/canvas/canvas/text.h @@ -16,8 +16,6 @@ public: void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); void set (std::string const &); void set_color (uint32_t); diff --git a/libs/canvas/canvas/wave_view.h b/libs/canvas/canvas/wave_view.h index efa0daaa9e..8362380921 100644 --- a/libs/canvas/canvas/wave_view.h +++ b/libs/canvas/canvas/wave_view.h @@ -51,9 +51,6 @@ public: void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; void compute_bounding_box () const; - XMLNode* get_state () const; - void set_state (XMLNode const *); - void set_samples_per_pixel (double); void set_height (Distance); void set_channel (int); diff --git a/libs/canvas/curve.cc b/libs/canvas/curve.cc index 172d1e8b9d..5c9112b270 100644 --- a/libs/canvas/curve.cc +++ b/libs/canvas/curve.cc @@ -102,22 +102,6 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const } } -XMLNode * -Curve::get_state () const -{ - XMLNode* node = new XMLNode ("PolyLine"); - add_poly_item_state (node); - add_outline_state (node); - return node; -} - -void -Curve::set_state (XMLNode const * node) -{ - set_poly_item_state (node); - set_outline_state (node); -} - void Curve::render_path (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const { diff --git a/libs/canvas/fill.cc b/libs/canvas/fill.cc index 6a424d8c63..4e2d2b1912 100644 --- a/libs/canvas/fill.cc +++ b/libs/canvas/fill.cc @@ -43,19 +43,3 @@ Fill::setup_fill_context (Cairo::RefPtr<Cairo::Context> context) const { set_source_rgba (context, _fill_color); } - -void -Fill::add_fill_state (XMLNode* node) const -{ - node->add_property ("fill-color", string_compose ("%1", _fill_color)); - node->add_property ("fill", _fill ? "yes" : "no"); -} - -void -Fill::set_fill_state (XMLNode const * node) -{ - _fill_color = atoll (node->property("fill-color")->value().c_str()); - _fill = PBD::string_is_affirmative (node->property("fill")->value ().c_str()); - - _bounding_box_dirty = true; -} diff --git a/libs/canvas/group.cc b/libs/canvas/group.cc index 34001bc255..b5bc2e3151 100644 --- a/libs/canvas/group.cc +++ b/libs/canvas/group.cc @@ -8,7 +8,6 @@ #include "canvas/group.h" #include "canvas/types.h" #include "canvas/debug.h" -#include "canvas/item_factory.h" #include "canvas/item.h" #include "canvas/canvas.h" @@ -249,30 +248,6 @@ Group::add_items_at_point (Duple const point, vector<Item const *>& items) const } } -XMLNode * -Group::get_state () const -{ - XMLNode* node = new XMLNode ("Group"); - for (list<Item*>::const_iterator i = _items.begin(); i != _items.end(); ++i) { - node->add_child_nocopy (*(*i)->get_state ()); - } - - add_item_state (node); - return node; -} - -void -Group::set_state (XMLNode const * node) -{ - set_item_state (node); - - XMLNodeList const & children = node->children (); - for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - /* this will create the item and add it to this group */ - create_item (this, *i); - } -} - void Group::dump (ostream& o) const { diff --git a/libs/canvas/image.cc b/libs/canvas/image.cc index 0c7ce6eb28..d8c4f11d1a 100644 --- a/libs/canvas/image.cc +++ b/libs/canvas/image.cc @@ -66,15 +66,3 @@ Image::accept_data () _need_render = true; } -XMLNode * -Image::get_state () const -{ - /* XXX */ - return new XMLNode ("Image"); -} - -void -Image::set_state (XMLNode const * /*node*/) -{ - /* XXX */ -} diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc index 75a5718271..4108c0e0d6 100644 --- a/libs/canvas/item.cc +++ b/libs/canvas/item.cc @@ -301,22 +301,6 @@ Item::move (Duple movement) } void -Item::add_item_state (XMLNode* node) const -{ - node->add_property ("x-position", string_compose ("%1", _position.x)); - node->add_property ("y-position", string_compose ("%1", _position.y)); - node->add_property ("visible", _visible ? "yes" : "no"); -} - -void -Item::set_item_state (XMLNode const * node) -{ - _position.x = atof (node->property("x-position")->value().c_str()); - _position.y = atof (node->property("y-position")->value().c_str()); - _visible = PBD::string_is_affirmative (node->property("visible")->value()); -} - -void Item::grab () { assert (_canvas); diff --git a/libs/canvas/item_factory.cc b/libs/canvas/item_factory.cc deleted file mode 100644 index 0371cb1d82..0000000000 --- a/libs/canvas/item_factory.cc +++ /dev/null @@ -1,43 +0,0 @@ -#include "pbd/xml++.h" -#include "canvas/item_factory.h" -#include "canvas/group.h" -#include "canvas/line.h" -#include "canvas/rectangle.h" -#include "canvas/poly_line.h" -#include "canvas/polygon.h" -#include "canvas/pixbuf.h" -#include "canvas/wave_view.h" -#include "canvas/text.h" -#include "canvas/line_set.h" - -using namespace std; -using namespace ArdourCanvas; - -Item* -ArdourCanvas::create_item (Group* parent, XMLNode const * node) -{ - Item* item = 0; - if (node->name() == "Group") { - item = new Group (parent); - } else if (node->name() == "Line") { - item = new Line (parent); - } else if (node->name() == "Rectangle") { - item = new Rectangle (parent); - } else if (node->name() == "PolyLine") { - item = new PolyLine (parent); - } else if (node->name() == "Polygon") { - item = new Polygon (parent); - } else if (node->name() == "Pixbuf") { - item = new Pixbuf (parent); - } else if (node->name() == "WaveView") { - item = new WaveView (parent, boost::shared_ptr<ARDOUR::AudioRegion> ()); - } else if (node->name() == "Text") { - item = new Text (parent); - } else if (node->name() == "LineSet") { - item = new LineSet (parent); - } - - assert (item); - item->set_state (node); - return item; -} diff --git a/libs/canvas/line.cc b/libs/canvas/line.cc index 6c3a62e5dc..b070a57574 100644 --- a/libs/canvas/line.cc +++ b/libs/canvas/line.cc @@ -113,36 +113,3 @@ Line::set_y1 (Coord y1) DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: line change\n"); } - -XMLNode * -Line::get_state () const -{ - XMLNode* node = new XMLNode ("Line"); -#ifdef CANVAS_DEBUG - if (!name.empty ()) { - node->add_property ("name", name); - } -#endif - node->add_property ("x0", string_compose ("%1", _points[0].x)); - node->add_property ("y0", string_compose ("%1", _points[0].y)); - node->add_property ("x1", string_compose ("%1", _points[1].x)); - node->add_property ("y1", string_compose ("%1", _points[1].y)); - - add_item_state (node); - add_outline_state (node); - return node; -} - -void -Line::set_state (XMLNode const * node) -{ - _points[0].x = atof (node->property("x0")->value().c_str()); - _points[0].y = atof (node->property("y0")->value().c_str()); - _points[1].x = atof (node->property("x1")->value().c_str()); - _points[1].y = atof (node->property("y1")->value().c_str()); - - set_item_state (node); - set_outline_state (node); - - _bounding_box_dirty = true; -} diff --git a/libs/canvas/line_set.cc b/libs/canvas/line_set.cc index c77ab7cf2b..af5ed40e32 100644 --- a/libs/canvas/line_set.cc +++ b/libs/canvas/line_set.cc @@ -21,12 +21,6 @@ LineSet::LineSet (Group* parent) } -XMLNode * -LineSet::get_state () const -{ - /* XXX */ - return new XMLNode ("LineSet"); -} void LineSet::compute_bounding_box () const diff --git a/libs/canvas/outline.cc b/libs/canvas/outline.cc index 8db2c27f8f..4b2fc39cb8 100644 --- a/libs/canvas/outline.cc +++ b/libs/canvas/outline.cc @@ -61,20 +61,3 @@ Outline::setup_outline_context (Cairo::RefPtr<Cairo::Context> context) const context->set_line_width (_outline_width); } -void -Outline::add_outline_state (XMLNode* node) const -{ - node->add_property ("outline-color", string_compose ("%1", _outline_color)); - node->add_property ("outline", _outline ? "yes" : "no"); - node->add_property ("outline-width", string_compose ("%1", _outline_width)); -} - -void -Outline::set_outline_state (XMLNode const * node) -{ - _outline_color = atoll (node->property("outline-color")->value().c_str()); - _outline = PBD::string_is_affirmative (node->property("outline")->value().c_str()); - _outline_width = atof (node->property("outline-width")->value().c_str()); - - _bounding_box_dirty = true; -} diff --git a/libs/canvas/pixbuf.cc b/libs/canvas/pixbuf.cc index ccb42fdf74..59fd99ba6d 100644 --- a/libs/canvas/pixbuf.cc +++ b/libs/canvas/pixbuf.cc @@ -49,15 +49,3 @@ Pixbuf::pixbuf() { return _pixbuf; } -XMLNode * -Pixbuf::get_state () const -{ - /* XXX */ - return new XMLNode ("Pixbuf"); -} - -void -Pixbuf::set_state (XMLNode const * /*node*/) -{ - /* XXX */ -} diff --git a/libs/canvas/poly_item.cc b/libs/canvas/poly_item.cc index 45faaf2d54..90115dfabf 100644 --- a/libs/canvas/poly_item.cc +++ b/libs/canvas/poly_item.cc @@ -110,33 +110,6 @@ PolyItem::get () const } void -PolyItem::add_poly_item_state (XMLNode* node) const -{ - add_item_state (node); - - for (Points::const_iterator i = _points.begin(); i != _points.end(); ++i) { - XMLNode* p = new XMLNode ("Point"); - p->add_property ("x", string_compose ("%1", i->x)); - p->add_property ("y", string_compose ("%1", i->y)); - node->add_child_nocopy (*p); - } -} - -void -PolyItem::set_poly_item_state (XMLNode const * node) -{ - XMLNodeList const & children = node->children (); - for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { - Duple p; - p.x = atof ((*i)->property("x")->value().c_str()); - p.y = atof ((*i)->property("y")->value().c_str()); - _points.push_back (p); - } - - _bounding_box_dirty = true; -} - -void PolyItem::dump (ostream& o) const { Item::dump (o); diff --git a/libs/canvas/poly_line.cc b/libs/canvas/poly_line.cc index e48082817d..47c6736f9c 100644 --- a/libs/canvas/poly_line.cc +++ b/libs/canvas/poly_line.cc @@ -19,20 +19,3 @@ PolyLine::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons context->stroke (); } } - - -XMLNode * -PolyLine::get_state () const -{ - XMLNode* node = new XMLNode ("PolyLine"); - add_poly_item_state (node); - add_outline_state (node); - return node; -} - -void -PolyLine::set_state (XMLNode const * node) -{ - set_poly_item_state (node); - set_outline_state (node); -} diff --git a/libs/canvas/polygon.cc b/libs/canvas/polygon.cc index b89a7ca880..8c123a526b 100644 --- a/libs/canvas/polygon.cc +++ b/libs/canvas/polygon.cc @@ -31,26 +31,3 @@ Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const } } -XMLNode * -Polygon::get_state () const -{ - XMLNode* node = new XMLNode ("Polygon"); -#ifdef CANVAS_DEBUG - if (!name.empty ()) { - node->add_property ("name", name); - } -#endif - add_poly_item_state (node); - add_outline_state (node); - add_fill_state (node); - return node; -} - - -void -Polygon::set_state (XMLNode const * node) -{ - set_poly_item_state (node); - set_outline_state (node); - set_fill_state (node); -} diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 9395cc774d..249106de33 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -194,39 +194,3 @@ Rectangle::set_outline_what (int what) set_outline_what ((What) what); } -XMLNode * -Rectangle::get_state () const -{ - XMLNode* node = new XMLNode ("Rectangle"); -#ifdef CANVAS_DEBUG - if (!name.empty ()) { - node->add_property ("name", name); - } -#endif - node->add_property ("x0", string_compose ("%1", _rect.x0)); - node->add_property ("y0", string_compose ("%1", _rect.y0)); - node->add_property ("x1", string_compose ("%1", _rect.x1)); - node->add_property ("y1", string_compose ("%1", _rect.y1)); - node->add_property ("outline-what", string_compose ("%1", _outline_what)); - - add_item_state (node); - add_outline_state (node); - add_fill_state (node); - return node; -} - -void -Rectangle::set_state (XMLNode const * node) -{ - _rect.x0 = atof (node->property("x0")->value().c_str()); - _rect.y0 = atof (node->property("y0")->value().c_str()); - _rect.x1 = atof (node->property("x1")->value().c_str()); - _rect.y1 = atof (node->property("y1")->value().c_str()); - _outline_what = (What) atoi (node->property("outline-what")->value().c_str()); - - set_item_state (node); - set_outline_state (node); - set_fill_state (node); - - _bounding_box_dirty = true; -} diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc index ed0e7dfae0..e5bb61d8ba 100644 --- a/libs/canvas/text.cc +++ b/libs/canvas/text.cc @@ -131,24 +131,6 @@ Text::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) cons context->fill (); } -XMLNode * -Text::get_state () const -{ - XMLNode* node = new XMLNode ("Text"); -#ifdef CANVAS_DEBUG - if (!name.empty ()) { - node->add_property ("name", name); - } -#endif - return node; -} - -void -Text::set_state (XMLNode const * /*node*/) -{ - /* XXX */ -} - void Text::set_alignment (Pango::Alignment alignment) { diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index 3fac6bce77..9ab06c4649 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -165,19 +165,6 @@ WaveView::compute_bounding_box () const _bounding_box_dirty = false; } -XMLNode * -WaveView::get_state () const -{ - /* XXX */ - return new XMLNode ("WaveView"); -} - -void -WaveView::set_state (XMLNode const * /*node*/) -{ - /* XXX */ -} - void WaveView::set_height (Distance height) { diff --git a/libs/canvas/wscript b/libs/canvas/wscript index eb1613c117..177328115c 100644 --- a/libs/canvas/wscript +++ b/libs/canvas/wscript @@ -37,7 +37,6 @@ canvas_sources = [ 'flag.cc', 'group.cc', 'image.cc', - 'item_factory.cc', 'line.cc', 'line_set.cc', 'lookup_table.cc', |