cc7283ebf688c41fead3a1e7d3878a06603091ee
[mirror_edk2.git] / Nt32Pkg / WinNtGopDxe / WinNtGop.h
1 /** @file
2
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
8
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.
11
12 Module Name:
13
14 WinNtGop.h
15
16 Abstract:
17
18 Private data for the Gop driver that is bound to the WinNt Thunk protocol
19
20
21 **/
22
23 #ifndef _WIN_NT_GOP_H_
24 #define _WIN_NT_GOP_H_
25
26 //
27 // Include common header file for this module.
28 //
29 #include "CommonHeader.h"
30
31 //@MT:#include "EfiWinNT.h"
32 //@MT:#include "Tiano.h"
33 //@MT:#include "EfiDriverLib.h"
34
35 //
36 // Driver Consumed Protocols
37 //
38 //@MT:#include EFI_PROTOCOL_DEFINITION (DevicePath)
39 //@MT:#include EFI_PROTOCOL_DEFINITION (WinNtIo)
40
41 //
42 // Driver Produced Protocols
43 //
44 //@MT:#include EFI_PROTOCOL_DEFINITION (DriverBinding)
45 //@MT:#include EFI_PROTOCOL_DEFINITION (ComponentName)
46 //@MT:#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
47 //@MT:#include "LinkedList.h"
48
49 #define MAX_Q 256
50
51 typedef struct {
52 UINTN Front;
53 UINTN Rear;
54 UINTN Count;
55 EFI_INPUT_KEY Q[MAX_Q];
56 } GOP_QUEUE_FIXED;
57
58 #define WIN_NT_GOP_CLASS_NAME L"WinNtGopWindow"
59
60 #define GOP_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('S', 'g', 'o', 'N')
61
62 #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
63
64 typedef struct {
65 UINT32 HorizontalResolution;
66 UINT32 VerticalResolution;
67 UINT32 ColorDepth;
68 UINT32 RefreshRate;
69 } GOP_MODE_DATA;
70
71 typedef struct {
72 UINT64 Signature;
73
74 EFI_HANDLE Handle;
75 EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
76 EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
77
78 EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
79
80 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
81
82 //
83 // GOP Private Data for QueryMode ()
84 //
85 GOP_MODE_DATA *ModeData;
86
87 //
88 // GOP Private Data knowing when to start hardware
89 //
90 BOOLEAN HardwareNeedsStarting;
91
92 CHAR16 *WindowName;
93 CHAR16 Buffer[160];
94
95 HANDLE ThreadInited; // Semaphore
96 HANDLE ThreadHandle; // Thread
97 DWORD ThreadId;
98
99 HWND WindowHandle;
100 WNDCLASSEX WindowsClass;
101
102 //
103 // This screen is used to redraw the scree when windows events happen. It's
104 // updated in the main thread and displayed in the windows thread.
105 //
106 BITMAPV4HEADER *VirtualScreenInfo;
107 RGBQUAD *VirtualScreen;
108
109 EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;
110
111 //
112 // Keyboard Queue used by Simple Text In. WinProc thread adds, and main
113 // thread removes.
114 //
115 CRITICAL_SECTION QCriticalSection;
116 GOP_QUEUE_FIXED Queue;
117
118 } GOP_PRIVATE_DATA;
119
120 #define GOP_PRIVATE_DATA_FROM_THIS(a) \
121 CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)
122
123 #define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \
124 CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)
125
126 //
127 // Global Protocol Variables
128 //
129 extern EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding;
130 extern EFI_COMPONENT_NAME_PROTOCOL gWinNtGopComponentName;
131
132 //
133 // Gop Hardware abstraction internal worker functions
134 //
135
136 /**
137 TODO: Add function description
138
139 @param WinNtIo TODO: add argument description
140
141 @return TODO: add return values
142
143 **/
144 EFI_STATUS
145 WinNtGopSupported (
146 IN EFI_WIN_NT_IO_PROTOCOL *WinNtIo
147 )
148 ;
149
150
151 /**
152 TODO: Add function description
153
154 @param Private TODO: add argument description
155
156 @return TODO: add return values
157
158 **/
159 EFI_STATUS
160 WinNtGopConstructor (
161 IN GOP_PRIVATE_DATA *Private
162 )
163 ;
164
165
166 /**
167 TODO: Add function description
168
169 @param Private TODO: add argument description
170
171 @return TODO: add return values
172
173 **/
174 EFI_STATUS
175 WinNtGopDestructor (
176 IN GOP_PRIVATE_DATA *Private
177 )
178 ;
179
180 //
181 // EFI 1.1 driver model prototypes for Win NT GOP
182 //
183
184
185 /**
186 TODO: Add function description
187
188 @param ImageHandle TODO: add argument description
189 @param SystemTable TODO: add argument description
190
191 @return TODO: add return values
192
193 **/
194 EFI_STATUS
195 EFIAPI
196 WinNtGopInitialize (
197 IN EFI_HANDLE ImageHandle,
198 IN EFI_SYSTEM_TABLE *SystemTable
199 )
200 ;
201
202
203 /**
204 TODO: Add function description
205
206 @param This TODO: add argument description
207 @param Handle TODO: add argument description
208 @param RemainingDevicePath TODO: add argument description
209
210 @return TODO: add return values
211
212 **/
213 EFI_STATUS
214 EFIAPI
215 WinNtGopDriverBindingSupported (
216 IN EFI_DRIVER_BINDING_PROTOCOL *This,
217 IN EFI_HANDLE Handle,
218 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
219 )
220 ;
221
222
223 /**
224 TODO: Add function description
225
226 @param This TODO: add argument description
227 @param Handle TODO: add argument description
228 @param RemainingDevicePath TODO: add argument description
229
230 @return TODO: add return values
231
232 **/
233 EFI_STATUS
234 EFIAPI
235 WinNtGopDriverBindingStart (
236 IN EFI_DRIVER_BINDING_PROTOCOL *This,
237 IN EFI_HANDLE Handle,
238 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
239 )
240 ;
241
242
243 /**
244 TODO: Add function description
245
246 @param This TODO: add argument description
247 @param Handle TODO: add argument description
248 @param NumberOfChildren TODO: add argument description
249 @param ChildHandleBuffer TODO: add argument description
250
251 @return TODO: add return values
252
253 **/
254 EFI_STATUS
255 EFIAPI
256 WinNtGopDriverBindingStop (
257 IN EFI_DRIVER_BINDING_PROTOCOL *This,
258 IN EFI_HANDLE Handle,
259 IN UINTN NumberOfChildren,
260 IN EFI_HANDLE *ChildHandleBuffer
261 )
262 ;
263
264
265 /**
266 TODO: Add function description
267
268 @param Private TODO: add argument description
269 @param Key TODO: add argument description
270
271 @return TODO: add return values
272
273 **/
274 EFI_STATUS
275 GopPrivateAddQ (
276 IN GOP_PRIVATE_DATA *Private,
277 IN EFI_INPUT_KEY Key
278 )
279 ;
280
281
282 /**
283 TODO: Add function description
284
285 @param Private TODO: add argument description
286
287 @return TODO: add return values
288
289 **/
290 EFI_STATUS
291 WinNtGopInitializeSimpleTextInForWindow (
292 IN GOP_PRIVATE_DATA *Private
293 )
294 ;
295
296
297 /**
298 TODO: Add function description
299
300 @param Private TODO: add argument description
301
302 @return TODO: add return values
303
304 **/
305 EFI_STATUS
306 WinNtGopDestroySimpleTextInForWindow (
307 IN GOP_PRIVATE_DATA *Private
308 )
309 ;
310
311
312 /**
313 TODO: Add function description
314
315 @param String TODO: add argument description
316
317 @return TODO: add return values
318
319 **/
320 UINTN
321 Atoi (
322 IN CHAR16 *String
323 )
324 ;
325
326 #endif