X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsession.h;h=4cf5dcb0808bd0c10c32f43d4bcd0f3f5c347941;hb=cd4033aef3a3f1efdb5a676b8bab3d367f53a830;hp=f36730b6bb6f859e2a557d838f3ed7c6b319b4e4;hpb=dbe93457cd49ad09c01691831bb59af93fe25556;p=lyx.git diff --git a/src/session.h b/src/session.h index f36730b6bb..4cf5dcb080 100644 --- a/src/session.h +++ b/src/session.h @@ -258,10 +258,14 @@ public: public: /// ToolbarInfo() : - state(ON), location(NOTSET) { } + state(ON), location(NOTSET), posx(0), posy(0) { } /// - ToolbarInfo(int s, int loc) : - state(static_cast(s)), location(static_cast(loc)) { } + ToolbarInfo(int s, int loc, int x=0, int y=0) : + state(static_cast(s)), + location(static_cast(loc)), + posx(x), + posy(y) + { } public: enum State { @@ -284,11 +288,20 @@ public: Location location; + /// x-position of the toolbar + int posx; + + /// y-position of the toolbar + int posy; + /// potentially, icons }; + typedef boost::tuple ToolbarItem; + /// info for each toolbar - typedef std::map ToolbarMap; + typedef std::vector ToolbarList; + public: /// @@ -300,11 +313,24 @@ public: /// 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 - ToolbarMap toolbars; + 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 {