ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

bmfd.h
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS win32 subsystem
00003  * LICENSE:         GPL - See COPYING in the top level directory
00004  * PURPOSE:         GDI font driver for bitmap fonts
00005  * PROGRAMMER:      Timo Kreuzer (timo.kreuzer@reactos.org)
00006  */
00007 
00008 #include <stdarg.h>
00009 #include <windef.h>
00010 #include <wingdi.h>
00011 #include <winddi.h>
00012 
00013 #if defined(_M_IX86) || defined(_M_AMD64)
00014 /* on x86 and x64, unaligned access is allowed, byteorder is LE */
00015 #define GETVAL(x) (x)
00016 #else
00017 // FIXME: BE
00018 #define GETVAL(x) \
00019     sizeof(x) == 1 ? (x) : \
00020     sizeof(x) == 2 ? (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8)) : \
00021     (((PCHAR)&(x))[0] + (((PCHAR)&(x))[1] << 8) + (((PCHAR)&(x))[2] << 16) + \
00022      (((PCHAR)&(x))[3] << 24))
00023 
00024 #endif
00025 
00026 #define FDM_MASK \
00027     FDM_TYPE_CONST_BEARINGS | FDM_TYPE_ZERO_BEARINGS | \
00028     FDM_TYPE_CHAR_INC_EQUAL_BM_BASE | FDM_TYPE_MAXEXT_EQUAL_BM_SIDE | \
00029     FDM_TYPE_BM_SIDE_CONST
00030 
00031 #define FM_INFO_MASK \
00032     FM_INFO_TECH_BITMAP | FM_INFO_1BPP | FM_INFO_INTEGER_WIDTH | \
00033     FM_INFO_RETURNS_BITMAPS | FM_INFO_RIGHT_HANDED | FM_INFO_INTEGRAL_SCALING |\
00034     FM_INFO_90DEGREE_ROTATIONS | FM_INFO_OPTICALLY_FIXED_PITCH | FM_INFO_NONNEGATIVE_AC
00035 
00036 #define FLOATL_1 0x3f800000
00037 
00038 #define TAG_PDEV 'veDP'
00039 #define TAG_GLYPHSET 'GlSt'
00040 #define TAG_IFIMETRICS 'Ifim'
00041 #define TAG_FONTINFO 'Font'
00042 
00043 
00046 #define IMAGE_DOS_MAGIC 0x594D // FIXME: hack hack hack
00047 
00048 #include <pshpack1.h>
00049 typedef struct
00050 {
00051     WORD offset;
00052     WORD length;
00053     WORD flags;
00054     WORD id;
00055     WORD handle;
00056     WORD usage;
00057 } NE_NAMEINFO, *PNE_NAMEINFO;
00058 
00059 #define NE_RSCTYPE_FONT    0x8008
00060 #define NE_RSCTYPE_FONTDIR 0x8007
00061 typedef struct
00062 {
00063     WORD type_id;
00064     WORD count;
00065     DWORD resloader;
00066     NE_NAMEINFO nameinfo[1];
00067 } NE_TYPEINFO, *PNE_TYPEINFO;
00068 
00069 typedef struct
00070 {
00071     WORD  size_shift;
00072     NE_TYPEINFO typeinfo[1];
00073 } NE_RESTABLE, *PNE_RESTABLE;
00074 
00075 // Values of dfFlags:
00076 #define DFF_FIXED            0x0001
00077 #define DFF_PROPORTIONAL     0x0002
00078 #define DFF_ABCFIXED         0x0004
00079 #define DFF_ABCPROPORTIONAL  0x0008
00080 #define DFF_1COLOR           0x0010
00081 #define DFF_16COLOR          0x0020
00082 #define DFF_256COLOR         0x0040
00083 #define DFF_RGBCOLOR         0x0080
00084 
00085 // see http://msdn.microsoft.com/en-us/library/ms648014(VS.85).aspx
00086 typedef struct _FONTDIRENTRY
00087 {
00088     WORD dfVersion;
00089     DWORD dfSize;
00090     char dfCopyright[60];
00091     WORD dfType;
00092     WORD dfPoints;
00093     WORD dfVertRes;
00094     WORD dfHorizRes;
00095     WORD dfAscent;
00096     WORD dfInternalLeading;
00097     WORD dfExternalLeading;
00098     BYTE dfItalic;
00099     BYTE dfUnderline;
00100     BYTE dfStrikeOut;
00101     WORD dfWeight;
00102     BYTE dfCharSet;
00103     WORD dfPixWidth;
00104     WORD dfPixHeight;
00105     BYTE dfPitchAndFamily;
00106     WORD dfAvgWidth;
00107     WORD dfMaxWidth;
00108     BYTE dfFirstChar;
00109     BYTE dfLastChar;
00110     BYTE dfDefaultChar;
00111     BYTE dfBreakChar;
00112     WORD dfWidthBytes;
00113     DWORD dfDevice;
00114     DWORD dfFace;
00115     DWORD dfReserved;
00116     char szDeviceName[1];
00117     char szFaceName[1];
00118 } FONTDIRENTRY, *PFONTDIRENTRY;
00119 
00120 typedef struct _DIRENTRY
00121 { 
00122     WORD fontOrdinal;
00123     FONTDIRENTRY fde;
00124 } DIRENTRY, *PDIRENTRY;
00125 
00126 typedef struct _FONTGROUPHDR
00127 { 
00128   WORD NumberOfFonts;
00129   DIRENTRY ade[1];
00130 } FONTGROUPHDR, *PFONTGROUPHDR;
00131 
00132 typedef struct
00133 {
00134     WORD dfVersion;
00135     DWORD dfSize;
00136     CHAR dfCopyright[60];
00137     WORD dfType;
00138     WORD dfPoints;
00139     WORD dfVertRes;
00140     WORD dfHorizRes;
00141     WORD dfAscent;
00142     WORD dfInternalLeading;
00143     WORD dfExternalLeading;
00144     BYTE dfItalic;
00145     BYTE dfUnderline;
00146     BYTE dfStrikeOut;
00147     WORD dfWeight;
00148     BYTE dfCharSet;
00149     WORD dfPixWidth;
00150     WORD dfPixHeight;
00151     BYTE dfPitchAndFamily;
00152     WORD dfAvgWidth;
00153     WORD dfMaxWidth;
00154     BYTE dfFirstChar;
00155     BYTE dfLastChar;
00156     BYTE dfDefaultChar;
00157     BYTE dfBreakChar;
00158     WORD dfWidthBytes;
00159     DWORD dfDevice;
00160     DWORD dfFace;
00161     DWORD dfBitsPointer;
00162     DWORD dfBitsOffset;
00163     BYTE dfReserved;
00164     /* Version 3.00: */
00165     DWORD dfFlags;
00166     WORD dfAspace;
00167     WORD dfBspace;
00168     WORD dfCspace;
00169     DWORD dfColorPointer;
00170     DWORD dfReserved1[4];
00171     BYTE dfCharTable[1];
00172 } FONTINFO16, *LPFONTINFO16, *PFONTINFO16;
00173 
00174 typedef struct
00175 {
00176      WORD geWidth;
00177      WORD geOffset;
00178 } GLYPHENTRY20, *PGLYPHENTRY20;
00179 
00180 typedef struct
00181 {
00182      WORD geWidth;
00183      DWORD geOffset;
00184 } GLYPHENTRY30, *PGLYPHENTRY30;
00185 
00186 typedef union
00187 {
00188     GLYPHENTRY20 ge20;
00189     GLYPHENTRY30 ge30;
00190 } GLYPHENTRY, *PGLYPHENTRY;
00191 
00192 #include <poppack.h>
00193 
00194 
00197 typedef enum
00198 {
00199     FONTTYPE_FON,
00200     FONTTYPE_FNT,
00201 } FONTTYPE;
00202 
00203 typedef struct
00204 {
00205     PFONTDIRENTRY pFontDirEntry;
00206     PFONTINFO16 pFontInfo;
00207     PBYTE pCharTable;
00208     ULONG cjEntrySize;
00209     ULONG ulVersion;
00210     PCHAR pszFaceName;
00211     PCHAR pszCopyright;
00212     ULONG cGlyphs;
00213     CHAR chFirstChar;
00214     CHAR chLastChar;
00215     WCHAR wcFirstChar;
00216     WCHAR wcLastChar;
00217     WCHAR wcDefaultChar;
00218     WCHAR wcBreakChar;
00219     WORD wPixHeight;
00220     WORD wPixWidth;
00221     WORD wWidthBytes;
00222     WORD wA;
00223     WORD wB;
00224     WORD wC;
00225     WORD wAscent;
00226     WORD wDescent;
00227     FLONG flInfo;
00228 } BMFD_FACE, *PBMFD_FACE;
00229 
00230 typedef struct
00231 {
00232     PVOID pvView;
00233     ULONG_PTR iFile;
00234     PFONTGROUPHDR pFontDir;
00235     FONTTYPE ulFontType;
00236     ULONG cNumFaces;
00237     BMFD_FACE aface[1];
00238 } BMFD_FILE, *PBMFD_FILE;
00239 
00240 typedef struct
00241 {
00242     FONTOBJ *pfo;
00243     PBMFD_FACE pface;
00244     ULONG xScale;
00245     ULONG yScale;
00246     ULONG ulAngle;
00247 } BMFD_FONT, *PBMFD_FONT;
00248 
00249 //"Bold Italic Underline Strikeout"
00250 #define MAX_STYLESIZE 35
00251 typedef struct
00252 {
00253     IFIMETRICS ifim;
00254     BYTE ajCharSet[16];
00255     WCHAR wszFamilyName[LF_FACESIZE];
00256     WCHAR wszFaceName[LF_FACESIZE];
00257     WCHAR wszStyleName[MAX_STYLESIZE];
00258 } BMFD_IFIMETRICS, *PBMFD_IFIMETRICS;
00259 
00260 
00263 ULONG
00264 DbgPrint(IN PCHAR Format, IN ...);
00265 
00266 DHPDEV
00267 APIENTRY
00268 BmfdEnablePDEV(
00269     IN DEVMODEW *pdm,
00270     IN LPWSTR pwszLogAddress,
00271     IN ULONG cPat,
00272     OUT HSURF *phsurfPatterns,
00273     IN ULONG cjCaps,
00274     OUT ULONG *pdevcaps,
00275     IN ULONG cjDevInfo,
00276     OUT DEVINFO *pdi,
00277     IN HDEV hdev,
00278     IN LPWSTR pwszDeviceName,
00279     IN HANDLE hDriver);
00280 
00281 VOID
00282 APIENTRY
00283 BmfdCompletePDEV(
00284     IN DHPDEV dhpdev,
00285     IN HDEV hdev);
00286 
00287 VOID
00288 APIENTRY
00289 BmfdDisablePDEV(
00290     IN DHPDEV dhpdev);
00291 
00292 ULONG_PTR
00293 APIENTRY
00294 BmfdLoadFontFile(
00295     ULONG cFiles,
00296     ULONG_PTR *piFile,
00297     PVOID *ppvView,
00298     ULONG *pcjView,
00299     DESIGNVECTOR *pdv,
00300     ULONG ulLangID,
00301     ULONG ulFastCheckSum);
00302 
00303 BOOL
00304 APIENTRY
00305 BmfdUnloadFontFile(
00306     IN ULONG_PTR iFile);
00307 
00308 LONG
00309 APIENTRY
00310 BmfdQueryFontFile(
00311     ULONG_PTR iFile,
00312     ULONG ulMode,
00313     ULONG cjBuf,
00314     ULONG *pulBuf);
00315 
00316 LONG
00317 APIENTRY
00318 BmfdQueryFontCaps(
00319     ULONG culCaps,
00320     ULONG *pulCaps);
00321 
00322 PVOID
00323 APIENTRY
00324 BmfdQueryFontTree(
00325     DHPDEV dhpdev,
00326     ULONG_PTR iFile,
00327     ULONG iFace,
00328     ULONG iMode,
00329     ULONG_PTR *pid);
00330 
00331 PIFIMETRICS
00332 APIENTRY
00333 BmfdQueryFont(
00334     IN DHPDEV dhpdev,
00335     IN ULONG_PTR iFile,
00336     IN ULONG iFace,
00337     IN ULONG_PTR *pid);
00338 
00339 VOID
00340 APIENTRY
00341 BmfdFree(
00342     PVOID pv,
00343     ULONG_PTR id);
00344 
00345 PFD_GLYPHATTR
00346 APIENTRY
00347 BmfdQueryGlyphAttrs(
00348     FONTOBJ *pfo,
00349     ULONG iMode);
00350 
00351 LONG
00352 APIENTRY
00353 BmfdQueryFontData(
00354     DHPDEV dhpdev,
00355     FONTOBJ *pfo,
00356     ULONG iMode,
00357     HGLYPH hg,
00358     OUT GLYPHDATA *pgd,
00359     PVOID pv,
00360     ULONG cjSize);
00361 
00362 VOID
00363 APIENTRY
00364 BmfdDestroyFont(
00365     IN FONTOBJ *pfo);
00366 

Generated on Sun May 27 2012 04:38:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.