[ros-diffs] [dchapyshev] 33804: - Sync with Wine HEAD

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Sun Jun 1 15:14:02 CEST 2008


Author: dchapyshev
Date: Sun Jun  1 08:14:02 2008
New Revision: 33804

URL: http://svn.reactos.org/svn/reactos?rev=33804&view=rev
Log:
- Sync with Wine HEAD

Modified:
    trunk/reactos/dll/win32/gdiplus/font.c
    trunk/reactos/dll/win32/gdiplus/gdiplus.spec
    trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
    trunk/reactos/dll/win32/gdiplus/graphics.c
    trunk/reactos/dll/win32/gdiplus/graphicspath.c
    trunk/reactos/dll/win32/gdiplus/image.c
    trunk/reactos/dll/win32/gdiplus/matrix.c
    trunk/reactos/dll/win32/gdiplus/pen.c
    trunk/reactos/dll/win32/gdiplus/region.c

Modified: trunk/reactos/dll/win32/gdiplus/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/font.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -68,7 +68,7 @@
     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;

Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.spec?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -25,8 +25,8 @@
 @ 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
@@ -92,7 +92,7 @@
 @ 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
@@ -122,9 +122,9 @@
 @ 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
@@ -148,7 +148,7 @@
 @ stdcall GdipDeletePathIter(ptr)
 @ stdcall GdipDeletePen(ptr)
 @ stub GdipDeletePrivateFontCollection
-@ stub GdipDeleteRegion
+@ stdcall GdipDeleteRegion(ptr)
 @ stdcall GdipDeleteStringFormat(ptr)
 @ stdcall GdipDisposeImage(ptr)
 @ stdcall GdipDisposeImageAttributes(ptr)
@@ -244,7 +244,7 @@
 @ stdcall GdipGetBrushType(ptr ptr)
 @ stub GdipGetCellAscent
 @ stub GdipGetCellDescent
-@ stub GdipGetClip
+@ stdcall GdipGetClip(ptr ptr)
 @ stub GdipGetClipBounds
 @ stub GdipGetClipBoundsI
 @ stdcall GdipGetCompositingMode(ptr ptr)
@@ -255,7 +255,7 @@
 @ stub GdipGetCustomLineCapStrokeJoin
 @ stub GdipGetCustomLineCapType
 @ stub GdipGetCustomLineCapWidthScale
-@ stub GdipGetDC
+@ stdcall GdipGetDC(ptr ptr)
 @ stdcall GdipGetDpiX(ptr ptr)
 @ stdcall GdipGetDpiY(ptr ptr)
 @ stub GdipGetEffectParameterSize
@@ -286,7 +286,7 @@
 @ 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)
@@ -379,7 +379,7 @@
 @ stub GdipGetRegionBoundsI
 @ stub GdipGetRegionData
 @ stub GdipGetRegionDataSize
-@ stub GdipGetRegionHRgn
+@ stdcall GdipGetRegionHRgn(ptr ptr ptr)
 @ stub GdipGetRegionScans
 @ stub GdipGetRegionScansCount
 @ stub GdipGetRegionScansI
@@ -436,7 +436,7 @@
 @ stub GdipIsVisibleRegionRect
 @ stub GdipIsVisibleRegionRectI
 @ stdcall GdipLoadImageFromFile(wstr ptr)
-@ stub GdipLoadImageFromFileICM
+@ stdcall GdipLoadImageFromFileICM(wstr ptr)
 @ stdcall GdipLoadImageFromStream(ptr ptr)
 @ stdcall GdipLoadImageFromStreamICM(ptr ptr)
 @ stub GdipMeasureCharacterRanges
@@ -472,7 +472,7 @@
 @ stub GdipRecordMetafileI
 @ stub GdipRecordMetafileStream
 @ stub GdipRecordMetafileStreamI
-@ stub GdipReleaseDC
+@ stdcall GdipReleaseDC(ptr ptr)
 @ stdcall GdipRemovePropertyItem(ptr long)
 @ stub GdipResetClip
 @ stub GdipResetImageAttributes

Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_private.h?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -149,6 +149,7 @@
 struct GpImage{
     IPicture* picture;
     ImageType type;
+    UINT flags;
 };
 
 struct GpMetafile{

Modified: trunk/reactos/dll/win32/gdiplus/graphics.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -797,6 +797,12 @@
     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)
 {
@@ -932,22 +938,7 @@
 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,
@@ -2436,3 +2427,25 @@
 
     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;
+}

Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphicspath.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -708,3 +708,53 @@
     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);
+}

Modified: trunk/reactos/dll/win32/gdiplus/image.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -384,6 +384,7 @@
     }
 
     (*bitmap)->image.type = ImageTypeBitmap;
+    (*bitmap)->image.flags = ImageFlagsNone;
     (*bitmap)->width = width;
     (*bitmap)->height = height;
     (*bitmap)->format = format;
@@ -724,6 +725,12 @@
     IStream_Release(stream);
 
     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)
@@ -789,6 +796,7 @@
     }
 
     (*image)->picture = pic;
+    (*image)->flags   = ImageFlagsNone;
 
     return Ok;
 }
@@ -1108,3 +1116,13 @@
 
     return NotImplemented;
 }
+
+GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
+{
+    if(!image || !flags)
+        return InvalidParameter;
+
+    *flags = image->flags;
+
+    return Ok;
+}

Modified: trunk/reactos/dll/win32/gdiplus/matrix.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/matrix.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/matrix.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/matrix.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -244,7 +244,7 @@
     REAL x, y;
     INT i;
 
-    if(!matrix || !pts)
+    if(!matrix || !pts || count <= 0)
         return InvalidParameter;
 
     for(i = 0; i < count; i++)
@@ -264,6 +264,9 @@
     GpPointF *ptsF;
     GpStatus ret;
     INT i;
+
+    if(count <= 0)
+        return InvalidParameter;
 
     ptsF = GdipAlloc(sizeof(GpPointF) * count);
     if(!ptsF)
@@ -314,7 +317,7 @@
     REAL x, y;
     INT i;
 
-    if(!matrix || !pts)
+    if(!matrix || !pts || count <= 0)
         return InvalidParameter;
 
     for(i = 0; i < count; i++)
@@ -334,6 +337,9 @@
     GpPointF *ptsF;
     GpStatus ret;
     INT i;
+
+    if(count <= 0)
+        return InvalidParameter;
 
     ptsF = GdipAlloc(sizeof(GpPointF) * count);
     if(!ptsF)

Modified: trunk/reactos/dll/win32/gdiplus/pen.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/pen.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/pen.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/pen.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -251,6 +251,9 @@
     if(!pen || !dash)
         return InvalidParameter;
 
+    if(count <= 0)
+        return OutOfMemory;
+
     for(i = 0; i < count; i++){
         sum += dash[i];
         if(dash[i] < 0.0)

Modified: trunk/reactos/dll/win32/gdiplus/region.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c?rev=33804&r1=33803&r2=33804&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] Sun Jun  1 08:14:02 2008
@@ -30,6 +30,73 @@
 
 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;



More information about the Ros-diffs mailing list