From: Lars Gullik Bjønnes Date: Fri, 20 May 2005 06:36:29 +0000 (+0000) Subject: move gnome subdir to the Attic X-Git-Tag: 1.6.10~14279 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9601a476f016dc7855be9d4e8709a036822cb3ad;p=features.git move gnome subdir to the Attic git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9959 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 6d94a49d94..8b41ca10f4 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,7 @@ +2005-05-20 Lars Gullik Bjonnes + + * Move the gnome subdir to the Attic + 2005-04-17 Georg Baum * Dialogs.C (Dialogs): (re-)connect hide() and hideSlot() diff --git a/src/frontends/gnome/.cvsignore b/src/frontends/gnome/.cvsignore deleted file mode 100644 index 141d1a3af1..0000000000 --- a/src/frontends/gnome/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -*.deps -*.lo -.libs -libgnome.la diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog deleted file mode 100644 index 9480dfa4e2..0000000000 --- a/src/frontends/gnome/ChangeLog +++ /dev/null @@ -1,598 +0,0 @@ -2005-01-20 Asger Ottar Alstrup - - * support.c: use the HAVE_UNISTD_H preprocessor guard. - -2005-01-10 Angus Leeming - - * lyx_gui.C: use support/package.h to provide the paths to the - various directories used by LyX. - -2005-01-04 Jürgen Spitzmüller - - * lyx_gui.C: change getDVI() to int. - -2004-12-14 Angus Leeming - - * Makefile.am (AM_CPPFLAGS): Remove trailing slash from -Ifoo/ - to overcome bug in the MinGW port of g++ 3.4.2. - -2004-07-24 Lars Gullik Bjonnes - - * lyx_gui.C: - * GAbout.C: change "support/std_sstream.h" to - -2004-05-28 Lars Gullik Bjonnes - - * Makefile.am (libgnome_la_SOURCES): add support.c and support.h - -2004-03-17 Angus Leeming - - * Dialogs.C, Dialogs2.C, Dialogs_impl.h, Makefile.am: remove - mention of the forks dialog. - -2004-02-01 Lars Gullik Bjonnes - - * GFloat.C (update): "c" -> 'c' in calls to contains - -2003-12-14 Michael Schmitt - - * Dialogs.C: - * Dialogs2.C: - * Dialogs_impl.h: - * Makefile.am: remove minipage - -2003-10-08 Angus Leeming - - Fix doxygen warnings. - - * GView.C: \file GView.C -> \file gnome/GView.C - * GView.h: \file GView.h -> \file gnome/GView.h - -2003-09-21 Lars Gullik Bjønnes - - * lyx_gui.C (parse_init): fix new bug - -2003-09-09 Lars Gullik Bjønnes - - * GView.C: change Assert to BOOST_ASSERT - * GnomeBase.C: ditto - -2003-07-21 Angus Leeming - - * lyx_gui.C (reset): use namespace lyx::graphics rather than grfx - shortcut. - -2003-06-28 Lars Gullik Bjønnes - - * FileDialog.C: fix const type order - -2003-02-21 Angus Leeming - - * Timeout_pimpl.[Ch]: removed. - * gnomeTimeout.[Ch]: new files, replacing the above. - The gnomeTimeout class derives from Timeout::Impl. - -2003-02-21 Angus Leeming - - * FileDialog.C (FileDialog): no need for LyXView *. - -2003-02-14 John Levon - - * FileDialog.C: remove spurious allow/prohibitInput() - -2003-02-12 Michael A. Koziarski - - * GChanges.C - * GChanges.h - * dialogs/GChanges.glade: implement the Changes dialog - -2003-02-01 Michael A. Koziarski - - Major changes to make the gnome frontend compile and work again. - - Credit to Martin Craig who - actually did the work, I just cleaned his patch up. - - Removed Files: - * GUIRuntime.C - - Added Files: - * Dialogs2.C - * Dialogs_impl.h - * lyx_gui.C - - Changed Files: - * Dialogs.C - * FileDialog.C - * GAbout.[Ch] - * GERT.[Ch] - * GError.[Ch] - * GFloat.[Ch] - * GLog.[Ch] - * GPreamble.[Ch] - * GTabularCreate.[Ch] - * GUrl.[Ch] - * GnomeBase.[Ch] - * Makefile.am - * Timeout_pimpl.C - -2002-12-16 Angus Leeming - - * Makefile.am: remove the if USE_BASIC_IMAGE_LOADER test. - -2002-12-01 Lars Gullik Bjønnes - - * several files: ws changes - -2002-09-25 Angus Leeming - - * Dialogs.C: - * FileDialog.C: doxygen fixes. - - * GnomeBase.h: rename template FormCB as GnomeCB to avoid doxygen - problems with multiple classes (xforms amd gnome) having the same name. - - * GAbout.[Ch]: - * GERT.[Ch]: - * GError.[Ch]: - * GFloat.[Ch]: - * GLog.[Ch]: - * GPreamble.[Ch]: - * GTabularCreate.[Ch]: - * GUrl.[Ch]: associated change. - -2002-06-15 Michael A. Koziarski - - * Dialogs.C - * Makefile.am: Necessary changes for the various new dialogs - * GERT.C - * GERT.h - * dialogs/GERT.glade: Make ERT Properties dialog follow the GNOME hig. - * GLog.C: use std::string, all the conversion is wasteful - * GFloat.C - * GFloat.h - * dialogs/GFloat.glade: Implement the Float Properties Dialog - * dialogs/GAbout.glade - * GAbout.C - * GAbout.h: Temporary Aboutlyx implementation, waiting on some - gtkmm bugs to finalise it. - -2002-06-10 Lars Gullik Bjønnes - - * gnomeBC.C: do not include ButtonController.tmpl - -2002-06-03 Michael A. Koziarski - - * dialogs/GLog.C - * GLog.C - * GLog.h: Implement Log view class - * accessors.py: update for new glade format - -2002-06-02 Michael A. Koziarski - - == Gtkmm2 upgrade == - - * dialogs/*: Updated to glade-2 format. - * Dialogs.C: add() calls updated - * GError.C - * GError.h - * GERT.C - * GERT.h - * GPreamble.C - * GPreamble.h - * GTabularCreate.C - * GTabularCreate.h - * GUIRunTime.C - * GUrl.C - * GUrl.h: updated for gtkmm2 - * GnomeBase.C - * GnomeBase.h: updated for gtkmm2 and libglademm. - * gnome_helpers.C - * gnome_helpers.h: Cruft removed. Blasted X.h #defines #undef'd - * Timeout_pimpl.C - * Timeout_pimpl.h - * GUIRuntime.C: fix up the references to Gnome::* to use Gtk::*, - slight other changes required - * Makefile.am: all neccessary changes, mostly including stuff - that's been moved into src/frontends/xforms - - - -2002-05-23 John Levon - - * FileDialog.C: LyXView moved into frontends/ - -2002-04-09 Michael A. Koziarski - - * dialoges/GERT.glade - * dialoges/GError.glade - * dialoges/GUrl.glade - * dialoges/GTabularCreate.glade: Added, I left them out of the - last commit - -2002-04-08 Lars Gullik Bjønnes - - * Makefile.am: change to work correctly with dist - -2002-03-29 Michael A. Koziarski - - * GPreamble.C - * GPreamble.h - * Makefile.am - * dialogs/GPreamble.glade:Implemented Preamble dialog - * Dialogs.C - * GERT.C - * GERT.h - * GTabularCreate.C - * GTabularCreate.h - * GUrl.C - * GUrl.h - * GError.C - * GError.h: Renamed classes to match the filenames - * dialogs/GERT.glade - * dialogs/GTabularCreate.glade - * dialogs/GUrl.glade - * dialogs/GError.glade: FormX isn't used for classes or files, so - it shouldn't be used for ui files either. - * dialogs/FormERT.glade - * dialogs/FormTabularCreate.glade - * dialogs/FormUrl.glade - * dialogs/FormError.glade - * dialogs/diaerror.glade - * dialogs/diahelpcopyright.glade - * dialogs/diahelpcredits.glade - * dialogs/diainsertcitation.glade - * dialogs/diainsertindex.glade - * dialogs/diainserttabular.glade - * dialogs/diainserturl.glade - * dialogs/diaprint.glade - * dialogs/diatoc.glade: old glade files. Removed - -2002-03-26 Michael A. Koziarski - - * Makefile.am: Moved all 4 active Form* dialogs to new Filenames. - * Dialogs.C: Fixes for the Renaming and #include cleanup - * GERT.C - * GERT.h - * GTabularCreate.C - * GTabularCreate.h - * GUrl.C - * GUrl.h - * GError.C - * GError.h: #include Fixes for the renaming. cruft tidyup - * README: Reflect new naming convention - * GnomeBase.C: cleaned up use of dialog_. Fix for bug #169, - Thanks Angus! - * FormCitation.C - * FormCitation.h - * FormCopyright.C - * FormCopyright.h - * FormCredits.C - * FormCredits.h - * FormIndex.C - * FormIndex.h - * FormPrint.C - * FormPrint.h - * FormRef.C - * FormRef.h - * FormToc.C - * FormToc.h: Removed, they're old, unused files. - -2002-03-21 Lars Gullik Bjønnes - - * most files: ws cleanup - -2002-03-16 Michael A. Koziarski - - * Makefile.am: Cleanup and linking fix. - * README: Added procedure for adding a new dialog. - * Dialogs.C (tooltipsEnable): new method. - -2002-03-14 Michael A. Koziarski - - * Timeout_pimpl.C - * Timeout_pimpl.h: implemented running to fix compilation, linking - fix still to come - -2002-03-11 Lars Gullik Bjønnes - - * docygen fixes. - -2002-03-05 Angus Leeming - - * GUIRunTime.C (initialiseGraphics): use the xforms image loader if - your version of the xforms libraries is up to the task. - - * Makefile.am: link in the xforms image loader if so configured. - -2002-03-04 Angus Leeming - - * Dialogs.C (redrawGUI): removed to frontends/Dialogs.C - - * GUIRunTime.C (initialiseGraphics): new static method - -2002-03-02 Lars Gullik Bjønnes - - * Makefile.am: get rid of LYX_LIBS - -2002-02-10 Michael A. Koziarski - - * FormERT.C - * FormERT.h - * Dialogs.C - * dialogs/FormERT.glade: Implemented FormERT, still seeing the - weird crashes - * GnomeBase.C: add debug message to help track down the "twice OK" - bug - * gnomeBC.C: Fix compilation - -2002-01-12 Michael A. Koziarski - - * Menubar_pimpl.C - * Menubar_pimpl.h - * mainapp.h - * mainapp.C: Removed, We should behave similarly to the qt2 - frontend, so I've removed the LyXGnomified and menubar code. The - menubar wasn't working properly anyway. - -2002-01-12 Michael A. Koziarski - - * various: Cleaned out the old stuff, standardised the new - stuff. - * GnomeBase.C - * GnomeBase.h: Changed the constructor to take one argument. The - dialog name. The path and name of the glade files can be - calculated from there. These two now provide default validate() & - *Clicked functions. - * FormUrl.C - * FormUrl.h - * FormError.C - * FormError.h - * FormTabularCreate.C - * FormTabularCreate.h: updated them to use the new system. - Removed Local inline *Clicked functions as they're now in the base - class. - * README: new, brief outline of what I'm doing here. - * accessors.py: Described in README, generates the accessor - functions from the glade file. - -2002-01-12 Michael A. Koziarski - - * Menubar_pimpl.C - * Menubar_pimpl.h - * mainapp.h - * mainapp.C: Removed, We should behave similarly to the qt2 - frontend, so I've removed the LyXGnomified and menubar code. The - menubar wasn't working properly anyway. - -2002-01-08 Martin Vermeer - - * Menubar_pimpl.C (composeUIInfo): - (update): use FuncStatus - -2002-01-03 Michael Koziarski - - * Dialogs.h: fix compilation. - * Makefile.am: ditto. - * GUIRunTime.C: ditto. Supply a getScreenDPI(). - -2001-12-19 Jean-Marc Lasgouttes - - * Timeout_pimpl.h: do not include in header files. - -2001-12-05 Lars Gullik Bjønnes - - * FormCitation.C: - * GUIRunTime.C: change "while(" to "while (" - -2001-09-27 Angus Leeming - - * Dialogs.C: remove splash dialog code. - - * Makefile.am: remove splash dialog files. - -2001-09-09 Lars Gullik Bjønnes - - * Makefile.am (libgnome_la_LIBADD): depend on the gui libs. - (libgnome_la_SOURCES): sort - -2001-08-27 John Levon - - * GUIRunTime.C: initApplication() should take a int & argc, add debug - -2001-07-19 Baruch Even - - * Menubar_pimpl.C: Renamed LyXFunc::Dispatch to LyXFunc::dispatch. - -2001-07-16 Baruch Even - - * GUIRunTime.C: Added some functions that were required lately. - -2001-07-16 Baruch Even - - * Makefile.am: - * Dialogs.C: Removed Citation and Copyright dialogs from build. Left them - in repository until they get redone as About Dialog. - - * FileDialog.C: - * Menubar_pimpl.C: - * Menubar_pimpl.h: - * mainapp.C: - * mainapp.h: Various fixed to get Gnome FE (FrontEnd) to compile again. - -2001-07-13 Angus Leeming - - Consistent use of Lsstream.h: - * FormCredits.C (build): std::stringstream -> stringstream. - -2001-06-16 Angus Leeming - - * gnomeBC.h: clean-up of included files. - -2001-06-14 Angus Leeming - - * FileDialog.C: - * FormCitation.C: - * FormCopyright.C: - * FormCredits.C: - * FormError.C: - * FormIndex.C: - * FormPrint.C: - * FormRef.C: - * FormTabularCreate.C: - * FormToc.C: - * FormUrl.C: - * GnomeBase.C: - * Menubar_pimpl.C: - * gnome_helpers.C: - * mainapp.C: removed // -*- C++ -*- as first line. - - * FormTabularCreate.h: - * FormToc.h: - * Timeout_pimpl.h: added // -*- C++ -*- as first line. - -2001-05-08 Michael A. Koziarski - - * FormTabularCreate[Ch]: - * dialogs: - * Makefile.am: - * Dialogs.C: Created the FormCharacter Dialog and altered the - other files to include it. - -2001-04-29 Baruch Even - - * Dialogs.C: Added an include for ControlSplash which is required - in GUI.h but is not included there. - - * GnomeBase.C: Changed an Assert to lyx::Assert. - -2001-04-17 Lars Gullik Bjønnes - - * FormIndex.C: delete duplicate include files - -2001-04-16 Allan Rae - - * gnomeBC.C (setButtonLabel): - * Menubar_pimpl.C (updateAllLists): - * GnomeBase.C (loadXML): #warning triggers an error on Sun CC 6.0 as - an unrecognised preprocessor directive. So ensure they're wrapped. - -2001-04-03 Baruch Even - - * FileDialog.C: Added file to provide the gnome file dialog. - -2001-04-03 John Levon - - * Dialogs.C: s/popup/dialog/ - - * FormUrl.C: - * GnomeBase.C: - * GnomeBase.h: s/ControlButton/ControlButtons/ - s/UndoAll/Restore/ - -2001-04-02 Michael Koziarski - - * FormCopyright.[Ch]: Reimplemented as an MVC dialog. - - * gnome_helpers.C: Some castings to avoid compilation break. - -2001-04-01 Baruch Even - - * GUIRuntime.C (initApplication): Changed strings to non-static. - -2001-03-30 Baruch Even - - * FormCredits.C: Added the formatting of the credits text. - - * gnome_helpers.[Ch]: Added functions to get font name from font. - -2001-03-30 Baruch Even - - * GnomeBase.[Ch]: Added the dialog as a responsibility. - - * FormUrl.[Ch]: Changed accordingly. - * FormCredits.[Ch]: ditto. - - * gnomeBC.[Ch]: Fixed to get it to compile. - - * gnome_helpers.h: Changed declaration from const char * to char const * - -2001-03-30 Angus Leeming - - * GnomeBase.[Ch]: changed ControlBase to ControlButton. - -2001-03-29 Angus Leeming - - * gnomeBC.[Ch]: Patched in a slight reworking of Baruch Even's patch. - Code moved into the generic template base class. Replaced - setCancelCloseButton() with setButtonLabel(). - -2001-03-29 Baruch Even - - * gnomeBC.[Ch]: Changed to use the new GuiBC template. - -2001-03-29 Baruch Even - - * FormUrl.C (d-tor): - * FormCredits.C (d-tor): Removed the dialog_->destroy(), it was causing - crashes on exit. - - * GnomeBase.C (d-tor): Added a check for times when the xml wasn't loaded. - -2001-03-29 Michael Koziarski - - * Dialogs.C: Uncommented FormCredits in the #include and instantiate it. - - * Makefile.am: Added FormCredits.[Ch] - - * FormCredits.[Ch]: Created FormCredits dialog using libglade - approach. Text needs to be formatted still. - - * dialogs/diahelpcredits.glade: Created file. - -2001-03-26 Baruch Even - - * Various files: Fixes to get the gnome frontend to compile again. - Removed most xforms dialogs in order to reduce compilation breaks caused - by the moves to MVC in the xforms frontend. - - * GUIRuntime.C: Added libglade library initialization. - - * gnomeBC.h: - * gnomeBC.C: Added file for the MVC support. - - * gnome_helpers.h: Added file with support functions. - - * GnomeBase.h: - * GnomeBase.C: Added file to be the base class of MVC dialogs that use - libglade. - - * FormUrl.h: - * FormUrl.C: Recreated the dialog in the MVC way. - - * Timeout_pimpl.h: - * Timeout_pimpl.C: Implementation of the Timeout pimpl. - -2001-03-15 Lars Gullik Bjønnes - - * several files: remove CXX_WORKING_NAMESPACES - -2001-03-11 Baruch Even - - * Various files: More fixes to get it compiled again. - -2001-03-06 Baruch Even - - * Various files: Small fixes to get the gnome frontend to compile again. - -2001-02-26 Dekel Tsur - - * FormRef.C (apply): Update bookmark #0 after inserting a reference. - -2001-02-16 Lars Gullik Bjønnes - - * FormCitation.C: small cleanup. - (searchSimple): better localization of variables, don't use - sequencing operator if you don't have to. - - * other: use compare instead of strcmp/strncmp diff --git a/src/frontends/gnome/Dialogs.C b/src/frontends/gnome/Dialogs.C deleted file mode 100644 index 99501a66cd..0000000000 --- a/src/frontends/gnome/Dialogs.C +++ /dev/null @@ -1,58 +0,0 @@ -/** - * \file gnome/Dialogs.C - * Copyright 1995 Matthias Ettrich - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Allan Rae - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "Dialogs_impl.h" - - -void Dialogs::init_pimpl() -{ - pimpl_ = new Impl(lyxview_, *this); -} - - -Dialogs::~Dialogs() -{ - delete pimpl_; -} - - -Dialogs::Impl::Impl(LyXView & lv, Dialogs & d) - : aboutlyx(lv, d), - character(lv, d), - changes(lv, d), - document(lv, d), - external(lv, d), - file(lv, d), - floats(lv, d), - graphics(lv, d), - include(lv, d), - logfile(lv, d), - mathpanel(lv, d), - paragraph(lv, d), - preamble(lv, d), - preferences(lv, d), - print(lv, d), - search(lv, d), - sendto(lv, d), - spellchecker(lv, d), - tabular(lv, d), - tabularcreate(lv, d), - texinfo(lv, d), -#ifdef HAVE_LIBAIKSAURUS - thesaurus(lv, d), -#endif - - vclogfile(lv, d), - wrap(lv, d) -{} diff --git a/src/frontends/gnome/Dialogs2.C b/src/frontends/gnome/Dialogs2.C deleted file mode 100644 index 66d20ef798..0000000000 --- a/src/frontends/gnome/Dialogs2.C +++ /dev/null @@ -1,185 +0,0 @@ -/** - * \file gnome/Dialogs2.C - * Copyright 1995 Matthias Ettrich - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Allan Rae - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "Dialogs_impl.h" - - -void Dialogs::showAboutlyx() -{ - pimpl_->aboutlyx.controller().show(); -} - - -void Dialogs::showCharacter() -{ - pimpl_->character.controller().show(); -} - - -void Dialogs::setUserFreeFont() -{ - pimpl_->character.controller().apply(); -} - - -void Dialogs::showDocument() -{ - pimpl_->document.controller().show(); -} - - -void Dialogs::showExternal(InsetExternal * ie) -{ - pimpl_->external.controller().showInset(ie); -} - - -void Dialogs::showFile(string const & f) -{ - pimpl_->file.controller().showFile(f); -} - - -void Dialogs::showFloat(InsetFloat * ifl) -{ - pimpl_->floats.controller().showInset(ifl); -} - - -void Dialogs::showGraphics(InsetGraphics * ig) -{ - pimpl_->graphics.controller().showInset(ig); -} - - -void Dialogs::showInclude(InsetInclude * ii) -{ - pimpl_->include.controller().showInset(ii); -} - - -void Dialogs::showLogFile() -{ - pimpl_->logfile.controller().show(); -} - - -void Dialogs::showMathPanel() -{ - pimpl_->mathpanel.controller().show(); -} - -void Dialogs::showMergeChanges() -{ - pimpl_->changes.controller().show(); -} - - -void Dialogs::showParagraph() -{ - pimpl_->paragraph.controller().show(); -} - - -void Dialogs::updateParagraph() -{ - pimpl_->paragraph.controller().changedParagraph(); -} - - -void Dialogs::showPreamble() -{ - pimpl_->preamble.controller().show(); -} - - -void Dialogs::showPreferences() -{ - pimpl_->preferences.controller().show(); -} - - -void Dialogs::showPrint() -{ - pimpl_->print.controller().show(); -} - - -void Dialogs::showSearch() -{ - pimpl_->search.controller().show(); -} - - -void Dialogs::showSendto() -{ - pimpl_->sendto.controller().show(); -} - - -void Dialogs::showSpellchecker() -{ - pimpl_->spellchecker.controller().show(); -} - - -void Dialogs::showTabular(InsetTabular * it) -{ - pimpl_->tabular.controller().showInset(it); -} - - -void Dialogs::updateTabular(InsetTabular * it) -{ - pimpl_->tabular.controller().updateInset(it); -} - - -void Dialogs::showTabularCreate() -{ - pimpl_->tabularcreate.controller().show(); -} - - -void Dialogs::showTexinfo() -{ - pimpl_->texinfo.controller().show(); -} - - -#ifdef HAVE_LIBAIKSAURUS - -void Dialogs::showThesaurus(string const & s) -{ - pimpl_->thesaurus.controller().showEntry(s); -} - -#else - -void Dialogs::showThesaurus(string const &) -{} - -#endif - - -void Dialogs::showVCLogFile() -{ - pimpl_->vclogfile.controller().show(); -} - - -void Dialogs::showWrap(InsetWrap * iw) -{ - pimpl_->wrap.controller().showInset(iw); -} diff --git a/src/frontends/gnome/Dialogs3.C b/src/frontends/gnome/Dialogs3.C deleted file mode 100644 index 0c3f81e9cc..0000000000 --- a/src/frontends/gnome/Dialogs3.C +++ /dev/null @@ -1,150 +0,0 @@ -/** - * \file qt2/Dialogs3.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "Dialogs.h" -#include "Dialog.h" - -#include "ControlBibitem.h" -#include "ControlBibtex.h" -#include "ControlCitation.h" -#include "ControlError.h" -#include "ControlERT.h" -#include "ControlIndex.h" -#include "ControlRef.h" -#include "ControlToc.h" -#include "ControlUrl.h" - -#include "FormBibitem.h" -#include "forms/form_bibitem.h" - -#include "FormBibtex.h" -#include "forms/form_bibtex.h" - -#include "FormCitation.h" -#include "forms/form_citation.h" - -#include "GError.h" -#include "GERT.h" - -#include "FormIndex.h" -#include "forms/form_index.h" - -#include "FormRef.h" -#include "forms/form_ref.h" - -#include "FormToc.h" -#include "forms/form_toc.h" - -#include "GUrl.h" - -#include "gnomeBC.h" -#include "ButtonController.h" - - -typedef ButtonController - OkCancelBC; - -typedef ButtonController - OkCancelReadOnlyBC; - -typedef ButtonController - NoRepeatedApplyReadOnlyBC; - - -namespace { - -char const * const dialognames[] = { "bibitem", "bibtex", "citation", - "error", "ert", "index", "ref", - "toc", "url" }; - -char const * const * const end_dialognames = - dialognames + (sizeof(dialognames) / sizeof(char *)); - -struct cmpCStr { - cmpCStr(char const * name) : name_(name) {} - bool operator()(char const * other) { - return strcmp(other, name_) == 0; - } -private: - char const * name_; -}; - - -} // namespace anon - - -bool Dialogs::isValidName(string const & name) const -{ - return std::find_if(dialognames, end_dialognames, - cmpCStr(name.c_str())) != end_dialognames; -} - - -Dialog * Dialogs::build(string const & name) -{ - if (!isValidName(name)) - return 0; - - Dialog * dialog = new Dialog(lyxview_, name); - - if (name == "bibitem") { - dialog->setController(new ControlBibitem(*dialog)); - dialog->setView(new FormBibitem(*dialog)); - dialog->setButtonController(new OkCancelReadOnlyBC); - } else if (name == "bibtex") { - dialog->setController(new ControlBibtex(*dialog)); - dialog->setView(new FormBibtex(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } else if (name == "citation") { - dialog->setController(new ControlCitation(*dialog)); - dialog->setView(new FormCitation(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } else if (name == "error") { - dialog->setController(new ControlError(*dialog)); - dialog->setView(new GError(*dialog)); - dialog->setButtonController(new OkCancelBC); - } else if (name == "ert") { - dialog->setController(new ControlERT(*dialog)); - dialog->setView(new GERT(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } else if (name == "index") { - dialog->setController(new ControlIndex(*dialog)); - dialog->setView(new FormIndex(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } else if (name == "ref") { - dialog->setController(new ControlRef(*dialog)); - dialog->setView(new FormRef(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } else if (name == "toc") { - dialog->setController(new ControlToc(*dialog)); - dialog->setView(new FormToc(*dialog)); - dialog->setButtonController(new OkCancelBC); - } else if (name == "url") { - dialog->setController(new ControlUrl(*dialog)); - dialog->setView(new GURL(*dialog)); - dialog->setButtonController(new NoRepeatedApplyReadOnlyBC); - } - - return dialog; -} - - -void Dialogs::toggleTooltips() -{ - Tooltips::toggleEnabled(); -} - - -bool Dialogs::tooltipsEnabled() -{ - return Tooltips::enabled(); -} diff --git a/src/frontends/gnome/Dialogs_impl.h b/src/frontends/gnome/Dialogs_impl.h deleted file mode 100644 index 1dfe4c9f5b..0000000000 --- a/src/frontends/gnome/Dialogs_impl.h +++ /dev/null @@ -1,244 +0,0 @@ -// -*- C++ -*- -/** - * \file xforms/Dialogs_impl.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * \author Angus Leeming - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef DIALOGS_IMPL_H -#define DIALOGS_IMP_H - -#include "Dialogs.h" -#include "controllers/GUI.h" - -#include "Tooltips.h" -#include "xformsBC.h" -#include "gnomeBC.h" -#include "combox.h" - -#include "ControlAboutlyx.h" -#include "GAbout.h" - -#include "FormBrowser.h" -#include "forms/form_browser.h" - -#include "ControlCharacter.h" -#include "FormCharacter.h" -#include "forms/form_character.h" - -#include "ControlChanges.h" -#include "GChanges.h" - -#include "ControlDocument.h" -#include "FormDocument.h" -#include "forms/form_document.h" - -#include "ControlError.h" -#include "GError.h" - -#include "ControlERT.h" -#include "GERT.h" - -#include "ControlExternal.h" -#include "FormExternal.h" -#include "forms/form_external.h" - -#include "ControlFloat.h" -#include "GFloat.h" - -#include "ControlGraphics.h" -#include "FormGraphics.h" -#include "forms/form_graphics.h" - -#include "ControlInclude.h" -#include "FormInclude.h" -#include "forms/form_include.h" - -#include "ControlIndex.h" -#include "FormIndex.h" -#include "forms/form_index.h" - -#include "ControlLog.h" -#include "GLog.h" - -#include "ControlShowFile.h" -#include "FormShowFile.h" - -#include "ControlMath.h" -#include "FormMathsPanel.h" -#include "forms/form_maths_panel.h" - -#include "ControlParagraph.h" -#include "FormParagraph.h" -#include "forms/form_paragraph.h" - -#include "ControlPreamble.h" -#include "GPreamble.h" - -#include "ControlPrefs.h" -#include "FormPreferences.h" -#include "forms/form_preferences.h" - -#include "ControlPrint.h" -#include "FormPrint.h" -#include "forms/form_print.h" - -#include "ControlRef.h" -#include "FormRef.h" -#include "forms/form_ref.h" - -#include "ControlSearch.h" -#include "FormSearch.h" -#include "forms/form_search.h" - -#include "ControlSendto.h" -#include "FormSendto.h" -#include "forms/form_sendto.h" - -#include "ControlSpellchecker.h" -#include "FormSpellchecker.h" -#include "forms/form_spellchecker.h" - -#include "ControlTabular.h" -#include "FormTabular.h" -#include "forms/form_tabular.h" - -#include "ControlTabularCreate.h" -#include "GTabularCreate.h" - -#include "ControlTexinfo.h" -#include "FormTexinfo.h" -#include "forms/form_texinfo.h" - -#ifdef HAVE_LIBAIKSAURUS -#include "ControlThesaurus.h" -#include "FormThesaurus.h" -#include "forms/form_thesaurus.h" -#endif - -#include "ControlToc.h" -#include "FormToc.h" -#include "forms/form_toc.h" - -#include "ControlUrl.h" -#include "GUrl.h" - -#include "ControlVCLog.h" -#include "FormVCLog.h" - -#include "ControlWrap.h" -#include "FormWrap.h" -#include "forms/form_wrap.h" - - -typedef GUI -AboutlyxDialog; - -typedef GUI -CharacterDialog; - -typedef GUI -ChangesDialog; - -typedef GUI -DocumentDialog; - -ypedef GUI -ExternalDialog; - -typedef GUI -FileDialog; - -typedef GUI -FloatDialog; - -typedef GUI -GraphicsDialog; - -typedef GUI -IncludeDialog; - -typedef GUI -LogFileDialog; - -typedef GUI -MathPanelDialog; - -typedef GUI -ParagraphDialog; - -typedef GUI -PreambleDialog; - -typedef GUI -PreferencesDialog; - -typedef GUI -PrintDialog; - -typedef GUI -SearchDialog; - -typedef GUI -SendtoDialog; - -typedef GUI -SpellcheckerDialog; - -typedef GUI -TabularDialog; - -typedef GUI -TabularCreateDialog; - -typedef GUI -TexinfoDialog; - -#ifdef HAVE_LIBAIKSAURUS -typedef GUI -ThesaurusDialog; -#endif - -typedef GUI -VCLogFileDialog; - -typedef GUI -WrapDialog; - -struct Dialogs::Impl { - Impl(LyXView & lv, Dialogs & d); - - AboutlyxDialog aboutlyx; - CharacterDialog character; - ChangesDialog changes; - DocumentDialog document; - ExternalDialog external; - FileDialog file; - FloatDialog floats; - GraphicsDialog graphics; - IncludeDialog include; - LogFileDialog logfile; - MathPanelDialog mathpanel; - ParagraphDialog paragraph; - PreambleDialog preamble; - PreferencesDialog preferences; - PrintDialog print; - SearchDialog search; - SendtoDialog sendto; - SpellcheckerDialog spellchecker; - TabularDialog tabular; - TabularCreateDialog tabularcreate; - TexinfoDialog texinfo; - -#ifdef HAVE_LIBAIKSAURUS - ThesaurusDialog thesaurus; -#endif - - VCLogFileDialog vclogfile; - WrapDialog wrap; -}; - -#endif // DIALOGS_IMPL_H diff --git a/src/frontends/gnome/FileDialog.C b/src/frontends/gnome/FileDialog.C deleted file mode 100644 index 98217b79be..0000000000 --- a/src/frontends/gnome/FileDialog.C +++ /dev/null @@ -1,128 +0,0 @@ -/** - * \file gnome/FileDialog.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - - -#include -#include "FileDialog.h" -#include "debug.h" -#include "support/lstrings.h" -#include -#include - -#include "frontends/LyXView.h" // This is only needed while we have the xforms part! -#include "bufferview_funcs.h" -// FileDialog::Private - -class FileDialog::Private : public SigC::Object { -public: - Private(string const & title); - - void set_modal(bool modal) { modal_ = modal; } - void set_complete(string const & pattern) { sel_.complete(pattern); } - void set_filename(string const & filename) { sel_.set_filename(filename);} - - string const exec(); - - void button_clicked(bool canceled); - void ok_clicked() { button_clicked(false); } - void cancel_clicked() { button_clicked(true); } - -private: - Gtk::FileSelection sel_; - bool modal_; - bool canceled_; -}; - -FileDialog::Private::Private(string const & title) - : sel_(title), modal_(false) -{ - sel_.get_ok_button()->signal_clicked().connect(slot(*this, - &FileDialog::Private::ok_clicked)); - sel_.get_cancel_button()->signal_clicked().connect(slot(*this, - &FileDialog::Private::cancel_clicked)); -} - -string const FileDialog::Private::exec() -{ - canceled_ = false; - sel_.set_modal(modal_); - sel_.show(); - - sel_.run(); - // Find if its canceled or oked and return as needed. - - if (canceled_) - return string(); - else - return sel_.get_filename(); -} - -void FileDialog::Private::button_clicked(bool canceled) -{ - canceled_ = canceled; - sel_.hide(); -} - -// FileDialog - -FileDialog::FileDialog(string const & title, kb_action a, - Button /*b1*/, Button /*b2*/) - : private_(new Private(title)) - , title_(title), success_(a) -{ - private_->set_modal(LFUN_SELECT_FILE_SYNC == a); -} - - -FileDialog::~FileDialog() -{ - delete private_; -} - - -FileDialog::Result const -FileDialog::open(string const & path, string const & mask, - string const & suggested) -{ - // For some reason we need to ignore the asynchronous method... -#if 0 - if (LFUN_SELECT_FILE_SYNC != success_) { - lyxerr << "Asynchronous file dialog." << std::endl; - private_->show(); - - return FileDialog::Result(Later, string()); - } -#endif - lyxerr << "Synchronous file dialog." << std::endl; - - lyxerr << "Path: " << path << "\nMask: " << mask << "\nSuggested: " << suggested << std::endl; - - string filter = mask; - rsplit(mask, filter, '|'); - private_->set_complete(mask); - private_->set_filename(path+suggested); - - string const filename = private_->exec(); - - // Collect the info and return it for synchronous dialog. - return FileDialog::Result(Chosen, filename); -} - -FileDialog::Result const -FileDialog::opendir(string const & path, - string const & suggested) -{ - return open(path, "*/", suggested); -} - -FileDialog::Result const FileDialog::save(string const & path, string const & mask, string const & suggested) -{ - return open(path, mask, suggested); -} diff --git a/src/frontends/gnome/GAbout.C b/src/frontends/gnome/GAbout.C deleted file mode 100644 index f390388a53..0000000000 --- a/src/frontends/gnome/GAbout.C +++ /dev/null @@ -1,112 +0,0 @@ -/** - * \file GAbout.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "support/lstrings.h" - -#include "gnome_helpers.h" -#include "gnomeBC.h" -#include "GAbout.h" - -#include -#include - -#include - -using std::istringstream; - - -GAbout::GAbout() - : GnomeCB("GAbout") -{} - - -GAbout::~GAbout() -{} - - -void GAbout::build() -{ - // Connect the buttons. - close_btn()->signal_clicked().connect(SigC::slot(*this, &GAbout::CancelClicked)); - - // Manage the buttons state - bc().setCancel(close_btn()); - bc().refresh(); -} - -void GAbout::apply() -{} - - -void GAbout::update() -{ - using namespace std; - - string cr; - cr += controller().getCopyright(); - cr += "\n"; - cr += controller().getLicense(); - cr += "\n"; - cr += controller().getDisclaimer(); - copyright()->get_buffer()->set_text(cr); - - - - version()->set_text(controller().getVersion()); - - stringstream in; - controller().getCredits(in); - - istringstream ss(in.str()); - - string s; - Glib::RefPtr buf = credits()->get_buffer(); - - addDefaultTags(buf); - while (getline(ss, s)) { - - if (prefixIs(s, "@b")) - buf->insert_with_tag(buf->end(), - Glib::locale_to_utf8(s.substr(2)), - "bold"); - else if (prefixIs(s, "@i")) - buf->insert_with_tag(buf->end(), - Glib::locale_to_utf8(s.substr(2)), - "italic"); - else - buf->insert(buf->end(), - Glib::locale_to_utf8(s.substr(2))); - buf->insert(buf->end(),"\n"); - - } - -} - - - -Gtk::Button * GAbout::close_btn() const -{ - return getWidget("r_close_btn"); -} -Gtk::Label * GAbout::version() const -{ - return getWidget("r_version"); -} -Gtk::TextView * GAbout::credits() const -{ - return getWidget("r_credits"); -} -Gtk::TextView * GAbout::copyright() const -{ - return getWidget("r_copyright"); -} diff --git a/src/frontends/gnome/GAbout.h b/src/frontends/gnome/GAbout.h deleted file mode 100644 index 0a399425ad..0000000000 --- a/src/frontends/gnome/GAbout.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- -/** - * \file GAbout.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GABOUT_H -#define GABOUT_H - - -#include "ControlAboutlyx.h" -#include "GnomeBase.h" - -namespace Gtk { - class Button; - class Label; - class TextView; -} - -/** - * This class implements the dialog to display the information About LyX - */ -class GAbout : public GnomeCB { -public: - /// - GAbout(); - /// - ~GAbout(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// generated by accessors.py - Gtk::Button * close_btn() const; - /// generated by accessors.py - Gtk::Label * version() const; - /// generated by accessors.py - Gtk::TextView * credits() const; - /// generated by accessors.py - Gtk::TextView * copyright() const; - - -}; - -#endif diff --git a/src/frontends/gnome/GChanges.C b/src/frontends/gnome/GChanges.C deleted file mode 100644 index d0ef240b3e..0000000000 --- a/src/frontends/gnome/GChanges.C +++ /dev/null @@ -1,113 +0,0 @@ -/** - * \file GChanges.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "gnomeBC.h" -#include "GChanges.h" - -#include -#include -#include - -GChanges::GChanges() - : GnomeCB("GChanges") -{} - - -GChanges::~GChanges() -{} - - -void GChanges::build() -{ - // Connect the buttons. - cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::CancelClicked)); - accept_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::accept)); - reject_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::reject)); - - bc().setCancel(cancel_btn()); - - // Manage the read-only aware widgets. - bc().addReadOnly(accept_btn()); - bc().addReadOnly(cancel_btn()); - bc().addReadOnly(reject_btn()); - - // Make sure everything is in the correct state. - bc().refresh(); -} - - -void GChanges::connect_signals() -{} - - -void GChanges::disconnect_signals() -{} - -void GChanges::accept() -{ - controller().accept(); -} - -void GChanges::reject() -{ - controller().reject(); -} - -void GChanges::apply() -{} - - -void GChanges::update() -{ - using std::string; - disconnect_signals(); - controller().find(); - - string text; - string author(controller().getChangeAuthor()); - string date(controller().getChangeDate()); - - if (!author.empty()) - text += "Change by " + author + "\n\n"; - if (!date.empty()) - text += "Change made at " + date + "\n"; - - changes()->get_buffer()->set_text(Glib::locale_to_utf8(text)); - - connect_signals(); -} - - -bool GChanges::validate() const -{ - return true; -} -Gtk::Button * GChanges::next_btn() const -{ - return getWidget("r_next_btn"); -} -Gtk::Button * GChanges::cancel_btn() const -{ - return getWidget("r_cancel_btn"); -} -Gtk::TextView * GChanges::changes() const -{ - return getWidget("r_changes"); -} -Gtk::Button * GChanges::accept_btn() const -{ - return getWidget("r_accept_btn"); -} -Gtk::Button * GChanges::reject_btn() const -{ - return getWidget("r_reject_btn"); -} diff --git a/src/frontends/gnome/GChanges.h b/src/frontends/gnome/GChanges.h deleted file mode 100644 index e54daff8b3..0000000000 --- a/src/frontends/gnome/GChanges.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -/** - * \file GChanges.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GCHANGES_H -#define GCHANGES_H - -#include "ControlChanges.h" -#include "GnomeBase.h" - -namespace Gtk { -class Button; -class TextView; -} - -/** - * This class implements the dialog to Track changes - */ -class GChanges : public GnomeCB { -public: - /// - GChanges(); - /// - ~GChanges(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// Do the connection of signals - void connect_signals(); - /// Disconnect the signals. - void disconnect_signals(); - - void reject(); - - void accept(); - - /// generated by accessors.py - Gtk::Button * next_btn() const; - /// generated by accessors.py - Gtk::Button * cancel_btn() const; - /// generated by accessors.py - Gtk::TextView * changes() const; - /// generated by accessors.py - Gtk::Button * accept_btn() const; - /// generated by accessors.py - Gtk::Button * reject_btn() const; - -}; - -#endif diff --git a/src/frontends/gnome/GERT.C b/src/frontends/gnome/GERT.C deleted file mode 100644 index 735e177ff2..0000000000 --- a/src/frontends/gnome/GERT.C +++ /dev/null @@ -1,114 +0,0 @@ -/** - * \file GERT.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "gnomeBC.h" -#include "GERT.h" - -#include -#include - -GERT::GERT() - : GnomeCB("GERT") -{} - - -GERT::~GERT() -{} - - -void GERT::build() -{ - // Connect the buttons. - close_btn()->signal_clicked().connect(SigC::slot(*this, &GERT::OKClicked)); - - - // Make sure everything is in the correct state. - bc().refresh(); - - // Manage the read-only aware widgets. - bc().addReadOnly(open()); - bc().addReadOnly(inlined()); - bc().addReadOnly(collapsed()); - -} - - -void GERT::connect_signals() -{ - slot_open = open()->signal_clicked().connect( - SigC::slot(*this, &GERT::ApplyClicked) - ); - slot_collapsed = collapsed()->signal_clicked().connect( - SigC::slot(*this, &GERT::ApplyClicked) - ); - slot_inlined = inlined()->signal_clicked().connect( - SigC::slot(*this, &GERT::ApplyClicked) - ); -} - - -void GERT::disconnect_signals() -{ - slot_open.disconnect(); - slot_collapsed.disconnect(); - slot_inlined.disconnect(); -} - - -void GERT::apply() -{ - - if (open()->get_active()) - controller().params().status = InsetERT::Open; - else if (collapsed()->get_active()) - controller().params().status = InsetERT::Collapsed; - else - controller().params().status = InsetERT::Inlined; - -} - - -void GERT::update() -{ - disconnect_signals(); - switch (controller().params().status) { - case InsetERT::Open: - open()->set_active(true); - break; - case InsetERT::Collapsed: - collapsed()->set_active(true); - break; - case InsetERT::Inlined: - inlined()->set_active(true); - break; - } - connect_signals(); - -} - -Gtk::Button * GERT::close_btn() const -{ - return getWidget("r_close_btn"); -} -Gtk::RadioButton * GERT::open() const -{ - return getWidget("r_open"); -} -Gtk::RadioButton * GERT::collapsed() const -{ - return getWidget("r_collapsed"); -} -Gtk::RadioButton * GERT::inlined() const -{ - return getWidget("r_inlined"); -} diff --git a/src/frontends/gnome/GERT.h b/src/frontends/gnome/GERT.h deleted file mode 100644 index 41588397b5..0000000000 --- a/src/frontends/gnome/GERT.h +++ /dev/null @@ -1,66 +0,0 @@ -// -*- C++ -*- -/** - * \file GERT.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GERT_H -#define GERT_H - - -#include "ControlERT.h" -#include "GnomeBase.h" - -namespace Gtk { - class RadioButton; - class Button; -} - -/** - * This class implements the dialog to insert/modify urls. - */ -class GERT : public GnomeCB { -public: - /// - GERT(); - /// - ~GERT(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// Do the connection of signals - void connect_signals(); - /// Disconnect the signals. - void disconnect_signals(); - - /// generated by accessors.py - Gtk::Button * close_btn() const; - /// generated by accessors.py - Gtk::RadioButton * open() const; - /// generated by accessors.py - Gtk::RadioButton * collapsed() const; - /// generated by accessors.py - Gtk::RadioButton * inlined() const; - - - /// do input validation - SigC::Connection slot_open; - SigC::Connection slot_collapsed; - SigC::Connection slot_inlined; - -}; - -#endif diff --git a/src/frontends/gnome/GError.C b/src/frontends/gnome/GError.C deleted file mode 100644 index 447dda4804..0000000000 --- a/src/frontends/gnome/GError.C +++ /dev/null @@ -1,54 +0,0 @@ -/** - * \file GError.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "gnomeBC.h" -#include "GError.h" - -#include -#include - -GErrorDialog::GErrorDialog() - : GControlledView("GError") -{} - - -void GErrorDialog::build() -{ - // Connect the buttons. - button_close()->signal_clicked().connect( - SigC::slot(*this, &GErrorDialog::CloseClicked) - ); - - // Manage the buttons state - bc().setCancel(button_close()); - - // Make sure everything is in the correct state. - bc().refresh(); -} - - -void GErrorDialog::update() -{ - textarea()->get_buffer()->set_text(controller().params()); -} - -Gtk::Button * GErrorDialog::button_close() const -{ - return getWidget("r_button_close"); -} - -Gtk::TextView * GErrorDialog::textarea() const -{ - return getWidget("r_textarea"); -} diff --git a/src/frontends/gnome/GError.h b/src/frontends/gnome/GError.h deleted file mode 100644 index 1daa486bd4..0000000000 --- a/src/frontends/gnome/GError.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- -/** - * \file GError.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GERROR_H -#define GERROR_H - - -#include "ControlError.h" -#include "GView.h" - -namespace Gtk { - -class Button; -class TextView; - -} - -/** - * This class implements the dialog to show error messages. - */ -class GErrorDialog : public GControlledView { -public: - /// - GErrorDialog(); - /// - ~GErrorDialog() {} - /// - void apply() {} - /// - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const { return true; } - - /// - void CloseClicked() { CancelClicked(); } - - /// generated by accessors.py - Gtk::Button * button_close() const; - /// generated by accessors.py - Gtk::TextView * textarea() const; -}; - -#endif diff --git a/src/frontends/gnome/GFloat.C b/src/frontends/gnome/GFloat.C deleted file mode 100644 index 53df5c9003..0000000000 --- a/src/frontends/gnome/GFloat.C +++ /dev/null @@ -1,170 +0,0 @@ -/** - * \file GFloat.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "gnomeBC.h" -#include "GFloat.h" -#include "support/lstrings.h" - -#include -#include -#include -#include - -GFloat::GFloat() - : GnomeCB("GFloat") -{} - - -GFloat::~GFloat() -{} - - -void GFloat::build() -{ - // Connect the buttons. - close_btn()->signal_clicked().connect(SigC::slot(*this, &GFloat::OKClicked)); - // Manage the buttons state - bc().setCancel(close_btn()); - bc().refresh(); - connect_signals(); -} - -void GFloat::apply() -{ - string placement; - if (here_definitely()->get_active()) { - placement += 'H'; - } else { - if (top_of_page()->get_active()) { - placement += 't'; - } - if (bottom_of_page()->get_active()) { - placement += 'b'; - } - if (page_of_floats()->get_active()) { - placement += 'p'; - } - if (here_if_possible()->get_active()) { - placement += 'h'; - } - } - controller().params().placement = placement; -} - - -void GFloat::update() -{ - disconnect_signals(); - bool top = false; - bool bottom = false; - bool page = false; - bool here = false; - bool forcehere = false; - - string placement(controller().params().placement); - - if (contains(placement, 'H')) { - forcehere = true; - } else { - if (contains(placement, 't')) { - top = true; - } - if (contains(placement, 'b')) { - bottom = true; - } - if (contains(placement, 'p')) { - page = true; - } - if (contains(placement, 'h')) { - here = true; - } - } - - top_of_page()->set_active(top); - page_of_floats()->set_active(page); - bottom_of_page()->set_active(bottom); - here_if_possible()->set_active(here); - here_definitely()->set_active(forcehere); - connect_signals(); -} - -void GFloat::connect_signals() -{ - conn_top_ = top_of_page()->signal_toggled().connect( - SigC::slot(*this, &GFloat::ApplyClicked) - ); - conn_bottom_ = bottom_of_page()->signal_toggled().connect( - SigC::slot(*this, &GFloat::ApplyClicked) - ); - conn_page_ = page_of_floats()->signal_toggled().connect( - SigC::slot(*this, &GFloat::ApplyClicked) - ); - conn_ifposs_ = here_if_possible()->signal_toggled().connect( - SigC::slot(*this, &GFloat::ApplyClicked) - ); - conn_definitely_ = here_definitely()->signal_toggled().connect( - SigC::slot(*this, &GFloat::ApplyClicked) - ); - conn_disable_ = here_definitely()->signal_toggled().connect( - SigC::slot(*this, &GFloat::update_sensitive) - ); -} - -void GFloat::disconnect_signals() -{ - conn_top_.disconnect(); - conn_bottom_.disconnect(); - conn_page_.disconnect(); - conn_ifposs_.disconnect(); - conn_definitely_.disconnect(); - conn_disable_.disconnect(); -} - -void GFloat::update_sensitive() -{ - if (here_definitely()->get_active()) - other_options()->set_sensitive(false); - else - other_options()->set_sensitive(true); - -} - -Gtk::HBox * GFloat::other_options() const -{ - return getWidget("r_other_options"); -} -Gtk::CheckButton * GFloat::page_of_floats() const -{ - return getWidget("r_page_of_floats"); -} -Gtk::CheckButton * GFloat::top_of_page() const -{ - return getWidget("r_top_of_page"); -} -Gtk::CheckButton * GFloat::bottom_of_page() const -{ - return getWidget("r_bottom_of_page"); -} -Gtk::CheckButton * GFloat::here_if_possible() const -{ - return getWidget("r_here_if_possible"); -} -Gtk::RadioButton * GFloat::here_definitely() const -{ - return getWidget("r_here_definitely"); -} - -Gtk::Button * GFloat::close_btn() const -{ - return getWidget("r_close_btn"); -} diff --git a/src/frontends/gnome/GFloat.h b/src/frontends/gnome/GFloat.h deleted file mode 100644 index 34f36943f6..0000000000 --- a/src/frontends/gnome/GFloat.h +++ /dev/null @@ -1,76 +0,0 @@ -// -*- C++ -*- -/** - * \file GFloat.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GFLOAT_H -#define GFLOAT_H - - -#include "ControlFloat.h" -#include "GnomeBase.h" - -namespace Gtk { - class Buttton; - class CheckButton; - class RadioButton; - class HBox; -} - -/** - * This class implements the dialog to modify the LaTeX preamble - */ -class GFloat : public GnomeCB { -public: - /// - GFloat(); - /// - ~GFloat(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// - void connect_signals(); - /// - void disconnect_signals(); - - /// generated by accessors.py - Gtk::HBox * other_options() const; - /// generated by accessors.py - Gtk::CheckButton * page_of_floats() const; - /// generated by accessors.py - Gtk::CheckButton * top_of_page() const; - /// generated by accessors.py - Gtk::CheckButton * bottom_of_page() const; - /// generated by accessors.py - Gtk::CheckButton * here_if_possible() const; - /// generated by accessors.py - Gtk::RadioButton * here_definitely() const; - /// generated by accessors.py - Gtk::Button * close_btn() const; - /// Disable all the uncheckable buttons - void update_sensitive(); - - SigC::Connection conn_top_; - SigC::Connection conn_bottom_; - SigC::Connection conn_page_; - SigC::Connection conn_ifposs_; - SigC::Connection conn_definitely_; - SigC::Connection conn_disable_; -}; - -#endif diff --git a/src/frontends/gnome/GLog.C b/src/frontends/gnome/GLog.C deleted file mode 100644 index db0996eb51..0000000000 --- a/src/frontends/gnome/GLog.C +++ /dev/null @@ -1,88 +0,0 @@ -/** - * \file GLog.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include -#include - -#include "gnomeBC.h" -#include "GLog.h" - -#include -#include -#include - -GLog::GLog() - : GnomeCB("GLog") -{} - - -GLog::~GLog() -{} - - -void GLog::build() -{ - // Connect the buttons. - close_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::CancelClicked)); - refresh_btn()->signal_clicked().connect(SigC::slot(*this, &GLog::update)); - - // Manage the buttons state - bc().setCancel(close_btn()); - bc().refresh(); -} - -void GLog::apply() -{} - - -void GLog::update() -{ - using namespace std; - pair const logfile = controller().logfile(); - - if (logfile.first == Buffer::buildlog) - dialog()->set_title(_("Build log")); - else - dialog()->set_title(_("LaTeX log")); - - log_text()->get_buffer()->set_text(""); - - ifstream ifstr(logfile.second.c_str()); - if (!ifstr) { - if (logfile.first == Buffer::buildlog) - log_text()->get_buffer()->set_text(_("No build log file found.")); - else - log_text()->get_buffer()->set_text(_("No LaTeX log file found.")); - return; - } - - string text; - string line; - - while (getline(ifstr, line)) - text += line + "\n"; - - log_text()->get_buffer()->set_text(text); -} - - -Gtk::Button * GLog::refresh_btn() const -{ - return getWidget("r_refresh_btn"); -} -Gtk::Button * GLog::close_btn() const -{ - return getWidget("r_close_btn"); -} -Gtk::TextView * GLog::log_text() const -{ - return getWidget("r_log_text"); -} diff --git a/src/frontends/gnome/GLog.h b/src/frontends/gnome/GLog.h deleted file mode 100644 index 6a5ea92e60..0000000000 --- a/src/frontends/gnome/GLog.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- -/** - * \file GLog.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GLOG_H -#define GLOG_H - - -#include "ControlLog.h" -#include "GnomeBase.h" - -namespace Gtk { - class Button; - class TextView; -} - -/** - * This class implements the dialog to modify the LaTeX preamble - */ -class GLog : public GnomeCB { -public: - /// - GLog(); - /// - ~GLog(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// generated by accessors.py - Gtk::Button * refresh_btn() const; - /// generated by accessors.py - Gtk::Button * close_btn() const; - /// generated by accessors.py - Gtk::TextView * log_text() const; - - -}; - -#endif diff --git a/src/frontends/gnome/GPreamble.C b/src/frontends/gnome/GPreamble.C deleted file mode 100644 index 4b7837c384..0000000000 --- a/src/frontends/gnome/GPreamble.C +++ /dev/null @@ -1,84 +0,0 @@ -/** - * \file GPreamble.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "gnomeBC.h" -#include "GPreamble.h" - -#include -#include - -GPreamble::GPreamble() - : GnomeCB("GPreamble") -{} - - -GPreamble::~GPreamble() -{} - - -void GPreamble::build() -{ - // Connect the buttons. - ok_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::OKClicked)); - cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::CancelClicked)); - apply_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::ApplyClicked)); - // Manage the buttons state - bc().setOK(ok_btn()); - bc().setCancel(cancel_btn()); - bc().setApply(apply_btn()); - bc().refresh(); -} - -void GPreamble::apply() -{ -// controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(), -// preamble()->get_buffer()->get_end_iter(), -// false); -} - - -void GPreamble::update() -{ - disconnect_signals(); - preamble()->get_buffer()->set_text(controller().params()); - connect_signals(); -} - -void GPreamble::connect_signals() -{ - slot_preamble_ = preamble()-> - get_buffer()-> - signal_changed().connect(SigC::slot(*this, &GPreamble::InputChanged)); -} - -void GPreamble::disconnect_signals() -{ - slot_preamble_.disconnect(); -} - -Gtk::Button * GPreamble::ok_btn() const -{ - return getWidget("r_ok_btn"); -} -Gtk::Button * GPreamble::apply_btn() const -{ - return getWidget("r_apply_btn"); -} -Gtk::Button * GPreamble::cancel_btn() const -{ - return getWidget("r_cancel_btn"); -} -Gtk::TextView * GPreamble::preamble() const -{ - return getWidget("r_preamble"); -} diff --git a/src/frontends/gnome/GPreamble.h b/src/frontends/gnome/GPreamble.h deleted file mode 100644 index 28676fec41..0000000000 --- a/src/frontends/gnome/GPreamble.h +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- -/** - * \file GPreamble.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GPREAMBLE_H -#define GPREAMBLE_H - - -#include "ControlPreamble.h" -#include "GnomeBase.h" - -namespace Gtk { -class Button; -class TextView; -} - -/** - * This class implements the dialog to modify the LaTeX preamble - */ -class GPreamble : public GnomeCB { -public: - /// - GPreamble(); - /// - ~GPreamble(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// - void connect_signals(); - /// - void disconnect_signals(); - - /// generated by accessors.py - Gtk::Button * ok_btn() const; - /// generated by accessors.py - Gtk::Button * apply_btn() const; - /// generated by accessors.py - Gtk::Button * cancel_btn() const; - /// generated by accessors.py - Gtk::TextView * preamble() const; - - /// - SigC::Connection slot_preamble_; - - -}; - -#endif diff --git a/src/frontends/gnome/GTabularCreate.C b/src/frontends/gnome/GTabularCreate.C deleted file mode 100644 index c1530bf7d6..0000000000 --- a/src/frontends/gnome/GTabularCreate.C +++ /dev/null @@ -1,89 +0,0 @@ -/** - * \file GTabularCreate.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include -#include - -#include "gnomeBC.h" -#include "GTabularCreate.h" - -#include -#include - -GTabularCreate::GTabularCreate() - : GnomeCB("GTabularCreate") -{} - - -GTabularCreate::~GTabularCreate() -{} - - -void GTabularCreate::build() -{ - // Connect the buttons. - ok_btn()->signal_clicked().connect(SigC::slot(*this, - >abularCreate::OKClicked)); - cancel_btn()->signal_clicked().connect(SigC::slot(*this, - >abularCreate::CancelClicked)); - apply_btn()->signal_clicked().connect(SigC::slot(*this, - >abularCreate::ApplyClicked)); - - // Manage the buttons state - bc().setOK(ok_btn()); - bc().setCancel(cancel_btn()); - bc().setApply(apply_btn()); - - // Make sure everything is in the correct state. - bc().refresh(); -} - - -void GTabularCreate::apply() -{ - unsigned int xsize = (unsigned int)(rows()->get_value_as_int()); - unsigned int ysize = (unsigned int)(cols()->get_value_as_int()); - - controller().params() = std::make_pair(xsize, ysize); -} - - -void GTabularCreate::update() -{} - - -bool GTabularCreate::validate() const -{ - return ( rows()->get_value_as_int() > 0 ) && - ( cols()->get_value_as_int() > 0 ); -} - - -Gtk::Button * GTabularCreate::ok_btn() const -{ - return getWidget("r_ok_btn"); -} -Gtk::Button * GTabularCreate::apply_btn() const -{ - return getWidget("r_apply_btn"); -} -Gtk::Button * GTabularCreate::cancel_btn() const -{ - return getWidget("r_cancel_btn"); -} -Gtk::SpinButton * GTabularCreate::rows() const -{ - return getWidget("r_rows"); -} -Gtk::SpinButton * GTabularCreate::cols() const -{ - return getWidget("r_cols"); -} diff --git a/src/frontends/gnome/GTabularCreate.h b/src/frontends/gnome/GTabularCreate.h deleted file mode 100644 index ab76e67465..0000000000 --- a/src/frontends/gnome/GTabularCreate.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- -/** - * \file GTabularCreate.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GTABULARCREATE_H -#define GTABULARCREATE_H - - -#include "ControlTabularCreate.h" -#include "GnomeBase.h" - -namespace Gtk { - class SpinButton; - class Button; -} - -/** - * This class implements the dialog to insert/modify urls. - */ -class GTabularCreate : public GnomeCB { -public: - /// - GTabularCreate(); - /// - ~GTabularCreate(); - - void apply(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - void update(); - - void OKClicked() { getController().OKButton(); } - void CancelClicked() { getController().CancelButton(); } - void ApplyClicked() { getController().ApplyButton(); } - - /// generated by accessors.py - Gtk::Button * ok_btn() const; - /// generated by accessors.py - Gtk::Button * apply_btn() const; - /// generated by accessors.py - Gtk::Button * cancel_btn() const; - /// generated by accessors.py - Gtk::SpinButton * rows() const; - /// generated by accessors.py - Gtk::SpinButton * cols() const; - -}; - -#endif diff --git a/src/frontends/gnome/GUrl.C b/src/frontends/gnome/GUrl.C deleted file mode 100644 index 7a1c59411b..0000000000 --- a/src/frontends/gnome/GUrl.C +++ /dev/null @@ -1,132 +0,0 @@ -/** - * \file GUrl.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - - -#include - -#include "gnomeBC.h" -#include "GUrl.h" - -#include -#include -#include - -GUrl::GUrl() - : GControlledView("GUrl") -{} - - -GUrl::~GUrl() -{} - - -void GUrl::build() -{ - // Connect the buttons. - ok_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::OKClicked)); - cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::CancelClicked)); - apply_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::ApplyClicked)); - restore_btn()->signal_clicked().connect(SigC::slot(*this, &GUrl::RestoreClicked)); - - // Manage the buttons state - bc().setOK(ok_btn()); - bc().setCancel(cancel_btn()); - bc().setApply(apply_btn()); - bc().setRestore(restore_btn()); - - // Manage the read-only aware widgets. - bc().addReadOnly(html_cb()); - bc().addReadOnly(name()); - bc().addReadOnly(url()); - - // Make sure everything is in the correct state. - bc().refresh(); -} - - -void GUrl::connect_signals() -{ - // Get notifications on input change - slot_url_ = url()->signal_changed().connect(SigC::slot(*this, &GUrl::InputChanged)); - slot_name_ = name()->signal_changed().connect(SigC::slot(*this, &GUrl::InputChanged)); - slot_html_ = html_cb()->signal_toggled().connect(SigC::slot(*this, &GUrl::InputChanged)); -} - - -void GUrl::disconnect_signals() -{ - slot_url_.disconnect(); - slot_name_.disconnect(); - slot_html_.disconnect(); -} - - -void GUrl::apply() -{ - disconnect_signals(); - controller().params().setContents(url()->get_text()); - controller().params().setOptions(name()->get_text()); - - string cmdname("url"); - if (html_cb()->get_active()) - cmdname = "htmlurl"; - - controller().params().setCmdName(cmdname); - connect_signals(); -} - - -void GUrl::update() -{ - disconnect_signals(); - - url()->set_text(controller().params().getContents()); - name()->set_text(controller().params().getOptions()); - - html_cb()->set_active("url" != controller().params().getCmdName()); - - connect_signals(); -} - - -bool GUrl::validate() const -{ - return !url()->get_text().empty() && !name()->get_text().empty(); -} - -Gtk::Button * GUrl::restore_btn() const -{ - return getWidget("r_restore_btn"); -} -Gtk::Button * GUrl::ok_btn() const -{ - return getWidget("r_ok_btn"); -} -Gtk::Button * GUrl::apply_btn() const -{ - return getWidget("r_apply_btn"); -} -Gtk::Button * GUrl::cancel_btn() const -{ - return getWidget("r_cancel_btn"); -} -Gtk::Entry * GUrl::url() const -{ - return getWidget("r_url"); -} -Gtk::Entry * GUrl::name() const -{ - return getWidget("r_name"); -} -Gtk::CheckButton * GUrl::html_cb() const -{ - return getWidget("r_html_cb"); -} diff --git a/src/frontends/gnome/GUrl.h b/src/frontends/gnome/GUrl.h deleted file mode 100644 index 89e41401e4..0000000000 --- a/src/frontends/gnome/GUrl.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- -/** - * \file GUrl.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GURL_H -#define GURL_H - - -#include "ControlUrl.h" -#include "GView.h" - -namespace Gtk { -class Button; -class CheckButton; -class Entry; -} - -/** - * This class implements the dialog to insert/modify urls. - */ -class GUrl : public GControlledView { -public: - /// - GUrl(); - /// - ~GUrl(); - - void apply(); - void update(); - -private: - /// Build the dialog - void build(); - - /// Returns true if the dialog input is in a valid state. - bool validate() const; - - /// Do the connection of signals - void connect_signals(); - /// Disconnect the signals. - void disconnect_signals(); - - /// generated by accessors.py - Gtk::Button * restore_btn() const; - /// gene rated by accessors.py - Gtk::Button * ok_btn() const; - /// generated by accessors.py - Gtk::Button * apply_btn() const; - /// generated by accessors.py - Gtk::Button * cancel_btn() const; - /// generated by accessors.py - Gtk::Entry * url() const; - /// generated by accessors.py - Gtk::Entry * name() const; - /// generated by accessors.py - Gtk::CheckButton * html_cb() const; - - /// Keeps the connection to the input validator. - SigC::Connection slot_url_; - SigC::Connection slot_name_; - SigC::Connection slot_html_; -}; - -#endif diff --git a/src/frontends/gnome/GView.C b/src/frontends/gnome/GView.C deleted file mode 100644 index 36d8469853..0000000000 --- a/src/frontends/gnome/GView.C +++ /dev/null @@ -1,118 +0,0 @@ -/** - * \file gnome/GView.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "GView.h" -#include "debug.h" -#include "support/filetools.h" -#include "ControlButtons.h" - -#include -#include - -GView::GView(string const & name) - : ViewBase(), - updating_(false), - file_(name + ".glade"), - title_(name), - widget_name_(name), - xml_(0), - dialog_(0) -{ - loadXML(); -} - -GView::~GView() -{} - -gnomeBC & GView::bc() -{ - return static_cast(getController().bc()); -} - -void GView::loadXML() -{ -#ifdef WITH_WARNINGS -#warning Change this before declaring it production code! (be 20010325) -#endif - string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;"); - - string const file = FileOpenSearch(path, file_, "glade"); - - if (file.empty()) { - lyxerr << "Cannot find glade file. Aborting." << endl; - BOOST_ASSERT(true); - } - - lyxerr[Debug::GUI] << "Glade file to open is " << file << endl; - - xml_ = Gnome::Glade::Xml::create (file, widget_name_); -} - - -void GView::show() -{ - update(); - dialog()->show(); -} - - -void GView::hide() -{ - dialog()->hide(); -} - -bool GView::isValid() -{ - return true; -} - -void GView::OKClicked() -{ - lyxerr[Debug::GUI] << "GView::OKClicked()" << endl; - getController().OKButton(); -} - -void GView::CancelClicked() -{ - lyxerr[Debug::GUI] << "GView::CancelClicked()" << endl; - getController().CancelButton(); -} - -void GView::ApplyClicked() -{ - lyxerr[Debug::GUI] << "GView::ApplyClicked()" << endl; - getController().ApplyButton(); -} - -void GView::RestoreClicked() -{ - lyxerr[Debug::GUI] << "GView::RestoreClicked()" << endl; - getController().RestoreButton(); -} - -void GView::InputChanged() -{ - bc().valid(isValid()); -} - -Gtk::Dialog * GView::dialog() -{ - if (!dialog_) - dialog_ = getWidget(widget_name_); - - return dialog_; -} - -bool GView::isVisible() const -{ - return dialog_ && dialog_->is_visible(); -} diff --git a/src/frontends/gnome/GView.h b/src/frontends/gnome/GView.h deleted file mode 100644 index 002e8e47ec..0000000000 --- a/src/frontends/gnome/GView.h +++ /dev/null @@ -1,131 +0,0 @@ -// -*- C++ -*- -/** - * \file gnome/GView.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GView_H -#define GView_H - - -#include "gnome_helpers.h" - -#include -#include - -#include "ViewBase.h" -#include "gnomeBC.h" - -namespace Gtk { - class Dialog; -}; - -/** - * This is a base class for Gnome dialogs. It handles all the common - * work that is needed for all dialogs. - */ -class GView : public ViewBase, public SigC::Object { -public: - /// - GView(string const & name); - /// - virtual ~GView(); - -protected: - /// Get the widget named 'name' from the xml representation. - template - T* getWidget(const string & name) const; - - /// Get the dialog we use. - Gtk::Dialog * dialog(); - - /// Show the dialog. - void show(); - /// Hide the dialog. - void hide(); - /// Build the dialog. Also connects signals and prepares it for work. - virtual void build() = 0; - /// Dialog is valid - virtual bool isValid(); - /// dialog is visible - virtual bool isVisible() const; - /// Default OK behaviour - virtual void OKClicked(); - /// Default Cancel behaviour - virtual void CancelClicked(); - /// Default Restore behaviour - virtual void RestoreClicked(); - /// Default apply behaviour - virtual void ApplyClicked(); - /// Default changed input behaviour - virtual void InputChanged(); - - /// - gnomeBC & bc(); - - /// are we updating ? - bool updating_; -private: - /// Loads the glade file to memory. - void loadXML(); - - /// The glade file name - const string file_; - /// The widget name - const string widget_name_; - /// The XML representation of the dialogs. - Glib::RefPtr xml_; - - /** The dialog we work with, since it is managed by libglade, we do not - * need to delete it or destroy it, it will be destroyed with the rest - * of the libglade GladeXML structure. - */ - Gtk::Dialog * dialog_; - - /// dialog title, displayed by WM. - string title_; -}; - - -template -T* GView::getWidget(const string & name) const -{ - return dynamic_cast(xml_->get_widget(name)); -} - -/** - * This class is used to provide a simple automatic casting of the controller. - * We chose not to make GView a template since it has some size and we - * have no reason to duplicate it by making it a template. - * - * Basically the GControlledView template instantiates GView and - * passes the parameters to it and it also adds the controller() method to - * give us a reference to the controller of the correct type (the type is - * set by the template parameter). -*/ -template -class GControlledView : public GView { -public: - GControlledView(string const & name); -protected: - Controller & controller(); -}; - -template -GControlledView::GControlledView(string const & name) - : GView(name) -{} - -template -Controller & -GControlledView::controller() -{ - return static_cast(getController()); -} - -#endif diff --git a/src/frontends/gnome/GnomeBase.C b/src/frontends/gnome/GnomeBase.C deleted file mode 100644 index 74adfb05ce..0000000000 --- a/src/frontends/gnome/GnomeBase.C +++ /dev/null @@ -1,119 +0,0 @@ -/** - * \file GnomeBase.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "GnomeBase.h" -#include "debug.h" -#include "support/filetools.h" -#include "ControlButtons.h" - -#include -#include - - -GnomeBase::GnomeBase(string const & name) - : ViewBase(), - updating_(false), - file_(name + ".glade"), - title_(name), - widget_name_(name), - xml_(0), - dialog_(0) -{ - loadXML(); -} - -GnomeBase::~GnomeBase() -{} - -gnomeBC & GnomeBase::bc() -{ - return static_cast(getController().bc()); -} - -void GnomeBase::loadXML() -{ -#ifdef WITH_WARNINGS -#warning Change this before declaring it production code! (be 20010325) -#endif - string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;"); - - string const file = FileOpenSearch(path, file_, "glade"); - - if (file.empty()) { - lyxerr << "Cannot find glade file. Aborting." << std::endl; - BOOST_ASSERT(true); - } - - lyxerr[Debug::GUI] << "Glade file to open is " << file << endl; - - xml_ = Gnome::Glade::Xml::create (file, widget_name_); -} - - -void GnomeBase::show() -{ - update(); - dialog()->show(); -} - - -void GnomeBase::hide() -{ - dialog()->hide(); -} - -bool GnomeBase::isValid() -{ - return true; -} - -void GnomeBase::OKClicked() -{ - lyxerr[Debug::GUI] << "GnomeBase::OKClicked()" << endl; - getController().OKButton(); -} - -void GnomeBase::CancelClicked() -{ - lyxerr[Debug::GUI] << "GnomeBase::CancelClicked()" << endl; - getController().CancelButton(); -} - -void GnomeBase::ApplyClicked() -{ - lyxerr[Debug::GUI] << "GnomeBase::ApplyClicked()" << endl; - getController().ApplyButton(); -} - -void GnomeBase::RestoreClicked() -{ - lyxerr[Debug::GUI] << "GnomeBase::RestoreClicked()" << endl; - getController().RestoreButton(); -} - -void GnomeBase::InputChanged() -{ - bc().valid(isValid()); -} - -Gtk::Dialog * GnomeBase::dialog() -{ - if (!dialog_) - dialog_ = getWidget(widget_name_); - - return dialog_; -} - -bool GnomeBase::isVisible() const -{ - return dialog_ && dialog_->is_visible(); -} diff --git a/src/frontends/gnome/GnomeBase.h b/src/frontends/gnome/GnomeBase.h deleted file mode 100644 index 6f1373e28d..0000000000 --- a/src/frontends/gnome/GnomeBase.h +++ /dev/null @@ -1,131 +0,0 @@ -// -*- C++ -*- -/** - * \file GnomeBase.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GnomeBase_H -#define GnomeBase_H - - -#include "gnome_helpers.h" - -#include -#include - -#include "ViewBase.h" -#include "gnomeBC.h" - -namespace Gtk { - class Dialog; -}; - -/** - * This is a base class for Gnome dialogs. It handles all the common - * work that is needed for all dialogs. - */ -class GnomeBase : public ViewBase, public SigC::Object { -public: - /// - GnomeBase(string const & name); - /// - virtual ~GnomeBase(); - -protected: - /// Get the widget named 'name' from the xml representation. - template - T* getWidget(const string & name) const; - - /// Get the dialog we use. - Gtk::Dialog * dialog(); - - /// Show the dialog. - void show(); - /// Hide the dialog. - void hide(); - /// Build the dialog. Also connects signals and prepares it for work. - virtual void build() = 0; - /// Dialog is valid - virtual bool isValid(); - /// dialog is visible - virtual bool isVisible() const; - /// Default OK behaviour - virtual void OKClicked(); - /// Default Cancel behaviour - virtual void CancelClicked(); - /// Default Restore behaviour - virtual void RestoreClicked(); - /// Default apply behaviour - virtual void ApplyClicked(); - /// Default changed input behaviour - virtual void InputChanged(); - - /// - gnomeBC & bc(); - - /// are we updating ? - bool updating_; -private: - /// Loads the glade file to memory. - void loadXML(); - - /// The glade file name - const string file_; - /// The widget name - const string widget_name_; - /// The XML representation of the dialogs. - Glib::RefPtr xml_; - - /** The dialog we work with, since it is managed by libglade, we do not - * need to delete it or destroy it, it will be destroyed with the rest - * of the libglade GladeXML structure. - */ - Gtk::Dialog * dialog_; - - /// dialog title, displayed by WM. - string title_; -}; - - -template -T* GnomeBase::getWidget(const string & name) const -{ - return dynamic_cast(xml_->get_widget(name)); -} - -/** - * This class is used to provide a simple automatic casting of the controller. - * We chose not to make GnomeBase a template since it has some size and we - * have no reason to duplicate it by making it a template. - * - * Basically the GnomeCB template instantiates GnomeBase and passes - * the parameters to it and it also adds the controller() method to give us - * a reference to the controller of the correct type (the type is set by the - * template parameter). -*/ -template -class GnomeCB : public GnomeBase { -public: - GnomeCB(string const & name); -protected: - Controller & controller(); -}; - -template -GnomeCB::GnomeCB(string const & name) - : GnomeBase(name) -{} - -template -Controller & -GnomeCB::controller() -{ - return static_cast(getController()); -} - -#endif diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am deleted file mode 100644 index 010cd791ef..0000000000 --- a/src/frontends/gnome/Makefile.am +++ /dev/null @@ -1,162 +0,0 @@ -include $(top_srcdir)/config/common.am - -noinst_LTLIBRARIES = libgnome.la - -AM_CPPFLAGS = \ - $(FRONTEND_INCLUDES) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/frontends \ - -I$(top_srcdir)/src/frontends/xforms \ - -I$(top_srcdir)/src/frontends/controllers \ - $(BOOST_INCLUDES) - -# These are the XForms GUI classes we still need because they -# haven't been implemented in Gnome. -# alphabetised -xforms_objects = \ - ../xforms/Alert_pimpl.lo \ - ../xforms/bmtable.lo \ - ../xforms/checkedwidgets.lo \ - ../xforms/combox.lo \ - ../xforms/Color.lo \ - ../xforms/ColorHandler.lo \ - ../xforms/DropDown.lo \ - ../xforms/fdesign_base.lo \ - ../xforms/FontInfo.lo \ - ../xforms/FormAboutlyx.lo \ - ../xforms/FormBase.lo \ - ../xforms/FormDialogView.lo \ - ../xforms/FormBibitem.lo \ - ../xforms/FormBibtex.lo \ - ../xforms/FormBrowser.lo \ - ../xforms/FormCharacter.lo \ - ../xforms/FormCitation.lo \ - ../xforms/FormDocument.lo \ - ../xforms/FormExternal.lo \ - ../xforms/FormGraphics.lo \ - ../xforms/FormInclude.lo \ - ../xforms/FormIndex.lo \ - ../xforms/FormMathsBitmap.lo \ - ../xforms/FormMathsDelim.lo \ - ../xforms/FormMathsMatrix.lo \ - ../xforms/FormMathsPanel.lo \ - ../xforms/FormMathsSpace.lo \ - ../xforms/FormMathsStyle.lo \ - ../xforms/FormParagraph.lo \ - ../xforms/FormPreferences.lo \ - ../xforms/FormPrint.lo \ - ../xforms/FormRef.lo \ - ../xforms/forms_gettext.lo \ - ../xforms/FormSearch.lo \ - ../xforms/FormSendto.lo \ - ../xforms/FormShowFile.lo \ - ../xforms/FormSpellchecker.lo \ - ../xforms/FormTabular.lo \ - ../xforms/FormTexinfo.lo \ - ../xforms/FormThesaurus.lo \ - ../xforms/FormToc.lo \ - ../xforms/FormVCLog.lo \ - ../xforms/FormWrap.lo \ - ../xforms/input_validators.lo \ - ../xforms/LyXKeySymFactory.lo \ - ../xforms/LyXScreenFactory.lo \ - ../xforms/Menubar_pimpl.lo \ - ../xforms/RadioButtonGroup.lo \ - ../xforms/Toolbar_pimpl.lo \ - ../xforms/Tooltips.lo \ - ../xforms/WorkAreaFactory.lo \ - ../xforms/xfont_loader.lo \ - ../xforms/xfont_metrics.lo \ - ../xforms/xforms_helpers.lo \ - ../xforms/xforms_resize.lo \ - ../xforms/xformsBC.lo \ - ../xforms/xformsImage.lo \ - ../xforms/XFormsView.lo \ - ../xforms/XLyXKeySym.lo \ - ../xforms/XMiniBuffer.lo \ - ../xforms/XPainter.lo \ - ../xforms/xscreen.lo \ - ../xforms/XWorkArea.lo \ - ../xforms/forms/form_aboutlyx.lo \ - ../xforms/forms/form_bibitem.lo \ - ../xforms/forms/form_bibtex.lo \ - ../xforms/forms/form_browser.lo \ - ../xforms/forms/form_character.lo \ - ../xforms/forms/form_citation.lo \ - ../xforms/forms/form_document.lo \ - ../xforms/forms/form_error.lo \ - ../xforms/forms/form_ert.lo \ - ../xforms/forms/form_external.lo \ - ../xforms/forms/form_filedialog.lo \ - ../xforms/forms/form_float.lo \ - ../xforms/forms/form_graphics.lo \ - ../xforms/forms/form_include.lo \ - ../xforms/forms/form_index.lo \ - ../xforms/forms/form_maths_delim.lo \ - ../xforms/forms/form_maths_matrix.lo \ - ../xforms/forms/form_maths_panel.lo \ - ../xforms/forms/form_maths_space.lo \ - ../xforms/forms/form_maths_style.lo \ - ../xforms/forms/form_paragraph.lo \ - ../xforms/forms/form_preamble.lo \ - ../xforms/forms/form_preferences.lo \ - ../xforms/forms/form_print.lo \ - ../xforms/forms/form_ref.lo \ - ../xforms/forms/form_search.lo \ - ../xforms/forms/form_sendto.lo \ - ../xforms/forms/form_spellchecker.lo \ - ../xforms/forms/form_tabular_create.lo \ - ../xforms/forms/form_tabular.lo \ - ../xforms/forms/form_texinfo.lo \ - ../xforms/forms/form_thesaurus.lo \ - ../xforms/forms/form_toc.lo \ - ../xforms/forms/form_url.lo \ - ../xforms/forms/form_wrap.lo - - -xforms.lo: $(xforms_objects) - $(CXXLINK) $(xforms_objects) - -### -# KOZ 20020315 Large commented out removed. -### - -libgnome_la_SOURCES = \ - Dialogs.C \ - Dialogs2.C \ - Dialogs_impl.h \ - FileDialog.C \ - GAbout.C \ - GAbout.h \ - GChanges.C \ - GChanges.h \ - GError.C \ - GError.h \ - GERT.C \ - GERT.h \ - GFloat.C \ - GFloat.h \ - GLog.C \ - GLog.h \ - GPreamble.C \ - GPreamble.h \ - GTabularCreate.C \ - GTabularCreate.h \ - GUrl.C \ - GUrl.h \ - gnome_helpers.C \ - gnome_helpers.h \ - GnomeBase.C \ - GnomeBase.h \ - GView.C \ - GView.h \ - gnomeBC.C \ - gnomeBC.h \ - lyx_gui.C \ - gnomeTimeout.C \ - gnomeTimeout.h \ - pixbutton.h \ - support.c \ - support.h - -libgnome.la: xforms.lo $(libgnome_la_OBJECTS) $(libgnome_la_DEPENDENCIES) diff --git a/src/frontends/gnome/README b/src/frontends/gnome/README deleted file mode 100644 index cba707aaa2..0000000000 --- a/src/frontends/gnome/README +++ /dev/null @@ -1,60 +0,0 @@ -GNOME FRONT END -=============== - -Firstly, this stuff is pre-alpha. I don't use it so you shouldn't -either. At all, no exceptions :). Secondly I'm no c++ guru, I'm -learning as I go along so if something looks stupid, there's a good -chance it is. - -Adding Dialogs --------------- - -The GNOME frontend of LyX uses libglade to draw the dialogs. The base -(GnomeBase.C) class handles the drawing and activating of the Dialogs, -for an example of contructing a simple dialog see GUrl.[Ch] - -FormUrl::FormUrl(ControlUrl & c) - : FormCB(c, "FormUrl") -{} - - - -To manipulate a widget you extract a pointer using getWidget(string). - -If you look at FormUrl you'll see that there are a number of -helper functions at the bottom of the .C file. These are -automatically generated by accessors.py - -For accessors.py to work glade files now must adhere to the following -conventions: - - * The root widget and the file should be named after the form (i.e - FormTabularCreate & FormTabularCreate.glade) - * Functional widgets, those actually used rather than the filler - widgets like Gtk::HBox etc, should have an r_ as the first two - characters of their name. (see below) - -To make the build system include your new dialog edit Makefile.am as -follows: - 1) make clean in src/frontends/gnome/ - 2) Add GX.C and GX.h to libgnome_la_SOURCES - 3) Remove FormX.lo and form_x.lo (if applicable) from xforms_objects - 4) make clean && make in src/frontends/ - 5) make in src/ - - -Using accessors.py ------------------- - -Usage: - -python accessors.py glade_ui_file DialogClass - -e.g - -python accessors.py FormTabularCreate.glade GTabularCreate - -Accessors.py will write the helper functions to DialogClass.C_gen and -the function declarations to DialogClass.g_gen. To ensure the widgets -you're interested in are made available using this method, prefix the -widgets name with r_ when you build the dialog in Glade. diff --git a/src/frontends/gnome/accessors.py b/src/frontends/gnome/accessors.py deleted file mode 100644 index 70b771cc09..0000000000 --- a/src/frontends/gnome/accessors.py +++ /dev/null @@ -1,103 +0,0 @@ -from xml.sax import * - -import re, sys - -### -# Real name. This RE distinguishes 'filler' widgets from the -# widgets we actually care about. -### - -rn = re.compile(r"^r_") - - -def cppClass(gladeClass): - gtk = re.compile(r"^Gtk") - gnome = re.compile(r"^Gnome") - - if gtk.search(gladeClass): - return "Gtk::" + gladeClass[3:] - elif gnome.search(gladeClass): - return "Gnome::" + gladeClass[5:] - -class widget: - def __init__(self, clss, name): - self.clss = cppClass(clss) - self.name = name - - def getAccessor(self): - function = "" - function += self.clss + " * " + dialog +"::" + self.name - function += "() const \n{\n return getWidget<" + self.clss - function += ">(\"" + "r_" + self.name + "\");\n}\n" - - return function - - def getDeclaration(self): - function = "/// generated by accessors.py\n" - function += self.clss + " * " + self.name - function += "() const;\n"; - - return function - - -class GnomeFrontendHandler(ContentHandler): - - def __init__(self): - - self.elemstack = [] - self.widget = 0 - self.TODO = [] - - def startElement(self, name, attrs): - self.elemstack.append(name) - if name == "widget" and rn.search(attrs["id"]): - self.TODO.append(widget(attrs["class"], - re.sub("^r_", "", attrs["id"]))) - - def endElement(self, name): - self.elemstack.pop() - - - def characters(self, data): - - elem = self.elemstack[-1] - - def widgets(self): - return self.TODO - - - -dialog = sys.argv[2] -glade = open(sys.argv[1]) - - -## parse the document - -prs = make_parser() -hndlr = GnomeFrontendHandler() -prs.setContentHandler(hndlr) -prs.parse(glade) - -## write the definitions to .C_gen - -dotC = open(dialog + ".C_gen", "w+") - -for i in hndlr.widgets(): - dotC.write( i.getAccessor()) - -dotC.close() - -## write the declarations to .h_gen - -dotH = open(dialog + ".h_gen", "w+") - -for i in hndlr.widgets(): - dotH.write( i.getDeclaration()) - -dotH.close() - - - - - - diff --git a/src/frontends/gnome/dialogs/GAbout.glade b/src/frontends/gnome/dialogs/GAbout.glade deleted file mode 100644 index 93533fc7e7..0000000000 --- a/src/frontends/gnome/dialogs/GAbout.glade +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - About LyX - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 0 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - True - True - GTK_POS_TOP - False - 2 - 2 - False - - - - True - True - r_version - False - True - GTK_JUSTIFY_CENTER - False - True - 0.5 - 0.5 - 0 - 0 - - - False - True - - - - - - True - Version - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - False - True - - - - - - True - Credits - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - False - True - - - - - - True - Copyright - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - tab - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GChanges.glade b/src/frontends/gnome/dialogs/GChanges.glade deleted file mode 100644 index c43c1e3cd4..0000000000 --- a/src/frontends/gnome/dialogs/GChanges.glade +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - Changes - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - - - - 2 - True - False - 0 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - GTK_RELIEF_NORMAL - -6 - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-go-forward - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Next change - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - -6 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 4 - - - - True - False - 4 - - - - True - Change: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - False - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_START - 12 - - - - True - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-yes - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Accept - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - - True - True - True - GTK_RELIEF_NORMAL - - - - True - 0.5 - 0.5 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-no - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Reject - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GERT.glade b/src/frontends/gnome/dialogs/GERT.glade deleted file mode 100644 index aeb0f66632..0000000000 --- a/src/frontends/gnome/dialogs/GERT.glade +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - 2 - ERT Properties - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 8 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - False - 0 - - - - True - True - _Open - True - GTK_RELIEF_NORMAL - True - False - True - - - 0 - False - False - - - - - - True - True - _Collapsed - True - GTK_RELIEF_NORMAL - False - False - True - r_open - - - 0 - False - False - - - - - - True - True - _Inlined View - True - GTK_RELIEF_NORMAL - False - False - True - r_open - - - 0 - False - False - - - - - - - - True - Status - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GError.glade b/src/frontends/gnome/dialogs/GError.glade deleted file mode 100644 index 2d7fcafb34..0000000000 --- a/src/frontends/gnome/dialogs/GError.glade +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - Error - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 8 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - 0 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GFloat.glade b/src/frontends/gnome/dialogs/GFloat.glade deleted file mode 100644 index 82d74fe0c5..0000000000 --- a/src/frontends/gnome/dialogs/GFloat.glade +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - True - True - Float Properties - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - - - - 2 - True - False - 0 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 5 - True - False - 3 - - - - True - True - Placement - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - False - 0 - - - - True - False - 0 - - - - True - True - Page of floats - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - True - Top of the page - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - True - Bottom of the page - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - - True - True - Here, if possible - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - 20 - True - True - - - - - 0 - False - False - - - - - - True - True - Here, definitely - True - GTK_RELIEF_NORMAL - False - False - True - b_placement - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GLog.glade b/src/frontends/gnome/dialogs/GLog.glade deleted file mode 100644 index a785079a2a..0000000000 --- a/src/frontends/gnome/dialogs/GLog.glade +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - dialog1 - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 0 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-refresh - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GPreamble.glade b/src/frontends/gnome/dialogs/GPreamble.glade deleted file mode 100644 index da8b545616..0000000000 --- a/src/frontends/gnome/dialogs/GPreamble.glade +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - LaTeX Preamble - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 8 - - - - 5 - True - GTK_BUTTONBOX_END - 10 - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - 0 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - True - True - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/dialogs/GTabularCreate.glade b/src/frontends/gnome/dialogs/GTabularCreate.glade deleted file mode 100644 index 96420f283c..0000000000 --- a/src/frontends/gnome/dialogs/GTabularCreate.glade +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - Insert Tabular - GTK_WINDOW_DIALOG - no - no - no - no - GTK_WIN_POS_NONE - - - - no - 8 - yes - - - - GTK_BUTTONBOX_END - 8 - yes - - - - yes - yes - yes - gtk-ok - yes - yes - - - - - - yes - yes - yes - gtk-apply - yes - yes - - - - - - yes - yes - yes - gtk-cancel - yes - yes - - - - - 0 - no - yes - GTK_PACK_END - - - - - - yes - 0 - 0 - 2 - 2 - yes - - - - Rows - GTK_JUSTIFY_RIGHT - no - 0 - 0.5 - 0 - 0 - yes - - - 0 - 1 - 0 - 1 - 0 - 0 - fill - - - - - - - Columns - GTK_JUSTIFY_RIGHT - no - 0 - 0.5 - 0 - 0 - yes - - - 0 - 1 - 1 - 2 - 0 - 0 - fill - - - - - - - yes - 1 - 0 - no - GTK_UPDATE_ALWAYS - no - no - yes - 1 1 50 1 10 10 - - - 1 - 2 - 0 - 1 - 0 - 0 - expand|fill - - - - - - - yes - 1 - 0 - no - GTK_UPDATE_ALWAYS - no - no - yes - 1 1 50 1 10 10 - - - 1 - 2 - 1 - 2 - 0 - 0 - expand|fill - - - - - - 0 - yes - yes - - - - - 4 - yes - yes - - - - diff --git a/src/frontends/gnome/dialogs/GUrl.glade b/src/frontends/gnome/dialogs/GUrl.glade deleted file mode 100644 index 6608e41926..0000000000 --- a/src/frontends/gnome/dialogs/GUrl.glade +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - 2 - Insert URL - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - - - - 2 - True - False - 8 - - - - 5 - True - GTK_BUTTONBOX_DEFAULT_STYLE - 10 - - - - True - True - True - Restore - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - 0 - - - - - - True - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - 0 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 2 - - - - True - 2 - 2 - False - 2 - 2 - - - - True - _Name - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - r_name - - - 0 - 1 - 1 - 2 - - - - - - - - True - _URL - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - r_url - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 1 - 2 - - - - - - 0 - True - True - - - - - - 2 - True - True - _HTML type - True - GTK_RELIEF_NORMAL - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/src/frontends/gnome/gnomeBC.C b/src/frontends/gnome/gnomeBC.C deleted file mode 100644 index a3a78e7440..0000000000 --- a/src/frontends/gnome/gnomeBC.C +++ /dev/null @@ -1,38 +0,0 @@ -/** - * \file gnomeBC.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ -#include - - -#include "gnomeBC.h" - -#include -#include - -gnomeBC::gnomeBC(string const & cancel, string const & close) - : GuiBC(cancel, close) -{} - - -void gnomeBC::setWidgetEnabled(Gtk::Widget * obj, bool enabled) -{ - if (obj) - obj->set_sensitive(enabled); -} - - -void gnomeBC::setButtonEnabled(Gtk::Button * btn, bool enabled) -{ - if (btn) - btn->set_sensitive(enabled); -} - - -void gnomeBC::setButtonLabel(Gtk::Button * obj, string const & label) -{} diff --git a/src/frontends/gnome/gnomeBC.h b/src/frontends/gnome/gnomeBC.h deleted file mode 100644 index 37b1b381c5..0000000000 --- a/src/frontends/gnome/gnomeBC.h +++ /dev/null @@ -1,40 +0,0 @@ -// -*- C++ -*- -/** - * \file gnomeBC.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GNOMEBC_H -#define GNOMEBC_H - - -#include "ButtonController.h" - -namespace Gtk { -class Button; -class Widget; -}; - -class gnomeBC : public GuiBC -{ -public: - /// - gnomeBC(string const & cancel, string const & close); - -private: - /// Updates the button sensitivity (enabled/disabled) - void setButtonEnabled(Gtk::Button * btn, bool enabled); - - /// Updates the widget sensitivity (enabled/disabled) - void setWidgetEnabled(Gtk::Widget * obj, bool enabled); - - /// Set the label on the button - void setButtonLabel(Gtk::Button * btn, string const & label); -}; - -#endif // GNOMEBC_H diff --git a/src/frontends/gnome/gnomeTimeout.C b/src/frontends/gnome/gnomeTimeout.C deleted file mode 100644 index 96f4f7f272..0000000000 --- a/src/frontends/gnome/gnomeTimeout.C +++ /dev/null @@ -1,67 +0,0 @@ -/** - * \file gnomeTimeout.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * \author Michael Koziarski - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include -#include "gnomeTimeout.h" -#include "debug.h" - - -Timeout::Timeout(unsigned int msec, Type t) - : pimpl_(new gnomeTimeout(*this)), type(t), timeout_ms(msec) -{} - - -gnomeTimeout::(gnomeTimeoutTimeout * owner) - : Timeout::Impl(owner), timeout_id(-1) -{} - - -void gnomeTimeout::reset() -{ - stop(); -} - - -bool gnomeTimeout::running() const -{ - return running_; -} - - -void gnomeTimeout::start() -{ - if (conn_.connected()) { - lyxerr << "Timeout::start: already running!" << std::endl; - stop(); - } - - conn_ = Glib::signal_timeout().connect( - SigC::slot(*this, &Timeout::Pimpl::timeoutEvent), - timeout_ms() - ); - running_ = true; -} - - -void gnomeTimeout::stop() -{ - conn_.disconnect(); - running_ = false; -} - - -bool gnomeTimeout::timeoutEvent() -{ - emit(); - return false; // discontinue emitting timeouts. -} diff --git a/src/frontends/gnome/gnomeTimeout.h b/src/frontends/gnome/gnomeTimeout.h deleted file mode 100644 index 50cab257a6..0000000000 --- a/src/frontends/gnome/gnomeTimeout.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -/** - * \file gnomeTimeout.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Baruch Even - * - * Full author contact details are available in file CREDITS. - */ -#ifndef GNOMETIMEOUT_H -#define GNOMETIMEOUT_H - -#include "frontends/Timeout.h" -#include "glib.h" // for gint - -#include - - -/** - * This class executes the callback when the timeout expires - * using Gnome mechanisms - */ -struct gnomeTimeout : public SigC::Object, public Timeout::Impl { -public: - /// - gnomeTimeout(Timeout * owner_); - /// start the timer - void start(); - /// stop the timer - void stop(); - /// reset - void reset(); - /// Is the timer running? - bool running() const; - - -public: - /// The timeout signal, this gets called when the timeout passed. - bool timeoutEvent(); -private: - /// Timer connection - SigC::Connection conn_; - /// Used for running as SigC::Connection::connected() isn't const - bool running_; -}; - -#endif // GNOMETIMEOUT diff --git a/src/frontends/gnome/gnome_helpers.C b/src/frontends/gnome/gnome_helpers.C deleted file mode 100644 index 3a126c67ca..0000000000 --- a/src/frontends/gnome/gnome_helpers.C +++ /dev/null @@ -1,27 +0,0 @@ -/** - * \file gnome_helpers.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * - * Full author contact details are available in file CREDITS. - */ - -#include - - -#include "gnome_helpers.h" -#include - -void addDefaultTags(Glib::RefPtr & buf) { - Glib::RefPtr italicTag = Gtk::TextTag::create("italic"); - italicTag->property_style() = Pango::STYLE_ITALIC; - - Glib::RefPtr boldTag = Gtk::TextTag::create("bold"); - boldTag->property_weight() = Pango::WEIGHT_BOLD; - - buf->get_tag_table()->add(italicTag); - buf->get_tag_table()->add(boldTag); - -} diff --git a/src/frontends/gnome/gnome_helpers.h b/src/frontends/gnome/gnome_helpers.h deleted file mode 100644 index c0fad6ef07..0000000000 --- a/src/frontends/gnome/gnome_helpers.h +++ /dev/null @@ -1,32 +0,0 @@ -// -*- C++ -*- -/** - * \file gnome_helpers.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GNOME_HELPERS_H -#define GNOME_HELPERS_H - - -#include "debug.h" - -#undef Status -#undef Value -#undef DestroyNotify - -#include - - -/** - * This helper function adds default tags to a TextBuffer - * - * Hopefully gtk will come with its own one day, but until then... - */ -void addDefaultTags(Glib::RefPtr &); - -#endif diff --git a/src/frontends/gnome/lyx_gui.C b/src/frontends/gnome/lyx_gui.C deleted file mode 100644 index 4c9e3460ab..0000000000 --- a/src/frontends/gnome/lyx_gui.C +++ /dev/null @@ -1,399 +0,0 @@ -/** - * \file gnome/lyx_gui.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * \author John Levon - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "lyx_gui.h" - -#include "support/lyxlib.h" -#include "support/os.h" -#include "support/filetools.h" -#include "support/package.h" - -#include "debug.h" -#include "gettext.h" - -#include "lyx_main.h" -#include "lyxrc.h" -#include "lyxfont.h" - -// FIXME: move this stuff out again -#include "bufferlist.h" -#include "lyxfunc.h" -#include "lyxserver.h" -#include "BufferView.h" -#include "XFormsView.h" - -#include FORMS_H_LOCATION -#include "ColorHandler.h" -#include "xforms_helpers.h" -#include "xfont_loader.h" -#include "xformsImage.h" - -#include - -#include -#include -#include - -#include "gnome_helpers.h" -#include -#include - -#ifndef CXX_GLOBAL_CSTD -using std::exit; -#endif - -using std::ostringstream; -using std::vector; -using std::hex; -using std::dec; -using std::endl; -using std::setbase; -using std::setfill; -using std::setw; - -extern BufferList bufferlist; - -// FIXME: wrong place ! -LyXServer * lyxserver; - -namespace { - -/// quit lyx -bool finished = false; - -/// estimate DPI from X server -int getDPI() -{ - Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen); - return int(((HeightOfScreen(scr) * 25.4 / HeightMMOfScreen(scr)) + - (WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2); -} - - -/// set default GUI configuration -void setDefaults() -{ - FL_IOPT cntl; - cntl.buttonFontSize = FL_NORMAL_SIZE; - cntl.browserFontSize = FL_NORMAL_SIZE; - cntl.labelFontSize = FL_NORMAL_SIZE; - cntl.choiceFontSize = FL_NORMAL_SIZE; - cntl.inputFontSize = FL_NORMAL_SIZE; - cntl.menuFontSize = FL_NORMAL_SIZE; - cntl.borderWidth = -1; - cntl.vclass = FL_DefaultVisual; - fl_set_defaults(FL_PDVisual - | FL_PDButtonFontSize - | FL_PDBrowserFontSize - | FL_PDLabelFontSize - | FL_PDChoiceFontSize - | FL_PDInputFontSize - | FL_PDMenuFontSize - | FL_PDBorderWidth, &cntl); -} - - -extern "C" { - -int LyX_XErrHandler(Display * display, XErrorEvent * xeev) { - // We don't abort on BadWindow - if (xeev->error_code == BadWindow) { - lyxerr << "BadWindow received !" << endl; - lyxerr << "If you're using xforms 1.0 or greater, " - << " please report this to lyx-devel@lists.lyx.org" << endl; - return 0; - } - - // emergency cleanup - LyX::emergencyCleanup(); - - // Get the reason for the crash. - char etxt[513]; - XGetErrorText(display, xeev->error_code, etxt, 512); - lyxerr << etxt << " id: " << xeev->resourceid << endl; - // By doing an abort we get a nice backtrace. (hopefully) - lyx::abort(); - return 0; -} - -} - -/// read in geometry specification -char geometry[40]; - -} // namespace anon - - -void lyx_gui::parse_init(int & argc, char * argv[]) -{ - setDefaults(); - - FL_CMD_OPT cmdopt[] = { - {"-geometry", "*.geometry", XrmoptionSepArg, "690x510"} - }; - - FL_resource res[] = { - {"geometry", "geometryClass", FL_STRING, geometry, "", 40} - }; - - const int num_res = sizeof(res)/sizeof(FL_resource); - - fl_initialize(&argc, argv, "LyX", cmdopt, num_res); - - // It appears that, in xforms >=0.89.5, fl_initialize() - // calls setlocale() and ruins our LC_NUMERIC setting. - locale_init(); - - fl_get_app_resources(res, num_res); - - Display * display = fl_get_display(); - - if (!display) { - lyxerr << "LyX: unable to access X display, exiting" << endl; - ::exit(1); - } - - fcntl(ConnectionNumber(display), F_SETFD, FD_CLOEXEC); - - XSetErrorHandler(LyX_XErrHandler); - - lyxColorHandler.reset(new LyXColorHandler); - - using namespace lyx::graphics; - - // connect the image loader based on the xforms library - Image::newImage = boost::bind(&xformsImage::newImage); - Image::loadableFormats = boost::bind(&xformsImage::loadableFormats); - - // must do this /before/ lyxrc gets read - lyxrc.dpi = getDPI(); - - new Gtk::Main (argc, argv); -} - - -void lyx_gui::parse_lyxrc() -{ - XformsColor::read(AddName(user_lyxdir(), "preferences.xform")); - - if (lyxrc.popup_font_encoding.empty()) - lyxrc.popup_font_encoding = lyxrc.font_norm; - // Set the font name for popups and menus - string boldfontname = lyxrc.popup_bold_font - + "-*-*-*-?-*-*-*-*-" - + lyxrc.popup_font_encoding; - // "?" means "scale that font" - string fontname = lyxrc.popup_normal_font - + "-*-*-*-?-*-*-*-*-" - + lyxrc.popup_font_encoding; - - int bold = fl_set_font_name(FL_BOLD_STYLE, boldfontname.c_str()); - int normal = fl_set_font_name(FL_NORMAL_STYLE, fontname.c_str()); - if (bold < 0) - lyxerr << "Could not set menu font to " - << boldfontname << endl; - - if (normal < 0) - lyxerr << "Could not set popup font to " - << fontname << endl; - - if (bold < 0 && normal < 0) { - lyxerr << "Using 'helvetica' font for menus" << endl; - boldfontname = "-*-helvetica-bold-r-*-*-*-?-*-*-*-*-iso8859-1"; - fontname = "-*-helvetica-medium-r-*-*-*-?-*-*-*-*-iso8859-1"; - bold = fl_set_font_name(FL_BOLD_STYLE, boldfontname.c_str()); - normal = fl_set_font_name(FL_NORMAL_STYLE, fontname.c_str()); - - if (bold < 0 && normal < 0) { - lyxerr << "Could not find helvetica font. Using 'fixed'." << endl; - fl_set_font_name(FL_NORMAL_STYLE, "fixed"); - normal = bold = 0; - } - } - if (bold < 0) - fl_set_font_name(FL_BOLD_STYLE, fontname.c_str()); - else if (normal < 0) - fl_set_font_name(FL_NORMAL_STYLE, boldfontname.c_str()); - - fl_setpup_fontstyle(FL_NORMAL_STYLE); - fl_setpup_fontsize(FL_NORMAL_SIZE); - fl_setpup_color(FL_MCOL, FL_BLACK); - fl_set_goodies_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE); - fl_set_tooltip_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE); -} - -void lyx_gui::start(string const & batch, vector const & files) -{ - // initial geometry - int xpos = -1; - int ypos = -1; - unsigned int width = 690; - unsigned int height = 510; - - int const geometryBitmask = - XParseGeometry(geometry, - &xpos, &ypos, &width, &height); - - // if width is not set by geometry, check it against monitor width - if (!(geometryBitmask & WidthValue)) { - Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen); - if (WidthOfScreen(scr) - 8 < int(width)) - width = WidthOfScreen(scr) - 8; - } - - // if height is not set by geometry, check it against monitor height - if (!(geometryBitmask & HeightValue)) { - Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen); - if (HeightOfScreen(scr) - 24 < int(height)) - height = HeightOfScreen(scr) - 24; - } - - Screen * s = ScreenOfDisplay(fl_get_display(), fl_screen); - - // recalculate xpos if it's not set - if (xpos == -1) - xpos = (WidthOfScreen(s) - width) / 2; - - // recalculate ypos if it's not set - if (ypos == -1) - ypos = (HeightOfScreen(s) - height) / 2; - - lyxerr[Debug::GUI] << "Creating view: " << width << 'x' << height - << '+' << xpos << '+' << ypos << endl; - - XFormsView view(width, height); - view.show(xpos, ypos, "LyX"); - view.init(); - - Buffer * last = 0; - - // FIXME: some code below needs moving - - lyxserver = new LyXServer(&view.getLyXFunc(), lyxrc.lyxpipes); - - vector::const_iterator cit = files.begin(); - vector::const_iterator end = files.end(); - for (; cit != end; ++cit) { - Buffer * b = bufferlist.loadLyXFile(*cit); - if (b) { - last = b; - } - } - - // switch to the last buffer successfully loaded - if (last) { - view.view()->buffer(last); - } - - // handle the batch commands the user asked for - if (!batch.empty()) { - view.getLyXFunc().dispatch(batch); - } - - // enter the event loop - while (!finished) { - while (Gtk::Main::events_pending()) - Gtk::Main::iteration(false); - if (fl_check_forms() == FL_EVENT) { - XEvent ev; - fl_XNextEvent(&ev); - lyxerr[Debug::GUI] - << "Received unhandled X11 event" << endl - << "Type: " << ev.xany.type - << " Target: 0x" << hex << ev.xany.window - << dec << endl; - } - - } - - // FIXME: breaks emergencyCleanup - delete lyxserver; -} - -void lyx_gui::exit() -{ - finished = true; -} - - -FuncStatus lyx_gui::getStatus(FuncRequest const & /*ev*/) -{ - // Nothing interesting to do here - return FuncStatus(); -} - -string const lyx_gui::hexname(LColor::color col) -{ - string const name = lcolor.getX11Name(col); - Display * const display = fl_get_display(); - Colormap const cmap = fl_state[fl_get_vclass()].colormap; - XColor xcol, ccol; - - if (XLookupColor(display, cmap, name.c_str(), &xcol, &ccol) == 0) { - lyxerr << "X can't find color \"" - << lcolor.getLyXName(col) - << '"' << endl; - return string(); - } - - ostringstream os; - - // Note that X stores the RGB values in the range 0 - 65535 - // whilst we require them in the range 0 - 255. - os << setbase(16) << setfill('0') - << setw(2) << (xcol.red / 256) - << setw(2) << (xcol.green / 256) - << setw(2) << (xcol.blue / 256); - - return STRCONV(os.str()); -} - - -void lyx_gui::update_color(LColor::color col) -{ - lyxColorHandler->updateColor(col); -} - - -void lyx_gui::update_fonts() -{ - fontloader.update(); -} - - -bool lyx_gui::font_available(LyXFont const & font) -{ - return fontloader.available(font); -} - -namespace { - -extern "C" -void C_read_callback(int, void * data) -{ - LyXComm * comm = static_cast(data); - comm->read_ready(); -} - -} - -void lyx_gui::set_read_callback(int fd, LyXComm * comm) -{ - fl_add_io_callback(fd, FL_READ, C_read_callback, comm); -} - - -void lyx_gui::remove_read_callback(int fd) -{ - fl_remove_io_callback(fd, FL_READ, C_read_callback); -} diff --git a/src/frontends/gnome/pixbutton.h b/src/frontends/gnome/pixbutton.h deleted file mode 100644 index f175bf7508..0000000000 --- a/src/frontends/gnome/pixbutton.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -/** - * \file pixbutton.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef GNOME_PIXBUTTON -#define GNOME_PIXBUTTON - -#include -#include -#include -#include -#include - -/* Button class used in LyX Gnome frontend for buttons with pixmaps and - accelerators */ - -namespace Gnome -{ -class PixButton: public Gtk::Button -{ -public: - PixButton(string label, string pixname): Button() - { - Gtk::Box * b = manage( new Gtk::HBox() ); - l = manage( new Gtk::Label(label) ); - Gnome::Pixmap * p = Gtk::wrap( GNOME_PIXMAP( gnome_stock_pixmap_widget(0, pixname.c_str()) ) ); - - b->set_spacing(3); - b->children().push_back(Gtk::Box_Helpers::Element(*p, false, false)); - b->children().push_back(Gtk::Box_Helpers::Element(*l, false, false)); - - add(*b); - - accelkey_ = l->parse_uline(label); - - l->show(); - p->show(); - b->show(); - } - - guint get_accelkey() { return accelkey_; } - - void set_text(string const & newlabel) { l->set_text(newlabel); } - -protected: - guint accelkey_; - Gtk::Label * l; -}; -} - -#endif diff --git a/src/frontends/gnome/support.c b/src/frontends/gnome/support.c deleted file mode 100644 index f547fdd354..0000000000 --- a/src/frontends/gnome/support.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif -#include - -#include - -#include "support.h" - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* create_dummy_pixmap (GtkWidget *widget, - gboolean gnome_pixmap); - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -/* This is a dummy pixmap we use when a pixmap can't be found. */ -static char *dummy_pixmap_xpm[] = { -/* columns rows colors chars-per-pixel */ -"1 1 1 1", -" c None", -/* pixels */ -" ", -" " -}; - -/* This is an internally used function to create pixmaps. */ -static GtkWidget* -create_dummy_pixmap (GtkWidget *widget, - gboolean gnome_pixmap) -{ - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - GtkWidget *pixmap; - - if (gnome_pixmap) - { - return gnome_pixmap_new_from_xpm_d (dummy_pixmap_xpm); - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, - NULL, dummy_pixmap_xpm); - if (gdkpixmap == NULL) - g_error ("Couldn't create replacement pixmap."); - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename, - gboolean gnome_pixmap) -{ - GtkWidget *pixmap; - GdkColormap *colormap; - GdkPixmap *gdkpixmap; - GdkBitmap *mask; - gchar *pathname; - - if (!filename || !filename[0]) - return create_dummy_pixmap (widget, gnome_pixmap); - - pathname = gnome_pixmap_file (filename); - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return create_dummy_pixmap (widget, gnome_pixmap); - } - - if (gnome_pixmap) - { - pixmap = gnome_pixmap_new_from_file (pathname); - g_free (pathname); - return pixmap; - } - - colormap = gtk_widget_get_colormap (widget); - gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask, - NULL, pathname); - if (gdkpixmap == NULL) - { - g_warning (_("Couldn't create pixmap from file: %s"), pathname); - g_free (pathname); - return create_dummy_pixmap (widget, gnome_pixmap); - } - g_free (pathname); - - pixmap = gtk_pixmap_new (gdkpixmap, mask); - gdk_pixmap_unref (gdkpixmap); - gdk_bitmap_unref (mask); - return pixmap; -} - -/* This is an internally used function to create imlib images. */ -GdkImlibImage* -create_image (const gchar *filename) -{ - GdkImlibImage *image; - gchar *pathname; - - pathname = gnome_pixmap_file (filename); - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return NULL; - } - - image = gdk_imlib_load_image (pathname); - g_free (pathname); - return image; -} - diff --git a/src/frontends/gnome/support.h b/src/frontends/gnome/support.h deleted file mode 100644 index f05ed8d78e..0000000000 --- a/src/frontends/gnome/support.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#include - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - -/* get_widget() is deprecated. Use lookup_widget instead. */ -#define get_widget lookup_widget - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename, - gboolean gnome_pixmap); - -GdkImlibImage* create_image (const gchar *filename);