From: Lars Gullik Bjønnes Date: Thu, 4 Jul 2002 17:45:35 +0000 (+0000) Subject: Changes to make RH-7.3 be able to run lyx. X-Git-Tag: 1.6.10~18966 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=de236c41d824990bbf5ea18dd391d113442ffe53;p=features.git Changes to make RH-7.3 be able to run lyx. Also changes to make gcc 3.1 compiled lyx exit cleanly after above changes. Move operator== out out InsetCommandParams. Change some signals in GraphicsImage to function instead. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4535 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/po/POTFILES.in b/po/POTFILES.in index 61ddad4474..b45b39034d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -8,7 +8,6 @@ src/converter.C src/CutAndPaste.C src/debug.C src/exporter.C -src/ext_l10n.h src/FloatList.C src/frontends/controllers/biblio.C src/frontends/controllers/ButtonController.h diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 58eb2867a3..b911b35cc6 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,9 @@ +2002-07-04 Lars Gullik Bjønnes + + * screen.C (SplashScreen): we change + (topCursorVisible): ws change + (greyOut): divide by 2 instead of multiplying with 0.5 + 2002-07-02 Lars Gullik Bjønnes * Dialogs.h: remove static from redrawGUI and diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 7bd0b62f7c..6afca5d7da 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-07-04 Lars Gullik Bjønnes + + * ControlBibtex.C (applyParamsToInset): ws change + 2002-06-27 Juergen Spitzmueller * ControlInclude.C: Add warning if absolute path name and diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 9f8df298d6..832b86a4a1 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -49,7 +49,7 @@ void ControlBibtex::applyParamsToInset() // We need to do a redraw because the maximum // InsetBibKey width could have changed -#warning are you sure you need this repaint() ? +#warning are you sure you need this repaint() ? lv_.view()->repaint(); lv_.view()->fitCursor(); } diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 6f874d9f79..31220bf0f7 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -94,8 +94,8 @@ SplashScreen::SplashScreen() loader_.reset(file); // We aren't interested here in when the image is loaded. // If it isn't ready when we want it, then we ignore it. -// loader_->statusChanged.connect( -// boost::bind(&SplashScreen::statusChanged, this)); +// loader_->statusChanged.connect( +// boost::bind(&SplashScreen::statusChanged, this)); if (loader_.status() == grfx::WaitingToLoad) loader_.startLoading(); } @@ -189,8 +189,7 @@ unsigned int LyXScreen::topCursorVisible(LyXCursor const & cursor, int top_y) if (!row) return max(newtop, 0); - if (cursor.y() - row->baseline() + row->height() - - top_y >= vheight) { + if (cursor.y() - row->baseline() + row->height() - top_y >= vheight) { if (row->height() < vheight && row->height() > vheight / 4) { newtop = cursor.y() @@ -381,14 +380,14 @@ void LyXScreen::greyOut() int const w = splash_image->getWidth(); int const h = splash_image->getHeight(); - int x = 0.5 * (workarea().workWidth() - w); - int y = 0.5 * (workarea().workHeight() - h); + int x = (workarea().workWidth() - w) / 2; + int y = (workarea().workHeight() - h) / 2; workarea().getPainter().image(x, y, w, h, *splash_image); string const & splash_text = splash.text(); LyXFont const & splash_font = splash.font(); - + x += 260; y += 265; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 34bfff30e6..d173b53e3d 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,13 +1,31 @@ +2002-07-04 Lars Gullik Bjønnes + + * lyx_gui.C (init_graphics): boost::function assign, not + boost::signal connect. + + * combox.C (Combox): what remove does is now done implicitly from + XFormsView destructor. + + * XMiniBuffer.C (peek_event): comment last arg to avoid warning. + + * XFormsView.h: form_ is now a raw pointer not a scoped_ptr. + + * XFormsView.C (XFormsView): hide and free form_ + (getForm): raw pointer return + (create_form_form_main): raw pointer set + + * Toolbar_pimpl.C (toolbarItem): whet clean does is now done + implicitly from XFormsView destructor. 2002-07-04 André Pönitz * FormInset.[Ch]: reduce #include depencies - + * guiapi.C: suppress compiler warning 2002-06-27 Juergen Spitzmueller - * FormInclude.C: Comment out unneeded and wrong update mechanism + * FormInclude.C: Comment out unneeded and wrong update mechanism (related to bug #459) *forms/form_include.fd: define missing callbacks (bug #459) diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 6aee2b1f6c..25304f9d4e 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -53,7 +53,9 @@ Toolbar::Pimpl::toolbarItem::toolbarItem() Toolbar::Pimpl::toolbarItem::~toolbarItem() { - clean(); + // It seems that now this is taken care of + // in the XFormsView destructor. (Lgb) + // clean(); } diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 8fec911401..a8f7a5e5ee 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -72,7 +72,11 @@ XFormsView::XFormsView(int width, int height) } -XFormsView::~XFormsView() {} +XFormsView::~XFormsView() +{ + fl_hide_form(form_); + fl_free_form(form_); +} /// Redraw the main form. @@ -88,7 +92,7 @@ void XFormsView::redraw() FL_FORM * XFormsView::getForm() const { - return form_.get(); + return form_; } @@ -133,7 +137,7 @@ void XFormsView::create_form_form_main(Dialogs & dia, int width, int height) */ { // the main form - form_.reset(fl_bgn_form(FL_NO_BOX, width, height)); + form_ = fl_bgn_form(FL_NO_BOX, width, height); getForm()->u_vdata = this; FL_OBJECT * obj = fl_add_box(FL_FLAT_BOX, 0, 0, width, height, ""); fl_set_object_color(obj, FL_MCOL, FL_MCOL); diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index de236a5422..32242db532 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -65,6 +65,6 @@ private: /// makes the main form. void create_form_form_main(Dialogs & d, int width, int height); /// the main form. - boost::scoped_ptr form_; + FL_FORM * form_; }; #endif diff --git a/src/frontends/xforms/XMiniBuffer.C b/src/frontends/xforms/XMiniBuffer.C index ee8160cfcd..b516d103f6 100644 --- a/src/frontends/xforms/XMiniBuffer.C +++ b/src/frontends/xforms/XMiniBuffer.C @@ -75,14 +75,15 @@ XMiniBuffer::~XMiniBuffer() } -int XMiniBuffer::peek_event(FL_OBJECT * ob, int event, int key, XEvent * xev) +int XMiniBuffer::peek_event(FL_OBJECT * ob, int event, + int key, XEvent * /*xev*/) { #if 0 if (dropdown_->isVisible()) { return dropdown_->peek(xev); } #endif - + switch (event) { case FL_UNFOCUS: messageMode(); @@ -98,7 +99,7 @@ int XMiniBuffer::peek_event(FL_OBJECT * ob, int event, int key, XEvent * xev) char const * tmp = fl_get_input(ob); input = tmp ? tmp : ""; } - + switch (key) { case XK_Down: diff --git a/src/frontends/xforms/combox.C b/src/frontends/xforms/combox.C index d181c92061..fa7a531755 100644 --- a/src/frontends/xforms/combox.C +++ b/src/frontends/xforms/combox.C @@ -84,7 +84,8 @@ Combox::Combox(combox_type t) Combox::~Combox() { - remove(); + // This is now handled by the XFormsView destructor (Lgb) + // remove(); } diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 044dfada97..207a33bcc8 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -300,11 +300,11 @@ void lyx_gui::init_graphics() #ifdef USE_XFORMS_IMAGE_LOADER // connect the image loader based on the xforms library - Image::newImage.connect(boost::bind(&xformsImage::newImage)); - Image::loadableFormats.connect(boost::bind(&xformsImage::loadableFormats)); + Image::newImage = boost::bind(&xformsImage::newImage); + Image::loadableFormats = boost::bind(&xformsImage::loadableFormats); #else // connect the image loader based on the XPM library - Image::newImage.connect(boost::bind(&ImageXPM::newImage)); - Image::loadableFormats.connect(boost::bind(&ImageXPM::loadableFormats)); + Image::newImage = boost::bind(&ImageXPM::newImage); + Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats); #endif } diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 3f4056bce5..458889a557 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2002-07-04 Lars Gullik Bjønnes + + * GraphicsImage.[Ch]: newImage and loadableFormats changed to + boost::function from boost::signal. + 2002-07-01 Jean-Marc Lasgouttes * GraphicsConverter.C (convert): do not use ChangeExtension @@ -19,7 +24,7 @@ grfx::Converter now represents a single conversion process. Thus grfx::CachItem now has a grfx::Converter * that is set when the conversion is initiated and destroyed on completion. - + * GraphicsCache.[Ch]: * GraphicsCacheItem.[Ch]: * GraphicsConverter.[Ch]: @@ -29,7 +34,7 @@ so not only should we have a clean, minimal and well documented interface to these classes in the header files, but the class internals should be much clearer too. - + * Renamed classes grfx::GCache -> grfx::Cache, grfx::GCacheItem -> grfx::CacheItem, @@ -80,15 +85,15 @@ 2002-06-17 Herbert Voss - * GraphicsCachItem.C: (findTargetFormat)return xpm-format as a + * GraphicsCachItem.C: (findTargetFormat)return xpm-format as a default when nothing different was found - (convertToDisplayFormat): handle zipped files in the right way and - choose always convert as a default converter when no other + (convertToDisplayFormat): handle zipped files in the right way and + choose always convert as a default converter when no other userdefined was found - + * GraphicsConverter.C: add more lyxerr comments and choose convert when no other userdefined converter was found - + 2002-06-10 Herbert Voss * GraphicsImageXPM.C (convertTo7chars): get another special color @@ -97,20 +102,20 @@ 2002-06-12 John Levon * GraphicsCache.C: use right colormap incantation - + 2002-06-12 John Levon * GraphicsCache.C: use lyx_gui namespace * GraphicsImageXPM.C: back down to using xforms directly again - + 2002-06-07 Angus Leeming Fixes needed to compile with Compaq cxx 6.5. * GraphicsConverter.h: forward declare class ConvProcess. - * GraphicsImageXPM.C: + * GraphicsImageXPM.C: all c-library variables have been moved into namespace std. Wrap using std::xyz declarations inside a #ifndef CXX_GLOBAL_CSTD block. diff --git a/src/graphics/GraphicsImage.C b/src/graphics/GraphicsImage.C index a87ad49a55..8ef312666c 100644 --- a/src/graphics/GraphicsImage.C +++ b/src/graphics/GraphicsImage.C @@ -20,10 +20,11 @@ namespace grfx { // This is to be connected to a function that will return a new // instance of a viable derived class. -boost::signal0 Image::newImage; +boost::function0 Image::newImage; /// Return the list of loadable formats. -boost::signal0 Image::loadableFormats; +boost::function0 Image::loadableFormats; + std::pair Image::getScaledDimensions(Params const & params) const diff --git a/src/graphics/GraphicsImage.h b/src/graphics/GraphicsImage.h index 5c90776793..3a03523b80 100644 --- a/src/graphics/GraphicsImage.h +++ b/src/graphics/GraphicsImage.h @@ -25,7 +25,7 @@ #include "LString.h" #include -#include +#include #include #include // for Pixmap :-( @@ -48,12 +48,12 @@ public: */ typedef boost::shared_ptr ImagePtr; /// - static boost::signal0 newImage; + static boost::function0 newImage; /// Return the list of loadable formats. typedef std::vector FormatList; /// - static boost::signal0 loadableFormats; + static boost::function0 loadableFormats; /// Must define default c-tor explicitly as we define a copy c-tor. Image() {} diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 0373696c39..a2e272ba89 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-07-04 Lars Gullik Bjønnes + + * insetcommandparams.[Ch] (operator=): move out of class + (operator!): move out of class 2002-07-04 André Pönitz diff --git a/src/insets/insetcommandparams.C b/src/insets/insetcommandparams.C index 93a3070d49..d3879d0ae0 100644 --- a/src/insets/insetcommandparams.C +++ b/src/insets/insetcommandparams.C @@ -16,6 +16,11 @@ #include "lyxlex.h" #include "debug.h" +#include "support/LOstream.h" + +using std::ostream; +using std::endl; + InsetCommandParams::InsetCommandParams() {} @@ -58,19 +63,6 @@ void InsetCommandParams::setFromString(string const & b) } -bool InsetCommandParams::operator==(InsetCommandParams const & o) const -{ - return cmdname == o.cmdname && contents == o.contents - && options == o.options; -} - - -bool InsetCommandParams::operator!=(InsetCommandParams const & o) const -{ - return !(*this == o); -} - - void InsetCommandParams::scanCommand(string const & cmd) { string tcmdname, toptions, tcontents; @@ -172,3 +164,18 @@ string const InsetCommandParams::getCommand() const return s; } + +bool operator==(InsetCommandParams const & o1, + InsetCommandParams const & o2) +{ + return o1.getCmdName() == o2.getCmdName() + && o1.getContents() == o2.getContents() + && o1.getOptions() == o2.getOptions(); +} + + +bool operator!=(InsetCommandParams const & o1, + InsetCommandParams const & o2) +{ + return !(o1 == o2); +} diff --git a/src/insets/insetcommandparams.h b/src/insets/insetcommandparams.h index 90bb0eb56a..b6c3b75ded 100644 --- a/src/insets/insetcommandparams.h +++ b/src/insets/insetcommandparams.h @@ -33,10 +33,6 @@ public: string const & c = string(), string const & o = string()); /// - bool operator==(InsetCommandParams const &) const; - /// - bool operator!=(InsetCommandParams const &) const; - /// void read(LyXLex &); /// Parse the command void scanCommand(string const &); @@ -70,4 +66,12 @@ private: }; +/// +bool operator==(InsetCommandParams const &, + InsetCommandParams const &); + +/// +bool operator!=(InsetCommandParams const &, + InsetCommandParams const &); + #endif diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index d40bf7117e..6e18e2cce5 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2002-07-04 Lars Gullik Bjønnes + + * formulabase.C: ws changes + * formula.C: ws changes + 2002-07-01 Geof Piroux * math_ex*.[Ch] et al: support for Mathematica as CAS backend @@ -17,13 +22,13 @@ 2002-06-24 André Pönitz * *.[Ch]: left over changes from Porto - + * math_gridinset.C (eolString): fix #456 2002-06-21 John Levon * formula.C: use repaint() - + 2002-06-16 André Pönitz * math_factory.C: diff --git a/src/mathed/formula.C b/src/mathed/formula.C index a6c0b60201..466c9fe241 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -76,7 +76,7 @@ InsetFormula::InsetFormula(string const & data) { if (!data.size()) return; - if (!mathed_parse_normal(par_, data)) + if (!mathed_parse_normal(par_, data)) lyxerr << "cannot interpret '" << data << "' as math\n"; } @@ -279,7 +279,7 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action, } #warning FIXME: please check you really mean repaint() ... is it needed, -#warning and if so, should it be update() instead ? +#warning and if so, should it be update() instead ? if (!new_label.empty() && bv->ChangeRefsIfUnique(old_label, new_label)) bv->repaint(); @@ -382,7 +382,7 @@ bool InsetFormula::insetAllowed(Inset::Code code) const { return (code == Inset::LABEL_CODE && display()) - || code == Inset::REF_CODE + || code == Inset::REF_CODE || code == Inset::ERT_CODE; } @@ -440,7 +440,7 @@ void InsetFormula::statusChanged() { lyxerr << "### InsetFormula::statusChanged called!, status: " << loader_->status() << "\n"; - if (loader_->status() == grfx::Ready) + if (loader_->status() == grfx::Ready) view()->updateInset(this, false); else if (loader_->status() == grfx::WaitingToLoad) loader_->startLoading(); @@ -454,7 +454,7 @@ void InsetFormula::updatePreview() if (!lyxrc.preview) return; - // get LaTeX + // get LaTeX ostringstream ls; WriteStream wi(ls, false, false); par_->write(wi); @@ -505,4 +505,3 @@ void InsetFormula::updatePreview() loader_->startLoading(); loader_->statusChanged.connect(boost::bind(&InsetFormula::statusChanged, this)); } - diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 93bc456b65..d3b03a8a1d 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -1030,7 +1030,7 @@ void mathDispatchInsertMatrix(BufferView * bv, string const & arg) if (!bv->available()) return; InsetFormula * f = new InsetFormula(bv); - if (openNewInset(bv, f)) { + if (openNewInset(bv, f)) { f->mutate("simple"); bv->theLockingInset()->localDispatch(bv, LFUN_INSERT_MATRIX, arg); }