Author: dchapyshev
Date: Sun Jun 7 11:59:56 2009
New Revision: 41318
URL:
http://svn.reactos.org/svn/reactos?rev=41318&view=rev
Log:
- Sync gdiplus with Wine 1.1.23
Modified:
trunk/reactos/dll/win32/gdiplus/gdiplus.spec
trunk/reactos/dll/win32/gdiplus/graphics.c
trunk/reactos/dll/win32/gdiplus/graphicspath.c
trunk/reactos/dll/win32/gdiplus/image.c
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] Sun Jun 7 11:59:56 2009
@@ -29,15 +29,15 @@
@ stdcall GdipAddPathRectangleI(ptr long long long long)
@ stdcall GdipAddPathRectangles(ptr ptr long)
@ stdcall GdipAddPathRectanglesI(ptr ptr long)
-@ stub GdipAddPathString
-@ stub GdipAddPathStringI
+@ stdcall GdipAddPathString(ptr wstr long ptr long long ptr ptr)
+@ stdcall GdipAddPathStringI(ptr wstr long ptr long long ptr ptr)
@ stdcall GdipAlloc(long)
@ stdcall GdipBeginContainer2(ptr ptr)
-@ stub GdipBeginContainer
-@ stub GdipBeginContainerI
-@ stub GdipBitmapApplyEffect
+@ stdcall GdipBeginContainer(ptr ptr ptr long ptr)
+@ stdcall GdipBeginContainerI(ptr ptr ptr long ptr)
+@ stdcall GdipBitmapApplyEffect(ptr ptr ptr long ptr ptr)
@ stub GdipBitmapConvertFormat
-@ stub GdipBitmapCreateApplyEffect
+@ stdcall GdipBitmapCreateApplyEffect(ptr long ptr ptr ptr ptr long ptr ptr)
@ stub GdipBitmapGetHistogram
@ stub GdipBitmapGetHistogramSize
@ stdcall GdipBitmapGetPixel(ptr long long ptr)
@@ -46,7 +46,7 @@
@ stdcall GdipBitmapSetResolution(ptr long long)
@ stdcall GdipBitmapUnlockBits(ptr ptr)
@ stdcall GdipClearPathMarkers(ptr)
-@ stub GdipCloneBitmapArea
+@ stdcall GdipCloneBitmapArea(long long long long long ptr ptr)
@ stdcall GdipCloneBitmapAreaI(long long long long long ptr ptr)
@ stdcall GdipCloneBrush(ptr ptr)
@ stdcall GdipCloneCustomLineCap(ptr ptr)
@@ -65,7 +65,7 @@
@ stdcall GdipCombineRegionRect(ptr ptr long)
@ stdcall GdipCombineRegionRectI(ptr ptr long)
@ stdcall GdipCombineRegionRegion(ptr ptr long)
-@ stub GdipComment
+@ stdcall GdipComment(ptr long ptr)
@ stdcall GdipConvertToEmfPlus(ptr ptr ptr long ptr ptr)
@ stub GdipConvertToEmfPlusToFile
@ stub GdipConvertToEmfPlusToStream
@@ -94,7 +94,7 @@
@ stdcall GdipCreateFromHWND(long ptr)
@ stdcall GdipCreateFromHWNDICM(long ptr)
@ stdcall GdipCreateHBITMAPFromBitmap(ptr ptr long)
-@ stub GdipCreateHICONFromBitmap
+@ stdcall GdipCreateHICONFromBitmap(ptr ptr)
@ stdcall GdipCreateHalftonePalette()
@ stdcall GdipCreateHatchBrush(long long long ptr)
@ stdcall GdipCreateImageAttributes(ptr)
@@ -109,8 +109,8 @@
@ stdcall GdipCreateMatrix3I(ptr ptr ptr)
@ stdcall GdipCreateMatrix(ptr)
@ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
-@ stub GdipCreateMetafileFromFile
-@ stub GdipCreateMetafileFromStream
+@ stdcall GdipCreateMetafileFromFile(ptr ptr)
+@ stdcall GdipCreateMetafileFromStream(ptr ptr)
@ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
@ stdcall GdipCreateMetafileFromWmfFile(wstr ptr ptr)
@ stdcall GdipCreatePath2(ptr ptr long long ptr)
@@ -139,7 +139,7 @@
@ stdcall GdipDeleteBrush(ptr)
@ stdcall GdipDeleteCachedBitmap(ptr)
@ stdcall GdipDeleteCustomLineCap(ptr)
-@ stub GdipDeleteEffect
+@ stdcall GdipDeleteEffect(ptr)
@ stdcall GdipDeleteFont(ptr)
@ stdcall GdipDeleteFontFamily(ptr)
@ stdcall GdipDeleteGraphics(ptr)
@@ -175,10 +175,10 @@
@ stdcall GdipDrawImage(ptr ptr long long)
@ stub GdipDrawImageFX
@ stdcall GdipDrawImageI(ptr ptr long long)
-@ stub GdipDrawImagePointRect
-@ stub GdipDrawImagePointRectI
-@ stub GdipDrawImagePoints
-@ stub GdipDrawImagePointsI
+@ stdcall GdipDrawImagePointRect(ptr ptr long long long long long long long)
+@ stdcall GdipDrawImagePointRectI(ptr ptr long long long long long long long)
+@ stdcall GdipDrawImagePoints(ptr ptr ptr long)
+@ stdcall GdipDrawImagePointsI(ptr ptr ptr long)
@ stdcall GdipDrawImagePointsRect(ptr ptr ptr long long long long long long ptr ptr ptr)
@ stdcall GdipDrawImagePointsRectI(ptr ptr ptr long long long long long long ptr ptr
ptr)
@ stdcall GdipDrawImageRect(ptr ptr long long long long)
@@ -199,7 +199,7 @@
@ stdcall GdipDrawRectangles(ptr ptr ptr long)
@ stdcall GdipDrawRectanglesI(ptr ptr ptr long)
@ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
-@ stub GdipEmfToWmfBits
+@ stdcall GdipEmfToWmfBits(ptr long ptr long long)
@ stdcall GdipEndContainer(ptr ptr)
@ stub GdipEnumerateMetafileDestPoint
@ stub GdipEnumerateMetafileDestPointI
Modified: trunk/reactos/dll/win32/gdiplus/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Sun Jun 7 11:59:56 2009
@@ -1116,6 +1116,20 @@
return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile);
}
+GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file,
+ GpMetafile **metafile)
+{
+ FIXME("(%p, %p): stub\n", file, metafile);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream,
+ GpMetafile **metafile)
+{
+ FIXME("(%p, %p): stub\n", stream, metafile);
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename,
UINT access, IStream **stream)
{
@@ -1590,6 +1604,36 @@
return Ok;
}
+GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image,
+ REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight,
+ GpUnit srcUnit)
+{
+ FIXME("(%p, %p, %f, %f, %f, %f, %f, %f, %d): stub\n", graphics, image, x,
y, srcx, srcy, srcwidth, srcheight, srcUnit);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipDrawImagePointRectI(GpGraphics *graphics, GpImage *image,
+ INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight,
+ GpUnit srcUnit)
+{
+ FIXME("(%p, %p, %d, %d, %d, %d, %d, %d, %d): stub\n", graphics, image, x,
y, srcx, srcy, srcwidth, srcheight, srcUnit);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipDrawImagePoints(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPointF *dstpoints, INT count)
+{
+ FIXME("(%p, %p, %p, %d): stub\n", graphics, image, dstpoints, count);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipDrawImagePointsI(GpGraphics *graphics, GpImage *image,
+ GDIPCONST GpPoint *dstpoints, INT count)
+{
+ FIXME("(%p, %p, %p, %d): stub\n", graphics, image, dstpoints, count);
+ return NotImplemented;
+}
+
/* FIXME: partially implemented (only works for rectangular parallelograms) */
GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image,
GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
@@ -2045,7 +2089,7 @@
POINT corners[4];
WCHAR* stringdup;
REAL angle, ang_cos, ang_sin, rel_width, rel_height;
- INT sum = 0, height = 0, fit, fitcpy, save_state, i, j, lret, nwidth,
+ INT sum = 0, height = 0, offsety = 0, fit, fitcpy, save_state, i, j, lret, nwidth,
nheight;
SIZE size;
RECT drawcoord;
@@ -2061,8 +2105,21 @@
return NotImplemented;
}
- if(format)
+ if(format){
TRACE("may be ignoring some format flags: attr %x\n",
format->attr);
+
+ /* Should be no need to explicitly test for StringAlignmentNear as
+ * that is default behavior if no alignment is passed. */
+ if(format->vertalign != StringAlignmentNear){
+ RectF bounds;
+ GdipMeasureString(graphics, string, length, font, rect, format, &bounds,
0, 0);
+
+ if(format->vertalign == StringAlignmentCenter)
+ offsety = (rect->Height - bounds.Height) / 2;
+ else if(format->vertalign == StringAlignmentFar)
+ offsety = (rect->Height - bounds.Height);
+ }
+ }
if(length == -1) length = lstrlenW(string);
@@ -2074,9 +2131,9 @@
SetTextColor(graphics->hdc, brush->lb.lbColor);
rectcpy[3].X = rectcpy[0].X = rect->X;
- rectcpy[1].Y = rectcpy[0].Y = rect->Y;
+ rectcpy[1].Y = rectcpy[0].Y = rect->Y + offsety;
rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width;
- rectcpy[3].Y = rectcpy[2].Y = rect->Y + rect->Height;
+ rectcpy[3].Y = rectcpy[2].Y = rect->Y + offsety + rect->Height;
transform_and_round_points(graphics, corners, rectcpy, 4);
if (roundr(rect->Width) == 0)
@@ -3150,6 +3207,24 @@
*state = 0xdeadbeef;
return Ok;
+}
+
+GpStatus WINGDIPAPI GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF *dstrect,
GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state)
+{
+ FIXME("(%p, %p, %p, %d, %p): stub\n", graphics, dstrect, srcrect, unit,
state);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipBeginContainerI(GpGraphics *graphics, GDIPCONST GpRect *dstrect,
GDIPCONST GpRect *srcrect, GpUnit unit, GraphicsContainer *state)
+{
+ FIXME("(%p, %p, %p, %d, %p): stub\n", graphics, dstrect, srcrect, unit,
state);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipComment(GpGraphics *graphics, UINT sizeData, GDIPCONST BYTE
*data)
+{
+ FIXME("(%p, %d, %p): stub\n", graphics, sizeData, data);
+ return NotImplemented;
}
GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsState state)
Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] Sun Jun 7 11:59:56 2009
@@ -831,6 +831,18 @@
return status;
}
+GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT length,
GDIPCONST GpFontFamily* family, INT style, REAL emSize, GDIPCONST RectF* layoutRect,
GDIPCONST GpStringFormat* format)
+{
+ FIXME("(%p, %p, %d, %p, %d, %f, %p, %p): stub\n", path, string, length,
family, style, emSize, layoutRect, format);
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipAddPathStringI(GpPath* path, GDIPCONST WCHAR* string, INT length,
GDIPCONST GpFontFamily* family, INT style, REAL emSize, GDIPCONST Rect* layoutRect,
GDIPCONST GpStringFormat* format)
+{
+ FIXME("(%p, %p, %d, %p, %d, %f, %p, %p): stub\n", path, string, length,
family, style, emSize, layoutRect, format);
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipClonePath(GpPath* path, GpPath **clone)
{
TRACE("(%p, %p)\n", path, clone);
Modified: trunk/reactos/dll/win32/gdiplus/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Sun Jun 7 11:59:56 2009
@@ -70,6 +70,29 @@
return x;
}
+GpStatus WINGDIPAPI GdipBitmapApplyEffect(GpBitmap* bitmap, CGpEffect* effect,
+ RECT* roi, BOOL useAuxData, VOID** auxData, INT* auxDataSize)
+{
+ FIXME("(%p %p %p %d %p %p): stub\n", bitmap, effect, roi, useAuxData,
auxData, auxDataSize);
+ /*
+ * Note: According to Jose Roca's GDI+ docs, this function is not
+ * implemented in Windows's GDI+.
+ */
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipBitmapCreateApplyEffect(GpBitmap** inputBitmaps,
+ INT numInputs, CGpEffect* effect, RECT* roi, RECT* outputRect,
+ GpBitmap** outputBitmap, BOOL useAuxData, VOID** auxData, INT* auxDataSize)
+{
+ FIXME("(%p %d %p %p %p %p %d %p %p): stub\n", inputBitmaps, numInputs,
effect, roi, outputRect, outputBitmap, useAuxData, auxData, auxDataSize);
+ /*
+ * Note: According to Jose Roca's GDI+ docs, this function is not
+ * implemented in Windows's GDI+.
+ */
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y,
ARGB *color)
{
@@ -271,10 +294,18 @@
return Ok;
}
+GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height,
+ PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap)
+{
+ FIXME("(%f,%f,%f,%f,%i,%p,%p): stub\n", x, y, width, height, format,
srcBitmap, dstBitmap);
+
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT x, INT y, INT width, INT height,
PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap)
{
- FIXME("(%i,%i,%i,%i,%i,%p,%p)\n", x, y, width, height, format, srcBitmap,
dstBitmap);
+ FIXME("(%i,%i,%i,%i,%i,%p,%p): stub\n", x, y, width, height, format,
srcBitmap, dstBitmap);
return NotImplemented;
}
@@ -655,6 +686,13 @@
return Ok;
}
+GpStatus WINGDIPAPI GdipCreateHICONFromBitmap(GpBitmap *bitmap, HICON *hicon)
+{
+ FIXME("(%p, %p)\n", bitmap, hicon);
+
+ return NotImplemented;
+}
+
GpStatus WINGDIPAPI GdipDeleteCachedBitmap(GpCachedBitmap *cachedbmp)
{
TRACE("%p\n", cachedbmp);
@@ -677,6 +715,13 @@
return InvalidParameter;
return GdipDrawImage(graphics, cachedbmp->image, (REAL)x, (REAL)y);
+}
+
+GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16,
+ LPBYTE pData16, INT iMapMode, INT eFlags)
+{
+ FIXME("(%p, %d, %p, %d, %d): stub\n", hemf, cbData16, pData16, iMapMode,
eFlags);
+ return NotImplemented;
}
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
@@ -1586,6 +1631,14 @@
return retval;
}
+GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect)
+{
+ FIXME("(%p): stub\n", effect);
+ /* note: According to Jose Roca's GDI+ Docs, this is not implemented
+ * in Windows's gdiplus */
+ return NotImplemented;
+}
+
/*****************************************************************************
* GdipSetEffectParameters [GDIPLUS.@]
*/