remove all XML related API from canvas. it may have been useful during development...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 16 Apr 2013 01:57:08 +0000 (21:57 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 16 Apr 2013 01:57:08 +0000 (21:57 -0400)
39 files changed:
gtk2_ardour/ardour_ui.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/public_editor.h
libs/canvas/canvas.cc
libs/canvas/canvas/canvas.h
libs/canvas/canvas/curve.h
libs/canvas/canvas/fill.h
libs/canvas/canvas/group.h
libs/canvas/canvas/image.h
libs/canvas/canvas/item.h
libs/canvas/canvas/item_factory.h [deleted file]
libs/canvas/canvas/line.h
libs/canvas/canvas/line_set.h
libs/canvas/canvas/outline.h
libs/canvas/canvas/pixbuf.h
libs/canvas/canvas/poly_item.h
libs/canvas/canvas/poly_line.h
libs/canvas/canvas/polygon.h
libs/canvas/canvas/rectangle.h
libs/canvas/canvas/text.h
libs/canvas/canvas/wave_view.h
libs/canvas/curve.cc
libs/canvas/fill.cc
libs/canvas/group.cc
libs/canvas/image.cc
libs/canvas/item.cc
libs/canvas/item_factory.cc [deleted file]
libs/canvas/line.cc
libs/canvas/line_set.cc
libs/canvas/outline.cc
libs/canvas/pixbuf.cc
libs/canvas/poly_item.cc
libs/canvas/poly_line.cc
libs/canvas/polygon.cc
libs/canvas/rectangle.cc
libs/canvas/text.cc
libs/canvas/wave_view.cc
libs/canvas/wscript

index 6801222e8b9b872a5b005c6176d0166fd909572e..eebd35aefbc041c1449979c5670b0e3f30cafe78 100644 (file)
@@ -2335,7 +2335,6 @@ ARDOUR_UI::save_state_canfail (string name, bool switch_to_it)
        }
 
        save_ardour_state (); /* XXX cannot fail? yeah, right ... */
-       editor->save_canvas_state ();
        return 0;
 }
 
index 04f4f514fd72ac8945ffaf1f30a84d636cc830d5..75239a75384aea1164fd513a054daa353f8a91ff 100644 (file)
@@ -5528,12 +5528,3 @@ Editor::shift_key_released ()
 {
        _stepping_axis_view = 0;
 }
-
-
-void
-Editor::save_canvas_state ()
-{
-       XMLTree* tree = static_cast<ArdourCanvas::Canvas*>(_track_canvas)->get_state ();
-       string path = string_compose ("%1/canvas-state.xml", _session->path());
-       tree->write (path);
-}
index 6cdd7060c250f1d8135e69e6ab0b7ab700a6e5bf..738175aed205d4f97798dc673bbf4c8e6b8cb9f2 100644 (file)
@@ -454,8 +454,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                _stepping_axis_view = v;
        }
 
-       void save_canvas_state ();
-       
        ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
         ArdourCanvas::Group* get_time_bars_group () const;
         ArdourCanvas::Group* get_track_canvas_group () const;
index 709f9208c4020fa21de9222f2fc5ce35e56938ef..12f4cd0ec789886fae91350795683df6087b7623 100644 (file)
@@ -420,8 +420,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
 
        virtual void get_regions_at (RegionSelection &, framepos_t where, TrackViewList const &) const = 0;
 
-       virtual void save_canvas_state () = 0;
-
        /// Singleton instance, set up by Editor::Editor()
 
        static PublicEditor* _instance;
index da34a73c211953d434685b09fa96a5492b91fce2..c3f051cf4d8db524082898a67b1492f37594e927 100644 (file)
@@ -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.
  */
index 1dd339b0b409e477fc3df7eac74f445148008adc..9c0f690f937782e93f62d3c171cc905f2ce7511a 100644 (file)
@@ -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);
index 733808dc14cf7a5836174d8ca82085ea6f503d56..d63510c545bc56b3693a4d84a3de4504bd1aa552 100644 (file)
@@ -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 &);
 
index 0745bae2cc68cf2e760711c4b552315122a4d3e7..26095abe271006e9999e2b3826f92831d4868ca1 100644 (file)
@@ -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;
        }
index ee50f649f3bd3049c126565ca52e69a6c92f8c37..b875dbbdeb2fd700d2649b26fedc63d13ff31ff2 100644 (file)
@@ -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 *);
index e23e9221a31ee16abcdefa21a10eeb0c01a655c6..b3a1ce6f9f732de858dca40fce8bd3e8183aba00 100644 (file)
@@ -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;
index 7f1321b260da1b9f4e760b52e0f01b39be1dbdfd..76a93d2c054c0066550e779985627d9bc46f1f5d 100644 (file)
@@ -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 (file)
index 149dbaa..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace ArdourCanvas
-{
-
-class Item;
-class Group;   
-
-Item* create_item (Group *, XMLNode const *);
-       
-}
index 85983d55b699fd2f6b512340b669bcf8c8f3e69e..fd0e702f4a661f3953dd95e82bcf8d54fd02bdd5 100644 (file)
@@ -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);
index ec27e6a72e3aef11fbca4a613cbcb3252ab8c3d7..3c0cdec0c903a2ac42c78bcd31326f2eea1cb194 100644 (file)
@@ -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);
 
