mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
- Synchronize with wine head
svn path=/trunk/; revision=33277
This commit is contained in:
parent
0d8a3eb240
commit
1a6f20f880
9 changed files with 841 additions and 76 deletions
|
@ -131,7 +131,25 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
|
||||
GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint,
|
||||
GDIPCONST GpPoint* endpoint, ARGB startcolor, ARGB endcolor,
|
||||
GpWrapMode wrap, GpLineGradient **line)
|
||||
{
|
||||
GpPointF stF;
|
||||
GpPointF endF;
|
||||
|
||||
if(!startpoint || !endpoint)
|
||||
return InvalidParameter;
|
||||
|
||||
stF.X = (REAL)startpoint->X;
|
||||
stF.Y = (REAL)startpoint->Y;
|
||||
endF.X = (REAL)endpoint->X;
|
||||
endF.X = (REAL)endpoint->Y;
|
||||
|
||||
return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
|
||||
ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
|
||||
GpLineGradient **line)
|
||||
{
|
||||
|
@ -140,14 +158,28 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
|
|||
if(!line || !rect)
|
||||
return InvalidParameter;
|
||||
|
||||
start.X = (REAL) rect->X;
|
||||
start.Y = (REAL) rect->Y;
|
||||
end.X = (REAL) (rect->X + rect->Width);
|
||||
end.Y = (REAL) (rect->Y + rect->Height);
|
||||
start.X = rect->X;
|
||||
start.Y = rect->Y;
|
||||
end.X = rect->X + rect->Width;
|
||||
end.Y = rect->Y + rect->Height;
|
||||
|
||||
return GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
|
||||
ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
|
||||
GpLineGradient **line)
|
||||
{
|
||||
GpRectF rectF;
|
||||
|
||||
rectF.X = (REAL) rect->X;
|
||||
rectF.Y = (REAL) rect->Y;
|
||||
rectF.Width = (REAL) rect->Width;
|
||||
rectF.Height = (REAL) rect->Height;
|
||||
|
||||
return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, wrap, line);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
|
||||
INT count, GpWrapMode wrap, GpPathGradient **grad)
|
||||
{
|
||||
|
@ -193,6 +225,34 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points,
|
||||
INT count, GpWrapMode wrap, GpPathGradient **grad)
|
||||
{
|
||||
GpPointF *pointsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!points || !grad)
|
||||
return InvalidParameter;
|
||||
|
||||
if(count <= 0)
|
||||
return OutOfMemory;
|
||||
|
||||
pointsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||
if(!pointsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
pointsF[i].X = (REAL)points[i].X;
|
||||
pointsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipCreatePathGradient(pointsF, count, wrap, grad);
|
||||
GdipFree(pointsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
|
||||
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
|
||||
GpPathGradient **grad)
|
||||
|
@ -428,6 +488,25 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient *grad,
|
||||
GpPoint *point)
|
||||
{
|
||||
GpStatus ret;
|
||||
GpPointF ptf;
|
||||
|
||||
if(!point)
|
||||
return InvalidParameter;
|
||||
|
||||
ret = GdipGetPathGradientCenterPoint(grad,&ptf);
|
||||
|
||||
if(ret == Ok){
|
||||
point->X = roundr(ptf.X);
|
||||
point->Y = roundr(ptf.Y);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad,
|
||||
REAL *x, REAL *y)
|
||||
{
|
||||
|
@ -563,6 +642,20 @@ GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI(GpPathGradient *grad,
|
||||
GpPoint *point)
|
||||
{
|
||||
GpPointF ptf;
|
||||
|
||||
if(!point)
|
||||
return InvalidParameter;
|
||||
|
||||
ptf.X = (REAL)point->X;
|
||||
ptf.Y = (REAL)point->Y;
|
||||
|
||||
return GdipSetPathGradientCenterPoint(grad,&ptf);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient *grad,
|
||||
REAL x, REAL y)
|
||||
{
|
||||
|
@ -657,12 +750,24 @@ GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture,
|
|||
GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
|
||||
ARGB color2)
|
||||
{
|
||||
static int calls;
|
||||
if(!brush)
|
||||
return InvalidParameter;
|
||||
|
||||
if(!(calls++))
|
||||
FIXME("not implemented\n");
|
||||
brush->startcolor = color1;
|
||||
brush->endcolor = color2;
|
||||
|
||||
return NotImplemented;
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
|
||||
{
|
||||
if(!brush || !colors)
|
||||
return InvalidParameter;
|
||||
|
||||
colors[0] = brush->startcolor;
|
||||
colors[1] = brush->endcolor;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus,
|
||||
|
@ -697,3 +802,34 @@ GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush,
|
|||
|
||||
return NotImplemented;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
|
||||
{
|
||||
if(!brush || !rect)
|
||||
return InvalidParameter;
|
||||
|
||||
rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X);
|
||||
rect->Y = (brush->startpoint.Y < brush->endpoint.Y ? brush->startpoint.Y: brush->endpoint.Y);
|
||||
|
||||
rect->Width = fabs(brush->startpoint.X - brush->endpoint.X);
|
||||
rect->Height = fabs(brush->startpoint.Y - brush->endpoint.Y);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient *brush, GpRect *rect)
|
||||
{
|
||||
GpRectF rectF;
|
||||
GpStatus ret;
|
||||
|
||||
ret = GdipGetLineRect(brush, &rectF);
|
||||
|
||||
if(ret == Ok){
|
||||
rect->X = roundr(rectF.X);
|
||||
rect->Y = roundr(rectF.Y);
|
||||
rect->Width = roundr(rectF.Width);
|
||||
rect->Height = roundr(rectF.Height);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -184,3 +184,13 @@ GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale(GpCustomLineCap* custom,
|
|||
|
||||
return NotImplemented;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap(GpCustomLineCap *customCap, GpLineCap *baseCap)
|
||||
{
|
||||
if(!customCap || !baseCap)
|
||||
return InvalidParameter;
|
||||
|
||||
*baseCap = customCap->cap;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
|
|
@ -88,6 +88,24 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont* font)
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
|
||||
{
|
||||
HFONT hfont;
|
||||
LOGFONTW lfw;
|
||||
|
||||
if(!font)
|
||||
return InvalidParameter;
|
||||
|
||||
hfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);
|
||||
if(!hfont)
|
||||
return GenericError;
|
||||
|
||||
if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
|
||||
return GenericError;
|
||||
|
||||
return GdipCreateFontFromLogfontW(hdc, &lfw, font);
|
||||
}
|
||||
|
||||
/* FIXME: use graphics */
|
||||
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
|
||||
LOGFONTW *lfw)
|
||||
|
@ -99,3 +117,16 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
|
|||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCloneFont(GpFont *font, GpFont **cloneFont)
|
||||
{
|
||||
if(!font || !cloneFont)
|
||||
return InvalidParameter;
|
||||
|
||||
*cloneFont = GdipAlloc(sizeof(GpFont));
|
||||
if(!*cloneFont) return OutOfMemory;
|
||||
|
||||
**cloneFont = *font;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
@ stdcall GdipAddPathArc(ptr long long long long long long)
|
||||
@ stub GdipAddPathArcI
|
||||
@ stub GdipAddPathBezier
|
||||
@ stdcall GdipAddPathArcI(ptr long long long long long long)
|
||||
@ stdcall GdipAddPathBezier(ptr long long long long long long long long)
|
||||
@ stdcall GdipAddPathBezierI(ptr long long long long long long long long)
|
||||
@ stdcall GdipAddPathBeziers(ptr ptr long)
|
||||
@ stub GdipAddPathBeziersI
|
||||
@ stdcall GdipAddPathBeziersI(ptr ptr long)
|
||||
@ stub GdipAddPathClosedCurve2
|
||||
@ stub GdipAddPathClosedCurve2I
|
||||
@ stub GdipAddPathClosedCurve
|
||||
|
@ -15,10 +15,10 @@
|
|||
@ stub GdipAddPathCurve
|
||||
@ stub GdipAddPathCurveI
|
||||
@ stdcall GdipAddPathEllipse(ptr long long long long)
|
||||
@ stub GdipAddPathEllipseI
|
||||
@ stdcall GdipAddPathEllipseI(ptr long long long long)
|
||||
@ stdcall GdipAddPathLine2(ptr ptr long)
|
||||
@ stub GdipAddPathLine2I
|
||||
@ stub GdipAddPathLine
|
||||
@ stdcall GdipAddPathLine2I(ptr ptr long)
|
||||
@ stdcall GdipAddPathLine(ptr long long long long)
|
||||
@ stdcall GdipAddPathLineI(ptr long long long long)
|
||||
@ stdcall GdipAddPathPath(ptr ptr long)
|
||||
@ stub GdipAddPathPie
|
||||
|
@ -50,7 +50,7 @@
|
|||
@ stub GdipCloneBitmapAreaI
|
||||
@ stdcall GdipCloneBrush(ptr ptr)
|
||||
@ stdcall GdipCloneCustomLineCap(ptr ptr)
|
||||
@ stub GdipCloneFont
|
||||
@ stdcall GdipCloneFont(ptr ptr)
|
||||
@ stub GdipCloneFontFamily
|
||||
@ stub GdipCloneImage
|
||||
@ stub GdipCloneImageAttributes
|
||||
|
@ -58,7 +58,7 @@
|
|||
@ stdcall GdipClonePath(ptr ptr)
|
||||
@ stdcall GdipClonePen(ptr ptr)
|
||||
@ stub GdipCloneRegion
|
||||
@ stub GdipCloneStringFormat
|
||||
@ stdcall GdipCloneStringFormat(ptr ptr)
|
||||
@ stdcall GdipClosePathFigure(ptr)
|
||||
@ stdcall GdipClosePathFigures(ptr)
|
||||
@ stub GdipCombineRegionPath
|
||||
|
@ -86,9 +86,9 @@
|
|||
@ stub GdipCreateEffect
|
||||
@ stub GdipCreateFont
|
||||
@ stub GdipCreateFontFamilyFromName
|
||||
@ stub GdipCreateFontFromDC
|
||||
@ stdcall GdipCreateFontFromLogfontA(ptr ptr ptr)
|
||||
@ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr)
|
||||
@ stdcall GdipCreateFontFromDC(long ptr)
|
||||
@ stdcall GdipCreateFontFromLogfontA(long ptr ptr)
|
||||
@ stdcall GdipCreateFontFromLogfontW(long ptr ptr)
|
||||
@ stdcall GdipCreateFromHDC2(long long ptr)
|
||||
@ stdcall GdipCreateFromHDC(long ptr)
|
||||
@ stdcall GdipCreateFromHWND(long ptr)
|
||||
|
@ -99,14 +99,14 @@
|
|||
@ stub GdipCreateHatchBrush
|
||||
@ stdcall GdipCreateImageAttributes(ptr)
|
||||
@ stdcall GdipCreateLineBrush(ptr ptr long long long ptr)
|
||||
@ stub GdipCreateLineBrushFromRect
|
||||
@ stdcall GdipCreateLineBrushFromRect(ptr long long long long ptr)
|
||||
@ stdcall GdipCreateLineBrushFromRectI(ptr long long long long ptr)
|
||||
@ stub GdipCreateLineBrushFromRectWithAngle
|
||||
@ stub GdipCreateLineBrushFromRectWithAngleI
|
||||
@ stub GdipCreateLineBrushI
|
||||
@ stdcall GdipCreateLineBrushI(ptr ptr long long long ptr)
|
||||
@ stdcall GdipCreateMatrix2(long long long long long long ptr)
|
||||
@ stdcall GdipCreateMatrix3(ptr ptr ptr)
|
||||
@ stub GdipCreateMatrix3I
|
||||
@ stdcall GdipCreateMatrix3I(ptr ptr ptr)
|
||||
@ stdcall GdipCreateMatrix(ptr)
|
||||
@ stdcall GdipCreateMetafileFromEmf(ptr long ptr)
|
||||
@ stub GdipCreateMetafileFromFile
|
||||
|
@ -114,11 +114,11 @@
|
|||
@ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
|
||||
@ stub GdipCreateMetafileFromWmfFile
|
||||
@ stdcall GdipCreatePath2(ptr ptr long long ptr)
|
||||
@ stub GdipCreatePath2I
|
||||
@ stdcall GdipCreatePath2I(ptr ptr long long ptr)
|
||||
@ stdcall GdipCreatePath(long ptr)
|
||||
@ stdcall GdipCreatePathGradient(ptr long long ptr)
|
||||
@ stdcall GdipCreatePathGradientFromPath(ptr ptr)
|
||||
@ stub GdipCreatePathGradientI
|
||||
@ stdcall GdipCreatePathGradientI(ptr long long ptr)
|
||||
@ stdcall GdipCreatePathIter(ptr ptr)
|
||||
@ stdcall GdipCreatePen1(long long long ptr)
|
||||
@ stdcall GdipCreatePen2(ptr long long ptr)
|
||||
|
@ -164,15 +164,15 @@
|
|||
@ stub GdipDrawClosedCurve
|
||||
@ stub GdipDrawClosedCurveI
|
||||
@ stdcall GdipDrawCurve2(ptr ptr ptr long long)
|
||||
@ stub GdipDrawCurve2I
|
||||
@ stdcall GdipDrawCurve2I(ptr ptr ptr long long)
|
||||
@ stub GdipDrawCurve3
|
||||
@ stub GdipDrawCurve3I
|
||||
@ stub GdipDrawCurve
|
||||
@ stub GdipDrawCurveI
|
||||
@ stdcall GdipDrawCurve(ptr ptr ptr long)
|
||||
@ stdcall GdipDrawCurveI(ptr ptr ptr long)
|
||||
@ stub GdipDrawDriverString
|
||||
@ stub GdipDrawEllipse
|
||||
@ stub GdipDrawEllipseI
|
||||
@ stub GdipDrawImage
|
||||
@ stdcall GdipDrawImage(ptr ptr long long)
|
||||
@ stub GdipDrawImageFX
|
||||
@ stdcall GdipDrawImageI(ptr ptr long long)
|
||||
@ stub GdipDrawImagePointRect
|
||||
|
@ -180,9 +180,9 @@
|
|||
@ stub GdipDrawImagePoints
|
||||
@ stub GdipDrawImagePointsI
|
||||
@ stdcall GdipDrawImagePointsRect(ptr ptr ptr long long long long long long ptr ptr ptr)
|
||||
@ stub GdipDrawImagePointsRectI
|
||||
@ stub GdipDrawImageRect
|
||||
@ stub GdipDrawImageRectI
|
||||
@ stdcall GdipDrawImagePointsRectI(ptr ptr ptr long long long long long long ptr ptr ptr)
|
||||
@ stdcall GdipDrawImageRect(ptr ptr long long long long)
|
||||
@ stdcall GdipDrawImageRectI(ptr ptr long long long long)
|
||||
@ stdcall GdipDrawImageRectRect(ptr ptr long long long long long long long long long ptr long ptr)
|
||||
@ stdcall GdipDrawImageRectRectI(ptr ptr long long long long long long long long long ptr long ptr)
|
||||
@ stdcall GdipDrawLine(ptr ptr long long long long)
|
||||
|
@ -191,13 +191,13 @@
|
|||
@ stdcall GdipDrawLinesI(ptr ptr ptr long)
|
||||
@ stdcall GdipDrawPath(ptr ptr ptr)
|
||||
@ stdcall GdipDrawPie(ptr ptr long long long long long long)
|
||||
@ stub GdipDrawPieI
|
||||
@ stub GdipDrawPolygon
|
||||
@ stub GdipDrawPolygonI
|
||||
@ stub GdipDrawRectangle
|
||||
@ stdcall GdipDrawPieI(ptr ptr long long long long long long)
|
||||
@ stdcall GdipDrawPolygon(ptr ptr ptr long)
|
||||
@ stdcall GdipDrawPolygonI(ptr ptr ptr long)
|
||||
@ stdcall GdipDrawRectangle(ptr ptr long long long long)
|
||||
@ stdcall GdipDrawRectangleI(ptr ptr long long long long)
|
||||
@ stdcall GdipDrawRectangles(ptr ptr ptr long)
|
||||
@ stub GdipDrawRectanglesI
|
||||
@ stdcall GdipDrawRectanglesI(ptr ptr ptr long)
|
||||
@ stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr)
|
||||
@ stub GdipEmfToWmfBits
|
||||
@ stub GdipEndContainer
|
||||
|
@ -217,19 +217,19 @@
|
|||
@ stub GdipFillClosedCurve2I
|
||||
@ stub GdipFillClosedCurve
|
||||
@ stub GdipFillClosedCurveI
|
||||
@ stub GdipFillEllipse
|
||||
@ stub GdipFillEllipseI
|
||||
@ stdcall GdipFillEllipse(ptr ptr long long long long)
|
||||
@ stdcall GdipFillEllipseI(ptr ptr long long long long)
|
||||
@ stdcall GdipFillPath(ptr ptr ptr)
|
||||
@ stdcall GdipFillPie(ptr ptr long long long long long long)
|
||||
@ stub GdipFillPieI
|
||||
@ stdcall GdipFillPieI(ptr ptr long long long long long long)
|
||||
@ stub GdipFillPolygon2
|
||||
@ stub GdipFillPolygon2I
|
||||
@ stdcall GdipFillPolygon(ptr ptr ptr long long)
|
||||
@ stdcall GdipFillPolygonI(ptr ptr ptr long long)
|
||||
@ stdcall GdipFillRectangle(ptr ptr long long long long)
|
||||
@ stdcall GdipFillRectangleI(ptr ptr long long long long)
|
||||
@ stub GdipFillRectangles
|
||||
@ stub GdipFillRectanglesI
|
||||
@ stdcall GdipFillRectangles(ptr ptr ptr long)
|
||||
@ stdcall GdipFillRectanglesI(ptr ptr ptr long)
|
||||
@ stub GdipFillRegion
|
||||
@ stdcall GdipFindFirstImageItem(ptr ptr)
|
||||
@ stub GdipFindNextImageItem
|
||||
|
@ -249,15 +249,15 @@
|
|||
@ stub GdipGetClipBoundsI
|
||||
@ stdcall GdipGetCompositingMode(ptr ptr)
|
||||
@ stdcall GdipGetCompositingQuality(ptr ptr)
|
||||
@ stub GdipGetCustomLineCapBaseCap
|
||||
@ stdcall GdipGetCustomLineCapBaseCap(ptr ptr)
|
||||
@ stdcall GdipGetCustomLineCapBaseInset(ptr ptr)
|
||||
@ stub GdipGetCustomLineCapStrokeCaps
|
||||
@ stub GdipGetCustomLineCapStrokeJoin
|
||||
@ stub GdipGetCustomLineCapType
|
||||
@ stub GdipGetCustomLineCapWidthScale
|
||||
@ stub GdipGetDC
|
||||
@ stub GdipGetDpiX
|
||||
@ stub GdipGetDpiY
|
||||
@ stdcall GdipGetDpiX(ptr ptr)
|
||||
@ stdcall GdipGetDpiY(ptr ptr)
|
||||
@ stub GdipGetEffectParameterSize
|
||||
@ stub GdipGetEffectParameters
|
||||
@ stub GdipGetEmHeight
|
||||
|
@ -302,12 +302,12 @@
|
|||
@ stdcall GdipGetInterpolationMode(ptr ptr)
|
||||
@ stub GdipGetLineBlend
|
||||
@ stub GdipGetLineBlendCount
|
||||
@ stub GdipGetLineColors
|
||||
@ stdcall GdipGetLineColors(ptr ptr)
|
||||
@ stdcall GdipGetLineGammaCorrection(ptr ptr)
|
||||
@ stub GdipGetLinePresetBlend
|
||||
@ stub GdipGetLinePresetBlendCount
|
||||
@ stub GdipGetLineRect
|
||||
@ stub GdipGetLineRectI
|
||||
@ stdcall GdipGetLineRect(ptr ptr)
|
||||
@ stdcall GdipGetLineRectI(ptr ptr)
|
||||
@ stub GdipGetLineSpacing
|
||||
@ stub GdipGetLineTransform
|
||||
@ stub GdipGetLineWrapMode
|
||||
|
@ -329,7 +329,7 @@
|
|||
@ stub GdipGetPathGradientBlendCount
|
||||
@ stub GdipGetPathGradientCenterColor
|
||||
@ stdcall GdipGetPathGradientCenterPoint(ptr ptr)
|
||||
@ stub GdipGetPathGradientCenterPointI
|
||||
@ stdcall GdipGetPathGradientCenterPointI(ptr ptr)
|
||||
@ stdcall GdipGetPathGradientFocusScales(ptr ptr ptr)
|
||||
@ stdcall GdipGetPathGradientGammaCorrection(ptr ptr)
|
||||
@ stub GdipGetPathGradientPath
|
||||
|
@ -344,10 +344,10 @@
|
|||
@ stub GdipGetPathGradientWrapMode
|
||||
@ stub GdipGetPathLastPoint
|
||||
@ stdcall GdipGetPathPoints(ptr ptr long)
|
||||
@ stub GdipGetPathPointsI
|
||||
@ stdcall GdipGetPathPointsI(ptr ptr long)
|
||||
@ stdcall GdipGetPathTypes(ptr ptr long)
|
||||
@ stdcall GdipGetPathWorldBounds(ptr ptr ptr ptr)
|
||||
@ stub GdipGetPathWorldBoundsI
|
||||
@ stdcall GdipGetPathWorldBoundsI(ptr ptr ptr ptr)
|
||||
@ stdcall GdipGetPenBrushFill(ptr ptr)
|
||||
@ stdcall GdipGetPenColor(ptr ptr)
|
||||
@ stub GdipGetPenCompoundArray
|
||||
|
@ -418,8 +418,8 @@
|
|||
@ stub GdipIsEmptyRegion
|
||||
@ stub GdipIsEqualRegion
|
||||
@ stub GdipIsInfiniteRegion
|
||||
@ stub GdipIsMatrixEqual
|
||||
@ stub GdipIsMatrixIdentity
|
||||
@ stdcall GdipIsMatrixEqual(ptr ptr ptr)
|
||||
@ stdcall GdipIsMatrixIdentity(ptr ptr)
|
||||
@ stub GdipIsMatrixInvertible
|
||||
@ stub GdipIsOutlineVisiblePathPoint
|
||||
@ stdcall GdipIsOutlineVisiblePathPointI(ptr long long ptr ptr ptr)
|
||||
|
@ -447,7 +447,7 @@
|
|||
@ stub GdipMultiplyPathGradientTransform
|
||||
@ stub GdipMultiplyPenTransform
|
||||
@ stub GdipMultiplyTextureTransform
|
||||
@ stub GdipMultiplyWorldTransform
|
||||
@ stdcall GdipMultiplyWorldTransform(ptr ptr long)
|
||||
@ stub GdipNewInstalledFontCollection
|
||||
@ stub GdipNewPrivateFontCollection
|
||||
@ stdcall GdipPathIterCopyData(ptr ptr ptr ptr long long)
|
||||
|
@ -551,7 +551,7 @@
|
|||
@ stub GdipSetPathGradientBlend
|
||||
@ stdcall GdipSetPathGradientCenterColor(ptr long)
|
||||
@ stdcall GdipSetPathGradientCenterPoint(ptr ptr)
|
||||
@ stub GdipSetPathGradientCenterPointI
|
||||
@ stdcall GdipSetPathGradientCenterPointI(ptr ptr)
|
||||
@ stdcall GdipSetPathGradientFocusScales(ptr long long)
|
||||
@ stdcall GdipSetPathGradientGammaCorrection(ptr long)
|
||||
@ stub GdipSetPathGradientLinearBlend
|
||||
|
@ -604,7 +604,7 @@
|
|||
@ stub GdipStringFormatGetGenericTypographic
|
||||
@ stub GdipTestControl
|
||||
@ stdcall GdipTransformMatrixPoints(ptr ptr long)
|
||||
@ stub GdipTransformMatrixPointsI
|
||||
@ stdcall GdipTransformMatrixPointsI(ptr ptr long)
|
||||
@ stdcall GdipTransformPath(ptr ptr)
|
||||
@ stub GdipTransformPoints
|
||||
@ stub GdipTransformPointsI
|
||||
|
@ -619,8 +619,8 @@
|
|||
@ stub GdipTranslateRegionI
|
||||
@ stub GdipTranslateTextureTransform
|
||||
@ stdcall GdipTranslateWorldTransform(ptr long long long)
|
||||
@ stub GdipVectorTransformMatrixPoints
|
||||
@ stub GdipVectorTransformMatrixPointsI
|
||||
@ stdcall GdipVectorTransformMatrixPoints(ptr ptr long)
|
||||
@ stdcall GdipVectorTransformMatrixPointsI(ptr ptr long)
|
||||
@ stub GdipWarpPath
|
||||
@ stub GdipWidenPath
|
||||
@ stub GdipWindingModeOutline
|
||||
|
|
|
@ -1006,6 +1006,37 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1,
|
|||
return retval;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpPointF *points, INT count)
|
||||
{
|
||||
return GdipDrawCurve2(graphics,pen,points,count,1.0);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpPoint *points, INT count)
|
||||
{
|
||||
GpPointF *pointsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!points || count <= 0)
|
||||
return InvalidParameter;
|
||||
|
||||
pointsF = GdipAlloc(sizeof(GpPointF)*count);
|
||||
if(!pointsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
pointsF[i].X = (REAL)points[i].X;
|
||||
pointsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipDrawCurve(graphics,pen,pointsF,count);
|
||||
GdipFree(pointsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Approximates cardinal spline with Bezier curves. */
|
||||
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpPointF *points, INT count, REAL tension)
|
||||
|
@ -1059,6 +1090,37 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
|
|||
return retval;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpPoint *points, INT count, REAL tension)
|
||||
{
|
||||
GpPointF *pointsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!points || count <= 0)
|
||||
return InvalidParameter;
|
||||
|
||||
pointsF = GdipAlloc(sizeof(GpPointF)*count);
|
||||
if(!pointsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
pointsF[i].X = (REAL)points[i].X;
|
||||
pointsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension);
|
||||
GdipFree(pointsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y)
|
||||
{
|
||||
/* IPicture::Render uses LONG coords */
|
||||
return GdipDrawImageI(graphics,image,roundr(x),roundr(y));
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x,
|
||||
INT y)
|
||||
{
|
||||
|
@ -1100,7 +1162,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
|||
srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
|
||||
callbackData);
|
||||
|
||||
if(!graphics || !image || !points || !imageAttributes || count != 3)
|
||||
if(!graphics || !image || !points || count != 3)
|
||||
return InvalidParameter;
|
||||
|
||||
if(srcUnit == UnitInch)
|
||||
|
@ -1139,6 +1201,27 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImagePointsRectI(GpGraphics *graphics, GpImage *image,
|
||||
GDIPCONST GpPoint *points, INT count, INT srcx, INT srcy, INT srcwidth,
|
||||
INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
|
||||
DrawImageAbort callback, VOID * callbackData)
|
||||
{
|
||||
GpPointF pointsF[3];
|
||||
INT i;
|
||||
|
||||
if(!points || count!=3)
|
||||
return InvalidParameter;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
pointsF[i].X = (REAL)points[i].X;
|
||||
pointsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
return GdipDrawImagePointsRect(graphics, image, pointsF, count, (REAL)srcx, (REAL)srcy,
|
||||
(REAL)srcwidth, (REAL)srcheight, srcUnit, imageAttributes,
|
||||
callback, callbackData);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image,
|
||||
REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy,
|
||||
REAL srcwidth, REAL srcheight, GpUnit srcUnit,
|
||||
|
@ -1177,6 +1260,31 @@ GpStatus WINGDIPAPI GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image,
|
|||
srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImageRect(GpGraphics *graphics, GpImage *image,
|
||||
REAL x, REAL y, REAL width, REAL height)
|
||||
{
|
||||
RectF bounds;
|
||||
GpUnit unit;
|
||||
GpStatus ret;
|
||||
|
||||
if(!graphics || !image)
|
||||
return InvalidParameter;
|
||||
|
||||
ret = GdipGetImageBounds(image, &bounds, &unit);
|
||||
if(ret != Ok)
|
||||
return ret;
|
||||
|
||||
return GdipDrawImageRectRect(graphics, image, x, y, width, height,
|
||||
bounds.X, bounds.Y, bounds.Width, bounds.Height,
|
||||
unit, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawImageRectI(GpGraphics *graphics, GpImage *image,
|
||||
INT x, INT y, INT width, INT height)
|
||||
{
|
||||
return GdipDrawImageRect(graphics, image, (REAL)x, (REAL)y, (REAL)width, (REAL)height);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1,
|
||||
REAL y1, REAL x2, REAL y2)
|
||||
{
|
||||
|
@ -1308,8 +1416,14 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||
INT y, INT width, INT height)
|
||||
GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||
INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
|
||||
{
|
||||
return GdipDrawPie(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x,
|
||||
REAL y, REAL width, REAL height)
|
||||
{
|
||||
INT save_state;
|
||||
GpPointF ptf[4];
|
||||
|
@ -1338,6 +1452,12 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
|
||||
INT y, INT width, INT height)
|
||||
{
|
||||
return GdipDrawRectangle(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpRectF* rects, INT count)
|
||||
{
|
||||
|
@ -1380,6 +1500,33 @@ GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen,
|
||||
GDIPCONST GpRect* rects, INT count)
|
||||
{
|
||||
GpRectF *rectsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!rects || count<=0)
|
||||
return InvalidParameter;
|
||||
|
||||
rectsF = GdipAlloc(sizeof(GpRectF) * count);
|
||||
if(!rectsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0;i < count;i++){
|
||||
rectsF[i].X = (REAL)rects[i].X;
|
||||
rectsF[i].Y = (REAL)rects[i].Y;
|
||||
rectsF[i].Width = (REAL)rects[i].Width;
|
||||
rectsF[i].Height = (REAL)rects[i].Height;
|
||||
}
|
||||
|
||||
ret = GdipDrawRectangles(graphics, pen, rectsF, count);
|
||||
GdipFree(rectsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string,
|
||||
INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect,
|
||||
GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush)
|
||||
|
@ -1535,6 +1682,41 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x,
|
||||
REAL y, REAL width, REAL height)
|
||||
{
|
||||
INT save_state;
|
||||
GpPointF ptf[2];
|
||||
POINT pti[2];
|
||||
|
||||
if(!graphics || !brush)
|
||||
return InvalidParameter;
|
||||
|
||||
ptf[0].X = x;
|
||||
ptf[0].Y = y;
|
||||
ptf[1].X = x + width;
|
||||
ptf[1].Y = y + height;
|
||||
|
||||
save_state = SaveDC(graphics->hdc);
|
||||
EndPath(graphics->hdc);
|
||||
SelectObject(graphics->hdc, brush->gdibrush);
|
||||
SelectObject(graphics->hdc, GetStockObject(NULL_PEN));
|
||||
|
||||
transform_and_round_points(graphics, pti, ptf, 2);
|
||||
|
||||
Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
|
||||
|
||||
RestoreDC(graphics->hdc, save_state);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x,
|
||||
INT y, INT width, INT height)
|
||||
{
|
||||
return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
|
||||
{
|
||||
INT save_state;
|
||||
|
@ -1587,6 +1769,12 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x,
|
||||
INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
|
||||
{
|
||||
return GdipFillPie(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush,
|
||||
GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
|
||||
{
|
||||
|
@ -1734,6 +1922,50 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects,
|
||||
INT count)
|
||||
{
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!rects)
|
||||
return InvalidParameter;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
ret = GdipFillRectangle(graphics, brush, rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height);
|
||||
if(ret != Ok) return ret;
|
||||
}
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipFillRectanglesI(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRect *rects,
|
||||
INT count)
|
||||
{
|
||||
GpRectF *rectsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!rects || count <= 0)
|
||||
return InvalidParameter;
|
||||
|
||||
rectsF = GdipAlloc(sizeof(GpRectF)*count);
|
||||
if(!rectsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
rectsF[i].X = (REAL)rects[i].X;
|
||||
rectsF[i].Y = (REAL)rects[i].Y;
|
||||
rectsF[i].X = (REAL)rects[i].Width;
|
||||
rectsF[i].Height = (REAL)rects[i].Height;
|
||||
}
|
||||
|
||||
ret = GdipFillRectangles(graphics,brush,rectsF,count);
|
||||
GdipFree(rectsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* FIXME: Compositing mode is not used anywhere except the getter/setter. */
|
||||
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics,
|
||||
CompositingMode *mode)
|
||||
|
@ -2122,3 +2354,85 @@ GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpGraphics *graph
|
|||
|
||||
return NotImplemented;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points,
|
||||
INT count)
|
||||
{
|
||||
INT save_state;
|
||||
POINT *pti;
|
||||
|
||||
if(!graphics || !pen || count<=0)
|
||||
return InvalidParameter;
|
||||
|
||||
pti = GdipAlloc(sizeof(POINT) * count);
|
||||
|
||||
save_state = prepare_dc(graphics, pen);
|
||||
SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH));
|
||||
|
||||
transform_and_round_points(graphics, pti, (GpPointF*)points, count);
|
||||
Polygon(graphics->hdc, pti, count);
|
||||
|
||||
restore_dc(graphics, save_state);
|
||||
GdipFree(pti);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDrawPolygonI(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPoint *points,
|
||||
INT count)
|
||||
{
|
||||
GpStatus ret;
|
||||
GpPointF *ptf;
|
||||
INT i;
|
||||
|
||||
if(count<=0) return InvalidParameter;
|
||||
ptf = GdipAlloc(sizeof(GpPointF) * count);
|
||||
|
||||
for(i = 0;i < count; i++){
|
||||
ptf[i].X = (REAL)points[i].X;
|
||||
ptf[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipDrawPolygon(graphics,pen,ptf,count);
|
||||
GdipFree(ptf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi)
|
||||
{
|
||||
if(!graphics || !dpi)
|
||||
return InvalidParameter;
|
||||
|
||||
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi)
|
||||
{
|
||||
if(!graphics || !dpi)
|
||||
return InvalidParameter;
|
||||
|
||||
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipMultiplyWorldTransform(GpGraphics *graphics, GDIPCONST GpMatrix *matrix,
|
||||
GpMatrixOrder order)
|
||||
{
|
||||
GpMatrix m;
|
||||
GpStatus ret;
|
||||
|
||||
if(!graphics || !matrix)
|
||||
return InvalidParameter;
|
||||
|
||||
m = *(graphics->worldtrans);
|
||||
|
||||
ret = GdipMultiplyMatrix(&m, (GpMatrix*)matrix, order);
|
||||
if(ret == Ok)
|
||||
*(graphics->worldtrans) = m;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -97,8 +97,14 @@ GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
||||
INT y2, INT x3, INT y3, INT x4, INT y4)
|
||||
GpStatus WINGDIPAPI GdipAddPathArcI(GpPath *path, INT x1, INT y1, INT x2,
|
||||
INT y2, REAL startAngle, REAL sweepAngle)
|
||||
{
|
||||
return GdipAddPathArc(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,startAngle,sweepAngle);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2,
|
||||
REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
|
||||
{
|
||||
INT old_count;
|
||||
|
||||
|
@ -110,14 +116,14 @@ GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
|||
|
||||
old_count = path->pathdata.Count;
|
||||
|
||||
path->pathdata.Points[old_count].X = (REAL) x1;
|
||||
path->pathdata.Points[old_count].Y = (REAL) y1;
|
||||
path->pathdata.Points[old_count + 1].X = (REAL) x2;
|
||||
path->pathdata.Points[old_count + 1].Y = (REAL) y2;
|
||||
path->pathdata.Points[old_count + 2].X = (REAL) x3;
|
||||
path->pathdata.Points[old_count + 2].Y = (REAL) y3;
|
||||
path->pathdata.Points[old_count + 3].X = (REAL) x4;
|
||||
path->pathdata.Points[old_count + 3].Y = (REAL) y4;
|
||||
path->pathdata.Points[old_count].X = x1;
|
||||
path->pathdata.Points[old_count].Y = y1;
|
||||
path->pathdata.Points[old_count + 1].X = x2;
|
||||
path->pathdata.Points[old_count + 1].Y = y2;
|
||||
path->pathdata.Points[old_count + 2].X = x3;
|
||||
path->pathdata.Points[old_count + 2].Y = y3;
|
||||
path->pathdata.Points[old_count + 3].X = x4;
|
||||
path->pathdata.Points[old_count + 3].Y = y4;
|
||||
|
||||
path->pathdata.Types[old_count] =
|
||||
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
||||
|
@ -131,6 +137,13 @@ GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath *path, INT x1, INT y1, INT x2,
|
||||
INT y2, INT x3, INT y3, INT x4, INT y4)
|
||||
{
|
||||
return GdipAddPathBezier(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,(REAL)x3,(REAL)y3,
|
||||
(REAL)x4,(REAL)y4);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
|
||||
INT count)
|
||||
{
|
||||
|
@ -158,6 +171,31 @@ GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points,
|
||||
INT count)
|
||||
{
|
||||
GpPointF *ptsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
if(!points || ((count - 1) % 3))
|
||||
return InvalidParameter;
|
||||
|
||||
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||
if(!ptsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
ptsF[i].X = (REAL)points[i].X;
|
||||
ptsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipAddPathBeziers(path, ptsF, count);
|
||||
GdipFree(ptsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
|
||||
REAL height)
|
||||
{
|
||||
|
@ -188,6 +226,12 @@ GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath *path, INT x, INT y, INT width,
|
||||
INT height)
|
||||
{
|
||||
return GdipAddPathEllipse(path,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
|
||||
INT count)
|
||||
{
|
||||
|
@ -217,7 +261,31 @@ GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2)
|
||||
GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
|
||||
{
|
||||
GpPointF *pointsF;
|
||||
INT i;
|
||||
GpStatus stat;
|
||||
|
||||
if(count <= 0)
|
||||
return InvalidParameter;
|
||||
|
||||
pointsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||
if(!pointsF) return OutOfMemory;
|
||||
|
||||
for(i = 0;i < count; i++){
|
||||
pointsF[i].X = (REAL)points[i].X;
|
||||
pointsF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
stat = GdipAddPathLine2(path, pointsF, count);
|
||||
|
||||
GdipFree(pointsF);
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
|
||||
{
|
||||
INT old_count;
|
||||
|
||||
|
@ -229,10 +297,10 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y
|
|||
|
||||
old_count = path->pathdata.Count;
|
||||
|
||||
path->pathdata.Points[old_count].X = (REAL) x1;
|
||||
path->pathdata.Points[old_count].Y = (REAL) y1;
|
||||
path->pathdata.Points[old_count + 1].X = (REAL) x2;
|
||||
path->pathdata.Points[old_count + 1].Y = (REAL) y2;
|
||||
path->pathdata.Points[old_count].X = x1;
|
||||
path->pathdata.Points[old_count].Y = y1;
|
||||
path->pathdata.Points[old_count + 1].X = x2;
|
||||
path->pathdata.Points[old_count + 1].Y = y2;
|
||||
|
||||
path->pathdata.Types[old_count] =
|
||||
(path->newfigure ? PathPointTypeStart : PathPointTypeLine);
|
||||
|
@ -244,6 +312,11 @@ GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathLineI(GpPath *path, INT x1, INT y1, INT x2, INT y2)
|
||||
{
|
||||
return GdipAddPathLine(path, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipAddPathPath(GpPath *path, GDIPCONST GpPath* addingPath,
|
||||
BOOL connect)
|
||||
{
|
||||
|
@ -373,6 +446,27 @@ GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF* points,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreatePath2I(GDIPCONST GpPoint* points,
|
||||
GDIPCONST BYTE* types, INT count, GpFillMode fill, GpPath **path)
|
||||
{
|
||||
GpPointF *ptF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
ptF = GdipAlloc(sizeof(GpPointF)*count);
|
||||
|
||||
for(i = 0;i < count; i++){
|
||||
ptF[i].X = (REAL)points[i].X;
|
||||
ptF[i].Y = (REAL)points[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipCreatePath2(ptF, types, count, fill, path);
|
||||
|
||||
GdipFree(ptF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
|
||||
{
|
||||
if(!path)
|
||||
|
@ -408,6 +502,29 @@ GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF* points, INT count)
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPathPointsI(GpPath *path, GpPoint* points, INT count)
|
||||
{
|
||||
GpStatus ret;
|
||||
GpPointF *ptf;
|
||||
INT i;
|
||||
|
||||
if(count <= 0)
|
||||
return InvalidParameter;
|
||||
|
||||
ptf = GdipAlloc(sizeof(GpPointF)*count);
|
||||
if(!ptf) return OutOfMemory;
|
||||
|
||||
ret = GdipGetPathPoints(path,ptf,count);
|
||||
if(ret == Ok)
|
||||
for(i = 0;i < count;i++){
|
||||
points[i].X = roundr(ptf[i].X);
|
||||
points[i].Y = roundr(ptf[i].Y);
|
||||
};
|
||||
GdipFree(ptf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPathTypes(GpPath *path, BYTE* types, INT count)
|
||||
{
|
||||
if(!path)
|
||||
|
@ -506,6 +623,24 @@ GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath* path, GpRectF* bounds,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPathWorldBoundsI(GpPath* path, GpRect* bounds,
|
||||
GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen)
|
||||
{
|
||||
GpStatus ret;
|
||||
GpRectF boundsF;
|
||||
|
||||
ret = GdipGetPathWorldBounds(path,&boundsF,matrix,pen);
|
||||
|
||||
if(ret == Ok){
|
||||
bounds->X = roundr(boundsF.X);
|
||||
bounds->Y = roundr(boundsF.Y);
|
||||
bounds->Width = roundr(boundsF.Width);
|
||||
bounds->Height = roundr(boundsF.Height);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
|
||||
{
|
||||
if(!path)
|
||||
|
|
|
@ -759,6 +759,7 @@ GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream* stream, GpImage **image)
|
|||
IPicture_get_Handle(pic, &hbm);
|
||||
IPicture_get_CurDC(pic, &hdc);
|
||||
|
||||
ZeroMemory(&bmi, sizeof(bmi));
|
||||
bmch = (BITMAPCOREHEADER*) (&bmi.bmiHeader);
|
||||
bmch->bcSize = sizeof(BITMAPCOREHEADER);
|
||||
|
||||
|
|
|
@ -89,6 +89,23 @@ GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCreateMatrix3I(GDIPCONST GpRect *rect, GDIPCONST GpPoint *pt,
|
||||
GpMatrix **matrix)
|
||||
{
|
||||
GpRectF rectF;
|
||||
GpPointF ptF;
|
||||
|
||||
rectF.X = (REAL)rect->X;
|
||||
rectF.Y = (REAL)rect->Y;
|
||||
rectF.Width = (REAL)rect->Width;
|
||||
rectF.Height = (REAL)rect->Height;
|
||||
|
||||
ptF.X = (REAL)pt->X;
|
||||
ptF.Y = (REAL)pt->Y;
|
||||
|
||||
return GdipCreateMatrix3(&rectF, &ptF, matrix);
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone)
|
||||
{
|
||||
if(!matrix || !clone)
|
||||
|
@ -242,6 +259,33 @@ GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
|
||||
{
|
||||
GpPointF *ptsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||
if(!ptsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
ptsF[i].X = (REAL)pts[i].X;
|
||||
ptsF[i].Y = (REAL)pts[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipTransformMatrixPoints(matrix, ptsF, count);
|
||||
|
||||
if(ret == Ok)
|
||||
for(i = 0; i < count; i++){
|
||||
pts[i].X = roundr(ptsF[i].X);
|
||||
pts[i].Y = roundr(ptsF[i].Y);
|
||||
}
|
||||
GdipFree(ptsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
|
||||
REAL offsetY, GpMatrixOrder order)
|
||||
{
|
||||
|
@ -264,3 +308,82 @@ GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX,
|
|||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
|
||||
{
|
||||
REAL x, y;
|
||||
INT i;
|
||||
|
||||
if(!matrix || !pts)
|
||||
return InvalidParameter;
|
||||
|
||||
for(i = 0; i < count; i++)
|
||||
{
|
||||
x = pts[i].X;
|
||||
y = pts[i].Y;
|
||||
|
||||
pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2];
|
||||
pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3];
|
||||
}
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI(GpMatrix *matrix, GpPoint *pts, INT count)
|
||||
{
|
||||
GpPointF *ptsF;
|
||||
GpStatus ret;
|
||||
INT i;
|
||||
|
||||
ptsF = GdipAlloc(sizeof(GpPointF) * count);
|
||||
if(!ptsF)
|
||||
return OutOfMemory;
|
||||
|
||||
for(i = 0; i < count; i++){
|
||||
ptsF[i].X = (REAL)pts[i].X;
|
||||
ptsF[i].Y = (REAL)pts[i].Y;
|
||||
}
|
||||
|
||||
ret = GdipVectorTransformMatrixPoints(matrix, ptsF, count);
|
||||
/* store back */
|
||||
if(ret == Ok)
|
||||
for(i = 0; i < count; i++){
|
||||
pts[i].X = roundr(ptsF[i].X);
|
||||
pts[i].Y = roundr(ptsF[i].Y);
|
||||
}
|
||||
GdipFree(ptsF);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2,
|
||||
BOOL *result)
|
||||
{
|
||||
if(!matrix || !matrix2 || !result)
|
||||
return InvalidParameter;
|
||||
/* based on single array member of GpMatrix */
|
||||
*result = (memcmp(matrix->matrix, matrix2->matrix, sizeof(GpMatrix)) == 0);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
|
||||
{
|
||||
GpMatrix *e;
|
||||
GpStatus ret;
|
||||
BOOL isIdentity;
|
||||
|
||||
if(!matrix || !result)
|
||||
return InvalidParameter;
|
||||
|
||||
ret = GdipCreateMatrix(&e);
|
||||
if(ret != Ok) return ret;
|
||||
|
||||
ret = GdipIsMatrixEqual(matrix, e, &isIdentity);
|
||||
if(ret == Ok)
|
||||
*result = isIdentity;
|
||||
|
||||
GdipFree(e);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -152,3 +152,18 @@ GpStatus WINGDIPAPI GdipSetStringFormatFlags(GDIPCONST GpStringFormat *format, I
|
|||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpStringFormat **newFormat)
|
||||
{
|
||||
if(!format || !newFormat)
|
||||
return InvalidParameter;
|
||||
|
||||
*newFormat = GdipAlloc(sizeof(GpStringFormat));
|
||||
if(!*newFormat) return OutOfMemory;
|
||||
|
||||
**newFormat = *format;
|
||||
|
||||
TRACE("%p %p\n",format,newFormat);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue