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