13GopPrivateIsKeyRegistered (
35 ASSERT (RegsiteredData !=
NULL && InputData !=
NULL);
37 if ((RegsiteredData->Key.ScanCode != InputData->Key.ScanCode) ||
38 (RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar))
46 if ((RegsiteredData->KeyState.KeyShiftState != 0) &&
47 (RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState))
52 if ((RegsiteredData->KeyState.KeyToggleState != 0) &&
53 (RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState))
63GopPrivateMakeCallbackFunction (
74 for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
79 EMU_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
81 if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
84 gBS->SignalEvent (CurrentNotify->Event);
91GopPrivateBreakCallbackFunction (
96 KeyMapBreak (KeyData);
115EmuGopSimpleTextInReset (
117 IN BOOLEAN ExtendedVerification
124 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
125 if (Private->EmuGraphicsWindow ==
NULL) {
132 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
137 while (Private->EmuGraphicsWindow->GetKey (Private->EmuGraphicsWindow, &KeyData) ==
EFI_SUCCESS) {
143 gBS->RestoreTPL (OldTpl);
164EmuGopSimpleTextInReadKeyStroke (
174 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
175 if (Private->EmuGraphicsWindow ==
NULL) {
176 return EFI_NOT_READY;
182 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
184 Status = Private->EmuGraphicsWindow->GetKey (Private->EmuGraphicsWindow, &KeyData);
185 if (!EFI_ERROR (Status)) {
186 if ((KeyData.
Key.ScanCode == 0) && (KeyData.
Key.UnicodeChar == 0)) {
188 Status = EFI_NOT_READY;
197 gBS->RestoreTPL (OldTpl);
211EmuGopSimpleTextInWaitForKey (
221 if (Private->EmuGraphicsWindow ==
NULL) {
228 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
230 Status = Private->EmuGraphicsWindow->CheckKey (Private->EmuGraphicsWindow);
231 if (!EFI_ERROR (Status)) {
235 gBS->SignalEvent (Event);
241 gBS->RestoreTPL (OldTpl);
275EmuGopSimpleTextInExResetEx (
277 IN BOOLEAN ExtendedVerification
349EmuGopSimpleTextInExReadKeyStrokeEx (
378 if (KeyData ==
NULL) {
379 return EFI_INVALID_PARAMETER;
382 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
383 if (Private->EmuGraphicsWindow ==
NULL) {
384 return EFI_NOT_READY;
390 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
392 Status = Private->EmuGraphicsWindow->GetKey (Private->EmuGraphicsWindow, KeyData);
397 gBS->RestoreTPL (OldTpl);
424EmuGopSimpleTextInExSetState (
433 if (KeyToggleState ==
NULL) {
434 return EFI_INVALID_PARAMETER;
437 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
438 if (Private->EmuGraphicsWindow ==
NULL) {
439 return EFI_NOT_READY;
442 if (((Private->KeyState.
KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID) ||
443 ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID))
445 return EFI_UNSUPPORTED;
451 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
453 Status = Private->EmuGraphicsWindow->KeySetState (Private->EmuGraphicsWindow, KeyToggleState);
457 gBS->RestoreTPL (OldTpl);
471EmuGopRegisterKeyCallback (
478 ExNotify->KeyNotificationFn (&ExNotify->KeyData);
508EmuGopSimpleTextInExRegisterKeyNotify (
512 OUT VOID **NotifyHandle
521 if ((KeyData ==
NULL) || (KeyNotificationFunction ==
NULL) || (NotifyHandle ==
NULL)) {
522 return EFI_INVALID_PARAMETER;
525 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
530 for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
535 EMU_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
537 if (GopPrivateIsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
538 if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
539 *NotifyHandle = CurrentNotify->NotifyHandle;
549 if (NewNotify ==
NULL) {
550 return EFI_OUT_OF_RESOURCES;
553 NewNotify->Signature = EMU_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE;
554 NewNotify->KeyNotificationFn = KeyNotificationFunction;
555 NewNotify->NotifyHandle = (
EFI_HANDLE)NewNotify;
556 CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));
559 Status =
gBS->CreateEvent (
562 EmuGopRegisterKeyCallback,
568 *NotifyHandle = NewNotify->NotifyHandle;
590EmuGopSimpleTextInExUnregisterKeyNotify (
592 IN VOID *NotificationHandle
614 if (NotificationHandle ==
NULL) {
615 return EFI_INVALID_PARAMETER;
619 return EFI_INVALID_PARAMETER;
622 Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);
624 for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {
629 EMU_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE
631 if (CurrentNotify->NotifyHandle == NotificationHandle) {
637 gBS->CloseEvent (CurrentNotify->Event);
639 gBS->FreePool (CurrentNotify);
647 return EFI_INVALID_PARAMETER;
660EmuGopInitializeSimpleTextInForWindow (
669 Private->SimpleTextIn.Reset = EmuGopSimpleTextInReset;
670 Private->SimpleTextIn.ReadKeyStroke = EmuGopSimpleTextInReadKeyStroke;
672 Status =
gBS->CreateEvent (
675 EmuGopSimpleTextInWaitForKey,
677 &Private->SimpleTextIn.WaitForKey
685 Private->SimpleTextInEx.Reset = EmuGopSimpleTextInExResetEx;
686 Private->SimpleTextInEx.ReadKeyStrokeEx = EmuGopSimpleTextInExReadKeyStrokeEx;
687 Private->SimpleTextInEx.SetState = EmuGopSimpleTextInExSetState;
688 Private->SimpleTextInEx.RegisterKeyNotify = EmuGopSimpleTextInExRegisterKeyNotify;
689 Private->SimpleTextInEx.UnregisterKeyNotify = EmuGopSimpleTextInExUnregisterKeyNotify;
691 Private->SimpleTextInEx.Reset (&Private->SimpleTextInEx,
FALSE);
695 Status =
gBS->CreateEvent (
698 EmuGopSimpleTextInWaitForKey,
700 &Private->SimpleTextInEx.WaitForKeyEx
725EmuGopSimplePointerReset (
727 IN BOOLEAN ExtendedVerification
734 Private = GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS (This);
735 if (Private->EmuGraphicsWindow ==
NULL) {
742 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
747 while (Private->EmuGraphicsWindow->GetPointerState (Private->EmuGraphicsWindow, &State) ==
EFI_SUCCESS) {
753 gBS->RestoreTPL (OldTpl);
773EmuGopSimplePointerGetState (
782 Private = GOP_PRIVATE_DATA_FROM_POINTER_MODE_THIS (This);
783 if (Private->EmuGraphicsWindow ==
NULL) {
784 return EFI_NOT_READY;
790 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
792 Status = Private->EmuGraphicsWindow->GetPointerState (Private->EmuGraphicsWindow, State);
796 gBS->RestoreTPL (OldTpl);
810EmuGopSimplePointerWaitForInput (
820 if (Private->EmuGraphicsWindow ==
NULL) {
827 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
829 Status = Private->EmuGraphicsWindow->CheckPointer (Private->EmuGraphicsWindow);
830 if (!EFI_ERROR (Status)) {
834 gBS->SignalEvent (Event);
840 gBS->RestoreTPL (OldTpl);
852EmuGopInitializeSimplePointerForWindow (
861 Private->PointerMode.ResolutionX = 1;
862 Private->PointerMode.ResolutionY = 1;
863 Private->PointerMode.ResolutionZ = 1;
864 Private->PointerMode.LeftButton =
TRUE;
865 Private->PointerMode.RightButton =
TRUE;
867 Private->SimplePointer.Reset = EmuGopSimplePointerReset;
868 Private->SimplePointer.GetState = EmuGopSimplePointerGetState;
869 Private->SimplePointer.Mode = &Private->PointerMode;
871 Status =
gBS->CreateEvent (
874 EmuGopSimplePointerWaitForInput,
876 &Private->SimplePointer.WaitForInput
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
#define ASSERT_EFI_ERROR(StatusParameter)
#define CR(Record, TYPE, Field, TestSignature)
UINT8 EFI_KEY_TOGGLE_STATE
EFI_STATUS(EFIAPI * EFI_KEY_NOTIFY_FUNCTION)(IN EFI_KEY_DATA *KeyData)
EFI_KEY_TOGGLE_STATE KeyToggleState