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
);
88 UnixUgaSimpleTextInReadKeyStroke (
89 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL
*This
,
90 OUT EFI_INPUT_KEY
*Key
96 TODO: Add function description
100 This - TODO: add argument description
101 Key - TODO: add argument description
105 TODO: add return values
109 UGA_PRIVATE_DATA
*Private
;
113 Private
= UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This
);
114 if (Private
->UgaIo
== NULL
) {
115 return EFI_NOT_READY
;
119 // Enter critical section
121 OldTpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
123 Status
= Private
->UgaIo
->UgaGetKey(Private
->UgaIo
, Key
);
125 // Leave critical section and return
127 gBS
->RestoreTPL (OldTpl
);
134 UnixUgaSimpleTextInWaitForKey (
142 TODO: Add function description
146 Event - TODO: add argument description
147 Context - TODO: add argument description
151 TODO: add return values
155 UGA_PRIVATE_DATA
*Private
;
159 Private
= (UGA_PRIVATE_DATA
*) Context
;
160 if (Private
->UgaIo
== NULL
) {
165 // Enter critical section
167 OldTpl
= gBS
->RaiseTPL (TPL_NOTIFY
);
169 Status
= Private
->UgaIo
->UgaCheckKey(Private
->UgaIo
);
170 if (!EFI_ERROR (Status
)) {
172 // If a there is a key in the queue signal our event.
174 gBS
->SignalEvent (Event
);
177 // Leave critical section and return
179 gBS
->RestoreTPL (OldTpl
);
183 UnixUgaInitializeSimpleTextInForWindow (
184 IN UGA_PRIVATE_DATA
*Private
190 TODO: Add function description
194 Private - TODO: add argument description
198 TODO: add return values
205 // Initialize Simple Text In protoocol
207 Private
->SimpleTextIn
.Reset
= UnixUgaSimpleTextInReset
;
208 Private
->SimpleTextIn
.ReadKeyStroke
= UnixUgaSimpleTextInReadKeyStroke
;
210 Status
= gBS
->CreateEvent (
213 UnixUgaSimpleTextInWaitForKey
,
215 &Private
->SimpleTextIn
.WaitForKey