3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This file produces the Simple Text In for an Uga window.
20 This stuff is linked at the hip to the Window, since the window
21 processing is done in a thread kicked off in UnixUgaImplementation.c
23 Since the window information is processed in an other thread we need
24 a keyboard Queue to pass data about. The Simple Text In code just
25 takes data off the Queue. The WinProc message loop takes keyboard input
26 and places it in the Queue.
33 // Simple Text In implementation.
38 UnixUgaSimpleTextInReset (
39 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
40 IN BOOLEAN ExtendedVerification
46 TODO: Add function description
50 This - TODO: add argument description
51 ExtendedVerification - TODO: add argument description
55 EFI_SUCCESS - TODO: Add description for return value
59 UGA_PRIVATE_DATA
*Private
;
63 Private
= UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This
);
64 if (Private
->UgaIo
== NULL
) {
69 // Enter critical section
71 OldTpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
74 // A reset is draining the Queue
76 while (Private
->UgaIo
->UgaGetKey(Private
->UgaIo
, &Key
) == EFI_SUCCESS
)
80 // Leave critical section and return
82 gBS
->RestoreTPL (OldTpl
);
89 UnixUgaSimpleTextInReadKeyStroke (
90 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
91 OUT EFI_INPUT_KEY
*Key
97 TODO: Add function description
101 This - TODO: add argument description
102 Key - TODO: add argument description
106 TODO: add return values
110 UGA_PRIVATE_DATA
*Private
;
114 Private
= UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This
);
115 if (Private
->UgaIo
== NULL
) {
116 return EFI_NOT_READY
;
120 // Enter critical section
122 OldTpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
124 Status
= Private
->UgaIo
->UgaGetKey(Private
->UgaIo
, Key
);
126 // Leave critical section and return
128 gBS
->RestoreTPL (OldTpl
);
136 UnixUgaSimpleTextInWaitForKey (
144 TODO: Add function description
148 Event - TODO: add argument description
149 Context - TODO: add argument description
153 TODO: add return values
157 UGA_PRIVATE_DATA
*Private
;
161 Private
= (UGA_PRIVATE_DATA
*) Context
;
162 if (Private
->UgaIo
== NULL
) {
167 // Enter critical section
169 OldTpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
171 Status
= Private
->UgaIo
->UgaCheckKey(Private
->UgaIo
);
172 if (!EFI_ERROR (Status
)) {
174 // If a there is a key in the queue signal our event.
176 gBS
->SignalEvent (Event
);
179 // Leave critical section and return
181 gBS
->RestoreTPL (OldTpl
);
185 UnixUgaInitializeSimpleTextInForWindow (
186 IN UGA_PRIVATE_DATA
*Private
192 TODO: Add function description
196 Private - TODO: add argument description
200 TODO: add return values
207 // Initialize Simple Text In protoocol
209 Private
->SimpleTextIn
.Reset
= UnixUgaSimpleTextInReset
;
210 Private
->SimpleTextIn
.ReadKeyStroke
= UnixUgaSimpleTextInReadKeyStroke
;
212 Status
= gBS
->CreateEvent (
215 UnixUgaSimpleTextInWaitForKey
,
217 &Private
->SimpleTextIn
.WaitForKey