ReactOS 0.4.15-dev-7098-ge0c17c3
font.c File Reference
#include "bl.h"
Include dependency graph for font.c:

Go to the source code of this file.

Functions

NTSTATUS BfiLoadFontFile (_In_ PBL_DEVICE_DESCRIPTOR FontDevice, _In_ PWCHAR FontPath)
 
VOID BfiFreeDeferredFontFile (_In_ PBL_DEFERRED_FONT_FILE DeferredFontFile)
 
NTSTATUS BfLoadFontFile (_In_ PBL_DEVICE_DESCRIPTOR Device, _In_ PWCHAR FontPath)
 
NTSTATUS BfLoadDeferredFontFiles (VOID)
 
NTSTATUS BfiFlipCursorCharacter (_In_ PBL_GRAPHICS_CONSOLE Console, _In_ BOOLEAN Visible)
 
NTSTATUS BfClearToEndOfLine (_In_ PBL_GRAPHICS_CONSOLE Console)
 
NTSTATUS BfClearScreen (_In_ PBL_GRAPHICS_CONSOLE Console)
 

Variables

LIST_ENTRY BfiDeferredListHead
 

Function Documentation

◆ BfClearScreen()

NTSTATUS BfClearScreen ( _In_ PBL_GRAPHICS_CONSOLE  Console)

Definition at line 158 of file font.c.

161{
163
164 /* Reset the cursor position */
165 Console->TextConsole.State.XPos = 0;
166 Console->TextConsole.State.YPos = 0;
167
168 /* Fill the screen with the background color */
170 Console->TextConsole.State.BgColor);
171 if (!NT_SUCCESS(Status))
172 {
173 return Status;
174 }
175
176 /* Check if the cursor should be visible */
177 if (Console->TextConsole.State.CursorVisible)
178 {
179 /* Load any fonts at this time */
181 {
183 }
184
185 /* Switch the cursor to visible */
187 }
188 else
189 {
190 /* Nothing left to do */
192 }
193
194 /* Return cursor flip result, if any */
195 return Status;
196}
CConsole Console
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS ConsoleGraphicalClearPixels(_In_ PBL_GRAPHICS_CONSOLE Console, _In_ ULONG Color)
Definition: guicons.c:275
NTSTATUS BfLoadDeferredFontFiles(VOID)
Definition: font.c:99
NTSTATUS BfiFlipCursorCharacter(_In_ PBL_GRAPHICS_CONSOLE Console, _In_ BOOLEAN Visible)
Definition: font.c:139
LIST_ENTRY BfiDeferredListHead
Definition: font.c:15
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
Status
Definition: gdiplustypes.h:25
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by ConsoleGraphicalClearText().

◆ BfClearToEndOfLine()

NTSTATUS BfClearToEndOfLine ( _In_ PBL_GRAPHICS_CONSOLE  Console)

Definition at line 149 of file font.c.

152{
153 /* not implemented */
155}
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

Referenced by ConsoleGraphicalClearText().

◆ BfiFlipCursorCharacter()

NTSTATUS BfiFlipCursorCharacter ( _In_ PBL_GRAPHICS_CONSOLE  Console,
_In_ BOOLEAN  Visible 
)

Definition at line 139 of file font.c.

143{
144 /* not implemented */
146}

Referenced by BfClearScreen().

◆ BfiFreeDeferredFontFile()

VOID BfiFreeDeferredFontFile ( _In_ PBL_DEFERRED_FONT_FILE  DeferredFontFile)

Definition at line 30 of file font.c.

33{
34 /* Free the device copy if there was one */
35 if (DeferredFontFile->Device)
36 {
37 BlMmFreeHeap(DeferredFontFile->Device);
38 }
39
40 /* Free the path copy if there was one */
41 if (DeferredFontFile->FontPath)
42 {
43 BlMmFreeHeap(DeferredFontFile->FontPath);
44 }
45
46 /* Free the whole thing */
47 BlMmFreeHeap(DeferredFontFile);
48}
NTSTATUS BlMmFreeHeap(_In_ PVOID Buffer)
Definition: heapalloc.c:663

Referenced by BfLoadDeferredFontFiles(), BfLoadFontFile(), and BlpDisplayRegisterLocale().

◆ BfiLoadFontFile()

NTSTATUS BfiLoadFontFile ( _In_ PBL_DEVICE_DESCRIPTOR  FontDevice,
_In_ PWCHAR  FontPath 
)

Definition at line 20 of file font.c.

