Synchronize with trunk's revision r57599.
[reactos.git] / win32ss / gdi / ntgdi / device.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Functions for creation and destruction of DCs
5 * FILE: subsystem/win32/win32k/objects/device.c
6 * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
7 */
8
9 #include <win32k.h>
10
11 #define NDEBUG
12 #include <debug.h>
13
14 PDC defaultDCstate = NULL;
15
16 VOID FASTCALL
17 IntGdiReferencePdev(PPDEVOBJ ppdev)
18 {
19 UNIMPLEMENTED;
20 }
21
22 VOID FASTCALL
23 IntGdiUnreferencePdev(PPDEVOBJ ppdev, DWORD CleanUpType)
24 {
25 UNIMPLEMENTED;
26 }
27
28 BOOL FASTCALL
29 IntCreatePrimarySurface(VOID)
30 {
31 SIZEL SurfSize;
32 SURFOBJ *pso;
33 PDESKTOP rpDesk;
34
35 /* Attach monitor */
36 UserAttachMonitor((HDEV)gppdevPrimary);
37
38 DPRINT("IntCreatePrimarySurface, gppdevPrimary=%p, gppdevPrimary->pSurface = %p\n",
39 gppdevPrimary, gppdevPrimary->pSurface);
40
41 /* Create surface */
42 pso = &PDEVOBJ_pSurface(gppdevPrimary)->SurfObj;
43 SurfSize = pso->sizlBitmap;
44
45 /* Put the pointer in the center of the screen */
46 gpsi->ptCursor.x = pso->sizlBitmap.cx / 2;
47 gpsi->ptCursor.y = pso->sizlBitmap.cy / 2;
48
49 rpDesk = IntGetActiveDesktop();
50 if (!rpDesk)
51 { /* First time going in from winlogon and starting up application desktop and
52 haven't switch to winlogon desktop. Also still in WM_CREATE. */
53 PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
54 rpDesk = pti->rpdesk;
55 if (!rpDesk)
56 {
57 DPRINT1("No DESKTOP Window!!!!!\n");
58 }
59 }
60 co_IntShowDesktop(rpDesk, SurfSize.cx, SurfSize.cy);
61
62 // Init Primary Displays Device Capabilities.
63 PDEVOBJ_vGetDeviceCaps(gppdevPrimary, &GdiHandleTable->DevCaps);
64
65 return TRUE;
66 }
67
68 VOID FASTCALL
69 IntDestroyPrimarySurface(VOID)
70 {
71 UNIMPLEMENTED;
72 }
73
74 PPDEVOBJ FASTCALL
75 IntEnumHDev(VOID)
76 {
77 // I guess we will soon have more than one primary surface.
78 // This will do for now.
79 return gppdevPrimary;
80 }
81
82
83 INT
84 APIENTRY
85 NtGdiDrawEscape(
86 IN HDC hdc,
87 IN INT iEsc,
88 IN INT cjIn,
89 IN OPTIONAL LPSTR pjIn)
90 {
91 UNIMPLEMENTED;
92 return 0;
93 }
94
95