[WIN32K]
[reactos.git] / reactos / subsystems / win32 / win32k / include / text.h
1 #pragma once
2
3 #define TAG_FINF 'FNIF'
4 //
5 // EXSTROBJ flags.
6 //
7 #define TO_MEM_ALLOCATED 0x0001
8 #define TO_ALL_PTRS_VALID 0x0002
9 #define TO_VALID 0x0004
10 #define TO_ESC_NOT_ORIENT 0x0008
11 #define TO_PWSZ_ALLOCATED 0x0010
12 #define TSIM_UNDERLINE1 0x0020
13 #define TSIM_UNDERLINE2 0x0040
14 #define TSIM_STRIKEOUT 0x0080
15 #define TO_HIGHRESTEXT 0x0100
16 #define TO_BITMAPS 0x0200
17 #define TO_PARTITION_INIT 0x0400
18 #define TO_ALLOC_FACENAME 0x0800
19 #define TO_SYS_PARTITION 0x1000
20 //
21 // Extended STROBJ
22 //
23 typedef struct _STRGDI
24 {
25 STROBJ StrObj; // Text string object header.
26 FLONG flTO;
27 INT cgposCopied;
28 INT cgposPositionsEnumerated;
29 PVOID prfo; // PRFONT -> PFONTGDI
30 PGLYPHPOS pgpos;
31 POINTFIX ptfxRef;
32 POINTFIX ptfxUpdate;
33 POINTFIX ptfxEscapement;
34 RECTFX rcfx;
35 FIX fxExtent;
36 FIX fxExtra;
37 FIX fxBreakExtra;
38 DWORD dwCodePage;
39 INT cExtraRects;
40 RECTL arclExtra[3];
41 RECTL rclBackGroundSave;
42 PWCHAR pwcPartition;
43 PLONG plPartition;
44 PLONG plNext;
45 PGLYPHPOS pgpNext;
46 PLONG plCurrentFont;
47 POINTL ptlBaseLineAdjust;
48 INT cTTSysGlyphs;
49 INT cSysGlyphs;
50 INT cDefGlyphs;
51 INT cNumFaceNameGlyphs;
52 PVOID pacFaceNameGlyphs;
53 ULONG acFaceNameGlyphs[8];
54 } STRGDI, *PSTRGDI;
55
56 #define TEXTOBJECT_INIT 0x00010000
57
58 /* GDI logical font object */
59 typedef struct
60 {
61 /* Header for all gdi objects in the handle table.
62 Do not (re)move this. */
63 BASEOBJECT BaseObject;
64 LFTYPE lft;
65 FLONG fl;
66 FONTOBJ *Font;
67 WCHAR FullName[LF_FULLFACESIZE];
68 WCHAR Style[LF_FACESIZE];
69 WCHAR FaceName[LF_FACESIZE];
70 DWORD dwOffsetEndArray;
71 // Fixed:
72 ENUMLOGFONTEXDVW logfont;
73 } TEXTOBJ, *PTEXTOBJ;
74
75 /* Internal interface */
76
77 #define TEXTOBJ_AllocText() ((PTEXTOBJ) GDIOBJ_AllocObj(GDIObjType_LFONT_TYPE))
78 #define TEXTOBJ_AllocTextWithHandle() ((PTEXTOBJ) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT, sizeof(TEXTOBJ)))
79 #define TEXTOBJ_FreeText(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDILoObjType_LO_FONT_TYPE)
80 #define TEXTOBJ_FreeTextByHandle(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)
81 #define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObject((HGDIOBJ) hBMObj, GDIObjType_LFONT_TYPE))
82 #define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_vUnlockObject ((POBJ)pBMObj)
83
84 PTEXTOBJ FASTCALL RealizeFontInit(HFONT);
85 NTSTATUS FASTCALL TextIntRealizeFont(HFONT,PTEXTOBJ);
86 NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont);
87 BOOL FASTCALL InitFontSupport(VOID);
88 BOOL FASTCALL IntIsFontRenderingEnabled(VOID);
89 BOOL FASTCALL IntIsFontRenderingEnabled(VOID);
90 VOID FASTCALL IntEnableFontRendering(BOOL Enable);
91 INT FASTCALL FontGetObject(PTEXTOBJ TextObj, INT Count, PVOID Buffer);
92 VOID FASTCALL IntLoadSystemFonts(VOID);
93 INT FASTCALL IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics);
94 ULONG FASTCALL ftGdiGetGlyphOutline(PDC,WCHAR,UINT,LPGLYPHMETRICS,ULONG,PVOID,LPMAT2,BOOL);
95 INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI,UINT,OUTLINETEXTMETRICW *);
96 BOOL FASTCALL ftGdiGetRasterizerCaps(LPRASTERIZER_STATUS);
97 BOOL FASTCALL TextIntGetTextExtentPoint(PDC,PTEXTOBJ,LPCWSTR,INT,ULONG,LPINT,LPINT,LPSIZE,FLONG);
98 BOOL FASTCALL ftGdiGetTextMetricsW(HDC,PTMW_INTERNAL);
99 DWORD FASTCALL IntGetFontLanguageInfo(PDC);
100 INT FASTCALL ftGdiGetTextCharsetInfo(PDC,PFONTSIGNATURE,DWORD);
101 DWORD FASTCALL ftGetFontUnicodeRanges(PFONTGDI, PGLYPHSET);
102 DWORD FASTCALL ftGdiGetFontData(PFONTGDI,DWORD,DWORD,PVOID,DWORD);
103 BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
104 BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
105 DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
106 BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL RECTL*,
107 IN LPWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD);
108 DWORD FASTCALL IntGetCharDimensions(HDC, PTEXTMETRICW, PDWORD);
109 BOOL FASTCALL GreGetTextExtentW(HDC,LPWSTR,INT,LPSIZE,UINT);
110 BOOL FASTCALL GreGetTextExtentExW(HDC,LPWSTR,ULONG,ULONG,PULONG,PULONG,LPSIZE,FLONG);
111 DWORD FASTCALL GreGetGlyphIndicesW(HDC,LPWSTR,INT,LPWORD,DWORD,DWORD);
112
113 #define IntLockProcessPrivateFonts(W32Process) \
114 ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)
115
116 #define IntUnLockProcessPrivateFonts(W32Process) \
117 ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&W32Process->PrivateFontListLock)