From 375e2ac1a07025fe1db4a7ce9ff505f54e91b1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 21 Aug 2002 06:32:10 +0000 Subject: [PATCH] move a few things out-of-line git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5048 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/MenuBackend.C | 13 +++++++++++++ src/MenuBackend.h | 6 ++---- src/frontends/xforms/Menubar_pimpl.C | 16 ++++++++++++++++ src/frontends/xforms/Menubar_pimpl.h | 9 +++++---- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 71ded3f708..faa09a8a52 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -81,6 +81,13 @@ MenuItem::MenuItem(Kind kind, string const & label, } +MenuItem::MenuItem(Kind kind, string const & label, int action, + bool optional = false); + : kind_(kind), label_(label), action_(action), submenuname_(), + optional_(optional) +{} + + MenuItem::~MenuItem() {} @@ -104,6 +111,12 @@ Menu & Menu::add(MenuItem const & i) } +void Menu::submenu(Menu * menu) +{ + submenu_.reset(menu); +} + + Menu & Menu::read(LyXLex & lex) { enum Menutags { diff --git a/src/MenuBackend.h b/src/MenuBackend.h index b7a3abeb7a..12e38bf0a6 100644 --- a/src/MenuBackend.h +++ b/src/MenuBackend.h @@ -72,9 +72,7 @@ public: MenuItem(Kind kind, string const & label, int action, - bool optional = false) - : kind_(kind), label_(label), - action_(action), submenuname_(), optional_(optional) {} + bool optional = false); /// This one is just to please boost::shared_ptr<> ~MenuItem(); @@ -97,7 +95,7 @@ public: /// Menu * submenu() const { return submenu_.get(); } /// - void submenu(Menu * menu) { submenu_.reset(menu); } + void submenu(Menu * menu); private: //friend class MenuBackend; diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index f430ecd050..e9af3553f9 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -90,6 +90,10 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb) } +Menubar::Pimpl::~Pimpl() +{} + + void Menubar::Pimpl::makeMenubar(Menu const & menu) { FL_FORM * form = owner_->getForm(); @@ -417,3 +421,15 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button) fl_set_tabstop(default_tabstop); } + + +Menubar::Pimpl::ItemInfo::ItemInfo + (Menubar::Pimpl * p, MenuItem const * i, FL_OBJECT * o) + : pimpl_(p), obj_(o) +{ + item_.reset(i); +} + + +Menubar::Pimpl::ItemInfo::~ItemInfo() +{} diff --git a/src/frontends/xforms/Menubar_pimpl.h b/src/frontends/xforms/Menubar_pimpl.h index 16dfdac303..dd0e6afe6d 100644 --- a/src/frontends/xforms/Menubar_pimpl.h +++ b/src/frontends/xforms/Menubar_pimpl.h @@ -39,6 +39,8 @@ struct Menubar::Pimpl { public: /// Pimpl(LyXView *, MenuBackend const &); + /// + ~Pimpl(); /// update the state of the menuitems void update(); @@ -62,7 +64,7 @@ private: std::vector & smn, bool & all_disabled); // - void makeMenubar(Menu const &menu); + void makeMenubar(Menu const & menu); /// XFormsView * owner_; @@ -72,9 +74,8 @@ private: struct ItemInfo { /// ItemInfo(Menubar::Pimpl * p, MenuItem const * i, - FL_OBJECT * o) - - : pimpl_(p), obj_(o) { item_.reset(i); } + FL_OBJECT * o); + ~ItemInfo(); /// Menubar::Pimpl * pimpl_; ///