/** * \file guiapi.C * Copyright 2002 the LyX Team * Read the file COPYING * * \author John Levon */ #include #include "guiapi.h" #include "QAbout.h" #include "QAboutDialog.h" #include "QBibitem.h" #include "QBibitemDialog.h" #include "QBibtex.h" #include "QBibtexDialog.h" #include "QCharacter.h" #include "QCharacterDialog.h" #include "QCitation.h" #include "QCitationDialog.h" //#include "QDocument.h" #include "QError.h" #include "QErrorDialog.h" #include "QERT.h" #include "QERTDialog.h" #include "QExternal.h" #include "QExternalDialog.h" #include "QFloat.h" #include "QFloatDialog.h" //#include "QForks.h" // Here would be an appropriate point to lecture on the evils // of the Qt headers, those most fucked up of disgusting ratholes. // But I won't. #undef signals #include "QGraphics.h" #include "QGraphicsDialog.h" #include "QInclude.h" #include "QIncludeDialog.h" #include "QIndex.h" #include "QIndexDialog.h" #include "QLog.h" #include "QLogDialog.h" #include "QMinipage.h" #include "QMinipageDialog.h" //#include "QParagraph.h" #include "QPreamble.h" #include "QPreambleDialog.h" //#include "QPreferences.h" #include "QPrint.h" #include "QPrintDialog.h" #include "QRef.h" #include "QRefDialog.h" #include "QSearch.h" #include "QSearchDialog.h" //#include "QSendto.h" #include "QShowFile.h" #include "QShowFileDialog.h" #include "QSpellchecker.h" #include "QSpellcheckerDialog.h" //#include "QTabular.h" #include "QTabularCreate.h" #include "QTabularCreateDialog.h" #include "QTexinfo.h" #include "QTexinfoDialog.h" #ifdef HAVE_LIBAIKSAURUS #include "QThesaurus.h" #include "QThesaurusDialog.h" #endif #include "QToc.h" #include "QTocDialog.h" #include "QURL.h" #include "QURLDialog.h" #include "QVCLog.h" #include "QVCLogDialog.h" #include "Qt2BC.h" #include "controllers/GUI.h" #include "insets/inseterror.h" #include "LyXView.h" #include "ControlAboutlyx.h" #include "ControlBibitem.h" #include "ControlBibtex.h" #include "ControlCharacter.h" #include "ControlCitation.h" #include "ControlError.h" #include "ControlERT.h" #include "ControlExternal.h" #include "ControlFloat.h" #include "ControlForks.h" #include "ControlGraphics.h" #include "insets/insetgraphicsParams.h" #include "ControlInclude.h" #include "ControlIndex.h" #include "ControlLog.h" #include "ControlMinipage.h" #include "ControlParagraph.h" #include "ControlPreamble.h" #include "ControlPrint.h" #include "ControlRef.h" #include "ControlSearch.h" #include "ControlSendto.h" #include "ControlShowFile.h" #include "ControlSpellchecker.h" #include "ControlTabularCreate.h" #include "ControlTexinfo.h" #include "ControlThesaurus.h" #include "ControlToc.h" #include "ControlUrl.h" #include "ControlVCLog.h" namespace { // anon // I belive that this one is buggy (Lgb) // But not if used correctly. (Lgb) template class GUISingleton { public: static T & get(LyXView & lv, Dialogs & d) { static T t(lv, d); return t; } }; GUISingleton > controlCharacterSingleton; GUISingleton > controlCitationSingleton; GUISingleton > controlERTSingleton; GUISingleton > controlIndexSingleton; GUISingleton > controlMinipageSingleton; //GUISingleton formPreferencesSingleton; GUISingleton > controlRefSingleton; //GUISingleton formTabularSingleton; GUISingleton > controlTocSingleton; GUISingleton > controlUrlSingleton; } // anon extern "C" { void gui_ShowAboutlyx(LyXView & lv, Dialogs & d) { static GUI cal(lv, d); cal.show(); } void gui_ShowBibitem(InsetCommand * ic, LyXView & lv, Dialogs & d) { static GUI cbi(lv, d); cbi.showInset(ic); } void gui_ShowBibtex(InsetCommand * ic, LyXView & lv, Dialogs & d) { static GUI cbt(lv, d); cbt.showInset(ic); } void gui_ShowCharacter(LyXView & lv, Dialogs & d) { controlCharacterSingleton.get(lv, d).show(); } void gui_SetUserFreeFont(LyXView & lv, Dialogs & d) { controlCharacterSingleton.get(lv, d).apply(); } void gui_ShowCitation(InsetCommand * ic, LyXView & lv, Dialogs & d) { controlCitationSingleton.get(lv, d).showInset(ic); } void gui_CreateCitation(string const & s, LyXView & lv, Dialogs & d) { controlCitationSingleton.get(lv, d).createInset(s); } void gui_ShowDocument(LyXView & lv, Dialogs & d) { //static QDocument fd(&lv, &d); //fd.show(); } void gui_ShowError(InsetError * ie, LyXView & lv, Dialogs & d) { static GUI ce(lv, d); ce.showInset(ie); } void gui_ShowERT(InsetERT * ie, LyXView & lv, Dialogs & d) { controlERTSingleton.get(lv, d).showInset(ie); } void gui_UpdateERT(InsetERT * ie, LyXView & lv, Dialogs & d) { controlERTSingleton.get(lv, d).showInset(ie); } void gui_ShowExternal(InsetExternal * ie, LyXView & lv, Dialogs & d) { static GUI ce(lv, d); ce.showInset(ie); } void gui_ShowFile(string const & f, LyXView & lv, Dialogs & d) { static GUI csf(lv, d); csf.showFile(f); } void gui_ShowFloat(InsetFloat * ifl, LyXView & lv, Dialogs & d) { static GUI cf(lv, d); cf.showInset(ifl); } void gui_ShowForks(LyXView & lv, Dialogs & d) { #if 0 static GUI cf(lv, d); cf.show(); #endif } void gui_ShowGraphics(InsetGraphics * ig, LyXView & lv, Dialogs & d) { static GUI cg(lv, d); cg.showInset(ig); } void gui_ShowInclude(InsetInclude * ii, LyXView & lv, Dialogs & d) { static GUI ci(lv, d); ci.showInset(ii); } void gui_ShowIndex(InsetCommand * ic, LyXView & lv, Dialogs & d) { controlIndexSingleton.get(lv, d).showInset(ic); } void gui_CreateIndex(string const & s, LyXView & lv, Dialogs & d) { controlIndexSingleton.get(lv, d).createInset(s); } #if 0 void gui_ShowInfo(InsetInfo *, LyXView & lv, Dialogs & d) { } #endif void gui_ShowLogFile(LyXView & lv, Dialogs & d) { static GUI cl(lv, d); cl.show(); } void gui_ShowMathPanel(LyXView & lv, Dialogs & d) { //static QMathsPanel fmp(&lv, &d); //fmp.show(); } void gui_ShowMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { controlMinipageSingleton.get(lv, d).showInset(im); } void gui_UpdateMinipage(InsetMinipage * im, LyXView & lv, Dialogs & d) { controlMinipageSingleton.get(lv, d).showInset(im); } void gui_ShowParagraph(LyXView & lv, Dialogs & d) { #if 0 static GUI cp(lv, d); cp.show(); #endif } #if 0 void gui_UpdateParagraph(LyXView & lv, Dialogs & d) { #warning FIXME! // This should be the same object as in gui_ShowParagraph static GUI cp(lv, d); #if 0 cp. #endif } #endif void gui_ShowPreamble(LyXView & lv, Dialogs & d) { static GUI cp(lv, d); cp.show(); } void gui_ShowPreferences(LyXView & lv, Dialogs & d) { //formPreferencesSingleton.get(lv, d).show(); } void gui_ShowPrint(LyXView & lv, Dialogs & d) { static GUI cp(lv, d); cp.show(); } void gui_ShowRef(InsetCommand * ic, LyXView & lv, Dialogs & d) { controlRefSingleton.get(lv, d).showInset(ic); } void gui_CreateRef(string const & s, LyXView & lv, Dialogs & d) { controlRefSingleton.get(lv, d).createInset(s); } void gui_ShowSearch(LyXView & lv, Dialogs & d) { static GUI cs(lv, d); cs.show(); } void gui_ShowSendto(LyXView & lv, Dialogs & d) { #if 0 static GUI cs(lv, d); cs.show(); #endif } void gui_ShowSpellchecker(LyXView & lv, Dialogs & d) { static GUI cp(lv, d); cp.show(); } void gui_ShowSpellcheckerPreferences(LyXView & lv, Dialogs & d) { //formPreferencesSingleton.get(lv, d).showSpellPref(); } void gui_ShowTabular(InsetTabular * it, LyXView & lv, Dialogs & d) { //formTabularSingleton.get(lv, d).showInset(it); } void gui_UpdateTabular(InsetTabular * it, LyXView & lv, Dialogs & d) { //formTabularSingleton.get(lv, d).updateInset(it); } void gui_ShowTabularCreate(LyXView & lv, Dialogs & d) { static GUI ctc(lv, d); ctc.show(); } void gui_ShowTexinfo(LyXView & lv, Dialogs & d) { static GUI ct(lv, d); ct.show(); } void gui_ShowThesaurus(string const & s, LyXView & lv, Dialogs & d) { #ifdef HAVE_LIBAIKSAURUS static GUI ct(lv, d); ct.showEntry(s); #endif } void gui_ShowTOC(InsetCommand * ic, LyXView & lv, Dialogs & d) { controlTocSingleton.get(lv, d).showInset(ic); } void gui_CreateTOC(string const & s, LyXView & lv, Dialogs & d) { controlTocSingleton.get(lv, d).createInset(s); } void gui_ShowUrl(InsetCommand * ic, LyXView & lv, Dialogs & d) { controlUrlSingleton.get(lv, d).showInset(ic); } void gui_CreateUrl(string const & s, LyXView & lv, Dialogs & d) { controlUrlSingleton.get(lv, d).createInset(s); } void gui_ShowVCLogFile(LyXView & lv, Dialogs & d) { static GUI cv(lv, d); cv.show(); } } // extern "C"