- wxList doodleSegments;
-
- DrawingDocument(void);
- ~DrawingDocument(void);
-
-#if wxUSE_STD_IOSTREAM
- ostream& SaveObject(ostream& text_stream);
- istream& LoadObject(istream& text_stream);
-#else
- wxOutputStream& SaveObject(wxOutputStream& stream);
- wxInputStream& LoadObject(wxInputStream& stream);
-#endif
-
- inline wxList& GetDoodleSegments(void) const { return (wxList&) doodleSegments; };
+ DrawingDocument() : wxDocument() { }
+
+ DocumentOstream& SaveObject(DocumentOstream& stream);
+ DocumentIstream& LoadObject(DocumentIstream& stream);
+
+ // add a new segment to the document
+ void AddDoodleSegment(const DoodleSegment& segment);
+
+ // remove the last segment, if any, and copy it in the provided pointer if
+ // not NULL and return true or return false and do nothing if there are no
+ // segments
+ bool PopLastSegment(DoodleSegment *segment);
+
+ // get direct access to our segments (for DrawingView)
+ const DoodleSegments& GetSegments() const { return m_doodleSegments; }
+
+private:
+ void DoUpdate();
+
+ DoodleSegments m_doodleSegments;
+
+ DECLARE_DYNAMIC_CLASS(DrawingDocument)