if(!lfa || !font)
return InvalidParameter;
- memcpy(&lfw, lfa, sizeof(LOGFONTA));
+ memcpy(&lfw, lfa, FIELD_OFFSET(LOGFONTA,lfFaceName) );
if(!MultiByteToWideChar(CP_ACP, 0, lfa->lfFaceName, -1, lfw.lfFaceName, LF_FACESIZE))
return GenericError;
@ stub GdipAddPathPieI
@ stub GdipAddPathPolygon
@ stub GdipAddPathPolygonI
-@ stub GdipAddPathRectangle
-@ stub GdipAddPathRectangleI
+@ stdcall GdipAddPathRectangle(ptr long long long long)
+@ stdcall GdipAddPathRectangleI(ptr long long long long)
@ stub GdipAddPathRectangles
@ stub GdipAddPathRectanglesI
@ stub GdipAddPathString
@ stdcall GdipCreateFromHDC2(long long ptr)
@ stdcall GdipCreateFromHDC(long ptr)
@ stdcall GdipCreateFromHWND(long ptr)
-@ stub GdipCreateFromHWNDICM
+@ stdcall GdipCreateFromHWNDICM(long ptr)
@ stdcall GdipCreateHBITMAPFromBitmap(ptr ptr long)
@ stub GdipCreateHICONFromBitmap
@ stub GdipCreateHalftonePalette
@ stdcall GdipCreatePathIter(ptr ptr)
@ stdcall GdipCreatePen1(long long long ptr)
@ stdcall GdipCreatePen2(ptr long long ptr)
-@ stub GdipCreateRegion
+@ stdcall GdipCreateRegion(ptr)
@ stub GdipCreateRegionHrgn
-@ stub GdipCreateRegionPath
+@ stdcall GdipCreateRegionPath(ptr ptr)
@ stub GdipCreateRegionRect
@ stub GdipCreateRegionRectI
@ stub GdipCreateRegionRgnData
@ stdcall GdipDeletePathIter(ptr)
@ stdcall GdipDeletePen(ptr)
@ stub GdipDeletePrivateFontCollection
-@ stub GdipDeleteRegion
+@ stdcall GdipDeleteRegion(ptr)
@ stdcall GdipDeleteStringFormat(ptr)
@ stdcall GdipDisposeImage(ptr)
@ stdcall GdipDisposeImageAttributes(ptr)
@ stdcall GdipGetBrushType(ptr ptr)
@ stub GdipGetCellAscent
@ stub GdipGetCellDescent
-@ stub GdipGetClip
+@ stdcall GdipGetClip(ptr ptr)
@ stub GdipGetClipBounds
@ stub GdipGetClipBoundsI
@ stdcall GdipGetCompositingMode(ptr ptr)
@ stub GdipGetCustomLineCapStrokeJoin
@ stub GdipGetCustomLineCapType
@ stub GdipGetCustomLineCapWidthScale
-@ stub GdipGetDC
+@ stdcall GdipGetDC(ptr ptr)
@ stdcall GdipGetDpiX(ptr ptr)
@ stdcall GdipGetDpiY(ptr ptr)
@ stub GdipGetEffectParameterSize
@ stdcall GdipGetImageDimension(ptr ptr ptr)
@ stdcall GdipGetImageEncoders(long long ptr)
@ stdcall GdipGetImageEncodersSize(ptr ptr)
-@ stub GdipGetImageFlags
+@ stdcall GdipGetImageFlags(ptr ptr)
@ stdcall GdipGetImageGraphicsContext(ptr ptr)
@ stdcall GdipGetImageHeight(ptr ptr)
@ stdcall GdipGetImageHorizontalResolution(ptr ptr)
@ stub GdipGetRegionBoundsI
@ stub GdipGetRegionData
@ stub GdipGetRegionDataSize
-@ stub GdipGetRegionHRgn
+@ stdcall GdipGetRegionHRgn(ptr ptr ptr)
@ stub GdipGetRegionScans
@ stub GdipGetRegionScansCount
@ stub GdipGetRegionScansI
@ stub GdipIsVisibleRegionRect
@ stub GdipIsVisibleRegionRectI
@ stdcall GdipLoadImageFromFile(wstr ptr)
-@ stub GdipLoadImageFromFileICM
+@ stdcall GdipLoadImageFromFileICM(wstr ptr)
@ stdcall GdipLoadImageFromStream(ptr ptr)
@ stdcall GdipLoadImageFromStreamICM(ptr ptr)
@ stub GdipMeasureCharacterRanges
@ stub GdipRecordMetafileI
@ stub GdipRecordMetafileStream
@ stub GdipRecordMetafileStreamI
-@ stub GdipReleaseDC
+@ stdcall GdipReleaseDC(ptr ptr)
@ stdcall GdipRemovePropertyItem(ptr long)
@ stub GdipResetClip
@ stub GdipResetImageAttributes
struct GpImage{
IPicture* picture;
ImageType type;
+ UINT flags;
};
struct GpMetafile{
return Ok;
}
+/* FIXME: no icm handling */
+GpStatus WINGDIPAPI GdipCreateFromHWNDICM(HWND hwnd, GpGraphics **graphics)
+{
+ return GdipCreateFromHWND(hwnd, graphics);
+}
+
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete,
GpMetafile **metafile)
{
GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x,
INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
{
- INT save_state, num_pts;
- GpPointF points[MAX_ARC_PTS];
- GpStatus retval;
-
- if(!graphics || !pen || width <= 0 || height <= 0)
- return InvalidParameter;
-
- num_pts = arc2polybezier(points, x, y, width, height, startAngle, sweepAngle);
-
- save_state = prepare_dc(graphics, pen);
-
- retval = draw_polybezier(graphics, pen, points, num_pts, TRUE);
-
- restore_dc(graphics, save_state);
-
- return retval;
+ return GdipDrawArc(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
}
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1,
return ret;
}
+
+GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
+{
+ FIXME("(%p, %p): stub\n", graphics, hdc);
+
+ *hdc = NULL;
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipReleaseDC(GpGraphics *graphics, HDC hdc)
+{
+ FIXME("(%p, %p): stub\n", graphics, hdc);
+
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipGetClip(GpGraphics *graphics, GpRegion *region)
+{
+ FIXME("(%p, %p): stub\n", graphics, region);
+
+ return NotImplemented;
+}
return GdipTransformMatrixPoints(matrix, path->pathdata.Points,
path->pathdata.Count);
}
+
+GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
+ REAL width, REAL height)
+{
+ GpPath *backup;
+ GpPointF ptf[2];
+ GpStatus retstat;
+ BOOL old_new;
+
+ if(!path || width < 0.0 || height < 0.0)
+ return InvalidParameter;
+
+ /* make a backup copy of path data */
+ if((retstat = GdipClonePath(path, &backup)) != Ok)
+ return retstat;
+
+ /* rectangle should start as new path */
+ old_new = path->newfigure;
+ path->newfigure = TRUE;
+ if((retstat = GdipAddPathLine(path,x,y,x+width,y)) != Ok){
+ path->newfigure = old_new;
+ goto fail;
+ }
+
+ ptf[0].X = x+width;
+ ptf[0].Y = y+height;
+ ptf[1].X = x;
+ ptf[1].Y = y+height;
+
+ if((retstat = GdipAddPathLine2(path,(GDIPCONST GpPointF*)&ptf,2)) != Ok) goto fail;
+ path->pathdata.Types[path->pathdata.Count-1] |= PathPointTypeCloseSubpath;
+
+ /* free backup */
+ GdipDeletePath(backup);
+ return Ok;
+
+fail:
+ /* reverting */
+ GdipDeletePath(path);
+ GdipClonePath(backup, &path);
+ GdipDeletePath(backup);
+
+ return retstat;
+}
+
+GpStatus WINGDIPAPI GdipAddPathRectangleI(GpPath *path, INT x, INT y,
+ INT width, INT height)
+{
+ return GdipAddPathRectangle(path,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
+}
}
(*bitmap)->image.type = ImageTypeBitmap;
+ (*bitmap)->image.flags = ImageFlagsNone;
(*bitmap)->width = width;
(*bitmap)->height = height;
(*bitmap)->format = format;
return stat;
}
+/* FIXME: no icm handling */
+GpStatus WINGDIPAPI GdipLoadImageFromFileICM(GDIPCONST WCHAR* filename,GpImage **image)
+{
+ return GdipLoadImageFromFile(filename, image);
+}
+
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
{
IPicture *pic;
}
(*image)->picture = pic;
+ (*image)->flags = ImageFlagsNone;
return Ok;
}
return NotImplemented;
}
+
+GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
+{
+ if(!image || !flags)
+ return InvalidParameter;
+
+ *flags = image->flags;
+
+ return Ok;
+}
REAL x, y;
INT i;
- if(!matrix || !pts)
+ if(!matrix || !pts || count <= 0)
return InvalidParameter;
for(i = 0; i < count; i++)
GpStatus ret;
INT i;
+ if(count <= 0)
+ return InvalidParameter;
+
ptsF = GdipAlloc(sizeof(GpPointF) * count);
if(!ptsF)
return OutOfMemory;
REAL x, y;
INT i;
- if(!matrix || !pts)
+ if(!matrix || !pts || count <= 0)
return InvalidParameter;
for(i = 0; i < count; i++)
GpStatus ret;
INT i;
+ if(count <= 0)
+ return InvalidParameter;
+
ptsF = GdipAlloc(sizeof(GpPointF) * count);
if(!ptsF)
return OutOfMemory;
if(!pen || !dash)
return InvalidParameter;
+ if(count <= 0)
+ return OutOfMemory;
+
for(i = 0; i < count; i++){
sum += dash[i];
if(dash[i] < 0.0)
WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
+/**********************************************************
+ *
+ * Data returned by GdipGetRegionData (for rectangle based regions)
+ * looks something like this:
+ *
+ * struct region_data_header
+ * {
+ * DWORD size; size in bytes of the data - 8.
+ * DWORD magic1; probably a checksum.
+ * DWORD magic2; always seems to be 0xdbc01001 - version?
+ * DWORD num_ops; number of combining ops * 2
+ * };
+ *
+ * Then follows a sequence of combining ops and RECTFs.
+ *
+ * Combining ops are just stored as their CombineMode value.
+ *
+ * Each RECTF is preceded by the DWORD 0x10000000. An empty rect is
+ * stored as 0x10000002 (with no following RECTF) and an infinite rect
+ * is stored as 0x10000003 (again with no following RECTF).
+ *
+ * The combining ops are stored in the reverse order to the RECTFs and in the
+ * reverse order to which the region was constructed.
+ *
+ * When two or more complex regions (ie those with more than one rect)
+ * are combined, the combining op for the two regions comes first,
+ * then the combining ops for the rects in region 1, followed by the
+ * rects for region 1, then follows the combining ops for region 2 and
+ * finally region 2's rects. Presumably you're supposed to use the
+ * 0x10000000 rect header to find the end of the op list (the count of
+ * the rects in each region is not stored).
+ *
+ * When a simple region (1 rect) is combined, it's treated as if a single rect
+ * is being combined.
+ *
+ */
+
+GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
+{
+ FIXME("(%p): stub\n", region);
+
+ *region = NULL;
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
+{
+ FIXME("(%p, %p): stub\n", path, region);
+
+ *region = NULL;
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
+{
+ FIXME("(%p): stub\n", region);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn)
+{
+ FIXME("(%p, %p, %p): stub\n", region, graphics, hrgn);
+
+ *hrgn = NULL;
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region)
{
static int calls;