+ BookmarkList & load() { return bookmarks; }
+
+private:
+ /// temp bookmark (previously saved_positions[0]), this is really ugly
+ /// c.f. ./frontends/controllers/ControlRef.C
+ /// FIXME: a separate LFUN may be a better solution
+ Bookmark temp_bookmark;
+
+ /// a list of bookmarks
+ BookmarkList bookmarks;
+
+ ///
+ unsigned int const max_bookmarks;
+};
+
+
+class ToolbarSection : SessionSection
+{
+public:
+ /// information about a toolbar, not all information can be
+ /// saved/restored by all frontends, but this class provides
+ /// a superset of things that can be managed by session.
+ class ToolbarInfo
+ {
+ public:
+ ///
+ ToolbarInfo() :
+ state(ON), location(NOTSET), posx(0), posy(0) { }
+ ///
+ ToolbarInfo(int s, int loc, int x=0, int y=0) :
+ state(static_cast<State>(s)),
+ location(static_cast<Location>(loc)),
+ posx(x),
+ posy(y)
+ { }
+
+ public:
+ enum State {
+ ON,
+ OFF,
+ AUTO
+ };
+
+ /// on/off/auto
+ State state;
+
+ /// location: this can be intepreted differently.
+ enum Location {
+ TOP,
+ BOTTOM,
+ LEFT,
+ RIGHT,
+ NOTSET
+ };
+
+ Location location;
+
+ /// x-position of the toolbar
+ int posx;
+
+ /// y-position of the toolbar
+ int posy;
+
+ /// potentially, icons
+ };
+
+ typedef boost::tuple<std::string, ToolbarInfo> ToolbarItem;
+
+ /// info for each toolbar
+ typedef std::vector<ToolbarItem> ToolbarList;
+
+
+public:
+ ///
+ void read(std::istream & is);
+
+ ///
+ void write(std::ostream & os) const;
+
+ /// return reference to toolbar info, create a new one if needed
+ ToolbarInfo & load(std::string const & name);
+
+ /// toolbar begin
+ ToolbarList::const_iterator begin() { return toolbars.begin(); }
+
+ /// toolbar end
+ ToolbarList::const_iterator end() { return toolbars.end(); }
+
+private:
+ /// toolbar information
+ ToolbarList toolbars;
+};
+
+/// comparison operator to sort toolbars, the rules are:
+/// ON before OFF
+/// TOP < BOTTOM < LEFT < RIGHT
+/// Line at each side
+/// order in each line
+bool operator< (ToolbarSection::ToolbarItem const & a, ToolbarSection::ToolbarItem const & b);
+
+
+class SessionInfoSection : SessionSection
+{
+public:
+ ///
+ typedef std::map<std::string, std::string> MiscInfo;
+
+public:
+ ///
+ void read(std::istream & is);
+
+ ///
+ void write(std::ostream & os) const;