summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-06 21:46:09 (UTC)
committer zecke <zecke>2002-11-06 21:46:09 (UTC)
commit86a2bf4747f46a9915dffac376b888faa5400ec8 (patch) (side-by-side diff)
tree247946d61e915e1c238ce87a7ee14f014fc6e804
parent7a0e2678368c1cbb036085aaa594801e93e0b1c1 (diff)
downloadopie-86a2bf4747f46a9915dffac376b888faa5400ec8.zip
opie-86a2bf4747f46a9915dffac376b888faa5400ec8.tar.gz
opie-86a2bf4747f46a9915dffac376b888faa5400ec8.tar.bz2
Some ugly ifdefs inside fontdatabase for now :(
This temp. helps the x11 port
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/fontdatabase.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index 899d5cf..c7a5211 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -47,18 +47,18 @@ static QString fontFamily( const QString& key )
//int pointSize = key.mid(u0+1,u1-u0-1).toInt();
//int weight = key.mid(u1+1,u2-u1-1).toInt();
//bool italic = key.mid(u2-1,1) == "i";
// #### ignores _t and _I fields
return family;
}
#endif
-QValueList<FontFactory> *FontDatabase::factoryList = 0;
+QValueList<FontFactory> *FontDatabase::factoryList = 0;
/*!
\class FontDatabase fontdatabase.h
\brief The FontDatabase class provides information about available fonts.
Most often you will simply want to query the database for the
available font families().
Use FontDatabase rather than QFontDatabase when you may need access
@@ -87,16 +87,21 @@ FontDatabase::FontDatabase()
/*!
Returns a list of names of all the available font families.
*/
QStringList FontDatabase::families() const
{
#ifndef QT_NO_FONTDATABASE
return QFontDatabase::families();
#else
+
+#ifndef QWS
+ QStringList list;
+ return list;
+#else
QStringList list;
QDict<void> familyDict;
QDiskFont *qdf;
for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0;
qdf=qt_fontmanager->diskfonts.next()) {
QString familyname = qdf->name;
if ( !familyDict.find( familyname ) ) {
familyDict.insert( familyname, (void *)1 );
@@ -110,16 +115,17 @@ QStringList FontDatabase::families() const
if ( !familyDict.find( familyname ) ) {
familyDict.insert( familyname, (void *)1 );
list.append( familyname );
}
}
return list;
#endif
+#endif
}
#ifdef QT_NO_FONTDATABASE
/*!
Returns a list of standard fontsizes.
*/
QValueList<int> FontDatabase::standardSizes()
{
@@ -139,16 +145,20 @@ QValueList<int> FontDatabase::standardSizes()
#endif
/*!
Load any font renderer plugins that are available and make the fonts
that the plugins can read available.
*/
void FontDatabase::loadRenderers()
{
+#ifndef QWS
+ return;
+#else
+
#ifndef QT_NO_COMPONENT
if ( !factoryList )
factoryList = new QValueList<FontFactory>;
QValueList<FontFactory>::Iterator mit;
for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
qt_fontmanager->factories.setAutoDelete( false );
qt_fontmanager->factories.removeRef( (*mit).factory );
@@ -178,23 +188,27 @@ void FontDatabase::loadRenderers()
factoryList->append( factory );
qt_fontmanager->factories.append( factory.factory );
readFonts( factory.factory );
} else {
delete lib;
}
}
#endif
+#endif
}
/*!
\internal
*/
void FontDatabase::readFonts( QFontFactory *factory )
{
+#ifndef QWS
+return;
+#else
// Load in font definition file
QString fn = fontDir() + "fontdir";
FILE* fontdef=fopen(fn.local8Bit(),"r");
if(!fontdef) {
QCString temp=fn.local8Bit();
qWarning("Cannot find font definition file %s - is $QTDIR set correctly?",
temp.data());
return;
@@ -225,10 +239,11 @@ void FontDatabase::readFonts( QFontFactory *factory )
QFontDatabase::qwsAddDiskFont( qdf );
#endif
}
}
}
fgets(buf,200,fontdef);
}
fclose(fontdef);
+#endif
}