branch update for HEAD-2003050101
[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 int
24 STDCALL
25 GetPolyFillMode(
26         HDC     a0
27         )
28 {
29         return W32kGetPolyFillMode(a0);
30 }
31
32 HDC
33 STDCALL
34 CreateDCA (
35         LPCSTR          lpszDriver,
36         LPCSTR          lpszDevice,
37         LPCSTR          lpszOutput,
38         CONST DEVMODEA  * lpInitData
39         )
40 {
41         ANSI_STRING DriverA, DeviceA, OutputA;
42         UNICODE_STRING DriverU, DeviceU, OutputU;
43         HDC     hDC;
44         DEVMODEW *lpInitDataW;
45
46         /*
47          * If needed, convert to Unicode
48          * any string parameter.
49          */
50
51         if (NULL != lpszDriver)
52         {
53                 RtlInitAnsiString(&DriverA, (LPSTR)lpszDriver);
54                 RtlAnsiStringToUnicodeString(&DriverU, &DriverA, TRUE);
55         } else
56                 DriverU.Buffer = NULL;
57         if (NULL != lpszDevice)
58         {
59                 RtlInitAnsiString(&DeviceA, (LPSTR)lpszDevice);
60                 RtlAnsiStringToUnicodeString(&DeviceU, &DeviceA, TRUE);
61         } else
62                 DeviceU.Buffer = NULL;
63         if (NULL != lpszOutput)
64         {
65                 RtlInitAnsiString(&OutputA, (LPSTR)lpszOutput);
66                 RtlAnsiStringToUnicodeString(&OutputU, &OutputA, TRUE);
67         } else
68                 OutputU.Buffer = NULL;
69
70         if (NULL != lpInitData)
71         {
72 //              lpInitDataW = HeapAllocMem(
73         } else
74                 lpInitDataW = NULL;
75
76         /*
77          * Call the Unicode version
78          * of CreateDC.
79          */
80
81         hDC = CreateDCW (
82                 DriverU.Buffer,
83                 DeviceU.Buffer,
84                 OutputU.Buffer,
85                 NULL);
86 //              lpInitDataW);
87         /*
88          * Free Unicode parameters.
89          */
90         RtlFreeUnicodeString(&DriverU);
91         RtlFreeUnicodeString(&DeviceU);
92         RtlFreeUnicodeString(&OutputU);
93
94         /*
95          * Return the possible DC handle.
96          */
97
98         return hDC;
99 }
100
101 HDC
102 STDCALL
103 CreateDCW (
104         LPCWSTR         lpwszDriver,
105         LPCWSTR         lpwszDevice,
106         LPCWSTR         lpwszOutput,
107         CONST DEVMODEW  * lpInitData
108         )
109 {
110         return W32kCreateDC (
111                         lpwszDriver,
112                         lpwszDevice,
113                         lpwszOutput,
114                         (PDEVMODEW)lpInitData
115                         );
116 }
117
118 BOOL STDCALL DeleteDC( HDC hDC )
119 {
120   return W32kDeleteDC( hDC );
121 }
122
123
124 HDC
125 STDCALL
126 CreateCompatibleDC(
127         HDC  hDC
128         )
129 {
130         return W32kCreateCompatableDC(hDC);
131 }
132
133 HGDIOBJ
134 STDCALL
135 SelectObject(
136         HDC     hDC,
137         HGDIOBJ hGDIObj
138         )
139 {
140         return W32kSelectObject(hDC, hGDIObj);
141 }
142
143 int
144 STDCALL
145 SetMapMode(
146         HDC     a0,
147         int     a1
148         )
149 {
150   return W32kSetMapMode( a0, a1 );
151 }
152
153 BOOL
154 STDCALL
155 SetViewportOrgEx(
156         HDC     a0,
157         int     a1,
158         int     a2,
159         LPPOINT a3
160         )
161 {
162   return W32kSetViewportOrgEx( a0, a1, a2, a3 );
163 }
164
165 BOOL
166 STDCALL
167 SetWindowOrgEx(
168         HDC     a0,
169         int     a1,
170         int     a2,
171         LPPOINT a3
172         )
173 {
174   return W32kSetWindowOrgEx( a0, a1, a2, a3 );
175 }
176
177
178 BOOL
179 STDCALL
180 DeleteObject(
181         HGDIOBJ         a0
182         )
183 {
184         return W32kDeleteObject(a0);
185 }
186
187 HPALETTE
188 STDCALL
189 SelectPalette(
190         HDC             a0,
191         HPALETTE        a1,
192         BOOL            a2
193         )
194 {
195         return W32kSelectPalette( a0, a1,a2 );
196 }
197
198 UINT
199 STDCALL
200 RealizePalette(
201         HDC     a0
202         )
203 {
204         return W32kRealizePalette( a0 );
205 }
206
207
208 BOOL
209 STDCALL
210 LPtoDP(
211         HDC     a0,
212         LPPOINT a1,
213         int     a2
214         )
215 {
216         return W32kLPtoDP(a0, a1, a2);
217 }
218
219 int
220 STDCALL
221 SetPolyFillMode(
222         HDC     a0,
223         int     a1
224         )
225 {
226         return W32kSetPolyFillMode(a0, a1);
227 }
228