ReactOS 0.4.17-dev-218-g5635d24
gdiplusflat.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WINGDIPAPI   __stdcall
 
#define GDIPCONST   const
 

Functions

GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap (REAL, REAL, BOOL, GpAdjustableArrowCap **)
 
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState (GpAdjustableArrowCap *, BOOL *)
 
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight (GpAdjustableArrowCap *, REAL *)
 
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *, REAL *)
 
GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth (GpAdjustableArrowCap *, REAL *)
 
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState (GpAdjustableArrowCap *, BOOL)
 
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight (GpAdjustableArrowCap *, REAL)
 
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset (GpAdjustableArrowCap *, REAL)
 
GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth (GpAdjustableArrowCap *, REAL)
 
GpStatus WINGDIPAPI GdipBitmapApplyEffect (GpBitmap *, CGpEffect *, RECT *, BOOL, VOID **, INT *)
 
GpStatus WINGDIPAPI GdipBitmapCreateApplyEffect (GpBitmap **, INT, CGpEffect *, RECT *, RECT *, GpBitmap **, BOOL, VOID **, INT *)
 
GpStatus WINGDIPAPI GdipBitmapGetHistogram (GpBitmap *, HistogramFormat, UINT, UINT *, UINT *, UINT *, UINT *)
 
GpStatus WINGDIPAPI GdipBitmapGetHistogramSize (HistogramFormat, UINT *)
 
GpStatus WINGDIPAPI GdipBitmapGetPixel (GpBitmap *, INT, INT, ARGB *)
 
GpStatus WINGDIPAPI GdipBitmapLockBits (GpBitmap *, GDIPCONST GpRect *, UINT, PixelFormat, BitmapData *)
 
GpStatus WINGDIPAPI GdipBitmapSetPixel (GpBitmap *, INT, INT, ARGB)
 
GpStatus WINGDIPAPI GdipBitmapSetResolution (GpBitmap *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipBitmapUnlockBits (GpBitmap *, BitmapData *)
 
GpStatus WINGDIPAPI GdipCloneBitmapArea (REAL, REAL, REAL, REAL, PixelFormat, GpBitmap *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCloneBitmapAreaI (INT, INT, INT, INT, PixelFormat, GpBitmap *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromFile (GDIPCONST WCHAR *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM (GDIPCONST WCHAR *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib (GDIPCONST BITMAPINFO *, VOID *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics (INT, INT, GpGraphics *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP (HBITMAP, HPALETTE, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromHICON (HICON, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromResource (HINSTANCE, GDIPCONST WCHAR *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0 (INT, INT, INT, PixelFormat, BYTE *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromStream (IStream *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM (IStream *, GpBitmap **)
 
GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap (GpBitmap *, HBITMAP *, ARGB)
 
GpStatus WINGDIPAPI GdipCreateHICONFromBitmap (GpBitmap *, HICON *)
 
GpStatus WINGDIPAPI GdipDeleteEffect (CGpEffect *)
 
GpStatus WINGDIPAPI GdipSetEffectParameters (CGpEffect *, const VOID *, const UINT)
 
GpStatus WINGDIPAPI GdipCloneBrush (GpBrush *, GpBrush **)
 
GpStatus WINGDIPAPI GdipDeleteBrush (GpBrush *)
 
GpStatus WINGDIPAPI GdipGetBrushType (GpBrush *, GpBrushType *)
 
GpStatus WINGDIPAPI GdipCreateCachedBitmap (GpBitmap *, GpGraphics *, GpCachedBitmap **)
 
GpStatus WINGDIPAPI GdipDeleteCachedBitmap (GpCachedBitmap *)
 
GpStatus WINGDIPAPI GdipDrawCachedBitmap (GpGraphics *, GpCachedBitmap *, INT, INT)
 
GpStatus WINGDIPAPI GdipCloneCustomLineCap (GpCustomLineCap *, GpCustomLineCap **)
 
GpStatus WINGDIPAPI GdipCreateCustomLineCap (GpPath *, GpPath *, GpLineCap, REAL, GpCustomLineCap **)
 
GpStatus WINGDIPAPI GdipDeleteCustomLineCap (GpCustomLineCap *)
 
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap (GpCustomLineCap *, GpLineCap *)
 
GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap (GpCustomLineCap *, GpLineCap)
 
GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset (GpCustomLineCap *, REAL *)
 
GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset (GpCustomLineCap *, REAL)
 
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps (GpCustomLineCap *, GpLineCap, GpLineCap)
 
GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin (GpCustomLineCap *, GpLineJoin *)
 
GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin (GpCustomLineCap *, GpLineJoin)
 
GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale (GpCustomLineCap *, REAL *)
 
GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale (GpCustomLineCap *, REAL)
 
GpStatus WINGDIPAPI GdipGetCustomLineCapType (GpCustomLineCap *, CustomLineCapType *)
 
GpStatus WINGDIPAPI GdipCloneFont (GpFont *, GpFont **)
 
GpStatus WINGDIPAPI GdipCreateFont (GDIPCONST GpFontFamily *, REAL, INT, Unit, GpFont **)
 
GpStatus WINGDIPAPI GdipCreateFontFromDC (HDC, GpFont **)
 
GpStatus WINGDIPAPI GdipCreateFontFromLogfontA (HDC, GDIPCONST LOGFONTA *, GpFont **)
 
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW (HDC, GDIPCONST LOGFONTW *, GpFont **)
 
GpStatus WINGDIPAPI GdipDeleteFont (GpFont *)
 
GpStatus WINGDIPAPI GdipGetLogFontA (GpFont *, GpGraphics *, LOGFONTA *)
 
GpStatus WINGDIPAPI GdipGetLogFontW (GpFont *, GpGraphics *, LOGFONTW *)
 
GpStatus WINGDIPAPI GdipGetFamily (GpFont *, GpFontFamily **)
 
GpStatus WINGDIPAPI GdipGetFontUnit (GpFont *, Unit *)
 
GpStatus WINGDIPAPI GdipGetFontSize (GpFont *, REAL *)
 
GpStatus WINGDIPAPI GdipGetFontStyle (GpFont *, INT *)
 
GpStatus WINGDIPAPI GdipGetFontHeight (GDIPCONST GpFont *, GDIPCONST GpGraphics *, REAL *)
 
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI (GDIPCONST GpFont *, REAL, REAL *)
 
GpStatus WINGDIPAPI GdipNewInstalledFontCollection (GpFontCollection **)
 
GpStatus WINGDIPAPI GdipNewPrivateFontCollection (GpFontCollection **)
 
GpStatus WINGDIPAPI GdipDeletePrivateFontCollection (GpFontCollection **)
 
GpStatus WINGDIPAPI GdipPrivateAddFontFile (GpFontCollection *, GDIPCONST WCHAR *)
 
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont (GpFontCollection *, GDIPCONST void *, INT)
 
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount (GpFontCollection *, INT *)
 
GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList (GpFontCollection *, INT, GpFontFamily *[], INT *)
 
GpStatus WINGDIPAPI GdipCloneFontFamily (GpFontFamily *, GpFontFamily **)
 
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName (GDIPCONST WCHAR *, GpFontCollection *, GpFontFamily **)
 
GpStatus WINGDIPAPI GdipDeleteFontFamily (GpFontFamily *)
 
GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *, WCHAR *, LANGID)
 
GpStatus WINGDIPAPI GdipGetCellAscent (GDIPCONST GpFontFamily *, INT, UINT16 *)
 
GpStatus WINGDIPAPI GdipGetCellDescent (GDIPCONST GpFontFamily *, INT, UINT16 *)
 
GpStatus WINGDIPAPI GdipGetEmHeight (GDIPCONST GpFontFamily *, INT, UINT16 *)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif (GpFontFamily **)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif (GpFontFamily **)
 
GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace (GpFontFamily **)
 
GpStatus WINGDIPAPI GdipGetLineSpacing (GDIPCONST GpFontFamily *, INT, UINT16 *)
 
GpStatus WINGDIPAPI GdipIsStyleAvailable (GDIPCONST GpFontFamily *, INT, BOOL *)
 
GpStatus WINGDIPAPI GdipFlush (GpGraphics *, GpFlushIntention)
 
GpStatus WINGDIPAPI GdipBeginContainer (GpGraphics *, GDIPCONST GpRectF *, GDIPCONST GpRectF *, GpUnit, GraphicsContainer *)
 
GpStatus WINGDIPAPI GdipBeginContainer2 (GpGraphics *, GraphicsContainer *)
 
GpStatus WINGDIPAPI GdipBeginContainerI (GpGraphics *, GDIPCONST GpRect *, GDIPCONST GpRect *, GpUnit, GraphicsContainer *)
 
GpStatus WINGDIPAPI GdipEndContainer (GpGraphics *, GraphicsContainer)
 
GpStatus WINGDIPAPI GdipComment (GpGraphics *, UINT, GDIPCONST BYTE *)
 
GpStatus WINGDIPAPI GdipCreateFromHDC (HDC, GpGraphics **)
 
GpStatus WINGDIPAPI GdipCreateFromHDC2 (HDC, HANDLE, GpGraphics **)
 
GpStatus WINGDIPAPI GdipCreateFromHWND (HWND, GpGraphics **)
 
GpStatus WINGDIPAPI GdipCreateFromHWNDICM (HWND, GpGraphics **)
 
HPALETTE WINGDIPAPI GdipCreateHalftonePalette (void)
 
GpStatus WINGDIPAPI GdipDeleteGraphics (GpGraphics *)
 
GpStatus WINGDIPAPI GdipDrawArc (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawArcI (GpGraphics *, GpPen *, INT, INT, INT, INT, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawBezier (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawBezierI (GpGraphics *, GpPen *, INT, INT, INT, INT, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawBeziers (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawBeziersI (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawClosedCurve (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawClosedCurveI (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawClosedCurve2 (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawClosedCurve2I (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawCurve (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawCurveI (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawCurve2 (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawCurve2I (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawCurve3 (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT, INT, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawCurve3I (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT, INT, INT, REAL)
 
GpStatus WINGDIPAPI GdipDrawDriverString (GpGraphics *, GDIPCONST UINT16 *, INT, GDIPCONST GpFont *, GDIPCONST GpBrush *, GDIPCONST PointF *, INT, GDIPCONST GpMatrix *)
 
GpStatus WINGDIPAPI GdipDrawEllipse (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawEllipseI (GpGraphics *, GpPen *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawImage (GpGraphics *, GpImage *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawImageFX (GpGraphics *, GpImage *, GpRectF *, GpMatrix *, CGpEffect *, GpImageAttributes *, GpUnit)
 
GpStatus WINGDIPAPI GdipDrawImageI (GpGraphics *, GpImage *, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawImagePointRect (GpGraphics *, GpImage *, REAL, REAL, REAL, REAL, REAL, REAL, GpUnit)
 
GpStatus WINGDIPAPI GdipDrawImagePointRectI (GpGraphics *, GpImage *, INT, INT, INT, INT, INT, INT, GpUnit)
 
GpStatus WINGDIPAPI GdipDrawImagePoints (GpGraphics *, GpImage *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawImagePointsI (GpGraphics *, GpImage *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawImagePointsRect (GpGraphics *, GpImage *, GDIPCONST GpPointF *, INT, REAL, REAL, REAL, REAL, GpUnit, GDIPCONST GpImageAttributes *, DrawImageAbort, VOID *)
 
GpStatus WINGDIPAPI GdipDrawImagePointsRectI (GpGraphics *, GpImage *, GDIPCONST GpPoint *, INT, INT, INT, INT, INT, GpUnit, GDIPCONST GpImageAttributes *, DrawImageAbort, VOID *)
 
GpStatus WINGDIPAPI GdipDrawImageRect (GpGraphics *, GpImage *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawImageRectI (GpGraphics *, GpImage *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawImageRectRect (GpGraphics *, GpImage *, REAL, REAL, REAL, REAL, REAL, REAL, REAL, REAL, GpUnit, GDIPCONST GpImageAttributes *, DrawImageAbort, VOID *)
 
GpStatus WINGDIPAPI GdipDrawImageRectRectI (GpGraphics *, GpImage *, INT, INT, INT, INT, INT, INT, INT, INT, GpUnit, GDIPCONST GpImageAttributes *, DrawImageAbort, VOID *)
 
GpStatus WINGDIPAPI GdipDrawLine (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawLineI (GpGraphics *, GpPen *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawLines (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawLinesI (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawPath (GpGraphics *, GpPen *, GpPath *)
 
GpStatus WINGDIPAPI GdipDrawPie (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawPieI (GpGraphics *, GpPen *, INT, INT, INT, INT, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawPolygon (GpGraphics *, GpPen *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipDrawPolygonI (GpGraphics *, GpPen *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipDrawRectangle (GpGraphics *, GpPen *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipDrawRectangleI (GpGraphics *, GpPen *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipDrawRectangles (GpGraphics *, GpPen *, GDIPCONST GpRectF *, INT)
 
GpStatus WINGDIPAPI GdipDrawRectanglesI (GpGraphics *, GpPen *, GDIPCONST GpRect *, INT)
 
GpStatus WINGDIPAPI GdipDrawString (GpGraphics *, GDIPCONST WCHAR *, INT, GDIPCONST GpFont *, GDIPCONST RectF *, GDIPCONST GpStringFormat *, GDIPCONST GpBrush *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpPointF *, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpPoint *, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpRectF *, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpRect *, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpPointF *, INT, GDIPCONST GpRectF *, Unit, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRect (GpGraphics *, GDIPCONST GpMetafile *, GDIPCONST GpRectF *, GDIPCONST GpRectF *, Unit, EnumerateMetafileProc, VOID *, GDIPCONST GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipFillClosedCurve2 (GpGraphics *, GpBrush *, GDIPCONST GpPointF *, INT, REAL, GpFillMode)
 
GpStatus WINGDIPAPI GdipFillClosedCurve2I (GpGraphics *, GpBrush *, GDIPCONST GpPoint *, INT, REAL, GpFillMode)
 
GpStatus WINGDIPAPI GdipFillClosedCurve (GpGraphics *, GpBrush *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipFillClosedCurveI (GpGraphics *, GpBrush *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipFillEllipse (GpGraphics *, GpBrush *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipFillEllipseI (GpGraphics *, GpBrush *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipFillPath (GpGraphics *, GpBrush *, GpPath *)
 
GpStatus WINGDIPAPI GdipFillPie (GpGraphics *, GpBrush *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipFillPieI (GpGraphics *, GpBrush *, INT, INT, INT, INT, REAL, REAL)
 
GpStatus WINGDIPAPI GdipFillPolygon (GpGraphics *, GpBrush *, GDIPCONST GpPointF *, INT, GpFillMode)
 
GpStatus WINGDIPAPI GdipFillPolygonI (GpGraphics *, GpBrush *, GDIPCONST GpPoint *, INT, GpFillMode)
 
GpStatus WINGDIPAPI GdipFillPolygon2 (GpGraphics *, GpBrush *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipFillPolygon2I (GpGraphics *, GpBrush *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipFillRectangle (GpGraphics *, GpBrush *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipFillRectangleI (GpGraphics *, GpBrush *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipFillRectangles (GpGraphics *, GpBrush *, GDIPCONST GpRectF *, INT)
 
GpStatus WINGDIPAPI GdipFillRectanglesI (GpGraphics *, GpBrush *, GDIPCONST GpRect *, INT)
 
GpStatus WINGDIPAPI GdipFillRegion (GpGraphics *, GpBrush *, GpRegion *)
 
GpStatus WINGDIPAPI GdipGetClip (GpGraphics *, GpRegion *)
 
GpStatus WINGDIPAPI GdipGetClipBounds (GpGraphics *, GpRectF *)
 
GpStatus WINGDIPAPI GdipGetClipBoundsI (GpGraphics *, GpRect *)
 
GpStatus WINGDIPAPI GdipGetCompositingMode (GpGraphics *, CompositingMode *)
 
GpStatus WINGDIPAPI GdipGetCompositingQuality (GpGraphics *, CompositingQuality *)
 
GpStatus WINGDIPAPI GdipGetDC (GpGraphics *, HDC *)
 
GpStatus WINGDIPAPI GdipGetDpiX (GpGraphics *, REAL *)
 
GpStatus WINGDIPAPI GdipGetDpiY (GpGraphics *, REAL *)
 
GpStatus WINGDIPAPI GdipGetEncoderParameterListSize (GpImage *, GDIPCONST CLSID *, UINT *)
 
GpStatus WINGDIPAPI GdipGetImageDecoders (UINT, UINT, ImageCodecInfo *)
 
GpStatus WINGDIPAPI GdipGetImageDecodersSize (UINT *, UINT *)
 
GpStatus WINGDIPAPI GdipGetImageGraphicsContext (GpImage *, GpGraphics **)
 
GpStatus WINGDIPAPI GdipGetInterpolationMode (GpGraphics *, InterpolationMode *)
 
GpStatus WINGDIPAPI GdipGetNearestColor (GpGraphics *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetPageScale (GpGraphics *, REAL *)
 
GpStatus WINGDIPAPI GdipGetPageUnit (GpGraphics *, GpUnit *)
 
GpStatus WINGDIPAPI GdipGetPixelOffsetMode (GpGraphics *, PixelOffsetMode *)
 
GpStatus WINGDIPAPI GdipGetRenderingOrigin (GpGraphics *, INT *, INT *)
 
GpStatus WINGDIPAPI GdipGetSmoothingMode (GpGraphics *, SmoothingMode *)
 
GpStatus WINGDIPAPI GdipGetTextContrast (GpGraphics *, UINT *)
 
GpStatus WINGDIPAPI GdipGetTextRenderingHint (GpGraphics *, TextRenderingHint *)
 
GpStatus WINGDIPAPI GdipGetWorldTransform (GpGraphics *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipGraphicsClear (GpGraphics *, ARGB)
 
GpStatus WINGDIPAPI GdipGraphicsSetAbort (GpGraphics *, GdiplusAbort *)
 
GpStatus WINGDIPAPI GdipGetVisibleClipBounds (GpGraphics *, GpRectF *)
 
GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI (GpGraphics *, GpRect *)
 
GpStatus WINGDIPAPI GdipInitializePalette (ColorPalette *, PaletteType, INT, BOOL, GpBitmap *)
 
GpStatus WINGDIPAPI GdipIsClipEmpty (GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleClipEmpty (GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisiblePoint (GpGraphics *, REAL, REAL, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisiblePointI (GpGraphics *, INT, INT, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRect (GpGraphics *, REAL, REAL, REAL, REAL, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRectI (GpGraphics *, INT, INT, INT, INT, BOOL *)
 
GpStatus WINGDIPAPI GdipMeasureCharacterRanges (GpGraphics *, GDIPCONST WCHAR *, INT, GDIPCONST GpFont *, GDIPCONST RectF *, GDIPCONST GpStringFormat *, INT, GpRegion **)
 
GpStatus WINGDIPAPI GdipMeasureDriverString (GpGraphics *, GDIPCONST UINT16 *, INT, GDIPCONST GpFont *, GDIPCONST PointF *, INT, GDIPCONST GpMatrix *, RectF *)
 
GpStatus WINGDIPAPI GdipMeasureString (GpGraphics *, GDIPCONST WCHAR *, INT, GDIPCONST GpFont *, GDIPCONST RectF *, GDIPCONST GpStringFormat *, RectF *, INT *, INT *)
 
GpStatus WINGDIPAPI GdipMultiplyWorldTransform (GpGraphics *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipRecordMetafileFileName (GDIPCONST WCHAR *, HDC, EmfType, GDIPCONST GpRectF *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipRecordMetafileFileNameI (GDIPCONST WCHAR *, HDC, EmfType, GDIPCONST GpRect *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipReleaseDC (GpGraphics *, HDC)
 
GpStatus WINGDIPAPI GdipResetClip (GpGraphics *)
 
GpStatus WINGDIPAPI GdipResetPageTransform (GpGraphics *)
 
GpStatus WINGDIPAPI GdipResetWorldTransform (GpGraphics *)
 
GpStatus WINGDIPAPI GdipRestoreGraphics (GpGraphics *, GraphicsState)
 
GpStatus WINGDIPAPI GdipRotateWorldTransform (GpGraphics *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSaveGraphics (GpGraphics *, GraphicsState *)
 
GpStatus WINGDIPAPI GdipScaleWorldTransform (GpGraphics *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetClipHrgn (GpGraphics *, HRGN, CombineMode)
 
GpStatus WINGDIPAPI GdipSetClipGraphics (GpGraphics *, GpGraphics *, CombineMode)
 
GpStatus WINGDIPAPI GdipSetClipPath (GpGraphics *, GpPath *, CombineMode)
 
GpStatus WINGDIPAPI GdipSetClipRect (GpGraphics *, REAL, REAL, REAL, REAL, CombineMode)
 
GpStatus WINGDIPAPI GdipSetClipRectI (GpGraphics *, INT, INT, INT, INT, CombineMode)
 
GpStatus WINGDIPAPI GdipSetClipRegion (GpGraphics *, GpRegion *, CombineMode)
 
GpStatus WINGDIPAPI GdipSetCompositingMode (GpGraphics *, CompositingMode)
 
GpStatus WINGDIPAPI GdipSetCompositingQuality (GpGraphics *, CompositingQuality)
 
GpStatus WINGDIPAPI GdipSetInterpolationMode (GpGraphics *, InterpolationMode)
 
GpStatus WINGDIPAPI GdipSetPageScale (GpGraphics *, REAL)
 
GpStatus WINGDIPAPI GdipSetPageUnit (GpGraphics *, GpUnit)
 
GpStatus WINGDIPAPI GdipSetPixelOffsetMode (GpGraphics *, PixelOffsetMode)
 
GpStatus WINGDIPAPI GdipSetRenderingOrigin (GpGraphics *, INT, INT)
 
GpStatus WINGDIPAPI GdipSetSmoothingMode (GpGraphics *, SmoothingMode)
 
GpStatus WINGDIPAPI GdipSetTextContrast (GpGraphics *, UINT)
 
GpStatus WINGDIPAPI GdipSetTextRenderingHint (GpGraphics *, TextRenderingHint)
 
GpStatus WINGDIPAPI GdipSetWorldTransform (GpGraphics *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipTransformPoints (GpGraphics *, GpCoordinateSpace, GpCoordinateSpace, GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipTransformPointsI (GpGraphics *, GpCoordinateSpace, GpCoordinateSpace, GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipTranslateClip (GpGraphics *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipTranslateClipI (GpGraphics *, INT, INT)
 
GpStatus WINGDIPAPI GdipTranslateWorldTransform (GpGraphics *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipAddPathArc (GpPath *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathArcI (GpPath *, INT, INT, INT, INT, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathBezier (GpPath *, REAL, REAL, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathBezierI (GpPath *, INT, INT, INT, INT, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipAddPathBeziers (GpPath *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathBeziersI (GpPath *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipAddPathClosedCurve (GpPath *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathClosedCurveI (GpPath *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipAddPathClosedCurve2 (GpPath *, GDIPCONST GpPointF *, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathClosedCurve2I (GpPath *, GDIPCONST GpPoint *, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathCurve (GpPath *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathCurveI (GpPath *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipAddPathCurve2 (GpPath *, GDIPCONST GpPointF *, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathCurve2I (GpPath *, GDIPCONST GpPoint *, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathCurve3 (GpPath *, GDIPCONST GpPointF *, INT, INT, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathCurve3I (GpPath *, GDIPCONST GpPoint *, INT, INT, INT, REAL)
 
GpStatus WINGDIPAPI GdipAddPathEllipse (GpPath *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathEllipseI (GpPath *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipAddPathLine (GpPath *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathLineI (GpPath *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipAddPathLine2 (GpPath *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathLine2I (GpPath *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipAddPathPath (GpPath *, GDIPCONST GpPath *, BOOL)
 
GpStatus WINGDIPAPI GdipAddPathPie (GpPath *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathPieI (GpPath *, INT, INT, INT, INT, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathPolygon (GpPath *, GDIPCONST GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathPolygonI (GpPath *, GDIPCONST GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipAddPathRectangle (GpPath *, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipAddPathRectangleI (GpPath *, INT, INT, INT, INT)
 
GpStatus WINGDIPAPI GdipAddPathRectangles (GpPath *, GDIPCONST GpRectF *, INT)
 
GpStatus WINGDIPAPI GdipAddPathRectanglesI (GpPath *, GDIPCONST GpRect *, INT)
 
GpStatus WINGDIPAPI GdipAddPathString (GpPath *, GDIPCONST WCHAR *, INT, GDIPCONST GpFontFamily *, INT, REAL, GDIPCONST RectF *, GDIPCONST GpStringFormat *)
 
GpStatus WINGDIPAPI GdipAddPathStringI (GpPath *, GDIPCONST WCHAR *, INT, GDIPCONST GpFontFamily *, INT, REAL, GDIPCONST Rect *, GDIPCONST GpStringFormat *)
 
GpStatus WINGDIPAPI GdipClearPathMarkers (GpPath *)
 
GpStatus WINGDIPAPI GdipClonePath (GpPath *, GpPath **)
 
GpStatus WINGDIPAPI GdipClosePathFigure (GpPath *)
 
GpStatus WINGDIPAPI GdipClosePathFigures (GpPath *)
 
GpStatus WINGDIPAPI GdipCreatePath (GpFillMode, GpPath **)
 
GpStatus WINGDIPAPI GdipCreatePath2 (GDIPCONST GpPointF *, GDIPCONST BYTE *, INT, GpFillMode, GpPath **)
 
GpStatus WINGDIPAPI GdipCreatePath2I (GDIPCONST GpPoint *, GDIPCONST BYTE *, INT, GpFillMode, GpPath **)
 
GpStatus WINGDIPAPI GdipDeletePath (GpPath *)
 
GpStatus WINGDIPAPI GdipFlattenPath (GpPath *, GpMatrix *, REAL)
 
GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint (GpPath *, REAL, REAL, GpPen *, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI (GpPath *, INT, INT, GpPen *, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisiblePathPoint (GpPath *, REAL, REAL, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisiblePathPointI (GpPath *, INT, INT, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipGetPathData (GpPath *, GpPathData *)
 
GpStatus WINGDIPAPI GdipGetPathFillMode (GpPath *, GpFillMode *)
 
GpStatus WINGDIPAPI GdipGetPathLastPoint (GpPath *, GpPointF *)
 
GpStatus WINGDIPAPI GdipGetPathPoints (GpPath *, GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipGetPathPointsI (GpPath *, GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipGetPathTypes (GpPath *, BYTE *, INT)
 
GpStatus WINGDIPAPI GdipGetPathWorldBounds (GpPath *, GpRectF *, GDIPCONST GpMatrix *, GDIPCONST GpPen *)
 
GpStatus WINGDIPAPI GdipGetPathWorldBoundsI (GpPath *, GpRect *, GDIPCONST GpMatrix *, GDIPCONST GpPen *)
 
GpStatus WINGDIPAPI GdipGetPointCount (GpPath *, INT *)
 
GpStatus WINGDIPAPI GdipResetPath (GpPath *)
 
GpStatus WINGDIPAPI GdipReversePath (GpPath *)
 
GpStatus WINGDIPAPI GdipSetPathFillMode (GpPath *, GpFillMode)
 
GpStatus WINGDIPAPI GdipSetPathMarker (GpPath *)
 
GpStatus WINGDIPAPI GdipStartPathFigure (GpPath *)
 
GpStatus WINGDIPAPI GdipTransformPath (GpPath *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipWarpPath (GpPath *, GpMatrix *, GDIPCONST GpPointF *, INT, REAL, REAL, REAL, REAL, WarpMode, REAL)
 
GpStatus WINGDIPAPI GdipWidenPath (GpPath *, GpPen *, GpMatrix *, REAL)
 
GpStatus WINGDIPAPI GdipWindingModeOutline (GpPath *, GpMatrix *, REAL)
 
GpStatus WINGDIPAPI GdipCreateHatchBrush (GpHatchStyle, ARGB, ARGB, GpHatch **)
 
GpStatus WINGDIPAPI GdipGetHatchBackgroundColor (GpHatch *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetHatchForegroundColor (GpHatch *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetHatchStyle (GpHatch *, GpHatchStyle *)
 
GpStatus WINGDIPAPI GdipCloneImage (GpImage *, GpImage **)
 
GpStatus WINGDIPAPI GdipCloneImageAttributes (GDIPCONST GpImageAttributes *, GpImageAttributes **)
 
GpStatus WINGDIPAPI GdipDisposeImage (GpImage *)
 
GpStatus WINGDIPAPI GdipEmfToWmfBits (HENHMETAFILE, UINT, LPBYTE, INT, INT)
 
GpStatus WINGDIPAPI GdipFindFirstImageItem (GpImage *, ImageItemData *)
 
GpStatus WINGDIPAPI GdipFindNextImageItem (GpImage *, ImageItemData *)
 
GpStatus WINGDIPAPI GdipGetAllPropertyItems (GpImage *, UINT, UINT, PropertyItem *)
 
GpStatus WINGDIPAPI GdipGetImageBounds (GpImage *, GpRectF *, GpUnit *)
 
GpStatus WINGDIPAPI GdipGetImageDimension (GpImage *, REAL *, REAL *)
 
GpStatus WINGDIPAPI GdipGetImageFlags (GpImage *, UINT *)
 
GpStatus WINGDIPAPI GdipGetImageHeight (GpImage *, UINT *)
 
GpStatus WINGDIPAPI GdipGetImageHorizontalResolution (GpImage *, REAL *)
 
GpStatus WINGDIPAPI GdipGetImageItemData (GpImage *, ImageItemData *)
 
GpStatus WINGDIPAPI GdipGetImagePalette (GpImage *, ColorPalette *, INT)
 
GpStatus WINGDIPAPI GdipGetImagePaletteSize (GpImage *, INT *)
 
GpStatus WINGDIPAPI GdipGetImagePixelFormat (GpImage *, PixelFormat *)
 
GpStatus WINGDIPAPI GdipGetImageRawFormat (GpImage *, GUID *)
 
GpStatus WINGDIPAPI GdipGetImageThumbnail (GpImage *, UINT, UINT, GpImage **, GetThumbnailImageAbort, VOID *)
 
GpStatus WINGDIPAPI GdipGetImageType (GpImage *, ImageType *)
 
GpStatus WINGDIPAPI GdipGetImageVerticalResolution (GpImage *, REAL *)
 
GpStatus WINGDIPAPI GdipGetImageWidth (GpImage *, UINT *)
 
GpStatus WINGDIPAPI GdipGetPropertyCount (GpImage *, UINT *)
 
GpStatus WINGDIPAPI GdipGetPropertyIdList (GpImage *, UINT, PROPID *)
 
GpStatus WINGDIPAPI GdipGetPropertyItem (GpImage *, PROPID, UINT, PropertyItem *)
 
GpStatus WINGDIPAPI GdipGetPropertyItemSize (GpImage *, PROPID, UINT *)
 
GpStatus WINGDIPAPI GdipGetPropertySize (GpImage *, UINT *, UINT *)
 
GpStatus WINGDIPAPI GdipImageForceValidation (GpImage *)
 
GpStatus WINGDIPAPI GdipImageGetFrameCount (GpImage *, GDIPCONST GUID *, UINT *)
 
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount (GpImage *, UINT *)
 
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList (GpImage *, GUID *, UINT)
 
GpStatus WINGDIPAPI GdipImageRotateFlip (GpImage *, RotateFlipType)
 
GpStatus WINGDIPAPI GdipImageSelectActiveFrame (GpImage *, GDIPCONST GUID *, UINT)
 
GpStatus WINGDIPAPI GdipImageSetAbort (GpImage *, GdiplusAbort *)
 
GpStatus WINGDIPAPI GdipLoadImageFromFile (GDIPCONST WCHAR *, GpImage **)
 
GpStatus WINGDIPAPI GdipLoadImageFromFileICM (GDIPCONST WCHAR *, GpImage **)
 
GpStatus WINGDIPAPI GdipLoadImageFromStream (IStream *, GpImage **)
 
GpStatus WINGDIPAPI GdipLoadImageFromStreamICM (IStream *, GpImage **)
 
GpStatus WINGDIPAPI GdipRemovePropertyItem (GpImage *, PROPID)
 
GpStatus WINGDIPAPI GdipSaveImageToFile (GpImage *, GDIPCONST WCHAR *, GDIPCONST CLSID *, GDIPCONST EncoderParameters *)
 
GpStatus WINGDIPAPI GdipSaveImageToStream (GpImage *, IStream *, GDIPCONST CLSID *, GDIPCONST EncoderParameters *)
 
GpStatus WINGDIPAPI GdipSaveAdd (GpImage *, GDIPCONST EncoderParameters *)
 
GpStatus WINGDIPAPI GdipSaveAddImage (GpImage *, GpImage *, GDIPCONST EncoderParameters *)
 
GpStatus WINGDIPAPI GdipSetImagePalette (GpImage *, GDIPCONST ColorPalette *)
 
GpStatus WINGDIPAPI GdipSetPropertyItem (GpImage *, GDIPCONST PropertyItem *)
 
GpStatus WINGDIPAPI GdipCreateImageAttributes (GpImageAttributes **)
 
GpStatus WINGDIPAPI GdipDisposeImageAttributes (GpImageAttributes *)
 
GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette (GpImageAttributes *, ColorPalette *, ColorAdjustType)
 
GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground (GpImageAttributes *, BOOL)
 
GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys (GpImageAttributes *, ColorAdjustType, BOOL, ARGB, ARGB)
 
GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix (GpImageAttributes *, ColorAdjustType, BOOL, GDIPCONST ColorMatrix *, GDIPCONST ColorMatrix *, ColorMatrixFlags)
 
GpStatus WINGDIPAPI GdipSetImageAttributesGamma (GpImageAttributes *, ColorAdjustType, BOOL, REAL)
 
GpStatus WINGDIPAPI GdipSetImageAttributesNoOp (GpImageAttributes *, ColorAdjustType, BOOL)
 
GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel (GpImageAttributes *, ColorAdjustType, BOOL, ColorChannelFlags)
 
GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile (GpImageAttributes *, ColorAdjustType, BOOL, GDIPCONST WCHAR *)
 
GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable (GpImageAttributes *, ColorAdjustType, BOOL, UINT, GDIPCONST ColorMap *)
 
GpStatus WINGDIPAPI GdipSetImageAttributesThreshold (GpImageAttributes *, ColorAdjustType, BOOL, REAL)
 
GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity (GpImageAttributes *, ColorAdjustType)
 
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode (GpImageAttributes *, WrapMode, ARGB, BOOL)
 
GpStatus WINGDIPAPI GdipResetImageAttributes (GpImageAttributes *, ColorAdjustType)
 
GpStatus WINGDIPAPI GdipCreateLineBrush (GDIPCONST GpPointF *, GDIPCONST GpPointF *, ARGB, ARGB, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipCreateLineBrushI (GDIPCONST GpPoint *, GDIPCONST GpPoint *, ARGB, ARGB, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect (GDIPCONST GpRectF *, ARGB, ARGB, LinearGradientMode, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI (GDIPCONST GpRect *, ARGB, ARGB, LinearGradientMode, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle (GDIPCONST GpRectF *, ARGB, ARGB, REAL, BOOL, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI (GDIPCONST GpRect *, ARGB, ARGB, REAL, BOOL, GpWrapMode, GpLineGradient **)
 
GpStatus WINGDIPAPI GdipGetLineColors (GpLineGradient *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetLineGammaCorrection (GpLineGradient *, BOOL *)
 
GpStatus WINGDIPAPI GdipGetLineRect (GpLineGradient *, GpRectF *)
 
GpStatus WINGDIPAPI GdipGetLineRectI (GpLineGradient *, GpRect *)
 
GpStatus WINGDIPAPI GdipGetLineWrapMode (GpLineGradient *, GpWrapMode *)
 
GpStatus WINGDIPAPI GdipSetLineBlend (GpLineGradient *, GDIPCONST REAL *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetLineBlend (GpLineGradient *, REAL *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetLineBlendCount (GpLineGradient *, INT *)
 
GpStatus WINGDIPAPI GdipSetLinePresetBlend (GpLineGradient *, GDIPCONST ARGB *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetLinePresetBlend (GpLineGradient *, ARGB *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount (GpLineGradient *, INT *)
 
GpStatus WINGDIPAPI GdipGetLineTransform (GpLineGradient *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipMultiplyLineTransform (GpLineGradient *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipResetLineTransform (GpLineGradient *)
 
GpStatus WINGDIPAPI GdipRotateLineTransform (GpLineGradient *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipScaleLineTransform (GpLineGradient *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetLineColors (GpLineGradient *, ARGB, ARGB)
 
GpStatus WINGDIPAPI GdipSetLineGammaCorrection (GpLineGradient *, BOOL)
 
GpStatus WINGDIPAPI GdipSetLineSigmaBlend (GpLineGradient *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipSetLineTransform (GpLineGradient *, GDIPCONST GpMatrix *)
 
GpStatus WINGDIPAPI GdipSetLineLinearBlend (GpLineGradient *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipSetLineWrapMode (GpLineGradient *, GpWrapMode)
 
GpStatus WINGDIPAPI GdipTranslateLineTransform (GpLineGradient *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipCloneMatrix (GpMatrix *, GpMatrix **)
 
GpStatus WINGDIPAPI GdipCreateMatrix (GpMatrix **)
 
GpStatus WINGDIPAPI GdipCreateMatrix2 (REAL, REAL, REAL, REAL, REAL, REAL, GpMatrix **)
 
GpStatus WINGDIPAPI GdipCreateMatrix3 (GDIPCONST GpRectF *, GDIPCONST GpPointF *, GpMatrix **)
 
GpStatus WINGDIPAPI GdipCreateMatrix3I (GDIPCONST GpRect *, GDIPCONST GpPoint *, GpMatrix **)
 
GpStatus WINGDIPAPI GdipDeleteMatrix (GpMatrix *)
 
GpStatus WINGDIPAPI GdipGetMatrixElements (GDIPCONST GpMatrix *, REAL *)
 
GpStatus WINGDIPAPI GdipInvertMatrix (GpMatrix *)
 
GpStatus WINGDIPAPI GdipIsMatrixEqual (GDIPCONST GpMatrix *, GDIPCONST GpMatrix *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsMatrixIdentity (GDIPCONST GpMatrix *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsMatrixInvertible (GDIPCONST GpMatrix *, BOOL *)
 
GpStatus WINGDIPAPI GdipMultiplyMatrix (GpMatrix *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipRotateMatrix (GpMatrix *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipShearMatrix (GpMatrix *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipScaleMatrix (GpMatrix *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetMatrixElements (GpMatrix *, REAL, REAL, REAL, REAL, REAL, REAL)
 
GpStatus WINGDIPAPI GdipTransformMatrixPoints (GpMatrix *, GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipTransformMatrixPointsI (GpMatrix *, GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipTranslateMatrix (GpMatrix *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints (GpMatrix *, GpPointF *, INT)
 
GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI (GpMatrix *, GpPoint *, INT)
 
GpStatus WINGDIPAPI GdipConvertToEmfPlus (const GpGraphics *, GpMetafile *, INT *, EmfType, const WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile (const GpGraphics *, GpMetafile *, INT *, const WCHAR *, EmfType, const WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream (const GpGraphics *, GpMetafile *, INT *, IStream *, EmfType, const WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf (HENHMETAFILE, BOOL, GpMetafile **)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromWmf (HMETAFILE, BOOL, GDIPCONST WmfPlaceableFileHeader *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile (GDIPCONST WCHAR *, GDIPCONST WmfPlaceableFileHeader *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromFile (GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromStream (IStream *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipGetMetafileDownLevelRasterizationLimit (GDIPCONST GpMetafile *, UINT *)
 
GpStatus WINGDIPAPI GdipGetHemfFromMetafile (GpMetafile *, HENHMETAFILE *)
 
GpStatus WINGDIPAPI GdipPlayMetafileRecord (GDIPCONST GpMetafile *, EmfPlusRecordType, UINT, UINT, GDIPCONST BYTE *)
 
GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit (GpMetafile *, UINT)
 
GpStatus WINGDIPAPI GdipRecordMetafile (HDC, EmfType, GDIPCONST GpRectF *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipRecordMetafileI (HDC, EmfType, GDIPCONST GpRect *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipRecordMetafileStream (IStream *, HDC, EmfType, GDIPCONST GpRectF *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipRecordMetafileStreamI (IStream *, HDC, EmfType, GDIPCONST GpRect *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf (HENHMETAFILE, MetafileHeader *)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile (GDIPCONST WCHAR *, MetafileHeader *)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile (GpMetafile *, MetafileHeader *)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream (IStream *, MetafileHeader *)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf (HMETAFILE, GDIPCONST WmfPlaceableFileHeader *, MetafileHeader *)
 
GpStatus WINAPI GdiplusNotificationHook (ULONG_PTR *)
 
void WINAPI GdiplusNotificationUnhook (ULONG_PTR)
 
GpStatus WINGDIPAPI GdipCreatePathGradient (GDIPCONST GpPointF *, INT, GpWrapMode, GpPathGradient **)
 
GpStatus WINGDIPAPI GdipCreatePathGradientI (GDIPCONST GpPoint *, INT, GpWrapMode, GpPathGradient **)
 
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath (GDIPCONST GpPath *, GpPathGradient **)
 
GpStatus WINGDIPAPI GdipGetPathGradientBlend (GpPathGradient *, REAL *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetPathGradientBlendCount (GpPathGradient *, INT *)
 
GpStatus WINGDIPAPI GdipGetPathGradientCenterColor (GpPathGradient *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint (GpPathGradient *, GpPointF *)
 
GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI (GpPathGradient *, GpPoint *)
 
GpStatus WINGDIPAPI GdipGetPathGradientFocusScales (GpPathGradient *, REAL *, REAL *)
 
GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection (GpPathGradient *, BOOL *)
 
GpStatus WINGDIPAPI GdipGetPathGradientPath (GpPathGradient *, GpPath *)
 
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend (GpPathGradient *, ARGB *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount (GpPathGradient *, INT *)
 
GpStatus WINGDIPAPI GdipGetPathGradientPointCount (GpPathGradient *, INT *)
 
GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend (GpPathGradient *, GDIPCONST ARGB *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetPathGradientRect (GpPathGradient *, GpRectF *)
 
GpStatus WINGDIPAPI GdipGetPathGradientRectI (GpPathGradient *, GpRect *)
 
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount (GpPathGradient *, ARGB *, INT *)
 
GpStatus WINGDIPAPI GdipGetPathGradientTransform (GpPathGradient *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipGetPathGradientWrapMode (GpPathGradient *, GpWrapMode *)
 
GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform (GpPathGradient *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipResetPathGradientTransform (GpPathGradient *)
 
GpStatus WINGDIPAPI GdipRotatePathGradientTransform (GpPathGradient *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipScalePathGradientTransform (GpPathGradient *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend (GpPathGradient *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipSetPathGradientBlend (GpPathGradient *, GDIPCONST REAL *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipSetPathGradientCenterColor (GpPathGradient *, ARGB)
 
GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint (GpPathGradient *, GpPointF *)
 
GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI (GpPathGradient *, GpPoint *)
 
GpStatus WINGDIPAPI GdipSetPathGradientFocusScales (GpPathGradient *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection (GpPathGradient *, BOOL)
 
GpStatus WINGDIPAPI GdipSetPathGradientPath (GpPathGradient *, GDIPCONST GpPath *)
 
GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend (GpPathGradient *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount (GpPathGradient *, GDIPCONST ARGB *, INT *)
 
GpStatus WINGDIPAPI GdipSetPathGradientWrapMode (GpPathGradient *, GpWrapMode)
 
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount (GpPathGradient *, INT *)
 
GpStatus WINGDIPAPI GdipSetPathGradientTransform (GpPathGradient *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipTranslatePathGradientTransform (GpPathGradient *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipCreatePathIter (GpPathIterator **, GpPath *)
 
GpStatus WINGDIPAPI GdipDeletePathIter (GpPathIterator *)
 
GpStatus WINGDIPAPI GdipPathIterCopyData (GpPathIterator *, INT *, GpPointF *, BYTE *, INT, INT)
 
GpStatus WINGDIPAPI GdipPathIterGetCount (GpPathIterator *, INT *)
 
GpStatus WINGDIPAPI GdipPathIterGetSubpathCount (GpPathIterator *, INT *)
 
GpStatus WINGDIPAPI GdipPathIterEnumerate (GpPathIterator *, INT *, GpPointF *, BYTE *, INT)
 
GpStatus WINGDIPAPI GdipPathIterHasCurve (GpPathIterator *, BOOL *)
 
GpStatus WINGDIPAPI GdipPathIterIsValid (GpPathIterator *, BOOL *)
 
GpStatus WINGDIPAPI GdipPathIterNextMarker (GpPathIterator *, INT *, INT *, INT *)
 
GpStatus WINGDIPAPI GdipPathIterNextMarkerPath (GpPathIterator *, INT *, GpPath *)
 
GpStatus WINGDIPAPI GdipPathIterNextPathType (GpPathIterator *, INT *, BYTE *, INT *, INT *)
 
GpStatus WINGDIPAPI GdipPathIterNextSubpath (GpPathIterator *, INT *, INT *, INT *, BOOL *)
 
GpStatus WINGDIPAPI GdipPathIterNextSubpathPath (GpPathIterator *, INT *, GpPath *, BOOL *)
 
GpStatus WINGDIPAPI GdipPathIterRewind (GpPathIterator *)
 
GpStatus WINGDIPAPI GdipClonePen (GpPen *, GpPen **)
 
GpStatus WINGDIPAPI GdipCreatePen1 (ARGB, REAL, GpUnit, GpPen **)
 
GpStatus WINGDIPAPI GdipCreatePen2 (GpBrush *, REAL, GpUnit, GpPen **)
 
GpStatus WINGDIPAPI GdipDeletePen (GpPen *)
 
GpStatus WINGDIPAPI GdipGetPenBrushFill (GpPen *, GpBrush **)
 
GpStatus WINGDIPAPI GdipGetPenColor (GpPen *, ARGB *)
 
GpStatus WINGDIPAPI GdipGetPenCompoundArray (GpPen *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetPenCompoundCount (GpPen *, INT *)
 
GpStatus WINGDIPAPI GdipGetPenCustomStartCap (GpPen *, GpCustomLineCap **)
 
GpStatus WINGDIPAPI GdipGetPenCustomEndCap (GpPen *, GpCustomLineCap **)
 
GpStatus WINGDIPAPI GdipGetPenDashArray (GpPen *, REAL *, INT)
 
GpStatus WINGDIPAPI GdipGetPenDashCount (GpPen *, INT *)
 
GpStatus WINGDIPAPI GdipGetPenDashOffset (GpPen *, REAL *)
 
GpStatus WINGDIPAPI GdipGetPenDashStyle (GpPen *, GpDashStyle *)
 
GpStatus WINGDIPAPI GdipGetPenMode (GpPen *, GpPenAlignment *)
 
GpStatus WINGDIPAPI GdipGetPenTransform (GpPen *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipMultiplyPenTransform (GpPen *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipResetPenTransform (GpPen *)
 
GpStatus WINGDIPAPI GdipRotatePenTransform (GpPen *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipScalePenTransform (GpPen *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetPenBrushFill (GpPen *, GpBrush *)
 
GpStatus WINGDIPAPI GdipSetPenColor (GpPen *, ARGB)
 
GpStatus WINGDIPAPI GdipSetPenCompoundArray (GpPen *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipSetPenCustomEndCap (GpPen *, GpCustomLineCap *)
 
GpStatus WINGDIPAPI GdipSetPenCustomStartCap (GpPen *, GpCustomLineCap *)
 
GpStatus WINGDIPAPI GdipSetPenDashArray (GpPen *, GDIPCONST REAL *, INT)
 
GpStatus WINGDIPAPI GdipSetPenDashCap197819 (GpPen *, GpDashCap)
 
GpStatus WINGDIPAPI GdipSetPenDashOffset (GpPen *, REAL)
 
GpStatus WINGDIPAPI GdipSetPenDashStyle (GpPen *, GpDashStyle)
 
GpStatus WINGDIPAPI GdipSetPenEndCap (GpPen *, GpLineCap)
 
GpStatus WINGDIPAPI GdipGetPenFillType (GpPen *, GpPenType *)
 
GpStatus WINGDIPAPI GdipSetPenLineCap197819 (GpPen *, GpLineCap, GpLineCap, GpDashCap)
 
GpStatus WINGDIPAPI GdipSetPenLineJoin (GpPen *, GpLineJoin)
 
GpStatus WINGDIPAPI GdipSetPenMode (GpPen *, GpPenAlignment)
 
GpStatus WINGDIPAPI GdipSetPenMiterLimit (GpPen *, REAL)
 
GpStatus WINGDIPAPI GdipSetPenStartCap (GpPen *, GpLineCap)
 
GpStatus WINGDIPAPI GdipSetPenTransform (GpPen *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipSetPenWidth (GpPen *, REAL)
 
GpStatus WINGDIPAPI GdipGetPenDashCap197819 (GpPen *, GpDashCap *)
 
GpStatus WINGDIPAPI GdipGetPenEndCap (GpPen *, GpLineCap *)
 
GpStatus WINGDIPAPI GdipGetPenLineJoin (GpPen *, GpLineJoin *)
 
GpStatus WINGDIPAPI GdipGetPenMiterLimit (GpPen *, REAL *)
 
GpStatus WINGDIPAPI GdipGetPenStartCap (GpPen *, GpLineCap *)
 
GpStatus WINGDIPAPI GdipGetPenUnit (GpPen *, GpUnit *)
 
GpStatus WINGDIPAPI GdipGetPenWidth (GpPen *, REAL *)
 
GpStatus WINGDIPAPI GdipTranslatePenTransform (GpPen *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipCloneRegion (GpRegion *, GpRegion **)
 
GpStatus WINGDIPAPI GdipCombineRegionPath (GpRegion *, GpPath *, CombineMode)
 
GpStatus WINGDIPAPI GdipCombineRegionRect (GpRegion *, GDIPCONST GpRectF *, CombineMode)
 
GpStatus WINGDIPAPI GdipCombineRegionRectI (GpRegion *, GDIPCONST GpRect *, CombineMode)
 
GpStatus WINGDIPAPI GdipCombineRegionRegion (GpRegion *, GpRegion *, CombineMode)
 
GpStatus WINGDIPAPI GdipCreateRegion (GpRegion **)
 
GpStatus WINGDIPAPI GdipCreateRegionPath (GpPath *, GpRegion **)
 
GpStatus WINGDIPAPI GdipCreateRegionRect (GDIPCONST GpRectF *, GpRegion **)
 
GpStatus WINGDIPAPI GdipCreateRegionRectI (GDIPCONST GpRect *, GpRegion **)
 
GpStatus WINGDIPAPI GdipCreateRegionRgnData (GDIPCONST BYTE *, INT, GpRegion **)
 
GpStatus WINGDIPAPI GdipCreateRegionHrgn (HRGN, GpRegion **)
 
GpStatus WINGDIPAPI GdipDeleteRegion (GpRegion *)
 
GpStatus WINGDIPAPI GdipGetRegionBounds (GpRegion *, GpGraphics *, GpRectF *)
 
GpStatus WINGDIPAPI GdipGetRegionBoundsI (GpRegion *, GpGraphics *, GpRect *)
 
GpStatus WINGDIPAPI GdipGetRegionData (GpRegion *, BYTE *, UINT, UINT *)
 
GpStatus WINGDIPAPI GdipGetRegionDataSize (GpRegion *, UINT *)
 
GpStatus WINGDIPAPI GdipGetRegionHRgn (GpRegion *, GpGraphics *, HRGN *)
 
GpStatus WINGDIPAPI GdipGetRegionScans (GpRegion *, GpRectF *, INT *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipGetRegionScansI (GpRegion *, GpRect *, INT *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipGetRegionScansCount (GpRegion *, UINT *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipIsEmptyRegion (GpRegion *, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsEqualRegion (GpRegion *, GpRegion *, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsInfiniteRegion (GpRegion *, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRegionPoint (GpRegion *, REAL, REAL, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRegionPointI (GpRegion *, INT, INT, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRegionRect (GpRegion *, REAL, REAL, REAL, REAL, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipIsVisibleRegionRectI (GpRegion *, INT, INT, INT, INT, GpGraphics *, BOOL *)
 
GpStatus WINGDIPAPI GdipSetEmpty (GpRegion *)
 
GpStatus WINGDIPAPI GdipSetInfinite (GpRegion *)
 
GpStatus WINGDIPAPI GdipTransformRegion (GpRegion *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipTranslateRegion (GpRegion *, REAL, REAL)
 
GpStatus WINGDIPAPI GdipTranslateRegionI (GpRegion *, INT, INT)
 
GpStatus WINGDIPAPI GdipCreateSolidFill (ARGB, GpSolidFill **)
 
GpStatus WINGDIPAPI GdipGetSolidFillColor (GpSolidFill *, ARGB *)
 
GpStatus WINGDIPAPI GdipSetSolidFillColor (GpSolidFill *, ARGB)
 
GpStatus WINGDIPAPI GdipCloneStringFormat (GDIPCONST GpStringFormat *, GpStringFormat **)
 
GpStatus WINGDIPAPI GdipCreateStringFormat (INT, LANGID, GpStringFormat **)
 
GpStatus WINGDIPAPI GdipDeleteStringFormat (GpStringFormat *)
 
GpStatus WINGDIPAPI GdipGetStringFormatAlign (GpStringFormat *, StringAlignment *)
 
GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution (GDIPCONST GpStringFormat *, LANGID *, StringDigitSubstitute *)
 
GpStatus WINGDIPAPI GdipGetStringFormatFlags (GDIPCONST GpStringFormat *, INT *)
 
GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix (GDIPCONST GpStringFormat *, INT *)
 
GpStatus WINGDIPAPI GdipGetStringFormatLineAlign (GpStringFormat *, StringAlignment *)
 
GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount (GDIPCONST GpStringFormat *, INT *)
 
GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount (GDIPCONST GpStringFormat *, INT *)
 
GpStatus WINGDIPAPI GdipGetStringFormatTabStops (GDIPCONST GpStringFormat *, INT, REAL *, REAL *)
 
GpStatus WINGDIPAPI GdipGetStringFormatTrimming (GpStringFormat *, StringTrimming *)
 
GpStatus WINGDIPAPI GdipSetStringFormatAlign (GpStringFormat *, StringAlignment)
 
GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution (GpStringFormat *, LANGID, StringDigitSubstitute)
 
GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix (GpStringFormat *, INT)
 
GpStatus WINGDIPAPI GdipSetStringFormatLineAlign (GpStringFormat *, StringAlignment)
 
GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges (GpStringFormat *, INT, GDIPCONST CharacterRange *)
 
GpStatus WINGDIPAPI GdipSetStringFormatTabStops (GpStringFormat *, REAL, INT, GDIPCONST REAL *)
 
GpStatus WINGDIPAPI GdipSetStringFormatTrimming (GpStringFormat *, StringTrimming)
 
GpStatus WINGDIPAPI GdipSetStringFormatFlags (GpStringFormat *, INT)
 
GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault (GpStringFormat **)
 
GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic (GpStringFormat **)
 
GpStatus WINGDIPAPI GdipCreateTexture (GpImage *, GpWrapMode, GpTexture **)
 
GpStatus WINGDIPAPI GdipCreateTexture2 (GpImage *, GpWrapMode, REAL, REAL, REAL, REAL, GpTexture **)
 
GpStatus WINGDIPAPI GdipCreateTexture2I (GpImage *, GpWrapMode, INT, INT, INT, INT, GpTexture **)
 
GpStatus WINGDIPAPI GdipCreateTextureIA (GpImage *, GDIPCONST GpImageAttributes *, REAL, REAL, REAL, REAL, GpTexture **)
 
GpStatus WINGDIPAPI GdipCreateTextureIAI (GpImage *, GDIPCONST GpImageAttributes *, INT, INT, INT, INT, GpTexture **)
 
GpStatus WINGDIPAPI GdipGetTextureImage (GpTexture *, GpImage **)
 
GpStatus WINGDIPAPI GdipGetTextureTransform (GpTexture *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipGetTextureWrapMode (GpTexture *, GpWrapMode *)
 
GpStatus WINGDIPAPI GdipMultiplyTextureTransform (GpTexture *, GDIPCONST GpMatrix *, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipResetTextureTransform (GpTexture *)
 
GpStatus WINGDIPAPI GdipRotateTextureTransform (GpTexture *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipScaleTextureTransform (GpTexture *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSetTextureTransform (GpTexture *, GDIPCONST GpMatrix *)
 
GpStatus WINGDIPAPI GdipSetTextureWrapMode (GpTexture *, GpWrapMode)
 
GpStatus WINGDIPAPI GdipTranslateTextureTransform (GpTexture *, REAL, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipCreateStreamOnFile (GDIPCONST WCHAR *, UINT, IStream **)
 
GpStatus WINGDIPAPI GdipGetImageEncodersSize (UINT *numEncoders, UINT *size)
 
GpStatus WINGDIPAPI GdipGetImageEncoders (UINT numEncoders, UINT size, ImageCodecInfo *encoders)
 
GpStatus WINGDIPAPI GdipTestControl (GpTestControlEnum, void *)
 

Macro Definition Documentation

◆ GDIPCONST

#define GDIPCONST   const

Definition at line 24 of file gdiplusflat.h.

◆ WINGDIPAPI

#define WINGDIPAPI   __stdcall

Definition at line 22 of file gdiplusflat.h.

Function Documentation

◆ GdipAddPathArc()

GpStatus WINGDIPAPI GdipAddPathArc ( GpPath path,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 353 of file graphicspath.c.

355{
358 INT count;
359
360 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
361 path, x, y, width, height, startAngle, sweepAngle);
362
363 if(!path || width <= 0.0f || height <= 0.0f)
364 return InvalidParameter;
365
366 count = arc2polybezier(NULL, x, y, width, height, startAngle, sweepAngle);
367 if(count == 0)
368 return Ok;
369
370 points = malloc(sizeof(GpPointF) * count);
371 if(!points)
372 return OutOfMemory;
373
374 arc2polybezier(points, x, y, width, height, startAngle, sweepAngle);
375
377
378 free(points);
379 return status;
380}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
static GpStatus extend_current_figure(GpPath *path, GDIPCONST PointF *points, INT count, BYTE type)
Definition: graphicspath.c:297
INT arc2polybezier(GpPointF *points, REAL left, REAL top, REAL width, REAL height, REAL start_angle, REAL sweep_angle)
Definition: gdiplus.c:223
@ PathPointTypeBezier
Definition: gdiplusenums.h:85
Status
Definition: gdiplustypes.h:24
@ Ok
Definition: gdiplustypes.h:25
@ InvalidParameter
Definition: gdiplustypes.h:27
@ OutOfMemory
Definition: gdiplustypes.h:28
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizei const GLfloat * points
Definition: glext.h:8112
#define TRACE(s)
Definition: solgame.cpp:4
Definition: ps.c:97
int32_t INT
Definition: typedefs.h:58

Referenced by GdipAddPathArcI(), GdipDrawArc(), test_arc(), test_flatten(), test_getregiondata(), test_linei(), test_pathpath(), and test_worldbounds().

◆ GdipAddPathArcI()

GpStatus WINGDIPAPI GdipAddPathArcI ( GpPath path,
INT  x1,
INT  y1,
INT  x2,
INT  y2,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 387 of file graphicspath.c.

389{
390 TRACE("(%p, %d, %d, %d, %d, %.2f, %.2f)\n",
391 path, x1, y1, x2, y2, startAngle, sweepAngle);
392
393 return GdipAddPathArc(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,startAngle,sweepAngle);
394}
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphicspath.c:353
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

◆ GdipAddPathBezier()

GpStatus WINGDIPAPI GdipAddPathBezier ( GpPath path,
REAL  x1,
REAL  y1,
REAL  x2,
REAL  y2,
REAL  x3,
REAL  y3,
REAL  x4,
REAL  y4 
)

Definition at line 396 of file graphicspath.c.

398{
399 PointF points[4];
400
401 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
402 path, x1, y1, x2, y2, x3, y3, x4, y4);
403
404 if(!path)
405 return InvalidParameter;
406
407 points[0].X = x1;
408 points[0].Y = y1;
409 points[1].X = x2;
410 points[1].Y = y2;
411 points[2].X = x3;
412 points[2].Y = y3;
413 points[3].X = x4;
414 points[3].Y = y4;
415
417}
static float int float int float int x3
Definition: server.c:79
static float int float int float int float int x4
Definition: server.c:79
static float int float int float int float y3
Definition: server.c:79
static float int float int float int float int float y4
Definition: server.c:79

Referenced by GdipAddPathBezierI(), test_bezier(), test_flatten(), and test_nextpathtype().

◆ GdipAddPathBezierI()

GpStatus WINGDIPAPI GdipAddPathBezierI ( GpPath path,
INT  x1,
INT  y1,
INT  x2,
INT  y2,
INT  x3,
INT  y3,
INT  x4,
INT  y4 
)

Definition at line 419 of file graphicspath.c.

421{
422 TRACE("(%p, %d, %d, %d, %d, %d, %d, %d, %d)\n",
423 path, x1, y1, x2, y2, x3, y3, x4, y4);
424
426 (REAL)x4,(REAL)y4);
427}
GpStatus WINGDIPAPI GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
Definition: graphicspath.c:396

◆ GdipAddPathBeziers()

GpStatus WINGDIPAPI GdipAddPathBeziers ( GpPath path,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 429 of file graphicspath.c.

431{
432 TRACE("(%p, %p, %d)\n", path, points, count);
433
434 if(!path || !points || ((count - 1) % 3))
435 return InvalidParameter;
436
438}

Referenced by GdipAddPathBeziersI(), GdipDrawBeziers(), and test_beziers().

◆ GdipAddPathBeziersI()

GpStatus WINGDIPAPI GdipAddPathBeziersI ( GpPath path,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 440 of file graphicspath.c.

442{
443 GpPointF *ptsF;
445 INT i;
446
447 TRACE("(%p, %p, %d)\n", path, points, count);
448
449 if(!points || ((count - 1) % 3))
450 return InvalidParameter;
451
452 ptsF = malloc(sizeof(GpPointF) * count);
453 if(!ptsF)
454 return OutOfMemory;
455
456 for(i = 0; i < count; i++){
457 ptsF[i].X = (REAL)points[i].X;
458 ptsF[i].Y = (REAL)points[i].Y;
459 }
460
462 free(ptsF);
463
464 return ret;
465}
#define Y(I)
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:429
return ret
Definition: mutex.c:146
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
Definition: glfuncs.h:248
REAL Y
Definition: gdiplustypes.h:644
REAL X
Definition: gdiplustypes.h:643

◆ GdipAddPathClosedCurve()

GpStatus WINGDIPAPI GdipAddPathClosedCurve ( GpPath path,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 467 of file graphicspath.c.

469{
470 TRACE("(%p, %p, %d)\n", path, points, count);
471
473}
GpStatus WINGDIPAPI GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphicspath.c:483

Referenced by test_addclosedcurve().

◆ GdipAddPathClosedCurve2()

GpStatus WINGDIPAPI GdipAddPathClosedCurve2 ( GpPath path,
GDIPCONST GpPointF points,
INT  count,
REAL  tension 
)

Definition at line 483 of file graphicspath.c.

485{
486 INT i, len_pt = (count + 1)*3-2;
487 GpPointF *pt;
488 GpPointF *pts;
489 REAL x1, x2, y1, y2;
491
492 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
493
494 if(!path || !points || count <= 1)
495 return InvalidParameter;
496
497 pt = malloc(len_pt * sizeof(GpPointF));
498 pts = malloc((count + 1) * sizeof(GpPointF));
499 if(!pt || !pts){
500 free(pt);
501 free(pts);
502 return OutOfMemory;
503 }
504
505 /* copy source points to extend with the last one */
506 memcpy(pts, points, sizeof(GpPointF)*count);
507 pts[count] = pts[0];
508
509 tension = tension * TENSION_CONST;
510
511 for(i = 0; i < count-1; i++){
512 calc_curve_bezier(&(pts[i]), tension, &x1, &y1, &x2, &y2);
513
514 pt[3*i+2].X = x1;
515 pt[3*i+2].Y = y1;
516 pt[3*i+3].X = pts[i+1].X;
517 pt[3*i+3].Y = pts[i+1].Y;
518 pt[3*i+4].X = x2;
519 pt[3*i+4].Y = y2;
520 }
521
522 /* points [len_pt-2] and [0] are calculated
523 separately to connect splines properly */
524 pts[0] = points[count-1];
525 pts[1] = points[0]; /* equals to start and end of a resulting path */
526 pts[2] = points[1];
527
528 calc_curve_bezier(pts, tension, &x1, &y1, &x2, &y2);
529 pt[len_pt-2].X = x1;
530 pt[len_pt-2].Y = y1;
531 pt[0].X = pts[1].X;
532 pt[0].Y = pts[1].Y;
533 pt[1].X = x2;
534 pt[1].Y = y2;
535 /* close path */
536 pt[len_pt-1].X = pt[0].X;
537 pt[len_pt-1].Y = pt[0].Y;
538
540
541 /* close figure */
542 if(stat == Ok){
543 path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath;
544 path->newfigure = TRUE;
545 }
546
547 free(pts);
548 free(pt);
549
550 return stat;
551}
#define stat
Definition: acwin.h:100
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2)
Definition: gdiplus.c:389
#define TENSION_CONST
@ PathPointTypeCloseSubpath
Definition: gdiplusenums.h:89
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: stat.h:66

Referenced by GdipAddPathClosedCurve(), GdipAddPathClosedCurve2I(), GdipDrawClosedCurve2(), GdipFillClosedCurve2(), and test_addclosedcurve().

◆ GdipAddPathClosedCurve2I()

GpStatus WINGDIPAPI GdipAddPathClosedCurve2I ( GpPath path,
GDIPCONST GpPoint points,
INT  count,
REAL  tension 
)

Definition at line 553 of file graphicspath.c.

555{
556 GpPointF *ptf;
557 INT i;
559
560 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
561
562 if(!path || !points || count <= 1)
563 return InvalidParameter;
564
565 ptf = malloc(sizeof(GpPointF) * count);
566 if(!ptf)
567 return OutOfMemory;
568
569 for(i = 0; i < count; i++){
570 ptf[i].X = (REAL)points[i].X;
571 ptf[i].Y = (REAL)points[i].Y;
572 }
573
574 stat = GdipAddPathClosedCurve2(path, ptf, count, tension);
575
576 free(ptf);
577
578 return stat;
579}

Referenced by GdipAddPathClosedCurveI().

◆ GdipAddPathClosedCurveI()

GpStatus WINGDIPAPI GdipAddPathClosedCurveI ( GpPath path,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 475 of file graphicspath.c.

477{
478 TRACE("(%p, %p, %d)\n", path, points, count);
479
481}
GpStatus WINGDIPAPI GdipAddPathClosedCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphicspath.c:553

◆ GdipAddPathCurve()

GpStatus WINGDIPAPI GdipAddPathCurve ( GpPath path,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 581 of file graphicspath.c.

582{
583 TRACE("(%p, %p, %d)\n", path, points, count);
584
585 return GdipAddPathCurve3(path, points, count, 0, count - 1, 0.5);
586}
GpStatus WINGDIPAPI GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points, INT count, INT offset, INT nseg, REAL tension)
Definition: graphicspath.c:595

Referenced by test_addcurve().

◆ GdipAddPathCurve2()

GpStatus WINGDIPAPI GdipAddPathCurve2 ( GpPath path,
GDIPCONST GpPointF points,
INT  count,
REAL  tension 
)

Definition at line 667 of file graphicspath.c.

669{
670 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
671
672 return GdipAddPathCurve3(path, points, count, 0, count - 1, tension);
673}

Referenced by GdipDrawCurve2(), and test_addcurve().

◆ GdipAddPathCurve2I()

GpStatus WINGDIPAPI GdipAddPathCurve2I ( GpPath path,
GDIPCONST GpPoint points,
INT  count,
REAL  tension 
)

Definition at line 659 of file graphicspath.c.

661{
662 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
663
664 return GdipAddPathCurve3I(path, points, count, 0, count - 1, tension);
665}
GpStatus WINGDIPAPI GdipAddPathCurve3I(GpPath *path, GDIPCONST GpPoint *points, INT count, INT offset, INT nseg, REAL tension)
Definition: graphicspath.c:675

◆ GdipAddPathCurve3()

GpStatus WINGDIPAPI GdipAddPathCurve3 ( GpPath path,
GDIPCONST GpPointF points,
INT  count,
INT  offset,
INT  nseg,
REAL  tension 
)

Definition at line 595 of file graphicspath.c.

597{
598 INT i, len_pt = nseg * 3 + 1;
599 GpPointF *pt;
600 REAL x1, x2, y1, y2;
602 TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension);
603
604 if(!path || !points || offset + 1 >= count || count - offset < nseg + 1 || nseg < 1)
605 return InvalidParameter;
606
607 pt = calloc(len_pt, sizeof(GpPointF));
608 if(!pt)
609 return OutOfMemory;
610
611 tension = tension * TENSION_CONST;
612
613 pt[0].X = points[offset].X;
614 pt[0].Y = points[offset].Y;
615 if (offset > 0)
616 {
617 calc_curve_bezier(&(points[offset - 1]), tension, &x1, &y1, &x2, &y2);
618 pt[1].X = x2;
619 pt[1].Y = y2;
620 }
621 else
622 {
624 points[offset + 1].X, points[offset + 1].Y, tension, &x1, &y1);
625 pt[1].X = x1;
626 pt[1].Y = y1;
627 }
628
629 for (i = 0; i < nseg - 1; i++){
630 calc_curve_bezier(&(points[offset + i]), tension, &x1, &y1, &x2, &y2);
631
632 pt[3*i+2].X = x1;
633 pt[3*i+2].Y = y1;
634 pt[3*i+3].X = points[offset + i + 1].X;
635 pt[3*i+3].Y = points[offset + i + 1].Y;
636 pt[3*i+4].X = x2;
637 pt[3*i+4].Y = y2;
638 }
639
640 if (offset + nseg + 1 < count)
641 /* If there are one more point in points table then use it for curve calculation */
642 calc_curve_bezier(&(points[offset + nseg - 1]), tension, &x1, &y1, &x2, &y2);
643 else
645 points[offset + nseg - 1].X, points[offset + nseg - 1].Y, tension, &x1, &y1);
646
647 pt[len_pt-2].X = x1;
648 pt[len_pt-2].Y = y1;
649 pt[len_pt-1].X = points[offset + nseg].X;
650 pt[len_pt-1].Y = points[offset + nseg].Y;
651
653
654 free(pt);
655
656 return stat;
657}
void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, REAL tension, REAL *x, REAL *y)
Definition: gdiplus.c:406
GLintptr offset
Definition: glext.h:5920
#define calloc
Definition: rosglue.h:14

Referenced by GdipAddPathCurve(), GdipAddPathCurve2(), GdipAddPathCurve3I(), and test_addcurve().

◆ GdipAddPathCurve3I()

GpStatus WINGDIPAPI GdipAddPathCurve3I ( GpPath path,
GDIPCONST GpPoint points,
INT  count,
INT  offset,
INT  nseg,
REAL  tension 
)

Definition at line 675 of file graphicspath.c.

677{
678 GpPointF *ptf;
679 INT i;
681
682 TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension);
683
684 if(!path || !points || offset + 1 >= count || count - offset < nseg + 1 || nseg < 1)
685 return InvalidParameter;
686
687 ptf = malloc(sizeof(GpPointF) * count);
688 if(!ptf)
689 return OutOfMemory;
690
691 for(i = 0; i < count; i++) {
692 ptf[i].X = (REAL)points[i].X;
693 ptf[i].Y = (REAL)points[i].Y;
694 }
695
696 stat = GdipAddPathCurve3(path, ptf, count, offset, nseg, tension);
697
698 free(ptf);
699
700 return stat;
701}

Referenced by GdipAddPathCurve2I(), and GdipAddPathCurveI().

◆ GdipAddPathCurveI()

GpStatus WINGDIPAPI GdipAddPathCurveI ( GpPath path,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 588 of file graphicspath.c.

589{
590 TRACE("(%p, %p, %d)\n", path, points, count);
591
592 return GdipAddPathCurve3I(path, points, count, 0, count - 1, 0.5);
593}

◆ GdipAddPathEllipse()

GpStatus WINGDIPAPI GdipAddPathEllipse ( GpPath path,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 703 of file graphicspath.c.

705{
706 INT old_count, numpts;
707
708 TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height);
709
710 if(!path)
711 return InvalidParameter;
712
714 return OutOfMemory;
715
716 old_count = path->pathdata.Count;
717 if((numpts = arc2polybezier(&path->pathdata.Points[old_count], x, y, width,
718 height, 0.0, 360.0)) != MAX_ARC_PTS){
719 ERR("expected %d points but got %d\n", MAX_ARC_PTS, numpts);
720 return GenericError;
721 }
722
723 memset(&path->pathdata.Types[old_count + 1], PathPointTypeBezier,
724 MAX_ARC_PTS - 1);
725
726 /* An ellipse is an intrinsic figure (always is its own subpath). */
727 path->pathdata.Types[old_count] = PathPointTypeStart;
728 path->pathdata.Types[old_count + MAX_ARC_PTS - 1] |= PathPointTypeCloseSubpath;
729 path->newfigure = TRUE;
730 path->pathdata.Count += MAX_ARC_PTS;
731
732 return Ok;
733}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL lengthen_path(GpPath *path, INT len)
Definition: gdiplus.c:415
#define MAX_ARC_PTS
@ PathPointTypeStart
Definition: gdiplusenums.h:83
@ GenericError
Definition: gdiplustypes.h:26
#define memset(x, y, z)
Definition: compat.h:39

Referenced by GdipAddPathEllipseI(), GdipDrawEllipse(), GdipFillEllipse(), test_combinereplace(), test_ellipse(), test_flatten(), test_hascurve(), test_isvisiblepoint(), test_isvisiblerect(), test_nextpathtype(), test_pathgradientcenterpoint(), test_transform(), and test_translate().

◆ GdipAddPathEllipseI()

GpStatus WINGDIPAPI GdipAddPathEllipseI ( GpPath path,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 735 of file graphicspath.c.

737{
738 TRACE("(%p, %d, %d, %d, %d)\n", path, x, y, width, height);
739
741}
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height)
Definition: graphicspath.c:703

◆ GdipAddPathLine()

◆ GdipAddPathLine2()

GpStatus WINGDIPAPI GdipAddPathLine2 ( GpPath path,
GDIPCONST GpPointF points,
INT  count 
)

◆ GdipAddPathLine2I()

GpStatus WINGDIPAPI GdipAddPathLine2I ( GpPath path,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 754 of file graphicspath.c.

755{
756 GpPointF *pointsF;
757 INT i;
759
760 TRACE("(%p, %p, %d)\n", path, points, count);
761
762 if(count <= 0)
763 return InvalidParameter;
764
765 pointsF = malloc(sizeof(GpPointF) * count);
766 if(!pointsF) return OutOfMemory;
767
768 for(i = 0;i < count; i++){
769 pointsF[i].X = (REAL)points[i].X;
770 pointsF[i].Y = (REAL)points[i].Y;
771 }
772
773 stat = GdipAddPathLine2(path, pointsF, count);
774
775 free(pointsF);
776
777 return stat;
778}
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:743

Referenced by GdipCreatePathGradientI().

◆ GdipAddPathLineI()

GpStatus WINGDIPAPI GdipAddPathLineI ( GpPath path,
INT  x1,
INT  y1,
INT  x2,
INT  y2 
)

Definition at line 826 of file graphicspath.c.

827{
828 TRACE("(%p, %d, %d, %d, %d)\n", path, x1, y1, x2, y2);
829
830 return GdipAddPathLine(path, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
831}
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:804

Referenced by test_GdipFillPath(), test_linei(), and test_rect_line().

◆ GdipAddPathPath()

GpStatus WINGDIPAPI GdipAddPathPath ( GpPath path,
GDIPCONST GpPath addingPath,
BOOL  connect 
)

Definition at line 833 of file graphicspath.c.

835{
836 INT old_count, count;
837
838 TRACE("(%p, %p, %d)\n", path, addingPath, connect);
839
840 if(!path || !addingPath)
841 return InvalidParameter;
842
843 old_count = path->pathdata.Count;
844 count = addingPath->pathdata.Count;
845
847 return OutOfMemory;
848
849 memcpy(&path->pathdata.Points[old_count], addingPath->pathdata.Points,
850 count * sizeof(GpPointF));
851 memcpy(&path->pathdata.Types[old_count], addingPath->pathdata.Types, count);
852
853 if(path->newfigure || !connect)
854 path->pathdata.Types[old_count] = PathPointTypeStart;
855 else
856 path->pathdata.Types[old_count] = PathPointTypeLine;
857
858 path->newfigure = FALSE;
859 path->pathdata.Count += count;
860
861 return Ok;
862}
#define FALSE
Definition: types.h:117

Referenced by test_pathpath().

◆ GdipAddPathPie()

GpStatus WINGDIPAPI GdipAddPathPie ( GpPath path,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 864 of file graphicspath.c.

866{
867 GpPointF *ptf;
869 INT i, count;
870
871 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
872 path, x, y, width, height, startAngle, sweepAngle);
873
874 if(!path)
875 return InvalidParameter;
876
877 /* on zero width/height only start point added */
878 if(width <= 1e-7 || height <= 1e-7){
879 if(!lengthen_path(path, 1))
880 return OutOfMemory;
881 path->pathdata.Points[0].X = x + width / 2.0;
882 path->pathdata.Points[0].Y = y + height / 2.0;
884 path->pathdata.Count = 1;
885 return InvalidParameter;
886 }
887
888 count = arc2polybezier(NULL, x, y, width, height, startAngle, sweepAngle);
889
890 if(count == 0)
891 return Ok;
892
893 ptf = malloc(sizeof(GpPointF) * count);
894 if(!ptf)
895 return OutOfMemory;
896
897 arc2polybezier(ptf, x, y, width, height, startAngle, sweepAngle);
898
899 status = GdipAddPathLine(path, x + width/2, y + height/2, ptf[0].X, ptf[0].Y);
900 if(status != Ok){
901 free(ptf);
902 return status;
903 }
904 /* one spline is already added as a line endpoint */
905 if(!lengthen_path(path, count - 1)){
906 free(ptf);
907 return OutOfMemory;
908 }
909
910 memcpy(&(path->pathdata.Points[path->pathdata.Count]), &(ptf[1]),sizeof(GpPointF)*(count-1));
911 for(i = 0; i < count-1; i++)
912 path->pathdata.Types[path->pathdata.Count+i] = PathPointTypeBezier;
913
914 path->pathdata.Count += count-1;
915
917
918 free(ptf);
919
920 return status;
921}
GpStatus WINGDIPAPI GdipClosePathFigure(GpPath *path)
#define e
Definition: ke_i.h:82

Referenced by GdipAddPathPieI(), GdipDrawPie(), GdipFillPie(), and test_addpie().

◆ GdipAddPathPieI()

GpStatus WINGDIPAPI GdipAddPathPieI ( GpPath path,
INT  x,
INT  y,
INT  width,
INT  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 923 of file graphicspath.c.

925{
926 TRACE("(%p, %d, %d, %d, %d, %.2f, %.2f)\n",
927 path, x, y, width, height, startAngle, sweepAngle);
928
929 return GdipAddPathPie(path, (REAL)x, (REAL)y, (REAL)width, (REAL)height, startAngle, sweepAngle);
930}
GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphicspath.c:864

◆ GdipAddPathPolygon()

GpStatus WINGDIPAPI GdipAddPathPolygon ( GpPath path,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 932 of file graphicspath.c.

933{
934 INT old_count;
935
936 TRACE("(%p, %p, %d)\n", path, points, count);
937
938 if(!path || !points || count < 3)
939 return InvalidParameter;
940
942 return OutOfMemory;
943
944 old_count = path->pathdata.Count;
945
946 memcpy(&path->pathdata.Points[old_count], points, count*sizeof(GpPointF));
947 memset(&path->pathdata.Types[old_count + 1], PathPointTypeLine, count - 1);
948
949 /* A polygon is an intrinsic figure */
950 path->pathdata.Types[old_count] = PathPointTypeStart;
951 path->pathdata.Types[old_count + count - 1] |= PathPointTypeCloseSubpath;
952 path->newfigure = TRUE;
953 path->pathdata.Count += count;
954
955 return Ok;
956}

Referenced by GdipAddPathPolygonI(), GdipDrawPolygon(), GdipEnumerateMetafileSrcRectDestPoints(), GdipFillPolygon(), test_incombinedregion(), and test_polygon().

◆ GdipAddPathPolygonI()

GpStatus WINGDIPAPI GdipAddPathPolygonI ( GpPath path,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 958 of file graphicspath.c.

959{
960 GpPointF *ptf;
962 INT i;
963
964 TRACE("(%p, %p, %d)\n", path, points, count);
965
966 if(!points || count < 3)
967 return InvalidParameter;
968
969 ptf = malloc(sizeof(GpPointF) * count);
970 if(!ptf)
971 return OutOfMemory;
972
973 for(i = 0; i < count; i++){
974 ptf[i].X = (REAL)points[i].X;
975 ptf[i].Y = (REAL)points[i].Y;
976 }
977
979
980 free(ptf);
981
982 return status;
983}
GpStatus WINGDIPAPI GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:932

Referenced by GdipFillPolygonI().

◆ GdipAddPathRectangle()

GpStatus WINGDIPAPI GdipAddPathRectangle ( GpPath path,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 2671 of file graphicspath.c.

2673{
2674 GpPath *backup;
2675 GpPointF ptf[2];
2676 GpStatus retstat;
2677 BOOL old_new;
2678
2679 TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height);
2680
2681 if(!path)
2682 return InvalidParameter;
2683
2684 if (width <= 0.0 || height <= 0.0)
2685 return Ok;
2686
2687 /* make a backup copy of path data */
2688 if((retstat = GdipClonePath(path, &backup)) != Ok)
2689 return retstat;
2690
2691 /* rectangle should start as new path */
2692 old_new = path->newfigure;
2693 path->newfigure = TRUE;
2694 if((retstat = GdipAddPathLine(path,x,y,x+width,y)) != Ok){
2695 path->newfigure = old_new;
2696 goto fail;
2697 }
2698
2699 ptf[0].X = x+width;
2700 ptf[0].Y = y+height;
2701 ptf[1].X = x;
2702 ptf[1].Y = y+height;
2703
2704 if((retstat = GdipAddPathLine2(path, ptf, 2)) != Ok) goto fail;
2705 path->pathdata.Types[path->pathdata.Count-1] |= PathPointTypeCloseSubpath;
2706 path->newfigure = TRUE;
2707
2708 /* free backup */
2710 return Ok;
2711
2712fail:
2713 /* reverting */
2714 free(path->pathdata.Points);
2715 free(path->pathdata.Types);
2716 memcpy(path, backup, sizeof(*path));
2717 free(backup);
2718
2719 return retstat;
2720}
static long backup()
Definition: maze.c:403
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipClonePath(GpPath *path, GpPath **clone)
unsigned int BOOL
Definition: ntddk_ex.h:94

Referenced by GdipAddPathRectangleI(), GdipAddPathRectangles(), GdipCreateRegionHrgn(), get_region_hrgn(), test_captype(), test_constructor_destructor(), test_empty_rect(), test_GdipFillPath(), test_getbounds(), test_gethrgn(), test_getregiondata(), test_hascurve(), test_inset(), test_is_outline_visible_path_point(), test_isvisible(), test_lastpoint(), test_linejoin(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_pen(), test_rect(), test_scale(), test_strokecap(), and transform_region_element().

◆ GdipAddPathRectangleI()

GpStatus WINGDIPAPI GdipAddPathRectangleI ( GpPath path,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 2722 of file graphicspath.c.

2724{
2725 TRACE("(%p, %d, %d, %d, %d)\n", path, x, y, width, height);
2726
2728}
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)

Referenced by test_getregiondata(), and test_rect_line().

◆ GdipAddPathRectangles()

GpStatus WINGDIPAPI GdipAddPathRectangles ( GpPath path,
GDIPCONST GpRectF rects,
INT  count 
)

Definition at line 2730 of file graphicspath.c.

2731{
2732 GpPath *backup;
2733 GpStatus retstat;
2734 INT i;
2735
2736 TRACE("(%p, %p, %d)\n", path, rects, count);
2737
2738 /* count == 0 - verified condition */
2739 if(!path || !rects || count == 0)
2740 return InvalidParameter;
2741
2742 if(count < 0)
2743 return OutOfMemory;
2744
2745 /* make a backup copy */
2746 if((retstat = GdipClonePath(path, &backup)) != Ok)
2747 return retstat;
2748
2749 for(i = 0; i < count; i++){
2750 if((retstat = GdipAddPathRectangle(path,rects[i].X,rects[i].Y,rects[i].Width,rects[i].Height)) != Ok)
2751 goto fail;
2752 }
2753
2754 /* free backup */
2756 return Ok;
2757
2758fail:
2759 /* reverting */
2760 free(path->pathdata.Points);
2761 free(path->pathdata.Types);
2762 memcpy(path, backup, sizeof(*path));
2763 free(backup);
2764
2765 return retstat;
2766}
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by GdipAddPathRectanglesI(), GdipDrawRectangles(), GdipFillRectangles(), and test_rect().

◆ GdipAddPathRectanglesI()

GpStatus WINGDIPAPI GdipAddPathRectanglesI ( GpPath path,
GDIPCONST GpRect rects,
INT  count 
)

Definition at line 2768 of file graphicspath.c.

2769{
2770 GpRectF *rectsF;
2771 GpStatus retstat;
2772 INT i;
2773
2774 TRACE("(%p, %p, %d)\n", path, rects, count);
2775
2776 if(!rects || count == 0)
2777 return InvalidParameter;
2778
2779 if(count < 0)
2780 return OutOfMemory;
2781
2782 rectsF = malloc(sizeof(GpRectF) * count);
2783
2784 for(i = 0;i < count;i++)
2785 set_rect(&rectsF[i], rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height);
2786
2787 retstat = GdipAddPathRectangles(path, rectsF, count);
2788 free(rectsF);
2789
2790 return retstat;
2791}
GpStatus WINGDIPAPI GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects, INT count)
static void set_rect(GpRectF *rect, REAL x, REAL y, REAL width, REAL height)

◆ GdipAddPathString()

GpStatus WINGDIPAPI GdipAddPathString ( GpPath path,
GDIPCONST WCHAR string,
INT  length,
GDIPCONST GpFontFamily family,
INT  style,
REAL  emSize,
GDIPCONST RectF layoutRect,
GDIPCONST GpStringFormat format 
)

Definition at line 1116 of file graphicspath.c.

1117{
1118 GpFont *font;
1120 LOGFONTW lfw;
1121 HANDLE hfont;
1122 HDC dc;
1123 GpGraphics *graphics;
1124 GpPath *backup;
1125 struct format_string_args args;
1126 int i;
1127 UINT16 native_height;
1128 RectF scaled_layout_rect;
1129 TEXTMETRICW textmetric;
1130
1131 TRACE("(%p, %s, %d, %p, %d, %f, %p, %p)\n", path, debugstr_w(string), length, family, style, emSize, layoutRect, format);
1132 if (!path || !string || !family || !emSize || !layoutRect)
1133 return InvalidParameter;
1134
1135 if (!format)
1137
1138 status = GdipGetEmHeight(family, style, &native_height);
1139 if (status != Ok)
1140 return status;
1141
1142 scaled_layout_rect.X = layoutRect->X;
1143 scaled_layout_rect.Y = layoutRect->Y;
1144 scaled_layout_rect.Width = layoutRect->Width * native_height / emSize;
1145 scaled_layout_rect.Height = layoutRect->Height * native_height / emSize;
1146
1147 if ((status = GdipClonePath(path, &backup)) != Ok)
1148 return status;
1149
1151 status = GdipCreateFromHDC(dc, &graphics);
1152 if (status != Ok)
1153 {
1154 DeleteDC(dc);
1156 return status;
1157 }
1158
1159 status = GdipCreateFont(family, native_height, style, UnitPixel, &font);
1160 if (status != Ok)
1161 {
1162 GdipDeleteGraphics(graphics);
1163 DeleteDC(dc);
1165 return status;
1166 }
1167
1168 get_log_fontW(font, graphics, &lfw);
1169
1170 hfont = CreateFontIndirectW(&lfw);
1171 if (!hfont)
1172 {
1173 WARN("Failed to create font\n");
1174 DeleteDC(dc);
1177 return GenericError;
1178 }
1179
1181
1182 GetTextMetricsW(dc, &textmetric);
1183
1184 args.path = path;
1185 args.maxY = 0;
1186 args.scale = emSize / native_height;
1187 args.ascent = textmetric.tmAscent * args.scale;
1188 status = gdip_format_string(graphics, dc, string, length, font, &scaled_layout_rect,
1190
1191 DeleteDC(dc);
1194 GdipDeleteGraphics(graphics);
1195
1196 if (status != Ok) /* free backup */
1197 {
1198 free(path->pathdata.Points);
1199 free(path->pathdata.Types);
1200 *path = *backup;
1201 free(backup);
1202 return status;
1203 }
1204 if (format->line_align == StringAlignmentCenter && layoutRect->Y + args.maxY < layoutRect->Height)
1205 {
1206 float inc = layoutRect->Height + layoutRect->Y - args.maxY;
1207 inc /= 2;
1208 for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
1209 path->pathdata.Points[i].Y += inc;
1210 } else if (format->line_align == StringAlignmentFar) {
1211 float inc = layoutRect->Height + layoutRect->Y - args.maxY;
1212 for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
1213 path->pathdata.Points[i].Y += inc;
1214 }
1216 return status;
1217}
static HFONT hfont
unsigned short UINT16
Definition: actypes.h:129
Arabic default style
Definition: afstyles.h:94
#define WARN(fmt,...)
Definition: precomp.h:61
HDC dc
Definition: cylfrac.c:34
GpStatus WINGDIPAPI GdipDeleteFont(GpFont *font)
Definition: font.c:272
GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
Definition: font.c:150
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
Definition: font.c:872
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
Definition: graphics.c:2434
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
Definition: graphics.c:2616
static GpStatus format_string_callback(struct gdip_format_string_info *info)
pKey DeleteObject()
GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data)
Definition: graphics.c:5478
const struct GpStringFormat default_drawstring_format
Definition: stringformat.c:35
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *)
Definition: graphics.c:2353
@ StringAlignmentCenter
Definition: gdiplusenums.h:264
@ StringAlignmentFar
Definition: gdiplusenums.h:265
@ UnitPixel
Definition: gdiplusenums.h:29
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define debugstr_w
Definition: kernel32.h:32
static HDC
Definition: imagelist.c:88
Definition: mk_font.cpp:20
REAL Height
Definition: gdiplustypes.h:659
REAL X
Definition: gdiplustypes.h:656
REAL Width
Definition: gdiplustypes.h:658
REAL Y
Definition: gdiplustypes.h:657
Definition: match.c:390
Definition: format.c:58
LONG tmAscent
Definition: wingdi.h:2830
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by GdipAddPathStringI().

◆ GdipAddPathStringI()

GpStatus WINGDIPAPI GdipAddPathStringI ( GpPath path,
GDIPCONST WCHAR string,
INT  length,
GDIPCONST GpFontFamily family,
INT  style,
REAL  emSize,
GDIPCONST Rect layoutRect,
GDIPCONST GpStringFormat format 
)

Definition at line 1219 of file graphicspath.c.

1221{
1222 RectF rect;
1223
1224 if (!layoutRect)
1225 return InvalidParameter;
1226
1227 set_rect(&rect, layoutRect->X, layoutRect->Y, layoutRect->Width, layoutRect->Height);
1228 return GdipAddPathString(path, string, length, family, style, emSize, &rect, format);
1229}
RECT rect
Definition: combotst.c:67
GpStatus WINGDIPAPI GdipAddPathString(GpPath *path, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFontFamily *family, INT style, REAL emSize, GDIPCONST RectF *layoutRect, GDIPCONST GpStringFormat *format)

◆ GdipBeginContainer()

GpStatus WINGDIPAPI GdipBeginContainer ( GpGraphics graphics,
GDIPCONST GpRectF dstrect,
GDIPCONST GpRectF srcrect,
GpUnit  unit,
GraphicsContainer state 
)

Definition at line 6280 of file graphics.c.

6281{
6284 GpStatus stat;
6285 GpRectF scaled_srcrect;
6286 REAL scale_x, scale_y;
6287
6288 TRACE("(%p, %s, %s, %d, %p)\n", graphics, debugstr_rectf(dstrect), debugstr_rectf(srcrect), unit, state);
6289
6290 if(!graphics || !dstrect || !srcrect || unit < UnitPixel || unit > UnitMillimeter || !state)
6291 return InvalidParameter;
6292
6294 if(stat != Ok)
6295 return stat;
6296
6297 list_add_head(&graphics->containers, &container->entry);
6298 *state = graphics->contid = container->contid;
6299
6300 scale_x = units_to_pixels(1.0, unit, graphics->xres, graphics->printer_display);
6301 scale_y = units_to_pixels(1.0, unit, graphics->yres, graphics->printer_display);
6302
6303 scaled_srcrect.X = scale_x * srcrect->X;
6304 scaled_srcrect.Y = scale_y * srcrect->Y;
6305 scaled_srcrect.Width = scale_x * srcrect->Width;
6306 scaled_srcrect.Height = scale_y * srcrect->Height;
6307
6308 transform.matrix[0] = dstrect->Width / scaled_srcrect.Width;
6309 transform.matrix[1] = 0.0;
6310 transform.matrix[2] = 0.0;
6311 transform.matrix[3] = dstrect->Height / scaled_srcrect.Height;
6312 transform.matrix[4] = dstrect->X - scaled_srcrect.X;
6313 transform.matrix[5] = dstrect->Y - scaled_srcrect.Y;
6314
6316
6317 if (is_metafile_graphics(graphics))
6318 METAFILE_BeginContainer((GpMetafile*)graphics->image, dstrect, srcrect, unit, container->contid);
6319
6320 return Ok;
6321}
static int state
Definition: maze.c:121
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static BOOL is_metafile_graphics(const GpGraphics *graphics)
Definition: graphics.c:157
static GpStatus init_container(GraphicsContainerItem **container, GDIPCONST GpGraphics *graphics, GraphicsContainerType type)
Definition: graphics.c:2170
@ BEGIN_CONTAINER
Definition: graphics.c:2147
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
Definition: matrix.c:239
const char * debugstr_rectf(const RectF *rc)
Definition: gdiplus.c:486
REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi, BOOL printer_display)
Definition: gdiplus.c:329
GpStatus METAFILE_BeginContainer(GpMetafile *metafile, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex)
Definition: metafile.c:1564
@ MatrixOrderPrepend
Definition: gdiplusenums.h:187
@ UnitMillimeter
Definition: gdiplusenums.h:33
GLuint GLenum GLenum transform
Definition: glext.h:9407
png_const_structrp png_const_inforp int * unit
Definition: png.h:2392
GpMatrix worldtrans
struct list containers
GpImage * image
GraphicsContainer contid
BOOL printer_display
struct list entry
Definition: metafile.c:157

Referenced by GdipBeginContainerI(), test_container_rects(), and test_containers().

◆ GdipBeginContainer2()

GpStatus WINGDIPAPI GdipBeginContainer2 ( GpGraphics graphics,
GraphicsContainer state 
)

Definition at line 6273 of file graphics.c.

6275{
6276 TRACE("(%p, %p)\n", graphics, state);
6277 return begin_container(graphics, BEGIN_CONTAINER, state);
6278}
static GpStatus begin_container(GpGraphics *graphics, GraphicsContainerType type, GraphicsContainer *state)
Definition: graphics.c:6241

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipPlayMetafileRecord(), test_BeginContainer2(), test_containers(), and test_save_restore().

◆ GdipBeginContainerI()

GpStatus WINGDIPAPI GdipBeginContainerI ( GpGraphics graphics,
GDIPCONST GpRect dstrect,
GDIPCONST GpRect srcrect,
GpUnit  unit,
GraphicsContainer state 
)

Definition at line 6323 of file graphics.c.

6324{
6325 GpRectF dstrectf, srcrectf;
6326
6327 TRACE("(%p, %p, %p, %d, %p)\n", graphics, dstrect, srcrect, unit, state);
6328
6329 if (!dstrect || !srcrect)
6330 return InvalidParameter;
6331
6332 dstrectf.X = dstrect->X;
6333 dstrectf.Y = dstrect->Y;
6334 dstrectf.Width = dstrect->Width;
6335 dstrectf.Height = dstrect->Height;
6336
6337 srcrectf.X = srcrect->X;
6338 srcrectf.Y = srcrect->Y;
6339 srcrectf.Width = srcrect->Width;
6340 srcrectf.Height = srcrect->Height;
6341
6342 return GdipBeginContainer(graphics, &dstrectf, &srcrectf, unit, state);
6343}
GpStatus WINGDIPAPI GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state)
Definition: graphics.c:6280

◆ GdipBitmapApplyEffect()

GpStatus WINGDIPAPI GdipBitmapApplyEffect ( GpBitmap bitmap,
CGpEffect effect,
RECT roi,
BOOL  useAuxData,
VOID **  auxData,
INT auxDataSize 
)

Definition at line 151 of file image.c.

153{
154 FIXME("(%p %p %p %d %p %p): stub\n", bitmap, effect, roi, useAuxData, auxData, auxDataSize);
155 /*
156 * Note: According to Jose Roca's GDI+ docs, this function is not
157 * implemented in Windows's GDI+.
158 */
159 return NotImplemented;
160}
#define FIXME(fmt,...)
Definition: precomp.h:53
@ NotImplemented
Definition: gdiplustypes.h:31
Definition: uimain.c:89

◆ GdipBitmapCreateApplyEffect()

GpStatus WINGDIPAPI GdipBitmapCreateApplyEffect ( GpBitmap **  inputBitmaps,
INT  numInputs,
CGpEffect effect,
RECT roi,
RECT outputRect,
GpBitmap **  outputBitmap,
BOOL  useAuxData,
VOID **  auxData,
INT auxDataSize 
)

Definition at line 162 of file image.c.

165{
166 FIXME("(%p %d %p %p %p %p %d %p %p): stub\n", inputBitmaps, numInputs, effect, roi, outputRect, outputBitmap, useAuxData, auxData, auxDataSize);
167 /*
168 * Note: According to Jose Roca's GDI+ docs, this function is not
169 * implemented in Windows's GDI+.
170 */
171 return NotImplemented;
172}

◆ GdipBitmapGetHistogram()

GpStatus WINGDIPAPI GdipBitmapGetHistogram ( GpBitmap bitmap,
HistogramFormat  format,
UINT  num_of_entries,
UINT ch0,
UINT ch1,
UINT ch2,
UINT ch3 
)

Definition at line 5953 of file image.c.

5955{
5956 static void (* const set_histogram_point[])(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3) =
5957 {
5966 };
5967 UINT width, height, x, y;
5968
5969 TRACE("(%p, %d, %u, %p, %p, %p, %p)\n", bitmap, format, num_of_entries,
5970 ch0, ch1, ch2, ch3);
5971
5972 if (!bitmap || num_of_entries != 256)
5973 return InvalidParameter;
5974
5975 /* Make sure passed channel pointers match requested format */
5976 switch (format)
5977 {
5980 if (!ch0 || !ch1 || !ch2 || !ch3)
5981 return InvalidParameter;
5982 memset(ch0, 0, num_of_entries * sizeof(UINT));
5983 memset(ch1, 0, num_of_entries * sizeof(UINT));
5984 memset(ch2, 0, num_of_entries * sizeof(UINT));
5985 memset(ch3, 0, num_of_entries * sizeof(UINT));
5986 break;
5987 case HistogramFormatRGB:
5988 if (!ch0 || !ch1 || !ch2 || ch3)
5989 return InvalidParameter;
5990 memset(ch0, 0, num_of_entries * sizeof(UINT));
5991 memset(ch1, 0, num_of_entries * sizeof(UINT));
5992 memset(ch2, 0, num_of_entries * sizeof(UINT));
5993 break;
5995 case HistogramFormatB:
5996 case HistogramFormatG:
5997 case HistogramFormatR:
5998 case HistogramFormatA:
5999 if (!ch0 || ch1 || ch2 || ch3)
6000 return InvalidParameter;
6001 memset(ch0, 0, num_of_entries * sizeof(UINT));
6002 break;
6003 default:
6004 WARN("Invalid histogram format requested, %d\n", format);
6005 return InvalidParameter;
6006 }
6007
6008 GdipGetImageWidth(&bitmap->image, &width);
6009 GdipGetImageHeight(&bitmap->image, &height);
6010
6011 for (y = 0; y < height; y++)
6012 for (x = 0; x < width; x++)
6013 {
6014 ARGB color;
6015
6017 set_histogram_point[format](color, ch0, ch1, ch2, ch3);
6018 }
6019
6020 return Ok;
6021}
static void set_histogram_point_g(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5935
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2323
static void set_histogram_point_rgb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5918
static void set_histogram_point_argb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5900
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2213
static void set_histogram_point_pargb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5908
static void set_histogram_point_a(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5945
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap *bitmap, INT x, INT y, ARGB *color)
Definition: image.c:310
static void set_histogram_point_r(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5940
static void set_histogram_point_gray(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5925
static void set_histogram_point_b(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5930
@ HistogramFormatRGB
@ HistogramFormatPARGB
@ HistogramFormatB
@ HistogramFormatA
@ HistogramFormatARGB
@ HistogramFormatR
@ HistogramFormatGray
@ HistogramFormatG
DWORD ARGB
GLuint color
Definition: glext.h:6243
unsigned int UINT
Definition: ndis.h:50

◆ GdipBitmapGetHistogramSize()

GpStatus WINGDIPAPI GdipBitmapGetHistogramSize ( HistogramFormat  format,
UINT num_of_entries 
)

Definition at line 6026 of file image.c.

6027{
6028 TRACE("(%d, %p)\n", format, num_of_entries);
6029
6030 if (!num_of_entries)
6031 return InvalidParameter;
6032
6033 *num_of_entries = 256;
6034 return Ok;
6035}

◆ GdipBitmapGetPixel()

GpStatus WINGDIPAPI GdipBitmapGetPixel ( GpBitmap bitmap,
INT  x,
INT  y,
ARGB color 
)

Definition at line 310 of file image.c.

312{
313 BYTE r, g, b, a;
314 BYTE index;
315 BYTE *row;
316
317 if(!bitmap || !color ||
318 x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
319 return InvalidParameter;
320
321 row = bitmap->bits+bitmap->stride*y;
322
323 switch (bitmap->format)
324 {
327 break;
330 break;
333 break;
336 break;
339 break;
342 break;
345 break;
347 getpixel_24bppRGB(&r,&g,&b,&a,row,x);
348 break;
350 getpixel_32bppRGB(&r,&g,&b,&a,row,x);
351 break;
354 break;
357 break;
359 getpixel_48bppRGB(&r,&g,&b,&a,row,x);
360 break;
363 break;
366 break;
367 default:
368 FIXME("not implemented for format 0x%x\n", bitmap->format);
369 return NotImplemented;
370 }
371
372 if (bitmap->format & PixelFormatIndexed)
373 *color = bitmap->image.palette->Entries[index];
374 else
375 *color = a<<24|r<<16|g<<8|b;
376
377 return Ok;
378}
#define index(s, c)
Definition: various.h:29
static void getpixel_16bppARGB1555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:219
static void getpixel_64bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:296
static void getpixel_16bppRGB565(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:209
static void getpixel_4bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:179
static void getpixel_1bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:174
static void getpixel_32bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:241
static void getpixel_8bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:187
static void getpixel_64bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:287
static void getpixel_48bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:278
static void getpixel_16bppGrayScale(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:192
static void getpixel_24bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:232
static void getpixel_16bppRGB555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:199
static void getpixel_32bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:250
static void getpixel_32bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:259
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
#define PixelFormat32bppPARGB
#define PixelFormat64bppARGB
#define PixelFormat32bppRGB
#define PixelFormat4bppIndexed
#define PixelFormat64bppPARGB
#define PixelFormat16bppRGB555
#define PixelFormat16bppARGB1555
#define PixelFormat16bppGrayScale
#define PixelFormat8bppIndexed
#define PixelFormatIndexed
#define PixelFormat24bppRGB
#define PixelFormat16bppRGB565
#define PixelFormat1bppIndexed
#define PixelFormat32bppARGB
#define PixelFormat48bppRGB
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint index
Definition: glext.h:6031
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
uint32 width
Definition: uimain.c:91
uint32 height
Definition: uimain.c:92
unsigned char BYTE
Definition: xxhash.c:193

Referenced by alpha_blend_bmp_pixels(), GdipBitmapGetHistogram(), test_clear(), test_clipping(), test_CloneBitmapArea(), test_colorkey(), test_colormatrix(), test_containers(), test_emfonly(), test_fillrect(), test_fillregion(), test_gamma(), test_gdi_interop_bitmap(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipImageGetFrameDimensionsCount(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_getsetpixel(), test_hatchBrushStyles(), test_lineargradient(), test_LockBits(), test_LockBits_UserBuf(), test_multiframegif(), test_pagetransform(), test_palette(), test_pen(), test_remaptable(), test_renderingOrigin(), test_restoredc(), test_rotateflip(), and test_worldtransform().

◆ GdipBitmapLockBits()

GpStatus WINGDIPAPI GdipBitmapLockBits ( GpBitmap bitmap,
GDIPCONST GpRect rect,
UINT  flags,
PixelFormat  format,
BitmapData lockeddata 
)

Definition at line 1107 of file image.c.

1109{
1110 INT bitspp = PIXELFORMATBPP(format);
1111 GpRect act_rect; /* actual rect to be used */
1112 GpStatus stat;
1113
1114 TRACE("%p %p %d 0x%x %p\n", bitmap, rect, flags, format, lockeddata);
1115
1116 if(!lockeddata || !bitmap)
1117 return InvalidParameter;
1118 if(!image_lock(&bitmap->image))
1119 return ObjectBusy;
1120
1121 if(rect){
1122 if(rect->X < 0 || rect->Y < 0 || (rect->X + rect->Width > bitmap->width) ||
1123 (rect->Y + rect->Height > bitmap->height) || !flags)
1124 {
1125 image_unlock(&bitmap->image);
1126 return InvalidParameter;
1127 }
1128
1129 act_rect = *rect;
1130 }
1131 else{
1132 act_rect.X = act_rect.Y = 0;
1133 act_rect.Width = bitmap->width;
1134 act_rect.Height = bitmap->height;
1135 }
1136
1137 if(bitmap->lockmode)
1138 {
1139 WARN("bitmap is already locked and cannot be locked again\n");
1140 image_unlock(&bitmap->image);
1141 return WrongState;
1142 }
1143
1144 if (bitmap->bits && bitmap->format == format && !(flags & ImageLockModeUserInputBuf))
1145 {
1146 /* no conversion is necessary; just use the bits directly */
1147 lockeddata->Width = act_rect.Width;
1148 lockeddata->Height = act_rect.Height;
1149 lockeddata->PixelFormat = format;
1150 lockeddata->Reserved = flags;
1151 lockeddata->Stride = bitmap->stride;
1152 lockeddata->Scan0 = bitmap->bits + (bitspp / 8) * act_rect.X +
1153 bitmap->stride * act_rect.Y;
1154
1155 bitmap->lockmode = flags | ImageLockModeRead;
1156
1157 image_unlock(&bitmap->image);
1158 return Ok;
1159 }
1160
1161 /* Make sure we can convert to the requested format. */
1163 {
1164 stat = convert_pixels(0, 0, 0, NULL, format, NULL, 0, NULL, bitmap->format, NULL);
1165 if (stat == NotImplemented)
1166 {
1167 FIXME("cannot read bitmap from %x to %x\n", bitmap->format, format);
1168 image_unlock(&bitmap->image);
1169 return NotImplemented;
1170 }
1171 }
1172
1173 /* If we're opening for writing, make sure we'll be able to write back in
1174 * the original format. */
1176 {
1177 stat = convert_pixels(0, 0, 0, NULL, bitmap->format, NULL, 0, NULL, format, NULL);
1178 if (stat == NotImplemented)
1179 {
1180 FIXME("cannot write bitmap from %x to %x\n", format, bitmap->format);
1181 image_unlock(&bitmap->image);
1182 return NotImplemented;
1183 }
1184 }
1185
1186 lockeddata->Width = act_rect.Width;
1187 lockeddata->Height = act_rect.Height;
1188 lockeddata->PixelFormat = format;
1189 lockeddata->Reserved = flags;
1190
1192 {
1193 lockeddata->Stride = (((act_rect.Width * bitspp + 7) / 8) + 3) & ~3;
1194
1195 bitmap->bitmapbits = calloc(lockeddata->Stride, act_rect.Height);
1196
1197 if (!bitmap->bitmapbits)
1198 {
1199 image_unlock(&bitmap->image);
1200 return OutOfMemory;
1201 }
1202
1203 lockeddata->Scan0 = bitmap->bitmapbits;
1204 }
1205
1207 {
1208 static BOOL fixme = FALSE;
1209
1210 if (!fixme && (PIXELFORMATBPP(bitmap->format) * act_rect.X) % 8 != 0)
1211 {
1212 FIXME("Cannot copy rows that don't start at a whole byte.\n");
1213 fixme = TRUE;
1214 }
1215
1216 stat = convert_pixels(act_rect.Width, act_rect.Height,
1217 lockeddata->Stride, lockeddata->Scan0, format, bitmap->image.palette,
1218 bitmap->stride,
1219 bitmap->bits + bitmap->stride * act_rect.Y + PIXELFORMATBPP(bitmap->format) * act_rect.X / 8,
1220 bitmap->format, bitmap->image.palette);
1221
1222 if (stat != Ok)
1223 {
1224 free(bitmap->bitmapbits);
1225 bitmap->bitmapbits = NULL;
1226 image_unlock(&bitmap->image);
1227 return stat;
1228 }
1229 }
1230
1231 bitmap->lockmode = flags | ImageLockModeRead;
1232 bitmap->lockx = act_rect.X;
1233 bitmap->locky = act_rect.Y;
1234
1235 image_unlock(&bitmap->image);
1236 return Ok;
1237}
GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, ColorPalette *dst_palette, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *src_palette)
Definition: image.c:589
static BOOL image_lock(GpImage *image)
#define PIXELFORMATBPP(x)
static void image_unlock(GpImage *image)
@ ImageLockModeUserInputBuf
@ ImageLockModeRead
@ ImageLockModeWrite
@ WrongState
Definition: gdiplustypes.h:33
@ ObjectBusy
Definition: gdiplustypes.h:29
GLbitfield flags
Definition: glext.h:7161
UINT_PTR Reserved
PixelFormat PixelFormat
INT Width
Definition: gdiplustypes.h:666
INT Height
Definition: gdiplustypes.h:667
INT X
Definition: gdiplustypes.h:664
INT Y
Definition: gdiplustypes.h:665

Referenced by brush_fill_pixels(), create_optimal_palette(), decode_frame_wic(), DibLoadImage(), encode_frame_wic(), expect_bitmap_locked_data(), GdipCreateBitmapFromHBITMAP(), GdipCreateBitmapFromHICON(), GdipCreateHICONFromBitmap(), GdipDrawImagePointsRect(), GdipImageRotateFlip(), test_ARGB_conversion(), test_bitmap_stride(), test_bitmapbits(), test_CloneBitmapArea(), test_createhbitmap(), test_graphics_clear(), test_image_format(), test_LockBits(), test_LockBits_UserBuf(), test_PARGB_conversion(), and test_pen_thickness().

◆ GdipBitmapSetPixel()

GpStatus WINGDIPAPI GdipBitmapSetPixel ( GpBitmap bitmap,
INT  x,
INT  y,
ARGB  color 
)

Definition at line 521 of file image.c.

523{
524 BYTE a, r, g, b;
525 BYTE *row;
526
527 if(!bitmap || x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
528 return InvalidParameter;
529
530 a = color>>24;
531 r = color>>16;
532 g = color>>8;
533 b = color;
534
535 row = bitmap->bits + bitmap->stride * y;
536
537 switch (bitmap->format)
538 {
541 break;
544 break;
547 break;
550 break;
553 break;
556 break;
559 break;
562 break;
565 break;
568 break;
571 break;
573 setpixel_8bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
574 break;
576 setpixel_4bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
577 break;
579 setpixel_1bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
580 break;
581 default:
582 FIXME("not implemented for format 0x%x\n", bitmap->format);
583 return NotImplemented;
584 }
585
586 return Ok;
587}
static void setpixel_16bppARGB1555(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:457
static void setpixel_48bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:495
static void setpixel_32bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:486
static void setpixel_16bppRGB555(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:441
static void setpixel_64bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:510
static void setpixel_32bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:474
static void setpixel_16bppGrayScale(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:435
static void setpixel_64bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:503
static void setpixel_4bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:426
static void setpixel_32bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:480
static void setpixel_16bppRGB565(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:449
static void setpixel_1bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:420
static void setpixel_8bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:413
static void setpixel_24bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:466

Referenced by alpha_blend_bmp_pixels(), test_colorkey(), test_colormatrix(), test_emfonly(), test_fillrect(), test_gamma(), test_GdipCreateBitmapFromHBITMAP(), test_GdipImageGetFrameDimensionsCount(), test_getdc(), test_getsetpixel(), test_histogram(), test_LockBits(), test_multiframegif(), test_palette(), test_PARGB_conversion(), and test_remaptable().

◆ GdipBitmapSetResolution()

GpStatus WINGDIPAPI GdipBitmapSetResolution ( GpBitmap bitmap,
REAL  xdpi,
REAL  ydpi 
)

Definition at line 1239 of file image.c.

1240{
1241 TRACE("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
1242
1243 if (!bitmap || xdpi == 0.0 || ydpi == 0.0)
1244 return InvalidParameter;
1245
1246 bitmap->image.xres = xdpi;
1247 bitmap->image.yres = ydpi;
1248
1249 return Ok;
1250}

Referenced by create_graphics(), test_DrawImage(), test_DrawImage_scale(), test_GdipDrawImagePointRect(), test_pen_thickness(), and test_resolution().

◆ GdipBitmapUnlockBits()

GpStatus WINGDIPAPI GdipBitmapUnlockBits ( GpBitmap bitmap,
BitmapData lockeddata 
)

Definition at line 1252 of file image.c.

1254{
1255 GpStatus stat;
1256 static BOOL fixme = FALSE;
1257
1258 TRACE("(%p,%p)\n", bitmap, lockeddata);
1259
1260 if(!bitmap || !lockeddata)
1261 return InvalidParameter;
1262 if(!image_lock(&bitmap->image))
1263 return ObjectBusy;
1264
1265 if(!bitmap->lockmode)
1266 {
1267 image_unlock(&bitmap->image);
1268 return WrongState;
1269 }
1270
1271 if(!(lockeddata->Reserved & ImageLockModeWrite)){
1272 bitmap->lockmode = 0;
1273 free(bitmap->bitmapbits);
1274 bitmap->bitmapbits = NULL;
1275 image_unlock(&bitmap->image);
1276 return Ok;
1277 }
1278
1279 if (!bitmap->bitmapbits && !(lockeddata->Reserved & ImageLockModeUserInputBuf))
1280 {
1281 /* we passed a direct reference; no need to do anything */
1282 bitmap->lockmode = 0;
1283 image_unlock(&bitmap->image);
1284 return Ok;
1285 }
1286
1287 if (!fixme && (PIXELFORMATBPP(bitmap->format) * bitmap->lockx) % 8 != 0)
1288 {
1289 FIXME("Cannot copy rows that don't start at a whole byte.\n");
1290 fixme = TRUE;
1291 }
1292
1293 /* FIXME: Pass src_palette generated from lockeddata->PixelFormat. */
1294 stat = convert_pixels(lockeddata->Width, lockeddata->Height,
1295 bitmap->stride,
1296 bitmap->bits + bitmap->stride * bitmap->locky + PIXELFORMATBPP(bitmap->format) * bitmap->lockx / 8,
1297 bitmap->format, bitmap->image.palette,
1298 lockeddata->Stride, lockeddata->Scan0, lockeddata->PixelFormat, NULL);
1299
1300 if (stat != Ok)
1301 {
1302 ERR("failed to convert pixels; this should never happen\n");
1303 }
1304
1305 free(bitmap->bitmapbits);
1306 bitmap->bitmapbits = NULL;
1307 bitmap->lockmode = 0;
1308
1309 image_unlock(&bitmap->image);
1310 return stat;
1311}

Referenced by brush_fill_pixels(), create_optimal_palette(), decode_frame_wic(), DibLoadImage(), encode_frame_wic(), expect_bitmap_locked_data(), GdipCreateBitmapFromHBITMAP(), GdipCreateBitmapFromHICON(), GdipCreateHICONFromBitmap(), GdipDrawImagePointsRect(), GdipImageRotateFlip(), test_ARGB_conversion(), test_bitmap_stride(), test_bitmapbits(), test_CloneBitmapArea(), test_createhbitmap(), test_graphics_clear(), test_image_format(), test_LockBits(), test_LockBits_UserBuf(), test_PARGB_conversion(), and test_pen_thickness().

◆ GdipClearPathMarkers()

GpStatus WINGDIPAPI GdipClearPathMarkers ( GpPath path)

Definition at line 2811 of file graphicspath.c.

2812{
2813 INT count;
2814 INT i;
2815
2816 TRACE("(%p)\n", path);
2817
2818 if(!path)
2819 return InvalidParameter;
2820
2821 count = path->pathdata.Count;
2822
2823 for(i = 0; i < count - 1; i++){
2824 path->pathdata.Types[i] &= ~PathPointTypePathMarker;
2825 }
2826
2827 return Ok;
2828}

◆ GdipCloneBitmapArea()

GpStatus WINGDIPAPI GdipCloneBitmapArea ( REAL  x,
REAL  y,
REAL  width,
REAL  height,
PixelFormat  format,
GpBitmap srcBitmap,
GpBitmap **  dstBitmap 
)

Definition at line 1313 of file image.c.

1315{
1316 Rect area;
1317 GpStatus stat;
1318
1319 TRACE("(%f,%f,%f,%f,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap);
1320
1321 if (!srcBitmap || !dstBitmap || srcBitmap->image.type != ImageTypeBitmap ||
1322 x < 0 || y < 0 ||
1323 x + width > srcBitmap->width || y + height > srcBitmap->height)
1324 {
1325 TRACE("<-- InvalidParameter\n");
1326 return InvalidParameter;
1327 }
1328
1330 format = srcBitmap->format;
1331
1332 area.X = gdip_round(x);
1333 area.Y = gdip_round(y);
1334 area.Width = gdip_round(width);
1335 area.Height = gdip_round(height);
1336
1337 stat = GdipCreateBitmapFromScan0(area.Width, area.Height, 0, format, NULL, dstBitmap);
1338 if (stat == Ok)
1339 {
1340 memcpy(&(*dstBitmap)->image.format, &srcBitmap->image.format, sizeof(GUID));
1341 stat = convert_pixels(area.Width, area.Height, (*dstBitmap)->stride, (*dstBitmap)->bits, (*dstBitmap)->format,
1342 (*dstBitmap)->image.palette, srcBitmap->stride,
1343 srcBitmap->bits + srcBitmap->stride * area.Y + PIXELFORMATBPP(srcBitmap->format) * area.X / 8,
1344 srcBitmap->format, srcBitmap->image.palette);
1345
1346 if (stat == Ok && srcBitmap->image.palette)
1347 {
1348 ColorPalette *src_palette, *dst_palette;
1349
1350 src_palette = srcBitmap->image.palette;
1351
1352 dst_palette = calloc(1, sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count);
1353
1354 if (dst_palette)
1355 {
1356 dst_palette->Flags = src_palette->Flags;
1357 dst_palette->Count = src_palette->Count;
1358 memcpy(dst_palette->Entries, src_palette->Entries, sizeof(ARGB) * src_palette->Count);
1359
1360 free((*dstBitmap)->image.palette);
1361 (*dstBitmap)->image.palette = dst_palette;
1362 }
1363 else
1364 stat = OutOfMemory;
1365 }
1366
1367 if (stat != Ok)
1368 GdipDisposeImage(&(*dstBitmap)->image);
1369 }
1370
1371 if (stat != Ok)
1372 *dstBitmap = NULL;
1373
1374 return stat;
1375}
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE *scan0, GpBitmap **bitmap)
Definition: image.c:1793
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2099
static INT gdip_round(REAL x)
@ ImageTypeBitmap
Definition: gdiplusenums.h:194
#define PixelFormatDontCare
static Real area(Real A[2], Real B[2], Real C[2])
Definition: polyDBG.cc:50
GpImage image
PixelFormat format
ColorPalette * palette
ImageType type

Referenced by GdipCloneBitmapAreaI(), and GdipCreateTextureIA().

◆ GdipCloneBitmapAreaI()

GpStatus WINGDIPAPI GdipCloneBitmapAreaI ( INT  x,
INT  y,
INT  width,
INT  height,
PixelFormat  format,
GpBitmap srcBitmap,
GpBitmap **  dstBitmap 
)

Definition at line 1377 of file image.c.

1379{
1380 TRACE("(%i,%i,%i,%i,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap);
1381
1382 return GdipCloneBitmapArea(x, y, width, height, format, srcBitmap, dstBitmap);
1383}
GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap)
Definition: image.c:1313

Referenced by GdipCloneImage(), and test_CloneBitmapArea().

◆ GdipCloneBrush()

GpStatus WINGDIPAPI GdipCloneBrush ( GpBrush brush,
GpBrush **  clone 
)

Definition at line 70 of file brush.c.

71{
72 TRACE("(%p, %p)\n", brush, clone);
73
74 if(!brush || !clone)
75 return InvalidParameter;
76
77 switch(brush->bt){
79 {
80 GpSolidFill *dest = malloc(sizeof(*dest));
81 if (!dest) return OutOfMemory;
82 memcpy(dest, brush, sizeof(*dest));
83 *clone = &dest->brush;
84 break;
85 }
87 {
88 GpHatch *hatch = (GpHatch*)brush;
89
90 return GdipCreateHatchBrush(hatch->hatchstyle, hatch->forecol, hatch->backcol, (GpHatch**)clone);
91 }
94 INT count, pcount;
96
97 dest = malloc(sizeof(*dest));
98 if (!dest) return OutOfMemory;
99
100 src = (GpPathGradient*) brush;
101
102 memcpy(dest, src, sizeof(GpPathGradient));
103
104 stat = GdipClonePath(src->path, &dest->path);
105
106 if(stat != Ok){
107 free(dest);
108 return stat;
109 }
110
111 dest->transform = src->transform;
112
113 /* blending */
114 count = src->blendcount;
115 dest->blendcount = count;
116 dest->blendfac = malloc(count * sizeof(REAL));
117 dest->blendpos = malloc(count * sizeof(REAL));
118 dest->surroundcolors = malloc(dest->surroundcolorcount * sizeof(ARGB));
119 pcount = dest->pblendcount;
120 if (pcount)
121 {
122 dest->pblendcolor = malloc(pcount * sizeof(ARGB));
123 dest->pblendpos = malloc(pcount * sizeof(REAL));
124 }
125
126 if(!dest->blendfac || !dest->blendpos || !dest->surroundcolors ||
127 (pcount && (!dest->pblendcolor || !dest->pblendpos))){
128 GdipDeletePath(dest->path);
129 free(dest->blendfac);
130 free(dest->blendpos);
131 free(dest->surroundcolors);
132 free(dest->pblendcolor);
133 free(dest->pblendpos);
134 free(dest);
135 return OutOfMemory;
136 }
137
138 memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
139 memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
140 memcpy(dest->surroundcolors, src->surroundcolors, dest->surroundcolorcount * sizeof(ARGB));
141
142 if (pcount)
143 {
144 memcpy(dest->pblendcolor, src->pblendcolor, pcount * sizeof(ARGB));
145 memcpy(dest->pblendpos, src->pblendpos, pcount * sizeof(REAL));
146 }
147
148 *clone = &dest->brush;
149 break;
150 }
153 INT count, pcount;
154
155 dest = malloc(sizeof(GpLineGradient));
156 if(!dest) return OutOfMemory;
157
158 src = (GpLineGradient*)brush;
159
160 memcpy(dest, src, sizeof(GpLineGradient));
161
162 count = dest->blendcount;
163 dest->blendfac = malloc(count * sizeof(REAL));
164 dest->blendpos = malloc(count * sizeof(REAL));
165 pcount = dest->pblendcount;
166 if (pcount)
167 {
168 dest->pblendcolor = malloc(pcount * sizeof(ARGB));
169 dest->pblendpos = malloc(pcount * sizeof(REAL));
170 }
171
172 if (!dest->blendfac || !dest->blendpos ||
173 (pcount && (!dest->pblendcolor || !dest->pblendpos)))
174 {
175 free(dest->blendfac);
176 free(dest->blendpos);
177 free(dest->pblendcolor);
178 free(dest->pblendpos);
179 free(dest);
180 return OutOfMemory;
181 }
182
183 dest->transform = src->transform;
184
185 memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
186 memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
187
188 if (pcount)
189 {
190 memcpy(dest->pblendcolor, src->pblendcolor, pcount * sizeof(ARGB));
191 memcpy(dest->pblendpos, src->pblendpos, pcount * sizeof(REAL));
192 }
193
194 *clone = &dest->brush;
195 break;
196 }
198 {
200 GpTexture *texture = (GpTexture*)brush;
201 GpTexture *new_texture;
203
205 if (stat != Ok) return stat;
207 if (stat != Ok) return stat;
208
209 stat = GdipCreateTextureIA(texture->image, texture->imageattributes, 0, 0, width, height, &new_texture);
210
211 if (stat == Ok)
212 {
213 new_texture->transform = texture->transform;
214 *clone = &new_texture->brush;
215 }
216 else
217 *clone = NULL;
218
219 return stat;
220 }
221 default:
222 ERR("not implemented for brush type %d\n", brush->bt);
223 return NotImplemented;
224 }
225
226 TRACE("<-- %p\n", *clone);
227 return Ok;
228}
GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
Definition: brush.c:302
GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, REAL height, GpTexture **texture)
Definition: brush.c:874
@ BrushTypeHatchFill
Definition: gdiplusenums.h:39
@ BrushTypeLinearGradient
Definition: gdiplusenums.h:42
@ BrushTypeTextureFill
Definition: gdiplusenums.h:40
@ BrushTypeSolidColor
Definition: gdiplusenums.h:38
@ BrushTypePathGradient
Definition: gdiplusenums.h:41
GLenum GLuint texture
Definition: glext.h:6295
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:149
GpBrushType bt
GpHatchStyle hatchstyle
GpBrush brush
GpMatrix transform

Referenced by GdipClonePen(), GdipCreatePen2(), GdipGetPenBrushFill(), and GdipSetPenBrushFill().

◆ GdipCloneCustomLineCap()

GpStatus WINGDIPAPI GdipCloneCustomLineCap ( GpCustomLineCap from,
GpCustomLineCap **  to 
)

Definition at line 34 of file customlinecap.c.

36{
37 TRACE("(%p, %p)\n", from, to);
38
39 if(!from || !to)
40 return InvalidParameter;
41
42 if (from->type == CustomLineCapTypeDefault)
43 *to = malloc(sizeof(GpCustomLineCap));
44 else
45 *to = malloc(sizeof(GpAdjustableArrowCap));
46
47 if (!*to)
48 return OutOfMemory;
49
50 if (from->type == CustomLineCapTypeDefault)
51 **to = *from;
52 else
54
55 /* Duplicate path data */
56 (*to)->pathdata.Points = malloc(from->pathdata.Count * sizeof(PointF));
57 (*to)->pathdata.Types = malloc(from->pathdata.Count);
58
59 if((!(*to)->pathdata.Types || !(*to)->pathdata.Points) && (*to)->pathdata.Count){
60 free((*to)->pathdata.Points);
61 free((*to)->pathdata.Types);
62 free(*to);
63 return OutOfMemory;
64 }
65
66 memcpy((*to)->pathdata.Points, from->pathdata.Points, from->pathdata.Count
67 * sizeof(PointF));
68 memcpy((*to)->pathdata.Types, from->pathdata.Types, from->pathdata.Count);
69
70 TRACE("<-- %p\n", *to);
71
72 return Ok;
73}
@ CustomLineCapTypeDefault
Definition: gdiplusenums.h:78
CardRegion * from
Definition: spigame.cpp:19

Referenced by GdipClonePen(), GdipGetPenCustomEndCap(), GdipGetPenCustomStartCap(), GdipSetPenCustomEndCap(), and GdipSetPenCustomStartCap().

◆ GdipCloneFont()

GpStatus WINGDIPAPI GdipCloneFont ( GpFont font,
GpFont **  cloneFont 
)

Definition at line 503 of file font.c.

504{
505 TRACE("(%p, %p)\n", font, cloneFont);
506
507 if(!font || !cloneFont)
508 return InvalidParameter;
509
510 *cloneFont = calloc(1, sizeof(GpFont));
511 if(!*cloneFont) return OutOfMemory;
512
513 **cloneFont = *font;
514 return Ok;
515}

Referenced by test_CloneFont(), and test_drawdriverstring().

◆ GdipCloneFontFamily()

GpStatus WINGDIPAPI GdipCloneFontFamily ( GpFontFamily family,
GpFontFamily **  clone 
)

Definition at line 754 of file font.c.

755{
756 if (!family || !clone)
757 return InvalidParameter;
758
759 TRACE("%p (%s), %p\n", family, debugstr_w(family->FamilyName), clone);
760
761 *clone = family;
762
763 if (!family->installed)
764 InterlockedIncrement(&family->ref);
765
766 return Ok;
767}
#define InterlockedIncrement
Definition: armddk.h:53
WCHAR FamilyName[LF_FACESIZE]

Referenced by GdipCreateFont(), GdipCreateFontFamilyFromName(), GdipGetFamily(), test_fontfamily(), and test_long_name().

◆ GdipCloneImage()

GpStatus WINGDIPAPI GdipCloneImage ( GpImage image,
GpImage **  cloneImage 
)

Definition at line 1385 of file image.c.

1386{
1387 TRACE("%p, %p\n", image, cloneImage);
1388
1389 if (!image || !cloneImage)
1390 return InvalidParameter;
1391
1392 if (image->type == ImageTypeBitmap)
1393 {
1395
1397 bitmap->format, bitmap, (GpBitmap **)cloneImage);
1398 }
1399 else if (image->type == ImageTypeMetafile && ((GpMetafile*)image)->hemf)
1400 {
1402
1404
1405 result = calloc(1, sizeof(*result));
1406 if (!result)
1407 return OutOfMemory;
1408
1409 result->image.type = ImageTypeMetafile;
1410 result->image.format = image->format;
1411 result->image.flags = image->flags;
1412 result->image.frame_count = 1;
1413 result->image.xres = image->xres;
1414 result->image.yres = image->yres;
1415 result->bounds = metafile->bounds;
1416 result->unit = metafile->unit;
1417 result->metafile_type = metafile->metafile_type;
1418 result->hemf = CopyEnhMetaFileW(metafile->hemf, NULL);
1419 list_init(&result->containers);
1420
1421 if (!result->hemf)
1422 {
1423 free(result);
1424 return OutOfMemory;
1425 }
1426
1427 *cloneImage = &result->image;
1428 return Ok;
1429 }
1430 else
1431 {
1432 WARN("GpImage with no image data (metafile in wrong state?)\n");
1433 return InvalidParameter;
1434 }
1435}
static void list_init(struct list_entry *head)
Definition: list.h:51
GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap)
Definition: image.c:1377
@ ImageTypeMetafile
Definition: gdiplusenums.h:195
GLuint64EXT * result
Definition: glext.h:11304
static const unsigned char metafile[]
Definition: olepicture.c:138
HENHMETAFILE WINAPI CopyEnhMetaFileW(_In_ HENHMETAFILE hemfSrc, _In_opt_ LPCWSTR pszFile)

Referenced by GdipCreateCachedBitmap(), GdipGetTextureImage(), load_image(), sync_metafile(), test_bufferrawformat(), test_emfonly(), test_GdipCloneImage(), and test_pen().

◆ GdipCloneImageAttributes()

GpStatus WINGDIPAPI GdipCloneImageAttributes ( GDIPCONST GpImageAttributes imageattr,
GpImageAttributes **  cloneImageattr 
)

Definition at line 30 of file imageattributes.c.

32{
34 struct color_remap_table remap_tables[ColorAdjustTypeCount] = {{0}};
35 int i;
36
37 TRACE("(%p, %p)\n", imageattr, cloneImageattr);
38
39 if(!imageattr || !cloneImageattr)
40 return InvalidParameter;
41
42 for (i=0; i<ColorAdjustTypeCount; i++)
43 {
44 if (imageattr->colorremaptables[i].enabled)
45 {
46 remap_tables[i].enabled = TRUE;
47 remap_tables[i].mapsize = imageattr->colorremaptables[i].mapsize;
48 remap_tables[i].colormap = malloc(sizeof(ColorMap) * remap_tables[i].mapsize);
49
50 if (remap_tables[i].colormap)
51 {
52 memcpy(remap_tables[i].colormap, imageattr->colorremaptables[i].colormap,
53 sizeof(ColorMap) * remap_tables[i].mapsize);
54 }
55 else
56 {
58 break;
59 }
60 }
61 }
62
63 if (stat == Ok)
64 stat = GdipCreateImageAttributes(cloneImageattr);
65
66 if (stat == Ok)
67 {
68 **cloneImageattr = *imageattr;
69
70 memcpy((*cloneImageattr)->colorremaptables, remap_tables, sizeof(remap_tables));
71 }
72
73 if (stat != Ok)
74 {
75 for (i=0; i<ColorAdjustTypeCount; i++)
76 free(remap_tables[i].colormap);
77 }
78
79 return stat;
80}
@ ColorAdjustTypeCount
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 GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint mapsize
Definition: glfuncs.h:262
GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)

Referenced by GdipCreateTextureIA().

◆ GdipCloneMatrix()

GpStatus WINGDIPAPI GdipCloneMatrix ( GpMatrix matrix,
GpMatrix **  clone 
)

Definition at line 121 of file matrix.c.

122{
123 TRACE("(%s, %p)\n", debugstr_matrix(matrix), clone);
124
125 if(!matrix || !clone)
126 return InvalidParameter;
127
128 *clone = malloc(sizeof(GpMatrix));
129 if(!*clone) return OutOfMemory;
130
131 **clone = *matrix;
132
133 return Ok;
134}
const char * debugstr_matrix(const GpMatrix *matrix)
Definition: gdiplus.c:498
GLuint GLenum matrix
Definition: glext.h:9407

◆ GdipClonePath()

GpStatus WINGDIPAPI GdipClonePath ( GpPath path,
GpPath **  clone 
)

Definition at line 1245 of file graphicspath.c.

1246{
1247 TRACE("(%p, %p)\n", path, clone);
1248
1249 if(!path || !clone)
1250 return InvalidParameter;
1251
1252 if (path->pathdata.Count)
1253 return GdipCreatePath2(path->pathdata.Points, path->pathdata.Types, path->pathdata.Count,
1254 path->fill, clone);
1255 else
1256 {
1257 *clone = calloc(1, sizeof(GpPath));
1258 if(!*clone) return OutOfMemory;
1259 }
1260
1261 return Ok;
1262}
GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF *points, GDIPCONST BYTE *types, INT count, GpFillMode fill, GpPath **path)

Referenced by brush_fill_pixels(), clone_element(), GdipAddPathRectangle(), GdipAddPathRectangles(), GdipAddPathString(), GdipCloneBrush(), GdipCreatePathGradientFromPath(), GdipCreateRegionPath(), GdipIsOutlineVisiblePathPoint(), GdipSetClipPath(), GdipWidenPath(), SOFTWARE_GdipDrawPath(), and SOFTWARE_GdipDrawThinPath().

◆ GdipClonePen()

GpStatus WINGDIPAPI GdipClonePen ( GpPen pen,
GpPen **  clonepen 
)

Definition at line 88 of file pen.c.

89{
91
92 TRACE("(%p, %p)\n", pen, clonepen);
93
94 if(!pen || !clonepen)
95 return InvalidParameter;
96
97 *clonepen = malloc(sizeof(GpPen));
98 if(!*clonepen) return OutOfMemory;
99
100 **clonepen = *pen;
101
102 (*clonepen)->customstart = NULL;
103 (*clonepen)->customend = NULL;
104 (*clonepen)->brush = NULL;
105 (*clonepen)->dashes = NULL;
106 (*clonepen)->compound_array = NULL;
107
108 stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
109
110 if (stat == Ok && pen->customstart)
111 stat = GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
112
113 if (stat == Ok && pen->customend)
114 stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
115
116 if (stat == Ok && pen->dashes)
117 {
118 (*clonepen)->dashes = malloc(pen->numdashes * sizeof(REAL));
119 if ((*clonepen)->dashes)
120 memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
121 else
123 }
124
125 if (stat == Ok && pen->compound_array)
126 {
127 (*clonepen)->compound_array = malloc(pen->compound_array_size * sizeof(REAL));
128 if ((*clonepen)->compound_array)
129 memcpy((*clonepen)->compound_array, pen->compound_array, pen->compound_array_size * sizeof(REAL));
130 else
132 }
133
134 if (stat != Ok)
135 {
136 GdipDeletePen(*clonepen);
137 *clonepen = NULL;
138 return stat;
139 }
140
141 TRACE("<-- %p\n", *clonepen);
142
143 return Ok;
144}
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
Definition: brush.c:70
GpStatus WINGDIPAPI GdipCloneCustomLineCap(GpCustomLineCap *from, GpCustomLineCap **to)
Definition: customlinecap.c:34
GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
Definition: pen.c:204
INT numdashes
REAL * dashes
GpCustomLineCap * customend
REAL * compound_array
GpBrush * brush
INT compound_array_size
GpCustomLineCap * customstart

◆ GdipCloneRegion()

GpStatus WINGDIPAPI GdipCloneRegion ( GpRegion region,
GpRegion **  clone 
)

Definition at line 215 of file region.c.

216{
218
219 TRACE("%p %p\n", region, clone);
220
221 if (!(region && clone))
222 return InvalidParameter;
223
224 *clone = calloc(1, sizeof(GpRegion));
225 if (!*clone)
226 return OutOfMemory;
227 element = &(*clone)->node;
228
229 (*clone)->num_children = region->num_children;
230 return clone_element(&region->node, &element);
231}
static GpStatus clone_element(const region_element *element, region_element **element2)
Definition: region.c:144
region_element node
DWORD num_children

Referenced by GdipCombineRegionRegion(), GdipGetClip(), GdipPlayMetafileRecord(), GdipSetClipRegion(), get_clip_hrgn(), get_region_scans_data(), init_container(), restore_container(), and SOFTWARE_GdipFillRegion().

◆ GdipCloneStringFormat()

GpStatus WINGDIPAPI GdipCloneStringFormat ( GDIPCONST GpStringFormat format,
GpStringFormat **  newFormat 
)

Definition at line 362 of file stringformat.c.

363{
364 if(!format || !newFormat)
365 return InvalidParameter;
366
367 *newFormat = malloc(sizeof(GpStringFormat));
368 if(!*newFormat) return OutOfMemory;
369
370 **newFormat = *format;
371
372 if(format->tabcount > 0){
373 (*newFormat)->tabs = malloc(sizeof(REAL) * format->tabcount);
374 if(!(*newFormat)->tabs){
375 free(*newFormat);
376 return OutOfMemory;
377 }
378 memcpy((*newFormat)->tabs, format->tabs, sizeof(REAL) * format->tabcount);
379 }
380 else
381 (*newFormat)->tabs = NULL;
382
383 if(format->range_count > 0){
384 (*newFormat)->character_ranges = malloc(sizeof(CharacterRange) * format->range_count);
385 if(!(*newFormat)->character_ranges){
386 free((*newFormat)->tabs);
387 free(*newFormat);
388 return OutOfMemory;
389 }
390 memcpy((*newFormat)->character_ranges, format->character_ranges,
391 sizeof(CharacterRange) * format->range_count);
392 }
393 else
394 (*newFormat)->character_ranges = NULL;
395
396 TRACE("%p %p\n",format,newFormat);
397
398 return Ok;
399}

◆ GdipClosePathFigure()

GpStatus WINGDIPAPI GdipClosePathFigure ( GpPath path)

Definition at line 1264 of file graphicspath.c.

1265{
1266 TRACE("(%p)\n", path);
1267
1268 if(!path)
1269 return InvalidParameter;
1270
1271 if(path->pathdata.Count > 0){
1272 path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath;
1273 path->newfigure = TRUE;
1274 }
1275
1276 return Ok;
1277}

Referenced by GdipAddPathPie(), test_ellipse(), test_flatten(), test_getregiondata(), test_line2(), test_linei(), test_nextsubpathpath(), test_pen_thickness(), and test_reverse().

◆ GdipClosePathFigures()

GpStatus WINGDIPAPI GdipClosePathFigures ( GpPath path)

Definition at line 1279 of file graphicspath.c.

1280{
1281 INT i;
1282
1283 TRACE("(%p)\n", path);
1284
1285 if(!path)
1286 return InvalidParameter;
1287
1288 for(i = 1; i < path->pathdata.Count; i++){
1289 if(path->pathdata.Types[i] == PathPointTypeStart)
1290 path->pathdata.Types[i-1] |= PathPointTypeCloseSubpath;
1291 }
1292
1293 path->newfigure = TRUE;
1294
1295 return Ok;
1296}

◆ GdipCombineRegionPath()

GpStatus WINGDIPAPI GdipCombineRegionPath ( GpRegion region,
GpPath path,
CombineMode  mode 
)

Definition at line 236 of file region.c.

237{
238 GpRegion *path_region;
241
242 TRACE("%p %p %d\n", region, path, mode);
243
244 if (!(region && path))
245 return InvalidParameter;
246
247 stat = GdipCreateRegionPath(path, &path_region);
248 if (stat != Ok)
249 return stat;
250
251 /* simply replace region data */
253 delete_element(&region->node);
254 memcpy(region, path_region, sizeof(GpRegion));
255 free(path_region);
256 return Ok;
257 }
258
259 left = malloc(sizeof(region_element));
260 if (left)
261 {
262 *left = region->node;
263 stat = clone_element(&path_region->node, &right);
264 if (stat == Ok)
265 {
266 fuse_region(region, left, right, mode);
267 GdipDeleteRegion(path_region);
268 return Ok;
269 }
270 }
271 else
273
274 free(left);
275 GdipDeleteRegion(path_region);
276 return stat;
277}
static void fuse_region(GpRegion *region, region_element *left, region_element *right, const CombineMode mode)
Definition: region.c:193
GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
Definition: region.c:425
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
Definition: region.c:567
void delete_element(region_element *element)
Definition: gdiplus.c:465
@ CombineModeReplace
Definition: gdiplusenums.h:388
GLdouble GLdouble right
Definition: glext.h:10859
GLenum mode
Definition: glext.h:6217
GLint left
Definition: glext.h:7726

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipSetClipPath(), test_combinereplace(), test_getbounds(), test_getregiondata(), test_incombinedregion(), test_isvisiblepoint(), test_isvisiblerect(), test_transform(), and test_translate().

◆ GdipCombineRegionRect()

GpStatus WINGDIPAPI GdipCombineRegionRect ( GpRegion region,
GDIPCONST GpRectF rect,
CombineMode  mode 
)

Definition at line 282 of file region.c.

284{
285 GpRegion *rect_region;
288
289 TRACE("%p %s %d\n", region, debugstr_rectf(rect), mode);
290
291 if (!(region && rect))
292 return InvalidParameter;
293
294 stat = GdipCreateRegionRect(rect, &rect_region);
295 if (stat != Ok)
296 return stat;
297
298 /* simply replace region data */
300 delete_element(&region->node);
301 memcpy(region, rect_region, sizeof(GpRegion));
302 free(rect_region);
303 return Ok;
304 }
305
306 left = malloc(sizeof(region_element));
307 if (left)
308 {
309 memcpy(left, &region->node, sizeof(region_element));
310 stat = clone_element(&rect_region->node, &right);
311 if (stat == Ok)
312 {
313 fuse_region(region, left, right, mode);
314 GdipDeleteRegion(rect_region);
315 return Ok;
316 }
317 }
318 else
320
321 free(left);
322 GdipDeleteRegion(rect_region);
323 return stat;
324}
GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region)
Definition: region.c:459

Referenced by GdipCombineRegionRectI(), get_visible_clip_region(), measure_ranges_callback(), SOFTWARE_GdipFillRegion(), test_clipping(), test_clipping_2(), test_combinereplace(), test_excludeinfinite(), test_getbounds(), test_gethrgn(), test_isequal(), test_isvisiblepoint(), test_isvisiblerect(), test_scans(), test_transform(), and test_translate().

◆ GdipCombineRegionRectI()

GpStatus WINGDIPAPI GdipCombineRegionRectI ( GpRegion region,
GDIPCONST GpRect rect,
CombineMode  mode 
)

Definition at line 329 of file region.c.

331{
332 GpRectF rectf;
333
334 TRACE("%p %p %d\n", region, rect, mode);
335
336 if (!rect)
337 return InvalidParameter;
338
339 set_rect(&rectf, rect->X, rect->Y, rect->Width, rect->Height);
340 return GdipCombineRegionRect(region, &rectf, mode);
341}
GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region, GDIPCONST GpRectF *rect, CombineMode mode)
Definition: region.c:282

Referenced by SOFTWARE_GdipDrawThinPath(), and test_getregiondata().

◆ GdipCombineRegionRegion()

GpStatus WINGDIPAPI GdipCombineRegionRegion ( GpRegion region1,
GpRegion region2,
CombineMode  mode 
)

Definition at line 346 of file region.c.

348{
351 GpRegion *reg2copy;
352
353 TRACE("%p %p %d\n", region1, region2, mode);
354
355 if(!(region1 && region2))
356 return InvalidParameter;
357
358 /* simply replace region data */
360 stat = GdipCloneRegion(region2, &reg2copy);
361 if(stat != Ok) return stat;
362
363 delete_element(&region1->node);
364 memcpy(region1, reg2copy, sizeof(GpRegion));
365 free(reg2copy);
366 return Ok;
367 }
368
369 left = malloc(sizeof(region_element));
370 if (!left)
371 return OutOfMemory;
372
373 *left = region1->node;
374 stat = clone_element(&region2->node, &right);
375 if (stat != Ok)
376 {
377 free(left);
378 return OutOfMemory;
379 }
380
381 fuse_region(region1, left, right, mode);
382 region1->num_children += region2->num_children;
383
384 return Ok;
385}
GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *region, GpRegion **clone)
Definition: region.c:215

Referenced by GdipPlayMetafileRecord(), GdipSetClipGraphics(), GdipSetClipHrgn(), GdipSetClipRect(), GdipSetClipRegion(), get_visible_clip_region(), METAFILE_PlaybackUpdateClip(), metafile_set_clip_region(), test_combinereplace(), test_getregiondata(), and test_incombinedregion().

◆ GdipComment()

GpStatus WINGDIPAPI GdipComment ( GpGraphics graphics,
UINT  sizeData,
GDIPCONST BYTE data 
)

Definition at line 6345 of file graphics.c.

6346{
6347 FIXME("(%p, %d, %p): stub\n", graphics, sizeData, data);
6348 return NotImplemented;
6349}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ GdipConvertToEmfPlus()

GpStatus WINGDIPAPI GdipConvertToEmfPlus ( const GpGraphics ,
GpMetafile ,
INT ,
EmfType  ,
const WCHAR ,
GpMetafile **   
)

◆ GdipConvertToEmfPlusToFile()

GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile ( const GpGraphics ,
GpMetafile ,
INT ,
const WCHAR ,
EmfType  ,
const WCHAR ,
GpMetafile **   
)

◆ GdipConvertToEmfPlusToStream()

GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream ( const GpGraphics ,
GpMetafile ,
INT ,
IStream ,
EmfType  ,
const WCHAR ,
GpMetafile **   
)

◆ GdipCreateAdjustableArrowCap()

GpStatus WINGDIPAPI GdipCreateAdjustableArrowCap ( REAL  height,
REAL  width,
BOOL  fill,
GpAdjustableArrowCap **  cap 
)

Definition at line 329 of file customlinecap.c.

331{
332 GpPathData pathdata;
334
335 TRACE("(%0.2f,%0.2f,%i,%p)\n", height, width, fill, cap);
336
337 if (!cap)
338 return InvalidParameter;
339
340 *cap = calloc(1, sizeof(**cap));
341 if (!*cap)
342 return OutOfMemory;
343
344 /* We'll need 4 points at most. */
345 pathdata.Count = 4;
346 pathdata.Points = NULL;
347 pathdata.Types = NULL;
348 stat = init_custom_linecap(&(*cap)->cap, &pathdata, fill, LineCapTriangle, width != 0.0 ? height / width : 0.0);
349 if (stat != Ok)
350 {
351 free(*cap);
352 return stat;
353 }
354
355 (*cap)->cap.type = CustomLineCapTypeAdjustableArrow;
356 (*cap)->height = height;
357 (*cap)->width = width;
358 (*cap)->middle_inset = 0.0;
360
361 return Ok;
362}
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algobase.h:449
static void arrowcap_update_path(GpAdjustableArrowCap *cap)
static GpStatus init_custom_linecap(GpCustomLineCap *cap, GpPathData *pathdata, BOOL fill, GpLineCap basecap, REAL base_inset)
Definition: customlinecap.c:75
@ CustomLineCapTypeAdjustableArrow
Definition: gdiplusenums.h:79
@ LineCapTriangle
Definition: gdiplusenums.h:64
GLenum cap
Definition: glext.h:9639
PointF * Points
Definition: gdiplustypes.h:650
BYTE * Types
Definition: gdiplustypes.h:651

Referenced by metafile_deserialize_custom_line_cap(), test_captype(), test_create_adjustable_cap(), and test_widen_cap().

◆ GdipCreateBitmapFromFile()

GpStatus WINGDIPAPI GdipCreateBitmapFromFile ( GDIPCONST WCHAR filename,
GpBitmap **  bitmap 
)

Definition at line 1437 of file image.c.

1439{
1440 GpStatus stat;
1441 IStream *stream;
1442
1443 TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
1444
1445 if(!filename || !bitmap)
1446 return InvalidParameter;
1447
1448 *bitmap = NULL;
1449
1451
1452 if(stat != Ok)
1453 return stat;
1454
1456
1457 IStream_Release(stream);
1458
1459 return stat;
1460}
#define GENERIC_READ
Definition: compat.h:135
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR *filename, UINT access, IStream **stream)
Definition: graphics.c:2593
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream *stream, GpBitmap **bitmap)
Definition: image.c:1895
const char * filename
Definition: ioapi.h:137
Definition: parse.h:23

Referenced by DibLoadImage(), GdipCreateBitmapFromFileICM(), and test_LoadingImages().

◆ GdipCreateBitmapFromFileICM()

GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM ( GDIPCONST WCHAR filename,
GpBitmap **  bitmap 
)

Definition at line 1492 of file image.c.

1494{
1495 TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
1496
1498}
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR *filename, GpBitmap **bitmap)
Definition: image.c:1437

◆ GdipCreateBitmapFromGdiDib()

GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib ( GDIPCONST BITMAPINFO info,
VOID bits,
GpBitmap **  bitmap 
)

Definition at line 1462 of file image.c.

1464{
1466 HBITMAP hbm;
1467 void *bmbits;
1469
1470 TRACE("(%p, %p, %p)\n", info, bits, bitmap);
1471
1472 if (!info || !bits || !bitmap)
1473 return InvalidParameter;
1474
1475 hbm = CreateDIBSection(0, info, DIB_RGB_COLORS, &bmbits, NULL, 0);
1476 if (!hbm)
1477 return InvalidParameter;
1478
1479 height = abs(info->bmiHeader.biHeight);
1480 stride = ((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) >> 3) & ~3;
1481 TRACE("height %lu, stride %lu, image size %lu\n", height, stride, height * stride);
1482
1483 memcpy(bmbits, bits, height * stride);
1484
1487
1488 return status;
1489}
GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBitmap **bitmap)
Definition: image.c:5392
#define abs(i)
Definition: fconv.c:206
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei stride
Definition: glext.h:5848
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
static HBITMAP
Definition: button.c:44
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
#define DIB_RGB_COLORS
Definition: wingdi.h:367

Referenced by test_drawimage(), test_FromGdiDib(), and test_GdipDrawImagePointsRect().

◆ GdipCreateBitmapFromGraphics()

GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics ( INT  width,
INT  height,
GpGraphics target,
GpBitmap **  bitmap 
)

Definition at line 1597 of file image.c.

1599{
1600 GpStatus ret;
1601
1602 TRACE("(%d, %d, %p, %p)\n", width, height, target, bitmap);
1603
1604 if(!target || !bitmap)
1605 return InvalidParameter;
1606
1608 NULL, bitmap);
1609
1610 if (ret == Ok)
1611 {
1612 GdipGetDpiX(target, &(*bitmap)->image.xres);
1613 GdipGetDpiY(target, &(*bitmap)->image.yres);
1614 }
1615
1616 return ret;
1617}
GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL *dpi)
Definition: graphics.c:6988
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL *dpi)
Definition: graphics.c:7002
Definition: tools.h:99

Referenced by test_bitmapfromgraphics(), test_texturewrap(), and test_transform().

◆ GdipCreateBitmapFromHBITMAP()

GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP ( HBITMAP  hbm,
HPALETTE  hpal,
GpBitmap **  bitmap 
)

Definition at line 5392 of file image.c.

5393{
5394 BITMAP bm;
5397 BitmapData lockeddata;
5398#ifdef __REACTOS__
5399 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)];
5400#else
5401 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
5402#endif
5403 BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf;
5404
5405 TRACE("%p %p %p\n", hbm, hpal, bitmap);
5406
5407 if(!hbm || !bitmap)
5408 return InvalidParameter;
5409
5410 if (GetObjectA(hbm, sizeof(bm), &bm) != sizeof(bm))
5411 return InvalidParameter;
5412
5413 /* TODO: Figure out the correct format for 16, 32, 64 bpp */
5414 switch(bm.bmBitsPixel) {
5415 case 1:
5417 break;
5418 case 4:
5420 break;
5421 case 8:
5423 break;
5424 case 16:
5427 return InvalidParameter;
5428 break;
5429 case 24:
5431 break;
5432 case 32:
5434 break;
5435 case 48:
5437 break;
5438 default:
5439 FIXME("don't know how to handle %d bpp\n", bm.bmBitsPixel);
5440 return InvalidParameter;
5441 }
5442
5444 format, NULL, bitmap);
5445
5446 if (retval == Ok)
5447 {
5449 format, &lockeddata);
5450 if (retval == Ok)
5451 {
5452 HDC hdc;
5453 INT src_height;
5454
5456
5459
5461
5462 src_height = abs(pbmi->bmiHeader.biHeight);
5463 pbmi->bmiHeader.biHeight = -src_height;
5464
5465 GetDIBits(hdc, hbm, 0, src_height, lockeddata.Scan0, pbmi, DIB_RGB_COLORS);
5466
5467 DeleteDC(hdc);
5468
5469 GdipBitmapUnlockBits(*bitmap, &lockeddata);
5470 }
5471
5472 /* According to the tests hpal is ignored */
5473 if (retval == Ok && pbmi->bmiHeader.biBitCount <= 8)
5474 {
5476 int i, num_palette_entries;
5477
5478 num_palette_entries = pbmi->bmiHeader.biClrUsed;
5479 if (!num_palette_entries)
5480 num_palette_entries = 1 << pbmi->bmiHeader.biBitCount;
5481
5482 palette = calloc(1, sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries - 1));
5483 if (!palette)
5485 else
5486 {
5487 palette->Flags = 0;
5488 palette->Count = num_palette_entries;
5489
5490 for (i=0; i<num_palette_entries; i++)
5491 {
5492 palette->Entries[i] = 0xff000000 | pbmi->bmiColors[i].rgbRed << 16 |
5494 }
5495
5496 retval = GdipSetImagePalette(&(*bitmap)->image, palette);
5497 }
5498
5499 free(palette);
5500 }
5501
5502 if (retval != Ok)
5503 {
5504 GdipDisposeImage(&(*bitmap)->image);
5505 *bitmap = NULL;
5506 }
5507 }
5508
5509 return retval;
5510}
GpStatus WINGDIPAPI GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette)
Definition: image.c:4984
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockeddata)
Definition: image.c:1107
static PixelFormat get_16bpp_format(HBITMAP hbm)
Definition: image.c:5348
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap *bitmap, BitmapData *lockeddata)
Definition: image.c:1252
ULONG RGBQUAD
Definition: precomp.h:47
INT PixelFormat
#define PixelFormatUndefined
HDC hdc
Definition: main.c:9
static HPALETTE palette
Definition: clipboard.c:1457
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
USHORT biBitCount
Definition: precomp.h:34
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
RGBQUAD bmiColors[1]
Definition: wingdi.h:1923
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
WORD bmBitsPixel
Definition: wingdi.h:1872
UCHAR rgbBlue
Definition: bootanim.c:103
UCHAR rgbRed
Definition: bootanim.c:105
UCHAR rgbGreen
Definition: bootanim.c:104
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
int retval
Definition: wcstombs.cpp:91
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)

Referenced by GdipCreateBitmapFromGdiDib(), GdipCreateBitmapFromResource(), and test_GdipCreateBitmapFromHBITMAP().

◆ GdipCreateBitmapFromHICON()

GpStatus WINGDIPAPI GdipCreateBitmapFromHICON ( HICON  hicon,
GpBitmap **  bitmap 
)

Definition at line 1619 of file image.c.

1620{
1621 GpStatus stat;
1622 ICONINFO iinfo;
1623 BITMAP bm;
1624 int ret;
1626 GpRect rect;
1627 BitmapData lockeddata;
1628 HDC screendc;
1629 int x, y;
1630 BITMAPINFOHEADER bih;
1631 DWORD *src;
1632 BYTE *dst_row;
1633 DWORD *dst;
1634 BYTE *bits;
1635 int mask_scanlines = 0, color_scanlines = 0;
1636
1637 TRACE("%p, %p\n", hicon, bitmap);
1638
1639 if(!bitmap || !GetIconInfo(hicon, &iinfo) || !iinfo.hbmColor || !iinfo.fIcon)
1640 return InvalidParameter;
1641
1642 /* get the size of the icon */
1643 ret = GetObjectA(iinfo.hbmColor, sizeof(bm), &bm);
1644 if (ret == 0) {
1645 DeleteObject(iinfo.hbmColor);
1646 DeleteObject(iinfo.hbmMask);
1647 return GenericError;
1648 }
1649
1650 width = bm.bmWidth;
1651 height = abs(bm.bmHeight);
1652 stride = width * 4;
1653
1655 if (stat != Ok) {
1656 DeleteObject(iinfo.hbmColor);
1657 DeleteObject(iinfo.hbmMask);
1658 return stat;
1659 }
1660
1661 rect.X = 0;
1662 rect.Y = 0;
1663 rect.Width = width;
1664 rect.Height = height;
1665
1667 if (stat != Ok) {
1668 DeleteObject(iinfo.hbmColor);
1669 DeleteObject(iinfo.hbmMask);
1670 GdipDisposeImage(&(*bitmap)->image);
1671 return stat;
1672 }
1673
1674 bih.biSize = sizeof(bih);
1675 bih.biWidth = width;
1676 bih.biHeight = -height;
1677 bih.biPlanes = 1;
1678 bih.biBitCount = 32;
1679 bih.biCompression = BI_RGB;
1680 bih.biSizeImage = 0;
1681 bih.biXPelsPerMeter = 0;
1682 bih.biYPelsPerMeter = 0;
1683 bih.biClrUsed = 0;
1684 bih.biClrImportant = 0;
1685
1686 bits = malloc(height * stride);
1687 if (!bits)
1688 {
1689 DeleteObject(iinfo.hbmColor);
1690 DeleteObject(iinfo.hbmMask);
1691 GdipBitmapUnlockBits(*bitmap, &lockeddata);
1692 GdipDisposeImage(&(*bitmap)->image);
1693 return OutOfMemory;
1694 }
1695
1696 screendc = CreateCompatibleDC(0);
1697 if (screendc)
1698 {
1699 color_scanlines = GetDIBits(screendc, iinfo.hbmColor, 0, height, lockeddata.Scan0,
1700 (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1701 mask_scanlines = GetDIBits(screendc, iinfo.hbmMask, 0, height, bits,
1702 (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1703 DeleteDC(screendc);
1704 }
1705
1706 DeleteObject(iinfo.hbmColor);
1707 DeleteObject(iinfo.hbmMask);
1708
1709 if (!screendc || ((color_scanlines == 0 || mask_scanlines == 0) &&
1711 {
1712 free(bits);
1713 GdipBitmapUnlockBits(*bitmap, &lockeddata);
1714 GdipDisposeImage(&(*bitmap)->image);
1715 return GenericError;
1716 }
1717
1718 src = (DWORD*)bits;
1719 dst_row = lockeddata.Scan0;
1720 for (y=0; y<height; y++)
1721 {
1722 dst = (DWORD*)dst_row;
1723 for (x=0; x<width; x++)
1724 {
1725 DWORD src_value = *src++;
1726 if (src_value)
1727 *dst++ = 0;
1728 else
1729 *dst++ |= 0xff000000;
1730 }
1731 dst_row += lockeddata.Stride;
1732 }
1733
1734 free(bits);
1735
1736 GdipBitmapUnlockBits(*bitmap, &lockeddata);
1737
1738 return Ok;
1739}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
GLenum GLenum dst
Definition: glext.h:6340
#define bits
Definition: infblock.c:15
LONG biYPelsPerMeter
Definition: amvideo.idl:38
DWORD biCompression
Definition: amvideo.idl:35
DWORD biClrImportant
Definition: amvideo.idl:40
LONG biXPelsPerMeter
Definition: amvideo.idl:37
DWORD biSizeImage
Definition: amvideo.idl:36
BOOL fIcon
Definition: winuser.h:3231
HBITMAP hbmColor
Definition: winuser.h:3235
HBITMAP hbmMask
Definition: winuser.h:3234
#define BI_RGB
Definition: uefivid.c:46
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2414

Referenced by test_fromhicon().

◆ GdipCreateBitmapFromResource()

GpStatus WINGDIPAPI GdipCreateBitmapFromResource ( HINSTANCE  hInstance,
GDIPCONST WCHAR lpBitmapName,
GpBitmap **  bitmap 
)

Definition at line 1500 of file image.c.

1502{
1503 HBITMAP hbm;
1505
1506 TRACE("%p (%s) %p\n", hInstance, debugstr_w(lpBitmapName), bitmap);
1507
1508 if(!lpBitmapName || !bitmap)
1509 return InvalidParameter;
1510
1511 /* load DIB */
1512 hbm = LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0,
1514
1515 if(hbm){
1518 }
1519
1520 return stat;
1521}
HINSTANCE hInstance
Definition: charmap.c:19
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572

◆ GdipCreateBitmapFromScan0()

GpStatus WINGDIPAPI GdipCreateBitmapFromScan0 ( INT  width,
INT  height,
INT  stride,
PixelFormat  format,
BYTE scan0,
GpBitmap **  bitmap 
)

Definition at line 1793 of file image.c.

1795{
1796 INT row_size;
1797 BYTE *bits=NULL, *own_bits=NULL;
1798 REAL xres, yres;
1799 GpStatus stat;
1800
1801 TRACE("%d %d %d 0x%x %p %p\n", width, height, stride, format, scan0, bitmap);
1802
1803 if (!bitmap) return InvalidParameter;
1804
1805 if(width <= 0 || height <= 0 || (scan0 && (stride % 4))){
1806 *bitmap = NULL;
1807 return InvalidParameter;
1808 }
1809
1810 if(scan0 && !stride)
1811 return InvalidParameter;
1812
1813 stat = get_screen_resolution(&xres, &yres);
1814 if (stat != Ok) return stat;
1815
1816 row_size = (width * PIXELFORMATBPP(format)+7) / 8;
1817
1818 if (scan0)
1819 bits = scan0;
1820 else
1821 {
1822 stride = (row_size + 3) & ~3;
1823
1824 own_bits = bits = calloc(1, stride * height);
1825 if (!own_bits) return OutOfMemory;
1826 }
1827
1828 *bitmap = calloc(1, sizeof(GpBitmap));
1829 if(!*bitmap)
1830 {
1831 free(own_bits);
1832 return OutOfMemory;
1833 }
1834
1835 (*bitmap)->image.type = ImageTypeBitmap;
1836 memcpy(&(*bitmap)->image.format, &ImageFormatMemoryBMP, sizeof(GUID));
1837 (*bitmap)->image.flags = ImageFlagsNone;
1838 (*bitmap)->image.frame_count = 1;
1839 (*bitmap)->image.current_frame = 0;
1840 (*bitmap)->image.palette = NULL;
1841 (*bitmap)->image.xres = xres;
1842 (*bitmap)->image.yres = yres;
1843 (*bitmap)->width = width;
1844 (*bitmap)->height = height;
1845 (*bitmap)->format = format;
1846 (*bitmap)->image.decoder = NULL;
1847 (*bitmap)->image.encoder = NULL;
1848 (*bitmap)->bits = bits;
1849 (*bitmap)->stride = stride;
1850 (*bitmap)->own_bits = own_bits;
1851 (*bitmap)->metadata_reader = NULL;
1852 (*bitmap)->prop_count = 0;
1853 (*bitmap)->prop_item = NULL;
1854
1855 /* set format-related flags */
1857 (*bitmap)->image.flags |= ImageFlagsHasAlpha;
1858
1862 {
1863 (*bitmap)->image.palette = calloc(1, sizeof(UINT) * 2 + sizeof(ARGB) * (1 << PIXELFORMATBPP(format)));
1864
1865 if (!(*bitmap)->image.palette)
1866 {
1867 GdipDisposeImage(&(*bitmap)->image);
1868 *bitmap = NULL;
1869 return OutOfMemory;
1870 }
1871
1872 (*bitmap)->image.palette->Count = 1 << PIXELFORMATBPP(format);
1873
1875 {
1876 (*bitmap)->image.palette->Flags = PaletteFlagsGrayScale;
1877 (*bitmap)->image.palette->Entries[0] = 0xff000000;
1878 (*bitmap)->image.palette->Entries[1] = 0xffffffff;
1879 }
1880 else
1881 {
1883 (*bitmap)->image.palette->Flags = PaletteFlagsHalftone;
1884
1885 generate_halftone_palette((*bitmap)->image.palette->Entries,
1886 (*bitmap)->image.palette->Count);
1887 }
1888 }
1889
1890 TRACE("<-- %p\n", *bitmap);
1891
1892 return Ok;
1893}
static void generate_halftone_palette(ARGB *entries, UINT count)
Definition: image.c:1741
static GpStatus get_screen_resolution(REAL *xres, REAL *yres)
Definition: image.c:1779
@ ImageFlagsNone
Definition: gdiplusenums.h:331
@ ImageFlagsHasAlpha
Definition: gdiplusenums.h:333
@ PaletteFlagsGrayScale
@ PaletteFlagsHalftone
#define PixelFormatPAlpha
#define PixelFormatAlpha

Referenced by create_graphics(), decode_frame_wic(), GdipCloneBitmapArea(), GdipCreateBitmapFromGraphics(), GdipCreateBitmapFromHBITMAP(), GdipCreateBitmapFromHICON(), GdipGetImageThumbnail(), GdipImageRotateFlip(), metafile_deserialize_image(), METAFILE_DrawImagePointsRect(), test_ARGB_conversion(), test_bitmap_stride(), test_bitmapbits(), test_clear(), test_clipping(), test_CloneBitmapArea(), test_colorkey(), test_colormatrix(), test_containers(), test_createhbitmap(), test_dispose(), test_drawdriverstring(), test_DrawImage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_emfonly(), test_fillrect(), test_fillregion(), test_fromMemoryBitmap(), test_gamma(), test_gdi_interop_bitmap(), test_GdipCloneImage(), test_GdipDrawImageFX(), test_GdipDrawImagePointRect(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetImageFlags(), test_GdipGetNearestColor(), test_GdipImageGetFrameDimensionsCount(), test_GdipInitializePalette(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_GetImageDimension(), test_getsetpixel(), test_getthumbnail(), test_graphics_clear(), test_hatchBrushStyles(), test_histogram(), test_image_format(), test_imageabort(), test_is_outline_visible_path_point(), test_lineargradient(), test_LockBits(), test_LockBits_UserBuf(), test_pagetransform(), test_palette(), test_PARGB_conversion(), test_pen(), test_pen_thickness(), test_png_save_palette(), test_remaptable(), test_renderingOrigin(), test_resolution(), test_restoredc(), test_rotateflip(), test_SavingImages(), test_SavingMultiPageTiff(), test_Scan0(), test_supported_encoders(), test_unknownfontdecode(), and test_worldtransform().

◆ GdipCreateBitmapFromStream()

GpStatus WINGDIPAPI GdipCreateBitmapFromStream ( IStream stream,
GpBitmap **  bitmap 
)

Definition at line 1895 of file image.c.

1897{
1898 GpStatus stat;
1899
1900 TRACE("%p %p\n", stream, bitmap);
1901
1903
1904 if(stat != Ok)
1905 return stat;
1906
1907 if((*bitmap)->image.type != ImageTypeBitmap){
1908 GdipDisposeImage(&(*bitmap)->image);
1909 *bitmap = NULL;
1910 return GenericError; /* FIXME: what error to return? */
1911 }
1912
1913 return Ok;
1914}
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
Definition: image.c:4525

Referenced by GdipCreateBitmapFromFile(), GdipCreateBitmapFromStreamICM(), metafile_deserialize_image(), and test_multiframegif().

◆ GdipCreateBitmapFromStreamICM()

GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM ( IStream stream,
GpBitmap **  bitmap 
)

Definition at line 1917 of file image.c.

1919{
1920 TRACE("%p %p\n", stream, bitmap);
1921
1923}

◆ GdipCreateCachedBitmap()

GpStatus WINGDIPAPI GdipCreateCachedBitmap ( GpBitmap bitmap,
GpGraphics graphics,
GpCachedBitmap **  cachedbmp 
)

Definition at line 1925 of file image.c.

1927{
1928 GpStatus stat;
1929
1930 TRACE("%p %p %p\n", bitmap, graphics, cachedbmp);
1931
1932 if(!bitmap || !graphics || !cachedbmp)
1933 return InvalidParameter;
1934
1935 *cachedbmp = calloc(1, sizeof(GpCachedBitmap));
1936 if(!*cachedbmp)
1937 return OutOfMemory;
1938
1939 stat = GdipCloneImage(&(bitmap->image), &(*cachedbmp)->image);
1940 if(stat != Ok){
1941 free(*cachedbmp);
1942 return stat;
1943 }
1944
1945 return Ok;
1946}
GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
Definition: image.c:1385

◆ GdipCreateCustomLineCap()

GpStatus WINGDIPAPI GdipCreateCustomLineCap ( GpPath fillPath,
GpPath strokePath,
GpLineCap  baseCap,
REAL  baseInset,
GpCustomLineCap **  customCap 
)

Definition at line 111 of file customlinecap.c.

113{
114 GpPathData *pathdata;
116
117 TRACE("%p %p %d %f %p\n", fillPath, strokePath, baseCap, baseInset, customCap);
118
119 if(!customCap || !(fillPath || strokePath))
120 return InvalidParameter;
121
122 *customCap = calloc(1, sizeof(GpCustomLineCap));
123 if(!*customCap) return OutOfMemory;
124
125 if (strokePath)
126 pathdata = &strokePath->pathdata;
127 else
128 pathdata = &fillPath->pathdata;
129
130 stat = init_custom_linecap(*customCap, pathdata, fillPath != NULL, baseCap, baseInset);
131 if (stat != Ok)
132 {
133 free(*customCap);
134 return stat;
135 }
136
137 TRACE("<-- %p\n", *customCap);
138
139 return Ok;
140}
GpPathData pathdata

Referenced by metafile_deserialize_custom_line_cap(), test_captype(), test_constructor_destructor(), test_inset(), test_linejoin(), test_pen(), test_scale(), and test_strokecap().

◆ GdipCreateFont()

GpStatus WINGDIPAPI GdipCreateFont ( GDIPCONST GpFontFamily fontFamily,
REAL  emSize,
INT  style,
Unit  unit,
GpFont **  font 
)

Definition at line 150 of file font.c.

152{
153 HFONT hfont;
155 LOGFONTW lfw;
156 HDC hdc;
158 int ret;
159
160 if (!fontFamily || !font || emSize < 0.0)
161 return InvalidParameter;
162
163 TRACE("%p (%s), %f, %d, %d, %p\n", fontFamily,
164 debugstr_w(fontFamily->FamilyName), emSize, style, unit, font);
165
166 memset(&lfw, 0, sizeof(lfw));
167
168 stat = GdipGetFamilyName(fontFamily, lfw.lfFaceName, LANG_NEUTRAL);
169 if (stat != Ok) return stat;
170
171 lfw.lfHeight = -units_to_pixels(emSize, unit, fontFamily->dpi, FALSE);
177
181 otm.otmSize = sizeof(otm);
183 DeleteDC(hdc);
185
186 if (!ret) return NotTrueTypeFont;
187
188 *font = calloc(1, sizeof(GpFont));
189 if (!*font) return OutOfMemory;
190
191 (*font)->unit = unit;
192 (*font)->emSize = emSize;
193 (*font)->otm = otm;
194 GdipCloneFontFamily((GpFontFamily*)fontFamily, &(*font)->family);
195
196 TRACE("<-- %p\n", *font);
197
198 return Ok;
199}
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *family, GpFontFamily **clone)
Definition: font.c:754
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
Definition: font.c:786
@ FontStyleUnderline
Definition: gdiplusenums.h:305
@ FontStyleBold
Definition: gdiplusenums.h:302
@ FontStyleStrikeout
Definition: gdiplusenums.h:306
@ FontStyleItalic
Definition: gdiplusenums.h:303
@ NotTrueTypeFont
Definition: gdiplustypes.h:41
#define LANG_NEUTRAL
Definition: nls.h:22
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfCharSet
Definition: dimm.idl:67
#define FW_REGULAR
Definition: wingdi.h:374
#define FW_BOLD
Definition: wingdi.h:378
#define DEFAULT_CHARSET
Definition: wingdi.h:384
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)

Referenced by check_family(), GdipAddPathString(), METAFILE_PlaybackObject(), test_CloneFont(), test_createfont(), test_createfont_charset(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_GdipMeasureString(), test_heightgivendpi(), test_long_name(), test_measure_string(), test_measured_extra_space(), test_string_functions(), and test_unknownfontdecode().

◆ GdipCreateFontFamilyFromName()

GpStatus WINGDIPAPI GdipCreateFontFamilyFromName ( GDIPCONST WCHAR name,
GpFontCollection collection,
GpFontFamily **  family 
)

Definition at line 701 of file font.c.

704{
705 HDC hdc;
706 LOGFONTW lf;
708 int i;
709
710 TRACE("%s, %p %p\n", debugstr_w(name), collection, family);
711
712 if (!name || !family)
713 return InvalidParameter;
714
715 if (!collection)
716 {
718 if (status != Ok) return status;
719 }
720
722
724
726 {
727 for (i = 0; i < collection->count; i++)
728 {
729 if (!wcsicmp(lf.lfFaceName, collection->FontFamilies[i]->FamilyName))
730 {
731 status = GdipCloneFontFamily(collection->FontFamilies[i], family);
732 TRACE("<-- %p\n", *family);
733 break;
734 }
735 }
736 }
737
738 DeleteDC(hdc);
739 return status;
740}
#define wcsicmp
Definition: compat.h:15
GpStatus WINGDIPAPI GdipNewInstalledFontCollection(GpFontCollection **fontCollection)
Definition: font.c:1669
static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:610
@ FontFamilyNotFound
Definition: gdiplustypes.h:39
LONG_PTR LPARAM
Definition: minwindef.h:175
static ICollection collection
Definition: typelib.c:184
Definition: name.c:39
int WINAPI EnumFontFamiliesW(_In_ HDC, _In_opt_ LPCWSTR, _In_ FONTENUMPROCW, _In_ LPARAM)

Referenced by GdipCreateFontFromLogfontW(), GdipGetGenericFontFamilyMonospace(), GdipGetGenericFontFamilySansSerif(), GdipGetGenericFontFamilySerif(), METAFILE_PlaybackObject(), test_CloneFont(), test_createfont(), test_createfont_charset(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_fontfamily(), test_fontfamily_properties(), test_GdipMeasureString(), test_heightgivendpi(), test_measure_string(), test_measured_extra_space(), and test_string_functions().

◆ GdipCreateFontFromDC()

GpStatus WINGDIPAPI GdipCreateFontFromDC ( HDC  hdc,
GpFont **  font 
)

Definition at line 288 of file font.c.

289{
290 HFONT hfont;
291 LOGFONTW lfw;
292
293 TRACE("(%p, %p)\n", hdc, font);
294
295 if(!font)
296 return InvalidParameter;
297
299 if(!hfont)
300 return GenericError;
301
302 if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
303 return GenericError;
304
305 return GdipCreateFontFromLogfontW(hdc, &lfw, font);
306}
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
Definition: font.c:204
#define OBJ_FONT
Definition: objidl.idl:1019
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428

Referenced by generate_font_link_info().

◆ GdipCreateFontFromLogfontA()

GpStatus WINGDIPAPI GdipCreateFontFromLogfontA ( HDC  hdc,
GDIPCONST LOGFONTA lfa,
GpFont **  font 
)

Definition at line 251 of file font.c.

253{
254 LOGFONTW lfw;
255
256 TRACE("(%p, %p, %p)\n", hdc, lfa, font);
257
258 if(!lfa || !font)
259 return InvalidParameter;
260
261 memcpy(&lfw, lfa, FIELD_OFFSET(LOGFONTA,lfFaceName) );
262
263 if(!MultiByteToWideChar(CP_ACP, 0, lfa->lfFaceName, -1, lfw.lfFaceName, LF_FACESIZE))
264 return GenericError;
265
266 return GdipCreateFontFromLogfontW(hdc, &lfw, font);
267}
#define LF_FACESIZE
Definition: dimm.idl:39
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by test_drawdriverstring(), test_font_substitution(), test_font_transform(), test_GdipDrawString(), and test_logfont().

◆ GdipCreateFontFromLogfontW()

GpStatus WINGDIPAPI GdipCreateFontFromLogfontW ( HDC  hdc,
GDIPCONST LOGFONTW logfont,
GpFont **  font 
)

Definition at line 204 of file font.c.

206{
207 HFONT hfont, oldfont;
209 WCHAR facename[LF_FACESIZE];
211 int ret;
212
213 TRACE("(%p, %p, %p)\n", hdc, logfont, font);
214
215 if (!hdc || !logfont || !font)
216 return InvalidParameter;
217
218 hfont = CreateFontIndirectW(logfont);
219 oldfont = SelectObject(hdc, hfont);
220 otm.otmSize = sizeof(otm);
222 GetTextFaceW(hdc, LF_FACESIZE, facename);
223 SelectObject(hdc, oldfont);
225
226 if (!ret) return NotTrueTypeFont;
227
228 *font = calloc(1, sizeof(GpFont));
229 if (!*font) return OutOfMemory;
230
231 (*font)->unit = UnitWorld;
232 (*font)->emSize = otm.otmTextMetrics.tmHeight - otm.otmTextMetrics.tmInternalLeading;
233 (*font)->otm = otm;
234
235 stat = GdipCreateFontFamilyFromName(facename, NULL, &(*font)->family);
236 if (stat != Ok)
237 {
238 free(*font);
239 *font = NULL;
240 return NotTrueTypeFont;
241 }
242
243 TRACE("<-- %p\n", *font);
244
245 return Ok;
246}
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *collection, GpFontFamily **family)
Definition: font.c:701
@ UnitWorld
Definition: gdiplusenums.h:27
short WCHAR
Definition: pedump.c:58
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2960
LONG tmInternalLeading
Definition: wingdi.h:2832
LONG tmHeight
Definition: wingdi.h:2829
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)

Referenced by GdipCreateFontFromDC(), GdipCreateFontFromLogfontA(), and test_font_metrics().

◆ GdipCreateFromHDC()

GpStatus WINGDIPAPI GdipCreateFromHDC ( HDC  hdc,
GpGraphics **  graphics 
)

Definition at line 2434 of file graphics.c.

2435{
2436 TRACE("(%p, %p)\n", hdc, graphics);
2437
2438 return GdipCreateFromHDC2(hdc, NULL, graphics);
2439}
GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **graphics)
Definition: graphics.c:2455

Referenced by check_metafile(), GdipAddPathString(), GdipCreateFromHWND(), get_path_hrgn(), test_alpha_hdc(), test_BeginContainer2(), test_bitmapfromgraphics(), test_clip_xform(), test_cliphrgn_transform(), test_clipping(), test_clipping_2(), test_constructor_destructor(), test_container_rects(), test_createfont_charset(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_font_transform(), test_fromhrgn(), test_gdi_interop_hdc(), test_GdipCreateRegionRgnData(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), test_GdipDrawImageFX(), test_GdipDrawImagePointsRect(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipDrawLineI(), test_GdipDrawLinesI(), test_GdipDrawString(), test_GdipFillClosedCurve(), test_GdipFillClosedCurve2(), test_GdipFillClosedCurve2I(), test_GdipFillClosedCurveI(), test_GdipFillPath(), test_GdipFillRectangles(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetNearestColor(), test_GdipGetVisibleClipBounds(), test_GdipGetVisibleClipBounds_memoryDC(), test_GdipGetVisibleClipBounds_screen(), test_GdipGetVisibleClipBounds_window(), test_GdipGraphicsSetAbort(), test_GdipIsVisiblePoint(), test_GdipIsVisibleRect(), test_Get_Release_DC(), test_get_set_clip(), test_get_set_interpolation(), test_get_set_textrenderinghint(), test_getbounds(), test_gethrgn(), test_hatchBrushStyles(), test_hdc_caching(), test_isempty(), test_isequal(), test_isinfinite(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_logfont(), test_measure_string(), test_measured_extra_space(), test_printer_dc(), test_renderingOrigin(), test_save_restore(), test_set_page_transform(), test_string_functions(), test_textcontrast(), test_texturewrap(), test_transform(), test_transformpoints(), test_translate(), and ZoomWnd_OnDraw().

◆ GdipCreateFromHDC2()

GpStatus WINGDIPAPI GdipCreateFromHDC2 ( HDC  hdc,
HANDLE  hDevice,
GpGraphics **  graphics 
)

Definition at line 2455 of file graphics.c.

2456{
2459 DIBSECTION dib;
2460
2461 TRACE("(%p, %p, %p)\n", hdc, hDevice, graphics);
2462
2463 if(hDevice != NULL)
2464 FIXME("Don't know how to handle parameter hDevice\n");
2465
2466 if(hdc == NULL)
2467 return OutOfMemory;
2468
2469 if(graphics == NULL)
2470 return InvalidParameter;
2471
2472 *graphics = calloc(1, sizeof(GpGraphics));
2473 if(!*graphics) return OutOfMemory;
2474
2475 GdipSetMatrixElements(&(*graphics)->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
2476
2477 if((retval = GdipCreateRegion(&(*graphics)->clip)) != Ok){
2478 free(*graphics);
2479 return retval;
2480 }
2481
2483 if (hbitmap && GetObjectW(hbitmap, sizeof(dib), &dib) == sizeof(dib) &&
2484 dib.dsBmih.biBitCount == 32 && dib.dsBmih.biCompression == BI_RGB)
2485 {
2486 (*graphics)->alpha_hdc = 1;
2487 }
2488
2489 (*graphics)->hdc = hdc;
2490 (*graphics)->hwnd = WindowFromDC(hdc);
2491 (*graphics)->owndc = FALSE;
2492 (*graphics)->smoothing = SmoothingModeDefault;
2493 (*graphics)->compqual = CompositingQualityDefault;
2494 (*graphics)->interpolation = InterpolationModeBilinear;
2495 (*graphics)->pixeloffset = PixelOffsetModeDefault;
2496 (*graphics)->compmode = CompositingModeSourceOver;
2497 (*graphics)->unit = UnitDisplay;
2498 (*graphics)->scale = 1.0;
2499 (*graphics)->xres = GetDeviceCaps(hdc, LOGPIXELSX);
2500 (*graphics)->yres = GetDeviceCaps(hdc, LOGPIXELSY);
2501 (*graphics)->busy = FALSE;
2502 (*graphics)->textcontrast = 4;
2503 list_init(&(*graphics)->containers);
2504 (*graphics)->contid = 0;
2505 (*graphics)->printer_display = (GetDeviceCaps(hdc, TECHNOLOGY) == DT_RASPRINTER);
2506 get_gdi_transform(hdc, &(*graphics)->gdi_transform);
2507
2508 (*graphics)->gdi_clip = CreateRectRgn(0,0,0,0);
2509 if (!GetClipRgn(hdc, (*graphics)->gdi_clip))
2510 {
2511 DeleteObject((*graphics)->gdi_clip);
2512 (*graphics)->gdi_clip = NULL;
2513 }
2514
2515 TRACE("<-- %p\n", *graphics);
2516
2517 return Ok;
2518}
static HBITMAP hbitmap
static void get_gdi_transform(HDC hdc, GpMatrix *matrix)
Definition: graphics.c:2441
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
Definition: matrix.c:318
GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
Definition: region.c:390
@ SmoothingModeDefault
Definition: gdiplusenums.h:122
@ CompositingModeSourceOver
Definition: gdiplusenums.h:247
@ PixelOffsetModeDefault
Definition: gdiplusenums.h:161
@ CompositingQualityDefault
Definition: gdiplusenums.h:132
@ UnitDisplay
Definition: gdiplusenums.h:28
@ InterpolationModeBilinear
Definition: gdiplusenums.h:145
#define OBJ_BITMAP
Definition: objidl.idl:1020
ULONG biCompression
Definition: precomp.h:35
BITMAPINFOHEADER dsBmih
Definition: wingdi.h:2116
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define DT_RASPRINTER
Definition: wingdi.h:709
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
#define LOGPIXELSX
Definition: wingdi.h:718
#define TECHNOLOGY
Definition: wingdi.h:706
HWND WINAPI WindowFromDC(_In_ HDC hDC)

Referenced by GdipCreateFromHDC().

◆ GdipCreateFromHWND()

GpStatus WINGDIPAPI GdipCreateFromHWND ( HWND  hwnd,
GpGraphics **  graphics 
)

Definition at line 2561 of file graphics.c.

2562{
2563 GpStatus ret;
2564 HDC hdc;
2565
2566 TRACE("(%p, %p)\n", hwnd, graphics);
2567
2568 hdc = GetDC(hwnd);
2569
2570 if((ret = GdipCreateFromHDC(hdc, graphics)) != Ok)
2571 {
2572 ReleaseDC(hwnd, hdc);
2573 return ret;
2574 }
2575
2576 (*graphics)->hwnd = hwnd;
2577 (*graphics)->owndc = TRUE;
2578
2579 ReleaseDC(hwnd, hdc);
2580 (*graphics)->hdc = NULL;
2581
2582 return Ok;
2583}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by GdipCreateFromHWNDICM(), test_constructor_destructor(), and test_transform().

◆ GdipCreateFromHWNDICM()

GpStatus WINGDIPAPI GdipCreateFromHWNDICM ( HWND  hwnd,
GpGraphics **  graphics 
)

Definition at line 2586 of file graphics.c.

2587{
2588 TRACE("(%p, %p)\n", hwnd, graphics);
2589
2590 return GdipCreateFromHWND(hwnd, graphics);
2591}
GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics)
Definition: graphics.c:2561

Referenced by test_constructor_destructor().

◆ GdipCreateHalftonePalette()

HPALETTE WINGDIPAPI GdipCreateHalftonePalette ( void  )

Definition at line 7406 of file graphics.c.

7407{
7408 static int calls;
7409
7410 TRACE("\n");
7411
7412 if (!calls++)
7413 FIXME("stub\n");
7414
7415 return NULL;
7416}

◆ GdipCreateHatchBrush()

GpStatus WINGDIPAPI GdipCreateHatchBrush ( GpHatchStyle  hatchstyle,
ARGB  forecol,
ARGB  backcol,
GpHatch **  brush 
)

Definition at line 302 of file brush.c.

303{
304 TRACE("(%d, %ld, %ld, %p)\n", hatchstyle, forecol, backcol, brush);
305
306 if(!brush) return InvalidParameter;
307
308 if(hatchstyle < HatchStyleMin || hatchstyle > HatchStyleMax)
309 return InvalidParameter;
310
311 *brush = calloc(1, sizeof(GpHatch));
312 if (!*brush) return OutOfMemory;
313
314 (*brush)->brush.bt = BrushTypeHatchFill;
315 (*brush)->forecol = forecol;
316 (*brush)->backcol = backcol;
317 (*brush)->hatchstyle = hatchstyle;
318 TRACE("<-- %p\n", *brush);
319
320 return Ok;
321}
@ HatchStyleMax
Definition: gdiplusenums.h:484

Referenced by GdipCloneBrush(), metafile_deserialize_brush(), test_createHatchBrush(), test_drawdriverstring(), test_fillregion(), test_getHatchStyle(), test_hatchBrushStyles(), and test_renderingOrigin().

◆ GdipCreateHBITMAPFromBitmap()

GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap ( GpBitmap bitmap,
HBITMAP hbmReturn,
ARGB  background 
)

Definition at line 1535 of file image.c.

1537{
1538 GpStatus stat;
1540 UINT width, height;
1541 BITMAPINFOHEADER bih;
1542 LPBYTE bits;
1543
1544 TRACE("(%p,%p,%lx)\n", bitmap, hbmReturn, background);
1545
1546 if (!bitmap || !hbmReturn) return InvalidParameter;
1547 if (!image_lock(&bitmap->image)) return ObjectBusy;
1548
1549 GdipGetImageWidth(&bitmap->image, &width);
1550 GdipGetImageHeight(&bitmap->image, &height);
1551
1552 bih.biSize = sizeof(bih);
1553 bih.biWidth = width;
1554 bih.biHeight = height;
1555 bih.biPlanes = 1;
1556 bih.biBitCount = 32;
1557 bih.biCompression = BI_RGB;
1558 bih.biSizeImage = 0;
1559 bih.biXPelsPerMeter = 0;
1560 bih.biYPelsPerMeter = 0;
1561 bih.biClrUsed = 0;
1562 bih.biClrImportant = 0;
1563
1564 result = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
1565 if (!result)
1566 {
1567 image_unlock(&bitmap->image);
1568 return GenericError;
1569 }
1570
1572 bits + (width * 4 * (height - 1)), PixelFormat32bppPARGB, bitmap->image.palette,
1573 bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette);
1574 if (stat != Ok)
1575 {
1577 image_unlock(&bitmap->image);
1578 return stat;
1579 }
1580
1581 if (background & 0xffffff)
1582 {
1583 DWORD *ptr;
1584 UINT i;
1585 for (ptr = (DWORD*)bits, i = 0; i < width * height; ptr++, i++)
1586 {
1587 if ((*ptr & 0xff000000) == 0xff000000) continue;
1588 *ptr = blend_argb_no_bkgnd_alpha(*ptr, background);
1589 }
1590 }
1591
1592 *hbmReturn = result;
1593 image_unlock(&bitmap->image);
1594 return Ok;
1595}
static DWORD blend_argb_no_bkgnd_alpha(DWORD src, DWORD bkgnd)
Definition: image.c:1523
static PVOID ptr
Definition: dispmode.c:27
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by test_createhbitmap(), and test_image_format().

◆ GdipCreateHICONFromBitmap()

GpStatus WINGDIPAPI GdipCreateHICONFromBitmap ( GpBitmap bitmap,
HICON hicon 
)

Definition at line 1948 of file image.c.

1949{
1950 GpStatus stat;
1951 BitmapData lockeddata;
1952 ULONG andstride, xorstride, bitssize;
1953 LPBYTE andbits, xorbits, androw, xorrow, srcrow;
1954 UINT x, y;
1955
1956 TRACE("(%p, %p)\n", bitmap, hicon);
1957
1958 if (!bitmap || !hicon)
1959 return InvalidParameter;
1960
1962 PixelFormat32bppPARGB, &lockeddata);
1963 if (stat == Ok)
1964 {
1965 andstride = ((lockeddata.Width+31)/32)*4;
1966 xorstride = lockeddata.Width*4;
1967 bitssize = (andstride + xorstride) * lockeddata.Height;
1968
1969 andbits = calloc(1, bitssize);
1970
1971 if (andbits)
1972 {
1973 xorbits = andbits + andstride * lockeddata.Height;
1974
1975 for (y=0; y<lockeddata.Height; y++)
1976 {
1977 srcrow = ((LPBYTE)lockeddata.Scan0) + lockeddata.Stride * y;
1978
1979 androw = andbits + andstride * y;
1980 for (x=0; x<lockeddata.Width; x++)
1981 if (srcrow[3+4*x] >= 128)
1982 androw[x/8] |= 1 << (7-x%8);
1983
1984 xorrow = xorbits + xorstride * y;
1985 memcpy(xorrow, srcrow, xorstride);
1986 }
1987
1988 *hicon = CreateIcon(NULL, lockeddata.Width, lockeddata.Height, 1, 32,
1989 andbits, xorbits);
1990
1991 free(andbits);
1992 }
1993 else
1994 stat = OutOfMemory;
1995
1996 GdipBitmapUnlockBits(bitmap, &lockeddata);
1997 }
1998
1999 return stat;
2000}
uint32_t ULONG
Definition: typedefs.h:59
HICON WINAPI CreateIcon(_In_opt_ HINSTANCE, _In_ int, _In_ int, _In_ BYTE, _In_ BYTE, _In_ const BYTE *, _In_ const BYTE *)
Definition: cursoricon.c:2764

◆ GdipCreateImageAttributes()

GpStatus WINGDIPAPI GdipCreateImageAttributes ( GpImageAttributes **  imageattr)

Definition at line 82 of file imageattributes.c.

83{
84 if(!imageattr)
85 return InvalidParameter;
86
87 *imageattr = calloc(1, sizeof(GpImageAttributes));
88 if(!*imageattr) return OutOfMemory;
89
90 (*imageattr)->wrap = WrapModeClamp;
91
92 TRACE("<-- %p\n", *imageattr);
93
94 return Ok;
95}
@ WrapModeClamp
Definition: gdiplusenums.h:209

Referenced by GdipCloneImageAttributes(), GdipCreateTexture(), GdipCreateTexture2(), GdipCreateTexture2I(), GdipCreateTextureIA(), METAFILE_PlaybackObject(), test_colorkey(), test_colormatrix(), test_drawimage(), test_gamma(), test_getadjustedpalette(), test_remaptable(), and ZoomWnd_OnDraw().

◆ GdipCreateLineBrush()

GpStatus WINGDIPAPI GdipCreateLineBrush ( GDIPCONST GpPointF startpoint,
GDIPCONST GpPointF endpoint,
ARGB  startcolor,
ARGB  endcolor,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 398 of file brush.c.

401{
404
405 TRACE("(%s, %s, %lx, %lx, %d, %p)\n", debugstr_pointf(startpoint),
406 debugstr_pointf(endpoint), startcolor, endcolor, wrap, line);
407
408 if(!line || !startpoint || !endpoint || wrap == WrapModeClamp)
409 return InvalidParameter;
410
411 if (startpoint->X == endpoint->X && startpoint->Y == endpoint->Y)
412 return OutOfMemory;
413
414 rect.X = startpoint->X < endpoint->X ? startpoint->X : endpoint->X;
415 rect.Y = startpoint->Y < endpoint->Y ? startpoint->Y : endpoint->Y;
416 rect.Width = fabs(startpoint->X - endpoint->X);
417 rect.Height = fabs(startpoint->Y - endpoint->Y);
418
419 if (rect.Width == 0.0f)
420 {
421 rect.X -= rect.Height / 2.0f;
422 rect.Width = rect.Height;
423 }
424 else if (rect.Height == 0.0f)
425 {
426 rect.Y -= rect.Width / 2.0f;
427 rect.Height = rect.Width;
428 }
429
430 stat = create_line_brush(&rect, startcolor, endcolor, wrap, line);
431 if (stat != Ok)
432 return stat;
433
435
436 TRACE("<-- %p\n", *line);
437
438 return Ok;
439}
static void linegradient_init_transform(const GpPointF *startpoint, const GpPointF *endpoint, GpLineGradient *line)
Definition: brush.c:360
static GpStatus create_line_brush(const GpRectF *rect, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:323
_ACRTIMP double __cdecl fabs(double)
#define wrap(journal, var)
Definition: recovery.c:207
const char * debugstr_pointf(const PointF *pt)
Definition: gdiplus.c:492
Definition: nis.h:10
Definition: parser.c:49

Referenced by GdipCreateLineBrushI(), test_constructor_destructor2(), test_getgamma(), test_gradientgetrect(), test_lineblend(), test_linelinearblend(), test_penfilltype(), and test_transform().

◆ GdipCreateLineBrushFromRect()

GpStatus WINGDIPAPI GdipCreateLineBrushFromRect ( GDIPCONST GpRectF rect,
ARGB  startcolor,
ARGB  endcolor,
LinearGradientMode  mode,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 462 of file brush.c.

465{
466 float angle;
467
468 TRACE("(%s, %lx, %lx, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, mode,
469 wrap, line);
470
471 if(!line || !rect)
472 return InvalidParameter;
473
474 switch (mode)
475 {
477 angle = 0.0f;
478 break;
480 angle = 90.0f;
481 break;
483 angle = 45.0f;
484 break;
486 angle = 135.0f;
487 break;
488 default:
489 return InvalidParameter;
490 }
491
492 return GdipCreateLineBrushFromRectWithAngle(rect, startcolor, endcolor, angle, TRUE, wrap, line);
493}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:511
@ LinearGradientModeForwardDiagonal
Definition: gdiplusenums.h:226
@ LinearGradientModeBackwardDiagonal
Definition: gdiplusenums.h:227
@ LinearGradientModeHorizontal
Definition: gdiplusenums.h:224
@ LinearGradientModeVertical
Definition: gdiplusenums.h:225
GLfloat angle
Definition: glext.h:10853

Referenced by GdipCreateLineBrushFromRectI(), metafile_deserialize_brush(), test_gradientgetrect(), test_lineargradient(), and test_transform().

◆ GdipCreateLineBrushFromRectI()

GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI ( GDIPCONST GpRect rect,
ARGB  startcolor,
ARGB  endcolor,
LinearGradientMode  mode,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 495 of file brush.c.

498{
499 GpRectF rectF;
500
501 TRACE("(%p, %lx, %lx, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
502 wrap, line);
503
504 set_rect(&rectF, rect->X, rect->Y, rect->Width, rect->Height);
505 return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, wrap, line);
506}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:462

Referenced by GdipCreateLineBrushFromRectWithAngleI().

◆ GdipCreateLineBrushFromRectWithAngle()

GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle ( GDIPCONST GpRectF rect,
ARGB  startcolor,
ARGB  endcolor,
REAL  angle,
BOOL  isAngleScalable,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 511 of file brush.c.

514{
516 REAL exofs, eyofs, far_x, far_y;
517 REAL sin_angle, cos_angle, sin_cos_angle;
519
520 TRACE("(%s, %lx, %lx, %.2f, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, angle, isAngleScalable,
521 wrap, line);
522
523 if (!rect || !line || wrap == WrapModeClamp)
524 return InvalidParameter;
525
526 if (!rect->Width || !rect->Height)
527 return OutOfMemory;
528
529 angle = fmodf(angle, 360);
530 if (angle < 0)
531 angle += 360;
532
533 if (isAngleScalable)
534 {
535 float add_angle = 0;
536
537 while(angle >= 90) {
538 angle -= 180;
539 add_angle += M_PI;
540 }
541
542 if (angle != 90 && angle != -90)
543 angle = atan((rect->Width / rect->Height) * tan(deg2rad(angle)));
544 else
546 angle += add_angle;
547 }
548 else
549 {
551 }
552
553 sin_angle = sinf(angle);
554 cos_angle = cosf(angle);
555 sin_cos_angle = sin_angle * cos_angle;
556
557 far_x = rect->X + rect->Width;
558 far_y = rect->Y + rect->Height;
559
560 if (angle == 0.0f)
561 {
562 start.X = min(rect->X, far_x);
563 start.Y = rect->Y;
564 end.X = max(rect->X, far_x);
565 end.Y = rect->Y;
566 }
567 else if (sin_cos_angle >= 0)
568 {
569 start.X = min(rect->X, far_x);
570 start.Y = min(rect->Y, far_y);
571 end.X = max(rect->X, far_x);
572 end.Y = max(rect->Y, far_y);
573 }
574 else
575 {
576 start.X = max(rect->X, far_x);
577 start.Y = min(rect->Y, far_y);
578 end.X = min(rect->X, far_x);
579 end.Y = max(rect->Y, far_y);
580 }
581
582 stat = create_line_brush(rect, startcolor, endcolor, wrap, line);
583 if (stat != Ok || angle == 0.0f)
584 return stat;
585
586 if (sin_cos_angle >= 0)
587 {
588 exofs = rect->Height * sin_cos_angle + rect->Width * cos_angle * cos_angle;
589 eyofs = rect->Height * sin_angle * sin_angle + rect->Width * sin_cos_angle;
590 }
591 else
592 {
593 exofs = rect->Width * sin_angle * sin_angle + rect->Height * sin_cos_angle;
594 eyofs = -rect->Width * sin_cos_angle + rect->Height * sin_angle * sin_angle;
595 }
596
597 if (sin_angle >= 0)
598 {
599 end.X = rect->X + exofs;
600 end.Y = rect->Y + eyofs;
601 }
602 else
603 {
604 end.X = start.X;
605 end.Y = start.Y;
606 start.X = rect->X + exofs;
607 start.Y = rect->Y + eyofs;
608 }
609
611
612 return stat;
613}
_ACRTIMP double __cdecl atan(double)
Definition: atan.c:44
_ACRTIMP float __cdecl cosf(float)
Definition: cosf.c:13
_ACRTIMP float __cdecl sinf(float)
Definition: sinf.c:13
_ACRTIMP double __cdecl tan(double)
Definition: tan.c:122
_ACRTIMP float __cdecl fmodf(float, float)
static REAL deg2rad(REAL degrees)
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define M_PI
Definition: macros.h:263
#define min(a, b)
Definition: monoChain.cc:55
#define max(a, b)
Definition: svc.c:63

Referenced by GdipCreateLineBrushFromRect(), test_createLineBrushFromRectWithAngle(), and test_gradientgetrect().

◆ GdipCreateLineBrushFromRectWithAngleI()

GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI ( GDIPCONST GpRect rect,
ARGB  startcolor,
ARGB  endcolor,
REAL  angle,
BOOL  isAngleScalable,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 615 of file brush.c.

618{
619 TRACE("(%p, %lx, %lx, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
620 wrap, line);
621
623 wrap, line);
624}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:495

◆ GdipCreateLineBrushI()

GpStatus WINGDIPAPI GdipCreateLineBrushI ( GDIPCONST GpPoint startpoint,
GDIPCONST GpPoint endpoint,
ARGB  startcolor,
ARGB  endcolor,
GpWrapMode  wrap,
GpLineGradient **  line 
)

Definition at line 441 of file brush.c.

444{
445 GpPointF stF;
446 GpPointF endF;
447
448 TRACE("(%p, %p, %lx, %lx, %d, %p)\n", startpoint, endpoint,
449 startcolor, endcolor, wrap, line);
450
451 if(!startpoint || !endpoint)
452 return InvalidParameter;
453
454 stF.X = (REAL)startpoint->X;
455 stF.Y = (REAL)startpoint->Y;
456 endF.X = (REAL)endpoint->X;
457 endF.Y = (REAL)endpoint->Y;
458
459 return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line);
460}
GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF *startpoint, GDIPCONST GpPointF *endpoint, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:398

◆ GdipCreateMatrix()

GpStatus WINGDIPAPI GdipCreateMatrix ( GpMatrix **  matrix)

Definition at line 136 of file matrix.c.

137{
138 TRACE("(%p)\n", matrix);
139
140 if(!matrix)
141 return InvalidParameter;
142
143 *matrix = malloc(sizeof(GpMatrix));
144 if(!*matrix) return OutOfMemory;
145
146 (*matrix)->matrix[0] = 1.0;
147 (*matrix)->matrix[1] = 0.0;
148 (*matrix)->matrix[2] = 0.0;
149 (*matrix)->matrix[3] = 1.0;
150 (*matrix)->matrix[4] = 0.0;
151 (*matrix)->matrix[5] = 0.0;
152
153 return Ok;
154}

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipIsOutlineVisiblePathPoint(), get_pen_transform(), SOFTWARE_GdipDrawPath(), SOFTWARE_GdipDrawThinPath(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_drawdriverstring(), test_excludeinfinite(), test_flatten(), test_font_transform(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_GdipDrawString(), test_Get_Release_DC(), test_getregiondata(), test_gradientgetrect(), test_scans(), test_string_functions(), test_transform(), test_widen(), and test_worldtransform().

◆ GdipCreateMatrix2()

GpStatus WINGDIPAPI GdipCreateMatrix2 ( REAL  m11,
REAL  m12,
REAL  m21,
REAL  m22,
REAL  dx,
REAL  dy,
GpMatrix **  matrix 
)

Definition at line 59 of file matrix.c.

61{
62 TRACE("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p)\n", m11, m12, m21, m22, dx, dy, matrix);
63
64 if(!matrix)
65 return InvalidParameter;
66
67 *matrix = malloc(sizeof(GpMatrix));
68 if(!*matrix) return OutOfMemory;
69
70 /* first row */
71 (*matrix)->matrix[0] = m11;
72 (*matrix)->matrix[1] = m12;
73 /* second row */
74 (*matrix)->matrix[2] = m21;
75 (*matrix)->matrix[3] = m22;
76 /* third row */
77 (*matrix)->matrix[4] = dx;
78 (*matrix)->matrix[5] = dy;
79
80 return Ok;
81}
#define m22
#define m11
#define m12
#define m21
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97

Referenced by GdipCreateMatrix3(), test_BeginContainer2(), test_constructor_destructor(), test_DrawImage_scale(), test_GdipDrawImageFX(), test_invert(), test_isidentity(), test_isinfinite(), test_isinvertible(), test_scale(), test_shear(), test_transform(), test_translate(), and test_worldbounds().

◆ GdipCreateMatrix3()

GpStatus WINGDIPAPI GdipCreateMatrix3 ( GDIPCONST GpRectF rect,
GDIPCONST GpPointF pt,
GpMatrix **  matrix 
)

Definition at line 83 of file matrix.c.

85{
86 REAL m11, m12, m21, m22, dx, dy;
87
88 TRACE("(%s, %p, %p)\n", debugstr_rectf(rect), pt, matrix);
89
90 if(!matrix || !pt)
91 return InvalidParameter;
92
93 m11 = (pt[1].X - pt[0].X) / rect->Width;
94 m21 = (pt[2].X - pt[0].X) / rect->Height;
95 dx = pt[0].X - m11 * rect->X - m21 * rect->Y;
96 m12 = (pt[1].Y - pt[0].Y) / rect->Width;
97 m22 = (pt[2].Y - pt[0].Y) / rect->Height;
98 dy = pt[0].Y - m12 * rect->X - m22 * rect->Y;
99
100 return GdipCreateMatrix2(m11, m12, m21, m22, dx, dy, matrix);
101}
GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix)
Definition: matrix.c:59

Referenced by GdipCreateMatrix3I(), METAFILE_PlaybackUpdateWorldTransform(), and test_constructor3().

◆ GdipCreateMatrix3I()

GpStatus WINGDIPAPI GdipCreateMatrix3I ( GDIPCONST GpRect rect,
GDIPCONST GpPoint pt,
GpMatrix **  matrix 
)

Definition at line 103 of file matrix.c.

105{
106 GpRectF rectF;
107 GpPointF ptF[3];
108 int i;
109
110 TRACE("(%p, %p, %p)\n", rect, pt, matrix);
111
112 set_rect(&rectF, rect->X, rect->Y, rect->Width, rect->Height);
113
114 for (i = 0; i < 3; i++) {
115 ptF[i].X = (REAL)pt[i].X;
116 ptF[i].Y = (REAL)pt[i].Y;
117 }
118 return GdipCreateMatrix3(&rectF, ptF, matrix);
119}
GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect, GDIPCONST GpPointF *pt, GpMatrix **matrix)
Definition: matrix.c:83

◆ GdipCreateMetafileFromEmf()

GpStatus WINGDIPAPI GdipCreateMetafileFromEmf ( HENHMETAFILE  hemf,
BOOL  delete,
GpMetafile **  metafile 
)

Definition at line 4244 of file metafile.c.

4246{
4247 GpStatus stat;
4249
4250 TRACE("(%p,%i,%p)\n", hemf, delete, metafile);
4251
4252 if(!hemf || !metafile)
4253 return InvalidParameter;
4254
4256 if (stat != Ok)
4257 return stat;
4258
4259 *metafile = calloc(1, sizeof(GpMetafile));
4260 if (!*metafile)
4261 return OutOfMemory;
4262
4263 (*metafile)->image.type = ImageTypeMetafile;
4264 (*metafile)->image.format = ImageFormatEMF;
4265 (*metafile)->image.frame_count = 1;
4266 (*metafile)->image.xres = header.DpiX;
4267 (*metafile)->image.yres = header.DpiY;
4268 (*metafile)->bounds.X = (REAL)header.EmfHeader.rclFrame.left / 2540.0 * header.DpiX;
4269 (*metafile)->bounds.Y = (REAL)header.EmfHeader.rclFrame.top / 2540.0 * header.DpiY;
4270 (*metafile)->bounds.Width = (REAL)(header.EmfHeader.rclFrame.right - header.EmfHeader.rclFrame.left)
4271 / 2540.0 * header.DpiX;
4272 (*metafile)->bounds.Height = (REAL)(header.EmfHeader.rclFrame.bottom - header.EmfHeader.rclFrame.top)
4273 / 2540.0 * header.DpiY;
4274 (*metafile)->unit = UnitPixel;
4275 (*metafile)->metafile_type = header.Type;
4276 (*metafile)->hemf = hemf;
4277 (*metafile)->preserve_hemf = !delete;
4278 /* If the 31th bit of EmfPlusFlags was set, metafile was recorded with a DC for a video display.
4279 * If clear, metafile was recorded with a DC for a printer */
4280 (*metafile)->printer_display = !(header.EmfPlusFlags & (1u << 31));
4281 (*metafile)->logical_dpix = header.LogicalDpiX;
4282 (*metafile)->logical_dpiy = header.LogicalDpiY;
4283 list_init(&(*metafile)->containers);
4284
4285 TRACE("<-- %p\n", *metafile);
4286
4287 return Ok;
4288}
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hemf, MetafileHeader *header)
Definition: metafile.c:4128

Referenced by GdipCreateMetafileFromWmf(), GdipCreateMetafileFromWmfFile(), load_emf(), metafile_deserialize_image(), sync_metafile(), test_drawimage(), test_emfonly(), and test_empty().

◆ GdipCreateMetafileFromFile()

GpStatus WINGDIPAPI GdipCreateMetafileFromFile ( GDIPCONST WCHAR file,
GpMetafile **  metafile 
)

Definition at line 4360 of file metafile.c.

4362{
4364 IStream *stream;
4365
4366 TRACE("(%p, %p)\n", file, metafile);
4367
4368 if (!file || !metafile) return InvalidParameter;
4369
4370 *metafile = NULL;
4371
4373 if (status == Ok)
4374 {
4376 IStream_Release(stream);
4377 }
4378 return status;
4379}
GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, GpMetafile **metafile)
Definition: metafile.c:4381
Definition: fci.c:127

Referenced by GdipGetMetafileHeaderFromFile().

◆ GdipCreateMetafileFromStream()

GpStatus WINGDIPAPI GdipCreateMetafileFromStream ( IStream stream,
GpMetafile **  metafile 
)

Definition at line 4381 of file metafile.c.

4383{
4384 GpStatus stat;
4385
4386 TRACE("%p %p\n", stream, metafile);
4387
4389 if (stat != Ok) return stat;
4390
4391 if ((*metafile)->image.type != ImageTypeMetafile)
4392 {
4393 GdipDisposeImage(&(*metafile)->image);
4394 *metafile = NULL;
4395 return GenericError;
4396 }
4397
4398 return Ok;
4399}

Referenced by GdipCreateMetafileFromFile(), and GdipGetMetafileHeaderFromStream().

◆ GdipCreateMetafileFromWmf()

GpStatus WINGDIPAPI GdipCreateMetafileFromWmf ( HMETAFILE  hwmf,
BOOL  delete,
GDIPCONST WmfPlaceableFileHeader placeable,
GpMetafile **  metafile 
)

Definition at line 4290 of file metafile.c.

4292{
4293 UINT read;
4294 BYTE *copy;
4295 HENHMETAFILE hemf;
4296 GpStatus retval = Ok;
4297
4298 TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile);
4299
4300 if(!hwmf || !metafile)
4301 return InvalidParameter;
4302
4303 *metafile = NULL;
4304 read = GetMetaFileBitsEx(hwmf, 0, NULL);
4305 if(!read)
4306 return GenericError;
4307 copy = malloc(read);
4308 GetMetaFileBitsEx(hwmf, read, copy);
4309
4311 free(copy);
4312
4313 /* FIXME: We should store and use hwmf instead of converting to hemf */
4315
4316 if (retval == Ok)
4317 {
4318 if (placeable)
4319 {
4320 (*metafile)->image.xres = (REAL)placeable->Inch;
4321 (*metafile)->image.yres = (REAL)placeable->Inch;
4322 (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch);
4323 (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch);
4324 (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right -
4325 placeable->BoundingBox.Left);
4326 (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom -
4327 placeable->BoundingBox.Top);
4328 (*metafile)->metafile_type = MetafileTypeWmfPlaceable;
4329 }
4330 else
4331 (*metafile)->metafile_type = MetafileTypeWmf;
4332 (*metafile)->image.format = ImageFormatWMF;
4333
4334 if (delete) DeleteMetaFile(hwmf);
4335 }
4336 else
4337 DeleteEnhMetaFile(hemf);
4338 return retval;
4339}
#define read
Definition: acwin.h:97
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete, GpMetafile **metafile)
Definition: metafile.c:4244
@ MetafileTypeWmf
Definition: gdiplusenums.h:215
@ MetafileTypeWmfPlaceable
Definition: gdiplusenums.h:216
if(dx< 0)
Definition: linetemp.h:194
BOOL WINAPI DeleteMetaFile(_In_ HMETAFILE)
BOOL WINAPI DeleteEnhMetaFile(_In_opt_ HENHMETAFILE)
UINT WINAPI GetMetaFileBitsEx(_In_ HMETAFILE hMF, _In_ UINT cbBuffer, _Out_writes_bytes_opt_(cbBuffer) LPVOID lpData)
HENHMETAFILE WINAPI SetWinMetaFileBits(_In_ UINT nSize, _In_reads_bytes_(nSize) const BYTE *lpMeta16Data, _In_opt_ HDC hdcRef, _In_opt_ const METAFILEPICT *lpMFP)

Referenced by GdipCreateMetafileFromWmfFile(), GdipGetMetafileHeaderFromWmf(), load_wmf(), test_createfromwmf(), and test_createfromwmf_noplaceable().

◆ GdipCreateMetafileFromWmfFile()

GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile ( GDIPCONST WCHAR file,
GDIPCONST WmfPlaceableFileHeader placeable,
GpMetafile **  metafile 
)

Definition at line 4341 of file metafile.c.

4343{
4344 HMETAFILE hmf;
4345 HENHMETAFILE emf;
4346
4347 TRACE("(%s, %p, %p)\n", debugstr_w(file), placeable, metafile);
4348
4349 hmf = GetMetaFileW(file);
4350 if(hmf)
4351 return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile);
4352
4354 if(emf)
4356
4357 return GenericError;
4358}
GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, GDIPCONST WmfPlaceableFileHeader *placeable, GpMetafile **metafile)
Definition: metafile.c:4290
Definition: emfdc.c:45
HMETAFILE WINAPI GetMetaFileW(_In_ LPCWSTR)
HENHMETAFILE WINAPI GetEnhMetaFileW(_In_ LPCWSTR)

Referenced by test_fillpath().

◆ GdipCreatePath()

GpStatus WINGDIPAPI GdipCreatePath ( GpFillMode  fill,
GpPath **  path 
)

Definition at line 1298 of file graphicspath.c.

1299{
1300 TRACE("(%d, %p)\n", fill, path);
1301
1302 if(!path)
1303 return InvalidParameter;
1304
1305 *path = calloc(1, sizeof(GpPath));
1306 if(!*path) return OutOfMemory;
1307
1308 (*path)->fill = fill;
1309 (*path)->newfigure = TRUE;
1310
1311 return Ok;
1312}

Referenced by GdipCreatePathGradient(), GdipCreatePathGradientI(), GdipCreateRegionHrgn(), GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangles(), GdipEnumerateMetafileSrcRectDestPoints(), GdipFillClosedCurve2(), GdipFillEllipse(), GdipFillPie(), GdipFillPolygon(), GdipFillPolygonI(), GdipFillRectangles(), get_region_hrgn(), metafile_deserialize_path(), read_element(), test_addclosedcurve(), test_addcurve(), test_addpie(), test_arc(), test_bezier(), test_beziers(), test_captype(), test_combinereplace(), test_constructor_destructor(), test_drawpath(), test_ellipse(), test_empty_rect(), test_fillpath(), test_flatten(), test_GdipFillPath(), test_Get_Release_DC(), test_getbounds(), test_gethrgn(), test_getpathdata(), test_getregiondata(), test_getsubpathcount(), test_hascurve(), test_incombinedregion(), test_inset(), test_is_outline_visible_path_point(), test_isvalid(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_lastpoint(), test_line2(), test_linei(), test_linejoin(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_nextsubpath(), test_nextsubpathpath(), test_pathgradientcenterpoint(), test_pathgradientpath(), test_pathpath(), test_pen(), test_pen_thickness(), test_polygon(), test_rect(), test_rect_line(), test_reverse(), test_scale(), test_setclippath(), test_strokecap(), test_transform(), test_translate(), test_widen(), test_widen_cap(), test_worldbounds(), transform_region_element(), and widen_flat_path_anchors().

◆ GdipCreatePath2()

GpStatus WINGDIPAPI GdipCreatePath2 ( GDIPCONST GpPointF points,
GDIPCONST BYTE types,
INT  count,
GpFillMode  fill,
GpPath **  path 
)

Definition at line 1314 of file graphicspath.c.

1316{
1317 int i;
1318
1319 TRACE("(%p, %p, %d, %d, %p)\n", points, types, count, fill, path);
1320
1321 if(!points || !types || !path)
1322 return InvalidParameter;
1323
1324 if(count <= 0) {
1325 *path = NULL;
1326 return OutOfMemory;
1327 }
1328
1329 *path = calloc(1, sizeof(GpPath));
1330 if(!*path) return OutOfMemory;
1331
1333 count = 0;
1334
1335 for(i = 1; i < count; i++) {
1337 if(i+2 < count &&
1340 i += 2;
1341 else {
1342 count = 0;
1343 break;
1344 }
1345 }
1346 }
1347
1348 (*path)->pathdata.Points = malloc(count * sizeof(PointF));
1349 (*path)->pathdata.Types = malloc(count);
1350
1351 if(!(*path)->pathdata.Points || !(*path)->pathdata.Types){
1352 free((*path)->pathdata.Points);
1353 free((*path)->pathdata.Types);
1354 free(*path);
1355 return OutOfMemory;
1356 }
1357
1358 memcpy((*path)->pathdata.Points, points, count * sizeof(PointF));
1359 memcpy((*path)->pathdata.Types, types, count);
1360 if(count > 0)
1361 (*path)->pathdata.Types[0] = PathPointTypeStart;
1362 (*path)->pathdata.Count = count;
1363 (*path)->datalen = count;
1364
1365 (*path)->fill = fill;
1366 (*path)->newfigure = TRUE;
1367
1368 return Ok;
1369}
@ PathPointTypePathTypeMask
Definition: gdiplusenums.h:86
Definition: cmds.c:130

Referenced by GdipClonePath(), GdipCreatePath2I(), metafile_deserialize_path(), and test_createpath2().

◆ GdipCreatePath2I()

GpStatus WINGDIPAPI GdipCreatePath2I ( GDIPCONST GpPoint points,
GDIPCONST BYTE types,
INT  count,
GpFillMode  fill,
GpPath **  path 
)

Definition at line 1371 of file graphicspath.c.

1373{
1374 GpPointF *ptF;
1375 GpStatus ret;
1376 INT i;
1377
1378 TRACE("(%p, %p, %d, %d, %p)\n", points, types, count, fill, path);
1379
1380 ptF = malloc(sizeof(GpPointF) * count);
1381
1382 for(i = 0;i < count; i++){
1383 ptF[i].X = (REAL)points[i].X;
1384 ptF[i].Y = (REAL)points[i].Y;
1385 }
1386
1388
1389 free(ptF);
1390
1391 return ret;
1392}

◆ GdipCreatePathGradient()

GpStatus WINGDIPAPI GdipCreatePathGradient ( GDIPCONST GpPointF points,
INT  count,
GpWrapMode  wrap,
GpPathGradient **  grad 
)

Definition at line 684 of file brush.c.

686{
688 GpPath *path;
689
690 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
691
692 if(!grad)
693 return InvalidParameter;
694
695 if(!points || count <= 0)
696 return OutOfMemory;
697
699
700 if (stat == Ok)
701 {
703
704 if (stat == Ok)
705 stat = create_path_gradient(path, 0xff000000, grad);
706
707 if (stat != Ok)
709 }
710
711 if (stat == Ok)
712 (*grad)->wrap = wrap;
713
714 return stat;
715}
static GpStatus create_path_gradient(GpPath *path, ARGB centercolor, GpPathGradient **grad)
Definition: brush.c:626
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
@ FillModeAlternate
Definition: gdiplusenums.h:55

Referenced by test_getblend(), test_getbounds(), test_gradientblendcount(), test_gradientsurroundcolorcount(), test_pathgradientblend(), test_pathgradientcenterpoint(), test_pathgradientpath(), and test_pathgradientpresetblend().

◆ GdipCreatePathGradientFromPath()

GpStatus WINGDIPAPI GdipCreatePathGradientFromPath ( GDIPCONST GpPath path,
GpPathGradient **  grad 
)

Definition at line 753 of file brush.c.

755{
757 GpPath *new_path;
758
759 TRACE("(%p, %p)\n", path, grad);
760
761 if(!grad)
762 return InvalidParameter;
763
764 if (!path)
765 return OutOfMemory;
766
767 stat = GdipClonePath((GpPath*)path, &new_path);
768
769 if (stat == Ok)
770 {
771 stat = create_path_gradient(new_path, 0xffffffff, grad);
772
773 if (stat != Ok)
774 GdipDeletePath(new_path);
775 }
776
777 return stat;
778}

Referenced by test_pathgradientcenterpoint().

◆ GdipCreatePathGradientI()

GpStatus WINGDIPAPI GdipCreatePathGradientI ( GDIPCONST GpPoint points,
INT  count,
GpWrapMode  wrap,
GpPathGradient **  grad 
)

Definition at line 717 of file brush.c.

719{
721 GpPath *path;
722
723 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
724
725 if(!grad)
726 return InvalidParameter;
727
728 if(!points || count <= 0)
729 return OutOfMemory;
730
732
733 if (stat == Ok)
734 {
736
737 if (stat == Ok)
738 stat = create_path_gradient(path, 0xff000000, grad);
739
740 if (stat != Ok)
742 }
743
744 if (stat == Ok)
745 (*grad)->wrap = wrap;
746
747 return stat;
748}
GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
Definition: graphicspath.c:754

◆ GdipCreatePathIter()

GpStatus WINGDIPAPI GdipCreatePathIter ( GpPathIterator **  iterator,
GpPath path 
)

Definition at line 34 of file pathiterator.c.

35{
36 INT size;
37
38 TRACE("(%p, %p)\n", iterator, path);
39
40 if(!iterator)
41 return InvalidParameter;
42
43 *iterator = calloc(1, sizeof(GpPathIterator));
44 if(!*iterator) return OutOfMemory;
45
46 if(path){
47 size = path->pathdata.Count;
48
49 (*iterator)->pathdata.Types = malloc(size);
50 (*iterator)->pathdata.Points = malloc(size * sizeof(PointF));
51
52 memcpy((*iterator)->pathdata.Types, path->pathdata.Types, size);
53 memcpy((*iterator)->pathdata.Points, path->pathdata.Points,size * sizeof(PointF));
54 (*iterator)->pathdata.Count = size;
55 }
56 else{
57 (*iterator)->pathdata.Types = NULL;
58 (*iterator)->pathdata.Points = NULL;
59 (*iterator)->pathdata.Count = 0;
60 }
61
62 (*iterator)->subpath_pos = 0;
63 (*iterator)->marker_pos = 0;
64 (*iterator)->pathtype_pos = 0;
65
66 return Ok;
67}
GLsizeiptr size
Definition: glext.h:5919

Referenced by test_constructor_destructor(), test_getsubpathcount(), test_hascurve(), test_isvalid(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_nextsubpath(), and test_nextsubpathpath().

◆ GdipCreatePen1()

GpStatus WINGDIPAPI GdipCreatePen1 ( ARGB  color,
REAL  width,
GpUnit  unit,
GpPen **  pen 
)

◆ GdipCreatePen2()

GpStatus WINGDIPAPI GdipCreatePen2 ( GpBrush brush,
REAL  width,
GpUnit  unit,
GpPen **  pen 
)

Definition at line 160 of file pen.c.

162{
163 GpPen *gp_pen;
164 GpBrush *clone_brush;
165
166 TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
167
168 if(!pen || !brush)
169 return InvalidParameter;
170
171 gp_pen = calloc(1, sizeof(GpPen));
172 if(!gp_pen) return OutOfMemory;
173
174 gp_pen->style = GP_DEFAULT_PENSTYLE;
175 gp_pen->width = width;
176 gp_pen->unit = unit;
177 gp_pen->endcap = LineCapFlat;
178 gp_pen->join = LineJoinMiter;
179 gp_pen->miterlimit = 10.0;
180 gp_pen->dash = DashStyleSolid;
181 gp_pen->offset = 0.0;
182 gp_pen->customstart = NULL;
183 gp_pen->customend = NULL;
184 gp_pen->compound_array = NULL;
185 gp_pen->compound_array_size = 0;
186 GdipSetMatrixElements(&gp_pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
187
188 if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
189 FIXME("UnitWorld, UnitPixel only supported units\n");
190 free(gp_pen);
191 return NotImplemented;
192 }
193
194 GdipCloneBrush(brush, &clone_brush);
195 gp_pen->brush = clone_brush;
196
197 *pen = gp_pen;
198
199 TRACE("<-- %p\n", *pen);
200
201 return Ok;
202}
#define GP_DEFAULT_PENSTYLE
@ LineJoinMiter
Definition: gdiplusenums.h:105
@ LineCapFlat
Definition: gdiplusenums.h:61
@ DashStyleSolid
Definition: gdiplusenums.h:177
GpDashStyle dash
GpMatrix transform
REAL offset
REAL miterlimit
GpLineCap endcap
UINT style
GpLineJoin join
GpUnit unit
REAL width

Referenced by GdipCreatePen1(), METAFILE_PlaybackObject(), test_constructor_destructor2(), and test_penfilltype().

◆ GdipCreateRegion()

◆ GdipCreateRegionHrgn()

GpStatus WINGDIPAPI GdipCreateRegionHrgn ( HRGN  hrgn,
GpRegion **  region 
)

Definition at line 502 of file region.c.

503{
504 DWORD size;
506 LPRECT rect;
508 GpPath* path;
510 DWORD i;
511
512 TRACE("(%p, %p)\n", hrgn, region);
513
514 if(!region || !(size = GetRegionData(hrgn, 0, NULL)))
515 return InvalidParameter;
516
517 buf = malloc(size);
518 if(!buf)
519 return OutOfMemory;
520
521 if(!GetRegionData(hrgn, size, buf)){
522 free(buf);
523 return GenericError;
524 }
525
526 if(buf->rdh.nCount == 0){
527 if((stat = GdipCreateRegion(&local)) != Ok){
528 free(buf);
529 return stat;
530 }
531 if((stat = GdipSetEmpty(local)) != Ok){
532 free(buf);
534 return stat;
535 }
536 *region = local;
537 free(buf);
538 return Ok;
539 }
540
542 free(buf);
543 return stat;
544 }
545
546 rect = (LPRECT)buf->Buffer;
547 for(i = 0; i < buf->rdh.nCount; i++){
549 (REAL)(rect->right - rect->left), (REAL)(rect->bottom - rect->top))) != Ok){
550 free(buf);
552 return stat;
553 }
554 rect++;
555 }
556
557 stat = GdipCreateRegionPath(path, region);
558
559 free(buf);
561 return stat;
562}
static HRGN hrgn
GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region)
Definition: region.c:1581
#define local
Definition: zutil.h:30
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define LPRECT
Definition: precomp.h:28
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)

Referenced by GdipSetClipHrgn(), and test_fromhrgn().

◆ GdipCreateRegionPath()

GpStatus WINGDIPAPI GdipCreateRegionPath ( GpPath path,
GpRegion **  region 
)

Definition at line 425 of file region.c.

426{
429
430 TRACE("%p, %p\n", path, region);
431
432 if (!(path && region))
433 return InvalidParameter;
434
435 *region = calloc(1, sizeof(GpRegion));
436 if(!*region)
437 return OutOfMemory;
438 stat = init_region(*region, RegionDataPath);
439 if (stat != Ok)
440 {
441 GdipDeleteRegion(*region);
442 return stat;
443 }
444 element = &(*region)->node;
445
446 stat = GdipClonePath(path, &element->elementdata.path);
447 if (stat != Ok)
448 {
449 GdipDeleteRegion(*region);
450 return stat;
451 }
452
453 return Ok;
454}
@ RegionDataPath

Referenced by GdipCombineRegionPath(), GdipCreateRegionHrgn(), GdipIsVisiblePathPoint(), GdipPlayMetafileRecord(), SOFTWARE_GdipDrawThinPath(), SOFTWARE_GdipFillPath(), test_gethrgn(), test_getregiondata(), and transform_region_element().

◆ GdipCreateRegionRect()

GpStatus WINGDIPAPI GdipCreateRegionRect ( GDIPCONST GpRectF rect,
GpRegion **  region 
)

Definition at line 459 of file region.c.

461{
463
464 TRACE("%s, %p\n", debugstr_rectf(rect), region);
465
466 if (!(rect && region))
467 return InvalidParameter;
468
469 *region = calloc(1, sizeof(GpRegion));
470 stat = init_region(*region, RegionDataRect);
471 if(stat != Ok)
472 {
473 GdipDeleteRegion(*region);
474 return stat;
475 }
476
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;
481
482 return Ok;
483}
@ RegionDataRect

Referenced by GdipCombineRegionRect(), GdipCreateRegionRectI(), GdipPlayMetafileRecord(), GdipSetClipRect(), test_clipping(), test_combinereplace(), test_fillregion(), test_get_set_clip(), test_gethrgn(), and test_incombinedregion().

◆ GdipCreateRegionRectI()

GpStatus WINGDIPAPI GdipCreateRegionRectI ( GDIPCONST GpRect rect,
GpRegion **  region 
)

Definition at line 488 of file region.c.

490{
491 GpRectF rectf;
492
493 TRACE("%p, %p\n", rect, region);
494
495 set_rect(&rectf, rect->X, rect->Y, rect->Width, rect->Height);
496 return GdipCreateRegionRect(&rectf, region);
497}

Referenced by test_getregiondata().

◆ GdipCreateRegionRgnData()

GpStatus WINGDIPAPI GdipCreateRegionRgnData ( GDIPCONST BYTE data,
INT  size,
GpRegion **  region 
)

Definition at line 939 of file region.c.

940{
942 struct memory_buffer mbuf;
944 INT count;
945
946 TRACE("(%p, %d, %p)\n", data, size, region);
947
948 if (!data || !size)
949 return InvalidParameter;
950
952
955 return InvalidParameter;
956
957 status = GdipCreateRegion(region);
958 if (status != Ok)
959 return status;
960
961 count = 0;
962 status = read_element(&mbuf, *region, &(*region)->node, &count);
963 if (status == Ok && !count)
965
966 if (status != Ok)
967 {
968 GdipDeleteRegion(*region);
969 *region = NULL;
970 }
971
972 return status;
973}
static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, region_element *node, INT *count)
Definition: region.c:768
static void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size)
static const void * buffer_read(struct memory_buffer *mbuf, INT size)
#define VALID_MAGIC(x)
struct region_header header
Definition: region.c:90

Referenced by test_GdipCreateRegionRgnData(), and test_region_data().

◆ GdipCreateSolidFill()

◆ GdipCreateStreamOnFile()

GpStatus WINGDIPAPI GdipCreateStreamOnFile ( GDIPCONST WCHAR filename,
UINT  access,
IStream **  stream 
)

Definition at line 2593 of file graphics.c.

2595{
2596 DWORD dwMode;
2597 HRESULT ret;
2598
2599 TRACE("(%s, %u, %p)\n", debugstr_w(filename), access, stream);
2600
2601 if(!stream || !filename)
2602 return InvalidParameter;
2603
2604 if(access & GENERIC_WRITE)
2606 else if(access & GENERIC_READ)
2608 else
2609 return InvalidParameter;
2610
2612
2613 return hresult_to_status(ret);
2614}
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
Definition: istream.c:487
GpStatus hresult_to_status(HRESULT res)
Definition: gdiplus.c:314
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define GENERIC_WRITE
Definition: nt_native.h:90
#define STGM_CREATE
Definition: objbase.h:945
#define STGM_FAILIFTHERE
Definition: objbase.h:947
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:941
#define STGM_WRITE
Definition: objbase.h:937
#define STGM_READ
Definition: objbase.h:936

Referenced by GdipCreateBitmapFromFile(), GdipCreateMetafileFromFile(), GdipLoadImageFromFile(), and GdipSaveImageToFile().

◆ GdipCreateStringFormat()

GpStatus WINGDIPAPI GdipCreateStringFormat ( INT  attr,
LANGID  lang,
GpStringFormat **  format 
)

Definition at line 76 of file stringformat.c.

78{
79 TRACE("(%i, %x, %p)\n", attr, lang, format);
80
81 if(!format)
82 return InvalidParameter;
83
84 *format = calloc(1, sizeof(GpStringFormat));
85 if(!*format) return OutOfMemory;
86
87 (*format)->attr = attr;
88 (*format)->lang = lang;
89 (*format)->digitlang = LANG_NEUTRAL;
90 (*format)->trimming = StringTrimmingCharacter;
91 (*format)->digitsub = StringDigitSubstituteUser;
92 (*format)->character_ranges = NULL;
93 (*format)->range_count = 0;
94 (*format)->generic_typographic = FALSE;
95 /* tabstops */
96 (*format)->tabcount = 0;
97 (*format)->firsttab = 0.0;
98 (*format)->tabs = NULL;
99
100 TRACE("<-- %p\n", *format);
101
102 return Ok;
103}
@ StringTrimmingCharacter
Definition: gdiplusenums.h:292
@ StringDigitSubstituteUser
Definition: gdiplusenums.h:270
Definition: cookie.c:202
static const WCHAR lang[]
Definition: wbemdisp.c:287

Referenced by test_characterrange(), test_constructor(), test_digitsubstitution(), test_font_height_scaling(), test_font_transform(), test_GdipDrawString(), test_GdipMeasureString(), test_measure_string(), test_measured_extra_space(), test_string_functions(), test_stringformatflags(), and test_tabstops().

◆ GdipCreateTexture()

GpStatus WINGDIPAPI GdipCreateTexture ( GpImage image,
GpWrapMode  wrapmode,
GpTexture **  texture 
)

Definition at line 812 of file brush.c.

814{
818
819 TRACE("%p, %d %p\n", image, wrapmode, texture);
820
821 if (!(image && texture))
822 return InvalidParameter;
823
825 if (stat != Ok) return stat;
827 if (stat != Ok) return stat;
828
830
831 if (stat == Ok)
832 {
833 attributes->wrap = wrapmode;
834
836 texture);
837
839 }
840
841 return stat;
842}
GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
static HANDLE ACCESS_MASK ULONG attributes
Definition: om.c:94

Referenced by metafile_deserialize_brush(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_texturewrap(), and test_transform().

◆ GdipCreateTexture2()

GpStatus WINGDIPAPI GdipCreateTexture2 ( GpImage image,
GpWrapMode  wrapmode,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
GpTexture **  texture 
)

Definition at line 847 of file brush.c.

849{
852
853 TRACE("%p %d %f %f %f %f %p\n", image, wrapmode,
854 x, y, width, height, texture);
855
857
858 if (stat == Ok)
859 {
860 attributes->wrap = wrapmode;
861
863 texture);
864
866 }
867
868 return stat;
869}

◆ GdipCreateTexture2I()

GpStatus WINGDIPAPI GdipCreateTexture2I ( GpImage image,
GpWrapMode  wrapmode,
INT  x,
INT  y,
INT  width,
INT  height,
GpTexture **  texture 
)

Definition at line 954 of file brush.c.

956{
957 GpImageAttributes *imageattr;
959
960 TRACE("%p %d %d %d %d %d %p\n", image, wrapmode, x, y, width, height,
961 texture);
962
963 stat = GdipCreateImageAttributes(&imageattr);
964
965 if (stat == Ok)
966 {
967 imageattr->wrap = wrapmode;
968
969 stat = GdipCreateTextureIA(image, imageattr, x, y, width, height, texture);
971 }
972
973 return stat;
974}

◆ GdipCreateTextureIA()

GpStatus WINGDIPAPI GdipCreateTextureIA ( GpImage image,
GDIPCONST GpImageAttributes imageattr,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
GpTexture **  texture 
)

Definition at line 874 of file brush.c.

877{
879 GpImage *new_image=NULL;
880
881 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)\n", image, imageattr, x, y, width, height,
882 texture);
883
884 if(!image || !texture || x < 0.0 || y < 0.0 || width < 0.0 || height < 0.0)
885 return InvalidParameter;
886
887 *texture = NULL;
888
889 if(image->type != ImageTypeBitmap){
890 FIXME("not implemented for image type %d\n", image->type);
891 return NotImplemented;
892 }
893
895 if (status != Ok)
896 return status;
897
898 *texture = calloc(1, sizeof(GpTexture));
899 if (!*texture){
901 goto exit;
902 }
903
904 GdipSetMatrixElements(&(*texture)->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
905
906 if (imageattr)
907 {
908 status = GdipCloneImageAttributes(imageattr, &(*texture)->imageattributes);
909 }
910 else
911 {
912 status = GdipCreateImageAttributes(&(*texture)->imageattributes);
913 if (status == Ok)
914 (*texture)->imageattributes->wrap = WrapModeTile;
915 }
916 if (status == Ok)
917 {
918 (*texture)->brush.bt = BrushTypeTextureFill;
919 (*texture)->image = new_image;
920 }
921
922exit:
923 if (status == Ok)
924 {
925 TRACE("<-- %p\n", *texture);
926 }
927 else
928 {
929 if (*texture)
930 {
931 GdipDisposeImageAttributes((*texture)->imageattributes);
932 free(*texture);
933 *texture = NULL;
934 }
935 GdipDisposeImage(new_image);
936 TRACE("<-- error %u\n", status);
937 }
938
939 return status;
940}
@ WrapModeTile
Definition: gdiplusenums.h:205
GpStatus WINGDIPAPI GdipCloneImageAttributes(GDIPCONST GpImageAttributes *imageattr, GpImageAttributes **cloneImageattr)
#define exit(n)
Definition: config.h:202

Referenced by GdipCloneBrush(), GdipCreateTexture(), GdipCreateTexture2(), GdipCreateTexture2I(), and GdipCreateTextureIAI().

◆ GdipCreateTextureIAI()

GpStatus WINGDIPAPI GdipCreateTextureIAI ( GpImage image,
GDIPCONST GpImageAttributes imageattr,
INT  x,
INT  y,
INT  width,
INT  height,
GpTexture **  texture 
)

Definition at line 945 of file brush.c.

947{
948 TRACE("(%p, %p, %d, %d, %d, %d, %p)\n", image, imageattr, x, y, width, height,
949 texture);
950
952}

◆ GdipDeleteBrush()

GpStatus WINGDIPAPI GdipDeleteBrush ( GpBrush brush)

Definition at line 1020 of file brush.c.

1021{
1022 TRACE("(%p)\n", brush);
1023
1024 if(!brush) return InvalidParameter;
1025
1026 switch(brush->bt)
1027 {
1030 free(((GpPathGradient*)brush)->blendfac);
1031 free(((GpPathGradient*)brush)->blendpos);
1032 free(((GpPathGradient*)brush)->surroundcolors);
1033 free(((GpPathGradient*)brush)->pblendcolor);
1034 free(((GpPathGradient*)brush)->pblendpos);
1035 break;
1037 free(((GpLineGradient*)brush)->blendfac);
1038 free(((GpLineGradient*)brush)->blendpos);
1039 free(((GpLineGradient*)brush)->pblendcolor);
1040 free(((GpLineGradient*)brush)->pblendpos);
1041 break;
1043 GdipDisposeImage(((GpTexture*)brush)->image);
1044 GdipDisposeImageAttributes(((GpTexture*)brush)->imageattributes);
1045 free(((GpTexture*)brush)->bitmap_bits);
1046 break;
1047 default:
1048 break;
1049 }
1050
1051 free(brush);
1052
1053 return Ok;
1054}
static const BYTE bitmap_bits[48 *48/8]
Definition: imagelist.c:131

Referenced by GdipCreatePen1(), GdipDeletePen(), GdipGraphicsClear(), GdipPlayMetafileRecord(), GdipSetPenBrushFill(), metafile_deserialize_brush(), metafile_free_object_table_entry(), METAFILE_PlaybackObject(), test_brushfill(), test_clipping(), test_constructor_destructor(), test_constructor_destructor2(), test_containers(), test_createHatchBrush(), test_createLineBrushFromRectWithAngle(), test_drawdriverstring(), test_fillellipse(), test_fillpath(), test_fillrect(), test_fillregion(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_GdipDrawString(), test_GdipFillClosedCurve(), test_GdipFillClosedCurve2(), test_GdipFillClosedCurve2I(), test_GdipFillClosedCurveI(), test_GdipFillPath(), test_GdipFillRectangles(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_Get_Release_DC(), test_getblend(), test_getbounds(), test_getgamma(), test_getHatchStyle(), test_gradientblendcount(), test_gradientgetrect(), test_gradientsurroundcolorcount(), test_hatchBrushStyles(), test_hdc_caching(), test_lineargradient(), test_lineblend(), test_linelinearblend(), test_nullframerect(), test_pagetransform(), test_pathgradientblend(), test_pathgradientcenterpoint(), test_pathgradientpath(), test_pathgradientpresetblend(), test_penfilltype(), test_printer_dc(), test_renderingOrigin(), test_string_functions(), test_texturewrap(), test_transform(), test_type(), test_unknownfontdecode(), and test_worldtransform().

◆ GdipDeleteCachedBitmap()

GpStatus WINGDIPAPI GdipDeleteCachedBitmap ( GpCachedBitmap cachedbmp)

Definition at line 2002 of file image.c.

2003{
2004 TRACE("%p\n", cachedbmp);
2005
2006 if(!cachedbmp)
2007 return InvalidParameter;
2008
2009 GdipDisposeImage(cachedbmp->image);
2010 free(cachedbmp);
2011
2012 return Ok;
2013}

◆ GdipDeleteCustomLineCap()

◆ GdipDeleteEffect()

GpStatus WINGDIPAPI GdipDeleteEffect ( CGpEffect effect)

Definition at line 5585 of file image.c.

5586{
5587 TRACE("(%p)\n", effect);
5588
5589 if (!effect)
5590 return InvalidParameter;
5591
5592 free(effect);
5593 return Ok;
5594}

◆ GdipDeleteFont()

◆ GdipDeleteFontFamily()

◆ GdipDeleteGraphics()

GpStatus WINGDIPAPI GdipDeleteGraphics ( GpGraphics graphics)

Definition at line 2616 of file graphics.c.

2617{
2619 GpStatus stat;
2620 TRACE("(%p)\n", graphics);
2621
2622 if(!graphics) return InvalidParameter;
2623 if(graphics->busy) return ObjectBusy;
2624
2625 assert(graphics->hdc_refs == 0);
2626
2627 if (is_metafile_graphics(graphics))
2628 {
2630 if (stat != Ok)
2631 return stat;
2632 }
2633
2634 if (graphics->temp_hdc)
2635 {
2636 if (graphics->owndc)
2637 ReleaseDC(graphics->hwnd, graphics->temp_hdc);
2638 else
2639 DeleteDC(graphics->temp_hdc);
2640 graphics->temp_hdc = NULL;
2641 }
2642
2644 list_remove(&cont->entry);
2645 delete_container(cont);
2646 }
2647
2648 GdipDeleteRegion(graphics->clip);
2649
2650 DeleteObject(graphics->gdi_clip);
2651
2652 /* Native returns ObjectBusy on the second free, instead of crashing as we'd
2653 * do otherwise, but we can't have that in the test suite because it means
2654 * accessing freed memory. */
2655 graphics->busy = TRUE;
2656
2657 free(graphics);
2658
2659 return Ok;
2660}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void delete_container(GraphicsContainerItem *container)
Definition: graphics.c:2204
#define assert(_expr)
Definition: assert.h:32
GpStatus METAFILE_GraphicsDeleted(GpMetafile *metafile)
Definition: metafile.c:1675
uint32_t entry
Definition: isohybrid.c:63
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
GpRegion * clip

Referenced by check_metafile(), GdipAddPathString(), GdipGetImageThumbnail(), get_path_hrgn(), METAFILE_DrawImagePointsRect(), test_alpha_hdc(), test_BeginContainer2(), test_bitmapfromgraphics(), test_clear(), test_clip_xform(), test_cliphrgn_transform(), test_clipping(), test_clipping_2(), test_colorkey(), test_colormatrix(), test_constructor_destructor(), test_container_rects(), test_containers(), test_converttoemfplus(), test_createfont_charset(), test_drawdriverstring(), test_drawellipse(), test_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_drawrectangle(), test_emfonly(), test_empty(), test_fillellipse(), test_fillpath(), test_fillrect(), test_fillregion(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_font_transform(), test_frameunit(), test_fromhrgn(), test_fromMemoryBitmap(), test_gamma(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_GdipCreateRegionRgnData(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), test_GdipDrawImageFX(), test_GdipDrawImagePointRect(), test_GdipDrawImagePointsRect(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipDrawLineI(), test_GdipDrawLinesI(), test_GdipDrawString(), test_GdipFillClosedCurve(), test_GdipFillClosedCurve2(), test_GdipFillClosedCurve2I(), test_GdipFillClosedCurveI(), test_GdipFillPath(), test_GdipFillRectangles(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetNearestColor(), test_GdipGetVisibleClipBounds(), test_GdipGetVisibleClipBounds_memoryDC(), test_GdipGetVisibleClipBounds_screen(), test_GdipGetVisibleClipBounds_window(), test_GdipGraphicsSetAbort(), test_GdipIsVisiblePoint(), test_GdipIsVisibleRect(), test_GdipMeasureString(), test_gditransform(), test_Get_Release_DC(), test_get_set_clip(), test_get_set_interpolation(), test_get_set_textrenderinghint(), test_getbounds(), test_getdc(), test_getdc_scaled(), test_gethrgn(), test_graphics_clear(), test_hatchBrushStyles(), test_hdc_caching(), test_is_outline_visible_path_point(), test_isempty(), test_isequal(), test_isinfinite(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_lineargradient(), test_logfont(), test_measure_string(), test_measured_extra_space(), test_nullframerect(), test_offsetclip(), test_pagetransform(), test_pen(), test_pen_thickness(), test_printer_dc(), test_properties(), test_remaptable(), test_renderingOrigin(), test_resetclip(), test_resolution(), test_restoredc(), test_save_restore(), test_set_page_transform(), test_setclippath(), test_string_functions(), test_textcontrast(), test_texturewrap(), test_transform(), test_transformpoints(), test_translate(), test_unknownfontdecode(), test_worldtransform(), and ZoomWnd_OnDraw().

◆ GdipDeleteMatrix()

◆ GdipDeletePath()

GpStatus WINGDIPAPI GdipDeletePath ( GpPath path)

Definition at line 1394 of file graphicspath.c.

1395{
1396 TRACE("(%p)\n", path);
1397
1398 if(!path)
1399 return InvalidParameter;
1400
1401 free(path->pathdata.Points);
1402 free(path->pathdata.Types);
1403 free(path);
1404
1405 return Ok;
1406}

Referenced by brush_fill_pixels(), delete_element(), GdipAddPathRectangle(), GdipAddPathRectangles(), GdipAddPathString(), GdipCloneBrush(), GdipCreatePathGradient(), GdipCreatePathGradientFromPath(), GdipCreatePathGradientI(), GdipCreateRegionHrgn(), GdipDeleteBrush(), GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangles(), GdipEnumerateMetafileSrcRectDestPoints(), GdipFillClosedCurve2(), GdipFillEllipse(), GdipFillPie(), GdipFillPolygon(), GdipFillPolygonI(), GdipFillRectangles(), GdipIsOutlineVisiblePathPoint(), GdipSetClipPath(), GdipWidenPath(), get_region_hrgn(), metafile_deserialize_custom_line_cap(), metafile_free_object_table_entry(), SOFTWARE_GdipDrawPath(), SOFTWARE_GdipDrawThinPath(), test_addclosedcurve(), test_addcurve(), test_addpie(), test_arc(), test_bezier(), test_beziers(), test_captype(), test_combinereplace(), test_constructor_destructor(), test_createpath2(), test_drawpath(), test_ellipse(), test_empty_rect(), test_fillpath(), test_flatten(), test_GdipFillPath(), test_Get_Release_DC(), test_getbounds(), test_gethrgn(), test_getpathdata(), test_getregiondata(), test_getsubpathcount(), test_hascurve(), test_incombinedregion(), test_inset(), test_is_outline_visible_path_point(), test_isvalid(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_lastpoint(), test_line2(), test_linei(), test_linejoin(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_nextsubpath(), test_nextsubpathpath(), test_pathgradientcenterpoint(), test_pathgradientpath(), test_pathpath(), test_pen(), test_pen_thickness(), test_polygon(), test_rect(), test_rect_line(), test_reverse(), test_scale(), test_setclippath(), test_strokecap(), test_transform(), test_translate(), test_widen(), test_widen_cap(), test_worldbounds(), transform_region_element(), and widen_flat_path_anchors().

◆ GdipDeletePathIter()

GpStatus WINGDIPAPI GdipDeletePathIter ( GpPathIterator iter)

Definition at line 69 of file pathiterator.c.

70{
71 TRACE("(%p)\n", iter);
72
73 if(!iter)
74 return InvalidParameter;
75
76 free(iter->pathdata.Types);
77 free(iter->pathdata.Points);
78 free(iter);
79
80 return Ok;
81}
GpPathData pathdata

Referenced by test_constructor_destructor(), test_getsubpathcount(), test_hascurve(), test_isvalid(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_nextsubpath(), and test_nextsubpathpath().

◆ GdipDeletePen()

◆ GdipDeletePrivateFontCollection()

GpStatus WINGDIPAPI GdipDeletePrivateFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1076 of file font.c.

1077{
1078 INT i;
1079
1080 TRACE("%p\n", fontCollection);
1081
1082 if (!fontCollection)
1083 return InvalidParameter;
1084
1085 for (i = 0; i < (*fontCollection)->count; i++) GdipDeleteFontFamily((*fontCollection)->FontFamilies[i]);
1086 free((*fontCollection)->FontFamilies);
1087 free(*fontCollection);
1088
1089 return Ok;
1090}

Referenced by test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipDeleteRegion()

GpStatus WINGDIPAPI GdipDeleteRegion ( GpRegion region)

◆ GdipDeleteStringFormat()

GpStatus WINGDIPAPI GdipDeleteStringFormat ( GpStringFormat format)

◆ GdipDisposeImage()

GpStatus WINGDIPAPI GdipDisposeImage ( GpImage image)

Definition at line 2099 of file image.c.

2100{
2102
2103 TRACE("%p\n", image);
2104
2106 if (status != Ok) return status;
2107 image->type = ~0;
2108 free(image);
2109
2110 return Ok;
2111}
static GpStatus free_image_data(GpImage *image)
Definition: image.c:2071

Referenced by decode_frame_wic(), DibLoadImage(), GdipCloneBitmapArea(), GdipCreateBitmapFromHBITMAP(), GdipCreateBitmapFromHICON(), GdipCreateBitmapFromScan0(), GdipCreateBitmapFromStream(), GdipCreateMetafileFromStream(), GdipCreateTextureIA(), GdipDeleteBrush(), GdipDeleteCachedBitmap(), GdipGetImageThumbnail(), GdipGetMetafileHeaderFromFile(), GdipGetMetafileHeaderFromStream(), GdipGetMetafileHeaderFromWmf(), GdipImageRotateFlip(), load_image(), metafile_deserialize_brush(), metafile_deserialize_image(), METAFILE_DrawImagePointsRect(), metafile_free_object_table_entry(), Preview_pFreeImage(), select_frame_wic(), SetWallpaper(), sync_metafile(), test_ARGB_conversion(), test_bitmap_stride(), test_bitmapbits(), test_bitmapfromgraphics(), test_bufferrawformat(), test_clear(), test_clipping(), test_CloneBitmapArea(), test_colorkey(), test_colormatrix(), test_containers(), test_converttoemfplus(), test_createfromwmf(), test_createfromwmf_noplaceable(), test_createhbitmap(), test_dispose(), test_drawdriverstring(), test_drawellipse(), test_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_drawrectangle(), test_emfonly(), test_empty(), test_fillellipse(), test_fillpath(), test_fillrect(), test_fillregion(), test_frameunit(), test_FromGdiDib(), test_fromhicon(), test_fromMemoryBitmap(), test_gamma(), test_gdi_interop_bitmap(), test_GdipCloneImage(), test_GdipCreateBitmapFromHBITMAP(), test_GdipDrawImageFX(), test_GdipDrawImagePointRect(), test_GdipDrawImagePointsRect(), test_GdipDrawImagePointsRectOnMemoryDC(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetAllPropertyItems(), test_GdipGetImageFlags(), test_GdipGetNearestColor(), test_GdipImageGetFrameDimensionsCount(), test_GdipInitializePalette(), test_GdipMeasureString(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_GetImageDimension(), test_getsetpixel(), test_getthumbnail(), test_gif_properties(), test_graphics_clear(), test_hatchBrushStyles(), test_histogram(), test_image_format(), test_image_properties(), test_imageabort(), test_lineargradient(), test_loadwmf(), test_LockBits(), test_LockBits_UserBuf(), test_multiframegif(), test_nullframerect(), test_offsetclip(), test_pagetransform(), test_palette(), test_PARGB_conversion(), test_pen(), test_pen_thickness(), test_png_color_formats(), test_png_datetime_property(), test_png_histogram_property(), test_png_save_palette(), test_png_unit_properties(), test_printer_dc(), test_properties(), test_remaptable(), test_renderingOrigin(), test_resetclip(), test_resolution(), test_restoredc(), test_rotateflip(), test_SavingImages(), test_SavingMultiPageTiff(), test_Scan0(), test_setclippath(), test_supported_encoders(), test_texturewrap(), test_tiff_palette(), test_tiff_properties(), test_transform(), test_unknownfontdecode(), and test_worldtransform().

◆ GdipDisposeImageAttributes()

GpStatus WINGDIPAPI GdipDisposeImageAttributes ( GpImageAttributes imageattr)

Definition at line 97 of file imageattributes.c.

98{
99 int i;
100
101 TRACE("(%p)\n", imageattr);
102
103 if(!imageattr)
104 return InvalidParameter;
105
106 for (i=0; i<ColorAdjustTypeCount; i++)
107 free(imageattr->colorremaptables[i].colormap);
108
109 free(imageattr);
110
111 return Ok;
112}
struct color_remap_table colorremaptables[ColorAdjustTypeCount]

Referenced by GdipCreateTexture(), GdipCreateTexture2(), GdipCreateTexture2I(), GdipCreateTextureIA(), GdipDeleteBrush(), metafile_free_object_table_entry(), METAFILE_PlaybackObject(), test_colorkey(), test_colormatrix(), test_drawimage(), test_gamma(), test_getadjustedpalette(), test_remaptable(), and ZoomWnd_OnDraw().

◆ GdipDrawArc()

GpStatus WINGDIPAPI GdipDrawArc ( GpGraphics graphics,
GpPen pen,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 2662 of file graphics.c.

2664{
2666 GpPath *path;
2667 GpRectF rect;
2668
2669 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
2670 width, height, startAngle, sweepAngle);
2671
2672 if(!graphics || !pen || width <= 0 || height <= 0)
2673 return InvalidParameter;
2674
2675 if(graphics->busy)
2676 return ObjectBusy;
2677
2678 if (is_metafile_graphics(graphics))
2679 {
2680 set_rect(&rect, x, y, width, height);
2681 return METAFILE_DrawArc((GpMetafile *)graphics->image, pen, &rect, startAngle, sweepAngle);
2682 }
2683
2685 if (status != Ok) return status;
2686
2687 status = GdipAddPathArc(path, x, y, width, height, startAngle, sweepAngle);
2688 if (status == Ok)
2689 status = GdipDrawPath(graphics, pen, path);
2690
2692 return status;
2693}
GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:4207
GpStatus METAFILE_DrawArc(GpMetafile *metafile, GpPen *pen, const GpRectF *rect, REAL startAngle, REAL sweepAngle)
Definition: metafile.c:5536

Referenced by GdipDrawArcI(), GdipPlayMetafileRecord(), test_GdipDrawArc(), and test_Get_Release_DC().

◆ GdipDrawArcI()

GpStatus WINGDIPAPI GdipDrawArcI ( GpGraphics graphics,
GpPen pen,
INT  x,
INT  y,
INT  width,
INT  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 2695 of file graphics.c.

2697{
2698 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n", graphics, pen, x, y,
2699 width, height, startAngle, sweepAngle);
2700
2701 return GdipDrawArc(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
2702}
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:2662

Referenced by GdipPlayMetafileRecord(), test_GdipDrawArcI(), and test_Get_Release_DC().

◆ GdipDrawBezier()

GpStatus WINGDIPAPI GdipDrawBezier ( GpGraphics graphics,
GpPen pen,
REAL  x1,
REAL  y1,
REAL  x2,
REAL  y2,
REAL  x3,
REAL  y3,
REAL  x4,
REAL  y4 
)

Definition at line 2704 of file graphics.c.

2706{
2707 GpPointF pt[4];
2708
2709 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x1, y1,
2710 x2, y2, x3, y3, x4, y4);
2711
2712 if(!graphics || !pen)
2713 return InvalidParameter;
2714
2715 if(graphics->busy)
2716 return ObjectBusy;
2717
2718 pt[0].X = x1;
2719 pt[0].Y = y1;
2720 pt[1].X = x2;
2721 pt[1].Y = y2;
2722 pt[2].X = x3;
2723 pt[2].Y = y3;
2724 pt[3].X = x4;
2725 pt[3].Y = y4;
2726 return GdipDrawBeziers(graphics, pen, pt, 4);
2727}
GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:2738

Referenced by GdipDrawBezierI(), and test_Get_Release_DC().

◆ GdipDrawBezierI()

GpStatus WINGDIPAPI GdipDrawBezierI ( GpGraphics graphics,
GpPen pen,
INT  x1,
INT  y1,
INT  x2,
INT  y2,
INT  x3,
INT  y3,
INT  x4,
INT  y4 
)

Definition at line 2729 of file graphics.c.

2731{
2732 TRACE("(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d)\n", graphics, pen, x1, y1,
2733 x2, y2, x3, y3, x4, y4);
2734
2735 return GdipDrawBezier(graphics, pen, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2, (REAL)x3, (REAL)y3, (REAL)x4, (REAL)y4);
2736}
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
Definition: graphics.c:2704

Referenced by test_GdipDrawBezierI(), and test_Get_Release_DC().

◆ GdipDrawBeziers()

GpStatus WINGDIPAPI GdipDrawBeziers ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 2738 of file graphics.c.

2740{
2742 GpPath *path;
2743
2744 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2745
2746 if(!graphics || !pen || !points || (count <= 0))
2747 return InvalidParameter;
2748
2749 if(graphics->busy)
2750 return ObjectBusy;
2751
2753 if (status != Ok) return status;
2754
2756 if (status == Ok)
2757 status = GdipDrawPath(graphics, pen, path);
2758
2760 return status;
2761}

Referenced by GdipDrawBezier(), GdipDrawBeziersI(), and test_Get_Release_DC().

◆ GdipDrawBeziersI()

GpStatus WINGDIPAPI GdipDrawBeziersI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 2763 of file graphics.c.

2765{
2766 GpPointF *pts;
2767 GpStatus ret;
2768 INT i;
2769
2770 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2771
2772 if(!graphics || !pen || !points || (count <= 0))
2773 return InvalidParameter;
2774
2775 if(graphics->busy)
2776 return ObjectBusy;
2777
2778 pts = malloc(sizeof(GpPointF) * count);
2779 if(!pts)
2780 return OutOfMemory;
2781
2782 for(i = 0; i < count; i++){
2783 pts[i].X = (REAL)points[i].X;
2784 pts[i].Y = (REAL)points[i].Y;
2785 }
2786
2787 ret = GdipDrawBeziers(graphics,pen,pts,count);
2788
2789 free(pts);
2790
2791 return ret;
2792}

Referenced by test_Get_Release_DC().

◆ GdipDrawCachedBitmap()

GpStatus WINGDIPAPI GdipDrawCachedBitmap ( GpGraphics graphics,
GpCachedBitmap cachedbmp,
INT  x,
INT  y 
)

Definition at line 2015 of file image.c.

2017{
2018 TRACE("%p %p %d %d\n", graphics, cachedbmp, x, y);
2019
2020 if(!graphics || !cachedbmp)
2021 return InvalidParameter;
2022
2023 return GdipDrawImage(graphics, cachedbmp->image, (REAL)x, (REAL)y);
2024}
GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y)
Definition: graphics.c:3026

◆ GdipDrawClosedCurve()

GpStatus WINGDIPAPI GdipDrawClosedCurve ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 2794 of file graphics.c.

2796{
2797 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2798
2799 return GdipDrawClosedCurve2(graphics, pen, points, count, 1.0);
2800}
GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphics.c:2810

Referenced by test_Get_Release_DC().

◆ GdipDrawClosedCurve2()

GpStatus WINGDIPAPI GdipDrawClosedCurve2 ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count,
REAL  tension 
)

Definition at line 2810 of file graphics.c.

2812{
2813 GpPath *path;
2815
2816 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2817
2818 if(!graphics || !pen || !points || count <= 0)
2819 return InvalidParameter;
2820
2821 if(graphics->busy)
2822 return ObjectBusy;
2823
2825 if (status != Ok) return status;
2826
2828 if (status == Ok)
2829 status = GdipDrawPath(graphics, pen, path);
2830
2832
2833 return status;
2834}

Referenced by GdipDrawClosedCurve(), GdipDrawClosedCurve2I(), and test_Get_Release_DC().

◆ GdipDrawClosedCurve2I()

GpStatus WINGDIPAPI GdipDrawClosedCurve2I ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count,
REAL  tension 
)

Definition at line 2836 of file graphics.c.

2838{
2839 GpPointF *ptf;
2840 GpStatus stat;
2841 INT i;
2842
2843 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2844
2845 if(!points || count <= 0)
2846 return InvalidParameter;
2847
2848 ptf = malloc(sizeof(GpPointF) * count);
2849 if(!ptf)
2850 return OutOfMemory;
2851
2852 for(i = 0; i < count; i++){
2853 ptf[i].X = (REAL)points[i].X;
2854 ptf[i].Y = (REAL)points[i].Y;
2855 }
2856
2857 stat = GdipDrawClosedCurve2(graphics, pen, ptf, count, tension);
2858
2859 free(ptf);
2860
2861 return stat;
2862}

Referenced by GdipDrawClosedCurveI(), and test_Get_Release_DC().

◆ GdipDrawClosedCurveI()

GpStatus WINGDIPAPI GdipDrawClosedCurveI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 2802 of file graphics.c.

2804{
2805 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2806
2807 return GdipDrawClosedCurve2I(graphics, pen, points, count, 1.0);
2808}
GpStatus WINGDIPAPI GdipDrawClosedCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphics.c:2836

Referenced by test_Get_Release_DC().

◆ GdipDrawCurve()

GpStatus WINGDIPAPI GdipDrawCurve ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 2864 of file graphics.c.

2866{
2867 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2868
2869 return GdipDrawCurve2(graphics,pen,points,count,1.0);
2870}
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphics.c:2900

Referenced by GdipDrawCurveI(), test_GdipDrawCurve(), and test_Get_Release_DC().

◆ GdipDrawCurve2()

GpStatus WINGDIPAPI GdipDrawCurve2 ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count,
REAL  tension 
)

Definition at line 2900 of file graphics.c.

2902{
2903 GpPath *path;
2905
2906 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2907
2908 if(!graphics || !pen)
2909 return InvalidParameter;
2910
2911 if(graphics->busy)
2912 return ObjectBusy;
2913
2914 if(count < 2)
2915 return InvalidParameter;
2916
2918 if (status != Ok) return status;
2919
2921 if (status == Ok)
2922 status = GdipDrawPath(graphics, pen, path);
2923
2925 return status;
2926}
GpStatus WINGDIPAPI GdipAddPathCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphicspath.c:667

Referenced by GdipDrawCurve(), GdipDrawCurve2I(), GdipDrawCurve3(), test_GdipDrawCurve2(), and test_Get_Release_DC().

◆ GdipDrawCurve2I()

GpStatus WINGDIPAPI GdipDrawCurve2I ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count,
REAL  tension 
)

Definition at line 2928 of file graphics.c.

2930{
2931 GpPointF *pointsF;
2932 GpStatus ret;
2933 INT i;
2934
2935 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2936
2937 if(!points)
2938 return InvalidParameter;
2939
2940 pointsF = malloc(sizeof(GpPointF) * count);
2941 if(!pointsF)
2942 return OutOfMemory;
2943
2944 for(i = 0; i < count; i++){
2945 pointsF[i].X = (REAL)points[i].X;
2946 pointsF[i].Y = (REAL)points[i].Y;
2947 }
2948
2949 ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension);
2950 free(pointsF);
2951
2952 return ret;
2953}

Referenced by GdipDrawCurve3I(), test_GdipDrawCurve2I(), and test_Get_Release_DC().

◆ GdipDrawCurve3()

GpStatus WINGDIPAPI GdipDrawCurve3 ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count,
INT  offset,
INT  numberOfSegments,
REAL  tension 
)

Definition at line 2955 of file graphics.c.

2958{
2959 TRACE("(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen, points, count, offset, numberOfSegments, tension);
2960
2961 if(offset >= count || numberOfSegments > count - offset - 1 || numberOfSegments <= 0){
2962 return InvalidParameter;
2963 }
2964
2965 return GdipDrawCurve2(graphics, pen, points + offset, numberOfSegments + 1, tension);
2966}

Referenced by test_GdipDrawCurve3().

◆ GdipDrawCurve3I()

GpStatus WINGDIPAPI GdipDrawCurve3I ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count,
INT  offset,
INT  numberOfSegments,
REAL  tension 
)

Definition at line 2968 of file graphics.c.

2971{
2972 TRACE("(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen, points, count, offset, numberOfSegments, tension);
2973
2974 if(count < 0){
2975 return OutOfMemory;
2976 }
2977
2978 if(offset >= count || numberOfSegments > count - offset - 1 || numberOfSegments <= 0){
2979 return InvalidParameter;
2980 }
2981
2982 return GdipDrawCurve2I(graphics, pen, points + offset, numberOfSegments + 1, tension);
2983}
GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphics.c:2928

Referenced by test_GdipDrawCurve3I().

◆ GdipDrawCurveI()

GpStatus WINGDIPAPI GdipDrawCurveI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 2872 of file graphics.c.

2874{
2875 GpPointF *pointsF;
2876 GpStatus ret;
2877 INT i;
2878
2879 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2880
2881 if(!points)
2882 return InvalidParameter;
2883
2884 pointsF = malloc(sizeof(GpPointF) * count);
2885 if(!pointsF)
2886 return OutOfMemory;
2887
2888 for(i = 0; i < count; i++){
2889 pointsF[i].X = (REAL)points[i].X;
2890 pointsF[i].Y = (REAL)points[i].Y;
2891 }
2892
2893 ret = GdipDrawCurve(graphics,pen,pointsF,count);
2894 free(pointsF);
2895
2896 return ret;
2897}
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:2864

Referenced by test_GdipDrawCurveI(), and test_Get_Release_DC().

◆ GdipDrawDriverString()

GpStatus WINGDIPAPI GdipDrawDriverString ( GpGraphics graphics,
GDIPCONST UINT16 text,
INT  length,
GDIPCONST GpFont font,
GDIPCONST GpBrush brush,
GDIPCONST PointF positions,
INT  flags,
GDIPCONST GpMatrix matrix 
)

Definition at line 7903 of file graphics.c.

7907{
7908 TRACE("(%p %s %p %p %p %d %s)\n", graphics, debugstr_wn(text, length), font, brush, positions, flags, debugstr_matrix(matrix));
7909
7910 if (!graphics || !text || !font || !brush || !positions)
7911 return InvalidParameter;
7912
7913 return draw_driver_string(graphics, text, length, font, NULL,
7914 brush, positions, flags, matrix);
7915}
static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix)
Definition: graphics.c:7875
const WCHAR * text
Definition: package.c:1794
#define debugstr_wn
Definition: kernel32.h:33

Referenced by GdipPlayMetafileRecord(), test_drawdriverstring(), test_GdipDrawString(), and test_unknownfontdecode().

◆ GdipDrawEllipse()

GpStatus WINGDIPAPI GdipDrawEllipse ( GpGraphics graphics,
GpPen pen,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 2985 of file graphics.c.

2987{
2988 GpPath *path;
2990 GpRectF rect;
2991
2992 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height);
2993
2994 if(!graphics || !pen)
2995 return InvalidParameter;
2996
2997 if(graphics->busy)
2998 return ObjectBusy;
2999
3000 if (is_metafile_graphics(graphics))
3001 {
3002 set_rect(&rect, x, y, width, height);
3003 return METAFILE_DrawEllipse((GpMetafile *)graphics->image, pen, &rect);
3004 }
3005
3007 if (status != Ok) return status;
3008
3010 if (status == Ok)
3011 status = GdipDrawPath(graphics, pen, path);
3012
3014 return status;
3015}
GpStatus METAFILE_DrawEllipse(GpMetafile *metafile, GpPen *pen, GpRectF *rect)
Definition: metafile.c:5095

Referenced by GdipDrawEllipseI(), GdipPlayMetafileRecord(), test_drawellipse(), and test_Get_Release_DC().

◆ GdipDrawEllipseI()

GpStatus WINGDIPAPI GdipDrawEllipseI ( GpGraphics graphics,
GpPen pen,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 3017 of file graphics.c.

3019{
3020 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x, y, width, height);
3021
3022 return GdipDrawEllipse(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
3023}
GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:2985

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawImage()

GpStatus WINGDIPAPI GdipDrawImage ( GpGraphics graphics,
GpImage image,
REAL  x,
REAL  y 
)

Definition at line 3026 of file graphics.c.

3027{
3028 UINT width, height;
3029
3030 TRACE("(%p, %p, %.2f, %.2f)\n", graphics, image, x, y);
3031
3032 if(!graphics || !image)
3033 return InvalidParameter;
3034
3037
3038 return GdipDrawImagePointRect(graphics, image, x, y,
3039 0.0, 0.0, (REAL)width, (REAL)height, UnitPixel);
3040}
GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit)
Definition: graphics.c:3095

Referenced by GdipDrawCachedBitmap(), and GdipDrawImageI().

◆ GdipDrawImageFX()

GpStatus WINGDIPAPI GdipDrawImageFX ( GpGraphics graphics,
GpImage image,
GpRectF src_rect,
GpMatrix transform,
CGpEffect effect,
GpImageAttributes imageattr,
GpUnit  src_unit 
)

Definition at line 3042 of file graphics.c.

3045{
3046 GpRectF src_rect_buf;
3047 GpPointF points[3];
3049
3050 TRACE("(%p, %p, %p, %p, %p, %p, %d)\n", graphics, image, src_rect, transform, effect, imageattr, src_unit);
3051
3052 if (!graphics || !image)
3053 return InvalidParameter;
3054
3055 if (effect)
3056 FIXME("effect not implemented\n");
3057
3058 if (!src_rect)
3059 {
3060 if ((status = GdipGetImageBounds(image, &src_rect_buf, &src_unit)) != Ok)
3061 return status;
3062
3063 /* Metafiles may have different left-top coordinates */
3064 if (src_rect_buf.X != 0.0 || src_rect_buf.Y != 0.0)
3065 {
3066 FIXME("image bounds %s left-top not at origin", debugstr_rectf(&src_rect_buf));
3067 /* TODO: only use width and height (force origin)? */
3068 }
3069
3070 src_rect = &src_rect_buf;
3071 }
3072
3073 points[0].X = points[2].X = src_rect->X;
3074 points[0].Y = points[1].Y = src_rect->Y;
3075 points[1].X = src_rect->X + src_rect->Width;
3076 points[2].Y = src_rect->Y + src_rect->Height;
3077
3078 if (transform)
3080
3081 return GdipDrawImagePointsRect(graphics, image, points, 3,
3082 src_rect->X, src_rect->Y,
3083 src_rect->Width, src_rect->Height,
3084 src_unit, imageattr, NULL, NULL);
3085}
GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, VOID *callbackData)
Definition: graphics.c:3173
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit)
Definition: image.c:2140
GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
Definition: matrix.c:365

Referenced by test_GdipDrawImageFX().

◆ GdipDrawImageI()

GpStatus WINGDIPAPI GdipDrawImageI ( GpGraphics graphics,
GpImage image,
INT  x,
INT  y 
)

Definition at line 3087 of file graphics.c.

3089{
3090 TRACE("(%p, %p, %d, %d)\n", graphics, image, x, y);
3091
3092 return GdipDrawImage(graphics, image, (REAL)x, (REAL)y);
3093}

Referenced by test_DrawImage(), test_DrawImage_scale(), and test_DrawImage_SourceCopy().

◆ GdipDrawImagePointRect()

GpStatus WINGDIPAPI GdipDrawImagePointRect ( GpGraphics graphics,
GpImage image,
REAL  x,
REAL  y,
REAL  srcx,
REAL  srcy,
REAL  srcwidth,
REAL  srcheight,
GpUnit  srcUnit 
)

Definition at line 3095 of file graphics.c.

3098{
3099 GpPointF points[3];
3100 REAL scale_x, scale_y, width, height;
3101
3102 TRACE("(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
3103
3104 if (!graphics || !image) return InvalidParameter;
3105
3106 scale_x = units_scale(srcUnit, graphics->unit, graphics->xres, graphics->printer_display);
3107 scale_x *= graphics->xres / image->xres;
3108 scale_y = units_scale(srcUnit, graphics->unit, graphics->yres, graphics->printer_display);
3109 scale_y *= graphics->yres / image->yres;
3110 width = srcwidth * scale_x;
3111 height = srcheight * scale_y;
3112
3113 points[0].X = points[2].X = x;
3114 points[0].Y = points[1].Y = y;
3115 points[1].X = x + width;
3116 points[2].Y = y + height;
3117
3118 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3119 srcwidth, srcheight, srcUnit, NULL, NULL, NULL);
3120}
REAL units_scale(GpUnit from, GpUnit to, REAL dpi, BOOL printer_display)
Definition: gdiplus.c:382

Referenced by GdipDrawImage(), and GdipDrawImagePointRectI().

◆ GdipDrawImagePointRectI()

GpStatus WINGDIPAPI GdipDrawImagePointRectI ( GpGraphics graphics,
GpImage image,
INT  x,
INT  y,
INT  srcx,
INT  srcy,
INT  srcwidth,
INT  srcheight,
GpUnit  srcUnit 
)

Definition at line 3122 of file graphics.c.

3125{
3126 return GdipDrawImagePointRect(graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
3127}

Referenced by test_GdipDrawImagePointRect().

◆ GdipDrawImagePoints()

GpStatus WINGDIPAPI GdipDrawImagePoints ( GpGraphics graphics,
GpImage image,
GDIPCONST GpPointF dstpoints,
INT  count 
)

Definition at line 3129 of file graphics.c.

3131{
3132 UINT width, height;
3133
3134 TRACE("(%p, %p, %p, %d)\n", graphics, image, dstpoints, count);
3135
3136 if(!image)
3137 return InvalidParameter;
3138
3141
3142 return GdipDrawImagePointsRect(graphics, image, dstpoints, count, 0, 0,
3144}

Referenced by GdipDrawImagePointsI().

◆ GdipDrawImagePointsI()

GpStatus WINGDIPAPI GdipDrawImagePointsI ( GpGraphics graphics,
GpImage image,
GDIPCONST GpPoint dstpoints,
INT  count 
)

Definition at line 3146 of file graphics.c.

3148{
3149 GpPointF ptf[3];
3150
3151 TRACE("(%p, %p, %p, %d)\n", graphics, image, dstpoints, count);
3152
3153 if (count != 3 || !dstpoints)
3154 return InvalidParameter;
3155
3156 ptf[0].X = (REAL)dstpoints[0].X;
3157 ptf[0].Y = (REAL)dstpoints[0].Y;
3158 ptf[1].X = (REAL)dstpoints[1].X;
3159 ptf[1].Y = (REAL)dstpoints[1].Y;
3160 ptf[2].X = (REAL)dstpoints[2].X;
3161 ptf[2].Y = (REAL)dstpoints[2].Y;
3162
3163 return GdipDrawImagePoints(graphics, image, ptf, count);
3164}
GpStatus WINGDIPAPI GdipDrawImagePoints(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *dstpoints, INT count)
Definition: graphics.c:3129

◆ GdipDrawImagePointsRect()

GpStatus WINGDIPAPI GdipDrawImagePointsRect ( GpGraphics graphics,
GpImage image,
GDIPCONST GpPointF points,
INT  count,
REAL  srcx,
REAL  srcy,
REAL  srcwidth,
REAL  srcheight,
GpUnit  srcUnit,
GDIPCONST GpImageAttributes imageAttributes,
DrawImageAbort  callback,
VOID callbackData 
)

Definition at line 3173 of file graphics.c.

3177{
3178 GpPointF ptf[4];
3179 POINT pti[4];
3180 GpStatus stat;
3181
3182 TRACE("(%p, %p, %p, %d, %f, %f, %f, %f, %d, %p, %p, %p)\n", graphics, image, points,
3183 count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
3184 callbackData);
3185
3186 if (count == 4)
3187 return NotImplemented;
3188
3189 if(!graphics || !image || !points || count != 3)
3190 return InvalidParameter;
3191
3192 TRACE("%s %s %s\n", debugstr_pointf(&points[0]), debugstr_pointf(&points[1]),
3193 debugstr_pointf(&points[2]));
3194
3195 if (is_metafile_graphics(graphics))
3196 {
3198 image, points, count, srcx, srcy, srcwidth, srcheight,
3199 srcUnit, imageAttributes, callback, callbackData);
3200 }
3201
3202 memcpy(ptf, points, 3 * sizeof(GpPointF));
3203
3204 /* Ensure source width/height is positive */
3205 if (srcwidth < 0)
3206 {
3207 GpPointF tmp = ptf[1];
3208 srcx = srcx + srcwidth;
3209 srcwidth = -srcwidth;
3210 ptf[2].X = ptf[2].X + ptf[1].X - ptf[0].X;
3211 ptf[2].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y;
3212 ptf[1] = ptf[0];
3213 ptf[0] = tmp;
3214 }
3215
3216 if (srcheight < 0)
3217 {
3218 GpPointF tmp = ptf[2];
3219 srcy = srcy + srcheight;
3220 srcheight = -srcheight;
3221 ptf[1].X = ptf[1].X + ptf[2].X - ptf[0].X;
3222 ptf[1].Y = ptf[1].Y + ptf[2].Y - ptf[0].Y;
3223 ptf[2] = ptf[0];
3224 ptf[0] = tmp;
3225 }
3226
3227 ptf[3].X = ptf[2].X + ptf[1].X - ptf[0].X;
3228 ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y;
3229 if (!srcwidth || !srcheight || (ptf[3].X == ptf[0].X && ptf[3].Y == ptf[0].Y))
3230 return Ok;
3232 round_points(pti, ptf, 4);
3233
3234 TRACE("%s %s %s %s\n", wine_dbgstr_point(&pti[0]), wine_dbgstr_point(&pti[1]),
3235 wine_dbgstr_point(&pti[2]), wine_dbgstr_point(&pti[3]));
3236
3237 srcx = units_to_pixels(srcx, srcUnit, image->xres, graphics->printer_display);
3238 srcy = units_to_pixels(srcy, srcUnit, image->yres, graphics->printer_display);
3239 srcwidth = units_to_pixels(srcwidth, srcUnit, image->xres, graphics->printer_display);
3240 srcheight = units_to_pixels(srcheight, srcUnit, image->yres, graphics->printer_display);
3241 TRACE("src pixels: %f,%f %fx%f\n", srcx, srcy, srcwidth, srcheight);
3242
3243 if (image->type == ImageTypeBitmap)
3244 {
3246 BOOL do_resampling = FALSE;
3247 BOOL use_software = FALSE;
3248
3249 TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08lx\n",
3250 graphics->xres, graphics->yres,
3251 graphics->image && graphics->image->type == ImageTypeBitmap ? ((GpBitmap *)graphics->image)->format : 0,
3252 graphics->scale, image->xres, image->yres, bitmap->format,
3253 imageAttributes ? imageAttributes->outside_color : 0);
3254
3255 if (ptf[1].Y != ptf[0].Y || ptf[2].X != ptf[0].X ||
3256 ptf[1].X - ptf[0].X != srcwidth || ptf[2].Y - ptf[0].Y != srcheight ||
3257 srcx < 0 || srcy < 0 ||
3258 srcx + srcwidth > bitmap->width || srcy + srcheight > bitmap->height)
3259 do_resampling = TRUE;
3260
3261 if (imageAttributes || graphics->alpha_hdc || do_resampling ||
3262 (graphics->image && graphics->image->type == ImageTypeBitmap))
3263 use_software = TRUE;
3264
3265 if (use_software)
3266 {
3267 RECT dst_area;
3269 GpRect src_area;
3270 int i, x, y, src_stride, dst_stride;
3271 LPBYTE src_data, dst_data, dst_dyn_data=NULL;
3272 BitmapData lockeddata;
3273 InterpolationMode interpolation = graphics->interpolation;
3274 PixelOffsetMode offset_mode = graphics->pixeloffset;
3275 static const GpImageAttributes defaultImageAttributes = {WrapModeClamp, 0, FALSE};
3276
3277 if (!imageAttributes)
3278 imageAttributes = &defaultImageAttributes;
3279
3280 dst_area.left = dst_area.right = pti[0].x;
3281 dst_area.top = dst_area.bottom = pti[0].y;
3282 for (i=1; i<4; i++)
3283 {
3284 if (dst_area.left > pti[i].x) dst_area.left = pti[i].x;
3285 if (dst_area.right < pti[i].x) dst_area.right = pti[i].x;
3286 if (dst_area.top > pti[i].y) dst_area.top = pti[i].y;
3287 if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y;
3288 }
3289
3291 if (stat != Ok) return stat;
3292
3293 if (graphics_bounds.X > dst_area.left) dst_area.left = floorf(graphics_bounds.X);
3294 if (graphics_bounds.Y > dst_area.top) dst_area.top = floorf(graphics_bounds.Y);
3295 if (graphics_bounds.X + graphics_bounds.Width < dst_area.right) dst_area.right = ceilf(graphics_bounds.X + graphics_bounds.Width);
3296 if (graphics_bounds.Y + graphics_bounds.Height < dst_area.bottom) dst_area.bottom = ceilf(graphics_bounds.Y + graphics_bounds.Height);
3297
3298 TRACE("dst_area: %s\n", wine_dbgstr_rect(&dst_area));
3299
3300 if (IsRectEmpty(&dst_area)) return Ok;
3301
3302 if (do_resampling)
3303 {
3304 get_bitmap_sample_size(interpolation, imageAttributes->wrap,
3305 bitmap, srcx, srcy, srcwidth, srcheight, &src_area);
3306 }
3307 else
3308 {
3309 /* Make sure src_area is equal in size to dst_area. */
3310 src_area.X = srcx + dst_area.left - pti[0].x;
3311 src_area.Y = srcy + dst_area.top - pti[0].y;
3312 src_area.Width = dst_area.right - dst_area.left;
3313 src_area.Height = dst_area.bottom - dst_area.top;
3314 }
3315
3316 TRACE("src_area: %d x %d\n", src_area.Width, src_area.Height);
3317
3318 src_data = calloc(src_area.Width * src_area.Height, sizeof(ARGB));
3319 if (!src_data)
3320 return OutOfMemory;
3321 src_stride = sizeof(ARGB) * src_area.Width;
3322
3323 /* Read the bits we need from the source bitmap into a compatible buffer. */
3324 lockeddata.Width = src_area.Width;
3325 lockeddata.Height = src_area.Height;
3326 lockeddata.Stride = src_stride;
3327 lockeddata.Scan0 = src_data;
3328 if (!do_resampling && bitmap->format == PixelFormat32bppPARGB)
3329 lockeddata.PixelFormat = apply_image_attributes(imageAttributes, NULL, 0, 0, 0, ColorAdjustTypeBitmap, bitmap->format);
3330 else
3331 lockeddata.PixelFormat = PixelFormat32bppARGB;
3332
3334 lockeddata.PixelFormat, &lockeddata);
3335
3336 if (stat == Ok)
3337 stat = GdipBitmapUnlockBits(bitmap, &lockeddata);
3338
3339 if (stat != Ok)
3340 {
3341 free(src_data);
3342 return stat;
3343 }
3344
3345 apply_image_attributes(imageAttributes, src_data,
3346 src_area.Width, src_area.Height,
3347 src_stride, ColorAdjustTypeBitmap, lockeddata.PixelFormat);
3348
3349 if (do_resampling)
3350 {
3351 GpMatrix dst_to_src;
3352 REAL m11, m12, m21, m22, mdx, mdy;
3353 REAL x_dx, x_dy, y_dx, y_dy;
3354 ARGB *dst_color;
3355 GpPointF src_pointf_row, src_pointf;
3356
3357 m11 = (ptf[1].X - ptf[0].X) / srcwidth;
3358 m12 = (ptf[1].Y - ptf[0].Y) / srcwidth;
3359 m21 = (ptf[2].X - ptf[0].X) / srcheight;
3360 m22 = (ptf[2].Y - ptf[0].Y) / srcheight;
3361 mdx = ptf[0].X - m11 * srcx - m21 * srcy;
3362 mdy = ptf[0].Y - m12 * srcx - m22 * srcy;
3363
3364 GdipSetMatrixElements(&dst_to_src, m11, m12, m21, m22, mdx, mdy);
3365
3366 stat = GdipInvertMatrix(&dst_to_src);
3367 if (stat != Ok) return stat;
3368
3369 dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left);
3370 x_dx = dst_to_src.matrix[0];
3371 x_dy = dst_to_src.matrix[1];
3372 y_dx = dst_to_src.matrix[2];
3373 y_dy = dst_to_src.matrix[3];
3374
3375 /* Transform the bits as needed to the destination. */
3376 dst_data = dst_dyn_data = calloc((dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top), sizeof(ARGB));
3377 if (!dst_data)
3378 {
3379 free(src_data);
3380 return OutOfMemory;
3381 }
3382 dst_color = (ARGB*)(dst_data);
3383
3384 /* Calculate top left point of transformed image.
3385 It would be used as reference point for adding */
3386 src_pointf_row.X = dst_to_src.matrix[4] +
3387 dst_area.left * x_dx + dst_area.top * y_dx;
3388 src_pointf_row.Y = dst_to_src.matrix[5] +
3389 dst_area.left * x_dy + dst_area.top * y_dy;
3390
3391 for (y = dst_area.top; y < dst_area.bottom;
3392 y++, src_pointf_row.X += y_dx, src_pointf_row.Y += y_dy)
3393 {
3394 for (x = dst_area.left, src_pointf = src_pointf_row; x < dst_area.right;
3395 x++, src_pointf.X += x_dx, src_pointf.Y += x_dy)
3396 {
3397 if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth &&
3398 src_pointf.Y >= srcy && src_pointf.Y < srcy + srcheight)
3399 *dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
3400 imageAttributes, interpolation, offset_mode);
3401 dst_color++;
3402 }
3403 }
3404 }
3405 else
3406 {
3407 dst_data = src_data;
3408 dst_stride = src_stride;
3409 }
3410
3411 gdi_transform_acquire(graphics);
3412
3413 stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top,
3414 dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride,
3415 lockeddata.PixelFormat);
3416
3417 gdi_transform_release(graphics);
3418
3419 free(src_data);
3420
3421 free(dst_dyn_data);
3422
3423 return stat;
3424 }
3425 else
3426 {
3427 HDC src_hdc, dst_hdc;
3428 HBITMAP hbitmap, old_hbm=NULL;
3429 HRGN hrgn;
3430 INT save_state;
3431 BITMAPINFOHEADER bih;
3432 BYTE *temp_bits;
3434 INT dib_stride;
3435
3436 src_hdc = CreateCompatibleDC(0);
3437
3438 if (bitmap->format == PixelFormat16bppRGB555 ||
3439 bitmap->format == PixelFormat24bppRGB)
3440 dst_format = bitmap->format;
3441 else if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha))
3443 else
3445
3446 bih.biSize = sizeof(BITMAPINFOHEADER);
3447 bih.biWidth = bitmap->width;
3448 bih.biHeight = -bitmap->height;
3449 bih.biPlanes = 1;
3451 bih.biCompression = BI_RGB;
3452 bih.biSizeImage = 0;
3453 bih.biXPelsPerMeter = 0;
3454 bih.biYPelsPerMeter = 0;
3455 bih.biClrUsed = 0;
3456 bih.biClrImportant = 0;
3457
3459 (void**)&temp_bits, NULL, 0);
3460
3461 dib_stride = ((bitmap->width * PIXELFORMATBPP(dst_format) + 31) / 8) & ~3;
3462
3464 dib_stride, temp_bits, dst_format, bitmap->image.palette,
3465 bitmap->stride, bitmap->bits, bitmap->format,
3466 bitmap->image.palette);
3467
3468 old_hbm = SelectObject(src_hdc, hbitmap);
3469
3470 gdi_dc_acquire(graphics, &dst_hdc);
3471
3472 save_state = SaveDC(dst_hdc);
3473
3474 stat = get_clip_hrgn(graphics, &hrgn);
3475
3476 if (stat == Ok)
3477 {
3478 ExtSelectClipRgn(dst_hdc, hrgn, RGN_COPY);
3480 }
3481
3482 gdi_transform_acquire(graphics);
3483
3485 {
3486 gdi_alpha_blend(graphics, pti[0].x, pti[0].y, pti[1].x - pti[0].x, pti[2].y - pti[0].y,
3487 src_hdc, srcx, srcy, srcwidth, srcheight);
3488 }
3489 else
3490 {
3491 StretchBlt(dst_hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y,
3492 src_hdc, srcx, srcy, srcwidth, srcheight, SRCCOPY);
3493 }
3494
3495 gdi_transform_release(graphics);
3496
3497 RestoreDC(dst_hdc, save_state);
3498
3499 gdi_dc_release(graphics, dst_hdc);
3500
3501 SelectObject(src_hdc, old_hbm);
3502 DeleteDC(src_hdc);
3504 }
3505 }
3506 else if (image->type == ImageTypeMetafile && ((GpMetafile*)image)->hemf)
3507 {
3508 GpRectF rc;
3509
3510 set_rect(&rc, srcx, srcy, srcwidth, srcheight);
3512 points, count, &rc, srcUnit, play_metafile_proc, image, imageAttributes);
3513 }
3514 else
3515 {
3516 WARN("GpImage with nothing we can draw (metafile in wrong state?)\n");
3517 return InvalidParameter;
3518 }
3519
3520 return Ok;
3521}
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
static BOOL CALLBACK play_metafile_proc(EmfPlusRecordType record_type, unsigned int flags, unsigned int dataSize, const unsigned char *pStr, void *userdata)
Definition: graphics.c:3166
void gdi_dc_release(GpGraphics *graphics, HDC hdc)
Definition: graphics.c:75
GpStatus gdip_transform_points(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpPointF *points, INT count)
Definition: graphics.c:7344
GpStatus gdi_dc_acquire(GpGraphics *graphics, HDC *hdc)
Definition: graphics.c:54
static void get_bitmap_sample_size(InterpolationMode interpolation, WrapMode wrap, GpBitmap *bitmap, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpRect *rect)
Definition: graphics.c:956
static ARGB resample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width, UINT height, GpPointF *point, GDIPCONST GpImageAttributes *attributes, InterpolationMode interpolation, PixelOffsetMode offset_mode)
Definition: graphics.c:1068
GpStatus gdi_transform_acquire(GpGraphics *graphics)
Definition: graphics.c:7228
static void round_points(POINT *pti, GpPointF *ptf, INT count)
Definition: graphics.c:364
GpStatus gdi_transform_release(GpGraphics *graphics)
Definition: graphics.c:7250
static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
Definition: graphics.c:419
static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height, HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height)
Definition: graphics.c:381
static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y, const BYTE *src, INT src_width, INT src_height, INT src_stride, PixelFormat fmt)
Definition: graphics.c:651
PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data, UINT width, UINT height, INT stride, ColorAdjustType type, PixelFormat fmt)
Definition: graphics.c:796
static GpStatus get_graphics_device_bounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:2240
GpStatus WINGDIPAPI GdipInvertMatrix(GpMatrix *matrix)
Definition: matrix.c:181
GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpPointF *destPoints, INT count, GDIPCONST GpRectF *srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID *callbackData, GDIPCONST GpImageAttributes *imageAttributes)
Definition: metafile.c:3829
#define WineCoordinateSpaceGdiDevice
GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, ColorPalette *dst_palette, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *src_palette)
Definition: image.c:589
GpStatus METAFILE_DrawImagePointsRect(GpMetafile *metafile, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, VOID *callbackData)
Definition: metafile.c:4759
@ ColorAdjustTypeBitmap
PixelOffsetMode
Definition: gdiplusenums.h:159
@ CoordinateSpaceWorld
Definition: gdiplusenums.h:404
InterpolationMode
Definition: gdiplusenums.h:140
static IPrintDialogCallback callback
Definition: printdlg.c:326
static const char * dst_format
Definition: dib.c:1339
static const RECT graphics_bounds[]
Definition: dib.c:1266
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
PixelOffsetMode pixeloffset
InterpolationMode interpolation
REAL matrix[6]
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define RGN_COPY
Definition: wingdi.h:357
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
#define SRCCOPY
Definition: wingdi.h:333
int WINAPI SaveDC(_In_ HDC)
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)

Referenced by GdipDrawImageFX(), GdipDrawImagePointRect(), GdipDrawImagePoints(), GdipDrawImagePointsRectI(), GdipDrawImageRectRect(), GdipDrawImageRectRectI(), GdipPlayMetafileRecord(), test_clear(), test_drawimage(), test_emfonly(), test_fillrect(), test_GdipDrawImagePointsRect(), and test_getdc().

◆ GdipDrawImagePointsRectI()

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 
)

Definition at line 3523 of file graphics.c.

3527{
3528 GpPointF pointsF[3];
3529 INT i;
3530
3531 TRACE("(%p, %p, %p, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n", graphics, image, points, count,
3532 srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
3533 callbackData);
3534
3535 if (count == 4)
3536 return NotImplemented;
3537
3538 if (!points || count != 3)
3539 return InvalidParameter;
3540
3541 for(i = 0; i < count; i++){
3542 pointsF[i].X = (REAL)points[i].X;
3543 pointsF[i].Y = (REAL)points[i].Y;
3544 }
3545
3546 return GdipDrawImagePointsRect(graphics, image, pointsF, count, (REAL)srcx, (REAL)srcy,
3547 (REAL)srcwidth, (REAL)srcheight, srcUnit, imageAttributes,
3548 callback, callbackData);
3549}

◆ GdipDrawImageRect()

GpStatus WINGDIPAPI GdipDrawImageRect ( GpGraphics graphics,
GpImage image,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 3597 of file graphics.c.

3599{
3600 RectF bounds;
3601 GpUnit unit;
3602 GpStatus ret;
3603
3604 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, image, x, y, width, height);
3605
3606 if(!graphics || !image)
3607 return InvalidParameter;
3608
3609 ret = GdipGetImageBounds(image, &bounds, &unit);
3610 if(ret != Ok)
3611 return ret;
3612
3613 return GdipDrawImageRectRect(graphics, image, x, y, width, height,
3614 bounds.X, bounds.Y, bounds.Width, bounds.Height,
3615 unit, NULL, NULL, NULL);
3616}
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, GDIPCONST GpImageAttributes *imageattr, DrawImageAbort callback, VOID *callbackData)
Definition: graphics.c:3551
Unit
Definition: gdiplusenums.h:26

Referenced by GdipDrawImageRectI().

◆ GdipDrawImageRectI()

GpStatus WINGDIPAPI GdipDrawImageRectI ( GpGraphics graphics,
GpImage image,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 3618 of file graphics.c.

3620{
3621 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, image, x, y, width, height);
3622
3623 return GdipDrawImageRect(graphics, image, (REAL)x, (REAL)y, (REAL)width, (REAL)height);
3624}
GpStatus WINGDIPAPI GdipDrawImageRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:3597

◆ GdipDrawImageRectRect()

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,
GDIPCONST GpImageAttributes imageattr,
DrawImageAbort  callback,
VOID callbackData 
)

Definition at line 3551 of file graphics.c.

3556{
3557 GpPointF points[3];
3558
3559 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p, %p, %p)\n",
3560 graphics, image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3561 srcwidth, srcheight, srcUnit, imageattr, callback, callbackData);
3562
3563 points[0].X = dstx;
3564 points[0].Y = dsty;
3565 points[1].X = dstx + dstwidth;
3566 points[1].Y = dsty;
3567 points[2].X = dstx;
3568 points[2].Y = dsty + dstheight;
3569
3570 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3571 srcwidth, srcheight, srcUnit, imageattr, callback, callbackData);
3572}

Referenced by GdipDrawImageRect(), and ZoomWnd_OnDraw().

◆ GdipDrawImageRectRectI()

GpStatus WINGDIPAPI GdipDrawImageRectRectI ( GpGraphics graphics,
GpImage image,
INT  dstx,
INT  dsty,
INT  dstwidth,
INT  dstheight,
INT  srcx,
INT  srcy,
INT  srcwidth,
INT  srcheight,
GpUnit  srcUnit,
GDIPCONST GpImageAttributes imageAttributes,
DrawImageAbort  callback,
VOID callbackData 
)

Definition at line 3574 of file graphics.c.

3579{
3580 GpPointF points[3];
3581
3582 TRACE("(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n",
3583 graphics, image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3584 srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
3585
3586 points[0].X = dstx;
3587 points[0].Y = dsty;
3588 points[1].X = dstx + dstwidth;
3589 points[1].Y = dsty;
3590 points[2].X = dstx;
3591 points[2].Y = dsty + dstheight;
3592
3593 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3594 srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
3595}

Referenced by GdipGetImageThumbnail(), METAFILE_DrawImagePointsRect(), test_colorkey(), test_colormatrix(), test_gamma(), test_GdipDrawImagePointsRectOnMemoryDC(), and test_remaptable().

◆ GdipDrawLine()

GpStatus WINGDIPAPI GdipDrawLine ( GpGraphics graphics,
GpPen pen,
REAL  x1,
REAL  y1,
REAL  x2,
REAL  y2 
)

Definition at line 3626 of file graphics.c.

3628{
3629 GpPointF pt[2];
3630
3631 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x1, y1, x2, y2);
3632
3633 if (!pen)
3634 return InvalidParameter;
3635
3636 if (pen->unit == UnitPixel && pen->width <= 0.0)
3637 return Ok;
3638
3639 pt[0].X = x1;
3640 pt[0].Y = y1;
3641 pt[1].X = x2;
3642 pt[1].Y = y2;
3643 return GdipDrawLines(graphics, pen, pt, 2);
3644}
GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:3654

Referenced by GdipDrawLineI(), test_Get_Release_DC(), and test_pen_thickness().

◆ GdipDrawLineI()

GpStatus WINGDIPAPI GdipDrawLineI ( GpGraphics graphics,
GpPen pen,
INT  x1,
INT  y1,
INT  x2,
INT  y2 
)

Definition at line 3646 of file graphics.c.

3648{
3649 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x1, y1, x2, y2);
3650
3651 return GdipDrawLine(graphics, pen, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
3652}
GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphics.c:3626

Referenced by test_emfonly(), test_GdipDrawLineI(), and test_Get_Release_DC().

◆ GdipDrawLines()

GpStatus WINGDIPAPI GdipDrawLines ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 3654 of file graphics.c.

3656{
3658 GpPath *path;
3659
3660 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
3661
3662 if(!pen || !graphics || (count < 2))
3663 return InvalidParameter;
3664
3665 if(graphics->busy)
3666 return ObjectBusy;
3667
3669 if (status != Ok) return status;
3670
3672 if (status == Ok)
3673 status = GdipDrawPath(graphics, pen, path);
3674
3676 return status;
3677}

Referenced by GdipDrawLine(), GdipDrawLinesI(), and test_Get_Release_DC().

◆ GdipDrawLinesI()

GpStatus WINGDIPAPI GdipDrawLinesI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 3679 of file graphics.c.

3681{
3683 GpPointF *ptf;
3684 int i;
3685
3686 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
3687
3688 ptf = malloc(count * sizeof(GpPointF));
3689 if(!ptf) return OutOfMemory;
3690
3691 for(i = 0; i < count; i ++){
3692 ptf[i].X = (REAL) points[i].X;
3693 ptf[i].Y = (REAL) points[i].Y;
3694 }
3695
3696 retval = GdipDrawLines(graphics, pen, ptf, count);
3697
3698 free(ptf);
3699 return retval;
3700}

Referenced by test_GdipDrawLinesI(), and test_Get_Release_DC().

◆ GdipDrawPath()

GpStatus WINGDIPAPI GdipDrawPath ( GpGraphics graphics,
GpPen pen,
GpPath path 
)

Definition at line 4207 of file graphics.c.

4208{
4210
4211 TRACE("(%p, %p, %p)\n", graphics, pen, path);
4212
4213 if(!pen || !graphics)
4214 return InvalidParameter;
4215
4216 if(graphics->busy)
4217 return ObjectBusy;
4218
4219 if (path->pathdata.Count == 0)
4220 return Ok;
4221
4222 if (is_metafile_graphics(graphics))
4223 retval = METAFILE_DrawPath((GpMetafile*)graphics->image, pen, path);
4224 else if (!has_gdi_dc(graphics) || graphics->alpha_hdc || !brush_can_fill_path(pen->brush, FALSE))
4225 retval = SOFTWARE_GdipDrawPath(graphics, pen, path);
4226 else
4227 retval = GDI32_GdipDrawPath(graphics, pen, path);
4228
4229 return retval;
4230}
static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:3702
static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
Definition: graphics.c:1143
static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:4120
static BOOL has_gdi_dc(GpGraphics *graphics)
GpStatus METAFILE_DrawPath(GpMetafile *metafile, GpPen *pen, GpPath *path)
Definition: metafile.c:5065

Referenced by GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangles(), GdipPlayMetafileRecord(), test_drawpath(), test_Get_Release_DC(), test_pen(), and test_pen_thickness().

◆ GdipDrawPie()

GpStatus WINGDIPAPI GdipDrawPie ( GpGraphics graphics,
GpPen pen,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 4232 of file graphics.c.

4234{
4236 GpPath *path;
4237
4238 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
4239 width, height, startAngle, sweepAngle);
4240
4241 if(!graphics || !pen)
4242 return InvalidParameter;
4243
4244 if(graphics->busy)
4245 return ObjectBusy;
4246
4248 if (status != Ok) return status;
4249
4250 status = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle);
4251 if (status == Ok)
4252 status = GdipDrawPath(graphics, pen, path);
4253
4255 return status;
4256}

Referenced by GdipDrawPieI(), GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawPieI()

GpStatus WINGDIPAPI GdipDrawPieI ( GpGraphics graphics,
GpPen pen,
INT  x,
INT  y,
INT  width,
INT  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 4258 of file graphics.c.

4260{
4261 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n", graphics, pen, x, y,
4262 width, height, startAngle, sweepAngle);
4263
4264 return GdipDrawPie(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
4265}
GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4232

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawPolygon()

GpStatus WINGDIPAPI GdipDrawPolygon ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 6938 of file graphics.c.

6940{
6942 GpPath* path;
6943
6944 TRACE("(%p, %p, %d)\n", graphics, points, count);
6945
6946 if(!graphics || !pen || count<=0)
6947 return InvalidParameter;
6948
6949 if(graphics->busy)
6950 return ObjectBusy;
6951
6953 if (status != Ok) return status;
6954
6956 if (status == Ok)
6957 status = GdipDrawPath(graphics, pen, path);
6958
6960
6961 return status;
6962}

Referenced by GdipDrawPolygonI(), and test_Get_Release_DC().

◆ GdipDrawPolygonI()

GpStatus WINGDIPAPI GdipDrawPolygonI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 6964 of file graphics.c.

6966{
6967 GpStatus ret;
6968 GpPointF *ptf;
6969 INT i;
6970
6971 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
6972
6973 if(count <= 0) return InvalidParameter;
6974 ptf = malloc(sizeof(GpPointF) * count);
6975 if (!ptf) return OutOfMemory;
6976
6977 for(i = 0;i < count; i++){
6978 ptf[i].X = (REAL)points[i].X;
6979 ptf[i].Y = (REAL)points[i].Y;
6980 }
6981
6982 ret = GdipDrawPolygon(graphics,pen,ptf,count);
6983 free(ptf);
6984
6985 return ret;
6986}
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:6938

Referenced by test_Get_Release_DC().

◆ GdipDrawRectangle()

GpStatus WINGDIPAPI GdipDrawRectangle ( GpGraphics graphics,
GpPen pen,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 4267 of file graphics.c.

4269{
4270 GpRectF rect;
4271
4272 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height);
4273
4274 set_rect(&rect, x, y, width, height);
4275 return GdipDrawRectangles(graphics, pen, &rect, 1);
4276}
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4286

Referenced by GdipDrawRectangleI(), test_drawrectangle(), and test_Get_Release_DC().

◆ GdipDrawRectangleI()

GpStatus WINGDIPAPI GdipDrawRectangleI ( GpGraphics graphics,
GpPen pen,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 4278 of file graphics.c.

4280{
4281 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x, y, width, height);
4282
4283 return GdipDrawRectangle(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
4284}
GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4267

Referenced by test_Get_Release_DC().

◆ GdipDrawRectangles()

GpStatus WINGDIPAPI GdipDrawRectangles ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpRectF rects,
INT  count 
)

Definition at line 4286 of file graphics.c.

4288{
4290 GpPath *path;
4291
4292 TRACE("(%p, %p, %p, %d)\n", graphics, pen, rects, count);
4293
4294 if(!graphics || !pen || !rects || count < 1)
4295 return InvalidParameter;
4296
4297 if(graphics->busy)
4298 return ObjectBusy;
4299
4300 if (is_metafile_graphics(graphics))
4301 return METAFILE_DrawRectangles((GpMetafile *)graphics->image, pen, rects, count);
4302
4304 if (status != Ok) return status;
4305
4307 if (status == Ok)
4308 status = GdipDrawPath(graphics, pen, path);
4309
4311 return status;
4312}
GpStatus METAFILE_DrawRectangles(GpMetafile *metafile, GpPen *pen, const GpRectF *rects, INT count)
Definition: metafile.c:5481

Referenced by GdipDrawRectangle(), GdipDrawRectanglesI(), GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawRectanglesI()

GpStatus WINGDIPAPI GdipDrawRectanglesI ( GpGraphics graphics,
GpPen pen,
GDIPCONST GpRect rects,
INT  count 
)

Definition at line 4314 of file graphics.c.

4316{
4317 GpRectF *rectsF;
4318 GpStatus ret;
4319 INT i;
4320
4321 TRACE("(%p, %p, %p, %d)\n", graphics, pen, rects, count);
4322
4323 if(!rects || count<=0)
4324 return InvalidParameter;
4325
4326 rectsF = malloc(sizeof(GpRectF) * count);
4327 if(!rectsF)
4328 return OutOfMemory;
4329
4330 for(i = 0;i < count;i++)
4331 set_rect(&rectsF[i], rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height);
4332
4333 ret = GdipDrawRectangles(graphics, pen, rectsF, count);
4334 free(rectsF);
4335
4336 return ret;
4337}

Referenced by test_Get_Release_DC().

◆ GdipDrawString()

GpStatus WINGDIPAPI GdipDrawString ( GpGraphics graphics,
GDIPCONST WCHAR string,
INT  length,
GDIPCONST GpFont font,
GDIPCONST RectF rect,
GDIPCONST GpStringFormat format,
GDIPCONST GpBrush brush 
)

Definition at line 6043 of file graphics.c.

6046{
6048 HRGN rgn = NULL;
6049 HFONT gdifont;
6050 GpPointF rectcpy[4];
6051 POINT corners[4];
6052 REAL rel_width, rel_height, margin_x;
6053 INT save_state, format_flags = 0;
6054 REAL offsety = 0.0;
6055 struct draw_string_args args;
6056 RectF scaled_rect;
6057 HDC hdc, temp_hdc=NULL;
6058 TEXTMETRICW textmetric;
6059
6060 TRACE("(%p, %s, %i, %p, %s, %p, %p)\n", graphics, debugstr_wn(string, length),
6062
6063 if(!graphics || !string || !font || !brush || !rect)
6064 return InvalidParameter;
6065
6066 if(graphics->busy)
6067 return ObjectBusy;
6068
6069 if(has_gdi_dc(graphics))
6070 {
6071 status = gdi_dc_acquire(graphics, &hdc);
6072 if (status != Ok)
6073 return status;
6074 }
6075 else
6076 {
6077 hdc = temp_hdc = CreateCompatibleDC(0);
6078 }
6079
6080 if(format){
6081 TRACE("may be ignoring some format flags: attr %x\n", format->attr);
6082
6083 format_flags = format->attr;
6084
6085 /* Should be no need to explicitly test for StringAlignmentNear as
6086 * that is default behavior if no alignment is passed. */
6087 if(format->line_align != StringAlignmentNear){
6088 RectF bounds, in_rect = *rect;
6089 in_rect.Height = 0.0; /* avoid height clipping */
6090 GdipMeasureString(graphics, string, length, font, &in_rect, format, &bounds, 0, 0);
6091
6092 TRACE("bounds %s\n", debugstr_rectf(&bounds));
6093
6094 if(format->line_align == StringAlignmentCenter)
6095 offsety = (rect->Height - bounds.Height) / 2;
6096 else if(format->line_align == StringAlignmentFar)
6097 offsety = (rect->Height - bounds.Height);
6098 }
6099 TRACE("line align %d, offsety %f\n", format->line_align, offsety);
6100 }
6101
6102 save_state = SaveDC(hdc);
6103
6105 rectcpy[3].X = rectcpy[0].X = rect->X;
6106 rectcpy[1].Y = rectcpy[0].Y = rect->Y;
6107 rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width;
6108 rectcpy[3].Y = rectcpy[2].Y = rect->Y + rect->Height;
6110 round_points(corners, rectcpy, 4);
6111
6112 margin_x = (format && format->generic_typographic) ? 0.0 : font->emSize / 6.0;
6113 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres, graphics->printer_display);
6114
6115 scaled_rect.X = margin_x * rel_width;
6116 scaled_rect.Y = 0.0;
6117 scaled_rect.Width = rel_width * rect->Width;
6118 scaled_rect.Height = rel_height * rect->Height;
6119 if (scaled_rect.Width >= 0.5)
6120 {
6121 scaled_rect.Width -= margin_x * 2.0 * rel_width;
6122 if (scaled_rect.Width < 0.5) /* doesn't fit */
6123 goto end;
6124 }
6125
6126 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
6127 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
6128
6129 if (!(format_flags & StringFormatFlagsNoClip) &&
6130 scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23 &&
6131 rect->Width > 0.0 && rect->Height > 0.0)
6132 {
6133 /* FIXME: If only the width or only the height is 0, we should probably still clip */
6134 rgn = CreatePolygonRgn(corners, 4, ALTERNATE);
6135 SelectClipRgn(hdc, rgn);
6136 }
6137
6138 get_font_hfont(graphics, font, format, &gdifont, NULL, NULL);
6139 SelectObject(hdc, gdifont);
6140
6141 args.brush = brush;
6142
6143 args.x = rect->X;
6144 args.y = rect->Y + offsety;
6145
6146 args.rel_width = rel_width;
6147 args.rel_height = rel_height;
6148
6149 gdi_transform_acquire(graphics);
6150
6151 GetTextMetricsW(hdc, &textmetric);
6152 args.ascent = textmetric.tmAscent / rel_height;
6153
6154 gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE,
6156
6157 gdi_transform_release(graphics);
6158
6159 DeleteObject(rgn);
6160 DeleteObject(gdifont);
6161end:
6162 RestoreDC(hdc, save_state);
6163
6164 if (temp_hdc)
6165 DeleteDC(temp_hdc);
6166 else
6167 gdi_dc_release(graphics, hdc);
6168
6169 return Ok;
6170}
#define ALTERNATE
Definition: constants.h:278
void transform_properties(GpGraphics *graphics, GDIPCONST GpMatrix *matrix, BOOL graphics_transform, REAL *rel_width, REAL *rel_height, REAL *angle)
Definition: graphics.c:5696
static GpStatus draw_string_callback(struct gdip_format_string_info *info)
Definition: graphics.c:5985
GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, RectF *bounds, INT *codepointsfitted, INT *linesfilled)
Definition: graphics.c:5890
GpStatus gdip_format_string(GpGraphics *graphics, HDC hdc, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip, gdip_format_string_callback callback, void *user_data)
Definition: graphics.c:5478
void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, HFONT *hfont, LOGFONTW *lfw_return, GDIPCONST GpMatrix *matrix)
Definition: graphics.c:2385
@ StringAlignmentNear
Definition: gdiplusenums.h:263
@ StringFormatFlagsNoClip
Definition: gdiplusenums.h:286
GDIPCONST GpBrush * brush
Definition: graphics.c:5981
HRGN WINAPI CreatePolygonRgn(_In_reads_(cPoint) const POINT *pptl, _In_ int cPoint, _In_ int iMode)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)

Referenced by test_GdipDrawString(), and test_string_functions().

◆ GdipEmfToWmfBits()

GpStatus WINGDIPAPI GdipEmfToWmfBits ( HENHMETAFILE  hemf,
UINT  cbData16,
LPBYTE  pData16,
INT  iMapMode,
INT  eFlags 
)

Definition at line 4458 of file metafile.c.

4460{
4461 FIXME("(%p, %d, %p, %d, %d): stub\n", hemf, cbData16, pData16, iMapMode, eFlags);
4462 return NotImplemented;
4463}

◆ GdipEndContainer()

GpStatus WINGDIPAPI GdipEndContainer ( GpGraphics graphics,
GraphicsContainer  state 
)

Definition at line 6394 of file graphics.c.

6395{
6396 TRACE("(%p, %x)\n", graphics, state);
6397 return end_container(graphics, BEGIN_CONTAINER, state);
6398}
static GpStatus end_container(GpGraphics *graphics, GraphicsContainerType type, GraphicsContainer state)
Definition: graphics.c:6351

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipPlayMetafileRecord(), test_BeginContainer2(), test_container_rects(), test_containers(), and test_save_restore().

◆ GdipEnumerateMetafileDestPoint()

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpPointF dest,
EnumerateMetafileProc  callback,
VOID cb_data,
GDIPCONST GpImageAttributes attrs 
)

Definition at line 4040 of file metafile.c.

4043{
4044 GpRectF destf;
4045
4046 if (!graphics || !metafile || !dest) return InvalidParameter;
4047
4048 destf.X = dest->X;
4049 destf.Y = dest->Y;
4050 destf.Width = units_to_pixels(metafile->bounds.Width, metafile->unit,
4051 metafile->image.xres, metafile->printer_display);
4052 destf.Height = units_to_pixels(metafile->bounds.Height, metafile->unit,
4053 metafile->image.yres, metafile->printer_display);
4054
4055 return GdipEnumerateMetafileDestRect(graphics, metafile, &destf, callback, cb_data, attrs);
4056}
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect(GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpRectF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
Definition: metafile.c:4007

Referenced by GdipEnumerateMetafileDestPointI().

◆ GdipEnumerateMetafileDestPointI()

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpPoint dest,
EnumerateMetafileProc  callback,
VOID cb_data,
GDIPCONST GpImageAttributes attrs 
)

Definition at line 4058 of file metafile.c.

4061{
4062 GpPointF ptf;
4063
4064 if (!graphics || !metafile || !dest) return InvalidParameter;
4065
4066 ptf.X = dest->X;
4067 ptf.Y = dest->Y;
4068
4069 return GdipEnumerateMetafileDestPoint(graphics, metafile, &ptf, callback, cb_data, attrs);
4070}
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint(GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpPointF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
Definition: metafile.c:4040

◆ GdipEnumerateMetafileDestRect()

GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpRectF dest,
EnumerateMetafileProc  callback,
VOID cb_data,
GDIPCONST GpImageAttributes attrs 
)

Definition at line 4007 of file metafile.c.

4010{
4011 GpPointF points[3];
4012
4013 if (!graphics || !metafile || !dest) return InvalidParameter;
4014
4015 points[0].X = points[2].X = dest->X;
4016 points[0].Y = points[1].Y = dest->Y;
4017 points[1].X = dest->X + dest->Width;
4018 points[2].Y = dest->Y + dest->Height;
4019
4021 &metafile->bounds, metafile->unit, callback, cb_data, attrs);
4022}

Referenced by GdipEnumerateMetafileDestPoint(), and GdipEnumerateMetafileDestRectI().

◆ GdipEnumerateMetafileDestRectI()

GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpRect dest,
EnumerateMetafileProc  callback,
VOID cb_data,
GDIPCONST GpImageAttributes attrs 
)

Definition at line 4024 of file metafile.c.

4027{
4028 GpRectF destf;
4029
4030 if (!graphics || !metafile || !dest) return InvalidParameter;
4031
4032 destf.X = dest->X;
4033 destf.Y = dest->Y;
4034 destf.Width = dest->Width;
4035 destf.Height = dest->Height;
4036
4037 return GdipEnumerateMetafileDestRect(graphics, metafile, &destf, callback, cb_data, attrs);
4038}

◆ GdipEnumerateMetafileSrcRectDestPoints()

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpPointF destPoints,
INT  count,
GDIPCONST GpRectF srcRect,
Unit  srcUnit,
EnumerateMetafileProc  callback,
VOID callbackData,
GDIPCONST GpImageAttributes imageAttributes 
)

Definition at line 3829 of file metafile.c.

3833{
3834 struct enum_metafile_data data;
3835 GpStatus stat;
3836 GpMetafile *real_metafile = (GpMetafile*)metafile; /* whoever made this const was joking */
3838 GpPath *dst_path;
3839 RECT dst_bounds;
3840
3841 TRACE("(%p,%p,%p,%i,%p,%i,%p,%p,%p)\n", graphics, metafile,
3842 destPoints, count, srcRect, srcUnit, callback, callbackData,
3843 imageAttributes);
3844
3845 if (!graphics || !metafile || !destPoints || count != 3 || !srcRect)
3846 return InvalidParameter;
3847
3848 if (!metafile->hemf)
3849 return InvalidParameter;
3850
3851 if (metafile->playback_graphics)
3852 return ObjectBusy;
3853
3854 TRACE("%s %i -> %s %s %s\n", debugstr_rectf(srcRect), srcUnit,
3855 debugstr_pointf(&destPoints[0]), debugstr_pointf(&destPoints[1]),
3856 debugstr_pointf(&destPoints[2]));
3857
3858 data.callback = callback;
3859 data.callback_data = callbackData;
3860 data.metafile = real_metafile;
3861
3862 real_metafile->playback_graphics = graphics;
3863 real_metafile->playback_dc = NULL;
3864 real_metafile->src_rect = *srcRect;
3865
3866 memcpy(real_metafile->playback_points, destPoints, sizeof(PointF) * 3);
3868
3869 if (stat == Ok)
3870 stat = GdipBeginContainer2(graphics, &state);
3871
3872 if (stat == Ok)
3873 {
3874 stat = GdipSetPageScale(graphics, 1.0);
3875
3876 if (stat == Ok)
3877 stat = GdipSetPageUnit(graphics, UnitPixel);
3878
3879 if (stat == Ok)
3880 stat = GdipResetWorldTransform(graphics);
3881
3882 if (stat == Ok)
3883 stat = GdipCreateRegion(&real_metafile->base_clip);
3884
3885 if (stat == Ok)
3886 stat = GdipGetClip(graphics, real_metafile->base_clip);
3887
3888 if (stat == Ok)
3889 stat = GdipCreateRegion(&real_metafile->clip);
3890
3891 if (stat == Ok)
3893
3894 if (stat == Ok)
3895 {
3896 GpPointF clip_points[4];
3897
3898 clip_points[0] = real_metafile->playback_points[0];
3899 clip_points[1] = real_metafile->playback_points[1];
3900 clip_points[2].X = real_metafile->playback_points[1].X + real_metafile->playback_points[2].X
3901 - real_metafile->playback_points[0].X;
3902 clip_points[2].Y = real_metafile->playback_points[1].Y + real_metafile->playback_points[2].Y
3903 - real_metafile->playback_points[0].Y;
3904 clip_points[3] = real_metafile->playback_points[2];
3905
3906 stat = GdipAddPathPolygon(dst_path, clip_points, 4);
3907
3908 if (stat == Ok)
3909 stat = GdipCombineRegionPath(real_metafile->base_clip, dst_path, CombineModeIntersect);
3910
3911 GdipDeletePath(dst_path);
3912 }
3913
3914 if (stat == Ok)
3915 stat = GdipCreateMatrix(&real_metafile->world_transform);
3916
3917 if (stat == Ok)
3918 {
3919 real_metafile->page_unit = UnitDisplay;
3920 real_metafile->page_scale = 1.0;
3922 }
3923
3924 if (stat == Ok)
3925 {
3926 stat = METAFILE_PlaybackUpdateClip(real_metafile);
3927 }
3928
3929 if (stat == Ok)
3930 {
3931 stat = METAFILE_PlaybackGetDC(real_metafile);
3932
3933 dst_bounds.left = real_metafile->playback_points[0].X;
3934 dst_bounds.right = real_metafile->playback_points[1].X;
3935 dst_bounds.top = real_metafile->playback_points[0].Y;
3936 dst_bounds.bottom = real_metafile->playback_points[2].Y;
3937 }
3938
3939 if (stat == Ok)
3941 &data, &dst_bounds);
3942
3943 METAFILE_PlaybackReleaseDC(real_metafile);
3944
3945 GdipDeleteMatrix(real_metafile->world_transform);
3946 real_metafile->world_transform = NULL;
3947
3948 GdipDeleteRegion(real_metafile->base_clip);
3949 real_metafile->base_clip = NULL;
3950
3951 GdipDeleteRegion(real_metafile->clip);
3952 real_metafile->clip = NULL;
3953
3954 while (list_head(&real_metafile->containers))
3955 {
3956 container* cont = LIST_ENTRY(list_head(&real_metafile->containers), container, entry);
3957 list_remove(&cont->entry);
3958 GdipDeleteRegion(cont->clip);
3959 free(cont);
3960 }
3961
3962 GdipEndContainer(graphics, state);
3963 }
3964
3965 real_metafile->playback_graphics = NULL;
3966
3967 return stat;
3968}
GpStatus WINGDIPAPI GdipGetClip(GpGraphics *graphics, GpRegion *region)
Definition: graphics.c:7195
GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsContainer state)
Definition: graphics.c:6394
GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpPointF *points, INT count)
Definition: graphics.c:7356
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
Definition: graphics.c:6560
GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
Definition: graphics.c:6194
GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale)
Definition: graphics.c:6533
GpStatus WINGDIPAPI GdipBeginContainer2(GpGraphics *graphics, GraphicsContainer *state)
Definition: graphics.c:6273
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
Definition: matrix.c:156
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
Definition: matrix.c:136
static GpStatus METAFILE_PlaybackUpdateWorldTransform(GpMetafile *metafile)
Definition: metafile.c:1832
static int CALLBACK enum_metafile_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
Definition: metafile.c:3779
static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
Definition: metafile.c:1814
static GpStatus METAFILE_PlaybackUpdateClip(GpMetafile *metafile)
Definition: metafile.c:1823
static GpStatus METAFILE_PlaybackGetDC(GpMetafile *metafile)
Definition: metafile.c:1805
GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode mode)
Definition: region.c:236
@ CombineModeIntersect
Definition: gdiplusenums.h:389
UINT GraphicsContainer
Definition: gdiplusenums.h:23
@ CoordinateSpaceDevice
Definition: gdiplusenums.h:406
GpRegion * base_clip
struct list containers
GpMatrix * world_transform
GpGraphics * playback_graphics
GpUnit page_unit
GpRectF src_rect
GpRegion * clip
GpPointF playback_points[3]
GpRegion * clip
Definition: metafile.c:164
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175
BOOL WINAPI EnumEnhMetaFile(_In_opt_ HDC, _In_ HENHMETAFILE, _In_ ENHMFENUMPROC, _In_opt_ PVOID, _In_opt_ LPCRECT)

Referenced by check_metafile(), GdipDrawImagePointsRect(), GdipEnumerateMetafileDestRect(), GdipEnumerateMetafileSrcRectDestRect(), and play_metafile().

◆ GdipEnumerateMetafileSrcRectDestRect()

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRect ( GpGraphics graphics,
GDIPCONST GpMetafile metafile,
GDIPCONST GpRectF dest,
GDIPCONST GpRectF src,
Unit  srcUnit,
EnumerateMetafileProc  callback,
VOID cb_data,
GDIPCONST GpImageAttributes attrs 
)

Definition at line 3970 of file metafile.c.

3974{
3975 GpPointF points[3];
3976
3977 if (!graphics || !metafile || !dest) return InvalidParameter;
3978
3979 points[0].X = points[2].X = dest->X;
3980 points[0].Y = points[1].Y = dest->Y;
3981 points[1].X = dest->X + dest->Width;
3982 points[2].Y = dest->Y + dest->Height;
3983
3985 src, srcUnit, callback, cb_data, attrs);
3986}

Referenced by GdipEnumerateMetafileSrcRectDestRectI().

◆ GdipFillClosedCurve()

GpStatus WINGDIPAPI GdipFillClosedCurve ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 4400 of file graphics.c.

4402{
4403 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4404 return GdipFillClosedCurve2(graphics, brush, points, count,
4405 0.5f, FillModeAlternate);
4406}
GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill)
Definition: graphics.c:4339

Referenced by test_GdipFillClosedCurve(), and test_Get_Release_DC().

◆ GdipFillClosedCurve2()

GpStatus WINGDIPAPI GdipFillClosedCurve2 ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPointF points,
INT  count,
REAL  tension,
GpFillMode  fill 
)

Definition at line 4339 of file graphics.c.

4341{
4342 GpPath *path;
4344
4345 TRACE("(%p, %p, %p, %d, %.2f, %d)\n", graphics, brush, points,
4346 count, tension, fill);
4347
4348 if(!graphics || !brush || !points)
4349 return InvalidParameter;
4350
4351 if(graphics->busy)
4352 return ObjectBusy;
4353
4354 if(count == 1) /* Do nothing */
4355 return Ok;
4356
4358 if (status != Ok) return status;
4359
4361 if (status == Ok)
4362 status = GdipFillPath(graphics, brush, path);
4363
4365 return status;
4366}
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4529

Referenced by GdipFillClosedCurve(), GdipFillClosedCurve2I(), GdipPlayMetafileRecord(), test_GdipFillClosedCurve2(), and test_Get_Release_DC().

◆ GdipFillClosedCurve2I()

GpStatus WINGDIPAPI GdipFillClosedCurve2I ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPoint points,
INT  count,
REAL  tension,
GpFillMode  fill 
)

Definition at line 4368 of file graphics.c.

4370{
4371 GpPointF *ptf;
4372 GpStatus stat;
4373 INT i;
4374
4375 TRACE("(%p, %p, %p, %d, %.2f, %d)\n", graphics, brush, points,
4376 count, tension, fill);
4377
4378 if(!points || count == 0)
4379 return InvalidParameter;
4380
4381 if(count == 1) /* Do nothing */
4382 return Ok;
4383
4384 ptf = malloc(sizeof(GpPointF) * count);
4385 if(!ptf)
4386 return OutOfMemory;
4387
4388 for(i = 0;i < count;i++){
4389 ptf[i].X = (REAL)points[i].X;
4390 ptf[i].Y = (REAL)points[i].Y;
4391 }
4392
4393 stat = GdipFillClosedCurve2(graphics, brush, ptf, count, tension, fill);
4394
4395 free(ptf);
4396
4397 return stat;
4398}

Referenced by GdipFillClosedCurveI(), test_GdipFillClosedCurve2I(), and test_Get_Release_DC().

◆ GdipFillClosedCurveI()

GpStatus WINGDIPAPI GdipFillClosedCurveI ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 4408 of file graphics.c.

4410{
4411 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4412 return GdipFillClosedCurve2I(graphics, brush, points, count,
4413 0.5f, FillModeAlternate);
4414}
GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, REAL tension, GpFillMode fill)
Definition: graphics.c:4368

Referenced by test_GdipFillClosedCurveI(), and test_Get_Release_DC().

◆ GdipFillEllipse()

GpStatus WINGDIPAPI GdipFillEllipse ( GpGraphics graphics,
GpBrush brush,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 4416 of file graphics.c.

4418{
4419 GpStatus stat;
4420 GpPath *path;
4421 GpRectF rect;
4422
4423 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
4424
4425 if(!graphics || !brush)
4426 return InvalidParameter;
4427
4428 if(graphics->busy)
4429 return ObjectBusy;
4430
4431 if (is_metafile_graphics(graphics))
4432 {
4433 set_rect(&rect, x, y, width, height);
4434 return METAFILE_FillEllipse((GpMetafile *)graphics->image, brush, &rect);
4435 }
4436
4438
4439 if (stat == Ok)
4440 {
4442
4443 if (stat == Ok)
4444 stat = GdipFillPath(graphics, brush, path);
4445
4447 }
4448
4449 return stat;
4450}
GpStatus METAFILE_FillEllipse(GpMetafile *metafile, GpBrush *brush, GpRectF *rect)
Definition: metafile.c:5175

Referenced by GdipFillEllipseI(), GdipPlayMetafileRecord(), test_fillellipse(), and test_Get_Release_DC().

◆ GdipFillEllipseI()

GpStatus WINGDIPAPI GdipFillEllipseI ( GpGraphics graphics,
GpBrush brush,
INT  x,
INT  y,
INT  width,
INT  height 
)

Definition at line 4452 of file graphics.c.

4454{
4455 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, brush, x, y, width, height);
4456
4457 return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
4458}
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4416

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipFillPath()

GpStatus WINGDIPAPI GdipFillPath ( GpGraphics graphics,
GpBrush brush,
GpPath path 
)

Definition at line 4529 of file graphics.c.

4530{
4532
4533 TRACE("(%p, %p, %p)\n", graphics, brush, path);
4534
4535 if(!brush || !graphics || !path)
4536 return InvalidParameter;
4537
4538 if(graphics->busy)
4539 return ObjectBusy;
4540
4541 if (!path->pathdata.Count)
4542 return Ok;
4543
4544 if (is_metafile_graphics(graphics))
4545 return METAFILE_FillPath((GpMetafile*)graphics->image, brush, path);
4546
4547 if (!graphics->image && !graphics->alpha_hdc)
4548 stat = GDI32_GdipFillPath(graphics, brush, path);
4549
4550 if (stat == NotImplemented)
4551 stat = SOFTWARE_GdipFillPath(graphics, brush, path);
4552
4553 if (stat == NotImplemented)
4554 {
4555 FIXME("Not implemented for brushtype %i\n", brush->bt);
4556 stat = Ok;
4557 }
4558
4559 return stat;
4560}
static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4460
static GpStatus SOFTWARE_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4507
GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path)
Definition: metafile.c:5134

Referenced by GdipFillClosedCurve2(), GdipFillEllipse(), GdipFillPie(), GdipFillPolygon(), GdipFillPolygonI(), GdipFillRectangles(), GdipPlayMetafileRecord(), SOFTWARE_GdipDrawPath(), test_fillpath(), test_GdipFillPath(), and test_Get_Release_DC().

◆ GdipFillPie()

GpStatus WINGDIPAPI GdipFillPie ( GpGraphics graphics,
GpBrush brush,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 4562 of file graphics.c.

4564{
4565 GpStatus stat;
4566 GpPath *path;
4567 GpRectF rect;
4568
4569 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
4570 graphics, brush, x, y, width, height, startAngle, sweepAngle);
4571
4572 if(!graphics || !brush)
4573 return InvalidParameter;
4574
4575 if(graphics->busy)
4576 return ObjectBusy;
4577
4578 if (is_metafile_graphics(graphics))
4579 {
4580 set_rect(&rect, x, y, width, height);
4581 return METAFILE_FillPie((GpMetafile *)graphics->image, brush, &rect, startAngle, sweepAngle);
4582 }
4583
4585
4586 if (stat == Ok)
4587 {
4588 stat = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle);
4589
4590 if (stat == Ok)
4591 stat = GdipFillPath(graphics, brush, path);
4592
4594 }
4595
4596 return stat;
4597}
GpStatus METAFILE_FillPie(GpMetafile *metafile, GpBrush *brush, const GpRectF *rect, REAL startAngle, REAL sweepAngle)
Definition: metafile.c:5224

Referenced by GdipFillPieI(), GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipFillPieI()

GpStatus WINGDIPAPI GdipFillPieI ( GpGraphics graphics,
GpBrush brush,
INT  x,
INT  y,
INT  width,
INT  height,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 4599 of file graphics.c.

4601{
4602 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n",
4603 graphics, brush, x, y, width, height, startAngle, sweepAngle);
4604
4605 return GdipFillPie(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
4606}
GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4562

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipFillPolygon()

GpStatus WINGDIPAPI GdipFillPolygon ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPointF points,
INT  count,
GpFillMode  fillMode 
)

Definition at line 4608 of file graphics.c.

4610{
4611 GpStatus stat;
4612 GpPath *path;
4613
4614 TRACE("(%p, %p, %p, %d, %d)\n", graphics, brush, points, count, fillMode);
4615
4616 if(!graphics || !brush || !points || !count)
4617 return InvalidParameter;
4618
4619 if(graphics->busy)
4620 return ObjectBusy;
4621
4623
4624 if (stat == Ok)
4625 {
4627
4628 if (stat == Ok)
4629 stat = GdipFillPath(graphics, brush, path);
4630
4632 }
4633
4634 return stat;
4635}
GLenum fillMode
Definition: glext.h:11728

Referenced by GdipFillPolygon2(), and test_Get_Release_DC().

◆ GdipFillPolygon2()

GpStatus WINGDIPAPI GdipFillPolygon2 ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPointF points,
INT  count 
)

Definition at line 4666 of file graphics.c.

4668{
4669 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4670
4671 return GdipFillPolygon(graphics, brush, points, count, FillModeAlternate);
4672}
GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
Definition: graphics.c:4608

Referenced by test_Get_Release_DC().

◆ GdipFillPolygon2I()

GpStatus WINGDIPAPI GdipFillPolygon2I ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPoint points,
INT  count 
)

Definition at line 4674 of file graphics.c.

4676{
4677 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4678
4679 return GdipFillPolygonI(graphics, brush, points, count, FillModeAlternate);
4680}
GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, GpFillMode fillMode)
Definition: graphics.c:4637

Referenced by test_Get_Release_DC().

◆ GdipFillPolygonI()

GpStatus WINGDIPAPI GdipFillPolygonI ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpPoint points,
INT  count,
GpFillMode  fillMode 
)

Definition at line 4637 of file graphics.c.

4639{
4640 GpStatus stat;
4641 GpPath *path;
4642
4643 TRACE("(%p, %p, %p, %d, %d)\n", graphics, brush, points, count, fillMode);
4644
4645 if(!graphics || !brush || !points || !count)
4646 return InvalidParameter;
4647
4648 if(graphics->busy)
4649 return ObjectBusy;
4650
4652
4653 if (stat == Ok)
4654 {
4656
4657 if (stat == Ok)
4658 stat = GdipFillPath(graphics, brush, path);
4659
4661 }
4662
4663 return stat;
4664}
GpStatus WINGDIPAPI GdipAddPathPolygonI(GpPath *path, GDIPCONST GpPoint *points, INT count)
Definition: graphicspath.c:958

Referenced by GdipFillPolygon2I(), and test_Get_Release_DC().

◆ GdipFillRectangle()

GpStatus WINGDIPAPI GdipFillRectangle ( GpGraphics graphics,
GpBrush brush,
REAL  x,
REAL  y,
REAL  width,
REAL  height 
)

Definition at line 4682 of file graphics.c.

4684{
4685 GpRectF rect;
4686
4687 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
4688
4689 set_rect(&rect, x, y, width, height);
4690 return GdipFillRectangles(graphics, brush, &rect, 1);
4691}
GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4704

Referenced by draw_string_callback(), GdipGraphicsClear(), test_clipping(), test_containers(), test_Get_Release_DC(), test_pagetransform(), test_transform(), and test_worldtransform().

◆ GdipFillRectangleI()

◆ GdipFillRectangles()

GpStatus WINGDIPAPI GdipFillRectangles ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpRectF rects,
INT  count 
)

Definition at line 4704 of file graphics.c.

4706{
4708 GpPath *path;
4709
4710 TRACE("(%p, %p, %p, %d)\n", graphics, brush, rects, count);
4711
4712 if(!graphics || !brush || !rects || count <= 0)
4713 return InvalidParameter;
4714
4715 if (is_metafile_graphics(graphics))
4716 {
4717 status = METAFILE_FillRectangles((GpMetafile*)graphics->image, brush, rects, count);
4718 /* FIXME: Add gdi32 drawing. */
4719 return status;
4720 }
4721
4723 if (status != Ok) return status;
4724
4726 if (status == Ok)
4727 status = GdipFillPath(graphics, brush, path);
4728
4730 return status;
4731}
GpStatus METAFILE_FillRectangles(GpMetafile *metafile, GpBrush *brush, GDIPCONST GpRectF *rects, INT count)
Definition: metafile.c:1261

Referenced by GdipFillRectangle(), GdipFillRectangleI(), GdipFillRectanglesI(), GdipPlayMetafileRecord(), test_GdipFillRectangles(), test_Get_Release_DC(), and test_lineargradient().

◆ GdipFillRectanglesI()

GpStatus WINGDIPAPI GdipFillRectanglesI ( GpGraphics graphics,
GpBrush brush,
GDIPCONST GpRect rects,
INT  count 
)

Definition at line 4733 of file graphics.c.

4735{
4736 GpRectF *rectsF;
4737 GpStatus ret;
4738 INT i;
4739
4740 TRACE("(%p, %p, %p, %d)\n", graphics, brush, rects, count);
4741
4742 if(!rects || count <= 0)
4743 return InvalidParameter;
4744
4745 rectsF = malloc(sizeof(GpRectF) * count);
4746 if(!rectsF)
4747 return OutOfMemory;
4748
4749 for(i = 0; i < count; i++)
4750 set_rect(&rectsF[i], rects[i].X, rects[i].Y, rects[i].Width, rects[i].Height);
4751
4752 ret = GdipFillRectangles(graphics,brush,rectsF,count);
4753 free(rectsF);
4754
4755 return ret;
4756}

Referenced by test_Get_Release_DC().

◆ GdipFillRegion()

GpStatus WINGDIPAPI GdipFillRegion ( GpGraphics graphics,
GpBrush brush,
GpRegion region 
)

Definition at line 4891 of file graphics.c.

4893{
4895
4896 TRACE("(%p, %p, %p)\n", graphics, brush, region);
4897
4898 if (!(graphics && brush && region))
4899 return InvalidParameter;
4900
4901 if(graphics->busy)
4902 return ObjectBusy;
4903
4904 if (is_metafile_graphics(graphics))
4905 stat = METAFILE_FillRegion((GpMetafile*)graphics->image, brush, region);
4906 else
4907 {
4908 if (!graphics->image && !graphics->alpha_hdc)
4909 stat = GDI32_GdipFillRegion(graphics, brush, region);
4910
4911 if (stat == NotImplemented)
4912 stat = SOFTWARE_GdipFillRegion(graphics, brush, region);
4913 }
4914
4915 if (stat == NotImplemented)
4916 {
4917 FIXME("not implemented for brushtype %i\n", brush->bt);
4918 stat = Ok;
4919 }
4920
4921 return stat;
4922}
static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush, GpRegion *region)
Definition: graphics.c:4808
static GpStatus GDI32_GdipFillRegion(GpGraphics *graphics, GpBrush *brush, GpRegion *region)
Definition: graphics.c:4758
GpStatus METAFILE_FillRegion(GpMetafile *metafile, GpBrush *brush, GpRegion *region)
Definition: metafile.c:5434

Referenced by GdipPlayMetafileRecord(), SOFTWARE_GdipFillPath(), test_fillregion(), and test_Get_Release_DC().

◆ GdipFindFirstImageItem()

GpStatus WINGDIPAPI GdipFindFirstImageItem ( GpImage image,
ImageItemData item 
)

Definition at line 2113 of file image.c.

2114{
2115 static int calls;
2116
2117 TRACE("(%p,%p)\n", image, item);
2118
2119 if(!image || !item)
2120 return InvalidParameter;
2121
2122 if (!(calls++))
2123 FIXME("not implemented\n");
2124
2125 return NotImplemented;
2126}

◆ GdipFindNextImageItem()

GpStatus WINGDIPAPI GdipFindNextImageItem ( GpImage ,
ImageItemData  
)

◆ GdipFlattenPath()

GpStatus WINGDIPAPI GdipFlattenPath ( GpPath path,
GpMatrix matrix,
REAL  flatness 
)

Definition at line 1408 of file graphicspath.c.

1409{
1411 GpPointF pt;
1412 INT i = 1;
1413 INT startidx = 0;
1414 GpStatus stat;
1415
1416 TRACE("(%p, %p, %.2f)\n", path, matrix, flatness);
1417
1418 if(!path)
1419 return InvalidParameter;
1420
1421 if(path->pathdata.Count == 0)
1422 return Ok;
1423
1425 if(stat != Ok)
1426 return stat;
1427
1428 pt = path->pathdata.Points[0];
1429 if(!init_path_list(&list, pt.X, pt.Y))
1430 return OutOfMemory;
1431
1432 node = list;
1433
1434 while(i < path->pathdata.Count){
1435
1436 BYTE type = path->pathdata.Types[i] & PathPointTypePathTypeMask;
1438
1439 pt = path->pathdata.Points[i];
1440
1441 /* save last start point index */
1443 startidx = i;
1444
1445 /* always add line points and start points */
1447 if(!add_path_list_node(node, pt.X, pt.Y, path->pathdata.Types[i]))
1448 goto memout;
1449
1450 node = node->next;
1451 ++i;
1452 continue;
1453 }
1454
1455 /* Bezier curve */
1456
1457 /* test for closed figure */
1458 if(path->pathdata.Types[i+1] & PathPointTypeCloseSubpath){
1459 pt = path->pathdata.Points[startidx];
1460 ++i;
1461 }
1462 else
1463 {
1464 i += 2;
1465 pt = path->pathdata.Points[i];
1466 };
1467
1468 start = node;
1469 /* add Bezier end point */
1470 type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine;
1471 if(!add_path_list_node(node, pt.X, pt.Y, type))
1472 goto memout;
1473 node = node->next;
1474
1475 /* flatten curve */
1476 if(!flatten_bezier(start, path->pathdata.Points[i-2].X, path->pathdata.Points[i-2].Y,
1477 path->pathdata.Points[i-1].X, path->pathdata.Points[i-1].Y,
1478 node, flatness))
1479 goto memout;
1480
1481 ++i;
1482 }/* while */
1483
1484 if (!path_list_to_path(list, path)) goto memout;
1486 return Ok;
1487
1488memout:
1490 return OutOfMemory;
1491}
Definition: list.h:37
static BOOL flatten_bezier(path_list_node_t *start, REAL x2, REAL y2, REAL x3, REAL y3, path_list_node_t *end, REAL flatness)
Definition: graphicspath.c:193
static void free_path_list(path_list_node_t *node)
Definition: graphicspath.c:61
static BOOL init_path_list(path_list_node_t **node, REAL x, REAL y)
Definition: graphicspath.c:46
GpStatus WINGDIPAPI GdipTransformPath(GpPath *path, GpMatrix *matrix)
static BOOL path_list_to_path(path_list_node_t *node, GpPath *path)
Definition: graphicspath.c:109
static path_list_node_t * add_path_list_node(path_list_node_t *node, REAL x, REAL y, BOOL type)
Definition: graphicspath.c:78
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define list
Definition: rosglue.h:35
Definition: dlist.c:348
void * next
Definition: dlist.c:360

Referenced by brush_fill_pixels(), GdipWidenPath(), SOFTWARE_GdipDrawThinPath(), and test_flatten().

◆ GdipFlush()

GpStatus WINGDIPAPI GdipFlush ( GpGraphics graphics,
GpFlushIntention  intention 
)

Definition at line 4924 of file graphics.c.

4925{
4926 TRACE("(%p,%u)\n", graphics, intention);
4927
4928 if(!graphics)
4929 return InvalidParameter;
4930
4931 if(graphics->busy)
4932 return ObjectBusy;
4933
4934 /* We have no internal operation queue, so there's no need to clear it. */
4935
4936 if (has_gdi_dc(graphics))
4937 GdiFlush();
4938
4939 return Ok;
4940}
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44

Referenced by test_Get_Release_DC().

◆ GdipGetAdjustableArrowCapFillState()

GpStatus WINGDIPAPI GdipGetAdjustableArrowCapFillState ( GpAdjustableArrowCap cap,
BOOL fill 
)

Definition at line 364 of file customlinecap.c.

365{
366 TRACE("(%p,%p)\n", cap, fill);
367
368 if (!cap || !fill)
369 return InvalidParameter;
370
371 *fill = cap->cap.fill;
372 return Ok;
373}

Referenced by test_create_adjustable_cap().

◆ GdipGetAdjustableArrowCapHeight()

GpStatus WINGDIPAPI GdipGetAdjustableArrowCapHeight ( GpAdjustableArrowCap cap,
REAL height 
)

Definition at line 375 of file customlinecap.c.

376{
377 TRACE("(%p,%p)\n", cap, height);
378
379 if (!cap || !height)
380 return InvalidParameter;
381
382 *height = cap->height;
383 return Ok;
384}

Referenced by test_create_adjustable_cap().

◆ GdipGetAdjustableArrowCapMiddleInset()

GpStatus WINGDIPAPI GdipGetAdjustableArrowCapMiddleInset ( GpAdjustableArrowCap cap,
REAL middle 
)

Definition at line 386 of file customlinecap.c.

387{
388 TRACE("(%p,%p)\n", cap, middle);
389
390 if (!cap || !middle)
391 return InvalidParameter;
392
393 *middle = cap->middle_inset;
394 return Ok;
395}

Referenced by test_create_adjustable_cap().

◆ GdipGetAdjustableArrowCapWidth()

GpStatus WINGDIPAPI GdipGetAdjustableArrowCapWidth ( GpAdjustableArrowCap cap,
REAL width 
)

Definition at line 397 of file customlinecap.c.

398{
399 TRACE("(%p,%p)\n", cap, width);
400
401 if (!cap || !width)
402 return InvalidParameter;
403
404 *width = cap->width;
405 return Ok;
406}

Referenced by test_create_adjustable_cap().

◆ GdipGetAllPropertyItems()

GpStatus WINGDIPAPI GdipGetAllPropertyItems ( GpImage image,
UINT  size,
UINT  count,
PropertyItem buf 
)

Definition at line 2746 of file image.c.

2748{
2750 HRESULT hr;
2752 IWICEnumMetadataItem *enumerator;
2753 UINT prop_count, prop_size, i;
2754 PROPVARIANT id, value;
2755 char *item_value;
2756
2757 TRACE("(%p,%u,%u,%p)\n", image, size, count, buf);
2758
2759 if (!image || !buf) return InvalidParameter;
2760
2761 if (image->type != ImageTypeBitmap)
2762 {
2763 FIXME("Not implemented for type %d\n", image->type);
2764 return NotImplemented;
2765 }
2766
2767 status = GdipGetPropertySize(image, &prop_size, &prop_count);
2768 if (status != Ok) return status;
2769
2770 if (prop_count != count || prop_size != size) return InvalidParameter;
2771
2772 if (((GpBitmap *)image)->prop_item)
2773 {
2774 memcpy(buf, ((GpBitmap *)image)->prop_item, prop_size);
2775
2776 item_value = (char *)(buf + prop_count);
2777
2778 for (i = 0; i < prop_count; i++)
2779 {
2780 buf[i].value = item_value;
2781 item_value += buf[i].length;
2782 }
2783
2784 return Ok;
2785 }
2786
2787 reader = ((GpBitmap *)image)->metadata_reader;
2788 if (!reader) return GenericError;
2789
2790 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2791 if (FAILED(hr)) return hresult_to_status(hr);
2792
2793 IWICEnumMetadataItem_Reset(enumerator);
2794
2795 item_value = (char *)(buf + prop_count);
2796
2797 PropVariantInit(&id);
2798 PropVariantInit(&value);
2799
2800 for (i = 0; i < prop_count; i++)
2801 {
2803 ULONG items_returned;
2804 UINT item_size;
2805
2806 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, &value, &items_returned);
2807 if (hr != S_OK) break;
2808
2809 if (id.vt != VT_UI2)
2810 {
2811 FIXME("not supported propvariant type for id: %u\n", id.vt);
2812 continue;
2813 }
2814
2815 item_size = propvariant_size(&value);
2816 if (item_size)
2817 {
2818 item = malloc(item_size + sizeof(*item));
2819
2820 propvariant_to_item(&value, item, item_size + sizeof(*item), id.uiVal);
2821 buf[i].id = item->id;
2822 buf[i].type = item->type;
2823 buf[i].length = item_size;
2824 buf[i].value = item_value;
2825 memcpy(item_value, item->value, item_size);
2826 item_value += item_size;
2827
2828 free(item);
2829 }
2830
2831 PropVariantClear(&id);
2833 }
2834
2835 IWICEnumMetadataItem_Release(enumerator);
2836
2837 if (hr != S_OK) return PropertyNotFound;
2838
2839 return Ok;
2840}
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: combase.c:709
@ VT_UI2
Definition: compat.h:2312
GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT *size, UINT *count)
Definition: image.c:2670
static UINT propvariant_size(PROPVARIANT *value)
Definition: image.c:2437
static GpStatus propvariant_to_item(PROPVARIANT *value, PropertyItem *item, UINT size, PROPID id)
Definition: image.c:2554
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:91
@ PropertyNotFound
Definition: gdiplustypes.h:44
GLuint id
Definition: glext.h:5910
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
uacpi_u8 type
Definition: interpreter.c:38
Definition: reader.h:84
Definition: pdh_main.c:96

Referenced by check_properties_get_all(), and test_image_properties().

◆ GdipGetBrushType()

GpStatus WINGDIPAPI GdipGetBrushType ( GpBrush brush,
GpBrushType type 
)

Definition at line 976 of file brush.c.

977{
978 TRACE("(%p, %p)\n", brush, type);
979
980 if(!brush || !type) return InvalidParameter;
981
982 *type = brush->bt;
983
984 return Ok;
985}

Referenced by test_brushfill(), and test_type().

◆ GdipGetCellAscent()

GpStatus WINGDIPAPI GdipGetCellAscent ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 CellAscent 
)

Definition at line 834 of file font.c.

836{
837 if (!(family && CellAscent)) return InvalidParameter;
838
839 *CellAscent = family->ascent;
840 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellAscent);
841
842 return Ok;
843}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetCellDescent()

GpStatus WINGDIPAPI GdipGetCellDescent ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 CellDescent 
)

Definition at line 845 of file font.c.

847{
848 TRACE("(%p, %d, %p)\n", family, style, CellDescent);
849
850 if (!(family && CellDescent)) return InvalidParameter;
851
852 *CellDescent = family->descent;
853 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellDescent);
854
855 return Ok;
856}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetClip()

GpStatus WINGDIPAPI GdipGetClip ( GpGraphics graphics,
GpRegion region 
)

Definition at line 7195 of file graphics.c.

7196{
7197 GpRegion *clip;
7199 GpMatrix device_to_world;
7200
7201 TRACE("(%p, %p)\n", graphics, region);
7202
7203 if(!graphics || !region)
7204 return InvalidParameter;
7205
7206 if(graphics->busy)
7207 return ObjectBusy;
7208
7209 if((status = GdipCloneRegion(graphics->clip, &clip)) != Ok)
7210 return status;
7211
7213 status = GdipTransformRegion(clip, &device_to_world);
7214 if (status != Ok)
7215 {
7216 GdipDeleteRegion(clip);
7217 return status;
7218 }
7219
7220 /* free everything except root node and header */
7221 delete_element(&region->node);
7222 memcpy(region, clip, sizeof(GpRegion));
7223 free(clip);
7224
7225 return Ok;
7226}
GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpMatrix *matrix)
Definition: graphics.c:7266
GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix)
Definition: region.c:1702

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipGetClipBounds(), test_clip_xform(), test_clipping(), test_clipping_2(), test_Get_Release_DC(), and test_get_set_clip().

◆ GdipGetClipBounds()

GpStatus WINGDIPAPI GdipGetClipBounds ( GpGraphics graphics,
GpRectF rect 
)

Definition at line 4945 of file graphics.c.

4946{
4948 GpRegion *clip;
4949
4950 TRACE("(%p, %p)\n", graphics, rect);
4951
4952 if(!graphics)
4953 return InvalidParameter;
4954
4955 if(graphics->busy)
4956 return ObjectBusy;
4957
4958 status = GdipCreateRegion(&clip);
4959 if (status != Ok) return status;
4960
4961 status = GdipGetClip(graphics, clip);
4962 if (status == Ok)
4963 status = GdipGetRegionBounds(clip, graphics, rect);
4964
4965 GdipDeleteRegion(clip);
4966 return status;
4967}
GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, GpRectF *rect)
Definition: region.c:583

Referenced by GdipGetClipBoundsI(), test_BeginContainer2(), test_clipping(), and test_Get_Release_DC().

◆ GdipGetClipBoundsI()

GpStatus WINGDIPAPI GdipGetClipBoundsI ( GpGraphics graphics,
GpRect rect 
)

Definition at line 4972 of file graphics.c.

4973{
4974 GpRectF rectf;
4975 GpStatus stat;
4976
4977 TRACE("(%p, %p)\n", graphics, rect);
4978
4979 if (!rect)
4980 return InvalidParameter;
4981
4982 if ((stat = GdipGetClipBounds(graphics, &rectf)) == Ok)
4983 {
4984 rect->X = gdip_round(rectf.X);
4985 rect->Y = gdip_round(rectf.Y);
4986 rect->Width = gdip_round(rectf.Width);
4987 rect->Height = gdip_round(rectf.Height);
4988 }
4989
4990 return stat;
4991}
GpStatus WINGDIPAPI GdipGetClipBounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:4945

Referenced by test_clipping(), and test_Get_Release_DC().

◆ GdipGetCompositingMode()

GpStatus WINGDIPAPI GdipGetCompositingMode ( GpGraphics graphics,
CompositingMode mode 
)

Definition at line 4993 of file graphics.c.

4995{
4996 TRACE("(%p, %p)\n", graphics, mode);
4997
4998 if(!graphics || !mode)
4999 return InvalidParameter;
5000
5001 if(graphics->busy)
5002 return ObjectBusy;
5003
5004 *mode = graphics->compmode;
5005
5006 return Ok;
5007}
CompositingMode compmode

Referenced by gdi_alpha_blend(), GdipGraphicsClear(), test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetCompositingQuality()

GpStatus WINGDIPAPI GdipGetCompositingQuality ( GpGraphics graphics,
CompositingQuality quality 
)

Definition at line 5010 of file graphics.c.

5012{
5013 TRACE("(%p, %p)\n", graphics, quality);
5014
5015 if(!graphics || !quality)
5016 return InvalidParameter;
5017
5018 if(graphics->busy)
5019 return ObjectBusy;
5020
5021 *quality = graphics->compqual;
5022
5023 return Ok;
5024}
int quality
Definition: jpeglib.h:994
CompositingQuality compqual

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetCustomLineCapBaseCap()

GpStatus WINGDIPAPI GdipGetCustomLineCapBaseCap ( GpCustomLineCap customCap,
GpLineCap baseCap 
)

Definition at line 260 of file customlinecap.c.

261{
262 TRACE("(%p, %p)\n", customCap, baseCap);
263
264 if(!customCap || !baseCap)
265 return InvalidParameter;
266
267 *baseCap = customCap->basecap;
268
269 return Ok;
270}

Referenced by test_create_adjustable_cap().

◆ GdipGetCustomLineCapBaseInset()

GpStatus WINGDIPAPI GdipGetCustomLineCapBaseInset ( GpCustomLineCap custom,
REAL inset 
)

Definition at line 208 of file customlinecap.c.

210{
211 TRACE("(%p, %p)\n", custom, inset);
212
213 if(!custom || !inset)
214 return InvalidParameter;
215
216 *inset = custom->inset;
217
218 return Ok;
219}

Referenced by test_create_adjustable_cap(), and test_inset().

◆ GdipGetCustomLineCapStrokeJoin()

GpStatus WINGDIPAPI GdipGetCustomLineCapStrokeJoin ( GpCustomLineCap customCap,
GpLineJoin lineJoin 
)

Definition at line 156 of file customlinecap.c.

158{
159 TRACE("(%p, %p)\n", customCap, lineJoin);
160
161 if(!customCap || !lineJoin)
162 return InvalidParameter;
163
164 *lineJoin = customCap->join;
165
166 return Ok;
167}

Referenced by test_create_adjustable_cap(), and test_linejoin().

◆ GdipGetCustomLineCapType()

GpStatus WINGDIPAPI GdipGetCustomLineCapType ( GpCustomLineCap customCap,
CustomLineCapType type 
)

Definition at line 272 of file customlinecap.c.

273{
274 TRACE("(%p, %p)\n", customCap, type);
275
276 if(!customCap || !type)
277 return InvalidParameter;
278
279 *type = customCap->type;
280 return Ok;
281}
CustomLineCapType type

Referenced by test_captype().

◆ GdipGetCustomLineCapWidthScale()

GpStatus WINGDIPAPI GdipGetCustomLineCapWidthScale ( GpCustomLineCap custom,
REAL widthScale 
)

Definition at line 169 of file customlinecap.c.

171{
172 TRACE("(%p, %p)\n", custom, widthScale);
173
174 if(!custom || !widthScale)
175 return InvalidParameter;
176
177 *widthScale = custom->scale;
178
179 return Ok;
180}

Referenced by test_create_adjustable_cap(), and test_scale().

◆ GdipGetDC()

GpStatus WINGDIPAPI GdipGetDC ( GpGraphics graphics,
HDC hdc 
)

Definition at line 7050 of file graphics.c.

7051{
7053
7054 TRACE("(%p, %p)\n", graphics, hdc);
7055
7056 if(!graphics || !hdc)
7057 return InvalidParameter;
7058
7059 if(graphics->busy)
7060 return ObjectBusy;
7061
7062 if (is_metafile_graphics(graphics))
7063 {
7064 stat = METAFILE_GetDC((GpMetafile*)graphics->image, hdc);
7065 }
7066 else if (graphics->owndc)
7067 {
7068 graphics->temp_hdc = GetDC(graphics->hwnd);
7069 if (!graphics->temp_hdc)
7070 return OutOfMemory;
7071 *hdc = graphics->temp_hdc;
7072 }
7073 else if (!graphics->hdc ||
7074 (graphics->image && graphics->image->type == ImageTypeBitmap))
7075 {
7076 /* Create a fake HDC and fill it with a constant color. */
7077 HDC temp_hdc;
7079 GpRectF bounds;
7080 BITMAPINFOHEADER bmih;
7081 int i;
7082
7083 stat = get_graphics_bounds(graphics, &bounds);
7084 if (stat != Ok)
7085 return stat;
7086
7087 graphics->temp_hbitmap_width = bounds.Width;
7088 graphics->temp_hbitmap_height = bounds.Height;
7089
7090 bmih.biSize = sizeof(bmih);
7091 bmih.biWidth = graphics->temp_hbitmap_width;
7092 bmih.biHeight = -graphics->temp_hbitmap_height;
7093 bmih.biPlanes = 1;
7094 bmih.biBitCount = 32;
7095 bmih.biCompression = BI_RGB;
7096 bmih.biSizeImage = 0;
7097 bmih.biXPelsPerMeter = 0;
7098 bmih.biYPelsPerMeter = 0;
7099 bmih.biClrUsed = 0;
7100 bmih.biClrImportant = 0;
7101
7103 (void**)&graphics->temp_bits, NULL, 0);
7104 if (!hbitmap)
7105 return GenericError;
7106
7107 if (!graphics->temp_hdc)
7108 {
7109 temp_hdc = CreateCompatibleDC(0);
7110 }
7111 else
7112 {
7113 temp_hdc = graphics->temp_hdc;
7114 }
7115
7116 if (!temp_hdc)
7117 {
7119 return GenericError;
7120 }
7121
7122 for (i=0; i<(graphics->temp_hbitmap_width * graphics->temp_hbitmap_height); i++)
7123 ((DWORD*)graphics->temp_bits)[i] = DC_BACKGROUND_KEY;
7124
7125 SelectObject(temp_hdc, hbitmap);
7126
7127 graphics->temp_hbitmap = hbitmap;
7128 *hdc = graphics->temp_hdc = temp_hdc;
7129 }
7130 else
7131 {
7132 *hdc = graphics->hdc;
7133 }
7134
7135 if (stat == Ok)
7136 graphics->busy = TRUE;
7137
7138 return stat;
7139}
static const COLORREF DC_BACKGROUND_KEY
Definition: graphics.c:7048
static GpStatus get_graphics_bounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:2287
GpStatus METAFILE_GetDC(GpMetafile *metafile, HDC *hdc)
Definition: metafile.c:941
int temp_hbitmap_width
BYTE * temp_bits
int temp_hbitmap_height
HBITMAP temp_hbitmap

Referenced by METAFILE_PlaybackGetDC(), test_alpha_hdc(), test_emfonly(), test_fromMemoryBitmap(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_GdipDrawString(), test_gditransform(), test_Get_Release_DC(), test_getdc(), test_getdc_scaled(), test_nullframerect(), and test_restoredc().

◆ GdipGetDpiX()

GpStatus WINGDIPAPI GdipGetDpiX ( GpGraphics graphics,
REAL dpi 
)

Definition at line 6988 of file graphics.c.

6989{
6990 TRACE("(%p, %p)\n", graphics, dpi);
6991
6992 if(!graphics || !dpi)
6993 return InvalidParameter;
6994
6995 if(graphics->busy)
6996 return ObjectBusy;
6997
6998 *dpi = graphics->xres;
6999 return Ok;
7000}
#define dpi
Definition: sysparams.c:23

Referenced by create_graphics(), GdipCreateBitmapFromGraphics(), test_bitmapfromgraphics(), test_container_rects(), test_containers(), test_Get_Release_DC(), test_measured_extra_space(), test_pagetransform(), test_printer_dc(), and test_resolution().

◆ GdipGetDpiY()

GpStatus WINGDIPAPI GdipGetDpiY ( GpGraphics graphics,
REAL dpi 
)

Definition at line 7002 of file graphics.c.

7003{
7004 TRACE("(%p, %p)\n", graphics, dpi);
7005
7006 if(!graphics || !dpi)
7007 return InvalidParameter;
7008
7009 if(graphics->busy)
7010 return ObjectBusy;
7011
7012 *dpi = graphics->yres;
7013 return Ok;
7014}

Referenced by create_graphics(), GdipCreateBitmapFromGraphics(), GdipGetFontHeight(), test_bitmapfromgraphics(), test_container_rects(), test_containers(), test_font_height_scaling(), test_Get_Release_DC(), test_pagetransform(), test_printer_dc(), and test_resolution().

◆ GdipGetEmHeight()

GpStatus WINGDIPAPI GdipGetEmHeight ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 EmHeight 
)

Definition at line 872 of file font.c.

873{
874 if (!(family && EmHeight)) return InvalidParameter;
875
876 TRACE("%p (%s), %d, %p\n", family, debugstr_w(family->FamilyName), style, EmHeight);
877
878 *EmHeight = family->em_height;
879 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *EmHeight);
880
881 return Ok;
882}

Referenced by gdip_get_font_metrics(), GdipAddPathString(), GdipGetFontHeightGivenDPI(), test_fontfamily_properties(), and test_logfont().

◆ GdipGetEncoderParameterListSize()

GpStatus WINGDIPAPI GdipGetEncoderParameterListSize ( GpImage image,
GDIPCONST CLSID clsidEncoder,
UINT size 
)

Definition at line 5333 of file image.c.

5335{
5336 static int calls;
5337
5338 TRACE("(%p,%s,%p)\n", image, debugstr_guid(clsidEncoder), size);
5339
5340 if(!(calls++))
5341 FIXME("not implemented\n");
5342
5343 *size = 0;
5344
5345 return NotImplemented;
5346}
#define debugstr_guid
Definition: kernel32.h:35

◆ GdipGetFamily()

GpStatus WINGDIPAPI GdipGetFamily ( GpFont font,
GpFontFamily **  family 
)

Definition at line 321 of file font.c.

322{
323 TRACE("%p %p\n", font, family);
324
325 if (!(font && family))
326 return InvalidParameter;
327
328 return GdipCloneFontFamily(font->family, family);
329}

Referenced by gdip_get_font_metrics(), test_CloneFont(), test_createfont(), and test_logfont().

◆ GdipGetFamilyName()

GpStatus WINGDIPAPI GdipGetFamilyName ( GDIPCONST GpFontFamily family,
WCHAR name,
LANGID  language 
)

Definition at line 786 of file font.c.

788{
789 static int lang_fixme;
790
791 TRACE("%p, %p, %d\n", family, name, language);
792
793 if (family == NULL)
794 return InvalidParameter;
795
796 if (name == NULL)
797 return Ok;
798
799 if (language != LANG_NEUTRAL && !lang_fixme++)
800 FIXME("No support for handling of multiple languages!\n");
801
802 lstrcpynW (name, family->FamilyName, LF_FACESIZE);
803
804 return Ok;
805}
#define lstrcpynW
Definition: compat.h:738

Referenced by check_family(), GdipCreateFont(), test_createfont(), test_fontfamily(), and test_long_name().

◆ GdipGetFontCollectionFamilyCount()

GpStatus WINGDIPAPI GdipGetFontCollectionFamilyCount ( GpFontCollection fontCollection,
INT numFound 
)

Definition at line 1528 of file font.c.

1530{
1531 TRACE("%p, %p\n", fontCollection, numFound);
1532
1533 if (!(fontCollection && numFound))
1534 return InvalidParameter;
1535
1536 *numFound = fontCollection->count;
1537 return Ok;
1538}

Referenced by is_family_in_collection(), test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipGetFontCollectionFamilyList()

GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList ( GpFontCollection fontCollection,
INT  numSought,
GpFontFamily gpfamilies[],
INT numFound 
)

Definition at line 1543 of file font.c.

1546{
1547 INT i;
1548
1549 TRACE("%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
1550
1551 if (!(fontCollection && gpfamilies && numFound))
1552 return InvalidParameter;
1553
1554 memset(gpfamilies, 0, sizeof(*gpfamilies) * numSought);
1555
1556 for (i = 0; i < numSought && i < fontCollection->count; i++)
1557 {
1558 /* caller is responsible for cloning these if it keeps references */
1559 gpfamilies[i] = fontCollection->FontFamilies[i];
1560 }
1561
1562 *numFound = i;
1563
1564 return Ok;
1565}
GpFontFamily ** FontFamilies

Referenced by is_family_in_collection(), test_GdipGetFontCollectionFamilyList(), test_long_name(), and test_unknownfontdecode().

◆ GdipGetFontHeight()

GpStatus WINGDIPAPI GdipGetFontHeight ( GDIPCONST GpFont font,
GDIPCONST GpGraphics graphics,
REAL height 
)

Definition at line 530 of file font.c.

532{
533 REAL dpi;
535 REAL font_height;
536
537 TRACE("%p %p %p\n", font, graphics, height);
538
539 if (!font || !height) return InvalidParameter;
540
541 stat = GdipGetFontHeightGivenDPI(font, font->family->dpi, &font_height);
542 if (stat != Ok) return stat;
543
544 if (!graphics)
545 {
546 *height = font_height;
547 TRACE("%s,%ld => %f\n",
548 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
549 return Ok;
550 }
551
552 stat = GdipGetDpiY((GpGraphics *)graphics, &dpi);
553 if (stat != Ok) return stat;
554
555 *height = pixels_to_units(font_height, graphics->unit, dpi, graphics->printer_display);
556
557 TRACE("%s,%ld(unit %d) => %f\n",
558 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, graphics->unit, *height);
559 return Ok;
560}
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
Definition: font.c:577
REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi, BOOL printer_display)
Definition: gdiplus.c:356

Referenced by gdip_get_font_metrics(), test_font_height_scaling(), test_font_transform(), and test_logfont().

◆ GdipGetFontHeightGivenDPI()

GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI ( GDIPCONST GpFont font,
REAL  dpi,
REAL height 
)

Definition at line 577 of file font.c.

578{
580 INT style;
581 UINT16 line_spacing, em_height;
582 REAL font_size;
583
584 if (!font || !height) return InvalidParameter;
585
586 TRACE("%p (%s), %f, %p\n", font,
587 debugstr_w(font->family->FamilyName), dpi, height);
588
589 font_size = units_to_pixels(get_font_size(font), font->unit, dpi, FALSE);
591 stat = GdipGetLineSpacing(font->family, style, &line_spacing);
592 if (stat != Ok) return stat;
593 stat = GdipGetEmHeight(font->family, style, &em_height);
594 if (stat != Ok) return stat;
595
596 *height = (REAL)line_spacing * font_size / (REAL)em_height;
597
598 TRACE("%s,%ld => %f\n",
599 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
600
601 return Ok;
602}
static INT get_font_style(const GpFont *font)
Definition: font.c:364
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
Definition: font.c:899
static REAL get_font_size(const GpFont *font)
Definition: font.c:331

Referenced by GdipGetFontHeight(), and test_heightgivendpi().

◆ GdipGetFontSize()

GpStatus WINGDIPAPI GdipGetFontSize ( GpFont font,
REAL size 
)

Definition at line 352 of file font.c.

353{
354 TRACE("(%p, %p)\n", font, size);
355
356 if (!(font && size)) return InvalidParameter;
357
359 TRACE("%s,%ld => %f\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *size);
360
361 return Ok;
362}

Referenced by gdip_get_font_metrics(), test_CloneFont(), test_createfont(), test_GdipMeasureString(), test_logfont(), and test_measured_extra_space().

◆ GdipGetFontStyle()

GpStatus WINGDIPAPI GdipGetFontStyle ( GpFont font,
INT style 
)

Definition at line 395 of file font.c.

396{
397 TRACE("%p %p\n", font, style);
398
399 if (!(font && style))
400 return InvalidParameter;
401
403 TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *style);
404
405 return Ok;
406}

Referenced by gdip_get_font_metrics(), METAFILE_AddFontObject(), test_CloneFont(), and test_logfont().

◆ GdipGetFontUnit()

GpStatus WINGDIPAPI GdipGetFontUnit ( GpFont font,
Unit unit 
)

Definition at line 419 of file font.c.

420{
421 TRACE("(%p, %p)\n", font, unit);
422
423 if (!(font && unit)) return InvalidParameter;
424
425 *unit = font->unit;
426 TRACE("%s,%ld => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *unit);
427
428 return Ok;
429}

Referenced by test_CloneFont(), test_createfont(), test_font_metrics(), test_GdipMeasureString(), test_heightgivendpi(), and test_logfont().

◆ GdipGetGenericFontFamilyMonospace()

GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace ( GpFontFamily **  nativeFamily)

Definition at line 965 of file font.c.

966{
968
969 TRACE("(%p)\n", nativeFamily);
970
971 if (nativeFamily == NULL) return InvalidParameter;
972
973 stat = GdipCreateFontFamilyFromName(L"Courier New", NULL, nativeFamily);
974
976 stat = GdipCreateFontFamilyFromName(L"Liberation Mono", NULL, nativeFamily);
977
979 stat = GdipCreateFontFamilyFromName(L"Courier", NULL, nativeFamily);
980
981 return stat;
982}
#define L(x)
Definition: resources.c:13

Referenced by test_getgenerics().

◆ GdipGetGenericFontFamilySansSerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif ( GpFontFamily **  nativeFamily)

Definition at line 1029 of file font.c.

1030{
1031 GpStatus stat;
1032
1033 TRACE("(%p)\n", nativeFamily);
1034
1035 if (nativeFamily == NULL) return InvalidParameter;
1036
1037 stat = GdipCreateFontFamilyFromName(L"Microsoft Sans Serif", NULL, nativeFamily);
1038
1039 if (stat == FontFamilyNotFound)
1040 stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, nativeFamily);
1041
1042 if (stat == FontFamilyNotFound)
1043 stat = GdipCreateFontFamilyFromName(L"Arial", NULL, nativeFamily);
1044
1045 if (stat == FontFamilyNotFound)
1046 stat = GdipCreateFontFamilyFromName(L"Liberation Sans", NULL, nativeFamily);
1047
1048 return stat;
1049}

Referenced by GdipGetGenericFontFamilySerif(), METAFILE_PlaybackObject(), and test_getgenerics().

◆ GdipGetGenericFontFamilySerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif ( GpFontFamily **  nativeFamily)

Definition at line 997 of file font.c.

998{
1000
1001 TRACE("(%p)\n", nativeFamily);
1002
1003 if (nativeFamily == NULL) return InvalidParameter;
1004
1005 stat = GdipCreateFontFamilyFromName(L"Times New Roman", NULL, nativeFamily);
1006
1007 if (stat == FontFamilyNotFound)
1008 stat = GdipCreateFontFamilyFromName(L"Liberation Serif", NULL, nativeFamily);
1009
1010 if (stat == FontFamilyNotFound)
1012
1013 return stat;
1014}
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
Definition: font.c:1029

Referenced by test_getgenerics().

◆ GdipGetHatchBackgroundColor()

GpStatus WINGDIPAPI GdipGetHatchBackgroundColor ( GpHatch brush,
ARGB backcol 
)

Definition at line 987 of file brush.c.

988{
989 TRACE("(%p, %p)\n", brush, backcol);
990
991 if(!brush || !backcol) return InvalidParameter;
992
993 *backcol = brush->backcol;
994
995 return Ok;
996}

◆ GdipGetHatchForegroundColor()

GpStatus WINGDIPAPI GdipGetHatchForegroundColor ( GpHatch brush,
ARGB forecol 
)

Definition at line 998 of file brush.c.

999{
1000 TRACE("(%p, %p)\n", brush, forecol);
1001
1002 if(!brush || !forecol) return InvalidParameter;
1003
1004 *forecol = brush->forecol;
1005
1006 return Ok;
1007}

◆ GdipGetHatchStyle()

GpStatus WINGDIPAPI GdipGetHatchStyle ( GpHatch brush,
GpHatchStyle hatchstyle 
)

Definition at line 1009 of file brush.c.

1010{
1011 TRACE("(%p, %p)\n", brush, hatchstyle);
1012
1013 if(!brush || !hatchstyle) return InvalidParameter;
1014
1015 *hatchstyle = brush->hatchstyle;
1016
1017 return Ok;
1018}

Referenced by test_getHatchStyle().

◆ GdipGetHemfFromMetafile()

GpStatus WINGDIPAPI GdipGetHemfFromMetafile ( GpMetafile metafile,
HENHMETAFILE *  hEmf 
)

◆ GdipGetImageAttributesAdjustedPalette()

GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette ( GpImageAttributes imageattr,
ColorPalette palette,
ColorAdjustType  type 
)

Definition at line 114 of file imageattributes.c.

116{
117 TRACE("(%p,%p,%u)\n", imageattr, palette, type);
118
119 if (!imageattr || !palette || !palette->Count ||
121 return InvalidParameter;
122
123 apply_image_attributes(imageattr, (LPBYTE)palette->Entries, palette->Count, 1, 0,
125
126 return Ok;
127}
PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data, UINT width, UINT height, INT stride, ColorAdjustType type, PixelFormat fmt)
Definition: graphics.c:796
@ ColorAdjustTypeDefault

Referenced by test_getadjustedpalette().

◆ GdipGetImageBounds()

GpStatus WINGDIPAPI GdipGetImageBounds ( GpImage image,
GpRectF srcRect,
GpUnit srcUnit 
)

Definition at line 2140 of file image.c.

2142{
2143 TRACE("%p %p %p\n", image, srcRect, srcUnit);
2144
2145 if(!image || !srcRect || !srcUnit)
2146 return InvalidParameter;
2147 if(image->type == ImageTypeMetafile){
2148 *srcRect = ((GpMetafile*)image)->bounds;
2149 *srcUnit = ((GpMetafile*)image)->unit;
2150 }
2151 else if(image->type == ImageTypeBitmap){
2152 srcRect->X = srcRect->Y = 0.0;
2153 srcRect->Width = (REAL) ((GpBitmap*)image)->width;
2154 srcRect->Height = (REAL) ((GpBitmap*)image)->height;
2155 *srcUnit = UnitPixel;
2156 }
2157 else{
2158 WARN("GpImage with no image data\n");
2159 return InvalidParameter;
2160 }
2161
2162 TRACE("returning (%f, %f) (%f, %f) unit type %d\n", srcRect->X, srcRect->Y,
2163 srcRect->Width, srcRect->Height, *srcUnit);
2164
2165 return Ok;
2166}
GLeglImageOES image
Definition: gl.h:2204

Referenced by GdipDrawImageFX(), GdipDrawImageRect(), get_graphics_device_bounds(), test_createfromwmf(), test_emfonly(), test_empty(), test_frameunit(), test_GdipCloneImage(), test_loadwmf(), and test_nullframerect().

◆ GdipGetImageDecoders()

GpStatus WINGDIPAPI GdipGetImageDecoders ( UINT  numDecoders,
UINT  size,
ImageCodecInfo decoders 
)

Definition at line 5258 of file image.c.

5259{
5260 int i, decoder_count=0;
5261 TRACE("%u %u %p\n", numDecoders, size, decoders);
5262
5263 if (!decoders ||
5264 size != numDecoders * sizeof(ImageCodecInfo))
5265 return GenericError;
5266
5267 for (i=0; i<NUM_CODECS; i++)
5268 {
5269 if (codecs[i].info.Flags & ImageCodecFlagsDecoder)
5270 {
5271 if (decoder_count == numDecoders) return GenericError;
5272 memcpy(&decoders[decoder_count], &codecs[i].info, sizeof(ImageCodecInfo));
5273 decoder_count++;
5274 }
5275 }
5276
5277 if (decoder_count < numDecoders) return GenericError;
5278
5279 return Ok;
5280}
@ NUM_CODECS
Definition: image.c:4404
static const struct image_codec codecs[NUM_CODECS]
Definition: image.c:4407
@ ImageCodecFlagsDecoder
Definition: gdiplusenums.h:319

Referenced by GdipGetSupportedFileExtensions(), and pBuildFileList().

◆ GdipGetImageDecodersSize()

GpStatus WINGDIPAPI GdipGetImageDecodersSize ( UINT numDecoders,
UINT size 
)

Definition at line 5234 of file image.c.

5235{
5236 int decoder_count=0;
5237 int i;
5238 TRACE("%p %p\n", numDecoders, size);
5239
5240 if (!numDecoders || !size)
5241 return InvalidParameter;
5242
5243 for (i=0; i<NUM_CODECS; i++)
5244 {
5245 if (codecs[i].info.Flags & ImageCodecFlagsDecoder)
5246 decoder_count++;
5247 }
5248
5249 *numDecoders = decoder_count;
5250 *size = decoder_count * sizeof(ImageCodecInfo);
5251
5252 return Ok;
5253}

Referenced by GdipGetSupportedFileExtensions(), and pBuildFileList().

◆ GdipGetImageDimension()

GpStatus WINGDIPAPI GdipGetImageDimension ( GpImage image,
REAL width,
REAL height 
)

Definition at line 2168 of file image.c.

2170{
2171 TRACE("%p %p %p\n", image, width, height);
2172
2173 if(!image || !height || !width)
2174 return InvalidParameter;
2175
2176 if(image->type == ImageTypeMetafile){
2177 *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit,
2178 image->yres, ((GpMetafile*)image)->printer_display);
2179 *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit,
2180 image->xres, ((GpMetafile*)image)->printer_display);
2181 }
2182 else if(image->type == ImageTypeBitmap){
2183 *height = ((GpBitmap*)image)->height;
2184 *width = ((GpBitmap*)image)->width;
2185 }
2186 else{
2187 WARN("GpImage with no image data\n");
2188 return InvalidParameter;
2189 }
2190
2191 TRACE("returning (%f, %f)\n", *height, *width);
2192 return Ok;
2193}

Referenced by test_GdipCreateBitmapFromHBITMAP(), test_GetImageDimension(), test_SavingImages(), and test_SavingMultiPageTiff().

◆ GdipGetImageEncoders()

GpStatus WINGDIPAPI GdipGetImageEncoders ( UINT  numEncoders,
UINT  size,
ImageCodecInfo encoders 
)

Definition at line 5309 of file image.c.

5310{
5311 int i, encoder_count=0;
5312 TRACE("%u %u %p\n", numEncoders, size, encoders);
5313
5314 if (!encoders ||
5315 size != numEncoders * sizeof(ImageCodecInfo))
5316 return GenericError;
5317
5318 for (i=0; i<NUM_CODECS; i++)
5319 {
5320 if (codecs[i].info.Flags & ImageCodecFlagsEncoder)
5321 {
5322 if (encoder_count == numEncoders) return GenericError;
5323 memcpy(&encoders[encoder_count], &codecs[i].info, sizeof(ImageCodecInfo));
5324 encoder_count++;
5325 }
5326 }
5327
5328 if (encoder_count < numEncoders) return GenericError;
5329
5330 return Ok;
5331}
@ ImageCodecFlagsEncoder
Definition: gdiplusenums.h:318

Referenced by GdipGetEncoderClsid(), get_encoder_clsid(), Preview_pSaveImage(), Preview_pSaveImageAs(), test_encoders(), and test_SavingImages().

◆ GdipGetImageEncodersSize()

GpStatus WINGDIPAPI GdipGetImageEncodersSize ( UINT numEncoders,
UINT size 
)

Definition at line 5285 of file image.c.

5286{
5287 int encoder_count=0;
5288 int i;
5289 TRACE("%p %p\n", numEncoders, size);
5290
5291 if (!numEncoders || !size)
5292 return InvalidParameter;
5293
5294 for (i=0; i<NUM_CODECS; i++)
5295 {
5296 if (codecs[i].info.Flags & ImageCodecFlagsEncoder)
5297 encoder_count++;
5298 }
5299
5300 *numEncoders = encoder_count;
5301 *size = encoder_count * sizeof(ImageCodecInfo);
5302
5303 return Ok;
5304}

Referenced by GdipGetEncoderClsid(), get_encoder_clsid(), Preview_pSaveImage(), Preview_pSaveImageAs(), test_encoders(), and test_SavingImages().

◆ GdipGetImageFlags()

GpStatus WINGDIPAPI GdipGetImageFlags ( GpImage image,
UINT flags 
)

Definition at line 5672 of file image.c.

5673{
5674 TRACE("%p %p\n", image, flags);
5675
5676 if(!image || !flags)
5677 return InvalidParameter;
5678
5679 *flags = image->flags;
5680
5681 return Ok;
5682}

Referenced by test_GdipGetImageFlags(), test_png_color_formats(), and ZoomWnd_OnDraw().

◆ GdipGetImageGraphicsContext()

GpStatus WINGDIPAPI GdipGetImageGraphicsContext ( GpImage image,
GpGraphics **  graphics 
)

Definition at line 2195 of file image.c.

2197{
2198 GpStatus stat;
2199
2200 TRACE("%p %p\n", image, graphics);
2201
2202 if(!image || !graphics)
2203 return InvalidParameter;
2204
2205 if (image->type == ImageTypeMetafile)
2207 else
2208 stat = graphics_from_image(image, graphics);
2209
2210 return stat;
2211}
GpStatus METAFILE_GetGraphicsContext(GpMetafile *metafile, GpGraphics **result)
Definition: metafile.c:921
GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics)
Definition: graphics.c:2520

Referenced by create_graphics(), GdipGetImageThumbnail(), METAFILE_DrawImagePointsRect(), test_clear(), test_clipping(), test_colorkey(), test_colormatrix(), test_containers(), test_converttoemfplus(), test_drawdriverstring(), test_drawellipse(), test_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_drawrectangle(), test_emfonly(), test_empty(), test_fillellipse(), test_fillpath(), test_fillrect(), test_fillregion(), test_frameunit(), test_fromMemoryBitmap(), test_gamma(), test_gdi_interop_bitmap(), test_GdipDrawImagePointRect(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipGetNearestColor(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_graphics_clear(), test_hatchBrushStyles(), test_is_outline_visible_path_point(), test_lineargradient(), test_nullframerect(), test_offsetclip(), test_pagetransform(), test_pen(), test_pen_thickness(), test_printer_dc(), test_properties(), test_remaptable(), test_renderingOrigin(), test_resetclip(), test_resolution(), test_restoredc(), test_setclippath(), test_unknownfontdecode(), and test_worldtransform().

◆ GdipGetImageHeight()

GpStatus WINGDIPAPI GdipGetImageHeight ( GpImage image,
UINT height 
)

Definition at line 2213 of file image.c.

2214{
2215 TRACE("%p %p\n", image, height);
2216
2217 if(!image || !height)
2218 return InvalidParameter;
2219
2220 if(image->type == ImageTypeMetafile)
2221 *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit,
2222 image->yres, ((GpMetafile*)image)->printer_display);
2223 else if(image->type == ImageTypeBitmap)
2224 *height = ((GpBitmap*)image)->height;
2225 else
2226 {
2227 WARN("GpImage with no image data\n");
2228 return InvalidParameter;
2229 }
2230
2231 TRACE("returning %d\n", *height);
2232
2233 return Ok;
2234}

Referenced by DibLoadImage(), encode_frame_wic(), expect_image_properties(), GdipBitmapGetHistogram(), GdipCloneBrush(), GdipCreateHBITMAPFromBitmap(), GdipCreateTexture(), GdipDrawImage(), GdipDrawImagePoints(), GdipGetImageThumbnail(), Preview_ResetZoom(), test_bitmapfromgraphics(), test_getthumbnail(), test_pagetransform(), test_rotateflip(), ZoomWnd_OnDraw(), ZoomWnd_OnHVScroll(), and ZoomWnd_UpdateScroll().

◆ GdipGetImageHorizontalResolution()

GpStatus WINGDIPAPI GdipGetImageHorizontalResolution ( GpImage image,
REAL res 
)

Definition at line 2236 of file image.c.

2237{
2238 if(!image || !res)
2239 return InvalidParameter;
2240
2241 *res = image->xres;
2242
2243 TRACE("(%p) <-- %0.2f\n", image, *res);
2244
2245 return Ok;
2246}
GLuint res
Definition: glext.h:9613

Referenced by create_graphics(), test_bitmapfromgraphics(), test_createfromwmf(), test_emfonly(), test_empty(), test_frameunit(), test_loadwmf(), test_pagetransform(), and test_resolution().

◆ GdipGetImageItemData()

GpStatus WINGDIPAPI GdipGetImageItemData ( GpImage image,
ImageItemData item 
)

Definition at line 2128 of file image.c.

2129{
2130 static int calls;
2131
2132 TRACE("(%p,%p)\n", image, item);
2133
2134 if (!(calls++))
2135 FIXME("not implemented\n");
2136
2137 return NotImplemented;
2138}

◆ GdipGetImagePalette()

GpStatus WINGDIPAPI GdipGetImagePalette ( GpImage image,
ColorPalette palette,
INT  size 
)

Definition at line 4950 of file image.c.

4951{
4952 INT count;
4953
4954 TRACE("(%p,%p,%i)\n", image, palette, size);
4955
4956 if (!image || !palette)
4957 return InvalidParameter;
4958
4959 count = image->palette ? image->palette->Count : 0;
4960
4961 if (size < (sizeof(UINT)*2+sizeof(ARGB)*count))
4962 {
4963 TRACE("<-- InsufficientBuffer\n");
4964 return InsufficientBuffer;
4965 }
4966
4967 if (image->palette)
4968 {
4969 palette->Flags = image->palette->Flags;
4970 palette->Count = image->palette->Count;
4971 memcpy(palette->Entries, image->palette->Entries, sizeof(ARGB)*image->palette->Count);
4972 }
4973 else
4974 {
4975 palette->Flags = 0;
4976 palette->Count = 0;
4977 }
4978 return Ok;
4979}
@ InsufficientBuffer
Definition: gdiplustypes.h:30

Referenced by test_GdipCreateBitmapFromHBITMAP(), test_multiframegif(), test_palette(), and test_tiff_palette().

◆ GdipGetImagePaletteSize()

GpStatus WINGDIPAPI GdipGetImagePaletteSize ( GpImage image,
INT size 
)

Definition at line 2248 of file image.c.

2249{
2250 TRACE("%p %p\n", image, size);
2251
2252 if(!image || !size)
2253 return InvalidParameter;
2254
2255 if (image->type == ImageTypeMetafile)
2256 {
2257 *size = 0;
2258 return GenericError;
2259 }
2260
2261 if (!image->palette || image->palette->Count == 0)
2262 *size = sizeof(ColorPalette);
2263 else
2264 *size = sizeof(UINT)*2 + sizeof(ARGB)*image->palette->Count;
2265
2266 TRACE("<-- %u\n", *size);
2267
2268 return Ok;
2269}

Referenced by test_image_properties(), test_multiframegif(), test_palette(), and test_tiff_palette().

◆ GdipGetImagePixelFormat()

GpStatus WINGDIPAPI GdipGetImagePixelFormat ( GpImage image,
PixelFormat format 
)

Definition at line 2272 of file image.c.

2273{
2274 TRACE("%p %p\n", image, format);
2275
2276 if(!image || !format)
2277 return InvalidParameter;
2278
2279 if(image->type != ImageTypeBitmap)
2281 else
2282 *format = ((GpBitmap*) image)->format;
2283
2284 return Ok;
2285}

Referenced by expect_image_properties(), test_bitmapfromgraphics(), test_FromGdiDib(), test_GdipCreateBitmapFromHBITMAP(), test_image_format(), test_multiframegif(), test_png_color_formats(), and test_tiff_palette().

◆ GdipGetImageRawFormat()

GpStatus WINGDIPAPI GdipGetImageRawFormat ( GpImage image,
GUID format 
)

Definition at line 2287 of file image.c.

2288{
2289 TRACE("(%p, %p)\n", image, format);
2290
2291 if(!image || !format)
2292 return InvalidParameter;
2293
2294 memcpy(format, &image->format, sizeof(GUID));
2295
2296 return Ok;
2297}

Referenced by expect_rawformat(), Preview_pSaveImage(), Preview_pSaveImageAs(), and SetWallpaper().

◆ GdipGetImageThumbnail()

GpStatus WINGDIPAPI GdipGetImageThumbnail ( GpImage image,
UINT  width,
UINT  height,
GpImage **  ret_image,
GetThumbnailImageAbort  cb,
VOID cb_data 
)

Definition at line 5715 of file image.c.

5718{
5719 GpStatus stat;
5720 GpGraphics *graphics;
5721 UINT srcwidth, srcheight;
5722
5723 TRACE("(%p %u %u %p %p %p)\n",
5724 image, width, height, ret_image, cb, cb_data);
5725
5726 if (!image || !ret_image)
5727 return InvalidParameter;
5728
5729 if (!width) width = 120;
5730 if (!height) height = 120;
5731
5732 GdipGetImageWidth(image, &srcwidth);
5733 GdipGetImageHeight(image, &srcheight);
5734
5736 NULL, (GpBitmap**)ret_image);
5737
5738 if (stat == Ok)
5739 {
5740 stat = GdipGetImageGraphicsContext(*ret_image, &graphics);
5741
5742 if (stat == Ok)
5743 {
5744 stat = GdipDrawImageRectRectI(graphics, image,
5745 0, 0, width, height, 0, 0, srcwidth, srcheight, UnitPixel,
5746 NULL, NULL, NULL);
5747
5748 GdipDeleteGraphics(graphics);
5749 }
5750
5751 if (stat != Ok)
5752 {
5753 GdipDisposeImage(*ret_image);
5754 *ret_image = NULL;
5755 }
5756 }
5757
5758 return stat;
5759}
GpStatus WINGDIPAPI GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image, INT dstx, INT dsty, INT dstwidth, INT dstheight, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, VOID *callbackData)
Definition: graphics.c:3574
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics)
Definition: image.c:2195
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118

Referenced by test_getthumbnail(), and test_image_format().

◆ GdipGetImageType()

GpStatus WINGDIPAPI GdipGetImageType ( GpImage image,
ImageType type 
)

Definition at line 2299 of file image.c.

2300{
2301 TRACE("%p %p\n", image, type);
2302
2303 if(!image || !type)
2304 return InvalidParameter;
2305
2306 *type = image->type;
2307
2308 return Ok;
2309}

Referenced by expect_image_properties(), load_image(), test_image_properties(), and test_png_color_formats().

◆ GdipGetImageVerticalResolution()

GpStatus WINGDIPAPI GdipGetImageVerticalResolution ( GpImage image,
REAL res 
)

Definition at line 2311 of file image.c.

2312{
2313 if(!image || !res)
2314 return InvalidParameter;
2315
2316 *res = image->yres;
2317
2318 TRACE("(%p) <-- %0.2f\n", image, *res);
2319
2320 return Ok;
2321}

Referenced by create_graphics(), test_bitmapfromgraphics(), test_createfromwmf(), test_emfonly(), test_empty(), test_frameunit(), test_loadwmf(), test_pagetransform(), and test_resolution().

◆ GdipGetImageWidth()

GpStatus WINGDIPAPI GdipGetImageWidth ( GpImage image,
UINT width 
)

Definition at line 2323 of file image.c.

2324{
2325 TRACE("%p %p\n", image, width);
2326
2327 if(!image || !width)
2328 return InvalidParameter;
2329
2330 if(image->type == ImageTypeMetafile)
2331 *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit,
2332 image->xres, ((GpMetafile*)image)->printer_display);
2333 else if(image->type == ImageTypeBitmap)
2334 *width = ((GpBitmap*)image)->width;
2335 else
2336 {
2337 WARN("GpImage with no image data\n");
2338 return InvalidParameter;
2339 }
2340
2341 TRACE("returning %d\n", *width);
2342
2343 return Ok;
2344}

Referenced by DibLoadImage(), encode_frame_wic(), expect_image_properties(), GdipBitmapGetHistogram(), GdipCloneBrush(), GdipCreateHBITMAPFromBitmap(), GdipCreateTexture(), GdipDrawImage(), GdipDrawImagePoints(), GdipGetImageThumbnail(), Preview_ResetZoom(), test_bitmapfromgraphics(), test_getthumbnail(), test_pagetransform(), test_rotateflip(), ZoomWnd_OnDraw(), ZoomWnd_OnHVScroll(), and ZoomWnd_UpdateScroll().

◆ GdipGetInterpolationMode()

GpStatus WINGDIPAPI GdipGetInterpolationMode ( GpGraphics graphics,
InterpolationMode mode 
)

Definition at line 5027 of file graphics.c.

5029{
5030 TRACE("(%p, %p)\n", graphics, mode);
5031
5032 if(!graphics || !mode)
5033 return InvalidParameter;
5034
5035 if(graphics->busy)
5036 return ObjectBusy;
5037
5038 *mode = graphics->interpolation;
5039
5040 return Ok;
5041}

Referenced by test_BeginContainer2(), test_Get_Release_DC(), test_get_set_interpolation(), and test_save_restore().

◆ GdipGetLineBlend()

GpStatus WINGDIPAPI GdipGetLineBlend ( GpLineGradient brush,
REAL factors,
REAL positions,
INT  count 
)

Definition at line 1429 of file brush.c.

1431{
1432 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1433
1434 if (!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient)
1435 return InvalidParameter;
1436
1437 if (count < brush->blendcount)
1438 return InsufficientBuffer;
1439
1440 memcpy(factors, brush->blendfac, brush->blendcount * sizeof(REAL));
1441 memcpy(positions, brush->blendpos, brush->blendcount * sizeof(REAL));
1442
1443 return Ok;
1444}

Referenced by test_lineblend(), and test_linelinearblend().

◆ GdipGetLineBlendCount()

GpStatus WINGDIPAPI GdipGetLineBlendCount ( GpLineGradient brush,
INT count 
)

Definition at line 1446 of file brush.c.

1447{
1448 TRACE("(%p, %p)\n", brush, count);
1449
1450 if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
1451 return InvalidParameter;
1452
1453 *count = brush->blendcount;
1454
1455 return Ok;
1456}

Referenced by test_lineblend(), and test_linelinearblend().

◆ GdipGetLineColors()

GpStatus WINGDIPAPI GdipGetLineColors ( GpLineGradient brush,
ARGB colors 
)

Definition at line 2009 of file brush.c.

2010{
2011 TRACE("(%p, %p)\n", brush, colors);
2012
2013 if(!brush || !colors || brush->brush.bt != BrushTypeLinearGradient)
2014 return InvalidParameter;
2015
2016 colors[0] = brush->startcolor;
2017 colors[1] = brush->endcolor;
2018
2019 return Ok;
2020}

Referenced by test_gradientgetrect().

◆ GdipGetLineGammaCorrection()

GpStatus WINGDIPAPI GdipGetLineGammaCorrection ( GpLineGradient line,
BOOL usinggamma 
)

Definition at line 1056 of file brush.c.

1058{
1059 TRACE("(%p, %p)\n", line, usinggamma);
1060
1061 if(!line || !usinggamma)
1062 return InvalidParameter;
1063
1064 *usinggamma = line->gamma;
1065
1066 return Ok;
1067}

Referenced by test_getgamma().

◆ GdipGetLinePresetBlend()

GpStatus WINGDIPAPI GdipGetLinePresetBlend ( GpLineGradient brush,
ARGB blend,
REAL positions,
INT  count 
)

Definition at line 2103 of file brush.c.

2105{
2106 if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient)
2107 return InvalidParameter;
2108
2109 if (brush->pblendcount == 0)
2110 return GenericError;
2111
2112 if (count < brush->pblendcount)
2113 return InsufficientBuffer;
2114
2115 memcpy(blend, brush->pblendcolor, sizeof(ARGB) * brush->pblendcount);
2116 memcpy(positions, brush->pblendpos, sizeof(REAL) * brush->pblendcount);
2117
2118 return Ok;
2119}

Referenced by test_lineblend().

◆ GdipGetLinePresetBlendCount()

GpStatus WINGDIPAPI GdipGetLinePresetBlendCount ( GpLineGradient brush,
INT count 
)

Definition at line 2121 of file brush.c.

2123{
2124 if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
2125 return InvalidParameter;
2126
2127 *count = brush->pblendcount;
2128
2129 return Ok;
2130}

Referenced by test_lineblend().

◆ GdipGetLineRect()

GpStatus WINGDIPAPI GdipGetLineRect ( GpLineGradient brush,
GpRectF rect 
)

Definition at line 2217 of file brush.c.

2218{
2219 TRACE("(%p, %p)\n", brush, rect);
2220
2221 if(!brush || !rect || brush->brush.bt != BrushTypeLinearGradient)
2222 return InvalidParameter;
2223
2224 *rect = brush->rect;
2225
2226 return Ok;
2227}

Referenced by GdipGetLineRectI(), test_gradientgetrect(), and test_transform().

◆ GdipGetLineRectI()

GpStatus WINGDIPAPI GdipGetLineRectI ( GpLineGradient brush,
GpRect rect 
)

Definition at line 2229 of file brush.c.

2230{
2231 GpRectF rectF;
2232 GpStatus ret;
2233
2234 TRACE("(%p, %p)\n", brush, rect);
2235
2236 if(!rect)
2237 return InvalidParameter;
2238
2239 ret = GdipGetLineRect(brush, &rectF);
2240
2241 if(ret == Ok){
2242 rect->X = gdip_round(rectF.X);
2243 rect->Y = gdip_round(rectF.Y);
2244 rect->Width = gdip_round(rectF.Width);
2245 rect->Height = gdip_round(rectF.Height);
2246 }
2247
2248 return ret;
2249}
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
Definition: brush.c:2217

◆ GdipGetLineSpacing()

GpStatus WINGDIPAPI GdipGetLineSpacing ( GDIPCONST GpFontFamily family,
INT  style,
UINT16 LineSpacing 
)

Definition at line 899 of file font.c.

901{
902 TRACE("%p, %d, %p\n", family, style, LineSpacing);
903
904 if (!(family && LineSpacing))
905 return InvalidParameter;
906
907 if (style) FIXME("ignoring style\n");
908
909 *LineSpacing = family->line_spacing;
910 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *LineSpacing);
911
912 return Ok;
913}

Referenced by gdip_get_font_metrics(), GdipGetFontHeightGivenDPI(), test_fontfamily_properties(), and test_logfont().

◆ GdipGetLineTransform()

GpStatus WINGDIPAPI GdipGetLineTransform ( GpLineGradient brush,
GpMatrix matrix 
)

Definition at line 2155 of file brush.c.

2156{
2157 TRACE("(%p,%s)\n", brush, debugstr_matrix(matrix));
2158
2159 if(!brush || !matrix)
2160 return InvalidParameter;
2161
2162 *matrix = brush->transform;
2163
2164 return Ok;
2165}

Referenced by test_gradientgetrect(), and test_transform().

◆ GdipGetLineWrapMode()

GpStatus WINGDIPAPI GdipGetLineWrapMode ( GpLineGradient brush,
GpWrapMode wrapmode 
)

Definition at line 1069 of file brush.c.

1070{
1071 TRACE("(%p, %p)\n", brush, wrapmode);
1072
1073 if(!brush || !wrapmode || brush->brush.bt != BrushTypeLinearGradient)
1074 return InvalidParameter;
1075
1076 *wrapmode = brush->wrap;
1077
1078 return Ok;
1079}

◆ GdipGetLogFontA()

GpStatus WINGDIPAPI GdipGetLogFontA ( GpFont font,
GpGraphics graphics,
LOGFONTA lfa 
)

Definition at line 434 of file font.c.

436{
438 LOGFONTW lfw;
439
440 TRACE("(%p, %p, %p)\n", font, graphics, lfa);
441
442 status = GdipGetLogFontW(font, graphics, &lfw);
443 if(status != Ok)
444 return status;
445
446 memcpy(lfa, &lfw, FIELD_OFFSET(LOGFONTA,lfFaceName) );
447
449 return GenericError;
450
451 return Ok;
452}
#define WideCharToMultiByte
Definition: compat.h:111
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
Definition: font.c:457
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55

Referenced by test_font_substitution(), test_font_transform(), and test_logfont().

◆ GdipGetLogFontW()

GpStatus WINGDIPAPI GdipGetLogFontW ( GpFont font,
GpGraphics graphics,
LOGFONTW lf 
)

Definition at line 457 of file font.c.

458{
459 REAL angle, rel_height, height;
461
462 TRACE("(%p, %p, %p)\n", font, graphics, lf);
463
464 if (!font || !graphics || !lf)
465 return InvalidParameter;
466
467 matrix = graphics->worldtrans;
468
469 if (font->unit == UnitPixel || font->unit == UnitWorld)
470 {
471 height = units_to_pixels(font->emSize, graphics->unit, graphics->yres, graphics->printer_display);
472 if (graphics->unit != UnitDisplay)
473 GdipScaleMatrix(&matrix, graphics->scale, graphics->scale, MatrixOrderAppend);
474 }
475 else
476 {
477 if (graphics->unit == UnitDisplay || graphics->unit == UnitPixel)
478 height = units_to_pixels(font->emSize, font->unit, graphics->xres, graphics->printer_display);
479 else
480 height = units_to_pixels(font->emSize, font->unit, graphics->yres, graphics->printer_display);
481 }
482
484 transform_properties(graphics, &matrix, FALSE, NULL, &rel_height, &angle);
485 get_log_fontW(font, graphics, lf);
486
487 lf->lfHeight = -gdip_round(height * rel_height);
488 lf->lfEscapement = lf->lfOrientation = gdip_round((angle / M_PI) * 1800.0);
489 if (lf->lfEscapement < 0)
490 {
491 lf->lfEscapement += 3600;
492 lf->lfOrientation += 3600;
493 }
494
495 TRACE("=> %s,%ld\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
496
497 return Ok;
498}
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:288
void transform_properties(GpGraphics *, GDIPCONST GpMatrix *, BOOL, REAL *, REAL *, REAL *)
Definition: graphics.c:5696
@ MatrixOrderAppend
Definition: gdiplusenums.h:188
GpMatrix gdi_transform
LONG lfOrientation
Definition: dimm.idl:62
LONG lfEscapement
Definition: dimm.idl:61

Referenced by GdipGetLogFontA(), test_createfont_charset(), test_font_metrics(), and test_GdipMeasureString().

◆ GdipGetMatrixElements()

GpStatus WINGDIPAPI GdipGetMatrixElements ( GDIPCONST GpMatrix matrix,
REAL out 
)

Definition at line 168 of file matrix.c.

170{
171 TRACE("(%s, %p)\n", debugstr_matrix(matrix), out);
172
173 if(!matrix || !out)
174 return InvalidParameter;
175
176 memcpy(out, matrix->matrix, sizeof(matrix->matrix));
177
178 return Ok;
179}
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

Referenced by get_pen_transform(), test_BeginContainer2(), test_constructor3(), test_gradientgetrect(), test_invert(), test_scale(), test_transform(), test_translate(), and test_worldtransform().

◆ GdipGetMetafileDownLevelRasterizationLimit()

GpStatus WINGDIPAPI GdipGetMetafileDownLevelRasterizationLimit ( GDIPCONST GpMetafile metafile,
UINT limitDpi 
)

Definition at line 4401 of file metafile.c.

4403{
4404 TRACE("(%p,%p)\n", metafile, limitDpi);
4405
4406 if (!metafile || !limitDpi)
4407 return InvalidParameter;
4408
4409 if (!metafile->record_dc)
4410 return WrongState;
4411
4412 *limitDpi = metafile->limit_dpi;
4413
4414 return Ok;
4415}

Referenced by test_empty().

◆ GdipGetMetafileHeaderFromEmf()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf ( HENHMETAFILE  hemf,
MetafileHeader header 
)

Definition at line 4128 of file metafile.c.

4130{
4131 ENHMETAHEADER3 emfheader;
4132 EmfPlusHeader emfplusheader;
4133 MetafileType metafile_type;
4134
4135 TRACE("(%p,%p)\n", hemf, header);
4136
4137 if(!hemf || !header)
4138 return InvalidParameter;
4139
4140 if (GetEnhMetaFileHeader(hemf, sizeof(emfheader), (ENHMETAHEADER*)&emfheader) == 0)
4141 return GenericError;
4142
4143 emfplusheader.Header.Type = 0;
4144
4145 EnumEnhMetaFile(NULL, hemf, get_emfplus_header_proc, &emfplusheader, NULL);
4146
4147 if (emfplusheader.Header.Type == EmfPlusRecordTypeHeader)
4148 {
4149 if ((emfplusheader.Header.Flags & 1) == 1)
4150 metafile_type = MetafileTypeEmfPlusDual;
4151 else
4152 metafile_type = MetafileTypeEmfPlusOnly;
4153 }
4154 else
4155 metafile_type = MetafileTypeEmf;
4156
4157 header->Type = metafile_type;
4158 header->Size = emfheader.nBytes;
4159 header->DpiX = (REAL)emfheader.szlDevice.cx * 25.4 / emfheader.szlMillimeters.cx;
4160 header->DpiY = (REAL)emfheader.szlDevice.cy * 25.4 / emfheader.szlMillimeters.cy;
4161 header->X = gdip_round((REAL)emfheader.rclFrame.left / 2540.0 * header->DpiX);
4162 header->Y = gdip_round((REAL)emfheader.rclFrame.top / 2540.0 * header->DpiY);
4163 header->Width = gdip_round((REAL)(emfheader.rclFrame.right - emfheader.rclFrame.left) / 2540.0 * header->DpiX);
4164 header->Height = gdip_round((REAL)(emfheader.rclFrame.bottom - emfheader.rclFrame.top) / 2540.0 * header->DpiY);
4165 header->EmfHeader = emfheader;
4166
4167 if (metafile_type == MetafileTypeEmfPlusDual || metafile_type == MetafileTypeEmfPlusOnly)
4168 {
4169 header->Version = emfplusheader.Version;
4170 header->EmfPlusFlags = emfplusheader.EmfPlusFlags;
4171 header->EmfPlusHeaderSize = emfplusheader.Header.Size;
4172 header->LogicalDpiX = emfplusheader.LogicalDpiX;
4173 header->LogicalDpiY = emfplusheader.LogicalDpiY;
4174 }
4175 else
4176 {
4177 header->Version = emfheader.nVersion;
4178 header->EmfPlusFlags = 0;
4179 header->EmfPlusHeaderSize = 0;
4180 header->LogicalDpiX = 0;
4181 header->LogicalDpiY = 0;
4182 }
4183
4184 return Ok;
4185}
static int CALLBACK get_emfplus_header_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
Definition: metafile.c:4102
@ EmfPlusRecordTypeHeader
Definition: gdiplusenums.h:696
MetafileType
Definition: gdiplusenums.h:213
@ MetafileTypeEmfPlusOnly
Definition: gdiplusenums.h:218
@ MetafileTypeEmf
Definition: gdiplusenums.h:217
@ MetafileTypeEmfPlusDual
Definition: gdiplusenums.h:219
DWORD Version
Definition: metafile.c:64
EmfPlusRecordHeader Header
Definition: metafile.c:63
DWORD LogicalDpiY
Definition: metafile.c:67
DWORD LogicalDpiX
Definition: metafile.c:66
DWORD EmfPlusFlags
Definition: metafile.c:65
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
RECTL rclFrame
Definition: wingdi.h:2769
SIZEL szlDevice
Definition: wingdi.h:2779
SIZEL szlMillimeters
Definition: wingdi.h:2780
DWORD nVersion
Definition: wingdi.h:2771
UINT WINAPI GetEnhMetaFileHeader(_In_ HENHMETAFILE hemf, _In_ UINT nSize, _Out_writes_bytes_opt_(nSize) LPENHMETAHEADER lpEnhMetaHeader)

Referenced by GdipCreateMetafileFromEmf(), GdipGetMetafileHeaderFromMetafile(), METAFILE_GraphicsDeleted(), test_emfonly(), and test_empty().

◆ GdipGetMetafileHeaderFromFile()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile ( GDIPCONST WCHAR filename,
MetafileHeader header 
)

Definition at line 4204 of file metafile.c.

4206{
4209
4210 TRACE("(%s,%p)\n", debugstr_w(filename), header);
4211
4212 if (!filename || !header)
4213 return InvalidParameter;
4214
4216 if (status == Ok)
4217 {
4219 GdipDisposeImage(&metafile->image);
4220 }
4221 return status;
4222}
GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, GpMetafile **metafile)
Definition: metafile.c:4360
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile *metafile, MetafileHeader *header)
Definition: metafile.c:4072

◆ GdipGetMetafileHeaderFromMetafile()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile ( GpMetafile metafile,
MetafileHeader header 
)

Definition at line 4072 of file metafile.c.

4074{
4076
4077 TRACE("(%p, %p)\n", metafile, header);
4078
4079 if(!metafile || !header)
4080 return InvalidParameter;
4081
4082 if (metafile->hemf)
4083 {
4085 if (status != Ok) return status;
4086 }
4087 else
4088 {
4089 memset(header, 0, sizeof(*header));
4090 header->Version = VERSION_MAGIC2;
4091 }
4092
4093 header->Type = metafile->metafile_type;
4094 header->DpiX = metafile->image.xres;
4095 header->DpiY = metafile->image.yres;
4096 header->Width = gdip_round(metafile->bounds.Width);
4097 header->Height = gdip_round(metafile->bounds.Height);
4098
4099 return Ok;
4100}
#define VERSION_MAGIC2

Referenced by GdipGetMetafileHeaderFromFile(), GdipGetMetafileHeaderFromStream(), GdipGetMetafileHeaderFromWmf(), test_createfromwmf(), test_emfonly(), test_empty(), test_gditransform(), and test_loadwmf().

◆ GdipGetMetafileHeaderFromStream()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream ( IStream stream,
MetafileHeader header 
)

Definition at line 4224 of file metafile.c.

4226{
4229
4230 TRACE("(%p,%p)\n", stream, header);
4231
4232 if (!stream || !header)
4233 return InvalidParameter;
4234
4236 if (status == Ok)
4237 {
4239 GdipDisposeImage(&metafile->image);
4240 }
4241 return status;
4242}

◆ GdipGetMetafileHeaderFromWmf()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf ( HMETAFILE  hwmf,
GDIPCONST WmfPlaceableFileHeader placeable,
MetafileHeader header 
)

Definition at line 4187 of file metafile.c.

4189{
4192
4193 TRACE("(%p,%p,%p)\n", hwmf, placeable, header);
4194
4195 status = GdipCreateMetafileFromWmf(hwmf, FALSE, placeable, &metafile);
4196 if (status == Ok)
4197 {
4199 GdipDisposeImage(&metafile->image);
4200 }
4201 return status;
4202}

◆ GdipGetNearestColor()

GpStatus WINGDIPAPI GdipGetNearestColor ( GpGraphics graphics,
ARGB argb 
)

Definition at line 5044 of file graphics.c.

5045{
5046 TRACE("(%p, %p)\n", graphics, argb);
5047
5048 if(!graphics || !argb)
5049 return InvalidParameter;
5050
5051 if(graphics->busy)
5052 return ObjectBusy;
5053
5054 if (graphics->image && graphics->image->type == ImageTypeBitmap)
5055 {
5056 static int once;
5057 GpBitmap *bitmap = (GpBitmap *)graphics->image;
5058 if (IsIndexedPixelFormat(bitmap->format) && !once++)
5059 FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
5060 }
5061
5062 return Ok;
5063}
static BOOL IsIndexedPixelFormat(PixelFormat format)

Referenced by test_GdipGetNearestColor(), and test_Get_Release_DC().

◆ GdipGetPageScale()

GpStatus WINGDIPAPI GdipGetPageScale ( GpGraphics graphics,
REAL scale 
)

Definition at line 5065 of file graphics.c.

5066{
5067 TRACE("(%p, %p)\n", graphics, scale);
5068
5069 if(!graphics || !scale)
5070 return InvalidParameter;
5071
5072 if(graphics->busy)
5073 return ObjectBusy;
5074
5075 *scale = graphics->scale;
5076
5077 return Ok;
5078}
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032

Referenced by test_BeginContainer2(), test_Get_Release_DC(), test_pagetransform(), and test_set_page_transform().

◆ GdipGetPageUnit()

GpStatus WINGDIPAPI GdipGetPageUnit ( GpGraphics graphics,
GpUnit unit 
)

Definition at line 5080 of file graphics.c.

5081{
5082 TRACE("(%p, %p)\n", graphics, unit);
5083
5084 if(!graphics || !unit)
5085 return InvalidParameter;
5086
5087 if(graphics->busy)
5088 return ObjectBusy;
5089
5090 *unit = graphics->unit;
5091
5092 return Ok;
5093}

Referenced by test_BeginContainer2(), test_clipping(), test_clipping_2(), test_Get_Release_DC(), test_pagetransform(), test_printer_dc(), and test_set_page_transform().

◆ GdipGetPathData()

GpStatus WINGDIPAPI GdipGetPathData ( GpPath path,
GpPathData pathData 
)

Definition at line 1493 of file graphicspath.c.

1494{
1495 TRACE("(%p, %p)\n", path, pathData);
1496
1497 if(!path || !pathData)
1498 return InvalidParameter;
1499
1500 /* Only copy data. pathData allocation/freeing controlled by wrapper class.
1501 Assumed that pathData is enough wide to get all data - controlled by wrapper too. */
1502 memcpy(pathData->Points, path->pathdata.Points, sizeof(PointF) * pathData->Count);
1503 memcpy(pathData->Types , path->pathdata.Types , pathData->Count);
1504
1505 return Ok;
1506}

Referenced by test_createpath2(), and test_getpathdata().

◆ GdipGetPathFillMode()

GpStatus WINGDIPAPI GdipGetPathFillMode ( GpPath path,
GpFillMode fillmode 
)

Definition at line 1508 of file graphicspath.c.

1509{
1510 TRACE("(%p, %p)\n", path, fillmode);
1511
1512 if(!path || !fillmode)
1513 return InvalidParameter;
1514
1515 *fillmode = path->fill;
1516
1517 return Ok;
1518}

◆ GdipGetPathGradientBlend()

GpStatus WINGDIPAPI GdipGetPathGradientBlend ( GpPathGradient brush,
REAL blend,
REAL positions,
INT  count 
)

Definition at line 1081 of file brush.c.

1083{
1084 TRACE("(%p, %p, %p, %d)\n", brush, blend, positions, count);
1085
1086 if(!brush || !blend || !positions || count <= 0 || brush->brush.bt != BrushTypePathGradient)
1087 return InvalidParameter;
1088
1089 if(count < brush->blendcount)
1090 return InsufficientBuffer;
1091
1092 memcpy(blend, brush->blendfac, count*sizeof(REAL));
1093 if(brush->blendcount > 1){
1094 memcpy(positions, brush->blendpos, count*sizeof(REAL));
1095 }
1096
1097 return Ok;
1098}

Referenced by test_getblend(), and test_pathgradientblend().

◆ GdipGetPathGradientBlendCount()

GpStatus WINGDIPAPI GdipGetPathGradientBlendCount ( GpPathGradient brush,
INT count 
)

Definition at line 1100 of file brush.c.

1101{
1102 TRACE("(%p, %p)\n", brush, count);
1103
1104 if(!brush || !count || brush->brush.bt != BrushTypePathGradient)
1105 return InvalidParameter;
1106
1107 *count = brush->blendcount;
1108
1109 return Ok;
1110}

Referenced by test_gradientblendcount(), and test_pathgradientblend().

◆ GdipGetPathGradientCenterColor()

GpStatus WINGDIPAPI GdipGetPathGradientCenterColor ( GpPathGradient grad,
ARGB colors 
)

Definition at line 1147 of file brush.c.

1149{
1150 TRACE("(%p,%p)\n", grad, colors);
1151
1152 if (!grad || !colors || grad->brush.bt != BrushTypePathGradient)
1153 return InvalidParameter;
1154
1155 *colors = grad->centercolor;
1156
1157 return Ok;
1158}

◆ GdipGetPathGradientCenterPoint()

GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint ( GpPathGradient grad,
GpPointF point 
)

Definition at line 1112 of file brush.c.

1114{
1115 TRACE("(%p, %p)\n", grad, point);
1116
1117 if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
1118 return InvalidParameter;
1119
1120 point->X = grad->center.X;
1121 point->Y = grad->center.Y;
1122
1123 return Ok;
1124}
POINTL point
Definition: edittest.c:50

Referenced by GdipGetPathGradientCenterPointI(), and test_pathgradientcenterpoint().

◆ GdipGetPathGradientCenterPointI()

GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI ( GpPathGradient grad,
GpPoint point 
)

Definition at line 1126 of file brush.c.

1128{
1129 GpStatus ret;
1130 GpPointF ptf;
1131
1132 TRACE("(%p, %p)\n", grad, point);
1133
1134 if(!point)
1135 return InvalidParameter;
1136
1138
1139 if(ret == Ok){
1140 point->X = gdip_round(ptf.X);
1141 point->Y = gdip_round(ptf.Y);
1142 }
1143
1144 return ret;
1145}
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1112

◆ GdipGetPathGradientFocusScales()

GpStatus WINGDIPAPI GdipGetPathGradientFocusScales ( GpPathGradient grad,
REAL x,
REAL y 
)

Definition at line 1160 of file brush.c.

1162{
1163 TRACE("(%p, %p, %p)\n", grad, x, y);
1164
1165 if(!grad || !x || !y || grad->brush.bt != BrushTypePathGradient)
1166 return InvalidParameter;
1167
1168 *x = grad->focus.X;
1169 *y = grad->focus.Y;
1170
1171 return Ok;
1172}

◆ GdipGetPathGradientGammaCorrection()

GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection ( GpPathGradient grad,
BOOL gamma 
)

Definition at line 1174 of file brush.c.

1176{
1177 TRACE("(%p, %p)\n", grad, gamma);
1178
1179 if(!grad || !gamma || grad->brush.bt != BrushTypePathGradient)
1180 return InvalidParameter;
1181
1182 *gamma = grad->gamma;
1183
1184 return Ok;
1185}

◆ GdipGetPathGradientPath()

GpStatus WINGDIPAPI GdipGetPathGradientPath ( GpPathGradient grad,
GpPath path 
)

Definition at line 1187 of file brush.c.

1188{
1189 static int calls;
1190
1191 TRACE("(%p, %p)\n", grad, path);
1192
1193 if (!(calls++))
1194 FIXME("not implemented\n");
1195
1196 return NotImplemented;
1197}

Referenced by test_pathgradientpath().

◆ GdipGetPathGradientPointCount()

GpStatus WINGDIPAPI GdipGetPathGradientPointCount ( GpPathGradient grad,
INT count 
)

Definition at line 1199 of file brush.c.

1201{
1202 TRACE("(%p, %p)\n", grad, count);
1203
1204 if(!grad || !count || grad->brush.bt != BrushTypePathGradient)
1205 return InvalidParameter;
1206
1207 *count = grad->path->pathdata.Count;
1208
1209 return Ok;
1210}

◆ GdipGetPathGradientPresetBlend()

GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend ( GpPathGradient brush,
ARGB blend,
REAL pos,
INT  count 
)

Definition at line 1642 of file brush.c.

1644{
1645 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1646
1647 if (count < 0)
1648 return OutOfMemory;
1649
1650 if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient)
1651 return InvalidParameter;
1652
1653 if (brush->pblendcount == 0)
1654 return GenericError;
1655
1656 if (count != brush->pblendcount)
1657 {
1658 /* Native lines up the ends of each array, and copies the destination size. */
1659 FIXME("Braindead behavior on wrong-sized buffer not implemented.\n");
1660 return InvalidParameter;
1661 }
1662
1663 memcpy(blend, brush->pblendcolor, sizeof(ARGB) * brush->pblendcount);
1664 memcpy(pos, brush->pblendpos, sizeof(REAL) * brush->pblendcount);
1665
1666 return Ok;
1667}

Referenced by test_pathgradientpresetblend().

◆ GdipGetPathGradientPresetBlendCount()

GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount ( GpPathGradient brush,
INT count 
)

Definition at line 1669 of file brush.c.

1671{
1672 TRACE("(%p,%p)\n", brush, count);
1673
1674 if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
1675 return InvalidParameter;
1676
1677 *count = brush->pblendcount;
1678
1679 return Ok;
1680}

Referenced by test_pathgradientpresetblend().

◆ GdipGetPathGradientRect()

GpStatus WINGDIPAPI GdipGetPathGradientRect ( GpPathGradient brush,
GpRectF rect 
)

Definition at line 1212 of file brush.c.

1213{
1214 GpStatus stat;
1215
1216 TRACE("(%p, %p)\n", brush, rect);
1217
1218 if(!brush || !rect || brush->brush.bt != BrushTypePathGradient)
1219 return InvalidParameter;
1220
1222
1223 return stat;
1224}
GpStatus WINGDIPAPI GdipGetPathWorldBounds(GpPath *path, GpRectF *bounds, GDIPCONST GpMatrix *matrix, GDIPCONST GpPen *pen)

Referenced by GdipGetPathGradientRectI(), and test_getbounds().

◆ GdipGetPathGradientRectI()

GpStatus WINGDIPAPI GdipGetPathGradientRectI ( GpPathGradient brush,
GpRect rect 
)

Definition at line 1226 of file brush.c.

1227{
1228 GpRectF rectf;
1229 GpStatus stat;
1230
1231 TRACE("(%p, %p)\n", brush, rect);
1232
1233 if(!brush || !rect)
1234 return InvalidParameter;
1235
1236 stat = GdipGetPathGradientRect(brush, &rectf);
1237 if(stat != Ok) return stat;
1238
1239 rect->X = gdip_round(rectf.X);
1240 rect->Y = gdip_round(rectf.Y);
1241 rect->Width = gdip_round(rectf.Width);
1242 rect->Height = gdip_round(rectf.Height);
1243
1244 return Ok;
1245}
GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect)
Definition: brush.c:1212

◆ GdipGetPathGradientSurroundColorCount()

GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount ( GpPathGradient brush,
INT count 
)

Definition at line 1270 of file brush.c.

1271{
1272 TRACE("(%p, %p)\n", brush, count);
1273
1274 if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
1275 return InvalidParameter;
1276
1277 /* Yes, this actually returns the number of points in the path (which is the
1278 * required size of a buffer to get the surround colors), rather than the
1279 * number of surround colors. The real count is returned when getting the
1280 * colors. */
1281 *count = brush->path->pathdata.Count;
1282
1283 return Ok;
1284}

Referenced by test_gradientsurroundcolorcount().

◆ GdipGetPathGradientSurroundColorsWithCount()

GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount ( GpPathGradient grad,
ARGB argb,
INT count 
)

Definition at line 1247 of file brush.c.

1249{
1250 INT i;
1251
1252 TRACE("(%p,%p,%p)\n", grad, argb, count);
1253
1254 if(!grad || !argb || !count || (*count < grad->path->pathdata.Count) || grad->brush.bt != BrushTypePathGradient)
1255 return InvalidParameter;
1256
1257 for (i=0; i<grad->path->pathdata.Count; i++)
1258 {
1259 if (i < grad->surroundcolorcount)
1260 argb[i] = grad->surroundcolors[i];
1261 else
1262 argb[i] = grad->surroundcolors[grad->surroundcolorcount-1];
1263 }
1264
1265 *count = grad->surroundcolorcount;
1266
1267 return Ok;
1268}

Referenced by test_gradientsurroundcolorcount().

◆ GdipGetPathGradientTransform()

GpStatus WINGDIPAPI GdipGetPathGradientTransform ( GpPathGradient grad,
GpMatrix matrix 
)

Definition at line 1884 of file brush.c.

1886{
1887 TRACE("(%p,%s)\n", grad, debugstr_matrix(matrix));
1888
1889 if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
1890 return InvalidParameter;
1891
1892 *matrix = grad->transform;
1893
1894 return Ok;
1895}

◆ GdipGetPathGradientWrapMode()

GpStatus WINGDIPAPI GdipGetPathGradientWrapMode ( GpPathGradient brush,
GpWrapMode wrapmode 
)

Definition at line 1286 of file brush.c.

1288{
1289 TRACE("(%p, %p)\n", brush, wrapmode);
1290
1291 if(!brush || !wrapmode || brush->brush.bt != BrushTypePathGradient)
1292 return InvalidParameter;
1293
1294 *wrapmode = brush->wrap;
1295
1296 return Ok;
1297}

◆ GdipGetPathLastPoint()

GpStatus WINGDIPAPI GdipGetPathLastPoint ( GpPath path,
GpPointF lastPoint 
)

Definition at line 1520 of file graphicspath.c.

1521{
1522 INT count;
1523
1524 TRACE("(%p, %p)\n", path, lastPoint);
1525
1526 if(!path || !lastPoint)
1527 return InvalidParameter;
1528
1529 count = path->pathdata.Count;
1530 if(count > 0)
1531 *lastPoint = path->pathdata.Points[count-1];
1532
1533 return Ok;
1534}

Referenced by test_lastpoint().

◆ GdipGetPathPoints()

GpStatus WINGDIPAPI GdipGetPathPoints ( GpPath path,
GpPointF points,
INT  count 
)

Definition at line 1536 of file graphicspath.c.

1537{
1538 TRACE("(%p, %p, %d)\n", path, points, count);
1539
1540 if(!path)
1541 return InvalidParameter;
1542
1543 if(count < path->pathdata.Count)
1544 return InsufficientBuffer;
1545
1546 memcpy(points, path->pathdata.Points, path->pathdata.Count * sizeof(GpPointF));
1547
1548 return Ok;
1549}

Referenced by _ok_path_fudge(), and GdipGetPathPointsI().

◆ GdipGetPathPointsI()

GpStatus WINGDIPAPI GdipGetPathPointsI ( GpPath path,
GpPoint points,
INT  count 
)

Definition at line 1551 of file graphicspath.c.

1552{
1553 GpStatus ret;
1554 GpPointF *ptf;
1555 INT i;
1556
1557 TRACE("(%p, %p, %d)\n", path, points, count);
1558
1559 if(count <= 0)
1560 return InvalidParameter;
1561
1562 ptf = malloc(sizeof(GpPointF) * count);
1563 if(!ptf) return OutOfMemory;
1564
1566 if(ret == Ok)
1567 for(i = 0;i < count;i++){
1568 points[i].X = gdip_round(ptf[i].X);
1569 points[i].Y = gdip_round(ptf[i].Y);
1570 };
1571 free(ptf);
1572
1573 return ret;
1574}
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF *points, INT count)

◆ GdipGetPathTypes()

GpStatus WINGDIPAPI GdipGetPathTypes ( GpPath path,
BYTE types,
INT  count 
)

Definition at line 1576 of file graphicspath.c.

1577{
1578 TRACE("(%p, %p, %d)\n", path, types, count);
1579
1580 if(!path)
1581 return InvalidParameter;
1582
1583 if(count < path->pathdata.Count)
1584 return InsufficientBuffer;
1585
1586 memcpy(types, path->pathdata.Types, path->pathdata.Count);
1587
1588 return Ok;
1589}

Referenced by _ok_path_fudge().

◆ GdipGetPathWorldBounds()

GpStatus WINGDIPAPI GdipGetPathWorldBounds ( GpPath path,
GpRectF bounds,
GDIPCONST GpMatrix matrix,
GDIPCONST GpPen pen 
)

Definition at line 1595 of file graphicspath.c.

1597{
1598 GpPointF * points, temp_pts[4];
1599 INT count, i;
1600 REAL path_width = 1.0, width, height, temp, low_x, low_y, high_x, high_y;
1601
1602 TRACE("(%p, %p, %s, %p)\n", path, bounds, debugstr_matrix(matrix), pen);
1603
1604 /* Matrix and pen can be null. */
1605 if(!path || !bounds)
1606 return InvalidParameter;
1607
1608 /* If path is empty just return. */
1609 count = path->pathdata.Count;
1610 if(count == 0){
1611 bounds->X = bounds->Y = bounds->Width = bounds->Height = 0.0;
1612 return Ok;
1613 }
1614
1615 points = path->pathdata.Points;
1616
1617 low_x = high_x = points[0].X;
1618 low_y = high_y = points[0].Y;
1619
1620 for(i = 1; i < count; i++){
1621 low_x = min(low_x, points[i].X);
1622 low_y = min(low_y, points[i].Y);
1623 high_x = max(high_x, points[i].X);
1624 high_y = max(high_y, points[i].Y);
1625 }
1626
1627 width = high_x - low_x;
1628 height = high_y - low_y;
1629
1630 /* This looks unusual but it's the only way I can imitate windows. */
1631 if(matrix){
1632 temp_pts[0].X = low_x;
1633 temp_pts[0].Y = low_y;
1634 temp_pts[1].X = low_x;
1635 temp_pts[1].Y = high_y;
1636 temp_pts[2].X = high_x;
1637 temp_pts[2].Y = high_y;
1638 temp_pts[3].X = high_x;
1639 temp_pts[3].Y = low_y;
1640
1642 low_x = temp_pts[0].X;
1643 low_y = temp_pts[0].Y;
1644
1645 for(i = 1; i < 4; i++){
1646 low_x = min(low_x, temp_pts[i].X);
1647 low_y = min(low_y, temp_pts[i].Y);
1648 }
1649
1650 temp = width;
1651 width = height * fabs(matrix->matrix[2]) + width * fabs(matrix->matrix[0]);
1652 height = height * fabs(matrix->matrix[3]) + temp * fabs(matrix->matrix[1]);
1653 }
1654
1655 if(pen){
1656 path_width = pen->width / 2.0;
1657
1658 if(count > 2)
1659 path_width = max(path_width, pen->width * pen->miterlimit / 2.0);
1660 /* FIXME: this should probably also check for the startcap */
1661 if(pen->endcap & LineCapNoAnchor)
1662 path_width = max(path_width, pen->width * 2.2);
1663
1664 low_x -= path_width;
1665 low_y -= path_width;
1666 width += 2.0 * path_width;
1667 height += 2.0 * path_width;
1668 }
1669
1670 bounds->X = low_x;
1671 bounds->Y = low_y;
1672 bounds->Width = width;
1673 bounds->Height = height;
1674
1675 return Ok;
1676}
@ LineCapNoAnchor
Definition: gdiplusenums.h:66
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by GdipGetPathGradientRect(), GdipGetPathWorldBoundsI(), and test_worldbounds().

◆ GdipGetPathWorldBoundsI()

GpStatus WINGDIPAPI GdipGetPathWorldBoundsI ( GpPath path,
GpRect bounds,
GDIPCONST GpMatrix matrix,
GDIPCONST GpPen pen 
)

Definition at line 1678 of file graphicspath.c.

1680{
1681 GpStatus ret;
1682 GpRectF boundsF;
1683
1684 TRACE("(%p, %p, %s, %p)\n", path, bounds, debugstr_matrix(matrix), pen);
1685
1686 ret = GdipGetPathWorldBounds(path,&boundsF,matrix,pen);
1687
1688 if(ret == Ok){
1689 bounds->X = gdip_round(boundsF.X);
1690 bounds->Y = gdip_round(boundsF.Y);
1691 bounds->Width = gdip_round(boundsF.Width);
1692 bounds->Height = gdip_round(boundsF.Height);
1693 }
1694
1695 return ret;
1696}

◆ GdipGetPenBrushFill()

GpStatus WINGDIPAPI GdipGetPenBrushFill ( GpPen pen,
GpBrush **  brush 
)

Definition at line 220 of file pen.c.

221{
222 TRACE("(%p, %p)\n", pen, brush);
223
224 if(!pen || !brush)
225 return InvalidParameter;
226
227 return GdipCloneBrush(pen->brush, brush);
228}

Referenced by test_brushfill().

◆ GdipGetPenColor()

GpStatus WINGDIPAPI GdipGetPenColor ( GpPen pen,
ARGB argb 
)

Definition at line 230 of file pen.c.

231{
232 TRACE("(%p, %p)\n", pen, argb);
233
234 if(!pen || !argb)
235 return InvalidParameter;
236
237 if(pen->brush->bt != BrushTypeSolidColor)
238 return NotImplemented;
239
240 return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
241}
GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
Definition: brush.c:1299

Referenced by test_brushfill().

◆ GdipGetPenCompoundArray()

GpStatus WINGDIPAPI GdipGetPenCompoundArray ( GpPen pen,
REAL compoundarray,
INT  count 
)

Definition at line 543 of file pen.c.

544{
545 TRACE("(%p, %p, %i)\n", pen, compoundarray, count);
546
547 if (!pen || !compoundarray || count > pen->compound_array_size)
548 return InvalidParameter;
549 if (pen->compound_array && count > 0)
550 memcpy(compoundarray, pen->compound_array, count * sizeof(REAL));
551 return Ok;
552}

Referenced by test_compoundarray().

◆ GdipGetPenCompoundCount()

GpStatus WINGDIPAPI GdipGetPenCompoundCount ( GpPen pen,
INT count 
)

Definition at line 554 of file pen.c.

555{
556 TRACE("(%p, %p)\n", pen, count);
557
558 if (!pen || !count)
559 return InvalidParameter;
561 return Ok;
562}

Referenced by test_compoundarray().

◆ GdipGetPenCustomEndCap()

GpStatus WINGDIPAPI GdipGetPenCustomEndCap ( GpPen pen,
GpCustomLineCap **  customCap 
)

Definition at line 243 of file pen.c.

244{
245 TRACE("(%p, %p)\n", pen, customCap);
246
247 if(!pen || !customCap)
248 return InvalidParameter;
249
250 if(!pen->customend){
251 *customCap = NULL;
252 return Ok;
253 }
254
255 return GdipCloneCustomLineCap(pen->customend, customCap);
256}

Referenced by test_customcap().

◆ GdipGetPenCustomStartCap()

GpStatus WINGDIPAPI GdipGetPenCustomStartCap ( GpPen pen,
GpCustomLineCap **  customCap 
)

Definition at line 258 of file pen.c.

259{
260 TRACE("(%p, %p)\n", pen, customCap);
261
262 if(!pen || !customCap)
263 return InvalidParameter;
264
265 if(!pen->customstart){
266 *customCap = NULL;
267 return Ok;
268 }
269
270 return GdipCloneCustomLineCap(pen->customstart, customCap);
271}

Referenced by test_customcap().

◆ GdipGetPenDashArray()

GpStatus WINGDIPAPI GdipGetPenDashArray ( GpPen pen,
REAL dash,
INT  count 
)

Definition at line 273 of file pen.c.

274{
275 TRACE("(%p, %p, %d)\n", pen, dash, count);
276
277 if(!pen || !dash || count > pen->numdashes)
278 return InvalidParameter;
279
280 /* note: if you pass a negative value for count, it crashes native gdiplus. */
281 if(count < 0)
282 return GenericError;
283
284 memcpy(dash, pen->dashes, count * sizeof(REAL));
285
286 return Ok;
287}

Referenced by test_dasharray().

◆ GdipGetPenDashCap197819()

GpStatus WINGDIPAPI GdipGetPenDashCap197819 ( GpPen pen,
GpDashCap dashCap 
)

Definition at line 289 of file pen.c.

290{
291 TRACE("(%p, %p)\n", pen, dashCap);
292
293 if(!pen || !dashCap)
294 return InvalidParameter;
295
296 *dashCap = pen->dashcap;
297
298 return Ok;
299}
GpDashCap dashcap

◆ GdipGetPenDashCount()

GpStatus WINGDIPAPI GdipGetPenDashCount ( GpPen pen,
INT count 
)

Definition at line 301 of file pen.c.

302{
303 TRACE("(%p, %p)\n", pen, count);
304
305 if(!pen || !count)
306 return InvalidParameter;
307
308 *count = pen->numdashes;
309
310 return Ok;
311}

◆ GdipGetPenDashOffset()

GpStatus WINGDIPAPI GdipGetPenDashOffset ( GpPen pen,
REAL offset 
)

Definition at line 313 of file pen.c.

314{
315 TRACE("(%p, %p)\n", pen, offset);
316
317 if(!pen || !offset)
318 return InvalidParameter;
319
320 *offset = pen->offset;
321
322 return Ok;
323}

◆ GdipGetPenDashStyle()

GpStatus WINGDIPAPI GdipGetPenDashStyle ( GpPen pen,
GpDashStyle dash 
)

Definition at line 325 of file pen.c.

326{
327 TRACE("(%p, %p)\n", pen, dash);
328
329 if(!pen || !dash)
330 return InvalidParameter;
331
332 *dash = pen->dash;
333
334 return Ok;
335}

Referenced by test_dasharray().

◆ GdipGetPenEndCap()

GpStatus WINGDIPAPI GdipGetPenEndCap ( GpPen pen,
GpLineCap endCap 
)

Definition at line 337 of file pen.c.

338{
339 TRACE("(%p, %p)\n", pen, endCap);
340
341 if(!pen || !endCap)
342 return InvalidParameter;
343
344 *endCap = pen->endcap;
345
346 return Ok;
347}

◆ GdipGetPenFillType()

GpStatus WINGDIPAPI GdipGetPenFillType ( GpPen pen,
GpPenType type 
)

Definition at line 349 of file pen.c.

350{
351 TRACE("(%p, %p)\n", pen, type);
352
353 if(!pen || !type)
354 return InvalidParameter;
355
356 *type = bt_to_pt(pen->brush->bt);
357
358 return Ok;
359}
static GpPenType bt_to_pt(GpBrushType bt)
Definition: pen.c:70

Referenced by test_penfilltype().

◆ GdipGetPenLineJoin()

GpStatus WINGDIPAPI GdipGetPenLineJoin ( GpPen pen,
GpLineJoin lineJoin 
)

Definition at line 361 of file pen.c.

362{
363 TRACE("(%p, %p)\n", pen, lineJoin);
364
365 if(!pen || !lineJoin)
366 return InvalidParameter;
367
368 *lineJoin = pen->join;
369
370 return Ok;
371}

◆ GdipGetPenMiterLimit()

GpStatus WINGDIPAPI GdipGetPenMiterLimit ( GpPen pen,
REAL miterLimit 
)

Definition at line 385 of file pen.c.

386{
387 TRACE("(%p, %p)\n", pen, miterLimit);
388
389 if(!pen || !miterLimit)
390 return InvalidParameter;
391
392 *miterLimit = pen->miterlimit;
393
394 return Ok;
395}

◆ GdipGetPenMode()

GpStatus WINGDIPAPI GdipGetPenMode ( GpPen pen,
GpPenAlignment mode 
)

Definition at line 373 of file pen.c.

374{
375 TRACE("(%p, %p)\n", pen, mode);
376
377 if(!pen || !mode)
378 return InvalidParameter;
379
380 *mode = pen->align;
381
382 return Ok;
383}
GpPenAlignment align

◆ GdipGetPenStartCap()

GpStatus WINGDIPAPI GdipGetPenStartCap ( GpPen pen,
GpLineCap startCap 
)

Definition at line 397 of file pen.c.

398{
399 TRACE("(%p, %p)\n", pen, startCap);
400
401 if(!pen || !startCap)
402 return InvalidParameter;
403
404 *startCap = pen->startcap;
405
406 return Ok;
407}
GpLineCap startcap

◆ GdipGetPenTransform()

GpStatus WINGDIPAPI GdipGetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 466 of file pen.c.

467{
468 TRACE("(%p,%s)\n", pen, debugstr_matrix(matrix));
469
470 if(!pen || !matrix)
471 return InvalidParameter;
472
473 *matrix = pen->transform;
474
475 return Ok;
476}

Referenced by get_pen_transform(), and test_transform().

◆ GdipGetPenUnit()

GpStatus WINGDIPAPI GdipGetPenUnit ( GpPen pen,
GpUnit unit 
)

Definition at line 409 of file pen.c.

410{
411 TRACE("(%p, %p)\n", pen, unit);
412
413 if(!pen || !unit)
414 return InvalidParameter;
415
416 *unit = pen->unit;
417
418 return Ok;
419}

◆ GdipGetPenWidth()

GpStatus WINGDIPAPI GdipGetPenWidth ( GpPen pen,
REAL width 
)

Definition at line 421 of file pen.c.

422{
423 TRACE("(%p, %p)\n", pen, width);
424
425 if(!pen || !width)
426 return InvalidParameter;
427
428 *width = pen->width;
429
430 return Ok;
431}

◆ GdipGetPixelOffsetMode()

GpStatus WINGDIPAPI GdipGetPixelOffsetMode ( GpGraphics graphics,
PixelOffsetMode mode 
)

Definition at line 5096 of file graphics.c.

5098{
5099 TRACE("(%p, %p)\n", graphics, mode);
5100
5101 if(!graphics || !mode)
5102 return InvalidParameter;
5103
5104 if(graphics->busy)
5105 return ObjectBusy;
5106
5107 *mode = graphics->pixeloffset;
5108
5109 return Ok;
5110}

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetPointCount()

GpStatus WINGDIPAPI GdipGetPointCount ( GpPath path,
INT count 
)

Definition at line 1698 of file graphicspath.c.

1699{
1700 TRACE("(%p, %p)\n", path, count);
1701
1702 if(!path)
1703 return InvalidParameter;
1704
1705 *count = path->pathdata.Count;
1706
1707 return Ok;
1708}

Referenced by _ok_path_fudge(), test_createpath2(), test_empty_rect(), test_getpathdata(), test_nextmarkerpath(), test_nextsubpathpath(), test_widen(), and test_widen_cap().

◆ GdipGetPropertyCount()

GpStatus WINGDIPAPI GdipGetPropertyCount ( GpImage image,
UINT num 
)

Definition at line 2346 of file image.c.

2347{
2348 TRACE("(%p, %p)\n", image, num);
2349
2350 if (!image || !num) return InvalidParameter;
2351
2352 *num = 0;
2353
2354 if (image->type == ImageTypeBitmap)
2355 {
2356 if (((GpBitmap *)image)->prop_item)
2357 {
2358 *num = ((GpBitmap *)image)->prop_count;
2359 return Ok;
2360 }
2361
2362 if (((GpBitmap *)image)->metadata_reader)
2363 IWICMetadataReader_GetCount(((GpBitmap *)image)->metadata_reader, num);
2364 }
2365
2366 return Ok;
2367}
GLuint GLuint num
Definition: glext.h:9618

Referenced by check_properties_id_list(), and test_image_properties().

◆ GdipGetPropertyIdList()

GpStatus WINGDIPAPI GdipGetPropertyIdList ( GpImage image,
UINT  num,
PROPID list 
)

Definition at line 2369 of file image.c.

2370{
2371 HRESULT hr;
2373 IWICEnumMetadataItem *enumerator;
2374 UINT prop_count, i;
2375 ULONG items_returned;
2376
2377 TRACE("(%p, %u, %p)\n", image, num, list);
2378
2379 if (!image || !list) return InvalidParameter;
2380
2381 if (image->type != ImageTypeBitmap)
2382 {
2383 FIXME("Not implemented for type %d\n", image->type);
2384 return NotImplemented;
2385 }
2386
2387 if (((GpBitmap *)image)->prop_item)
2388 {
2389 if (num != ((GpBitmap *)image)->prop_count) return InvalidParameter;
2390
2391 for (i = 0; i < num; i++)
2392 {
2393 list[i] = ((GpBitmap *)image)->prop_item[i].id;
2394 }
2395
2396 return Ok;
2397 }
2398
2399 reader = ((GpBitmap *)image)->metadata_reader;
2400 if (!reader)
2401 {
2402 if (num != 0) return InvalidParameter;
2403 return Ok;
2404 }
2405
2406 hr = IWICMetadataReader_GetCount(reader, &prop_count);
2407 if (FAILED(hr)) return hresult_to_status(hr);
2408
2409 if (num != prop_count) return InvalidParameter;
2410
2411 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2412 if (FAILED(hr)) return hresult_to_status(hr);
2413
2414 IWICEnumMetadataItem_Reset(enumerator);
2415
2416 for (i = 0; i < num; i++)
2417 {
2418 PROPVARIANT id;
2419
2420 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, NULL, &items_returned);
2421 if (hr != S_OK) break;
2422
2423 if (id.vt != VT_UI2)
2424 {
2425 FIXME("not supported propvariant type for id: %u\n", id.vt);
2426 list[i] = 0;
2427 continue;
2428 }
2429 list[i] = id.uiVal;
2430 }
2431
2432 IWICEnumMetadataItem_Release(enumerator);
2433
2434 return hr == S_OK ? Ok : hresult_to_status(hr);
2435}

Referenced by check_properties_id_list(), and test_image_properties().

◆ GdipGetPropertyItem()

GpStatus WINGDIPAPI GdipGetPropertyItem ( GpImage image,
PROPID  propid,
UINT  size,
PropertyItem buffer 
)

Definition at line 2617 of file image.c.

2619{
2620 GpStatus stat;
2621 HRESULT hr;
2623 PROPVARIANT id, value;
2624
2625 TRACE("(%p,%#lx,%u,%p)\n", image, propid, size, buffer);
2626
2627 if (!image || !buffer) return InvalidParameter;
2628
2629 if (image->type != ImageTypeBitmap)
2630 {
2631 FIXME("Not implemented for type %d\n", image->type);
2632 return NotImplemented;
2633 }
2634
2635 if (((GpBitmap *)image)->prop_item)
2636 {
2637 UINT i;
2638
2639 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2640 {
2641 if (propid == ((GpBitmap *)image)->prop_item[i].id)
2642 {
2643 if (size != sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length)
2644 return InvalidParameter;
2645
2646 *buffer = ((GpBitmap *)image)->prop_item[i];
2647 buffer->value = buffer + 1;
2648 memcpy(buffer->value, ((GpBitmap *)image)->prop_item[i].value, buffer->length);
2649 return Ok;
2650 }
2651 }
2652
2653 return PropertyNotFound;
2654 }
2655
2656 reader = ((GpBitmap *)image)->metadata_reader;
2657 if (!reader) return PropertyNotFound;
2658
2659 id.vt = VT_UI2;
2660 id.uiVal = propid;
2661 hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
2662 if (FAILED(hr)) return PropertyNotFound;
2663
2666
2667 return stat;
2668}
GLuint buffer
Definition: glext.h:5915

Referenced by Anime_LoadInfo(), check_properties_id_list(), and test_image_properties().

◆ GdipGetPropertyItemSize()

GpStatus WINGDIPAPI GdipGetPropertyItemSize ( GpImage image,
PROPID  propid,
UINT size 
)

Definition at line 2471 of file image.c.

2472{
2473 HRESULT hr;
2475 PROPVARIANT id, value;
2476
2477 TRACE("(%p,%#lx,%p)\n", image, propid, size);
2478
2479 if (!size || !image) return InvalidParameter;
2480
2481 if (image->type != ImageTypeBitmap)
2482 {
2483 FIXME("Not implemented for type %d\n", image->type);
2484 return NotImplemented;
2485 }
2486
2487 if (((GpBitmap *)image)->prop_item)
2488 {
2489 UINT i;
2490
2491 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2492 {
2493 if (propid == ((GpBitmap *)image)->prop_item[i].id)
2494 {
2495 *size = sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length;
2496 return Ok;
2497 }
2498 }
2499
2500 return PropertyNotFound;
2501 }
2502
2503 reader = ((GpBitmap *)image)->metadata_reader;
2504 if (!reader) return PropertyNotFound;
2505
2506 id.vt = VT_UI2;
2507 id.uiVal = propid;
2508 hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
2509 if (FAILED(hr)) return PropertyNotFound;
2510
2512 if (*size) *size += sizeof(PropertyItem);
2514
2515 return Ok;
2516}

Referenced by Anime_LoadInfo(), check_properties_id_list(), and test_image_properties().

◆ GdipGetPropertySize()

GpStatus WINGDIPAPI GdipGetPropertySize ( GpImage image,
UINT size,
UINT count 
)

Definition at line 2670 of file image.c.

2671{
2672 HRESULT hr;
2674 IWICEnumMetadataItem *enumerator;
2675 UINT prop_count, prop_size, i;
2676 PROPVARIANT id, value;
2677
2678 TRACE("(%p,%p,%p)\n", image, size, count);
2679
2680 if (!image || !size || !count) return InvalidParameter;
2681
2682 if (image->type != ImageTypeBitmap)
2683 {
2684 FIXME("Not implemented for type %d\n", image->type);
2685 return NotImplemented;
2686 }
2687
2688 if (((GpBitmap *)image)->prop_item)
2689 {
2690 *count = ((GpBitmap *)image)->prop_count;
2691 *size = 0;
2692
2693 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2694 {
2695 *size += sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length;
2696 }
2697
2698 return Ok;
2699 }
2700
2701 reader = ((GpBitmap *)image)->metadata_reader;
2702 if (!reader)
2703 {
2704 *count = 0;
2705 *size = 0;
2706 return Ok;
2707 }
2708
2709 hr = IWICMetadataReader_GetCount(reader, &prop_count);
2710 if (FAILED(hr)) return hresult_to_status(hr);
2711
2712 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2713 if (FAILED(hr)) return hresult_to_status(hr);
2714
2715 IWICEnumMetadataItem_Reset(enumerator);
2716
2717 prop_size = 0;
2718
2719 PropVariantInit(&id);
2720 PropVariantInit(&value);
2721
2722 for (i = 0; i < prop_count; i++)
2723 {
2724 ULONG items_returned;
2725 UINT item_size;
2726
2727 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, &value, &items_returned);
2728 if (hr != S_OK) break;
2729
2730 item_size = propvariant_size(&value);
2731 if (item_size) prop_size += sizeof(PropertyItem) + item_size;
2732
2733 PropVariantClear(&id);
2735 }
2736
2737 IWICEnumMetadataItem_Release(enumerator);
2738
2739 if (hr != S_OK) return PropertyNotFound;
2740
2741 *count = prop_count;
2742 *size = prop_size;
2743 return Ok;
2744}

Referenced by add_property(), check_properties_get_all(), GdipGetAllPropertyItems(), and test_image_properties().

◆ GdipGetRegionBounds()

GpStatus WINGDIPAPI GdipGetRegionBounds ( GpRegion region,
GpGraphics graphics,
GpRectF rect 
)

Definition at line 583 of file region.c.

584{
585 REAL min_x, min_y, max_x, max_y;
586 BOOL empty, infinite;
587
588 TRACE("(%p, %p, %p)\n", region, graphics, rect);
589
590 if(!region || !graphics || !rect)
591 return InvalidParameter;
592
593 /* Contrary to MSDN, native ignores the graphics transform. */
594 get_region_bounding_box(&region->node, &min_x, &min_y, &max_x, &max_y, &empty, &infinite);
595
596 /* infinite */
597 if(infinite){
598 rect->X = rect->Y = -(REAL)(1 << 22);
599 rect->Width = rect->Height = (REAL)(1 << 23);
600 TRACE("%p => infinite\n", region);
601 return Ok;
602 }
603
604 if(empty){
605 rect->X = rect->Y = rect->Width = rect->Height = 0.0;
606 TRACE("%p => empty\n", region);
607 return Ok;
608 }
609
610 rect->X = min_x;
611 rect->Y = min_y;
612 rect->Width = max_x - min_x;
613 rect->Height = max_y - min_y;
614 TRACE("%p => %s\n", region, debugstr_rectf(rect));
615
616 return Ok;
617}
static const WCHAR empty[1]
Definition: string.c:47
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)
Definition: region.c:1330

Referenced by GdipGetClipBounds(), GdipGetRegionBoundsI(), GdipGetVisibleClipBounds(), GdipIsEmptyRegion(), test_clipping(), test_font_height_scaling(), test_getbounds(), and test_measure_string().

◆ GdipGetRegionBoundsI()

GpStatus WINGDIPAPI GdipGetRegionBoundsI ( GpRegion region,
GpGraphics graphics,
GpRect rect 
)

Definition at line 622 of file region.c.

623{
624 GpRectF rectf;
626
627 TRACE("(%p, %p, %p)\n", region, graphics, rect);
628
629 if(!rect)
630 return InvalidParameter;
631
632 status = GdipGetRegionBounds(region, graphics, &rectf);
633 if(status == Ok){
634 rect->X = gdip_round(rectf.X);
635 rect->Y = gdip_round(rectf.Y);
636 rect->Width = gdip_round(rectf.Width);
637 rect->Height = gdip_round(rectf.Height);
638 }
639
640 return status;
641}

◆ GdipGetRegionData()

GpStatus WINGDIPAPI GdipGetRegionData ( GpRegion region,
BYTE buffer,
UINT  size,
UINT needed 
)

Definition at line 740 of file region.c.

742{
744 UINT required;
745
746 TRACE("%p, %p, %d, %p\n", region, buffer, size, needed);
747
748 if (!region || !buffer || !size)
749 return InvalidParameter;
750
751 required = FIELD_OFFSET(struct region_data_header, header) + write_region_data(region, NULL);
752 if (size < required)
753 {
754 if (needed) *needed = size;
755 return InsufficientBuffer;
756 }
757
761
762 if (needed)
763 *needed = required;
764
765 return Ok;
766}
DWORD write_region_data(const GpRegion *region, void *data)
Definition: region.c:689
DWORD checksum
Definition: region.c:89

Referenced by get_region_type(), test_clip_xform(), test_combinereplace(), test_fromhrgn(), test_GdipCreateRegionRgnData(), test_getregiondata(), and test_region_data().

◆ GdipGetRegionDataSize()

GpStatus WINGDIPAPI GdipGetRegionDataSize ( GpRegion region,
UINT needed 
)

Definition at line 978 of file region.c.

979{
980 TRACE("%p, %p\n", region, needed);
981
982 if (!(region && needed))
983 return InvalidParameter;
984
985 /* header.size doesn't count header.size and header.checksum */
986 *needed = FIELD_OFFSET(struct region_data_header, header) + write_region_data(region, NULL);
987
988 return Ok;
989}

Referenced by get_region_type(), test_combinereplace(), test_fromhrgn(), test_getregiondata(), and test_region_data().

◆ GdipGetRegionHRgn()

GpStatus WINGDIPAPI GdipGetRegionHRgn ( GpRegion region,
GpGraphics graphics,
HRGN *  hrgn 
)

Definition at line 1201 of file region.c.

1202{
1203 TRACE("(%p, %p, %p)\n", region, graphics, hrgn);
1204
1205 if (!region || !hrgn)
1206 return InvalidParameter;
1207
1208 return get_region_hrgn(&region->node, graphics, hrgn);
1209}
static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *graphics, HRGN *hrgn)
Definition: region.c:1062

Referenced by GDI32_GdipFillRegion(), GdipIsEqualRegion(), GdipIsVisiblePathPoint(), GdipIsVisibleRegionPoint(), GdipIsVisibleRegionRect(), get_clip_hrgn(), get_region_scans_data(), SOFTWARE_GdipDrawThinPath(), SOFTWARE_GdipFillRegion(), test_clipping(), test_clipping_2(), and test_gethrgn().

◆ GdipGetRegionScans()

GpStatus WINGDIPAPI GdipGetRegionScans ( GpRegion region,
GpRectF scans,
INT count,
GpMatrix matrix 
)

Definition at line 1878 of file region.c.

1879{
1880 GpStatus stat;
1881 DWORD i;
1883 RECT *rects;
1884
1885 if (!region || !count || !matrix)
1886 return InvalidParameter;
1887
1889
1890 if (stat == Ok)
1891 {
1892 *count = data->rdh.nCount;
1893 rects = (RECT*)data->Buffer;
1894
1895 if (scans)
1896 {
1897 for (i=0; i<data->rdh.nCount; i++)
1898 {
1899 scans[i].X = rects[i].left;
1900 scans[i].Y = rects[i].top;
1901 scans[i].Width = rects[i].right - rects[i].left;
1902 scans[i].Height = rects[i].bottom - rects[i].top;
1903 }
1904 }
1905
1906 free(data);
1907 }
1908
1909 return Ok;
1910}
static GpStatus get_region_scans_data(GpRegion *region, GpMatrix *matrix, LPRGNDATA *data)
Definition: region.c:1764

Referenced by test_excludeinfinite(), and test_scans().

◆ GdipGetRegionScansCount()

GpStatus WINGDIPAPI GdipGetRegionScansCount ( GpRegion region,
UINT count,
GpMatrix matrix 
)

Definition at line 1823 of file region.c.

1824{
1825 GpStatus stat;
1827
1828 TRACE("(%p, %p, %s)\n", region, count, debugstr_matrix(matrix));
1829
1830 if (!region || !count || !matrix)
1831 return InvalidParameter;
1832
1834
1835 if (stat == Ok)
1836 {
1837 *count = data->rdh.nCount;
1838 free(data);
1839 }
1840
1841 return stat;
1842}

Referenced by test_excludeinfinite(), and test_scans().

◆ GdipGetRegionScansI()

GpStatus WINGDIPAPI GdipGetRegionScansI ( GpRegion region,
GpRect scans,
INT count,
GpMatrix matrix 
)

Definition at line 1844 of file region.c.

1845{
1846 GpStatus stat;
1847 DWORD i;
1849 RECT *rects;
1850
1851 if (!region || !count || !matrix)
1852 return InvalidParameter;
1853
1855
1856 if (stat == Ok)
1857 {
1858 *count = data->rdh.nCount;
1859 rects = (RECT*)data->Buffer;
1860
1861 if (scans)
1862 {
1863 for (i=0; i<data->rdh.nCount; i++)
1864 {
1865 scans[i].X = rects[i].left;
1866 scans[i].Y = rects[i].top;
1867 scans[i].Width = rects[i].right - rects[i].left;
1868 scans[i].Height = rects[i].bottom - rects[i].top;
1869 }
1870 }
1871
1872 free(data);
1873 }
1874
1875 return Ok;
1876}

Referenced by test_scans().

◆ GdipGetRenderingOrigin()

GpStatus WINGDIPAPI GdipGetRenderingOrigin ( GpGraphics graphics,
INT x,
INT y 
)

Definition at line 6641 of file graphics.c.

6642{
6643 TRACE("(%p,%p,%p)\n", graphics, x, y);
6644
6645 if (!graphics || !x || !y)
6646 return InvalidParameter;
6647
6648 *x = graphics->origin_x;
6649 *y = graphics->origin_y;
6650
6651 return Ok;
6652}

Referenced by test_renderingOrigin().

◆ GdipGetSmoothingMode()

GpStatus WINGDIPAPI GdipGetSmoothingMode ( GpGraphics graphics,
SmoothingMode mode 
)

Definition at line 5113 of file graphics.c.

5114{
5115 TRACE("(%p, %p)\n", graphics, mode);
5116
5117 if(!graphics || !mode)
5118 return InvalidParameter;
5119
5120 if(graphics->busy)
5121 return ObjectBusy;
5122
5123 *mode = graphics->smoothing;
5124
5125 return Ok;
5126}
SmoothingMode smoothing

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetSolidFillColor()

GpStatus WINGDIPAPI GdipGetSolidFillColor ( GpSolidFill sf,
ARGB argb 
)

Definition at line 1299 of file brush.c.

1300{
1301 TRACE("(%p, %p)\n", sf, argb);
1302
1303 if(!sf || !argb)
1304 return InvalidParameter;
1305
1306 *argb = sf->color;
1307
1308 return Ok;
1309}

Referenced by GdipGetPenColor(), and test_brushfill().

◆ GdipGetStringFormatAlign()

GpStatus WINGDIPAPI GdipGetStringFormatAlign ( GpStringFormat format,
StringAlignment align 
)

Definition at line 130 of file stringformat.c.

132{
133 if(!format || !align)
134 return InvalidParameter;
135
136 *align = format->align;
137
138 return Ok;
139}
int align(int length, int align)
Definition: dsound8.c:36

Referenced by test_constructor(), test_getgenericdefault(), and test_getgenerictypographic().

◆ GdipGetStringFormatDigitSubstitution()

GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution ( GDIPCONST GpStringFormat format,
LANGID language,
StringDigitSubstitute substitute 
)

Definition at line 141 of file stringformat.c.

143{
144 if(!format)
145 return InvalidParameter;
146
147 if(language) *language = format->digitlang;
148 if(substitute) *substitute = format->digitsub;
149
150 return Ok;
151}

Referenced by test_constructor(), test_digitsubstitution(), test_getgenericdefault(), and test_getgenerictypographic().

◆ GdipGetStringFormatFlags()

GpStatus WINGDIPAPI GdipGetStringFormatFlags ( GDIPCONST GpStringFormat format,
INT flags 
)

Definition at line 153 of file stringformat.c.

155{
156 if (!(format && flags))
157 return InvalidParameter;
158
159 *flags = format->attr;
160
161 return Ok;
162}

Referenced by test_getgenericdefault(), test_getgenerictypographic(), and test_stringformatflags().

◆ GdipGetStringFormatHotkeyPrefix()

GpStatus WINGDIPAPI GdipGetStringFormatHotkeyPrefix ( GDIPCONST GpStringFormat format,
INT hkpx 
)

Definition at line 164 of file stringformat.c.

166{
167 if(!format || !hkpx)
168 return InvalidParameter;
169
170 *hkpx = (INT)format->hkprefix;
171
172 return Ok;
173}
#define INT
Definition: polytest.cpp:20

Referenced by test_constructor(), test_getgenericdefault(), and test_getgenerictypographic().

◆ GdipGetStringFormatLineAlign()

GpStatus WINGDIPAPI GdipGetStringFormatLineAlign ( GpStringFormat format,
StringAlignment align 
)

Definition at line 175 of file stringformat.c.

177{
178 if(!format || !align)
179 return InvalidParameter;
180
181 *align = format->line_align;
182
183 return Ok;
184}

Referenced by test_constructor(), test_getgenericdefault(), and test_getgenerictypographic().

◆ GdipGetStringFormatMeasurableCharacterRangeCount()

GpStatus WINGDIPAPI GdipGetStringFormatMeasurableCharacterRangeCount ( GDIPCONST GpStringFormat format,
INT count 
)

Definition at line 186 of file stringformat.c.

188{
189 if (!(format && count))
190 return InvalidParameter;
191
192 TRACE("%p %p\n", format, count);
193
194 *count = format->range_count;
195
196 return Ok;
197}

Referenced by test_characterrange(), and test_constructor().

◆ GdipGetStringFormatTabStopCount()

GpStatus WINGDIPAPI GdipGetStringFormatTabStopCount ( GDIPCONST GpStringFormat format,
INT count 
)

Definition at line 199 of file stringformat.c.

201{
202 if(!format || !count)
203 return InvalidParameter;
204
205 *count = format->tabcount;
206
207 return Ok;
208}

Referenced by test_getgenericdefault(), test_getgenerictypographic(), and test_tabstops().

◆ GdipGetStringFormatTabStops()

GpStatus WINGDIPAPI GdipGetStringFormatTabStops ( GDIPCONST GpStringFormat format,
INT  count,
REAL firsttab,
REAL tabs 
)

Definition at line 210 of file stringformat.c.

212{
213 if(!format || !firsttab || !tabs)
214 return InvalidParameter;
215
216 /* native simply crashes on count < 0 */
217 if(count != 0)
218 memcpy(tabs, format->tabs, sizeof(REAL)*count);
219
220 *firsttab = format->firsttab;
221
222 return Ok;
223}

Referenced by test_tabstops().

◆ GdipGetStringFormatTrimming()

GpStatus WINGDIPAPI GdipGetStringFormatTrimming ( GpStringFormat format,
StringTrimming trimming 
)

Definition at line 225 of file stringformat.c.

227{
228 if(!format || !trimming)
229 return InvalidParameter;
230
231 *trimming = format->trimming;
232
233 return Ok;
234}

Referenced by test_constructor(), test_getgenericdefault(), and test_getgenerictypographic().

◆ GdipGetTextContrast()

GpStatus WINGDIPAPI GdipGetTextContrast ( GpGraphics graphics,
UINT contrast 
)

Definition at line 5128 of file graphics.c.

5129{
5130 TRACE("(%p, %p)\n", graphics, contrast);
5131
5132 if(!graphics || !contrast)
5133 return InvalidParameter;
5134
5135 *contrast = graphics->textcontrast;
5136
5137 return Ok;
5138}

Referenced by test_BeginContainer2(), and test_textcontrast().

◆ GdipGetTextRenderingHint()

GpStatus WINGDIPAPI GdipGetTextRenderingHint ( GpGraphics graphics,
TextRenderingHint hint 
)

Definition at line 5141 of file graphics.c.

5143{
5144 TRACE("(%p, %p)\n", graphics, hint);
5145
5146 if(!graphics || !hint)
5147 return InvalidParameter;
5148
5149 if(graphics->busy)
5150 return ObjectBusy;
5151
5152 *hint = graphics->texthint;
5153
5154 return Ok;
5155}
TextRenderingHint texthint
DWORD hint
Definition: vfdcmd.c:88

Referenced by test_BeginContainer2(), test_Get_Release_DC(), and test_get_set_textrenderinghint().

◆ GdipGetTextureImage()

GpStatus WINGDIPAPI GdipGetTextureImage ( GpTexture brush,
GpImage **  image 
)

Definition at line 1314 of file brush.c.

1315{
1316 TRACE("(%p, %p)\n", brush, image);
1317
1318 if(!brush || !image)
1319 return InvalidParameter;
1320
1321 return GdipCloneImage(brush->image, image);
1322}
GpImage * image

◆ GdipGetTextureTransform()

GpStatus WINGDIPAPI GdipGetTextureTransform ( GpTexture brush,
GpMatrix matrix 
)

Definition at line 1327 of file brush.c.

1328{
1329 TRACE("(%p, %s)\n", brush, debugstr_matrix(matrix));
1330
1331 if(!brush || !matrix)
1332 return InvalidParameter;
1333
1334 *matrix = brush->transform;
1335
1336 return Ok;
1337}

Referenced by test_transform().

◆ GdipGetTextureWrapMode()

GpStatus WINGDIPAPI GdipGetTextureWrapMode ( GpTexture brush,
GpWrapMode wrapmode 
)

Definition at line 1342 of file brush.c.

1343{
1344 TRACE("(%p, %p)\n", brush, wrapmode);
1345
1346 if(!brush || !wrapmode)
1347 return InvalidParameter;
1348
1349 *wrapmode = brush->imageattributes->wrap;
1350
1351 return Ok;
1352}
GpImageAttributes * imageattributes

Referenced by test_texturewrap().

◆ GdipGetVisibleClipBounds()

GpStatus WINGDIPAPI GdipGetVisibleClipBounds ( GpGraphics graphics,
GpRectF rect 
)

Definition at line 5157 of file graphics.c.

5158{
5159 GpRegion *clip_rgn;
5160 GpStatus stat;
5161 GpMatrix device_to_world;
5162
5163 TRACE("(%p, %p)\n", graphics, rect);
5164
5165 if(!graphics || !rect)
5166 return InvalidParameter;
5167
5168 if(graphics->busy)
5169 return ObjectBusy;
5170
5171 /* intersect window and graphics clipping regions */
5172 if((stat = GdipCreateRegion(&clip_rgn)) != Ok)
5173 return stat;
5174
5175 if((stat = get_visible_clip_region(graphics, clip_rgn)) != Ok)
5176 goto cleanup;
5177
5178 /* transform to world coordinates */
5179 if((stat = get_graphics_transform(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, &device_to_world)) != Ok)
5180 goto cleanup;
5181
5182 if((stat = GdipTransformRegion(clip_rgn, &device_to_world)) != Ok)
5183 goto cleanup;
5184
5185 /* get bounds of the region */
5186 stat = GdipGetRegionBounds(clip_rgn, graphics, rect);
5187
5188cleanup:
5189 GdipDeleteRegion(clip_rgn);
5190
5191 return stat;
5192}
static GpStatus get_visible_clip_region(GpGraphics *graphics, GpRegion *rgn)
Definition: graphics.c:2324
static void cleanup(void)
Definition: main.c:1335

Referenced by GdipGetVisibleClipBoundsI(), GdipGraphicsClear(), test_alpha_hdc(), test_cliphrgn_transform(), test_clipping(), test_GdipGetVisibleClipBounds(), test_GdipGetVisibleClipBounds_screen(), and test_GdipGetVisibleClipBounds_window().

◆ GdipGetVisibleClipBoundsI()

GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI ( GpGraphics graphics,
GpRect rect 
)

Definition at line 5194 of file graphics.c.

5195{
5196 GpRectF rectf;
5197 GpStatus stat;
5198
5199 TRACE("(%p, %p)\n", graphics, rect);
5200
5201 if(!graphics || !rect)
5202 return InvalidParameter;
5203
5204 if((stat = GdipGetVisibleClipBounds(graphics, &rectf)) == Ok)
5205 {
5206 rect->X = gdip_round(rectf.X);
5207 rect->Y = gdip_round(rectf.Y);
5208 rect->Width = gdip_round(rectf.Width);
5209 rect->Height = gdip_round(rectf.Height);
5210 }
5211
5212 return stat;
5213}
GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:5157

Referenced by test_GdipGetVisibleClipBounds(), test_GdipGetVisibleClipBounds_memoryDC(), test_GdipGetVisibleClipBounds_screen(), and test_GdipGetVisibleClipBounds_window().

◆ GdipGetWorldTransform()

GpStatus WINGDIPAPI GdipGetWorldTransform ( GpGraphics graphics,
GpMatrix matrix 
)

Definition at line 5215 of file graphics.c.

5216{
5217 TRACE("(%p, %s)\n", graphics, debugstr_matrix(matrix));
5218
5219 if(!graphics || !matrix)
5220 return InvalidParameter;
5221
5222 if(graphics->busy)
5223 return ObjectBusy;
5224
5225 *matrix = graphics->worldtrans;
5226 return Ok;
5227}

Referenced by test_BeginContainer2(), test_Get_Release_DC(), and test_worldtransform().

◆ GdipGraphicsClear()

GpStatus WINGDIPAPI GdipGraphicsClear ( GpGraphics graphics,
ARGB  color 
)

Definition at line 5229 of file graphics.c.

5230{
5231 GpSolidFill *brush;
5232 GpStatus stat;
5233 GpRectF wnd_rect;
5234 CompositingMode prev_comp_mode;
5235
5236 TRACE("(%p, %lx)\n", graphics, color);
5237
5238 if(!graphics)
5239 return InvalidParameter;
5240
5241 if(graphics->busy)
5242 return ObjectBusy;
5243
5244 if (is_metafile_graphics(graphics))
5245 return METAFILE_GraphicsClear((GpMetafile*)graphics->image, color);
5246
5247 if((stat = GdipCreateSolidFill(color, &brush)) != Ok)
5248 return stat;
5249
5250 if((stat = GdipGetVisibleClipBounds(graphics, &wnd_rect)) != Ok){
5251 GdipDeleteBrush((GpBrush*)brush);
5252 return stat;
5253 }
5254
5255 GdipGetCompositingMode(graphics, &prev_comp_mode);
5257 GdipFillRectangle(graphics, (GpBrush*)brush, wnd_rect.X, wnd_rect.Y,
5258 wnd_rect.Width, wnd_rect.Height);
5259 GdipSetCompositingMode(graphics, prev_comp_mode);
5260
5261 GdipDeleteBrush((GpBrush*)brush);
5262
5263 return Ok;
5264}
GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics, CompositingMode mode)
Definition: graphics.c:6440
GpStatus WINGDIPAPI GdipGetCompositingMode(GpGraphics *graphics, CompositingMode *mode)
Definition: graphics.c:4993
GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4682
GpStatus METAFILE_GraphicsClear(GpMetafile *metafile, ARGB color)
Definition: metafile.c:960
CompositingMode
Definition: gdiplusenums.h:246
@ CompositingModeSourceCopy
Definition: gdiplusenums.h:248

Referenced by GdipPlayMetafileRecord(), test_alpha_hdc(), test_clear(), test_clip_xform(), test_fromMemoryBitmap(), test_GdipDrawString(), test_Get_Release_DC(), test_graphics_clear(), and test_pen_thickness().

◆ GdipGraphicsSetAbort()

GpStatus WINGDIPAPI GdipGraphicsSetAbort ( GpGraphics graphics,
GdiplusAbort pabort 
)

Definition at line 7965 of file graphics.c.

7966{
7967 TRACE("(%p, %p)\n", graphics, pabort);
7968
7969 if (!graphics)
7970 return InvalidParameter;
7971
7972 if (pabort)
7973 FIXME("Abort callback is not supported.\n");
7974
7975 return Ok;
7976}

◆ GdipImageForceValidation()

GpStatus WINGDIPAPI GdipImageForceValidation ( GpImage image)

Definition at line 5705 of file image.c.

5706{
5707 TRACE("%p\n", image);
5708
5709 return Ok;
5710}

◆ GdipImageGetFrameCount()

GpStatus WINGDIPAPI GdipImageGetFrameCount ( GpImage image,
GDIPCONST GUID dimensionID,
UINT count 
)

Definition at line 2855 of file image.c.

2857{
2858 TRACE("(%p,%s,%p)\n", image, debugstr_guid(dimensionID), count);
2859
2860 if(!image || !count)
2861 return InvalidParameter;
2862
2863 if (!dimensionID ||
2864 IsEqualGUID(dimensionID, &image->format) ||
2865 IsEqualGUID(dimensionID, &FrameDimensionPage) ||
2866 IsEqualGUID(dimensionID, &FrameDimensionTime))
2867 {
2868 *count = image->frame_count;
2869 return Ok;
2870 }
2871
2872 return InvalidParameter;
2873}
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

Referenced by Anime_LoadInfo(), test_GdipGetAllPropertyItems(), test_GdipImageGetFrameDimensionsCount(), test_gif_properties(), test_multiframegif(), test_SavingMultiPageTiff(), and test_tiff_properties().

◆ GdipImageGetFrameDimensionsCount()

GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount ( GpImage image,
UINT count 
)

Definition at line 2875 of file image.c.

2877{
2878 TRACE("(%p, %p)\n", image, count);
2879
2880 /* Native gdiplus 1.1 does not yet support multiple frame dimensions. */
2881
2882 if(!image || !count)
2883 return InvalidParameter;
2884
2885 *count = 1;
2886
2887 return Ok;
2888}

Referenced by Anime_LoadInfo(), test_GdipGetAllPropertyItems(), test_GdipImageGetFrameDimensionsCount(), test_gif_properties(), test_multiframegif(), and test_tiff_properties().

◆ GdipImageGetFrameDimensionsList()

GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList ( GpImage image,
GUID dimensionIDs,
UINT  count 
)

Definition at line 2890 of file image.c.

2892{
2893 int i;
2894 const GUID *result=NULL;
2895
2896 TRACE("(%p,%p,%u)\n", image, dimensionIDs, count);
2897
2898 if(!image || !dimensionIDs || count != 1)
2899 return InvalidParameter;
2900
2901 for (i=0; image_format_dimensions[i].format; i++)
2902 {
2903 if (IsEqualGUID(&image->format, image_format_dimensions[i].format))
2904 {
2905 result = image_format_dimensions[i].dimension;
2906 break;
2907 }
2908 }
2909
2910 if (!result)
2911 result = &FrameDimensionPage;
2912
2913 memcpy(dimensionIDs, result, sizeof(GUID));
2914
2915 return Ok;
2916}
static const struct image_format_dimension image_format_dimensions[]
Definition: image.c:2848

Referenced by Anime_LoadInfo(), test_GdipGetAllPropertyItems(), test_GdipImageGetFrameDimensionsCount(), test_gif_properties(), test_multiframegif(), and test_tiff_properties().

◆ GdipImageRotateFlip()

GpStatus WINGDIPAPI GdipImageRotateFlip ( GpImage image,
RotateFlipType  type 
)

Definition at line 5764 of file image.c.

5765{
5766 GpBitmap *new_bitmap;
5768 int bpp, bytesperpixel;
5769 BOOL rotate_90, flip_x, flip_y;
5770 int src_x_offset, src_y_offset;
5771 LPBYTE src_origin;
5772 UINT x, y, width, height;
5773 BitmapData dst_lock;
5774 GpStatus stat;
5775
5776 TRACE("(%p, %u)\n", image, type);
5777
5778 if (!image)
5779 return InvalidParameter;
5780 if (!image_lock(image))
5781 return ObjectBusy;
5782
5783 rotate_90 = type&1;
5784 flip_x = (type&6) == 2 || (type&6) == 4;
5785 flip_y = (type&3) == 1 || (type&3) == 2;
5786
5787 if (image->type != ImageTypeBitmap)
5788 {
5789 FIXME("Not implemented for type %i\n", image->type);
5791 return NotImplemented;
5792 }
5793
5794 bitmap = (GpBitmap*)image;
5795 bpp = PIXELFORMATBPP(bitmap->format);
5796
5797 if (bpp < 8)
5798 {
5799 FIXME("Not implemented for %i bit images\n", bpp);
5801 return NotImplemented;
5802 }
5803
5804 if (rotate_90)
5805 {
5806 width = bitmap->height;
5807 height = bitmap->width;
5808 }
5809 else
5810 {
5811 width = bitmap->width;
5812 height = bitmap->height;
5813 }
5814
5815 bytesperpixel = bpp/8;
5816
5817 stat = GdipCreateBitmapFromScan0(width, height, 0, bitmap->format, NULL, &new_bitmap);
5818
5819 if (stat == Ok)
5820 {
5821 stat = GdipBitmapLockBits(new_bitmap, NULL, ImageLockModeWrite, bitmap->format, &dst_lock);
5822
5823 if (stat == Ok)
5824 {
5825 LPBYTE src_row, src_pixel;
5826 LPBYTE dst_row, dst_pixel;
5827
5828 src_origin = bitmap->bits;
5829 if (flip_x) src_origin += bytesperpixel * (bitmap->width - 1);
5830 if (flip_y) src_origin += bitmap->stride * (bitmap->height - 1);
5831
5832 if (rotate_90)
5833 {
5834 if (flip_y) src_x_offset = -bitmap->stride;
5835 else src_x_offset = bitmap->stride;
5836 if (flip_x) src_y_offset = -bytesperpixel;
5837 else src_y_offset = bytesperpixel;
5838 }
5839 else
5840 {
5841 if (flip_x) src_x_offset = -bytesperpixel;
5842 else src_x_offset = bytesperpixel;
5843 if (flip_y) src_y_offset = -bitmap->stride;
5844 else src_y_offset = bitmap->stride;
5845 }
5846
5847 src_row = src_origin;
5848 dst_row = dst_lock.Scan0;
5849 for (y=0; y<height; y++)
5850 {
5851 src_pixel = src_row;
5852 dst_pixel = dst_row;
5853 for (x=0; x<width; x++)
5854 {
5855 /* FIXME: This could probably be faster without memcpy. */
5856 memcpy(dst_pixel, src_pixel, bytesperpixel);
5857 dst_pixel += bytesperpixel;
5858 src_pixel += src_x_offset;
5859 }
5860 src_row += src_y_offset;
5861 dst_row += dst_lock.Stride;
5862 }
5863
5864 GdipBitmapUnlockBits(new_bitmap, &dst_lock);
5865 move_bitmap(bitmap, new_bitmap, FALSE);
5866 }
5867 else GdipDisposeImage(&new_bitmap->image);
5868 }
5869
5871 return stat;
5872}
DWORD bpp
Definition: surface.c:185
static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette)
Definition: image.c:2028

Referenced by Preview_OnCommand(), test_multiframegif(), and test_rotateflip().

◆ GdipImageSelectActiveFrame()

GpStatus WINGDIPAPI GdipImageSelectActiveFrame ( GpImage image,
GDIPCONST GUID dimensionID,
UINT  frame 
)

Definition at line 4474 of file image.c.

4476{
4477 GpStatus stat;
4478 const struct image_codec *codec = NULL;
4479
4480 TRACE("(%p,%s,%u)\n", image, debugstr_guid(dimensionID), frame);
4481
4482 if (!image || !dimensionID)
4483 return InvalidParameter;
4484 if(!image_lock(image))
4485 return ObjectBusy;
4486
4487 if (frame >= image->frame_count)
4488 WARN("requested frame %u, but image has only %u\n", frame, image->frame_count);
4489 /* rely on codec->select_func() to fail */
4490
4491 if (image->type != ImageTypeBitmap && image->type != ImageTypeMetafile)
4492 {
4493 WARN("invalid image type %d\n", image->type);
4495 return InvalidParameter;
4496 }
4497
4498 if (image->current_frame == frame)
4499 {
4501 return Ok;
4502 }
4503
4504 if (!image->decoder)
4505 {
4506 TRACE("image doesn't have an associated decoder\n");
4508 return Ok;
4509 }
4510
4511 /* choose an appropriate image decoder */
4513 if (stat != Ok)
4514 {
4515 WARN("can't find decoder info\n");
4517 return stat;
4518 }
4519
4520 stat = codec->select_func(image, frame);
4522 return stat;
4523}
static GpStatus get_decoder_info_from_image(GpImage *image, const struct image_codec **result)
Definition: image.c:4457
select_image_func select_func
Definition: image.c:4392

Referenced by Anime_SetFrameIndex(), test_GdipImageGetFrameDimensionsCount(), test_gif_properties(), test_multiframegif(), and test_SavingMultiPageTiff().

◆ GdipImageSetAbort()

GpStatus WINGDIPAPI GdipImageSetAbort ( GpImage image,
GdiplusAbort pabort 
)

Definition at line 5877 of file image.c.

5878{
5879 TRACE("(%p, %p)\n", image, pabort);
5880
5881 if (!image)
5882 return InvalidParameter;
5883
5884 if (pabort)
5885 FIXME("Abort callback is not supported.\n");
5886
5887 return Ok;
5888}

◆ GdipInitializePalette()

GpStatus WINGDIPAPI GdipInitializePalette ( ColorPalette palette,
PaletteType  type,
INT  desired,
BOOL  transparent,
GpBitmap bitmap 
)

Definition at line 6092 of file image.c.

6094{
6095 TRACE("(%p,%d,%d,%d,%p)\n", palette, type, desired, transparent, bitmap);
6096
6097 if (!palette) return InvalidParameter;
6098
6099 switch (type)
6100 {
6101 case PaletteTypeCustom:
6102 return Ok;
6103
6104 case PaletteTypeOptimal:
6105 return create_optimal_palette(palette, desired, transparent, bitmap);
6106
6107 /* WIC palette type enumeration matches these gdiplus enums */
6108 case PaletteTypeFixedBW:
6116 {
6117 ColorPalette *wic_palette;
6118 GpStatus status = Ok;
6119
6120 wic_palette = get_palette(NULL, (WICBitmapPaletteType)type);
6121 if (!wic_palette) return OutOfMemory;
6122
6123 if (palette->Count >= wic_palette->Count)
6124 {
6125 palette->Flags = wic_palette->Flags;
6126 palette->Count = wic_palette->Count;
6127 memcpy(palette->Entries, wic_palette->Entries, wic_palette->Count * sizeof(wic_palette->Entries[0]));
6128 }
6129 else
6131
6132 free(wic_palette);
6133
6134 return status;
6135 }
6136
6137 default:
6138 FIXME("unknown palette type %d\n", type);
6139 break;
6140 }
6141
6142 return InvalidParameter;
6143}
static GpStatus create_optimal_palette(ColorPalette *palette, INT desired, BOOL transparent, GpBitmap *bitmap)
Definition: image.c:6037
static ColorPalette * get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteType palette_type)
Definition: image.c:66
@ PaletteTypeOptimal
@ PaletteTypeCustom
@ PaletteTypeFixedHalftone27
@ PaletteTypeFixedHalftone125
@ PaletteTypeFixedHalftone64
@ PaletteTypeFixedHalftone256
@ PaletteTypeFixedHalftone8
@ PaletteTypeFixedHalftone252
@ PaletteTypeFixedHalftone216
@ PaletteTypeFixedBW
int desired
Definition: jpeglib.h:1121
WICBitmapPaletteType
Definition: wincodec.idl:91

◆ GdipInvertMatrix()

GpStatus WINGDIPAPI GdipInvertMatrix ( GpMatrix matrix)

Definition at line 181 of file matrix.c.

182{
184 REAL det;
185
186 TRACE("(%s)\n", debugstr_matrix(matrix));
187
188 if(!matrix)
189 return InvalidParameter;
190
191 /* optimize inverting simple scaling and translation matrices */
192 if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
193 {
194 if (matrix->matrix[0] != 0 && matrix->matrix[3] != 0)
195 {
196 matrix->matrix[4] = -matrix->matrix[4] / matrix->matrix[0];
197 matrix->matrix[5] = -matrix->matrix[5] / matrix->matrix[3];
198 matrix->matrix[0] = 1 / matrix->matrix[0];
199 matrix->matrix[3] = 1 / matrix->matrix[3];
200
201 return Ok;
202 }
203 else
204 return InvalidParameter;
205 }
206 det = matrix_det(matrix);
207 if (!(fabs(det) >= 1e-5))
208 return InvalidParameter;
209
210 det = 1 / det;
211
212 copy = *matrix;
213 /* store result */
214 matrix->matrix[0] = copy.matrix[3] * det;
215 matrix->matrix[1] = -copy.matrix[1] * det;
216 matrix->matrix[2] = -copy.matrix[2] * det;
217 matrix->matrix[3] = copy.matrix[0] * det;
218 matrix->matrix[4] = (copy.matrix[2]*copy.matrix[5]-copy.matrix[3]*copy.matrix[4]) * det;
219 matrix->matrix[5] = -(copy.matrix[0]*copy.matrix[5]-copy.matrix[1]*copy.matrix[4]) * det;
220
221 return Ok;
222}
static REAL matrix_det(GDIPCONST GpMatrix *matrix)
Definition: matrix.c:54

Referenced by brush_fill_pixels(), GdipDrawImagePointsRect(), get_graphics_transform(), SOFTWARE_GdipDrawPath(), and test_invert().

◆ GdipIsClipEmpty()

GpStatus WINGDIPAPI GdipIsClipEmpty ( GpGraphics graphics,
BOOL res 
)

Definition at line 5266 of file graphics.c.

5267{
5268 TRACE("(%p, %p)\n", graphics, res);
5269
5270 if(!graphics || !res)
5271 return InvalidParameter;
5272
5273 return GdipIsEmptyRegion(graphics->clip, graphics, res);
5274}
GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
Definition: region.c:1211

Referenced by test_isempty().

◆ GdipIsEmptyRegion()

GpStatus WINGDIPAPI GdipIsEmptyRegion ( GpRegion region,
GpGraphics graphics,
BOOL res 
)

Definition at line 1211 of file region.c.

1212{
1214 GpRectF rect;
1215
1216 TRACE("(%p, %p, %p)\n", region, graphics, res);
1217
1218 if(!region || !graphics || !res)
1219 return InvalidParameter;
1220
1221 status = GdipGetRegionBounds(region, graphics, &rect);
1222 if (status != Ok) return status;
1223
1224 *res = rect.Width == 0.0 && rect.Height == 0.0;
1225 TRACE("=> %d\n", *res);
1226
1227 return Ok;
1228}

Referenced by GdipIsClipEmpty(), GdipIsVisibleClipEmpty(), test_fromhrgn(), test_GdipCreateRegionRgnData(), test_get_set_clip(), test_isempty(), and test_string_functions().

◆ GdipIsEqualRegion()

GpStatus WINGDIPAPI GdipIsEqualRegion ( GpRegion region,
GpRegion region2,
GpGraphics graphics,
BOOL res 
)

Definition at line 1233 of file region.c.

1235{
1236 HRGN hrgn1, hrgn2;
1237 GpStatus stat;
1238
1239 TRACE("(%p, %p, %p, %p)\n", region, region2, graphics, res);
1240
1241 if(!region || !region2 || !graphics || !res)
1242 return InvalidParameter;
1243
1244 stat = GdipGetRegionHRgn(region, graphics, &hrgn1);
1245 if(stat != Ok)
1246 return stat;
1247 stat = GdipGetRegionHRgn(region2, graphics, &hrgn2);
1248 if(stat != Ok){
1249 DeleteObject(hrgn1);
1250 return stat;
1251 }
1252
1253 *res = EqualRgn(hrgn1, hrgn2);
1254
1255 /* one of GpRegions is infinite */
1256 if(*res == ERROR)
1257 *res = (!hrgn1 && !hrgn2);
1258
1259 DeleteObject(hrgn1);
1261
1262 return Ok;
1263}
static HRGN hrgn2
GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn)
Definition: region.c:1201
#define ERROR(name)
Definition: error_private.h:53
BOOL WINAPI EqualRgn(_In_ HRGN, _In_ HRGN)

Referenced by test_isequal(), test_transform(), and test_translate().

◆ GdipIsInfiniteRegion()

GpStatus WINGDIPAPI GdipIsInfiniteRegion ( GpRegion region,
GpGraphics graphics,
BOOL res 
)

Definition at line 1268 of file region.c.

1269{
1270 /* I think graphics is ignored here */
1271 TRACE("(%p, %p, %p)\n", region, graphics, res);
1272
1273 if(!region || !graphics || !res)
1274 return InvalidParameter;
1275
1276 *res = (region->node.type == RegionDataInfiniteRect);
1277
1278 return Ok;
1279}

Referenced by test_GdipCreateRegionRgnData(), test_get_set_clip(), test_isinfinite(), test_isvisiblepoint(), and test_isvisiblerect().

◆ GdipIsMatrixEqual()

GpStatus WINGDIPAPI GdipIsMatrixEqual ( GDIPCONST GpMatrix matrix,
GDIPCONST GpMatrix matrix2,
BOOL result 
)

Definition at line 500 of file matrix.c.

502{
503 TRACE("(%s, %s, %p)\n", debugstr_matrix(matrix), debugstr_matrix(matrix2), result);
504
505 if(!matrix || !matrix2 || !result)
506 return InvalidParameter;
507 /* based on single array member of GpMatrix */
508 *result = (memcmp(matrix->matrix, matrix2->matrix, sizeof(GpMatrix)) == 0);
509
510 return Ok;
511}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802

Referenced by GdipIsMatrixIdentity(), test_invert(), test_shear(), and test_transform().

◆ GdipIsMatrixIdentity()

GpStatus WINGDIPAPI GdipIsMatrixIdentity ( GDIPCONST GpMatrix matrix,
BOOL result 
)

Definition at line 513 of file matrix.c.

514{
515 static const GpMatrix identity =
516 {
517 { 1.0, 0.0,
518 0.0, 1.0,
519 0.0, 0.0 }
520 };
521
522 TRACE("(%s, %p)\n", debugstr_matrix(matrix), result);
523
524 if(!matrix || !result)
525 return InvalidParameter;
526
528}
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result)
Definition: matrix.c:500

Referenced by brush_fill_pixels(), GdipSetClipRect(), GdipSetClipRegion(), get_clip_hrgn(), METAFILE_AddPenObject(), METAFILE_DrawDriverString(), METAFILE_FillBrushData(), METAFILE_PrepareBrushData(), test_gradientgetrect(), test_isidentity(), test_transform(), and test_worldtransform().

◆ GdipIsMatrixInvertible()

GpStatus WINGDIPAPI GdipIsMatrixInvertible ( GDIPCONST GpMatrix matrix,
BOOL result 
)

Definition at line 224 of file matrix.c.

225{
226 TRACE("(%s, %p)\n", debugstr_matrix(matrix), result);
227
228 if(!matrix || !result)
229 return InvalidParameter;
230
231 if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
232 *result = matrix->matrix[0] != 0 && matrix->matrix[3] != 0;
233 else
234 *result = (fabs(matrix_det(matrix)) >= 1e-5);
235
236 return Ok;
237}

Referenced by GdipSetPenTransform(), and test_isinvertible().

◆ GdipIsOutlineVisiblePathPoint()

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint ( GpPath path,
REAL  x,
REAL  y,
GpPen pen,
GpGraphics graphics,
BOOL result 
)

Definition at line 1774 of file graphicspath.c.

1776{
1777 GpStatus stat;
1778 GpPath *wide_path;
1779 GpPointF pt = {x, y};
1781
1782 TRACE("(%p, %0.2f, %0.2f, %p, %p, %p)\n", path, x, y, pen, graphics, result);
1783
1784 if(!path || !pen)
1785 return InvalidParameter;
1786
1787 stat = GdipClonePath(path, &wide_path);
1788
1789 if (stat != Ok)
1790 return stat;
1791
1792 if (pen->unit == UnitPixel && graphics != NULL)
1793 {
1795
1796 if (stat == Ok)
1799 if (stat == Ok)
1801 }
1802
1803 if (stat == Ok)
1804 stat = GdipWidenPath(wide_path, pen, transform, 0.25f);
1805
1806 if (stat == Ok)
1807 stat = GdipIsVisiblePathPoint(wide_path, pt.X, pt.Y, graphics, result);
1808
1810
1811 GdipDeletePath(wide_path);
1812
1813 return stat;
1814}
GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, REAL flatness)
GpStatus WINGDIPAPI GdipIsVisiblePathPoint(GpPath *path, REAL x, REAL y, GpGraphics *graphics, BOOL *result)
GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpMatrix *matrix)
Definition: graphics.c:7266

Referenced by GdipIsOutlineVisiblePathPointI(), and test_is_outline_visible_path_point().

◆ GdipIsOutlineVisiblePathPointI()

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI ( GpPath path,
INT  x,
INT  y,
GpPen pen,
GpGraphics graphics,
BOOL result 
)

Definition at line 1766 of file graphicspath.c.

1768{
1769 TRACE("(%p, %d, %d, %p, %p, %p)\n", path, x, y, pen, graphics, result);
1770
1771 return GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result);
1772}
GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint(GpPath *path, REAL x, REAL y, GpPen *pen, GpGraphics *graphics, BOOL *result)

◆ GdipIsStyleAvailable()

GpStatus WINGDIPAPI GdipIsStyleAvailable ( GDIPCONST GpFontFamily family,
INT  style,
BOOL IsStyleAvailable 
)

Definition at line 930 of file font.c.

932{
933 HDC hdc;
934
935 TRACE("%p %d %p\n", family, style, IsStyleAvailable);
936
937 if (!(family && IsStyleAvailable))
938 return InvalidParameter;
939
940 *IsStyleAvailable = FALSE;
941
943
944 if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
945 *IsStyleAvailable = TRUE;
946
947 DeleteDC(hdc);
948
949 return Ok;
950}
static INT CALLBACK font_has_style_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:915

◆ GdipIsVisibleClipEmpty()

GpStatus WINGDIPAPI GdipIsVisibleClipEmpty ( GpGraphics graphics,
BOOL res 
)

Definition at line 7920 of file graphics.c.

7921{
7922 GpStatus stat;
7923 GpRegion* rgn;
7924
7925 TRACE("(%p, %p)\n", graphics, res);
7926
7927 if((stat = GdipCreateRegion(&rgn)) != Ok)
7928 return stat;
7929
7930 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
7931 goto cleanup;
7932
7933 stat = GdipIsEmptyRegion(rgn, graphics, res);
7934
7935cleanup:
7936 GdipDeleteRegion(rgn);
7937 return stat;
7938}

◆ GdipIsVisiblePathPoint()

GpStatus WINGDIPAPI GdipIsVisiblePathPoint ( GpPath path,
REAL  x,
REAL  y,
GpGraphics graphics,
BOOL result 
)

Definition at line 1826 of file graphicspath.c.

1827{
1828 GpRegion *region;
1829 HRGN hrgn;
1831
1832 if(!path || !result) return InvalidParameter;
1833
1834 status = GdipCreateRegionPath(path, &region);
1835 if(status != Ok)
1836 return status;
1837
1838 status = GdipGetRegionHRgn(region, NULL, &hrgn);
1839 if(status != Ok){
1840 GdipDeleteRegion(region);
1841 return status;
1842 }
1843
1845
1847 GdipDeleteRegion(region);
1848
1849 return Ok;
1850}
BOOL WINAPI PtInRegion(_In_ HRGN, _In_ int, _In_ int)

Referenced by GdipIsOutlineVisiblePathPoint(), GdipIsVisiblePathPointI(), test_empty_rect(), and test_isvisible().

◆ GdipIsVisiblePathPointI()

GpStatus WINGDIPAPI GdipIsVisiblePathPointI ( GpPath path,
INT  x,
INT  y,
GpGraphics graphics,
BOOL result 
)

Definition at line 1816 of file graphicspath.c.

1817{
1818 TRACE("(%p, %d, %d, %p, %p)\n", path, x, y, graphics, result);
1819
1820 return GdipIsVisiblePathPoint(path, x, y, graphics, result);
1821}

◆ GdipIsVisiblePoint()

GpStatus WINGDIPAPI GdipIsVisiblePoint ( GpGraphics graphics,
REAL  x,
REAL  y,
BOOL result 
)

Definition at line 5276 of file graphics.c.

5277{
5278 GpStatus stat;
5279 GpRegion* rgn;
5280 GpPointF pt;
5281
5282 TRACE("(%p, %.2f, %.2f, %p)\n", graphics, x, y, result);
5283
5284 if(!graphics || !result)
5285 return InvalidParameter;
5286
5287 if(graphics->busy)
5288 return ObjectBusy;
5289
5290 pt.X = x;
5291 pt.Y = y;
5293 CoordinateSpaceWorld, &pt, 1)) != Ok)
5294 return stat;
5295
5296 if((stat = GdipCreateRegion(&rgn)) != Ok)
5297 return stat;
5298
5299 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
5300 goto cleanup;
5301
5302 stat = GdipIsVisibleRegionPoint(rgn, pt.X, pt.Y, graphics, result);
5303
5304cleanup:
5305 GdipDeleteRegion(rgn);
5306 return stat;
5307}
GpStatus WINGDIPAPI GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y, GpGraphics *graphics, BOOL *res)
Definition: region.c:1529

Referenced by GdipIsVisiblePointI(), test_cliphrgn_transform(), test_GdipIsVisiblePoint(), and test_Get_Release_DC().

◆ GdipIsVisiblePointI()

GpStatus WINGDIPAPI GdipIsVisiblePointI ( GpGraphics graphics,
INT  x,
INT  y,
BOOL result 
)

Definition at line 5309 of file graphics.c.

5310{
5311 return GdipIsVisiblePoint(graphics, (REAL)x, (REAL)y, result);
5312}
GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics *graphics, REAL x, REAL y, BOOL *result)
Definition: graphics.c:5276

Referenced by test_GdipIsVisiblePoint(), and test_Get_Release_DC().

◆ GdipIsVisibleRect()

GpStatus WINGDIPAPI GdipIsVisibleRect ( GpGraphics graphics,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
BOOL result 
)

Definition at line 5314 of file graphics.c.

5315{
5316 GpStatus stat;
5317 GpRegion* rgn;
5318 GpPointF pts[2];
5319
5320 TRACE("(%p %.2f %.2f %.2f %.2f %p)\n", graphics, x, y, width, height, result);
5321
5322 if(!graphics || !result)
5323 return InvalidParameter;
5324
5325 if(graphics->busy)
5326 return ObjectBusy;
5327
5328 pts[0].X = x;
5329 pts[0].Y = y;
5330 pts[1].X = x + width;
5331 pts[1].Y = y + height;
5332
5334 CoordinateSpaceWorld, pts, 2)) != Ok)
5335 return stat;
5336
5337 pts[1].X -= pts[0].X;
5338 pts[1].Y -= pts[0].Y;
5339
5340 if((stat = GdipCreateRegion(&rgn)) != Ok)
5341 return stat;
5342
5343 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
5344 goto cleanup;
5345
5346 stat = GdipIsVisibleRegionRect(rgn, pts[0].X, pts[0].Y, pts[1].X, pts[1].Y, graphics, result);
5347
5348cleanup:
5349 GdipDeleteRegion(rgn);
5350 return stat;
5351}
GpStatus WINGDIPAPI GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL w, REAL h, GpGraphics *graphics, BOOL *res)
Definition: region.c:1284

Referenced by GdipIsVisibleRectI(), and test_GdipIsVisibleRect().

◆ GdipIsVisibleRectI()

GpStatus WINGDIPAPI GdipIsVisibleRectI ( GpGraphics graphics,
INT  x,
INT  y,
INT  width,
INT  height,
BOOL result 
)

Definition at line 5353 of file graphics.c.

5354{
5355 return GdipIsVisibleRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, result);
5356}
GpStatus WINGDIPAPI GdipIsVisibleRect(GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, BOOL *result)
Definition: graphics.c:5314

Referenced by test_GdipIsVisibleRect().

◆ GdipIsVisibleRegionPoint()

GpStatus WINGDIPAPI GdipIsVisibleRegionPoint ( GpRegion region,
REAL  x,
REAL  y,
GpGraphics graphics,
BOOL res 
)

Definition at line 1529 of file region.c.

1530{
1531 HRGN hrgn;
1532 GpStatus stat;
1533 REAL min_x, min_y, max_x, max_y;
1534 BOOL empty, infinite;
1535
1536 TRACE("(%p, %.2f, %.2f, %p, %p)\n", region, x, y, graphics, res);
1537
1538 if(!region || !res)
1539 return InvalidParameter;
1540
1541 x = gdip_round(x);
1542 y = gdip_round(y);
1543
1544 /* Check for cases where we can skip quantization. */
1545 get_region_bounding_box(&region->node, &min_x, &min_y, &max_x, &max_y, &empty, &infinite);
1546 if (empty || x < min_x || y < min_y || x > max_x || y > max_y)
1547 {
1548 *res = infinite;
1549 return Ok;
1550 }
1551
1552 if((stat = GdipGetRegionHRgn(region, NULL, &hrgn)) != Ok)
1553 return stat;
1554
1555 /* infinite */
1556 if(!hrgn){
1557 *res = TRUE;
1558 return Ok;
1559 }
1560
1561 *res = PtInRegion(hrgn, x, y);
1562
1564
1565 return Ok;
1566}

Referenced by GdipIsVisiblePoint(), GdipIsVisibleRegionPointI(), test_incombinedregion(), and test_isvisiblepoint().

◆ GdipIsVisibleRegionPointI()

GpStatus WINGDIPAPI GdipIsVisibleRegionPointI ( GpRegion region,
INT  x,
INT  y,
GpGraphics graphics,
BOOL res 
)

Definition at line 1571 of file region.c.

1572{
1573 TRACE("(%p, %d, %d, %p, %p)\n", region, x, y, graphics, res);
1574
1575 return GdipIsVisibleRegionPoint(region, (REAL)x, (REAL)y, graphics, res);
1576}

Referenced by test_isvisiblepoint().

◆ GdipIsVisibleRegionRect()

GpStatus WINGDIPAPI GdipIsVisibleRegionRect ( GpRegion region,
REAL  x,
REAL  y,
REAL  w,
REAL  h,
GpGraphics graphics,
BOOL res 
)

Definition at line 1284 of file region.c.

1285{
1286 HRGN hrgn;
1287 GpStatus stat;
1288 RECT rect;
1289
1290 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %p, %p)\n", region, x, y, w, h, graphics, res);
1291
1292 if(!region || !res)
1293 return InvalidParameter;
1294
1295 if((stat = GdipGetRegionHRgn(region, NULL, &hrgn)) != Ok)
1296 return stat;
1297
1298 /* infinite */
1299 if(!hrgn){
1300 *res = TRUE;
1301 return Ok;
1302 }
1303
1304 SetRect(&rect, ceilr(x), ceilr(y), ceilr(x + w), ceilr(y + h));
1305 *res = RectInRegion(hrgn, &rect);
1306
1308
1309 return Ok;
1310}
static INT ceilr(REAL x)
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL WINAPI RectInRegion(_In_ HRGN, _In_ LPCRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by GdipIsVisibleRect(), GdipIsVisibleRegionRectI(), and test_isvisiblerect().

◆ GdipIsVisibleRegionRectI()

GpStatus WINGDIPAPI GdipIsVisibleRegionRectI ( GpRegion region,
INT  x,
INT  y,
INT  w,
INT  h,
GpGraphics graphics,
BOOL res 
)

Definition at line 1315 of file region.c.

1316{
1317 TRACE("(%p, %d, %d, %d, %d, %p, %p)\n", region, x, y, w, h, graphics, res);
1318 if(!region || !res)
1319 return InvalidParameter;
1320
1321 return GdipIsVisibleRegionRect(region, (REAL)x, (REAL)y, (REAL)w, (REAL)h, graphics, res);
1322}

Referenced by test_isvisiblerect().

◆ GdipLoadImageFromFile()

GpStatus WINGDIPAPI GdipLoadImageFromFile ( GDIPCONST WCHAR filename,
GpImage **  image 
)

Definition at line 2918 of file image.c.

2920{
2921 GpStatus stat;
2922 IStream *stream;
2923
2924 TRACE("(%s) %p\n", debugstr_w(filename), image);
2925
2926 if (!filename || !image)
2927 return InvalidParameter;
2928
2929 *image = NULL;
2930
2932
2933 if (stat != Ok)
2934 return stat;
2935
2937
2938 IStream_Release(stream);
2939
2940 return stat;
2941}

Referenced by GdipLoadImageFromFileICM(), SetWallpaper(), test_LoadingImages(), test_SavingImages(), and test_SavingMultiPageTiff().

◆ GdipLoadImageFromFileICM()

GpStatus WINGDIPAPI GdipLoadImageFromFileICM ( GDIPCONST WCHAR filename,
GpImage **  image 
)

Definition at line 2944 of file image.c.

2945{
2946 TRACE("(%s) %p\n", debugstr_w(filename), image);
2947
2949}
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
Definition: image.c:2918

Referenced by test_LoadingImages().

◆ GdipLoadImageFromStream()

GpStatus WINGDIPAPI GdipLoadImageFromStream ( IStream stream,
GpImage **  image 
)

Definition at line 4525 of file image.c.

4526{
4527 GpStatus stat;
4529 HRESULT hr;
4530 const struct image_codec *codec=NULL;
4531
4532 TRACE("%p %p\n", stream, image);
4533
4534 if (!stream || !image)
4535 return InvalidParameter;
4536
4537 /* choose an appropriate image decoder */
4538 stat = get_decoder_info(stream, &codec);
4539 if (stat != Ok) return stat;
4540
4541 /* seek to the start of the stream */
4542 seek.QuadPart = 0;
4543 hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, NULL);
4544 if (FAILED(hr)) return hresult_to_status(hr);
4545
4546 /* call on the image decoder to do the real work */
4547 stat = codec->decode_func(stream, image);
4548
4549 /* take note of the original data format */
4550 if (stat == Ok)
4551 {
4552 memcpy(&(*image)->format, &codec->info.FormatID, sizeof(GUID));
4553 return Ok;
4554 }
4555
4556 return stat;
4557}
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
Definition: image.c:4409
int seek(void *fd, ulong off, int mode)
Definition: pe.c:51
decode_image_func decode_func
Definition: image.c:4391
ImageCodecInfo info
Definition: image.c:4389

Referenced by GdipCreateBitmapFromStream(), GdipCreateMetafileFromStream(), GdipLoadImageFromFile(), GdipLoadImageFromStreamICM(), load_image(), test_bufferrawformat(), test_GdipLoadImageFromStream(), test_loadwmf(), and test_transform().

◆ GdipLoadImageFromStreamICM()

GpStatus WINGDIPAPI GdipLoadImageFromStreamICM ( IStream stream,
GpImage **  image 
)

Definition at line 4560 of file image.c.

4561{
4562 TRACE("%p %p\n", stream, image);
4563
4565}

◆ GdiplusNotificationHook()

GpStatus WINAPI GdiplusNotificationHook ( ULONG_PTR token)

Definition at line 112 of file gdiplus.c.

113{
114 FIXME("%p\n", token);
115 return NotificationHook(token);
116}
static Status WINAPI NotificationHook(ULONG_PTR *token)
Definition: gdiplus.c:43
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 token
Definition: glfuncs.h:210

◆ GdiplusNotificationUnhook()

void WINAPI GdiplusNotificationUnhook ( ULONG_PTR  token)

Definition at line 118 of file gdiplus.c.

119{
120 FIXME("%Id\n", token);
122}
static void WINAPI NotificationUnhook(ULONG_PTR token)
Definition: gdiplus.c:52

◆ GdipMeasureCharacterRanges()

GpStatus WINGDIPAPI GdipMeasureCharacterRanges ( GpGraphics graphics,
GDIPCONST WCHAR string,
INT  length,
GDIPCONST GpFont font,
GDIPCONST RectF layoutRect,
GDIPCONST GpStringFormat stringFormat,
INT  regionCount,
GpRegion **  regions 
)

Definition at line 5758 of file graphics.c.

5762{
5763 GpStatus stat;
5764 int i;
5765 HFONT gdifont, oldfont;
5767 HDC hdc, temp_hdc=NULL;
5768 RectF scaled_rect;
5769 REAL margin_x;
5770
5771 TRACE("(%p %s %d %p %s %p %d %p)\n", graphics, debugstr_wn(string, length),
5772 length, font, debugstr_rectf(layoutRect), stringFormat, regionCount, regions);
5773
5774 if (!(graphics && string && font && layoutRect && stringFormat && regions))
5775 return InvalidParameter;
5776
5777 if (regionCount < stringFormat->range_count)
5778 return InvalidParameter;
5779
5780 if(!has_gdi_dc(graphics))
5781 {
5782 hdc = temp_hdc = CreateCompatibleDC(0);
5783 if (!temp_hdc) return OutOfMemory;
5784 }
5785 else
5786 {
5787 stat = gdi_dc_acquire(graphics, &hdc);
5788 if (stat != Ok)
5789 return stat;
5790 }
5791
5792 if (stringFormat->attr)
5793 TRACE("may be ignoring some format flags: attr %x\n", stringFormat->attr);
5794
5795
5796 margin_x = stringFormat->generic_typographic ? 0.0 : font->emSize / 6.0;
5797 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres, graphics->printer_display);
5798 transform_properties(graphics, NULL, TRUE, &args.rel_width, &args.rel_height, NULL);
5799 scaled_rect.X = (layoutRect->X + margin_x) * args.rel_width;
5800 scaled_rect.Y = layoutRect->Y * args.rel_height;
5801 scaled_rect.Width = layoutRect->Width * args.rel_width;
5802 scaled_rect.Height = layoutRect->Height * args.rel_height;
5803
5804 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
5805 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
5806
5807 get_font_hfont(graphics, font, stringFormat, &gdifont, NULL, NULL);
5808 oldfont = SelectObject(hdc, gdifont);
5809
5810 for (i=0; i<stringFormat->range_count; i++)
5811 {
5813 if (stat != Ok)
5814 {
5815 SelectObject(hdc, oldfont);
5816 DeleteObject(gdifont);
5817 if (temp_hdc)
5818 DeleteDC(temp_hdc);
5819 return stat;
5820 }
5821 }
5822
5823 args.regions = regions;
5824
5825 gdi_transform_acquire(graphics);
5826
5827 stat = gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, stringFormat,
5829
5830 gdi_transform_release(graphics);
5831
5832 SelectObject(hdc, oldfont);
5833 DeleteObject(gdifont);
5834
5835 if (temp_hdc)
5836 DeleteDC(temp_hdc);
5837 else
5838 gdi_dc_release(graphics, hdc);
5839
5840 return stat;
5841}
static const WCHAR stringFormat[]
Definition: wordpad.c:55
static GpStatus measure_ranges_callback(struct gdip_format_string_info *info)
Definition: graphics.c:5724
GpRegion ** regions
Definition: graphics.c:5720

Referenced by test_font_height_scaling(), test_measure_string(), and test_string_functions().

◆ GdipMeasureDriverString()

GpStatus WINGDIPAPI GdipMeasureDriverString ( GpGraphics graphics,
GDIPCONST UINT16 text,
INT  length,
GDIPCONST GpFont font,
GDIPCONST PointF positions,
INT  flags,
GDIPCONST GpMatrix matrix,
RectF boundingBox 
)

Definition at line 7456 of file graphics.c.

7459{
7460 static const INT unsupported_flags = ~(DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance);
7461 HFONT hfont;
7462 HDC hdc;
7463 REAL min_x, min_y, max_x, max_y, x, y;
7464 int i;
7465 TEXTMETRICW textmetric;
7466 const WORD *glyph_indices;
7467 WORD *dynamic_glyph_indices=NULL;
7468 REAL rel_width, rel_height, ascent, descent;
7469 GpPointF pt[3];
7470
7471 TRACE("(%p %p %d %p %p %d %s %p)\n", graphics, text, length, font, positions, flags, debugstr_matrix(matrix), boundingBox);
7472
7473 if (!graphics || !text || !font || !positions || !boundingBox)
7474 return InvalidParameter;
7475
7476 if (length == -1)
7477 length = lstrlenW(text);
7478
7479 if (length == 0)
7480 set_rect(boundingBox, 0.0f, 0.0f, 0.0f, 0.0f);
7481
7482 if (flags & unsupported_flags)
7483 FIXME("Ignoring flags %x\n", flags & unsupported_flags);
7484
7485 get_font_hfont(graphics, font, NULL, &hfont, NULL, matrix);
7486
7489
7490 GetTextMetricsW(hdc, &textmetric);
7491
7492 pt[0].X = 0.0;
7493 pt[0].Y = 0.0;
7494 pt[1].X = 1.0;
7495 pt[1].Y = 0.0;
7496 pt[2].X = 0.0;
7497 pt[2].Y = 1.0;
7498 if (matrix)
7499 {
7500 GpMatrix xform = *matrix;
7501 GdipTransformMatrixPoints(&xform, pt, 3);
7502 }
7504 rel_width = hypotf(pt[1].Y - pt[0].Y, pt[1].X - pt[0].X);
7505 rel_height = hypotf(pt[2].Y - pt[0].Y, pt[2].X - pt[0].X);
7506
7508 {
7509 glyph_indices = dynamic_glyph_indices = malloc(sizeof(WORD) * length);
7510 if (!glyph_indices)
7511 {
7512 DeleteDC(hdc);
7514 return OutOfMemory;
7515 }
7516
7517 GetGlyphIndicesW(hdc, text, length, dynamic_glyph_indices, 0);
7518 }
7519 else
7520 glyph_indices = text;
7521
7522 min_x = max_x = x = positions[0].X;
7523 min_y = max_y = y = positions[0].Y;
7524
7525 ascent = textmetric.tmAscent / rel_height;
7526 descent = textmetric.tmDescent / rel_height;
7527
7528 for (i=0; i<length; i++)
7529 {
7530 int char_width;
7531 ABC abc;
7532
7534 {
7535 x = positions[i].X;
7536 y = positions[i].Y;
7537 }
7538
7539 GetCharABCWidthsW(hdc, glyph_indices[i], glyph_indices[i], &abc);
7540 char_width = abc.abcA + abc.abcB + abc.abcC;
7541
7542 if (min_y > y - ascent) min_y = y - ascent;
7543 if (max_y < y + descent) max_y = y + descent;
7544 if (min_x > x) min_x = x;
7545
7546 x += char_width / rel_width;
7547
7548 if (max_x < x) max_x = x;
7549 }
7550
7551 free(dynamic_glyph_indices);
7552 DeleteDC(hdc);
7554
7555 boundingBox->X = min_x;
7556 boundingBox->Y = min_y;
7557 boundingBox->Width = max_x - min_x;
7558 boundingBox->Height = max_y - min_y;
7559
7560 return Ok;
7561}
#define lstrlenW
Definition: compat.h:750
static float hypotf(float x, float y)
Definition: math.h:428
unsigned short WORD
Definition: ntddk_ex.h:93
@ DriverStringOptionsRealizedAdvance
Definition: gdiplusenums.h:49
@ DriverStringOptionsCmapLookup
Definition: gdiplusenums.h:47
Definition: wingdi.h:1856
int abcA
Definition: wingdi.h:1857
UINT abcB
Definition: wingdi.h:1858
int abcC
Definition: wingdi.h:1859
LONG tmDescent
Definition: wingdi.h:2831
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
BOOL WINAPI GetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)

Referenced by test_font_transform(), and test_string_functions().

◆ GdipMeasureString()

GpStatus WINGDIPAPI GdipMeasureString ( GpGraphics graphics,
GDIPCONST WCHAR string,
INT  length,
GDIPCONST GpFont font,
GDIPCONST RectF rect,
GDIPCONST GpStringFormat format,
RectF bounds,
INT codepointsfitted,
INT linesfilled 
)

Definition at line 5890 of file graphics.c.

5894{
5896 HFONT oldfont, gdifont;
5898 HDC temp_hdc=NULL, hdc;
5899 RectF scaled_rect;
5900 REAL margin_x;
5901 INT lines, glyphs;
5902
5903 TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics,
5906
5907 if(!graphics || !string || !font || !rect || !bounds)
5908 return InvalidParameter;
5909
5910 if(!has_gdi_dc(graphics))
5911 {
5912 hdc = temp_hdc = CreateCompatibleDC(0);
5913 if (!temp_hdc) return OutOfMemory;
5914 }
5915 else
5916 {
5917 status = gdi_dc_acquire(graphics, &hdc);
5918 if (status != Ok)
5919 return status;
5920 }
5921
5922 if(linesfilled) *linesfilled = 0;
5924
5925 if(format)
5926 TRACE("may be ignoring some format flags: attr %x\n", format->attr);
5927
5928 transform_properties(graphics, NULL, TRUE, &args.rel_width, &args.rel_height, NULL);
5929 margin_x = (format && format->generic_typographic) ? 0.0 : font->emSize / 6.0;
5930 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres, graphics->printer_display);
5931
5932 scaled_rect.X = (rect->X + margin_x) * args.rel_width;
5933 scaled_rect.Y = rect->Y * args.rel_height;
5934 scaled_rect.Width = rect->Width * args.rel_width;
5935 scaled_rect.Height = rect->Height * args.rel_height;
5936 if (scaled_rect.Width >= 0.5)
5937 {
5938 scaled_rect.Width -= margin_x * 2.0 * args.rel_width;
5939 if (scaled_rect.Width < 0.5) /* doesn't fit */
5940 goto end;
5941 }
5942
5943 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
5944 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
5945
5946 get_font_hfont(graphics, font, format, &gdifont, NULL, NULL);
5947 oldfont = SelectObject(hdc, gdifont);
5948
5949 set_rect(bounds, rect->X, rect->Y, 0.0f, 0.0f);
5950
5951 args.bounds = bounds;
5952 args.codepointsfitted = &glyphs;
5953 args.linesfilled = &lines;
5954 lines = glyphs = 0;
5955
5956 gdi_transform_acquire(graphics);
5957
5958 gdip_format_string(graphics, hdc, string, length, font, &scaled_rect, format, TRUE,
5960
5961 gdi_transform_release(graphics);
5962
5964 if (codepointsfitted) *codepointsfitted = glyphs;
5965
5966 if (lines)
5967 bounds->Width += margin_x * 2.0;
5968
5969 SelectObject(hdc, oldfont);
5970 DeleteObject(gdifont);
5971end:
5972 if (temp_hdc)
5973 DeleteDC(temp_hdc);
5974 else
5975 gdi_dc_release(graphics, hdc);
5976
5977 return Ok;
5978}
static GpStatus measure_string_callback(struct gdip_format_string_info *info)
Definition: graphics.c:5850
eMaj lines
Definition: tritemp.h:206

Referenced by GdipDrawString(), test_font_height_scaling(), test_font_transform(), test_GdipMeasureString(), test_measure_string(), test_measured_extra_space(), and test_string_functions().

◆ GdipMultiplyLineTransform()

GpStatus WINGDIPAPI GdipMultiplyLineTransform ( GpLineGradient brush,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 2178 of file brush.c.

2180{
2181 TRACE("(%p,%s,%u)\n", brush, debugstr_matrix(matrix), order);
2182
2183 if(!brush)
2184 return InvalidParameter;
2185
2186 if(!matrix)
2187 return Ok;
2188
2189 return GdipMultiplyMatrix(&brush->transform, matrix, order);
2190}
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

Referenced by test_transform().

◆ GdipMultiplyMatrix()

GpStatus WINGDIPAPI GdipMultiplyMatrix ( GpMatrix matrix,
GDIPCONST GpMatrix matrix2,
GpMatrixOrder  order 
)

Definition at line 239 of file matrix.c.

241{
242 TRACE("(%s, %s, %d)\n", debugstr_matrix(matrix), debugstr_matrix(matrix2), order);
243
244 if(!matrix || !matrix2)
245 return InvalidParameter;
246
248 matrix_multiply(matrix->matrix, matrix2->matrix, matrix->matrix);
249 else if (order == MatrixOrderPrepend)
250 matrix_multiply(matrix2->matrix, matrix->matrix, matrix->matrix);
251 else
252 return InvalidParameter;
253
254 return Ok;
255}
static void matrix_multiply(GDIPCONST REAL *left, GDIPCONST REAL *right, REAL *out)
Definition: matrix.c:42

Referenced by GdipBeginContainer(), GdipGetLogFontW(), GdipMultiplyLineTransform(), GdipMultiplyPathGradientTransform(), GdipMultiplyPenTransform(), GdipMultiplyTextureTransform(), GdipMultiplyWorldTransform(), GdipPlayMetafileRecord(), get_graphics_transform(), linegradient_init_transform(), and METAFILE_PlaybackUpdateWorldTransform().

◆ GdipMultiplyPathGradientTransform()

GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform ( GpPathGradient grad,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 1897 of file brush.c.

1899{
1900 TRACE("(%p,%s,%i)\n", grad, debugstr_matrix(matrix), order);
1901
1902 if (!grad || grad->brush.bt != BrushTypePathGradient)
1903 return InvalidParameter;
1904
1905 return GdipMultiplyMatrix(&grad->transform, matrix, order);
1906}

◆ GdipMultiplyPenTransform()

GpStatus WINGDIPAPI GdipMultiplyPenTransform ( GpPen pen,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 508 of file pen.c.

510{
511 TRACE("(%p,%s,%u)\n", pen, debugstr_matrix(matrix), order);
512
513 if(!pen)
514 return InvalidParameter;
515
517}

Referenced by test_transform().

◆ GdipMultiplyTextureTransform()

GpStatus WINGDIPAPI GdipMultiplyTextureTransform ( GpTexture brush,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 1357 of file brush.c.

1359{
1360 TRACE("(%p, %s, %d)\n", brush, debugstr_matrix(matrix), order);
1361
1362 if(!brush || !matrix)
1363 return InvalidParameter;
1364
1365 return GdipMultiplyMatrix(&brush->transform, matrix, order);
1366}

◆ GdipMultiplyWorldTransform()

GpStatus WINGDIPAPI GdipMultiplyWorldTransform ( GpGraphics graphics,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 7016 of file graphics.c.

7018{
7019 GpMatrix m;
7020 GpStatus ret;
7021
7022 TRACE("(%p, %s, %d)\n", graphics, debugstr_matrix(matrix), order);
7023
7024 if(!graphics || !matrix)
7025 return InvalidParameter;
7026
7027 if(graphics->busy)
7028 return ObjectBusy;
7029
7030 if (is_metafile_graphics(graphics))
7031 {
7033
7034 if (ret != Ok)
7035 return ret;
7036 }
7037
7038 m = graphics->worldtrans;
7039
7041 if(ret == Ok)
7042 graphics->worldtrans = m;
7043
7044 return ret;
7045}
GpStatus METAFILE_MultiplyWorldTransform(GpMetafile *metafile, GDIPCONST GpMatrix *matrix, MatrixOrder order)
Definition: metafile.c:1482
const GLfloat * m
Definition: glext.h:10848

Referenced by test_Get_Release_DC(), and test_worldtransform().

◆ GdipNewInstalledFontCollection()

GpStatus WINGDIPAPI GdipNewInstalledFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1669 of file font.c.

1671{
1672 TRACE("(%p)\n",fontCollection);
1673
1674 if (!fontCollection)
1675 return InvalidParameter;
1676
1679 {
1680 struct add_font_param param;
1681 LOGFONTW lfw;
1682
1683 param.hdc = CreateCompatibleDC(0);
1684
1685 lfw.lfCharSet = DEFAULT_CHARSET;
1686 lfw.lfFaceName[0] = 0;
1687 lfw.lfPitchAndFamily = 0;
1688
1689 param.collection = &installedFontCollection;
1690 param.is_system = TRUE;
1691 if (!EnumFontFamiliesExW(param.hdc, &lfw, add_font_proc, (LPARAM)&param, 0))
1692 {
1694 DeleteDC(param.hdc);
1696 return param.stat;
1697 }
1698
1699 DeleteDC(param.hdc);
1700 }
1702
1703 *fontCollection = &installedFontCollection;
1704
1705 return Ok;
1706}
void free_installed_fonts(void)
Definition: font.c:1567
static GpFontCollection installedFontCollection
Definition: font.c:118
static CRITICAL_SECTION font_cs
Definition: font.c:120
static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:1579
GLfloat param
Definition: glext.h:5796
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)

Referenced by GdipCreateFontFamilyFromName(), test_CloneFont(), test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), and test_installedfonts().

◆ GdipNewPrivateFontCollection()

GpStatus WINGDIPAPI GdipNewPrivateFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1054 of file font.c.

1055{
1056 TRACE("%p\n", fontCollection);
1057
1058 if (!fontCollection)
1059 return InvalidParameter;
1060
1061 *fontCollection = calloc(1, sizeof(GpFontCollection));
1062 if (!*fontCollection) return OutOfMemory;
1063
1064 (*fontCollection)->FontFamilies = NULL;
1065 (*fontCollection)->count = 0;
1066 (*fontCollection)->allocated = 0;
1067
1068 TRACE("<-- %p\n", *fontCollection);
1069
1070 return Ok;
1071}

Referenced by test_GdipPrivateAddMemoryFont(), test_long_name(), and test_unknownfontdecode().

◆ GdipPathIterCopyData()

GpStatus WINGDIPAPI GdipPathIterCopyData ( GpPathIterator iterator,
INT resultCount,
GpPointF points,
BYTE types,
INT  startIndex,
INT  endIndex 
)

Definition at line 83 of file pathiterator.c.

85{
86 TRACE("(%p, %p, %p, %p, %d, %d)\n", iterator, resultCount, points, types,
87 startIndex, endIndex);
88
89 if(!iterator || !types || !points)
90 return InvalidParameter;
91
92 if(endIndex > iterator->pathdata.Count - 1 || startIndex < 0 ||
93 endIndex < startIndex){
94 *resultCount = 0;
95 return Ok;
96 }
97
98 *resultCount = endIndex - startIndex + 1;
99
100 memcpy(types, &(iterator->pathdata.Types[startIndex]), *resultCount);
101 memcpy(points, &(iterator->pathdata.Points[startIndex]),
102 *resultCount * sizeof(PointF));
103
104 return Ok;
105}

Referenced by GdipPathIterEnumerate().

◆ GdipPathIterEnumerate()

GpStatus WINGDIPAPI GdipPathIterEnumerate ( GpPathIterator iterator,
INT resultCount,
GpPointF points,
BYTE types,
INT  count 
)

Definition at line 270 of file pathiterator.c.

272{
273 TRACE("(%p, %p, %p, %p, %d)\n", iterator, resultCount, points, types, count);
274
275 if((count < 0) || !resultCount)
276 return InvalidParameter;
277
278 if(count == 0){
279 *resultCount = 0;
280 return Ok;
281 }
282
283 return GdipPathIterCopyData(iterator, resultCount, points, types, 0, count-1);
284}
GpStatus WINGDIPAPI GdipPathIterCopyData(GpPathIterator *iterator, INT *resultCount, GpPointF *points, BYTE *types, INT startIndex, INT endIndex)
Definition: pathiterator.c:83

◆ GdipPathIterGetCount()

GpStatus WINGDIPAPI GdipPathIterGetCount ( GpPathIterator iterator,
INT count 
)

Definition at line 258 of file pathiterator.c.

259{
260 TRACE("(%p, %p)\n", iterator, count);
261
262 if(!iterator || !count)
263 return InvalidParameter;
264
265 *count = iterator->pathdata.Count;
266
267 return Ok;
268}

Referenced by test_nextpathtype().

◆ GdipPathIterGetSubpathCount()

GpStatus WINGDIPAPI GdipPathIterGetSubpathCount ( GpPathIterator iterator,
INT count 
)

Definition at line 127 of file pathiterator.c.

128{
129 INT i;
130
131 TRACE("(%p, %p)\n", iterator, count);
132
133 if(!iterator || !count)
134 return InvalidParameter;
135
136 *count = 0;
137 for(i = 0; i < iterator->pathdata.Count; i++){
138 if(iterator->pathdata.Types[i] == PathPointTypeStart)
139 (*count)++;
140 }
141
142 return Ok;
143}

Referenced by test_getsubpathcount().

◆ GdipPathIterHasCurve()

GpStatus WINGDIPAPI GdipPathIterHasCurve ( GpPathIterator iterator,
BOOL hasCurve 
)

Definition at line 107 of file pathiterator.c.

108{
109 INT i;
110
111 TRACE("(%p, %p)\n", iterator, hasCurve);
112
113 if(!iterator)
114 return InvalidParameter;
115
116 *hasCurve = FALSE;
117
118 for(i = 0; i < iterator->pathdata.Count; i++)
119 if((iterator->pathdata.Types[i] & PathPointTypePathTypeMask) == PathPointTypeBezier){
120 *hasCurve = TRUE;
121 break;
122 }
123
124 return Ok;
125}

Referenced by test_hascurve().

◆ GdipPathIterIsValid()

GpStatus WINGDIPAPI GdipPathIterIsValid ( GpPathIterator iterator,
BOOL valid 
)

Definition at line 286 of file pathiterator.c.

287{
288 TRACE("(%p, %p)\n", iterator, valid);
289
290 if(!iterator || !valid)
291 return InvalidParameter;
292
293 *valid = TRUE;
294
295 return Ok;
296}
BOOLEAN valid

Referenced by test_isvalid().

◆ GdipPathIterNextMarker()

GpStatus WINGDIPAPI GdipPathIterNextMarker ( GpPathIterator iterator,
INT resultCount,
INT startIndex,
INT endIndex 
)

Definition at line 145 of file pathiterator.c.

147{
148 INT i;
149
150 TRACE("(%p, %p, %p, %p)\n", iterator, resultCount, startIndex, endIndex);
151
152 if(!iterator || !startIndex || !endIndex)
153 return InvalidParameter;
154
155 *resultCount = 0;
156
157 /* first call could start with second point as all subsequent, cause
158 path couldn't contain only one */
159 for(i = iterator->marker_pos + 1; i < iterator->pathdata.Count; i++){
160 if((iterator->pathdata.Types[i] & PathPointTypePathMarker) ||
161 (i == iterator->pathdata.Count - 1)){
162 *startIndex = iterator->marker_pos;
163 if(iterator->marker_pos > 0) (*startIndex)++;
164 *endIndex = iterator->marker_pos = i;
165 *resultCount= *endIndex - *startIndex + 1;
166 break;
167 }
168 }
169
170 return Ok;
171}
@ PathPointTypePathMarker
Definition: gdiplusenums.h:88

Referenced by GdipPathIterNextMarkerPath(), test_isvalid(), and test_nextmarker().

◆ GdipPathIterNextMarkerPath()

GpStatus WINGDIPAPI GdipPathIterNextMarkerPath ( GpPathIterator iterator,
INT result,
GpPath path 
)

Definition at line 173 of file pathiterator.c.

175{
176 INT start, end;
177
178 TRACE("(%p, %p, %p)\n", iterator, result, path);
179
180 if(!iterator || !result)
181 return InvalidParameter;
182
184 /* return path */
185 if(((*result) > 0) && path){
187
189 return OutOfMemory;
190
191 memcpy(path->pathdata.Points, &(iterator->pathdata.Points[start]), sizeof(GpPointF)*(*result));
192 memcpy(path->pathdata.Types, &(iterator->pathdata.Types[start]), sizeof(BYTE)*(*result));
193 path->pathdata.Count = *result;
194 }
195
196 return Ok;
197}
GpStatus WINGDIPAPI GdipResetPath(GpPath *path)
GpStatus WINGDIPAPI GdipPathIterNextMarker(GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex)
Definition: pathiterator.c:145

Referenced by test_nextmarkerpath().

◆ GdipPathIterNextPathType()

GpStatus WINGDIPAPI GdipPathIterNextPathType ( GpPathIterator iter,
INT result,
BYTE type,
INT start,
INT end 
)

Definition at line 298 of file pathiterator.c.

300{
301 INT i, stopIndex;
302 TRACE("(%p, %p, %p, %p, %p)\n", iter, result, type, start, end);
303
304 if (!iter || !result || !type || !start || !end)
305 return InvalidParameter;
306
307 i = iter->pathtype_pos;
308 stopIndex = iter->subpath_pos;
309 if (i >= stopIndex) {
310 *result = 0;
311 return Ok;
312 }
314 i++;
315
316 *start = i - 1;
317 if ((i < stopIndex) &&
319 {
321 i++;
322 for ( ; i < stopIndex; i++) {
323 if ((iter->pathdata.Types[i] & PathPointTypePathTypeMask) != *type)
324 break;
325 }
326 }
327 iter->pathtype_pos = i;
328 *end = i - 1;
329 *result = *end - *start + 1;
330 return Ok;
331}

Referenced by test_nextpathtype().

◆ GdipPathIterNextSubpath()

GpStatus WINGDIPAPI GdipPathIterNextSubpath ( GpPathIterator iterator,
INT resultCount,
INT startIndex,
INT endIndex,
BOOL isClosed 
)

Definition at line 199 of file pathiterator.c.

201{
202 INT i, count;
203
204 TRACE("(%p, %p, %p, %p, %p)\n", iterator, resultCount, startIndex,
205 endIndex, isClosed);
206
207 if(!iterator || !startIndex || !endIndex || !isClosed || !resultCount)
208 return InvalidParameter;
209
210 count = iterator->pathdata.Count;
211
212 /* iterator created with NULL path */
213 if(count == 0){
214 *resultCount = 0;
215 return Ok;
216 }
217
218 if(iterator->subpath_pos == count){
219 *startIndex = *endIndex = *resultCount = 0;
220 *isClosed = TRUE;
221 return Ok;
222 }
223
224 *startIndex = iterator->subpath_pos;
225 /* Set new pathtype position */
226 iterator->pathtype_pos = iterator->subpath_pos;
227
228 for(i = iterator->subpath_pos + 1; i < count &&
229 !(iterator->pathdata.Types[i] == PathPointTypeStart); i++);
230
231 *endIndex = i - 1;
232 iterator->subpath_pos = i;
233
234 *resultCount = *endIndex - *startIndex + 1;
235
236 if(iterator->pathdata.Types[*endIndex] & PathPointTypeCloseSubpath)
237 *isClosed = TRUE;
238 else
239 *isClosed = FALSE;
240
241 return Ok;
242}

Referenced by GdipPathIterNextSubpathPath(), test_nextpathtype(), and test_nextsubpath().

◆ GdipPathIterNextSubpathPath()

GpStatus WINGDIPAPI GdipPathIterNextSubpathPath ( GpPathIterator iter,
INT result,
GpPath path,
BOOL closed 
)

Definition at line 333 of file pathiterator.c.

335{
336 INT start, end;
337
338 TRACE("(%p, %p, %p, %p)\n", iter, result, path, closed);
339
340 if(!iter || !result || !closed)
341 return InvalidParameter;
342
343 GdipPathIterNextSubpath(iter, result, &start, &end, closed);
344 /* return path */
345 if(((*result) > 0) && path){
347
349 return OutOfMemory;
350
351 memcpy(path->pathdata.Points, &(iter->pathdata.Points[start]), sizeof(GpPointF)*(*result));
352 memcpy(path->pathdata.Types, &(iter->pathdata.Types[start]), sizeof(BYTE)*(*result));
353 path->pathdata.Count = *result;
354 }
355
356 return Ok;
357}
GpStatus WINGDIPAPI GdipPathIterNextSubpath(GpPathIterator *iterator, INT *resultCount, INT *startIndex, INT *endIndex, BOOL *isClosed)
Definition: pathiterator.c:199

Referenced by test_nextsubpathpath().

◆ GdipPathIterRewind()

GpStatus WINGDIPAPI GdipPathIterRewind ( GpPathIterator iterator)

Definition at line 244 of file pathiterator.c.

245{
246 TRACE("(%p)\n", iterator);
247
248 if(!iterator)
249 return InvalidParameter;
250
251 iterator->subpath_pos = 0;
252 iterator->marker_pos = 0;
253 iterator->pathtype_pos = 0;
254
255 return Ok;
256}

◆ GdipPlayMetafileRecord()

GpStatus WINGDIPAPI GdipPlayMetafileRecord ( GDIPCONST GpMetafile metafile,
EmfPlusRecordType  recordType,
UINT  flags,
UINT  dataSize,
GDIPCONST BYTE data 
)

Definition at line 2766 of file metafile.c.

2768{
2769 GpStatus stat;
2770 GpMetafile *real_metafile = (GpMetafile*)metafile;
2771
2772 TRACE("(%p,%x,%x,%d,%p)\n", metafile, recordType, flags, dataSize, data);
2773
2774 if (!metafile || (dataSize && !data) || !metafile->playback_graphics)
2775 return InvalidParameter;
2776
2777 if (recordType >= 1 && recordType <= 0x7a)
2778 {
2779 /* regular EMF record */
2780 if (metafile->playback_dc)
2781 {
2783
2784 if (record)
2785 {
2786 record->iType = recordType;
2787 record->nSize = dataSize + 8;
2788 memcpy(record->dParm, data, dataSize);
2789
2790 if (record->iType == EMR_BITBLT || record->iType == EMR_STRETCHBLT)
2792
2793 if(PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table,
2794 record, metafile->handle_count) == 0)
2795 ERR("PlayEnhMetaFileRecord failed\n");
2796
2797 free(record);
2798 }
2799 else
2800 return OutOfMemory;
2801 }
2802 }
2803 else
2804 {
2806
2808
2809 switch(recordType)
2810 {
2813 break;
2816 break;
2818 {
2820
2821 if (dataSize != sizeof(record->Color))
2822 return InvalidParameter;
2823
2824 return GdipGraphicsClear(metafile->playback_graphics, record->Color);
2825 }
2827 {
2829 GpBrush *brush, *temp_brush=NULL;
2830 GpRectF *rects, *temp_rects=NULL;
2831
2832 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects))
2833 return InvalidParameter;
2834
2835 if (flags & 0x4000)
2836 {
2837 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(EmfPlusRect) * record->Count)
2838 return InvalidParameter;
2839 }
2840 else
2841 {
2842 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(GpRectF) * record->Count)
2843 return InvalidParameter;
2844 }
2845
2846 if (flags & 0x8000)
2847 {
2848 stat = GdipCreateSolidFill(record->BrushID, (GpSolidFill **)&temp_brush);
2849 brush = temp_brush;
2850 }
2851 else
2852 {
2853 if (record->BrushID >= EmfPlusObjectTableSize ||
2854 real_metafile->objtable[record->BrushID].type != ObjectTypeBrush)
2855 return InvalidParameter;
2856
2857 brush = real_metafile->objtable[record->BrushID].u.brush;
2858 stat = Ok;
2859 }
2860
2861 if (stat == Ok)
2862 {
2863 if (flags & 0x4000)
2864 {
2865 EmfPlusRect *int_rects = (EmfPlusRect*)(record+1);
2866 int i;
2867
2868 rects = temp_rects = calloc(record->Count, sizeof(GpRectF));
2869 if (rects)
2870 {
2871 for (i=0; i<record->Count; i++)
2872 {
2873 rects[i].X = int_rects[i].X;
2874 rects[i].Y = int_rects[i].Y;
2875 rects[i].Width = int_rects[i].Width;
2876 rects[i].Height = int_rects[i].Height;
2877 }
2878 }
2879 else
2880 stat = OutOfMemory;
2881 }
2882 else
2883 rects = (GpRectF*)(record+1);
2884 }
2885
2886 if (stat == Ok)
2887 {
2888 stat = GdipFillRectangles(metafile->playback_graphics, brush, rects, record->Count);
2889 }
2890
2891 GdipDeleteBrush(temp_brush);
2892 free(temp_rects);
2893
2894 return stat;
2895 }
2897 {
2899 CombineMode mode = (CombineMode)((flags >> 8) & 0xf);
2900 GpRegion *region;
2901
2902 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(*record))
2903 return InvalidParameter;
2904
2905 stat = GdipCreateRegionRect(&record->ClipRect, &region);
2906
2907 if (stat == Ok)
2908 {
2909 stat = metafile_set_clip_region(real_metafile, region, mode);
2910 GdipDeleteRegion(region);
2911 }
2912
2913 return stat;
2914 }
2916 {
2917 CombineMode mode = (flags >> 8) & 0xf;
2918 BYTE regionid = flags & 0xff;
2919 GpRegion *region;
2920
2921 if (dataSize != 0)
2922 return InvalidParameter;
2923
2924 if (regionid >= EmfPlusObjectTableSize || real_metafile->objtable[regionid].type != ObjectTypeRegion)
2925 return InvalidParameter;
2926
2927 stat = GdipCloneRegion(real_metafile->objtable[regionid].u.region, &region);
2928 if (stat == Ok)
2929 {
2930 stat = metafile_set_clip_region(real_metafile, region, mode);
2931 GdipDeleteRegion(region);
2932 }
2933
2934 return stat;
2935 }
2937 {
2938 CombineMode mode = (flags >> 8) & 0xf;
2939 BYTE pathid = flags & 0xff;
2940 GpRegion *region;
2941
2942 if (dataSize != 0)
2943 return InvalidParameter;
2944
2945 if (pathid >= EmfPlusObjectTableSize || real_metafile->objtable[pathid].type != ObjectTypePath)
2946 return InvalidParameter;
2947
2948 stat = GdipCreateRegionPath(real_metafile->objtable[pathid].u.path, &region);
2949 if (stat == Ok)
2950 {
2951 stat = metafile_set_clip_region(real_metafile, region, mode);
2952 GdipDeleteRegion(region);
2953 }
2954
2955 return stat;
2956 }
2958 {
2961
2963 return InvalidParameter;
2964
2965 real_metafile->page_unit = unit;
2966 real_metafile->page_scale = record->PageScale;
2967
2968 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2969 }
2971 {
2973
2975 return InvalidParameter;
2976
2977 memcpy(real_metafile->world_transform->matrix, record->MatrixData, sizeof(record->MatrixData));
2978
2979 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2980 }
2982 {
2985
2987 return InvalidParameter;
2988
2989 GdipScaleMatrix(real_metafile->world_transform, record->Sx, record->Sy, order);
2990
2991 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2992 }
2994 {
2998
3000 return InvalidParameter;
3001
3002 memcpy(matrix.matrix, record->MatrixData, sizeof(matrix.matrix));
3003
3005
3006 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
3007 }
3009 {
3012
3014 return InvalidParameter;
3015
3016 GdipRotateMatrix(real_metafile->world_transform, record->Angle, order);
3017
3018 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
3019 }
3021 {
3024
3026 return InvalidParameter;
3027
3028 GdipTranslateMatrix(real_metafile->world_transform, record->dx, record->dy, order);
3029
3030 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
3031 }
3033 {
3034 GdipSetMatrixElements(real_metafile->world_transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
3035
3036 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
3037 }
3039 {
3041 container* cont;
3042 GpUnit unit;
3043 REAL scale_x, scale_y;
3044 GpRectF scaled_srcrect;
3046
3047 cont = calloc(1, sizeof(*cont));
3048 if (!cont)
3049 return OutOfMemory;
3050
3051 stat = GdipCloneRegion(metafile->clip, &cont->clip);
3052 if (stat != Ok)
3053 {
3054 free(cont);
3055 return stat;
3056 }
3057
3058 stat = GdipBeginContainer2(metafile->playback_graphics, &cont->state);
3059
3060 if (stat != Ok)
3061 {
3062 GdipDeleteRegion(cont->clip);
3063 free(cont);
3064 return stat;
3065 }
3066
3067 cont->id = record->StackIndex;
3068 cont->type = BEGIN_CONTAINER;
3069 cont->world_transform = *metafile->world_transform;
3070 cont->page_unit = metafile->page_unit;
3071 cont->page_scale = metafile->page_scale;
3072 list_add_head(&real_metafile->containers, &cont->entry);
3073
3074 unit = record->Header.Flags & 0xff;
3075
3076 scale_x = units_to_pixels(1.0, unit, metafile->image.xres, metafile->printer_display);
3077 scale_y = units_to_pixels(1.0, unit, metafile->image.yres, metafile->printer_display);
3078
3079 scaled_srcrect.X = scale_x * record->SrcRect.X;
3080 scaled_srcrect.Y = scale_y * record->SrcRect.Y;
3081 scaled_srcrect.Width = scale_x * record->SrcRect.Width;
3082 scaled_srcrect.Height = scale_y * record->SrcRect.Height;
3083
3084 transform.matrix[0] = record->DestRect.Width / scaled_srcrect.Width;
3085 transform.matrix[1] = 0.0;
3086 transform.matrix[2] = 0.0;
3087 transform.matrix[3] = record->DestRect.Height / scaled_srcrect.Height;
3088 transform.matrix[4] = record->DestRect.X - scaled_srcrect.X;
3089 transform.matrix[5] = record->DestRect.Y - scaled_srcrect.Y;
3090
3092
3093 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
3094 }
3097 {
3099 container* cont;
3100
3101 cont = calloc(1, sizeof(*cont));
3102 if (!cont)
3103 return OutOfMemory;
3104
3105 stat = GdipCloneRegion(metafile->clip, &cont->clip);
3106 if (stat != Ok)
3107 {
3108 free(cont);
3109 return stat;
3110 }
3111
3113 stat = GdipBeginContainer2(metafile->playback_graphics, &cont->state);
3114 else
3115 stat = GdipSaveGraphics(metafile->playback_graphics, &cont->state);
3116
3117 if (stat != Ok)
3118 {
3119 GdipDeleteRegion(cont->clip);
3120 free(cont);
3121 return stat;
3122 }
3123
3124 cont->id = record->StackIndex;
3126 cont->type = BEGIN_CONTAINER;
3127 else
3128 cont->type = SAVE_GRAPHICS;
3129 cont->world_transform = *metafile->world_transform;
3130 cont->page_unit = metafile->page_unit;
3131 cont->page_scale = metafile->page_scale;
3132 list_add_head(&real_metafile->containers, &cont->entry);
3133
3134 break;
3135 }
3138 {
3140 container* cont;
3141 enum container_type type;
3142 BOOL found=FALSE;
3143
3144 if (recordType == EmfPlusRecordTypeEndContainer)
3146 else
3148
3149 LIST_FOR_EACH_ENTRY(cont, &real_metafile->containers, container, entry)
3150 {
3151 if (cont->id == record->StackIndex && cont->type == type)
3152 {
3153 found = TRUE;
3154 break;
3155 }
3156 }
3157
3158 if (found)
3159 {
3160 container* cont2;
3161
3162 /* pop any newer items on the stack */
3163 while ((cont2 = LIST_ENTRY(list_head(&real_metafile->containers), container, entry)) != cont)
3164 {
3165 list_remove(&cont2->entry);
3166 GdipDeleteRegion(cont2->clip);
3167 free(cont2);
3168 }
3169
3170 if (type == BEGIN_CONTAINER)
3171 GdipEndContainer(real_metafile->playback_graphics, cont->state);
3172 else
3173 GdipRestoreGraphics(real_metafile->playback_graphics, cont->state);
3174
3175 *real_metafile->world_transform = cont->world_transform;
3176 real_metafile->page_unit = cont->page_unit;
3177 real_metafile->page_scale = cont->page_scale;
3178 GdipCombineRegionRegion(real_metafile->clip, cont->clip, CombineModeReplace);
3179
3180 list_remove(&cont->entry);
3181 GdipDeleteRegion(cont->clip);
3182 free(cont);
3183 }
3184
3185 break;
3186 }
3188 {
3189 return GdipSetPixelOffsetMode(real_metafile->playback_graphics, flags & 0xff);
3190 }
3192 {
3193 return GdipSetCompositingQuality(real_metafile->playback_graphics, flags & 0xff);
3194 }
3196 {
3197 return GdipSetInterpolationMode(real_metafile->playback_graphics, flags & 0xff);
3198 }
3200 {
3201 return GdipSetTextRenderingHint(real_metafile->playback_graphics, flags & 0xff);
3202 }
3204 {
3205 return GdipSetSmoothingMode(real_metafile->playback_graphics, (flags >> 1) & 0xff);
3206 }
3208 {
3209 return GdipSetCompositingMode(real_metafile->playback_graphics, flags & 0xff);
3210 }
3212 {
3213 return METAFILE_PlaybackObject(real_metafile, flags, dataSize, data);
3214 }
3216 {
3218 BYTE image = flags & 0xff;
3219 GpPointF points[3];
3220
3221 if (image >= EmfPlusObjectTableSize || real_metafile->objtable[image].type != ObjectTypeImage)
3222 return InvalidParameter;
3223
3224 if (dataSize != FIELD_OFFSET(EmfPlusDrawImage, RectData) - sizeof(EmfPlusRecordHeader) +
3225 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3226 return InvalidParameter;
3227
3229 real_metafile->objtable[draw->ImageAttributesID].type != ObjectTypeImageAttributes)
3230 return InvalidParameter;
3231
3232 if (flags & 0x4000) /* C */
3233 {
3234 points[0].X = draw->RectData.rect.X;
3235 points[0].Y = draw->RectData.rect.Y;
3236 points[1].X = points[0].X + draw->RectData.rect.Width;
3237 points[1].Y = points[0].Y;
3238 points[2].X = points[1].X;
3239 points[2].Y = points[1].Y + draw->RectData.rect.Height;
3240 }
3241 else
3242 {
3243 points[0].X = draw->RectData.rectF.X;
3244 points[0].Y = draw->RectData.rectF.Y;
3245 points[1].X = points[0].X + draw->RectData.rectF.Width;
3246 points[1].Y = points[0].Y;
3247 points[2].X = points[1].X;
3248 points[2].Y = points[1].Y + draw->RectData.rectF.Height;
3249 }
3250
3251 return GdipDrawImagePointsRect(real_metafile->playback_graphics, real_metafile->objtable[image].u.image,
3252 points, 3, draw->SrcRect.X, draw->SrcRect.Y, draw->SrcRect.Width, draw->SrcRect.Height, draw->SrcUnit,
3253 real_metafile->objtable[draw->ImageAttributesID].u.image_attributes, NULL, NULL);
3254 }
3256 {
3258 static const UINT fixed_part_size = FIELD_OFFSET(EmfPlusDrawImagePoints, PointData) -
3259 FIELD_OFFSET(EmfPlusDrawImagePoints, ImageAttributesID);
3260 BYTE image = flags & 0xff;
3261 GpPointF points[3];
3262 unsigned int i;
3263 UINT size;
3264
3265 if (image >= EmfPlusObjectTableSize || real_metafile->objtable[image].type != ObjectTypeImage)
3266 return InvalidParameter;
3267
3268 if (dataSize <= fixed_part_size)
3269 return InvalidParameter;
3270 dataSize -= fixed_part_size;
3271
3273 real_metafile->objtable[draw->ImageAttributesID].type != ObjectTypeImageAttributes)
3274 return InvalidParameter;
3275
3276 if (draw->count != 3)
3277 return InvalidParameter;
3278
3279 if ((flags >> 13) & 1) /* E */
3280 FIXME("image effects are not supported.\n");
3281
3282 if ((flags >> 11) & 1) /* P */
3283 size = sizeof(EmfPlusPointR7) * draw->count;
3284 else if ((flags >> 14) & 1) /* C */
3285 size = sizeof(EmfPlusPoint) * draw->count;
3286 else
3287 size = sizeof(EmfPlusPointF) * draw->count;
3288
3289 if (dataSize != size)
3290 return InvalidParameter;
3291
3292 if ((flags >> 11) & 1) /* P */
3293 {
3294 points[0].X = draw->PointData.pointsR[0].X;
3295 points[0].Y = draw->PointData.pointsR[0].Y;
3296 for (i = 1; i < 3; i++)
3297 {
3298 points[i].X = points[i-1].X + draw->PointData.pointsR[i].X;
3299 points[i].Y = points[i-1].Y + draw->PointData.pointsR[i].Y;
3300 }
3301 }
3302 else if ((flags >> 14) & 1) /* C */
3303 {
3304 for (i = 0; i < 3; i++)
3305 {
3306 points[i].X = draw->PointData.points[i].X;
3307 points[i].Y = draw->PointData.points[i].Y;
3308 }
3309 }
3310 else
3311 memcpy(points, draw->PointData.pointsF, sizeof(points));
3312
3313 return GdipDrawImagePointsRect(real_metafile->playback_graphics, real_metafile->objtable[image].u.image,
3314 points, 3, draw->SrcRect.X, draw->SrcRect.Y, draw->SrcRect.Width, draw->SrcRect.Height, draw->SrcUnit,
3315 real_metafile->objtable[draw->ImageAttributesID].u.image_attributes, NULL, NULL);
3316 }
3318 {
3320 GpSolidFill *solidfill = NULL;
3321 BYTE path = flags & 0xff;
3322 GpBrush *brush;
3323
3324 if (path >= EmfPlusObjectTableSize || real_metafile->objtable[path].type != ObjectTypePath)
3325 return InvalidParameter;
3326
3327 if (dataSize != sizeof(fill->data.BrushId))
3328 return InvalidParameter;
3329
3330 if (flags & 0x8000)
3331 {
3332 stat = GdipCreateSolidFill(fill->data.Color, &solidfill);
3333 if (stat != Ok)
3334 return stat;
3335 brush = (GpBrush *)solidfill;
3336 }
3337 else
3338 {
3339 if (fill->data.BrushId >= EmfPlusObjectTableSize ||
3340 real_metafile->objtable[fill->data.BrushId].type != ObjectTypeBrush)
3341 return InvalidParameter;
3342
3343 brush = real_metafile->objtable[fill->data.BrushId].u.brush;
3344 }
3345
3346 stat = GdipFillPath(real_metafile->playback_graphics, brush, real_metafile->objtable[path].u.path);
3347 GdipDeleteBrush((GpBrush *)solidfill);
3348 return stat;
3349 }
3351 {
3352 static const UINT fixed_part_size = FIELD_OFFSET(EmfPlusFillClosedCurve, PointData) -
3353 sizeof(EmfPlusRecordHeader);
3355 GpSolidFill *solidfill = NULL;
3357 GpBrush *brush;
3358 UINT size, i;
3359
3360 if (dataSize <= fixed_part_size)
3361 return InvalidParameter;
3362
3363 if (fill->Count == 0)
3364 return InvalidParameter;
3365
3366 if (flags & 0x800) /* P */
3367 size = (fixed_part_size + sizeof(EmfPlusPointR7) * fill->Count + 3) & ~3;
3368 else if (flags & 0x4000) /* C */
3369 size = fixed_part_size + sizeof(EmfPlusPoint) * fill->Count;
3370 else
3371 size = fixed_part_size + sizeof(EmfPlusPointF) * fill->Count;
3372
3373 if (dataSize != size)
3374 return InvalidParameter;
3375
3376 mode = flags & 0x200 ? FillModeWinding : FillModeAlternate; /* W */
3377
3378 if (flags & 0x8000) /* S */
3379 {
3380 stat = GdipCreateSolidFill(fill->BrushId, &solidfill);
3381 if (stat != Ok)
3382 return stat;
3383 brush = (GpBrush *)solidfill;
3384 }
3385 else
3386 {
3387 if (fill->BrushId >= EmfPlusObjectTableSize ||
3388 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3389 return InvalidParameter;
3390
3391 brush = real_metafile->objtable[fill->BrushId].u.brush;
3392 }
3393
3394 if (flags & (0x800 | 0x4000))
3395 {
3396 GpPointF *points = malloc(fill->Count * sizeof(*points));
3397 if (points)
3398 {
3399 if (flags & 0x800) /* P */
3400 {
3401 points[0].X = 0;
3402 points[0].Y = 0;
3403 for (i = 1; i < fill->Count; i++)
3404 {
3405 points[i].X = points[i - 1].X + fill->PointData.pointsR[i].X;
3406 points[i].Y = points[i - 1].Y + fill->PointData.pointsR[i].Y;
3407 }
3408 }
3409 else
3410 {
3411 for (i = 0; i < fill->Count; i++)
3412 {
3413 points[i].X = fill->PointData.points[i].X;
3414 points[i].Y = fill->PointData.points[i].Y;
3415 }
3416 }
3417
3418 stat = GdipFillClosedCurve2(real_metafile->playback_graphics, brush,
3419 points, fill->Count, fill->Tension, mode);
3420 free(points);
3421 }
3422 else
3423 stat = OutOfMemory;
3424 }
3425 else
3426 stat = GdipFillClosedCurve2(real_metafile->playback_graphics, brush,
3427 (const GpPointF *)fill->PointData.pointsF, fill->Count, fill->Tension, mode);
3428
3429 GdipDeleteBrush((GpBrush *)solidfill);
3430 return stat;
3431 }
3433 {
3435 GpSolidFill *solidfill = NULL;
3436 GpBrush *brush;
3437
3438 if (dataSize <= FIELD_OFFSET(EmfPlusFillEllipse, RectData) - sizeof(EmfPlusRecordHeader))
3439 return InvalidParameter;
3441
3442 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3443 return InvalidParameter;
3444
3445 if (flags & 0x8000)
3446 {
3447 stat = GdipCreateSolidFill(fill->BrushId, &solidfill);
3448 if (stat != Ok)
3449 return stat;
3450 brush = (GpBrush *)solidfill;
3451 }
3452 else
3453 {
3454 if (fill->BrushId >= EmfPlusObjectTableSize ||
3455 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3456 return InvalidParameter;
3457
3458 brush = real_metafile->objtable[fill->BrushId].u.brush;
3459 }
3460
3461 if (flags & 0x4000)
3462 stat = GdipFillEllipseI(real_metafile->playback_graphics, brush, fill->RectData.rect.X,
3463 fill->RectData.rect.Y, fill->RectData.rect.Width, fill->RectData.rect.Height);
3464 else
3465 stat = GdipFillEllipse(real_metafile->playback_graphics, brush, fill->RectData.rectF.X,
3466 fill->RectData.rectF.Y, fill->RectData.rectF.Width, fill->RectData.rectF.Height);
3467
3468 GdipDeleteBrush((GpBrush *)solidfill);
3469 return stat;
3470 }
3472 {
3474 GpSolidFill *solidfill = NULL;
3475 GpBrush *brush;
3476
3477 if (dataSize <= FIELD_OFFSET(EmfPlusFillPie, RectData) - sizeof(EmfPlusRecordHeader))
3478 return InvalidParameter;
3480
3481 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3482 return InvalidParameter;
3483
3484 if (flags & 0x8000) /* S */
3485 {
3486 stat = GdipCreateSolidFill(fill->BrushId, &solidfill);
3487 if (stat != Ok)
3488 return stat;
3489 brush = (GpBrush *)solidfill;
3490 }
3491 else
3492 {
3493 if (fill->BrushId >= EmfPlusObjectTableSize ||
3494 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3495 return InvalidParameter;
3496
3497 brush = real_metafile->objtable[fill->BrushId].u.brush;
3498 }
3499
3500 if (flags & 0x4000) /* C */
3501 stat = GdipFillPieI(real_metafile->playback_graphics, brush, fill->RectData.rect.X,
3502 fill->RectData.rect.Y, fill->RectData.rect.Width, fill->RectData.rect.Height,
3503 fill->StartAngle, fill->SweepAngle);
3504 else
3505 stat = GdipFillPie(real_metafile->playback_graphics, brush, fill->RectData.rectF.X,
3506 fill->RectData.rectF.Y, fill->RectData.rectF.Width, fill->RectData.rectF.Height,
3507 fill->StartAngle, fill->SweepAngle);
3508
3509 GdipDeleteBrush((GpBrush *)solidfill);
3510 return stat;
3511 }
3513 {
3515 BYTE path = flags & 0xff;
3516
3517 if (dataSize != sizeof(draw->PenId))
3518 return InvalidParameter;
3519
3521 return InvalidParameter;
3522
3523 if (real_metafile->objtable[path].type != ObjectTypePath ||
3524 real_metafile->objtable[draw->PenId].type != ObjectTypePen)
3525 return InvalidParameter;
3526
3527 return GdipDrawPath(real_metafile->playback_graphics, real_metafile->objtable[draw->PenId].u.pen,
3528 real_metafile->objtable[path].u.path);
3529 }
3531 {
3533 BYTE pen = flags & 0xff;
3534
3535 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3536 return InvalidParameter;
3537
3538 if (dataSize != FIELD_OFFSET(EmfPlusDrawArc, RectData) - sizeof(EmfPlusRecordHeader) +
3539 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3540 return InvalidParameter;
3541
3542 if (flags & 0x4000) /* C */
3543 return GdipDrawArcI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3544 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3545 draw->RectData.rect.Height, draw->StartAngle, draw->SweepAngle);
3546 else
3547 return GdipDrawArc(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3548 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3549 draw->RectData.rectF.Height, draw->StartAngle, draw->SweepAngle);
3550 }
3552 {
3554 BYTE pen = flags & 0xff;
3555
3556 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3557 return InvalidParameter;
3558
3559 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3560 return InvalidParameter;
3561
3562 if (flags & 0x4000) /* C */
3563 return GdipDrawEllipseI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3564 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3565 draw->RectData.rect.Height);
3566 else
3567 return GdipDrawEllipse(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3568 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3569 draw->RectData.rectF.Height);
3570 }
3572 {
3574 BYTE pen = flags & 0xff;
3575
3576 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3577 return InvalidParameter;
3578
3579 if (dataSize != FIELD_OFFSET(EmfPlusDrawPie, RectData) - sizeof(EmfPlusRecordHeader) +
3580 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3581 return InvalidParameter;
3582
3583 if (flags & 0x4000) /* C */
3584 return GdipDrawPieI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3585 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3586 draw->RectData.rect.Height, draw->StartAngle, draw->SweepAngle);
3587 else
3588 return GdipDrawPie(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3589 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3590 draw->RectData.rectF.Height, draw->StartAngle, draw->SweepAngle);
3591 }
3593 {
3595 BYTE pen = flags & 0xff;
3596 GpRectF *rects = NULL;
3597
3598 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3599 return InvalidParameter;
3600
3601 if (dataSize <= FIELD_OFFSET(EmfPlusDrawRects, RectData) - sizeof(EmfPlusRecordHeader))
3602 return InvalidParameter;
3604
3605 if (dataSize != draw->Count * (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3606 return InvalidParameter;
3607
3608 if (flags & 0x4000)
3609 {
3610 DWORD i;
3611
3612 rects = malloc(draw->Count * sizeof(*rects));
3613 if (!rects)
3614 return OutOfMemory;
3615
3616 for (i = 0; i < draw->Count; i++)
3617 {
3618 rects[i].X = draw->RectData.rect[i].X;
3619 rects[i].Y = draw->RectData.rect[i].Y;
3620 rects[i].Width = draw->RectData.rect[i].Width;
3621 rects[i].Height = draw->RectData.rect[i].Height;
3622 }
3623 }
3624
3625 stat = GdipDrawRectangles(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3626 rects ? rects : (GpRectF *)draw->RectData.rectF, draw->Count);
3627 free(rects);
3628 return stat;
3629 }
3631 {
3632 GpBrush *brush;
3633 DWORD expected_size;
3634 UINT16 *text;
3635 PointF *positions;
3636 GpSolidFill *solidfill = NULL;
3637 void* alignedmem = NULL;
3638 GpMatrix *matrix = NULL;
3639 BYTE font = flags & 0xff;
3641
3643 real_metafile->objtable[font].type != ObjectTypeFont)
3644 return InvalidParameter;
3645
3646 expected_size = FIELD_OFFSET(EmfPlusDrawDriverString, VariableData) -
3647 sizeof(EmfPlusRecordHeader);
3648 if (dataSize < expected_size || draw->GlyphCount <= 0)
3649 return InvalidParameter;
3650
3651 expected_size += draw->GlyphCount * (sizeof(*text) + sizeof(*positions));
3652 if (draw->MatrixPresent)
3653 expected_size += sizeof(*matrix);
3654
3655 /* Pad expected size to DWORD alignment. */
3656 expected_size = (expected_size + 3) & ~3;
3657
3658 if (dataSize != expected_size)
3659 return InvalidParameter;
3660
3661 if (flags & 0x8000)
3662 {
3663 stat = GdipCreateSolidFill(draw->brush.Color, &solidfill);
3664
3665 if (stat != Ok)
3666 return InvalidParameter;
3667
3668 brush = (GpBrush*)solidfill;
3669 }
3670 else
3671 {
3672 if (draw->brush.BrushId >= EmfPlusObjectTableSize ||
3673 real_metafile->objtable[draw->brush.BrushId].type != ObjectTypeBrush)
3674 return InvalidParameter;
3675
3676 brush = real_metafile->objtable[draw->brush.BrushId].u.brush;
3677 }
3678
3679 text = (UINT16*)&draw->VariableData[0];
3680
3681 /* If GlyphCount is odd, all subsequent fields will be 2-byte
3682 aligned rather than 4-byte aligned, which may lead to access
3683 issues. Handle this case by making our own copy of positions. */
3684 if (draw->GlyphCount % 2)
3685 {
3686 SIZE_T alloc_size = draw->GlyphCount * sizeof(*positions);
3687
3688 if (draw->MatrixPresent)
3689 alloc_size += sizeof(*matrix);
3690
3691 positions = alignedmem = malloc(alloc_size);
3692 if (!positions)
3693 {
3694 GdipDeleteBrush((GpBrush*)solidfill);
3695 return OutOfMemory;
3696 }
3697
3698 memcpy(positions, &text[draw->GlyphCount], alloc_size);
3699 }
3700 else
3701 positions = (PointF*)&text[draw->GlyphCount];
3702
3703 if (draw->MatrixPresent)
3704 matrix = (GpMatrix*)&positions[draw->GlyphCount];
3705
3707 real_metafile->objtable[font].u.font, brush, positions,
3709
3710 GdipDeleteBrush((GpBrush*)solidfill);
3711 free(alignedmem);
3712
3713 return stat;
3714 }
3716 {
3718 GpSolidFill *solidfill = NULL;
3719 GpBrush *brush;
3720 BYTE region = flags & 0xff;
3721
3722 if (dataSize != sizeof(EmfPlusFillRegion) - sizeof(EmfPlusRecordHeader))
3723 return InvalidParameter;
3724
3725 if (region >= EmfPlusObjectTableSize ||
3726 real_metafile->objtable[region].type != ObjectTypeRegion)
3727 return InvalidParameter;
3728
3729 if (flags & 0x8000)
3730 {
3731 stat = GdipCreateSolidFill(fill->data.Color, &solidfill);
3732 if (stat != Ok)
3733 return stat;
3734 brush = (GpBrush*)solidfill;
3735 }
3736 else
3737 {
3738 if (fill->data.BrushId >= EmfPlusObjectTableSize ||
3739 real_metafile->objtable[fill->data.BrushId].type != ObjectTypeBrush)
3740 return InvalidParameter;
3741
3742 brush = real_metafile->objtable[fill->data.BrushId].u.brush;
3743 }
3744
3745 stat = GdipFillRegion(real_metafile->playback_graphics, brush,
3746 real_metafile->objtable[region].u.region);
3747 GdipDeleteBrush((GpBrush*)solidfill);
3748
3749 return stat;
3750 }
3752 {
3754
3756 return InvalidParameter;
3757
3758 return GdipSetRenderingOrigin(real_metafile->playback_graphics, origin->x, origin->y);
3759 }
3760 default:
3761 if (recordType >= GDIP_EMFPLUS_RECORD_BASE)
3762 FIXME("Not implemented for EMF+ record type %u\n", recordType - GDIP_EMFPLUS_RECORD_BASE);
3763 else
3764 FIXME("Not implemented for record type %x\n", recordType);
3765 return NotImplemented;
3766 }
3767 }
3768
3769 return Ok;
3770}
GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height)
Definition: graphics.c:3017
GpStatus WINGDIPAPI GdipFillRegion(GpGraphics *graphics, GpBrush *brush, GpRegion *region)
Definition: graphics.c:4891
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
Definition: graphics.c:5229
GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics, TextRenderingHint hint)
Definition: graphics.c:6696
GpStatus WINGDIPAPI GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT16 *text, INT length, GDIPCONST GpFont *font, GDIPCONST GpBrush *brush, GDIPCONST PointF *positions, INT flags, GDIPCONST GpMatrix *matrix)
Definition: graphics.c:7903
GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state)
Definition: graphics.c:6267
GpStatus WINGDIPAPI GdipSetCompositingQuality(GpGraphics *graphics, CompositingQuality quality)
Definition: graphics.c:6469
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
Definition: graphics.c:6498
GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4258
GpStatus WINGDIPAPI GdipSetRenderingOrigin(GpGraphics *graphics, INT x, INT y)
Definition: graphics.c:6616
GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:2695
GpStatus WINGDIPAPI GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4599
GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state)
Definition: graphics.c:6400
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
Definition: graphics.c:6654
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height)
Definition: graphics.c:4452
GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode mode)
Definition: graphics.c:6587
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
Definition: matrix.c:420
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
Definition: matrix.c:257
struct EmfPlusRecordHeader EmfPlusRecordHeader
static GpStatus metafile_set_clip_region(GpMetafile *metafile, GpRegion *region, CombineMode mode)
Definition: metafile.c:2754
static GpStatus METAFILE_PlaybackObject(GpMetafile *metafile, UINT flags, UINT data_size, const BYTE *record_data)
Definition: metafile.c:2538
container_type
Definition: metafile.c:150
@ SAVE_GRAPHICS
Definition: metafile.c:152
@ BEGIN_CONTAINER
Definition: metafile.c:151
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1, GpRegion *region2, CombineMode mode)
Definition: region.c:346
#define EmfPlusObjectTableSize
@ ObjectTypeImage
@ ObjectTypeImageAttributes
@ ObjectTypePen
@ ObjectTypeFont
@ ObjectTypeRegion
@ ObjectTypeBrush
@ ObjectTypePath
#define GDIP_EMFPLUS_RECORD_BASE
Definition: gdiplusenums.h:487
CombineMode
Definition: gdiplusenums.h:387
@ EmfPlusRecordTypeGetDC
Definition: gdiplusenums.h:699
@ EmfPlusRecordTypeDrawPie
Definition: gdiplusenums.h:712
@ EmfPlusRecordTypeSetCompositingQuality
Definition: gdiplusenums.h:731
@ EmfPlusRecordTypeSetClipRect
Definition: gdiplusenums.h:745
@ EmfPlusRecordTypeSetClipPath
Definition: gdiplusenums.h:746
@ EmfPlusRecordTypeResetWorldTransform
Definition: gdiplusenums.h:738
@ EmfPlusRecordTypeEndContainer
Definition: gdiplusenums.h:736
@ EmfPlusRecordTypeSave
Definition: gdiplusenums.h:732
@ EmfPlusRecordTypeRotateWorldTransform
Definition: gdiplusenums.h:742
@ EmfPlusRecordTypeTranslateWorldTransform
Definition: gdiplusenums.h:740
@ EmfPlusRecordTypeDrawImagePoints
Definition: gdiplusenums.h:722
@ EmfPlusRecordTypeRestore
Definition: gdiplusenums.h:733
@ EmfPlusRecordTypeClear
Definition: gdiplusenums.h:704
@ EmfPlusRecordTypeFillPath
Definition: gdiplusenums.h:715
@ EmfPlusRecordTypeSetPixelOffsetMode
Definition: gdiplusenums.h:729
@ EmfPlusRecordTypeDrawArc
Definition: gdiplusenums.h:713
@ EmfPlusRecordTypeSetCompositingMode
Definition: gdiplusenums.h:730
@ EmfPlusRecordTypeBeginContainer
Definition: gdiplusenums.h:734
@ EmfPlusRecordTypeDrawDriverString
Definition: gdiplusenums.h:749
@ EmfPlusRecordTypeDrawPath
Definition: gdiplusenums.h:716
@ EmfPlusRecordTypeObject
Definition: gdiplusenums.h:703
@ EmfPlusRecordTypeFillClosedCurve
Definition: gdiplusenums.h:717
@ EmfPlusRecordTypeFillPie
Definition: gdiplusenums.h:711
@ EmfPlusRecordTypeSetWorldTransform
Definition: gdiplusenums.h:737
@ EmfPlusRecordTypeFillRects
Definition: gdiplusenums.h:705
@ EmfPlusRecordTypeDrawEllipse
Definition: gdiplusenums.h:710
@ EmfPlusRecordTypeFillEllipse
Definition: gdiplusenums.h:709
@ EmfPlusRecordTypeSetInterpolationMode
Definition: gdiplusenums.h:728
@ EmfPlusRecordTypeEndOfFile
Definition: gdiplusenums.h:697
@ EmfPlusRecordTypeDrawRects
Definition: gdiplusenums.h:706
@ EmfPlusRecordTypeSetPageTransform
Definition: gdiplusenums.h:743
@ EmfPlusRecordTypeSetRenderingOrigin
Definition: gdiplusenums.h:724
@ EmfPlusRecordTypeSetAntiAliasMode
Definition: gdiplusenums.h:725
@ EmfPlusRecordTypeBeginContainerNoParams
Definition: gdiplusenums.h:735
@ EmfPlusRecordTypeFillRegion
Definition: gdiplusenums.h:714
@ EmfPlusRecordTypeDrawImage
Definition: gdiplusenums.h:721
@ EmfPlusRecordTypeScaleWorldTransform
Definition: gdiplusenums.h:741
@ EmfPlusRecordTypeMultiplyWorldTransform
Definition: gdiplusenums.h:739
@ EmfPlusRecordTypeSetClipRegion
Definition: gdiplusenums.h:747
@ EmfPlusRecordTypeSetTextRenderingHint
Definition: gdiplusenums.h:726
FillMode
Definition: gdiplusenums.h:54
@ FillModeWinding
Definition: gdiplusenums.h:56
MatrixOrder
Definition: gdiplusenums.h:186
Unit GpUnit
GLenum GLsizei dataSize
Definition: glext.h:11123
voidpf uLong int origin
Definition: ioapi.h:144
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
EmfPlusRectF rectF
Definition: metafile.c:526
float SweepAngle
Definition: metafile.c:522
union EmfPlusDrawArc::@413 RectData
EmfPlusRect rect
Definition: metafile.c:525
float StartAngle
Definition: metafile.c:521
union EmfPlusDrawDriverString::@421 brush
DWORD DriverStringOptionsFlags
Definition: metafile.c:619
EmfPlusRect rect
Definition: metafile.c:535
EmfPlusRectF rectF
Definition: metafile.c:536
union EmfPlusDrawEllipse::@414 RectData
EmfPlusRectF SrcRect
Definition: metafile.c:502
EmfPlusPointR7 pointsR[3]
Definition: metafile.c:506
union EmfPlusDrawImagePoints::@412 PointData
EmfPlusPointF pointsF[3]
Definition: metafile.c:508
EmfPlusPoint points[3]
Definition: metafile.c:507
DWORD ImageAttributesID
Definition: metafile.c:487
union EmfPlusDrawImage::@411 RectData
EmfPlusRect rect
Definition: metafile.c:492
EmfPlusRectF rectF
Definition: metafile.c:493
EmfPlusRectF SrcRect
Definition: metafile.c:489
float SweepAngle
Definition: metafile.c:544
float StartAngle
Definition: metafile.c:543
union EmfPlusDrawPie::@415 RectData
EmfPlusRect rect
Definition: metafile.c:547
EmfPlusRectF rectF
Definition: metafile.c:548
EmfPlusRectF rectF[1]
Definition: metafile.c:559
EmfPlusRect rect[1]
Definition: metafile.c:558
union EmfPlusDrawRects::@416 RectData
float Width
Definition: metafile.c:272
float Height
Definition: metafile.c:273
SHORT Y
Definition: metafile.c:98
SHORT X
Definition: metafile.c:97
SHORT Height
Definition: metafile.c:100
SHORT Width
Definition: metafile.c:99
struct emfplus_object objtable[EmfPlusObjectTableSize]
DWORD id
Definition: metafile.c:158
REAL page_scale
Definition: metafile.c:163
GpUnit page_unit
Definition: metafile.c:162
enum container_type type
Definition: metafile.c:159
GpMatrix world_transform
Definition: metafile.c:161
GraphicsContainer state
Definition: metafile.c:160
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define EMR_STRETCHBLT
Definition: wingdi.h:150
#define STRETCH_HALFTONE
Definition: wingdi.h:959
#define EMR_BITBLT
Definition: wingdi.h:149
BOOL WINAPI PlayEnhMetaFileRecord(_In_ HDC hdc, _In_reads_(cht) LPHANDLETABLE pht, _In_ CONST ENHMETARECORD *pmr, _In_ UINT cht)
int WINAPI SetStretchBltMode(_In_ HDC, _In_ int)
Definition: dc.c:1373

Referenced by play_metafile_proc(), and test_gditransform_cb().

◆ GdipPrivateAddFontFile()

GpStatus WINGDIPAPI GdipPrivateAddFontFile ( GpFontCollection collection,
GDIPCONST WCHAR name 
)

Definition at line 1095 of file font.c.

1096{
1099 void *mem;
1101
1102 TRACE("%p, %s\n", collection, debugstr_w(name));
1103
1104 if (!collection || !name) return InvalidParameter;
1105
1108
1109 if (!GetFileSizeEx(file, &size) || size.u.HighPart)
1110 {
1112 return InvalidParameter;
1113 }
1114
1117 if (!mapping) return InvalidParameter;
1118
1121 if (!mem) return InvalidParameter;
1122
1123 /* GdipPrivateAddMemoryFont creates a copy of the memory block */
1126
1127 return status;
1128}
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define GetFileSizeEx
Definition: compat.h:757
#define MapViewOfFile
Definition: compat.h:745
#define FILE_SHARE_READ
Definition: compat.h:136
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
Definition: font.c:1479
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
Definition: mem.c:349

Referenced by test_long_name(), and test_unknownfontdecode().

◆ GdipPrivateAddMemoryFont()

GpStatus WINGDIPAPI GdipPrivateAddMemoryFont ( GpFontCollection fontCollection,
GDIPCONST void memory,
INT  length 
)

Definition at line 1479 of file font.c.

1481{
1482 WCHAR *name;
1483 DWORD count = 0;
1484 HANDLE font;
1485 GpStatus ret = Ok;
1486 TRACE("%p, %p, %d\n", fontCollection, memory, length);
1487
1488 if (!fontCollection || !memory || !length)
1489 return InvalidParameter;
1490
1492 if (!name)
1493 return OutOfMemory;
1494
1496 TRACE("%s: %p/%lu\n", debugstr_w(name), font, count);
1497 if (!font || !count)
1499 else
1500 {
1501 struct add_font_param param;
1502 LOGFONTW lfw;
1503
1504 param.hdc = CreateCompatibleDC(0);
1505
1506 /* Truncate name if necessary, GDI32 can't deal with long names */
1507 if(lstrlenW(name) > LF_FACESIZE - 1)
1508 name[LF_FACESIZE - 1] = 0;
1509
1510 lfw.lfCharSet = DEFAULT_CHARSET;
1511 lstrcpyW(lfw.lfFaceName, name);
1512 lfw.lfPitchAndFamily = 0;
1513
1514 param.collection = fontCollection;
1515 param.is_system = FALSE;
1516 if (!EnumFontFamiliesExW(param.hdc, &lfw, add_font_proc, (LPARAM)&param, 0))
1517 ret = param.stat;
1518
1519 DeleteDC(param.hdc);
1520 }
1521 free(name);
1522 return ret;
1523}
#define lstrcpyW
Definition: compat.h:749
#define NAME_ID_FULL_FONT_NAME
Definition: font.c:1143
static WCHAR * load_ttf_name_id(const BYTE *mem, DWORD_PTR size, DWORD id)
Definition: font.c:1386
static char memory[1024 *256]
Definition: process.c:122
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)

Referenced by GdipPrivateAddFontFile(), and test_GdipPrivateAddMemoryFont().

◆ GdipRecordMetafile()

GpStatus WINGDIPAPI GdipRecordMetafile ( HDC  hdc,
EmfType  type,
GDIPCONST GpRectF frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 828 of file metafile.c.

830{
831
832 TRACE("(%p %d %s %d %p %p)\n", hdc, type, debugstr_rectf(frameRect), frameUnit, desc, metafile);
833
834 return GdipRecordMetafileFileName(NULL, hdc, type, frameRect, frameUnit, desc, metafile);
835}
GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR *fileName, HDC hdc, EmfType type, GDIPCONST GpRectF *pFrameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
Definition: metafile.c:4465
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1204

Referenced by GdipRecordMetafileI(), GdipRecordMetafileStream(), test_clear(), test_clipping(), test_containers(), test_converttoemfplus(), test_drawdriverstring(), test_drawellipse(), test_drawimage(), test_drawpath(), test_drawrectangle(), test_emfonly(), test_empty(), test_fillellipse(), test_fillpath(), test_fillrect(), test_fillregion(), test_frameunit(), test_gditransform(), test_getdc(), test_lineargradient(), test_nullframerect(), test_offsetclip(), test_pagetransform(), test_pen(), test_printer_dc(), test_properties(), test_resetclip(), test_restoredc(), test_setclippath(), test_unknownfontdecode(), and test_worldtransform().

◆ GdipRecordMetafileFileName()

GpStatus WINGDIPAPI GdipRecordMetafileFileName ( GDIPCONST WCHAR fileName,
HDC  hdc,
EmfType  type,
GDIPCONST GpRectF pFrameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 4465 of file metafile.c.

4469{
4470 HDC record_dc;
4471 REAL dpix, dpiy;
4472 REAL framerect_factor_x, framerect_factor_y;
4473 RECT rc, *lprc;
4474 GpStatus stat;
4475
4476 TRACE("%s %p %d %s %d %s %p\n", debugstr_w(fileName), hdc, type, debugstr_rectf(pFrameRect),
4477 frameUnit, debugstr_w(desc), metafile);
4478
4479 if (!hdc || type < EmfTypeEmfOnly || type > EmfTypeEmfPlusDual || !metafile)
4480 return InvalidParameter;
4481
4482 dpix = (REAL)GetDeviceCaps(hdc, HORZRES) / GetDeviceCaps(hdc, HORZSIZE) * 25.4;
4483 dpiy = (REAL)GetDeviceCaps(hdc, VERTRES) / GetDeviceCaps(hdc, VERTSIZE) * 25.4;
4484
4485 if (pFrameRect)
4486 {
4487 switch (frameUnit)
4488 {
4490 framerect_factor_x = 2540.0 / dpix;
4491 framerect_factor_y = 2540.0 / dpiy;
4492 break;
4494 framerect_factor_x = framerect_factor_y = 2540.0 / 72.0;
4495 break;
4497 framerect_factor_x = framerect_factor_y = 2540.0;
4498 break;
4500 framerect_factor_x = framerect_factor_y = 2540.0 / 300.0;
4501 break;
4503 framerect_factor_x = framerect_factor_y = 100.0;
4504 break;
4506 framerect_factor_x = framerect_factor_y = 1.0;
4507 break;
4508 default:
4509 return InvalidParameter;
4510 }
4511
4512 rc.left = framerect_factor_x * pFrameRect->X;
4513 rc.top = framerect_factor_y * pFrameRect->Y;
4514 rc.right = rc.left + framerect_factor_x * pFrameRect->Width;
4515 rc.bottom = rc.top + framerect_factor_y * pFrameRect->Height;
4516
4517 lprc = &rc;
4518 }
4519 else
4520 lprc = NULL;
4521
4522 record_dc = CreateEnhMetaFileW(hdc, fileName, lprc, desc);
4523
4524 if (!record_dc)
4525 return GenericError;
4526
4527 *metafile = calloc(1, sizeof(GpMetafile));
4528 if(!*metafile)
4529 {
4531 return OutOfMemory;
4532 }
4533
4534 (*metafile)->image.type = ImageTypeMetafile;
4535 (*metafile)->image.flags = ImageFlagsNone;
4536 (*metafile)->image.palette = NULL;
4537 (*metafile)->image.xres = dpix;
4538 (*metafile)->image.yres = dpiy;
4539 (*metafile)->bounds.X = (*metafile)->bounds.Y = 0.0;
4540 (*metafile)->bounds.Width = (*metafile)->bounds.Height = 1.0;
4541 (*metafile)->unit = UnitPixel;
4542 (*metafile)->metafile_type = (MetafileType)type;
4543 (*metafile)->record_dc = record_dc;
4544 (*metafile)->comment_data = NULL;
4545 (*metafile)->comment_data_size = 0;
4546 (*metafile)->comment_data_length = 0;
4547 (*metafile)->limit_dpi = 96;
4548 (*metafile)->hemf = NULL;
4549 (*metafile)->printer_display = (GetDeviceCaps(record_dc, TECHNOLOGY) == DT_RASPRINTER);
4550 (*metafile)->logical_dpix = (REAL)GetDeviceCaps(record_dc, LOGPIXELSX);
4551 (*metafile)->logical_dpiy = (REAL)GetDeviceCaps(record_dc, LOGPIXELSY);
4552 list_init(&(*metafile)->containers);
4553
4554 if (!pFrameRect)
4555 {
4556 (*metafile)->auto_frame = TRUE;
4557 (*metafile)->auto_frame_min.X = 0;
4558 (*metafile)->auto_frame_min.Y = 0;
4559 (*metafile)->auto_frame_max.X = -1;
4560 (*metafile)->auto_frame_max.Y = -1;
4561 }
4562
4564
4565 if (stat != Ok)
4566 {
4568 free(*metafile);
4569 *metafile = NULL;
4570 return OutOfMemory;
4571 }
4572
4573 return stat;
4574}
static GpStatus METAFILE_WriteHeader(GpMetafile *metafile, HDC hdc)
Definition: metafile.c:779
@ EmfTypeEmfPlusDual
Definition: gdiplusenums.h:234
@ MetafileFrameUnitMillimeter
Definition: gdiplusenums.h:422
@ MetafileFrameUnitInch
Definition: gdiplusenums.h:420
@ MetafileFrameUnitPixel
Definition: gdiplusenums.h:418
@ MetafileFrameUnitPoint
Definition: gdiplusenums.h:419
@ MetafileFrameUnitGdi
Definition: gdiplusenums.h:423
@ MetafileFrameUnitDocument
Definition: gdiplusenums.h:421
#define HORZRES
Definition: wingdi.h:716
#define VERTSIZE
Definition: wingdi.h:715
HDC WINAPI CreateEnhMetaFileW(_In_opt_ HDC, _In_opt_ LPCWSTR, _In_opt_ LPCRECT, _In_opt_ LPCWSTR)
#define HORZSIZE
Definition: wingdi.h:714
#define VERTRES
Definition: wingdi.h:717
HENHMETAFILE WINAPI CloseEnhMetaFile(_In_ HDC hdc)
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4620

Referenced by GdipRecordMetafile().

◆ GdipRecordMetafileFileNameI()

GpStatus WINGDIPAPI GdipRecordMetafileFileNameI ( GDIPCONST WCHAR fileName,
HDC  hdc,
EmfType  type,
GDIPCONST GpRect pFrameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 4576 of file metafile.c.

4579{
4580 FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect,
4581 frameUnit, debugstr_w(desc), metafile);
4582
4583 return NotImplemented;
4584}

◆ GdipRecordMetafileI()

GpStatus WINGDIPAPI GdipRecordMetafileI ( HDC  hdc,
EmfType  type,
GDIPCONST GpRect frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 840 of file metafile.c.

842{
843 GpRectF frameRectF, *pFrameRectF;
844
845 TRACE("(%p %d %p %d %p %p)\n", hdc, type, frameRect, frameUnit, desc, metafile);
846
847 if (frameRect)
848 {
849 set_rect(&frameRectF, frameRect->X, frameRect->Y, frameRect->Width, frameRect->Height);
850 pFrameRectF = &frameRectF;
851 }
852 else
853 pFrameRectF = NULL;
854
855 return GdipRecordMetafile(hdc, type, pFrameRectF, frameUnit, desc, metafile);
856}
GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
Definition: metafile.c:828

◆ GdipRecordMetafileStream()

GpStatus WINGDIPAPI GdipRecordMetafileStream ( IStream stream,
HDC  hdc,
EmfType  type,
GDIPCONST GpRectF frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 876 of file metafile.c.

878{
880
881 TRACE("(%p %p %d %s %d %p %p)\n", stream, hdc, type, debugstr_rectf(frameRect), frameUnit, desc, metafile);
882
883 if (!stream)
884 return InvalidParameter;
885
886 stat = GdipRecordMetafile(hdc, type, frameRect, frameUnit, desc, metafile);
887
888 if (stat == Ok)
889 {
890 (*metafile)->record_stream = stream;
891 IStream_AddRef(stream);
892 }
893
894 return stat;
895}

Referenced by GdipRecordMetafileStreamI().

◆ GdipRecordMetafileStreamI()

GpStatus WINGDIPAPI GdipRecordMetafileStreamI ( IStream stream,
HDC  hdc,
EmfType  type,
GDIPCONST GpRect frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 858 of file metafile.c.

860{
861 GpRectF frameRectF, *pFrameRectF;
862
863 TRACE("(%p %p %d %p %d %p %p)\n", stream, hdc, type, frameRect, frameUnit, desc, metafile);
864
865 if (frameRect)
866 {
867 set_rect(&frameRectF, frameRect->X, frameRect->Y, frameRect->Width, frameRect->Height);
868 pFrameRectF = &frameRectF;
869 }
870 else
871 pFrameRectF = NULL;
872
873 return GdipRecordMetafileStream(stream, hdc, type, pFrameRectF, frameUnit, desc, metafile);
874}
GpStatus WINGDIPAPI GdipRecordMetafileStream(IStream *stream, HDC hdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
Definition: metafile.c:876

◆ GdipReleaseDC()

GpStatus WINGDIPAPI GdipReleaseDC ( GpGraphics graphics,
HDC  hdc 
)

Definition at line 7141 of file graphics.c.

7142{
7144
7145 TRACE("(%p, %p)\n", graphics, hdc);
7146
7147 if(!graphics || !hdc || !graphics->busy)
7148 return InvalidParameter;
7149
7150 if (is_metafile_graphics(graphics))
7151 {
7152 stat = METAFILE_ReleaseDC((GpMetafile*)graphics->image, hdc);
7153 }
7154 else if (graphics->owndc)
7155 {
7156 ReleaseDC(graphics->hwnd, graphics->temp_hdc);
7157 graphics->temp_hdc = NULL;
7158 }
7159 else if (graphics->temp_hdc == hdc)
7160 {
7161 DWORD* pos;
7162 int i;
7163
7164 /* Find the pixels that have changed, and mark them as opaque. */
7165 pos = (DWORD*)graphics->temp_bits;
7166 for (i=0; i<(graphics->temp_hbitmap_width * graphics->temp_hbitmap_height); i++)
7167 {
7168 if (*pos != DC_BACKGROUND_KEY)
7169 {
7170 *pos |= 0xff000000;
7171 }
7172 pos++;
7173 }
7174
7175 /* Write the changed pixels to the real target. */
7176 alpha_blend_pixels(graphics, 0, 0, graphics->temp_bits,
7177 graphics->temp_hbitmap_width, graphics->temp_hbitmap_height,
7179
7180 /* Clean up. */
7181 DeleteObject(graphics->temp_hbitmap);
7182 graphics->temp_hbitmap = NULL;
7183 }
7184 else if (hdc != graphics->hdc)
7185 {
7187 }
7188
7189 if (stat == Ok)
7190 graphics->busy = FALSE;
7191
7192 return stat;
7193}
GpStatus METAFILE_ReleaseDC(GpMetafile *metafile, HDC hdc)
Definition: metafile.c:1667
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)

Referenced by METAFILE_PlaybackReleaseDC(), test_alpha_hdc(), test_emfonly(), test_fromMemoryBitmap(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_GdipDrawString(), test_gditransform(), test_Get_Release_DC(), test_getdc(), test_getdc_scaled(), test_nullframerect(), and test_restoredc().

◆ GdipRemovePropertyItem()

GpStatus WINGDIPAPI GdipRemovePropertyItem ( GpImage image,
PROPID  propId 
)

Definition at line 4567 of file image.c.

4568{
4569 static int calls;
4570
4571 TRACE("(%p,%lu)\n", image, propId);
4572
4573 if(!image)
4574 return InvalidParameter;
4575
4576 if(!(calls++))
4577 FIXME("not implemented\n");
4578
4579 return NotImplemented;
4580}

◆ GdipResetClip()

GpStatus WINGDIPAPI GdipResetClip ( GpGraphics graphics)

Definition at line 6172 of file graphics.c.

6173{
6174 GpStatus stat;
6175
6176 TRACE("(%p)\n", graphics);
6177
6178 if(!graphics)
6179 return InvalidParameter;
6180
6181 if(graphics->busy)
6182 return ObjectBusy;
6183
6184 if (is_metafile_graphics(graphics))
6185 {
6186 stat = METAFILE_ResetClip((GpMetafile *)graphics->image);
6187 if (stat != Ok)
6188 return stat;
6189 }
6190
6191 return GdipSetInfinite(graphics->clip);
6192}
GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region)
Definition: region.c:1596
GpStatus METAFILE_ResetClip(GpMetafile *metafile)
Definition: metafile.c:5605

Referenced by test_clip_xform(), test_GdipGetVisibleClipBounds_window(), test_Get_Release_DC(), test_get_set_clip(), and test_resetclip().

◆ GdipResetImageAttributes()

GpStatus WINGDIPAPI GdipResetImageAttributes ( GpImageAttributes imageAttr,
ColorAdjustType  type 
)

Definition at line 323 of file imageattributes.c.

325{
326 TRACE("(%p,%u)\n", imageAttr, type);
327
328 if(!imageAttr || type >= ColorAdjustTypeCount)
329 return InvalidParameter;
330
331 memset(&imageAttr->colormatrices[type], 0, sizeof(imageAttr->colormatrices[type]));
332 GdipSetImageAttributesColorKeys(imageAttr, type, FALSE, 0, 0);
334 GdipSetImageAttributesGamma(imageAttr, type, FALSE, 0.0);
335 imageAttr->noop[type] = IMAGEATTR_NOOP_UNDEFINED;
336
337 return Ok;
338}
@ IMAGEATTR_NOOP_UNDEFINED
GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag, REAL gamma)
GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag, UINT mapSize, GDIPCONST ColorMap *map)
struct color_matrix colormatrices[ColorAdjustTypeCount]
enum imageattr_noop noop[ColorAdjustTypeCount]

Referenced by test_colorkey(), test_colormatrix(), test_gamma(), and test_remaptable().

◆ GdipResetLineTransform()

GpStatus WINGDIPAPI GdipResetLineTransform ( GpLineGradient brush)

Definition at line 2132 of file brush.c.

2133{
2134 TRACE("(%p)\n", brush);
2135
2136 if(!brush)
2137 return InvalidParameter;
2138
2139 return GdipSetMatrixElements(&brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
2140}

Referenced by test_transform().

◆ GdipResetPageTransform()

GpStatus WINGDIPAPI GdipResetPageTransform ( GpGraphics graphics)

Definition at line 7940 of file graphics.c.

7941{
7942 GpStatus stat;
7943
7944 TRACE("(%p)\n", graphics);
7945
7946 if(!graphics)
7947 return InvalidParameter;
7948
7949 if(graphics->busy)
7950 return ObjectBusy;
7951
7952 if (is_metafile_graphics(graphics))
7953 {
7955 if (stat != Ok)
7956 return stat;
7957 }
7958
7959 graphics->scale = 1.0;
7960 graphics->unit = UnitDisplay;
7961
7962 return Ok;
7963}
GpStatus METAFILE_SetPageTransform(GpMetafile *metafile, GpUnit unit, REAL scale)
Definition: metafile.c:1419

Referenced by test_Get_Release_DC(), test_getbounds(), and test_set_page_transform().

◆ GdipResetPath()

GpStatus WINGDIPAPI GdipResetPath ( GpPath path)

Definition at line 1864 of file graphicspath.c.

1865{
1866 TRACE("(%p)\n", path);
1867
1868 if(!path)
1869 return InvalidParameter;
1870
1871 path->pathdata.Count = 0;
1872 path->newfigure = TRUE;
1873 path->fill = FillModeAlternate;
1874
1875 return Ok;
1876}

Referenced by GdipPathIterNextMarkerPath(), GdipPathIterNextSubpathPath(), test_addcurve(), test_addpie(), test_arc(), test_flatten(), test_GdipFillPath(), test_line2(), test_transform(), test_translate(), test_widen(), and test_widen_cap().

◆ GdipResetPathGradientTransform()

GpStatus WINGDIPAPI GdipResetPathGradientTransform ( GpPathGradient grad)

Definition at line 1908 of file brush.c.

1909{
1910 TRACE("(%p)\n", grad);
1911
1912 if (!grad || grad->brush.bt != BrushTypePathGradient)
1913 return InvalidParameter;
1914
1915 return GdipSetMatrixElements(&grad->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
1916}

◆ GdipResetPenTransform()

GpStatus WINGDIPAPI GdipResetPenTransform ( GpPen pen)

Definition at line 433 of file pen.c.

434{
435 TRACE("(%p)\n", pen);
436
437 if(!pen)
438 return InvalidParameter;
439
440 GdipSetMatrixElements(&pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
441
442 return Ok;
443}

Referenced by test_transform().

◆ GdipResetTextureTransform()

GpStatus WINGDIPAPI GdipResetTextureTransform ( GpTexture brush)

Definition at line 1371 of file brush.c.

1372{
1373 TRACE("(%p)\n", brush);
1374
1375 if(!brush)
1376 return InvalidParameter;
1377
1378 return GdipSetMatrixElements(&brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
1379}

Referenced by test_transform().

◆ GdipResetWorldTransform()

GpStatus WINGDIPAPI GdipResetWorldTransform ( GpGraphics graphics)

Definition at line 6194 of file graphics.c.

6195{
6196 GpStatus stat;
6197
6198 TRACE("(%p)\n", graphics);
6199
6200 if(!graphics)
6201 return InvalidParameter;
6202
6203 if(graphics->busy)
6204 return ObjectBusy;
6205
6206 if (is_metafile_graphics(graphics))
6207 {
6209
6210 if (stat != Ok)
6211 return stat;
6212 }
6213
6214 return GdipSetMatrixElements(&graphics->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
6215}
GpStatus METAFILE_ResetWorldTransform(GpMetafile *metafile)
Definition: metafile.c:1546

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), test_clip_xform(), test_container_rects(), test_GdipDrawString(), test_Get_Release_DC(), test_getbounds(), test_is_outline_visible_path_point(), test_isvisible(), and test_worldtransform().

◆ GdipRestoreGraphics()

GpStatus WINGDIPAPI GdipRestoreGraphics ( GpGraphics graphics,
GraphicsState  state 
)

Definition at line 6400 of file graphics.c.

6401{
6402 TRACE("(%p, %x)\n", graphics, state);
6403 return end_container(graphics, SAVE_GRAPHICS, state);
6404}
@ SAVE_GRAPHICS
Definition: graphics.c:2148

Referenced by GdipPlayMetafileRecord(), test_clipping(), test_containers(), and test_save_restore().

◆ GdipReversePath()

GpStatus WINGDIPAPI GdipReversePath ( GpPath path)

Definition at line 1710 of file graphicspath.c.

1711{
1712 INT i, count;
1713 INT start = 0; /* position in reversed path */
1714 GpPathData revpath;
1715
1716 TRACE("(%p)\n", path);
1717
1718 if(!path)
1719 return InvalidParameter;
1720
1721 count = path->pathdata.Count;
1722
1723 if(count == 0) return Ok;
1724
1725 revpath.Points = calloc(count, sizeof(GpPointF));
1726 revpath.Types = calloc(count, sizeof(BYTE));
1727 revpath.Count = count;
1728 if(!revpath.Points || !revpath.Types){
1729 free(revpath.Points);
1730 free(revpath.Types);
1731 return OutOfMemory;
1732 }
1733
1734 for(i = 0; i < count; i++){
1735
1736 /* find next start point */
1737 if(path->pathdata.Types[count-i-1] == PathPointTypeStart){
1738 INT j;
1739 for(j = start; j <= i; j++){
1740 revpath.Points[j] = path->pathdata.Points[count-j-1];
1741 revpath.Types[j] = path->pathdata.Types[count-j-1];
1742 }
1743 /* mark start point */
1744 revpath.Types[start] = PathPointTypeStart;
1745 /* set 'figure' endpoint type */
1746 if(i-start > 1){
1747 revpath.Types[i] = path->pathdata.Types[count-start-1] & ~PathPointTypePathTypeMask;
1748 revpath.Types[i] |= revpath.Types[i-1];
1749 }
1750 else
1751 revpath.Types[i] = path->pathdata.Types[start];
1752
1753 start = i+1;
1754 }
1755 }
1756
1757 memcpy(path->pathdata.Points, revpath.Points, sizeof(GpPointF)*count);
1758 memcpy(path->pathdata.Types, revpath.Types, sizeof(BYTE)*count);
1759
1760 free(revpath.Points);
1761 free(revpath.Types);
1762
1763 return Ok;
1764}
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 GLint GLint j
Definition: glfuncs.h:250

Referenced by test_reverse().

◆ GdipRotateLineTransform()

GpStatus WINGDIPAPI GdipRotateLineTransform ( GpLineGradient brush,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 2251 of file brush.c.

2253{
2254 static int calls;
2255
2256 TRACE("(%p,%0.2f,%u)\n", brush, angle, order);
2257
2258 if(!brush || brush->brush.bt != BrushTypeLinearGradient)
2259 return InvalidParameter;
2260
2261 if(!(calls++))
2262 FIXME("(%p, %.2f, %d) stub\n", brush, angle, order);
2263
2264 return NotImplemented;
2265}

◆ GdipRotateMatrix()

GpStatus WINGDIPAPI GdipRotateMatrix ( GpMatrix matrix,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 257 of file matrix.c.

259{
260 REAL cos_theta, sin_theta, rotate[6];
261
262 TRACE("(%p, %.2f, %d)\n", debugstr_matrix(matrix), angle, order);
263
264 if(!matrix)
265 return InvalidParameter;
266
268 cos_theta = cos(angle);
269 sin_theta = sin(angle);
270
271 rotate[0] = cos_theta;
272 rotate[1] = sin_theta;
273 rotate[2] = -sin_theta;
274 rotate[3] = cos_theta;
275 rotate[4] = 0.0;
276 rotate[5] = 0.0;
277
279 matrix_multiply(matrix->matrix, rotate, matrix->matrix);
280 else if (order == MatrixOrderPrepend)
281 matrix_multiply(rotate, matrix->matrix, matrix->matrix);
282 else
283 return InvalidParameter;
284
285 return Ok;
286}
_STLP_MOVE_TO_STD_NAMESPACE void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:519
_ACRTIMP double __cdecl sin(double)
Definition: sin.c:21
_ACRTIMP double __cdecl cos(double)
Definition: cos.c:21

Referenced by draw_cap(), GDI32_GdipDrawDriverString(), GdipPlayMetafileRecord(), GdipRotatePathGradientTransform(), GdipRotatePenTransform(), GdipRotateTextureTransform(), GdipRotateWorldTransform(), test_clipping(), test_clipping_2(), test_font_transform(), and test_transform().

◆ GdipRotatePathGradientTransform()

GpStatus WINGDIPAPI GdipRotatePathGradientTransform ( GpPathGradient grad,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 1918 of file brush.c.

1920{
1921 TRACE("(%p,%0.2f,%i)\n", grad, angle, order);
1922
1923 if (!grad || grad->brush.bt != BrushTypePathGradient)
1924 return InvalidParameter;
1925
1926 return GdipRotateMatrix(&grad->transform, angle, order);
1927}

◆ GdipRotatePenTransform()

GpStatus WINGDIPAPI GdipRotatePenTransform ( GpPen pen,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 498 of file pen.c.

499{
500 TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
501
502 if(!pen)
503 return InvalidParameter;
504
505 return GdipRotateMatrix(&pen->transform, angle, order);
506}

Referenced by test_transform().

◆ GdipRotateTextureTransform()

GpStatus WINGDIPAPI GdipRotateTextureTransform ( GpTexture brush,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 2025 of file brush.c.

2027{
2028 TRACE("(%p, %.2f, %d)\n", brush, angle, order);
2029
2030 if(!brush)
2031 return InvalidParameter;
2032
2033 return GdipRotateMatrix(&brush->transform, angle, order);
2034}

Referenced by test_transform().

◆ GdipRotateWorldTransform()

GpStatus WINGDIPAPI GdipRotateWorldTransform ( GpGraphics graphics,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 6217 of file graphics.c.

6219{
6220 GpStatus stat;
6221
6222 TRACE("(%p, %.2f, %d)\n", graphics, angle, order);
6223
6224 if(!graphics)
6225 return InvalidParameter;
6226
6227 if(graphics->busy)
6228 return ObjectBusy;
6229
6230 if (is_metafile_graphics(graphics))
6231 {
6233
6234 if (stat != Ok)
6235 return stat;
6236 }
6237
6238 return GdipRotateMatrix(&graphics->worldtrans, angle, order);
6239}
GpStatus METAFILE_RotateWorldTransform(GpMetafile *metafile, REAL angle, MatrixOrder order)
Definition: metafile.c:1503

Referenced by test_GdipDrawString(), test_Get_Release_DC(), and test_worldtransform().

◆ GdipSaveAdd()

GpStatus WINGDIPAPI GdipSaveAdd ( GpImage image,
GDIPCONST EncoderParameters params 
)

Definition at line 4913 of file image.c.

4914{
4916}
GpStatus WINGDIPAPI GdipSaveAddImage(GpImage *image, GpImage *additional_image, GDIPCONST EncoderParameters *params)
Definition: image.c:4928
GLenum const GLfloat * params
Definition: glext.h:5645

Referenced by test_SavingMultiPageTiff().

◆ GdipSaveAddImage()

GpStatus WINGDIPAPI GdipSaveAddImage ( GpImage image,
GpImage additional_image,
GDIPCONST EncoderParameters params 
)

Definition at line 4928 of file image.c.

4930{
4931 TRACE("%p, %p, %p\n", image, additional_image, params);
4932
4933 if (!image || !additional_image || !params)
4934 return InvalidParameter;
4935
4936 if (!image->encoder)
4937 return Win32Error;
4938
4939 if (has_encoder_param_long(params, EncoderSaveFlag, EncoderValueFlush))
4942 return encode_frame_wic(image->encoder, additional_image);
4943 else
4944 return InvalidParameter;
4945}
GpStatus terminate_encoder_wic(GpImage *image)
Definition: image.c:4655
static GpStatus encode_frame_wic(IWICBitmapEncoder *encoder, GpImage *image)
Definition: image.c:4668
static BOOL has_encoder_param_long(GDIPCONST EncoderParameters *params, GUID param_guid, ULONG val)
Definition: image.c:4800
@ EncoderValueFlush
Definition: gdiplusenums.h:380
@ EncoderValueFrameDimensionPage
Definition: gdiplusenums.h:383
@ Win32Error
Definition: gdiplustypes.h:32

Referenced by GdipSaveAdd(), and test_SavingMultiPageTiff().

◆ GdipSaveGraphics()

GpStatus WINGDIPAPI GdipSaveGraphics ( GpGraphics graphics,
GraphicsState state 
)

Definition at line 6267 of file graphics.c.

6268{
6269 TRACE("(%p, %p)\n", graphics, state);
6270 return begin_container(graphics, SAVE_GRAPHICS, state);
6271}

Referenced by GdipPlayMetafileRecord(), test_clipping(), test_containers(), and test_save_restore().

◆ GdipSaveImageToFile()

GpStatus WINGDIPAPI GdipSaveImageToFile ( GpImage image,
GDIPCONST WCHAR filename,
GDIPCONST CLSID clsidEncoder,
GDIPCONST EncoderParameters encoderParams 
)

Definition at line 4596 of file image.c.

4599{
4600 GpStatus stat;
4601 IStream *stream;
4602
4603 TRACE("%p (%s) %p %p\n", image, debugstr_w(filename), clsidEncoder, encoderParams);
4604
4605 if (!image || !filename|| !clsidEncoder)
4606 return InvalidParameter;
4607
4608 /* this might release an old file stream held by the encoder so we can re-create it below */
4610
4612 if (stat != Ok)
4613 return GenericError;
4614
4615 stat = GdipSaveImageToStream(image, stream, clsidEncoder, encoderParams);
4616
4617 IStream_Release(stream);
4618 return stat;
4619}
GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream *stream, GDIPCONST CLSID *clsid, GDIPCONST EncoderParameters *params)
Definition: image.c:4880

Referenced by Preview_pSaveImage(), Preview_pSaveImageAs(), SetWallpaper(), test_SavingImages(), and test_SavingMultiPageTiff().

◆ GdipSaveImageToStream()

GpStatus WINGDIPAPI GdipSaveImageToStream ( GpImage image,
IStream stream,
GDIPCONST CLSID clsid,
GDIPCONST EncoderParameters params 
)

Definition at line 4880 of file image.c.

4882{
4883 GpStatus stat;
4884 encode_image_func encode_image;
4885 int i;
4886
4887 TRACE("%p, %p, %s, %p\n", image, stream, wine_dbgstr_guid(clsid), params);
4888
4889 if(!image || !stream)
4890 return InvalidParameter;
4891
4892 /* select correct encoder */
4893 encode_image = NULL;
4894 for (i = 0; i < NUM_CODECS; i++) {
4895 if ((codecs[i].info.Flags & ImageCodecFlagsEncoder) &&
4896 IsEqualCLSID(clsid, &codecs[i].info.Clsid))
4897 encode_image = codecs[i].encode_func;
4898 }
4899 if (encode_image == NULL)
4900 return UnknownImageFormat;
4901
4902 stat = encode_image(image, stream, params);
4903
4904 return stat;
4905}
GpStatus(* encode_image_func)(GpImage *image, IStream *stream, GDIPCONST EncoderParameters *params)
Definition: image.c:4381
@ UnknownImageFormat
Definition: gdiplustypes.h:38
const CLSID * clsid
Definition: msctf.cpp:50
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:171

Referenced by GdipSaveImageToFile(), test_png_save_palette(), and test_supported_encoders().

◆ GdipScaleLineTransform()

GpStatus WINGDIPAPI GdipScaleLineTransform ( GpLineGradient brush,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 2167 of file brush.c.

2169{
2170 TRACE("(%p,%0.2f,%0.2f,%u)\n", brush, sx, sy, order);
2171
2172 if(!brush)
2173 return InvalidParameter;
2174
2175 return GdipScaleMatrix(&brush->transform, sx, sy, order);
2176}

Referenced by test_transform().

◆ GdipScaleMatrix()

GpStatus WINGDIPAPI GdipScaleMatrix ( GpMatrix matrix,
REAL  scaleX,
REAL  scaleY,
GpMatrixOrder  order 
)

Definition at line 288 of file matrix.c.

290{
291 TRACE("(%s, %.2f, %.2f, %d)\n", debugstr_matrix(matrix), scaleX, scaleY, order);
292
293 if(!matrix)
294 return InvalidParameter;
295
297 {
298 matrix->matrix[0] *= scaleX;
299 matrix->matrix[1] *= scaleY;
300 matrix->matrix[2] *= scaleX;
301 matrix->matrix[3] *= scaleY;
302 matrix->matrix[4] *= scaleX;
303 matrix->matrix[5] *= scaleY;
304 }
305 else if (order == MatrixOrderPrepend)
306 {
307 matrix->matrix[0] *= scaleX;
308 matrix->matrix[1] *= scaleX;
309 matrix->matrix[2] *= scaleY;
310 matrix->matrix[3] *= scaleY;
311 }
312 else
313 return InvalidParameter;
314
315 return Ok;
316}

Referenced by draw_cap(), GdipGetLogFontW(), GdipPlayMetafileRecord(), GdipScaleLineTransform(), GdipScalePathGradientTransform(), GdipScalePenTransform(), GdipScaleTextureTransform(), GdipScaleWorldTransform(), get_graphics_transform(), linegradient_init_transform(), METAFILE_PlaybackUpdateWorldTransform(), test_clipping(), test_clipping_2(), test_font_transform(), test_scale(), test_transform(), and test_widen().

◆ GdipScalePathGradientTransform()

GpStatus WINGDIPAPI GdipScalePathGradientTransform ( GpPathGradient grad,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 1929 of file brush.c.

1931{
1932 TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, sx, sy, order);
1933
1934 if (!grad || grad->brush.bt != BrushTypePathGradient)
1935 return InvalidParameter;
1936
1937 return GdipScaleMatrix(&grad->transform, sx, sy, order);
1938}

◆ GdipScalePenTransform()

GpStatus WINGDIPAPI GdipScalePenTransform ( GpPen pen,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 488 of file pen.c.

489{
490 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order);
491
492 if(!pen)
493 return InvalidParameter;
494
495 return GdipScaleMatrix(&pen->transform, sx, sy, order);
496}

Referenced by test_transform().

◆ GdipScaleTextureTransform()

GpStatus WINGDIPAPI GdipScaleTextureTransform ( GpTexture brush,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 1384 of file brush.c.

1386{
1387 TRACE("(%p, %.2f, %.2f, %d)\n", brush, sx, sy, order);
1388
1389 if(!brush)
1390 return InvalidParameter;
1391
1392 return GdipScaleMatrix(&brush->transform, sx, sy, order);
1393}

◆ GdipScaleWorldTransform()

GpStatus WINGDIPAPI GdipScaleWorldTransform ( GpGraphics graphics,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 6406 of file graphics.c.

6408{
6409 GpStatus stat;
6410
6411 TRACE("(%p, %.2f, %.2f, %d)\n", graphics, sx, sy, order);
6412
6413 if(!graphics)
6414 return InvalidParameter;
6415
6416 if(graphics->busy)
6417 return ObjectBusy;
6418
6419 if (is_metafile_graphics(graphics)) {
6420 stat = METAFILE_ScaleWorldTransform((GpMetafile*)graphics->image, sx, sy, order);
6421
6422 if (stat != Ok)
6423 return stat;
6424 }
6425
6426 return GdipScaleMatrix(&graphics->worldtrans, sx, sy, order);
6427}
GpStatus METAFILE_ScaleWorldTransform(GpMetafile *metafile, REAL sx, REAL sy, MatrixOrder order)
Definition: metafile.c:1460

Referenced by test_clip_xform(), test_container_rects(), test_containers(), test_font_height_scaling(), test_GdipDrawString(), test_GdipGetVisibleClipBounds_window(), test_Get_Release_DC(), test_getbounds(), test_getdc_scaled(), test_gethrgn(), test_is_outline_visible_path_point(), test_isvisible(), and test_worldtransform().

◆ GdipSetAdjustableArrowCapFillState()

GpStatus WINGDIPAPI GdipSetAdjustableArrowCapFillState ( GpAdjustableArrowCap cap,
BOOL  fill 
)

Definition at line 408 of file customlinecap.c.

409{
410 TRACE("(%p,%i)\n", cap, fill);
411
412 if (!cap)
413 return InvalidParameter;
414
415 cap->cap.fill = fill;
417 return Ok;
418}

◆ GdipSetAdjustableArrowCapHeight()

GpStatus WINGDIPAPI GdipSetAdjustableArrowCapHeight ( GpAdjustableArrowCap cap,
REAL  height 
)

Definition at line 420 of file customlinecap.c.

421{
422 TRACE("(%p,%0.2f)\n", cap, height);
423
424 if (!cap)
425 return InvalidParameter;
426
427 cap->height = height;
429 return Ok;
430}

Referenced by test_create_adjustable_cap().

◆ GdipSetAdjustableArrowCapMiddleInset()

GpStatus WINGDIPAPI GdipSetAdjustableArrowCapMiddleInset ( GpAdjustableArrowCap cap,
REAL  middle 
)

Definition at line 432 of file customlinecap.c.

433{
434 TRACE("(%p,%0.2f)\n", cap, middle);
435
436 if (!cap)
437 return InvalidParameter;
438
439 cap->middle_inset = middle;
441 return Ok;
442}

Referenced by metafile_deserialize_custom_line_cap(), test_create_adjustable_cap(), and test_widen_cap().

◆ GdipSetAdjustableArrowCapWidth()

GpStatus WINGDIPAPI GdipSetAdjustableArrowCapWidth ( GpAdjustableArrowCap cap,
REAL  width 
)

Definition at line 444 of file customlinecap.c.

445{
446 TRACE("(%p,%0.2f)\n", cap, width);
447
448 if (!cap)
449 return InvalidParameter;
450
451 cap->width = width;
453 return Ok;
454}

◆ GdipSetClipGraphics()

GpStatus WINGDIPAPI GdipSetClipGraphics ( GpGraphics graphics,
GpGraphics srcgraphics,
CombineMode  mode 
)

Definition at line 6429 of file graphics.c.

6431{
6432 TRACE("(%p, %p, %d)\n", graphics, srcgraphics, mode);
6433
6434 if(!graphics || !srcgraphics)
6435 return InvalidParameter;
6436
6437 return GdipCombineRegionRegion(graphics->clip, srcgraphics->clip, mode);
6438}

◆ GdipSetClipHrgn()

GpStatus WINGDIPAPI GdipSetClipHrgn ( GpGraphics graphics,
HRGN  hrgn,
CombineMode  mode 
)

Definition at line 6774 of file graphics.c.

6775{
6776 GpRegion *region;
6779
6780 TRACE("(%p, %p, %d)\n", graphics, hrgn, mode);
6781
6782 if(!graphics)
6783 return InvalidParameter;
6784
6785 if(graphics->busy)
6786 return ObjectBusy;
6787
6788 /* hrgn is in gdi32 device units */
6789 status = GdipCreateRegionHrgn(hrgn, &region);
6790
6791 if (status == Ok)
6792 {
6794
6795 if (status == Ok)
6797
6798 if (status == Ok)
6799 status = GdipCombineRegionRegion(graphics->clip, region, mode);
6800
6801 GdipDeleteRegion(region);
6802 }
6803 return status;
6804}
GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
Definition: region.c:502

Referenced by test_cliphrgn_transform(), and test_Get_Release_DC().

◆ GdipSetClipPath()

GpStatus WINGDIPAPI GdipSetClipPath ( GpGraphics graphics,
GpPath path,
CombineMode  mode 
)

Definition at line 6806 of file graphics.c.

6807{
6809 GpPath *clip_path;
6810
6811 TRACE("(%p, %p, %d)\n", graphics, path, mode);
6812
6813 if(!graphics)
6814 return InvalidParameter;
6815
6816 if(graphics->busy)
6817 return ObjectBusy;
6818
6819 if (is_metafile_graphics(graphics))
6820 {
6822 if (status != Ok)
6823 return status;
6824 }
6825
6826 status = GdipClonePath(path, &clip_path);
6827 if (status == Ok)
6828 {
6829 GpMatrix world_to_device;
6830
6832 CoordinateSpaceWorld, &world_to_device);
6833 status = GdipTransformPath(clip_path, &world_to_device);
6834 if (status == Ok)
6835 GdipCombineRegionPath(graphics->clip, clip_path, mode);
6836
6837 GdipDeletePath(clip_path);
6838 }
6839 return status;
6840}
GpStatus METAFILE_SetClipPath(GpMetafile *metafile, GpPath *path, CombineMode mode)
Definition: metafile.c:5626

Referenced by test_Get_Release_DC(), test_get_set_clip(), and test_setclippath().

◆ GdipSetClipRect()

GpStatus WINGDIPAPI GdipSetClipRect ( GpGraphics graphics,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
CombineMode  mode 
)

Definition at line 6842 of file graphics.c.

6845{
6847 GpRectF rect;
6848 GpRegion *region;
6849
6850 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %d)\n", graphics, x, y, width, height, mode);
6851
6852 if(!graphics)
6853 return InvalidParameter;
6854
6855 if(graphics->busy)
6856 return ObjectBusy;
6857
6858 if (is_metafile_graphics(graphics))
6859 {
6861 if (status != Ok)
6862 return status;
6863 }
6864
6865 set_rect(&rect, x, y, width, height);
6866 status = GdipCreateRegionRect(&rect, &region);
6867 if (status == Ok)
6868 {
6869 GpMatrix world_to_device;
6870 BOOL identity;
6871
6873 status = GdipIsMatrixIdentity(&world_to_device, &identity);
6874 if (status == Ok && !identity)
6875 status = GdipTransformRegion(region, &world_to_device);
6876 if (status == Ok)
6877 status = GdipCombineRegionRegion(graphics->clip, region, mode);
6878
6879 GdipDeleteRegion(region);
6880 }
6881 return status;
6882}
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:513
GpStatus METAFILE_SetClipRect(GpMetafile *metafile, REAL x, REAL y, REAL width, REAL height, CombineMode mode)
Definition: metafile.c:1350

Referenced by GdipSetClipRectI(), test_BeginContainer2(), test_clip_xform(), test_clipping(), test_GdipGetVisibleClipBounds_screen(), test_GdipGetVisibleClipBounds_window(), test_GdipIsVisiblePoint(), test_GdipIsVisibleRect(), test_Get_Release_DC(), and test_isvisible().

◆ GdipSetClipRectI()

GpStatus WINGDIPAPI GdipSetClipRectI ( GpGraphics graphics,
INT  x,
INT  y,
INT  width,
INT  height,
CombineMode  mode 
)

Definition at line 6884 of file graphics.c.

6887{
6888 TRACE("(%p, %d, %d, %d, %d, %d)\n", graphics, x, y, width, height, mode);
6889
6890 if(!graphics)
6891 return InvalidParameter;
6892
6893 if(graphics->busy)
6894 return ObjectBusy;
6895
6896 return GdipSetClipRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, mode);
6897}
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, CombineMode mode)
Definition: graphics.c:6842

Referenced by test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_GdipGetVisibleClipBounds_memoryDC(), and test_Get_Release_DC().

◆ GdipSetClipRegion()

GpStatus WINGDIPAPI GdipSetClipRegion ( GpGraphics graphics,
GpRegion region,
CombineMode  mode 
)

Definition at line 6899 of file graphics.c.

6901{
6903 GpRegion *clip;
6904
6905 TRACE("(%p, %p, %d)\n", graphics, region, mode);
6906
6907 if(!graphics || !region)
6908 return InvalidParameter;
6909
6910 if(graphics->busy)
6911 return ObjectBusy;
6912
6913 if (is_metafile_graphics(graphics))
6914 {
6915 status = METAFILE_SetClipRegion((GpMetafile*)graphics->image, region, mode);
6916 if (status != Ok)
6917 return status;
6918 }
6919
6920 status = GdipCloneRegion(region, &clip);
6921 if (status == Ok)
6922 {
6923 GpMatrix world_to_device;
6924 BOOL identity;
6925
6927 status = GdipIsMatrixIdentity(&world_to_device, &identity);
6928 if (status == Ok && !identity)
6929 status = GdipTransformRegion(clip, &world_to_device);
6930 if (status == Ok)
6931 status = GdipCombineRegionRegion(graphics->clip, clip, mode);
6932
6933 GdipDeleteRegion(clip);
6934 }
6935 return status;
6936}
GpStatus METAFILE_SetClipRegion(GpMetafile *metafile, GpRegion *region, CombineMode mode)
Definition: metafile.c:1395

Referenced by test_clipping(), test_clipping_2(), test_Get_Release_DC(), and test_get_set_clip().

◆ GdipSetCompositingMode()

GpStatus WINGDIPAPI GdipSetCompositingMode ( GpGraphics graphics,
CompositingMode  mode 
)

Definition at line 6440 of file graphics.c.

6442{
6443 TRACE("(%p, %d)\n", graphics, mode);
6444
6445 if(!graphics)
6446 return InvalidParameter;
6447
6448 if(graphics->busy)
6449 return ObjectBusy;
6450
6451 if(graphics->compmode == mode)
6452 return Ok;
6453
6454 if (is_metafile_graphics(graphics))
6455 {
6456 GpStatus stat;
6457
6460 if(stat != Ok)
6461 return stat;
6462 }
6463
6464 graphics->compmode = mode;
6465
6466 return Ok;
6467}
GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val)
Definition: metafile.c:4839

Referenced by GdipGraphicsClear(), GdipPlayMetafileRecord(), test_BeginContainer2(), test_DrawImage_SourceCopy(), test_Get_Release_DC(), and test_properties().

◆ GdipSetCompositingQuality()

GpStatus WINGDIPAPI GdipSetCompositingQuality ( GpGraphics graphics,
CompositingQuality  quality 
)

Definition at line 6469 of file graphics.c.

6471{
6472 TRACE("(%p, %d)\n", graphics, quality);
6473
6474 if(!graphics)
6475 return InvalidParameter;
6476
6477 if(graphics->busy)
6478 return ObjectBusy;
6479
6480 if(graphics->compqual == quality)
6481 return Ok;
6482
6483 if (is_metafile_graphics(graphics))
6484 {
6485 GpStatus stat;
6486
6489 if(stat != Ok)
6490 return stat;
6491 }
6492
6493 graphics->compqual = quality;
6494
6495 return Ok;
6496}

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_Get_Release_DC(), and test_properties().

◆ GdipSetCustomLineCapBaseCap()

GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap ( GpCustomLineCap custom,
GpLineCap  basecap 
)

Definition at line 196 of file customlinecap.c.

198{
199 TRACE("(%p,%u)\n", custom, basecap);
200 if(!custom || basecap > LineCapTriangle)
201 return InvalidParameter;
202
203 custom->basecap = basecap;
204
205 return Ok;
206}

Referenced by test_create_adjustable_cap().

◆ GdipSetCustomLineCapBaseInset()

GpStatus WINGDIPAPI GdipSetCustomLineCapBaseInset ( GpCustomLineCap custom,
REAL  inset 
)

Definition at line 221 of file customlinecap.c.

223{
224 TRACE("(%p,%0.2f)\n", custom, inset);
225
226 if(!custom)
227 return InvalidParameter;
228
229 custom->inset = inset;
230
231 return Ok;
232}

Referenced by test_inset().

◆ GdipSetCustomLineCapStrokeCaps()

GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps ( GpCustomLineCap custom,
GpLineCap  startcap,
GpLineCap  endcap 
)

Definition at line 182 of file customlinecap.c.

184{
185 TRACE("(%p,%u,%u)\n", custom, startcap, endcap);
186
187 if(!custom || startcap > LineCapTriangle || endcap > LineCapTriangle)
188 return InvalidParameter;
189
190 custom->strokeStartCap = startcap;
191 custom->strokeEndCap = endcap;
192
193 return Ok;
194}
GpLineCap strokeEndCap
GpLineCap strokeStartCap

Referenced by metafile_deserialize_custom_line_cap(), and test_strokecap().

◆ GdipSetCustomLineCapStrokeJoin()

GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeJoin ( GpCustomLineCap custom,
GpLineJoin  join 
)

Definition at line 235 of file customlinecap.c.

237{
238 TRACE("(%p, %d)\n", custom, join);
239
240 if(!custom)
241 return InvalidParameter;
242
243 custom->join = join;
244
245 return Ok;
246}
LOCAL int join(int *aux, int a, int b)
Definition: match.c:560

Referenced by metafile_deserialize_custom_line_cap(), and test_linejoin().

◆ GdipSetCustomLineCapWidthScale()

GpStatus WINGDIPAPI GdipSetCustomLineCapWidthScale ( GpCustomLineCap custom,
REAL  width 
)

Definition at line 248 of file customlinecap.c.

249{
250 TRACE("(%p,%0.2f)\n", custom, width);
251
252 if(!custom)
253 return InvalidParameter;
254
255 custom->scale = width;
256
257 return Ok;
258}

Referenced by metafile_deserialize_custom_line_cap(), and test_scale().

◆ GdipSetEffectParameters()

GpStatus WINGDIPAPI GdipSetEffectParameters ( CGpEffect effect,
const VOID params,
const  UINT 
)

Definition at line 5656 of file image.c.

5658{
5659 static int calls;
5660
5661 TRACE("(%p,%p,%u)\n", effect, params, size);
5662
5663 if(!(calls++))
5664 FIXME("not implemented\n");
5665
5666 return NotImplemented;
5667}

◆ GdipSetEmpty()

◆ GdipSetImageAttributesCachedBackground()

GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground ( GpImageAttributes imageAttr,
BOOL  enableFlag 
)

Definition at line 191 of file imageattributes.c.

193{
194 static int calls;
195
196 TRACE("(%p,%i)\n", imageAttr, enableFlag);
197
198 if(!(calls++))
199 FIXME("not implemented\n");
200
201 return NotImplemented;
202}

◆ GdipSetImageAttributesColorKeys()

GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys ( GpImageAttributes imageattr,
ColorAdjustType  type,
BOOL  enableFlag,
ARGB  colorLow,
ARGB  colorHigh 
)

Definition at line 129 of file imageattributes.c.

131{
132 TRACE("(%p,%u,%i,%08lx,%08lx)\n", imageattr, type, enableFlag, colorLow, colorHigh);
133
134 if(!imageattr || type >= ColorAdjustTypeCount)
135 return InvalidParameter;
136
137 imageattr->colorkeys[type].enabled = enableFlag;
138 imageattr->colorkeys[type].low = colorLow;
139 imageattr->colorkeys[type].high = colorHigh;
140
141 return Ok;
142}
struct color_key colorkeys[ColorAdjustTypeCount]

Referenced by GdipResetImageAttributes(), and test_colorkey().

◆ GdipSetImageAttributesColorMatrix()

GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix ( GpImageAttributes imageattr,
ColorAdjustType  type,
BOOL  enableFlag,
GDIPCONST ColorMatrix colorMatrix,
GDIPCONST ColorMatrix grayMatrix,
ColorMatrixFlags  flags 
)

Definition at line 144 of file imageattributes.c.

147{
148 TRACE("(%p,%u,%i,%p,%p,%u)\n", imageattr, type, enableFlag, colorMatrix,
149 grayMatrix, flags);
150
152 return InvalidParameter;
153
154 if (enableFlag)
155 {
156 if (!colorMatrix)
157 return InvalidParameter;
158
160 {
161 if (!grayMatrix)
162 return InvalidParameter;
163
164 imageattr->colormatrices[type].graymatrix = *grayMatrix;
165 }
166
167 imageattr->colormatrices[type].colormatrix = *colorMatrix;
168 imageattr->colormatrices[type].flags = flags;
169 }
170
171 imageattr->colormatrices[type].enabled = enableFlag;
172
173 return Ok;
174}
@ ColorMatrixFlagsAltGray

Referenced by test_colormatrix(), and test_drawimage().

◆ GdipSetImageAttributesGamma()

GpStatus WINGDIPAPI GdipSetImageAttributesGamma ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag,
REAL  gamma 
)

Definition at line 204 of file imageattributes.c.

206{
207 TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, gamma);
208
209 if (!imageAttr || (enableFlag && gamma <= 0.0) || type >= ColorAdjustTypeCount)
210 return InvalidParameter;
211
212 imageAttr->gamma_enabled[type] = enableFlag;
213 imageAttr->gamma[type] = gamma;
214
215 return Ok;
216}
REAL gamma[ColorAdjustTypeCount]
BOOL gamma_enabled[ColorAdjustTypeCount]

Referenced by GdipResetImageAttributes(), and test_gamma().

◆ GdipSetImageAttributesNoOp()

GpStatus WINGDIPAPI GdipSetImageAttributesNoOp ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag 
)

Definition at line 218 of file imageattributes.c.

220{
221 TRACE("(%p,%u,%i)\n", imageAttr, type, enableFlag);
222
224 return InvalidParameter;
225
226 imageAttr->noop[type] = enableFlag ? IMAGEATTR_NOOP_SET : IMAGEATTR_NOOP_CLEAR;
227
228 return Ok;
229}
@ IMAGEATTR_NOOP_CLEAR
@ IMAGEATTR_NOOP_SET

Referenced by test_colormatrix().

◆ GdipSetImageAttributesOutputChannel()

GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag,
ColorChannelFlags  channelFlags 
)

Definition at line 231 of file imageattributes.c.

233{
234 static int calls;
235
236 TRACE("(%p,%u,%i,%x)\n", imageAttr, type, enableFlag, channelFlags);
237
238 if(!(calls++))
239 FIXME("not implemented\n");
240
241 return NotImplemented;
242}

◆ GdipSetImageAttributesOutputChannelColorProfile()

GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag,
GDIPCONST WCHAR colorProfileFilename 
)

Definition at line 244 of file imageattributes.c.

247{
248 static int calls;
249
250 TRACE("(%p,%u,%i,%s)\n", imageAttr, type, enableFlag, debugstr_w(colorProfileFilename));
251
252 if(!(calls++))
253 FIXME("not implemented\n");
254
255 return NotImplemented;
256}

◆ GdipSetImageAttributesRemapTable()

GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag,
UINT  mapSize,
GDIPCONST ColorMap map 
)

Definition at line 258 of file imageattributes.c.

261{
262 ColorMap *new_map;
263
264 TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
265
266 if(!imageAttr || type >= ColorAdjustTypeCount)
267 return InvalidParameter;
268
269 if (enableFlag)
270 {
271 if(!map || !mapSize)
272 return InvalidParameter;
273
274 new_map = malloc(sizeof(*map) * mapSize);
275
276 if (!new_map)
277 return OutOfMemory;
278
279 memcpy(new_map, map, sizeof(*map) * mapSize);
280
281 free(imageAttr->colorremaptables[type].colormap);
282
283 imageAttr->colorremaptables[type].mapsize = mapSize;
284 imageAttr->colorremaptables[type].colormap = new_map;
285 }
286 else
287 {
288 free(imageAttr->colorremaptables[type].colormap);
289 imageAttr->colorremaptables[type].colormap = NULL;
290 }
291
292 imageAttr->colorremaptables[type].enabled = enableFlag;
293
294 return Ok;
295}
Definition: _map.h:48

Referenced by GdipResetImageAttributes(), test_getadjustedpalette(), and test_remaptable().

◆ GdipSetImageAttributesThreshold()

GpStatus WINGDIPAPI GdipSetImageAttributesThreshold ( GpImageAttributes imageAttr,
ColorAdjustType  type,
BOOL  enableFlag,
REAL  threshold 
)

Definition at line 297 of file imageattributes.c.

299{
300 static int calls;
301
302 TRACE("(%p,%u,%i,%0.2f)\n", imageAttr, type, enableFlag, threshold);
303
304 if(!(calls++))
305 FIXME("not implemented\n");
306
307 return NotImplemented;
308}

◆ GdipSetImageAttributesToIdentity()

GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity ( GpImageAttributes imageAttr,
ColorAdjustType  type 
)

Definition at line 310 of file imageattributes.c.

312{
313 static int calls;
314
315 TRACE("(%p,%u)\n", imageAttr, type);
316
317 if(!(calls++))
318 FIXME("not implemented\n");
319
320 return NotImplemented;
321}

◆ GdipSetImageAttributesWrapMode()

GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode ( GpImageAttributes imageAttr,
WrapMode  wrap,
ARGB  argb,
BOOL  clamp 
)

Definition at line 176 of file imageattributes.c.

178{
179 TRACE("(%p,%u,%08lx,%i)\n", imageAttr, wrap, argb, clamp);
180
181 if(!imageAttr || wrap > WrapModeClamp)
182 return InvalidParameter;
183
184 imageAttr->wrap = wrap;
185 imageAttr->outside_color = argb;
186 imageAttr->clamp = clamp;
187
188 return Ok;
189}
GLenum clamp
Definition: glext.h:6216

Referenced by METAFILE_PlaybackObject(), and ZoomWnd_OnDraw().

◆ GdipSetImagePalette()

GpStatus WINGDIPAPI GdipSetImagePalette ( GpImage image,
GDIPCONST ColorPalette palette 
)

Definition at line 4984 of file image.c.

4986{
4987 ColorPalette *new_palette;
4988
4989 TRACE("(%p,%p)\n", image, palette);
4990
4991 if(!image || !palette || palette->Count > 256)
4992 return InvalidParameter;
4993
4994 new_palette = calloc(1, 2 * sizeof(UINT) + palette->Count * sizeof(ARGB));
4995 if (!new_palette) return OutOfMemory;
4996
4997 free(image->palette);
4998 image->palette = new_palette;
4999 image->palette->Flags = palette->Flags;
5000 image->palette->Count = palette->Count;
5001 memcpy(image->palette->Entries, palette->Entries, sizeof(ARGB)*palette->Count);
5002
5003 return Ok;
5004}

Referenced by GdipCreateBitmapFromHBITMAP(), metafile_deserialize_image(), test_bitmapbits(), and test_palette().

◆ GdipSetInfinite()

GpStatus WINGDIPAPI GdipSetInfinite ( GpRegion region)

Definition at line 1596 of file region.c.

1597{
1598 GpStatus stat;
1599
1600 TRACE("%p\n", region);
1601
1602 if (!region)
1603 return InvalidParameter;
1604
1605 delete_element(&region->node);
1607
1608 return stat;
1609}

Referenced by GdipResetClip(), test_gethrgn(), test_getregiondata(), and test_isequal().

◆ GdipSetInterpolationMode()

GpStatus WINGDIPAPI GdipSetInterpolationMode ( GpGraphics graphics,
InterpolationMode  mode 
)

Definition at line 6498 of file graphics.c.

6500{
6501 TRACE("(%p, %d)\n", graphics, mode);
6502
6504 return InvalidParameter;
6505
6506 if(graphics->busy)
6507 return ObjectBusy;
6508
6511
6514
6515 if (mode == graphics->interpolation)
6516 return Ok;
6517
6518 if (is_metafile_graphics(graphics))
6519 {
6520 GpStatus stat;
6521
6524 if (stat != Ok)
6525 return stat;
6526 }
6527
6528 graphics->interpolation = mode;
6529
6530 return Ok;
6531}
@ InterpolationModeHighQualityBicubic
Definition: gdiplusenums.h:149
@ InterpolationModeInvalid
Definition: gdiplusenums.h:141
@ InterpolationModeHighQuality
Definition: gdiplusenums.h:144
@ InterpolationModeDefault
Definition: gdiplusenums.h:142
@ InterpolationModeLowQuality
Definition: gdiplusenums.h:143

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_DrawImage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_GdipDrawImagePointRect(), test_Get_Release_DC(), test_get_set_interpolation(), test_properties(), test_save_restore(), and ZoomWnd_OnDraw().

◆ GdipSetLineBlend()

GpStatus WINGDIPAPI GdipSetLineBlend ( GpLineGradient brush,
GDIPCONST REAL factors,
GDIPCONST REAL positions,
INT  count 
)

Definition at line 1395 of file brush.c.

1397{
1398 REAL *new_blendfac, *new_blendpos;
1399
1400 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1401
1402 if(!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient ||
1403 (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f)))
1404 return InvalidParameter;
1405
1406 new_blendfac = malloc(count * sizeof(REAL));
1407 new_blendpos = malloc(count * sizeof(REAL));
1408
1409 if (!new_blendfac || !new_blendpos)
1410 {
1411 free(new_blendfac);
1412 free(new_blendpos);
1413 return OutOfMemory;
1414 }
1415
1416 memcpy(new_blendfac, factors, count * sizeof(REAL));
1417 memcpy(new_blendpos, positions, count * sizeof(REAL));
1418
1419 free(brush->blendfac);
1420 free(brush->blendpos);
1421
1422 brush->blendcount = count;
1423 brush->blendfac = new_blendfac;
1424 brush->blendpos = new_blendpos;
1425
1426 return Ok;
1427}

Referenced by GdipSetLineLinearBlend(), GdipSetLineSigmaBlend(), metafile_deserialize_brush(), test_lineargradient(), and test_lineblend().

◆ GdipSetLineColors()

GpStatus WINGDIPAPI GdipSetLineColors ( GpLineGradient brush,
ARGB  color1,
ARGB  color2 
)

Definition at line 1995 of file brush.c.

1997{
1998 TRACE("(%p, %lx, %lx)\n", brush, color1, color2);
1999
2000 if(!brush || brush->brush.bt != BrushTypeLinearGradient)
2001 return InvalidParameter;
2002
2003 brush->startcolor = color1;
2004 brush->endcolor = color2;
2005
2006 return Ok;
2007}

◆ GdipSetLineGammaCorrection()

GpStatus WINGDIPAPI GdipSetLineGammaCorrection ( GpLineGradient line,
BOOL  usegamma 
)

Definition at line 1458 of file brush.c.

1460{
1461 TRACE("(%p, %d)\n", line, usegamma);
1462
1463 if(!line || line->brush.bt != BrushTypeLinearGradient)
1464 return InvalidParameter;
1465
1466 line->gamma = usegamma;
1467
1468 return Ok;
1469}

◆ GdipSetLineLinearBlend()

GpStatus WINGDIPAPI GdipSetLineLinearBlend ( GpLineGradient brush,
REAL  focus,
REAL  scale 
)

Definition at line 2036 of file brush.c.

2038{
2039 REAL factors[3];
2040 REAL positions[3];
2041 int num_points = 0;
2042
2043 TRACE("(%p,%.2f,%.2f)\n", brush, focus, scale);
2044
2045 if (!brush) return InvalidParameter;
2046
2047 if (focus != 0.0)
2048 {
2049 factors[num_points] = 0.0;
2050 positions[num_points] = 0.0;
2051 num_points++;
2052 }
2053
2054 factors[num_points] = scale;
2055 positions[num_points] = focus;
2056 num_points++;
2057
2058 if (focus != 1.0)
2059 {
2060 factors[num_points] = 0.0;
2061 positions[num_points] = 1.0;
2062 num_points++;
2063 }
2064
2065 return GdipSetLineBlend(brush, factors, positions, num_points);
2066}
GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *factors, GDIPCONST REAL *positions, INT count)
Definition: brush.c:1395

Referenced by test_linelinearblend().

◆ GdipSetLinePresetBlend()

GpStatus WINGDIPAPI GdipSetLinePresetBlend ( GpLineGradient brush,
GDIPCONST ARGB blend,
GDIPCONST REAL positions,
INT  count 
)

Definition at line 2068 of file brush.c.

2070{
2071 ARGB *new_color;
2072 REAL *new_pos;
2073 TRACE("(%p,%p,%p,%i)\n", brush, blend, positions, count);
2074
2075 if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient ||
2076 positions[0] != 0.0f || positions[count-1] != 1.0f)
2077 {
2078 return InvalidParameter;
2079 }
2080
2081 new_color = malloc(count * sizeof(ARGB));
2082 new_pos = malloc(count * sizeof(REAL));
2083 if (!new_color || !new_pos)
2084 {
2085 free(new_color);
2086 free(new_pos);
2087 return OutOfMemory;
2088 }
2089
2090 memcpy(new_color, blend, sizeof(ARGB) * count);
2091 memcpy(new_pos, positions, sizeof(REAL) * count);
2092
2093 free(brush->pblendcolor);
2094 free(brush->pblendpos);
2095
2096 brush->pblendcolor = new_color;
2097 brush->pblendpos = new_pos;
2098 brush->pblendcount = count;
2099
2100 return Ok;
2101}

Referenced by metafile_deserialize_brush(), test_lineargradient(), and test_lineblend().

◆ GdipSetLineSigmaBlend()

GpStatus WINGDIPAPI GdipSetLineSigmaBlend ( GpLineGradient line,
REAL  focus,
REAL  scale 
)

Definition at line 1471 of file brush.c.

1473{
1474 REAL factors[33];
1475 REAL positions[33];
1476 int num_points = 0;
1477 int i;
1478 const int precision = 16;
1479 REAL erf_range; /* we use values erf(-erf_range) through erf(+erf_range) */
1480 REAL min_erf;
1481 REAL scale_erf;
1482
1483 TRACE("(%p, %0.2f, %0.2f)\n", line, focus, scale);
1484
1485 if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || line->brush.bt != BrushTypeLinearGradient)
1486 return InvalidParameter;
1487
1488 /* we want 2 standard deviations */
1489 erf_range = 2.0 / sqrt(2);
1490
1491 /* calculate the constants we need to normalize the error function to be
1492 between 0.0 and scale over the range we need */
1493 min_erf = erf(-erf_range);
1494 scale_erf = scale / (-2.0 * min_erf);
1495
1496 if (focus != 0.0)
1497 {
1498 positions[0] = 0.0;
1499 factors[0] = 0.0;
1500 for (i=1; i<precision; i++)
1501 {
1502 positions[i] = focus * i / precision;
1503 factors[i] = scale_erf * (erf(2 * erf_range * i / precision - erf_range) - min_erf);
1504 }
1505 num_points += precision;
1506 }
1507
1508 positions[num_points] = focus;
1509 factors[num_points] = scale;
1510 num_points += 1;
1511
1512 if (focus != 1.0)
1513 {
1514 for (i=1; i<precision; i++)
1515 {
1516 positions[i+num_points-1] = (focus + ((1.0-focus) * i / precision));
1517 factors[i+num_points-1] = scale_erf * (erf(erf_range - 2 * erf_range * i / precision) - min_erf);
1518 }
1519 num_points += precision;
1520 positions[num_points-1] = 1.0;
1521 factors[num_points-1] = 0.0;
1522 }
1523
1524 return GdipSetLineBlend(line, factors, positions, num_points);
1525}
_ACRTIMP double __cdecl sqrt(double)
Definition: sqrt.c:5
_ACRTIMP double __cdecl erf(double)
GLenum GLint GLint * precision
Definition: glext.h:7539

◆ GdipSetLineTransform()

GpStatus WINGDIPAPI GdipSetLineTransform ( GpLineGradient brush,
GDIPCONST GpMatrix matrix 
)

Definition at line 2142 of file brush.c.

2144{
2145 TRACE("(%p,%s)\n", brush, debugstr_matrix(matrix));
2146
2147 if(!brush || !matrix)
2148 return InvalidParameter;
2149
2150 brush->transform = *matrix;
2151
2152 return Ok;
2153}

Referenced by metafile_deserialize_brush(), and test_transform().

◆ GdipSetLineWrapMode()

GpStatus WINGDIPAPI GdipSetLineWrapMode ( GpLineGradient line,
GpWrapMode  wrap 
)

Definition at line 1527 of file brush.c.

1529{
1530 TRACE("(%p, %d)\n", line, wrap);
1531
1532 if(!line || wrap == WrapModeClamp || line->brush.bt != BrushTypeLinearGradient)
1533 return InvalidParameter;
1534
1535 line->wrap = wrap;
1536
1537 return Ok;
1538}

◆ GdipSetMatrixElements()

◆ GdipSetMetafileDownLevelRasterizationLimit()

GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit ( GpMetafile metafile,
UINT  limitDpi 
)

Definition at line 4417 of file metafile.c.

4419{
4420 TRACE("(%p,%u)\n", metafile, limitDpi);
4421
4422 if (limitDpi == 0)
4423 limitDpi = 96;
4424
4425 if (!metafile || limitDpi < 10)
4426 return InvalidParameter;
4427
4428 if (!metafile->record_dc)
4429 return WrongState;
4430
4431 metafile->limit_dpi = limitDpi;
4432
4433 return Ok;
4434}

Referenced by test_empty().

◆ GdipSetPageScale()

GpStatus WINGDIPAPI GdipSetPageScale ( GpGraphics graphics,
REAL  scale 
)

Definition at line 6533 of file graphics.c.

6534{
6535 GpStatus stat;
6536
6537 TRACE("(%p, %.2f)\n", graphics, scale);
6538
6539 if(!graphics)
6540 return InvalidParameter;
6541
6542 if(graphics->busy)
6543 return ObjectBusy;
6544
6545 if(scale <= 0.0)
6546 return InvalidParameter;
6547
6548 if (is_metafile_graphics(graphics))
6549 {
6550 stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, graphics->unit, scale);
6551 if (stat != Ok)
6552 return stat;
6553 }
6554
6555 graphics->scale = scale;
6556
6557 return Ok;
6558}

Referenced by create_graphics(), GdipEnumerateMetafileSrcRectDestPoints(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_Get_Release_DC(), test_getbounds(), test_pagetransform(), test_pen_thickness(), test_set_page_transform(), and test_transformpoints().

◆ GdipSetPageUnit()

GpStatus WINGDIPAPI GdipSetPageUnit ( GpGraphics graphics,
GpUnit  unit 
)

Definition at line 6560 of file graphics.c.

6561{
6562 GpStatus stat;
6563
6564 TRACE("(%p, %d)\n", graphics, unit);
6565
6566 if(!graphics)
6567 return InvalidParameter;
6568
6569 if(graphics->busy)
6570 return ObjectBusy;
6571
6572 if(unit == UnitWorld || unit > UnitMillimeter)
6573 return InvalidParameter;
6574
6575 if (is_metafile_graphics(graphics))
6576 {
6577 stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, unit, graphics->scale);
6578 if (stat != Ok)
6579 return stat;
6580 }
6581
6582 graphics->unit = unit;
6583
6584 return Ok;
6585}

Referenced by create_graphics(), GdipEnumerateMetafileSrcRectDestPoints(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_container_rects(), test_font_height_scaling(), test_font_transform(), test_Get_Release_DC(), test_getbounds(), test_is_outline_visible_path_point(), test_measured_extra_space(), test_pagetransform(), test_pen_thickness(), test_set_page_transform(), and test_transformpoints().

◆ GdipSetPathFillMode()

GpStatus WINGDIPAPI GdipSetPathFillMode ( GpPath path,
GpFillMode  fill 
)

Definition at line 1878 of file graphicspath.c.

1879{
1880 TRACE("(%p, %d)\n", path, fill);
1881
1882 if(!path)
1883 return InvalidParameter;
1884
1885 path->fill = fill;
1886
1887 return Ok;
1888}

◆ GdipSetPathGradientBlend()

GpStatus WINGDIPAPI GdipSetPathGradientBlend ( GpPathGradient brush,
GDIPCONST REAL blend,
GDIPCONST REAL pos,
INT  count 
)

Definition at line 1540 of file brush.c.

1542{
1543 REAL *new_blendfac, *new_blendpos;
1544
1545 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1546
1547 if(!brush || !blend || !pos || count <= 0 || brush->brush.bt != BrushTypePathGradient ||
1548 (count >= 2 && (pos[0] != 0.0f || pos[count-1] != 1.0f)))
1549 return InvalidParameter;
1550
1551 new_blendfac = malloc(count * sizeof(REAL));
1552 new_blendpos = malloc(count * sizeof(REAL));
1553
1554 if (!new_blendfac || !new_blendpos)
1555 {
1556 free(new_blendfac);
1557 free(new_blendpos);
1558 return OutOfMemory;
1559 }
1560
1561 memcpy(new_blendfac, blend, count * sizeof(REAL));
1562 memcpy(new_blendpos, pos, count * sizeof(REAL));
1563
1564 free(brush->blendfac);
1565 free(brush->blendpos);
1566
1567 brush->blendcount = count;
1568 brush->blendfac = new_blendfac;
1569 brush->blendpos = new_blendpos;
1570
1571 return Ok;
1572}

Referenced by GdipSetPathGradientLinearBlend(), GdipSetPathGradientSigmaBlend(), and test_pathgradientblend().

◆ GdipSetPathGradientCenterColor()

GpStatus WINGDIPAPI GdipSetPathGradientCenterColor ( GpPathGradient grad,
ARGB  argb 
)

Definition at line 1682 of file brush.c.

1684{
1685 TRACE("(%p, %lx)\n", grad, argb);
1686
1687 if(!grad || grad->brush.bt != BrushTypePathGradient)
1688 return InvalidParameter;
1689
1690 grad->centercolor = argb;
1691 return Ok;
1692}

◆ GdipSetPathGradientCenterPoint()

GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint ( GpPathGradient grad,
GpPointF point 
)

Definition at line 1694 of file brush.c.

1696{
1697 TRACE("(%p, %s)\n", grad, debugstr_pointf(point));
1698
1699 if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
1700 return InvalidParameter;
1701
1702 grad->center.X = point->X;
1703 grad->center.Y = point->Y;
1704
1705 return Ok;
1706}

Referenced by GdipSetPathGradientCenterPointI(), and test_pathgradientcenterpoint().

◆ GdipSetPathGradientCenterPointI()

GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI ( GpPathGradient grad,
GpPoint point 
)

Definition at line 1708 of file brush.c.

1710{
1711 GpPointF ptf;
1712
1713 TRACE("(%p, %p)\n", grad, point);
1714
1715 if(!point)
1716 return InvalidParameter;
1717
1718 ptf.X = (REAL)point->X;
1719 ptf.Y = (REAL)point->Y;
1720
1721 return GdipSetPathGradientCenterPoint(grad,&ptf);
1722}
GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1694

◆ GdipSetPathGradientFocusScales()

GpStatus WINGDIPAPI GdipSetPathGradientFocusScales ( GpPathGradient grad,
REAL  x,
REAL  y 
)

Definition at line 1724 of file brush.c.

1726{
1727 TRACE("(%p, %.2f, %.2f)\n", grad, x, y);
1728
1729 if(!grad || grad->brush.bt != BrushTypePathGradient)
1730 return InvalidParameter;
1731
1732 grad->focus.X = x;
1733 grad->focus.Y = y;
1734
1735 return Ok;
1736}

◆ GdipSetPathGradientGammaCorrection()

GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection ( GpPathGradient grad,
BOOL  gamma 
)

Definition at line 1738 of file brush.c.

1740{
1741 TRACE("(%p, %d)\n", grad, gamma);
1742
1743 if(!grad || grad->brush.bt != BrushTypePathGradient)
1744 return InvalidParameter;
1745
1746 grad->gamma = gamma;
1747
1748 return Ok;
1749}

◆ GdipSetPathGradientLinearBlend()

GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend ( GpPathGradient brush,
REAL  focus,
REAL  scale 
)

Definition at line 1574 of file brush.c.

1576{
1577 REAL factors[3];
1578 REAL positions[3];
1579 int num_points = 0;
1580
1581 TRACE("(%p,%0.2f,%0.2f)\n", brush, focus, scale);
1582
1583 if (!brush || brush->brush.bt != BrushTypePathGradient)
1584 return InvalidParameter;
1585
1586 if (focus != 0.0)
1587 {
1588 factors[num_points] = 0.0;
1589 positions[num_points] = 0.0;
1590 num_points++;
1591 }
1592
1593 factors[num_points] = scale;
1594 positions[num_points] = focus;
1595 num_points++;
1596
1597 if (focus != 1.0)
1598 {
1599 factors[num_points] = 0.0;
1600 positions[num_points] = 1.0;
1601 num_points++;
1602 }
1603
1604 return GdipSetPathGradientBlend(brush, factors, positions, num_points);
1605}
GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *pos, INT count)
Definition: brush.c:1540

◆ GdipSetPathGradientPath()

GpStatus WINGDIPAPI GdipSetPathGradientPath ( GpPathGradient grad,
GDIPCONST GpPath path 
)

Definition at line 1751 of file brush.c.

1752{
1753 static int calls;
1754
1755 TRACE("(%p, %p)\n", grad, path);
1756
1757 if (!(calls++))
1758 FIXME("not implemented\n");
1759
1760 return NotImplemented;
1761}

◆ GdipSetPathGradientPresetBlend()

GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend ( GpPathGradient brush,
GDIPCONST ARGB blend,
GDIPCONST REAL pos,
INT  count 
)

Definition at line 1607 of file brush.c.

1609{
1610 ARGB *new_color;
1611 REAL *new_pos;
1612 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1613
1614 if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient ||
1615 pos[0] != 0.0f || pos[count-1] != 1.0f)
1616 {
1617 return InvalidParameter;
1618 }
1619
1620 new_color = malloc(count * sizeof(ARGB));
1621 new_pos = malloc(count * sizeof(REAL));
1622 if (!new_color || !new_pos)
1623 {
1624 free(new_color);
1625 free(new_pos);
1626 return OutOfMemory;
1627 }
1628
1629 memcpy(new_color, blend, sizeof(ARGB) * count);
1630 memcpy(new_pos, pos, sizeof(REAL) * count);
1631
1632 free(brush->pblendcolor);
1633 free(brush->pblendpos);
1634
1635 brush->pblendcolor = new_color;
1636 brush->pblendpos = new_pos;
1637 brush->pblendcount = count;
1638
1639 return Ok;
1640}

Referenced by test_pathgradientpresetblend().

◆ GdipSetPathGradientSigmaBlend()

GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend ( GpPathGradient grad,
REAL  focus,
REAL  scale 
)

Definition at line 1763 of file brush.c.

1765{
1766 REAL factors[33];
1767 REAL positions[33];
1768 int num_points = 0;
1769 int i;
1770 const int precision = 16;
1771 REAL erf_range; /* we use values erf(-erf_range) through erf(+erf_range) */
1772 REAL min_erf;
1773 REAL scale_erf;
1774
1775 TRACE("(%p,%0.2f,%0.2f)\n", grad, focus, scale);
1776
1777 if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || grad->brush.bt != BrushTypePathGradient)
1778 return InvalidParameter;
1779
1780 /* we want 2 standard deviations */
1781 erf_range = 2.0 / sqrt(2);
1782
1783 /* calculate the constants we need to normalize the error function to be
1784 between 0.0 and scale over the range we need */
1785 min_erf = erf(-erf_range);
1786 scale_erf = scale / (-2.0 * min_erf);
1787
1788 if (focus != 0.0)
1789 {
1790 positions[0] = 0.0;
1791 factors[0] = 0.0;
1792 for (i=1; i<precision; i++)
1793 {
1794 positions[i] = focus * i / precision;
1795 factors[i] = scale_erf * (erf(2 * erf_range * i / precision - erf_range) - min_erf);
1796 }
1797 num_points += precision;
1798 }
1799
1800 positions[num_points] = focus;
1801 factors[num_points] = scale;
1802 num_points += 1;
1803
1804 if (focus != 1.0)
1805 {
1806 for (i=1; i<precision; i++)
1807 {
1808 positions[i+num_points-1] = (focus + ((1.0-focus) * i / precision));
1809 factors[i+num_points-1] = scale_erf * (erf(erf_range - 2 * erf_range * i / precision) - min_erf);
1810 }
1811 num_points += precision;
1812 positions[num_points-1] = 1.0;
1813 factors[num_points-1] = 0.0;
1814 }
1815
1816 return GdipSetPathGradientBlend(grad, factors, positions, num_points);
1817}

◆ GdipSetPathGradientSurroundColorsWithCount()

GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount ( GpPathGradient grad,
GDIPCONST ARGB argb,
INT count 
)

Definition at line 1819 of file brush.c.

1821{
1822 ARGB *new_surroundcolors;
1823 INT i, num_colors;
1824
1825 TRACE("(%p,%p,%p)\n", grad, argb, count);
1826
1827 if(!grad || !argb || !count || (*count <= 0) || grad->brush.bt != BrushTypePathGradient ||
1828 (*count > grad->path->pathdata.Count))
1829 return InvalidParameter;
1830
1831 num_colors = *count;
1832
1833 /* If all colors are the same, only store 1 color. */
1834 if (*count > 1)
1835 {
1836 for (i=1; i < num_colors; i++)
1837 if (argb[i] != argb[i-1])
1838 break;
1839
1840 if (i == num_colors)
1841 num_colors = 1;
1842 }
1843
1844 new_surroundcolors = malloc(num_colors * sizeof(ARGB));
1845 if (!new_surroundcolors)
1846 return OutOfMemory;
1847
1848 memcpy(new_surroundcolors, argb, num_colors * sizeof(ARGB));
1849
1850 free(grad->surroundcolors);
1851
1852 grad->surroundcolors = new_surroundcolors;
1853 grad->surroundcolorcount = num_colors;
1854
1855 return Ok;
1856}

Referenced by test_gradientsurroundcolorcount().

◆ GdipSetPathGradientTransform()

GpStatus WINGDIPAPI GdipSetPathGradientTransform ( GpPathGradient grad,
GpMatrix matrix 
)

Definition at line 1871 of file brush.c.

1873{
1874 TRACE("(%p,%s)\n", grad, debugstr_matrix(matrix));
1875
1876 if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
1877 return InvalidParameter;
1878
1879 grad->transform = *matrix;
1880
1881 return Ok;
1882}

◆ GdipSetPathGradientWrapMode()

GpStatus WINGDIPAPI GdipSetPathGradientWrapMode ( GpPathGradient grad,
GpWrapMode  wrap 
)

Definition at line 1858 of file brush.c.

1860{
1861 TRACE("(%p, %d)\n", grad, wrap);
1862
1863 if(!grad || grad->brush.bt != BrushTypePathGradient)
1864 return InvalidParameter;
1865
1866 grad->wrap = wrap;
1867
1868 return Ok;
1869}

◆ GdipSetPathMarker()

GpStatus WINGDIPAPI GdipSetPathMarker ( GpPath path)

Definition at line 2793 of file graphicspath.c.

2794{
2795 INT count;
2796
2797 TRACE("(%p)\n", path);
2798
2799 if(!path)
2800 return InvalidParameter;
2801
2802 count = path->pathdata.Count;
2803
2804 /* set marker flag */
2805 if(count > 0)
2806 path->pathdata.Types[count-1] |= PathPointTypePathMarker;
2807
2808 return Ok;
2809}

Referenced by test_nextmarker(), and test_nextmarkerpath().

◆ GdipSetPenBrushFill()

GpStatus WINGDIPAPI GdipSetPenBrushFill ( GpPen pen,
GpBrush brush 
)

Definition at line 519 of file pen.c.

520{
521 TRACE("(%p, %p)\n", pen, brush);
522
523 if(!pen || !brush)
524 return InvalidParameter;
525
527 return GdipCloneBrush(brush, &pen->brush);
528}

Referenced by test_brushfill().

◆ GdipSetPenColor()

GpStatus WINGDIPAPI GdipSetPenColor ( GpPen pen,
ARGB  argb 
)

Definition at line 530 of file pen.c.

531{
532 TRACE("(%p, %lx)\n", pen, argb);
533
534 if(!pen)
535 return InvalidParameter;
536
537 if(pen->brush->bt != BrushTypeSolidColor)
538 return NotImplemented;
539
540 return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
541}
GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
Definition: brush.c:1951

◆ GdipSetPenCompoundArray()

GpStatus WINGDIPAPI GdipSetPenCompoundArray ( GpPen pen,
GDIPCONST REAL compoundarray,
INT  count 
)

Definition at line 564 of file pen.c.

566{
567 INT i;
568 REAL *tmp;
569 TRACE("(%p, %p, %i)\n", pen, compoundarray, count);
570
571 if(!pen || !compoundarray || count < 2 || count%2 == 1 || *compoundarray < 0.0 || *compoundarray > 1.0)
572 return InvalidParameter;
573
574 for(i = 1; i<count; i++)
575 {
576 if((compoundarray[i] < compoundarray[i - 1]) || (compoundarray[i] > 1.0))
577 return InvalidParameter;
578 }
579
580 tmp = malloc(count * sizeof(REAL));
581 if(!tmp)
582 return OutOfMemory;
583 free(pen->compound_array);
584 pen->compound_array = tmp;
585 memcpy(pen->compound_array, compoundarray, count * sizeof(REAL));
587 return Ok;
588}

Referenced by test_compoundarray().

◆ GdipSetPenCustomEndCap()

GpStatus WINGDIPAPI GdipSetPenCustomEndCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 590 of file pen.c.

591{
594
595 TRACE("(%p, %p)\n", pen, customCap);
596
597 /* native crashes on pen == NULL, customCap != NULL */
598 if(!customCap) return InvalidParameter;
599
600 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
602 pen->endcap = LineCapCustom;
603 pen->customend = cap;
604 }
605
606 return ret;
607}
@ LineCapCustom
Definition: gdiplusenums.h:72
#define cap
Definition: glfuncs.h:226

Referenced by METAFILE_PlaybackObject(), test_customcap(), test_pen(), and test_widen_cap().

◆ GdipSetPenCustomStartCap()

GpStatus WINGDIPAPI GdipSetPenCustomStartCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 609 of file pen.c.

610{
613
614 TRACE("(%p, %p)\n", pen, customCap);
615
616 /* native crashes on pen == NULL, customCap != NULL */
617 if(!customCap) return InvalidParameter;
618
619 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
621 pen->startcap = LineCapCustom;
622 pen->customstart = cap;
623 }
624
625 return ret;
626}

Referenced by METAFILE_PlaybackObject(), test_customcap(), test_pen(), and test_widen_cap().

◆ GdipSetPenDashArray()

GpStatus WINGDIPAPI GdipSetPenDashArray ( GpPen pen,
GDIPCONST REAL dash,
INT  count 
)

Definition at line 628 of file pen.c.

630{
631 INT i;
632
633 TRACE("(%p, %p, %d)\n", pen, dash, count);
634
635 if(!pen || !dash)
636 return InvalidParameter;
637
638 if(count <= 0)
639 return OutOfMemory;
640
641 for(i = 0; i < count; i++){
642 if(dash[i] <= 0.0)
643 return InvalidParameter;
644 }
645
646 free(pen->dashes);
647 pen->dashes = NULL;
648
649 if(count > 0)
650 pen->dashes = malloc(count * sizeof(REAL));
651 if(!pen->dashes){
652 pen->numdashes = 0;
653 return OutOfMemory;
654 }
655
657 memcpy(pen->dashes, dash, count * sizeof(REAL));
658 pen->numdashes = count;
659
660 return Ok;
661}
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
Definition: pen.c:688
@ DashStyleCustom
Definition: gdiplusenums.h:182

Referenced by test_dasharray().

◆ GdipSetPenDashCap197819()

GpStatus WINGDIPAPI GdipSetPenDashCap197819 ( GpPen pen,
GpDashCap  dashCap 
)

Definition at line 663 of file pen.c.

664{
665 TRACE("(%p, %d)\n", pen, dashCap);
666
667 if(!pen)
668 return InvalidParameter;
669
670 pen->dashcap = dashCap;
671
672 return Ok;
673}

◆ GdipSetPenDashOffset()

GpStatus WINGDIPAPI GdipSetPenDashOffset ( GpPen pen,
REAL  offset 
)

Definition at line 676 of file pen.c.

677{
678 TRACE("(%p, %.2f)\n", pen, offset);
679
680 if(!pen)
681 return InvalidParameter;
682
683 pen->offset = offset;
684
685 return Ok;
686}

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenDashStyle()

GpStatus WINGDIPAPI GdipSetPenDashStyle ( GpPen pen,
GpDashStyle  dash 
)

Definition at line 688 of file pen.c.

689{
690 TRACE("(%p, %d)\n", pen, dash);
691
692 if(!pen)
693 return InvalidParameter;
694
695 if(dash != DashStyleCustom){
696 free(pen->dashes);
697 pen->dashes = NULL;
698 pen->numdashes = 0;
699 }
700
701 pen->dash = dash;
704 pen->style |= gdip_to_gdi_dash(dash);
705
706 return Ok;
707}
static DWORD gdip_to_gdi_dash(GpDashStyle dash)
Definition: pen.c:33
#define PS_NULL
Definition: wingdi.h:591
#define PS_DASH
Definition: wingdi.h:587
#define PS_ALTERNATE
Definition: wingdi.h:585
#define PS_DOT
Definition: wingdi.h:588
#define PS_USERSTYLE
Definition: wingdi.h:592
#define PS_INSIDEFRAME
Definition: wingdi.h:593
#define PS_SOLID
Definition: wingdi.h:586
#define PS_DASHDOT
Definition: wingdi.h:589
#define PS_DASHDOTDOT
Definition: wingdi.h:590

Referenced by GdipSetPenDashArray(), METAFILE_PlaybackObject(), test_dasharray(), test_widen(), and test_widen_cap().

◆ GdipSetPenEndCap()

GpStatus WINGDIPAPI GdipSetPenEndCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 709 of file pen.c.

710{
711 TRACE("(%p, %d)\n", pen, cap);
712
713 if(!pen) return InvalidParameter;
714
715 /* The old custom cap gets deleted even if the new style is LineCapCustom. */
717 pen->customend = NULL;
718 pen->endcap = cap;
719
720 return Ok;
721}

Referenced by METAFILE_PlaybackObject(), test_widen_cap(), and test_worldbounds().

◆ GdipSetPenLineCap197819()

GpStatus WINGDIPAPI GdipSetPenLineCap197819 ( GpPen pen,
GpLineCap  start,
GpLineCap  end,
GpDashCap  dash 
)

Definition at line 724 of file pen.c.

726{
727 TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);
728
729 if(!pen)
730 return InvalidParameter;
731
734 pen->customend = NULL;
735 pen->customstart = NULL;
736
737 pen->startcap = start;
738 pen->endcap = end;
739 pen->dashcap = dash;
740
741 return Ok;
742}

◆ GdipSetPenLineJoin()

GpStatus WINGDIPAPI GdipSetPenLineJoin ( GpPen pen,
GpLineJoin  join 
)

Definition at line 746 of file pen.c.

747{
748 TRACE("(%p, %d)\n", pen, join);
749
750 if(!pen) return InvalidParameter;
751
752 pen->join = join;
754 pen->style |= gdip_to_gdi_join(join);
755
756 return Ok;
757}
static DWORD gdip_to_gdi_join(GpLineJoin join)
Definition: pen.c:54
#define PS_JOIN_BEVEL
Definition: wingdi.h:597
#define PS_JOIN_ROUND
Definition: wingdi.h:599
#define PS_JOIN_MITER
Definition: wingdi.h:598

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenMiterLimit()

GpStatus WINGDIPAPI GdipSetPenMiterLimit ( GpPen pen,
REAL  limit 
)

Definition at line 759 of file pen.c.

760{
761 TRACE("(%p, %.2f)\n", pen, limit);
762
763 if(!pen)
764 return InvalidParameter;
765
766 pen->miterlimit = limit;
767
768 return Ok;
769}
GLint limit
Definition: glext.h:10326

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenMode()

GpStatus WINGDIPAPI GdipSetPenMode ( GpPen pen,
GpPenAlignment  mode 
)

Definition at line 795 of file pen.c.

796{
797 TRACE("(%p, %d)\n", pen, mode);
798
799 if(!pen) return InvalidParameter;
800
801 pen->align = mode;
802
803 return Ok;
804}

◆ GdipSetPenStartCap()

GpStatus WINGDIPAPI GdipSetPenStartCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 771 of file pen.c.

772{
773 TRACE("(%p, %d)\n", pen, cap);
774
775 if(!pen) return InvalidParameter;
776
778 pen->customstart = NULL;
779 pen->startcap = cap;
780
781 return Ok;
782}

Referenced by METAFILE_PlaybackObject(), and test_widen_cap().

◆ GdipSetPenTransform()

GpStatus WINGDIPAPI GdipSetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 445 of file pen.c.

446{
447 static int calls;
448 BOOL result;
449
450 TRACE("(%p, %s)\n", pen, debugstr_matrix(matrix));
451
452 if(!pen || !matrix)
453 return InvalidParameter;
454
455 if(!(calls++))
456 FIXME("(%p,%p) Semi-stub\n", pen, matrix);
457
459 if (!result)
460 return InvalidParameter;
461 pen->transform = *matrix;
462
463 return Ok;
464}
GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:224

Referenced by test_transform().

◆ GdipSetPenWidth()

GpStatus WINGDIPAPI GdipSetPenWidth ( GpPen pen,
REAL  width 
)

Definition at line 784 of file pen.c.

785{
786 TRACE("(%p, %.2f)\n", pen, width);
787
788 if(!pen) return InvalidParameter;
789
790 pen->width = width;
791
792 return Ok;
793}

Referenced by test_widen_cap().

◆ GdipSetPixelOffsetMode()

GpStatus WINGDIPAPI GdipSetPixelOffsetMode ( GpGraphics graphics,
PixelOffsetMode  mode 
)

Definition at line 6587 of file graphics.c.

6589{
6590 TRACE("(%p, %d)\n", graphics, mode);
6591
6592 if(!graphics)
6593 return InvalidParameter;
6594
6595 if(graphics->busy)
6596 return ObjectBusy;
6597
6598 if(graphics->pixeloffset == mode)
6599 return Ok;
6600
6601 if (is_metafile_graphics(graphics))
6602 {
6603 GpStatus stat;
6604
6607 if(stat != Ok)
6608 return stat;
6609 }
6610
6611 graphics->pixeloffset = mode;
6612
6613 return Ok;
6614}

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_DrawImage_scale(), test_Get_Release_DC(), and test_properties().

◆ GdipSetPropertyItem()

GpStatus WINGDIPAPI GdipSetPropertyItem ( GpImage image,
GDIPCONST PropertyItem item 
)

Definition at line 4582 of file image.c.

4583{
4584 static int calls;
4585
4586 if (!image || !item) return InvalidParameter;
4587
4588 TRACE("(%p,%p:%#lx,%u,%lu,%p)\n", image, item, item->id, item->type, item->length, item->value);
4589
4590 if(!(calls++))
4591 FIXME("not implemented\n");
4592
4593 return Ok;
4594}

◆ GdipSetRenderingOrigin()

GpStatus WINGDIPAPI GdipSetRenderingOrigin ( GpGraphics graphics,
INT  x,
INT  y 
)

Definition at line 6616 of file graphics.c.

6617{
6618 GpStatus stat;
6619
6620 TRACE("(%p,%i,%i)\n", graphics, x, y);
6621
6622 if (!graphics)
6623 return InvalidParameter;
6624
6625 if (graphics->origin_x == x && graphics->origin_y == y)
6626 return Ok;
6627
6628 if (is_metafile_graphics(graphics))
6629 {
6631 if (stat != Ok)
6632 return stat;
6633 }
6634
6635 graphics->origin_x = x;
6636 graphics->origin_y = y;
6637
6638 return Ok;
6639}
GpStatus METAFILE_SetRenderingOrigin(GpMetafile *metafile, INT x, INT y)
Definition: metafile.c:5653

Referenced by GdipPlayMetafileRecord(), test_properties(), and test_renderingOrigin().

◆ GdipSetSmoothingMode()

GpStatus WINGDIPAPI GdipSetSmoothingMode ( GpGraphics graphics,
SmoothingMode  mode 
)

Definition at line 6654 of file graphics.c.

6655{
6656 TRACE("(%p, %d)\n", graphics, mode);
6657
6658 if(!graphics)
6659 return InvalidParameter;
6660
6661 if(graphics->busy)
6662 return ObjectBusy;
6663
6664 if(graphics->smoothing == mode)
6665 return Ok;
6666
6667 if (is_metafile_graphics(graphics))
6668 {
6669 GpStatus stat;
6670 BOOL antialias = (mode != SmoothingModeDefault &&
6672
6674 EmfPlusRecordTypeSetAntiAliasMode, (mode << 1) + antialias);
6675 if(stat != Ok)
6676 return stat;
6677 }
6678
6679 graphics->smoothing = mode;
6680
6681 return Ok;
6682}
@ SmoothingModeNone
Definition: gdiplusenums.h:125
@ SmoothingModeHighSpeed
Definition: gdiplusenums.h:123

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_Get_Release_DC(), test_properties(), and ZoomWnd_OnDraw().

◆ GdipSetSolidFillColor()

GpStatus WINGDIPAPI GdipSetSolidFillColor ( GpSolidFill sf,
ARGB  argb 
)

Definition at line 1951 of file brush.c.

1952{
1953 TRACE("(%p, %lx)\n", sf, argb);
1954
1955 if(!sf)
1956 return InvalidParameter;
1957
1958 sf->color = argb;
1959 return Ok;
1960}

Referenced by GdipSetPenColor(), and test_brushfill().

◆ GdipSetStringFormatAlign()

GpStatus WINGDIPAPI GdipSetStringFormatAlign ( GpStringFormat format,
StringAlignment  align 
)

Definition at line 236 of file stringformat.c.

238{
239 TRACE("(%p, %i)\n", format, align);
240
241 if(!format)
242 return InvalidParameter;
243
244 format->align = align;
245
246 return Ok;
247}

Referenced by test_measure_string().

◆ GdipSetStringFormatDigitSubstitution()

GpStatus WINGDIPAPI GdipSetStringFormatDigitSubstitution ( GpStringFormat format,
LANGID  language,
StringDigitSubstitute  substitute 
)

Definition at line 250 of file stringformat.c.

252{
253 TRACE("(%p, %x, %i)\n", format, language, substitute);
254
255 if(!format)
256 return InvalidParameter;
257
258 format->digitlang = language;
259 format->digitsub = substitute;
260
261 return Ok;
262}

Referenced by test_digitsubstitution().

◆ GdipSetStringFormatFlags()

GpStatus WINGDIPAPI GdipSetStringFormatFlags ( GpStringFormat format,
INT  flags 
)

Definition at line 350 of file stringformat.c.

351{
352 TRACE("(%p, %x)\n", format, flags);
353
354 if(!format)
355 return InvalidParameter;
356
357 format->attr = flags;
358
359 return Ok;
360}

Referenced by test_getgenericdefault(), test_getgenerictypographic(), test_measure_string(), and test_stringformatflags().

◆ GdipSetStringFormatHotkeyPrefix()

GpStatus WINGDIPAPI GdipSetStringFormatHotkeyPrefix ( GpStringFormat format,
INT  hkpx 
)

Definition at line 264 of file stringformat.c.

266{
267 TRACE("(%p, %i)\n", format, hkpx);
268
269 if(!format || hkpx < 0 || hkpx > 2)
270 return InvalidParameter;
271
272 format->hkprefix = (HotkeyPrefix) hkpx;
273
274 return Ok;
275}
HotkeyPrefix
Definition: gdiplusenums.h:310

◆ GdipSetStringFormatLineAlign()

GpStatus WINGDIPAPI GdipSetStringFormatLineAlign ( GpStringFormat format,
StringAlignment  align 
)

Definition at line 277 of file stringformat.c.

279{
280 TRACE("(%p, %i)\n", format, align);
281
282 if(!format)
283 return InvalidParameter;
284
285 format->line_align = align;
286
287 return Ok;
288}

Referenced by test_measure_string().

◆ GdipSetStringFormatMeasurableCharacterRanges()

GpStatus WINGDIPAPI GdipSetStringFormatMeasurableCharacterRanges ( GpStringFormat format,
INT  rangeCount,
GDIPCONST CharacterRange ranges 
)

Definition at line 290 of file stringformat.c.

292{
293 CharacterRange *new_ranges;
294
295 if (!(format && ranges))
296 return InvalidParameter;
297
298 TRACE("%p, %d, %p\n", format, rangeCount, ranges);
299
300 new_ranges = malloc(rangeCount * sizeof(CharacterRange));
301 if (!new_ranges)
302 return OutOfMemory;
303
304 free(format->character_ranges);
305 format->character_ranges = new_ranges;
306 memcpy(format->character_ranges, ranges, sizeof(CharacterRange) * rangeCount);
307 format->range_count = rangeCount;
308
309 return Ok;
310}

Referenced by test_characterrange(), test_font_height_scaling(), test_measure_string(), and test_string_functions().

◆ GdipSetStringFormatTabStops()

GpStatus WINGDIPAPI GdipSetStringFormatTabStops ( GpStringFormat format,
REAL  firsttab,
INT  count,
GDIPCONST REAL tabs 
)

Definition at line 312 of file stringformat.c.

314{
315 TRACE("(%p, %0.2f, %i, %p)\n", format, firsttab, count, tabs);
316
317 if(!format || !tabs)
318 return InvalidParameter;
319
320 if(count > 0){
321 if(firsttab < 0.0) return NotImplemented;
322 if(format->tabcount < count){
323 REAL *ptr;
324 ptr = realloc(format->tabs, sizeof(REAL) * count);
325 if(!ptr)
326 return OutOfMemory;
327 format->tabs = ptr;
328 }
329 format->firsttab = firsttab;
330 format->tabcount = count;
331 memcpy(format->tabs, tabs, sizeof(REAL)*count);
332 }
333
334 return Ok;
335}
#define realloc
Definition: debug_ros.c:6

Referenced by test_tabstops().

◆ GdipSetStringFormatTrimming()

GpStatus WINGDIPAPI GdipSetStringFormatTrimming ( GpStringFormat format,
StringTrimming  trimming 
)

Definition at line 337 of file stringformat.c.

339{
340 TRACE("(%p, %i)\n", format, trimming);
341
342 if(!format)
343 return InvalidParameter;
344
345 format->trimming = trimming;
346
347 return Ok;
348}

◆ GdipSetTextContrast()

GpStatus WINGDIPAPI GdipSetTextContrast ( GpGraphics graphics,
UINT  contrast 
)

Definition at line 6684 of file graphics.c.

6685{
6686 TRACE("(%p, %d)\n", graphics, contrast);
6687
6688 if(!graphics)
6689 return InvalidParameter;
6690
6691 graphics->textcontrast = contrast;
6692
6693 return Ok;
6694}

Referenced by test_BeginContainer2().

◆ GdipSetTextRenderingHint()

GpStatus WINGDIPAPI GdipSetTextRenderingHint ( GpGraphics graphics,
TextRenderingHint  hint 
)

Definition at line 6696 of file graphics.c.

6698{
6699 TRACE("(%p, %d)\n", graphics, hint);
6700
6701 if(!graphics || hint > TextRenderingHintClearTypeGridFit)
6702 return InvalidParameter;
6703
6704 if(graphics->busy)
6705 return ObjectBusy;
6706
6707 if(graphics->texthint == hint)
6708 return Ok;
6709
6710 if (is_metafile_graphics(graphics)) {
6711 GpStatus stat;
6712
6715 if(stat != Ok)
6716 return stat;
6717 }
6718
6719 graphics->texthint = hint;
6720
6721 return Ok;
6722}
@ TextRenderingHintClearTypeGridFit
Definition: gdiplusenums.h:258

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_Get_Release_DC(), test_get_set_textrenderinghint(), and test_properties().

◆ GdipSetTextureTransform()

GpStatus WINGDIPAPI GdipSetTextureTransform ( GpTexture texture,
GDIPCONST GpMatrix matrix 
)

Definition at line 1965 of file brush.c.

1967{
1968 TRACE("(%p, %s)\n", texture, debugstr_matrix(matrix));
1969
1970 if(!texture || !matrix)
1971 return InvalidParameter;
1972
1973 texture->transform = *matrix;
1974
1975 return Ok;
1976}

Referenced by metafile_deserialize_brush(), and test_transform().

◆ GdipSetTextureWrapMode()

GpStatus WINGDIPAPI GdipSetTextureWrapMode ( GpTexture brush,
GpWrapMode  wrapmode 
)

Definition at line 1983 of file brush.c.

1984{
1985 TRACE("(%p, %d)\n", brush, wrapmode);
1986
1987 if(!brush)
1988 return InvalidParameter;
1989
1990 brush->imageattributes->wrap = wrapmode;
1991
1992 return Ok;
1993}

Referenced by test_texturewrap().

◆ GdipSetWorldTransform()

GpStatus WINGDIPAPI GdipSetWorldTransform ( GpGraphics graphics,
GpMatrix matrix 
)

Definition at line 6724 of file graphics.c.

6725{
6726 GpStatus stat;
6727
6728 TRACE("(%p, %s)\n", graphics, debugstr_matrix(matrix));
6729
6730 if(!graphics || !matrix)
6731 return InvalidParameter;
6732
6733 if(graphics->busy)
6734 return ObjectBusy;
6735
6736 if (is_metafile_graphics(graphics)) {
6738
6739 if (stat != Ok)
6740 return stat;
6741 }
6742
6743 graphics->worldtrans = *matrix;
6744
6745 return Ok;
6746}
GpStatus METAFILE_SetWorldTransform(GpMetafile *metafile, GDIPCONST GpMatrix *transform)
Definition: metafile.c:1440

Referenced by METAFILE_PlaybackUpdateWorldTransform(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_DrawImage_scale(), test_font_transform(), test_gdi_interop_bitmap(), test_gdi_interop_hdc(), test_Get_Release_DC(), test_isinfinite(), and test_worldtransform().

◆ GdipShearMatrix()

GpStatus WINGDIPAPI GdipShearMatrix ( GpMatrix matrix,
REAL  shearX,
REAL  shearY,
GpMatrixOrder  order 
)

Definition at line 337 of file matrix.c.

339{
340 REAL shear[6];
341
342 TRACE("(%s, %.2f, %.2f, %d)\n", debugstr_matrix(matrix), shearX, shearY, order);
343
344 if(!matrix)
345 return InvalidParameter;
346
347 /* prepare transformation matrix */
348 shear[0] = 1.0;
349 shear[1] = shearY;
350 shear[2] = shearX;
351 shear[3] = 1.0;
352 shear[4] = 0.0;
353 shear[5] = 0.0;
354
356 matrix_multiply(matrix->matrix, shear, matrix->matrix);
357 else if (order == MatrixOrderPrepend)
358 matrix_multiply(shear, matrix->matrix, matrix->matrix);
359 else
360 return InvalidParameter;
361
362 return Ok;
363}

Referenced by test_font_transform(), and test_shear().

◆ GdipStartPathFigure()

GpStatus WINGDIPAPI GdipStartPathFigure ( GpPath path)

Definition at line 1852 of file graphicspath.c.

1853{
1854 TRACE("(%p)\n", path);
1855
1856 if(!path)
1857 return InvalidParameter;
1858
1859 path->newfigure = TRUE;
1860
1861 return Ok;
1862}

Referenced by test_flatten(), test_getsubpathcount(), test_nextpathtype(), and test_widen_cap().

◆ GdipStringFormatGetGenericDefault()

GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault ( GpStringFormat **  format)

Definition at line 120 of file stringformat.c.

121{
122 if (!format)
123 return InvalidParameter;
124
126
127 return Ok;
128}

Referenced by test_getgenericdefault().

◆ GdipStringFormatGetGenericTypographic()

GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic ( GpStringFormat **  format)

Definition at line 401 of file stringformat.c.

402{
403 if(!format)
404 return InvalidParameter;
405
407
408 TRACE("%p => %p\n", format, *format);
409
410 return Ok;
411}

Referenced by test_font_transform(), and test_getgenerictypographic().

◆ GdipTestControl()

GpStatus WINGDIPAPI GdipTestControl ( GpTestControlEnum  control,
void param 
)

Definition at line 5684 of file image.c.

5685{
5686 TRACE("(%d, %p)\n", control, param);
5687
5688 switch(control){
5690 if(param)
5691 FIXME("TestControlForceBilinear not handled\n");
5692 break;
5693 case TestControlNoICM:
5694 if(param)
5695 FIXME("TestControlNoICM not handled\n");
5696 break;
5698 *((DWORD*)param) = 3102;
5699 break;
5700 }
5701
5702 return Ok;
5703}
@ TestControlNoICM
Definition: gdiplusenums.h:412
@ TestControlForceBilinear
Definition: gdiplusenums.h:411
@ TestControlGetBuildNumber
Definition: gdiplusenums.h:413
Definition: dialog.c:52

Referenced by test_testcontrol().

◆ GdipTransformMatrixPoints()

GpStatus WINGDIPAPI GdipTransformMatrixPoints ( GpMatrix matrix,
GpPointF pts,
INT  count 
)

Definition at line 365 of file matrix.c.

367{
368 REAL x, y;
369 INT i;
370
371 TRACE("(%s, %p, %d)\n", debugstr_matrix(matrix), pts, count);
372
373 if(!matrix || !pts || count <= 0)
374 return InvalidParameter;
375
376 for(i = 0; i < count; i++)
377 {
378 x = pts[i].X;
379 y = pts[i].Y;
380
381 pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4];
382 pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5];
383 }
384
385 return Ok;
386}

Referenced by brush_fill_pixels(), draw_cap(), GDI32_GdipDrawDriverString(), gdip_transform_points(), GdipDrawImageFX(), GdipGetPathWorldBounds(), GdipIsOutlineVisiblePathPoint(), GdipMeasureDriverString(), GdipTransformMatrixPointsI(), GdipTransformPath(), test_transform(), transform_properties(), and transform_region_element().

◆ GdipTransformMatrixPointsI()

GpStatus WINGDIPAPI GdipTransformMatrixPointsI ( GpMatrix matrix,
GpPoint pts,
INT  count 
)

Definition at line 388 of file matrix.c.

389{
390 GpPointF *ptsF;
392 INT i;
393
394 TRACE("(%s, %p, %d)\n", debugstr_matrix(matrix), pts, count);
395
396 if(count <= 0)
397 return InvalidParameter;
398
399 ptsF = malloc(sizeof(GpPointF) * count);
400 if(!ptsF)
401 return OutOfMemory;
402
403 for(i = 0; i < count; i++){
404 ptsF[i].X = (REAL)pts[i].X;
405 ptsF[i].Y = (REAL)pts[i].Y;
406 }
407
409
410 if(ret == Ok)
411 for(i = 0; i < count; i++){
412 pts[i].X = gdip_round(ptsF[i].X);
413 pts[i].Y = gdip_round(ptsF[i].Y);
414 }
415 free(ptsF);
416
417 return ret;
418}

◆ GdipTransformPath()

GpStatus WINGDIPAPI GdipTransformPath ( GpPath path,
GpMatrix matrix 
)

Definition at line 1890 of file graphicspath.c.

1891{
1892 TRACE("(%p, %s)\n", path, debugstr_matrix(matrix));
1893
1894 if(!path)
1895 return InvalidParameter;
1896
1897 if(path->pathdata.Count == 0 || !matrix)
1898 return Ok;
1899
1900 return GdipTransformMatrixPoints(matrix, path->pathdata.Points,
1901 path->pathdata.Count);
1902}

Referenced by brush_fill_pixels(), GdipFlattenPath(), GdipSetClipPath(), GdipWidenPath(), SOFTWARE_GdipDrawPath(), and test_flatten().

◆ GdipTransformPoints()

GpStatus WINGDIPAPI GdipTransformPoints ( GpGraphics graphics,
GpCoordinateSpace  dst_space,
GpCoordinateSpace  src_space,
GpPointF points,
INT  count 
)

Definition at line 7356 of file graphics.c.

7358{
7359 if(!graphics || !points || count <= 0 || (UINT)dst_space > CoordinateSpaceDevice ||
7360 (UINT)src_space > CoordinateSpaceDevice)
7361 return InvalidParameter;
7362
7363 if(graphics->busy)
7364 return ObjectBusy;
7365
7366 TRACE("(%p, %d, %d, %p, %d)\n", graphics, dst_space, src_space, points, count);
7367
7368 if (src_space == dst_space) return Ok;
7369
7370 return gdip_transform_points(graphics, dst_space, src_space, points, count);
7371}

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipIsVisiblePoint(), GdipIsVisibleRect(), GdipTransformPointsI(), METAFILE_FillRectangles(), test_clipping(), test_clipping_2(), test_container_rects(), test_font_height_scaling(), test_GdipMeasureString(), test_Get_Release_DC(), test_pen_thickness(), test_transform(), and test_transformpoints().

◆ GdipTransformPointsI()

GpStatus WINGDIPAPI GdipTransformPointsI ( GpGraphics graphics,
GpCoordinateSpace  dst_space,
GpCoordinateSpace  src_space,
GpPoint points,
INT  count 
)

Definition at line 7373 of file graphics.c.

7375{
7376 GpPointF *pointsF;
7377 GpStatus ret;
7378 INT i;
7379
7380 TRACE("(%p, %d, %d, %p, %d)\n", graphics, dst_space, src_space, points, count);
7381
7382 if(count <= 0)
7383 return InvalidParameter;
7384
7385 pointsF = malloc(sizeof(GpPointF) * count);
7386 if(!pointsF)
7387 return OutOfMemory;
7388
7389 for(i = 0; i < count; i++){
7390 pointsF[i].X = (REAL)points[i].X;
7391 pointsF[i].Y = (REAL)points[i].Y;
7392 }
7393
7394 ret = GdipTransformPoints(graphics, dst_space, src_space, pointsF, count);
7395
7396 if(ret == Ok)
7397 for(i = 0; i < count; i++){
7398 points[i].X = gdip_round(pointsF[i].X);
7399 points[i].Y = gdip_round(pointsF[i].Y);
7400 }
7401 free(pointsF);
7402
7403 return ret;
7404}

Referenced by test_transformpoints().

◆ GdipTransformRegion()

GpStatus WINGDIPAPI GdipTransformRegion ( GpRegion region,
GpMatrix matrix 
)

Definition at line 1702 of file region.c.

1703{
1704 TRACE("(%p, %s)\n", region, debugstr_matrix(matrix));
1705
1706 if (!region || !matrix)
1707 return InvalidParameter;
1708
1709 return transform_region_element(&region->node, matrix);
1710}
static GpStatus transform_region_element(region_element *element, GpMatrix *matrix)
Definition: region.c:1612

Referenced by GdipGetClip(), GdipGetVisibleClipBounds(), GdipSetClipHrgn(), GdipSetClipRect(), GdipSetClipRegion(), get_clip_hrgn(), get_region_scans_data(), metafile_set_clip_region(), SOFTWARE_GdipFillRegion(), test_clipping(), test_getregiondata(), and test_transform().

◆ GdipTranslateClip()

GpStatus WINGDIPAPI GdipTranslateClip ( GpGraphics graphics,
REAL  dx,
REAL  dy 
)

Definition at line 7421 of file graphics.c.

7422{
7423 GpStatus stat;
7424
7425 TRACE("(%p, %.2f, %.2f)\n", graphics, dx, dy);
7426
7427 if(!graphics)
7428 return InvalidParameter;
7429
7430 if(graphics->busy)
7431 return ObjectBusy;
7432
7433 if (is_metafile_graphics(graphics))
7434 {
7435 stat = METAFILE_OffsetClip((GpMetafile *)graphics->image, dx, dy);
7436 if (stat != Ok)
7437 return stat;
7438 }
7439
7440 return GdipTranslateRegion(graphics->clip, dx, dy);
7441}
GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy)
Definition: region.c:1742
GpStatus METAFILE_OffsetClip(GpMetafile *metafile, REAL dx, REAL dy)
Definition: metafile.c:5581

Referenced by GdipTranslateClipI(), test_Get_Release_DC(), and test_offsetclip().

◆ GdipTranslateClipI()

GpStatus WINGDIPAPI GdipTranslateClipI ( GpGraphics graphics,
INT  dx,
INT  dy 
)

Definition at line 7446 of file graphics.c.

7447{
7448 TRACE("(%p, %d, %d)\n", graphics, dx, dy);
7449
7450 return GdipTranslateClip(graphics, dx, dy);
7451}
GpStatus WINGDIPAPI GdipTranslateClip(GpGraphics *graphics, REAL dx, REAL dy)
Definition: graphics.c:7421

Referenced by test_Get_Release_DC(), and test_offsetclip().

◆ GdipTranslateLineTransform()

GpStatus WINGDIPAPI GdipTranslateLineTransform ( GpLineGradient brush,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 2192 of file brush.c.

2194{
2195 TRACE("(%p,%f,%f,%d)\n", brush, dx, dy, order);
2196
2197 if(!brush)
2198 return InvalidParameter;
2199
2200 return GdipTranslateMatrix(&brush->transform, dx, dy, order);
2201}

Referenced by test_transform().

◆ GdipTranslateMatrix()

GpStatus WINGDIPAPI GdipTranslateMatrix ( GpMatrix matrix,
REAL  offsetX,
REAL  offsetY,
GpMatrixOrder  order 
)

Definition at line 420 of file matrix.c.

422{
423 TRACE("(%s, %.2f, %.2f, %d)\n", debugstr_matrix(matrix), offsetX, offsetY, order);
424
425 if(!matrix)
426 return InvalidParameter;
427
429 {
430 matrix->matrix[4] += offsetX;
431 matrix->matrix[5] += offsetY;
432 }
433 else if (order == MatrixOrderPrepend)
434 {
435 matrix->matrix[4] = offsetX * matrix->matrix[0] + offsetY * matrix->matrix[2]
436 + matrix->matrix[4];
437 matrix->matrix[5] = offsetX * matrix->matrix[1] + offsetY * matrix->matrix[3]
438 + matrix->matrix[5];
439 }
440 else
441 return InvalidParameter;
442
443 return Ok;
444}

Referenced by draw_cap(), GdipPlayMetafileRecord(), GdipTranslateLineTransform(), GdipTranslatePathGradientTransform(), GdipTranslatePenTransform(), GdipTranslateTextureTransform(), GdipTranslateWorldTransform(), linegradient_init_transform(), test_clipping(), test_clipping_2(), test_font_transform(), and test_translate().

◆ GdipTranslatePathGradientTransform()

GpStatus WINGDIPAPI GdipTranslatePathGradientTransform ( GpPathGradient grad,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 1940 of file brush.c.

1942{
1943 TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, dx, dy, order);
1944
1945 if (!grad || grad->brush.bt != BrushTypePathGradient)
1946 return InvalidParameter;
1947
1948 return GdipTranslateMatrix(&grad->transform, dx, dy, order);
1949}

◆ GdipTranslatePenTransform()

GpStatus WINGDIPAPI GdipTranslatePenTransform ( GpPen pen,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 478 of file pen.c.

479{
480 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
481
482 if(!pen)
483 return InvalidParameter;
484
485 return GdipTranslateMatrix(&pen->transform, dx, dy, order);
486}

Referenced by test_transform().

◆ GdipTranslateRegion()

GpStatus WINGDIPAPI GdipTranslateRegion ( GpRegion region,
REAL  dx,
REAL  dy 
)

Definition at line 1742 of file region.c.

1743{
1744 TRACE("(%p, %f, %f)\n", region, dx, dy);
1745
1746 if(!region)
1747 return InvalidParameter;
1748
1749 translate_region_element(&region->node, dx, dy);
1750
1751 return Ok;
1752}
static void translate_region_element(region_element *element, REAL dx, REAL dy)
Definition: region.c:1713

Referenced by GdipTranslateClip(), GdipTranslateRegionI(), test_getregiondata(), and test_translate().

◆ GdipTranslateRegionI()

GpStatus WINGDIPAPI GdipTranslateRegionI ( GpRegion region,
INT  dx,
INT  dy 
)

Definition at line 1757 of file region.c.

1758{
1759 TRACE("(%p, %d, %d)\n", region, dx, dy);
1760
1761 return GdipTranslateRegion(region, (REAL)dx, (REAL)dy);
1762}

◆ GdipTranslateTextureTransform()

GpStatus WINGDIPAPI GdipTranslateTextureTransform ( GpTexture brush,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 2206 of file brush.c.

2208{
2209 TRACE("(%p, %.2f, %.2f, %d)\n", brush, dx, dy, order);
2210
2211 if(!brush)
2212 return InvalidParameter;
2213
2214 return GdipTranslateMatrix(&brush->transform, dx, dy, order);
2215}

◆ GdipTranslateWorldTransform()

GpStatus WINGDIPAPI GdipTranslateWorldTransform ( GpGraphics graphics,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 6748 of file graphics.c.

6750{
6751 GpStatus stat;
6752
6753 TRACE("(%p, %.2f, %.2f, %d)\n", graphics, dx, dy, order);
6754
6755 if(!graphics)
6756 return InvalidParameter;
6757
6758 if(graphics->busy)
6759 return ObjectBusy;
6760
6761 if (is_metafile_graphics(graphics)) {
6763
6764 if (stat != Ok)
6765 return stat;
6766 }
6767
6768 return GdipTranslateMatrix(&graphics->worldtrans, dx, dy, order);
6769}
GpStatus METAFILE_TranslateWorldTransform(GpMetafile *metafile, REAL dx, REAL dy, MatrixOrder order)
Definition: metafile.c:1524

Referenced by test_GdipIsVisiblePoint(), test_GdipIsVisibleRect(), test_Get_Release_DC(), test_is_outline_visible_path_point(), test_isvisiblepoint(), test_isvisiblerect(), test_transformpoints(), and test_worldtransform().

◆ GdipVectorTransformMatrixPoints()

GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints ( GpMatrix matrix,
GpPointF pts,
INT  count 
)

Definition at line 446 of file matrix.c.

447{
448 REAL x, y;
449 INT i;
450
451 TRACE("(%s, %p, %d)\n", debugstr_matrix(matrix), pts, count);
452
453 if(!matrix || !pts || count <= 0)
454 return InvalidParameter;
455
456 for(i = 0; i < count; i++)
457 {
458 x = pts[i].X;
459 y = pts[i].Y;
460
461 pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2];
462 pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3];
463 }
464
465 return Ok;
466}

Referenced by GdipVectorTransformMatrixPointsI().

◆ GdipVectorTransformMatrixPointsI()

GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI ( GpMatrix matrix,
GpPoint pts,
INT  count 
)

Definition at line 468 of file matrix.c.

469{
470 GpPointF *ptsF;
472 INT i;
473
474 TRACE("(%s, %p, %d)\n", debugstr_matrix(matrix), pts, count);
475
476 if(count <= 0)
477 return InvalidParameter;
478
479 ptsF = malloc(sizeof(GpPointF) * count);
480 if(!ptsF)
481 return OutOfMemory;
482
483 for(i = 0; i < count; i++){
484 ptsF[i].X = (REAL)pts[i].X;
485 ptsF[i].Y = (REAL)pts[i].Y;
486 }
487
489 /* store back */
490 if(ret == Ok)
491 for(i = 0; i < count; i++){
492 pts[i].X = gdip_round(ptsF[i].X);
493 pts[i].Y = gdip_round(ptsF[i].Y);
494 }
495 free(ptsF);
496
497 return ret;
498}
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
Definition: matrix.c:446

◆ GdipWarpPath()

GpStatus WINGDIPAPI GdipWarpPath ( GpPath path,
GpMatrix matrix,
GDIPCONST GpPointF points,
INT  count,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
WarpMode  warpmode,
REAL  flatness 
)

Definition at line 1904 of file graphicspath.c.

1907{
1908 FIXME("(%p,%s,%p,%i,%0.2f,%0.2f,%0.2f,%0.2f,%i,%0.2f)\n", path, debugstr_matrix(matrix),
1909 points, count, x, y, width, height, warpmode, flatness);
1910
1911 return NotImplemented;
1912}

◆ GdipWidenPath()

GpStatus WINGDIPAPI GdipWidenPath ( GpPath path,
GpPen pen,
GpMatrix matrix,
REAL  flatness 
)

Definition at line 2587 of file graphicspath.c.

2589{
2590 GpPath *flat_path=NULL;
2592 path_list_node_t *points=NULL, *last_point=NULL;
2593 int i, subpath_start=0;
2594
2595 TRACE("(%p,%p,%s,%0.2f)\n", path, pen, debugstr_matrix(matrix), flatness);
2596
2597 if (!path || !pen)
2598 return InvalidParameter;
2599
2600 if (path->pathdata.Count <= 1)
2601 return OutOfMemory;
2602
2603 status = GdipClonePath(path, &flat_path);
2604
2605 if (status == Ok)
2606 status = GdipFlattenPath(flat_path, pen->unit == UnitPixel ? matrix : NULL, flatness);
2607
2608 if (status == Ok && !init_path_list(&points, 314.0, 22.0))
2610
2611 if (status == Ok)
2612 {
2613 REAL pen_width = (pen->unit == UnitWorld) ? max(pen->width, 1.0) : pen->width;
2614 BYTE *types = flat_path->pathdata.Types;
2615
2616 last_point = points;
2617
2618 if (pen->dashcap != DashCapFlat)
2619 FIXME("unimplemented dash cap %d\n", pen->dashcap);
2620
2621 if (pen->join == LineJoinRound)
2622 FIXME("unimplemented line join %d\n", pen->join);
2623
2624 if (pen->align != PenAlignmentCenter)
2625 FIXME("unimplemented pen alignment %d\n", pen->align);
2626
2627 if (pen->compound_array_size != 0)
2628 FIXME("unimplemented pen compoundline. Solid line will be drawn instead: %d\n", pen->compound_array_size);
2629
2630 for (i=0; i < flat_path->pathdata.Count; i++)
2631 {
2633 subpath_start = i;
2634
2636 {
2637 if (pen->dash != DashStyleSolid)
2638 widen_dashed_figure(flat_path, subpath_start, i, 1, pen, pen_width, &last_point);
2639 else
2640 widen_closed_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen_width, &last_point);
2641 }
2642 else if (i == flat_path->pathdata.Count-1 ||
2644 {
2645 if (pen->dash != DashStyleSolid)
2646 widen_dashed_figure(flat_path, subpath_start, i, 0, pen, pen_width, &last_point);
2647 else
2648 widen_open_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen_width,
2649 pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point);
2650 }
2651 }
2652
2653 widen_anchors(flat_path, pen, fmax(pen->width, 2.0), &last_point);
2654
2655 if (!path_list_to_path(points->next, path))
2657
2658 path->fill = FillModeWinding;
2659 }
2660
2662
2663 GdipDeletePath(flat_path);
2664
2665 if (status == Ok && pen->unit != UnitPixel)
2667
2668 return status;
2669}
static void widen_dashed_figure(GpPath *path, int start, int end, int closed, GpPen *pen, REAL pen_width, path_list_node_t **last_point)
static void widen_closed_figure(const GpPointF *points, int start, int end, GpPen *pen, REAL pen_width, path_list_node_t **last_point)
static void widen_open_figure(const GpPointF *points, int start, int end, GpPen *pen, REAL pen_width, GpLineCap start_cap, GpCustomLineCap *custom_start, GpLineCap end_cap, GpCustomLineCap *custom_end, path_list_node_t **last_point)
GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix *matrix, REAL flatness)
void widen_anchors(GpPath *flat_path, GpPen *pen, REAL pen_width, path_list_node_t **last_point)
_ACRTIMP double __cdecl fmax(double, double)
@ DashCapFlat
Definition: gdiplusenums.h:170
@ LineJoinRound
Definition: gdiplusenums.h:107
@ PenAlignmentCenter
Definition: gdiplusenums.h:154

Referenced by GdipIsOutlineVisiblePathPoint(), SOFTWARE_GdipDrawPath(), test_widen(), and test_widen_cap().

◆ GdipWindingModeOutline()

GpStatus WINGDIPAPI GdipWindingModeOutline ( GpPath path,
GpMatrix matrix,
REAL  flatness 
)

Definition at line 2830 of file graphicspath.c.

2831{
2832 FIXME("stub: %p, %p, %.2f\n", path, matrix, flatness);
2833 return NotImplemented;
2834}