24 #include <freerdp/config.h>
29 #include <freerdp/freerdp.h>
30 #include <freerdp/gdi/gdi.h>
32 #include <freerdp/gdi/region.h>
34 #include <freerdp/gdi/dc.h>
50 hDC->format = PIXEL_FORMAT_XRGB32;
51 hDC->drawMode = GDI_R2_BLACK;
52 hDC->clip = gdi_CreateRectRgn(0, 0, 0, 0);
60 hDC->clip->null = TRUE;
72 HGDI_DC gdi_CreateDC(UINT32 format)
79 hDC->drawMode = GDI_R2_BLACK;
81 if (!(hDC->clip = gdi_CreateRectRgn(0, 0, 0, 0)))
84 hDC->clip->null = TRUE;
91 if (!(hDC->hwnd->invalid = gdi_CreateRectRgn(0, 0, 0, 0)))
94 hDC->hwnd->invalid->null = TRUE;
95 hDC->hwnd->count = 32;
97 if (!(hDC->hwnd->cinvalid = (
HGDI_RGN)calloc(hDC->hwnd->count,
sizeof(
GDI_RGN))))
100 hDC->hwnd->ninvalid = 0;
121 if (!(hDC->clip = gdi_CreateRectRgn(0, 0, 0, 0)))
127 hDC->clip->null = TRUE;
128 hDC->format = hdc->format;
129 hDC->drawMode = hdc->drawMode;
145 HGDIOBJECT previousSelectedObject = hdc->selectedObject;
147 if (hgdiobject == NULL)
150 if (hgdiobject->objectType == GDIOBJECT_BITMAP)
152 hdc->selectedObject = hgdiobject;
154 else if (hgdiobject->objectType == GDIOBJECT_PEN)
156 previousSelectedObject = (
HGDIOBJECT)hdc->pen;
159 else if (hgdiobject->objectType == GDIOBJECT_BRUSH)
161 previousSelectedObject = (
HGDIOBJECT)hdc->brush;
164 else if (hgdiobject->objectType == GDIOBJECT_REGION)
166 hdc->selectedObject = hgdiobject;
167 previousSelectedObject = (
HGDIOBJECT)COMPLEXREGION;
169 else if (hgdiobject->objectType == GDIOBJECT_RECT)
171 hdc->selectedObject = hgdiobject;
172 previousSelectedObject = (
HGDIOBJECT)SIMPLEREGION;
180 return previousSelectedObject;
195 if (hgdiobject->objectType == GDIOBJECT_BITMAP)
199 if (hBitmap->data && hBitmap->free)
201 hBitmap->free(hBitmap->data);
202 hBitmap->data = NULL;
207 else if (hgdiobject->objectType == GDIOBJECT_PEN)
212 else if (hgdiobject->objectType == GDIOBJECT_BRUSH)
217 else if (hgdiobject->objectType == GDIOBJECT_REGION)
221 else if (hgdiobject->objectType == GDIOBJECT_RECT)
248 free(hdc->hwnd->cinvalid);
249 free(hdc->hwnd->invalid);