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