24{
25 EfiPrintf(L"Cannot load font %s, no font loader exists\r\n", FontPath);
27}
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126
#define L(x)
Definition: ntvdm.h:50

Referenced by BfLoadDeferredFontFiles().

◆ BfLoadDeferredFontFiles()

NTSTATUS BfLoadDeferredFontFiles ( VOID  )

Definition at line 99 of file font.c.

102{
103 PLIST_ENTRY NextEntry;
104 PBL_DEFERRED_FONT_FILE DeferredFont;
105 NTSTATUS Status, LoadStatus;
106
107 /* Assume empty list */
109
110 /* Parse the list */
111 NextEntry = BfiDeferredListHead.Flink;
112 while (NextEntry != &BfiDeferredListHead)
113 {
114 /* Get the font */
115 DeferredFont = CONTAINING_RECORD(NextEntry, BL_DEFERRED_FONT_FILE, ListEntry);
116
117 /* Move to the next entry and remove this one */
118 NextEntry = NextEntry->Flink;
119 RemoveEntryList(&DeferredFont->ListEntry);
120
121 /* Load the font */
122 LoadStatus = BfiLoadFontFile(DeferredFont->Device,
123 DeferredFont->FontPath);
124 if (!NT_SUCCESS(LoadStatus))
125 {
126 /* Remember the load failure if there was one */
127 Status = LoadStatus;
128 }
129
130 /* Free the deferred font */
131 BfiFreeDeferredFontFile(DeferredFont);
132 }
133
134 /* Return load status */
135 return Status;
136}
NTSTATUS BfiLoadFontFile(_In_ PBL_DEVICE_DESCRIPTOR FontDevice, _In_ PWCHAR FontPath)
Definition: font.c:20
VOID BfiFreeDeferredFontFile(_In_ PBL_DEFERRED_FONT_FILE DeferredFontFile)
Definition: font.c:30
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
PBL_DEVICE_DESCRIPTOR Device
Definition: bl.h:1301
LIST_ENTRY ListEntry
Definition: bl.h:1299
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by BfClearScreen(), and BlResourceFindMessage().

◆ BfLoadFontFile()

NTSTATUS BfLoadFontFile ( _In_ PBL_DEVICE_DESCRIPTOR  Device,
_In_ PWCHAR  FontPath 
)

Definition at line 51 of file font.c.

55{
56 PBL_DEFERRED_FONT_FILE DeferredFont;
57 SIZE_T FontPathSize;
58
59 /* Allocate the deferred font structure */
60 DeferredFont = (PBL_DEFERRED_FONT_FILE)BlMmAllocateHeap(sizeof(*DeferredFont));
61 if (!DeferredFont)
62 {
63 return STATUS_NO_MEMORY;
64 }
65
66 /* Zero it out */
67 RtlZeroMemory(DeferredFont, sizeof(*DeferredFont));
68
69 /* Allocate a copy for the file path */
70 FontPathSize = sizeof(WCHAR) * wcslen(FontPath) + sizeof(UNICODE_NULL);
71 DeferredFont->FontPath = (PWCHAR)BlMmAllocateHeap(FontPathSize);
72 if (!DeferredFont->FontPath)
73 {
74 BfiFreeDeferredFontFile(DeferredFont);
75 return STATUS_NO_MEMORY;
76 }
77
78 /* Allocate a copy for the device */
79 DeferredFont->Device = BlMmAllocateHeap(Device->Size);
80 if (!DeferredFont->Device)
81 {
82 BfiFreeDeferredFontFile(DeferredFont);
83 return STATUS_NO_MEMORY;
84 }
85
86 /* Copy the path and device */
87 RtlCopyMemory(DeferredFont->FontPath, FontPath, FontPathSize);
88 RtlCopyMemory(DeferredFont->Device,Device, Device->Size);
89
90 /* Set pending flag? */
91 DeferredFont->Flags = 1;
92
93 /* Insert it into the list */
95 return STATUS_SUCCESS;
96}
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
Definition: heapalloc.c:569
struct _BL_DEFERRED_FONT_FILE * PBL_DEFERRED_FONT_FILE
#define InsertTailList(ListHead, Entry)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define UNICODE_NULL
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DsppLoadFontFile().

Variable Documentation

◆ BfiDeferredListHead

LIST_ENTRY BfiDeferredListHead

Definition at line 15 of file font.c.

Referenced by BfClearScreen(), BfLoadDeferredFontFiles(), and BfLoadFontFile().