From d42a082c68e364f49da1515cab063572bcc8b38e Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 12 Jul 2002 16:26:25 +0000 Subject: [PATCH] remove init_graphics() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4627 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/ChangeLog | 4 ++++ src/frontends/lyx_gui.h | 3 --- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/lyx_gui.C | 14 +++++--------- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/lyx_gui.C | 30 ++++++++++++------------------ src/graphics/ChangeLog | 4 ++++ src/graphics/GraphicsCache.C | 6 ------ 8 files changed, 33 insertions(+), 36 deletions(-) diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 62e7cce35d..b132925deb 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyx_gui.h: remove init_graphics() + 2002-07-12 John Levon * Toolbar.h: diff --git a/src/frontends/lyx_gui.h b/src/frontends/lyx_gui.h index 4da6f3dc39..d4f0c03e45 100644 --- a/src/frontends/lyx_gui.h +++ b/src/frontends/lyx_gui.h @@ -35,9 +35,6 @@ namespace lyx_gui { */ void start(string const & batch, std::vector files); - /// initialise graphics - void init_graphics(); - /** Eg, passing LColor::black returns "000000", * passing LColor::white returns "ffffff". */ diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 2e09439f89..02d9e89896 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyx_gui.C: move init_graphics() to parse_init() + 2002-07-12 John Levon * Toolbar_pimpl.h: diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index b318a1f3a0..5ca81241cc 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -58,6 +58,11 @@ LyXServer * lyxserver; void lyx_gui::parse_init(int & argc, char * argv[]) { static QApplication a(argc, argv); + + using namespace grfx; + + Image::newImage = boost::bind(&QLImage::newImage); + Image::loadableFormats = boost::bind(&QLImage::loadableFormats); } @@ -114,15 +119,6 @@ void lyx_gui::start(string const & batch, vector files) } -void lyx_gui::init_graphics() -{ - using namespace grfx; - - Image::newImage = boost::bind(&QLImage::newImage); - Image::loadableFormats = boost::bind(&QLImage::loadableFormats); -} - - string const lyx_gui::hexname(LColor::color col) { // FIXME diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index d113246a5c..84c084ccbb 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyx_gui.C: move init_graphics() into setup + 2002-07-12 Angus Leeming * xformsImage.C (width): apply fudge irrespective of library version. diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 7eaaf8f3b1..67c55eede8 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -152,6 +152,18 @@ void lyx_gui::parse_init(int & argc, char * argv[]) XSetErrorHandler(LyX_XErrHandler); lyxColorHandler.reset(new LyXColorHandler()); + + using namespace grfx; + +#ifdef USE_XFORMS_IMAGE_LOADER + // connect the image loader based on the xforms library + Image::newImage = boost::bind(&xformsImage::newImage); + Image::loadableFormats = boost::bind(&xformsImage::loadableFormats); +#else + // connect the image loader based on the XPM library + Image::newImage = boost::bind(&ImageXPM::newImage); + Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats); +#endif } @@ -297,24 +309,6 @@ void lyx_gui::start(string const & batch, vector files) } -// Called by the graphics cache to connect the appropriate frontend -// image loading routines to the LyX kernel. -void lyx_gui::init_graphics() -{ - using namespace grfx; - -#ifdef USE_XFORMS_IMAGE_LOADER - // connect the image loader based on the xforms library - Image::newImage = boost::bind(&xformsImage::newImage); - Image::loadableFormats = boost::bind(&xformsImage::loadableFormats); -#else - // connect the image loader based on the XPM library - Image::newImage = boost::bind(&ImageXPM::newImage); - Image::loadableFormats = boost::bind(&ImageXPM::loadableFormats); -#endif -} - - string const lyx_gui::hexname(LColor::color col) { string const name = lcolor.getX11Name(col); diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 1a1d6c2f04..23cf06e790 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * GraphicsCache.C: remove init_graphics() + 2002-07-09 Angus Leeming * PreviewLoader.C (setAscentFractions): fix bug due to use of integer diff --git a/src/graphics/GraphicsCache.C b/src/graphics/GraphicsCache.C index f56c3ae4ee..12ddc91dff 100644 --- a/src/graphics/GraphicsCache.C +++ b/src/graphics/GraphicsCache.C @@ -40,12 +40,6 @@ struct Cache::Impl { Cache & Cache::get() { - static bool start = true; - if (start) { - start = false; - lyx_gui::init_graphics(); - } - // Now return the cache static Cache singleton; return singleton; -- 2.39.2