- fix button control size for german language
[reactos.git] / reactos / subsystems / win32 / win32k / ntddraw / dxeng.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Native driver enumate of dxeng implementation
5 * FILE: subsys/win32k/ntddraw/dxeng.c
6 * PROGRAMER: Magnus olsen (magnus@greatlord.com)
7 * REVISION HISTORY:
8 * 15/10-2007 Magnus Olsen
9 */
10
11 #include <w32k.h>
12 #include <debug.h>
13
14
15
16 ULONG gcEngFuncs = DXENG_INDEX_DxEngLoadImage + 1;
17 DRVFN gaEngFuncs [] =
18 {
19 {0, (PFN) NULL},
20 {DXENG_INDEX_DxEngNUIsTermSrv, (PFN)DxEngNUIsTermSrv},
21 {DXENG_INDEX_DxEngScreenAccessCheck, (PFN)DxEngScreenAccessCheck},
22 {DXENG_INDEX_DxEngRedrawDesktop, (PFN)DxEngRedrawDesktop},
23 {DXENG_INDEX_DxEngDispUniq, (PFN)DxEngDispUniq},
24 {DXENG_INDEX_DxEngIncDispUniq, (PFN)DxEngIncDispUniq},
25 {DXENG_INDEX_DxEngVisRgnUniq, (PFN)DxEngVisRgnUniq},
26 {DXENG_INDEX_DxEngLockShareSem, (PFN)DxEngLockShareSem},
27 {DXENG_INDEX_DxEngUnlockShareSem, (PFN)DxEngUnlockShareSem},
28 {DXENG_INDEX_DxEngEnumerateHdev, (PFN)DxEngEnumerateHdev},
29 {DXENG_INDEX_DxEngLockHdev, (PFN)DxEngLockHdev},
30 {DXENG_INDEX_DxEngUnlockHdev, (PFN)DxEngUnlockHdev},
31 {DXENG_INDEX_DxEngIsHdevLockedByCurrentThread, (PFN)DxEngIsHdevLockedByCurrentThread},
32 {DXENG_INDEX_DxEngReferenceHdev, (PFN)DxEngReferenceHdev},
33 {DXENG_INDEX_DxEngUnreferenceHdev, (PFN)DxEngUnreferenceHdev},
34 {DXENG_INDEX_DxEngGetDeviceGammaRamp, (PFN)DxEngGetDeviceGammaRamp},
35 {DXENG_INDEX_DxEngSetDeviceGammaRamp, (PFN)DxEngSetDeviceGammaRamp},
36 {DXENG_INDEX_DxEngSpTearDownSprites, (PFN)DxEngSpTearDownSprites},
37 {DXENG_INDEX_DxEngSpUnTearDownSprites, (PFN)DxEngSpUnTearDownSprites},
38 {DXENG_INDEX_DxEngSpSpritesVisible, (PFN)DxEngSpSpritesVisible},
39 {DXENG_INDEX_DxEngGetHdevData, (PFN)DxEngGetHdevData},
40 {DXENG_INDEX_DxEngSetHdevData, (PFN)DxEngSetHdevData},
41 {DXENG_INDEX_DxEngCreateMemoryDC, (PFN)DxEngCreateMemoryDC},
42 {DXENG_INDEX_DxEngGetDesktopDC, (PFN)DxEngGetDesktopDC},
43 {DXENG_INDEX_DxEngDeleteDC, (PFN)DxEngDeleteDC},
44 {DXENG_INDEX_DxEngCleanDC, (PFN)DxEngCleanDC},
45 {DXENG_INDEX_DxEngSetDCOwner, (PFN)DxEngSetDCOwner},
46 {DXENG_INDEX_DxEngLockDC, (PFN)DxEngLockDC},
47 {DXENG_INDEX_DxEngUnlockDC, (PFN)DxEngUnlockDC},
48 {DXENG_INDEX_DxEngSetDCState, (PFN)DxEngGetDCState},
49 {DXENG_INDEX_DxEngGetDCState, (PFN)DxEngGetDCState},
50 {DXENG_INDEX_DxEngSelectBitmap, (PFN)DxEngSelectBitmap},
51 {DXENG_INDEX_DxEngSetBitmapOwner, (PFN)DxEngSetBitmapOwner},
52 {DXENG_INDEX_DxEngDeleteSurface, (PFN)DxEngDeleteSurface},
53 {DXENG_INDEX_DxEngGetSurfaceData, (PFN)DxEngGetSurfaceData},
54 {DXENG_INDEX_DxEngAltLockSurface, (PFN)DxEngAltLockSurface},
55 {DXENG_INDEX_DxEngUploadPaletteEntryToSurface, (PFN)DxEngUploadPaletteEntryToSurface},
56 {DXENG_INDEX_DxEngMarkSurfaceAsDirectDraw, (PFN)DxEngMarkSurfaceAsDirectDraw},
57 {DXENG_INDEX_DxEngSelectPaletteToSurface, (PFN)DxEngSelectPaletteToSurface},
58 {DXENG_INDEX_DxEngSyncPaletteTableWithDevice, (PFN)DxEngSyncPaletteTableWithDevice},
59 {DXENG_INDEX_DxEngSetPaletteState, (PFN)DxEngSetPaletteState},
60 {DXENG_INDEX_DxEngGetRedirectionBitmap, (PFN)DxEngGetRedirectionBitmap},
61 {DXENG_INDEX_DxEngLoadImage, (PFN)DxEngLoadImage}
62 };
63
64 /************************************************************************/
65 /* DxEngNUIsTermSrv */
66 /************************************************************************/
67
68 /* Notes : Check see if termal server got a connections or not */
69 BOOL
70 DxEngNUIsTermSrv()
71 {
72 /* FIXME ReactOS does not suport terminal server yet, we can not check if we got a connections or not */
73 UNIMPLEMENTED;
74 return FALSE;
75 }
76
77 /************************************************************************/
78 /* DxEngRedrawDesktop */
79 /************************************************************************/
80
81 /* Notes : it always return TRUE, and it update whole the screen (redaw current desktop) */
82 BOOL
83 DxEngRedrawDesktop()
84 {
85 /* FIXME add redraw code */
86 UNIMPLEMENTED;
87 return TRUE;
88 }
89
90
91 /************************************************************************/
92 /* DxEngDispUniq */
93 /************************************************************************/
94
95 /* Notes : return the DisplayUniqVisrgn counter from gdishare memory */
96 ULONG
97 DxEngDispUniq()
98 {
99 return GdiHandleTable->flDeviceUniq;
100 }
101
102 ULONG gulVisRgnUniqueness; // Inc count everytime client region is updated.
103
104 /************************************************************************/
105 /* DxEngVisRgnUniq */
106 /************************************************************************/
107 /* Notes : return the VisRgnUniq counter for win32k */
108 ULONG
109 DxEngVisRgnUniq()
110 {
111 return gulVisRgnUniqueness;
112 }
113
114 /************************************************************************/
115 /* DxEngEnumerateHdev */
116 /************************************************************************/
117 /* Enumate all drivers in win32k */
118 HDEV *
119 DxEngEnumerateHdev(HDEV *hdev)
120 {
121 /* FIXME Enumate all drivers in win32k */
122 UNIMPLEMENTED;
123 return FALSE;
124 }
125
126 /*++
127 * @name DxEngGetDeviceGammaRamp
128 * @implemented
129 *
130 * The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys
131
132 * @param HDEV hPDev
133 * The hdev
134 *
135 * @param PGAMMARAMP Ramp
136 * to fill in our gama ramp
137 *
138 * @return
139 * This return FALSE or TRUE, FALSE for fail, TRUE for success
140 *
141 * @remarks.
142 * ReactOS does not loop it, only set the gamma once.
143 *
144 *--*/
145 BOOL
146 DxEngGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp)
147 {
148 return IntGetDeviceGammaRamp(hPDev, Ramp);
149 }
150
151
152 /*++
153 * @name DxEngLockDC
154 * @implemented
155 *
156 * The function DxEngLockDC lock a hdc from dxg.sys
157 *
158 * @param HDC hDC
159 * The handle we need want lock
160 *
161 * @return
162 * This api return PDC or NULL depns if it sussess lock the hdc or not
163 *
164 * @remarks.
165 * none
166 *
167 *--*/
168 PDC
169 DxEngLockDC(HDC hDC)
170 {
171 return DC_LockDc(hDC);
172 }
173
174
175 /*++
176 * @name DxEngUnlockDC
177 * @implemented
178 *
179 * The function DxEngUnlockDC Unlock a pDC (hdc) from dxg.sys
180
181 * @param PDC pDC
182 * The handle we need unlock
183 *
184 * @return
185 * This api always return TRUE if it sussess or not
186 *
187 * @remarks.
188 * none
189 *
190 *--*/
191 BOOL
192 DxEngUnlockDC(PDC pDC)
193 {
194 DC_UnlockDc(pDC);
195 return TRUE;
196 }
197
198
199 /************************************************************************/
200 /* DxEngCreateMemoryDC */
201 /************************************************************************/
202 DWORD DxEngCreateMemoryDC(DWORD x1)
203 {
204 UNIMPLEMENTED;
205 return FALSE;
206 }
207
208 /************************************************************************/
209 /* DxEngScreenAccessCheck */
210 /************************************************************************/
211 DWORD DxEngScreenAccessCheck()
212 {
213 UNIMPLEMENTED;
214 return FALSE;
215 }
216
217 /************************************************************************/
218 /* DxEngLockShareSem */
219 /************************************************************************/
220 DWORD DxEngLockShareSem()
221 {
222 UNIMPLEMENTED;
223 return FALSE;
224 }
225
226 /************************************************************************/
227 /* DxEngUnlockShareSem */
228 /************************************************************************/
229 DWORD DxEngUnlockShareSem()
230 {
231 UNIMPLEMENTED;
232 return FALSE;
233 }
234
235 /************************************************************************/
236 /* DxEngLockHdev */
237 /************************************************************************/
238 DWORD DxEngLockHdev(DWORD x1)
239 {
240 UNIMPLEMENTED;
241 return FALSE;
242 }
243
244 /************************************************************************/
245 /* DxEngUnlockHdev */
246 /************************************************************************/
247 DWORD DxEngUnlockHdev(DWORD x1)
248 {
249 UNIMPLEMENTED;
250 return FALSE;
251 }
252
253 /************************************************************************/
254 /* DxEngReferenceHdev */
255 /************************************************************************/
256 DWORD DxEngReferenceHdev(DWORD x1)
257 {
258 UNIMPLEMENTED;
259 return FALSE;
260 }
261
262 /************************************************************************/
263 /* DxEngIsHdevLockedByCurrentThread */
264 /************************************************************************/
265 DWORD DxEngIsHdevLockedByCurrentThread(DWORD x1)
266 {
267 UNIMPLEMENTED;
268 return FALSE;
269 }
270
271
272 /************************************************************************/
273 /* DxEngUnreferenceHdev */
274 /************************************************************************/
275 DWORD DxEngUnreferenceHdev(DWORD x1)
276 {
277 UNIMPLEMENTED;
278 return FALSE;
279 }
280
281
282 /*++
283 * @name DxEngSetDeviceGammaRamp
284 * @implemented
285 *
286 * The function DxEngSetDeviceGammaRamp Set Gamma ramp from from dxg.sys
287
288 * @param HDEV hPDev
289 * The hdev
290 *
291 * @param PGAMMARAMP Ramp
292 * to set in our gama ramp
293 *
294 * @param BOOL Test
295 * Testing the gama or not. FALSE for no test, TRUE for testing
296 *
297 * @return
298 * This return FALSE or TRUE, FALSE for fail, TRUE for success
299 *
300 * @remarks.
301 * ReactOS does not loop it, only set the gamma once.
302 *
303 *--*/
304 BOOL
305 DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Test)
306 {
307 return IntSetDeviceGammaRamp(hPDev, Ramp, Test);
308 }
309
310 /************************************************************************/
311 /* DxEngSpTearDownSprites */
312 /************************************************************************/
313 DWORD DxEngSpTearDownSprites(DWORD x1, DWORD x2, DWORD x3)
314 {
315 UNIMPLEMENTED;
316 return FALSE;
317 }
318
319 /************************************************************************/
320 /* DxEngSpUnTearDownSprites */
321 /************************************************************************/
322 DWORD DxEngSpUnTearDownSprites(DWORD x1, DWORD x2, DWORD x3)
323 {
324 UNIMPLEMENTED;
325 return FALSE;
326 }
327
328 /************************************************************************/
329 /* DxEngSpSpritesVisible */
330 /************************************************************************/
331 DWORD DxEngSpSpritesVisible(DWORD x1)
332 {
333 UNIMPLEMENTED;
334 return FALSE;
335 }
336
337 /************************************************************************/
338 /* DxEngGetHdevData */
339 /************************************************************************/
340 DWORD
341 DxEngGetHdevData(PEDD_DIRECTDRAW_GLOBAL pEDDgpl,
342 DWORD Index)
343 {
344 UNIMPLEMENTED;
345 return 0;
346 }
347
348 /************************************************************************/
349 /* DxEngSetHdevData */
350 /************************************************************************/
351 DWORD DxEngSetHdevData(DWORD x1, DWORD x2, DWORD x3)
352 {
353 UNIMPLEMENTED;
354 return FALSE;
355 }
356
357 /************************************************************************/
358 /* DxEngGetDesktopDC */
359 /************************************************************************/
360 DWORD DxEngGetDesktopDC(DWORD x1, DWORD x2, DWORD x3)
361 {
362 UNIMPLEMENTED;
363 return FALSE;
364 }
365
366 /************************************************************************/
367 /* DxEngDeleteDC */
368 /************************************************************************/
369 DWORD DxEngDeleteDC(DWORD x1, DWORD x2)
370 {
371 UNIMPLEMENTED;
372 return FALSE;
373 }
374
375 /************************************************************************/
376 /* DxEngCleanDC */
377 /************************************************************************/
378 DWORD DxEngCleanDC(DWORD x1)
379 {
380 UNIMPLEMENTED;
381 return FALSE;
382 }
383
384 /************************************************************************/
385 /* DxEngSetDCOwner */
386 /************************************************************************/
387 DWORD DxEngSetDCOwner(DWORD x1, DWORD x2)
388 {
389 UNIMPLEMENTED;
390 return FALSE;
391 }
392
393 /************************************************************************/
394 /* DxEngSetDCState */
395 /************************************************************************/
396 DWORD DxEngSetDCState(DWORD x1, DWORD x2, DWORD x3)
397 {
398 UNIMPLEMENTED;
399 return FALSE;
400 }
401
402
403
404 /*++
405 * @name DxEngGetDCState
406 * @implemented
407 *
408 * The function DxEngGetDCState getting sate
409 * if it DC full screen / Get Complexity of visiable region or
410 * Get Driver hdev, which is pPDev
411 *
412 * @param HDC hdc
413 * The hdc
414 *
415 * @param DWORD type
416 * value 1 = Is DC full screen
417 * value 2 = Get Complexity of visiable region.
418 * value 3 = Get Driver hdev, which is pPDev.
419 *
420 * @return
421 * return one of the type value
422 *
423 * @remarks.
424 * we do not have type 2 implement yet
425 *
426 *--*/
427 DWORD
428 DxEngGetDCState(HDC hDC,
429 DWORD type)
430 {
431 PDC pDC = DC_LockDc(hDC);
432 DWORD retVal = 0;
433
434 if (pDC)
435 {
436 switch (type)
437 {
438 case 1:
439 retVal = (DWORD) pDC->DC_Flags & DC_FLAG_FULLSCREEN;
440 break;
441 case 2:
442 UNIMPLEMENTED;
443 break;
444 case 3:
445 {
446 /* Return HDEV of this DC. */
447 retVal = (DWORD) pDC->pPDev;
448 break;
449 }
450 default:
451 /* if it does not found a type it wanted we return 0 as value */
452 DPRINT1("warning did not found type %d\n",type);
453 break;
454 }
455 DC_UnlockDc(pDC);
456 }
457
458 return retVal;
459 }
460
461 /************************************************************************/
462 /* DxEngSelectBitmap */
463 /************************************************************************/
464 DWORD DxEngSelectBitmap(DWORD x1, DWORD x2)
465 {
466 UNIMPLEMENTED;
467 return FALSE;
468 }
469
470 /************************************************************************/
471 /* DxEngSetBitmapOwner */
472 /************************************************************************/
473 DWORD DxEngSetBitmapOwner(DWORD x1, DWORD x2)
474 {
475 UNIMPLEMENTED;
476 return FALSE;
477 }
478
479 /************************************************************************/
480 /* DxEngDeleteSurface */
481 /************************************************************************/
482 DWORD DxEngDeleteSurface(DWORD x1)
483 {
484 UNIMPLEMENTED;
485 return FALSE;
486 }
487
488 /************************************************************************/
489 /* DxEngGetSurfaceData */
490 /************************************************************************/
491 DWORD DxEngGetSurfaceData(DWORD x1, DWORD x2)
492 {
493 UNIMPLEMENTED;
494 return FALSE;
495 }
496
497 /************************************************************************/
498 /* DxEngAltLockSurface */
499 /************************************************************************/
500 DWORD DxEngAltLockSurface(DWORD x1)
501 {
502 UNIMPLEMENTED;
503 return FALSE;
504 }
505
506 /************************************************************************/
507 /* DxEngUploadPaletteEntryToSurface */
508 /************************************************************************/
509 DWORD DxEngUploadPaletteEntryToSurface(DWORD x1, DWORD x2,DWORD x3, DWORD x4)
510 {
511 UNIMPLEMENTED;
512 return FALSE;
513 }
514
515 /************************************************************************/
516 /* DxEngMarkSurfaceAsDirectDraw */
517 /************************************************************************/
518 DWORD DxEngMarkSurfaceAsDirectDraw(DWORD x1, DWORD x2)
519 {
520 UNIMPLEMENTED;
521 return FALSE;
522 }
523
524 /************************************************************************/
525 /* DxEngSelectPaletteToSurface */
526 /************************************************************************/
527 DWORD DxEngSelectPaletteToSurface(DWORD x1, DWORD x2)
528 {
529 UNIMPLEMENTED;
530 return FALSE;
531 }
532
533 /************************************************************************/
534 /* DxEngSyncPaletteTableWithDevice */
535 /************************************************************************/
536 DWORD DxEngSyncPaletteTableWithDevice(DWORD x1, DWORD x2)
537 {
538 UNIMPLEMENTED;
539 return FALSE;
540 }
541
542 /************************************************************************/
543 /* DxEngSetPaletteState */
544 /************************************************************************/
545 DWORD DxEngSetPaletteState(DWORD x1, DWORD x2, DWORD x3)
546 {
547 UNIMPLEMENTED;
548 return FALSE;
549 }
550
551 /************************************************************************/
552 /* DxEngGetRedirectionBitmap */
553 /************************************************************************/
554 DWORD DxEngGetRedirectionBitmap(DWORD x1)
555 {
556 UNIMPLEMENTED;
557 return FALSE;
558 }
559
560 /************************************************************************/
561 /* DxEngLoadImage */
562 /************************************************************************/
563 DWORD DxEngLoadImage(DWORD x1,DWORD x2)
564 {
565 UNIMPLEMENTED;
566 return FALSE;
567 }
568
569 /************************************************************************/
570 /* DxEngIncDispUniq */
571 /************************************************************************/
572 DWORD DxEngIncDispUniq()
573 {
574 UNIMPLEMENTED;
575 return FALSE;
576 }
577
578