78#define FLAGS_INTPATH 0x4000
116 return needed +
sizeof(
GpRect);
120 needed +=
sizeof(
DWORD);
156 (*element2)->type =
element->type;
161 (*element2)->elementdata.rect =
element->elementdata.rect;
171 (*element2)->elementdata.combine.left =
NULL;
172 (*element2)->elementdata.combine.right =
NULL;
175 &(*element2)->elementdata.combine.left);
179 &(*element2)->elementdata.combine.right);
219 TRACE(
"%p %p\n", region, clone);
221 if (!(region && clone))
244 if (!(region &&
path))
291 if (!(region &&
rect))
353 TRACE(
"%p %p %d\n", region1, region2,
mode);
355 if(!(region1 && region2))
392 TRACE(
"%p\n", region);
401 TRACE(
"=> %p\n", *region);
432 if (!(
path && region))
466 if (!(
rect && region))
477 (*region)->node.elementdata.rect.X =
rect->X;
478 (*region)->node.elementdata.rect.Y =
rect->Y;
479 (*region)->node.elementdata.rect.Width =
rect->Width;
480 (*region)->node.elementdata.rect.Height =
rect->Height;
526 if(
buf->rdh.nCount == 0){
547 for(
i = 0; i < buf->rdh.nCount;
i++){
569 TRACE(
"%p\n", region);
585 REAL min_x, min_y, max_x, max_y;
588 TRACE(
"(%p, %p, %p)\n", region, graphics,
rect);
590 if(!region || !graphics || !
rect)
600 TRACE(
"%p => infinite\n", region);
606 TRACE(
"%p => empty\n", region);
612 rect->Width = max_x - min_x;
613 rect->Height = max_y - min_y;
627 TRACE(
"(%p, %p, %p)\n", region, graphics,
rect);
754 if (needed) *needed =
size;
806 node->elementdata.combine.left =
left;
825 ERR(
"failed to read rect data\n");
829 node->elementdata.rect = *rc;
843 ERR(
"failed to read path header\n");
855 TRACE(
"refusing to create an empty path in a region\n");
929 FIXME(
"element type %#lx is not supported\n", *
type);
980 TRACE(
"%p, %p\n", region, needed);
982 if (!(region && needed))
998 if (!
path->pathdata.Count)
1011 graphics = new_graphics;
1192 FIXME(
"GdipGetRegionHRgn unimplemented for region type=%lx\n",
element->type);
1203 TRACE(
"(%p, %p, %p)\n", region, graphics,
hrgn);
1205 if (!region || !
hrgn)
1216 TRACE(
"(%p, %p, %p)\n", region, graphics,
res);
1218 if(!region || !graphics || !
res)
1239 TRACE(
"(%p, %p, %p, %p)\n", region, region2, graphics,
res);
1241 if(!region || !region2 || !graphics || !
res)
1271 TRACE(
"(%p, %p, %p)\n", region, graphics,
res);
1273 if(!region || !graphics || !
res)
1290 TRACE(
"(%p, %.2f, %.2f, %.2f, %.2f, %p, %p)\n", region,
x,
y,
w,
h, graphics,
res);
1317 TRACE(
"(%p, %d, %d, %d, %d, %p, %p)\n", region,
x,
y,
w,
h, graphics,
res);
1333 REAL left_min_x, left_min_y, left_max_x, left_max_y;
1334 BOOL left_empty, left_infinite;
1335 REAL right_min_x, right_min_y, right_max_x, right_max_y;
1336 BOOL right_empty, right_infinite;
1343 const int combine_mode_flags[] = {
1356 *min_x = *min_y = *max_x = *max_y = 0.0;
1361 *min_x = *min_y = *max_x = *max_y = 0.0;
1370 if (
path->pathdata.Count <= 1) {
1371 *min_x = *min_y = *max_x = *max_y = 0.0;
1377 *min_x = *max_x =
path->pathdata.Points[0].X;
1378 *min_y = *max_y =
path->pathdata.Points[0].Y;
1382 for (
i=1;
i <
path->pathdata.Count;
i++)
1384 if (
path->pathdata.Points[
i].X < *min_x)
1385 *min_x =
path->pathdata.Points[
i].X;
1386 else if (
path->pathdata.Points[
i].X > *max_x)
1387 *max_x =
path->pathdata.Points[
i].X;
1388 if (
path->pathdata.Points[
i].Y < *min_y)
1389 *min_y =
path->pathdata.Points[
i].Y;
1390 else if (
path->pathdata.Points[
i].Y > *max_y)
1391 *max_y =
path->pathdata.Points[
i].Y;
1397 *min_x =
element->elementdata.rect.X;
1398 *min_y =
element->elementdata.rect.Y;
1399 *max_x =
element->elementdata.rect.X +
element->elementdata.rect.Width;
1400 *max_y =
element->elementdata.rect.Y +
element->elementdata.rect.Height;
1412 &left_min_x, &left_min_y, &left_max_x, &left_max_y, &left_empty, &left_infinite);
1420 if (left_empty && (
flags & 0x3) == 0) {
1427 if (left_empty && (
flags & 0x3) == 0x3) {
1435 &right_min_x, &right_min_y, &right_max_x, &right_max_y, &right_empty, &right_infinite);
1444 *infinite = (
flags & 0x1);
1459 *min_x = right_min_x;
1460 *min_y = right_min_y;
1461 *max_x = right_max_x;
1462 *max_y = right_max_y;
1463 *
empty = right_empty;
1474 *min_x = left_min_x;
1475 *min_y = left_min_y;
1476 *max_x = left_max_x;
1477 *max_y = left_max_y;
1478 *
empty = left_empty;
1489 switch (
flags & 0x6)
1493 *min_x =
fmaxf(left_min_x, right_min_x);
1494 *min_y =
fmaxf(left_min_y, right_min_y);
1495 *max_x =
fminf(left_max_x, right_max_x);
1496 *max_y =
fminf(left_max_y, right_max_y);
1497 *
empty = *min_x > *max_x || *min_y > *max_y;
1501 *min_x = right_min_x;
1502 *min_y = right_min_y;
1503 *max_x = right_max_x;
1504 *max_y = right_max_y;
1505 *
empty = right_empty;
1509 *min_x = left_min_x;
1510 *min_y = left_min_y;
1511 *max_x = left_max_x;
1512 *max_y = left_max_y;
1513 *
empty = left_empty;
1517 *min_x =
fminf(left_min_x, right_min_x);
1518 *min_y =
fminf(left_min_y, right_min_y);
1519 *max_x =
fmaxf(left_max_x, right_max_x);
1520 *max_y =
fmaxf(left_max_y, right_max_y);
1533 REAL min_x, min_y, max_x, max_y;
1536 TRACE(
"(%p, %.2f, %.2f, %p, %p)\n", region,
x,
y, graphics,
res);
1546 if (
empty ||
x < min_x || y < min_y || x > max_x ||
y > max_y)
1573 TRACE(
"(%p, %d, %d, %p, %p)\n", region,
x,
y, graphics,
res);
1585 TRACE(
"%p\n", region);
1600 TRACE(
"%p\n", region);
1626 if (
matrix->matrix[1] == 0.0 &&
matrix->matrix[2] == 0.0)
1668 element->elementdata.rect.Width,
element->elementdata.rect.Height);
1687 if (!
element->elementdata.path->pathdata.Count)
1691 element->elementdata.path->pathdata.Points,
1692 element->elementdata.path->pathdata.Count);
1727 for(
i = 0;
i <
element->elementdata.path->pathdata.Count;
i++){
1728 element->elementdata.path->pathdata.Points[
i].X +=
dx;
1729 element->elementdata.path->pathdata.Points[
i].Y +=
dy;
1744 TRACE(
"(%p, %f, %f)\n", region,
dx,
dy);
1759 TRACE(
"(%p, %d, %d)\n", region,
dx,
dy);
1805 (*data)->rdh.nCount = 1;
1806 (*data)->rdh.nRgnSize =
sizeof(
RECT);
1807 (*data)->rdh.rcBound.left = (*data)->rdh.rcBound.top = -0x400000;
1808 (*data)->rdh.rcBound.right = (*data)->rdh.rcBound.bottom = 0x400000;
1810 memcpy((*data)->Buffer, &(*data)->rdh.rcBound,
sizeof(
RECT));
1863 for (
i=0;
i<
data->rdh.nCount;
i++)
1866 scans[
i].
Y = rects[
i].
top;
1897 for (
i=0;
i<
data->rdh.nCount;
i++)
1900 scans[
i].
Y = rects[
i].
top;
struct _RGNDATAHEADER RGNDATAHEADER
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static const WCHAR empty[1]
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)
GpStatus WINGDIPAPI GdipClonePath(GpPath *path, GpPath **clone)
GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
DWORD write_region_data(const GpRegion *region, void *data)
static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *graphics, HRGN *hrgn)
GpStatus WINGDIPAPI GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL w, REAL h, GpGraphics *graphics, BOOL *res)
GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode mode)
static GpStatus clone_element(const region_element *element, region_element **element2)
static GpStatus get_region_scans_data(GpRegion *region, GpMatrix *matrix, LPRGNDATA *data)
static void translate_region_element(region_element *element, REAL dx, REAL dy)
static void write_element(const region_element *element, DWORD *buffer, INT *filled)
GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
GpStatus WINGDIPAPI GdipIsInfiniteRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region)
GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region)
GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy)
GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn)
GpStatus WINGDIPAPI GdipGetRegionBoundsI(GpRegion *region, GpGraphics *graphics, GpRect *rect)
GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region)
GpStatus WINGDIPAPI GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y, GpGraphics *graphics, BOOL *res)
static GpStatus init_region(GpRegion *region, const RegionType type)
GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRegion **region)
static GpStatus transform_region_element(region_element *element, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipIsVisibleRegionRectI(GpRegion *region, INT x, INT y, INT w, INT h, GpGraphics *graphics, BOOL *res)
static INT get_element_size(const region_element *element)
GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy)
GpStatus WINGDIPAPI GdipGetRegionScans(GpRegion *region, GpRectF *scans, INT *count, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *region, GpRegion *region2, GpGraphics *graphics, BOOL *res)
static void write_float(DWORD *location, INT *offset, const FLOAT write)
GpStatus WINGDIPAPI GdipCombineRegionRectI(GpRegion *region, GDIPCONST GpRect *rect, CombineMode mode)
GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
static void fuse_region(GpRegion *region, region_element *left, region_element *right, const CombineMode mode)
GpStatus WINGDIPAPI GdipGetRegionDataSize(GpRegion *region, UINT *needed)
GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region, GDIPCONST GpRectF *rect, CombineMode mode)
GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1, GpRegion *region2, CombineMode mode)
static void get_region_bounding_box(struct region_element *element, REAL *min_x, REAL *min_y, REAL *max_x, REAL *max_y, BOOL *empty, BOOL *infinite)
static void write_dword(DWORD *location, INT *offset, const DWORD write)
static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, region_element *node, INT *count)
GpStatus WINGDIPAPI GdipIsVisibleRegionPointI(GpRegion *region, INT x, INT y, GpGraphics *graphics, BOOL *res)
GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *region, BYTE *buffer, UINT size, UINT *needed)
GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *count, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, GpRectF *rect)
static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect, GpRegion **region)
GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *region, GpRegion **clone)
_ACRTIMP float __cdecl fmaxf(float, float)
_ACRTIMP float __cdecl fminf(float, float)
void delete_element(region_element *element)
const char * debugstr_rectf(const RectF *rc)
BOOL lengthen_path(GpPath *path, INT len)
const char * debugstr_matrix(const GpMatrix *matrix)
static INT gdip_round(REAL x)
static void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size)
DWORD write_path_data(GpPath *path, void *data)
static void set_rect(GpRectF *rect, REAL x, REAL y, REAL width, REAL height)
void gdi_dc_release(GpGraphics *graphics, HDC hdc)
static const void * buffer_read(struct memory_buffer *mbuf, INT size)
GpStatus gdi_dc_acquire(GpGraphics *graphics, HDC *hdc)
GpStatus gdi_transform_acquire(GpGraphics *graphics)
static BOOL has_gdi_dc(GpGraphics *graphics)
GpStatus gdi_transform_release(GpGraphics *graphics)
GpStatus trace_path(GpGraphics *graphics, GpPath *path)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLubyte GLubyte GLubyte GLubyte w
GLsizei const GLfloat * points
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
struct region_element::@405::@406 combine
union region_element::@405 elementdata
#define FIELD_OFFSET(t, f)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EqualRgn(_In_ HRGN, _In_ HRGN)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI PtInRegion(_In_ HRGN, _In_ int, _In_ int)
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
HRGN WINAPI PathToRegion(_In_ HDC)
BOOL WINAPI RectInRegion(_In_ HRGN, _In_ LPCRECT)
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI EndPath(_In_ HDC)
int WINAPI SaveDC(_In_ HDC)
int WINAPI SetPolyFillMode(_In_ HDC, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)