From: Angus Leeming Date: Mon, 4 Mar 2002 10:51:40 +0000 (+0000) Subject: Move Dialogs::redrawGUI to frontends/Dialogs.C from all those guis. X-Git-Tag: 1.6.10~19743 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=356caadd6d4135f044f82cd77dc5bbca4257f458;p=features.git Move Dialogs::redrawGUI to frontends/Dialogs.C from all those guis. Move Dialogs::initialiseGraphics to GUIRunTime. xforms works, qt2 and gnome not tested. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3654 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 7807eaa48d..23febc64bd 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,8 @@ +2002-03-04 Angus Leeming + + * Dialogs.h: + * GUIRunTime.h (initialiseGraphics): moved to GUIRunTime. + 2002-03-02 Lars Gullik Bjønnes * Toolbar.[Ch] (setLayout): layout as string diff --git a/src/frontends/Dialogs.C b/src/frontends/Dialogs.C index 4e6f32171c..da2e1a581c 100644 --- a/src/frontends/Dialogs.C +++ b/src/frontends/Dialogs.C @@ -23,6 +23,10 @@ #include "Dialogs.h" #include "support/LAssert.h" +// Signal enabling all visible dialogs to be redrawn if so desired. +// E.g., when the GUI colours have been remapped. +SigC::Signal0 Dialogs::redrawGUI; + void Dialogs::add(DialogBase * ptr) { lyx::Assert(ptr); diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index b80704b97c..50c3ccc02e 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -63,11 +63,6 @@ public: Dialogs(LyXView *); //@} - /** Called bu the graphics cache to connect the approriate frontend - * image loading routines to the LyX kernel. - */ - static void initialiseGraphics(); - /** Redraw all visible dialogs because, for example, the GUI colours have been re-mapped. */ static SigC::Signal0 redrawGUI; diff --git a/src/frontends/GUIRunTime.h b/src/frontends/GUIRunTime.h index 5bfc5c57cb..72221fed67 100644 --- a/src/frontends/GUIRunTime.h +++ b/src/frontends/GUIRunTime.h @@ -39,6 +39,10 @@ public: /// static LyXView * createMainView(int w, int h); + /** Called bu the graphics cache to connect the approriate frontend + * image loading routines to the LyX kernel. + */ + static void initialiseGraphics(); /* the following entries are X11 specific and should eventually go away */ /// The display on which LyX is running diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index 9cb655648d..9eefafbb95 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/src/frontends/gnome/Dialogs.C b/src/frontends/gnome/Dialogs.C index 5461718385..d4792e2f9b 100644 --- a/src/frontends/gnome/Dialogs.C +++ b/src/frontends/gnome/Dialogs.C @@ -64,10 +64,6 @@ #include "FormMinipage.h" */ -// Signal enabling all visible dialogs to be redrawn if so desired. -// E.g., when the GUI colours have been remapped. -SigC::Signal0 Dialogs::redrawGUI; - Dialogs::Dialogs(LyXView * lv) { add(new GUIUrl(*lv, *this)); diff --git a/src/frontends/gnome/GUIRunTime.C b/src/frontends/gnome/GUIRunTime.C index 74738fb247..b69ee4fa00 100644 --- a/src/frontends/gnome/GUIRunTime.C +++ b/src/frontends/gnome/GUIRunTime.C @@ -21,6 +21,8 @@ #include #include +#include "graphics/GraphicsImageXPM.h" + using std::endl; // I keep these here so that it will be processed as early in @@ -127,7 +129,20 @@ LyXView * GUIRunTime::createMainView(int w, int h) return new XFormsView(w, h); } - + +// Called bu the graphics cache to connect the approriate frontend +// image loading routines to the LyX kernel. +void GUIRunTime::initialiseGraphics() +{ + using namespace grfx; + using SigC::slot; + + // connect the image loader based on the XPM library + GImage::newImage.connect(slot(&GImageXPM::newImage)); + GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); +} + + Display * GUIRunTime::x11Display() { return fl_get_display(); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index fe7cdc80ba..fe156841e7 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,10 @@ +2002-03-04 Angus Leeming + + * Dialogs.C (redrawGUI): removed to frontends/Dialogs.C + + * Dialogs.C: + * GUIRunTime.C (initialiseGraphics): moved to GUIRunTime. + 2002-03-02 Lars Gullik Bjønnes * Makefile.am: get rid of LYX_LIBS diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 80d667fe59..401d460dc6 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -80,14 +80,8 @@ #include "xforms/FormShowFile.h" #include "xforms/FormTabular.h" -#include "graphics/GraphicsImageXPM.h" - #include "GUI.h" -// this makes no real sense for Qt2 -SigC::Signal0 Dialogs::redrawGUI; - - Dialogs::Dialogs(LyXView * lv) { // dialogs that have been converted to new scheme @@ -129,16 +123,3 @@ Dialogs::Dialogs(LyXView * lv) // dialogs by a simple connection here. hideAll.connect(hideBufferDependent.slot()); } - - -// Called bu the graphics cache to connect the approriate frontend -// image loading routines to the LyX kernel. -void Dialogs::initialiseGraphics() -{ - using namespace grfx; - using SigC::slot; - - // connect the image loader based on the XPM library - GImage::newImage.connect(slot(&GImageXPM::newImage)); - GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); -} diff --git a/src/frontends/qt2/GUIRunTime.C b/src/frontends/qt2/GUIRunTime.C index 4692ba0729..8aecae903d 100644 --- a/src/frontends/qt2/GUIRunTime.C +++ b/src/frontends/qt2/GUIRunTime.C @@ -19,6 +19,7 @@ #include "XFormsView.h" #include "GUIRunTime.h" #include "debug.h" +#include "graphics/GraphicsImageXPM.h" #include FORMS_H_LOCATION @@ -90,6 +91,19 @@ LyXView * GUIRunTime::createMainView(int w, int h) } +// Called bu the graphics cache to connect the approriate frontend +// image loading routines to the LyX kernel. +void GUIRunTime::initialiseGraphics() +{ + using namespace grfx; + using SigC::slot; + + // connect the image loader based on the XPM library + GImage::newImage.connect(slot(&GImageXPM::newImage)); + GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); +} + + Display * GUIRunTime::x11Display() { //return p.device()->x11Display(); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 937017a021..9b8c17bdcf 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,10 @@ +2002-03-04 Angus Leeming + + * Dialogs.C (redrawGUI): removed to frontends/Dialogs.C + + * Dialogs.C: + * GUIRunTime.C (initialiseGraphics): moved to GUIRunTime. + 2002-03-04 Angus Leeming * FormDocument.C (build): add a std:: qualifier to remove_if. diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 724d978da7..f44dddc7c2 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -81,12 +81,6 @@ #include "FormPreferences.h" #include "FormTabular.h" -#include "graphics/GraphicsImageXPM.h" -//#include "xformsGraphicsImage.h" - -// Signal enabling all visible dialogs to be redrawn if so desired. -// E.g., when the GUI colours have been remapped. -SigC::Signal0 Dialogs::redrawGUI; Dialogs::Dialogs(LyXView * lv) { @@ -130,18 +124,3 @@ Dialogs::Dialogs(LyXView * lv) // dialogs by a simple connection here. hideAll.connect(hideBufferDependent.slot()); } - -// Called bu the graphics cache to connect the approriate frontend -// image loading routines to the LyX kernel. -void Dialogs::initialiseGraphics() -{ - using namespace grfx; - using SigC::slot; - - // connect the image loader based on the XPM library - GImage::newImage.connect(slot(&GImageXPM::newImage)); - GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); - // connect the image loader based on the xforms library -// GImage::newImage.connect(slot(&xformsGImage::newImage)); -// GImage::loadableFormats.connect(slot(&xformsGImage::loadableFormats)); -} diff --git a/src/frontends/xforms/GUIRunTime.C b/src/frontends/xforms/GUIRunTime.C index 423dd12306..05bba6edb7 100644 --- a/src/frontends/xforms/GUIRunTime.C +++ b/src/frontends/xforms/GUIRunTime.C @@ -19,6 +19,12 @@ #include "XFormsView.h" #include "debug.h" +//#if (FL_REVISION >= 89 && FL_FIXLEVEL >= 6) +//#include "xformsGImage.h" +//#else +#include "graphics/GraphicsImageXPM.h" +//#endif + // I keep these here so that it will be processed as early in // the compilation process as possible. #if !defined(FL_REVISION) || FL_REVISION < 88 || FL_VERSION != 0 @@ -125,6 +131,26 @@ LyXView * GUIRunTime::createMainView(int w, int h) } + +// Called bu the graphics cache to connect the approriate frontend +// image loading routines to the LyX kernel. +void GUIRunTime::initialiseGraphics() +{ + using namespace grfx; + using SigC::slot; + +//#if (FL_REVISION >= 89 && FL_FIXLEVEL >= 6) + // connect the image loader based on the xforms library +// GImage::newImage.connect(slot(&xformsGImage::newImage)); +// GImage::loadableFormats.connect(slot(&xformsGImage::loadableFormats)); +//#else + // connect the image loader based on the XPM library + GImage::newImage.connect(slot(&GImageXPM::newImage)); + GImage::loadableFormats.connect(slot(&GImageXPM::loadableFormats)); +//#endif +} + + Display * GUIRunTime::x11Display() { return fl_get_display(); diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index 8c5d13f7e3..5466b1fd91 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -201,6 +201,10 @@ libxforms_la_SOURCES = \ xformsBC.C \ xformsBC.h + +# xformsGImage.C \ +# xformsGImage.h + # These still have to be added. Sooner or later. ARRae-20000411 # GUI_defaults.C \ # GUI_initialize.C \ diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index a6de1db243..3305160858 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2002-03-04 Angus Leeming + + * GraphicsCache.C: change associated with move of initialiseGraphics + to GUIRuntime. + 2002-02-28 Angus Leeming * GraphicsParams.[Ch]: diff --git a/src/graphics/GraphicsCache.C b/src/graphics/GraphicsCache.C index 1380bf4adc..b478331033 100644 --- a/src/graphics/GraphicsCache.C +++ b/src/graphics/GraphicsCache.C @@ -18,7 +18,7 @@ #include "GraphicsImage.h" #include "GraphicsParams.h" #include "insets/insetgraphics.h" -#include "frontends/Dialogs.h" +#include "frontends/GUIRunTime.h" namespace grfx { @@ -28,7 +28,7 @@ GCache & GCache::get() static bool start = true; if (start) { start = false; - Dialogs::initialiseGraphics(); + GUIRunTime::initialiseGraphics(); } // Now return the cache