diff --git a/config/ChangeLog b/config/ChangeLog index b1941397a6..a3add6c9e6 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2004-11-16 Lars Gullik Bjonnes + + * lyxinclude.m4 (enable_debug): Add support for stdlibc++ concept + checks on gcc >3.4. + 2004-10-23 Georg Baum * lyxinclude.m4 (LYX_VERSION_SUFFIX): set RPM_VERSION_SUFFIX even diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 983397ff99..4e92b88c35 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -220,7 +220,11 @@ if test x$GXX = xyes; then esac if test x$enable_debug = xyes ; then case $gxx_version in + 3.3*) CXXFLAGS="-g $CXXFLAGS" + AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS, 1, [libstdc++ concept checking]) + ;; 3.4*|3.5*) CXXFLAGS="-g $CXXFLAGS" + AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS, 1, [libstdc++ concept checking]) AC_DEFINE(_GLIBCXX_DEBUG, 1, [libstdc++ debug mode]) AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [libstdc++ pedantic debug mode]) ;; diff --git a/src/ChangeLog b/src/ChangeLog index 8cac07dcf1..21118ccdbe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,23 @@ +2004-11-16 Lars Gullik Bjonnes + + * pariterator.h: add typdefs for value_type, difference_type, + pointer and reference to satisfy concept checks. Also add default + constructor for same reason. + + * pariterator.C (operator++): add post-increment operator to + satisfy concept checks. + + * lyxtextclasslist.h: include lyxtextclass.h to satisfy concept + checks. + + * RowList_fwd.h: include lyxrow.h to satisfy concept checks. + + * ParagraphList_fwd.h: include paragraph.h to satisfy concept + checks. Also rename base_type to BaseType to follow naming + standard better. + + * FloatList.h: include Floating.h to satisfy concept checks. + 2004-11-15 Jean-Marc Lasgouttes * lyxfunc.C (getStatus): when the origin of the request is menu or @@ -45,7 +65,7 @@ * kbmap.C (defkey): set the origin of func to KEYBOARD - * MenuBackend.C (MenuItem): + * MenuBackend.C (MenuItem): * ToolbarBackend.C (add): set the origin of func to UI * funcrequest.[Ch]: add origin member, which indicates which part diff --git a/src/FloatList.h b/src/FloatList.h index c8a9df46e2..94eb53ee89 100644 --- a/src/FloatList.h +++ b/src/FloatList.h @@ -12,12 +12,12 @@ #ifndef FLOATLIST_H #define FLOATLIST_H +#include "Floating.h" + #include #include -class Floating; - /// class FloatList { public: diff --git a/src/ParagraphList_fwd.h b/src/ParagraphList_fwd.h index a937a89180..df6d55041d 100644 --- a/src/ParagraphList_fwd.h +++ b/src/ParagraphList_fwd.h @@ -12,21 +12,21 @@ #ifndef PARAGRAPH_LIST_FWD_H #define PARAGRAPH_LIST_FWD_H -#include +#include "paragraph.h" -class Paragraph; +#include class ParagraphList : public std::vector { public: /// - typedef std::vector base_type; + typedef std::vector BaseType; /// ParagraphList(); /// template ParagraphList(Iter beg, Iter end) - : base_type(beg, end) + : BaseType(beg, end) {} }; diff --git a/src/RowList_fwd.h b/src/RowList_fwd.h index a86fae5e53..1682257b0a 100644 --- a/src/RowList_fwd.h +++ b/src/RowList_fwd.h @@ -12,9 +12,9 @@ #ifndef ROW_LIST_FWD_H #define ROW_LIST_FWD_H -#include +#include "lyxrow.h" -class Row; +#include typedef std::vector RowList; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 5754011163..f429aeef52 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,23 @@ +2004-11-16 Lars Gullik Bjonnes + + * Layoutengine.[Ch]: Break up circular dependency between Box and + BoxList with the use of boost::shared_ptr. Modify to fit + * XFormsMenubar.[Ch]: modify to fit + * XFormsToolbar.[Ch]: modify to fit + * XFormsView.[Ch]: modify to fit + * XMiniBuffer.[Ch]: modify to fit + * XWorkArea.[Ch]: modify to fit + + * LayoutEngine.C (show): use std::for_each + (hide): ditto + + * FormPreferences.h: include xforms_helpers.h to satisfy concept + checks. + + * FormCharacter.h: include LColor.h to satisfy concept checks. + + * FormCharacter.C: do no include LColor.h + 2004-11-15 Jean-Marc Lasgouttes * XFormsView.C (hasFocus): new method, always returns true for now @@ -11,14 +31,14 @@ 2004-11-05 Jean-Marc Lasgouttes - * XFormsToolbar.C (C_ToolbarCB, selected): + * XFormsToolbar.C (C_ToolbarCB, selected): * XFormsMenubar.C (MenuCallback): do not use the verbose argument to dispatch 2004-11-06 Lars Gullik Bjonnes * RadioButtonGroup.C (set): use bind, equal_to instead of - equal_2nd_in_pair + equal_2nd_in_pair * xformsImage.C (loadableFormats): use bind, equal_to instead of compare_memfun diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index ac126ba2f5..b3fa460fec 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -20,8 +20,6 @@ #include "controllers/frnt_lang.h" #include "controllers/helper_funcs.h" -#include "LColor.h" - #include "support/lstrings.h" #include "lyx_forms.h" diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h index 328cc65abd..d07255d83f 100644 --- a/src/frontends/xforms/FormCharacter.h +++ b/src/frontends/xforms/FormCharacter.h @@ -16,7 +16,7 @@ #include "FormDialogView.h" #include "ControlCharacter.h" // for ControlCharacter enum -struct LColor_color; +#include "LColor.h" namespace lyx { namespace frontend { diff --git a/src/frontends/xforms/FormPreferences.h b/src/frontends/xforms/FormPreferences.h index 8adb810ddc..88df04cbce 100644 --- a/src/frontends/xforms/FormPreferences.h +++ b/src/frontends/xforms/FormPreferences.h @@ -16,6 +16,7 @@ #include "FormDialogView.h" #include "lyx_forms.h" +#include "xforms_helpers.h" #include @@ -49,9 +50,7 @@ struct FD_preferences_screen_fonts; struct FD_preferences_spelloptions; class FormColorpicker; -class NamedColor; class RGBColor; -class XformsColor; /** This class provides an XForms implementation of the FormPreferences Dialog. * The preferences dialog allows users to set/save their preferences. diff --git a/src/frontends/xforms/LayoutEngine.C b/src/frontends/xforms/LayoutEngine.C index 00e9a42304..84687d1677 100644 --- a/src/frontends/xforms/LayoutEngine.C +++ b/src/frontends/xforms/LayoutEngine.C @@ -24,8 +24,14 @@ #include "LayoutEngine.h" #include "lyx_forms.h" -#include +#include +#include + +using boost::bind; +using boost::shared_ptr; + +using std::for_each; namespace lyx { namespace frontend { @@ -49,9 +55,9 @@ void BoxList::clear() } -Box & BoxList::push_back(Box const & box) +shared_ptr BoxList::push_back(Box const & box) { - data_.push_back(box); + data_.push_back(shared_ptr(new Box(box))); return data_.back(); } @@ -176,7 +182,7 @@ bool Box::expandable() const BoxList::const_iterator it = children_.begin(); BoxList::const_iterator const end = children_.end(); for (; it != end; ++it) { - if (it->visible() && it->packing() == Expand) + if ((*it)->visible() && (*it)->packing() == Expand) return true; } @@ -211,10 +217,8 @@ void Box::show() visible_ = true; - BoxList::iterator it = children_.begin(); - BoxList::iterator const end = children_.end(); - for (; it != end; ++it) - it->show(); + for_each(children_.begin(), children_.end(), + bind(&Box::show, _1)); } @@ -222,10 +226,8 @@ void Box::hide() { visible_ = false; - BoxList::iterator it = children_.begin(); - BoxList::iterator const end = children_.end(); - for (; it != end; ++it) - it->hide(); + for_each(children_.begin(), children_.end(), + bind(&Box::hide, _1)); } @@ -280,12 +282,12 @@ void Box::shrinkMetrics() BoxList::iterator it = children_.begin(); BoxList::iterator const end = children_.end(); for (; it != end; ++it) { - if (!it->visible()) + if (!(*it)->visible()) continue; - it->shrinkMetrics(); - dimension_t child_width = it->width(); - dimension_t child_height = it->height(); + (*it)->shrinkMetrics(); + dimension_t child_width = (*it)->width(); + dimension_t child_height = (*it)->height(); if (orientation_ == Horizontal) { width += child_width; @@ -326,12 +328,12 @@ void Box::expandHbox(dimension_t x_in, dimension_t y_in, BoxList::const_iterator cit = children_.begin(); BoxList::const_iterator const cend = children_.end(); for (; cit != cend; ++cit) { - if (cit->visible()) { + if ((*cit)->visible()) { nvisible_children += 1; - if (cit->expandable()) + if ((*cit)->expandable()) nexpanded_children += 1; else - w_fixed += cit->width(); + w_fixed += (*cit)->width(); } } @@ -352,11 +354,11 @@ void Box::expandHbox(dimension_t x_in, dimension_t y_in, BoxList::iterator it = children_.begin(); BoxList::iterator const end = children_.end(); for (; it != end; ++it) { - if (!it->visible()) + if (!(*it)->visible()) continue; - dimension_t w_child = it->width(); - if (it->expandable()) { + dimension_t w_child = (*it)->width(); + if ((*it)->expandable()) { if (nexpanded_children == 1) w_child = std::max(w_child, width); else @@ -366,7 +368,7 @@ void Box::expandHbox(dimension_t x_in, dimension_t y_in, width -= w_child; } - it->expandMetrics(x_child, y_child, w_child, h_child); + (*it)->expandMetrics(x_child, y_child, w_child, h_child); x_child += w_child; } } @@ -382,12 +384,12 @@ void Box::expandVbox(dimension_t x_in, dimension_t y_in, BoxList::const_iterator cit = children_.begin(); BoxList::const_iterator const cend = children_.end(); for (; cit != cend; ++cit) { - if (cit->visible()) { + if ((*cit)->visible()) { nvisible_children += 1; - if (cit->expandable()) + if ((*cit)->expandable()) nexpanded_children += 1; else - h_fixed += cit->height(); + h_fixed += (*cit)->height(); } } @@ -408,11 +410,11 @@ void Box::expandVbox(dimension_t x_in, dimension_t y_in, BoxList::iterator it = children_.begin(); BoxList::iterator const end = children_.end(); for (; it != end; ++it) { - if (!it->visible()) + if (!(*it)->visible()) continue; - dimension_t h_child = it->height(); - if (it->expandable()) { + dimension_t h_child = (*it)->height(); + if ((*it)->expandable()) { if (nexpanded_children == 1) h_child = std::max(h_child, height); else @@ -421,17 +423,17 @@ void Box::expandVbox(dimension_t x_in, dimension_t y_in, height -= h_child; } - it->expandMetrics(x_child, y_child, w_child, h_child); + (*it)->expandMetrics(x_child, y_child, w_child, h_child); y_child += h_child; } } -Box & WidgetMap::add(FL_OBJECT * ob, BoxList & container, +shared_ptr WidgetMap::add(FL_OBJECT * ob, BoxList & container, dimension_t min_w, dimension_t min_h) { - Box & box = container.push_back(Box(min_w, min_h)); - widgets_[ob] = &box; + shared_ptr box = container.push_back(Box(min_w, min_h)); + widgets_[ob] = box; return box; } @@ -458,16 +460,17 @@ void WidgetMap::updateMetrics() const } -Box & embed(FL_OBJECT * ob, BoxList & container, WidgetMap & widgets, int bw) +shared_ptr +embed(FL_OBJECT * ob, BoxList & container, WidgetMap & widgets, int bw) { container.push_back(Box(0, bw)); - Box & middle = container.push_back(Box(0, 0)); - middle.set(Box::Horizontal); + shared_ptr middle = container.push_back(Box(0, 0)); + middle->set(Box::Horizontal); container.push_back(Box(0, bw)); - middle.children().push_back(Box(bw, 0)); - Box & center = widgets.add(ob, middle.children(), 0, 0); - middle.children().push_back(Box(bw, 0)); + middle->children().push_back(Box(bw, 0)); + shared_ptr center = widgets.add(ob, middle->children(), 0, 0); + middle->children().push_back(Box(bw, 0)); return center; } diff --git a/src/frontends/xforms/LayoutEngine.h b/src/frontends/xforms/LayoutEngine.h index 8e3e105499..b442bf2b61 100644 --- a/src/frontends/xforms/LayoutEngine.h +++ b/src/frontends/xforms/LayoutEngine.h @@ -15,6 +15,9 @@ #define LAYOUT_ENGINE_H #include "forms_fwd.h" + +#include + #include #include @@ -25,7 +28,7 @@ class Box; class BoxList { public: - typedef std::list Container; + typedef std::list > Container; typedef Container::size_type size_type; typedef Container::iterator iterator; typedef Container::const_iterator const_iterator; @@ -34,7 +37,7 @@ public: size_type size() const; void clear(); - Box & push_back(Box const &); + boost::shared_ptr push_back(Box const &); iterator begin(); iterator end(); @@ -167,12 +170,13 @@ public: typedef Box::dimension_t dimension_t; /// \returns the just-added Box. - Box & add(FL_OBJECT * widget, BoxList & container, - dimension_t min_w, dimension_t min_h); + boost::shared_ptr + add(FL_OBJECT * widget, BoxList & container, + dimension_t min_w, dimension_t min_h); void updateMetrics() const; private: - typedef std::map DataMap; + typedef std::map > DataMap; DataMap widgets_; }; @@ -181,7 +185,8 @@ private: * Thereafter, hand control of its metrics to \c widgets. * \returns the Box containing \c ob. */ -Box & embed(FL_OBJECT * ob, BoxList & container, WidgetMap & widgets, int bw); +boost::shared_ptr +embed(FL_OBJECT * ob, BoxList & container, WidgetMap & widgets, int bw); } // namespace frontend } // namespace lyx diff --git a/src/frontends/xforms/XFormsMenubar.C b/src/frontends/xforms/XFormsMenubar.C index 034aae29b1..31aaac9475 100644 --- a/src/frontends/xforms/XFormsMenubar.C +++ b/src/frontends/xforms/XFormsMenubar.C @@ -27,6 +27,8 @@ #include "lyx_forms.h" +using boost::shared_ptr; + using std::distance; using std::endl; using std::for_each; @@ -88,8 +90,7 @@ extern "C" { XFormsMenubar::XFormsMenubar(LyXView * view, MenuBackend const & mb) : owner_(static_cast(view)), - menubackend_(&mb), - menubar_(0) + menubackend_(&mb) { owner_->metricsUpdated.connect(boost::bind(&WidgetMap::updateMetrics, &widgets_)); @@ -105,24 +106,24 @@ XFormsMenubar::~XFormsMenubar() void XFormsMenubar::makeMenubar(Menu const & menu) { // Draw a frame around the whole. - BoxList & boxlist = owner_->getBox(XFormsView::Top).children(); + BoxList & boxlist = owner_->getBox(XFormsView::Top)->children(); FL_OBJECT * frame = fl_add_frame(FL_UP_FRAME, 0, 0, 0, 0, ""); fl_set_object_resize(frame, FL_RESIZE_ALL); fl_set_object_gravity(frame, NorthWestGravity, NorthEastGravity); - menubar_ = &widgets_.add(frame, boxlist, 0, mheight); + menubar_ = widgets_.add(frame, boxlist, 0, mheight); // The menubar contains three vertically-aligned Boxes, // the center one of which is to contain the buttons, // aligned horizontally. // The other two provide some visual padding. menubar_->children().push_back(Box(0, yloc)); - Box & menubar_center = menubar_->children().push_back(Box(0,0)); - menubar_center.set(Box::Horizontal); + shared_ptr menubar_center = menubar_->children().push_back(Box(0,0)); + menubar_center->set(Box::Horizontal); menubar_->children().push_back(Box(0, yloc)); - BoxList & menubar_buttons = menubar_center.children(); + BoxList & menubar_buttons = menubar_center->children(); // Add the buttons. Menu::const_iterator i = menu.begin(); diff --git a/src/frontends/xforms/XFormsMenubar.h b/src/frontends/xforms/XFormsMenubar.h index b73c480c1d..07c945ef16 100644 --- a/src/frontends/xforms/XFormsMenubar.h +++ b/src/frontends/xforms/XFormsMenubar.h @@ -72,7 +72,7 @@ private: /// MenuBackend const * menubackend_; /// - Box * menubar_; + boost::shared_ptr menubar_; /// WidgetMap widgets_; /// diff --git a/src/frontends/xforms/XFormsToolbar.C b/src/frontends/xforms/XFormsToolbar.C index 243ef7e618..ccee31a916 100644 --- a/src/frontends/xforms/XFormsToolbar.C +++ b/src/frontends/xforms/XFormsToolbar.C @@ -38,6 +38,8 @@ #include #include +using boost::shared_ptr; + using std::distance; using std::endl; using std::string; @@ -200,14 +202,13 @@ namespace frontend { XFormsToolbar::XFormsToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & o) - : toolbar_(0), - toolbar_buttons_(0), + : toolbar_buttons_(0), owner_(static_cast(o)), tooltip_(new Tooltips) { position_ = getPosition(tbb.flags); - BoxList & boxlist = owner_.getBox(position_).children(); - toolbar_ = &boxlist.push_back(Box(0,0)); + BoxList & boxlist = owner_.getBox(position_)->children(); + toolbar_ = boxlist.push_back(Box(0,0)); // If the toolbar is horizontal, then it contains three // vertically-aligned Boxes,the center one of which is to @@ -235,9 +236,9 @@ XFormsToolbar::XFormsToolbar(ToolbarBackend::Toolbar const & tbb, toolbar_->children().push_back(Box(padding, padding)); - Box & toolbar_center = toolbar_->children().push_back(Box(0,0)); - toolbar_center.set(toolbar_orientation); - toolbar_buttons_ = &toolbar_center.children(); + shared_ptr toolbar_center = toolbar_->children().push_back(Box(0,0)); + toolbar_center->set(toolbar_orientation); + toolbar_buttons_ = &toolbar_center->children(); toolbar_->children().push_back(Box(padding, padding)); @@ -249,7 +250,6 @@ XFormsToolbar::XFormsToolbar(ToolbarBackend::Toolbar const & tbb, ToolbarBackend::item_iterator end = tbb.items.end(); for (; it != end; ++it) add(it->first, it->second); - } diff --git a/src/frontends/xforms/XFormsToolbar.h b/src/frontends/xforms/XFormsToolbar.h index 3e7c2fddf7..8e2c680e95 100644 --- a/src/frontends/xforms/XFormsToolbar.h +++ b/src/frontends/xforms/XFormsToolbar.h @@ -97,7 +97,7 @@ public: /// XFormsView::Position position_; /// - Box * toolbar_; + boost::shared_ptr toolbar_; /// BoxList * toolbar_buttons_; /// diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 00a0039c32..9abe89488a 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -27,6 +27,8 @@ #include +using boost::shared_ptr; + using std::abs; using std::endl; using std::string; @@ -69,22 +71,22 @@ XFormsView::XFormsView(int width, int height) int const air = 2; // Logical layout of the boxes making up the LyX window. - Box & top = window_.children().push_back(Box(0,0)); - Box & middle = window_.children().push_back(Box(0,0)); - middle.set(Box::Horizontal); - Box & bottom = window_.children().push_back(Box(0,0)); + shared_ptr top = window_.children().push_back(Box(0,0)); + shared_ptr middle = window_.children().push_back(Box(0,0)); + middle->set(Box::Horizontal); + shared_ptr bottom = window_.children().push_back(Box(0,0)); - Box & left = middle.children().push_back(Box(air,0)); - Box & center = middle.children().push_back(Box(0,0)); - center.set(Box::Expand); - Box & right = middle.children().push_back(Box(air,0)); + shared_ptr left = middle->children().push_back(Box(air,0)); + shared_ptr center = middle->children().push_back(Box(0,0)); + center->set(Box::Expand); + shared_ptr right = middle->children().push_back(Box(air,0)); // Define accessors to the various boxes. - box_map_[Top] = ⊤ - box_map_[Bottom] = ⊥ - box_map_[Left] = &left; - box_map_[Center] = ¢er; - box_map_[Right] = &right; + box_map_[Top] = top; + box_map_[Bottom] = bottom; + box_map_[Left] = left; + box_map_[Center] = center; + box_map_[Right] = right; // Define the XForms components making up the window. // Each uses the layout engine defined above to control its @@ -145,11 +147,11 @@ XFormsView::~XFormsView() } -Box & XFormsView::getBox(Position pos) const +shared_ptr XFormsView::getBox(Position pos) const { - std::map::const_iterator it = box_map_.find(pos); + BoxMap::const_iterator it = box_map_.find(pos); BOOST_ASSERT(it != box_map_.end()); - return *it->second; + return it->second; } diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index f6ea49a8e7..7f77b76937 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -48,7 +48,7 @@ public: ~XFormsView(); /// Accessor to the appropriate layout Box. - Box & getBox(Position pos) const; + boost::shared_ptr getBox(Position pos) const; /** * show - display the top-level window @@ -96,8 +96,10 @@ private: /// The top-most box of the layout engine containing all other boxes. Box window_; + typedef std::map > BoxMap; + // Accessors to the various Boxes. - std::map box_map_; + BoxMap box_map_; /// the minibuffer boost::scoped_ptr minibuffer_; diff --git a/src/frontends/xforms/XMiniBuffer.C b/src/frontends/xforms/XMiniBuffer.C index 54c983f030..a6b228aa99 100644 --- a/src/frontends/xforms/XMiniBuffer.C +++ b/src/frontends/xforms/XMiniBuffer.C @@ -25,6 +25,8 @@ #include +using boost::shared_ptr; + using std::vector; using std::string; @@ -53,11 +55,11 @@ XMiniBuffer::XMiniBuffer(XFormsView & owner, // 2 pixel deep frame. int const air = 2; - BoxList & boxlist = owner.getBox(XFormsView::Bottom).children(); - minibuffer_ = &boxlist.push_back(Box(0,0)); - Box & center = embed(input_, minibuffer_->children(), widgets_, air); - center.set(Box::Expand); - center.setMinimumDimensions(0, 25); + BoxList & boxlist = owner.getBox(XFormsView::Bottom)->children(); + minibuffer_ = boxlist.push_back(Box(0,0)); + shared_ptr center = embed(input_, minibuffer_->children(), widgets_, air); + center->set(Box::Expand); + center->setMinimumDimensions(0, 25); owner.metricsUpdated.connect(boost::bind(&WidgetMap::updateMetrics, &widgets_)); diff --git a/src/frontends/xforms/XMiniBuffer.h b/src/frontends/xforms/XMiniBuffer.h index ea75f214cf..42f8744f68 100644 --- a/src/frontends/xforms/XMiniBuffer.h +++ b/src/frontends/xforms/XMiniBuffer.h @@ -109,7 +109,7 @@ private: /// are we showing an informational temporary message ? bool info_shown_; /// - Box * minibuffer_; + boost::shared_ptr minibuffer_; /// WidgetMap widgets_; }; diff --git a/src/frontends/xforms/XWorkArea.C b/src/frontends/xforms/XWorkArea.C index bf2e367925..51f9a4e405 100644 --- a/src/frontends/xforms/XWorkArea.C +++ b/src/frontends/xforms/XWorkArea.C @@ -24,6 +24,8 @@ #include +using boost::shared_ptr; + using std::abs; using std::dec; using std::endl; @@ -147,17 +149,17 @@ XWorkArea::XWorkArea(LyXView & owner, int w, int h) // Hand control of the layout of these widgets to the // Layout Engine. XFormsView & xview = dynamic_cast(owner); - BoxList & boxlist = xview.getBox(XFormsView::Center).children(); + BoxList & boxlist = xview.getBox(XFormsView::Center)->children(); - wa_box_ = &boxlist.push_back(Box(0,0)); + wa_box_ = boxlist.push_back(Box(0,0)); wa_box_->set(Box::Horizontal); - Box & frame_box = widgets_.add(frame, wa_box_->children(), 0, 0); - frame_box.set(Box::Expand); + shared_ptr frame_box = widgets_.add(frame, wa_box_->children(), 0, 0); + frame_box->set(Box::Expand); int const bw = int(abs(fl_get_border_width())); - Box & wa_box = embed(work_area, frame_box.children(), widgets_, bw); - wa_box.set(Box::Expand); + shared_ptr wa_box = embed(work_area, frame_box->children(), widgets_, bw); + wa_box->set(Box::Expand); widgets_.add(scrollbar, wa_box_->children(), 17, 0); diff --git a/src/frontends/xforms/XWorkArea.h b/src/frontends/xforms/XWorkArea.h index 4936c38a22..d5f6d403d1 100644 --- a/src/frontends/xforms/XWorkArea.h +++ b/src/frontends/xforms/XWorkArea.h @@ -88,7 +88,7 @@ private: /// the current document's height (for scrollbar) int doc_height_; /// - Box * wa_box_; + boost::shared_ptr wa_box_; /// WidgetMap widgets_; }; diff --git a/src/lyxtextclasslist.h b/src/lyxtextclasslist.h index 1560318234..978eb2afbe 100644 --- a/src/lyxtextclasslist.h +++ b/src/lyxtextclasslist.h @@ -12,6 +12,8 @@ #ifndef LYXTEXTCLASSLIST_H #define LYXTEXTCLASSLIST_H +#include "lyxtextclass.h" + #include "support/types.h" #include @@ -19,7 +21,6 @@ #include #include -class LyXTextClass; class LyXLayout; /// Reads the style files diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 646189be1f..4c6fa00bd1 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2004-11-16 Lars Gullik Bjonnes + + * math_inset.h: include math_data.h to satisfy concept checks. + 2004-11-15 Jean-Marc Lasgouttes * math_hullinset.C (getStatus): typo in lfun argument diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 56157bbb9d..d2b26bc21a 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -13,6 +13,8 @@ #ifndef MATH_INSET_H #define MATH_INSET_H +#include "math_data.h" + #include "insets/insetbase.h" #include @@ -52,9 +54,6 @@ class MathUnknownInset; class RefInset; -class MathArray; -class MathAtom; - class NormalStream; class OctaveStream; class MapleStream; diff --git a/src/pariterator.C b/src/pariterator.C index 8d6fe92056..c4d027f540 100644 --- a/src/pariterator.C +++ b/src/pariterator.C @@ -53,6 +53,18 @@ ParIterator & ParIterator::operator++() } +ParIterator ParIterator::operator++(int) +{ + ParIterator tmp(*this); + forwardPar(); + return tmp; +} + + +#if 0 +// Unused member functions. Also having this makes ParIterator not be +// an forward iterator anymore. So unless we change that, this function +// should not be compiled/used. (Lgb) ParIterator & ParIterator::operator--() { #ifdef WITH_WARNINGS @@ -61,6 +73,7 @@ ParIterator & ParIterator::operator--() // DocIterator::backwardPar(); return *this; } +#endif Paragraph & ParIterator::operator*() const diff --git a/src/pariterator.h b/src/pariterator.h index 4ce2b05994..90e93f1842 100644 --- a/src/pariterator.h +++ b/src/pariterator.h @@ -31,6 +31,17 @@ class ParIterator : public std::iterator, public DocIterator { public: + typedef std::iterator StdIt; + + typedef StdIt::value_type value_type; + typedef StdIt::difference_type difference_type; + typedef StdIt::pointer pointer; + typedef StdIt::reference reference; + + /// + ParIterator() : DocIterator() {} + + /// ParIterator(InsetBase &, lyx::par_type pit); /// @@ -43,7 +54,9 @@ public: /// ParIterator & operator++(); /// - ParIterator & operator--(); + ParIterator operator++(int); + /// See comment in pariterator.C + //ParIterator & operator--(); /// Paragraph & operator*() const; /// diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 182d341e79..379521bf59 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,10 @@ +2004-11-16 Lars Gullik Bjonnes + + * forkedcontr.C (find_pid): simplify and also make pass concept + checks. + (handleCompletedProcesses): make sure that we do not slice the + object and satisfy concept checks. + 2004-11-09 Georg Baum * filetools.[Ch] (getFormatFromContents): don't guess format from @@ -6,7 +13,7 @@ 2004-11-07 Lars Gullik Bjonnes - * Make it clearer where include files are comming from. + * Make it clearer where include files are comming from. 2004-11-06 Lars Gullik Bjonnes diff --git a/src/support/forkedcontr.C b/src/support/forkedcontr.C index 24b5e53815..c4ab4371ac 100644 --- a/src/support/forkedcontr.C +++ b/src/support/forkedcontr.C @@ -225,17 +225,13 @@ void ForkedcallsController::addCall(ForkedProcess const & newcall) } -ForkedcallsController::iterator ForkedcallsController::find_pid(pid_t pid) +ForkedcallsController::iterator + ForkedcallsController::find_pid(pid_t pid) { - typedef boost::indirect_iterator iterator; - - iterator begin = boost::make_indirect_iterator(forkedCalls.begin()); - iterator end = boost::make_indirect_iterator(forkedCalls.end()); - iterator it = find_if(begin, end, - bind(equal_to(), - bind(&Forkedcall::pid, _1), - pid)); - return it.base(); + return find_if(forkedCalls.begin(), forkedCalls.end(), + bind(equal_to(), + bind(&Forkedcall::pid, _1), + pid)); } @@ -261,7 +257,7 @@ void ForkedcallsController::handleCompletedProcesses() // Block the SIGCHLD signal. sigprocmask(SIG_BLOCK, &newMask, &oldMask); - for (int i = 0; i != 1+current_child; ++i) { + for (int i = 0; i != 1 + current_child; ++i) { Data & store = reaped_children[i]; if (store.pid == -1) { @@ -278,17 +274,17 @@ void ForkedcallsController::handleCompletedProcesses() // Eg, child was run in blocking mode continue; - ForkedProcess & child = *it->get(); + ListType::value_type child = (*it); bool remove_it = false; if (WIFEXITED(store.status)) { // Ok, the return value goes into retval. - child.setRetValue(WEXITSTATUS(store.status)); + child->setRetValue(WEXITSTATUS(store.status)); remove_it = true; } else if (WIFSIGNALED(store.status)) { // Child died, so pretend it returned 1 - child.setRetValue(1); + child->setRetValue(1); remove_it = true; } else if (WIFSTOPPED(store.status)) { @@ -299,15 +295,15 @@ void ForkedcallsController::handleCompletedProcesses() } else { lyxerr << "LyX: Something rotten happened while " - "waiting for child " << store.pid << endl; + << "waiting for child " << store.pid << endl; // Child died, so pretend it returned 1 - child.setRetValue(1); + child->setRetValue(1); remove_it = true; } if (remove_it) { - child.emitSignal(); + child->emitSignal(); forkedCalls.erase(it); } }