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
This commit is contained in:
John Levon 2002-07-12 03:05:13 +00:00
parent b90477decc
commit c17851a1d5
15 changed files with 73 additions and 20 deletions

View File

@ -1,3 +1,7 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: use lyx_gui::update_fonts()
2002-07-12 John Levon <moz@compsoc.man.ac.uk> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: use lyx_gui::update_color() * lyxfunc.C: use lyx_gui::update_color()

View File

@ -1,3 +1,10 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* font_loader.h: remove
* lyx_gui.h: add update_fonts(), font_available()
2002-07-12 John Levon <moz@compsoc.man.ac.uk> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.h: add update_color * lyx_gui.h: add update_color

View File

@ -41,7 +41,6 @@ libfrontends_la_SOURCES = \
WorkArea.C \ WorkArea.C \
WorkArea.h \ WorkArea.h \
WorkAreaFactory.h \ WorkAreaFactory.h \
font_loader.h \
font_metrics.h \ font_metrics.h \
guiapi.h \ guiapi.h \
key_state.h \ key_state.h \

View File

@ -1,3 +0,0 @@
// very temporary
#include "xforms/xfont_loader.h"

View File

@ -15,6 +15,7 @@
#include <vector> #include <vector>
class Dialogs; class Dialogs;
class LyXFont;
/// GUI interaction /// GUI interaction
namespace lyx_gui { namespace lyx_gui {
@ -46,6 +47,16 @@ namespace lyx_gui {
* update an altered GUI color * update an altered GUI color
*/ */
void update_color(LColor::color col); 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 #endif // LYX_GUI_H

View File

@ -1,3 +1,7 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: implement update_fonts(), font_available()
2002-07-12 John Levon <moz@compsoc.man.ac.uk> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add un-needed update_color() * lyx_gui.C: add un-needed update_color()

View File

@ -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" Those with asterisks are what I perceive as being "big jobs"
ColorHandler
- remove mentions in core code
FileDialog FileDialog
- add buttons for Documents, Templates, etc. to the file dialog toolbar - add buttons for Documents, Templates, etc. to the file dialog toolbar

View File

@ -21,6 +21,7 @@
#include "lyx_gui.h" #include "lyx_gui.h"
#include "lyx_main.h" #include "lyx_main.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxfont.h"
// FIXME: move this stuff out again // FIXME: move this stuff out again
#include "bufferlist.h" #include "bufferlist.h"
@ -36,6 +37,7 @@
#include "QtView.h" #include "QtView.h"
#include "QLImage.h" #include "QLImage.h"
#include "qfont_loader.h"
#include <qapplication.h> #include <qapplication.h>
@ -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 // no need
} }
void lyx_gui::update_fonts()
{
fontloader.update();
}
bool lyx_gui::font_available(LyXFont const & font)
{
return fontloader.available(font);
}

View File

@ -32,13 +32,13 @@ class qfont_loader {
public: public:
qfont_loader(); qfont_loader();
virtual ~qfont_loader(); ~qfont_loader();
/// update fonts after zoom, dpi, font names, or norm change /// update fonts after zoom, dpi, font names, or norm change
virtual void update(); void update();
/// do we have anything matching? /// do we have anything matching?
virtual bool available(LyXFont const & f); bool available(LyXFont const & f);
/// get the QFont for this LyXFont /// get the QFont for this LyXFont
QFont const & get(LyXFont const & f) { QFont const & get(LyXFont const & f) {

View File

@ -1,3 +1,7 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: implement update_fonts(), font_available()
2002-07-12 John Levon <moz@compsoc.man.ac.uk> 2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: add update_color() * lyx_gui.C: add update_color()

View File

@ -20,6 +20,7 @@
#include "lyx_main.h" #include "lyx_main.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxfont.h"
// FIXME: move this stuff out again // FIXME: move this stuff out again
#include "bufferlist.h" #include "bufferlist.h"
@ -31,6 +32,7 @@
#include FORMS_H_LOCATION #include FORMS_H_LOCATION
#include "ColorHandler.h" #include "ColorHandler.h"
#include "xforms_helpers.h" #include "xforms_helpers.h"
#include "xfont_loader.h"
#ifdef USE_XFORMS_IMAGE_LOADER #ifdef USE_XFORMS_IMAGE_LOADER
#include "xformsImage.h" #include "xformsImage.h"
#else #else
@ -344,3 +346,15 @@ void lyx_gui::update_color(LColor::color col)
{ {
lyxColorHandler->updateColor(col); lyxColorHandler->updateColor(col);
} }
void lyx_gui::update_fonts()
{
fontloader.update();
}
bool lyx_gui::font_available(LyXFont const & font)
{
return fontloader.available(font);
}

View File

@ -99,8 +99,6 @@
#include <utility> #include <utility>
#include <algorithm> #include <algorithm>
#include "frontends/font_loader.h"
using std::pair; using std::pair;
using std::make_pair; using std::make_pair;
using std::endl; using std::endl;
@ -1578,7 +1576,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
// handle the screen font changes. // handle the screen font changes.
// //
lyxrc.set_font_norm_type(); lyxrc.set_font_norm_type();
fontloader.update(); lyx_gui::update_fonts();
// Of course we should only do the resize and the textcache.clear // Of course we should only do the resize and the textcache.clear
// if values really changed...but not very important right now. (Lgb) // if values really changed...but not very important right now. (Lgb)
// All visible buffers will need resize // All visible buffers will need resize

View File

@ -1,3 +1,8 @@
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* math_support.C:
* math_factory.C: use lyx_gui::font_available()
2002-07-09 Angus Leeming <leeming@lyx.org> 2002-07-09 Angus Leeming <leeming@lyx.org>
* math_braceinset.h: * math_braceinset.h:

View File

@ -39,7 +39,7 @@
#include "math_support.h" #include "math_support.h"
#include "Lsstream.h" #include "Lsstream.h"
#include "support/filetools.h" // LibFileSearch #include "support/filetools.h" // LibFileSearch
#include "frontends/font_loader.h" #include "frontends/lyx_gui.h"
#include <map> #include <map>
#include <fstream> #include <fstream>
@ -58,7 +58,7 @@ bool math_font_available(string & name)
augmentFont(f, name); augmentFont(f, name);
// Do we have the font proper? // Do we have the font proper?
if (fontloader.available(f)) if (lyx_gui::font_available(f))
return true; return true;
// can we fake it? // can we fake it?

View File

@ -9,7 +9,7 @@
#include "math_parser.h" #include "math_parser.h"
#include "frontends/Painter.h" #include "frontends/Painter.h"
#include "frontends/font_metrics.h" #include "frontends/font_metrics.h"
#include "frontends/font_loader.h" #include "frontends/lyx_gui.h"
#include "debug.h" #include "debug.h"
#include "commandtags.h" #include "commandtags.h"
#include "dimension.h" #include "dimension.h"
@ -632,9 +632,9 @@ void augmentFont(LyXFont & font, string const & name)
initialized = true; initialized = true;
// fake fonts if necessary // fake fonts if necessary
if (!fontloader.available(getFont("mathfrak"))) if (!lyx_gui::font_available(getFont("mathfrak")))
fakeFont("mathfrak", "lyxfakefrak"); fakeFont("mathfrak", "lyxfakefrak");
if (!fontloader.available(getFont("mathcal"))) if (!lyx_gui::font_available(getFont("mathcal")))
fakeFont("mathcal", "lyxfakecal"); fakeFont("mathcal", "lyxfakecal");
} }
fontinfo * info = searchFont(name); fontinfo * info = searchFont(name);