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>
* 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>
* lyx_gui.h: add update_color

View File

@ -41,7 +41,6 @@ libfrontends_la_SOURCES = \
WorkArea.C \
WorkArea.h \
WorkAreaFactory.h \
font_loader.h \
font_metrics.h \
guiapi.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>
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

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>
* 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"
ColorHandler
- remove mentions in core code
FileDialog
- add buttons for Documents, Templates, etc. to the file dialog toolbar

View File

@ -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 <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
}
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:
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) {

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>
* lyx_gui.C: add update_color()

View File

@ -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);
}

View File

@ -99,8 +99,6 @@
#include <utility>
#include <algorithm>
#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

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>
* math_braceinset.h:

View File

@ -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 <map>
#include <fstream>
@ -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?

View File

@ -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);