branch update for HEAD-2003021201
[reactos.git] / lib / gdi32 / objects / dc.c
1 #ifdef UNICODE
2 #undef UNICODE
3 #endif
4
5 #undef WIN32_LEAN_AND_MEAN
6 #include <windows.h>
7 #include <ddk/ntddk.h>
8 #include <win32k/kapi.h>
9
10 HGDIOBJ STDCALL
11 GetStockObject(int Index)
12 {
13   return(W32kGetStockObject(Index));
14 }
15
16
17 int STDCALL
18 GetClipBox(HDC hDc, LPRECT Rect)
19 {
20   return(W32kGetClipBox(hDc, Rect));
21 }
22
23
24 HDC
25 STDCALL
26 CreateDCA (
27         LPCSTR          lpszDriver,
28         LPCSTR          lpszDevice,
29         LPCSTR          lpszOutput,
30         CONST DEVMODEA  * lpInitData
31         )
32 {
33         ANSI_STRING DriverA, DeviceA, OutputA;
34         UNICODE_STRING DriverU, DeviceU, OutputU;
35         HDC     hDC;
36         DEVMODEW *lpInitDataW;
37
38         /*
39          * If needed, convert to Unicode
40          * any string parameter.
41          */
42
43         if (NULL != lpszDriver)
44         {
45                 RtlInitAnsiString(&DriverA, (LPSTR)lpszDriver);
46                 RtlAnsiStringToUnicodeString(&DriverU, &DriverA, TRUE);
47         } else
48                 DriverU.Buffer = NULL;
49         if (NULL != lpszDevice)
50         {
51                 RtlInitAnsiString(&DeviceA, (LPSTR)lpszDevice);
52                 RtlAnsiStringToUnicodeString(&DeviceU, &DeviceA, TRUE);
53         } else
54                 DeviceU.Buffer = NULL;
55         if (NULL != lpszOutput)
56         {
57                 RtlInitAnsiString(&OutputA, (LPSTR)lpszOutput);
58                 RtlAnsiStringToUnicodeString(&OutputU, &OutputA, TRUE);
59         } else
60                 OutputU.Buffer = NULL;
61
62         if (NULL != lpInitData)
63         {
64 //              lpInitDataW = HeapAllocMem(
65         } else
66                 lpInitDataW = NULL;
67
68         /*
69          * Call the Unicode version
70          * of CreateDC.
71          */
72
73         hDC = CreateDCW (
74                 DriverU.Buffer,
75                 DeviceU.Buffer,
76                 OutputU.Buffer,
77                 NULL);
78 //              lpInitDataW);
79         /*
80          * Free Unicode parameters.
81          */
82         RtlFreeUnicodeString(&DriverU);
83         RtlFreeUnicodeString(&DeviceU);
84         RtlFreeUnicodeString(&OutputU);
85
86         /*
87          * Return the possible DC handle.
88          */
89
90         return hDC;
91 }
92
93 HDC
94 STDCALL
95 CreateDCW (
96         LPCWSTR         lpwszDriver,
97         LPCWSTR         lpwszDevice,
98         LPCWSTR         lpwszOutput,
99         CONST DEVMODEW  * lpInitData
100         )
101 {
102         return W32kCreateDC (
103                         lpwszDriver,
104                         lpwszDevice,
105                         lpwszOutput,
106                         (PDEVMODEW)lpInitData
107                         );
108 }
109
110 BOOL STDCALL DeleteDC( HDC hDC )
111 {
112   return W32kDeleteDC( hDC );
113 }
114
115
116 HDC
117 STDCALL
118 CreateCompatibleDC(
119         HDC  hDC
120         )
121 {
122         return W32kCreateCompatableDC(hDC);
123 }
124
125 HGDIOBJ
126 STDCALL
127 SelectObject(
128         HDC     hDC,
129         HGDIOBJ hGDIObj
130         )
131 {
132         return W32kSelectObject(hDC, hGDIObj);
133 }
134
135 int
136 STDCALL
137 SetMapMode(
138         HDC     a0,
139         int     a1
140         )
141 {
142   return W32kSetMapMode( a0, a1 );
143 }
144
145 BOOL
146 STDCALL
147 SetViewportOrgEx(
148         HDC     a0,
149         int     a1,
150         int     a2,
151         LPPOINT a3
152         )
153 {
154   return W32kSetViewportOrgEx( a0, a1, a2, a3 );
155 }
156
157 BOOL
158 STDCALL
159 SetWindowOrgEx(
160         HDC     a0,
161         int     a1,
162         int     a2,
163         LPPOINT a3
164         )
165 {
166   return W32kSetWindowOrgEx( a0, a1, a2, a3 );
167 }
168
169
170 BOOL
171 STDCALL
172 DeleteObject(
173         HGDIOBJ         a0
174         )
175 {
176         return W32kDeleteObject(a0);
177 }
178
179 HPALETTE
180 STDCALL
181 SelectPalette(
182         HDC             a0,
183         HPALETTE        a1,
184         BOOL            a2
185         )
186 {
187         return W32kSelectPalette( a0, a1,a2 );
188 }
189
190 UINT
191 STDCALL
192 RealizePalette(
193         HDC     a0
194         )
195 {
196         return W32kRealizePalette( a0 );
197 }
198
199
200