summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-06 21:46:09 (UTC)
committer zecke <zecke>2002-11-06 21:46:09 (UTC)
commit86a2bf4747f46a9915dffac376b888faa5400ec8 (patch) (unidiff)
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
@@ -49,14 +49,14 @@ static QString fontFamily( const QString& key )
49 //bool italic = key.mid(u2-1,1) == "i"; 49 //bool italic = key.mid(u2-1,1) == "i";
50 // #### ignores _t and _I fields 50 // #### ignores _t and _I fields
51 return family; 51 return family;
52} 52}
53#endif 53#endif
54 54
55QValueList<FontFactory> *FontDatabase::factoryList = 0;
56 55
56QValueList<FontFactory> *FontDatabase::factoryList = 0;
57/*! 57/*!
58 \class FontDatabase fontdatabase.h 58 \class FontDatabase fontdatabase.h
59 \brief The FontDatabase class provides information about available fonts. 59 \brief The FontDatabase class provides information about available fonts.
60 60
61 Most often you will simply want to query the database for the 61 Most often you will simply want to query the database for the
62 available font families(). 62 available font families().
@@ -89,12 +89,17 @@ FontDatabase::FontDatabase()
89*/ 89*/
90QStringList FontDatabase::families() const 90QStringList FontDatabase::families() const
91{ 91{
92#ifndef QT_NO_FONTDATABASE 92#ifndef QT_NO_FONTDATABASE
93 return QFontDatabase::families(); 93 return QFontDatabase::families();
94#else 94#else
95
96#ifndef QWS
97 QStringList list;
98 return list;
99#else
95 QStringList list; 100 QStringList list;
96 QDict<void> familyDict; 101 QDict<void> familyDict;
97 QDiskFont *qdf; 102 QDiskFont *qdf;
98 for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0; 103 for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0;
99 qdf=qt_fontmanager->diskfonts.next()) { 104 qdf=qt_fontmanager->diskfonts.next()) {
100 QString familyname = qdf->name; 105 QString familyname = qdf->name;
@@ -112,12 +117,13 @@ QStringList FontDatabase::families() const
112 list.append( familyname ); 117 list.append( familyname );
113 } 118 }
114 } 119 }
115 120
116 return list; 121 return list;
117#endif 122#endif
123#endif
118} 124}
119 125
120#ifdef QT_NO_FONTDATABASE 126#ifdef QT_NO_FONTDATABASE
121/*! 127/*!
122 Returns a list of standard fontsizes. 128 Returns a list of standard fontsizes.
123*/ 129*/
@@ -141,12 +147,16 @@ QValueList<int> FontDatabase::standardSizes()
141/*! 147/*!
142 Load any font renderer plugins that are available and make the fonts 148 Load any font renderer plugins that are available and make the fonts
143 that the plugins can read available. 149 that the plugins can read available.
144*/ 150*/
145void FontDatabase::loadRenderers() 151void FontDatabase::loadRenderers()
146{ 152{
153#ifndef QWS
154 return;
155#else
156
147#ifndef QT_NO_COMPONENT 157#ifndef QT_NO_COMPONENT
148 if ( !factoryList ) 158 if ( !factoryList )
149 factoryList = new QValueList<FontFactory>; 159 factoryList = new QValueList<FontFactory>;
150 160
151 QValueList<FontFactory>::Iterator mit; 161 QValueList<FontFactory>::Iterator mit;
152 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) { 162 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
@@ -180,19 +190,23 @@ void FontDatabase::loadRenderers()
180 readFonts( factory.factory ); 190 readFonts( factory.factory );
181 } else { 191 } else {
182 delete lib; 192 delete lib;
183 } 193 }
184 } 194 }
185#endif 195#endif
196#endif
186} 197}
187 198
188/*! 199/*!
189 \internal 200 \internal
190*/ 201*/
191void FontDatabase::readFonts( QFontFactory *factory ) 202void FontDatabase::readFonts( QFontFactory *factory )
192{ 203{
204#ifndef QWS
205return;
206#else
193 // Load in font definition file 207 // Load in font definition file
194 QString fn = fontDir() + "fontdir"; 208 QString fn = fontDir() + "fontdir";
195 FILE* fontdef=fopen(fn.local8Bit(),"r"); 209 FILE* fontdef=fopen(fn.local8Bit(),"r");
196 if(!fontdef) { 210 if(!fontdef) {
197 QCString temp=fn.local8Bit(); 211 QCString temp=fn.local8Bit();
198 qWarning("Cannot find font definition file %s - is $QTDIR set correctly?", 212 qWarning("Cannot find font definition file %s - is $QTDIR set correctly?",
@@ -227,8 +241,9 @@ void FontDatabase::readFonts( QFontFactory *factory )
227 } 241 }
228 } 242 }
229 } 243 }
230 fgets(buf,200,fontdef); 244 fgets(buf,200,fontdef);
231 } 245 }
232 fclose(fontdef); 246 fclose(fontdef);
247#endif
233} 248}
234 249