ReactOS  0.4.14-dev-49-gfb4591c
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 }
#define TRUE
Definition: types.h:120
LIST_ENTRY BfiDeferredListHead
Definition: font.c:15
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
NTSTATUS ConsoleGraphicalClearPixels(_In_ PBL_GRAPHICS_CONSOLE Console, _In_ ULONG Color)
Definition: guicons.c:275
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
NTSTATUS BfiFlipCursorCharacter(_In_ PBL_GRAPHICS_CONSOLE Console, _In_ BOOLEAN Visible)
Definition: font.c:139
CConsole Console
NTSTATUS BfLoadDeferredFontFiles(VOID)
Definition: font.c:99
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by ConsoleGraphicalClearText().

◆ BfClearToEndOfLine()

NTSTATUS BfClearToEndOfLine ( _In_ PBL_GRAPHICS_CONSOLE  Console)

Definition at line 149 of file font.c.

152 {
153  /* not implemented */
154  return STATUS_NOT_IMPLEMENTED;
155 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

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 */
145  return STATUS_NOT_IMPLEMENTED;
146 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225

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 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
static const WCHAR L[]
Definition: oid.c:1250
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126

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 }
LIST_ENTRY BfiDeferredListHead
Definition: font.c:15
LONG NTSTATUS
Definition: precomp.h:26
VOID BfiFreeDeferredFontFile(_In_ PBL_DEFERRED_FONT_FILE DeferredFontFile)
Definition: font.c:30
LIST_ENTRY ListEntry
Definition: bl.h:1300
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PBL_DEVICE_DESCRIPTOR Device
Definition: bl.h:1302
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS BfiLoadFontFile(_In_ PBL_DEVICE_DESCRIPTOR FontDevice, _In_ PWCHAR FontPath)
Definition: font.c:20
Definition: typedefs.h:117
Status
Definition: gdiplustypes.h:24
return STATUS_SUCCESS
Definition: btrfs.c:2966

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 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
LIST_ENTRY BfiDeferredListHead
Definition: font.c:15
VOID BfiFreeDeferredFontFile(_In_ PBL_DEFERRED_FONT_FILE DeferredFontFile)
Definition: font.c:30
uint16_t * PWCHAR
Definition: typedefs.h:54
#define InsertTailList(ListHead, Entry)
LIST_ENTRY ListEntry
Definition: bl.h:1300
#define UNICODE_NULL
PVOID BlMmAllocateHeap(_In_ SIZE_T Size)
Definition: heapalloc.c:569
PBL_DEVICE_DESCRIPTOR Device
Definition: bl.h:1302
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _BL_DEFERRED_FONT_FILE * PBL_DEFERRED_FONT_FILE
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2966
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by DsppLoadFontFile().

Variable Documentation

◆ BfiDeferredListHead

LIST_ENTRY BfiDeferredListHead

Definition at line 15 of file font.c.

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