index 52b1f010610031d3ff17b5aa98107b918544fdc1..82b6d6e2519add996bcdfaf968483b3eb9f79341 100644 (file)
@@ -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;
        }
index 0da7e4e7eae0621f9154668135a99dc3f0864a49..408ee2c38b62361ddac28bcb238b13f653cd9fe2 100644 (file)
@@ -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>);
 
index 51f907699df01ef1231bcb3aaff70280b262e02e..1b6f1028eef0cb21abe661fa8b5d5a7576040286 100644 (file)
@@ -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;
 
index e870e51876690df8ed95c60e8966ebfe943e1bfe..b89b1f2c93b451ad2da3308bdd2ba0f2fb4d7e3c 100644 (file)
@@ -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 *);
 };
        
 }
index 3a624d867dc40dd432786e2ddc98a4295a9a27c0..5f5cca00cf3c8594e366893e4a426613de31bce7 100644 (file)
@@ -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 *);
 };
        
 }
index dd8232c4393b20d67d4fe8d488807ec1b2510af0..4b64db2a97440be3e21882182f29a6c0360af916 100644 (file)
@@ -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;
index e0be922e94ac2092ccccc1b210f5eb3d13aeb7f7..e5ba3de463673cde932df7c85b600e005fdcbdab 100644 (file)
@@ -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);
index efa0daaa9ea3cfb6987478d5978e349236d3250f..8362380921ba91b5981c0c7b4aeff89488702106 100644 (file)
@@ -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);
index 172d1e8b9df2efebfbcc223bac156a512b5e4dec..5c9112b2703831b92ae5286b580f331e40009382 100644 (file)
@@ -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
 {
index 6a424d8c6364bce32b3ee97a7f00a3abfb2ec8dd..4e2d2b19128558764cdc454337cd7f6e4bbaf795 100644 (file)
@@ -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;
-}
index 34001bc255ca2b6a4dadaefa7ddac512f8937d78..b5bc2e3151f86e5a89f5186a08f8d71a7f1d7d82 100644 (file)
@@ -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
 {
index 0c7ce6eb28b190f1e96f7ddb7807d319f706e4f9..d8c4f11d1aecbd346f05714a2e41a6520a99d54c 100644 (file)
@@ -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 */
-}
index 75a5718271af928eb54a5f08813c9a1ffce066c7..4108c0e0d6b4eafd919ec848028b18761041abe0 100644 (file)
@@ -300,22 +300,6 @@ Item::move (Duple movement)
        set_position (position() + 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 ()
 {
diff --git a/libs/canvas/item_factory.cc b/libs/canvas/item_factory.cc
deleted file mode 100644 (file)
index 0371cb1..0000000
+++ /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;
-}
index 6c3a62e5dcae029aec470a392317132c73819ad7..b070a57574a80962c888c370ad410a59134b198a 100644 (file)
@@ -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;
-}
index c77ab7cf2b451563c1d89bcd5421578963f0c702..af5ed40e32e553b8139607f4708ece7d2367ee3f 100644 (file)
@@ -21,12 +21,6 @@ LineSet::LineSet (Group* parent)
 
 }
 
-XMLNode *
-LineSet::get_state () const
-{
-       /* XXX */
-       return new XMLNode ("LineSet");
-}
 
 void
 LineSet::compute_bounding_box () const
index 8db2c27f8fec9ac3f27de1bb5f5d7495136c27c7..4b2fc39cb8d058b24fa7409686f4381c8f44a60c 100644 (file)
@@ -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;
-}
index ccb42fdf745efc317d0374ba66305b916ad1dd94..59fd99ba6d96094580ab072da083561100ef46c6 100644 (file)
@@ -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 */
-}
index 45faaf2d54a3c3388321c64cdf6e0bf74cd92286..90115dfabf7c4bc3909e5fa7c85b211b00abd76d 100644 (file)
@@ -109,33 +109,6 @@ PolyItem::get () const
        return _points;
 }
 
-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
 {
index e48082817dfc2187cc6d8ca438ab036d27dd9331..47c6736f9c3fd61d80bab1d996e33bc133fd17bb 100644 (file)
@@ -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);
-}
index b89a7ca8802bf587008fd7ed2c8b72ed989e1cf8..8c123a526b27e3c08018ec6c550a8dd964687ffc 100644 (file)
@@ -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);
-}
index 9395cc774d808583c7d449a227defde2dd45c8ea..249106de33fe748578d1f9555bbfc5df1927a361 100644 (file)
@@ -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;
-}
index ed0e7dfae081d0b347b709b5de9c7081e1eed2a0..e5bb61d8bab831920dd2bb9c226afba858a4ba52 100644 (file)
@@ -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)
 {
index 3fac6bce7791c99f7edced666c3bc3ead345e3b3..9ab06c464904081eeb8b17911b61be5536e6ddec 100644 (file)
@@ -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)
 {
index eb1613c1176c9c41e10280bf106a2507c1e2d079..177328115c3e0e6269e7497fd25846afc2693b93 100644 (file)
@@ -37,7 +37,6 @@ canvas_sources = [
         'flag.cc',
        'group.cc',
         'image.cc',
-       'item_factory.cc',
        'line.cc',
         'line_set.cc',
        'lookup_table.cc',