From: Lars Gullik Bjønnes Date: Sun, 9 Sep 2001 22:02:19 +0000 (+0000) Subject: some mods I had in my local tree, mostly small stuff, perhaps minus the the Makefile... X-Git-Tag: 1.6.10~20639 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=271f8d7eec31175f53d012147af164cb27b043ce;p=features.git some mods I had in my local tree, mostly small stuff, perhaps minus the the Makefile changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2713 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/config/missing b/config/missing index 7789652e87..d46f79f64d 100755 --- a/config/missing +++ b/config/missing @@ -1,6 +1,6 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -23,6 +23,14 @@ if test $# -eq 0; then exit 1 fi +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.in; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + case "$1" in -h|--h|--he|--hel|--help) @@ -61,7 +69,7 @@ Supported PROGRAM values: aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. You might want + you modified \`acinclude.m4' or \`$configure_ac'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 @@ -70,7 +78,7 @@ WARNING: \`$1' is missing on your system. You should only need it if autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`configure.in'. You might want to install the + you modified \`$configure_ac'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure @@ -79,10 +87,10 @@ WARNING: \`$1' is missing on your system. You should only need it if autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. You might want + you modified \`acconfig.h' or \`$configure_ac'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` test -z "$files" && files="config.h" touch_files= for f in $files; do @@ -98,7 +106,7 @@ WARNING: \`$1' is missing on your system. You should only need it if automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | diff --git a/config/qt2.m4 b/config/qt2.m4 index 6bdd23f9f2..48b892baae 100644 --- a/config/qt2.m4 +++ b/config/qt2.m4 @@ -222,7 +222,7 @@ if test "$ac_qt2_includes" = NO || test "$ac_qt2_libraries" = NO; then AC_CACHE_VAL(ac_cv_have_qt2, [#try to guess Qt2 locations -qt2_incdirs="$ac_qt2_includes usr/lib/qt2/include /usr/local/qt2/include /usr/include/qt2 /usr/X11R6/include/X11/qt2 /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes $QTINC" +qt2_incdirs="$ac_qt2_includes /usr/lib/qt2/include /usr/local/qt2/include /usr/include/qt2 /usr/X11R6/include/X11/qt2 /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes $QTINC" test -n "$QTDIR" && qt2_incdirs="$QTDIR/include/qt2 $QTDIR/include/qt $QTDIR/include $QTDIR $qt2_incdirs" AC_FIND_FILE(qmovie.h, $qt2_incdirs, qt2_incdir) ac_qt2_includes="$qt2_incdir" diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 49578dd62a..0012e62d9a 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -201,7 +201,7 @@ ${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS) grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\ grep -v frontends/kde |\ sed -e '/xforms.forms/d' | \ - sort -f -d | uniq ) > $@-t \ + sort -f -n | uniq ) > $@-t \ && echo "src/ext_l10n.h" >> $@-t \ && mv $@-t $@ diff --git a/po/POTFILES.in b/po/POTFILES.in index 98016b9a80..d22def5a24 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -10,8 +10,8 @@ src/CutAndPaste.C src/debug.C src/exporter.C src/ext_l10n.h -src/figureForm.C src/figure_form.C +src/figureForm.C src/FontLoader.C src/frontends/controllers/biblio.C src/frontends/controllers/ButtonController.h @@ -69,73 +69,73 @@ src/frontends/qt2/QURL.C src/frontends/qt2/QVCLog.C src/frontends/xforms/combox.C src/frontends/xforms/FileDialog.C -src/frontends/xforms/FormAboutlyx.C src/frontends/xforms/form_aboutlyx.C -src/frontends/xforms/FormBibitem.C +src/frontends/xforms/FormAboutlyx.C src/frontends/xforms/form_bibitem.C -src/frontends/xforms/FormBibtex.C +src/frontends/xforms/FormBibitem.C src/frontends/xforms/form_bibtex.C +src/frontends/xforms/FormBibtex.C src/frontends/xforms/form_browser.C -src/frontends/xforms/FormCharacter.C src/frontends/xforms/form_character.C -src/frontends/xforms/FormCitation.C +src/frontends/xforms/FormCharacter.C src/frontends/xforms/form_citation.C -src/frontends/xforms/FormDocument.C +src/frontends/xforms/FormCitation.C src/frontends/xforms/form_document.C -src/frontends/xforms/FormError.C +src/frontends/xforms/FormDocument.C src/frontends/xforms/form_error.C -src/frontends/xforms/FormERT.C +src/frontends/xforms/FormError.C src/frontends/xforms/form_ert.C -src/frontends/xforms/FormExternal.C +src/frontends/xforms/FormERT.C src/frontends/xforms/form_external.C -src/frontends/xforms/FormFiledialog.C +src/frontends/xforms/FormExternal.C src/frontends/xforms/form_filedialog.C -src/frontends/xforms/FormFloat.C +src/frontends/xforms/FormFiledialog.C src/frontends/xforms/form_float.C -src/frontends/xforms/FormGraphics.C +src/frontends/xforms/FormFloat.C src/frontends/xforms/form_graphics.C -src/frontends/xforms/FormInclude.C +src/frontends/xforms/FormGraphics.C src/frontends/xforms/form_include.C -src/frontends/xforms/FormIndex.C +src/frontends/xforms/FormInclude.C src/frontends/xforms/form_index.C +src/frontends/xforms/FormIndex.C src/frontends/xforms/FormLog.C src/frontends/xforms/FormMathsBitmap.C -src/frontends/xforms/FormMathsDeco.C src/frontends/xforms/form_maths_deco.C -src/frontends/xforms/FormMathsDelim.C +src/frontends/xforms/FormMathsDeco.C src/frontends/xforms/form_maths_delim.C -src/frontends/xforms/FormMathsMatrix.C +src/frontends/xforms/FormMathsDelim.C src/frontends/xforms/form_maths_matrix.C -src/frontends/xforms/FormMathsPanel.C +src/frontends/xforms/FormMathsMatrix.C src/frontends/xforms/form_maths_panel.C -src/frontends/xforms/FormMathsSpace.C +src/frontends/xforms/FormMathsPanel.C src/frontends/xforms/form_maths_space.C -src/frontends/xforms/FormMinipage.C +src/frontends/xforms/FormMathsSpace.C src/frontends/xforms/form_minipage.C -src/frontends/xforms/FormParagraph.C +src/frontends/xforms/FormMinipage.C src/frontends/xforms/form_paragraph.C -src/frontends/xforms/FormPreamble.C +src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_preamble.C -src/frontends/xforms/FormPreferences.C +src/frontends/xforms/FormPreamble.C src/frontends/xforms/form_preferences.C -src/frontends/xforms/FormPrint.C +src/frontends/xforms/FormPreferences.C src/frontends/xforms/form_print.C -src/frontends/xforms/FormRef.C +src/frontends/xforms/FormPrint.C src/frontends/xforms/form_ref.C -src/frontends/xforms/FormSearch.C +src/frontends/xforms/FormRef.C src/frontends/xforms/form_search.C -src/frontends/xforms/FormSpellchecker.C +src/frontends/xforms/FormSearch.C src/frontends/xforms/form_spellchecker.C -src/frontends/xforms/FormTabular.C +src/frontends/xforms/FormSpellchecker.C src/frontends/xforms/form_tabular.C -src/frontends/xforms/FormTabularCreate.C +src/frontends/xforms/FormTabular.C src/frontends/xforms/form_tabular_create.C -src/frontends/xforms/FormThesaurus.C +src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/form_thesaurus.C -src/frontends/xforms/FormToc.C +src/frontends/xforms/FormThesaurus.C src/frontends/xforms/form_toc.C -src/frontends/xforms/FormUrl.C +src/frontends/xforms/FormToc.C src/frontends/xforms/form_url.C +src/frontends/xforms/FormUrl.C src/frontends/xforms/FormVCLog.C src/frontends/xforms/input_validators.C src/frontends/xforms/Menubar_pimpl.C diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index d8532ad1bc..72c5611855 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -3239,6 +3239,8 @@ void BufferView::Pimpl::specialChar(InsetSpecialChar::Kind kind) InsetSpecialChar * new_inset = new InsetSpecialChar(kind); insertInset(new_inset); + // Ok, what happens here if we are unable to insert + // the inset? Leak it? } } diff --git a/src/ChangeLog b/src/ChangeLog index 7e3267dcee..8848e97fb8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,22 @@ +2001-09-09 Lars Gullik Bjønnes + + * paragraph.h: make the optional constructor arg required instead. + some modifications to other files because of this. + + * minibuffer.C (C_MiniBuffer_peek_event): make it static + + * lyxserver.C (C_LyXComm_callback): make it static + + * lyx_main.C (error_handler): make it static + + * lyx_gui.C (LyX_XErrHandler): make it static + + * XFormsView.C (C_XFormsView_atCloseMainFormCB): make it static + + * WorkArea.C: make the extern "C" methods static. + + * Makefile.am (lyx_LDADD): simplify + 2001-09-02 Angus Leeming * commandtags.h: removed redundant LFUNs, LFUN_HELP_COPYRIGHT, diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index a3c6f64d87..fbfa168982 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -166,13 +166,13 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar, // copy more than one paragraph // clone the paragraphs within the selection Paragraph * tmppar = startpar; - buf = new Paragraph(*tmppar); + buf = new Paragraph(*tmppar, false); Paragraph * tmppar2 = buf; while (tmppar != endpar && tmppar->next()) { tmppar = tmppar->next(); - tmppar2->next(new Paragraph(*tmppar)); + tmppar2->next(new Paragraph(*tmppar, false)); tmppar2->next()->previous(tmppar2); tmppar2 = tmppar2->next(); } @@ -209,7 +209,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // There are two cases: cutbuffer only one paragraph or many if (!buf->next()) { // only within a paragraph - Paragraph * tmpbuf = new Paragraph(*buf); + Paragraph * tmpbuf = new Paragraph(*buf, false); // Some provisions should be done here for checking // if we are inserting at the beginning of a @@ -239,12 +239,12 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // make a copy of the simple cut_buffer Paragraph * tmpbuf = buf; - Paragraph * simple_cut_clone = new Paragraph(*tmpbuf); + Paragraph * simple_cut_clone = new Paragraph(*tmpbuf, false); Paragraph * tmpbuf2 = simple_cut_clone; while (tmpbuf->next()) { tmpbuf = tmpbuf->next(); - tmpbuf2->next(new Paragraph(*tmpbuf)); + tmpbuf2->next(new Paragraph(*tmpbuf, false)); tmpbuf2->next()->previous(tmpbuf2); tmpbuf2 = tmpbuf2->next(); } diff --git a/src/Makefile.am b/src/Makefile.am index be4bb9c2c5..70c42bcb06 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,17 +3,15 @@ SUBDIRS = mathed insets graphics support frontends DISTCLEANFILES= *.orig *.rej *~ *.bak core libintl.h config.h MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/config.h.in bin_PROGRAMS = lyx -## libfrontends is given twice on the link line because it needs stuff -## from FRONTEND_GUILIB and inversely. If you do not like it, feel -## free to provide another solution... Maybe signals would solve that -## magically, but I do not understand them much (JMarc) + lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la \ graphics/libgraphics.la \ frontends/libfrontends.la \ support/libsupport.la \ @INCLUDED_SIGC@ -lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(LYX_LIBS) $(SIGC_LIBS) \ - $(PSPELL_LIBS) @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@ @AIKSAURUS_LIBS@ +lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(SIGC_LIBS) \ + $(PSPELL_LIBS) @AIKSAURUS_LIBS@ + #lyx_LDFLAGS=-Wl,-O1 EXTRA_DIST = config.h.in stamp-h.in cheaders ext_l10n.h ETAGS_ARGS = --lang=c++ diff --git a/src/WorkArea.C b/src/WorkArea.C index ea9324e037..1e64810638 100644 --- a/src/WorkArea.C +++ b/src/WorkArea.C @@ -44,15 +44,18 @@ void waitForX() extern "C" { -// Just a bunch of C wrappers around static members of WorkArea + // Just a bunch of C wrappers around static members of WorkArea + static void C_WorkArea_scroll_cb(FL_OBJECT * ob, long buf) { WorkArea::scroll_cb(ob, buf); } + + static int C_WorkArea_work_area_handler(FL_OBJECT * ob, int event, - FL_Coord, FL_Coord, - int key, void * xev) + FL_Coord, FL_Coord, + int key, void * xev) { return WorkArea::work_area_handler(ob, event, 0, 0, key, xev); @@ -485,18 +488,23 @@ namespace { string clipboard_selection; bool clipboard_read = false; -extern "C" -int request_clipboard_cb(FL_OBJECT * /*ob*/, long /*type*/, - void const * data, long size) -{ - clipboard_selection.erase(); - - if (size > 0) - clipboard_selection.reserve(size); - for (int i = 0; i < size; ++i) - clipboard_selection += static_cast(data)[i]; - clipboard_read = true; - return 0; +extern "C" { + + static + int request_clipboard_cb(FL_OBJECT * /*ob*/, long /*type*/, + void const * data, long size) + { + clipboard_selection.erase(); + + if (size > 0) + clipboard_selection.reserve(size); + for (int i = 0; i < size; ++i) + clipboard_selection += + static_cast(data)[i]; + clipboard_read = true; + return 0; + } + } } // namespace anon diff --git a/src/XFormsView.C b/src/XFormsView.C index 059e174a43..8d57aa88f9 100644 --- a/src/XFormsView.C +++ b/src/XFormsView.C @@ -15,9 +15,6 @@ #pragma implementation #endif -//#include -//#include - #include "XFormsView.h" #if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5) #include "lyxlookup.h" @@ -42,7 +39,15 @@ extern void QuitLyX(); // This is very temporary BufferView * current_view; -extern "C" int C_XFormsView_atCloseMainFormCB(FL_FORM *, void *); +extern "C" { + +static +int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) +{ + return XFormsView::atCloseMainFormCB(form, p); +} + +} XFormsView::XFormsView(int width, int height) @@ -87,14 +92,6 @@ int XFormsView::atCloseMainFormCB(FL_FORM *, void *) } -// Wrapper for the above -extern "C" -int C_XFormsView_atCloseMainFormCB(FL_FORM * form, void * p) -{ - return XFormsView::atCloseMainFormCB(form, p); -} - - void XFormsView::setPosition(int x, int y) { fl_set_form_position(form_, x, y); diff --git a/src/figureForm.C b/src/figureForm.C index 320f30c566..b160d0eedc 100644 --- a/src/figureForm.C +++ b/src/figureForm.C @@ -41,7 +41,8 @@ void Figure() /* callbacks for form form_figure */ -extern "C" +extern "C" { + void FigureApplyCB(FL_OBJECT *, long) { if (!current_view->available()) @@ -103,16 +104,17 @@ void FigureApplyCB(FL_OBJECT *, long) } -extern "C" void FigureCancelCB(FL_OBJECT *, long) { fl_hide_form(fd_form_figure->form_figure); } -extern "C" void FigureOKCB(FL_OBJECT * ob, long data) { FigureApplyCB(ob, data); FigureCancelCB(ob, data); } + +} + diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index 5abfa8a23a..422155cc16 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,8 @@ +2001-09-09 Lars Gullik Bjønnes + + * Makefile.am (libgnome_la_LIBADD): depend on the gui libs. + (libgnome_la_SOURCES): sort + 2001-08-27 John Levon * GUIRunTime.C: initApplication() should take a int & argc, add debug diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 2d0a976796..e1c28b74b2 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -1,6 +1,8 @@ AUTOMAKE_OPTIONS = foreign 1.4 DISTCLEANFILES= *.orig *.rej *~ *.bak core MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +ETAGS_ARGS = --lang=c++ + noinst_LTLIBRARIES = libgnome.la BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = ${FRONTEND_INCLUDES} -I${top_srcdir}/src/ \ @@ -9,7 +11,7 @@ INCLUDES = ${FRONTEND_INCLUDES} -I${top_srcdir}/src/ \ -I${top_srcdir}/src/frontends/controllers \ ${SIGC_CFLAGS} $(BOOST_INCLUDES) -libgnome_la_OBJADD = \ +libgnome_la_LIBADD = \ ../xforms/xforms_helpers.lo \ ../xforms/Toolbar_pimpl.lo \ ../xforms/combox.lo \ @@ -19,7 +21,9 @@ libgnome_la_OBJADD = \ ../xforms/FormMathsDelim.lo \ ../xforms/FormMathsMatrix.lo \ ../xforms/FormMathsPanel.lo \ - ../xforms/FormMathsSpace.lo + ../xforms/FormMathsSpace.lo \ + @LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@ + # ../xforms/FileDialog.lo \ # ../xforms/FormFiledialog.lo \ # ../xforms/form_filedialog.lo @@ -61,32 +65,32 @@ libgnome_la_OBJADD = \ # ../xforms/RadioButtonGroup.lo \ LIBS= -LDFLAGS= $(libgnome_la_OBJADD) +#LDFLAGS= $(libgnome_la_OBJADD) LYXDATADIRS = -#ETAGS_ARGS = --lang=c++ + libgnome_la_SOURCES = \ - gnomeBC.C \ - gnomeBC.h \ - gnome_helpers.C \ - gnome_helpers.h \ - mainapp.C \ - mainapp.h \ - support.c \ - support.h \ - pixbutton.h \ Dialogs.C \ - GnomeBase.C \ - GnomeBase.h \ - GUIRunTime.C \ FileDialog.C \ - FormTabularCreate.C \ - FormTabularCreate.h \ FormError.C \ FormError.h \ + FormTabularCreate.C \ + FormTabularCreate.h \ FormUrl.C \ FormUrl.h \ + gnome_helpers.C \ + gnome_helpers.h \ + GnomeBase.C \ + GnomeBase.h \ + gnomeBC.C \ + gnomeBC.h \ + GUIRunTime.C \ + pixbutton.h \ + mainapp.C \ + mainapp.h \ Menubar_pimpl.C \ Menubar_pimpl.h \ + support.c \ + support.h \ Timeout_pimpl.C \ Timeout_pimpl.h @@ -98,7 +102,6 @@ libgnome_la_SOURCES = \ # GUI_defaults.C \ # GUI_initialize.C \ # GUI_postlyxrc.C \ -# GUI_runtime.C \ # GUI_applymenu.C # just copied from old lyx repository diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index ad1e03c786..f0341594a8 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2001-09-09 Lars Gullik Bjønnes + + * Makefile.am (libqt2_la_LIBADD): rename from OBJADD, depend on + gui libs + 2001-09-06 John Levon * ui/QMinipageDialog.ui: fix layout, remove old slot diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 6f318ce15a..7ca0ed0132 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -15,7 +15,7 @@ include Makefile.dialogs libqt2_la_DEPENDENCIES = ui/libqt2ui.la moc/libqt2moc.la ui/moc/libqt2uimoc.la -libqt2_la_OBJADD = \ +libqt2_la_LIBADD = \ ui/libqt2ui.la \ moc/libqt2moc.la \ ui/moc/libqt2uimoc.la \ @@ -56,10 +56,11 @@ libqt2_la_OBJADD = \ ../xforms/form_url.lo \ ../xforms/input_validators.lo \ ../xforms/xformsBC.lo \ - ../xforms/xforms_helpers.lo + ../xforms/xforms_helpers.lo \ + @LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@ LIBS= -LDFLAGS= $(libqt2_la_OBJADD) +#LDFLAGS= $(libqt2_la_OBJADD) ETAGS_ARGS = --lang=c++ libqt2_la_SOURCES = \ diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index c2098c11f8..12be14d60a 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -56,8 +56,6 @@ QDocument::QDocument(LyXView *, Dialogs *) void QDocument::build_dialog() { - int n; - // the tabbed folder //dialog_.reset(new QDocumentDialog()); @@ -119,7 +117,7 @@ void QDocument::build_dialog() dialog->docFontSizeCO->insertItem( _( "10" ) ); dialog->docFontSizeCO->insertItem( _( "11" ) ); dialog->docFontSizeCO->insertItem( _( "12" ) ); - for (n=0; tex_fonts[n][0]; ++n) { + for (int n=0; tex_fonts[n][0]; ++n) { dialog->docFontsCO->insertItem( tex_fonts[n] ); } @@ -182,7 +180,7 @@ void QDocument::build_dialog() dialog->tocDepthSB->setRange( -1, 5 ); dialog->secNumDepthSB->setSteps( 1, 1 ); dialog->tocDepthSB->setRange( 1, 1 ); - for (n=0; tex_graphics[n][0]; ++n) { + for (int n=0; tex_graphics[n][0]; ++n) { dialog->postscriptDriverCO->insertItem( tex_graphics[n] ); } diff --git a/src/frontends/qt2/QThesaurus.C b/src/frontends/qt2/QThesaurus.C index 11cb78849c..9b8107bc1d 100644 --- a/src/frontends/qt2/QThesaurus.C +++ b/src/frontends/qt2/QThesaurus.C @@ -53,3 +53,8 @@ void QThesaurus::replace() { controller().replace(dialog_->replaceED->text().latin1()); } + + +void QThesaurus::apply() +{ +} diff --git a/src/frontends/qt2/QThesaurus.h b/src/frontends/qt2/QThesaurus.h index 9d72b3de67..c4e4b24136 100644 --- a/src/frontends/qt2/QThesaurus.h +++ b/src/frontends/qt2/QThesaurus.h @@ -30,7 +30,7 @@ public: QThesaurus(ControlThesaurus &); private: /// Apply changes - virtual void apply() {}; + virtual void apply(); /// update virtual void update_contents(); /// build the dialog diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 2f94548ae1..764f3bcf65 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,20 @@ +2001-09-09 Lars Gullik Bjønnes + + * combox.C (C_Combox_input_cb): make it static + (C_Combox_combo_cb): make it static + (C_Combox_peek_event): make it static + + * Toolbar_pimpl.C (C_Toolbar_BubbleTimerCB): make it static + (C_Toolbar_BubblePost): make it static + (C_Toolbar_ToolbarCB): make it static + + * Timeout_pimpl.C (C_intern_timeout_cb): make it static + + * Menubar_pimpl.C (C_Menubar_Pimpl_MenuCallback): make it static + + * Makefile.am (libxforms_la_LIBADD): add this and depend on the + gui libs + 2001-09-07 Angus Leeming * FormBaseDeprecated.[Ch]: use the same allow_resize methodology as has diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index cd97c3ef83..bfee6f8bd9 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -21,14 +21,12 @@ #include "xformsBC.h" #include "support/LAssert.h" -// Callback function invoked by xforms when the dialog is closed by the -// window manager -extern "C" int C_FormBaseWMHideCB(FL_FORM * form, void *); +extern "C" { + // Callback function invoked by xforms when the dialog is closed by the + // window manager + static int C_FormBaseWMHideCB(FL_FORM * form, void *); -// To trigger an input event when pasting in an xforms input object -// using the middle mouse button. -extern "C" int C_CutandPastePH(FL_OBJECT *, int, FL_Coord, FL_Coord, - int, void *); +} FormBase::FormBase(ControlButtons & c, string const & t, bool allowResize) @@ -123,56 +121,60 @@ FormBase * GetForm(FL_OBJECT * ob) } // namespace anon -extern "C" -int C_FormBaseWMHideCB(FL_FORM * form, void *) -{ - // Close the dialog cleanly, even if the WM is used to do so. - lyx::Assert(form && form->u_vdata); - FormBase * pre = static_cast(form->u_vdata); - pre->CancelButton(); - return FL_CANCEL; -} +extern "C" { + + static + int C_FormBaseWMHideCB(FL_FORM * form, void *) + { + // Close the dialog cleanly, even if the WM is used to do so. + lyx::Assert(form && form->u_vdata); + FormBase * pre = static_cast(form->u_vdata); + pre->CancelButton(); + return FL_CANCEL; + } -extern "C" void C_FormBaseApplyCB(FL_OBJECT * ob, long) -{ - GetForm(ob)->ApplyButton(); -} + void C_FormBaseApplyCB(FL_OBJECT * ob, long) + { + GetForm(ob)->ApplyButton(); + } -extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long) -{ - GetForm(ob)->OKButton(); -} + void C_FormBaseOKCB(FL_OBJECT * ob, long) + { + GetForm(ob)->OKButton(); + } -extern "C" void C_FormBaseCancelCB(FL_OBJECT * ob, long) -{ - FormBase * form = GetForm(ob); - form->CancelButton(); -} + void C_FormBaseCancelCB(FL_OBJECT * ob, long) + { + FormBase * form = GetForm(ob); + form->CancelButton(); + } -extern "C" void C_FormBaseRestoreCB(FL_OBJECT * ob, long) -{ - GetForm(ob)->RestoreButton(); -} + void C_FormBaseRestoreCB(FL_OBJECT * ob, long) + { + GetForm(ob)->RestoreButton(); + } -extern "C" void C_FormBaseInputCB(FL_OBJECT * ob, long d) -{ - GetForm(ob)->InputCB(ob, d); -} + void C_FormBaseInputCB(FL_OBJECT * ob, long d) + { + GetForm(ob)->InputCB(ob, d); + } -// To trigger an input event when pasting in an xforms input object -// using the middle mouse button. -extern "C" int C_CutandPastePH(FL_OBJECT * ob, int event, - FL_Coord, FL_Coord, int key, void *) -{ - if ((event == FL_PUSH) && (key == 2) && (ob->objclass == FL_INPUT)) { - C_FormBaseInputCB(ob, 0); + // To trigger an input event when pasting in an xforms input object + // using the middle mouse button. + int C_CutandPastePH(FL_OBJECT * ob, int event, + FL_Coord, FL_Coord, int key, void *) + { + if ((event == FL_PUSH) && (key == 2) + && (ob->objclass == FL_INPUT)) { + C_FormBaseInputCB(ob, 0); + } + return 0; } - return 0; } diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index 1e9c294b5c..bd661f10c1 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -26,29 +26,38 @@ using SigC::slot; -extern "C" int C_FormBaseDeprecatedWMHideCB(FL_FORM * ob, void * d) -{ - return FormBaseDeprecated::WMHideCB(ob, d); -} -extern "C" void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long d) -{ - FormBaseDeprecated::ApplyCB(ob, d); -} -extern "C" void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long d) -{ - FormBaseDeprecated::OKCB(ob, d); -} -extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long d) -{ - FormBaseDeprecated::CancelCB(ob, d); -} -extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT * ob, long d) -{ - FormBaseDeprecated::InputCB(ob, d); -} -extern "C" void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long d) -{ - FormBaseDeprecated::RestoreCB(ob, d); +extern "C" { + + static + int C_FormBaseDeprecatedWMHideCB(FL_FORM * ob, void * d) + { + return FormBaseDeprecated::WMHideCB(ob, d); + } + + void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long d) + { + FormBaseDeprecated::ApplyCB(ob, d); + } + + void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long d) + { + FormBaseDeprecated::OKCB(ob, d); + } + + void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long d) + { + FormBaseDeprecated::CancelCB(ob, d); + } + + void C_FormBaseDeprecatedInputCB(FL_OBJECT * ob, long d) + { + FormBaseDeprecated::InputCB(ob, d); + } + + void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long d) + { + FormBaseDeprecated::RestoreCB(ob, d); + } } diff --git a/src/frontends/xforms/FormFiledialog.C b/src/frontends/xforms/FormFiledialog.C index bcf77da0a0..869b5759ca 100644 --- a/src/frontends/xforms/FormFiledialog.C +++ b/src/frontends/xforms/FormFiledialog.C @@ -79,6 +79,28 @@ long const SIX_MONTH_SEC = 6L * 30L * 24L * 60L * 60L; //static long const ONE_HOUR_SEC = 60L * 60L; +extern "C" { + + static + int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev) + { + return FileDialog::Private::CancelCB(fl, xev); + } + + static + void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data) + { + FileDialog::Private::DoubleClickCB(ob, data); + } + + static + void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data) + { + FileDialog::Private::FileDlgCB(ob, data); + } + +} + } // namespace anon @@ -545,12 +567,6 @@ void FileDialog::Private::FileDlgCB(FL_OBJECT *, long lArgument) } -extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data) -{ - FileDialog::Private::FileDlgCB(ob, data); -} - - // Handle callback from list void FileDialog::Private::HandleListHit() { @@ -573,12 +589,6 @@ void FileDialog::Private::DoubleClickCB(FL_OBJECT *, long) } -extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data) -{ - FileDialog::Private::DoubleClickCB(ob, data); -} - - // Handle double click from list bool FileDialog::Private::HandleDoubleClick() { @@ -678,12 +688,6 @@ int FileDialog::Private::CancelCB(FL_FORM *, void *) } -extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev) -{ - return FileDialog::Private::CancelCB(fl, xev); -} - - // Simulates a click on OK/Cancel void FileDialog::Private::Force(bool cancel) { diff --git a/src/frontends/xforms/FormFiledialog.h b/src/frontends/xforms/FormFiledialog.h index 8ba1464a24..145f61dbbe 100644 --- a/src/frontends/xforms/FormFiledialog.h +++ b/src/frontends/xforms/FormFiledialog.h @@ -37,12 +37,15 @@ public: string pszLsEntry; }; -extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data); -extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data); -extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev); -class FileDialog::Private : public SigC::Object -{ +//extern "C" { +// void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data); +// void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data); +// int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev); +//} + + +class FileDialog::Private : public SigC::Object { public: /// Private(); diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index d9d93d49d9..f8446144db 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -29,7 +29,7 @@ FormFloat::FormFloat(ControlFloat & c) {} -#warning Needs to be implemented. (Lgb) +// FIX: Needs to be implemented. (Lgb) // A way to set to float default is missing. // A way to set "force[!]" is missing. // Also there are two groups of buttons [Here] and [top,bottom,page,here], diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index a16246d67e..186d5b4c75 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -31,14 +31,20 @@ using std::strlen; static char h_align_str[80] = "c"; static char v_align_c[] = "tcb"; -extern "C" -int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *, - char const * cur, int c) -{ - lyx::Assert(ob); - FormMathsMatrix * pre = static_cast(ob->u_vdata); - lyx::Assert(pre); - return pre->AlignFilter(cur, c); + +extern "C" { + + static + int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *, + char const * cur, int c) + { + lyx::Assert(ob); + FormMathsMatrix * pre = + static_cast(ob->u_vdata); + lyx::Assert(pre); + return pre->AlignFilter(cur, c); + } + } diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 2085822a1d..1006f38376 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -240,7 +240,7 @@ void FormParagraph::apply() labelwidthstring = fl_get_input(dialog_->input_labelwidth); noindent = fl_get_button(dialog_->check_noindent); - Spacing::Space linespacing; + Spacing::Space linespacing = Spacing::Default; string other_linespacing; switch (fl_get_choice(dialog_->choice_linespacing)) { case 1: linespacing = Spacing::Default; break; diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 33e9d52bdf..d43c4ef22d 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -3005,13 +3005,20 @@ void FormPreferences::browse(FL_OBJECT * inpt, // C function wrapper, required by xforms. -extern "C" int C_FormPreferencesFeedbackCB(FL_OBJECT * ob, int event, - FL_Coord mx, FL_Coord my, - int key, void * xev) -{ - return FormPreferences::FeedbackCB(ob, event, mx, my, key, xev); +extern "C" { + + static + int C_FormPreferencesFeedbackCB(FL_OBJECT * ob, int event, + FL_Coord mx, FL_Coord my, + int key, void * xev) + { + return FormPreferences::FeedbackCB(ob, event, + mx, my, key, xev); + } + } + int FormPreferences::FeedbackCB(FL_OBJECT * ob, int event, FL_Coord, FL_Coord, int, void *) { diff --git a/src/frontends/xforms/FormSplash.C b/src/frontends/xforms/FormSplash.C index 7fac1a161e..7fcef0f8a8 100644 --- a/src/frontends/xforms/FormSplash.C +++ b/src/frontends/xforms/FormSplash.C @@ -21,22 +21,24 @@ #include "form_splash.h" #include "support/LAssert.h" -extern "C" -int C_FormSplashCloseCB(FL_FORM * form, void *) -{ - lyx::Assert(form && form->u_vdata); - FormSplash * pre = static_cast(form->u_vdata); - pre->Hide(); - return FL_CANCEL; -} - - -extern "C" -void C_FormSplashCB(FL_OBJECT * ob, long) -{ - lyx::Assert(ob && ob->form && ob->form->u_vdata); - FormSplash * pre = static_cast(ob->form->u_vdata); - pre->Hide(); +extern "C" { + + static + int C_FormSplashCloseCB(FL_FORM * form, void *) + { + lyx::Assert(form && form->u_vdata); + FormSplash * pre = static_cast(form->u_vdata); + pre->Hide(); + return FL_CANCEL; + } + + void C_FormSplashCB(FL_OBJECT * ob, long) + { + lyx::Assert(ob && ob->form && ob->form->u_vdata); + FormSplash * pre = static_cast(ob->form->u_vdata); + pre->Hide(); + } + } diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 836eea39a0..f2890307d8 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -194,6 +194,8 @@ libxforms_la_SOURCES = \ # GUI_runtime.C \ # GUI_applymenu.C +libxforms_la_LIBADD = @LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@ + # for convenience only updatesrc: $(MAKE) -C forms updatesrc diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index 0ff7091d88..b485691855 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -70,9 +70,16 @@ int string_width(string const & str) } // namespace anon -//Defined later, used in makeMenubar(). -extern "C" -void C_Menubar_Pimpl_MenuCallback(FL_OBJECT * ob, long button); +extern "C" { + + //Defined later, used in makeMenubar(). + static + void C_Menubar_Pimpl_MenuCallback(FL_OBJECT * ob, long button) + { + Menubar::Pimpl::MenuCallback(ob, button); + } + +} Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb) @@ -523,13 +530,6 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view, } -extern "C" -void C_Menubar_Pimpl_MenuCallback(FL_OBJECT * ob, long button) -{ - Menubar::Pimpl::MenuCallback(ob, button); -} - - void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button) { ItemInfo * iteminfo = static_cast(ob->u_vdata); diff --git a/src/frontends/xforms/Timeout_pimpl.C b/src/frontends/xforms/Timeout_pimpl.C index deefa81da8..ad96ae2d87 100644 --- a/src/frontends/xforms/Timeout_pimpl.C +++ b/src/frontends/xforms/Timeout_pimpl.C @@ -22,11 +22,15 @@ using std::endl; namespace { -extern "C" -void C_intern_timeout_cb(int, void * data) -{ - Timeout * to = static_cast(data); - to->emit(); +extern "C" { + + static + void C_intern_timeout_cb(int, void * data) + { + Timeout * to = static_cast(data); + to->emit(); + } + } } // namespace anon diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 48bad4b157..655fa2a98e 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -106,7 +106,9 @@ void BubbleTimerCB(FL_OBJECT *, long data) } -extern "C" void C_Toolbar_BubbleTimerCB(FL_OBJECT * ob, long data) +extern "C" +static +void C_Toolbar_BubbleTimerCB(FL_OBJECT * ob, long data) { BubbleTimerCB(ob, data); } @@ -114,8 +116,8 @@ extern "C" void C_Toolbar_BubbleTimerCB(FL_OBJECT * ob, long data) // post_handler for bubble-help (Matthias) int BubblePost(FL_OBJECT *ob, int event, - FL_Coord /*mx*/, FL_Coord /*my*/, - int /*key*/, void * /*xev*/) + FL_Coord /*mx*/, FL_Coord /*my*/, + int /*key*/, void * /*xev*/) { FL_OBJECT * bubble_timer = reinterpret_cast(ob->u_cdata); @@ -134,9 +136,11 @@ int BubblePost(FL_OBJECT *ob, int event, } -extern "C" int C_Toolbar_BubblePost(FL_OBJECT * ob, int event, - FL_Coord /*mx*/, FL_Coord /*my*/, - int key, void * xev) +extern "C" +static +int C_Toolbar_BubblePost(FL_OBJECT * ob, int event, + FL_Coord /*mx*/, FL_Coord /*my*/, + int key, void * xev) { return BubblePost(ob, event, 0, 0, key, xev); } @@ -292,17 +296,18 @@ void ToolbarCB(FL_OBJECT * ob, long ac) << res << endl; } -} // namespace anon - -extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data) -{ - ToolbarCB(ob, data); +extern "C" { + + static + void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data) + { + ToolbarCB(ob, data); + } + } -namespace { - void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) { string name, arg, xpm_name; kb_action act; diff --git a/src/frontends/xforms/combox.C b/src/frontends/xforms/combox.C index 9f1c54b79c..8509c4b0f3 100644 --- a/src/frontends/xforms/combox.C +++ b/src/frontends/xforms/combox.C @@ -43,9 +43,28 @@ using std::endl; // These are C wrappers around static members of Combox, used as // callbacks for xforms. -extern "C" void C_Combox_input_cb(FL_OBJECT *ob, long); -extern "C" void C_Combox_combo_cb(FL_OBJECT *ob, long data) ; -extern "C" int C_Combox_peek_event(FL_FORM * form, void *xev); +extern "C" { + + static + void C_Combox_input_cb(FL_OBJECT * ob, long data) + { + Combox::input_cb(ob, data); + } + + static + void C_Combox_combo_cb(FL_OBJECT * ob, long data) + { + Combox::combo_cb(ob, data); + } + + static + int C_Combox_peek_event(FL_FORM * form, void *xev) + { + return Combox::peek_event(form, xev); + } + +} + Combox::Combox(combox_type t) : type(t), tabfolder1(0), tabfolder2(0) @@ -364,12 +383,6 @@ void Combox::input_cb(FL_OBJECT * ob, long) } -extern "C" void C_Combox_input_cb(FL_OBJECT * ob, long data) -{ - Combox::input_cb(ob, data); -} - - void Combox::combo_cb(FL_OBJECT * ob, long data) { Combox * combo = static_cast(ob->u_vdata); @@ -404,11 +417,6 @@ void Combox::combo_cb(FL_OBJECT * ob, long data) } } -extern "C" void C_Combox_combo_cb(FL_OBJECT * ob, long data) -{ - Combox::combo_cb(ob, data); -} - int Combox::peek_event(FL_FORM * form, void * xev) { @@ -474,11 +482,6 @@ int Combox::peek_event(FL_FORM * form, void * xev) } return 0; } - -extern "C" int C_Combox_peek_event(FL_FORM * form, void *xev) -{ - return Combox::peek_event(form, xev); -} #ifdef TESTCOMBO diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index 839a50acfd..c9d110da05 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -38,9 +38,8 @@ void setEnabled(FL_OBJECT * ob, bool enable) // Take a string and add breaks so that it fits into a desired label width, w string formatted(string const & sin, int w, int size, int style) { -#ifdef WITH_WARNINGS -#warning Why cant this be done by a one pass algo? (Lgb) -#endif + // FIX: Q: Why cant this be done by a one pass algo? (Lgb) + string sout; if (sin.empty()) return sout; diff --git a/src/graphics/ImageLoaderXPM.C b/src/graphics/ImageLoaderXPM.C index 9cdf6de1e7..6d1ad4117a 100644 --- a/src/graphics/ImageLoaderXPM.C +++ b/src/graphics/ImageLoaderXPM.C @@ -60,10 +60,8 @@ ImageLoaderXPM::runImageLoader(string const & filename) { Display * display = GUIRunTime::x11Display(); -//(BE 2000-08-05) -#ifdef WITH_WARNINGS -#warning This might be a dirty thing, but I dont know any other solution. -#endif + //(BE 2000-08-05) + // This might be a dirty thing, but I dont know any other solution. Screen * screen = ScreenOfDisplay(display, GUIRunTime::x11Screen()); Pixmap pixmap; diff --git a/src/insets/figinset.C b/src/insets/figinset.C index a1285e5b62..ff49663893 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -177,7 +177,9 @@ void kill_gs(int pid, int sig) } -extern "C" +extern "C" { + +static int GhostscriptMsg(XEvent * ev, void *) { // bin all events not of interest @@ -313,6 +315,8 @@ int GhostscriptMsg(XEvent * ev, void *) return FL_PREEMPT; } +} + void AllocColors(int num) // allocate color cube numxnumxnum, if possible @@ -388,6 +392,7 @@ void AllocGrays(int num) gs_color = true; } + void InitFigures() { // if bitmaps and figures are not empty we will leak mem diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 5a9926cff8..408447e7fb 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -631,6 +631,8 @@ bool InsetCollapsable::searchForward(BufferView * bv, string const & str, first_after_edit = false; return found; } + + bool InsetCollapsable::searchBackward(BufferView * bv, string const & str, bool const & cs, bool const & mw) { @@ -642,9 +644,10 @@ bool InsetCollapsable::searchBackward(BufferView * bv, string const & str, } -string const InsetCollapsable::selectNextWord(BufferView * bv, float & value) const +string const InsetCollapsable::selectNextWord(BufferView * bv, + float & value) const { - string str = inset.selectNextWord(bv, value); + string const str = inset.selectNextWord(bv, value); if (first_after_edit && str.empty()) close(bv); first_after_edit = false; diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 9668fea174..79ba5e635a 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -423,8 +423,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, inset_y = cy(bv) + drawTextYOffset; } if (!cleared && (need_update == CURSOR) - && !getLyXText(bv)->selection.set()) - { + && !getLyXText(bv)->selection.set()) { drawFrame(pain, cleared); x += last_width; // was width(bv, f); need_update = NONE; @@ -470,9 +469,9 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, bv->screen()->update(lt, bv, y_offset, int(x)); } else { locked = false; - if (need_update & SELECTION) + if (need_update & SELECTION) { bv->screen()->toggleToggle(lt, bv, y_offset, int(x)); - else if (need_update & CURSOR) { + } else if (need_update & CURSOR) { bv->screen()->toggleSelection(lt, bv, true, y_offset,int(x)); lt->clearSelection(); lt->selection.cursor = lt->cursor; @@ -484,15 +483,20 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, lt->refresh_y = 0; lt->status(bv, LyXText::UNCHANGED); if ((need_update != CURSOR_PAR) && - ((drawFrame_ == ALWAYS) || ((drawFrame_ == LOCKED) && locked))) + ((drawFrame_ == ALWAYS) || ((drawFrame_ == LOCKED) && locked))) { drawFrame(pain, cleared); - else if (need_update & CLEAR_FRAME) + } else if (need_update & CLEAR_FRAME) { clearFrame(pain, cleared); + } + x += last_width /* was width(bv, f) */ - TEXT_TO_INSET_OFFSET; + if (bv->text->status() == LyXText::CHANGED_IN_DRAW) { need_update |= FULL; - } else if (need_update != INIT) + } else if (need_update != INIT) { need_update = NONE; + } + if (clear) lt = 0; } @@ -506,7 +510,8 @@ void InsetText::drawFrame(Painter & pain, bool cleared) const frame_y = top_baseline - insetAscent + ttoD2; frame_w = last_width - TEXT_TO_INSET_OFFSET; frame_h = insetAscent + insetDescent - TEXT_TO_INSET_OFFSET; - pain.rectangle(frame_x, frame_y, frame_w, frame_h, + pain.rectangle(frame_x, frame_y, + frame_w, frame_h, frame_color); frame_is_visible = true; } diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 6afd11fb58..dcb3b5778c 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -75,7 +75,9 @@ FL_resource res[] = }; -extern "C" +extern "C" { + +static int LyX_XErrHandler(Display * display, XErrorEvent * xeev) { // emergency save @@ -90,6 +92,8 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev) lyx::abort(); return 0; // Solaris CC wants us to return something } + +} LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI) diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 54adb94fe2..dc4c6ca537 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -40,11 +40,15 @@ extern FD_form_sendto * fd_form_sendto; extern void HideFiguresPopups(); + // Prevents LyX from being killed when the close box is pressed in a popup. -extern "C" int CancelCloseBoxCB(FL_FORM *, void *) +extern "C" +int CancelCloseBoxCB(FL_FORM *, void *) { return FL_CANCEL; } + + // Redraw the form (on receipt of a Signal indicating, for example, // that the xform colors have been re-mapped). void RedrawAllBufferRelatedDialogs() diff --git a/src/lyx_gui_misc.h b/src/lyx_gui_misc.h index 5726d11baa..8ce53f9a00 100644 --- a/src/lyx_gui_misc.h +++ b/src/lyx_gui_misc.h @@ -23,7 +23,8 @@ #include /* needed for pair<> definition */ /// Prevents LyX from being killed when the close box is pressed in a popup. -extern "C" int CancelCloseBoxCB(FL_FORM *, void *); +extern "C" +int CancelCloseBoxCB(FL_FORM *, void *); /** Redraw the form (on receipt of a Signal indicating, for example, that the xform colors have been re-mapped). */ diff --git a/src/lyx_main.C b/src/lyx_main.C index 0197a8a4b3..6993f748a2 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -185,7 +185,52 @@ LyX::~LyX() } -extern "C" void error_handler(int err_sig); +extern "C" { + +static +void error_handler(int err_sig) +{ + switch (err_sig) { + case SIGHUP: + lyxerr << "\nlyx: SIGHUP signal caught" << endl; + break; + case SIGINT: + // no comments + break; + case SIGFPE: + lyxerr << "\nlyx: SIGFPE signal caught" << endl; + break; + case SIGSEGV: + lyxerr << "\nlyx: SIGSEGV signal caught" << endl; + lyxerr << + "Sorry, you have found a bug in LyX." + " If possible, please read 'Known bugs'\n" + "under the Help menu and then send us " + "a full bug report. Thanks!" << endl; + break; + case SIGTERM: + // no comments + break; + } + + // Deinstall the signal handlers + signal(SIGHUP, SIG_DFL); + signal(SIGINT, SIG_DFL); + signal(SIGFPE, SIG_DFL); + signal(SIGSEGV, SIG_DFL); + signal(SIGTERM, SIG_DFL); + + bufferlist.emergencyWriteAll(); + + lyxerr << "Bye." << endl; + if (err_sig!= SIGHUP && + (!GetEnv("LYXDEBUG").empty() || err_sig == SIGSEGV)) + lyx::abort(); + exit(0); +} + +} + void LyX::init(bool gui) { @@ -839,44 +884,3 @@ bool LyX::easyParse(int * argc, char * argv[]) } -extern "C" -void error_handler(int err_sig) -{ - switch (err_sig) { - case SIGHUP: - lyxerr << "\nlyx: SIGHUP signal caught" << endl; - break; - case SIGINT: - // no comments - break; - case SIGFPE: - lyxerr << "\nlyx: SIGFPE signal caught" << endl; - break; - case SIGSEGV: - lyxerr << "\nlyx: SIGSEGV signal caught" << endl; - lyxerr << - "Sorry, you have found a bug in LyX." - " If possible, please read 'Known bugs'\n" - "under the Help menu and then send us " - "a full bug report. Thanks!" << endl; - break; - case SIGTERM: - // no comments - break; - } - - // Deinstall the signal handlers - signal(SIGHUP, SIG_DFL); - signal(SIGINT, SIG_DFL); - signal(SIGFPE, SIG_DFL); - signal(SIGSEGV, SIG_DFL); - signal(SIGTERM, SIG_DFL); - - bufferlist.emergencyWriteAll(); - - lyxerr << "Bye." << endl; - if (err_sig!= SIGHUP && - (!GetEnv("LYXDEBUG").empty() || err_sig == SIGSEGV)) - lyx::abort(); - exit(0); -} diff --git a/src/lyxfunc.C b/src/lyxfunc.C index dedea4a7a5..d168f41aa5 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1195,7 +1195,7 @@ string const LyXFunc::dispatch(int ac, break; #else #ifdef WITH_WARNINGS -#warning Find another implementation here (or another lyxfunc)! +//#warning Find another implementation here (or another lyxfunc)! #endif #endif case LFUN_HELP_ABOUTLYX: diff --git a/src/lyxserver.C b/src/lyxserver.C index 0d6662cd96..0133d1abc3 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -36,7 +36,6 @@ #include -//#include #include #include #include @@ -81,14 +80,24 @@ int mkfifo(char const * __path, mode_t __mode) { extern LyXAction lyxaction; -// C wrapper -extern "C" void C_LyXComm_callback(int fd, void *v); + +extern "C" { + + // C wrapper + static + void C_LyXComm_callback(int fd, void *v) + { + LyXComm::callback(fd, v); + } + +} // LyXComm class - - // Open pipes -void LyXComm::openConnection() { + +// Open pipes +void LyXComm::openConnection() +{ lyxerr[Debug::LYXSERVER] << "LyXComm: Opening connection" << endl; // If we are up, that's an error @@ -113,10 +122,11 @@ void LyXComm::openConnection() { // The current emx implementation of access() won't work with pipes. rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_INBOUND, NP_NOWAIT|0x01, 0600, 0600, 0); - if (rc == ERROR_PIPE_BUSY) { + if (rc == ERROR_PIPE_BUSY) #else - if (::access(tmp.c_str(), F_OK) == 0) { + if (::access(tmp.c_str(), F_OK) == 0) #endif + { lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n" << "If no other LyX program is active, please delete" " the pipe by hand and try again." << endl; @@ -161,13 +171,14 @@ void LyXComm::openConnection() { tmp = pipename + ".out"; #ifndef __EMX__ - if (::access(tmp.c_str(), F_OK) == 0) { + if (::access(tmp.c_str(), F_OK) == 0) #else rc = DosCreateNPipe(tmp.c_str(), &fd, NP_ACCESS_DUPLEX, NP_NOWAIT|0x01, 0600, 0600, 0); - if (rc == ERROR_PIPE_BUSY) { + if (rc == ERROR_PIPE_BUSY) #endif + { lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n" << "If no other LyX program is active, please delete" " the pipe by hand and try again." << endl; @@ -216,14 +227,16 @@ void LyXComm::openConnection() { lyxerr << "LyXComm: Could not set flags on pipe " << tmp << '\n' << strerror(errno) << endl; return; - }; + } // We made it! ready = true; lyxerr[Debug::LYXSERVER] << "LyXComm: Connection established" << endl; } - + + /// Close pipes -void LyXComm::closeConnection() { +void LyXComm::closeConnection() +{ #ifdef __EMX__ APIRET rc; int errnum; @@ -287,7 +300,8 @@ void LyXComm::closeConnection() { } ready = false; } - + + // Receives messages and sends then to client void LyXComm::callback(int fd, void *v) { @@ -353,13 +367,9 @@ void LyXComm::callback(int fd, void *v) errno= 0; } -extern "C" void C_LyXComm_callback(int fd, void *v) -{ - LyXComm::callback(fd, v); -} - -void LyXComm::send(string const & msg) { +void LyXComm::send(string const & msg) +{ if (msg.empty()) { lyxerr << "LyXComm: Request to send empty string. Ignoring." << endl; diff --git a/src/mathed/Makefile.am b/src/mathed/Makefile.am index 666ceb7c29..c83aa507ab 100644 --- a/src/mathed/Makefile.am +++ b/src/mathed/Makefile.am @@ -7,8 +7,6 @@ ETAGS_ARGS = --lang=c++ BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES) - - libmathed_la_SOURCES = \ array.C \ array.h \ diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index e6421cff7c..cc131a3347 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -112,9 +112,7 @@ MathArrayInset * matrixpar(int & idx) InsetFormulaBase::InsetFormulaBase() { -#ifdef WITH_WARNINGS -#warning This is needed as long the math parser is not re-entrant -#endif + // This is needed as long the math parser is not re-entrant MathMacroTable::builtinMacros(); //lyxerr << "sizeof MathInset: " << sizeof(MathInset) << "\n"; } diff --git a/src/minibuffer.C b/src/minibuffer.C index 95ebfe3d4a..944af290e3 100644 --- a/src/minibuffer.C +++ b/src/minibuffer.C @@ -233,13 +233,17 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) } -extern "C" -int C_MiniBuffer_peek_event(FL_OBJECT * ob, int event, - FL_Coord, FL_Coord, - int key, void * /*xev*/) -{ - MiniBuffer * mini = static_cast(ob->u_vdata); - return mini->peek_event(ob, event, key); +extern "C" { + + static + int C_MiniBuffer_peek_event(FL_OBJECT * ob, int event, + FL_Coord, FL_Coord, + int key, void * /*xev*/) + { + MiniBuffer * mini = static_cast(ob->u_vdata); + return mini->peek_event(ob, event, key); + } + } diff --git a/src/os2_defines.h b/src/os2_defines.h index 25ffb99035..aa2b0c7855 100644 --- a/src/os2_defines.h +++ b/src/os2_defines.h @@ -16,7 +16,10 @@ #if defined (__cplusplus) #include #include -extern "C" inline int readlink(const char *, char *, size_t) {return -1;} + +extern "C" +inline int readlink(const char *, char *, size_t) {return -1;} + #else #include #include diff --git a/src/paragraph.C b/src/paragraph.C index 6aabdd620b..80745161f2 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1606,9 +1606,9 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, } #else #ifdef WITH_WARNINGS -#warning For now we ALWAYS have to close the foreign font settings if they are -#warning there as we start another \selectlanguage with the next paragraph if -#warning we are in need of this. This should be fixed sometime (Jug) +//#warning For now we ALWAYS have to close the foreign font settings if they are +//#warning there as we start another \selectlanguage with the next paragraph if +//#warning we are in need of this. This should be fixed sometime (Jug) #endif running_font.latexWriteEndChanges(os, basefont, basefont); #endif diff --git a/src/paragraph.h b/src/paragraph.h index a01af43b0c..1b54a1df1a 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -94,7 +94,7 @@ public: explicit Paragraph(Paragraph * par); /// - Paragraph(Paragraph const &, bool same_ids = false); + Paragraph(Paragraph const &, bool same_ids); /// the destructor removes the new paragraph from the list ~Paragraph(); @@ -400,6 +400,8 @@ public: inset_iterator InsetIterator(size_type pos); private: + /// if anything uses this we don't want it to. + Paragraph(Paragraph const &); /// Paragraph * next_; /// diff --git a/src/tabular-old.C b/src/tabular-old.C index 6b943119df..782d8e71d4 100644 --- a/src/tabular-old.C +++ b/src/tabular-old.C @@ -129,7 +129,7 @@ inline void l_getline(istream & is, string & str) { #ifdef WITH_WARNINGS -#warning old l_getline +//#warning old l_getline #endif getline(is, str); while(str.empty()) diff --git a/src/text.C b/src/text.C index 3e8400867a..58cb13af98 100644 --- a/src/text.C +++ b/src/text.C @@ -2281,6 +2281,7 @@ string const LyXText::selectNextWord(BufferView * bview, return str; } #warning Dekel please have a look on this one RTL? (Jug) +#warning DEKEL! // we have to go on checking so move cusor to the right if (cursor.pos() == cursor.par()->size()) { if (!cursor.par()->next()) diff --git a/src/text2.C b/src/text2.C index b29176a7e8..78be236665 100644 --- a/src/text2.C +++ b/src/text2.C @@ -2202,8 +2202,8 @@ void LyXText::setCursorIntern(BufferView * bview, Paragraph * par, // and open and lock the inset (bla bla bla) // stuff I don't know... so can you have a look? // (Lgb) - // I moved the lyxerr stuff in here so we can see if this - // is actually really needed and where! + // I moved the lyxerr stuff in here so we can see if + // this is actually really needed and where! // (Jug) it->getLyXText(bview)->setCursorIntern(bview, par, pos, setfont, boundary); diff --git a/src/trans.C b/src/trans.C index 72e67d5439..6f1e3809f7 100644 --- a/src/trans.C +++ b/src/trans.C @@ -221,7 +221,7 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys) } -int Trans::Load(LyXLex & lex) +int Trans::Load(LyXLex & lex) { bool error = false; @@ -253,7 +253,7 @@ int Trans::Load(LyXLex & lex) return -1; #if 1 -#warning This code should be removed... +//#warning This code should be removed... // But we need to fix up all the kmap files first // so that this field is not present anymore. if (lex.next(true)) { diff --git a/src/undo_funcs.C b/src/undo_funcs.C index 64afb1ac19..56b53ec745 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -296,7 +296,7 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind, while (tmppar != end && tmppar->next()) { tmppar = tmppar->next(); - tmppar2->next(new Paragraph(*tmppar)); + tmppar2->next(new Paragraph(*tmppar, false)); tmppar2->next()->id(tmppar->id()); // a memory optimization: Just store the layout // information when only edit