Commit the stuff. Lots of changes. I'll write a proper list of changes when it's...
[reactos.git] / subsystems / win32 / win32k / objects / 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 <w32k.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()
30 {
31 SIZEL SurfSize;
32 SURFOBJ *pso;
33 BOOL calledFromUser;
34
35 calledFromUser = UserIsEntered(); //fixme: possibly upgrade a shared lock
36 if (!calledFromUser)
37 {
38 UserEnterExclusive();
39 }
40
41 /* attach monitor */
42 IntAttachMonitor(gppdevPrimary, 0);
43
44 DPRINT1("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
45 pPrimarySurface, pPrimarySurface->pSurface);
46
47 pso = &pPrimarySurface->pSurface->SurfObj;
48 SurfSize = pso->sizlBitmap;
49
50 /* Put the pointer in the center of the screen */
51 gpsi->ptCursor.x = pso->sizlBitmap.cx / 2;
52 gpsi->ptCursor.y = pso->sizlBitmap.cy / 2;
53
54 co_IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
55
56 // Init Primary Displays Device Capabilities.
57 PDEVOBJ_vGetDeviceCaps(pPrimarySurface, &GdiHandleTable->DevCaps);
58
59 if (!calledFromUser)
60 {
61 UserLeave();
62 }
63
64 return TRUE;
65 }
66
67 VOID FASTCALL
68 IntDestroyPrimarySurface()
69 {
70 UNIMPLEMENTED;
71 }
72
73 PPDEVOBJ FASTCALL
74 IntEnumHDev(VOID)
75 {
76 // I guess we will soon have more than one primary surface.
77 // This will do for now.
78 return pPrimarySurface;
79 }
80
81
82 INT
83 APIENTRY
84 NtGdiDrawEscape(
85 IN HDC hdc,
86 IN INT iEsc,
87 IN INT cjIn,
88 IN OPTIONAL LPSTR pjIn)
89 {
90 UNIMPLEMENTED;
91 return 0;
92 }
93
94