From: John Levon Date: Fri, 12 Jul 2002 03:05:13 +0000 (+0000) Subject: Move fontloader into lyx_gui stuff. Now Qt should compile out of the box X-Git-Tag: 1.6.10~18895 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c17851a1d5a20f13f9b48c6f5afc3f7a89117833;p=features.git Move fontloader into lyx_gui stuff. Now Qt should compile out of the box git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4612 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index ae72761610..220be184eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyxfunc.C: use lyx_gui::update_fonts() + 2002-07-12 John Levon * lyxfunc.C: use lyx_gui::update_color() diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index f8216c10d5..c732d5cf98 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,10 @@ +2002-07-12 John Levon + + * Makefile.am: + * font_loader.h: remove + + * lyx_gui.h: add update_fonts(), font_available() + 2002-07-12 John Levon * lyx_gui.h: add update_color diff --git a/src/frontends/Makefile.am b/src/frontends/Makefile.am index 71d76b3ede..3bc6960fa6 100644 --- a/src/frontends/Makefile.am +++ b/src/frontends/Makefile.am @@ -41,7 +41,6 @@ libfrontends_la_SOURCES = \ WorkArea.C \ WorkArea.h \ WorkAreaFactory.h \ - font_loader.h \ font_metrics.h \ guiapi.h \ key_state.h \ diff --git a/src/frontends/font_loader.h b/src/frontends/font_loader.h deleted file mode 100644 index 4f169af00e..0000000000 --- a/src/frontends/font_loader.h +++ /dev/null @@ -1,3 +0,0 @@ -// very temporary - -#include "xforms/xfont_loader.h" diff --git a/src/frontends/lyx_gui.h b/src/frontends/lyx_gui.h index b839db26cb..4da6f3dc39 100644 --- a/src/frontends/lyx_gui.h +++ b/src/frontends/lyx_gui.h @@ -15,6 +15,7 @@ #include class Dialogs; +class LyXFont; /// GUI interaction namespace lyx_gui { @@ -46,6 +47,16 @@ namespace lyx_gui { * update an altered GUI color */ void update_color(LColor::color col); + + /** + * update the font cache + */ + void update_fonts(); + + /** + * is the given font available ? + */ + bool font_available(LyXFont const & font); } #endif // LYX_GUI_H diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 5940891742..4789ac03a7 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyx_gui.C: implement update_fonts(), font_available() + 2002-07-12 John Levon * lyx_gui.C: add un-needed update_color() diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index f065aaf4a1..778eb7c648 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -3,10 +3,6 @@ we can say the first iteration of the Qt frontend is "finished". Those with asterisks are what I perceive as being "big jobs" -ColorHandler - - - remove mentions in core code - FileDialog - add buttons for Documents, Templates, etc. to the file dialog toolbar diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 7826081da6..b318a1f3a0 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -21,6 +21,7 @@ #include "lyx_gui.h" #include "lyx_main.h" #include "lyxrc.h" +#include "lyxfont.h" // FIXME: move this stuff out again #include "bufferlist.h" @@ -36,6 +37,7 @@ #include "QtView.h" #include "QLImage.h" +#include "qfont_loader.h" #include @@ -128,7 +130,19 @@ string const lyx_gui::hexname(LColor::color col) } -void lyx_gui::update_color(LColor::color col) +void lyx_gui::update_color(LColor::color) { // no need } + + +void lyx_gui::update_fonts() +{ + fontloader.update(); +} + + +bool lyx_gui::font_available(LyXFont const & font) +{ + return fontloader.available(font); +} diff --git a/src/frontends/qt2/qfont_loader.h b/src/frontends/qt2/qfont_loader.h index aea8ff88c5..dab300a3d2 100644 --- a/src/frontends/qt2/qfont_loader.h +++ b/src/frontends/qt2/qfont_loader.h @@ -32,13 +32,13 @@ class qfont_loader { public: qfont_loader(); - virtual ~qfont_loader(); + ~qfont_loader(); /// update fonts after zoom, dpi, font names, or norm change - virtual void update(); + void update(); /// do we have anything matching? - virtual bool available(LyXFont const & f); + bool available(LyXFont const & f); /// get the QFont for this LyXFont QFont const & get(LyXFont const & f) { diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 76fd8b5e17..e1fb4dee91 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2002-07-12 John Levon + + * lyx_gui.C: implement update_fonts(), font_available() + 2002-07-12 John Levon * lyx_gui.C: add update_color() diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 33b7f49736..7eaaf8f3b1 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -20,6 +20,7 @@ #include "lyx_main.h" #include "lyxrc.h" +#include "lyxfont.h" // FIXME: move this stuff out again #include "bufferlist.h" @@ -31,6 +32,7 @@ #include FORMS_H_LOCATION #include "ColorHandler.h" #include "xforms_helpers.h" +#include "xfont_loader.h" #ifdef USE_XFORMS_IMAGE_LOADER #include "xformsImage.h" #else @@ -344,3 +346,15 @@ 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); +} diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 1071eb048e..8f59ef76d5 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -99,8 +99,6 @@ #include #include -#include "frontends/font_loader.h" - using std::pair; using std::make_pair; using std::endl; @@ -1578,7 +1576,7 @@ string const LyXFunc::dispatch(kb_action action, string argument) // handle the screen font changes. // lyxrc.set_font_norm_type(); - fontloader.update(); + lyx_gui::update_fonts(); // Of course we should only do the resize and the textcache.clear // if values really changed...but not very important right now. (Lgb) // All visible buffers will need resize diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index efada9d5b0..61bec342ea 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2002-07-12 John Levon + + * math_support.C: + * math_factory.C: use lyx_gui::font_available() + 2002-07-09 Angus Leeming * math_braceinset.h: diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 70cf8a096f..712c7c4a79 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -39,7 +39,7 @@ #include "math_support.h" #include "Lsstream.h" #include "support/filetools.h" // LibFileSearch -#include "frontends/font_loader.h" +#include "frontends/lyx_gui.h" #include #include @@ -58,7 +58,7 @@ bool math_font_available(string & name) augmentFont(f, name); // Do we have the font proper? - if (fontloader.available(f)) + if (lyx_gui::font_available(f)) return true; // can we fake it? diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index c0fb776142..8d576ae111 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -9,7 +9,7 @@ #include "math_parser.h" #include "frontends/Painter.h" #include "frontends/font_metrics.h" -#include "frontends/font_loader.h" +#include "frontends/lyx_gui.h" #include "debug.h" #include "commandtags.h" #include "dimension.h" @@ -632,9 +632,9 @@ void augmentFont(LyXFont & font, string const & name) initialized = true; // fake fonts if necessary - if (!fontloader.available(getFont("mathfrak"))) + if (!lyx_gui::font_available(getFont("mathfrak"))) fakeFont("mathfrak", "lyxfakefrak"); - if (!fontloader.available(getFont("mathcal"))) + if (!lyx_gui::font_available(getFont("mathcal"))) fakeFont("mathcal", "lyxfakecal"); } fontinfo * info = searchFont(name);