From 2a31934f38d624bef25c0b177852233eee9768f0 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 19 May 2004 15:11:37 +0000 Subject: [PATCH] Wrap most of the frontend code up inside namespace lyx::frontend. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8766 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 +++ src/LaTeXFeatures.C | 2 + src/ToolbarBackend.C | 2 + src/bufferparams.C | 2 + src/bufferparams.h | 4 +- src/frontends/ChangeLog | 6 +++ src/frontends/Dialogs.C | 1 + src/frontends/Dialogs.h | 11 ++-- src/frontends/LyXView.C | 1 + src/frontends/LyXView.h | 12 ++++- src/frontends/controllers/BCView.C | 5 ++ src/frontends/controllers/BCView.h | 4 ++ src/frontends/controllers/BCView.tmpl | 6 +++ src/frontends/controllers/ButtonController.C | 5 ++ src/frontends/controllers/ButtonController.h | 8 +-- src/frontends/controllers/ButtonPolicies.C | 6 +++ src/frontends/controllers/ButtonPolicies.h | 6 +++ src/frontends/controllers/ChangeLog | 5 ++ src/frontends/controllers/ControlAboutlyx.C | 18 +++++-- src/frontends/controllers/ControlAboutlyx.h | 6 +++ src/frontends/controllers/ControlBibtex.C | 14 +++-- src/frontends/controllers/ControlBibtex.h | 9 ++-- src/frontends/controllers/ControlBox.C | 5 ++ src/frontends/controllers/ControlBox.h | 6 +++ src/frontends/controllers/ControlBranch.C | 5 ++ src/frontends/controllers/ControlBranch.h | 5 ++ src/frontends/controllers/ControlChanges.C | 17 ++++-- src/frontends/controllers/ControlChanges.h | 6 +++ src/frontends/controllers/ControlCharacter.C | 33 +++++++----- src/frontends/controllers/ControlCharacter.h | 9 +++- src/frontends/controllers/ControlCitation.C | 5 ++ src/frontends/controllers/ControlCitation.h | 5 ++ src/frontends/controllers/ControlCommand.C | 5 ++ src/frontends/controllers/ControlCommand.h | 4 ++ .../controllers/ControlCommandBuffer.C | 16 ++++-- .../controllers/ControlCommandBuffer.h | 6 +++ src/frontends/controllers/ControlDocument.C | 11 ++-- src/frontends/controllers/ControlDocument.h | 7 ++- src/frontends/controllers/ControlERT.C | 5 ++ src/frontends/controllers/ControlERT.h | 5 ++ src/frontends/controllers/ControlErrorList.C | 11 ++-- src/frontends/controllers/ControlErrorList.h | 8 +-- src/frontends/controllers/ControlExternal.C | 53 ++++++++++--------- src/frontends/controllers/ControlExternal.h | 15 ++++-- src/frontends/controllers/ControlFloat.C | 5 ++ src/frontends/controllers/ControlFloat.h | 6 +++ src/frontends/controllers/ControlGraphics.C | 32 ++++++----- src/frontends/controllers/ControlGraphics.h | 8 +-- src/frontends/controllers/ControlInclude.C | 16 ++++-- src/frontends/controllers/ControlInclude.h | 5 ++ src/frontends/controllers/ControlLog.C | 5 ++ src/frontends/controllers/ControlLog.h | 6 +++ src/frontends/controllers/ControlMath.C | 16 ++++-- src/frontends/controllers/ControlMath.h | 5 ++ src/frontends/controllers/ControlNote.C | 5 ++ src/frontends/controllers/ControlNote.h | 6 +++ src/frontends/controllers/ControlParagraph.C | 5 ++ src/frontends/controllers/ControlParagraph.h | 6 +++ src/frontends/controllers/ControlPreamble.C | 5 ++ src/frontends/controllers/ControlPreamble.h | 6 +++ src/frontends/controllers/ControlPrefs.C | 18 +++++-- src/frontends/controllers/ControlPrefs.h | 5 ++ src/frontends/controllers/ControlPrint.C | 14 +++-- src/frontends/controllers/ControlPrint.h | 6 +++ src/frontends/controllers/ControlRef.C | 12 +++-- src/frontends/controllers/ControlRef.h | 5 ++ src/frontends/controllers/ControlSearch.C | 13 +++-- src/frontends/controllers/ControlSearch.h | 5 ++ src/frontends/controllers/ControlSendto.C | 13 +++-- src/frontends/controllers/ControlSendto.h | 6 +++ src/frontends/controllers/ControlShowFile.C | 14 +++-- src/frontends/controllers/ControlShowFile.h | 6 +++ .../controllers/ControlSpellchecker.C | 13 +++-- .../controllers/ControlSpellchecker.h | 7 ++- src/frontends/controllers/ControlTabular.C | 5 ++ src/frontends/controllers/ControlTabular.h | 5 ++ .../controllers/ControlTabularCreate.C | 5 ++ .../controllers/ControlTabularCreate.h | 6 +++ src/frontends/controllers/ControlTexinfo.C | 5 ++ src/frontends/controllers/ControlTexinfo.h | 6 +++ src/frontends/controllers/ControlThesaurus.C | 15 ++++-- src/frontends/controllers/ControlThesaurus.h | 6 +++ src/frontends/controllers/ControlToc.C | 17 +++--- src/frontends/controllers/ControlToc.h | 10 +++- src/frontends/controllers/ControlVSpace.C | 5 ++ src/frontends/controllers/ControlVSpace.h | 5 ++ src/frontends/controllers/ControlWrap.C | 5 ++ src/frontends/controllers/ControlWrap.h | 6 +++ src/frontends/controllers/Dialog.C | 5 ++ src/frontends/controllers/Dialog.h | 9 ++-- src/frontends/controllers/Kernel.C | 5 ++ src/frontends/controllers/Kernel.h | 5 +- src/frontends/controllers/biblio.C | 29 +++++----- src/frontends/controllers/biblio.h | 3 ++ src/frontends/controllers/character.C | 6 ++- src/frontends/controllers/character.h | 6 ++- src/frontends/controllers/frnt_lang.C | 15 +++--- src/frontends/controllers/frnt_lang.h | 6 ++- src/frontends/controllers/helper_funcs.C | 27 ++++++---- src/frontends/controllers/helper_funcs.h | 12 +++-- src/frontends/controllers/tex_helpers.C | 32 ++++++----- src/frontends/controllers/tex_helpers.h | 5 ++ src/frontends/gtk/ChangeLog | 4 ++ src/frontends/gtk/Dialogs.C | 1 + src/frontends/gtk/GAboutlyx.C | 5 ++ src/frontends/gtk/GAboutlyx.h | 6 +++ src/frontends/gtk/GBC.C | 5 ++ src/frontends/gtk/GBC.h | 6 +++ src/frontends/gtk/GMathDelim.C | 6 +++ src/frontends/gtk/GMathDelim.h | 6 +++ src/frontends/gtk/GMathPanel.C | 6 +++ src/frontends/gtk/GMathPanel.h | 6 +++ src/frontends/gtk/GMenubar.C | 6 +++ src/frontends/gtk/GMenubar.h | 6 +++ src/frontends/gtk/GMiniBuffer.C | 5 ++ src/frontends/gtk/GMiniBuffer.h | 6 +++ src/frontends/gtk/GPainter.C | 28 +++++----- src/frontends/gtk/GPainter.h | 9 +++- src/frontends/gtk/GPrint.C | 5 ++ src/frontends/gtk/GPrint.h | 6 +++ src/frontends/gtk/GScreen.C | 5 ++ src/frontends/gtk/GScreen.h | 6 +++ src/frontends/gtk/GTableCreate.C | 6 +++ src/frontends/gtk/GTableCreate.h | 6 +++ src/frontends/gtk/GText.C | 7 ++- src/frontends/gtk/GText.h | 6 +++ src/frontends/gtk/GTimeout.C | 8 ++- src/frontends/gtk/GTimeout.h | 6 +++ src/frontends/gtk/GToolbar.C | 11 ++++ src/frontends/gtk/GToolbar.h | 7 ++- src/frontends/gtk/GUrl.C | 6 +++ src/frontends/gtk/GUrl.h | 6 +++ src/frontends/gtk/GView.C | 7 ++- src/frontends/gtk/GView.h | 6 +++ src/frontends/gtk/GViewBase.C | 7 ++- src/frontends/gtk/GViewBase.h | 6 +++ src/frontends/gtk/GWorkArea.C | 5 ++ src/frontends/gtk/GWorkArea.h | 6 +++ src/frontends/gtk/LyXScreenFactory.C | 3 ++ src/frontends/gtk/WorkAreaFactory.C | 2 +- src/frontends/gtk/ghelpers.C | 6 +++ src/frontends/gtk/ghelpers.h | 6 +++ src/frontends/gtk/lyx_gui.C | 4 ++ src/frontends/qt2/ChangeLog | 4 ++ src/frontends/qt2/Dialogs.C | 1 + src/frontends/qt2/QAbout.C | 5 ++ src/frontends/qt2/QAbout.h | 6 ++- src/frontends/qt2/QAboutDialog.C | 6 ++- src/frontends/qt2/QAboutDialog.h | 7 ++- src/frontends/qt2/QBibitem.C | 8 ++- src/frontends/qt2/QBibitem.h | 7 ++- src/frontends/qt2/QBibitemDialog.C | 5 ++ src/frontends/qt2/QBibitemDialog.h | 7 ++- src/frontends/qt2/QBibtex.C | 5 ++ src/frontends/qt2/QBibtex.h | 7 ++- src/frontends/qt2/QBibtexDialog.C | 5 ++ src/frontends/qt2/QBibtexDialog.h | 10 +++- src/frontends/qt2/QBox.C | 5 ++ src/frontends/qt2/QBox.h | 6 ++- src/frontends/qt2/QBoxDialog.C | 6 ++- src/frontends/qt2/QBoxDialog.h | 7 ++- src/frontends/qt2/QBranch.C | 5 ++ src/frontends/qt2/QBranch.h | 5 ++ src/frontends/qt2/QBranchDialog.C | 6 ++- src/frontends/qt2/QBranchDialog.h | 5 ++ src/frontends/qt2/QChanges.C | 5 ++ src/frontends/qt2/QChanges.h | 6 +++ src/frontends/qt2/QChangesDialog.C | 6 ++- src/frontends/qt2/QChangesDialog.h | 6 +++ src/frontends/qt2/QCharacter.C | 20 ++----- src/frontends/qt2/QCharacter.h | 20 ++++--- src/frontends/qt2/QCharacterDialog.C | 5 ++ src/frontends/qt2/QCharacterDialog.h | 8 ++- src/frontends/qt2/QCitation.C | 14 +++-- src/frontends/qt2/QCitation.h | 9 +++- src/frontends/qt2/QCitationDialog.C | 5 ++ src/frontends/qt2/QCitationDialog.h | 10 +++- src/frontends/qt2/QCommandBuffer.C | 5 ++ src/frontends/qt2/QCommandBuffer.h | 11 +++- src/frontends/qt2/QCommandEdit.C | 6 +++ src/frontends/qt2/QCommandEdit.h | 6 +++ src/frontends/qt2/QDelimiterDialog.C | 6 +++ src/frontends/qt2/QDelimiterDialog.h | 10 +++- src/frontends/qt2/QDialogView.C | 7 ++- src/frontends/qt2/QDialogView.h | 5 ++ src/frontends/qt2/QDocument.C | 13 +++-- src/frontends/qt2/QDocument.h | 11 ++-- src/frontends/qt2/QDocumentDialog.C | 5 ++ src/frontends/qt2/QDocumentDialog.h | 9 +++- src/frontends/qt2/QERT.C | 6 +++ src/frontends/qt2/QERT.h | 6 ++- src/frontends/qt2/QERTDialog.C | 6 ++- src/frontends/qt2/QERTDialog.h | 5 ++ src/frontends/qt2/QErrorList.C | 6 +++ src/frontends/qt2/QErrorList.h | 7 ++- src/frontends/qt2/QErrorListDialog.C | 6 ++- src/frontends/qt2/QErrorListDialog.h | 7 ++- src/frontends/qt2/QExternal.C | 9 +++- src/frontends/qt2/QExternal.h | 6 ++- src/frontends/qt2/QExternalDialog.C | 5 ++ src/frontends/qt2/QExternalDialog.h | 7 ++- src/frontends/qt2/QFloat.C | 6 +++ src/frontends/qt2/QFloat.h | 7 ++- src/frontends/qt2/QFloatDialog.C | 8 +-- src/frontends/qt2/QFloatDialog.h | 7 ++- src/frontends/qt2/QGraphics.C | 11 ++-- src/frontends/qt2/QGraphics.h | 6 ++- src/frontends/qt2/QGraphicsDialog.C | 6 ++- src/frontends/qt2/QGraphicsDialog.h | 7 ++- src/frontends/qt2/QInclude.C | 5 ++ src/frontends/qt2/QInclude.h | 6 ++- src/frontends/qt2/QIncludeDialog.C | 8 +-- src/frontends/qt2/QIncludeDialog.h | 7 ++- src/frontends/qt2/QIndex.C | 6 +++ src/frontends/qt2/QIndex.h | 7 ++- src/frontends/qt2/QIndexDialog.C | 5 ++ src/frontends/qt2/QIndexDialog.h | 7 ++- src/frontends/qt2/QLMenubar.C | 5 ++ src/frontends/qt2/QLMenubar.h | 10 +++- src/frontends/qt2/QLPopupMenu.C | 10 +++- src/frontends/qt2/QLPopupMenu.h | 8 ++- src/frontends/qt2/QLPrintDialog.C | 6 ++- src/frontends/qt2/QLPrintDialog.h | 7 ++- src/frontends/qt2/QLToolbar.C | 10 ++++ src/frontends/qt2/QLToolbar.h | 9 +++- src/frontends/qt2/QLog.C | 5 ++ src/frontends/qt2/QLog.h | 6 ++- src/frontends/qt2/QLogDialog.C | 8 +-- src/frontends/qt2/QLogDialog.h | 7 ++- src/frontends/qt2/QMath.C | 6 ++- src/frontends/qt2/QMath.h | 7 ++- src/frontends/qt2/QMathDialog.C | 5 ++ src/frontends/qt2/QMathDialog.h | 8 ++- src/frontends/qt2/QMathMatrixDialog.C | 13 ++++- src/frontends/qt2/QMathMatrixDialog.h | 7 ++- src/frontends/qt2/QNote.C | 5 ++ src/frontends/qt2/QNote.h | 5 ++ src/frontends/qt2/QNoteDialog.C | 6 ++- src/frontends/qt2/QNoteDialog.h | 5 ++ src/frontends/qt2/QParagraph.C | 5 ++ src/frontends/qt2/QParagraph.h | 5 ++ src/frontends/qt2/QParagraphDialog.C | 5 ++ src/frontends/qt2/QParagraphDialog.h | 7 ++- src/frontends/qt2/QPrefs.C | 13 +++-- src/frontends/qt2/QPrefs.h | 9 +++- src/frontends/qt2/QPrefsDialog.C | 6 ++- src/frontends/qt2/QPrefsDialog.h | 10 +++- src/frontends/qt2/QPrint.C | 5 ++ src/frontends/qt2/QPrint.h | 6 +++ src/frontends/qt2/QRef.C | 5 ++ src/frontends/qt2/QRef.h | 5 ++ src/frontends/qt2/QRefDialog.C | 7 ++- src/frontends/qt2/QRefDialog.h | 7 ++- src/frontends/qt2/QSearch.C | 5 ++ src/frontends/qt2/QSearch.h | 7 ++- src/frontends/qt2/QSearchDialog.C | 7 ++- src/frontends/qt2/QSearchDialog.h | 10 +++- src/frontends/qt2/QSendto.C | 6 +++ src/frontends/qt2/QSendto.h | 9 +++- src/frontends/qt2/QSendtoDialog.C | 8 +-- src/frontends/qt2/QSendtoDialog.h | 7 ++- src/frontends/qt2/QShowFile.C | 6 +++ src/frontends/qt2/QShowFile.h | 6 ++- src/frontends/qt2/QShowFileDialog.C | 6 ++- src/frontends/qt2/QShowFileDialog.h | 7 ++- src/frontends/qt2/QSpellchecker.C | 6 +++ src/frontends/qt2/QSpellchecker.h | 6 +++ src/frontends/qt2/QSpellcheckerDialog.C | 6 ++- src/frontends/qt2/QSpellcheckerDialog.h | 7 ++- src/frontends/qt2/QTabular.C | 5 ++ src/frontends/qt2/QTabular.h | 6 ++- src/frontends/qt2/QTabularCreate.C | 6 +++ src/frontends/qt2/QTabularCreate.h | 7 ++- src/frontends/qt2/QTabularCreateDialog.C | 8 +-- src/frontends/qt2/QTabularCreateDialog.h | 7 ++- src/frontends/qt2/QTabularDialog.C | 6 +++ src/frontends/qt2/QTabularDialog.h | 7 ++- src/frontends/qt2/QTexinfo.C | 5 ++ src/frontends/qt2/QTexinfo.h | 7 ++- src/frontends/qt2/QTexinfoDialog.C | 8 ++- src/frontends/qt2/QTexinfoDialog.h | 7 ++- src/frontends/qt2/QThesaurus.C | 7 ++- src/frontends/qt2/QThesaurus.h | 6 ++- src/frontends/qt2/QThesaurusDialog.C | 7 ++- src/frontends/qt2/QThesaurusDialog.h | 10 +++- src/frontends/qt2/QToc.C | 13 +++-- src/frontends/qt2/QToc.h | 7 ++- src/frontends/qt2/QTocDialog.C | 5 ++ src/frontends/qt2/QTocDialog.h | 7 ++- src/frontends/qt2/QURL.C | 6 +++ src/frontends/qt2/QURL.h | 8 ++- src/frontends/qt2/QURLDialog.C | 6 ++- src/frontends/qt2/QURLDialog.h | 7 ++- src/frontends/qt2/QVSpace.C | 5 ++ src/frontends/qt2/QVSpace.h | 6 +++ src/frontends/qt2/QVSpaceDialog.C | 5 ++ src/frontends/qt2/QVSpaceDialog.h | 7 ++- src/frontends/qt2/QWrap.C | 5 ++ src/frontends/qt2/QWrap.h | 6 ++- src/frontends/qt2/QWrapDialog.C | 7 ++- src/frontends/qt2/QWrapDialog.h | 7 ++- src/frontends/qt2/Qt2BC.C | 5 ++ src/frontends/qt2/Qt2BC.h | 7 ++- src/frontends/qt2/QtView.C | 13 +++-- src/frontends/qt2/QtView.h | 9 +++- src/frontends/qt2/checkedwidgets.C | 5 ++ src/frontends/qt2/checkedwidgets.h | 6 ++- src/frontends/qt2/lyx_gui.C | 2 + src/frontends/xforms/Alert_pimpl.C | 3 ++ src/frontends/xforms/ChangeLog | 4 ++ src/frontends/xforms/Color.C | 6 ++- src/frontends/xforms/Color.h | 6 ++- src/frontends/xforms/ColorHandler.C | 21 ++++++-- src/frontends/xforms/ColorHandler.h | 7 ++- src/frontends/xforms/Dialogs.C | 1 + src/frontends/xforms/FontInfo.C | 12 +++-- src/frontends/xforms/FontInfo.h | 6 +++ src/frontends/xforms/FormAboutlyx.C | 5 ++ src/frontends/xforms/FormAboutlyx.h | 5 +- src/frontends/xforms/FormBibitem.C | 12 ++++- src/frontends/xforms/FormBibitem.h | 7 ++- src/frontends/xforms/FormBibtex.C | 30 +++++++---- src/frontends/xforms/FormBibtex.h | 7 ++- src/frontends/xforms/FormBox.C | 14 +++-- src/frontends/xforms/FormBox.h | 6 ++- src/frontends/xforms/FormBranch.C | 6 +++ src/frontends/xforms/FormBranch.h | 6 ++- src/frontends/xforms/FormBrowser.C | 6 ++- src/frontends/xforms/FormBrowser.h | 10 +++- src/frontends/xforms/FormChanges.C | 8 ++- src/frontends/xforms/FormChanges.h | 6 +++ src/frontends/xforms/FormCharacter.C | 28 ++++------ src/frontends/xforms/FormCharacter.h | 21 +++++--- src/frontends/xforms/FormCitation.C | 15 ++++-- src/frontends/xforms/FormCitation.h | 11 ++-- src/frontends/xforms/FormColorpicker.C | 8 ++- src/frontends/xforms/FormColorpicker.h | 11 ++-- src/frontends/xforms/FormDialogView.C | 12 +++-- src/frontends/xforms/FormDialogView.h | 8 ++- src/frontends/xforms/FormDocument.C | 27 ++++++---- src/frontends/xforms/FormDocument.h | 10 ++-- src/frontends/xforms/FormERT.C | 5 ++ src/frontends/xforms/FormERT.h | 6 ++- src/frontends/xforms/FormErrorList.C | 5 ++ src/frontends/xforms/FormErrorList.h | 7 ++- src/frontends/xforms/FormExternal.C | 30 ++++++----- src/frontends/xforms/FormExternal.h | 7 ++- src/frontends/xforms/FormFiledialog.C | 2 +- src/frontends/xforms/FormFiledialog.h | 23 +++++--- src/frontends/xforms/FormFloat.C | 10 +++- src/frontends/xforms/FormFloat.h | 6 +++ src/frontends/xforms/FormGraphics.C | 43 ++++++++------- src/frontends/xforms/FormGraphics.h | 9 ++-- src/frontends/xforms/FormInclude.C | 10 +++- src/frontends/xforms/FormInclude.h | 6 ++- src/frontends/xforms/FormLog.C | 5 ++ src/frontends/xforms/FormLog.h | 6 +++ src/frontends/xforms/FormMathsBitmap.C | 5 ++ src/frontends/xforms/FormMathsBitmap.h | 5 ++ src/frontends/xforms/FormMathsDelim.C | 5 ++ src/frontends/xforms/FormMathsDelim.h | 6 ++- src/frontends/xforms/FormMathsMatrix.C | 37 +++++++------ src/frontends/xforms/FormMathsMatrix.h | 6 ++- src/frontends/xforms/FormMathsPanel.C | 5 ++ src/frontends/xforms/FormMathsPanel.h | 6 ++- src/frontends/xforms/FormMathsSpace.C | 7 ++- src/frontends/xforms/FormMathsSpace.h | 6 ++- src/frontends/xforms/FormMathsStyle.C | 9 ++++ src/frontends/xforms/FormMathsStyle.h | 6 ++- src/frontends/xforms/FormNote.C | 6 ++- src/frontends/xforms/FormNote.h | 6 ++- src/frontends/xforms/FormParagraph.C | 14 +++-- src/frontends/xforms/FormParagraph.h | 9 +++- src/frontends/xforms/FormPreamble.C | 5 ++ src/frontends/xforms/FormPreamble.h | 5 ++ src/frontends/xforms/FormPreferences.C | 48 +++++++++-------- src/frontends/xforms/FormPreferences.h | 16 ++++-- src/frontends/xforms/FormPrint.C | 10 +++- src/frontends/xforms/FormPrint.h | 6 +++ src/frontends/xforms/FormRef.C | 10 +++- src/frontends/xforms/FormRef.h | 7 ++- src/frontends/xforms/FormSearch.C | 6 ++- src/frontends/xforms/FormSearch.h | 6 +++ src/frontends/xforms/FormSendto.C | 10 +++- src/frontends/xforms/FormSendto.h | 11 +++- src/frontends/xforms/FormShowFile.C | 6 ++- src/frontends/xforms/FormShowFile.h | 6 +++ src/frontends/xforms/FormSpellchecker.C | 6 ++- src/frontends/xforms/FormSpellchecker.h | 6 +++ src/frontends/xforms/FormTabular.C | 14 +++-- src/frontends/xforms/FormTabular.h | 7 +++ src/frontends/xforms/FormTabularCreate.C | 5 ++ src/frontends/xforms/FormTabularCreate.h | 6 +++ src/frontends/xforms/FormTexinfo.C | 11 +++- src/frontends/xforms/FormTexinfo.h | 7 ++- src/frontends/xforms/FormText.C | 10 +++- src/frontends/xforms/FormText.h | 8 ++- src/frontends/xforms/FormThesaurus.C | 14 +++-- src/frontends/xforms/FormThesaurus.h | 6 +++ src/frontends/xforms/FormToc.C | 18 ++++--- src/frontends/xforms/FormToc.h | 9 +++- src/frontends/xforms/FormUrl.C | 6 ++- src/frontends/xforms/FormUrl.h | 7 ++- src/frontends/xforms/FormVSpace.C | 14 +++-- src/frontends/xforms/FormVSpace.h | 7 ++- src/frontends/xforms/FormWrap.C | 12 +++-- src/frontends/xforms/FormWrap.h | 7 ++- src/frontends/xforms/LyXKeySymFactory.C | 2 +- src/frontends/xforms/LyXScreenFactory.C | 3 ++ src/frontends/xforms/RadioButtonGroup.C | 9 +++- src/frontends/xforms/RadioButtonGroup.h | 9 ++-- src/frontends/xforms/Tooltips.C | 12 ++++- src/frontends/xforms/Tooltips.h | 5 ++ src/frontends/xforms/WorkAreaFactory.C | 2 +- src/frontends/xforms/XFormsMenubar.C | 16 +++--- src/frontends/xforms/XFormsMenubar.h | 15 ++++-- src/frontends/xforms/XFormsToolbar.C | 23 +++++--- src/frontends/xforms/XFormsToolbar.h | 13 +++-- src/frontends/xforms/XFormsView.C | 14 +++-- src/frontends/xforms/XFormsView.h | 13 +++-- src/frontends/xforms/XLyXKeySym.C | 19 ++++--- src/frontends/xforms/XLyXKeySym.h | 6 +++ src/frontends/xforms/XMiniBuffer.C | 9 ++-- src/frontends/xforms/XMiniBuffer.h | 13 +++-- src/frontends/xforms/XPainter.C | 18 ++++--- src/frontends/xforms/XPainter.h | 10 +++- src/frontends/xforms/XWorkArea.C | 9 ++-- src/frontends/xforms/XWorkArea.h | 11 ++-- src/frontends/xforms/checkedwidgets.C | 11 +++- src/frontends/xforms/checkedwidgets.h | 7 ++- src/frontends/xforms/fdesign_base.C | 6 +++ src/frontends/xforms/fdesign_base.h | 7 ++- src/frontends/xforms/forms/fdfix.sh | 2 +- src/frontends/xforms/forms/fdfixc.sed | 15 ++++++ src/frontends/xforms/forms/fdfixh.sed | 13 +++-- src/frontends/xforms/forms_gettext.C | 7 ++- src/frontends/xforms/forms_gettext.h | 6 +++ src/frontends/xforms/lyx_gui.C | 7 +++ src/frontends/xforms/xfont_loader.C | 14 +++-- src/frontends/xforms/xfont_loader.h | 7 ++- src/frontends/xforms/xfont_metrics.C | 4 +- src/frontends/xforms/xfont_metrics.h | 3 -- src/frontends/xforms/xformsBC.C | 5 ++ src/frontends/xforms/xformsBC.h | 6 +++ src/frontends/xforms/xformsImage.C | 1 + src/frontends/xforms/xformsImage.h | 1 - src/frontends/xforms/xformsTimeout.C | 10 +++- src/frontends/xforms/xformsTimeout.h | 5 ++ src/frontends/xforms/xforms_helpers.C | 20 ++++--- src/frontends/xforms/xforms_helpers.h | 8 ++- src/frontends/xforms/xforms_resize.C | 5 ++ src/frontends/xforms/xforms_resize.h | 7 ++- src/frontends/xforms/xscreen.C | 5 ++ src/frontends/xforms/xscreen.h | 9 +++- src/insets/ChangeLog | 5 ++ src/insets/insetcite.C | 2 + src/insets/insetcite.h | 4 +- src/lyxfunc.C | 2 + 458 files changed, 3007 insertions(+), 751 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e9fc946a52..5d5e026ccb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-05-19 Angus Leeming + + * LaTeXFeatures.C: + * ToolbarBackend.C: + * bufferparams.C: + * lyxfunc.C: small changes due to the introduction of namespace + lyx::frontend and the moving of namespace biblio to lyx::biblio. 2004-05-18 Alfredo Braunstein diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index 9cbbc3288c..9ad269db10 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -41,6 +41,8 @@ using std::ostream; using std::ostringstream; using std::set; +namespace biblio = lyx::biblio; + LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n) : buffer_(&b), params_(p), nice_(n) diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index 41338d58c2..1a616774cf 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -212,6 +212,8 @@ void ToolbarBackend::add(Toolbar & tb, string const ToolbarBackend::getIcon(FuncRequest const & f) { + using lyx::frontend::find_xpm; + string fullname; if (f.action == LFUN_INSERT_MATH) { diff --git a/src/bufferparams.C b/src/bufferparams.C index 402297bb55..d3475dd639 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -55,6 +55,8 @@ using std::ostream; using std::ostringstream; using std::pair; +namespace biblio = lyx::biblio; + struct BufferParams::Impl { diff --git a/src/bufferparams.h b/src/bufferparams.h index 8951147114..a42cf57776 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -37,6 +37,7 @@ class VSpace; struct Language; +namespace lyx { namespace biblio { enum CiteEngine { @@ -54,6 +55,7 @@ public: }; } // namespace biblio +} // namespace lyx /** Buffer parameters. @@ -198,7 +200,7 @@ public: }; AMS use_amsmath; /// - biblio::CiteEngine cite_engine; + lyx::biblio::CiteEngine cite_engine; /// bool use_bibtopic; /// revision tracking for this buffer ? diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 4b48e0820e..edd400e859 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,9 @@ +2004-05-19 Angus Leeming + + * Dialogs.[Ch]: + * LyXView.[Ch]: small changes due to the introduction of namespace + lyx::frontend and the moving of namespace biblio to lyx::biblio. + 2004-04-28 Angus Leeming * LyXView.[Ch]: diff --git a/src/frontends/Dialogs.C b/src/frontends/Dialogs.C index 494f91fa6c..328d73e562 100644 --- a/src/frontends/Dialogs.C +++ b/src/frontends/Dialogs.C @@ -21,6 +21,7 @@ using std::string; +using lyx::frontend::Dialog; // Note that static boost signals break some compilers, so this wrapper diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 955076ea8c..71135cf480 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -16,10 +16,15 @@ #include #include -class Dialog; class InsetBase; class LyXView; +namespace lyx { +namespace frontend { +class Dialog; +} // namespace frontend +} // namespace lyx + /** Container of all dialogs. */ class Dialogs : boost::noncopyable @@ -98,9 +103,9 @@ private: /// bool isValidName(std::string const & name) const; /// - Dialog * find_or_build(std::string const & name); + lyx::frontend::Dialog * find_or_build(std::string const & name); /// - typedef boost::shared_ptr DialogPtr; + typedef boost::shared_ptr DialogPtr; /// DialogPtr build(std::string const & name); diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 3dbf17fbb6..a8d33b65f7 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -48,6 +48,7 @@ using lyx::support::OnlyFilename; using std::endl; using std::string; +using lyx::frontend::ControlCommandBuffer; string current_layout; diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 14a0633c93..3f2acfe952 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -24,7 +24,6 @@ class Toolbars; class InsetBase; class Intl; class Menubar; -class ControlCommandBuffer; class BufferView; class Dialogs; @@ -33,6 +32,12 @@ class LyXFont; class Timeout; class FuncRequest; +namespace lyx { +namespace frontend { +class ControlCommandBuffer; +} // namespace frontend +} // namespace lyx + /** * LyXView - main LyX window * @@ -170,7 +175,10 @@ protected: /// view's command buffer controller // this has to be declared _after_ lyxfunc_ as its initialization depends // on it! - boost::scoped_ptr const controlcommand_; + typedef boost::scoped_ptr + CommandBufferPtr; + + CommandBufferPtr const controlcommand_; }; #endif // LYXVIEW_H diff --git a/src/frontends/controllers/BCView.C b/src/frontends/controllers/BCView.C index efeb81f0c1..cbfe78f976 100644 --- a/src/frontends/controllers/BCView.C +++ b/src/frontends/controllers/BCView.C @@ -13,6 +13,8 @@ #include "BCView.h" #include "ButtonController.h" +namespace lyx { +namespace frontend { CheckedWidget::~CheckedWidget() {} @@ -50,3 +52,6 @@ bool BCView::checkWidgets() const // return valid status after checking ALL widgets return valid; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/BCView.h b/src/frontends/controllers/BCView.h index a0f0faae30..6227459d1b 100644 --- a/src/frontends/controllers/BCView.h +++ b/src/frontends/controllers/BCView.h @@ -18,6 +18,8 @@ #include #include +namespace lyx { +namespace frontend { class ButtonController; class ButtonPolicy; @@ -134,6 +136,8 @@ private: Widgets read_only_; }; +} // namespace frontend +} // namespace lyx #include "BCView.tmpl" diff --git a/src/frontends/controllers/BCView.tmpl b/src/frontends/controllers/BCView.tmpl index 85d093319c..69e6ffbe08 100644 --- a/src/frontends/controllers/BCView.tmpl +++ b/src/frontends/controllers/BCView.tmpl @@ -19,6 +19,9 @@ #include "ButtonPolicies.h" #include "debug.h" +namespace lyx { +namespace frontend { + template GuiBC::GuiBC(ButtonController const & parent, std::string const & cancel, std::string const & close) @@ -73,3 +76,6 @@ void GuiBC::refreshReadOnly() const setWidgetEnabled(*iter, enable); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ButtonController.C b/src/frontends/controllers/ButtonController.C index 63df789dff..312a20db5f 100644 --- a/src/frontends/controllers/ButtonController.C +++ b/src/frontends/controllers/ButtonController.C @@ -13,6 +13,8 @@ #include "ButtonController.h" #include "BCView.h" +namespace lyx { +namespace frontend { BCView & ButtonController::view() const { @@ -112,3 +114,6 @@ bool ButtonController::readOnly(bool ro) const view().refresh(); return ro; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ButtonController.h b/src/frontends/controllers/ButtonController.h index f387a07e2d..2e48a81547 100644 --- a/src/frontends/controllers/ButtonController.h +++ b/src/frontends/controllers/ButtonController.h @@ -12,15 +12,14 @@ #ifndef BUTTONCONTROLLER_H #define BUTTONCONTROLLER_H - #include "ButtonPolicies.h" - #include +namespace lyx { +namespace frontend { class BCView; - /** \c ButtonController controls the activation of the OK, Apply and * Cancel buttons. * @@ -87,4 +86,7 @@ private: boost::scoped_ptr view_; }; +} // namespace frontend +} // namespace lyx + #endif // BUTTONCONTROLLER_H diff --git a/src/frontends/controllers/ButtonPolicies.C b/src/frontends/controllers/ButtonPolicies.C index e077364a7e..31eabc7291 100644 --- a/src/frontends/controllers/ButtonPolicies.C +++ b/src/frontends/controllers/ButtonPolicies.C @@ -17,6 +17,9 @@ using std::endl; using std::string; +namespace lyx { +namespace frontend { + namespace { string const printState(ButtonPolicy::State const & state) @@ -625,3 +628,6 @@ void NoRepeatedApplyPolicy::input(SMInput input) "NoRepeatedApplyPolicy"); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ButtonPolicies.h b/src/frontends/controllers/ButtonPolicies.h index 564f4d7de4..3300c9a208 100644 --- a/src/frontends/controllers/ButtonPolicies.h +++ b/src/frontends/controllers/ButtonPolicies.h @@ -21,6 +21,9 @@ #include "support/std_ostream.h" +namespace lyx { +namespace frontend { + /** An abstract base class for button policies. A state machine implementation of the various button policies used by the dialogs. Only the policy is implemented here. Separate ButtonController @@ -465,4 +468,7 @@ public: } }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index edeb3ef775..5b148a6f00 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2004-05-19 Angus Leeming + + * *.[Ch]: wrap all code up inside namespace lyx::frontend. + Move namespace biblio to lyx::biblio. + 2004-05-14 Angus Leeming * biblio.[Ch] (asValidLatexCommand): new function which examines diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C index ce247a617f..5541173009 100644 --- a/src/frontends/controllers/ControlAboutlyx.C +++ b/src/frontends/controllers/ControlAboutlyx.C @@ -21,16 +21,21 @@ #include -using lyx::support::FileSearch; -using lyx::support::MakeDisplayPath; -using lyx::support::system_lyxdir; -using lyx::support::user_lyxdir; - using std::ostream; using std::ostringstream; using std::string; +namespace lyx { + +using support::FileSearch; +using support::MakeDisplayPath; +using support::system_lyxdir; +using support::user_lyxdir; + +namespace frontend { + + ControlAboutlyx::ControlAboutlyx(Dialog & parent) : Dialog::Controller(parent) {} @@ -92,3 +97,6 @@ string const ControlAboutlyx::getVersion() const return ss.str(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlAboutlyx.h b/src/frontends/controllers/ControlAboutlyx.h index 31b90aab70..7cfa322b3a 100644 --- a/src/frontends/controllers/ControlAboutlyx.h +++ b/src/frontends/controllers/ControlAboutlyx.h @@ -16,6 +16,9 @@ #include "Dialog.h" #include +namespace lyx { +namespace frontend { + /** \c ControlAboutlyx is a controller for the "About LyX" dialogs. */ class ControlAboutlyx : public Dialog::Controller { @@ -40,4 +43,7 @@ public: //@} }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLABOUTLYX_H diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 933b666bea..0675c87b89 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -25,14 +25,19 @@ #include "support/filetools.h" #include "support/globbing.h" -using lyx::support::FileFilterList; -using lyx::support::OnlyFilename; - using std::pair; using std::string; using std::vector; +namespace lyx { + +using support::FileFilterList; +using support::OnlyFilename; + +namespace frontend { + + ControlBibtex::ControlBibtex(Dialog & d) : ControlCommand(d, "bibtex") {} @@ -95,3 +100,6 @@ bool ControlBibtex::usingBibtopic() const { return kernel().buffer().params().use_bibtopic; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlBibtex.h b/src/frontends/controllers/ControlBibtex.h index 405445d3be..cdd91ef9cb 100644 --- a/src/frontends/controllers/ControlBibtex.h +++ b/src/frontends/controllers/ControlBibtex.h @@ -13,20 +13,19 @@ #ifndef CONTROLBIBTEX_H #define CONTROLBIBTEX_H - #include "ControlCommand.h" #include - namespace lyx { namespace support { class FileFilterList; } // namespace support -} // namespace lyx +namespace frontend { + /** A controller for Bibtex dialogs. */ class ControlBibtex : public ControlCommand { @@ -37,7 +36,7 @@ public: /// Browse for a file std::string const browse(std::string const & in_name, std::string const & title, - lyx::support::FileFilterList const & filters) const; + support::FileFilterList const & filters) const; /// get the list of bst files void getBibStyles(std::vector & data) const; /// get the list of bib files @@ -49,5 +48,7 @@ public: bool usingBibtopic() const; }; +} // namespace frontend +} // namespace lyx #endif // CONTROLBIBTEX_H diff --git a/src/frontends/controllers/ControlBox.C b/src/frontends/controllers/ControlBox.C index 9c9e7e0ea6..789224fba6 100644 --- a/src/frontends/controllers/ControlBox.C +++ b/src/frontends/controllers/ControlBox.C @@ -19,6 +19,8 @@ using std::string; using std::vector; +namespace lyx { +namespace frontend { ControlBox::ControlBox(Dialog & parent) : Dialog::Controller(parent) @@ -80,3 +82,6 @@ void box_gui_tokens_special_length(vector & ids, gui_names.push_back(_("Total Height")); gui_names.push_back(_("Width")); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlBox.h b/src/frontends/controllers/ControlBox.h index 3a3dc33dff..0651f50bd0 100644 --- a/src/frontends/controllers/ControlBox.h +++ b/src/frontends/controllers/ControlBox.h @@ -18,6 +18,9 @@ class InsetBoxParams; +namespace lyx { +namespace frontend { + class ControlBox : public Dialog::Controller { public: /// @@ -46,4 +49,7 @@ void box_gui_tokens(std::vector &, std::vector &); void box_gui_tokens_special_length(std::vector &, std::vector &); +} // namespace frontend +} // namespace lyx + #endif // CONTROLBOX_H diff --git a/src/frontends/controllers/ControlBranch.C b/src/frontends/controllers/ControlBranch.C index 4185fd4de6..aa7f97c58a 100644 --- a/src/frontends/controllers/ControlBranch.C +++ b/src/frontends/controllers/ControlBranch.C @@ -23,6 +23,8 @@ using std::string; using std::vector; +namespace lyx { +namespace frontend { ControlBranch::ControlBranch(Dialog & parent) : Dialog::Controller(parent) @@ -55,3 +57,6 @@ BranchList const & ControlBranch::branchlist() const { return kernel().buffer().params().branchlist(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlBranch.h b/src/frontends/controllers/ControlBranch.h index ef364107ab..9f6c9aa336 100644 --- a/src/frontends/controllers/ControlBranch.h +++ b/src/frontends/controllers/ControlBranch.h @@ -19,6 +19,8 @@ class BranchList; class InsetBranchParams; +namespace lyx { +namespace frontend { class ControlBranch : public Dialog::Controller { public: @@ -43,4 +45,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLBRANCH_H diff --git a/src/frontends/controllers/ControlChanges.C b/src/frontends/controllers/ControlChanges.C index d445ad245c..d25a3fa025 100644 --- a/src/frontends/controllers/ControlChanges.C +++ b/src/frontends/controllers/ControlChanges.C @@ -21,10 +21,14 @@ #include "lyxfind.h" #include "support/lstrings.h" -using lyx::support::rtrim; - using std::string; +namespace lyx { + +using support::rtrim; + +namespace frontend { + ControlChanges::ControlChanges(Dialog & parent) : Dialog::Controller(parent) @@ -33,7 +37,7 @@ ControlChanges::ControlChanges(Dialog & parent) bool ControlChanges::find() { - return lyx::find::findNextChange(kernel().bufferview()); + return find::findNextChange(kernel().bufferview()); } @@ -71,12 +75,15 @@ string const ControlChanges::getChangeAuthor() void ControlChanges::accept() { kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE)); - lyx::find::findNextChange(kernel().bufferview()); + find::findNextChange(kernel().bufferview()); } void ControlChanges::reject() { kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE)); - lyx::find::findNextChange(kernel().bufferview()); + find::findNextChange(kernel().bufferview()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlChanges.h b/src/frontends/controllers/ControlChanges.h index d0c9180112..f13398d0be 100644 --- a/src/frontends/controllers/ControlChanges.h +++ b/src/frontends/controllers/ControlChanges.h @@ -14,6 +14,9 @@ #include "Dialog.h" +namespace lyx { +namespace frontend { + /** * A controller for the merge changes dialog. */ @@ -46,4 +49,7 @@ public: void reject(); }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLCHANGES_H diff --git a/src/frontends/controllers/ControlCharacter.C b/src/frontends/controllers/ControlCharacter.C index cfb3878a2e..6b3e434d8a 100644 --- a/src/frontends/controllers/ControlCharacter.C +++ b/src/frontends/controllers/ControlCharacter.C @@ -24,6 +24,8 @@ using bv_funcs::font2string; using std::string; +namespace lyx { +namespace frontend { ControlCharacter::ControlCharacter(Dialog & parent) : Dialog::Controller(parent), @@ -42,7 +44,7 @@ bool ControlCharacter::initialiseParams(string const &) getSeries() != LyXFont::IGNORE_SERIES || getShape() != LyXFont::IGNORE_SHAPE || getSize() != LyXFont::IGNORE_SIZE || - getBar() != frnt::IGNORE || + getBar() != IGNORE || getColor() != LColor::ignore || font_->language() != ignore_language) dialog().bc().valid(); @@ -124,51 +126,51 @@ void ControlCharacter::setSize(LyXFont::FONT_SIZE val) } -frnt::FONT_STATE ControlCharacter::getBar() const +FONT_STATE ControlCharacter::getBar() const { if (!font_.get()) - return frnt::IGNORE; + return IGNORE; if (font_->emph() == LyXFont::TOGGLE) - return frnt::EMPH_TOGGLE; + return EMPH_TOGGLE; if (font_->underbar() == LyXFont::TOGGLE) - return frnt::UNDERBAR_TOGGLE; + return UNDERBAR_TOGGLE; if (font_->noun() == LyXFont::TOGGLE) - return frnt::NOUN_TOGGLE; + return NOUN_TOGGLE; if (font_->emph() == LyXFont::IGNORE && font_->underbar() == LyXFont::IGNORE && font_->noun() == LyXFont::IGNORE) - return frnt::IGNORE; + return IGNORE; - return frnt::INHERIT; + return INHERIT; } -void ControlCharacter::setBar(frnt::FONT_STATE val) +void ControlCharacter::setBar(FONT_STATE val) { switch (val) { - case frnt::IGNORE: + case IGNORE: font_->setEmph(LyXFont::IGNORE); font_->setUnderbar(LyXFont::IGNORE); font_->setNoun(LyXFont::IGNORE); break; - case frnt::EMPH_TOGGLE: + case EMPH_TOGGLE: font_->setEmph(LyXFont::TOGGLE); break; - case frnt::UNDERBAR_TOGGLE: + case UNDERBAR_TOGGLE: font_->setUnderbar(LyXFont::TOGGLE); break; - case frnt::NOUN_TOGGLE: + case NOUN_TOGGLE: font_->setNoun(LyXFont::TOGGLE); break; - case frnt::INHERIT: + case INHERIT: font_->setEmph(LyXFont::INHERIT); font_->setUnderbar(LyXFont::INHERIT); font_->setNoun(LyXFont::INHERIT); @@ -239,3 +241,6 @@ void ControlCharacter::setToggleAll(bool t) { toggleall_ = t; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlCharacter.h b/src/frontends/controllers/ControlCharacter.h index fe45b6aee5..9740cbf8f0 100644 --- a/src/frontends/controllers/ControlCharacter.h +++ b/src/frontends/controllers/ControlCharacter.h @@ -19,6 +19,8 @@ class LColor_color; +namespace lyx { +namespace frontend { class ControlCharacter : public Dialog::Controller { public: @@ -42,7 +44,7 @@ public: /// void setSize(LyXFont::FONT_SIZE); /// - void setBar(frnt::FONT_STATE); + void setBar(FONT_STATE); /// void setColor(LColor_color); /// @@ -59,7 +61,7 @@ public: /// LyXFont::FONT_SIZE getSize() const; /// - frnt::FONT_STATE getBar() const; + FONT_STATE getBar() const; /// LColor_color getColor() const; /// @@ -73,4 +75,7 @@ private: bool toggleall_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLCHARACTER_H diff --git a/src/frontends/controllers/ControlCitation.C b/src/frontends/controllers/ControlCitation.C index 2770d992fe..b7f755dbe2 100644 --- a/src/frontends/controllers/ControlCitation.C +++ b/src/frontends/controllers/ControlCitation.C @@ -20,6 +20,8 @@ using std::string; using std::vector; using std::pair; +namespace lyx { +namespace frontend { vector ControlCitation::citeStyles_; @@ -94,3 +96,6 @@ vector const ControlCitation::getCiteStrings(string const & key) const return styles; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlCitation.h b/src/frontends/controllers/ControlCitation.h index 260707fb08..5dc10ad44e 100644 --- a/src/frontends/controllers/ControlCitation.h +++ b/src/frontends/controllers/ControlCitation.h @@ -16,6 +16,9 @@ #include "ControlCommand.h" #include "biblio.h" +namespace lyx { +namespace frontend { + /** A controller for Citation dialogs. */ class ControlCitation : public ControlCommand { @@ -54,5 +57,7 @@ private: static std::vector citeStyles_; }; +} // namespace frontend +} // namespace lyx #endif // CONTROLCITATION_H diff --git a/src/frontends/controllers/ControlCommand.C b/src/frontends/controllers/ControlCommand.C index 7812507f46..9086ac4cab 100644 --- a/src/frontends/controllers/ControlCommand.C +++ b/src/frontends/controllers/ControlCommand.C @@ -18,6 +18,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name) : Dialog::Controller(dialog), @@ -49,3 +51,6 @@ void ControlCommand::dispatchParams() params_); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlCommand.h b/src/frontends/controllers/ControlCommand.h index 0174bf8582..b7f99d15a2 100644 --- a/src/frontends/controllers/ControlCommand.h +++ b/src/frontends/controllers/ControlCommand.h @@ -19,6 +19,8 @@ #include "Dialog.h" #include "insets/insetcommandparams.h" +namespace lyx { +namespace frontend { class ControlCommand : public Dialog::Controller { public: @@ -47,5 +49,7 @@ private: std::string const lfun_name_; }; +} // namespace frontend +} // namespace lyx #endif // CONTROLCOMMAND_H diff --git a/src/frontends/controllers/ControlCommandBuffer.C b/src/frontends/controllers/ControlCommandBuffer.C index 03055ddc65..68cdd703c1 100644 --- a/src/frontends/controllers/ControlCommandBuffer.C +++ b/src/frontends/controllers/ControlCommandBuffer.C @@ -25,13 +25,16 @@ #include "support/lyxalgo.h" #include "support/lstrings.h" -using lyx::support::prefixIs; - using std::back_inserter; using std::transform; using std::string; using std::vector; +namespace lyx { + +using support::prefixIs; + +namespace frontend { namespace { @@ -51,7 +54,7 @@ ControlCommandBuffer::ControlCommandBuffer(LyXView & lv) : lv_(lv), history_pos_(history_.end()) { transform(lyxaction.func_begin(), lyxaction.func_end(), - back_inserter(commands_), lyx::firster()); + back_inserter(commands_), firster()); } @@ -86,7 +89,7 @@ ControlCommandBuffer::completions(string const & prefix, string & new_prefix) { vector comp; - lyx::copy_if(commands_.begin(), commands_.end(), + copy_if(commands_.begin(), commands_.end(), back_inserter(comp), prefix_p(prefix)); if (comp.empty()) { @@ -106,7 +109,7 @@ ControlCommandBuffer::completions(string const & prefix, string & new_prefix) test += tmp[test.length()]; while (test.length() < tmp.length()) { vector vtmp; - lyx::copy_if(comp.begin(), comp.end(), + copy_if(comp.begin(), comp.end(), back_inserter(vtmp), prefix_p(test)); if (vtmp.size() != comp.size()) { test.erase(test.length() - 1); @@ -129,3 +132,6 @@ void ControlCommandBuffer::dispatch(string const & str) history_pos_ = history_.end(); lv_.getLyXFunc().dispatch(lyxaction.lookupFunc(str), true); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlCommandBuffer.h b/src/frontends/controllers/ControlCommandBuffer.h index 124cc668a0..0beb3a10e8 100644 --- a/src/frontends/controllers/ControlCommandBuffer.h +++ b/src/frontends/controllers/ControlCommandBuffer.h @@ -20,6 +20,9 @@ class LyXView; +namespace lyx { +namespace frontend { + /** * ControlCommandBuffer * @@ -59,4 +62,7 @@ private: std::vector::const_iterator history_pos_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLCOMMANDBUFFER_H diff --git a/src/frontends/controllers/ControlDocument.C b/src/frontends/controllers/ControlDocument.C index 5dc34b0095..f614db1e33 100644 --- a/src/frontends/controllers/ControlDocument.C +++ b/src/frontends/controllers/ControlDocument.C @@ -26,6 +26,8 @@ using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { ControlDocument::ControlDocument(Dialog & parent) : Dialog::Controller(parent) @@ -83,9 +85,9 @@ void ControlDocument::dispatchParams() setLanguage(); // Set the document class. - lyx::textclass_type const old_class = + textclass_type const old_class = kernel().buffer().params().textclass; - lyx::textclass_type const new_class = bp_->textclass; + textclass_type const new_class = bp_->textclass; if (new_class != old_class) { string const name = textclasslist[new_class].name(); @@ -130,7 +132,7 @@ void ControlDocument::setLanguage() const } -bool ControlDocument::loadTextclass(lyx::textclass_type tc) const +bool ControlDocument::loadTextclass(textclass_type tc) const { string const name = textclasslist[tc].name(); kernel().dispatch(FuncRequest(LFUN_TEXTCLASS_LOAD, name)); @@ -145,3 +147,6 @@ void ControlDocument::saveAsDefault() const { dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlDocument.h b/src/frontends/controllers/ControlDocument.h index f761a787ff..7197e55ec6 100644 --- a/src/frontends/controllers/ControlDocument.h +++ b/src/frontends/controllers/ControlDocument.h @@ -19,6 +19,8 @@ class BufferParams; class LyXTextClass; +namespace lyx { +namespace frontend { /** A controller for Document dialogs. */ @@ -45,10 +47,13 @@ public: /// void saveAsDefault() const; /// - bool loadTextclass(lyx::textclass_type tc) const; + bool loadTextclass(textclass_type tc) const; private: /// boost::scoped_ptr bp_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLDOCUMENT_H diff --git a/src/frontends/controllers/ControlERT.C b/src/frontends/controllers/ControlERT.C index 9f1209b9f5..3e366eaaa4 100644 --- a/src/frontends/controllers/ControlERT.C +++ b/src/frontends/controllers/ControlERT.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlERT::ControlERT(Dialog & parent) : Dialog::Controller(parent), status_(InsetERT::Collapsed) @@ -41,3 +43,6 @@ void ControlERT::dispatchParams() string const lfun = InsetERTMailer::params2string(status_); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlERT.h b/src/frontends/controllers/ControlERT.h index 44885238aa..a68078b33e 100644 --- a/src/frontends/controllers/ControlERT.h +++ b/src/frontends/controllers/ControlERT.h @@ -17,6 +17,8 @@ #include "Dialog.h" #include "insets/insetert.h" // InsetERT::ERTStatus +namespace lyx { +namespace frontend { class ControlERT : public Dialog::Controller { public: @@ -39,4 +41,7 @@ private: InsetCollapsable::CollapseStatus status_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/controllers/ControlErrorList.C b/src/frontends/controllers/ControlErrorList.C index 73b8855e91..a7d8c9be06 100644 --- a/src/frontends/controllers/ControlErrorList.C +++ b/src/frontends/controllers/ControlErrorList.C @@ -21,6 +21,8 @@ using std::endl; using std::string; +namespace lyx { +namespace frontend { ControlErrorList::ControlErrorList(Dialog & d) : Dialog::Controller(d) @@ -66,9 +68,9 @@ void ControlErrorList::goTo(int item) return; } - lyx::pos_type const end = std::min(err.pos_end, pit->size()); - lyx::pos_type const start = std::min(err.pos_start, end); - lyx::pos_type const range = end - start; + pos_type const end = std::min(err.pos_end, pit->size()); + pos_type const start = std::min(err.pos_start, end); + pos_type const range = end - start; // Now make the selection. #ifdef WITH_WARNINGS @@ -80,3 +82,6 @@ void ControlErrorList::goTo(int item) kernel().bufferview()->putSelectionAt(pos, range, false); #endif } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlErrorList.h b/src/frontends/controllers/ControlErrorList.h index 9dfc615948..17d3ec1a41 100644 --- a/src/frontends/controllers/ControlErrorList.h +++ b/src/frontends/controllers/ControlErrorList.h @@ -15,12 +15,11 @@ #include "errorlist.h" #include "Dialog.h" - +namespace lyx { +namespace frontend { /** A controller for the ErrorList dialog. */ - - class ControlErrorList : public Dialog::Controller { public: /// @@ -47,4 +46,7 @@ private: std::string name_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLERRORLIST_H diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index 8e0797deea..f4c75bd187 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -31,16 +31,18 @@ #include "support/globbing.h" #include "support/tostr.h" -namespace external = lyx::external; - -using lyx::support::FileFilterList; -using lyx::support::MakeAbsPath; -using lyx::support::readBB_from_PSFile; - using std::advance; using std::vector; using std::string; +namespace lyx { + +using support::FileFilterList; +using support::MakeAbsPath; +using support::readBB_from_PSFile; + +namespace frontend { + ControlExternal::ControlExternal(Dialog & parent) : Dialog::Controller(parent), @@ -177,9 +179,9 @@ string const ControlExternal::readBB(string const & file) int width = 0; int height = 0; - lyx::graphics::Cache & gc = lyx::graphics::Cache::get(); + graphics::Cache & gc = graphics::Cache::get(); if (gc.inCache(abs_file)) { - lyx::graphics::Image const * image = gc.item(abs_file)->image(); + graphics::Image const * image = gc.item(abs_file)->image(); if (image) { width = image->getWidth(); @@ -190,27 +192,32 @@ string const ControlExternal::readBB(string const & file) return ("0 0 " + tostr(width) + ' ' + tostr(height)); } +} // namespace frontend + + +namespace external { namespace { -external::RotationDataType origins_array[] = { - external::RotationData::DEFAULT, - external::RotationData::TOPLEFT, - external::RotationData::BOTTOMLEFT, - external::RotationData::BASELINELEFT, - external::RotationData::CENTER, - external::RotationData::TOPCENTER, - external::RotationData::BOTTOMCENTER, - external::RotationData::BASELINECENTER, - external::RotationData::TOPRIGHT, - external::RotationData::BOTTOMRIGHT, - external::RotationData::BASELINERIGHT +RotationDataType origins_array[] = { + RotationData::DEFAULT, + RotationData::TOPLEFT, + RotationData::BOTTOMLEFT, + RotationData::BASELINELEFT, + RotationData::CENTER, + RotationData::TOPCENTER, + RotationData::BOTTOMCENTER, + RotationData::BASELINECENTER, + RotationData::TOPRIGHT, + RotationData::BOTTOMRIGHT, + RotationData::BASELINERIGHT }; -lyx::size_type const origins_array_size = + +size_type const origins_array_size = sizeof(origins_array) / sizeof(origins_array[0]); -vector const +vector const origins(origins_array, origins_array + origins_array_size); // These are the strings, corresponding to the above, that the GUI should @@ -224,8 +231,6 @@ char const * const origin_gui_strs[] = { } // namespace anon -namespace lyx { -namespace external { vector const & all_origins() { diff --git a/src/frontends/controllers/ControlExternal.h b/src/frontends/controllers/ControlExternal.h index 604bc98e93..da404970d3 100644 --- a/src/frontends/controllers/ControlExternal.h +++ b/src/frontends/controllers/ControlExternal.h @@ -27,12 +27,16 @@ class InsetExternalParams; namespace lyx { + namespace external { + class Template; class RotationDataType; -} // namespace external -} // namespace lyx +} // namespace external + + +namespace frontend { class ControlExternal : public Dialog::Controller { public: @@ -59,7 +63,7 @@ public: /// int getTemplateNumber(std::string const &) const; /// - lyx::external::Template getTemplate(int) const; + external::Template getTemplate(int) const; /// std::string const browse(std::string const & input_file, std::string const & tempalate_name) const; @@ -75,12 +79,13 @@ private: bool bb_changed_; }; +} // namespace frontend + -namespace lyx { namespace external { std::vector const & all_origins(); -std::string const origin_gui_str(lyx::size_type i); +std::string const origin_gui_str(size_type i); } // namespace external } // namespace lyx diff --git a/src/frontends/controllers/ControlFloat.C b/src/frontends/controllers/ControlFloat.C index 0d54cc6eef..5214072826 100644 --- a/src/frontends/controllers/ControlFloat.C +++ b/src/frontends/controllers/ControlFloat.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlFloat::ControlFloat(Dialog & parent) : Dialog::Controller(parent) @@ -43,3 +45,6 @@ void ControlFloat::dispatchParams() string const lfun = InsetFloatMailer::params2string(params()); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlFloat.h b/src/frontends/controllers/ControlFloat.h index f0bb07aaa3..af4797414a 100644 --- a/src/frontends/controllers/ControlFloat.h +++ b/src/frontends/controllers/ControlFloat.h @@ -16,6 +16,9 @@ class InsetFloatParams; +namespace lyx { +namespace frontend { + class ControlFloat : public Dialog::Controller { public: /// @@ -37,4 +40,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index c546da8e15..d7ca70aacf 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -32,20 +32,24 @@ #include "support/tostr.h" #include "support/types.h" -using lyx::support::AddName; -using lyx::support::FileFilterList; -using lyx::support::FileInfo; -using lyx::support::IsFileReadable; -using lyx::support::MakeAbsPath; -using lyx::support::readBB_from_PSFile; -using lyx::support::system_lyxdir; -using lyx::support::user_lyxdir; - using std::make_pair; using std::string; using std::pair; using std::vector; +namespace lyx { + +using support::AddName; +using support::FileFilterList; +using support::FileInfo; +using support::IsFileReadable; +using support::MakeAbsPath; +using support::readBB_from_PSFile; +using support::system_lyxdir; +using support::user_lyxdir; + +namespace frontend { + ControlGraphics::ControlGraphics(Dialog & parent) : Dialog::Controller(parent) @@ -111,9 +115,9 @@ string const ControlGraphics::readBB(string const & file) int width = 0; int height = 0; - lyx::graphics::Cache & gc = lyx::graphics::Cache::get(); + graphics::Cache & gc = graphics::Cache::get(); if (gc.inCache(abs_file)) { - lyx::graphics::Image const * image = gc.item(abs_file)->image(); + graphics::Image const * image = gc.item(abs_file)->image(); if (image) { width = image->getWidth(); @@ -143,7 +147,6 @@ void ControlGraphics::editGraphics() kernel().dispatch(FuncRequest(LFUN_GRAPHICS_EDIT, lfun)); } -namespace frnt { namespace { @@ -186,7 +189,7 @@ vector getRotationOriginData() return data; data.resize(rorigin_size); - for (lyx::size_type i = 0; i < rorigin_size; ++i) { + for (size_type i = 0; i < rorigin_size; ++i) { data[i] = make_pair(_(rorigin_gui_strs[i]), rorigin_lyx_strs[i]); } @@ -194,4 +197,5 @@ vector getRotationOriginData() return data; } -} // namespace frnt +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlGraphics.h b/src/frontends/controllers/ControlGraphics.h index 3fec003e19..39e408ab0d 100644 --- a/src/frontends/controllers/ControlGraphics.h +++ b/src/frontends/controllers/ControlGraphics.h @@ -23,9 +23,11 @@ class InsetGraphics; class InsetGraphicsParams; class LyXView; +namespace lyx { +namespace frontend { + /** A controller for Graphics dialogs. */ - class ControlGraphics : public Dialog::Controller { public: /// @@ -59,7 +61,6 @@ private: boost::scoped_ptr params_; }; -namespace frnt { /// get the units for the bounding box std::vector const getBBUnits(); @@ -69,6 +70,7 @@ typedef std::pair RotationOriginPair; /// std::vector getRotationOriginData(); -} // namespace frnt +} // namespace frontend +} // namespace lyx #endif // CONTROLGRAPHICS_H diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index 513339d96e..da2ec7a7fd 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -28,14 +28,17 @@ #include -using lyx::support::FileFilterList; -using lyx::support::IsFileReadable; -using lyx::support::MakeAbsPath; -using lyx::support::OnlyPath; - using std::pair; using std::string; +namespace lyx { + +using support::FileFilterList; +using support::IsFileReadable; +using support::MakeAbsPath; +using support::OnlyPath; + +namespace frontend { ControlInclude::ControlInclude(Dialog & parent) : Dialog::Controller(parent) @@ -110,3 +113,6 @@ bool ControlInclude::fileExists(string const & file) return false; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlInclude.h b/src/frontends/controllers/ControlInclude.h index eeb62c3f94..41c23cd773 100644 --- a/src/frontends/controllers/ControlInclude.h +++ b/src/frontends/controllers/ControlInclude.h @@ -18,6 +18,8 @@ #include "Dialog.h" #include "insets/insetcommandparams.h" +namespace lyx { +namespace frontend { /** A controller for the Include file dialog. */ @@ -62,4 +64,7 @@ private: InsetCommandParams params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLINCLUDE_H diff --git a/src/frontends/controllers/ControlLog.C b/src/frontends/controllers/ControlLog.C index f83803a29b..dad828aaba 100644 --- a/src/frontends/controllers/ControlLog.C +++ b/src/frontends/controllers/ControlLog.C @@ -24,6 +24,8 @@ using std::istringstream; using std::ostream; using std::string; +namespace lyx { +namespace frontend { ControlLog::ControlLog(Dialog & parent) : Dialog::Controller(parent), @@ -115,3 +117,6 @@ void ControlLog::getContents(std::ostream & ss) const break; } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlLog.h b/src/frontends/controllers/ControlLog.h index 699cab0c25..4ee3a03c9b 100644 --- a/src/frontends/controllers/ControlLog.h +++ b/src/frontends/controllers/ControlLog.h @@ -15,6 +15,9 @@ #include "Dialog.h" +namespace lyx { +namespace frontend { + /** * A controller for a read-only text browser. */ @@ -51,4 +54,7 @@ private: std::string logfile_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLLOG_H diff --git a/src/frontends/controllers/ControlMath.C b/src/frontends/controllers/ControlMath.C index fa848a34f8..ffdf67d49a 100644 --- a/src/frontends/controllers/ControlMath.C +++ b/src/frontends/controllers/ControlMath.C @@ -18,12 +18,15 @@ #include "support/lstrings.h" #include "support/filetools.h" -using lyx::support::compare; -using lyx::support::LibFileSearch; -using lyx::support::subst; - using std::string; +namespace lyx { + +using support::compare; +using support::LibFileSearch; +using support::subst; + +namespace frontend { ControlMath::ControlMath(Dialog & dialog) : Dialog::Controller(dialog) @@ -344,7 +347,7 @@ string const find_xpm(string const & name) { XPMmap const * const begin = sorted_xpm_map; XPMmap const * const end = begin + nr_sorted_xpm_map; - BOOST_ASSERT(lyx::sorted(begin, end)); + BOOST_ASSERT(sorted(begin, end)); XPMmap const * const it = std::find_if(begin, end, CompareKey(name)); @@ -372,3 +375,6 @@ string const find_xpm(string const & name) return LibFileSearch("images/math/", xpm_name, "xpm"); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlMath.h b/src/frontends/controllers/ControlMath.h index 129cf8cd23..0f220775ae 100644 --- a/src/frontends/controllers/ControlMath.h +++ b/src/frontends/controllers/ControlMath.h @@ -18,6 +18,8 @@ #include "Dialog.h" #include "lfuns.h" // for kb_action +namespace lyx { +namespace frontend { class ControlMath : public Dialog::Controller { public: @@ -87,4 +89,7 @@ extern int const nr_latex_ams_ops; */ std::string const find_xpm(std::string const & name); +} // namespace frontend +} // namespace lyx + #endif // NOT CONTROLMATH diff --git a/src/frontends/controllers/ControlNote.C b/src/frontends/controllers/ControlNote.C index b7f66a038b..8b7e48ef2e 100644 --- a/src/frontends/controllers/ControlNote.C +++ b/src/frontends/controllers/ControlNote.C @@ -18,6 +18,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlNote::ControlNote(Dialog & parent) : Dialog::Controller(parent) @@ -44,3 +46,6 @@ void ControlNote::dispatchParams() string const lfun = InsetNoteMailer::params2string(params()); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlNote.h b/src/frontends/controllers/ControlNote.h index ad504e9e18..a2fc7592e0 100644 --- a/src/frontends/controllers/ControlNote.h +++ b/src/frontends/controllers/ControlNote.h @@ -18,6 +18,9 @@ class InsetNoteParams; +namespace lyx { +namespace frontend { + class ControlNote : public Dialog::Controller { public: /// @@ -40,4 +43,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLNOTE_H diff --git a/src/frontends/controllers/ControlParagraph.C b/src/frontends/controllers/ControlParagraph.C index 0af8e5b9b9..4d597ddcc4 100644 --- a/src/frontends/controllers/ControlParagraph.C +++ b/src/frontends/controllers/ControlParagraph.C @@ -24,6 +24,8 @@ using std::istringstream; using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { ControlParagraph::ControlParagraph(Dialog & parent) : Dialog::Controller(parent), ininset_(false) @@ -157,3 +159,6 @@ LyXAlignment ControlParagraph::alignDefault() const { return aligndefault_; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlParagraph.h b/src/frontends/controllers/ControlParagraph.h index 7375545538..6daf2caf21 100644 --- a/src/frontends/controllers/ControlParagraph.h +++ b/src/frontends/controllers/ControlParagraph.h @@ -17,6 +17,9 @@ class ParagraphParameters; +namespace lyx { +namespace frontend { + class ControlParagraph : public Dialog::Controller { public: /// @@ -51,4 +54,7 @@ private: LyXAlignment aligndefault_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLPARAGRAPH_H diff --git a/src/frontends/controllers/ControlPreamble.C b/src/frontends/controllers/ControlPreamble.C index c63377d994..6f779099fc 100644 --- a/src/frontends/controllers/ControlPreamble.C +++ b/src/frontends/controllers/ControlPreamble.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlPreamble::ControlPreamble(Dialog & parent) : Dialog::Controller(parent) @@ -57,3 +59,6 @@ void ControlPreamble::params(string const & newparams) { params_ = newparams; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlPreamble.h b/src/frontends/controllers/ControlPreamble.h index 931da035da..7a70ddec19 100644 --- a/src/frontends/controllers/ControlPreamble.h +++ b/src/frontends/controllers/ControlPreamble.h @@ -14,6 +14,9 @@ #include "Dialog.h" +namespace lyx { +namespace frontend { + /** A controller for Preamble dialogs. */ class ControlPreamble : public Dialog::Controller { @@ -38,4 +41,7 @@ private: std::string params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLPREAMBLE_H diff --git a/src/frontends/controllers/ControlPrefs.C b/src/frontends/controllers/ControlPrefs.C index 12f6b7e07f..7da7e88683 100644 --- a/src/frontends/controllers/ControlPrefs.C +++ b/src/frontends/controllers/ControlPrefs.C @@ -26,11 +26,6 @@ #include "support/std_sstream.h" -using lyx::support::AddName; -using lyx::support::FileFilterList; -using lyx::support::system_lyxdir; -using lyx::support::user_lyxdir; - using std::ostringstream; using std::pair; using std::string; @@ -39,6 +34,16 @@ using std::vector; extern BufferList bufferlist; +namespace lyx { + +using support::AddName; +using support::FileFilterList; +using support::system_lyxdir; +using support::user_lyxdir; + +namespace frontend { + + ControlPrefs::ControlPrefs(Dialog & parent) : Dialog::Controller(parent), redraw_gui_(false), @@ -171,3 +176,6 @@ string const ControlPrefs::browsedir(string const & path, { return browseDir(path, title); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlPrefs.h b/src/frontends/controllers/ControlPrefs.h index d6e0393457..8093de5634 100644 --- a/src/frontends/controllers/ControlPrefs.h +++ b/src/frontends/controllers/ControlPrefs.h @@ -22,6 +22,8 @@ class LColor_color; +namespace lyx { +namespace frontend { class ControlPrefs : public Dialog::Controller { public: @@ -84,4 +86,7 @@ private: bool update_screen_font_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLPREFS_H diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index 747e55b2bc..38844fb6d2 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -25,11 +25,16 @@ #include "support/filetools.h" #include "support/globbing.h" -using lyx::support::ChangeExtension; -using lyx::support::FileFilterList; - using std::string; +namespace lyx { + +using support::ChangeExtension; +using support::FileFilterList; + +namespace frontend { + + ControlPrint::ControlPrint(Dialog & parent) : Dialog::Controller(parent), params_(0) @@ -136,3 +141,6 @@ void ControlPrint::dispatchParams() string const data = target + " " + target_name + " " + command; kernel().dispatch(FuncRequest(LFUN_PRINT, data)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlPrint.h b/src/frontends/controllers/ControlPrint.h index d847bb9edf..224a57f13c 100644 --- a/src/frontends/controllers/ControlPrint.h +++ b/src/frontends/controllers/ControlPrint.h @@ -18,6 +18,9 @@ class PrinterParams; +namespace lyx { +namespace frontend { + /** A controller for Print dialogs. */ class ControlPrint : public Dialog::Controller { @@ -42,4 +45,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLPRINT_H diff --git a/src/frontends/controllers/ControlRef.C b/src/frontends/controllers/ControlRef.C index a66dc273f8..61692c0f71 100644 --- a/src/frontends/controllers/ControlRef.C +++ b/src/frontends/controllers/ControlRef.C @@ -18,15 +18,18 @@ #include "support/filetools.h" // MakeAbsPath, MakeDisplayPath -using lyx::support::MakeAbsPath; -using lyx::support::MakeDisplayPath; - using std::vector; using std::string; extern BufferList bufferlist; +namespace lyx { + +using support::MakeAbsPath; +using support::MakeDisplayPath; + +namespace frontend { ControlRef::ControlRef(Dialog & d) : ControlCommand(d, "ref") @@ -82,3 +85,6 @@ string const ControlRef::getBufferName(int num) const { return bufferlist.getFileNames()[num]; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlRef.h b/src/frontends/controllers/ControlRef.h index d9181bc456..eeefb38c48 100644 --- a/src/frontends/controllers/ControlRef.h +++ b/src/frontends/controllers/ControlRef.h @@ -16,6 +16,8 @@ #include "ControlCommand.h" #include +namespace lyx { +namespace frontend { /** A controller for the Ref Dialog. */ @@ -41,4 +43,7 @@ private: virtual bool disconnectOnApply() const { return true; } }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLREF_H diff --git a/src/frontends/controllers/ControlSearch.C b/src/frontends/controllers/ControlSearch.C index 0002aaa0cd..b0e46a52dc 100644 --- a/src/frontends/controllers/ControlSearch.C +++ b/src/frontends/controllers/ControlSearch.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlSearch::ControlSearch(Dialog & parent) : Dialog::Controller(parent) @@ -26,8 +28,8 @@ ControlSearch::ControlSearch(Dialog & parent) void ControlSearch::find(string const & search, bool casesensitive, bool matchword, bool forward) { - string const data = lyx::find::find2string(search, casesensitive, - matchword, forward); + string const data = find::find2string(search, casesensitive, + matchword, forward); kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data)); } @@ -37,7 +39,10 @@ void ControlSearch::replace(string const & search, string const & replace, bool forward, bool all) { string const data = - lyx::find::replace2string(search, replace, casesensitive, - matchword, all, forward); + find::replace2string(search, replace, casesensitive, + matchword, all, forward); kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlSearch.h b/src/frontends/controllers/ControlSearch.h index 09c2be5545..b5707c54dd 100644 --- a/src/frontends/controllers/ControlSearch.h +++ b/src/frontends/controllers/ControlSearch.h @@ -14,6 +14,8 @@ #include "Dialog.h" +namespace lyx { +namespace frontend { /** A controller for Search dialogs. */ @@ -36,4 +38,7 @@ public: bool forward, bool all); }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLSEARCH_H diff --git a/src/frontends/controllers/ControlSendto.C b/src/frontends/controllers/ControlSendto.C index 4daa3abde5..fb35d3102a 100644 --- a/src/frontends/controllers/ControlSendto.C +++ b/src/frontends/controllers/ControlSendto.C @@ -20,12 +20,16 @@ #include "support/filetools.h" #include "support/lstrings.h" -using lyx::support::AddName; -using lyx::support::trim; - using std::vector; using std::string; +namespace lyx { + +using support::AddName; +using support::trim; + +namespace frontend { + ControlSendto::ControlSendto(Dialog & parent) : Dialog::Controller(parent) @@ -110,3 +114,6 @@ void ControlSendto::setCommand(string const & cmd) { command_ = trim(cmd); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlSendto.h b/src/frontends/controllers/ControlSendto.h index f8e8c04808..d10a440f19 100644 --- a/src/frontends/controllers/ControlSendto.h +++ b/src/frontends/controllers/ControlSendto.h @@ -17,6 +17,9 @@ class Format; +namespace lyx { +namespace frontend { + /** A controller for the Custom Export dialogs. */ class ControlSendto : public Dialog::Controller { @@ -49,4 +52,7 @@ private: std::string command_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLSENDTO_H diff --git a/src/frontends/controllers/ControlShowFile.C b/src/frontends/controllers/ControlShowFile.C index 8144f1a0c7..6ffe52a18e 100644 --- a/src/frontends/controllers/ControlShowFile.C +++ b/src/frontends/controllers/ControlShowFile.C @@ -13,12 +13,15 @@ #include "ControlShowFile.h" #include "support/filetools.h" - -using lyx::support::GetFileContents; -using lyx::support::OnlyFilename; - using std::string; +namespace lyx { + +using support::GetFileContents; +using support::OnlyFilename; + +namespace frontend { + ControlShowFile::ControlShowFile(Dialog & parent) : Dialog::Controller(parent) @@ -48,3 +51,6 @@ string ControlShowFile::getFileName() { return OnlyFilename(filename_); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlShowFile.h b/src/frontends/controllers/ControlShowFile.h index 6f2f648344..b02b08fa42 100644 --- a/src/frontends/controllers/ControlShowFile.h +++ b/src/frontends/controllers/ControlShowFile.h @@ -14,6 +14,9 @@ #include "Dialog.h" +namespace lyx { +namespace frontend { + /** A controller for the ShowFile dialog. */ class ControlShowFile : public Dialog::Controller { @@ -38,4 +41,7 @@ private: std::string filename_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLSHOWFILE_H diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index a069f6e329..8e99872dbb 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -36,13 +36,17 @@ #include "frontends/Alert.h" -using lyx::support::bformat; - using std::advance; using std::distance; using std::endl; using std::string; +namespace lyx { + +using support::bformat; + +namespace frontend { + ControlSpellchecker::ControlSpellchecker(Dialog & parent) : Dialog::Controller(parent), @@ -259,7 +263,7 @@ void ControlSpellchecker::replace(string const & replacement) lyxerr << "ControlSpellchecker::replace(" << replacement << ")" << std::endl; BufferView & bufferview = *kernel().bufferview(); - lyx::cap::replaceWord(bufferview.cursor(), replacement); + cap::replaceWord(bufferview.cursor(), replacement); kernel().buffer().markDirty(); bufferview.update(); // fix up the count @@ -299,3 +303,6 @@ void ControlSpellchecker::ignoreAll() speller_->accept(word_); check(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlSpellchecker.h b/src/frontends/controllers/ControlSpellchecker.h index 3dcd2c9252..e04435bd75 100644 --- a/src/frontends/controllers/ControlSpellchecker.h +++ b/src/frontends/controllers/ControlSpellchecker.h @@ -16,9 +16,11 @@ #include "WordLangTuple.h" #include - class SpellBase; +namespace lyx { +namespace frontend { + /** A controller for Spellchecker dialogs. */ class ControlSpellchecker : public Dialog::Controller { @@ -88,4 +90,7 @@ private: boost::scoped_ptr speller_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLSPELLCHECKER_H diff --git a/src/frontends/controllers/ControlTabular.C b/src/frontends/controllers/ControlTabular.C index 63cbcfac21..be18472954 100644 --- a/src/frontends/controllers/ControlTabular.C +++ b/src/frontends/controllers/ControlTabular.C @@ -19,6 +19,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlTabular::ControlTabular(Dialog & parent) : Dialog::Controller(parent), active_cell_(-1) @@ -218,3 +220,6 @@ void ControlTabular::longTabular(bool yes) else set(LyXTabular::UNSET_LONGTABULAR); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlTabular.h b/src/frontends/controllers/ControlTabular.h index 0448ecd392..51533accca 100644 --- a/src/frontends/controllers/ControlTabular.h +++ b/src/frontends/controllers/ControlTabular.h @@ -19,6 +19,8 @@ #include "Dialog.h" #include "tabular.h" +namespace lyx { +namespace frontend { class ControlTabular : public Dialog::Controller { public: @@ -74,4 +76,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLTABULAR_H diff --git a/src/frontends/controllers/ControlTabularCreate.C b/src/frontends/controllers/ControlTabularCreate.C index 2361ca8199..c51a9abd17 100644 --- a/src/frontends/controllers/ControlTabularCreate.C +++ b/src/frontends/controllers/ControlTabularCreate.C @@ -18,6 +18,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlTabularCreate::ControlTabularCreate(Dialog & parent) : Dialog::Controller(parent) @@ -44,3 +46,6 @@ void ControlTabularCreate::dispatchParams() string data = tostr(params().first) + ' ' + tostr(params().second); kernel().dispatch(FuncRequest(LFUN_TABULAR_INSERT, data)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlTabularCreate.h b/src/frontends/controllers/ControlTabularCreate.h index 00e602a763..62dede1eba 100644 --- a/src/frontends/controllers/ControlTabularCreate.h +++ b/src/frontends/controllers/ControlTabularCreate.h @@ -15,6 +15,9 @@ #include "Dialog.h" #include +namespace lyx { +namespace frontend { + /** A controller for the TabularCreate Dialog. */ class ControlTabularCreate : public Dialog::Controller { @@ -40,4 +43,7 @@ private: rowsCols params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLTABULARCREATE_H diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C index c9d91c280e..68120c25d2 100644 --- a/src/frontends/controllers/ControlTexinfo.C +++ b/src/frontends/controllers/ControlTexinfo.C @@ -16,6 +16,8 @@ using std::string; +namespace lyx { +namespace frontend { void getTexFileList(ControlTexinfo::texFileSuffix type, std::vector & list) @@ -59,3 +61,6 @@ string const ControlTexinfo::getClassOptions(string const & filename) const { return getListOfOptions(filename, "cls"); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlTexinfo.h b/src/frontends/controllers/ControlTexinfo.h index 2cd12e5c41..2172dcbfdc 100644 --- a/src/frontends/controllers/ControlTexinfo.h +++ b/src/frontends/controllers/ControlTexinfo.h @@ -16,6 +16,9 @@ #include "Dialog.h" #include "tex_helpers.h" +namespace lyx { +namespace frontend { + /** A controller for Texinfo dialogs. */ class ControlTexinfo : public Dialog::Controller { @@ -50,4 +53,7 @@ private: void getTexFileList(ControlTexinfo::texFileSuffix type, std::vector & contents); +} // namespace frontend +} // namespace lyx + #endif // CONTROLTEXINFO_H diff --git a/src/frontends/controllers/ControlThesaurus.C b/src/frontends/controllers/ControlThesaurus.C index fe60194256..f99770f071 100644 --- a/src/frontends/controllers/ControlThesaurus.C +++ b/src/frontends/controllers/ControlThesaurus.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlThesaurus::ControlThesaurus(Dialog & parent) : Dialog::Controller(parent) @@ -43,11 +45,11 @@ void ControlThesaurus::replace(string const & newstr) * deletion/change ! */ string const data = - lyx::find::replace2string(oldstr_, newstr, - true, // case sensitive - true, // match word - false, // all words - true); // forward + find::replace2string(oldstr_, newstr, + true, // case sensitive + true, // match word + false, // all words + true); // forward kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data)); } @@ -58,3 +60,6 @@ Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str) meanings_ = thesaurus.lookup(str); return meanings_; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlThesaurus.h b/src/frontends/controllers/ControlThesaurus.h index 83023bed0b..75a8b4907e 100644 --- a/src/frontends/controllers/ControlThesaurus.h +++ b/src/frontends/controllers/ControlThesaurus.h @@ -16,6 +16,9 @@ #include "Dialog.h" #include "Thesaurus.h" +namespace lyx { +namespace frontend { + /** A controller for Thesaurus dialogs. */ class ControlThesaurus : public Dialog::Controller { @@ -54,4 +57,7 @@ private: virtual void apply() {} }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLTHESAURUS_H diff --git a/src/frontends/controllers/ControlToc.C b/src/frontends/controllers/ControlToc.C index 797000262d..8802de0df3 100644 --- a/src/frontends/controllers/ControlToc.C +++ b/src/frontends/controllers/ControlToc.C @@ -18,13 +18,15 @@ using std::string; class Buffer; +namespace lyx { +namespace frontend { ControlToc::ControlToc(Dialog & d) : ControlCommand(d, "toc") {} -void ControlToc::goTo(lyx::toc::TocItem const & item) +void ControlToc::goTo(toc::TocItem const & item) { item.goTo(kernel().lyxview()); } @@ -32,24 +34,27 @@ void ControlToc::goTo(lyx::toc::TocItem const & item) vector const ControlToc::getTypes() const { - return lyx::toc::getTypes(kernel().buffer()); + return toc::getTypes(kernel().buffer()); } -lyx::toc::Toc const ControlToc::getContents(string const & type) const +toc::Toc const ControlToc::getContents(string const & type) const { - lyx::toc::Toc empty_list; + toc::Toc empty_list; // This shouldn't be possible... if (!kernel().isBufferAvailable()) { return empty_list; } - lyx::toc::TocList tmp = lyx::toc::getTocList(kernel().buffer()); - lyx::toc::TocList::iterator it = tmp.find(type); + toc::TocList tmp = toc::getTocList(kernel().buffer()); + toc::TocList::iterator it = tmp.find(type); if (it == tmp.end()) { return empty_list; } return it->second; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlToc.h b/src/frontends/controllers/ControlToc.h index 03c39ecb00..3285e38e26 100644 --- a/src/frontends/controllers/ControlToc.h +++ b/src/frontends/controllers/ControlToc.h @@ -17,6 +17,9 @@ #include "toc.h" #include +namespace lyx { +namespace frontend { + /** A controller for TOC dialogs. */ class ControlToc : public ControlCommand { @@ -25,13 +28,16 @@ public: ControlToc(Dialog &); /// Goto this paragraph id - void goTo(lyx::toc::TocItem const &); + void goTo(toc::TocItem const &); /// Return the list of types available std::vector const getTypes() const; /// Given a type, returns the contents - lyx::toc::Toc const getContents(std::string const & type) const; + toc::Toc const getContents(std::string const & type) const; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLTOC_H diff --git a/src/frontends/controllers/ControlVSpace.C b/src/frontends/controllers/ControlVSpace.C index eab3a8ebd8..d1b8b86992 100644 --- a/src/frontends/controllers/ControlVSpace.C +++ b/src/frontends/controllers/ControlVSpace.C @@ -21,6 +21,8 @@ using std::istringstream; using std::string; +namespace lyx { +namespace frontend { ControlVSpace::ControlVSpace(Dialog & parent) : Dialog::Controller(parent) @@ -61,3 +63,6 @@ VSpace const & ControlVSpace::params() const { return params_; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlVSpace.h b/src/frontends/controllers/ControlVSpace.h index 108afae5b3..a16ae52753 100644 --- a/src/frontends/controllers/ControlVSpace.h +++ b/src/frontends/controllers/ControlVSpace.h @@ -16,6 +16,8 @@ #include "Dialog.h" #include "vspace.h" +namespace lyx { +namespace frontend { class ControlVSpace : public Dialog::Controller { public: @@ -41,4 +43,7 @@ private: VSpace params_; }; +} // namespace frontend +} // namespace lyx + #endif // CONTROLPARAGRAPH_H diff --git a/src/frontends/controllers/ControlWrap.C b/src/frontends/controllers/ControlWrap.C index d506f71814..f572e76491 100644 --- a/src/frontends/controllers/ControlWrap.C +++ b/src/frontends/controllers/ControlWrap.C @@ -17,6 +17,8 @@ using std::string; +namespace lyx { +namespace frontend { ControlWrap::ControlWrap(Dialog & parent) : Dialog::Controller(parent) @@ -43,3 +45,6 @@ void ControlWrap::dispatchParams() string const lfun = InsetWrapMailer::params2string(params()); kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/ControlWrap.h b/src/frontends/controllers/ControlWrap.h index 63608d4900..8fc8c3fc55 100644 --- a/src/frontends/controllers/ControlWrap.h +++ b/src/frontends/controllers/ControlWrap.h @@ -16,6 +16,9 @@ class InsetWrapParams; +namespace lyx { +namespace frontend { + class ControlWrap : public Dialog::Controller { public: /// @@ -37,4 +40,7 @@ private: boost::scoped_ptr params_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/controllers/Dialog.C b/src/frontends/controllers/Dialog.C index dfdb58a2f8..977379089a 100644 --- a/src/frontends/controllers/Dialog.C +++ b/src/frontends/controllers/Dialog.C @@ -18,6 +18,8 @@ using std::string; +namespace lyx { +namespace frontend { Dialog::Dialog(LyXView & lv, string const & name) : is_closing_(false), kernel_(lv), name_(name), @@ -203,3 +205,6 @@ string const & Dialog::View::getTitle() const void Dialog::View::partialUpdate(int) {} + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/Dialog.h b/src/frontends/controllers/Dialog.h index e4adb0f972..d1926dfcf2 100644 --- a/src/frontends/controllers/Dialog.h +++ b/src/frontends/controllers/Dialog.h @@ -12,16 +12,17 @@ #ifndef DIALOG_H #define DIALOG_H - #include "Kernel.h" #include #include - class LyXView; -class ButtonController; +namespace lyx { +namespace frontend { + +class ButtonController; /** \c Dialog collects the different parts of a Model-Controller-View * split of a generic dialog together. @@ -251,5 +252,7 @@ private: std::string title_; }; +} // namespace frontend +} // namespace lyx #endif // DIALOG_H diff --git a/src/frontends/controllers/Kernel.C b/src/frontends/controllers/Kernel.C index 46520bb3c1..6d42465e1e 100644 --- a/src/frontends/controllers/Kernel.C +++ b/src/frontends/controllers/Kernel.C @@ -22,6 +22,8 @@ using std::string; +namespace lyx { +namespace frontend { Kernel::Kernel(LyXView & lyxview) : lyxview_(lyxview) @@ -110,3 +112,6 @@ Buffer const & Kernel::buffer() const BOOST_ASSERT(lyxview_.buffer()); return *lyxview_.buffer(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/Kernel.h b/src/frontends/controllers/Kernel.h index 4655552da7..7919a2fc20 100644 --- a/src/frontends/controllers/Kernel.h +++ b/src/frontends/controllers/Kernel.h @@ -14,12 +14,13 @@ #include - class Buffer; class BufferView; class FuncRequest; class LyXView; +namespace lyx { +namespace frontend { /** \c Kernel is a wrapper making the LyX kernel available to the dialog. * (Ie, it provides an interface to the Model part of the Model-Controller- @@ -102,5 +103,7 @@ private: LyXView & lyxview_; }; +} // namespace frontend +} // namespace lyx #endif // KERNEL_H diff --git a/src/frontends/controllers/biblio.C b/src/frontends/controllers/biblio.C index 7e92ed61c9..b7776a5452 100644 --- a/src/frontends/controllers/biblio.C +++ b/src/frontends/controllers/biblio.C @@ -24,24 +24,26 @@ #include -using lyx::support::ascii_lowercase; -using lyx::support::bformat; -using lyx::support::compare_ascii_no_case; -using lyx::support::contains; -using lyx::support::getVectorFromString; -using lyx::support::ltrim; -using lyx::support::prefixIs; -using lyx::support::rtrim; -using lyx::support::split; -using lyx::support::subst; -using lyx::support::token; -using lyx::support::trim; - using std::string; using std::ostringstream; using std::vector; +namespace lyx { + +using support::ascii_lowercase; +using support::bformat; +using support::compare_ascii_no_case; +using support::contains; +using support::getVectorFromString; +using support::ltrim; +using support::prefixIs; +using support::rtrim; +using support::split; +using support::subst; +using support::token; +using support::trim; + namespace biblio { namespace { @@ -822,3 +824,4 @@ getAuthorYearStrings(string const & key, } } // namespace biblio +} // namespace lyx diff --git a/src/frontends/controllers/biblio.h b/src/frontends/controllers/biblio.h index cc39875b4d..72f487ef91 100644 --- a/src/frontends/controllers/biblio.h +++ b/src/frontends/controllers/biblio.h @@ -19,6 +19,7 @@ class Buffer; /** Functions of use to citation and bibtex GUI controllers and views */ +namespace lyx { namespace biblio { class CiteEngine_enum; @@ -156,6 +157,8 @@ std::vector const getAuthorYearStrings(std::string const & key, InfoMap const & map, std::vector const & styles); + } // namespace biblio +} // namespace lyx #endif // BIBLIOHELPERS_H diff --git a/src/frontends/controllers/character.C b/src/frontends/controllers/character.C index cc3640f8e3..d13387cf66 100644 --- a/src/frontends/controllers/character.C +++ b/src/frontends/controllers/character.C @@ -17,7 +17,8 @@ using std::vector; -namespace frnt { +namespace lyx { +namespace frontend { vector const getFamilyData() { @@ -258,4 +259,5 @@ vector const getColorData() return color; } -} // namespace frnt +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/character.h b/src/frontends/controllers/character.h index 0977b1ddc0..9e4f2cc79e 100644 --- a/src/frontends/controllers/character.h +++ b/src/frontends/controllers/character.h @@ -23,7 +23,8 @@ class LColor_color; /** Functions of use to the character GUI controller and view */ -namespace frnt { +namespace lyx { +namespace frontend { /// enum FONT_STATE { @@ -65,6 +66,7 @@ std::vector const getBarData(); /// std::vector const getColorData(); -} // namespace frnt +} // namespace frontend +} // namespace lyx #endif // CHARACTERHELPERS diff --git a/src/frontends/controllers/frnt_lang.C b/src/frontends/controllers/frnt_lang.C index 76b9b92253..71fd439aaf 100644 --- a/src/frontends/controllers/frnt_lang.C +++ b/src/frontends/controllers/frnt_lang.C @@ -22,21 +22,23 @@ using std::string; using std::vector; +namespace lyx { +namespace frontend { + namespace { struct Sorter - : public std::binary_function + : public std::binary_function { - bool operator()(frnt::LanguagePair const & lhs, - frnt::LanguagePair const & rhs) const { + bool operator()(LanguagePair const & lhs, + LanguagePair const & rhs) const { return lhs.first < rhs.first; } }; } // namespace anon -namespace frnt { vector const getLanguageData(bool character_dlg) { @@ -69,4 +71,5 @@ vector const getLanguageData(bool character_dlg) return langs; } -} // namespace frnt +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/frnt_lang.h b/src/frontends/controllers/frnt_lang.h index de12944b9b..c57f3ebaf2 100644 --- a/src/frontends/controllers/frnt_lang.h +++ b/src/frontends/controllers/frnt_lang.h @@ -18,7 +18,8 @@ #include #include -namespace frnt { +namespace lyx { +namespace frontend { /// typedef std::pair LanguagePair; @@ -28,6 +29,7 @@ typedef std::pair LanguagePair; */ std::vector const getLanguageData(bool character_dlg); -} // namespace frnt +} // namespace frontend +} // namespace lyx #endif // FRNT_LANG_H diff --git a/src/frontends/controllers/helper_funcs.C b/src/frontends/controllers/helper_funcs.C index 9c82f5763d..a817db0a1d 100644 --- a/src/frontends/controllers/helper_funcs.C +++ b/src/frontends/controllers/helper_funcs.C @@ -21,17 +21,24 @@ #include "support/filetools.h" // OnlyPath, OnlyFilename #include "support/globbing.h" -using lyx::support::FileFilterList; -using lyx::support::MakeAbsPath; -using lyx::support::MakeRelPath; -using lyx::support::OnlyFilename; -using lyx::support::OnlyPath; -using lyx::support::prefixIs; - using std::pair; using std::vector; using std::string; +// sorry this is just a temporary hack we should include vspace.h! (Jug) +extern const char * stringFromUnit(int); + +namespace lyx { + +using support::FileFilterList; +using support::MakeAbsPath; +using support::MakeRelPath; +using support::OnlyFilename; +using support::OnlyPath; +using support::prefixIs; + +namespace frontend { + string const browseFile(string const & filename, string const & title, @@ -129,9 +136,6 @@ string const browseDir(string const & pathname, } -// sorry this is just a temporary hack we should include vspace.h! (Jug) -extern const char * stringFromUnit(int); - vector const getLatexUnits() { vector units; @@ -141,3 +145,6 @@ vector const getLatexUnits() return units; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/helper_funcs.h b/src/frontends/controllers/helper_funcs.h index 5673c8f27c..aa9313f04c 100644 --- a/src/frontends/controllers/helper_funcs.h +++ b/src/frontends/controllers/helper_funcs.h @@ -19,10 +19,13 @@ namespace lyx { + namespace support { class FileFilterList; } // namespace support -} // namespace lyx + + +namespace frontend { /** Launch a file dialog and return the chosen file. filename: a suggested filename. @@ -33,7 +36,7 @@ class FileFilterList; std::string const browseFile(std::string const & filename, std::string const & title, - lyx::support::FileFilterList const & filters, + support::FileFilterList const & filters, bool save = false, std::pair const & dir1 = std::make_pair(std::string(), std::string()), @@ -51,7 +54,7 @@ std::string const browseRelFile(std::string const & filename, std::string const & refpath, std::string const & title, - lyx::support::FileFilterList const & filters, + support::FileFilterList const & filters, bool save = false, std::pair const & dir1 = std::make_pair(std::string(), std::string()), @@ -100,4 +103,7 @@ getSecond(std::vector const & pr) return tmp; } +} // namespace frontend +} // namespace lyx + #endif // NOT HELPERFUNCS_H diff --git a/src/frontends/controllers/tex_helpers.C b/src/frontends/controllers/tex_helpers.C index 587b7b93d6..383464b96b 100644 --- a/src/frontends/controllers/tex_helpers.C +++ b/src/frontends/controllers/tex_helpers.C @@ -24,21 +24,24 @@ #include #include -using lyx::support::contains; -using lyx::support::GetFileContents; -using lyx::support::getVectorFromString; -using lyx::support::LibFileSearch; -using lyx::support::OnlyFilename; -using lyx::support::Path; -using lyx::support::Path; -using lyx::support::split; -using lyx::support::Systemcall; -using lyx::support::token; -using lyx::support::user_lyxdir; - using std::string; using std::endl; +namespace lyx { + +using support::contains; +using support::GetFileContents; +using support::getVectorFromString; +using support::LibFileSearch; +using support::OnlyFilename; +using support::Path; +using support::Path; +using support::split; +using support::Systemcall; +using support::token; +using support::user_lyxdir; + +namespace frontend { // build filelists of all availabe bst/cls/sty-files. done through // kpsewhich and an external script, saved in *Files.lst @@ -80,7 +83,7 @@ void getTexFileList(string const & filename, std::vector & list) *it = regex.Merge((*it), "/"); } - lyx::eliminate_duplicates(list); + eliminate_duplicates(list); } @@ -128,3 +131,6 @@ string const getTexFileFromList(string const & file, return classfile; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/controllers/tex_helpers.h b/src/frontends/controllers/tex_helpers.h index d604135d87..1865561783 100644 --- a/src/frontends/controllers/tex_helpers.h +++ b/src/frontends/controllers/tex_helpers.h @@ -15,6 +15,8 @@ #include #include +namespace lyx { +namespace frontend { // build filelists of all availabe bst/cls/sty-files. done through // kpsewhich and an external script, saved in *Files.lst @@ -34,4 +36,7 @@ std::string const getListOfOptions(std::string const & classname, std::string co /// get a class with full path from the list std::string const getTexFileFromList(std::string const & classname, std::string const & type); +} // namespace frontend +} // namespace lyx + #endif // TEX_HELPERS_H diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index 865f34b24a..c805285101 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,7 @@ +2004-05-19 Angus Leeming + + * Most files: wrap code up inside namespace lyx::frontend. + 2004-05-04 Angus Leeming * Dialogs.C: Remove "error" dialog identifier. diff --git a/src/frontends/gtk/Dialogs.C b/src/frontends/gtk/Dialogs.C index 9831a4c235..dc3a89c1e5 100644 --- a/src/frontends/gtk/Dialogs.C +++ b/src/frontends/gtk/Dialogs.C @@ -118,6 +118,7 @@ using std::string; +using namespace lyx::frontend; namespace { diff --git a/src/frontends/gtk/GAboutlyx.C b/src/frontends/gtk/GAboutlyx.C index 7ebad4eada..a878ffcbd2 100644 --- a/src/frontends/gtk/GAboutlyx.C +++ b/src/frontends/gtk/GAboutlyx.C @@ -22,6 +22,8 @@ using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -173,3 +175,6 @@ void GAboutlyx::doBuild() setCancel(btn); //btn->signal_clicked().connect(SigC::slot(*this, &GViewBase::onCancel)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GAboutlyx.h b/src/frontends/gtk/GAboutlyx.h index adb852aa82..98fe06c24d 100644 --- a/src/frontends/gtk/GAboutlyx.h +++ b/src/frontends/gtk/GAboutlyx.h @@ -14,6 +14,9 @@ #include "GViewBase.h" +namespace lyx { +namespace frontend { + class ControlAboutlyx; class GAboutlyx : public GViewCB @@ -26,4 +29,7 @@ private: virtual void doBuild(); }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GBC.C b/src/frontends/gtk/GBC.C index 5680177e76..8144453641 100644 --- a/src/frontends/gtk/GBC.C +++ b/src/frontends/gtk/GBC.C @@ -15,6 +15,8 @@ using std::string; +namespace lyx { +namespace frontend { GBC::GBC(ButtonController const & parent, string const & cancel, string const & close) @@ -39,3 +41,6 @@ void GBC::setButtonLabel(Gtk::Button * btn, string const & label) const { btn->set_label(Glib::locale_to_utf8(label)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GBC.h b/src/frontends/gtk/GBC.h index cd89ef7231..8525d20798 100644 --- a/src/frontends/gtk/GBC.h +++ b/src/frontends/gtk/GBC.h @@ -18,6 +18,9 @@ #include "BCView.h" #include "gettext.h" +namespace lyx { +namespace frontend { + class GBC : public GuiBC { public: @@ -35,4 +38,7 @@ private: void setButtonLabel(Gtk::Button *, std::string const & label) const; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GMathDelim.C b/src/frontends/gtk/GMathDelim.C index 6ddd519207..5057eaf65c 100644 --- a/src/frontends/gtk/GMathDelim.C +++ b/src/frontends/gtk/GMathDelim.C @@ -24,6 +24,9 @@ using std::string; +namespace lyx { +namespace frontend { + namespace { @@ -224,3 +227,6 @@ void GMathDelim::onRadioClicked() { bc().valid(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GMathDelim.h b/src/frontends/gtk/GMathDelim.h index 1f0a127db3..addf53c7c8 100644 --- a/src/frontends/gtk/GMathDelim.h +++ b/src/frontends/gtk/GMathDelim.h @@ -16,6 +16,9 @@ #include "support/lstrings.h" #include "GXpmBtnTbl.h" +namespace lyx { +namespace frontend { + class ControlMath; class GMathDelim : public GViewCB @@ -42,4 +45,7 @@ private: int rightSel_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GMathPanel.C b/src/frontends/gtk/GMathPanel.C index eb16e49d08..e6fb1132c3 100644 --- a/src/frontends/gtk/GMathPanel.C +++ b/src/frontends/gtk/GMathPanel.C @@ -45,6 +45,9 @@ using std::string; +namespace lyx { +namespace frontend { + namespace { char const * infoUp[][5] = @@ -163,3 +166,6 @@ void GMathPanel::onFunctionSelected() controller().dispatchInsert( Glib::locale_from_utf8(sel)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GMathPanel.h b/src/frontends/gtk/GMathPanel.h index a1b78abd11..30b99f9a39 100644 --- a/src/frontends/gtk/GMathPanel.h +++ b/src/frontends/gtk/GMathPanel.h @@ -16,6 +16,9 @@ #include "support/lstrings.h" #include "GXpmBtnTbl.h" +namespace lyx { +namespace frontend { + class ControlMath; class GMathPanel : public GViewCB @@ -43,4 +46,7 @@ private: GXpmBtnTbl tableDown_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GMenubar.C b/src/frontends/gtk/GMenubar.C index 80d211577e..1c1e767aa3 100644 --- a/src/frontends/gtk/GMenubar.C +++ b/src/frontends/gtk/GMenubar.C @@ -18,6 +18,9 @@ using std::string; +namespace lyx { +namespace frontend { + namespace { @@ -229,3 +232,6 @@ void GMenubar::onCommandActivate(MenuItem const * item, { view_->getLyXFunc().dispatch(item->func(), true); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GMenubar.h b/src/frontends/gtk/GMenubar.h index f6db2ceb47..b23d89fa66 100644 --- a/src/frontends/gtk/GMenubar.h +++ b/src/frontends/gtk/GMenubar.h @@ -18,6 +18,9 @@ class LyXView; +namespace lyx { +namespace frontend { + class GMenubar : public Menubar, public SigC::Object { public: GMenubar(LyXView *, MenuBackend const &); @@ -33,4 +36,7 @@ private: std::vector mainMenuNames_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GMiniBuffer.C b/src/frontends/gtk/GMiniBuffer.C index 070a46777a..c917958f5d 100644 --- a/src/frontends/gtk/GMiniBuffer.C +++ b/src/frontends/gtk/GMiniBuffer.C @@ -23,6 +23,8 @@ using std::string; +namespace lyx { +namespace frontend { GMiniBuffer::GMiniBuffer(GView * view, ControlCommandBuffer & control) : controller_(control), view_(view) @@ -286,3 +288,6 @@ void GMiniBuffer::setInput(Glib::ustring const & input) entry_.set_text(input); entry_.set_position(-1); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GMiniBuffer.h b/src/frontends/gtk/GMiniBuffer.h index 6c97551ea3..41e146ebbc 100644 --- a/src/frontends/gtk/GMiniBuffer.h +++ b/src/frontends/gtk/GMiniBuffer.h @@ -15,6 +15,9 @@ #include "frontends/Timeout.h" +namespace lyx { +namespace frontend { + class ControlCommandBuffer; class GMiniBuffer : public SigC::Object @@ -67,4 +70,7 @@ private: Glib::RefPtr listSel_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GPainter.C b/src/frontends/gtk/GPainter.C index c6bd1a3455..3631ba4d6f 100644 --- a/src/frontends/gtk/GPainter.C +++ b/src/frontends/gtk/GPainter.C @@ -33,6 +33,15 @@ using std::string; +namespace font_metrics { + +int width(wchar_t const *s, size_t n, LyXFont const & f); + +} // namespace font_metrics + + +namespace lyx { +namespace frontend { GPainter::GPainter(GWorkArea & xwa) : Painter(), owner_(xwa) @@ -165,10 +174,10 @@ void GPainter::arc(int x, int y, unsigned int w, unsigned int h, void GPainter::image(int x, int y, int w, int h, - lyx::graphics::Image const & i) + graphics::Image const & i) { - lyx::graphics::xformsImage const & image = - static_cast(i); + graphics::xformsImage const & image = + static_cast(i); Pixmap pixmap = GDK_PIXMAP_XID(owner_.getPixmap()->gobj()); GC gc = GDK_GC_XGC(owner_.getGC()->gobj()); XCopyArea(owner_.getDisplay(), image.getPixmap(), pixmap, @@ -199,14 +208,6 @@ inline XftFont * getXftFont(LyXFont const & f) } -namespace font_metrics -{ - -int width(wchar_t const *s, size_t n, LyXFont const & f); - -} - - void GPainter::text(int x, int y, wchar_t const * s, int ls, LyXFont const & f) { XftFont * font = getXftFont(f); @@ -224,7 +225,7 @@ void GPainter::text(int x, int y, wchar_t const * s, int ls, LyXFont const & f) wchar_t c; int tmpx = x; for(int i = 0; i < ls; ++i) { - c = lyx::support::uppercase(s[i]); + c = support::uppercase(s[i]); if(c != s[i]) { XftDrawString32(draw, xftClr, fontS, tmpx, y, wcsToXftChar32StrFast(&c), 1); @@ -254,3 +255,6 @@ void GPainter::text(int x, int y, char const * s, size_t ls, LyXFont const & f) len = mbstowcs(wcs.get(), s, ls + 1); text(x, y, wcs.get(), len, f); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GPainter.h b/src/frontends/gtk/GPainter.h index 3e754ea569..775d9e73a8 100644 --- a/src/frontends/gtk/GPainter.h +++ b/src/frontends/gtk/GPainter.h @@ -19,6 +19,10 @@ #include class LyXFont; + +namespace lyx { +namespace frontend { + class GWorkArea; /** @@ -95,7 +99,7 @@ public: /// draw an image from the image cache virtual void image(int x, int y, int w, int h, - lyx::graphics::Image const & image); + graphics::Image const & image); /// draw a string at position x, y (y is the baseline) virtual void text(int x, int y, @@ -125,4 +129,7 @@ private: GWorkArea & owner_; }; +} // namespace frontend +} // namespace lyx + #endif // XPAINTER_H diff --git a/src/frontends/gtk/GPrint.C b/src/frontends/gtk/GPrint.C index d43be55f73..d4d5c0eff0 100644 --- a/src/frontends/gtk/GPrint.C +++ b/src/frontends/gtk/GPrint.C @@ -19,6 +19,8 @@ #include "PrinterParams.h" #include "support/lstrings.h" +namespace lyx { +namespace frontend { GPrint::GPrint(Dialog & parent, string title) : GViewCB(parent, title, false) @@ -163,3 +165,6 @@ void GPrint::doBuild() fromTo_->signal_toggled().connect(SigC::slot(*this, &GPrint::updateUI)); number_->signal_changed().connect(SigC::slot(*this, &GPrint::updateUI)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GPrint.h b/src/frontends/gtk/GPrint.h index af758a5b61..26df42f3c4 100644 --- a/src/frontends/gtk/GPrint.h +++ b/src/frontends/gtk/GPrint.h @@ -14,6 +14,9 @@ #include "GViewBase.h" +namespace lyx { +namespace frontend { + class ControlPrint; class GPrint : public GViewCB @@ -44,4 +47,7 @@ private: Gtk::Entry * toEntry_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GScreen.C b/src/frontends/gtk/GScreen.C index 50b94c7076..5948231f84 100644 --- a/src/frontends/gtk/GScreen.C +++ b/src/frontends/gtk/GScreen.C @@ -32,6 +32,8 @@ #include +namespace lyx { +namespace frontend { GScreen::GScreen(GWorkArea & o) : LyXScreen(), owner_(o) @@ -143,3 +145,6 @@ void GScreen::expose(int x, int y, int w, int h) y + owner_.ypos(), w, h); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GScreen.h b/src/frontends/gtk/GScreen.h index 510d707c20..c3610a71b9 100644 --- a/src/frontends/gtk/GScreen.h +++ b/src/frontends/gtk/GScreen.h @@ -14,6 +14,9 @@ #include "screen.h" +namespace lyx { +namespace frontend { + class GWorkArea; /** The class GScreen is used for the main Textbody. @@ -60,4 +63,7 @@ private: int cursorH_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GTableCreate.C b/src/frontends/gtk/GTableCreate.C index 98ecf8a1cc..f7bf7e7ce9 100644 --- a/src/frontends/gtk/GTableCreate.C +++ b/src/frontends/gtk/GTableCreate.C @@ -20,6 +20,9 @@ using std::string; +namespace lyx { +namespace frontend { + GTableCreate::GTableCreate(Dialog & parent) : GViewCB(parent, _("Insert Table")) { @@ -48,3 +51,6 @@ void GTableCreate::apply() int columns = columns_->get_value_as_int(); controller().params() = std::make_pair(columns, rows); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GTableCreate.h b/src/frontends/gtk/GTableCreate.h index 745c0598eb..a01e9dc730 100644 --- a/src/frontends/gtk/GTableCreate.h +++ b/src/frontends/gtk/GTableCreate.h @@ -14,6 +14,9 @@ #include "GViewBase.h" +namespace lyx { +namespace frontend { + class ControlTableCreate; class GTableCreate : public GViewCB @@ -28,4 +31,7 @@ private: Gtk::SpinButton *columns_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GText.C b/src/frontends/gtk/GText.C index 6ffb00ba74..642008d313 100644 --- a/src/frontends/gtk/GText.C +++ b/src/frontends/gtk/GText.C @@ -20,6 +20,8 @@ using std::string; +namespace lyx { +namespace frontend { GText::GText(Dialog & parent, string const & title, string const & label) : GViewCB(parent, title), @@ -35,7 +37,7 @@ void GText::apply() void GText::update() { - string const contents = lyx::support::trim( + string const contents = support::trim( controller().params().getContents()); entry_->set_text(Glib::locale_to_utf8(contents)); } @@ -69,3 +71,6 @@ void GText::onEntryChanged() { bc().valid(!entry_->get_text().empty()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GText.h b/src/frontends/gtk/GText.h index bbbc88436e..96511d04c8 100644 --- a/src/frontends/gtk/GText.h +++ b/src/frontends/gtk/GText.h @@ -14,6 +14,9 @@ #include "GViewBase.h" +namespace lyx { +namespace frontend { + class ControlCommand; class GText : public GViewCB @@ -29,4 +32,7 @@ private: Gtk::Entry * entry_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GTimeout.C b/src/frontends/gtk/GTimeout.C index 4fa8e8d940..943cf6ba87 100644 --- a/src/frontends/gtk/GTimeout.C +++ b/src/frontends/gtk/GTimeout.C @@ -18,9 +18,12 @@ Timeout::Timeout(unsigned int msec, Type t) - : pimpl_(new GTimeout(*this)), type(t), timeout_ms(msec) + : pimpl_(new lyx::frontend::GTimeout(*this)), + type(t), timeout_ms(msec) {} +namespace lyx { +namespace frontend { GTimeout::GTimeout(Timeout & owner) : Timeout::Impl(owner) @@ -67,3 +70,6 @@ bool GTimeout::timeoutEvent() emit(); return false; // discontinue emitting timeouts. } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GTimeout.h b/src/frontends/gtk/GTimeout.h index 10d1a10fc5..1eca87f1ac 100644 --- a/src/frontends/gtk/GTimeout.h +++ b/src/frontends/gtk/GTimeout.h @@ -17,6 +17,9 @@ #include +namespace lyx { +namespace frontend { + /** * This class executes the callback when the timeout expires * using Gtk mechanisms @@ -44,4 +47,7 @@ private: bool running_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GToolbar.C b/src/frontends/gtk/GToolbar.C index fcd968df89..f01cf0b231 100644 --- a/src/frontends/gtk/GToolbar.C +++ b/src/frontends/gtk/GToolbar.C @@ -23,6 +23,8 @@ using std::string; +namespace lyx { +namespace frontend { namespace { @@ -163,13 +165,19 @@ void GLayoutBox::selected() << layoutGuiName << std::endl; } +} // namespace frontend +} // namespace lyx + Toolbars::ToolbarPtr make_toolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) { + using lyx::frontend::GToolbar; return Toolbars::ToolbarPtr(new GToolbar(tbb, owner)); } +namespace lyx { +namespace frontend { GToolbar::GToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) : owner_(dynamic_cast(owner)) @@ -292,3 +300,6 @@ void GToolbar::update() set_relief(Gtk::RELIEF_NONE); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GToolbar.h b/src/frontends/gtk/GToolbar.h index fd9a9351ee..4fa9aca173 100644 --- a/src/frontends/gtk/GToolbar.h +++ b/src/frontends/gtk/GToolbar.h @@ -18,8 +18,10 @@ #include -class GView; +namespace lyx { +namespace frontend { +class GView; class GLayoutBox: public LayoutBox, public SigC::Object { public: @@ -63,4 +65,7 @@ private: boost::scoped_ptr layout_; }; +} // namespace frontend +} // namespace lyx + #endif // NOT GTOOLBAR_H diff --git a/src/frontends/gtk/GUrl.C b/src/frontends/gtk/GUrl.C index 1822b6e158..f25ca575db 100644 --- a/src/frontends/gtk/GUrl.C +++ b/src/frontends/gtk/GUrl.C @@ -20,6 +20,9 @@ using std::string; +namespace lyx { +namespace frontend { + GUrl::GUrl(Dialog & parent) : GViewCB(parent, _("URL")) { @@ -86,3 +89,6 @@ void GUrl::apply() else controller().params().setCmdName("url"); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GUrl.h b/src/frontends/gtk/GUrl.h index f6b493b5c2..ba547fc371 100644 --- a/src/frontends/gtk/GUrl.h +++ b/src/frontends/gtk/GUrl.h @@ -14,6 +14,9 @@ #include "GViewBase.h" +namespace lyx { +namespace frontend { + class ControlCommand; class GUrl : public GViewCB @@ -30,4 +33,7 @@ private: Gtk::CheckButton * htmlType_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GView.C b/src/frontends/gtk/GView.C index abcddc99e3..d37a335cf5 100644 --- a/src/frontends/gtk/GView.C +++ b/src/frontends/gtk/GView.C @@ -30,6 +30,8 @@ using std::string; +namespace lyx { +namespace frontend { namespace { @@ -94,7 +96,7 @@ GView::GView() // Make sure the buttons are disabled if needed. updateToolbars(); string const iconName = - lyx::support::LibFileSearch("images", "lyx", "xpm"); + support::LibFileSearch("images", "lyx", "xpm"); if (!iconName.empty()) set_icon_from_file(iconName); } @@ -173,3 +175,6 @@ void GView::clearMessage() { message(getLyXFunc().viewStatusMessage()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GView.h b/src/frontends/gtk/GView.h index d04a0ab329..5d7967202b 100644 --- a/src/frontends/gtk/GView.h +++ b/src/frontends/gtk/GView.h @@ -16,6 +16,9 @@ #include "bufferview_funcs.h" #include +namespace lyx { +namespace frontend { + class GMiniBuffer; class GView : public LyXView, public Gtk::Window @@ -66,4 +69,7 @@ private: Gtk::Widget * workArea_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GViewBase.C b/src/frontends/gtk/GViewBase.C index c6782bfd28..34d8887d9d 100644 --- a/src/frontends/gtk/GViewBase.C +++ b/src/frontends/gtk/GViewBase.C @@ -16,6 +16,8 @@ using std::string; +namespace lyx { +namespace frontend { GViewBase::GViewBase(Dialog & parent, string const & t, bool allowResize) : Dialog::View(parent, t), allowResize_(allowResize) @@ -38,7 +40,7 @@ void GViewBase::build() { doBuild(); string const iconName = - lyx::support::LibFileSearch("images", "lyx", "xpm"); + support::LibFileSearch("images", "lyx", "xpm"); if (!iconName.empty()) window()->set_icon_from_file(iconName); window()->signal_delete_event().connect( @@ -150,3 +152,6 @@ const Gtk::Window * GViewGladeB::window() const xml_->get_widget("dialog", win); return win; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GViewBase.h b/src/frontends/gtk/GViewBase.h index 1276c9cf60..e6113c1d82 100644 --- a/src/frontends/gtk/GViewBase.h +++ b/src/frontends/gtk/GViewBase.h @@ -19,6 +19,9 @@ #include "ButtonPolicies.h" #include "GBC.h" +namespace lyx { +namespace frontend { + class GViewBase : public Dialog::View, public SigC::Object { public: @@ -124,4 +127,7 @@ Controller const & GViewCB::controller() const return static_cast(getController()); } +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/GWorkArea.C b/src/frontends/gtk/GWorkArea.C index 4af3c59646..ffae993a42 100644 --- a/src/frontends/gtk/GWorkArea.C +++ b/src/frontends/gtk/GWorkArea.C @@ -23,6 +23,8 @@ using std::string; +namespace lyx { +namespace frontend { ColorCache colorCache; @@ -468,3 +470,6 @@ void GWorkArea::putClipboard(string const & str) const Gtk::Clipboard::get(GDK_SELECTION_PRIMARY); clipboard->set_text(Glib::locale_to_utf8(str)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/GWorkArea.h b/src/frontends/gtk/GWorkArea.h index 14fe4e8211..8264a8bb70 100644 --- a/src/frontends/gtk/GWorkArea.h +++ b/src/frontends/gtk/GWorkArea.h @@ -23,6 +23,9 @@ class LColor_color; class LyXView; +namespace lyx { +namespace frontend { + class ColorCache { typedef std::map Map; @@ -110,4 +113,7 @@ private: std::string inputCache_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/gtk/LyXScreenFactory.C b/src/frontends/gtk/LyXScreenFactory.C index bcf1362a1f..8bcd1f8fda 100644 --- a/src/frontends/gtk/LyXScreenFactory.C +++ b/src/frontends/gtk/LyXScreenFactory.C @@ -22,6 +22,9 @@ namespace LyXScreenFactory { LyXScreen * create(WorkArea & owner) { + using lyx::frontend::GScreen; + using lyx::frontend::GWorkArea; + return new GScreen(static_cast(owner)); } diff --git a/src/frontends/gtk/WorkAreaFactory.C b/src/frontends/gtk/WorkAreaFactory.C index e1c74cf827..3b54e273b0 100644 --- a/src/frontends/gtk/WorkAreaFactory.C +++ b/src/frontends/gtk/WorkAreaFactory.C @@ -21,7 +21,7 @@ namespace WorkAreaFactory { WorkArea * create(LyXView & owner, int w, int h) { - return new GWorkArea(owner, w, h); + return new lyx::frontend::GWorkArea(owner, w, h); } diff --git a/src/frontends/gtk/ghelpers.C b/src/frontends/gtk/ghelpers.C index e2008f6cd1..f943a6452a 100644 --- a/src/frontends/gtk/ghelpers.C +++ b/src/frontends/gtk/ghelpers.C @@ -19,6 +19,9 @@ using std::string; +namespace lyx { +namespace frontend { + string const findGladeFile(string const & name) { // First, search in the installation directories. @@ -44,3 +47,6 @@ string const findGladeFile(string const & name) return filename; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/gtk/ghelpers.h b/src/frontends/gtk/ghelpers.h index 873e269f67..f86b921e09 100644 --- a/src/frontends/gtk/ghelpers.h +++ b/src/frontends/gtk/ghelpers.h @@ -14,9 +14,15 @@ #include +namespace lyx { +namespace frontend { + /** name is the name of the glade file, without path or extension. * Eg, "aboutlyx", "tableCreate". */ std::string const findGladeFile(std::string const & name); +} // namespace frontend +} // namespace lyx + #endif // NOT GHELPERS_H diff --git a/src/frontends/gtk/lyx_gui.C b/src/frontends/gtk/lyx_gui.C index 53bad5f327..4a27d6e22d 100644 --- a/src/frontends/gtk/lyx_gui.C +++ b/src/frontends/gtk/lyx_gui.C @@ -60,6 +60,10 @@ namespace os = lyx::support::os; using std::ostringstream; using std::string; +using lyx::frontend::colorCache; +using lyx::frontend::GView; +using lyx::frontend::XformsColor; + extern BufferList bufferlist; diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index b112b29158..0167d56ae8 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2004-05-19 Angus Leeming + + * Most files: wrap code up inside namespace lyx::frontend. + 2004-05-14 Angus Leeming * QCitation.C: small changes due to the changes in biblio.h. diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 43f3cb4176..cb6e246dc5 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -95,6 +95,7 @@ using std::string; +using namespace lyx::frontend; namespace { diff --git a/src/frontends/qt2/QAbout.C b/src/frontends/qt2/QAbout.C index 63d9325388..258f0f6ce2 100644 --- a/src/frontends/qt2/QAbout.C +++ b/src/frontends/qt2/QAbout.C @@ -33,6 +33,8 @@ using std::istringstream; using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -113,3 +115,6 @@ void QAbout::build_dialog() bcview().setCancel(dialog_->closePB); bc().refresh(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QAbout.h b/src/frontends/qt2/QAbout.h index e4a9a10526..94b22d1d56 100644 --- a/src/frontends/qt2/QAbout.h +++ b/src/frontends/qt2/QAbout.h @@ -12,9 +12,10 @@ #ifndef FORMABOUT_H #define FORMABOUT_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class QAboutDialog; class ControlAboutlyx; @@ -33,4 +34,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMABOUT_H diff --git a/src/frontends/qt2/QAboutDialog.C b/src/frontends/qt2/QAboutDialog.C index e4f6392776..625970cd91 100644 --- a/src/frontends/qt2/QAboutDialog.C +++ b/src/frontends/qt2/QAboutDialog.C @@ -10,9 +10,10 @@ #include - #include "QAboutDialog.h" +namespace lyx { +namespace frontend { QAboutDialog::QAboutDialog(QWidget * parent, const char * name, bool modal, WFlags fl) @@ -23,3 +24,6 @@ QAboutDialog::QAboutDialog(QWidget * parent, const char * name, QAboutDialog::~QAboutDialog() {} + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QAboutDialog.h b/src/frontends/qt2/QAboutDialog.h index 589b7ed715..a5d2177d02 100644 --- a/src/frontends/qt2/QAboutDialog.h +++ b/src/frontends/qt2/QAboutDialog.h @@ -12,9 +12,11 @@ #ifndef QABOUTDIALOG_H #define QABOUTDIALOG_H - #include "ui/QAboutDialogBase.h" +namespace lyx { +namespace frontend { + class QAboutDialog : public QAboutDialogBase { Q_OBJECT public: @@ -23,4 +25,7 @@ public: ~QAboutDialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QABOUTDIALOG_H diff --git a/src/frontends/qt2/QBibitem.C b/src/frontends/qt2/QBibitem.C index 5257319126..5f18836adf 100644 --- a/src/frontends/qt2/QBibitem.C +++ b/src/frontends/qt2/QBibitem.C @@ -10,8 +10,6 @@ #include - - #include "debug.h" #include "ControlCommand.h" #include "qt_helpers.h" @@ -23,6 +21,9 @@ #include "QBibitem.h" #include "Qt2BC.h" +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -61,3 +62,6 @@ bool QBibitem::isValid() { return !dialog_->keyED->text().isEmpty(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBibitem.h b/src/frontends/qt2/QBibitem.h index 81125c64bb..c01d17989b 100644 --- a/src/frontends/qt2/QBibitem.h +++ b/src/frontends/qt2/QBibitem.h @@ -12,9 +12,11 @@ #ifndef QBIBITEM_H #define QBIBITEM_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; class QBibitemDialog; @@ -36,4 +38,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QBIBITEM_H diff --git a/src/frontends/qt2/QBibitemDialog.C b/src/frontends/qt2/QBibitemDialog.C index 768aa424a2..0871160d3a 100644 --- a/src/frontends/qt2/QBibitemDialog.C +++ b/src/frontends/qt2/QBibitemDialog.C @@ -15,6 +15,8 @@ #include "QBibitemDialog.h" #include "QBibitem.h" +namespace lyx { +namespace frontend { QBibitemDialog::QBibitemDialog(QBibitem * form) : QBibitemDialogBase(0, 0, false, 0), @@ -38,3 +40,6 @@ void QBibitemDialog::closeEvent(QCloseEvent *e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBibitemDialog.h b/src/frontends/qt2/QBibitemDialog.h index 81f9bdd029..276e45fe56 100644 --- a/src/frontends/qt2/QBibitemDialog.h +++ b/src/frontends/qt2/QBibitemDialog.h @@ -12,9 +12,11 @@ #ifndef QBIBITEMDIALOG_H #define QBIBITEMDIALOG_H - #include "ui/QBibitemDialogBase.h" +namespace lyx { +namespace frontend { + class QBibitem; class QBibitemDialog : public QBibitemDialogBase { @@ -29,4 +31,7 @@ private: QBibitem * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QBIBITEMDIALOG_H diff --git a/src/frontends/qt2/QBibtex.C b/src/frontends/qt2/QBibtex.C index 93660b23d4..bd7ac30f9d 100644 --- a/src/frontends/qt2/QBibtex.C +++ b/src/frontends/qt2/QBibtex.C @@ -39,6 +39,8 @@ using lyx::support::trim; using std::vector; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -196,3 +198,6 @@ bool QBibtex::isValid() { return dialog_->databaseLB->count() != 0; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBibtex.h b/src/frontends/qt2/QBibtex.h index 598f533b94..8c9bd50f2a 100644 --- a/src/frontends/qt2/QBibtex.h +++ b/src/frontends/qt2/QBibtex.h @@ -12,9 +12,11 @@ #ifndef QBIBTEX_H #define QBIBTEX_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlBibtex; class QBibtexDialog; @@ -36,4 +38,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QBIBTEX_H diff --git a/src/frontends/qt2/QBibtexDialog.C b/src/frontends/qt2/QBibtexDialog.C index ea3d26fd99..867487f408 100644 --- a/src/frontends/qt2/QBibtexDialog.C +++ b/src/frontends/qt2/QBibtexDialog.C @@ -28,6 +28,8 @@ using lyx::support::ChangeExtension; using std::string; +namespace lyx { +namespace frontend { QBibtexDialog::QBibtexDialog(QBibtex * form) : QBibtexDialogBase(0, 0, false, 0), @@ -164,3 +166,6 @@ void QBibtexDialog::closeEvent(QCloseEvent *e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBibtexDialog.h b/src/frontends/qt2/QBibtexDialog.h index f731b95f38..fa6adc7f1d 100644 --- a/src/frontends/qt2/QBibtexDialog.h +++ b/src/frontends/qt2/QBibtexDialog.h @@ -12,12 +12,15 @@ #ifndef QBIBTEXDIALOG_H #define QBIBTEXDIALOG_H - #include "ui/QBibtexDialogBase.h" -class QBibtex; class QBibtexAddDialogBase; +namespace lyx { +namespace frontend { + +class QBibtex; + class QBibtexDialog : public QBibtexDialogBase { Q_OBJECT @@ -43,4 +46,7 @@ private: QBibtex * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QBIBTEXDIALOG_H diff --git a/src/frontends/qt2/QBox.C b/src/frontends/qt2/QBox.C index 30fa298be7..1915423576 100644 --- a/src/frontends/qt2/QBox.C +++ b/src/frontends/qt2/QBox.C @@ -39,6 +39,8 @@ using lyx::support::isStrDbl; using lyx::support::subst; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -270,3 +272,6 @@ void QBox::setInnerType(bool frameless, int i) dialog_->innerBoxCO->setCurrentItem(i); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBox.h b/src/frontends/qt2/QBox.h index 1107064d9e..c5e2d60c73 100644 --- a/src/frontends/qt2/QBox.h +++ b/src/frontends/qt2/QBox.h @@ -13,10 +13,11 @@ #ifndef QBOX_H #define QBOX_H - #include "QDialogView.h" #include +namespace lyx { +namespace frontend { class ControlBox; class QBoxDialog; @@ -51,4 +52,7 @@ private: std::vector gui_names_spec_; }; +} // namespace frontend +} // namespace lyx + #endif // QBOX_H diff --git a/src/frontends/qt2/QBoxDialog.C b/src/frontends/qt2/QBoxDialog.C index dba8102ba6..69ccfc9b4a 100644 --- a/src/frontends/qt2/QBoxDialog.C +++ b/src/frontends/qt2/QBoxDialog.C @@ -10,7 +10,6 @@ #include - #include "QBox.h" #include "QBoxDialog.h" #include "qt_helpers.h" @@ -20,6 +19,8 @@ #include #include +namespace lyx { +namespace frontend { QBoxDialog::QBoxDialog(QBox * form) : QBoxDialogBase(0, 0, false, 0), @@ -88,3 +89,6 @@ void QBoxDialog::restoreClicked() heightUnitsLC->setCurrentItem(j); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBoxDialog.h b/src/frontends/qt2/QBoxDialog.h index ca2b2e9af0..bc8fa86467 100644 --- a/src/frontends/qt2/QBoxDialog.h +++ b/src/frontends/qt2/QBoxDialog.h @@ -12,9 +12,11 @@ #ifndef QBOXDIALOG_H #define QBOXDIALOG_H - #include "ui/QBoxDialogBase.h" +namespace lyx { +namespace frontend { + class QBox; class QBoxDialog : public QBoxDialogBase { @@ -32,4 +34,7 @@ private: QBox * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QBOXDIALOG_H diff --git a/src/frontends/qt2/QBranch.C b/src/frontends/qt2/QBranch.C index 28fd7446b3..8459aa75fb 100644 --- a/src/frontends/qt2/QBranch.C +++ b/src/frontends/qt2/QBranch.C @@ -27,6 +27,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -74,3 +76,6 @@ void QBranch::apply() string const type = fromqstr(dialog_->branchCO->currentText()); controller().params().branch = type; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBranch.h b/src/frontends/qt2/QBranch.h index 8f9711f15a..1b936a0ea2 100644 --- a/src/frontends/qt2/QBranch.h +++ b/src/frontends/qt2/QBranch.h @@ -14,6 +14,8 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlBranch; class QBranchDialog; @@ -36,4 +38,7 @@ private: virtual void update_contents(); }; +} // namespace frontend +} // namespace lyx + #endif // QBRANCH_H diff --git a/src/frontends/qt2/QBranchDialog.C b/src/frontends/qt2/QBranchDialog.C index b44b237c1f..66ccf2d6e6 100644 --- a/src/frontends/qt2/QBranchDialog.C +++ b/src/frontends/qt2/QBranchDialog.C @@ -10,12 +10,13 @@ #include - #include "QBranch.h" #include "QBranchDialog.h" #include +namespace lyx { +namespace frontend { QBranchDialog::QBranchDialog(QBranch * form) : QBranchDialogBase(0, 0, false, 0), @@ -39,3 +40,6 @@ void QBranchDialog::change_adaptor() { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QBranchDialog.h b/src/frontends/qt2/QBranchDialog.h index bbcea67b4a..27c3b9b4b2 100644 --- a/src/frontends/qt2/QBranchDialog.h +++ b/src/frontends/qt2/QBranchDialog.h @@ -14,6 +14,8 @@ #include "ui/QBranchDialogBase.h" +namespace lyx { +namespace frontend { class QBranch; @@ -29,4 +31,7 @@ private: QBranch * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QBRANCHDIALOG_H diff --git a/src/frontends/qt2/QChanges.C b/src/frontends/qt2/QChanges.C index 2c6b71470d..1fcaf873cf 100644 --- a/src/frontends/qt2/QChanges.C +++ b/src/frontends/qt2/QChanges.C @@ -24,6 +24,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -71,3 +73,6 @@ void QChanges::reject() { controller().reject(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QChanges.h b/src/frontends/qt2/QChanges.h index ef2d4725e5..0876a4dab0 100644 --- a/src/frontends/qt2/QChanges.h +++ b/src/frontends/qt2/QChanges.h @@ -14,6 +14,9 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlChanges; class QChangesDialog; @@ -40,4 +43,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QCHANGES_H diff --git a/src/frontends/qt2/QChangesDialog.C b/src/frontends/qt2/QChangesDialog.C index d6927ef5f1..b2be2b6855 100644 --- a/src/frontends/qt2/QChangesDialog.C +++ b/src/frontends/qt2/QChangesDialog.C @@ -10,12 +10,13 @@ #include - #include #include "QChangesDialog.h" #include "QChanges.h" +namespace lyx { +namespace frontend { QChangesDialog::QChangesDialog(QChanges * form) : QChangesDialogBase(0, 0, false, 0), @@ -49,3 +50,6 @@ void QChangesDialog::closeEvent(QCloseEvent *e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QChangesDialog.h b/src/frontends/qt2/QChangesDialog.h index 13aa211f4a..09389bc56e 100644 --- a/src/frontends/qt2/QChangesDialog.h +++ b/src/frontends/qt2/QChangesDialog.h @@ -14,6 +14,9 @@ #include "ui/QChangesDialogBase.h" +namespace lyx { +namespace frontend { + class QChanges; class QChangesDialog : public QChangesDialogBase { @@ -34,4 +37,7 @@ private: QChanges * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QCHANGESDIALOG_H diff --git a/src/frontends/qt2/QCharacter.C b/src/frontends/qt2/QCharacter.C index 1977c71d1a..a640c7282a 100644 --- a/src/frontends/qt2/QCharacter.C +++ b/src/frontends/qt2/QCharacter.C @@ -25,23 +25,10 @@ #include "LColor.h" -using frnt::BarPair; -using frnt::ColorPair; -using frnt::FamilyPair; -using frnt::getBarData; -using frnt::getColorData; -using frnt::getFamilyData; -using frnt::getLanguageData; -using frnt::getSeriesData; -using frnt::getShapeData; -using frnt::getSizeData; -using frnt::LanguagePair; -using frnt::SeriesPair; -using frnt::ShapePair; -using frnt::SizePair; - using std::vector; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -161,3 +148,6 @@ void QCharacter::apply() ctrl.setToggleAll(dialog_->toggleallCB->isChecked()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCharacter.h b/src/frontends/qt2/QCharacter.h index a484e397d2..48939df88b 100644 --- a/src/frontends/qt2/QCharacter.h +++ b/src/frontends/qt2/QCharacter.h @@ -13,13 +13,14 @@ #ifndef QCHARACTER_H #define QCHARACTER_H - #include "QDialogView.h" #include "controllers/character.h" #include "controllers/frnt_lang.h" #include +namespace lyx { +namespace frontend { class ControlCharacter; class QCharacterDialog; @@ -40,13 +41,16 @@ private: /// build the dialog virtual void build_dialog(); - std::vector family; - std::vector series; - std::vector shape; - std::vector size; - std::vector bar; - std::vector color; - std::vector language; + std::vector family; + std::vector series; + std::vector shape; + std::vector size; + std::vector bar; + std::vector color; + std::vector language; }; +} // namespace frontend +} // namespace lyx + #endif // QCHARACTER_H diff --git a/src/frontends/qt2/QCharacterDialog.C b/src/frontends/qt2/QCharacterDialog.C index bfcb49809f..9f563dff27 100644 --- a/src/frontends/qt2/QCharacterDialog.C +++ b/src/frontends/qt2/QCharacterDialog.C @@ -17,6 +17,8 @@ #include #include +namespace lyx { +namespace frontend { QCharacterDialog::QCharacterDialog(QCharacter * form) : QCharacterDialogBase(0, 0, false, 0), @@ -58,3 +60,6 @@ void QCharacterDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCharacterDialog.h b/src/frontends/qt2/QCharacterDialog.h index 5a94677615..1f05a3ef14 100644 --- a/src/frontends/qt2/QCharacterDialog.h +++ b/src/frontends/qt2/QCharacterDialog.h @@ -13,13 +13,14 @@ #ifndef QCHARACTERDIALOG_H #define QCHARACTERDIALOG_H - #include "QCharacter.h" #include "ui/QCharacterDialogBase.h" - class LyXFont; +namespace lyx { +namespace frontend { + class QCharacterDialog : public QCharacterDialogBase { Q_OBJECT public: @@ -32,4 +33,7 @@ protected slots: void change_adaptor(); }; +} // namespace frontend +} // namespace lyx + #endif // QCHARACTERDIALOG_H diff --git a/src/frontends/qt2/QCitation.C b/src/frontends/qt2/QCitation.C index 0cb80c675e..6d75f68483 100644 --- a/src/frontends/qt2/QCitation.C +++ b/src/frontends/qt2/QCitation.C @@ -30,14 +30,17 @@ #include "qt_helpers.h" #include "support/lstrings.h" -using lyx::support::getStringFromVector; -using lyx::support::getVectorFromString; -using lyx::support::trim; - using std::find; using std::string; using std::vector; +namespace lyx { + +using support::getStringFromVector; +using support::getVectorFromString; +using support::trim; + +namespace frontend { typedef QController > base_class; @@ -224,3 +227,6 @@ void QCitation::updateBrowser(QListBox * browser, browser->insertItem(toqstr(key)); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCitation.h b/src/frontends/qt2/QCitation.h index 446e7b2e65..23d22f2213 100644 --- a/src/frontends/qt2/QCitation.h +++ b/src/frontends/qt2/QCitation.h @@ -13,12 +13,14 @@ #ifndef QCITATION_H #define QCITATION_H - #include "QDialogView.h" #include - class QListBox; + +namespace lyx { +namespace frontend { + class ControlCitation; class QCitationDialog; @@ -58,4 +60,7 @@ private: int style_; }; +} // namespace frontend +} // namespace lyx + #endif // QCITATION_H diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C index 020a50e85d..863ab10af5 100644 --- a/src/frontends/qt2/QCitationDialog.C +++ b/src/frontends/qt2/QCitationDialog.C @@ -29,6 +29,8 @@ using std::vector; using std::string; +namespace lyx { +namespace frontend { QCitationDialog::QCitationDialog(QCitation * form) : QCitationDialogBase(0, 0, false, 0), @@ -282,3 +284,6 @@ void QCitationDialog::find(biblio::Direction dir) add_->availableLB->setSelected(found, true); add_->availableLB->ensureCurrentVisible(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCitationDialog.h b/src/frontends/qt2/QCitationDialog.h index 7f987b0af4..01a40537b9 100644 --- a/src/frontends/qt2/QCitationDialog.h +++ b/src/frontends/qt2/QCitationDialog.h @@ -12,13 +12,16 @@ #ifndef QCITATIONDIALOG_H #define QCITATIONDIALOG_H - #include "ui/QCitationDialogBase.h" #include "controllers/biblio.h" -class QCitation; class QCitationFindDialogBase; +namespace lyx { +namespace frontend { + +class QCitation; + class QCitationDialog : public QCitationDialogBase { Q_OBJECT @@ -52,4 +55,7 @@ private: QCitation * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QCITATIOINDIALOG_H diff --git a/src/frontends/qt2/QCommandBuffer.C b/src/frontends/qt2/QCommandBuffer.C index 5a88cde8cf..40f7408717 100644 --- a/src/frontends/qt2/QCommandBuffer.C +++ b/src/frontends/qt2/QCommandBuffer.C @@ -28,6 +28,8 @@ using lyx::support::LibFileSearch; using std::vector; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -215,3 +217,6 @@ void XMiniBuffer::suffix_timeout() } #endif + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCommandBuffer.h b/src/frontends/qt2/QCommandBuffer.h index 1809b836a1..00841f213a 100644 --- a/src/frontends/qt2/QCommandBuffer.h +++ b/src/frontends/qt2/QCommandBuffer.h @@ -14,9 +14,13 @@ #include -class QtView; -class QCommandEdit; class QListBoxItem; + +namespace lyx { +namespace frontend { + +class QCommandEdit; +class QtView; class ControlCommandBuffer; class QCommandBuffer : public QWidget { @@ -50,4 +54,7 @@ private: QCommandEdit * edit_; }; +} // namespace frontend +} // namespace lyx + #endif // QCOMMANDBUFFER_H diff --git a/src/frontends/qt2/QCommandEdit.C b/src/frontends/qt2/QCommandEdit.C index c6117b2b69..13e74b8e56 100644 --- a/src/frontends/qt2/QCommandEdit.C +++ b/src/frontends/qt2/QCommandEdit.C @@ -12,6 +12,9 @@ #include "QCommandEdit.h" +namespace lyx { +namespace frontend { + QCommandEdit::QCommandEdit(QWidget * parent) : QLineEdit(parent) { @@ -54,3 +57,6 @@ bool QCommandEdit::event(QEvent * e) emit tabPressed(); return true; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QCommandEdit.h b/src/frontends/qt2/QCommandEdit.h index a994d0a177..4cc8d0a16b 100644 --- a/src/frontends/qt2/QCommandEdit.h +++ b/src/frontends/qt2/QCommandEdit.h @@ -14,6 +14,9 @@ #include +namespace lyx { +namespace frontend { + class QCommandEdit : public QLineEdit { Q_OBJECT public: @@ -37,4 +40,7 @@ protected: virtual void keyPressEvent(QKeyEvent * e); }; +} // namespace frontend +} // namespace lyx + #endif // QCOMMANDEDIT_H diff --git a/src/frontends/qt2/QDelimiterDialog.C b/src/frontends/qt2/QDelimiterDialog.C index fea71f4818..c1a4c5b386 100644 --- a/src/frontends/qt2/QDelimiterDialog.C +++ b/src/frontends/qt2/QDelimiterDialog.C @@ -25,6 +25,9 @@ using std::string; +namespace lyx { +namespace frontend { + namespace { char const * delim[] = { @@ -133,3 +136,6 @@ void QDelimiterDialog::rdelim_clicked(const string & str) set_label(leftPI, left_); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QDelimiterDialog.h b/src/frontends/qt2/QDelimiterDialog.h index 6cd3b0f977..53b2324e24 100644 --- a/src/frontends/qt2/QDelimiterDialog.h +++ b/src/frontends/qt2/QDelimiterDialog.h @@ -15,11 +15,14 @@ #include "ui/QDelimiterDialogBase.h" #include - -class QMathDelimiter; class IconPalette; class QLabel; +namespace lyx { +namespace frontend { + +class QMathDelimiter; + class QDelimiterDialog : public QDelimiterDialogBase { Q_OBJECT public: @@ -43,4 +46,7 @@ private: QMathDelimiter * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QDELIMITERDIALOG_H diff --git a/src/frontends/qt2/QDialogView.C b/src/frontends/qt2/QDialogView.C index b6fef5e481..997a6d8306 100644 --- a/src/frontends/qt2/QDialogView.C +++ b/src/frontends/qt2/QDialogView.C @@ -10,13 +10,13 @@ #include - - #include "Qt2BC.h" #include "ButtonController.h" #include "qt_helpers.h" #include "QDialogView.h" +namespace lyx { +namespace frontend { QDialogView::QDialogView(Dialog & parent, std::string const & t) : Dialog::View(parent,t), updating_(false) @@ -110,3 +110,6 @@ void QDialogView::slotRestore() { dialog().RestoreButton(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QDialogView.h b/src/frontends/qt2/QDialogView.h index 8229f06c40..8edd08c270 100644 --- a/src/frontends/qt2/QDialogView.h +++ b/src/frontends/qt2/QDialogView.h @@ -19,6 +19,9 @@ #include #include +namespace lyx { +namespace frontend { + class Qt2BC; /** This class is an Qt2 GUI base class. @@ -175,5 +178,7 @@ Controller const & QController::controller() const return static_cast(this->getController()); } +} // namespace frontend +} // namespace lyx #endif // QDIALOGVIEW_H diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index 5d2cf56634..86d9d8c76f 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -47,6 +47,8 @@ using std::distance; using std::vector; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -64,7 +66,7 @@ char const * encodings[] = { "LaTeX default", "latin1", "latin2", QDocument::QDocument(Dialog & parent) : base_class(parent, _("LyX: Document Settings")), - lang_(getSecond(frnt::getLanguageData(false))) + lang_(getSecond(getLanguageData(false))) {} @@ -78,9 +80,9 @@ void QDocument::build_dialog() dialog_->biblioModule->citeStyleCO->setCurrentItem(0); // language & quotes - vector const langs = frnt::getLanguageData(false); - vector::const_iterator lit = langs.begin(); - vector::const_iterator lend = langs.end(); + vector const langs = getLanguageData(false); + vector::const_iterator lit = langs.begin(); + vector::const_iterator lend = langs.end(); for (; lit != lend; ++lit) { dialog_->langModule->languageCO->insertItem( toqstr(lit->first)); @@ -673,3 +675,6 @@ void QDocument::useClassDefaults() params.useClassDefaults(); update_contents(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QDocument.h b/src/frontends/qt2/QDocument.h index 52fef8f633..22d6d88e53 100644 --- a/src/frontends/qt2/QDocument.h +++ b/src/frontends/qt2/QDocument.h @@ -9,7 +9,6 @@ * Full author contact details are available in file CREDITS. */ - #ifndef QDOCUMENT_H #define QDOCUMENT_H @@ -19,11 +18,14 @@ #include #include +class LengthCombo; +class QLineEdit; + +namespace lyx { +namespace frontend { class ControlDocument; class QDocumentDialog; -class LengthCombo; -class QLineEdit; class QDocument : public QController > @@ -54,4 +56,7 @@ private: BranchList branchlist_; }; +} // namespace frontend +} // namespace lyx + #endif // QDOCUMENT_H diff --git a/src/frontends/qt2/QDocumentDialog.C b/src/frontends/qt2/QDocumentDialog.C index 17b4cb0082..a5d7bd9a31 100644 --- a/src/frontends/qt2/QDocumentDialog.C +++ b/src/frontends/qt2/QDocumentDialog.C @@ -43,6 +43,8 @@ using lyx::support::token; using std::string; +namespace lyx { +namespace frontend { QDocumentDialog::QDocumentDialog(QDocument * form) : QDocumentDialogBase(0, 0, false, 0), form_(form) @@ -541,3 +543,6 @@ void QDocumentDialog::toggleBranchColor() } } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QDocumentDialog.h b/src/frontends/qt2/QDocumentDialog.h index f1ced29df9..bea8ef735b 100644 --- a/src/frontends/qt2/QDocumentDialog.h +++ b/src/frontends/qt2/QDocumentDialog.h @@ -12,7 +12,6 @@ #ifndef QDOCUMENTDIALOG_H #define QDOCUMENTDIALOG_H - #include "ui/QDocumentDialogBase.h" #include "BulletsModule.h" @@ -28,9 +27,12 @@ #include "ui/PreambleModuleBase.h" #include "ui/BranchesModuleBase.h" +class FloatPlacement; + +namespace lyx { +namespace frontend { class QDocument; -class FloatPlacement; class QDocumentDialog : public QDocumentDialogBase { Q_OBJECT @@ -88,4 +90,7 @@ private: QDocument * form_; }; +} // namespace frontend +} // namespace lyx + #endif // DOCUMENTDIALOG_H diff --git a/src/frontends/qt2/QERT.C b/src/frontends/qt2/QERT.C index 4ad8d7bc0d..c50558d8c8 100644 --- a/src/frontends/qt2/QERT.C +++ b/src/frontends/qt2/QERT.C @@ -20,6 +20,9 @@ #include "QERT.h" #include "Qt2BC.h" +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -61,3 +64,6 @@ void QERT::update_contents() rb->setChecked(true); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QERT.h b/src/frontends/qt2/QERT.h index a26c1dc2db..21c1a992da 100644 --- a/src/frontends/qt2/QERT.h +++ b/src/frontends/qt2/QERT.h @@ -12,9 +12,10 @@ #ifndef QERT_H #define QERT_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlERT; class QERTDialog; @@ -35,4 +36,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QERT_H diff --git a/src/frontends/qt2/QERTDialog.C b/src/frontends/qt2/QERTDialog.C index e3a628822c..cea0345bed 100644 --- a/src/frontends/qt2/QERTDialog.C +++ b/src/frontends/qt2/QERTDialog.C @@ -10,12 +10,13 @@ #include - #include "QERT.h" #include "QERTDialog.h" #include +namespace lyx { +namespace frontend { QERTDialog::QERTDialog(QERT * form) : QERTDialogBase(0, 0, false, 0), @@ -39,3 +40,6 @@ void QERTDialog::change_adaptor() { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QERTDialog.h b/src/frontends/qt2/QERTDialog.h index a1863e6c81..06acb15a20 100644 --- a/src/frontends/qt2/QERTDialog.h +++ b/src/frontends/qt2/QERTDialog.h @@ -14,6 +14,8 @@ #include "ui/QERTDialogBase.h" +namespace lyx { +namespace frontend { class QERT; @@ -29,4 +31,7 @@ private: QERT * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QERTDIALOG_H diff --git a/src/frontends/qt2/QErrorList.C b/src/frontends/qt2/QErrorList.C index 1f43fc2d29..7e2dc17726 100644 --- a/src/frontends/qt2/QErrorList.C +++ b/src/frontends/qt2/QErrorList.C @@ -22,6 +22,9 @@ #include #include +namespace lyx { +namespace frontend { + typedef QController > base_class; QErrorList::QErrorList(Dialog & parent) @@ -57,3 +60,6 @@ void QErrorList::update_contents() dialog_->errorsLB->setSelected(0, true); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QErrorList.h b/src/frontends/qt2/QErrorList.h index e820a84ec9..c41f55871c 100644 --- a/src/frontends/qt2/QErrorList.h +++ b/src/frontends/qt2/QErrorList.h @@ -12,9 +12,11 @@ #ifndef QERRORLIST_H #define QERRORLIST_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlErrorList; class QErrorListDialog; @@ -36,4 +38,7 @@ private: virtual void update_contents(); }; +} // namespace frontend +} // namespace lyx + #endif // QERRORLIST_H diff --git a/src/frontends/qt2/QErrorListDialog.C b/src/frontends/qt2/QErrorListDialog.C index 72f1efefd8..0c6bc65659 100644 --- a/src/frontends/qt2/QErrorListDialog.C +++ b/src/frontends/qt2/QErrorListDialog.C @@ -10,13 +10,14 @@ #include - #include "QErrorList.h" #include "QErrorListDialog.h" #include #include +namespace lyx { +namespace frontend { QErrorListDialog::QErrorListDialog(QErrorList * form) : QErrorListDialogBase(0, 0, false, 0), @@ -44,3 +45,6 @@ void QErrorListDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QErrorListDialog.h b/src/frontends/qt2/QErrorListDialog.h index b09752a07b..a747c4fb3e 100644 --- a/src/frontends/qt2/QErrorListDialog.h +++ b/src/frontends/qt2/QErrorListDialog.h @@ -12,9 +12,11 @@ #ifndef QERRORLISTDIALOG_H #define QERRORLISTDIALOG_H - #include "ui/QErrorListDialogBase.h" +namespace lyx { +namespace frontend { + class QErrorList; class QErrorListDialog : public QErrorListDialogBase { @@ -30,4 +32,7 @@ private: QErrorList * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTOCERRORLIST_H diff --git a/src/frontends/qt2/QExternal.C b/src/frontends/qt2/QExternal.C index 59187b0e47..8c082dca7c 100644 --- a/src/frontends/qt2/QExternal.C +++ b/src/frontends/qt2/QExternal.C @@ -50,6 +50,8 @@ using std::string; using std::vector; using std::find; +namespace lyx { +namespace frontend { namespace { @@ -96,7 +98,7 @@ void setDisplay(QCheckBox & displayCB, QComboBox & showCO, QLineEdit & scaleED, } showCO.setCurrentItem(item); - bool const no_display = display == lyx::external::NoDisplay; + bool const no_display = display == external::NoDisplay; showCO.setEnabled(!no_display && !read_only); displayCB.setChecked(!no_display); scaleED.setEnabled(!no_display && !read_only); @@ -233,7 +235,7 @@ void setCrop(QCheckBox & clipCB, external::ClipData const & data) { clipCB.setChecked(data.clip); - lyx::graphics::BoundingBox const & bbox = data.bbox; + graphics::BoundingBox const & bbox = data.bbox; xlED.setText(toqstr(tostr(bbox.xl))); ybED.setText(toqstr(tostr(bbox.yb))); xrED.setText(toqstr(tostr(bbox.xr))); @@ -499,3 +501,6 @@ void QExternal::getBB() controller().bbChanged(false); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QExternal.h b/src/frontends/qt2/QExternal.h index fc52d621cd..ae083266fe 100644 --- a/src/frontends/qt2/QExternal.h +++ b/src/frontends/qt2/QExternal.h @@ -12,10 +12,11 @@ #ifndef QEXTERNAL_H #define QEXTERNAL_H - #include "QDialogView.h" #include +namespace lyx { +namespace frontend { class ControlExternal; class QExternalDialog; @@ -47,4 +48,7 @@ private: MapType extra_; }; +} // namespace frontend +} // namespace lyx + #endif // QEXTERNAL_H diff --git a/src/frontends/qt2/QExternalDialog.C b/src/frontends/qt2/QExternalDialog.C index c579a014ff..39b14dde78 100644 --- a/src/frontends/qt2/QExternalDialog.C +++ b/src/frontends/qt2/QExternalDialog.C @@ -39,6 +39,8 @@ using lyx::support::isStrDbl; using lyx::support::strToDbl; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -204,3 +206,6 @@ void QExternalDialog::widthUnitChanged() heightUnitCO->setEnabled(useHeight); form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QExternalDialog.h b/src/frontends/qt2/QExternalDialog.h index 1ac74c111c..34e79dabe1 100644 --- a/src/frontends/qt2/QExternalDialog.h +++ b/src/frontends/qt2/QExternalDialog.h @@ -12,9 +12,11 @@ #ifndef QEXTERNALDIALOG_H #define QEXTERNALDIALOG_H - #include "ui/QExternalDialogBase.h" +namespace lyx { +namespace frontend { + class QExternal; class QExternalDialog : public QExternalDialogBase { @@ -42,4 +44,7 @@ private: QExternal * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QEXTERNALDIALOG_H diff --git a/src/frontends/qt2/QFloat.C b/src/frontends/qt2/QFloat.C index 30e46211d4..4c0d1c95c1 100644 --- a/src/frontends/qt2/QFloat.C +++ b/src/frontends/qt2/QFloat.C @@ -21,6 +21,9 @@ #include +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -55,3 +58,6 @@ void QFloat::apply() params.placement = dialog_->floatFP->get(params.wide, params.sideways); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QFloat.h b/src/frontends/qt2/QFloat.h index 6e637a519c..d170634dbf 100644 --- a/src/frontends/qt2/QFloat.h +++ b/src/frontends/qt2/QFloat.h @@ -12,9 +12,11 @@ #ifndef QFLOAT_H #define QFLOAT_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlFloat; class QFloatDialog; @@ -35,4 +37,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QFLOAT_H diff --git a/src/frontends/qt2/QFloatDialog.C b/src/frontends/qt2/QFloatDialog.C index 76811dcbba..de55390115 100644 --- a/src/frontends/qt2/QFloatDialog.C +++ b/src/frontends/qt2/QFloatDialog.C @@ -10,9 +10,6 @@ #include - - - #include "floatplacement.h" #include @@ -20,6 +17,8 @@ #include "QFloatDialog.h" #include "QFloat.h" +namespace lyx { +namespace frontend { QFloatDialog::QFloatDialog(QFloat * form) : QFloatDialogBase(0, 0, false, 0), @@ -56,3 +55,6 @@ void QFloatDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QFloatDialog.h b/src/frontends/qt2/QFloatDialog.h index 274c89dd83..e7b18637bc 100644 --- a/src/frontends/qt2/QFloatDialog.h +++ b/src/frontends/qt2/QFloatDialog.h @@ -12,9 +12,11 @@ #ifndef QFLOATDIALOG_H #define QFLOATDIALOG_H - #include "ui/QFloatDialogBase.h" +namespace lyx { +namespace frontend { + class QFloat; class QFloatDialog : public QFloatDialogBase { @@ -32,4 +34,7 @@ private: QFloat * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QFLOATDIALOG_H diff --git a/src/frontends/qt2/QGraphics.C b/src/frontends/qt2/QGraphics.C index 6ece7d2ddc..b9734654d4 100644 --- a/src/frontends/qt2/QGraphics.C +++ b/src/frontends/qt2/QGraphics.C @@ -49,6 +49,8 @@ using std::floor; using std::vector; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -128,7 +130,7 @@ int getUnitNo(char const * const c[], string const & s) { void QGraphics::update_contents() { // clear and fill in the comboboxes - vector const bb_units = frnt::getBBUnits(); + vector const bb_units = lyx::frontend::getBBUnits(); dialog_->lbXunit->clear(); dialog_->lbYunit->clear(); dialog_->rtXunit->clear(); @@ -280,7 +282,7 @@ void QGraphics::update_contents() dialog_->origin->clear(); - using namespace frnt; + using namespace lyx::frontend; vector origindata = getRotationOriginData(); vector const origin_lang = getFirst(origindata); QGraphics::origin_ltx = getSecond(origindata); @@ -291,7 +293,7 @@ void QGraphics::update_contents() if (!igp.rotateOrigin.empty()) dialog_->origin->setCurrentItem( - ::getItemNo(origin_ltx, igp.rotateOrigin)); + getItemNo(origin_ltx, igp.rotateOrigin)); else dialog_->origin->setCurrentItem(0); @@ -425,3 +427,6 @@ void QGraphics::slotEdit() { controller().editGraphics(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QGraphics.h b/src/frontends/qt2/QGraphics.h index 7783cbf4fd..298a32cfc5 100644 --- a/src/frontends/qt2/QGraphics.h +++ b/src/frontends/qt2/QGraphics.h @@ -13,10 +13,11 @@ #ifndef QGRAPHICS_H #define QGRAPHICS_H - #include "QDialogView.h" #include +namespace lyx { +namespace frontend { class ControlGraphics; class QGraphicsDialog; @@ -49,4 +50,7 @@ private: }; +} // namespace frontend +} // namespace lyx + #endif // QGRAPHICS_H diff --git a/src/frontends/qt2/QGraphicsDialog.C b/src/frontends/qt2/QGraphicsDialog.C index 8ba4dc7fba..2d234e5798 100644 --- a/src/frontends/qt2/QGraphicsDialog.C +++ b/src/frontends/qt2/QGraphicsDialog.C @@ -11,7 +11,6 @@ #include - #include "ControlGraphics.h" #include "debug.h" #include "qt_helpers.h" @@ -26,6 +25,8 @@ using std::string; +namespace lyx { +namespace frontend { QGraphicsDialog::QGraphicsDialog(QGraphics * form) : QGraphicsDialogBase(0, 0, false, 0), @@ -101,3 +102,6 @@ void QGraphicsDialog::edit_clicked() { form_->controller().editGraphics(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QGraphicsDialog.h b/src/frontends/qt2/QGraphicsDialog.h index c2916b1410..fbae6bb39b 100644 --- a/src/frontends/qt2/QGraphicsDialog.h +++ b/src/frontends/qt2/QGraphicsDialog.h @@ -13,9 +13,11 @@ #ifndef QGRAPHICSDIALOG_H #define QGRAPHICSDIALOG_H - #include "ui/QGraphicsDialogBase.h" +namespace lyx { +namespace frontend { + class QGraphics; class QGraphicsDialog : public QGraphicsDialogBase { @@ -37,4 +39,7 @@ private: QGraphics * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QGRAPHICSDIALOG_H diff --git a/src/frontends/qt2/QInclude.C b/src/frontends/qt2/QInclude.C index d5f9959b80..d8beb5f6ae 100644 --- a/src/frontends/qt2/QInclude.C +++ b/src/frontends/qt2/QInclude.C @@ -25,6 +25,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -138,3 +140,6 @@ bool QInclude::isValid() { return !dialog_->filenameED->text().isEmpty(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QInclude.h b/src/frontends/qt2/QInclude.h index ea007a7180..99a36da499 100644 --- a/src/frontends/qt2/QInclude.h +++ b/src/frontends/qt2/QInclude.h @@ -12,9 +12,10 @@ #ifndef QINCLUDE_H #define QINCLUDE_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlInclude; class QIncludeDialog; @@ -44,4 +45,7 @@ private: void browse(); }; +} // namespace frontend +} // namespace lyx + #endif // QINCLUDE_H diff --git a/src/frontends/qt2/QIncludeDialog.C b/src/frontends/qt2/QIncludeDialog.C index 16addf6b20..8c3883e859 100644 --- a/src/frontends/qt2/QIncludeDialog.C +++ b/src/frontends/qt2/QIncludeDialog.C @@ -10,8 +10,6 @@ #include - - #include #include #include @@ -19,7 +17,8 @@ #include "QIncludeDialog.h" #include "QInclude.h" - +namespace lyx { +namespace frontend { QIncludeDialog::QIncludeDialog(QInclude * form) : QIncludeDialogBase(0, 0, false, 0), @@ -87,3 +86,6 @@ void QIncludeDialog::browseClicked() { form_->browse(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QIncludeDialog.h b/src/frontends/qt2/QIncludeDialog.h index 6374b89d04..1490840876 100644 --- a/src/frontends/qt2/QIncludeDialog.h +++ b/src/frontends/qt2/QIncludeDialog.h @@ -12,9 +12,11 @@ #ifndef QINCLUDEDIALOG_H #define QINCLUDEDIALOG_H - #include "ui/QIncludeDialogBase.h" +namespace lyx { +namespace frontend { + class QInclude; class QIncludeDialog : public QIncludeDialogBase { @@ -36,4 +38,7 @@ private: QInclude * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QINCLUDEDIALOG_H diff --git a/src/frontends/qt2/QIndex.C b/src/frontends/qt2/QIndex.C index 60b7627f83..a3cf1e6be5 100644 --- a/src/frontends/qt2/QIndex.C +++ b/src/frontends/qt2/QIndex.C @@ -24,6 +24,9 @@ using std::string; +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -64,3 +67,6 @@ bool QIndex::isValid() { return !dialog_->keywordED->text().isEmpty(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QIndex.h b/src/frontends/qt2/QIndex.h index a22020aeb0..020dbc097f 100644 --- a/src/frontends/qt2/QIndex.h +++ b/src/frontends/qt2/QIndex.h @@ -13,9 +13,11 @@ #ifndef QINDEX_H #define QINDEX_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; class QIndexDialog; @@ -41,4 +43,7 @@ private: QString const label_; }; +} // namespace frontend +} // namespace lyx + #endif // QINDEX_H diff --git a/src/frontends/qt2/QIndexDialog.C b/src/frontends/qt2/QIndexDialog.C index 372c9f1a60..4df39df93c 100644 --- a/src/frontends/qt2/QIndexDialog.C +++ b/src/frontends/qt2/QIndexDialog.C @@ -19,6 +19,8 @@ #include #include +namespace lyx { +namespace frontend { QIndexDialog::QIndexDialog(QIndex * form) : QIndexDialogBase(0, 0, false, 0), @@ -70,3 +72,6 @@ void QIndexDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QIndexDialog.h b/src/frontends/qt2/QIndexDialog.h index b348fa8efc..8a65af8ffc 100644 --- a/src/frontends/qt2/QIndexDialog.h +++ b/src/frontends/qt2/QIndexDialog.h @@ -12,9 +12,11 @@ #ifndef QINDEXDIALOG_H #define QINDEXDIALOG_H - #include "ui/QIndexDialogBase.h" +namespace lyx { +namespace frontend { + class QIndex; class QIndexDialog : public QIndexDialogBase { @@ -32,4 +34,7 @@ private: QIndex * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QINDEXDIALOG_H diff --git a/src/frontends/qt2/QLMenubar.C b/src/frontends/qt2/QLMenubar.C index 9fafbc5403..27d1de1070 100644 --- a/src/frontends/qt2/QLMenubar.C +++ b/src/frontends/qt2/QLMenubar.C @@ -23,6 +23,8 @@ using std::pair; using std::string; +namespace lyx { +namespace frontend { QLMenubar::QLMenubar(LyXView * view, MenuBackend const & mbe) : owner_(static_cast(view)), menubackend_(mbe) @@ -73,3 +75,6 @@ MenuBackend const & QLMenubar::backend() { return menubackend_; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLMenubar.h b/src/frontends/qt2/QLMenubar.h index ae14ae2148..98dcf812b4 100644 --- a/src/frontends/qt2/QLMenubar.h +++ b/src/frontends/qt2/QLMenubar.h @@ -10,7 +10,6 @@ * Full author contact details are available in file CREDITS. */ - #ifndef QLMENUBAR_H #define QLMENUBAR_H @@ -19,9 +18,13 @@ #include class LyXView; -class QtView; class MenuBackend; + +namespace lyx { +namespace frontend { + class QLPopupMenu; +class QtView; class QLMenubar : public Menubar { public: @@ -51,4 +54,7 @@ private: NameMap name_map_; }; +} // namespace frontend +} // namespace lyx + #endif // QLMENUBAR_H diff --git a/src/frontends/qt2/QLPopupMenu.C b/src/frontends/qt2/QLPopupMenu.C index 490435026c..76bf2a7a7d 100644 --- a/src/frontends/qt2/QLPopupMenu.C +++ b/src/frontends/qt2/QLPopupMenu.C @@ -20,13 +20,16 @@ #include "QLPopupMenu.h" #include "qt_helpers.h" -using lyx::support::subst; - using std::distance; using std::make_pair; using std::string; using std::pair; +namespace lyx { + +using support::subst; + +namespace frontend { namespace { @@ -118,3 +121,6 @@ void QLPopupMenu::showing() owner_->backend().expand(frommenu, tomenu, owner_->view()); populate(&tomenu); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLPopupMenu.h b/src/frontends/qt2/QLPopupMenu.h index e86c03113f..7afc37f89e 100644 --- a/src/frontends/qt2/QLPopupMenu.h +++ b/src/frontends/qt2/QLPopupMenu.h @@ -12,7 +12,6 @@ #ifndef QLPOPUPMENU_H #define QLPOPUPMENU_H - #include #include "funcrequest.h" @@ -24,6 +23,10 @@ class MenuBackend; class MenuItem; class Menu; class QMenuData; + +namespace lyx { +namespace frontend { + class QLMenubar; class QLPopupMenu; @@ -59,4 +62,7 @@ private: Funcs funcs_; }; +} // namespace frontend +} // namespace lyx + #endif // QLPOPUPMENU_H diff --git a/src/frontends/qt2/QLPrintDialog.C b/src/frontends/qt2/QLPrintDialog.C index 8679e77b4b..7a31172666 100644 --- a/src/frontends/qt2/QLPrintDialog.C +++ b/src/frontends/qt2/QLPrintDialog.C @@ -11,7 +11,6 @@ #include - #include "qt_helpers.h" #include "QPrint.h" @@ -23,6 +22,8 @@ #include #include +namespace lyx { +namespace frontend { QLPrintDialog::QLPrintDialog(QPrint * f) : QPrintDialogBase(0, 0, false, 0), @@ -81,3 +82,6 @@ void QLPrintDialog::pagerangeChanged() { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLPrintDialog.h b/src/frontends/qt2/QLPrintDialog.h index af460dcbda..ab1110bddf 100644 --- a/src/frontends/qt2/QLPrintDialog.h +++ b/src/frontends/qt2/QLPrintDialog.h @@ -13,9 +13,11 @@ #ifndef QLPRINTDIALOG_H #define QLPRINTDIALOG_H - #include "ui/QPrintDialogBase.h" +namespace lyx { +namespace frontend { + class QPrint; class QLPrintDialog : public QPrintDialogBase { @@ -33,4 +35,7 @@ private: QPrint * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QLPRINTDIALOG_H diff --git a/src/frontends/qt2/QLToolbar.C b/src/frontends/qt2/QLToolbar.C index 2c79d50266..72d4c2c16b 100644 --- a/src/frontends/qt2/QLToolbar.C +++ b/src/frontends/qt2/QLToolbar.C @@ -32,6 +32,8 @@ using std::endl; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -162,13 +164,18 @@ void QLayoutBox::selected(const QString & str) lyxerr << "ERROR (QLayoutBox::selected): layout not found!" << endl; } +} // namespace frontend +} // namespace lyx Toolbars::ToolbarPtr make_toolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) { + using lyx::frontend::QLToolbar; return Toolbars::ToolbarPtr(new QLToolbar(tbb, owner)); } +namespace lyx { +namespace frontend { QLToolbar::QLToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) : owner_(dynamic_cast(owner)), @@ -258,3 +265,6 @@ void QLToolbar::clicked() else lyxerr << "non existent tool button selected !" << endl; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLToolbar.h b/src/frontends/qt2/QLToolbar.h index 572f216ae1..37b6e0ed15 100644 --- a/src/frontends/qt2/QLToolbar.h +++ b/src/frontends/qt2/QLToolbar.h @@ -20,13 +20,15 @@ #include - class QComboBox; class QToolBar; class QToolButton; -class QtView; +namespace lyx { +namespace frontend { + class QLayoutBox; +class QtView; class QLToolbar; @@ -78,4 +80,7 @@ private: boost::scoped_ptr layout_; }; +} // namespace frontend +} // namespace lyx + #endif // NOT QLTOOLBAR_H diff --git a/src/frontends/qt2/QLog.C b/src/frontends/qt2/QLog.C index 64dabd1f66..cc3dedfda8 100644 --- a/src/frontends/qt2/QLog.C +++ b/src/frontends/qt2/QLog.C @@ -22,6 +22,8 @@ #include #include +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -45,3 +47,6 @@ void QLog::update_contents() dialog_->logTV->setText(toqstr(ss.str())); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLog.h b/src/frontends/qt2/QLog.h index 59af95e0e5..0853789a41 100644 --- a/src/frontends/qt2/QLog.h +++ b/src/frontends/qt2/QLog.h @@ -12,9 +12,10 @@ #ifndef QLOG_H #define QLOG_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlLog; class QLogDialog; @@ -37,4 +38,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QLOG_H diff --git a/src/frontends/qt2/QLogDialog.C b/src/frontends/qt2/QLogDialog.C index c0ad20f694..516b52c247 100644 --- a/src/frontends/qt2/QLogDialog.C +++ b/src/frontends/qt2/QLogDialog.C @@ -10,14 +10,13 @@ #include - - #include #include "QLogDialog.h" #include "QLog.h" - +namespace lyx { +namespace frontend { QLogDialog::QLogDialog(QLog * form) : QLogDialogBase(0, 0, false, 0), @@ -39,3 +38,6 @@ void QLogDialog::updateClicked() { form_->update_contents(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QLogDialog.h b/src/frontends/qt2/QLogDialog.h index 3a55e6015f..6c859e126d 100644 --- a/src/frontends/qt2/QLogDialog.h +++ b/src/frontends/qt2/QLogDialog.h @@ -12,9 +12,11 @@ #ifndef QLOGDIALOG_H #define QLOGDIALOG_H - #include "ui/QLogDialogBase.h" +namespace lyx { +namespace frontend { + class QLog; class QLogDialog : public QLogDialogBase { @@ -29,4 +31,7 @@ private: QLog * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QLOGDIALOG_H diff --git a/src/frontends/qt2/QMath.C b/src/frontends/qt2/QMath.C index 1060a29805..98543a7278 100644 --- a/src/frontends/qt2/QMath.C +++ b/src/frontends/qt2/QMath.C @@ -10,13 +10,14 @@ #include - #include "gettext.h" #include "QMathDialog.h" #include "QMathMatrixDialog.h" #include "QDelimiterDialog.h" #include "QMath.h" +namespace lyx { +namespace frontend { typedef QController > math_base; @@ -58,3 +59,6 @@ void QMathDelimiter::build_dialog() { dialog_.reset(new QDelimiterDialog(this)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QMath.h b/src/frontends/qt2/QMath.h index d98d0352ad..8dbcef822e 100644 --- a/src/frontends/qt2/QMath.h +++ b/src/frontends/qt2/QMath.h @@ -12,9 +12,11 @@ #ifndef QMATH_H #define QMATH_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlMath; class QMathDialog; class QMathMatrixDialog; @@ -61,4 +63,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QMATH_H diff --git a/src/frontends/qt2/QMathDialog.C b/src/frontends/qt2/QMathDialog.C index 933b9057a8..9613605ccf 100644 --- a/src/frontends/qt2/QMathDialog.C +++ b/src/frontends/qt2/QMathDialog.C @@ -28,6 +28,8 @@ using std::string; +namespace lyx { +namespace frontend { class QScrollViewSingle : public QScrollView { public: @@ -309,3 +311,6 @@ void QMathDialog::insertFont(int id) } form_->controller().dispatchInsert(str); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QMathDialog.h b/src/frontends/qt2/QMathDialog.h index 3a1c70ea66..41874330bf 100644 --- a/src/frontends/qt2/QMathDialog.h +++ b/src/frontends/qt2/QMathDialog.h @@ -15,9 +15,12 @@ #include "ui/QMathDialogBase.h" #include +class IconPalette; + +namespace lyx { +namespace frontend { class QMath; -class IconPalette; class QMathDialog : public QMathDialogBase { @@ -54,4 +57,7 @@ private: QMath * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QMATHDIALOG_H diff --git a/src/frontends/qt2/QMathMatrixDialog.C b/src/frontends/qt2/QMathMatrixDialog.C index 4ede05e30d..765d2816e7 100644 --- a/src/frontends/qt2/QMathMatrixDialog.C +++ b/src/frontends/qt2/QMathMatrixDialog.C @@ -27,9 +27,15 @@ using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { -static char h_align_str[80] = "c"; -static char v_align_c[] = "tcb"; +namespace { + +char h_align_str[80] = "c"; +char v_align_c[] = "tcb"; + +} // namespace anon QMathMatrixDialog::QMathMatrixDialog(QMathMatrix * form) @@ -94,3 +100,6 @@ void QMathMatrixDialog::slotClose() { close(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QMathMatrixDialog.h b/src/frontends/qt2/QMathMatrixDialog.h index 0f58150811..c36a8749ef 100644 --- a/src/frontends/qt2/QMathMatrixDialog.h +++ b/src/frontends/qt2/QMathMatrixDialog.h @@ -14,9 +14,11 @@ #ifndef QMATHMATRIXDIALOG_H #define QMATHMATRIXDIALOG_H - #include "ui/QMathMatrixDialogBase.h" +namespace lyx { +namespace frontend { + class QMathMatrix; class QMathMatrixDialog : public QMathMatrixDialogBase { @@ -34,4 +36,7 @@ private: QMathMatrix * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QMATHMATRIXDIALOG_H diff --git a/src/frontends/qt2/QNote.C b/src/frontends/qt2/QNote.C index a6cfd48e69..9bca052eb5 100644 --- a/src/frontends/qt2/QNote.C +++ b/src/frontends/qt2/QNote.C @@ -23,6 +23,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -74,3 +76,6 @@ void QNote::apply() controller().params().type = type; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QNote.h b/src/frontends/qt2/QNote.h index 3165115f29..e7f188b183 100644 --- a/src/frontends/qt2/QNote.h +++ b/src/frontends/qt2/QNote.h @@ -14,6 +14,8 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlNote; class QNoteDialog; @@ -36,4 +38,7 @@ private: virtual void update_contents(); }; +} // namespace frontend +} // namespace lyx + #endif // QNOTE_H diff --git a/src/frontends/qt2/QNoteDialog.C b/src/frontends/qt2/QNoteDialog.C index a1e2bd4e2b..6130cd2e03 100644 --- a/src/frontends/qt2/QNoteDialog.C +++ b/src/frontends/qt2/QNoteDialog.C @@ -10,12 +10,13 @@ #include - #include "QNote.h" #include "QNoteDialog.h" #include +namespace lyx { +namespace frontend { QNoteDialog::QNoteDialog(QNote * form) : QNoteDialogBase(0, 0, false, 0), @@ -39,3 +40,6 @@ void QNoteDialog::change_adaptor() { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QNoteDialog.h b/src/frontends/qt2/QNoteDialog.h index 1f487b2de1..d12eb46002 100644 --- a/src/frontends/qt2/QNoteDialog.h +++ b/src/frontends/qt2/QNoteDialog.h @@ -14,6 +14,8 @@ #include "ui/QNoteDialogBase.h" +namespace lyx { +namespace frontend { class QNote; @@ -29,4 +31,7 @@ private: QNote * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QNOTEDIALOG_H diff --git a/src/frontends/qt2/QParagraph.C b/src/frontends/qt2/QParagraph.C index 5ef2a5059c..98ed3a7fb6 100644 --- a/src/frontends/qt2/QParagraph.C +++ b/src/frontends/qt2/QParagraph.C @@ -31,6 +31,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -177,3 +179,6 @@ void QParagraph::update_contents() dialog_->linespacingValue->setEnabled(false); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QParagraph.h b/src/frontends/qt2/QParagraph.h index 3f314297fe..d036659fb6 100644 --- a/src/frontends/qt2/QParagraph.h +++ b/src/frontends/qt2/QParagraph.h @@ -15,6 +15,8 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlParagraph; class QParagraphDialog; @@ -36,4 +38,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QPARAGRAPH_H diff --git a/src/frontends/qt2/QParagraphDialog.C b/src/frontends/qt2/QParagraphDialog.C index 542138521f..89d884bb00 100644 --- a/src/frontends/qt2/QParagraphDialog.C +++ b/src/frontends/qt2/QParagraphDialog.C @@ -22,6 +22,8 @@ #include "qt_helpers.h" +namespace lyx { +namespace frontend { QParagraphDialog::QParagraphDialog(QParagraph * form) : QParagraphDialogBase(0, 0, false, 0), @@ -69,3 +71,6 @@ void QParagraphDialog::enableLinespacingValue(int) bool const enable = linespacing->currentItem() == 4; linespacingValue->setEnabled(enable); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QParagraphDialog.h b/src/frontends/qt2/QParagraphDialog.h index b85b1b7892..97af55d10e 100644 --- a/src/frontends/qt2/QParagraphDialog.h +++ b/src/frontends/qt2/QParagraphDialog.h @@ -13,9 +13,11 @@ #ifndef QPARAGRAPHDIALOG_H #define QPARAGRAPHDIALOG_H - #include "ui/QParagraphDialogBase.h" +namespace lyx { +namespace frontend { + class QParagraph; class QParagraphDialog : public QParagraphDialogBase { @@ -31,4 +33,7 @@ protected slots: void enableLinespacingValue(int); }; +} // namespace frontend +} // namespace lyx + #endif // QPARAGRAPHDIALOG_H diff --git a/src/frontends/qt2/QPrefs.C b/src/frontends/qt2/QPrefs.C index f1c7b80320..f803549bb2 100644 --- a/src/frontends/qt2/QPrefs.C +++ b/src/frontends/qt2/QPrefs.C @@ -64,6 +64,8 @@ using std::ostringstream; using std::pair; using std::vector; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -98,11 +100,13 @@ void QPrefs::build_dialog() langmod->defaultLanguageCO->clear(); // store the lang identifiers for later - vector const langs = frnt::getLanguageData(false); + using lyx::frontend::LanguagePair; + vector const langs = + lyx::frontend::getLanguageData(false); lang_ = getSecond(langs); - vector::const_iterator lit = langs.begin(); - vector::const_iterator lend = langs.end(); + vector::const_iterator lit = langs.begin(); + vector::const_iterator lend = langs.end(); for (; lit != lend; ++lit) { langmod->defaultLanguageCO->insertItem(toqstr(lit->first)); } @@ -615,3 +619,6 @@ void QPrefs::update_contents() dialog_->updateConverters(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QPrefs.h b/src/frontends/qt2/QPrefs.h index 368dde630b..ae188acaeb 100644 --- a/src/frontends/qt2/QPrefs.h +++ b/src/frontends/qt2/QPrefs.h @@ -15,9 +15,13 @@ #include "QDialogView.h" #include +class Formats; + +namespace lyx { +namespace frontend { + class QPrefsDialog; class Controllers; -class Formats; class QPrefs : public QController > @@ -45,4 +49,7 @@ private: std::vector lang_; }; +} // namespace frontend +} // namespace lyx + #endif // QPREFS_H diff --git a/src/frontends/qt2/QPrefsDialog.C b/src/frontends/qt2/QPrefsDialog.C index ab0aca7803..cd8389e8c7 100644 --- a/src/frontends/qt2/QPrefsDialog.C +++ b/src/frontends/qt2/QPrefsDialog.C @@ -14,7 +14,6 @@ #include "ControlPrefs.h" #include "QPrefs.h" - #include "QPrefsDialog.h" #include "ui/QPrefAsciiModule.h" @@ -49,6 +48,8 @@ using std::string; +namespace lyx { +namespace frontend { QPrefsDialog::QPrefsDialog(QPrefs * form) : QPrefsDialogBase(0, 0, false, 0), form_(form) @@ -547,3 +548,6 @@ void QPrefsDialog::select_typewriter(const QString& name) { screenfontsModule->screenTypewriterFE->set(QFont(name), name); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QPrefsDialog.h b/src/frontends/qt2/QPrefsDialog.h index 2f1afcc6d6..bfee667962 100644 --- a/src/frontends/qt2/QPrefsDialog.h +++ b/src/frontends/qt2/QPrefsDialog.h @@ -12,13 +12,11 @@ #ifndef QPREFSDIALOG_H #define QPREFSDIALOG_H - #include "ui/QPrefsDialogBase.h" #include class LColor_color; -class QPrefs; class QPrefAsciiModule; class QPrefDateModule; class QPrefKeyboardModule; @@ -35,6 +33,11 @@ class QPrefPrinterModule; class QPrefUIModule; class QPrefIdentityModule; +namespace lyx { +namespace frontend { + +class QPrefs; + class QPrefsDialog : public QPrefsDialogBase { Q_OBJECT public: @@ -104,4 +107,7 @@ private: QPrefs * form_; }; +} // namespace frontend +} // namespace lyx + #endif // PREFSDIALOG_H diff --git a/src/frontends/qt2/QPrint.C b/src/frontends/qt2/QPrint.C index 730bd8d7c3..3642a58308 100644 --- a/src/frontends/qt2/QPrint.C +++ b/src/frontends/qt2/QPrint.C @@ -26,6 +26,8 @@ #include #include +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -104,3 +106,6 @@ void QPrint::apply() controller().params() = pp; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QPrint.h b/src/frontends/qt2/QPrint.h index f3b390ee7b..6c53721466 100644 --- a/src/frontends/qt2/QPrint.h +++ b/src/frontends/qt2/QPrint.h @@ -15,6 +15,9 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlPrint; class QLPrintDialog; @@ -36,4 +39,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QPRINT_H diff --git a/src/frontends/qt2/QRef.C b/src/frontends/qt2/QRef.C index 583c58f9df..ea575b42f0 100644 --- a/src/frontends/qt2/QRef.C +++ b/src/frontends/qt2/QRef.C @@ -31,6 +31,8 @@ using std::vector; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -218,3 +220,6 @@ void QRef::updateRefs() dialog_->gotoPB->setEnabled(!refs_.empty()); redoRefs(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QRef.h b/src/frontends/qt2/QRef.h index 6b20057324..f23d0aa3c1 100644 --- a/src/frontends/qt2/QRef.h +++ b/src/frontends/qt2/QRef.h @@ -16,6 +16,8 @@ #include +namespace lyx { +namespace frontend { class ControlRef; class QRefDialog; @@ -70,4 +72,7 @@ private: std::vector refs_; }; +} // namespace frontend +} // namespace lyx + #endif // QREF_H diff --git a/src/frontends/qt2/QRefDialog.C b/src/frontends/qt2/QRefDialog.C index 1bae4f0976..10fae38502 100644 --- a/src/frontends/qt2/QRefDialog.C +++ b/src/frontends/qt2/QRefDialog.C @@ -11,8 +11,6 @@ #include - - #include "QRef.h" #include "QRefDialog.h" @@ -21,6 +19,8 @@ #include #include +namespace lyx { +namespace frontend { QRefDialog::QRefDialog(QRef * form) : QRefDialogBase(0, 0, false, 0), @@ -95,3 +95,6 @@ void QRefDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QRefDialog.h b/src/frontends/qt2/QRefDialog.h index 2e0b2faae4..4fbd5ad70e 100644 --- a/src/frontends/qt2/QRefDialog.h +++ b/src/frontends/qt2/QRefDialog.h @@ -13,9 +13,11 @@ #ifndef QREFDIALOG_H #define QREFDIALOG_H - #include "ui/QRefDialogBase.h" +namespace lyx { +namespace frontend { + class QRef; class QRefDialog : public QRefDialogBase { @@ -39,4 +41,7 @@ private: QRef * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QREFDIALOG_H diff --git a/src/frontends/qt2/QSearch.C b/src/frontends/qt2/QSearch.C index 53761d0366..39e9885630 100644 --- a/src/frontends/qt2/QSearch.C +++ b/src/frontends/qt2/QSearch.C @@ -22,6 +22,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -59,3 +61,6 @@ void QSearch::replace(string const & findstr, string const & replacestr, controller().replace(findstr, replacestr, casesens, words, !backwards, all); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSearch.h b/src/frontends/qt2/QSearch.h index 55dc44b362..de4a3c0356 100644 --- a/src/frontends/qt2/QSearch.h +++ b/src/frontends/qt2/QSearch.h @@ -14,10 +14,12 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlSearch; class QSearchDialog; - /// class QSearch : public QController > @@ -43,4 +45,7 @@ private: bool casesens, bool words, bool backwards, bool all); }; +} // namespace frontend +} // namespace lyx + #endif // QSEARCH_H diff --git a/src/frontends/qt2/QSearchDialog.C b/src/frontends/qt2/QSearchDialog.C index 113202d11a..adc8b24069 100644 --- a/src/frontends/qt2/QSearchDialog.C +++ b/src/frontends/qt2/QSearchDialog.C @@ -10,7 +10,6 @@ #include - #include "ControlSearch.h" #include "QSearchDialog.h" #include "QSearch.h" @@ -23,6 +22,9 @@ using std::string; +namespace lyx { +namespace frontend { + namespace { void uniqueInsert(QComboBox * box, QString const & text) @@ -110,3 +112,6 @@ void QSearchDialog::replaceallClicked() uniqueInsert(findCO, findCO->currentText()); uniqueInsert(replaceCO, replaceCO->currentText()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSearchDialog.h b/src/frontends/qt2/QSearchDialog.h index bd47dedebb..c6cccffe53 100644 --- a/src/frontends/qt2/QSearchDialog.h +++ b/src/frontends/qt2/QSearchDialog.h @@ -12,14 +12,17 @@ #ifndef QSEARCHDIALOG_H #define QSEARCHDIALOG_H - #include "ui/QSearchDialogBase.h" #include -class QSearch; class QCloseEvent; class QComboBox; +namespace lyx { +namespace frontend { + +class QSearch; + class QSearchDialog : public QSearchDialogBase { Q_OBJECT public: @@ -41,4 +44,7 @@ private: QSearch * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QSEARCHDIALOG_H diff --git a/src/frontends/qt2/QSendto.C b/src/frontends/qt2/QSendto.C index 5bfb010f1c..5092142abb 100644 --- a/src/frontends/qt2/QSendto.C +++ b/src/frontends/qt2/QSendto.C @@ -25,6 +25,9 @@ using std::vector; using std::string; +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -97,3 +100,6 @@ bool QSendto::isValid() else return dialog_->formatLB->count() != 0 && !dialog_->commandCO->currentText().isEmpty(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSendto.h b/src/frontends/qt2/QSendto.h index 7234756736..734b76c0b0 100644 --- a/src/frontends/qt2/QSendto.h +++ b/src/frontends/qt2/QSendto.h @@ -16,9 +16,13 @@ #include +class Format; + +namespace lyx { +namespace frontend { + class ControlSendto; class QSendtoDialog; -class Format; /** This class provides a Qt implementation of the Custom Export Dialog. */ @@ -43,4 +47,7 @@ private: std::vector all_formats_; }; +} // namespace frontend +} // namespace lyx + #endif // QSENDTO_H diff --git a/src/frontends/qt2/QSendtoDialog.C b/src/frontends/qt2/QSendtoDialog.C index 43c23f367a..32bb4c1a30 100644 --- a/src/frontends/qt2/QSendtoDialog.C +++ b/src/frontends/qt2/QSendtoDialog.C @@ -10,14 +10,13 @@ #include - - - #include #include "QSendtoDialog.h" #include "QSendto.h" +namespace lyx { +namespace frontend { QSendtoDialog::QSendtoDialog(QSendto * form) : QSendtoDialogBase(0, 0, false, 0), @@ -43,3 +42,6 @@ void QSendtoDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSendtoDialog.h b/src/frontends/qt2/QSendtoDialog.h index 40915ea1bd..2b4af2119e 100644 --- a/src/frontends/qt2/QSendtoDialog.h +++ b/src/frontends/qt2/QSendtoDialog.h @@ -12,9 +12,11 @@ #ifndef QSENDTODIALOG_H #define QSENDTODIALOG_H - #include "ui/QSendtoDialogBase.h" +namespace lyx { +namespace frontend { + class QSendto; class QSendtoDialog : public QSendtoDialogBase { @@ -31,4 +33,7 @@ private: QSendto * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QSENDTODIALOG_H diff --git a/src/frontends/qt2/QShowFile.C b/src/frontends/qt2/QShowFile.C index e96ace94f7..06d5004bff 100644 --- a/src/frontends/qt2/QShowFile.C +++ b/src/frontends/qt2/QShowFile.C @@ -23,6 +23,9 @@ using std::string; +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -51,3 +54,6 @@ void QShowFile::update_contents() dialog_->text->setText(toqstr(contents)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QShowFile.h b/src/frontends/qt2/QShowFile.h index 1a89d677a0..8421e09b73 100644 --- a/src/frontends/qt2/QShowFile.h +++ b/src/frontends/qt2/QShowFile.h @@ -12,9 +12,10 @@ #ifndef QSHOWFILE_H #define QSHOWFILE_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlShowFile; class QShowFileDialog; @@ -36,4 +37,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QSHOWFILE_H diff --git a/src/frontends/qt2/QShowFileDialog.C b/src/frontends/qt2/QShowFileDialog.C index c3552a9ba1..0514530669 100644 --- a/src/frontends/qt2/QShowFileDialog.C +++ b/src/frontends/qt2/QShowFileDialog.C @@ -10,12 +10,13 @@ #include - #include "QShowFile.h" #include "QShowFileDialog.h" #include +namespace lyx { +namespace frontend { QShowFileDialog::QShowFileDialog(QShowFile * form) : QShowFileDialogBase(0, 0, false, 0), @@ -31,3 +32,6 @@ void QShowFileDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QShowFileDialog.h b/src/frontends/qt2/QShowFileDialog.h index 5625db618a..95ad9f6c68 100644 --- a/src/frontends/qt2/QShowFileDialog.h +++ b/src/frontends/qt2/QShowFileDialog.h @@ -12,9 +12,11 @@ #ifndef QSHOWFILEDIALOG_H #define QSHOWFILEDIALOG_H - #include "ui/QShowFileDialogBase.h" +namespace lyx { +namespace frontend { + class QShowFile; class QShowFileDialog : public QShowFileDialogBase { @@ -27,4 +29,7 @@ private: QShowFile * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QSHOWFILEDIALOG_H diff --git a/src/frontends/qt2/QSpellchecker.C b/src/frontends/qt2/QSpellchecker.C index ad09f5e848..572cf7953a 100644 --- a/src/frontends/qt2/QSpellchecker.C +++ b/src/frontends/qt2/QSpellchecker.C @@ -27,6 +27,9 @@ using std::string; +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -104,3 +107,6 @@ void QSpellchecker::partialUpdate(int s) } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSpellchecker.h b/src/frontends/qt2/QSpellchecker.h index 2c961f1bdc..542c8d62b2 100644 --- a/src/frontends/qt2/QSpellchecker.h +++ b/src/frontends/qt2/QSpellchecker.h @@ -15,6 +15,9 @@ #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlSpellchecker; class QSpellcheckerDialog; @@ -43,4 +46,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QSPELLCHECKER_H diff --git a/src/frontends/qt2/QSpellcheckerDialog.C b/src/frontends/qt2/QSpellcheckerDialog.C index 11fb821525..35fa29bddd 100644 --- a/src/frontends/qt2/QSpellcheckerDialog.C +++ b/src/frontends/qt2/QSpellcheckerDialog.C @@ -10,7 +10,6 @@ #include - #include "QSpellcheckerDialog.h" #include "QSpellchecker.h" @@ -18,6 +17,8 @@ #include #include +namespace lyx { +namespace frontend { QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form) : QSpellcheckerDialogBase(0, 0, false, 0), @@ -91,3 +92,6 @@ void QSpellcheckerDialog::reject() form_->slotWMHide(); QSpellcheckerDialogBase::reject(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QSpellcheckerDialog.h b/src/frontends/qt2/QSpellcheckerDialog.h index 8de2c2ac73..aa37391e1b 100644 --- a/src/frontends/qt2/QSpellcheckerDialog.h +++ b/src/frontends/qt2/QSpellcheckerDialog.h @@ -12,9 +12,11 @@ #ifndef QSPELLCHECKERDIALOG_H #define QSPELLCHECKERDIALOG_H - #include "ui/QSpellcheckerDialogBase.h" +namespace lyx { +namespace frontend { + class QSpellchecker; class QSpellcheckerDialog : public QSpellcheckerDialogBase { @@ -39,4 +41,7 @@ private: QSpellchecker * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QSPELLCHECKERDIALOG_H diff --git a/src/frontends/qt2/QTabular.C b/src/frontends/qt2/QTabular.C index e0af1dff89..b12715b136 100644 --- a/src/frontends/qt2/QTabular.C +++ b/src/frontends/qt2/QTabular.C @@ -30,6 +30,8 @@ using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -361,3 +363,6 @@ void QTabular::closeGUI() controller().set(LyXTabular::SET_PWIDTH, width); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTabular.h b/src/frontends/qt2/QTabular.h index ced67eedc1..6780422fe0 100644 --- a/src/frontends/qt2/QTabular.h +++ b/src/frontends/qt2/QTabular.h @@ -15,9 +15,10 @@ #ifndef QTABULAR_H #define QTABULAR_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlTabular; class QTabularDialog; @@ -47,4 +48,7 @@ private: virtual void closeGUI(); }; +} // namespace frontend +} // namespace lyx + #endif // QTABULAR_H diff --git a/src/frontends/qt2/QTabularCreate.C b/src/frontends/qt2/QTabularCreate.C index 5b4aab3074..843766768d 100644 --- a/src/frontends/qt2/QTabularCreate.C +++ b/src/frontends/qt2/QTabularCreate.C @@ -19,6 +19,9 @@ #include #include +namespace lyx { +namespace frontend { + typedef QController > base_class; @@ -42,3 +45,6 @@ void QTabularCreate::apply() controller().params().first = dialog_->rowsSB->value(); controller().params().second = dialog_->columnsSB->value(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTabularCreate.h b/src/frontends/qt2/QTabularCreate.h index 8a79afbee8..8039bf9bd7 100644 --- a/src/frontends/qt2/QTabularCreate.h +++ b/src/frontends/qt2/QTabularCreate.h @@ -12,14 +12,14 @@ #ifndef QTABULARCREATE_H #define QTABULARCREATE_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlTabularCreate; class QTabularCreateDialog; - /// class QTabularCreate : public QController > @@ -38,4 +38,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QTABULARCREATE_H diff --git a/src/frontends/qt2/QTabularCreateDialog.C b/src/frontends/qt2/QTabularCreateDialog.C index 99a19d3bce..ef862dc6e5 100644 --- a/src/frontends/qt2/QTabularCreateDialog.C +++ b/src/frontends/qt2/QTabularCreateDialog.C @@ -11,9 +11,6 @@ #include - - - #include "QTabularCreate.h" #include "QTabularCreateDialog.h" @@ -21,6 +18,8 @@ #include #include "emptytable.h" +namespace lyx { +namespace frontend { QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form) : QTabularCreateDialogBase(0, 0, false, 0), @@ -47,3 +46,6 @@ void QTabularCreateDialog::rowsChanged(int) { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTabularCreateDialog.h b/src/frontends/qt2/QTabularCreateDialog.h index 6dd8704542..39e7478dba 100644 --- a/src/frontends/qt2/QTabularCreateDialog.h +++ b/src/frontends/qt2/QTabularCreateDialog.h @@ -13,9 +13,11 @@ #ifndef QTABULARCREATEDIALOG_H #define QTABULARCREATEDIALOG_H - #include "ui/QTabularCreateDialogBase.h" +namespace lyx { +namespace frontend { + class QTabularCreate; class QTabularCreateDialog : public QTabularCreateDialogBase { @@ -29,4 +31,7 @@ private: QTabularCreate * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTABULARCREATEDIALOG_H diff --git a/src/frontends/qt2/QTabularDialog.C b/src/frontends/qt2/QTabularDialog.C index 9d7bc25803..eebdfdc601 100644 --- a/src/frontends/qt2/QTabularDialog.C +++ b/src/frontends/qt2/QTabularDialog.C @@ -25,6 +25,9 @@ using std::string; +namespace lyx { +namespace frontend { + QTabularDialog::QTabularDialog(QTabular * form) : QTabularDialogBase(0, 0, false, 0), @@ -342,3 +345,6 @@ void QTabularDialog::ltLastFooterEmpty_clicked() lastfooterBorderBelowCB->setEnabled(!enable); form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTabularDialog.h b/src/frontends/qt2/QTabularDialog.h index f24ae522c5..ede823f2fb 100644 --- a/src/frontends/qt2/QTabularDialog.h +++ b/src/frontends/qt2/QTabularDialog.h @@ -14,9 +14,11 @@ #ifndef QTABULARDIALOG_H #define QTABULARDIALOG_H - #include "ui/QTabularDialogBase.h" +namespace lyx { +namespace frontend { + class QTabular; class QTabularDialog : public QTabularDialogBase { @@ -65,4 +67,7 @@ private: QTabular * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTABULARDIALOG_H diff --git a/src/frontends/qt2/QTexinfo.C b/src/frontends/qt2/QTexinfo.C index 43b2706a37..3507585357 100644 --- a/src/frontends/qt2/QTexinfo.C +++ b/src/frontends/qt2/QTexinfo.C @@ -26,6 +26,8 @@ using lyx::support::OnlyFilename; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -69,3 +71,6 @@ void QTexinfo::updateStyles() { updateStyles(activeStyle); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTexinfo.h b/src/frontends/qt2/QTexinfo.h index 2b2aff8b70..93f6be6054 100644 --- a/src/frontends/qt2/QTexinfo.h +++ b/src/frontends/qt2/QTexinfo.h @@ -12,13 +12,15 @@ #ifndef QTEXINFO_H #define QTEXINFO_H - #include "QDialogView.h" #include "ControlTexinfo.h" #include #include +namespace lyx { +namespace frontend { + class QTexinfoDialog; /// @@ -49,4 +51,7 @@ private: std::map texdata_; }; +} // namespace frontend +} // namespace lyx + #endif // QTEXINFO_H diff --git a/src/frontends/qt2/QTexinfoDialog.C b/src/frontends/qt2/QTexinfoDialog.C index d2883b6e90..34da483d06 100644 --- a/src/frontends/qt2/QTexinfoDialog.C +++ b/src/frontends/qt2/QTexinfoDialog.C @@ -10,8 +10,6 @@ #include - - #include "QTexinfoDialog.h" #include "QTexinfo.h" @@ -22,6 +20,9 @@ using std::vector; using std::string; +namespace lyx { +namespace frontend { + QTexinfoDialog::QTexinfoDialog(QTexinfo * form) : QTexinfoDialogBase(0, 0, false, 0), @@ -86,3 +87,6 @@ void QTexinfoDialog::enableViewPB() { viewPB->setEnabled(fileList->currentItem() > -1); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTexinfoDialog.h b/src/frontends/qt2/QTexinfoDialog.h index 37c689909a..debb95b806 100644 --- a/src/frontends/qt2/QTexinfoDialog.h +++ b/src/frontends/qt2/QTexinfoDialog.h @@ -12,9 +12,11 @@ #ifndef QTEXINFODIALOG_H #define QTEXINFODIALOG_H - #include "ui/QTexinfoDialogBase.h" +namespace lyx { +namespace frontend { + class QTexinfo; class QTexinfoDialog : public QTexinfoDialogBase { @@ -33,4 +35,7 @@ private: QTexinfo * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTEXINFODIALOG_H diff --git a/src/frontends/qt2/QThesaurus.C b/src/frontends/qt2/QThesaurus.C index 09f344d8ad..ed5b191c15 100644 --- a/src/frontends/qt2/QThesaurus.C +++ b/src/frontends/qt2/QThesaurus.C @@ -20,8 +20,10 @@ #include #include -typedef QController > base_class; +namespace lyx { +namespace frontend { +typedef QController > base_class; QThesaurus::QThesaurus(Dialog & parent) : base_class(parent, _("LyX: Thesaurus")) @@ -52,3 +54,6 @@ void QThesaurus::replace() { controller().replace(fromqstr(dialog_->replaceED->text())); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QThesaurus.h b/src/frontends/qt2/QThesaurus.h index 5b38231934..0e5bd43992 100644 --- a/src/frontends/qt2/QThesaurus.h +++ b/src/frontends/qt2/QThesaurus.h @@ -12,9 +12,10 @@ #ifndef QTHESAURUS_H #define QTHESAURUS_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlThesaurus; class QThesaurusDialog; @@ -40,4 +41,7 @@ private: void replace(); }; +} // namespace frontend +} // namespace lyx + #endif // QTHESAURUS_H diff --git a/src/frontends/qt2/QThesaurusDialog.C b/src/frontends/qt2/QThesaurusDialog.C index df64d0adcd..db7a85215c 100644 --- a/src/frontends/qt2/QThesaurusDialog.C +++ b/src/frontends/qt2/QThesaurusDialog.C @@ -10,8 +10,6 @@ #include - - #include "ControlThesaurus.h" #include "QThesaurusDialog.h" #include "QThesaurus.h" @@ -23,6 +21,8 @@ using std::string; +namespace lyx { +namespace frontend { QThesaurusDialog::QThesaurusDialog(QThesaurus * form) @@ -110,3 +110,6 @@ void QThesaurusDialog::updateLists() meaningsLV->setUpdatesEnabled(true); meaningsLV->update(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QThesaurusDialog.h b/src/frontends/qt2/QThesaurusDialog.h index 15b7eca6e9..9324676233 100644 --- a/src/frontends/qt2/QThesaurusDialog.h +++ b/src/frontends/qt2/QThesaurusDialog.h @@ -12,12 +12,15 @@ #ifndef QTHESAURUSDIALOG_H #define QTHESAURUSDIALOG_H - #include "ui/QThesaurusDialogBase.h" -class QThesaurus; class QListViewItem; +namespace lyx { +namespace frontend { + +class QThesaurus; + class QThesaurusDialog : public QThesaurusDialogBase { Q_OBJECT public: @@ -36,4 +39,7 @@ private: QThesaurus * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTHESAURUSDIALOG_H diff --git a/src/frontends/qt2/QToc.C b/src/frontends/qt2/QToc.C index ea098ee3c5..88e51740db 100644 --- a/src/frontends/qt2/QToc.C +++ b/src/frontends/qt2/QToc.C @@ -31,6 +31,8 @@ using std::stack; using std::vector; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -53,7 +55,7 @@ void QToc::updateType() dialog_->typeCO->clear(); vector const & choice = controller().getTypes(); - string const & type = lyx::toc::getType(controller().params().getCmdName()); + string const & type = toc::getType(controller().params().getCmdName()); for (vector::const_iterator it = choice.begin(); it != choice.end(); ++it) { @@ -77,7 +79,7 @@ void QToc::updateToc(int newdepth) { string type = fromqstr(dialog_->typeCO->currentText()); - lyx::toc::Toc const & contents = controller().getContents(type); + toc::Toc const & contents = controller().getContents(type); // Check if all elements are the same. if (newdepth == depth_ && toclist == contents) { @@ -105,7 +107,7 @@ void QToc::updateToc(int newdepth) // a QListView parent, rather than QListViewItem; and the // TOC can move in and out an arbitrary number of levels - for (lyx::toc::Toc::const_iterator iter = toclist.begin(); + for (toc::Toc::const_iterator iter = toclist.begin(); iter != toclist.end(); ++iter) { if (iter->depth == curdepth) { // insert it after the last one we processed @@ -159,7 +161,7 @@ void QToc::updateToc(int newdepth) void QToc::select(string const & text) { - lyx::toc::Toc::const_iterator iter = toclist.begin(); + toc::Toc::const_iterator iter = toclist.begin(); for (; iter != toclist.end(); ++iter) { if (iter->str == text) @@ -181,3 +183,6 @@ void QToc::set_depth(int depth) if (depth != depth_) updateToc(depth); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QToc.h b/src/frontends/qt2/QToc.h index db42391a21..09c6b69a25 100644 --- a/src/frontends/qt2/QToc.h +++ b/src/frontends/qt2/QToc.h @@ -13,10 +13,12 @@ #ifndef QTOC_H #define QTOC_H - #include "QDialogView.h" #include "toc.h" +namespace lyx { +namespace frontend { + class ControlToc; class QTocDialog; @@ -55,4 +57,7 @@ private: int depth_; }; +} // namespace frontend +} // namespace lyx + #endif // QTOC_H diff --git a/src/frontends/qt2/QTocDialog.C b/src/frontends/qt2/QTocDialog.C index 3831cd6d7a..a873d217e8 100644 --- a/src/frontends/qt2/QTocDialog.C +++ b/src/frontends/qt2/QTocDialog.C @@ -18,6 +18,8 @@ #include #include +namespace lyx { +namespace frontend { QTocDialog::QTocDialog(QToc * form) : QTocDialogBase(0, 0, false, 0), @@ -70,3 +72,6 @@ void QTocDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QTocDialog.h b/src/frontends/qt2/QTocDialog.h index af15fcea97..d028d8131c 100644 --- a/src/frontends/qt2/QTocDialog.h +++ b/src/frontends/qt2/QTocDialog.h @@ -12,9 +12,11 @@ #ifndef QTOCDIALOG_H #define QTOCDIALOG_H - #include "ui/QTocDialogBase.h" +namespace lyx { +namespace frontend { + class QToc; class QTocDialog : public QTocDialogBase { @@ -33,4 +35,7 @@ private: QToc * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QTOCDIALOG_H diff --git a/src/frontends/qt2/QURL.C b/src/frontends/qt2/QURL.C index 1beb2f3a00..48470c9556 100644 --- a/src/frontends/qt2/QURL.C +++ b/src/frontends/qt2/QURL.C @@ -25,6 +25,9 @@ using std::string; +namespace lyx { +namespace frontend { + typedef QController > base_class; QURL::QURL(Dialog & parent) @@ -78,3 +81,6 @@ bool QURL::isValid() return !u.empty() || !n.empty(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QURL.h b/src/frontends/qt2/QURL.h index 4e22838230..904862f4d5 100644 --- a/src/frontends/qt2/QURL.h +++ b/src/frontends/qt2/QURL.h @@ -12,13 +12,14 @@ #ifndef QURL_H #define QURL_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; class QURLDialog; - class QURL : public QController > { @@ -36,4 +37,7 @@ private: virtual void update_contents(); }; +} // namespace frontend +} // namespace lyx + #endif // QURL_H diff --git a/src/frontends/qt2/QURLDialog.C b/src/frontends/qt2/QURLDialog.C index e5a67f6bc5..08ae4bb064 100644 --- a/src/frontends/qt2/QURLDialog.C +++ b/src/frontends/qt2/QURLDialog.C @@ -10,13 +10,14 @@ #include - #include "QURL.h" #include "QURLDialog.h" #include #include +namespace lyx { +namespace frontend { QURLDialog::QURLDialog(QURL * form) : QURLDialogBase(0, 0, false, 0), @@ -52,3 +53,6 @@ void QURLDialog::closeEvent(QCloseEvent * e) form_->slotWMHide(); e->accept(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QURLDialog.h b/src/frontends/qt2/QURLDialog.h index 712603ae1c..b94e389ac0 100644 --- a/src/frontends/qt2/QURLDialog.h +++ b/src/frontends/qt2/QURLDialog.h @@ -12,9 +12,11 @@ #ifndef QURLDIALOG_H #define QURLDIALOG_H - #include "ui/QURLDialogBase.h" +namespace lyx { +namespace frontend { + class QURL; class QURLDialog : public QURLDialogBase { @@ -32,4 +34,7 @@ private: QURL * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QURLDIALOG_H diff --git a/src/frontends/qt2/QVSpace.C b/src/frontends/qt2/QVSpace.C index 76b3888292..e3cc6be868 100644 --- a/src/frontends/qt2/QVSpace.C +++ b/src/frontends/qt2/QVSpace.C @@ -39,6 +39,8 @@ using std::string; +namespace lyx { +namespace frontend { namespace { @@ -179,3 +181,6 @@ void QVSpace::update_contents() dialog_->unitCO, dialog_->keepCB); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QVSpace.h b/src/frontends/qt2/QVSpace.h index f35ad6e668..9422f723c3 100644 --- a/src/frontends/qt2/QVSpace.h +++ b/src/frontends/qt2/QVSpace.h @@ -18,6 +18,9 @@ #include +namespace lyx { +namespace frontend { + class ControlVSpace; class QVSpaceDialog; @@ -40,4 +43,7 @@ private: virtual void update_contents(); }; +} // namespace frontend +} // namespace lyx + #endif //QVSPACE_H diff --git a/src/frontends/qt2/QVSpaceDialog.C b/src/frontends/qt2/QVSpaceDialog.C index 521a206136..6dfe544a18 100644 --- a/src/frontends/qt2/QVSpaceDialog.C +++ b/src/frontends/qt2/QVSpaceDialog.C @@ -23,6 +23,8 @@ #include "qt_helpers.h" +namespace lyx { +namespace frontend { QVSpaceDialog::QVSpaceDialog(QVSpace * form) : QVSpaceDialogBase(0, 0, false, 0), @@ -56,3 +58,6 @@ void QVSpaceDialog::enableCustom(int) valueLE->setEnabled(enable); unitCO->setEnabled(enable); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QVSpaceDialog.h b/src/frontends/qt2/QVSpaceDialog.h index a69498daec..d449274dc2 100644 --- a/src/frontends/qt2/QVSpaceDialog.h +++ b/src/frontends/qt2/QVSpaceDialog.h @@ -13,9 +13,11 @@ #ifndef QVSPACEDIALOG_H #define QVSPACEDIALOG_H - #include "ui/QVSpaceDialogBase.h" +namespace lyx { +namespace frontend { + class QVSpace; class QVSpaceDialog : public QVSpaceDialogBase { @@ -35,4 +37,7 @@ private: QVSpace * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QVSPACEDIALOG_H diff --git a/src/frontends/qt2/QWrap.C b/src/frontends/qt2/QWrap.C index 6a92bee025..e501b4609e 100644 --- a/src/frontends/qt2/QWrap.C +++ b/src/frontends/qt2/QWrap.C @@ -30,6 +30,8 @@ using lyx::support::strToDbl; using std::string; +namespace lyx { +namespace frontend { typedef QController > base_class; @@ -112,3 +114,6 @@ void QWrap::update_contents() dialog_->valignCO->setCurrentItem(item); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QWrap.h b/src/frontends/qt2/QWrap.h index e9e1145997..575777cce7 100644 --- a/src/frontends/qt2/QWrap.h +++ b/src/frontends/qt2/QWrap.h @@ -12,9 +12,10 @@ #ifndef QWRAP_H #define QWRAP_H - #include "QDialogView.h" +namespace lyx { +namespace frontend { class ControlWrap; class QWrapDialog; @@ -34,4 +35,7 @@ private: virtual void build_dialog(); }; +} // namespace frontend +} // namespace lyx + #endif // QWRAP_H diff --git a/src/frontends/qt2/QWrapDialog.C b/src/frontends/qt2/QWrapDialog.C index d252d99406..7ea2817c23 100644 --- a/src/frontends/qt2/QWrapDialog.C +++ b/src/frontends/qt2/QWrapDialog.C @@ -10,13 +10,13 @@ #include - - #include "QWrap.h" #include "QWrapDialog.h" #include +namespace lyx { +namespace frontend { QWrapDialog::QWrapDialog(QWrap * form) @@ -45,3 +45,6 @@ void QWrapDialog::change_adaptor() { form_->changed(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QWrapDialog.h b/src/frontends/qt2/QWrapDialog.h index 88a92850a3..5775231527 100644 --- a/src/frontends/qt2/QWrapDialog.h +++ b/src/frontends/qt2/QWrapDialog.h @@ -12,9 +12,11 @@ #ifndef QWRAPDIALOG_H #define QWRAPDIALOG_H - #include "ui/QWrapDialogBase.h" +namespace lyx { +namespace frontend { + class QWrap; class QWrapDialog : public QWrapDialogBase { @@ -29,4 +31,7 @@ private: QWrap * form_; }; +} // namespace frontend +} // namespace lyx + #endif // QWRAPDIALOG_H diff --git a/src/frontends/qt2/Qt2BC.C b/src/frontends/qt2/Qt2BC.C index 982d5857b1..3902338784 100644 --- a/src/frontends/qt2/Qt2BC.C +++ b/src/frontends/qt2/Qt2BC.C @@ -19,6 +19,8 @@ using std::string; +namespace lyx { +namespace frontend { Qt2BC::Qt2BC(ButtonController const & parent, string const & cancel, string const & close) @@ -52,3 +54,6 @@ void Qt2BC::setButtonLabel(QButton * obj, string const & label) const { obj->setText(toqstr(label)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/Qt2BC.h b/src/frontends/qt2/Qt2BC.h index 6da14301bf..c28e08d2bd 100644 --- a/src/frontends/qt2/Qt2BC.h +++ b/src/frontends/qt2/Qt2BC.h @@ -14,13 +14,15 @@ #ifndef QT2BC_H #define QT2BC_H - #include "BCView.h" #include "gettext.h" class QWidget; class QButton; +namespace lyx { +namespace frontend { + /** General purpose button controller for up to four buttons. Controls the activation of the OK, Apply and Cancel buttons. Actually supports 4 buttons in all and it's up to the user to decide on @@ -43,4 +45,7 @@ private: void setButtonLabel(QButton *, std::string const & label) const; }; +} // namespace frontend +} // namespace lyx + #endif // QT2BC_H diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index 1d9b874556..eefdfaf5de 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -32,10 +32,15 @@ #include #include -using lyx::support::LibFileSearch; - using std::string; +qfont_loader fontloader; + +namespace lyx { + +using support::LibFileSearch; + +namespace frontend { namespace { @@ -43,7 +48,6 @@ int const statusbar_timer_value = 3000; } // namespace anon -qfont_loader fontloader; QtView::QtView(unsigned int width, unsigned int height) @@ -160,3 +164,6 @@ void QtView::busy(bool yes) const else QApplication::restoreOverrideCursor(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/QtView.h b/src/frontends/qt2/QtView.h index f55a42267f..bc723131d3 100644 --- a/src/frontends/qt2/QtView.h +++ b/src/frontends/qt2/QtView.h @@ -21,9 +21,13 @@ #include #include -class QCommandBuffer; class FuncRequest; +namespace lyx { +namespace frontend { + +class QCommandBuffer; + /** * QtView - Qt implementation of LyXView * @@ -81,4 +85,7 @@ private: QCommandBuffer * commandbuffer_; }; +} // namespace frontend +} // namespace lyx + #endif // QTVIEW_H diff --git a/src/frontends/qt2/checkedwidgets.C b/src/frontends/qt2/checkedwidgets.C index e6bf240e63..ea552d3e89 100644 --- a/src/frontends/qt2/checkedwidgets.C +++ b/src/frontends/qt2/checkedwidgets.C @@ -16,6 +16,8 @@ #include #include +namespace lyx { +namespace frontend { void addCheckedLineEdit(BCView & bcview, QLineEdit * input, QLabel * label) @@ -78,3 +80,6 @@ bool CheckedLineEdit::check() const return valid; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/qt2/checkedwidgets.h b/src/frontends/qt2/checkedwidgets.h index fde0e6301b..8e0814a4ce 100644 --- a/src/frontends/qt2/checkedwidgets.h +++ b/src/frontends/qt2/checkedwidgets.h @@ -12,12 +12,13 @@ #ifndef CHECKEDWIDGETS_H #define CHECKEDWIDGETS_H - #include "BCView.h" class QLabel; class QLineEdit; +namespace lyx { +namespace frontend { void addCheckedLineEdit(BCView & bcview, QLineEdit * input, QLabel * label = 0); @@ -35,4 +36,7 @@ private: QLabel * label_; }; +} // namespace frontend +} // namespace lyx + #endif // CHECKEDWIDGETS_H diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index f05705c795..dbfbd64e79 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -52,6 +52,8 @@ using lyx::support::ltrim; +using lyx::frontend::QtView; + namespace os = lyx::support::os; #ifndef CXX_GLOBAL_CSTD diff --git a/src/frontends/xforms/Alert_pimpl.C b/src/frontends/xforms/Alert_pimpl.C index 02c62f84ec..8fbad0ac1f 100644 --- a/src/frontends/xforms/Alert_pimpl.C +++ b/src/frontends/xforms/Alert_pimpl.C @@ -22,6 +22,9 @@ #include "lyx_forms.h" +using lyx::frontend::formatted; +using lyx::frontend::idex; +using lyx::frontend::parse_shortcut; using std::make_pair; using std::pair; diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index df23702bc7..1d8612ce46 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2004-05-19 Angus Leeming + + * Most files: wrap code up inside namespace lyx::frontend. + 2004-05-14 Angus Leeming * FormCitation.C: small changes due to the changes in biblio.h. diff --git a/src/frontends/xforms/Color.C b/src/frontends/xforms/Color.C index fdb6ed963b..7c683b9b36 100644 --- a/src/frontends/xforms/Color.C +++ b/src/frontends/xforms/Color.C @@ -21,7 +21,6 @@ #include #include - #ifndef CXX_GLOBAL_CSTD using std::floor; #endif @@ -34,6 +33,8 @@ using std::istringstream; using std::ostringstream; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -198,3 +199,6 @@ HSVColor::HSVColor(RGBColor const & rgb) h += 360; } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/Color.h b/src/frontends/xforms/Color.h index a297ae0765..498f3e9e9b 100644 --- a/src/frontends/xforms/Color.h +++ b/src/frontends/xforms/Color.h @@ -18,9 +18,10 @@ #include - class LColor_color; +namespace lyx { +namespace frontend { /** Given col, fills r, g, b in the range 0-255. The function returns true if successful. @@ -77,4 +78,7 @@ bool operator!=(RGBColor const & c1, RGBColor const & c2) return !(c1 == c2); } +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/ColorHandler.C b/src/frontends/xforms/ColorHandler.C index ac4da0db50..e4309fe78c 100644 --- a/src/frontends/xforms/ColorHandler.C +++ b/src/frontends/xforms/ColorHandler.C @@ -25,8 +25,6 @@ #include -using lyx::support::bformat; - #ifndef CXX_GLOBAL_CSTD using std::pow; #endif @@ -34,17 +32,27 @@ using std::pow; using std::endl; using std::string; +namespace lyx { +namespace support { namespace { string tostr(XColor const & col) { return bformat("(%1$s,%2$s,%3$s)", - ::tostr(col.red), ::tostr(col.green), ::tostr(col.blue)); + ::tostr(col.red), + ::tostr(col.green), + ::tostr(col.blue)); } -} +} // namespace +} // namespace support +using support::bformat; +using support::tostr; + + +namespace frontend { LyXColorHandler::LyXColorHandler() : colorGCcache(LColor::ignore + 1) @@ -153,7 +161,7 @@ GC LyXColorHandler::getGCForeground(string const & s) lyxerr << bformat( _(" Using closest allocated color with (r,g,b)=%1$s instead.\n" "Pixel [%2$s] is used."), - tostr(cmap[closest_pixel]), tostr(closest_pixel)) << endl; + tostr(cmap[closest_pixel]), ::tostr(closest_pixel)) << endl; val.foreground = cmap[closest_pixel].pixel; } @@ -264,3 +272,6 @@ void LyXColorHandler::updateColor (LColor_color c) // boost::scoped_ptr lyxColorHandler; + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/ColorHandler.h b/src/frontends/xforms/ColorHandler.h index 594d33d47c..d4086ae9a6 100644 --- a/src/frontends/xforms/ColorHandler.h +++ b/src/frontends/xforms/ColorHandler.h @@ -12,7 +12,6 @@ #ifndef COLOR_HANDLER_H #define COLOR_HANDLER_H - #include "frontends/Painter.h" #include @@ -25,6 +24,9 @@ class LColor_color; class LyXFont; +namespace lyx { +namespace frontend { + /** * This is a factory class that can produce GCs with a specific * color. It will cache GCs for performance. @@ -65,4 +67,7 @@ private: /// extern boost::scoped_ptr lyxColorHandler; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index c8898920d7..2a5d851adb 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -113,6 +113,7 @@ using std::string; +using namespace lyx::frontend; namespace { diff --git a/src/frontends/xforms/FontInfo.C b/src/frontends/xforms/FontInfo.C index d21f42df7c..13a7d5ab0e 100644 --- a/src/frontends/xforms/FontInfo.C +++ b/src/frontends/xforms/FontInfo.C @@ -26,13 +26,16 @@ #include -using lyx::support::atoi; -using lyx::support::token; - using std::abs; using std::endl; using std::string; +namespace lyx { + +using support::atoi; +using support::token; + +namespace frontend { /// Load font close to this size string const FontInfo::getFontname(int size) @@ -166,3 +169,6 @@ void FontInfo::init() scalable = false; scaleindex = -1; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FontInfo.h b/src/frontends/xforms/FontInfo.h index 47bc0776ed..89703e76c4 100644 --- a/src/frontends/xforms/FontInfo.h +++ b/src/frontends/xforms/FontInfo.h @@ -17,6 +17,9 @@ #include +namespace lyx { +namespace frontend { + /** This class manages a font. The idea is to create a FontInfo object with a font name pattern with a wildcard at the size field. Then this object can host request for font- @@ -87,4 +90,7 @@ private: std::string const resize(std::string const &, int size) const; }; +} // namespace frontend +} // namespace lyx + #endif // FONTINFO_H diff --git a/src/frontends/xforms/FormAboutlyx.C b/src/frontends/xforms/FormAboutlyx.C index 963a5db4a2..66858aefe2 100644 --- a/src/frontends/xforms/FormAboutlyx.C +++ b/src/frontends/xforms/FormAboutlyx.C @@ -25,6 +25,8 @@ using std::ostringstream; +namespace lyx { +namespace frontend { namespace { @@ -91,3 +93,6 @@ void FormAboutlyx::build() // Manage the cancel/close button bcview().setCancel(dialog_->button_close); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormAboutlyx.h b/src/frontends/xforms/FormAboutlyx.h index 91a0e19712..fc4b7b9c27 100644 --- a/src/frontends/xforms/FormAboutlyx.h +++ b/src/frontends/xforms/FormAboutlyx.h @@ -13,9 +13,10 @@ #ifndef FORMABOUTLYX_H #define FORMABOUTLYX_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlAboutlyx; struct FD_aboutlyx; @@ -47,5 +48,7 @@ private: boost::scoped_ptr license_; }; +} // namespace frontend +} // namespace lyx #endif // FORMABOUTLYX_H diff --git a/src/frontends/xforms/FormBibitem.C b/src/frontends/xforms/FormBibitem.C index 2544235c7c..ef32104db2 100644 --- a/src/frontends/xforms/FormBibitem.C +++ b/src/frontends/xforms/FormBibitem.C @@ -22,11 +22,16 @@ #include "lyx_forms.h" -using lyx::support::compare; - using std::string; +namespace lyx { + +using support::compare; + +namespace frontend { + + typedef FormController > base_class; FormBibitem::FormBibitem(Dialog & parent) @@ -83,3 +88,6 @@ void FormBibitem::apply() controller().params().setContents(fl_get_input(dialog_->input_key)); controller().params().setOptions(fl_get_input(dialog_->input_label)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormBibitem.h b/src/frontends/xforms/FormBibitem.h index bfcb7f8705..1b5ae47450 100644 --- a/src/frontends/xforms/FormBibitem.h +++ b/src/frontends/xforms/FormBibitem.h @@ -13,9 +13,11 @@ #ifndef FORMBIBITEM_H #define FORMBIBITEM_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; struct FD_bibitem; @@ -37,4 +39,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORMBIBITEM_H diff --git a/src/frontends/xforms/FormBibtex.C b/src/frontends/xforms/FormBibtex.C index 4a8a0c1bcc..cfcb93ae93 100644 --- a/src/frontends/xforms/FormBibtex.C +++ b/src/frontends/xforms/FormBibtex.C @@ -28,19 +28,23 @@ #include "lyx_forms.h" -using lyx::support::ChangeExtension; -using lyx::support::compare; -using lyx::support::contains; -using lyx::support::FileFilterList; -using lyx::support::getStringFromVector; -using lyx::support::getVectorFromString; -using lyx::support::OnlyFilename; -using lyx::support::prefixIs; -using lyx::support::split; - using std::vector; using std::string; +namespace lyx { + +using support::ChangeExtension; +using support::compare; +using support::contains; +using support::FileFilterList; +using support::getStringFromVector; +using support::getVectorFromString; +using support::OnlyFilename; +using support::prefixIs; +using support::split; + +namespace frontend { + typedef FormController > base_class; @@ -226,7 +230,7 @@ string const unique_and_no_extensions(string const & str_in) it != dbase.end(); ++it) { *it = ChangeExtension(*it, string()); } - lyx::eliminate_duplicates(dbase); + eliminate_duplicates(dbase); return getStringFromVector(dbase); } @@ -286,4 +290,8 @@ void FormBibtex::apply() else controller().params().setSecOptions(""); + } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormBibtex.h b/src/frontends/xforms/FormBibtex.h index ed050bf1d1..c37bc1dae5 100644 --- a/src/frontends/xforms/FormBibtex.h +++ b/src/frontends/xforms/FormBibtex.h @@ -13,9 +13,11 @@ #ifndef FORMBIBTEX_H #define FORMBIBTEX_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlBibtex; struct FD_bibtex; @@ -37,4 +39,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORMBIBTEX_H diff --git a/src/frontends/xforms/FormBox.C b/src/frontends/xforms/FormBox.C index 3e02a095e9..c74a384a03 100644 --- a/src/frontends/xforms/FormBox.C +++ b/src/frontends/xforms/FormBox.C @@ -30,11 +30,16 @@ #include -using lyx::support::getStringFromVector; -using lyx::support::isStrDbl; -using lyx::support::subst; using std::string; +namespace lyx { + +using support::getStringFromVector; +using support::isStrDbl; +using support::subst; + +namespace frontend { + typedef FormController > base_class; @@ -285,3 +290,6 @@ ButtonPolicy::SMInput FormBox::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormBox.h b/src/frontends/xforms/FormBox.h index 0bdc2180a3..85cef790da 100644 --- a/src/frontends/xforms/FormBox.h +++ b/src/frontends/xforms/FormBox.h @@ -12,9 +12,10 @@ #ifndef FORMBOX_H #define FORMBOX_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlBox; struct FD_box; @@ -52,4 +53,7 @@ private: }; }; +} // namespace frontend +} // namespace lyx + #endif // FORMBOX_H diff --git a/src/frontends/xforms/FormBranch.C b/src/frontends/xforms/FormBranch.C index c2badd04ea..0278bbfc0e 100644 --- a/src/frontends/xforms/FormBranch.C +++ b/src/frontends/xforms/FormBranch.C @@ -25,6 +25,9 @@ using std::string; +namespace lyx { +namespace frontend { + typedef FormController > base_class; @@ -72,3 +75,6 @@ void FormBranch::apply() string const type = fl_get_choice_text(dialog_->choice_branch); controller().params().branch = type; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormBranch.h b/src/frontends/xforms/FormBranch.h index 173f1d6aa6..6773db9825 100644 --- a/src/frontends/xforms/FormBranch.h +++ b/src/frontends/xforms/FormBranch.h @@ -12,9 +12,10 @@ #ifndef FORMBRANCH_H #define FORMBRANCH_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlBranch; struct FD_branch; @@ -34,4 +35,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMBRANCH_H diff --git a/src/frontends/xforms/FormBrowser.C b/src/frontends/xforms/FormBrowser.C index a59746961a..2cdacf7e74 100644 --- a/src/frontends/xforms/FormBrowser.C +++ b/src/frontends/xforms/FormBrowser.C @@ -14,9 +14,10 @@ #include "forms/form_browser.h" #include "xformsBC.h" - using std::string; +namespace lyx { +namespace frontend { FormBrowser::FormBrowser(Dialog & parent, string const & title, bool allowResize) @@ -31,3 +32,6 @@ void FormBrowser::build() // Manage the close button bcview().setCancel(dialog_->button_close); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormBrowser.h b/src/frontends/xforms/FormBrowser.h index 98e37a8871..ebd3f0fa41 100644 --- a/src/frontends/xforms/FormBrowser.h +++ b/src/frontends/xforms/FormBrowser.h @@ -13,14 +13,17 @@ #ifndef FORMBROWSER_H #define FORMBROWSER_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + +struct FD_browser; + /** * This class provides an XForms implementation of a read only * text browser. */ -struct FD_browser; class FormBrowser : public FormView { public: @@ -31,4 +34,7 @@ private: virtual void build(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMBROWSER_H diff --git a/src/frontends/xforms/FormChanges.C b/src/frontends/xforms/FormChanges.C index 4e086062c0..284ed5e717 100644 --- a/src/frontends/xforms/FormChanges.C +++ b/src/frontends/xforms/FormChanges.C @@ -19,10 +19,13 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { + + typedef FormController > base_class; FormChanges::FormChanges(Dialog & parent) @@ -76,3 +79,6 @@ ButtonPolicy::SMInput FormChanges::input(FL_OBJECT * obj, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormChanges.h b/src/frontends/xforms/FormChanges.h index 8f55bf440d..54e184d209 100644 --- a/src/frontends/xforms/FormChanges.h +++ b/src/frontends/xforms/FormChanges.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlChanges; struct FD_changes; @@ -37,4 +40,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORMCHANGES_H diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index 6862885685..ac126ba2f5 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -27,26 +27,15 @@ #include "lyx_forms.h" #include "combox.h" -using frnt::BarPair; -using frnt::ColorPair; -using frnt::FamilyPair; -using frnt::getBarData; -using frnt::getColorData; -using frnt::getFamilyData; -using frnt::getLanguageData; -using frnt::getSeriesData; -using frnt::getShapeData; -using frnt::getSizeData; -using frnt::LanguagePair; -using frnt::SeriesPair; -using frnt::ShapePair; -using frnt::SizePair; - -using lyx::support::getStringFromVector; - using std::vector; using std::string; +namespace lyx { + +using support::getStringFromVector; + +namespace frontend { + typedef FormController > base_class; @@ -185,7 +174,7 @@ ButtonPolicy::SMInput FormCharacter::input(FL_OBJECT *, long) activate = ButtonPolicy::SMI_VALID; pos = fl_get_choice(dialog_->choice_bar); - if (bar_[pos - 1] != frnt::IGNORE) + if (bar_[pos - 1] != IGNORE) activate = ButtonPolicy::SMI_VALID; pos = fl_get_choice(dialog_->choice_color); @@ -198,3 +187,6 @@ ButtonPolicy::SMInput FormCharacter::input(FL_OBJECT *, long) return activate; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h index 080b61dc39..328cc65abd 100644 --- a/src/frontends/xforms/FormCharacter.h +++ b/src/frontends/xforms/FormCharacter.h @@ -17,6 +17,10 @@ #include "ControlCharacter.h" // for ControlCharacter enum struct LColor_color; + +namespace lyx { +namespace frontend { + struct FD_character; /** @@ -44,19 +48,22 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); /// - std::vector family_; + std::vector family_; /// - std::vector series_; + std::vector series_; /// - std::vector shape_; + std::vector shape_; /// - std::vector size_; + std::vector size_; /// - std::vector bar_; + std::vector bar_; /// - std::vector color_; + std::vector color_; /// - std::vector lang_; + std::vector lang_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index f0dc375f0c..f6891d43f8 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -25,10 +25,6 @@ #include "lyx_forms.h" -using lyx::support::getStringFromVector; -using lyx::support::getVectorFromString; -using lyx::support::trim; - using std::find; using std::max; @@ -36,6 +32,14 @@ using std::vector; using std::string; +namespace lyx { + +using support::getStringFromVector; +using support::getVectorFromString; +using support::trim; + +namespace frontend { + namespace { // shamelessly stolen from Menubar_pimpl.C @@ -522,3 +526,6 @@ void FormCitation::setCiteButtons(State status) const setEnabled(dialog_->button_up, activate_up); setEnabled(dialog_->button_down, activate_down); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormCitation.h b/src/frontends/xforms/FormCitation.h index 12258b000c..382c9fd58a 100644 --- a/src/frontends/xforms/FormCitation.h +++ b/src/frontends/xforms/FormCitation.h @@ -12,15 +12,17 @@ #ifndef FORMCITATION_H #define FORMCITATION_H - #include "FormDialogView.h" #include "biblio.h" -/** This class provides an XForms implementation of the Citation Dialog. - */ +namespace lyx { +namespace frontend { + class ControlCitation; struct FD_citation; +/** This class provides an XForms implementation of the Citation Dialog. + */ class FormCitation : public FormController > { public: @@ -62,4 +64,7 @@ private: std::vector bibkeys; }; +} // namespace frontend +} // namespace lyx + #endif // FORMCITATION_H diff --git a/src/frontends/xforms/FormColorpicker.C b/src/frontends/xforms/FormColorpicker.C index 92325a2be6..7a23f9f01a 100644 --- a/src/frontends/xforms/FormColorpicker.C +++ b/src/frontends/xforms/FormColorpicker.C @@ -24,9 +24,10 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { namespace { @@ -284,7 +285,7 @@ void FormColorpicker::prepare_to_show() // assign an icon to the form string const iconname = - lyx::support::LibFileSearch("images", "lyx", "xpm"); + support::LibFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) { unsigned int w, h; @@ -365,3 +366,6 @@ static int C_WMHideCB(FL_FORM * form, void *) } } // extern "C" + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormColorpicker.h b/src/frontends/xforms/FormColorpicker.h index 4b3d7633ef..ab59809887 100644 --- a/src/frontends/xforms/FormColorpicker.h +++ b/src/frontends/xforms/FormColorpicker.h @@ -18,15 +18,15 @@ #include #include // for Pixmap +namespace lyx { +namespace frontend { -class Tooltips; class FD_colorpicker; class FD_colorpicker_rgb; class FD_colorpicker_hsv; +class Tooltips; - -class FormColorpicker -{ +class FormColorpicker { public: FormColorpicker(); ~FormColorpicker(); @@ -85,4 +85,7 @@ private: boost::scoped_ptr hsv_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMCOLORPICKER_H diff --git a/src/frontends/xforms/FormDialogView.C b/src/frontends/xforms/FormDialogView.C index 51dcee93fb..5e742bdaa5 100644 --- a/src/frontends/xforms/FormDialogView.C +++ b/src/frontends/xforms/FormDialogView.C @@ -26,11 +26,14 @@ #include "lyx_forms.h" -using lyx::support::bformat; -using lyx::support::LibFileSearch; - using std::string; +namespace lyx { + +using support::bformat; +using support::LibFileSearch; + +namespace frontend { extern "C" { @@ -413,3 +416,6 @@ static int C_PrehandlerCB(FL_OBJECT * ob, int event, } } // extern "C" + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormDialogView.h b/src/frontends/xforms/FormDialogView.h index 945cd746a5..21966777ac 100644 --- a/src/frontends/xforms/FormDialogView.h +++ b/src/frontends/xforms/FormDialogView.h @@ -22,9 +22,11 @@ #include // for Pixmap -class xformsBC; -class Tooltips; +namespace lyx { +namespace frontend { +class Tooltips; +class xformsBC; /** This class is an XForms GUI base class. */ @@ -190,5 +192,7 @@ Controller const & FormController::controller() const return static_cast(this->getController()); } +} // namespace frontend +} // namespace lyx #endif // FORMDIALOGVIEW_H diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index c4b29ab923..feb0711532 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -50,18 +50,21 @@ #include -using lyx::support::bformat; -using lyx::support::contains; -using lyx::support::getStringFromVector; -using lyx::support::getVectorFromString; -using lyx::support::LibFileSearch; - using boost::bind; using std::endl; using std::string; using std::vector; +namespace lyx { + +using support::bformat; +using support::contains; +using support::getStringFromVector; +using support::getVectorFromString; +using support::LibFileSearch; + +namespace frontend { namespace { @@ -285,12 +288,12 @@ void FormDocument::build() "default|auto|latin1|latin2|latin3|latin4|latin5|latin9" "|koi8-r|koi8-u|cp866|cp1251|iso88595|pt154"); - vector const langs = frnt::getLanguageData(false); + vector const langs = getLanguageData(false); // Store the identifiers for later lang_ = getSecond(langs); - vector::const_iterator lit = langs.begin(); - vector::const_iterator lend = langs.end(); + vector::const_iterator lit = langs.begin(); + vector::const_iterator lend = langs.end(); for (; lit != lend; ++lit) { fl_addto_combox(language_->combox_language, lit->first.c_str()); @@ -1524,8 +1527,7 @@ void FormDocument::CheckChoiceClass() { BufferParams & params = controller().params(); - lyx::textclass_type const tc = - fl_get_combox(class_->combox_class) - 1; + textclass_type const tc = fl_get_combox(class_->combox_class) - 1; if (controller().loadTextclass(tc)) { params.textclass = tc; @@ -1558,3 +1560,6 @@ void FormDocument::UpdateLayoutDocument(BufferParams const & params) options_update(params); bullets_update(params); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index 64fcedcbb9..f7488ae220 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -20,12 +20,13 @@ #include "lyx_forms.h" #include -class ControlDocument; - class BufferParams; -class FormColorpicker; +namespace lyx { +namespace frontend { +class ControlDocument; +class FormColorpicker; struct FD_document; struct FD_document_paper; struct FD_document_class; @@ -134,4 +135,7 @@ private: BranchList branchlist_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/FormERT.C b/src/frontends/xforms/FormERT.C index ab2db618d6..7d80b9202b 100644 --- a/src/frontends/xforms/FormERT.C +++ b/src/frontends/xforms/FormERT.C @@ -18,6 +18,8 @@ #include "lyx_forms.h" +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -66,3 +68,6 @@ void FormERT::update() break; } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormERT.h b/src/frontends/xforms/FormERT.h index 8e286b3918..e8af536994 100644 --- a/src/frontends/xforms/FormERT.h +++ b/src/frontends/xforms/FormERT.h @@ -12,9 +12,10 @@ #ifndef FORMERT_H #define FORMERT_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlERT; struct FD_ert; @@ -35,4 +36,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMERT_H diff --git a/src/frontends/xforms/FormErrorList.C b/src/frontends/xforms/FormErrorList.C index 7ba8af2d17..8f446c0fe8 100644 --- a/src/frontends/xforms/FormErrorList.C +++ b/src/frontends/xforms/FormErrorList.C @@ -18,6 +18,8 @@ #include "xforms_helpers.h" #include "lyx_forms.h" +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -96,3 +98,6 @@ void FormErrorList::updateContents() fl_select_browser_line(dialog_->browser_errors, 1); goTo(0); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormErrorList.h b/src/frontends/xforms/FormErrorList.h index a56cee94e3..ee7f9ca4f2 100644 --- a/src/frontends/xforms/FormErrorList.h +++ b/src/frontends/xforms/FormErrorList.h @@ -12,9 +12,11 @@ #ifndef FORMERRORLIST_H #define FORMERRORLIST_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlErrorList; struct FD_errorlist; @@ -39,4 +41,7 @@ private: void updateContents(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMERRORLIST_H diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index e1fcb2a945..b78462e51a 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -37,19 +37,22 @@ namespace external = lyx::external; -using lyx::support::bformat; -using lyx::support::float_equal; -using lyx::support::getStringFromVector; -using lyx::support::isStrDbl; -using lyx::support::strToDbl; -using lyx::support::strToInt; -using lyx::support::token; -using lyx::support::trim; - using std::find; using std::string; using std::vector; +namespace lyx { + +using support::bformat; +using support::float_equal; +using support::getStringFromVector; +using support::isStrDbl; +using support::strToDbl; +using support::strToInt; +using support::token; +using support::trim; + +namespace frontend { namespace { @@ -101,7 +104,7 @@ void setDisplay(FL_OBJECT * displayCB, FL_OBJECT * showCO, FL_OBJECT * scaleED, fl_set_choice(showCO, item); - bool const no_display = display == lyx::external::NoDisplay; + bool const no_display = display == external::NoDisplay; setEnabled(showCO, !no_display && !read_only); fl_set_button(displayCB, !no_display); @@ -271,7 +274,7 @@ void setCrop(FL_OBJECT * clipCB, BOOST_ASSERT(ytED && ytED->objclass == FL_INPUT); fl_set_button(clipCB, data.clip); - lyx::graphics::BoundingBox const & bbox = data.bbox; + graphics::BoundingBox const & bbox = data.bbox; fl_set_input(xlED, tostr(bbox.xl).c_str()); fl_set_input(ybED, tostr(bbox.yb).c_str()); fl_set_input(xrED, tostr(bbox.xr).c_str()); @@ -502,8 +505,6 @@ void FormExternal::update() void FormExternal::updateComboChange() { - namespace external = lyx::external; - int const choice = fl_get_choice(file_->choice_template) - 1; external::Template templ = controller().getTemplate(choice); @@ -753,3 +754,6 @@ void FormExternal::widthUnitChanged() setEnabled(scale_->input_height, useHeight); setEnabled(scale_->choice_height, useHeight); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormExternal.h b/src/frontends/xforms/FormExternal.h index 80296f3c3b..f48c160be8 100644 --- a/src/frontends/xforms/FormExternal.h +++ b/src/frontends/xforms/FormExternal.h @@ -14,10 +14,12 @@ #ifndef FORMEXTERNAL_H #define FORMEXTERNAL_H - #include "FormDialogView.h" #include +namespace lyx { +namespace frontend { + class ControlExternal; struct FD_external; struct FD_external_file; @@ -78,4 +80,7 @@ private: boost::scoped_ptr options_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMEXTERNAL_H diff --git a/src/frontends/xforms/FormFiledialog.C b/src/frontends/xforms/FormFiledialog.C index 60e32ba098..df009195aa 100644 --- a/src/frontends/xforms/FormFiledialog.C +++ b/src/frontends/xforms/FormFiledialog.C @@ -76,6 +76,7 @@ using std::string; using std::map; using std::vector; +using namespace lyx::frontend; namespace { @@ -187,7 +188,6 @@ public: } }; - } // namespace anon diff --git a/src/frontends/xforms/FormFiledialog.h b/src/frontends/xforms/FormFiledialog.h index 93b97b26c3..9d6cee29bf 100644 --- a/src/frontends/xforms/FormFiledialog.h +++ b/src/frontends/xforms/FormFiledialog.h @@ -24,6 +24,18 @@ class Dialogs; + +namespace lyx { + +namespace support { + +class FileFilterList; + +} // namespace support + + +namespace frontend { + /// DirEntry internal structure definition class DirEntry { public: @@ -45,12 +57,7 @@ public: class FD_filedialog; -namespace lyx { -namespace support { - -class FileFilterList; - -} // namespace support +} // namespace frontend } // namespace lyx @@ -84,7 +91,7 @@ public: private: /// data - static FD_filedialog * file_dlg_form_; + static lyx::frontend::FD_filedialog * file_dlg_form_; /// static FileDialog::Private * current_dlg_; /// @@ -110,7 +117,7 @@ private: /// std::string info_line_; /// - typedef std::vector DirEntries; + typedef std::vector DirEntries; /// DirEntries dir_entries_; /// diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index ac27dcbf39..c38b68a998 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -26,10 +26,13 @@ #include "lyx_forms.h" -using lyx::support::contains; - using std::string; +namespace lyx { + +using support::contains; + +namespace frontend { namespace { @@ -254,3 +257,6 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormFloat.h b/src/frontends/xforms/FormFloat.h index faf5bb3486..5eac685583 100644 --- a/src/frontends/xforms/FormFloat.h +++ b/src/frontends/xforms/FormFloat.h @@ -15,6 +15,9 @@ #include "FormDialogView.h" #include "RadioButtonGroup.h" +namespace lyx { +namespace frontend { + class ControlFloat; struct FD_float; @@ -39,4 +42,7 @@ private: RadioButtonGroup placement_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMFLOAT_H diff --git a/src/frontends/xforms/FormGraphics.C b/src/frontends/xforms/FormGraphics.C index ed7ac852b0..026676d194 100644 --- a/src/frontends/xforms/FormGraphics.C +++ b/src/frontends/xforms/FormGraphics.C @@ -37,13 +37,6 @@ #include -using lyx::support::bformat; -using lyx::support::float_equal; -using lyx::support::getStringFromVector; -using lyx::support::strToDbl; -using lyx::support::strToInt; -using lyx::support::token; - #ifndef CXX_GLOBAL_CSTD using std::floor; #endif @@ -53,6 +46,16 @@ using std::endl; using std::vector; using std::string; +namespace lyx { + +using support::bformat; +using support::float_equal; +using support::getStringFromVector; +using support::strToDbl; +using support::strToInt; +using support::token; + +namespace frontend { namespace { @@ -200,7 +203,7 @@ void FormGraphics::build() fl_set_input_filter(bbox_->input_bb_y0, fl_unsigned_float_filter); fl_set_input_filter(bbox_->input_bb_y1, fl_unsigned_float_filter); - string const bb_units = getStringFromVector(frnt::getBBUnits(), "|"); + string const bb_units = getStringFromVector(getBBUnits(), "|"); fl_addto_choice(bbox_->choice_bb_units, bb_units.c_str()); // set up the tooltips for the bounding-box-section @@ -245,7 +248,6 @@ void FormGraphics::build() fl_set_input_filter(extra_->input_rotate_angle, fl_float_filter); - using namespace frnt; vector origindata = getRotationOriginData(); // Store the identifiers for later @@ -311,19 +313,19 @@ void FormGraphics::apply() switch (fl_get_choice(file_->choice_display)) { case 5: - igp.display = lyx::graphics::NoDisplay; + igp.display = graphics::NoDisplay; break; case 4: - igp.display = lyx::graphics::ColorDisplay; + igp.display = graphics::ColorDisplay; break; case 3: - igp.display = lyx::graphics::GrayscaleDisplay; + igp.display = graphics::GrayscaleDisplay; break; case 2: - igp.display = lyx::graphics::MonochromeDisplay; + igp.display = graphics::MonochromeDisplay; break; case 1: - igp.display = lyx::graphics::DefaultDisplay; + igp.display = graphics::DefaultDisplay; } // first item in choice_width means scaling @@ -437,19 +439,19 @@ void FormGraphics::update() { fl_set_input(file_->input_lyxscale, tostr(igp.lyxscale).c_str()); switch (igp.display) { - case lyx::graphics::NoDisplay: + case graphics::NoDisplay: fl_set_choice(file_->choice_display, 5); break; - case lyx::graphics::ColorDisplay: + case graphics::ColorDisplay: fl_set_choice(file_->choice_display, 4); break; - case lyx::graphics::GrayscaleDisplay: + case graphics::GrayscaleDisplay: fl_set_choice(file_->choice_display, 3); break; - case lyx::graphics::MonochromeDisplay: + case graphics::MonochromeDisplay: fl_set_choice(file_->choice_display, 2); break; - case lyx::graphics::DefaultDisplay: + case graphics::DefaultDisplay: fl_set_choice(file_->choice_display, 1); } @@ -657,3 +659,6 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long) return activate; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormGraphics.h b/src/frontends/xforms/FormGraphics.h index 11ebe26467..85ee23a743 100644 --- a/src/frontends/xforms/FormGraphics.h +++ b/src/frontends/xforms/FormGraphics.h @@ -13,13 +13,13 @@ #ifndef FORMGRAPHICS_H #define FORMGRAPHICS_H - #include "FormDialogView.h" - #include - #include +namespace lyx { +namespace frontend { + class ControlGraphics; struct FD_graphics; struct FD_graphics_file; @@ -60,4 +60,7 @@ private: std::vector origins_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMGRAPHICS_H diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index 69b9185122..57bbb468e5 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -24,10 +24,13 @@ #include "lyx_forms.h" -using lyx::support::rtrim; - using std::string; +namespace lyx { + +using support::rtrim; + +namespace frontend { typedef FormController > base_class; @@ -183,3 +186,6 @@ ButtonPolicy::SMInput FormInclude::input(FL_OBJECT * ob, long) return action; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormInclude.h b/src/frontends/xforms/FormInclude.h index 2383baf12c..5bd8464335 100644 --- a/src/frontends/xforms/FormInclude.h +++ b/src/frontends/xforms/FormInclude.h @@ -13,10 +13,11 @@ #ifndef FORMINCLUDE_H #define FORMINCLUDE_H - #include "FormDialogView.h" #include "RadioButtonGroup.h" +namespace lyx { +namespace frontend { class ControlInclude; struct FD_include; @@ -42,4 +43,7 @@ private: RadioButtonGroup type_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMINCLUDE_H diff --git a/src/frontends/xforms/FormLog.C b/src/frontends/xforms/FormLog.C index bcbf7ffb38..be6d6625eb 100644 --- a/src/frontends/xforms/FormLog.C +++ b/src/frontends/xforms/FormLog.C @@ -18,6 +18,8 @@ #include "lyx_forms.h" +namespace lyx { +namespace frontend { FormLog::FormLog(Dialog & parent) : FormController(parent, "") @@ -34,3 +36,6 @@ void FormLog::update() fl_clear_browser(dialog_->browser); fl_add_browser_line(dialog_->browser, ss.str().c_str()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormLog.h b/src/frontends/xforms/FormLog.h index c81ce68c87..aebbfba1ef 100644 --- a/src/frontends/xforms/FormLog.h +++ b/src/frontends/xforms/FormLog.h @@ -14,6 +14,9 @@ #include "FormBrowser.h" +namespace lyx { +namespace frontend { + class ControlLog; /** @@ -33,4 +36,7 @@ public: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMLOG_H diff --git a/src/frontends/xforms/FormMathsBitmap.C b/src/frontends/xforms/FormMathsBitmap.C index 7280b2f091..b588c23d8a 100644 --- a/src/frontends/xforms/FormMathsBitmap.C +++ b/src/frontends/xforms/FormMathsBitmap.C @@ -25,6 +25,8 @@ using std::max; using std::vector; using std::string; +namespace lyx { +namespace frontend { extern "C" void C_FormDialogView_CancelCB(FL_OBJECT *, long); extern "C" void C_FormDialogView_InputCB(FL_OBJECT *, long); @@ -192,3 +194,6 @@ ButtonPolicy::SMInput FormMathsBitmap::input(FL_OBJECT * ob, long) apply(); return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsBitmap.h b/src/frontends/xforms/FormMathsBitmap.h index 375f4e8776..77e4e33b19 100644 --- a/src/frontends/xforms/FormMathsBitmap.h +++ b/src/frontends/xforms/FormMathsBitmap.h @@ -17,6 +17,9 @@ #include "FormDialogView.h" #include +namespace lyx { +namespace frontend { + struct BitmapStore { BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in, @@ -95,5 +98,7 @@ private: int h_; }; +} // namespace frontend +} // namespace lyx #endif // FORM_MATHSBITMAP_H diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index a6c366c368..2bcc42f06f 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -30,6 +30,8 @@ using std::ostringstream; #include "delim0.xpm" #include "delim1.xpm" +namespace lyx { +namespace frontend { namespace { @@ -147,3 +149,6 @@ ButtonPolicy::SMInput FormMathsDelim::input(FL_OBJECT *, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsDelim.h b/src/frontends/xforms/FormMathsDelim.h index 4ab44f16a0..6563896b25 100644 --- a/src/frontends/xforms/FormMathsDelim.h +++ b/src/frontends/xforms/FormMathsDelim.h @@ -14,9 +14,10 @@ #ifndef FORM_MATHSDELIM_H #define FORM_MATHSDELIM_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlMath; struct FD_maths_delim; @@ -41,4 +42,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORM_MATHSDELIM_H diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index 9a12b1684a..7076fc3054 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -34,26 +34,28 @@ using std::ostringstream; using std::strlen; #endif +namespace lyx { +namespace frontend { -static char h_align_str[80] = "c"; -static char v_align_c[] = "tcb"; +namespace { + +char h_align_str[80] = "c"; +char v_align_c[] = "tcb"; -extern "C" { - - static - int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *, - char const * cur, int c) - { - BOOST_ASSERT(ob); - FormMathsMatrix * pre = - static_cast(ob->u_vdata); - BOOST_ASSERT(pre); - return pre->AlignFilter(cur, c); - } - +extern "C" +int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *, + char const * cur, int c) +{ + BOOST_ASSERT(ob); + FormMathsMatrix * pre = + static_cast(ob->u_vdata); + BOOST_ASSERT(pre); + return pre->AlignFilter(cur, c); } +} // namespace anon + typedef FormController > base_class; @@ -128,7 +130,7 @@ int FormMathsMatrix::AlignFilter(char const * cur, int c) int const n = int(fl_get_slider_value(dialog_->slider_columns) + 0.5) - int(len) - + int(lyx::count(cur, cur + len, '|')); + + int(count(cur, cur + len, '|')); if (n < 0) return FL_INVALID; @@ -137,3 +139,6 @@ int FormMathsMatrix::AlignFilter(char const * cur, int c) return FL_INVALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsMatrix.h b/src/frontends/xforms/FormMathsMatrix.h index 7dfd416e93..ba9d7c05a8 100644 --- a/src/frontends/xforms/FormMathsMatrix.h +++ b/src/frontends/xforms/FormMathsMatrix.h @@ -14,9 +14,10 @@ #ifndef FORM_MATHSMATRIX_H #define FORM_MATHSMATRIX_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlMath; struct FD_maths_matrix; @@ -43,4 +44,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORM_MATHSMATRIX_H diff --git a/src/frontends/xforms/FormMathsPanel.C b/src/frontends/xforms/FormMathsPanel.C index b6a1f0bf51..c6cb941151 100644 --- a/src/frontends/xforms/FormMathsPanel.C +++ b/src/frontends/xforms/FormMathsPanel.C @@ -32,6 +32,8 @@ #include "sub.xpm" #include "super.xpm" +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -130,3 +132,6 @@ ButtonPolicy::SMInput FormMathsPanel::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsPanel.h b/src/frontends/xforms/FormMathsPanel.h index bf9d1eb8ad..48427cff87 100644 --- a/src/frontends/xforms/FormMathsPanel.h +++ b/src/frontends/xforms/FormMathsPanel.h @@ -14,9 +14,10 @@ #ifndef FORM_MATHSPANEL_H #define FORM_MATHSPANEL_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlMath; struct FD_maths_panel; @@ -42,4 +43,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORM_MATHSPANEL_H diff --git a/src/frontends/xforms/FormMathsSpace.C b/src/frontends/xforms/FormMathsSpace.C index 03cce878ca..80453a9283 100644 --- a/src/frontends/xforms/FormMathsSpace.C +++ b/src/frontends/xforms/FormMathsSpace.C @@ -20,9 +20,11 @@ #include "lyx_forms.h" - extern char * latex_mathspace[]; +namespace lyx { +namespace frontend { + typedef FormController > base_class; FormMathsSpace::FormMathsSpace(Dialog & parent) @@ -66,3 +68,6 @@ ButtonPolicy::SMInput FormMathsSpace::input(FL_OBJECT *, long data) } return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsSpace.h b/src/frontends/xforms/FormMathsSpace.h index f68c1c6638..ea147507c6 100644 --- a/src/frontends/xforms/FormMathsSpace.h +++ b/src/frontends/xforms/FormMathsSpace.h @@ -14,9 +14,10 @@ #ifndef FORM_MATHSSPACE_H #define FORM_MATHSSPACE_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlMath; struct FD_maths_space; @@ -44,4 +45,7 @@ private: int space_; }; +} // namespace frontend +} // namespace lyx + #endif // FORM_MATHSSPACE_H diff --git a/src/frontends/xforms/FormMathsStyle.C b/src/frontends/xforms/FormMathsStyle.C index b9de12dc42..e97017b8bc 100644 --- a/src/frontends/xforms/FormMathsStyle.C +++ b/src/frontends/xforms/FormMathsStyle.C @@ -25,6 +25,10 @@ #include "style.xbm" #include "font.xbm" +namespace lyx { +namespace frontend { + +namespace { char const * latex_mathstyle[] = { "displaystyle", "textstyle", "scriptstyle", "scriptscriptstyle" @@ -34,6 +38,8 @@ kb_action latex_mathfontcmds[] = { LFUN_BOLD, LFUN_SANS, LFUN_ROMAN, LFUN_ITAL, LFUN_CODE, LFUN_NOUN, LFUN_FRAK, LFUN_EMPH, LFUN_FREEFONT_APPLY, LFUN_DEFAULT }; + +} // namespace anon typedef FormController > base_class; @@ -95,3 +101,6 @@ ButtonPolicy::SMInput FormMathsStyle::input(FL_OBJECT * ob, long data) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormMathsStyle.h b/src/frontends/xforms/FormMathsStyle.h index 83ec9ae972..39892607b9 100644 --- a/src/frontends/xforms/FormMathsStyle.h +++ b/src/frontends/xforms/FormMathsStyle.h @@ -14,9 +14,10 @@ #ifndef FORM_MATHSSTYLE_H #define FORM_MATHSSTYLE_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlMath; struct FD_maths_style; @@ -44,4 +45,7 @@ private: int style_; }; +} // namespace frontend +} // namespace lyx + #endif // FORM_MATHSSTYLE_H diff --git a/src/frontends/xforms/FormNote.C b/src/frontends/xforms/FormNote.C index 1160d69e76..00110aca24 100644 --- a/src/frontends/xforms/FormNote.C +++ b/src/frontends/xforms/FormNote.C @@ -21,9 +21,10 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -82,3 +83,6 @@ void FormNote::apply() controller().params().type = type; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormNote.h b/src/frontends/xforms/FormNote.h index d444734a2e..8c1e1376d0 100644 --- a/src/frontends/xforms/FormNote.h +++ b/src/frontends/xforms/FormNote.h @@ -12,9 +12,10 @@ #ifndef FORMNOTE_H #define FORMNOTE_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { class ControlNote; struct FD_note; @@ -34,4 +35,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMNOTE_H diff --git a/src/frontends/xforms/FormParagraph.C b/src/frontends/xforms/FormParagraph.C index 316f98c6ab..6224a88ffa 100644 --- a/src/frontends/xforms/FormParagraph.C +++ b/src/frontends/xforms/FormParagraph.C @@ -34,10 +34,6 @@ #include -using lyx::support::contains; -using lyx::support::getStringFromVector; -using lyx::support::rtrim; - using boost::bind; using std::remove_if; @@ -45,6 +41,13 @@ using std::remove_if; using std::vector; using std::string; +namespace lyx { + +using support::contains; +using support::getStringFromVector; +using support::rtrim; + +namespace frontend { namespace { @@ -287,3 +290,6 @@ ButtonPolicy::SMInput FormParagraph::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormParagraph.h b/src/frontends/xforms/FormParagraph.h index 8d0f808701..d55ae062ae 100644 --- a/src/frontends/xforms/FormParagraph.h +++ b/src/frontends/xforms/FormParagraph.h @@ -12,12 +12,14 @@ #ifndef FORM_PARAGRAPH_H #define FORM_PARAGRAPH_H - #include "FormDialogView.h" #include "RadioButtonGroup.h" -struct FD_paragraph; +namespace lyx { +namespace frontend { + class ControlParagraph; +struct FD_paragraph; /** This class provides an XForms implementation of the FormParagraph dialog. */ @@ -41,4 +43,7 @@ private: RadioButtonGroup alignment_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/FormPreamble.C b/src/frontends/xforms/FormPreamble.C index ed0c7d7690..b43be9b495 100644 --- a/src/frontends/xforms/FormPreamble.C +++ b/src/frontends/xforms/FormPreamble.C @@ -20,6 +20,8 @@ #include "lyx_forms.h" +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -55,3 +57,6 @@ void FormPreamble::update() { fl_set_input(dialog_->input_preamble, controller().params().c_str()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormPreamble.h b/src/frontends/xforms/FormPreamble.h index 2abcfc7a92..335a174695 100644 --- a/src/frontends/xforms/FormPreamble.h +++ b/src/frontends/xforms/FormPreamble.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlPreamble; struct FD_preamble; @@ -33,5 +36,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx #endif // FORMPREAMBLE_H diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 61d177d2c2..a0761a28e2 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -37,13 +37,6 @@ #include -using lyx::support::AddName; -using lyx::support::ChangeExtension; -using lyx::support::rtrim; -using lyx::support::strToDbl; -using lyx::support::trim; -using lyx::support::user_lyxdir; - using std::endl; using std::make_pair; using std::max; @@ -53,6 +46,16 @@ using std::pair; using std::vector; using std::string; +namespace lyx { + +using support::AddName; +using support::ChangeExtension; +using support::rtrim; +using support::strToDbl; +using support::trim; +using support::user_lyxdir; + +namespace frontend { namespace { @@ -1452,12 +1455,12 @@ void FormPreferences::Language::build() fl_set_input_return(dialog_->input_command_end, FL_RETURN_CHANGED); // Store the lang identifiers for later - vector const langs = frnt::getLanguageData(false); + vector const langs = getLanguageData(false); lang_ = getSecond(langs); FL_OBJECT * obj = dialog_->combox_default_lang; - vector::const_iterator lit = langs.begin(); - vector::const_iterator lend = langs.end(); + vector::const_iterator lit = langs.begin(); + vector::const_iterator lend = langs.end(); for (; lit != lend; ++lit) { fl_addto_combox(obj, lit->first.c_str()); } @@ -1626,22 +1629,22 @@ void FormPreferences::LnFmisc::apply(LyXRC & rc) const (fl_get_counter_value(dialog_->counter_wm_jump)); // See FIXME below - // lyx::graphics::DisplayType old_value = rc.display_graphics; + // graphics::DisplayType old_value = rc.display_graphics; switch (fl_get_choice(dialog_->choice_graphics_display)) { case 4: - rc.display_graphics = lyx::graphics::NoDisplay; + rc.display_graphics = graphics::NoDisplay; break; case 3: - rc.display_graphics = lyx::graphics::ColorDisplay; + rc.display_graphics = graphics::ColorDisplay; break; case 2: - rc.display_graphics = lyx::graphics::GrayscaleDisplay; + rc.display_graphics = graphics::GrayscaleDisplay; break; case 1: - rc.display_graphics = lyx::graphics::MonochromeDisplay; + rc.display_graphics = graphics::MonochromeDisplay; break; default: - rc.display_graphics = lyx::graphics::ColorDisplay; + rc.display_graphics = graphics::ColorDisplay; break; } @@ -1650,7 +1653,7 @@ void FormPreferences::LnFmisc::apply(LyXRC & rc) const #endif #if 0 if (old_value != rc.display_graphics) { - lyx::graphics::GCache & gc = lyx::graphics::GCache::get(); + graphics::GCache & gc = graphics::GCache::get(); gc.changeDisplay(); } #endif @@ -1729,16 +1732,16 @@ void FormPreferences::LnFmisc::update(LyXRC const & rc) fl_set_counter_value(dialog_->counter_wm_jump, rc.wheel_jump); switch (rc.display_graphics) { - case lyx::graphics::NoDisplay: + case graphics::NoDisplay: fl_set_choice(dialog_->choice_graphics_display, 4); break; - case lyx::graphics::ColorDisplay: + case graphics::ColorDisplay: fl_set_choice(dialog_->choice_graphics_display, 3); break; - case lyx::graphics::GrayscaleDisplay: + case graphics::GrayscaleDisplay: fl_set_choice(dialog_->choice_graphics_display, 2); break; - case lyx::graphics::MonochromeDisplay: + case graphics::MonochromeDisplay: fl_set_choice(dialog_->choice_graphics_display, 1); break; default: @@ -2798,3 +2801,6 @@ void FormPreferences::SpellOptions::update(LyXRC const & rc) // buttons. input(0); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormPreferences.h b/src/frontends/xforms/FormPreferences.h index 723b408dbc..e7f4a0cb02 100644 --- a/src/frontends/xforms/FormPreferences.h +++ b/src/frontends/xforms/FormPreferences.h @@ -19,18 +19,17 @@ #include -class ControlPrefs; class Converters; class Formats; class Dialogs; -class FormColorpicker; class LyXRC; class LyXView; -class NamedColor; -class RGBColor; -class XformsColor; +namespace lyx { +namespace frontend { + +class ControlPrefs; struct FD_preferences; struct FD_preferences_colors; struct FD_preferences_converters; @@ -47,6 +46,10 @@ struct FD_preferences_printer; 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. @@ -512,4 +515,7 @@ private: SpellOptions spelloptions_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMPREFERENCES_H diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index a3ea1756ea..48d38d464b 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -27,10 +27,13 @@ #include "lyx_forms.h" -using lyx::support::strToInt; - using std::string; +namespace lyx { + +using support::strToInt; + +namespace frontend { typedef FormController > base_class; @@ -253,3 +256,6 @@ ButtonPolicy::SMInput FormPrint::input(FL_OBJECT * ob, long) return activate; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormPrint.h b/src/frontends/xforms/FormPrint.h index 316c8951b5..5a499b5366 100644 --- a/src/frontends/xforms/FormPrint.h +++ b/src/frontends/xforms/FormPrint.h @@ -16,6 +16,9 @@ #include "FormDialogView.h" #include "RadioButtonGroup.h" +namespace lyx { +namespace frontend { + class ControlPrint; struct FD_print; @@ -44,4 +47,7 @@ private: RadioButtonGroup all_pages_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMPRINT_H diff --git a/src/frontends/xforms/FormRef.C b/src/frontends/xforms/FormRef.C index 5e0ac68a7b..d35e8e2d26 100644 --- a/src/frontends/xforms/FormRef.C +++ b/src/frontends/xforms/FormRef.C @@ -24,14 +24,17 @@ #include "lyx_forms.h" -using lyx::support::getStringFromVector; - using std::find; using std::max; using std::sort; using std::string; using std::vector; +namespace lyx { + +using support::getStringFromVector; + +namespace frontend { typedef FormController > base_class; @@ -289,3 +292,6 @@ void FormRef::switch_go_button() fl_set_button_shortcut(dialog_->button_go, "#G", 1); fl_show_object(dialog_->button_go); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormRef.h b/src/frontends/xforms/FormRef.h index 4a5b24b0ac..cd00ae9bd9 100644 --- a/src/frontends/xforms/FormRef.h +++ b/src/frontends/xforms/FormRef.h @@ -12,9 +12,11 @@ #ifndef FORMREF_H #define FORMREF_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlRef; struct FD_ref; @@ -46,4 +48,7 @@ private: std::vector refs_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMREF_H diff --git a/src/frontends/xforms/FormSearch.C b/src/frontends/xforms/FormSearch.C index 4cf9b97e74..375dc0e21e 100644 --- a/src/frontends/xforms/FormSearch.C +++ b/src/frontends/xforms/FormSearch.C @@ -20,9 +20,10 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -91,3 +92,6 @@ ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormSearch.h b/src/frontends/xforms/FormSearch.h index 3571508112..7208a27c02 100644 --- a/src/frontends/xforms/FormSearch.h +++ b/src/frontends/xforms/FormSearch.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlSearch; struct FD_search; @@ -36,4 +39,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORMSEARCH_H diff --git a/src/frontends/xforms/FormSendto.C b/src/frontends/xforms/FormSendto.C index b1b08ffdcb..7fd0484ca8 100644 --- a/src/frontends/xforms/FormSendto.C +++ b/src/frontends/xforms/FormSendto.C @@ -24,11 +24,14 @@ #include "lyx_forms.h" -using lyx::support::trim; - using std::vector; using std::string; +namespace lyx { + +using support::trim; + +namespace frontend { typedef FormController > base_class; @@ -118,3 +121,6 @@ void FormSendto::apply() controller().setFormat(all_formats_[line-1]); controller().setCommand(cmd); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormSendto.h b/src/frontends/xforms/FormSendto.h index b4c85937e6..7557e117d2 100644 --- a/src/frontends/xforms/FormSendto.h +++ b/src/frontends/xforms/FormSendto.h @@ -15,10 +15,14 @@ #include "FormDialogView.h" #include -struct FD_sendto; -class ControlSendto; class Format; +namespace lyx { +namespace frontend { + +class ControlSendto; +struct FD_sendto; + /** This class provides an XForms implementation of the Custom Export Dialog. */ class FormSendto @@ -39,4 +43,7 @@ private: std::vector all_formats_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMSENDTO_H diff --git a/src/frontends/xforms/FormShowFile.C b/src/frontends/xforms/FormShowFile.C index 5e94c49c79..168c2ddede 100644 --- a/src/frontends/xforms/FormShowFile.C +++ b/src/frontends/xforms/FormShowFile.C @@ -18,9 +18,10 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { FormShowFile::FormShowFile(Dialog & parent) : FormController(parent, _("Show File")) @@ -45,3 +46,6 @@ void FormShowFile::update() else fl_add_browser_line(dialog_->browser, contents.c_str()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormShowFile.h b/src/frontends/xforms/FormShowFile.h index 1b6b444716..c52bd744ab 100644 --- a/src/frontends/xforms/FormShowFile.h +++ b/src/frontends/xforms/FormShowFile.h @@ -14,6 +14,9 @@ #include "FormBrowser.h" +namespace lyx { +namespace frontend { + class ControlShowFile; /** @@ -33,4 +36,7 @@ public: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMSHOWFILE_H diff --git a/src/frontends/xforms/FormSpellchecker.C b/src/frontends/xforms/FormSpellchecker.C index 3a4bccbdfb..4f51c8d664 100644 --- a/src/frontends/xforms/FormSpellchecker.C +++ b/src/frontends/xforms/FormSpellchecker.C @@ -23,9 +23,10 @@ #include "lyx_forms.h" - using std::string; +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -159,3 +160,6 @@ ButtonPolicy::SMInput FormSpellchecker::input(FL_OBJECT * ob, long ob_value) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormSpellchecker.h b/src/frontends/xforms/FormSpellchecker.h index 5a3f036e4f..4a43cb4e54 100644 --- a/src/frontends/xforms/FormSpellchecker.h +++ b/src/frontends/xforms/FormSpellchecker.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlSpellchecker; struct FD_spellchecker; @@ -39,4 +42,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif // FORMSPELLCHECKER_H diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 88d0860fad..cc395ba822 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -26,15 +26,18 @@ #include -using lyx::support::contains; -using lyx::support::getStringFromVector; -using lyx::support::isStrDbl; - using boost::bind; using std::string; using std::vector; +namespace lyx { + +using support::contains; +using support::getStringFromVector; +using support::isStrDbl; + +namespace frontend { namespace { @@ -730,3 +733,6 @@ int FormTabular::checkLongtableOptions(FL_OBJECT * ob, string & special) return LyXTabular::LAST_ACTION; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormTabular.h b/src/frontends/xforms/FormTabular.h index e6e8529b86..1d7bbe249b 100644 --- a/src/frontends/xforms/FormTabular.h +++ b/src/frontends/xforms/FormTabular.h @@ -16,6 +16,10 @@ #include class InsetTabular; + +namespace lyx { +namespace frontend { + class ControlTabular; struct FD_tabular; struct FD_tabular_options; @@ -65,4 +69,7 @@ private: int actCell_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTABULAR_H diff --git a/src/frontends/xforms/FormTabularCreate.C b/src/frontends/xforms/FormTabularCreate.C index 4e8f33c87e..909a78145b 100644 --- a/src/frontends/xforms/FormTabularCreate.C +++ b/src/frontends/xforms/FormTabularCreate.C @@ -22,6 +22,8 @@ using std::make_pair; using std::string; +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -54,3 +56,6 @@ void FormTabularCreate::apply() controller().params() = make_pair(xsize, ysize); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormTabularCreate.h b/src/frontends/xforms/FormTabularCreate.h index 4cb7343735..61f64dde2c 100644 --- a/src/frontends/xforms/FormTabularCreate.h +++ b/src/frontends/xforms/FormTabularCreate.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlTabularCreate; struct FD_tabular_create; @@ -34,4 +37,7 @@ private: virtual void update() {}; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTABULARCREATE diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C index f609af0b96..3f672ba1e7 100644 --- a/src/frontends/xforms/FormTexinfo.C +++ b/src/frontends/xforms/FormTexinfo.C @@ -20,10 +20,14 @@ #include "lyx_forms.h" -using lyx::support::OnlyFilename; - using std::string; +namespace lyx { + +using support::OnlyFilename; + +namespace frontend { + typedef FormController > base_class; @@ -135,3 +139,6 @@ void FormTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle) activeStyle = whichStyle; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormTexinfo.h b/src/frontends/xforms/FormTexinfo.h index a28742a6fe..a5c76cf1c1 100644 --- a/src/frontends/xforms/FormTexinfo.h +++ b/src/frontends/xforms/FormTexinfo.h @@ -12,11 +12,13 @@ #ifndef FORMTEXINFO_H #define FORMTEXINFO_H - #include "FormDialogView.h" #include "ControlTexinfo.h" #include +namespace lyx { +namespace frontend { + struct FD_texinfo; class FormTexinfo @@ -43,4 +45,7 @@ private: std::map texdata_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTEXINFO_H diff --git a/src/frontends/xforms/FormText.C b/src/frontends/xforms/FormText.C index 0fd0cd1509..95af628a27 100644 --- a/src/frontends/xforms/FormText.C +++ b/src/frontends/xforms/FormText.C @@ -23,10 +23,13 @@ #include "lyx_forms.h" -using lyx::support::trim; - using std::string; +namespace lyx { + +using support::trim; + +namespace frontend { typedef FormController > base_class; @@ -68,3 +71,6 @@ void FormText::apply() { controller().params().setContents(fl_get_input(dialog_->input_text)); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormText.h b/src/frontends/xforms/FormText.h index 2c09effac2..af8f543e05 100644 --- a/src/frontends/xforms/FormText.h +++ b/src/frontends/xforms/FormText.h @@ -12,13 +12,14 @@ #ifndef FORMTEXT_H #define FORMTEXT_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; struct FD_text; - class FormText : public FormController > { public: /// @@ -35,4 +36,7 @@ private: std::string const label_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTEXT_H diff --git a/src/frontends/xforms/FormThesaurus.C b/src/frontends/xforms/FormThesaurus.C index 9e1dc93b4f..245ea49207 100644 --- a/src/frontends/xforms/FormThesaurus.C +++ b/src/frontends/xforms/FormThesaurus.C @@ -21,10 +21,6 @@ #include "lyx_forms.h" -using lyx::support::lowercase; -using lyx::support::trim; -using lyx::support::uppercase; - #ifndef CXX_GLOBAL_CSTD using std::islower; using std::isupper; @@ -33,6 +29,13 @@ using std::isupper; using std::vector; using std::string; +namespace lyx { + +using support::lowercase; +using support::trim; +using support::uppercase; + +namespace frontend { typedef FormController > base_class; @@ -190,3 +193,6 @@ ButtonPolicy::SMInput FormThesaurus::input(FL_OBJECT * obj, long) return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormThesaurus.h b/src/frontends/xforms/FormThesaurus.h index 7b0ab9c624..aa1c47b265 100644 --- a/src/frontends/xforms/FormThesaurus.h +++ b/src/frontends/xforms/FormThesaurus.h @@ -14,6 +14,9 @@ #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlThesaurus; struct FD_thesaurus; @@ -48,4 +51,7 @@ private: std::string str_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTHESAURUS_H diff --git a/src/frontends/xforms/FormToc.C b/src/frontends/xforms/FormToc.C index a14c5f5ea0..62842e0342 100644 --- a/src/frontends/xforms/FormToc.C +++ b/src/frontends/xforms/FormToc.C @@ -21,11 +21,14 @@ #include "lyx_forms.h" -using lyx::support::getStringFromVector; - using std::vector; using std::string; +namespace lyx { + +using support::getStringFromVector; + +namespace frontend { typedef FormController > base_class; @@ -86,7 +89,7 @@ void FormToc::updateType() fl_addto_choice(dialog_->choice_toc_type, choice.c_str()); // And select the correct one - string const type = lyx::toc::getType(controller().params().getCmdName()); + string const type = toc::getType(controller().params().getCmdName()); fl_set_choice_text(dialog_->choice_toc_type, type.c_str()); } @@ -102,7 +105,7 @@ void FormToc::updateContents() return; } - lyx::toc::Toc const contents = controller().getContents(type); + toc::Toc const contents = controller().getContents(type); // Check if all elements are the same. if (toc_ == contents) { @@ -127,8 +130,8 @@ void FormToc::updateContents() fl_clear_browser(dialog_->browser_toc); setEnabled(dialog_->browser_toc, true); - lyx::toc::Toc::const_iterator cit = contents.begin(); - lyx::toc::Toc::const_iterator end = contents.end(); + toc::Toc::const_iterator cit = contents.begin(); + toc::Toc::const_iterator end = contents.end(); for (; cit != end; ++cit) { fl_add_browser_line(dialog_->browser_toc, cit->asString().c_str()); @@ -137,3 +140,6 @@ void FormToc::updateContents() fl_set_browser_topline(dialog_->browser_toc, topline); fl_select_browser_line(dialog_->browser_toc, line); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormToc.h b/src/frontends/xforms/FormToc.h index 7e55c9e2ab..1064ad5aee 100644 --- a/src/frontends/xforms/FormToc.h +++ b/src/frontends/xforms/FormToc.h @@ -12,10 +12,12 @@ #ifndef FORMTOC_H #define FORMTOC_H - #include "FormDialogView.h" #include "toc.h" +namespace lyx { +namespace frontend { + class ControlToc; struct FD_toc; @@ -41,7 +43,10 @@ private: void updateContents(); /// - lyx::toc::Toc toc_; + toc::Toc toc_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMTOC_H diff --git a/src/frontends/xforms/FormUrl.C b/src/frontends/xforms/FormUrl.C index 9d52023ac9..0c073e076d 100644 --- a/src/frontends/xforms/FormUrl.C +++ b/src/frontends/xforms/FormUrl.C @@ -8,7 +8,6 @@ * Full author contact details are available in file CREDITS. */ - #include #include "FormUrl.h" @@ -19,6 +18,8 @@ #include "lyx_forms.h" +namespace lyx { +namespace frontend { typedef FormController > base_class; @@ -73,3 +74,6 @@ void FormUrl::apply() else controller().params().setCmdName("url"); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormUrl.h b/src/frontends/xforms/FormUrl.h index f5b278527f..af727c08d3 100644 --- a/src/frontends/xforms/FormUrl.h +++ b/src/frontends/xforms/FormUrl.h @@ -12,9 +12,11 @@ #ifndef FORMURL_H #define FORMURL_H - #include "FormDialogView.h" +namespace lyx { +namespace frontend { + class ControlCommand; struct FD_url; @@ -33,4 +35,7 @@ private: virtual void update(); }; +} // namespace frontend +} // namespace lyx + #endif // FORMURL_H diff --git a/src/frontends/xforms/FormVSpace.C b/src/frontends/xforms/FormVSpace.C index a94686ceec..0df4171318 100644 --- a/src/frontends/xforms/FormVSpace.C +++ b/src/frontends/xforms/FormVSpace.C @@ -35,10 +35,6 @@ #include -using lyx::support::contains; -using lyx::support::getStringFromVector; -using lyx::support::rtrim; - using boost::bind; using std::remove_if; @@ -46,6 +42,13 @@ using std::remove_if; using std::vector; using std::string; +namespace lyx { + +using support::contains; +using support::getStringFromVector; +using support::rtrim; + +namespace frontend { namespace { @@ -270,3 +273,6 @@ ButtonPolicy::SMInput FormVSpace::input(FL_OBJECT * ob, long) } return ButtonPolicy::SMI_VALID; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormVSpace.h b/src/frontends/xforms/FormVSpace.h index d286bdbd45..1f04fbf35b 100644 --- a/src/frontends/xforms/FormVSpace.h +++ b/src/frontends/xforms/FormVSpace.h @@ -12,10 +12,12 @@ #ifndef FORM_VSPACE_H #define FORM_VSPACE_H - #include "FormDialogView.h" #include "RadioButtonGroup.h" +namespace lyx { +namespace frontend { + struct FD_vspace; class ControlVSpace; @@ -38,4 +40,7 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/FormWrap.C b/src/frontends/xforms/FormWrap.C index 2a30826980..37788f0202 100644 --- a/src/frontends/xforms/FormWrap.C +++ b/src/frontends/xforms/FormWrap.C @@ -25,11 +25,14 @@ #include "lyx_forms.h" #include "support/tostr.h" -using lyx::support::getStringFromVector; -using lyx::support::subst; - using std::string; +namespace lyx { + +using support::getStringFromVector; +using support::subst; + +namespace frontend { typedef FormController > base_class; @@ -113,3 +116,6 @@ void FormWrap::update() else placement_.set(params.placement.c_str()[0]); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/FormWrap.h b/src/frontends/xforms/FormWrap.h index 45994f318b..e97057302f 100644 --- a/src/frontends/xforms/FormWrap.h +++ b/src/frontends/xforms/FormWrap.h @@ -12,10 +12,12 @@ #ifndef FORMWRAP_H #define FORMWRAP_H - #include "FormDialogView.h" #include "RadioButtonGroup.h" +namespace lyx { +namespace frontend { + class ControlWrap; struct FD_wrap; @@ -39,4 +41,7 @@ private: RadioButtonGroup placement_; }; +} // namespace frontend +} // namespace lyx + #endif // FORMWRAP_H diff --git a/src/frontends/xforms/LyXKeySymFactory.C b/src/frontends/xforms/LyXKeySymFactory.C index f5ce4c134d..0409b58cdd 100644 --- a/src/frontends/xforms/LyXKeySymFactory.C +++ b/src/frontends/xforms/LyXKeySymFactory.C @@ -19,7 +19,7 @@ namespace LyXKeySymFactory { LyXKeySym * create() { - return new XLyXKeySym; + return new lyx::frontend::XLyXKeySym; } } diff --git a/src/frontends/xforms/LyXScreenFactory.C b/src/frontends/xforms/LyXScreenFactory.C index b17a549d9f..6e007f0de8 100644 --- a/src/frontends/xforms/LyXScreenFactory.C +++ b/src/frontends/xforms/LyXScreenFactory.C @@ -20,6 +20,9 @@ namespace LyXScreenFactory { LyXScreen * create(WorkArea & owner) { + using lyx::frontend::XScreen; + using lyx::frontend::XWorkArea; + return new XScreen(static_cast(owner)); } diff --git a/src/frontends/xforms/RadioButtonGroup.C b/src/frontends/xforms/RadioButtonGroup.C index cdaa0906aa..08e3884cbb 100644 --- a/src/frontends/xforms/RadioButtonGroup.C +++ b/src/frontends/xforms/RadioButtonGroup.C @@ -25,6 +25,8 @@ using std::endl; +namespace lyx { +namespace frontend { void RadioButtonGroup::init(FL_OBJECT * ob, size_type value) { @@ -96,7 +98,7 @@ void RadioButtonGroup::unset() const } -RadioButtonGroup::size_type RadioButtonGroup::get() const +size_type RadioButtonGroup::get() const { // Find the active button. ButtonValueMap::const_iterator it = @@ -117,6 +119,9 @@ void RadioButtonGroup::setEnabled(bool enable) ButtonValueMap::iterator it = map.begin(); ButtonValueMap::iterator end = map.end(); for (; it != end; ++it) { - ::setEnabled(it->first, enable); + lyx::frontend::setEnabled(it->first, enable); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/RadioButtonGroup.h b/src/frontends/xforms/RadioButtonGroup.h index 5fc6b1ed4d..3be3c0ad61 100644 --- a/src/frontends/xforms/RadioButtonGroup.h +++ b/src/frontends/xforms/RadioButtonGroup.h @@ -14,12 +14,14 @@ #ifndef RADIOBUTTONGROUP_H #define RADIOBUTTONGROUP_H - #include "support/types.h" #include #include #include "forms_fwd.h" +namespace lyx { +namespace frontend { + /** This class simplifies interaction with a group of radio buttons: * one, and only one, can be selected. * The idea is that you register a bunch of radio buttons with @@ -31,8 +33,6 @@ */ class RadioButtonGroup { public: - /// - typedef lyx::size_type size_type; /// Register a radio button with its corresponding value. void init(FL_OBJECT * ob, size_type value); @@ -58,4 +58,7 @@ private: ButtonValueMap map; }; +} // namespace frontend +} // namespace lyx + #endif // RADIOBUTTONGROUP_H diff --git a/src/frontends/xforms/Tooltips.C b/src/frontends/xforms/Tooltips.C index dc741ca98e..9ea6da5f03 100644 --- a/src/frontends/xforms/Tooltips.C +++ b/src/frontends/xforms/Tooltips.C @@ -26,11 +26,16 @@ #include -using lyx::support::trim; - using std::string; +namespace lyx { + +using support::trim; + +namespace frontend { + + bool Tooltips::enabled_ = true; boost::signal0 Tooltips::toggled; @@ -76,3 +81,6 @@ void Tooltips::init(FL_OBJECT * ob, string const & tip) char const * const c_str = enabled_ ? str.c_str() : 0; fl_set_object_helper(ob, c_str); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/Tooltips.h b/src/frontends/xforms/Tooltips.h index 5b7624a098..cd618d1a42 100644 --- a/src/frontends/xforms/Tooltips.h +++ b/src/frontends/xforms/Tooltips.h @@ -25,6 +25,8 @@ #include +namespace lyx { +namespace frontend { class Tooltips : boost::noncopyable, public boost::signals::trackable { public: @@ -61,4 +63,7 @@ private: TooltipsMap tooltipsMap; }; +} // namespace frontend +} // namespace lyx + #endif // TOOLTIPS_H diff --git a/src/frontends/xforms/WorkAreaFactory.C b/src/frontends/xforms/WorkAreaFactory.C index 8158ee0191..3b186a1f3e 100644 --- a/src/frontends/xforms/WorkAreaFactory.C +++ b/src/frontends/xforms/WorkAreaFactory.C @@ -18,7 +18,7 @@ namespace WorkAreaFactory { WorkArea * create(LyXView & owner, int w, int h) { - return new XWorkArea(owner, w, h); + return new lyx::frontend::XWorkArea(owner, w, h); } } diff --git a/src/frontends/xforms/XFormsMenubar.C b/src/frontends/xforms/XFormsMenubar.C index a52ffe6c88..74a1d7843e 100644 --- a/src/frontends/xforms/XFormsMenubar.C +++ b/src/frontends/xforms/XFormsMenubar.C @@ -27,18 +27,18 @@ #include "lyx_forms.h" -using lyx::frontend::Box; -using lyx::frontend::BoxList; - -using lyx::support::lowercase; -using lyx::support::subst; - using std::distance; using std::endl; using std::for_each; using std::string; using std::vector; +namespace lyx { + +using support::lowercase; +using support::subst; + +namespace frontend { typedef vector::size_type size_type; @@ -91,7 +91,6 @@ XFormsMenubar::XFormsMenubar(LyXView * view, MenuBackend const & mb) menubackend_(&mb), menubar_(0) { - using lyx::frontend::WidgetMap; owner_->metricsUpdated.connect(boost::bind(&WidgetMap::updateMetrics, &widgets_)); @@ -428,3 +427,6 @@ XFormsMenubar::ItemInfo::ItemInfo XFormsMenubar::ItemInfo::~ItemInfo() {} + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XFormsMenubar.h b/src/frontends/xforms/XFormsMenubar.h index ded13fb862..b73c480c1d 100644 --- a/src/frontends/xforms/XFormsMenubar.h +++ b/src/frontends/xforms/XFormsMenubar.h @@ -24,13 +24,16 @@ #include - class LyXView; -class XFormsView; class Menu; class MenuItem; class MenuBackend; +namespace lyx { +namespace frontend { + +class XFormsView; + class XFormsMenubar : public Menubar { public: /// @@ -69,9 +72,9 @@ private: /// MenuBackend const * menubackend_; /// - lyx::frontend::Box * menubar_; + Box * menubar_; /// - lyx::frontend::WidgetMap widgets_; + WidgetMap widgets_; /// struct ItemInfo { /// @@ -91,4 +94,8 @@ private: /// ButtonList buttonlist_; }; + +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/XFormsToolbar.C b/src/frontends/xforms/XFormsToolbar.C index 283e630932..aa965320e8 100644 --- a/src/frontends/xforms/XFormsToolbar.C +++ b/src/frontends/xforms/XFormsToolbar.C @@ -38,16 +38,16 @@ #include #include -using lyx::frontend::Box; -using lyx::frontend::BoxList; - -using lyx::support::compare_ascii_no_case; - using std::distance; using std::endl; using std::string; using std::vector; +namespace lyx { + +using support::compare_ascii_no_case; + +namespace frontend { // some constants const int standardspacing = 2; // the usual space between items @@ -183,14 +183,21 @@ void XFormsToolbar::toolbarItem::generateInactivePixmaps() raw_inactive_data, &inactive_pixmap, 0, 0); } +} // namespace frontend +} // namespace lyx + Toolbars::ToolbarPtr make_toolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner) { + using lyx::frontend::XFormsToolbar return Toolbars::ToolbarPtr(new XFormsToolbar(tbb, owner)); } +namespace lyx { +namespace frontend { + XFormsToolbar::XFormsToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & o) : toolbar_(0), @@ -234,7 +241,6 @@ XFormsToolbar::XFormsToolbar(ToolbarBackend::Toolbar const & tbb, toolbar_->children().push_back(Box(padding, padding)); - using lyx::frontend::WidgetMap; owner_.metricsUpdated.connect(boost::bind(&WidgetMap::updateMetrics, &widgets_)); @@ -507,7 +513,7 @@ void XLayoutBox::open() void XLayoutBox::setEnabled(bool enable) { - ::setEnabled(combox_, enable); + lyx::frontend::setEnabled(combox_, enable); } @@ -530,3 +536,6 @@ void XLayoutBox::selected() } lyxerr << "ERROR (XLayoutBox::selected): layout not found!" << endl; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XFormsToolbar.h b/src/frontends/xforms/XFormsToolbar.h index 006e28162e..dc31ce5ab6 100644 --- a/src/frontends/xforms/XFormsToolbar.h +++ b/src/frontends/xforms/XFormsToolbar.h @@ -21,10 +21,12 @@ #include #include +namespace lyx { +namespace frontend { +class Tooltips; class XFormsToolbar; class XFormsView; -class Tooltips; class XLayoutBox: public LayoutBox { @@ -95,11 +97,11 @@ public: /// XFormsView::Position position_; /// - lyx::frontend::Box * toolbar_; + Box * toolbar_; /// - lyx::frontend::BoxList * toolbar_buttons_; + BoxList * toolbar_buttons_; /// - lyx::frontend::WidgetMap widgets_; + WidgetMap widgets_; typedef std::vector Funcs; @@ -117,4 +119,7 @@ public: boost::scoped_ptr layout_; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/XFormsView.C b/src/frontends/xforms/XFormsView.C index 7f7db7abcf..7cf8cd28aa 100644 --- a/src/frontends/xforms/XFormsView.C +++ b/src/frontends/xforms/XFormsView.C @@ -27,18 +27,19 @@ #include -using lyx::frontend::Box; - -using lyx::support::LibFileSearch; - using std::abs; using std::endl; using std::string; - //extern void AutoSave(BufferView *); extern void QuitLyX(); +namespace lyx { + +using support::LibFileSearch; + +namespace frontend { + extern "C" { static @@ -273,3 +274,6 @@ void XFormsView::busy(bool yes) const fl_activate_all_forms(); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index 8d96550ee3..f74b4ff288 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -22,6 +22,9 @@ #include +namespace lyx { +namespace frontend { + class XMiniBuffer; /** @@ -45,7 +48,7 @@ public: ~XFormsView(); /// Accessor to the appropriate layout Box. - lyx::frontend::Box & getBox(Position pos) const; + Box & getBox(Position pos) const; /** * show - display the top-level window @@ -88,10 +91,10 @@ private: void show_view_state(); /// The top-most box of the layout engine containing all other boxes. - lyx::frontend::Box window_; + Box window_; // Accessors to the various Boxes. - std::map box_map_; + std::map box_map_; /// the minibuffer boost::scoped_ptr minibuffer_; @@ -109,4 +112,8 @@ private: /// Pixmap icon_mask_; }; + +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/XLyXKeySym.C b/src/frontends/xforms/XLyXKeySym.C index 5a71008dab..a16a7bc6c1 100644 --- a/src/frontends/xforms/XLyXKeySym.C +++ b/src/frontends/xforms/XLyXKeySym.C @@ -21,6 +21,17 @@ using std::endl; using std::string; +bool operator==(LyXKeySym const & k1, LyXKeySym const & k2) +{ + using lyx::frontend::XLyXKeySym; + return static_cast(k1).keysym() + == static_cast(k2).keysym(); +} + + +namespace lyx { +namespace frontend { + XLyXKeySym::XLyXKeySym() : LyXKeySym(), keysym_(NoSymbol) { @@ -106,9 +117,5 @@ string const XLyXKeySym::print(key_modifier::state mod) const return kb_keymap::printKeySym(*this, mod); } - -bool operator==(LyXKeySym const & k1, LyXKeySym const & k2) -{ - return static_cast(k1).keysym() - == static_cast(k2).keysym(); -} +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XLyXKeySym.h b/src/frontends/xforms/XLyXKeySym.h index 93944204a2..dca9a9f6fd 100644 --- a/src/frontends/xforms/XLyXKeySym.h +++ b/src/frontends/xforms/XLyXKeySym.h @@ -15,6 +15,9 @@ #include #include "frontends/LyXKeySym.h" +namespace lyx { +namespace frontend { + /** * This is the XForms (X11) version of LyXKeySym. */ @@ -55,4 +58,7 @@ private: unsigned int keysym_; }; +} // namespace frontend +} // namespace lyx + #endif // XLYXKEYSYM_H diff --git a/src/frontends/xforms/XMiniBuffer.C b/src/frontends/xforms/XMiniBuffer.C index 40854a4b1f..54c983f030 100644 --- a/src/frontends/xforms/XMiniBuffer.C +++ b/src/frontends/xforms/XMiniBuffer.C @@ -25,13 +25,11 @@ #include -using lyx::frontend::Box; -using lyx::frontend::BoxList; -using lyx::frontend::WidgetMap; - using std::vector; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -358,3 +356,6 @@ FL_FREEBROWSER * create_freebrowser(void * parent) } } // namespace anon + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XMiniBuffer.h b/src/frontends/xforms/XMiniBuffer.h index afea4343c8..ea75f214cf 100644 --- a/src/frontends/xforms/XMiniBuffer.h +++ b/src/frontends/xforms/XMiniBuffer.h @@ -25,9 +25,13 @@ struct fl_freebrowser_; typedef fl_freebrowser_ FL_FREEBROWSER; +class Timeout; + +namespace lyx { +namespace frontend { + class XFormsView; class ControlCommandBuffer; -class Timeout; /// in xforms, the minibuffer is both a status bar and a command buffer class XMiniBuffer { @@ -105,9 +109,12 @@ private: /// are we showing an informational temporary message ? bool info_shown_; /// - lyx::frontend::Box * minibuffer_; + Box * minibuffer_; /// - lyx::frontend::WidgetMap widgets_; + WidgetMap widgets_; }; +} // namespace frontend +} // namespace lyx + #endif // XMINIBUFFER_H diff --git a/src/frontends/xforms/XPainter.C b/src/frontends/xforms/XPainter.C index e9e433953c..7bfbca941d 100644 --- a/src/frontends/xforms/XPainter.C +++ b/src/frontends/xforms/XPainter.C @@ -28,10 +28,13 @@ #include "support/lstrings.h" -using lyx::support::uppercase; - using std::string; +namespace lyx { + +using support::uppercase; + +namespace frontend { XPainter::XPainter(XWorkArea & xwa) : Painter(), owner_(xwa) @@ -137,11 +140,11 @@ void XPainter::arc(int x, int y, void XPainter::image(int x, int y, - int w, int h, - lyx::graphics::Image const & i) + int w, int h, + graphics::Image const & i) { - lyx::graphics::xformsImage const & image = - static_cast(i); + graphics::xformsImage const & image = + static_cast(i); XGCValues val; val.function = GXcopy; @@ -260,3 +263,6 @@ void XPainter::text(int x, int y, underline(f, x, y, xfont_metrics::width(s, ls, f)); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XPainter.h b/src/frontends/xforms/XPainter.h index 1be0ca6aab..e7de816b6e 100644 --- a/src/frontends/xforms/XPainter.h +++ b/src/frontends/xforms/XPainter.h @@ -17,8 +17,11 @@ #include - class LyXFont; + +namespace lyx { +namespace frontend { + class XWorkArea; /** @@ -91,7 +94,7 @@ public: /// draw an image from the image cache virtual void image(int x, int y, int w, int h, - lyx::graphics::Image const & image); + graphics::Image const & image); /// draw a string at position x, y (y is the baseline) virtual void text(int x, int y, @@ -118,4 +121,7 @@ private: XWorkArea & owner_; }; +} // namespace frontend +} // namespace lyx + #endif // XPAINTER_H diff --git a/src/frontends/xforms/XWorkArea.C b/src/frontends/xforms/XWorkArea.C index 5a6cc2e89b..ff5e6f534f 100644 --- a/src/frontends/xforms/XWorkArea.C +++ b/src/frontends/xforms/XWorkArea.C @@ -24,16 +24,14 @@ #include -using lyx::frontend::Box; -using lyx::frontend::BoxList; -using lyx::frontend::WidgetMap; - using std::abs; using std::dec; using std::endl; using std::hex; using std::string; +namespace lyx { +namespace frontend { namespace { @@ -634,3 +632,6 @@ void XWorkArea::putClipboard(string const & s) const fl_stuff_clipboard(work_area, 0, hold.data(), hold.size(), 0); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/XWorkArea.h b/src/frontends/xforms/XWorkArea.h index 570100df53..4936c38a22 100644 --- a/src/frontends/xforms/XWorkArea.h +++ b/src/frontends/xforms/XWorkArea.h @@ -22,7 +22,9 @@ class LyXView; -/// +namespace lyx { +namespace frontend { + class XWorkArea : public WorkArea { public: /// @@ -86,9 +88,12 @@ private: /// the current document's height (for scrollbar) int doc_height_; /// - lyx::frontend::Box * wa_box_; + Box * wa_box_; /// - lyx::frontend::WidgetMap widgets_; + WidgetMap widgets_; }; +} // namespace frontend +} // namespace lyx + #endif // XWORKAREA_H diff --git a/src/frontends/xforms/checkedwidgets.C b/src/frontends/xforms/checkedwidgets.C index 41b5b74640..532823e34f 100644 --- a/src/frontends/xforms/checkedwidgets.C +++ b/src/frontends/xforms/checkedwidgets.C @@ -19,10 +19,14 @@ #include "lyx_forms.h" -using lyx::support::isStrDbl; - using std::string; +namespace lyx { + +using support::isStrDbl; + +namespace frontend { + void addCheckedLyXLength(BCView & bcview, FL_OBJECT * input, FL_OBJECT * label) @@ -102,3 +106,6 @@ bool CheckedGlueLength::check() const return valid; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/checkedwidgets.h b/src/frontends/xforms/checkedwidgets.h index 5318e5c811..1088bbcaa9 100644 --- a/src/frontends/xforms/checkedwidgets.h +++ b/src/frontends/xforms/checkedwidgets.h @@ -12,10 +12,12 @@ #ifndef CHECKEDWIDGETS_H #define CHECKEDWIDGETS_H - #include "BCView.h" #include "forms_fwd.h" +namespace lyx { +namespace frontend { + void addCheckedLyXLength(BCView & bcview, FL_OBJECT * input, FL_OBJECT * label = 0); @@ -57,4 +59,7 @@ private: FL_OBJECT * label_; }; +} // namespace frontend +} // namespace lyx + #endif // CHECKEDWIDGETS_H diff --git a/src/frontends/xforms/fdesign_base.C b/src/frontends/xforms/fdesign_base.C index 3a9add497f..242ba736b9 100644 --- a/src/frontends/xforms/fdesign_base.C +++ b/src/frontends/xforms/fdesign_base.C @@ -13,6 +13,9 @@ #include "fdesign_base.h" #include "lyx_forms.h" +namespace lyx { +namespace frontend { + FD_base::~FD_base() { if (!form) @@ -23,3 +26,6 @@ FD_base::~FD_base() fl_free_form(form); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/fdesign_base.h b/src/frontends/xforms/fdesign_base.h index 26dfd3e660..dad3007955 100644 --- a/src/frontends/xforms/fdesign_base.h +++ b/src/frontends/xforms/fdesign_base.h @@ -12,13 +12,18 @@ #ifndef FDESIGN_BASE_H #define FDESIGN_BASE_H - #include "forms_fwd.h" +namespace lyx { +namespace frontend { + /// A base class for the fdesign-generated structs struct FD_base { virtual ~FD_base(); FL_FORM * form; }; +} // namespace frontend +} // namespace lyx + #endif // FDESIGN_BASE_H diff --git a/src/frontends/xforms/forms/fdfix.sh b/src/frontends/xforms/forms/fdfix.sh index 4e56a4d290..a744a149a9 100644 --- a/src/frontends/xforms/forms/fdfix.sh +++ b/src/frontends/xforms/forms/fdfix.sh @@ -1,4 +1,4 @@ -#!/bin/sh +b#!/bin/sh # # file fdfix.sh # This file is part of LyX, the document processor. diff --git a/src/frontends/xforms/forms/fdfixc.sed b/src/frontends/xforms/forms/fdfixc.sed index e9780b0ea7..80e0c377b7 100644 --- a/src/frontends/xforms/forms/fdfixc.sed +++ b/src/frontends/xforms/forms/fdfixc.sed @@ -16,6 +16,21 @@ s/[ ]*$// +# Immediately after line "#include form_xxx.h" +# open namespace lyx::frontend. +/^#include "form_/a\ +\ +namespace lyx {\ +namespace frontend { + + +# When the end of the file is reached, close namespace lyx::frontend. +$ a\ +\ +} // namespace frontend\ +} // namespace lyx + + # Delete blank lines and fdesign comments. /^$/d /generated with fdesign/d diff --git a/src/frontends/xforms/forms/fdfixh.sed b/src/frontends/xforms/forms/fdfixh.sed index fa17837069..bf9bf9f0ef 100644 --- a/src/frontends/xforms/forms/fdfixh.sed +++ b/src/frontends/xforms/forms/fdfixh.sed @@ -24,18 +24,25 @@ s/[ ]*$// /generated with fdesign/d -# Pretty formatting; add an empty line before "#endif" +# Immediately before line "#endif", close namespace lyx::frontend /#endif/i\ - +\ +} // namespace frontend\ +} // namespace lyx\ # Immediately after line "#define FD_xxx_h_" that starts off the header file, -# #include "fdesign_base.h" and append the contents of file EXTERN_FUNCS. +# * #include "fdesign_base.h"; +# * open namespace lyx::frontend and; +# * append the contents of file EXTERN_FUNCS. # This latter is a sorted, unique list of any function declarations. # The actual name of the file is inserted by the parent shell script. /#define FD/{ a\ \ #include "fdesign_base.h"\ +\ +namespace lyx {\ +namespace frontend {\ r EXTERN_FUNCS } diff --git a/src/frontends/xforms/forms_gettext.C b/src/frontends/xforms/forms_gettext.C index 75cf0b6dfd..1f8f5d1466 100644 --- a/src/frontends/xforms/forms_gettext.C +++ b/src/frontends/xforms/forms_gettext.C @@ -13,10 +13,10 @@ #include "support/lstrings.h" -namespace support = lyx::support; - using std::string; +namespace lyx { +namespace frontend { // Extract shortcut from "|" string string const scex(string const & str) @@ -32,3 +32,6 @@ string const idex(string const & str) support::split(str, identifier, '|'); return identifier; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/forms_gettext.h b/src/frontends/xforms/forms_gettext.h index b5895e429b..65a1318cae 100644 --- a/src/frontends/xforms/forms_gettext.h +++ b/src/frontends/xforms/forms_gettext.h @@ -14,10 +14,16 @@ #include +namespace lyx { +namespace frontend { + /// Extract shortcut from "|" string std::string const scex(std::string const &); /// Extract identifier from "|" string std::string const idex(std::string const &); +} // namespace frontend +} // namespace lyx + #endif // FORMS_GETTEXT_H diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index a2e8ecba19..df14095962 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -49,6 +49,13 @@ using lyx::support::AddName; using lyx::support::user_lyxdir; +using lyx::frontend::fontloader; +using lyx::frontend::getRGBColor; +using lyx::frontend::lyxColorHandler; +using lyx::frontend::LyXColorHandler; +using lyx::frontend::XformsColor; +using lyx::frontend::XFormsView; + namespace os = lyx::support::os; #ifndef CXX_GLOBAL_CSTD diff --git a/src/frontends/xforms/xfont_loader.C b/src/frontends/xforms/xfont_loader.C index 73703b343b..28030cb45b 100644 --- a/src/frontends/xforms/xfont_loader.C +++ b/src/frontends/xforms/xfont_loader.C @@ -26,13 +26,16 @@ #include -using lyx::support::LibFileSearch; -using lyx::support::OnlyPath; -using lyx::support::Systemcall; - using std::endl; using std::string; +namespace lyx { + +using support::LibFileSearch; +using support::OnlyPath; +using support::Systemcall; + +namespace frontend { // The global fontloader xfont_loader fontloader; @@ -381,3 +384,6 @@ bool xfont_loader::available(LyXFont const & f) getFontinfo(f.family(), f.series(), f.realShape()); return fontinfo[f.family()][f.series()][f.realShape()]->exist(); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xfont_loader.h b/src/frontends/xforms/xfont_loader.h index 2e8beb67dc..c86dec027f 100644 --- a/src/frontends/xforms/xfont_loader.h +++ b/src/frontends/xforms/xfont_loader.h @@ -12,10 +12,12 @@ #ifndef FONTLOADER_H_ #define FONTLOADER_H_ - #include #include "lyxfont.h" +namespace lyx { +namespace frontend { + class FontInfo; /** This class takes care of loading fonts. It uses FontInfo to make @@ -75,4 +77,7 @@ private: /// extern xfont_loader fontloader; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/frontends/xforms/xfont_metrics.C b/src/frontends/xforms/xfont_metrics.C index eba8c5f4da..a150e65df9 100644 --- a/src/frontends/xforms/xfont_metrics.C +++ b/src/frontends/xforms/xfont_metrics.C @@ -25,10 +25,10 @@ #include -using lyx::support::uppercase; - using std::string; +using lyx::support::uppercase; +using lyx::frontend::fontloader; namespace { diff --git a/src/frontends/xforms/xfont_metrics.h b/src/frontends/xforms/xfont_metrics.h index c4326be7cc..4b31b277be 100644 --- a/src/frontends/xforms/xfont_metrics.h +++ b/src/frontends/xforms/xfont_metrics.h @@ -13,9 +13,6 @@ #ifndef XFONT_METRICS_H #define XFONT_METRICS_H - - - #include class LyXFont; diff --git a/src/frontends/xforms/xformsBC.C b/src/frontends/xforms/xformsBC.C index 99f20eaab5..354d55cfa3 100644 --- a/src/frontends/xforms/xformsBC.C +++ b/src/frontends/xforms/xformsBC.C @@ -20,6 +20,8 @@ using std::string; +namespace lyx { +namespace frontend { xformsBC::xformsBC(ButtonController const & parent, string const & cancel, string const & close) @@ -43,3 +45,6 @@ void xformsBC::setButtonLabel(FL_OBJECT * obj, string const & label) const { fl_set_object_label(obj, label.c_str()); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xformsBC.h b/src/frontends/xforms/xformsBC.h index e7725c3baa..085ca7174a 100644 --- a/src/frontends/xforms/xformsBC.h +++ b/src/frontends/xforms/xformsBC.h @@ -19,6 +19,9 @@ #include "BCView.h" #include "gettext.h" +namespace lyx { +namespace frontend { + class xformsBC : public GuiBC { public: /// @@ -36,4 +39,7 @@ private: void setButtonLabel(FL_OBJECT *, std::string const & label) const; }; +} // namespace frontend +} // namespace lyx + #endif // XFORMSBC_H diff --git a/src/frontends/xforms/xformsImage.C b/src/frontends/xforms/xformsImage.C index bdb98f49cd..49662b9972 100644 --- a/src/frontends/xforms/xformsImage.C +++ b/src/frontends/xforms/xformsImage.C @@ -35,6 +35,7 @@ #include +using lyx::frontend::getRGBColor; using lyx::support::float_equal; using lyx::support::prefixIs; diff --git a/src/frontends/xforms/xformsImage.h b/src/frontends/xforms/xformsImage.h index 6d4d3ccce1..f7e7e8eb0f 100644 --- a/src/frontends/xforms/xformsImage.h +++ b/src/frontends/xforms/xformsImage.h @@ -16,7 +16,6 @@ #ifndef XFORMSIMAGE_H #define XFORMSIMAGE_H - #include "graphics/GraphicsImage.h" #include diff --git a/src/frontends/xforms/xformsTimeout.C b/src/frontends/xforms/xformsTimeout.C index 324a280c60..c9f5c26f09 100644 --- a/src/frontends/xforms/xformsTimeout.C +++ b/src/frontends/xforms/xformsTimeout.C @@ -17,12 +17,15 @@ #include "lyx_forms.h" - Timeout::Timeout(unsigned int msec, Type t) - : pimpl_(new xformsTimeout(*this)), type(t), timeout_ms(msec) + : pimpl_(new lyx::frontend::xformsTimeout(*this)), + type(t), timeout_ms(msec) {} +namespace lyx { +namespace frontend { + namespace { extern "C" @@ -77,3 +80,6 @@ void xformsTimeout::reset() { timeout_id = -1; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xformsTimeout.h b/src/frontends/xforms/xformsTimeout.h index 3a127d8468..34aff02df0 100644 --- a/src/frontends/xforms/xformsTimeout.h +++ b/src/frontends/xforms/xformsTimeout.h @@ -16,6 +16,8 @@ #include "frontends/Timeout.h" +namespace lyx { +namespace frontend { /** * This class executes the callback when the timeout expires @@ -41,4 +43,7 @@ private: int timeout_id; }; +} // namespace frontend +} // namespace lyx + #endif // XFORMSTIMEOUT_H diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index 1901b37236..50fb6409d4 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -30,19 +30,22 @@ #include -using lyx::support::AbsolutePath; -using lyx::support::FileInfo; -using lyx::support::isStrDbl; -using lyx::support::OnlyPath; -using lyx::support::subst; -using lyx::support::trim; - using std::make_pair; using std::ofstream; using std::vector; using std::string; +namespace lyx { + +using support::AbsolutePath; +using support::FileInfo; +using support::isStrDbl; +using support::OnlyPath; +using support::subst; +using support::trim; + +namespace frontend { std::string const buildChoiceLengthString() { @@ -557,3 +560,6 @@ bool RWInfo::ReadableFile(string const & name) return true; } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xforms_helpers.h b/src/frontends/xforms/xforms_helpers.h index 7a514945d5..0d003d1ea7 100644 --- a/src/frontends/xforms/xforms_helpers.h +++ b/src/frontends/xforms/xforms_helpers.h @@ -12,7 +12,6 @@ #ifndef XFORMSHELPERS_H #define XFORMSHELPERS_H - #include "forms_fwd.h" #include "Color.h" @@ -22,6 +21,9 @@ class LyXLength; +namespace lyx { +namespace frontend { + /// parse "&Save" etc. to <"Save", "#S">. Does not handle && std::pair parse_shortcut(std::string const & str); @@ -116,4 +118,8 @@ private: /// static std::string error_message; }; + +} // namespace frontend +} // namespace lyx + #endif // XFORMSHELPERS_H diff --git a/src/frontends/xforms/xforms_resize.C b/src/frontends/xforms/xforms_resize.C index ddfc769078..d84aa560be 100644 --- a/src/frontends/xforms/xforms_resize.C +++ b/src/frontends/xforms/xforms_resize.C @@ -18,6 +18,8 @@ #include // std::max. Use FL_max in .c code... #include "lyx_forms.h" +namespace lyx { +namespace frontend { namespace { @@ -165,3 +167,6 @@ void scale_form_horizontally(FL_FORM * form, double factor) scale_tabfolder_horizontally(ob, factor); } } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xforms_resize.h b/src/frontends/xforms/xforms_resize.h index cc268743f7..7243dc8401 100644 --- a/src/frontends/xforms/xforms_resize.h +++ b/src/frontends/xforms/xforms_resize.h @@ -12,9 +12,11 @@ #ifndef XFORMS_RESIZE_H #define XFORMS_RESIZE_H - #include "forms_fwd.h" +namespace lyx { +namespace frontend { + /** Ascertains the scaling factor needed to ensure that all labels fit within their button. @@ -30,4 +32,7 @@ double get_scale_to_fit(FL_FORM * form); */ void scale_form_horizontally(FL_FORM * form, double factor); +} // namespace frontend +} // namespace lyx + #endif // XFORMS_RESIZE_H diff --git a/src/frontends/xforms/xscreen.C b/src/frontends/xforms/xscreen.C index 6465b5fee3..826dae7635 100644 --- a/src/frontends/xforms/xscreen.C +++ b/src/frontends/xforms/xscreen.C @@ -21,6 +21,8 @@ using std::endl; +namespace lyx { +namespace frontend { namespace { @@ -171,3 +173,6 @@ void XScreen::expose(int x, int y, int w, int h) XSendEvent(fl_get_display(), owner_.getWin(), False, 0, &ev); } + +} // namespace frontend +} // namespace lyx diff --git a/src/frontends/xforms/xscreen.h b/src/frontends/xforms/xscreen.h index 68eb4cca0f..00bfc2538e 100644 --- a/src/frontends/xforms/xscreen.h +++ b/src/frontends/xforms/xscreen.h @@ -13,13 +13,15 @@ #ifndef XSCREEN_H #define XSCREEN_H - #include "screen.h" #include // for Pixmap, GC class WorkArea; -class XWorkArea; +namespace lyx { +namespace frontend { + +class XWorkArea; /** The class XScreen is used for the main Textbody. Concretely, the screen is held in a pixmap. This pixmap is kept up to @@ -68,4 +70,7 @@ private: GC gc_copy; }; +} // namespace frontend +} // namespace lyx + #endif diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c082574b2a..b4ef5755c0 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2004-05-19 Angus Leeming + + * insetcite.[Ch]: small change because namespace biblio is + now namespace lyx::biblio. + 2004-05-15 Georg Baum * insettabular.[Ch] (buffer): make Buffer * argument const diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index 86e675f0fc..ef4e21acf2 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -36,6 +36,8 @@ using std::ostream; using std::vector; using std::map; +namespace biblio = lyx::biblio; + namespace { diff --git a/src/insets/insetcite.h b/src/insets/insetcite.h index 12b8b1d3bb..8a5091f33f 100644 --- a/src/insets/insetcite.h +++ b/src/insets/insetcite.h @@ -48,9 +48,9 @@ private: struct Cache { /// - Cache() : engine(biblio::ENGINE_BASIC) {} + Cache() : engine(lyx::biblio::ENGINE_BASIC) {} /// - biblio::CiteEngine engine; + lyx::biblio::CiteEngine engine; /// InsetCommandParams params; /// diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 42a7b708da..defcbe9689 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -128,6 +128,8 @@ using std::pair; using std::string; using std::istringstream; +namespace biblio = lyx::biblio; + extern BufferList bufferlist; extern LyXServer * lyxserver;