ReactOS 0.4.15-dev-7942-gd23573b
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 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 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 GdipRecordMetafileI (HDC, EmfType, GDIPCONST GpRect *, MetafileFrameUnit, GDIPCONST WCHAR *, GpMetafile **)
 
GpStatus WINGDIPAPI GdipReleaseDC (GpGraphics *, HDC)
 
GpStatus WINGDIPAPI GdipResetClip (GpGraphics *)
 
GpStatus WINGDIPAPI GdipResetWorldTransform (GpGraphics *)
 
GpStatus WINGDIPAPI GdipRestoreGraphics (GpGraphics *, GraphicsState)
 
GpStatus WINGDIPAPI GdipRotateWorldTransform (GpGraphics *, REAL, GpMatrixOrder)
 
GpStatus WINGDIPAPI GdipSaveAdd (GpImage *, GDIPCONST EncoderParameters *)
 
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 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 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 GdipRecordMetafileStream (IStream *, HDC, EmfType, GDIPCONST GpRectF *, 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 GdipGetPathGradientSurroundColorCount (GpPathGradient *, INT *)
 
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 GdipSetPathGradientTransform (GpPathGradient *, GpMatrix *)
 
GpStatus WINGDIPAPI GdipSetPathGradientWrapMode (GpPathGradient *, GpWrapMode)
 
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 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  x1,
REAL  y1,
REAL  x2,
REAL  y2,
REAL  startAngle,
REAL  sweepAngle 
)

Definition at line 195 of file graphicspath.c.

197{
198 INT count, old_count, i;
199
200 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
201 path, x1, y1, x2, y2, startAngle, sweepAngle);
202
203 if(!path)
204 return InvalidParameter;
205
206 count = arc2polybezier(NULL, x1, y1, x2, y2, startAngle, sweepAngle);
207
208 if(count == 0)
209 return Ok;
211 return OutOfMemory;
212
213 old_count = path->pathdata.Count;
214 arc2polybezier(&path->pathdata.Points[old_count], x1, y1, x2, y2,
215 startAngle, sweepAngle);
216
217 for(i = 0; i < count; i++){
218 path->pathdata.Types[old_count + i] = PathPointTypeBezier;
219 }
220
221 path->pathdata.Types[old_count] =
223 path->newfigure = FALSE;
224 path->pathdata.Count += count;
225
226 return Ok;
227}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
BOOL lengthen_path(GpPath *path, INT len)
Definition: gdiplus.c:405
INT arc2polybezier(GpPointF *points, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle)
Definition: gdiplus.c:223
@ PathPointTypeBezier
Definition: gdiplusenums.h:86
@ PathPointTypeLine
Definition: gdiplusenums.h:85
@ PathPointTypeStart
Definition: gdiplusenums.h:84
@ Ok
Definition: gdiplustypes.h:26
@ InvalidParameter
Definition: gdiplustypes.h:28
@ OutOfMemory
Definition: gdiplustypes.h:29
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
#define TRACE(s)
Definition: solgame.cpp:4
int32_t INT
Definition: typedefs.h:58
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711

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 234 of file graphicspath.c.

236{
237 TRACE("(%p, %d, %d, %d, %d, %.2f, %.2f)\n",
238 path, x1, y1, x2, y2, startAngle, sweepAngle);
239
240 return GdipAddPathArc(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,startAngle,sweepAngle);
241}
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle)
Definition: graphicspath.c:195

◆ 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 243 of file graphicspath.c.

245{
246 INT old_count;
247
248 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
249 path, x1, y1, x2, y2, x3, y3, x4, y4);
250
251 if(!path)
252 return InvalidParameter;
253
254 if(!lengthen_path(path, 4))
255 return OutOfMemory;
256
257 old_count = path->pathdata.Count;
258
259 path->pathdata.Points[old_count].X = x1;
260 path->pathdata.Points[old_count].Y = y1;
261 path->pathdata.Points[old_count + 1].X = x2;
262 path->pathdata.Points[old_count + 1].Y = y2;
263 path->pathdata.Points[old_count + 2].X = x3;
264 path->pathdata.Points[old_count + 2].Y = y3;
265 path->pathdata.Points[old_count + 3].X = x4;
266 path->pathdata.Points[old_count + 3].Y = y4;
267
268 path->pathdata.Types[old_count] =
270 path->pathdata.Types[old_count + 1] = PathPointTypeBezier;
271 path->pathdata.Types[old_count + 2] = PathPointTypeBezier;
272 path->pathdata.Types[old_count + 3] = PathPointTypeBezier;
273
274 path->newfigure = FALSE;
275 path->pathdata.Count += 4;
276
277 return Ok;
278}

Referenced by GdipAddPathBezierI().

◆ 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 280 of file graphicspath.c.

282{
283 TRACE("(%p, %d, %d, %d, %d, %d, %d, %d, %d)\n",
284 path, x1, y1, x2, y2, x3, y3, x4, y4);
285
286 return GdipAddPathBezier(path,(REAL)x1,(REAL)y1,(REAL)x2,(REAL)y2,(REAL)x3,(REAL)y3,
287 (REAL)x4,(REAL)y4);
288}
GpStatus WINGDIPAPI GdipAddPathBezier(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
Definition: graphicspath.c:243

◆ GdipAddPathBeziers()

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

Definition at line 290 of file graphicspath.c.

292{
293 INT i, old_count;
294
295 TRACE("(%p, %p, %d)\n", path, points, count);
296
297 if(!path || !points || ((count - 1) % 3))
298 return InvalidParameter;
299
301 return OutOfMemory;
302
303 old_count = path->pathdata.Count;
304
305 for(i = 0; i < count; i++){
306 path->pathdata.Points[old_count + i].X = points[i].X;
307 path->pathdata.Points[old_count + i].Y = points[i].Y;
308 path->pathdata.Types[old_count + i] = PathPointTypeBezier;
309 }
310
311 path->pathdata.Types[old_count] =
313 path->newfigure = FALSE;
314 path->pathdata.Count += count;
315
316 return Ok;
317}
GLsizei const GLfloat * points
Definition: glext.h:8112

Referenced by GdipAddPathBeziersI(), GdipAddPathClosedCurve2(), GdipAddPathCurve2(), and GdipDrawBeziers().

◆ GdipAddPathBeziersI()

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

Definition at line 319 of file graphicspath.c.

321{
322 GpPointF *ptsF;
324 INT i;
325
326 TRACE("(%p, %p, %d)\n", path, points, count);
327
328 if(!points || ((count - 1) % 3))
329 return InvalidParameter;
330
331 ptsF = heap_alloc_zero(sizeof(GpPointF) * count);
332 if(!ptsF)
333 return OutOfMemory;
334
335 for(i = 0; i < count; i++){
336 ptsF[i].X = (REAL)points[i].X;
337 ptsF[i].Y = (REAL)points[i].Y;
338 }
339
341 heap_free(ptsF);
342
343 return ret;
344}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define Y(I)
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:290
Status
Definition: gdiplustypes.h:25
REAL Y
Definition: gdiplustypes.h:649
REAL X
Definition: gdiplustypes.h:648
int ret

◆ GdipAddPathClosedCurve()

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

Definition at line 346 of file graphicspath.c.

348{
349 TRACE("(%p, %p, %d)\n", path, points, count);
350
352}
GpStatus WINGDIPAPI GdipAddPathClosedCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphicspath.c:362

◆ GdipAddPathClosedCurve2()

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

Definition at line 362 of file graphicspath.c.

364{
365 INT i, len_pt = (count + 1)*3-2;
366 GpPointF *pt;
367 GpPointF *pts;
368 REAL x1, x2, y1, y2;
370
371 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
372
373 if(!path || !points || count <= 1)
374 return InvalidParameter;
375
376 pt = heap_alloc_zero(len_pt * sizeof(GpPointF));
377 pts = heap_alloc_zero((count + 1)*sizeof(GpPointF));
378 if(!pt || !pts){
379 heap_free(pt);
380 heap_free(pts);
381 return OutOfMemory;
382 }
383
384 /* copy source points to extend with the last one */
385 memcpy(pts, points, sizeof(GpPointF)*count);
386 pts[count] = pts[0];
387
388 tension = tension * TENSION_CONST;
389
390 for(i = 0; i < count-1; i++){
391 calc_curve_bezier(&(pts[i]), tension, &x1, &y1, &x2, &y2);
392
393 pt[3*i+2].X = x1;
394 pt[3*i+2].Y = y1;
395 pt[3*i+3].X = pts[i+1].X;
396 pt[3*i+3].Y = pts[i+1].Y;
397 pt[3*i+4].X = x2;
398 pt[3*i+4].Y = y2;
399 }
400
401 /* points [len_pt-2] and [0] are calculated
402 separately to connect splines properly */
403 pts[0] = points[count-1];
404 pts[1] = points[0]; /* equals to start and end of a resulting path */
405 pts[2] = points[1];
406
407 calc_curve_bezier(pts, tension, &x1, &y1, &x2, &y2);
408 pt[len_pt-2].X = x1;
409 pt[len_pt-2].Y = y1;
410 pt[0].X = pts[1].X;
411 pt[0].Y = pts[1].Y;
412 pt[1].X = x2;
413 pt[1].Y = y2;
414 /* close path */
415 pt[len_pt-1].X = pt[0].X;
416 pt[len_pt-1].Y = pt[0].Y;
417
418 stat = GdipAddPathBeziers(path, pt, len_pt);
419
420 /* close figure */
421 if(stat == Ok){
422 path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath;
423 path->newfigure = TRUE;
424 }
425
426 heap_free(pts);
427 heap_free(pt);
428
429 return stat;
430}
#define stat
Definition: acwin.h:99
#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:379
#define TENSION_CONST
@ PathPointTypeCloseSubpath
Definition: gdiplusenums.h:90
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: stat.h:55

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 432 of file graphicspath.c.

434{
435 GpPointF *ptf;
436 INT i;
438
439 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
440
441 if(!path || !points || count <= 1)
442 return InvalidParameter;
443
444 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
445 if(!ptf)
446 return OutOfMemory;
447
448 for(i = 0; i < count; i++){
449 ptf[i].X = (REAL)points[i].X;
450 ptf[i].Y = (REAL)points[i].Y;
451 }
452
453 stat = GdipAddPathClosedCurve2(path, ptf, count, tension);
454
455 heap_free(ptf);
456
457 return stat;
458}

Referenced by GdipAddPathClosedCurveI().

◆ GdipAddPathClosedCurveI()

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

Definition at line 354 of file graphicspath.c.

356{
357 TRACE("(%p, %p, %d)\n", path, points, count);
358
360}
GpStatus WINGDIPAPI GdipAddPathClosedCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphicspath.c:432

◆ GdipAddPathCurve()

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

Definition at line 460 of file graphicspath.c.

461{
462 TRACE("(%p, %p, %d)\n", path, points, count);
463
464 if(!path || !points || count <= 1)
465 return InvalidParameter;
466
467 return GdipAddPathCurve2(path, points, count, 1.0);
468}
GpStatus WINGDIPAPI GdipAddPathCurve2(GpPath *path, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphicspath.c:480

◆ GdipAddPathCurve2()

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

Definition at line 480 of file graphicspath.c.

482{
483 INT i, len_pt = count*3-2;
484 GpPointF *pt;
485 REAL x1, x2, y1, y2;
487
488 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
489
490 if(!path || !points || count <= 1)
491 return InvalidParameter;
492
493 pt = heap_alloc_zero(len_pt * sizeof(GpPointF));
494 if(!pt)
495 return OutOfMemory;
496
497 tension = tension * TENSION_CONST;
498
500 tension, &x1, &y1);
501
502 pt[0].X = points[0].X;
503 pt[0].Y = points[0].Y;
504 pt[1].X = x1;
505 pt[1].Y = y1;
506
507 for(i = 0; i < count-2; i++){
508 calc_curve_bezier(&(points[i]), tension, &x1, &y1, &x2, &y2);
509
510 pt[3*i+2].X = x1;
511 pt[3*i+2].Y = y1;
512 pt[3*i+3].X = points[i+1].X;
513 pt[3*i+3].Y = points[i+1].Y;
514 pt[3*i+4].X = x2;
515 pt[3*i+4].Y = y2;
516 }
517
519 points[count-2].X, points[count-2].Y, tension, &x1, &y1);
520
521 pt[len_pt-2].X = x1;
522 pt[len_pt-2].Y = y1;
523 pt[len_pt-1].X = points[count-1].X;
524 pt[len_pt-1].Y = points[count-1].Y;
525
526 stat = GdipAddPathBeziers(path, pt, len_pt);
527
528 heap_free(pt);
529
530 return stat;
531}
void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, REAL tension, REAL *x, REAL *y)
Definition: gdiplus.c:396

Referenced by GdipAddPathCurve(), GdipAddPathCurve2I(), GdipAddPathCurve3(), GdipDrawCurve2(), and test_addcurve().

◆ GdipAddPathCurve2I()

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

Definition at line 533 of file graphicspath.c.

535{
536 GpPointF *ptf;
537 INT i;
539
540 TRACE("(%p, %p, %d, %.2f)\n", path, points, count, tension);
541
542 if(!path || !points || count <= 1)
543 return InvalidParameter;
544
545 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
546 if(!ptf)
547 return OutOfMemory;
548
549 for(i = 0; i < count; i++){
550 ptf[i].X = (REAL)points[i].X;
551 ptf[i].Y = (REAL)points[i].Y;
552 }
553
554 stat = GdipAddPathCurve2(path, ptf, count, tension);
555
556 heap_free(ptf);
557
558 return stat;
559}

Referenced by GdipAddPathCurve3I(), and GdipAddPathCurveI().

◆ GdipAddPathCurve3()

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

Definition at line 561 of file graphicspath.c.

563{
564 TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension);
565
566 if(!path || !points || offset + 1 >= count || count - offset < nseg + 1)
567 return InvalidParameter;
568
569 return GdipAddPathCurve2(path, &points[offset], nseg + 1, tension);
570}
GLintptr offset
Definition: glext.h:5920

Referenced by test_addcurve().

◆ GdipAddPathCurve3I()

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

Definition at line 572 of file graphicspath.c.

574{
575 TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension);
576
577 if(!path || !points || offset + 1 >= count || count - offset < nseg + 1)
578 return InvalidParameter;
579
580 return GdipAddPathCurve2I(path, &points[offset], nseg + 1, tension);
581}
GpStatus WINGDIPAPI GdipAddPathCurve2I(GpPath *path, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphicspath.c:533

◆ GdipAddPathCurveI()

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

Definition at line 470 of file graphicspath.c.

471{
472 TRACE("(%p, %p, %d)\n", path, points, count);
473
474 if(!path || !points || count <= 1)
475 return InvalidParameter;
476
477 return GdipAddPathCurve2I(path, points, count, 1.0);
478}

◆ GdipAddPathEllipse()

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

Definition at line 583 of file graphicspath.c.

585{
586 INT old_count, numpts;
587
588 TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height);
589
590 if(!path)
591 return InvalidParameter;
592
594 return OutOfMemory;
595
596 old_count = path->pathdata.Count;
597 if((numpts = arc2polybezier(&path->pathdata.Points[old_count], x, y, width,
598 height, 0.0, 360.0)) != MAX_ARC_PTS){
599 ERR("expected %d points but got %d\n", MAX_ARC_PTS, numpts);
600 return GenericError;
601 }
602
603 memset(&path->pathdata.Types[old_count + 1], PathPointTypeBezier,
604 MAX_ARC_PTS - 1);
605
606 /* An ellipse is an intrinsic figure (always is its own subpath). */
607 path->pathdata.Types[old_count] = PathPointTypeStart;
608 path->pathdata.Types[old_count + MAX_ARC_PTS - 1] |= PathPointTypeCloseSubpath;
609 path->newfigure = TRUE;
610 path->pathdata.Count += MAX_ARC_PTS;
611
612 return Ok;
613}
#define ERR(fmt,...)
Definition: debug.h:110
#define MAX_ARC_PTS
@ GenericError
Definition: gdiplustypes.h:27
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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
#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_transform(), and test_translate().

◆ GdipAddPathEllipseI()

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

Definition at line 615 of file graphicspath.c.

617{
618 TRACE("(%p, %d, %d, %d, %d)\n", path, x, y, width, height);
619
621}
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height)
Definition: graphicspath.c:583

◆ GdipAddPathLine()

GpStatus WINGDIPAPI GdipAddPathLine ( GpPath path,
REAL  x1,
REAL  y1,
REAL  x2,
REAL  y2 
)

Definition at line 704 of file graphicspath.c.

705{
706 INT old_count;
707
708 TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x1, y1, x2, y2);
709
710 if(!path)
711 return InvalidParameter;
712
713 if(!lengthen_path(path, 2))
714 return OutOfMemory;
715
716 old_count = path->pathdata.Count;
717
718 path->pathdata.Points[old_count].X = x1;
719 path->pathdata.Points[old_count].Y = y1;
720 path->pathdata.Points[old_count + 1].X = x2;
721 path->pathdata.Points[old_count + 1].Y = y2;
722
723 path->pathdata.Types[old_count] =
725 path->pathdata.Types[old_count + 1] = PathPointTypeLine;
726
727 path->newfigure = FALSE;
728 path->pathdata.Count += 2;
729
730 return Ok;
731}

Referenced by GdipAddPathLineI(), GdipAddPathPie(), GdipAddPathRectangle(), test_addcurve(), test_drawpath(), test_fillpath(), test_flatten(), test_getpathdata(), test_getregiondata(), test_getsubpathcount(), test_isvalid(), test_nextmarker(), test_nextmarkerpath(), test_nextpathtype(), test_nextsubpathpath(), test_pen_thickness(), test_polygon(), and test_widen().

◆ GdipAddPathLine2()

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

Definition at line 623 of file graphicspath.c.

625{
626 INT i, old_count;
627
628 TRACE("(%p, %p, %d)\n", path, points, count);
629
630 if(!path || !points)
631 return InvalidParameter;
632
634 return OutOfMemory;
635
636 old_count = path->pathdata.Count;
637
638 for(i = 0; i < count; i++){
639 path->pathdata.Points[old_count + i].X = points[i].X;
640 path->pathdata.Points[old_count + i].Y = points[i].Y;
641 path->pathdata.Types[old_count + i] = PathPointTypeLine;
642 }
643
644 if(path->newfigure){
645 path->pathdata.Types[old_count] = PathPointTypeStart;
646 path->newfigure = FALSE;
647 }
648
649 path->pathdata.Count += count;
650
651 return Ok;
652}

Referenced by GdipAddPathLine2I(), GdipAddPathRectangle(), GdipCreatePathGradient(), GdipDrawLines(), test_ellipse(), test_line2(), test_reverse(), and test_worldbounds().

◆ GdipAddPathLine2I()

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

Definition at line 654 of file graphicspath.c.

655{
656 GpPointF *pointsF;
657 INT i;
659
660 TRACE("(%p, %p, %d)\n", path, points, count);
661
662 if(count <= 0)
663 return InvalidParameter;
664
665 pointsF = heap_alloc_zero(sizeof(GpPointF) * count);
666 if(!pointsF) return OutOfMemory;
667
668 for(i = 0;i < count; i++){
669 pointsF[i].X = (REAL)points[i].X;
670 pointsF[i].Y = (REAL)points[i].Y;
671 }
672
673 stat = GdipAddPathLine2(path, pointsF, count);
674
675 heap_free(pointsF);
676
677 return stat;
678}
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:623

Referenced by GdipCreatePathGradientI().

◆ GdipAddPathLineI()

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

Definition at line 738 of file graphicspath.c.

739{
740 TRACE("(%p, %d, %d, %d, %d)\n", path, x1, y1, x2, y2);
741
742 return GdipAddPathLine(path, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
743}
GpStatus WINGDIPAPI GdipAddPathLine(GpPath *path, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphicspath.c:704

Referenced by test_GdipFillPath(), and test_linei().

◆ GdipAddPathPath()

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

Definition at line 745 of file graphicspath.c.

747{
748 INT old_count, count;
749
750 TRACE("(%p, %p, %d)\n", path, addingPath, connect);
751
752 if(!path || !addingPath)
753 return InvalidParameter;
754
755 old_count = path->pathdata.Count;
756 count = addingPath->pathdata.Count;
757
759 return OutOfMemory;
760
761 memcpy(&path->pathdata.Points[old_count], addingPath->pathdata.Points,
762 count * sizeof(GpPointF));
763 memcpy(&path->pathdata.Types[old_count], addingPath->pathdata.Types, count);
764
765 if(path->newfigure || !connect)
766 path->pathdata.Types[old_count] = PathPointTypeStart;
767 else
768 path->pathdata.Types[old_count] = PathPointTypeLine;
769
770 path->newfigure = FALSE;
771 path->pathdata.Count += count;
772
773 return Ok;
774}

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 776 of file graphicspath.c.

778{
779 GpPointF *ptf;
781 INT i, count;
782
783 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
784 path, x, y, width, height, startAngle, sweepAngle);
785
786 if(!path)
787 return InvalidParameter;
788
789 /* on zero width/height only start point added */
790 if(width <= 1e-7 || height <= 1e-7){
791 if(!lengthen_path(path, 1))
792 return OutOfMemory;
793 path->pathdata.Points[0].X = x + width / 2.0;
794 path->pathdata.Points[0].Y = y + height / 2.0;
796 path->pathdata.Count = 1;
797 return InvalidParameter;
798 }
799
800 count = arc2polybezier(NULL, x, y, width, height, startAngle, sweepAngle);
801
802 if(count == 0)
803 return Ok;
804
805 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
806 if(!ptf)
807 return OutOfMemory;
808
809 arc2polybezier(ptf, x, y, width, height, startAngle, sweepAngle);
810
811 status = GdipAddPathLine(path, x + width/2, y + height/2, ptf[0].X, ptf[0].Y);
812 if(status != Ok){
813 heap_free(ptf);
814 return status;
815 }
816 /* one spline is already added as a line endpoint */
817 if(!lengthen_path(path, count - 1)){
818 heap_free(ptf);
819 return OutOfMemory;
820 }
821
822 memcpy(&(path->pathdata.Points[path->pathdata.Count]), &(ptf[1]),sizeof(GpPointF)*(count-1));
823 for(i = 0; i < count-1; i++)
824 path->pathdata.Types[path->pathdata.Count+i] = PathPointTypeBezier;
825
826 path->pathdata.Count += count-1;
827
829
830 heap_free(ptf);
831
832 return status;
833}
GpStatus WINGDIPAPI GdipClosePathFigure(GpPath *path)
#define e
Definition: ke_i.h:82
Definition: ps.c:97

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 835 of file graphicspath.c.

837{
838 TRACE("(%p, %d, %d, %d, %d, %.2f, %.2f)\n",
839 path, x, y, width, height, startAngle, sweepAngle);
840
841 return GdipAddPathPie(path, (REAL)x, (REAL)y, (REAL)width, (REAL)height, startAngle, sweepAngle);
842}
GpStatus WINGDIPAPI GdipAddPathPie(GpPath *path, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphicspath.c:776

◆ GdipAddPathPolygon()

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

Definition at line 844 of file graphicspath.c.

845{
846 INT old_count;
847
848 TRACE("(%p, %p, %d)\n", path, points, count);
849
850 if(!path || !points || count < 3)
851 return InvalidParameter;
852
854 return OutOfMemory;
855
856 old_count = path->pathdata.Count;
857
858 memcpy(&path->pathdata.Points[old_count], points, count*sizeof(GpPointF));
859 memset(&path->pathdata.Types[old_count + 1], PathPointTypeLine, count - 1);
860
861 /* A polygon is an intrinsic figure */
862 path->pathdata.Types[old_count] = PathPointTypeStart;
863 path->pathdata.Types[old_count + count - 1] |= PathPointTypeCloseSubpath;
864 path->newfigure = TRUE;
865 path->pathdata.Count += count;
866
867 return Ok;
868}

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

◆ GdipAddPathPolygonI()

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

Definition at line 870 of file graphicspath.c.

871{
872 GpPointF *ptf;
874 INT i;
875
876 TRACE("(%p, %p, %d)\n", path, points, count);
877
878 if(!points || count < 3)
879 return InvalidParameter;
880
881 ptf = heap_alloc_zero(sizeof(GpPointF) * count);
882 if(!ptf)
883 return OutOfMemory;
884
885 for(i = 0; i < count; i++){
886 ptf[i].X = (REAL)points[i].X;
887 ptf[i].Y = (REAL)points[i].Y;
888 }
889
891
892 heap_free(ptf);
893
894 return status;
895}
GpStatus WINGDIPAPI GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:844

Referenced by GdipFillPolygonI().

◆ GdipAddPathRectangle()

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

Definition at line 2296 of file graphicspath.c.

2298{
2299 GpPath *backup;
2300 GpPointF ptf[2];
2301 GpStatus retstat;
2302 BOOL old_new;
2303
2304 TRACE("(%p, %.2f, %.2f, %.2f, %.2f)\n", path, x, y, width, height);
2305
2306 if(!path)
2307 return InvalidParameter;
2308
2309 if (width <= 0.0 || height <= 0.0)
2310 return Ok;
2311
2312 /* make a backup copy of path data */
2313 if((retstat = GdipClonePath(path, &backup)) != Ok)
2314 return retstat;
2315
2316 /* rectangle should start as new path */
2317 old_new = path->newfigure;
2318 path->newfigure = TRUE;
2319 if((retstat = GdipAddPathLine(path,x,y,x+width,y)) != Ok){
2320 path->newfigure = old_new;
2321 goto fail;
2322 }
2323
2324 ptf[0].X = x+width;
2325 ptf[0].Y = y+height;
2326 ptf[1].X = x;
2327 ptf[1].Y = y+height;
2328
2329 if((retstat = GdipAddPathLine2(path, ptf, 2)) != Ok) goto fail;
2330 path->pathdata.Types[path->pathdata.Count-1] |= PathPointTypeCloseSubpath;
2331
2332 /* free backup */
2334 return Ok;
2335
2336fail:
2337 /* reverting */
2338 heap_free(path->pathdata.Points);
2339 heap_free(path->pathdata.Types);
2340 memcpy(path, backup, sizeof(*path));
2342
2343 return retstat;
2344}
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(), GdipDrawRectangle(), get_region_hrgn(), test_captype(), test_constructor_destructor(), test_empty_rect(), test_GdipFillPath(), test_gethrgn(), test_getregiondata(), test_hascurve(), test_inset(), test_isvisible(), test_lastpoint(), test_linejoin(), test_nextmarker(), test_nextmarkerpath(), test_rect(), test_scale(), and transform_region_element().

◆ GdipAddPathRectangleI()

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

Definition at line 2346 of file graphicspath.c.

2348{
2349 TRACE("(%p, %d, %d, %d, %d)\n", path, x, y, width, height);
2350
2352}
GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, REAL width, REAL height)

Referenced by test_getregiondata().

◆ GdipAddPathRectangles()

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

Definition at line 2354 of file graphicspath.c.

2355{
2356 GpPath *backup;
2357 GpStatus retstat;
2358 INT i;
2359
2360 TRACE("(%p, %p, %d)\n", path, rects, count);
2361
2362 /* count == 0 - verified condition */
2363 if(!path || !rects || count == 0)
2364 return InvalidParameter;
2365
2366 if(count < 0)
2367 return OutOfMemory;
2368
2369 /* make a backup copy */
2370 if((retstat = GdipClonePath(path, &backup)) != Ok)
2371 return retstat;
2372
2373 for(i = 0; i < count; i++){
2374 if((retstat = GdipAddPathRectangle(path,rects[i].X,rects[i].Y,rects[i].Width,rects[i].Height)) != Ok)
2375 goto fail;
2376 }
2377
2378 /* free backup */
2380 return Ok;
2381
2382fail:
2383 /* reverting */
2384 heap_free(path->pathdata.Points);
2385 heap_free(path->pathdata.Types);
2386 memcpy(path, backup, sizeof(*path));
2388
2389 return retstat;
2390}
_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 2392 of file graphicspath.c.

2393{
2394 GpRectF *rectsF;
2395 GpStatus retstat;
2396 INT i;
2397
2398 TRACE("(%p, %p, %d)\n", path, rects, count);
2399
2400 if(!rects || count == 0)
2401 return InvalidParameter;
2402
2403 if(count < 0)
2404 return OutOfMemory;
2405
2406 rectsF = heap_alloc_zero(sizeof(GpRectF)*count);
2407
2408 for(i = 0;i < count;i++){
2409 rectsF[i].X = (REAL)rects[i].X;
2410 rectsF[i].Y = (REAL)rects[i].Y;
2411 rectsF[i].Width = (REAL)rects[i].Width;
2412 rectsF[i].Height = (REAL)rects[i].Height;
2413 }
2414
2415 retstat = GdipAddPathRectangles(path, rectsF, count);
2416 heap_free(rectsF);
2417
2418 return retstat;
2419}
GpStatus WINGDIPAPI GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects, INT count)
REAL Height
Definition: gdiplustypes.h:664
REAL X
Definition: gdiplustypes.h:661
REAL Width
Definition: gdiplustypes.h:663
REAL Y
Definition: gdiplustypes.h:662

◆ 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 1007 of file graphicspath.c.

1008{
1009 GpFont *font;
1011 LOGFONTW lfw;
1012 HANDLE hfont;
1013 HDC dc;
1014 GpGraphics *graphics;
1015 GpPath *backup;
1016 struct format_string_args args;
1017 int i;
1018 UINT16 native_height;
1019 RectF scaled_layout_rect;
1020 TEXTMETRICW textmetric;
1021
1022 TRACE("(%p, %s, %d, %p, %d, %f, %p, %p)\n", path, debugstr_w(string), length, family, style, emSize, layoutRect, format);
1023 if (!path || !string || !family || !emSize || !layoutRect || !format)
1024 return InvalidParameter;
1025
1026 status = GdipGetEmHeight(family, style, &native_height);
1027 if (status != Ok)
1028 return status;
1029
1030 scaled_layout_rect.X = layoutRect->X;
1031 scaled_layout_rect.Y = layoutRect->Y;
1032 scaled_layout_rect.Width = layoutRect->Width * native_height / emSize;
1033 scaled_layout_rect.Height = layoutRect->Height * native_height / emSize;
1034
1035 if ((status = GdipClonePath(path, &backup)) != Ok)
1036 return status;
1037
1039 status = GdipCreateFromHDC(dc, &graphics);
1040 if (status != Ok)
1041 {
1042 DeleteDC(dc);
1044 return status;
1045 }
1046
1047 status = GdipCreateFont(family, native_height, style, UnitPixel, &font);
1048 if (status != Ok)
1049 {
1050 GdipDeleteGraphics(graphics);
1051 DeleteDC(dc);
1053 return status;
1054 }
1055
1056 get_log_fontW(font, graphics, &lfw);
1058 GdipDeleteGraphics(graphics);
1059
1060 hfont = CreateFontIndirectW(&lfw);
1061 if (!hfont)
1062 {
1063 WARN("Failed to create font\n");
1064 DeleteDC(dc);
1066 return GenericError;
1067 }
1068
1070
1071 GetTextMetricsW(dc, &textmetric);
1072
1073 args.path = path;
1074 args.maxY = 0;
1075 args.scale = emSize / native_height;
1076 args.ascent = textmetric.tmAscent * args.scale;
1077 status = gdip_format_string(dc, string, length, NULL, &scaled_layout_rect,
1079
1080 DeleteDC(dc);
1082
1083 if (status != Ok) /* free backup */
1084 {
1085 heap_free(path->pathdata.Points);
1086 heap_free(path->pathdata.Types);
1087 *path = *backup;
1089 return status;
1090 }
1091 if (format && format->line_align == StringAlignmentCenter && layoutRect->Y + args.maxY < layoutRect->Height)
1092 {
1093 float inc = layoutRect->Height + layoutRect->Y - args.maxY;
1094 inc /= 2;
1095 for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
1096 path->pathdata.Points[i].Y += inc;
1097 } else if (format && format->line_align == StringAlignmentFar) {
1098 float inc = layoutRect->Height + layoutRect->Y - args.maxY;
1099 for (i = backup->pathdata.Count; i < path->pathdata.Count; ++i)
1100 path->pathdata.Points[i].Y += inc;
1101 }
1103 return status;
1104}
static HFONT hfont
unsigned short UINT16
Arabic default style
Definition: afstyles.h:94
#define WARN(fmt,...)
Definition: debug.h:112
GpStatus WINGDIPAPI GdipDeleteFont(GpFont *font)
Definition: font.c:270
GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, REAL emSize, INT style, Unit unit, GpFont **font)
Definition: font.c:144
GpStatus WINGDIPAPI GdipGetEmHeight(GDIPCONST GpFontFamily *family, INT style, UINT16 *EmHeight)
Definition: font.c:918
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
Definition: graphics.c:2395
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
Definition: graphics.c:2581
static GpStatus format_string_callback(HDC dc, GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, INT lineno, const RectF *bounds, INT *underlined_indexes, INT underlined_index_count, void *priv)
Definition: graphicspath.c:912
pKey DeleteObject()
GpStatus gdip_format_string(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) DECLSPEC_HIDDEN
Definition: graphics.c:5201
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN
Definition: graphics.c:2305
@ StringAlignmentCenter
Definition: gdiplusenums.h:266
@ StringAlignmentFar
Definition: gdiplusenums.h:267
@ UnitPixel
Definition: gdiplusenums.h:29
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR dc[]
static HDC
Definition: imagelist.c:92
Definition: mk_font.cpp:20
Definition: match.c:390
LONG tmAscent
Definition: wingdi.h:2384
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
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 1106 of file graphicspath.c.

1107{
1108 if (layoutRect)
1109 {
1110 RectF layoutRectF = {
1111 (REAL)layoutRect->X,
1112 (REAL)layoutRect->Y,
1113 (REAL)layoutRect->Width,
1114 (REAL)layoutRect->Height
1115 };
1116 return GdipAddPathString(path, string, length, family, style, emSize, &layoutRectF, format);
1117 }
1118 return InvalidParameter;
1119}
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 5924 of file graphics.c.

5925{
5928 GpStatus stat;
5929 GpRectF scaled_srcrect;
5930 REAL scale_x, scale_y;
5931
5932 TRACE("(%p, %s, %s, %d, %p)\n", graphics, debugstr_rectf(dstrect), debugstr_rectf(srcrect), unit, state);
5933
5934 if(!graphics || !dstrect || !srcrect || unit < UnitPixel || unit > UnitMillimeter || !state)
5935 return InvalidParameter;
5936
5938 if(stat != Ok)
5939 return stat;
5940
5941 list_add_head(&graphics->containers, &container->entry);
5942 *state = graphics->contid = container->contid;
5943
5944 scale_x = units_to_pixels(1.0, unit, graphics->xres);
5945 scale_y = units_to_pixels(1.0, unit, graphics->yres);
5946
5947 scaled_srcrect.X = scale_x * srcrect->X;
5948 scaled_srcrect.Y = scale_y * srcrect->Y;
5949 scaled_srcrect.Width = scale_x * srcrect->Width;
5950 scaled_srcrect.Height = scale_y * srcrect->Height;
5951
5952 transform.matrix[0] = dstrect->Width / scaled_srcrect.Width;
5953 transform.matrix[1] = 0.0;
5954 transform.matrix[2] = 0.0;
5955 transform.matrix[3] = dstrect->Height / scaled_srcrect.Height;
5956 transform.matrix[4] = dstrect->X - scaled_srcrect.X;
5957 transform.matrix[5] = dstrect->Y - scaled_srcrect.Y;
5958
5960
5961 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
5962 METAFILE_BeginContainer((GpMetafile*)graphics->image, dstrect, srcrect, unit, container->contid);
5963 }
5964
5965 return Ok;
5966}
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 GpStatus init_container(GraphicsContainerItem **container, GDIPCONST GpGraphics *graphics, GraphicsContainerType type)
Definition: graphics.c:2122
@ BEGIN_CONTAINER
Definition: graphics.c:2099
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
Definition: matrix.c:240
const char * debugstr_rectf(const RectF *rc)
Definition: gdiplus.c:476
REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi)
Definition: gdiplus.c:327
GpStatus METAFILE_BeginContainer(GpMetafile *metafile, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex) DECLSPEC_HIDDEN
Definition: metafile.c:1376
@ ImageTypeMetafile
Definition: gdiplusenums.h:196
@ MatrixOrderPrepend
Definition: gdiplusenums.h:188
@ UnitMillimeter
Definition: gdiplusenums.h:33
GLuint GLenum GLenum transform
Definition: glext.h:9407
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
GpMatrix worldtrans
struct list containers
GpImage * image
GraphicsContainer contid
ImageType type
struct list entry
Definition: metafile.c:154

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

◆ GdipBeginContainer2()

GpStatus WINGDIPAPI GdipBeginContainer2 ( GpGraphics graphics,
GraphicsContainer state 
)

Definition at line 5917 of file graphics.c.

5919{
5920 TRACE("(%p, %p)\n", graphics, state);
5921 return begin_container(graphics, BEGIN_CONTAINER, state);
5922}
static GpStatus begin_container(GpGraphics *graphics, GraphicsContainerType type, GraphicsContainer *state)
Definition: graphics.c:5885

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 5968 of file graphics.c.

5969{
5970 GpRectF dstrectf, srcrectf;
5971
5972 TRACE("(%p, %p, %p, %d, %p)\n", graphics, dstrect, srcrect, unit, state);
5973
5974 if (!dstrect || !srcrect)
5975 return InvalidParameter;
5976
5977 dstrectf.X = dstrect->X;
5978 dstrectf.Y = dstrect->Y;
5979 dstrectf.Width = dstrect->Width;
5980 dstrectf.Height = dstrect->Height;
5981
5982 srcrectf.X = srcrect->X;
5983 srcrectf.Y = srcrect->Y;
5984 srcrectf.Width = srcrect->Width;
5985 srcrectf.Height = srcrect->Height;
5986
5987 return GdipBeginContainer(graphics, &dstrectf, &srcrectf, unit, state);
5988}
GpStatus WINGDIPAPI GdipBeginContainer(GpGraphics *graphics, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, GraphicsContainer *state)
Definition: graphics.c:5924

◆ GdipBitmapApplyEffect()

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

Definition at line 134 of file image.c.

136{
137 FIXME("(%p %p %p %d %p %p): stub\n", bitmap, effect, roi, useAuxData, auxData, auxDataSize);
138 /*
139 * Note: According to Jose Roca's GDI+ docs, this function is not
140 * implemented in Windows's GDI+.
141 */
142 return NotImplemented;
143}
#define FIXME(fmt,...)
Definition: debug.h:111
@ NotImplemented
Definition: gdiplustypes.h:32
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 145 of file image.c.

148{
149 FIXME("(%p %d %p %p %p %p %d %p %p): stub\n", inputBitmaps, numInputs, effect, roi, outputRect, outputBitmap, useAuxData, auxData, auxDataSize);
150 /*
151 * Note: According to Jose Roca's GDI+ docs, this function is not
152 * implemented in Windows's GDI+.
153 */
154 return NotImplemented;
155}

◆ GdipBitmapGetHistogram()

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

Definition at line 5609 of file image.c.

5611{
5612 static void (* const set_histogram_point[])(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3) =
5613 {
5622 };
5623 UINT width, height, x, y;
5624
5625 TRACE("(%p, %d, %u, %p, %p, %p, %p)\n", bitmap, format, num_of_entries,
5626 ch0, ch1, ch2, ch3);
5627
5628 if (!bitmap || num_of_entries != 256)
5629 return InvalidParameter;
5630
5631 /* Make sure passed channel pointers match requested format */
5632 switch (format)
5633 {
5636 if (!ch0 || !ch1 || !ch2 || !ch3)
5637 return InvalidParameter;
5638 memset(ch0, 0, num_of_entries * sizeof(UINT));
5639 memset(ch1, 0, num_of_entries * sizeof(UINT));
5640 memset(ch2, 0, num_of_entries * sizeof(UINT));
5641 memset(ch3, 0, num_of_entries * sizeof(UINT));
5642 break;
5643 case HistogramFormatRGB:
5644 if (!ch0 || !ch1 || !ch2 || ch3)
5645 return InvalidParameter;
5646 memset(ch0, 0, num_of_entries * sizeof(UINT));
5647 memset(ch1, 0, num_of_entries * sizeof(UINT));
5648 memset(ch2, 0, num_of_entries * sizeof(UINT));
5649 break;
5651 case HistogramFormatB:
5652 case HistogramFormatG:
5653 case HistogramFormatR:
5654 case HistogramFormatA:
5655 if (!ch0 || ch1 || ch2 || ch3)
5656 return InvalidParameter;
5657 memset(ch0, 0, num_of_entries * sizeof(UINT));
5658 break;
5659 default:
5660 WARN("Invalid histogram format requested, %d\n", format);
5661 return InvalidParameter;
5662 }
5663
5664 GdipGetImageWidth(&bitmap->image, &width);
5665 GdipGetImageHeight(&bitmap->image, &height);
5666
5667 for (y = 0; y < height; y++)
5668 for (x = 0; x < width; x++)
5669 {
5670 ARGB color;
5671
5673 set_histogram_point[format](color, ch0, ch1, ch2, ch3);
5674 }
5675
5676 return Ok;
5677}
static void set_histogram_point_g(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5591
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2390
static void set_histogram_point_rgb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5574
static void set_histogram_point_argb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5556
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2287
static void set_histogram_point_pargb(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5564
static void set_histogram_point_a(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5601
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap *bitmap, INT x, INT y, ARGB *color)
Definition: image.c:288
static void set_histogram_point_r(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5596
static void set_histogram_point_gray(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5581
static void set_histogram_point_b(ARGB color, UINT *ch0, UINT *ch1, UINT *ch2, UINT *ch3)
Definition: image.c:5586
@ 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 5682 of file image.c.

5683{
5684 TRACE("(%d, %p)\n", format, num_of_entries);
5685
5686 if (!num_of_entries)
5687 return InvalidParameter;
5688
5689 *num_of_entries = 256;
5690 return Ok;
5691}

◆ GdipBitmapGetPixel()

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

Definition at line 288 of file image.c.

290{
291 BYTE r, g, b, a;
292 BYTE index;
293 BYTE *row;
294
295 if(!bitmap || !color ||
296 x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
297 return InvalidParameter;
298
299 row = bitmap->bits+bitmap->stride*y;
300
301 switch (bitmap->format)
302 {
305 break;
308 break;
311 break;
314 break;
317 break;
320 break;
323 break;
325 getpixel_24bppRGB(&r,&g,&b,&a,row,x);
326 break;
328 getpixel_32bppRGB(&r,&g,&b,&a,row,x);
329 break;
332 break;
335 break;
337 getpixel_48bppRGB(&r,&g,&b,&a,row,x);
338 break;
341 break;
344 break;
345 default:
346 FIXME("not implemented for format 0x%x\n", bitmap->format);
347 return NotImplemented;
348 }
349
350 if (bitmap->format & PixelFormatIndexed)
351 *color = bitmap->image.palette->Entries[index];
352 else
353 *color = a<<24|r<<16|g<<8|b;
354
355 return Ok;
356}
#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:202
static void getpixel_64bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:274
static void getpixel_16bppRGB565(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:192
static void getpixel_4bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:162
static void getpixel_1bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:157
static void getpixel_32bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:224
static void getpixel_8bppIndexed(BYTE *index, const BYTE *row, UINT x)
Definition: image.c:170
static void getpixel_64bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:265
static void getpixel_48bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:256
static void getpixel_16bppGrayScale(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:175
static void getpixel_24bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:215
static void getpixel_16bppRGB555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:182
static void getpixel_32bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:233
static void getpixel_32bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x)
Definition: image.c:242
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_colorkey(), test_colormatrix(), test_containers(), test_emfonly(), test_fillrect(), test_gamma(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipImageGetFrameDimensionsCount(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_getsetpixel(), test_LockBits(), test_LockBits_UserBuf(), test_multiframegif(), test_pagetransform(), test_palette(), test_remaptable(), test_rotateflip(), and test_worldtransform().

◆ GdipBitmapLockBits()

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

Definition at line 1030 of file image.c.

1032{
1033 INT bitspp = PIXELFORMATBPP(format);
1034 GpRect act_rect; /* actual rect to be used */
1035 GpStatus stat;
1036 BOOL unlock;
1037
1038 TRACE("%p %p %d 0x%x %p\n", bitmap, rect, flags, format, lockeddata);
1039
1040 if(!lockeddata || !bitmap)
1041 return InvalidParameter;
1042 if(!image_lock(&bitmap->image, &unlock))
1043 return ObjectBusy;
1044
1045 if(rect){
1046 if(rect->X < 0 || rect->Y < 0 || (rect->X + rect->Width > bitmap->width) ||
1047 (rect->Y + rect->Height > bitmap->height) || !flags)
1048 {
1049 image_unlock(&bitmap->image, unlock);
1050 return InvalidParameter;
1051 }
1052
1053 act_rect = *rect;
1054 }
1055 else{
1056 act_rect.X = act_rect.Y = 0;
1057 act_rect.Width = bitmap->width;
1058 act_rect.Height = bitmap->height;
1059 }
1060
1061 if(bitmap->lockmode)
1062 {
1063 WARN("bitmap is already locked and cannot be locked again\n");
1064 image_unlock(&bitmap->image, unlock);
1065 return WrongState;
1066 }
1067
1068 if (bitmap->bits && bitmap->format == format && !(flags & ImageLockModeUserInputBuf))
1069 {
1070 /* no conversion is necessary; just use the bits directly */
1071 lockeddata->Width = act_rect.Width;
1072 lockeddata->Height = act_rect.Height;
1073 lockeddata->PixelFormat = format;
1074 lockeddata->Reserved = flags;
1075 lockeddata->Stride = bitmap->stride;
1076 lockeddata->Scan0 = bitmap->bits + (bitspp / 8) * act_rect.X +
1077 bitmap->stride * act_rect.Y;
1078
1079 bitmap->lockmode = flags | ImageLockModeRead;
1080
1081 image_unlock(&bitmap->image, unlock);
1082 return Ok;
1083 }
1084
1085 /* Make sure we can convert to the requested format. */
1087 {
1088 stat = convert_pixels(0, 0, 0, NULL, format, 0, NULL, bitmap->format, NULL);
1089 if (stat == NotImplemented)
1090 {
1091 FIXME("cannot read bitmap from %x to %x\n", bitmap->format, format);
1092 image_unlock(&bitmap->image, unlock);
1093 return NotImplemented;
1094 }
1095 }
1096
1097 /* If we're opening for writing, make sure we'll be able to write back in
1098 * the original format. */
1100 {
1101 stat = convert_pixels(0, 0, 0, NULL, bitmap->format, 0, NULL, format, NULL);
1102 if (stat == NotImplemented)
1103 {
1104 FIXME("cannot write bitmap from %x to %x\n", format, bitmap->format);
1105 image_unlock(&bitmap->image, unlock);
1106 return NotImplemented;
1107 }
1108 }
1109
1110 lockeddata->Width = act_rect.Width;
1111 lockeddata->Height = act_rect.Height;
1112 lockeddata->PixelFormat = format;
1113 lockeddata->Reserved = flags;
1114
1116 {
1117 lockeddata->Stride = (((act_rect.Width * bitspp + 7) / 8) + 3) & ~3;
1118
1119 bitmap->bitmapbits = heap_alloc_zero(lockeddata->Stride * act_rect.Height);
1120
1121 if (!bitmap->bitmapbits)
1122 {
1123 image_unlock(&bitmap->image, unlock);
1124 return OutOfMemory;
1125 }
1126
1127 lockeddata->Scan0 = bitmap->bitmapbits;
1128 }
1129
1131 {
1132 static BOOL fixme = FALSE;
1133
1134 if (!fixme && (PIXELFORMATBPP(bitmap->format) * act_rect.X) % 8 != 0)
1135 {
1136 FIXME("Cannot copy rows that don't start at a whole byte.\n");
1137 fixme = TRUE;
1138 }
1139
1140 stat = convert_pixels(act_rect.Width, act_rect.Height,
1141 lockeddata->Stride, lockeddata->Scan0, format,
1142 bitmap->stride,
1143 bitmap->bits + bitmap->stride * act_rect.Y + PIXELFORMATBPP(bitmap->format) * act_rect.X / 8,
1144 bitmap->format, bitmap->image.palette);
1145
1146 if (stat != Ok)
1147 {
1148 heap_free(bitmap->bitmapbits);
1149 bitmap->bitmapbits = NULL;
1150 image_unlock(&bitmap->image, unlock);
1151 return stat;
1152 }
1153 }
1154
1155 bitmap->lockmode = flags | ImageLockModeRead;
1156 bitmap->lockx = act_rect.X;
1157 bitmap->locky = act_rect.Y;
1158
1159 image_unlock(&bitmap->image, unlock);
1160 return Ok;
1161}
#define PIXELFORMATBPP(x)
Definition: image.c:45
GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *palette)
Definition: image.c:562
static void image_unlock(GpImage *image, BOOL unlock)
static BOOL image_lock(GpImage *image, BOOL *unlock)
@ ImageLockModeUserInputBuf
@ ImageLockModeRead
@ ImageLockModeWrite
@ WrongState
Definition: gdiplustypes.h:34
@ ObjectBusy
Definition: gdiplustypes.h:30
GLbitfield flags
Definition: glext.h:7161
& rect
Definition: startmenu.cpp:1413
UINT_PTR Reserved
PixelFormat PixelFormat
INT Width
Definition: gdiplustypes.h:671
INT Height
Definition: gdiplustypes.h:672
INT X
Definition: gdiplustypes.h:669
INT Y
Definition: gdiplustypes.h:670

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

◆ GdipBitmapSetPixel()

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

Definition at line 494 of file image.c.

496{
497 BYTE a, r, g, b;
498 BYTE *row;
499
500 if(!bitmap || x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
501 return InvalidParameter;
502
503 a = color>>24;
504 r = color>>16;
505 g = color>>8;
506 b = color;
507
508 row = bitmap->bits + bitmap->stride * y;
509
510 switch (bitmap->format)
511 {
514 break;
517 break;
520 break;
523 break;
526 break;
529 break;
532 break;
535 break;
538 break;
541 break;
544 break;
546 setpixel_8bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
547 break;
549 setpixel_4bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
550 break;
552 setpixel_1bppIndexed(r,g,b,a,row,x,bitmap->image.palette);
553 break;
554 default:
555 FIXME("not implemented for format 0x%x\n", bitmap->format);
556 return NotImplemented;
557 }
558
559 return Ok;
560}
static void setpixel_16bppARGB1555(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:430
static void setpixel_48bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:468
static void setpixel_32bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:459
static void setpixel_16bppRGB555(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:414
static void setpixel_64bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:483
static void setpixel_32bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:447
static void setpixel_16bppGrayScale(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:408
static void setpixel_64bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:476
static void setpixel_4bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:399
static void setpixel_32bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:453
static void setpixel_16bppRGB565(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:422
static void setpixel_1bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:393
static void setpixel_8bppIndexed(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x, ColorPalette *palette)
Definition: image.c:386
static void setpixel_24bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, BYTE *row, UINT x)
Definition: image.c:439

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(), and test_remaptable().

◆ GdipBitmapSetResolution()

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

Definition at line 1163 of file image.c.

1164{
1165 TRACE("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
1166
1167 if (!bitmap || xdpi == 0.0 || ydpi == 0.0)
1168 return InvalidParameter;
1169
1170 bitmap->image.xres = xdpi;
1171 bitmap->image.yres = ydpi;
1172
1173 return Ok;
1174}

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 1176 of file image.c.

1178{
1179 GpStatus stat;
1180 static BOOL fixme = FALSE;
1181 BOOL unlock;
1182
1183 TRACE("(%p,%p)\n", bitmap, lockeddata);
1184
1185 if(!bitmap || !lockeddata)
1186 return InvalidParameter;
1187 if(!image_lock(&bitmap->image, &unlock))
1188 return ObjectBusy;
1189
1190 if(!bitmap->lockmode)
1191 {
1192 image_unlock(&bitmap->image, unlock);
1193 return WrongState;
1194 }
1195
1196 if(!(lockeddata->Reserved & ImageLockModeWrite)){
1197 bitmap->lockmode = 0;
1198 heap_free(bitmap->bitmapbits);
1199 bitmap->bitmapbits = NULL;
1200 image_unlock(&bitmap->image, unlock);
1201 return Ok;
1202 }
1203
1204 if (!bitmap->bitmapbits && !(lockeddata->Reserved & ImageLockModeUserInputBuf))
1205 {
1206 /* we passed a direct reference; no need to do anything */
1207 bitmap->lockmode = 0;
1208 image_unlock(&bitmap->image, unlock);
1209 return Ok;
1210 }
1211
1212 if (!fixme && (PIXELFORMATBPP(bitmap->format) * bitmap->lockx) % 8 != 0)
1213 {
1214 FIXME("Cannot copy rows that don't start at a whole byte.\n");
1215 fixme = TRUE;
1216 }
1217
1218 stat = convert_pixels(lockeddata->Width, lockeddata->Height,
1219 bitmap->stride,
1220 bitmap->bits + bitmap->stride * bitmap->locky + PIXELFORMATBPP(bitmap->format) * bitmap->lockx / 8,
1221 bitmap->format,
1222 lockeddata->Stride, lockeddata->Scan0, lockeddata->PixelFormat, NULL);
1223
1224 if (stat != Ok)
1225 {
1226 ERR("failed to convert pixels; this should never happen\n");
1227 }
1228
1229 heap_free(bitmap->bitmapbits);
1230 bitmap->bitmapbits = NULL;
1231 bitmap->lockmode = 0;
1232
1233 image_unlock(&bitmap->image, unlock);
1234 return stat;
1235}

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

◆ GdipClearPathMarkers()

GpStatus WINGDIPAPI GdipClearPathMarkers ( GpPath path)

Definition at line 2439 of file graphicspath.c.

2440{
2441 INT count;
2442 INT i;
2443
2444 TRACE("(%p)\n", path);
2445
2446 if(!path)
2447 return InvalidParameter;
2448
2449 count = path->pathdata.Count;
2450
2451 for(i = 0; i < count - 1; i++){
2452 path->pathdata.Types[i] &= ~PathPointTypePathMarker;
2453 }
2454
2455 return Ok;
2456}

◆ GdipCloneBitmapArea()

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

Definition at line 1237 of file image.c.

1239{
1240 Rect area;
1241 GpStatus stat;
1242
1243 TRACE("(%f,%f,%f,%f,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap);
1244
1245 if (!srcBitmap || !dstBitmap || srcBitmap->image.type != ImageTypeBitmap ||
1246 x < 0 || y < 0 ||
1247 x + width > srcBitmap->width || y + height > srcBitmap->height)
1248 {
1249 TRACE("<-- InvalidParameter\n");
1250 return InvalidParameter;
1251 }
1252
1254 format = srcBitmap->format;
1255
1256 area.X = gdip_round(x);
1257 area.Y = gdip_round(y);
1258 area.Width = gdip_round(width);
1259 area.Height = gdip_round(height);
1260
1261 stat = GdipCreateBitmapFromScan0(area.Width, area.Height, 0, format, NULL, dstBitmap);
1262 if (stat == Ok)
1263 {
1264 stat = convert_pixels(area.Width, area.Height, (*dstBitmap)->stride, (*dstBitmap)->bits, (*dstBitmap)->format,
1265 srcBitmap->stride,
1266 srcBitmap->bits + srcBitmap->stride * area.Y + PIXELFORMATBPP(srcBitmap->format) * area.X / 8,
1267 srcBitmap->format, srcBitmap->image.palette);
1268
1269 if (stat == Ok && srcBitmap->image.palette)
1270 {
1271 ColorPalette *src_palette, *dst_palette;
1272
1273 src_palette = srcBitmap->image.palette;
1274
1275 dst_palette = heap_alloc_zero(sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count);
1276
1277 if (dst_palette)
1278 {
1279 dst_palette->Flags = src_palette->Flags;
1280 dst_palette->Count = src_palette->Count;
1281 memcpy(dst_palette->Entries, src_palette->Entries, sizeof(ARGB) * src_palette->Count);
1282
1283 heap_free((*dstBitmap)->image.palette);
1284 (*dstBitmap)->image.palette = dst_palette;
1285 }
1286 else
1287 stat = OutOfMemory;
1288 }
1289
1290 if (stat != Ok)
1291 GdipDisposeImage(&(*dstBitmap)->image);
1292 }
1293
1294 if (stat != Ok)
1295 *dstBitmap = NULL;
1296
1297 return stat;
1298}
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE *scan0, GpBitmap **bitmap)
Definition: image.c:1760
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2155
static INT gdip_round(REAL x)
@ ImageTypeBitmap
Definition: gdiplusenums.h:195
#define PixelFormatDontCare
static Real area(Real A[2], Real B[2], Real C[2])
Definition: polyDBG.cc:50
GpImage image
PixelFormat format
ColorPalette * palette

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 1300 of file image.c.

1302{
1303 TRACE("(%i,%i,%i,%i,0x%x,%p,%p)\n", x, y, width, height, format, srcBitmap, dstBitmap);
1304
1305 return GdipCloneBitmapArea(x, y, width, height, format, srcBitmap, dstBitmap);
1306}
GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap)
Definition: image.c:1237

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 *clone = heap_alloc_zero(sizeof(GpSolidFill));
81 if (!*clone) return OutOfMemory;
82 memcpy(*clone, brush, sizeof(GpSolidFill));
83 break;
84 }
86 {
87 GpHatch *hatch = (GpHatch*)brush;
88
89 return GdipCreateHatchBrush(hatch->hatchstyle, hatch->forecol, hatch->backcol, (GpHatch**)clone);
90 }
93 INT count, pcount;
95
96 *clone = heap_alloc_zero(sizeof(GpPathGradient));
97 if (!*clone) return OutOfMemory;
98
99 src = (GpPathGradient*) brush,
100 dest = (GpPathGradient*) *clone;
101
102 memcpy(dest, src, sizeof(GpPathGradient));
103
104 stat = GdipClonePath(src->path, &dest->path);
105
106 if(stat != Ok){
108 return stat;
109 }
110
111 dest->transform = src->transform;
112
113 /* blending */
114 count = src->blendcount;
115 dest->blendcount = count;
116 dest->blendfac = heap_alloc_zero(count * sizeof(REAL));
117 dest->blendpos = heap_alloc_zero(count * sizeof(REAL));
118 dest->surroundcolors = heap_alloc_zero(dest->surroundcolorcount * sizeof(ARGB));
119 pcount = dest->pblendcount;
120 if (pcount)
121 {
122 dest->pblendcolor = heap_alloc_zero(pcount * sizeof(ARGB));
123 dest->pblendpos = heap_alloc_zero(pcount * sizeof(REAL));
124 }
125
126 if(!dest->blendfac || !dest->blendpos || !dest->surroundcolors ||
127 (pcount && (!dest->pblendcolor || !dest->pblendpos))){
128 GdipDeletePath(dest->path);
129 heap_free(dest->blendfac);
130 heap_free(dest->blendpos);
131 heap_free(dest->surroundcolors);
132 heap_free(dest->pblendcolor);
133 heap_free(dest->pblendpos);
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 break;
149 }
152 INT count, pcount;
153
154 dest = heap_alloc_zero(sizeof(GpLineGradient));
155 if(!dest) return OutOfMemory;
156
157 src = (GpLineGradient*)brush;
158
159 memcpy(dest, src, sizeof(GpLineGradient));
160
161 count = dest->blendcount;
162 dest->blendfac = heap_alloc_zero(count * sizeof(REAL));
163 dest->blendpos = heap_alloc_zero(count * sizeof(REAL));
164 pcount = dest->pblendcount;
165 if (pcount)
166 {
167 dest->pblendcolor = heap_alloc_zero(pcount * sizeof(ARGB));
168 dest->pblendpos = heap_alloc_zero(pcount * sizeof(REAL));
169 }
170
171 if (!dest->blendfac || !dest->blendpos ||
172 (pcount && (!dest->pblendcolor || !dest->pblendpos)))
173 {
174 heap_free(dest->blendfac);
175 heap_free(dest->blendpos);
176 heap_free(dest->pblendcolor);
177 heap_free(dest->pblendpos);
179 return OutOfMemory;
180 }
181
182 dest->transform = src->transform;
183
184 memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
185 memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
186
187 if (pcount)
188 {
189 memcpy(dest->pblendcolor, src->pblendcolor, pcount * sizeof(ARGB));
190 memcpy(dest->pblendpos, src->pblendpos, pcount * sizeof(REAL));
191 }
192
193 *clone = &dest->brush;
194 break;
195 }
197 {
199 GpTexture *texture = (GpTexture*)brush;
200 GpTexture *new_texture;
202
204 if (stat != Ok) return stat;
206 if (stat != Ok) return stat;
207
208 stat = GdipCreateTextureIA(texture->image, texture->imageattributes, 0, 0, width, height, &new_texture);
209
210 if (stat == Ok)
211 {
212 new_texture->transform = texture->transform;
213 *clone = &new_texture->brush;
214 }
215 else
216 *clone = NULL;
217
218 return stat;
219 }
220 default:
221 ERR("not implemented for brush type %d\n", brush->bt);
222 return NotImplemented;
223 }
224
225 TRACE("<-- %p\n", *clone);
226 return Ok;
227}
GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
Definition: brush.c:276
GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, REAL height, GpTexture **texture)
Definition: brush.c:848
@ 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:135
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 = heap_alloc_zero(sizeof(GpCustomLineCap));
44 else
45 *to = heap_alloc_zero(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 = heap_alloc_zero(from->pathdata.Count * sizeof(PointF));
57 (*to)->pathdata.Types = heap_alloc_zero(from->pathdata.Count);
58
59 if((!(*to)->pathdata.Types || !(*to)->pathdata.Points) && (*to)->pathdata.Count){
60 heap_free((*to)->pathdata.Points);
61 heap_free((*to)->pathdata.Types);
62 heap_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 520 of file font.c.

521{
523
524 TRACE("(%p, %p)\n", font, cloneFont);
525
526 if(!font || !cloneFont)
527 return InvalidParameter;
528
529 *cloneFont = heap_alloc_zero(sizeof(GpFont));
530 if(!*cloneFont) return OutOfMemory;
531
532 **cloneFont = *font;
533 stat = GdipCloneFontFamily(font->family, &(*cloneFont)->family);
534 if (stat != Ok) heap_free(*cloneFont);
535
536 return stat;
537}
GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily *FontFamily, GpFontFamily **clonedFontFamily)
Definition: font.c:803

◆ GdipCloneFontFamily()

GpStatus WINGDIPAPI GdipCloneFontFamily ( GpFontFamily FontFamily,
GpFontFamily **  clonedFontFamily 
)

Definition at line 803 of file font.c.

804{
806
807 if (!(FontFamily && clonedFontFamily)) return InvalidParameter;
808
809 TRACE("%p (%s), %p\n", FontFamily,
810 debugstr_w(FontFamily->FamilyName), clonedFontFamily);
811
812 status = clone_font_family(FontFamily, clonedFontFamily);
813 if (status != Ok) return status;
814
815 TRACE("<-- %p\n", *clonedFontFamily);
816
817 return Ok;
818}
static GpStatus clone_font_family(const GpFontFamily *, GpFontFamily **)
Definition: font.c:781

Referenced by GdipCloneFont(), GdipGetFamily(), GdipGetFontCollectionFamilyList(), and test_fontfamily().

◆ GdipCloneImage()

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

Definition at line 1308 of file image.c.

1309{
1310 TRACE("%p, %p\n", image, cloneImage);
1311
1312 if (!image || !cloneImage)
1313 return InvalidParameter;
1314
1315 if (image->type == ImageTypeBitmap)
1316 {
1318
1320 bitmap->format, bitmap, (GpBitmap **)cloneImage);
1321 }
1322 else if (image->type == ImageTypeMetafile && ((GpMetafile*)image)->hemf)
1323 {
1325
1327
1328 result = heap_alloc_zero(sizeof(*result));
1329 if (!result)
1330 return OutOfMemory;
1331
1332 result->image.type = ImageTypeMetafile;
1333 result->image.format = image->format;
1334 result->image.flags = image->flags;
1335 result->image.frame_count = 1;
1336 result->image.xres = image->xres;
1337 result->image.yres = image->yres;
1338 result->bounds = metafile->bounds;
1339 result->unit = metafile->unit;
1340 result->metafile_type = metafile->metafile_type;
1341 result->hemf = CopyEnhMetaFileW(metafile->hemf, NULL);
1342 list_init(&result->containers);
1343
1344 if (!result->hemf)
1345 {
1347 return OutOfMemory;
1348 }
1349
1350 *cloneImage = &result->image;
1351 return Ok;
1352 }
1353 else
1354 {
1355 WARN("GpImage with no image data (metafile in wrong state?)\n");
1356 return InvalidParameter;
1357 }
1358}
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:1300
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_emfonly(), and test_GdipCloneImage().

◆ 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 = heap_alloc(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 heap_free(remap_tables[i].colormap);
77 }
78
79 return stat;
80}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
@ 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 125 of file matrix.c.

126{
127 TRACE("(%p, %p)\n", matrix, clone);
128
129 if(!matrix || !clone)
130 return InvalidParameter;
131
132 *clone = heap_alloc_zero(sizeof(GpMatrix));
133 if(!*clone) return OutOfMemory;
134
135 **clone = *matrix;
136
137 return Ok;
138}
GLuint GLenum matrix
Definition: glext.h:9407

◆ GdipClonePath()

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

Definition at line 1135 of file graphicspath.c.

1136{
1137 TRACE("(%p, %p)\n", path, clone);
1138
1139 if(!path || !clone)
1140 return InvalidParameter;
1141
1142 *clone = heap_alloc_zero(sizeof(GpPath));
1143 if(!*clone) return OutOfMemory;
1144
1145 **clone = *path;
1146
1147 (*clone)->pathdata.Points = heap_alloc_zero(path->datalen * sizeof(PointF));
1148 (*clone)->pathdata.Types = heap_alloc_zero(path->datalen);
1149 if(!(*clone)->pathdata.Points || !(*clone)->pathdata.Types){
1150 heap_free((*clone)->pathdata.Points);
1151 heap_free((*clone)->pathdata.Types);
1152 heap_free(*clone);
1153 return OutOfMemory;
1154 }
1155
1156 memcpy((*clone)->pathdata.Points, path->pathdata.Points,
1157 path->datalen * sizeof(PointF));
1158 memcpy((*clone)->pathdata.Types, path->pathdata.Types, path->datalen);
1159
1160 return Ok;
1161}

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 = heap_alloc_zero(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
107 stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
108
109 if (stat == Ok && pen->customstart)
110 stat = GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
111
112 if (stat == Ok && pen->customend)
113 stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
114
115 if (stat == Ok && pen->dashes)
116 {
117 (*clonepen)->dashes = heap_alloc_zero(pen->numdashes * sizeof(REAL));
118 if ((*clonepen)->dashes)
119 memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL));
120 else
122 }
123
124 if (stat != Ok)
125 {
126 GdipDeletePen(*clonepen);
127 *clonepen = NULL;
128 return stat;
129 }
130
131 TRACE("<-- %p\n", *clonepen);
132
133 return Ok;
134}
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:192
INT numdashes
REAL * dashes
GpCustomLineCap * customend
GpBrush * brush
GpCustomLineCap * customstart

◆ GdipCloneRegion()

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

Definition at line 211 of file region.c.

212{
214
215 TRACE("%p %p\n", region, clone);
216
217 if (!(region && clone))
218 return InvalidParameter;
219
220 *clone = heap_alloc_zero(sizeof(GpRegion));
221 if (!*clone)
222 return OutOfMemory;
223 element = &(*clone)->node;
224
225 (*clone)->num_children = region->num_children;
226 return clone_element(&region->node, &element);
227}
static GpStatus clone_element(const region_element *element, region_element **element2)
Definition: region.c:140
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 369 of file stringformat.c.

370{
371 if(!format || !newFormat)
372 return InvalidParameter;
373
374 *newFormat = heap_alloc_zero(sizeof(GpStringFormat));
375 if(!*newFormat) return OutOfMemory;
376
377 **newFormat = *format;
378
379 if(format->tabcount > 0){
380 (*newFormat)->tabs = heap_alloc_zero(sizeof(REAL) * format->tabcount);
381 if(!(*newFormat)->tabs){
382 heap_free(*newFormat);
383 return OutOfMemory;
384 }
385 memcpy((*newFormat)->tabs, format->tabs, sizeof(REAL) * format->tabcount);
386 }
387 else
388 (*newFormat)->tabs = NULL;
389
390 if(format->range_count > 0){
391 (*newFormat)->character_ranges = heap_alloc_zero(sizeof(CharacterRange) * format->range_count);
392 if(!(*newFormat)->character_ranges){
393 heap_free((*newFormat)->tabs);
394 heap_free(*newFormat);
395 return OutOfMemory;
396 }
397 memcpy((*newFormat)->character_ranges, format->character_ranges,
398 sizeof(CharacterRange) * format->range_count);
399 }
400 else
401 (*newFormat)->character_ranges = NULL;
402
403 TRACE("%p %p\n",format,newFormat);
404
405 return Ok;
406}

◆ GdipClosePathFigure()

GpStatus WINGDIPAPI GdipClosePathFigure ( GpPath path)

Definition at line 1163 of file graphicspath.c.

1164{
1165 TRACE("(%p)\n", path);
1166
1167 if(!path)
1168 return InvalidParameter;
1169
1170 if(path->pathdata.Count > 0){
1171 path->pathdata.Types[path->pathdata.Count - 1] |= PathPointTypeCloseSubpath;
1172 path->newfigure = TRUE;
1173 }
1174
1175 return Ok;
1176}

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

◆ GdipClosePathFigures()

GpStatus WINGDIPAPI GdipClosePathFigures ( GpPath path)

Definition at line 1178 of file graphicspath.c.

1179{
1180 INT i;
1181
1182 TRACE("(%p)\n", path);
1183
1184 if(!path)
1185 return InvalidParameter;
1186
1187 for(i = 1; i < path->pathdata.Count; i++){
1188 if(path->pathdata.Types[i] == PathPointTypeStart)
1189 path->pathdata.Types[i-1] |= PathPointTypeCloseSubpath;
1190 }
1191
1192 path->newfigure = TRUE;
1193
1194 return Ok;
1195}

◆ GdipCombineRegionPath()

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

Definition at line 232 of file region.c.

233{
234 GpRegion *path_region;
237
238 TRACE("%p %p %d\n", region, path, mode);
239
240 if (!(region && path))
241 return InvalidParameter;
242
243 stat = GdipCreateRegionPath(path, &path_region);
244 if (stat != Ok)
245 return stat;
246
247 /* simply replace region data */
249 delete_element(&region->node);
250 memcpy(region, path_region, sizeof(GpRegion));
251 heap_free(path_region);
252 return Ok;
253 }
254
255 left = heap_alloc_zero(sizeof(region_element));
256 if (left)
257 {
258 *left = region->node;
259 stat = clone_element(&path_region->node, &right);
260 if (stat == Ok)
261 {
262 fuse_region(region, left, right, mode);
263 GdipDeleteRegion(path_region);
264 return Ok;
265 }
266 }
267 else
269
271 GdipDeleteRegion(path_region);
272 return stat;
273}
static void fuse_region(GpRegion *region, region_element *left, region_element *right, const CombineMode mode)
Definition: region.c:189
GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
Definition: region.c:425
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
Definition: region.c:571
void delete_element(region_element *element)
Definition: gdiplus.c:455
@ CombineModeReplace
Definition: gdiplusenums.h:351
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_getregiondata(), test_isvisiblepoint(), test_isvisiblerect(), test_transform(), and test_translate().

◆ GdipCombineRegionRect()

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

Definition at line 278 of file region.c.

280{
281 GpRegion *rect_region;
284
285 TRACE("%p %s %d\n", region, debugstr_rectf(rect), mode);
286
287 if (!(region && rect))
288 return InvalidParameter;
289
290 stat = GdipCreateRegionRect(rect, &rect_region);
291 if (stat != Ok)
292 return stat;
293
294 /* simply replace region data */
296 delete_element(&region->node);
297 memcpy(region, rect_region, sizeof(GpRegion));
298 heap_free(rect_region);
299 return Ok;
300 }
301
302 left = heap_alloc_zero(sizeof(region_element));
303 if (left)
304 {
305 memcpy(left, &region->node, sizeof(region_element));
306 stat = clone_element(&rect_region->node, &right);
307 if (stat == Ok)
308 {
309 fuse_region(region, left, right, mode);
310 GdipDeleteRegion(rect_region);
311 return Ok;
312 }
313 }
314 else
316
318 GdipDeleteRegion(rect_region);
319 return stat;
320}
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 325 of file region.c.

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

Referenced by 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 heap_free(reg2copy);
366 return Ok;
367 }
368
369 left = heap_alloc_zero(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 {
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:211

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

◆ GdipComment()

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

Definition at line 5990 of file graphics.c.

5991{
5992 FIXME("(%p, %d, %p): stub\n", graphics, sizeData, data);
5993 return NotImplemented;
5994}
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 = heap_alloc_zero(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 heap_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:655
BYTE * Types
Definition: gdiplustypes.h:656

Referenced by test_captype(), and test_create_adjustable_cap().

◆ GdipCreateBitmapFromFile()

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

Definition at line 1360 of file image.c.

1362{
1363 GpStatus stat;
1364 IStream *stream;
1365
1366 TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
1367
1368 if(!filename || !bitmap)
1369 return InvalidParameter;
1370
1371 *bitmap = NULL;
1372
1374
1375 if(stat != Ok)
1376 return stat;
1377
1379
1380 IStream_Release(stream);
1381
1382 return stat;
1383}
#define GENERIC_READ
Definition: compat.h:135
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR *filename, UINT access, IStream **stream)
Definition: graphics.c:2558
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream *stream, GpBitmap **bitmap)
Definition: image.c:1935
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 1436 of file image.c.

1438{
1439 TRACE("(%s) %p\n", debugstr_w(filename), bitmap);
1440
1442}
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR *filename, GpBitmap **bitmap)
Definition: image.c:1360

◆ GdipCreateBitmapFromGdiDib()

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

Definition at line 1385 of file image.c.

1387{
1390
1391 FIXME("(%p, %p, %p) - partially implemented\n", info, bits, bitmap);
1392
1393 if (!info || !bits || !bitmap)
1394 return InvalidParameter;
1395
1396 height = abs(info->bmiHeader.biHeight);
1397 stride = ((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) >> 3) & ~3;
1398
1399 if(info->bmiHeader.biHeight > 0) /* bottom-up */
1400 {
1401 bits = (BYTE*)bits + (height - 1) * stride;
1402 stride = -stride;
1403 }
1404
1405 switch(info->bmiHeader.biBitCount) {
1406 case 1:
1408 break;
1409 case 4:
1411 break;
1412 case 8:
1414 break;
1415 case 16:
1417 break;
1418 case 24:
1420 break;
1421 case 32:
1423 break;
1424 default:
1425 FIXME("don't know how to handle %d bpp\n", info->bmiHeader.biBitCount);
1426 *bitmap = NULL;
1427 return InvalidParameter;
1428 }
1429
1430 return GdipCreateBitmapFromScan0(info->bmiHeader.biWidth, height, stride, format,
1431 bits, bitmap);
1432
1433}
#define abs(i)
Definition: fconv.c:206
unsigned long DWORD
Definition: ntddk_ex.h:95
INT PixelFormat
GLsizei stride
Definition: glext.h:5848
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929

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

◆ GdipCreateBitmapFromGraphics()

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

Definition at line 1542 of file image.c.

1544{
1545 GpStatus ret;
1546
1547 TRACE("(%d, %d, %p, %p)\n", width, height, target, bitmap);
1548
1549 if(!target || !bitmap)
1550 return InvalidParameter;
1551
1553 NULL, bitmap);
1554
1555 if (ret == Ok)
1556 {
1557 GdipGetDpiX(target, &(*bitmap)->image.xres);
1558 GdipGetDpiY(target, &(*bitmap)->image.yres);
1559 }
1560
1561 return ret;
1562}
GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL *dpi)
Definition: graphics.c:6621
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL *dpi)
Definition: graphics.c:6635
GLenum target
Definition: glext.h:7315

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

◆ GdipCreateBitmapFromHBITMAP()

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

Definition at line 5152 of file image.c.

5153{
5154 BITMAP bm;
5155 GpStatus retval;
5157 BitmapData lockeddata;
5158
5159 TRACE("%p %p %p\n", hbm, hpal, bitmap);
5160
5161 if(!hbm || !bitmap)
5162 return InvalidParameter;
5163
5164 if (GetObjectA(hbm, sizeof(bm), &bm) != sizeof(bm))
5165 return InvalidParameter;
5166
5167 /* TODO: Figure out the correct format for 16, 32, 64 bpp */
5168 switch(bm.bmBitsPixel) {
5169 case 1:
5171 break;
5172 case 4:
5174 break;
5175 case 8:
5177 break;
5178 case 16:
5181 return InvalidParameter;
5182 break;
5183 case 24:
5185 break;
5186 case 32:
5188 break;
5189 case 48:
5191 break;
5192 default:
5193 FIXME("don't know how to handle %d bpp\n", bm.bmBitsPixel);
5194 return InvalidParameter;
5195 }
5196
5197 retval = GdipCreateBitmapFromScan0(bm.bmWidth, bm.bmHeight, 0,
5198 format, NULL, bitmap);
5199
5200 if (retval == Ok)
5201 {
5203 format, &lockeddata);
5204 if (retval == Ok)
5205 {
5206 HDC hdc;
5207 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)];
5208 BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf;
5209 INT src_height;
5210
5212
5215
5217
5218 src_height = abs(pbmi->bmiHeader.biHeight);
5219 pbmi->bmiHeader.biHeight = -src_height;
5220
5221 GetDIBits(hdc, hbm, 0, src_height, lockeddata.Scan0, pbmi, DIB_RGB_COLORS);
5222
5223 DeleteDC(hdc);
5224
5225 GdipBitmapUnlockBits(*bitmap, &lockeddata);
5226 }
5227
5228 if (retval == Ok && hpal)
5229 {
5230 PALETTEENTRY entry[256];
5232 int i, num_palette_entries;
5233
5234 num_palette_entries = GetPaletteEntries(hpal, 0, 256, entry);
5235 if (!num_palette_entries)
5236 retval = GenericError;
5237
5238 palette = heap_alloc_zero(sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries-1));
5239 if (!palette)
5240 retval = OutOfMemory;
5241
5242 if (retval == Ok)
5243 {
5244 palette->Flags = 0;
5245 palette->Count = num_palette_entries;
5246
5247 for (i=0; i<num_palette_entries; i++)
5248 {
5249 palette->Entries[i] = 0xff000000 | entry[i].peRed << 16 |
5250 entry[i].peGreen << 8 | entry[i].peBlue;
5251 }
5252
5253 retval = GdipSetImagePalette(&(*bitmap)->image, palette);
5254 }
5255
5257 }
5258
5259 if (retval != Ok)
5260 {
5261 GdipDisposeImage(&(*bitmap)->image);
5262 *bitmap = NULL;
5263 }
5264 }
5265
5266 return retval;
5267}
GpStatus WINGDIPAPI GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette)
Definition: image.c:4744
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockeddata)
Definition: image.c:1030
static PixelFormat get_16bpp_format(HBITMAP hbm)
Definition: image.c:5108
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap *bitmap, BitmapData *lockeddata)
Definition: image.c:1176
ULONG RGBQUAD
Definition: precomp.h:59
#define PixelFormatUndefined
uint32_t entry
Definition: isohybrid.c:63
HDC hdc
Definition: main.c:9
static HPALETTE palette
Definition: clipboard.c:1345
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
Definition: bl.h:1331
USHORT biBitCount
Definition: precomp.h:46
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
#define DIB_RGB_COLORS
Definition: wingdi.h:367
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 GdipCreateBitmapFromResource(), GdipCreateBitmapFromStream(), and test_GdipCreateBitmapFromHBITMAP().

◆ GdipCreateBitmapFromHICON()

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

Definition at line 1564 of file image.c.

1565{
1566 GpStatus stat;
1567 ICONINFO iinfo;
1568 BITMAP bm;
1569 int ret;
1571 GpRect rect;
1572 BitmapData lockeddata;
1573 HDC screendc;
1574 BOOL has_alpha;
1575 int x, y;
1576 BITMAPINFOHEADER bih;
1577 DWORD *src;
1578 BYTE *dst_row;
1579 DWORD *dst;
1580
1581 TRACE("%p, %p\n", hicon, bitmap);
1582
1583 if(!bitmap || !GetIconInfo(hicon, &iinfo))
1584 return InvalidParameter;
1585
1586 /* get the size of the icon */
1587 ret = GetObjectA(iinfo.hbmColor ? iinfo.hbmColor : iinfo.hbmMask, sizeof(bm), &bm);
1588 if (ret == 0) {
1589 DeleteObject(iinfo.hbmColor);
1590 DeleteObject(iinfo.hbmMask);
1591 return GenericError;
1592 }
1593
1594 width = bm.bmWidth;
1595 height = iinfo.hbmColor ? abs(bm.bmHeight) : abs(bm.bmHeight) / 2;
1596 stride = width * 4;
1597
1599 if (stat != Ok) {
1600 DeleteObject(iinfo.hbmColor);
1601 DeleteObject(iinfo.hbmMask);
1602 return stat;
1603 }
1604
1605 rect.X = 0;
1606 rect.Y = 0;
1607 rect.Width = width;
1608 rect.Height = height;
1609
1611 if (stat != Ok) {
1612 DeleteObject(iinfo.hbmColor);
1613 DeleteObject(iinfo.hbmMask);
1614 GdipDisposeImage(&(*bitmap)->image);
1615 return stat;
1616 }
1617
1618 bih.biSize = sizeof(bih);
1619 bih.biWidth = width;
1620 bih.biHeight = iinfo.hbmColor ? -height: -height * 2;
1621 bih.biPlanes = 1;
1622 bih.biBitCount = 32;
1623 bih.biCompression = BI_RGB;
1624 bih.biSizeImage = 0;
1625 bih.biXPelsPerMeter = 0;
1626 bih.biYPelsPerMeter = 0;
1627 bih.biClrUsed = 0;
1628 bih.biClrImportant = 0;
1629
1630 screendc = CreateCompatibleDC(0);
1631 if (iinfo.hbmColor)
1632 {
1633 GetDIBits(screendc, iinfo.hbmColor, 0, height, lockeddata.Scan0, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1634
1635 if (bm.bmBitsPixel == 32)
1636 {
1637 has_alpha = FALSE;
1638
1639 /* If any pixel has a non-zero alpha, ignore hbmMask */
1640 src = (DWORD*)lockeddata.Scan0;
1641 for (x=0; x<width && !has_alpha; x++)
1642 for (y=0; y<height && !has_alpha; y++)
1643 if ((*src++ & 0xff000000) != 0)
1644 has_alpha = TRUE;
1645 }
1646 else has_alpha = FALSE;
1647 }
1648 else
1649 {
1650 GetDIBits(screendc, iinfo.hbmMask, 0, height, lockeddata.Scan0, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1651 has_alpha = FALSE;
1652 }
1653
1654 if (!has_alpha)
1655 {
1656 if (iinfo.hbmMask)
1657 {
1659
1660 /* read alpha data from the mask */
1661 if (iinfo.hbmColor)
1662 GetDIBits(screendc, iinfo.hbmMask, 0, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1663 else
1664 GetDIBits(screendc, iinfo.hbmMask, height, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
1665
1666 src = (DWORD*)bits;
1667 dst_row = lockeddata.Scan0;
1668 for (y=0; y<height; y++)
1669 {
1670 dst = (DWORD*)dst_row;
1671 for (x=0; x<height; x++)
1672 {
1673 DWORD src_value = *src++;
1674 if (src_value)
1675 *dst++ = 0;
1676 else
1677 *dst++ |= 0xff000000;
1678 }
1679 dst_row += lockeddata.Stride;
1680 }
1681
1682 heap_free(bits);
1683 }
1684 else
1685 {
1686 /* set constant alpha of 255 */
1687 dst_row = lockeddata.Scan0;
1688 for (y=0; y<height; y++)
1689 {
1690 dst = (DWORD*)dst_row;
1691 for (x=0; x<height; x++)
1692 *dst++ |= 0xff000000;
1693 dst_row += lockeddata.Stride;
1694 }
1695 }
1696 }
1697
1698 DeleteDC(screendc);
1699
1700 DeleteObject(iinfo.hbmColor);
1701 DeleteObject(iinfo.hbmMask);
1702
1703 GdipBitmapUnlockBits(*bitmap, &lockeddata);
1704
1705 return Ok;
1706}
#define BI_RGB
Definition: precomp.h:56
GLenum GLenum dst
Definition: glext.h:6340
#define for
Definition: utility.h:88
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
HBITMAP hbmColor
Definition: winuser.h:3127
HBITMAP hbmMask
Definition: winuser.h:3126
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2045

Referenced by test_fromhicon().

◆ GdipCreateBitmapFromResource()

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

Definition at line 1444 of file image.c.

1446{
1447 HBITMAP hbm;
1449
1450 TRACE("%p (%s) %p\n", hInstance, debugstr_w(lpBitmapName), bitmap);
1451
1452 if(!lpBitmapName || !bitmap)
1453 return InvalidParameter;
1454
1455 /* load DIB */
1456 hbm = LoadImageW(hInstance, lpBitmapName, IMAGE_BITMAP, 0, 0,
1458
1459 if(hbm){
1462 }
1463
1464 return stat;
1465}
HINSTANCE hInstance
Definition: charmap.c:19
GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBitmap **bitmap)
Definition: image.c:5152
static HBITMAP
Definition: button.c:44
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1098
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:2203

◆ GdipCreateBitmapFromScan0()

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

Definition at line 1760 of file image.c.

1762{
1764 INT row_size, dib_stride;
1765 BYTE *bits=NULL, *own_bits=NULL;
1766 REAL xres, yres;
1767 GpStatus stat;
1768
1769 TRACE("%d %d %d 0x%x %p %p\n", width, height, stride, format, scan0, bitmap);
1770
1771 if (!bitmap) return InvalidParameter;
1772
1773 if(width <= 0 || height <= 0 || (scan0 && (stride % 4))){
1774 *bitmap = NULL;
1775 return InvalidParameter;
1776 }
1777
1778 if(scan0 && !stride)
1779 return InvalidParameter;
1780
1781 stat = get_screen_resolution(&xres, &yres);
1782 if (stat != Ok) return stat;
1783
1784 row_size = (width * PIXELFORMATBPP(format)+7) / 8;
1785 dib_stride = (row_size + 3) & ~3;
1786
1787 if(stride == 0)
1788 stride = dib_stride;
1789
1791 {
1792 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)];
1793 BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf;
1794
1798 pbmi->bmiHeader.biPlanes = 1;
1799 /* FIXME: use the rest of the data from format */
1807
1808 hbitmap = CreateDIBSection(0, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
1809
1810 if (!hbitmap) return GenericError;
1811
1812 stride = dib_stride;
1813 }
1814 else
1815 {
1816 /* Not a GDI format; don't try to make an HBITMAP. */
1817 if (scan0)
1818 bits = scan0;
1819 else
1820 {
1821 INT size = abs(stride) * height;
1822
1823 own_bits = bits = heap_alloc_zero(size);
1824 if (!own_bits) return OutOfMemory;
1825
1826 if (stride < 0)
1827 bits += stride * (1 - height);
1828 }
1829 }
1830
1831 *bitmap = heap_alloc_zero(sizeof(GpBitmap));
1832 if(!*bitmap)
1833 {
1835 heap_free(own_bits);
1836 return OutOfMemory;
1837 }
1838
1839 (*bitmap)->image.type = ImageTypeBitmap;
1840 memcpy(&(*bitmap)->image.format, &ImageFormatMemoryBMP, sizeof(GUID));
1841 (*bitmap)->image.flags = ImageFlagsNone;
1842 (*bitmap)->image.frame_count = 1;
1843 (*bitmap)->image.current_frame = 0;
1844 (*bitmap)->image.palette = NULL;
1845 (*bitmap)->image.xres = xres;
1846 (*bitmap)->image.yres = yres;
1847 (*bitmap)->width = width;
1848 (*bitmap)->height = height;
1849 (*bitmap)->format = format;
1850 (*bitmap)->image.decoder = NULL;
1851 (*bitmap)->hbitmap = hbitmap;
1852 (*bitmap)->hdc = NULL;
1853 (*bitmap)->bits = bits;
1854 (*bitmap)->stride = stride;
1855 (*bitmap)->own_bits = own_bits;
1856 (*bitmap)->metadata_reader = NULL;
1857 (*bitmap)->prop_count = 0;
1858 (*bitmap)->prop_item = NULL;
1859
1860 /* set format-related flags */
1862 (*bitmap)->image.flags |= ImageFlagsHasAlpha;
1863
1867 {
1868 (*bitmap)->image.palette = heap_alloc_zero(sizeof(UINT) * 2 + sizeof(ARGB) * (1 << PIXELFORMATBPP(format)));
1869
1870 if (!(*bitmap)->image.palette)
1871 {
1872 GdipDisposeImage(&(*bitmap)->image);
1873 *bitmap = NULL;
1874 return OutOfMemory;
1875 }
1876
1877 (*bitmap)->image.palette->Count = 1 << PIXELFORMATBPP(format);
1878
1880 {
1881 (*bitmap)->image.palette->Flags = PaletteFlagsGrayScale;
1882 (*bitmap)->image.palette->Entries[0] = 0xff000000;
1883 (*bitmap)->image.palette->Entries[1] = 0xffffffff;
1884 }
1885 else
1886 {
1888 (*bitmap)->image.palette->Flags = PaletteFlagsHalftone;
1889
1890 generate_halftone_palette((*bitmap)->image.palette->Entries,
1891 (*bitmap)->image.palette->Count);
1892 }
1893 }
1894
1895 TRACE("<-- %p\n", *bitmap);
1896
1897 return Ok;
1898}
static HBITMAP hbitmap
static void generate_halftone_palette(ARGB *entries, UINT count)
Definition: image.c:1708
static GpStatus get_screen_resolution(REAL *xres, REAL *yres)
Definition: image.c:1746
@ ImageFlagsNone
Definition: gdiplusenums.h:333
@ ImageFlagsHasAlpha
Definition: gdiplusenums.h:335
@ PaletteFlagsGrayScale
@ PaletteFlagsHalftone
#define PixelFormatPAlpha
#define PixelFormatGDI
#define PixelFormatAlpha
GLsizeiptr size
Definition: glext.h:5919
#define bits
Definition: infblock.c:15
ULONG biClrImportant
Definition: precomp.h:52
LONG biYPelsPerMeter
Definition: precomp.h:50
ULONG biCompression
Definition: precomp.h:47
LONG biXPelsPerMeter
Definition: precomp.h:49
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245

Referenced by create_graphics(), decode_frame_wic(), GdipCloneBitmapArea(), GdipCreateBitmapFromGdiDib(), GdipCreateBitmapFromGraphics(), GdipCreateBitmapFromHBITMAP(), GdipCreateBitmapFromHICON(), GdipGetImageThumbnail(), GdipImageRotateFlip(), metafile_deserialize_image(), METAFILE_DrawImagePointsRect(), test_ARGB_conversion(), test_bitmapbits(), test_clear(), test_clipping(), test_CloneBitmapArea(), test_colorkey(), test_colormatrix(), test_containers(), test_createhbitmap(), test_dispose(), test_DrawImage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_emfonly(), test_fillrect(), test_fromMemoryBitmap(), test_gamma(), test_GdipCloneImage(), 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_histogram(), test_image_format(), test_imageabort(), test_LockBits(), test_LockBits_UserBuf(), test_pagetransform(), test_palette(), test_pen_thickness(), test_remaptable(), test_resolution(), test_rotateflip(), test_SavingImages(), test_Scan0(), test_supported_encoders(), and test_worldtransform().

◆ GdipCreateBitmapFromStream()

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

Definition at line 1935 of file image.c.

1937{
1938 GpStatus stat;
1939
1940 TRACE("%p %p\n", stream, bitmap);
1941
1943
1944 if(stat != Ok)
1945 return stat;
1946
1947#ifdef __REACTOS__
1948 if ((*bitmap)->image.type == ImageTypeMetafile)
1949 {
1950 HBITMAP hbm = hbitmap_from_emf(((GpMetafile*)*bitmap)->hemf);
1951 GdipDisposeImage(&(*bitmap)->image);
1952 if (!hbm)
1953 return GenericError; /* FIXME: what error to return? */
1954
1957 }
1958 else
1959#endif
1960 if((*bitmap)->image.type != ImageTypeBitmap){
1961 GdipDisposeImage(&(*bitmap)->image);
1962 *bitmap = NULL;
1963 return GenericError; /* FIXME: what error to return? */
1964 }
1965
1966 return Ok;
1967}
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
Definition: image.c:4405

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

◆ GdipCreateBitmapFromStreamICM()

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

Definition at line 1970 of file image.c.

1972{
1973 TRACE("%p %p\n", stream, bitmap);
1974
1976}

◆ GdipCreateCachedBitmap()

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

Definition at line 1978 of file image.c.

1980{
1981 GpStatus stat;
1982
1983 TRACE("%p %p %p\n", bitmap, graphics, cachedbmp);
1984
1985 if(!bitmap || !graphics || !cachedbmp)
1986 return InvalidParameter;
1987
1988 *cachedbmp = heap_alloc_zero(sizeof(GpCachedBitmap));
1989 if(!*cachedbmp)
1990 return OutOfMemory;
1991
1992 stat = GdipCloneImage(&(bitmap->image), &(*cachedbmp)->image);
1993 if(stat != Ok){
1994 heap_free(*cachedbmp);
1995 return stat;
1996 }
1997
1998 return Ok;
1999}
GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
Definition: image.c:1308

◆ GdipCreateCustomLineCap()

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

Definition at line 108 of file customlinecap.c.

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

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

◆ GdipCreateFont()

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

Definition at line 144 of file font.c.

146{
147 HFONT hfont;
149 LOGFONTW lfw;
150 HDC hdc;
152 int ret;
153
154 if (!fontFamily || !font || emSize < 0.0)
155 return InvalidParameter;
156
157 TRACE("%p (%s), %f, %d, %d, %p\n", fontFamily,
158 debugstr_w(fontFamily->FamilyName), emSize, style, unit, font);
159
160 memset(&lfw, 0, sizeof(lfw));
161
162 stat = GdipGetFamilyName(fontFamily, lfw.lfFaceName, LANG_NEUTRAL);
163 if (stat != Ok) return stat;
164
165 lfw.lfHeight = -units_to_pixels(emSize, unit, fontFamily->dpi);
170
174 otm.otmSize = sizeof(otm);
176 DeleteDC(hdc);
178
179 if (!ret) return NotTrueTypeFont;
180
181 *font = heap_alloc_zero(sizeof(GpFont));
182 if (!*font) return OutOfMemory;
183
184 (*font)->unit = unit;
185 (*font)->emSize = emSize;
186 (*font)->otm = otm;
187
188 stat = clone_font_family(fontFamily, &(*font)->family);
189 if (stat != Ok)
190 {
191 heap_free(*font);
192 return stat;
193 }
194
195 TRACE("<-- %p\n", *font);
196
197 return Ok;
198}
GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language)
Definition: font.c:837
@ FontStyleUnderline
Definition: gdiplusenums.h:307
@ FontStyleBold
Definition: gdiplusenums.h:304
@ FontStyleStrikeout
Definition: gdiplusenums.h:308
@ FontStyleItalic
Definition: gdiplusenums.h:305
@ NotTrueTypeFont
Definition: gdiplustypes.h:42
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#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
#define FW_REGULAR
Definition: wingdi.h:374
#define FW_BOLD
Definition: wingdi.h:378
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)

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

◆ GdipCreateFontFamilyFromName()

GpStatus WINGDIPAPI GdipCreateFontFamilyFromName ( GDIPCONST WCHAR name,
GpFontCollection fontCollection,
GpFontFamily **  FontFamily 
)

Definition at line 746 of file font.c.

749{
751 GpFontFamily* ffamily;
752 struct font_metrics fm;
753
754 TRACE("%s, %p %p\n", debugstr_w(name), fontCollection, FontFamily);
755
756 if (!(name && FontFamily))
757 return InvalidParameter;
758 if (fontCollection)
759 FIXME("No support for FontCollections yet!\n");
760
762 if (stat != Ok) return stat;
763
764 ffamily = heap_alloc_zero(sizeof (GpFontFamily));
765 if (!ffamily) return OutOfMemory;
766
767 lstrcpyW(ffamily->FamilyName, fm.facename);
768 ffamily->em_height = fm.em_height;
769 ffamily->ascent = fm.ascent;
770 ffamily->descent = fm.descent;
771 ffamily->line_spacing = fm.line_spacing;
772 ffamily->dpi = fm.dpi;
773
774 *FontFamily = ffamily;
775
776 TRACE("<-- %p\n", ffamily);
777
778 return Ok;
779}
#define lstrcpyW
Definition: compat.h:749
static GpStatus find_installed_font(const WCHAR *name, struct font_metrics *fm)
Definition: font.c:703
WCHAR FamilyName[LF_FACESIZE]
Definition: name.c:39

Referenced by add_font_proc(), GdipCreateFontFromLogfontW(), GdipGetGenericFontFamilyMonospace(), GdipGetGenericFontFamilySansSerif(), GdipGetGenericFontFamilySerif(), METAFILE_PlaybackObject(), test_createfont(), 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 286 of file font.c.

287{
288 HFONT hfont;
289 LOGFONTW lfw;
290
291 TRACE("(%p, %p)\n", hdc, font);
292
293 if(!font)
294 return InvalidParameter;
295
297 if(!hfont)
298 return GenericError;
299
300 if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
301 return GenericError;
302
303 return GdipCreateFontFromLogfontW(hdc, &lfw, font);
304}
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, GDIPCONST LOGFONTW *logfont, GpFont **font)
Definition: font.c:203
#define OBJ_FONT
Definition: objidl.idl:1414
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

◆ GdipCreateFontFromLogfontA()

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

Definition at line 249 of file font.c.

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

Referenced by 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 203 of file font.c.

205{
206 HFONT hfont, oldfont;
208 WCHAR facename[LF_FACESIZE];
210 int ret;
211
212 TRACE("(%p, %p, %p)\n", hdc, logfont, font);
213
214 if (!hdc || !logfont || !font)
215 return InvalidParameter;
216
217 hfont = CreateFontIndirectW(logfont);
218 oldfont = SelectObject(hdc, hfont);
219 otm.otmSize = sizeof(otm);
221 GetTextFaceW(hdc, LF_FACESIZE, facename);
222 SelectObject(hdc, oldfont);
224
225 if (!ret) return NotTrueTypeFont;
226
227 *font = heap_alloc_zero(sizeof(GpFont));
228 if (!*font) return OutOfMemory;
229
230 (*font)->unit = UnitWorld;
231 (*font)->emSize = otm.otmTextMetrics.tmAscent;
232 (*font)->otm = otm;
233
234 stat = GdipCreateFontFamilyFromName(facename, NULL, &(*font)->family);
235 if (stat != Ok)
236 {
237 heap_free(*font);
238 return NotTrueTypeFont;
239 }
240
241 TRACE("<-- %p\n", *font);
242
243 return Ok;
244}
GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCollection *fontCollection, GpFontFamily **FontFamily)
Definition: font.c:746
@ UnitWorld
Definition: gdiplusenums.h:27
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2514
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)
__wchar_t WCHAR
Definition: xmlstorage.h:180

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

◆ GdipCreateFromHDC()

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

Definition at line 2395 of file graphics.c.

2396{
2397 TRACE("(%p, %p)\n", hdc, graphics);
2398
2399 return GdipCreateFromHDC2(hdc, NULL, graphics);
2400}
GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **graphics)
Definition: graphics.c:2416

Referenced by check_metafile(), GdipAddPathString(), GdipCreateFromHWND(), GdipGetImageGraphicsContext(), 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_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_font_transform(), test_fromhrgn(), test_GdipCreateRegionRgnData(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), 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_hdc_caching(), test_isempty(), test_isequal(), test_isinfinite(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_logfont(), test_measure_string(), test_measured_extra_space(), test_save_restore(), 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 2416 of file graphics.c.

2417{
2418 GpStatus retval;
2421
2422 TRACE("(%p, %p, %p)\n", hdc, hDevice, graphics);
2423
2424 if(hDevice != NULL)
2425 FIXME("Don't know how to handle parameter hDevice\n");
2426
2427 if(hdc == NULL)
2428 return OutOfMemory;
2429
2430 if(graphics == NULL)
2431 return InvalidParameter;
2432
2433 *graphics = heap_alloc_zero(sizeof(GpGraphics));
2434 if(!*graphics) return OutOfMemory;
2435
2436 GdipSetMatrixElements(&(*graphics)->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
2437
2438 if((retval = GdipCreateRegion(&(*graphics)->clip)) != Ok){
2439 heap_free(*graphics);
2440 return retval;
2441 }
2442
2444 if (hbitmap && GetObjectW(hbitmap, sizeof(dib), &dib) == sizeof(dib) &&
2445 dib.dsBmih.biBitCount == 32 && dib.dsBmih.biCompression == BI_RGB)
2446 {
2447 (*graphics)->alpha_hdc = 1;
2448 }
2449
2450 (*graphics)->hdc = hdc;
2451 (*graphics)->hwnd = WindowFromDC(hdc);
2452 (*graphics)->owndc = FALSE;
2453 (*graphics)->smoothing = SmoothingModeDefault;
2454 (*graphics)->compqual = CompositingQualityDefault;
2455 (*graphics)->interpolation = InterpolationModeBilinear;
2456 (*graphics)->pixeloffset = PixelOffsetModeDefault;
2457 (*graphics)->compmode = CompositingModeSourceOver;
2458 (*graphics)->unit = UnitDisplay;
2459 (*graphics)->scale = 1.0;
2460 (*graphics)->xres = GetDeviceCaps(hdc, LOGPIXELSX);
2461 (*graphics)->yres = GetDeviceCaps(hdc, LOGPIXELSY);
2462 (*graphics)->busy = FALSE;
2463 (*graphics)->textcontrast = 4;
2464 list_init(&(*graphics)->containers);
2465#ifdef __REACTOS__
2466 (*graphics)->contid = GDIP_GET_NEW_CONTID_FOR(*graphics);
2467#else
2468 (*graphics)->contid = 0;
2469#endif
2470 get_gdi_transform(*graphics, &(*graphics)->gdi_transform);
2471
2472 (*graphics)->gdi_clip = CreateRectRgn(0,0,0,0);
2473 if (!GetClipRgn(hdc, (*graphics)->gdi_clip))
2474 {
2475 DeleteObject((*graphics)->gdi_clip);
2476 (*graphics)->gdi_clip = NULL;
2477 }
2478
2479 TRACE("<-- %p\n", *graphics);
2480
2481 return Ok;
2482}
static void get_gdi_transform(GpGraphics *graphics, GpMatrix *matrix)
Definition: graphics.c:2402
#define GDIP_GET_NEW_CONTID_FOR(pGpGraphics)
Definition: graphics.c:59
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
Definition: matrix.c:316
GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
Definition: region.c:390
@ SmoothingModeDefault
Definition: gdiplusenums.h:123
@ CompositingModeSourceOver
Definition: gdiplusenums.h:249
@ PixelOffsetModeDefault
Definition: gdiplusenums.h:162
@ CompositingQualityDefault
Definition: gdiplusenums.h:133
@ UnitDisplay
Definition: gdiplusenums.h:28
@ InterpolationModeBilinear
Definition: gdiplusenums.h:146
static const BYTE dib[]
Definition: ole2.c:201
#define OBJ_BITMAP
Definition: objidl.idl:1415
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
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
HWND WINAPI WindowFromDC(_In_ HDC hDC)

Referenced by GdipCreateFromHDC().

◆ GdipCreateFromHWND()

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

Definition at line 2529 of file graphics.c.

2530{
2531 GpStatus ret;
2532 HDC hdc;
2533
2534 TRACE("(%p, %p)\n", hwnd, graphics);
2535
2536 hdc = GetDC(hwnd);
2537
2538 if((ret = GdipCreateFromHDC(hdc, graphics)) != Ok)
2539 {
2540 ReleaseDC(hwnd, hdc);
2541 return ret;
2542 }
2543
2544 (*graphics)->hwnd = hwnd;
2545 (*graphics)->owndc = TRUE;
2546
2547 return Ok;
2548}
_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 2551 of file graphics.c.

2552{
2553 TRACE("(%p, %p)\n", hwnd, graphics);
2554
2555 return GdipCreateFromHWND(hwnd, graphics);
2556}
GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics)
Definition: graphics.c:2529

Referenced by test_constructor_destructor().

◆ GdipCreateHalftonePalette()

HPALETTE WINGDIPAPI GdipCreateHalftonePalette ( void  )

Definition at line 7011 of file graphics.c.

7012{
7013 static int calls;
7014
7015 TRACE("\n");
7016
7017 if (!calls++)
7018 FIXME("stub\n");
7019
7020 return NULL;
7021}

◆ GdipCreateHatchBrush()

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

Definition at line 276 of file brush.c.

277{
278 TRACE("(%d, %d, %d, %p)\n", hatchstyle, forecol, backcol, brush);
279
280 if(!brush) return InvalidParameter;
281
282 if(hatchstyle < HatchStyleMin || hatchstyle > HatchStyleMax)
283 return InvalidParameter;
284
285 *brush = heap_alloc_zero(sizeof(GpHatch));
286 if (!*brush) return OutOfMemory;
287
288 (*brush)->brush.bt = BrushTypeHatchFill;
289 (*brush)->forecol = forecol;
290 (*brush)->backcol = backcol;
291 (*brush)->hatchstyle = hatchstyle;
292 TRACE("<-- %p\n", *brush);
293
294 return Ok;
295}
@ HatchStyleMax
Definition: gdiplusenums.h:447

Referenced by GdipCloneBrush(), metafile_deserialize_brush(), test_createHatchBrush(), and test_getHatchStyle().

◆ GdipCreateHBITMAPFromBitmap()

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

Definition at line 1479 of file image.c.

1481{
1482 GpStatus stat;
1484 UINT width, height;
1485 BITMAPINFOHEADER bih;
1486 LPBYTE bits;
1487 BOOL unlock;
1488
1489 TRACE("(%p,%p,%x)\n", bitmap, hbmReturn, background);
1490
1491 if (!bitmap || !hbmReturn) return InvalidParameter;
1492 if (!image_lock(&bitmap->image, &unlock)) return ObjectBusy;
1493
1494 GdipGetImageWidth(&bitmap->image, &width);
1495 GdipGetImageHeight(&bitmap->image, &height);
1496
1497 bih.biSize = sizeof(bih);
1498 bih.biWidth = width;
1499 bih.biHeight = height;
1500 bih.biPlanes = 1;
1501 bih.biBitCount = 32;
1502 bih.biCompression = BI_RGB;
1503 bih.biSizeImage = 0;
1504 bih.biXPelsPerMeter = 0;
1505 bih.biYPelsPerMeter = 0;
1506 bih.biClrUsed = 0;
1507 bih.biClrImportant = 0;
1508
1509 result = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
1510 if (!result)
1511 {
1512 image_unlock(&bitmap->image, unlock);
1513 return GenericError;
1514 }
1515
1517 bits + (width * 4 * (height - 1)), PixelFormat32bppPARGB,
1518 bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette);
1519 if (stat != Ok)
1520 {
1522 image_unlock(&bitmap->image, unlock);
1523 return stat;
1524 }
1525
1526 if (background & 0xffffff)
1527 {
1528 DWORD *ptr;
1529 UINT i;
1530 for (ptr = (DWORD*)bits, i = 0; i < width * height; ptr++, i++)
1531 {
1532 if ((*ptr & 0xff000000) == 0xff000000) continue;
1533 *ptr = blend_argb_no_bkgnd_alpha(*ptr, background);
1534 }
1535 }
1536
1537 *hbmReturn = result;
1538 image_unlock(&bitmap->image, unlock);
1539 return Ok;
1540}
static DWORD blend_argb_no_bkgnd_alpha(DWORD src, DWORD bkgnd)
Definition: image.c:1467
static PVOID ptr
Definition: dispmode.c:27
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by GdipDrawImagePointsRect(), test_createhbitmap(), and test_image_format().

◆ GdipCreateHICONFromBitmap()

GpStatus WINGDIPAPI GdipCreateHICONFromBitmap ( GpBitmap bitmap,
HICON hicon 
)

Definition at line 2001 of file image.c.

2002{
2003 GpStatus stat;
2004 BitmapData lockeddata;
2005 ULONG andstride, xorstride, bitssize;
2006 LPBYTE andbits, xorbits, androw, xorrow, srcrow;
2007 UINT x, y;
2008
2009 TRACE("(%p, %p)\n", bitmap, hicon);
2010
2011 if (!bitmap || !hicon)
2012 return InvalidParameter;
2013
2015 PixelFormat32bppPARGB, &lockeddata);
2016 if (stat == Ok)
2017 {
2018 andstride = ((lockeddata.Width+31)/32)*4;
2019 xorstride = lockeddata.Width*4;
2020 bitssize = (andstride + xorstride) * lockeddata.Height;
2021
2022 andbits = heap_alloc_zero(bitssize);
2023
2024 if (andbits)
2025 {
2026 xorbits = andbits + andstride * lockeddata.Height;
2027
2028 for (y=0; y<lockeddata.Height; y++)
2029 {
2030 srcrow = ((LPBYTE)lockeddata.Scan0) + lockeddata.Stride * y;
2031
2032 androw = andbits + andstride * y;
2033 for (x=0; x<lockeddata.Width; x++)
2034 if (srcrow[3+4*x] >= 128)
2035 androw[x/8] |= 1 << (7-x%8);
2036
2037 xorrow = xorbits + xorstride * y;
2038 memcpy(xorrow, srcrow, xorstride);
2039 }
2040
2041 *hicon = CreateIcon(NULL, lockeddata.Width, lockeddata.Height, 1, 32,
2042 andbits, xorbits);
2043
2044 heap_free(andbits);
2045 }
2046 else
2047 stat = OutOfMemory;
2048
2049 GdipBitmapUnlockBits(bitmap, &lockeddata);
2050 }
2051
2052 return stat;
2053}
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:2395

◆ GdipCreateImageAttributes()

GpStatus WINGDIPAPI GdipCreateImageAttributes ( GpImageAttributes **  imageattr)

Definition at line 82 of file imageattributes.c.

83{
84 if(!imageattr)
85 return InvalidParameter;
86
87 *imageattr = heap_alloc_zero(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:211

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 372 of file brush.c.

375{
378
379 TRACE("(%s, %s, %x, %x, %d, %p)\n", debugstr_pointf(startpoint),
380 debugstr_pointf(endpoint), startcolor, endcolor, wrap, line);
381
382 if(!line || !startpoint || !endpoint || wrap == WrapModeClamp)
383 return InvalidParameter;
384
385 if (startpoint->X == endpoint->X && startpoint->Y == endpoint->Y)
386 return OutOfMemory;
387
388 rect.X = startpoint->X < endpoint->X ? startpoint->X : endpoint->X;
389 rect.Y = startpoint->Y < endpoint->Y ? startpoint->Y : endpoint->Y;
390 rect.Width = fabs(startpoint->X - endpoint->X);
391 rect.Height = fabs(startpoint->Y - endpoint->Y);
392
393 if (rect.Width == 0.0f)
394 {
395 rect.X -= rect.Height / 2.0f;
396 rect.Width = rect.Height;
397 }
398 else if (rect.Height == 0.0f)
399 {
400 rect.Y -= rect.Width / 2.0f;
401 rect.Height = rect.Width;
402 }
403
404 stat = create_line_brush(&rect, startcolor, endcolor, wrap, line);
405 if (stat != Ok)
406 return stat;
407
409
410 TRACE("<-- %p\n", *line);
411
412 return Ok;
413}
static void linegradient_init_transform(const GpPointF *startpoint, const GpPointF *endpoint, GpLineGradient *line)
Definition: brush.c:334
static GpStatus create_line_brush(const GpRectF *rect, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:297
#define wrap(journal, var)
Definition: recovery.c:207
const char * debugstr_pointf(const PointF *pt)
Definition: gdiplus.c:482
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
Definition: fabs.c:17
Definition: nis.h:10
Definition: parser.c:49

Referenced by GdipCreateLineBrushI(), metafile_deserialize_brush(), 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 436 of file brush.c.

439{
440 float angle;
441
442 TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
443 wrap, line);
444
445 if(!line || !rect)
446 return InvalidParameter;
447
448 switch (mode)
449 {
451 angle = 0.0f;
452 break;
454 angle = 90.0f;
455 break;
457 angle = 45.0f;
458 break;
460 angle = 135.0f;
461 break;
462 default:
463 return InvalidParameter;
464 }
465
466 return GdipCreateLineBrushFromRectWithAngle(rect, startcolor, endcolor, angle, TRUE, wrap, line);
467}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:489
@ LinearGradientModeForwardDiagonal
Definition: gdiplusenums.h:228
@ LinearGradientModeBackwardDiagonal
Definition: gdiplusenums.h:229
@ LinearGradientModeHorizontal
Definition: gdiplusenums.h:226
@ LinearGradientModeVertical
Definition: gdiplusenums.h:227
GLfloat angle
Definition: glext.h:10853

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

◆ GdipCreateLineBrushFromRectI()

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

Definition at line 469 of file brush.c.

472{
473 GpRectF rectF;
474
475 TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
476 wrap, line);
477
478 rectF.X = (REAL) rect->X;
479 rectF.Y = (REAL) rect->Y;
480 rectF.Width = (REAL) rect->Width;
481 rectF.Height = (REAL) rect->Height;
482
483 return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, wrap, line);
484}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:436

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 489 of file brush.c.

492{
494 REAL exofs, eyofs, far_x, far_y;
495 REAL sin_angle, cos_angle, sin_cos_angle;
497
498 TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
499 wrap, line);
500
501 if (!rect || !line || wrap == WrapModeClamp)
502 return InvalidParameter;
503
504 if (!rect->Width || !rect->Height)
505 return OutOfMemory;
506
507 angle = fmodf(angle, 360);
508 if (angle < 0)
509 angle += 360;
510
511 if (isAngleScalable)
512 {
513 float add_angle = 0;
514
515 while(angle >= 90) {
516 angle -= 180;
517 add_angle += M_PI;
518 }
519
520 if (angle != 90 && angle != -90)
521 angle = atan((rect->Width / rect->Height) * tan(deg2rad(angle)));
522 else
524 angle += add_angle;
525 }
526 else
527 {
529 }
530
531 sin_angle = sinf(angle);
532 cos_angle = cosf(angle);
533 sin_cos_angle = sin_angle * cos_angle;
534
535 far_x = rect->X + rect->Width;
536 far_y = rect->Y + rect->Height;
537
538 if (angle == 0.0f)
539 {
540 start.X = min(rect->X, far_x);
541 start.Y = rect->Y;
542 end.X = max(rect->X, far_x);
543 end.Y = rect->Y;
544 }
545 else if (sin_cos_angle >= 0)
546 {
547 start.X = min(rect->X, far_x);
548 start.Y = min(rect->Y, far_y);
549 end.X = max(rect->X, far_x);
550 end.Y = max(rect->Y, far_y);
551 }
552 else
553 {
554 start.X = max(rect->X, far_x);
555 start.Y = min(rect->Y, far_y);
556 end.X = min(rect->X, far_x);
557 end.Y = max(rect->Y, far_y);
558 }
559
560 stat = create_line_brush(rect, startcolor, endcolor, wrap, line);
561 if (stat != Ok || angle == 0.0f)
562 return stat;
563
564 if (sin_cos_angle >= 0)
565 {
566 exofs = rect->Height * sin_cos_angle + rect->Width * cos_angle * cos_angle;
567 eyofs = rect->Height * sin_angle * sin_angle + rect->Width * sin_cos_angle;
568 }
569 else
570 {
571 exofs = rect->Width * sin_angle * sin_angle + rect->Height * sin_cos_angle;
572 eyofs = -rect->Width * sin_cos_angle + rect->Height * sin_angle * sin_angle;
573 }
574
575 if (sin_angle >= 0)
576 {
577 end.X = rect->X + exofs;
578 end.Y = rect->Y + eyofs;
579 }
580 else
581 {
582 end.X = start.X;
583 end.Y = start.Y;
584 start.X = rect->X + exofs;
585 start.Y = rect->Y + eyofs;
586 }
587
589
590 return stat;
591}
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
valarray< _Tp > atan(const valarray< _Tp > &__x)
Definition: _valarray.h:919
static REAL deg2rad(REAL degrees)
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
_Check_return_ float __cdecl cosf(_In_ float x)
Definition: math.h:224
_Check_return_ float __cdecl fmodf(_In_ float x, _In_ float y)
Definition: math.h:228
_Check_return_ float __cdecl sinf(_In_ float x)
Definition: math.h:233
#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 593 of file brush.c.

596{
597 TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
598 wrap, line);
599
601 wrap, line);
602}
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:469

◆ GdipCreateLineBrushI()

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

Definition at line 415 of file brush.c.

418{
419 GpPointF stF;
420 GpPointF endF;
421
422 TRACE("(%p, %p, %x, %x, %d, %p)\n", startpoint, endpoint,
423 startcolor, endcolor, wrap, line);
424
425 if(!startpoint || !endpoint)
426 return InvalidParameter;
427
428 stF.X = (REAL)startpoint->X;
429 stF.Y = (REAL)startpoint->Y;
430 endF.X = (REAL)endpoint->X;
431 endF.Y = (REAL)endpoint->Y;
432
433 return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line);
434}
GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF *startpoint, GDIPCONST GpPointF *endpoint, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:372

◆ GdipCreateMatrix()

GpStatus WINGDIPAPI GdipCreateMatrix ( GpMatrix **  matrix)

Definition at line 140 of file matrix.c.

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

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), GdipIsOutlineVisiblePathPoint(), get_pen_transform(), SOFTWARE_GdipDrawPath(), SOFTWARE_GdipDrawThinPath(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_excludeinfinite(), test_flatten(), test_font_transform(), 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 61 of file matrix.c.

63{
64 TRACE("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %p)\n", m11, m12, m21, m22, dx, dy, matrix);
65
66 if(!matrix)
67 return InvalidParameter;
68
69 *matrix = heap_alloc_zero(sizeof(GpMatrix));
70 if(!*matrix) return OutOfMemory;
71
72 /* first row */
73 (*matrix)->matrix[0] = m11;
74 (*matrix)->matrix[1] = m12;
75 /* second row */
76 (*matrix)->matrix[2] = m21;
77 (*matrix)->matrix[3] = m22;
78 /* third row */
79 (*matrix)->matrix[4] = dx;
80 (*matrix)->matrix[5] = dy;
81
82 return Ok;
83}
#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_invert(), test_isidentity(), test_isinfinite(), test_isinvertible(), test_shear(), test_transform(), and test_worldbounds().

◆ GdipCreateMatrix3()

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

Definition at line 85 of file matrix.c.

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

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

◆ GdipCreateMatrix3I()

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

Definition at line 104 of file matrix.c.

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

◆ GdipCreateMetafileFromEmf()

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

Definition at line 3804 of file metafile.c.

3806{
3807 GpStatus stat;
3809
3810 TRACE("(%p,%i,%p)\n", hemf, delete, metafile);
3811
3812 if(!hemf || !metafile)
3813 return InvalidParameter;
3814
3816 if (stat != Ok)
3817 return stat;
3818
3819 *metafile = heap_alloc_zero(sizeof(GpMetafile));
3820 if (!*metafile)
3821 return OutOfMemory;
3822
3823 (*metafile)->image.type = ImageTypeMetafile;
3824 (*metafile)->image.format = ImageFormatEMF;
3825 (*metafile)->image.frame_count = 1;
3826 (*metafile)->image.xres = header.DpiX;
3827 (*metafile)->image.yres = header.DpiY;
3828 (*metafile)->bounds.X = (REAL)header.u.EmfHeader.rclFrame.left / 2540.0 * header.DpiX;
3829 (*metafile)->bounds.Y = (REAL)header.u.EmfHeader.rclFrame.top / 2540.0 * header.DpiY;
3830 (*metafile)->bounds.Width = (REAL)(header.u.EmfHeader.rclFrame.right - header.u.EmfHeader.rclFrame.left)
3831 / 2540.0 * header.DpiX;
3832 (*metafile)->bounds.Height = (REAL)(header.u.EmfHeader.rclFrame.bottom - header.u.EmfHeader.rclFrame.top)
3833 / 2540.0 * header.DpiY;
3834 (*metafile)->unit = UnitPixel;
3835 (*metafile)->metafile_type = header.Type;
3836 (*metafile)->hemf = hemf;
3837 (*metafile)->preserve_hemf = !delete;
3838 list_init(&(*metafile)->containers);
3839
3840 TRACE("<-- %p\n", *metafile);
3841
3842 return Ok;
3843}
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hemf, MetafileHeader *header)
Definition: metafile.c:3688

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

◆ GdipCreateMetafileFromFile()

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

Definition at line 3915 of file metafile.c.

3917{
3919 IStream *stream;
3920
3921 TRACE("(%p, %p)\n", file, metafile);
3922
3923 if (!file || !metafile) return InvalidParameter;
3924
3925 *metafile = NULL;
3926
3928 if (status == Ok)
3929 {
3931 IStream_Release(stream);
3932 }
3933 return status;
3934}
GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, GpMetafile **metafile)
Definition: metafile.c:3936
Definition: fci.c:127

Referenced by GdipGetMetafileHeaderFromFile().

◆ GdipCreateMetafileFromStream()

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

Definition at line 3936 of file metafile.c.

3938{
3939 GpStatus stat;
3940
3941 TRACE("%p %p\n", stream, metafile);
3942
3944 if (stat != Ok) return stat;
3945
3946 if ((*metafile)->image.type != ImageTypeMetafile)
3947 {
3948 GdipDisposeImage(&(*metafile)->image);
3949 *metafile = NULL;
3950 return GenericError;
3951 }
3952
3953 return Ok;
3954}

Referenced by GdipCreateMetafileFromFile(), and GdipGetMetafileHeaderFromStream().

◆ GdipCreateMetafileFromWmf()

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

Definition at line 3845 of file metafile.c.

3847{
3848 UINT read;
3849 BYTE *copy;
3850 HENHMETAFILE hemf;
3851 GpStatus retval = Ok;
3852
3853 TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile);
3854
3855 if(!hwmf || !metafile)
3856 return InvalidParameter;
3857
3858 *metafile = NULL;
3859 read = GetMetaFileBitsEx(hwmf, 0, NULL);
3860 if(!read)
3861 return GenericError;
3862 copy = heap_alloc_zero(read);
3863 GetMetaFileBitsEx(hwmf, read, copy);
3864
3866 heap_free(copy);
3867
3868 /* FIXME: We should store and use hwmf instead of converting to hemf */
3869 retval = GdipCreateMetafileFromEmf(hemf, TRUE, metafile);
3870
3871 if (retval == Ok)
3872 {
3873 if (placeable)
3874 {
3875 (*metafile)->image.xres = (REAL)placeable->Inch;
3876 (*metafile)->image.yres = (REAL)placeable->Inch;
3877 (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch);
3878 (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch);
3879 (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right -
3880 placeable->BoundingBox.Left);
3881 (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom -
3882 placeable->BoundingBox.Top);
3883 (*metafile)->metafile_type = MetafileTypeWmfPlaceable;
3884 }
3885 else
3886 (*metafile)->metafile_type = MetafileTypeWmf;
3887 (*metafile)->image.format = ImageFormatWMF;
3888
3889 if (delete) DeleteMetaFile(hwmf);
3890 }
3891 else
3892 DeleteEnhMetaFile(hemf);
3893 return retval;
3894}
#define read
Definition: acwin.h:96
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:3804
@ MetafileTypeWmf
Definition: gdiplusenums.h:217
@ MetafileTypeWmfPlaceable
Definition: gdiplusenums.h:218
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 3896 of file metafile.c.

3898{
3899 HMETAFILE hmf;
3900 HENHMETAFILE emf;
3901
3902 TRACE("(%s, %p, %p)\n", debugstr_w(file), placeable, metafile);
3903
3904 hmf = GetMetaFileW(file);
3905 if(hmf)
3906 return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile);
3907
3909 if(emf)
3911
3912 return GenericError;
3913}
GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, GDIPCONST WmfPlaceableFileHeader *placeable, GpMetafile **metafile)
Definition: metafile.c:3845
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 1197 of file graphicspath.c.

1198{
1199 TRACE("(%d, %p)\n", fill, path);
1200
1201 if(!path)
1202 return InvalidParameter;
1203
1204 *path = heap_alloc_zero(sizeof(GpPath));
1205 if(!*path) return OutOfMemory;
1206
1207 (*path)->fill = fill;
1208 (*path)->newfigure = TRUE;
1209
1210 return Ok;
1211}

Referenced by GdipCreatePathGradient(), GdipCreatePathGradientI(), GdipCreateRegionHrgn(), GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangle(), 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_captype(), test_combinereplace(), test_constructor_destructor(), test_drawpath(), test_ellipse(), test_empty_rect(), test_fillpath(), test_flatten(), test_GdipFillPath(), test_Get_Release_DC(), test_gethrgn(), test_getpathdata(), test_getregiondata(), test_getsubpathcount(), test_hascurve(), test_inset(), 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_pathgradientpath(), test_pathpath(), test_pen_thickness(), test_polygon(), test_rect(), test_reverse(), test_scale(), test_transform(), test_translate(), test_widen(), test_worldbounds(), and transform_region_element().

◆ GdipCreatePath2()

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

Definition at line 1213 of file graphicspath.c.

1215{
1216 TRACE("(%p, %p, %d, %d, %p)\n", points, types, count, fill, path);
1217
1218 if(!path)
1219 return InvalidParameter;
1220
1221 *path = heap_alloc_zero(sizeof(GpPath));
1222 if(!*path) return OutOfMemory;
1223
1224 (*path)->pathdata.Points = heap_alloc_zero(count * sizeof(PointF));
1225 (*path)->pathdata.Types = heap_alloc_zero(count);
1226
1227 if(!(*path)->pathdata.Points || !(*path)->pathdata.Types){
1228 heap_free((*path)->pathdata.Points);
1229 heap_free((*path)->pathdata.Types);
1230 heap_free(*path);
1231 return OutOfMemory;
1232 }
1233
1234 memcpy((*path)->pathdata.Points, points, count * sizeof(PointF));
1235 memcpy((*path)->pathdata.Types, types, count);
1236 (*path)->pathdata.Count = count;
1237 (*path)->datalen = count;
1238
1239 (*path)->fill = fill;
1240 (*path)->newfigure = TRUE;
1241
1242 return Ok;
1243}
Definition: cmds.c:130

Referenced by GdipCreatePath2I().

◆ GdipCreatePath2I()

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

Definition at line 1245 of file graphicspath.c.

1247{
1248 GpPointF *ptF;
1249 GpStatus ret;
1250 INT i;
1251
1252 TRACE("(%p, %p, %d, %d, %p)\n", points, types, count, fill, path);
1253
1254 ptF = heap_alloc_zero(sizeof(GpPointF)*count);
1255
1256 for(i = 0;i < count; i++){
1257 ptF[i].X = (REAL)points[i].X;
1258 ptF[i].Y = (REAL)points[i].Y;
1259 }
1260
1262
1263 heap_free(ptF);
1264
1265 return ret;
1266}
GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF *points, GDIPCONST BYTE *types, INT count, GpFillMode fill, GpPath **path)

◆ GdipCreatePathGradient()

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

Definition at line 658 of file brush.c.

660{
662 GpPath *path;
663
664 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
665
666 if(!grad)
667 return InvalidParameter;
668
669 if(!points || count <= 0)
670 return OutOfMemory;
671
673
674 if (stat == Ok)
675 {
677
678 if (stat == Ok)
679 stat = create_path_gradient(path, 0xff000000, grad);
680
681 if (stat != Ok)
683 }
684
685 if (stat == Ok)
686 (*grad)->wrap = wrap;
687
688 return stat;
689}
static GpStatus create_path_gradient(GpPath *path, ARGB centercolor, GpPathGradient **grad)
Definition: brush.c:604
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 727 of file brush.c.

729{
731 GpPath *new_path;
732
733 TRACE("(%p, %p)\n", path, grad);
734
735 if(!grad)
736 return InvalidParameter;
737
738 if (!path)
739 return OutOfMemory;
740
741 stat = GdipClonePath((GpPath*)path, &new_path);
742
743 if (stat == Ok)
744 {
745 stat = create_path_gradient(new_path, 0xffffffff, grad);
746
747 if (stat != Ok)
748 GdipDeletePath(new_path);
749 }
750
751 return stat;
752}

◆ GdipCreatePathGradientI()

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

Definition at line 691 of file brush.c.

693{
695 GpPath *path;
696
697 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
698
699 if(!grad)
700 return InvalidParameter;
701
702 if(!points || count <= 0)
703 return OutOfMemory;
704
706
707 if (stat == Ok)
708 {
710
711 if (stat == Ok)
712 stat = create_path_gradient(path, 0xff000000, grad);
713
714 if (stat != Ok)
716 }
717
718 if (stat == Ok)
719 (*grad)->wrap = wrap;
720
721 return stat;
722}
GpStatus WINGDIPAPI GdipAddPathLine2I(GpPath *path, GDIPCONST GpPoint *points, INT count)
Definition: graphicspath.c:654

◆ 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 = heap_alloc_zero(sizeof(GpPathIterator));
44 if(!*iterator) return OutOfMemory;
45
46 if(path){
47 size = path->pathdata.Count;
48
49 (*iterator)->pathdata.Types = heap_alloc_zero(size);
50 (*iterator)->pathdata.Points = heap_alloc_zero(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}

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 
)

Definition at line 136 of file pen.c.

138{
139 GpBrush *brush;
141
142 TRACE("(%x, %.2f, %d, %p)\n", color, width, unit, pen);
143
145 status = GdipCreatePen2(brush, width, unit, pen);
146 GdipDeleteBrush(brush);
147 return status;
148}
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
Definition: brush.c:994
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
Definition: brush.c:757
GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, GpPen **pen)
Definition: pen.c:150

Referenced by test_brushfill(), test_compoundarray(), test_constructor_destructor(), test_customcap(), test_dasharray(), test_drawpath(), test_emfonly(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), test_GdipDrawLineI(), test_GdipDrawLinesI(), test_Get_Release_DC(), test_pen_thickness(), test_penfilltype(), test_startup(), test_transform(), test_widen(), and test_worldbounds().

◆ GdipCreatePen2()

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

Definition at line 150 of file pen.c.

152{
153 GpPen *gp_pen;
154 GpBrush *clone_brush;
155
156 TRACE("(%p, %.2f, %d, %p)\n", brush, width, unit, pen);
157
158 if(!pen || !brush)
159 return InvalidParameter;
160
161 gp_pen = heap_alloc_zero(sizeof(GpPen));
162 if(!gp_pen) return OutOfMemory;
163
164 gp_pen->style = GP_DEFAULT_PENSTYLE;
165 gp_pen->width = width;
166 gp_pen->unit = unit;
167 gp_pen->endcap = LineCapFlat;
168 gp_pen->join = LineJoinMiter;
169 gp_pen->miterlimit = 10.0;
170 gp_pen->dash = DashStyleSolid;
171 gp_pen->offset = 0.0;
172 gp_pen->customstart = NULL;
173 gp_pen->customend = NULL;
174 GdipSetMatrixElements(&gp_pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
175
176 if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) {
177 FIXME("UnitWorld, UnitPixel only supported units\n");
178 heap_free(gp_pen);
179 return NotImplemented;
180 }
181
182 GdipCloneBrush(brush, &clone_brush);
183 gp_pen->brush = clone_brush;
184
185 *pen = gp_pen;
186
187 TRACE("<-- %p\n", *pen);
188
189 return Ok;
190}
#define GP_DEFAULT_PENSTYLE
@ LineJoinMiter
Definition: gdiplusenums.h:106
@ LineCapFlat
Definition: gdiplusenums.h:61
@ DashStyleSolid
Definition: gdiplusenums.h:178
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 506 of file region.c.

507{
508 DWORD size;
510 LPRECT rect;
512 GpPath* path;
514 DWORD i;
515
516 TRACE("(%p, %p)\n", hrgn, region);
517
518 if(!region || !(size = GetRegionData(hrgn, 0, NULL)))
519 return InvalidParameter;
520
521 buf = heap_alloc_zero(size);
522 if(!buf)
523 return OutOfMemory;
524
525 if(!GetRegionData(hrgn, size, buf)){
526 heap_free(buf);
527 return GenericError;
528 }
529
530 if(buf->rdh.nCount == 0){
531 if((stat = GdipCreateRegion(&local)) != Ok){
532 heap_free(buf);
533 return stat;
534 }
535 if((stat = GdipSetEmpty(local)) != Ok){
536 heap_free(buf);
538 return stat;
539 }
540 *region = local;
541 heap_free(buf);
542 return Ok;
543 }
544
546 heap_free(buf);
547 return stat;
548 }
549
550 rect = (LPRECT)buf->Buffer;
551 for(i = 0; i < buf->rdh.nCount; i++){
552 if((stat = GdipAddPathRectangle(path, (REAL)rect->left, (REAL)rect->top,
553 (REAL)(rect->right - rect->left), (REAL)(rect->bottom - rect->top))) != Ok){
554 heap_free(buf);
556 return stat;
557 }
558 rect++;
559 }
560
561 stat = GdipCreateRegionPath(path, region);
562
563 heap_free(buf);
565 return stat;
566}
static HRGN hrgn
GpStatus WINGDIPAPI GdipSetEmpty(GpRegion *region)
Definition: region.c:1359
#define local
Definition: zutil.h:30
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#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 = heap_alloc_zero(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_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("%p, %p\n", rect, region);
465
466 if (!(rect && region))
467 return InvalidParameter;
468
469 *region = heap_alloc_zero(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_get_set_clip(), and test_gethrgn().

◆ 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 rectf.X = (REAL)rect->X;
496 rectf.Y = (REAL)rect->Y;
497 rectf.Width = (REAL)rect->Width;
498 rectf.Height = (REAL)rect->Height;
499
500 return GdipCreateRegionRect(&rectf, region);
501}

Referenced by test_getregiondata().

◆ GdipCreateRegionRgnData()

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

Definition at line 946 of file region.c.

947{
949 struct memory_buffer mbuf;
951 INT count;
952
953 TRACE("(%p, %d, %p)\n", data, size, region);
954
955 if (!data || !size)
956 return InvalidParameter;
957
959
962 return InvalidParameter;
963
964 status = GdipCreateRegion(region);
965 if (status != Ok)
966 return status;
967
968 count = 0;
969 status = read_element(&mbuf, *region, &(*region)->node, &count);
970 if (status == Ok && !count)
972
973 if (status != Ok)
974 {
975 GdipDeleteRegion(*region);
976 *region = NULL;
977 }
978
979 return status;
980}
static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, region_element *node, INT *count)
Definition: region.c:775
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:89

Referenced by test_GdipCreateRegionRgnData(), and test_region_data().

◆ GdipCreateSolidFill()

◆ GdipCreateStreamOnFile()

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

Definition at line 2558 of file graphics.c.

2560{
2561 DWORD dwMode;
2562 HRESULT ret;
2563
2564 TRACE("(%s, %u, %p)\n", debugstr_w(filename), access, stream);
2565
2566 if(!stream || !filename)
2567 return InvalidParameter;
2568
2569 if(access & GENERIC_WRITE)
2571 else if(access & GENERIC_READ)
2573 else
2574 return InvalidParameter;
2575
2577
2578 return hresult_to_status(ret);
2579}
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
Definition: istream.c:484
GpStatus hresult_to_status(HRESULT res)
Definition: gdiplus.c:312
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define GENERIC_WRITE
Definition: nt_native.h:90
#define STGM_CREATE
Definition: objbase.h:926
#define STGM_FAILIFTHERE
Definition: objbase.h:928
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define STGM_WRITE
Definition: objbase.h:918
#define STGM_READ
Definition: objbase.h:917

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 = heap_alloc_zero(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:294
@ StringDigitSubstituteUser
Definition: gdiplusenums.h:272
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 786 of file brush.c.

788{
790 GpImageAttributes *attributes;
792
793 TRACE("%p, %d %p\n", image, wrapmode, texture);
794
795 if (!(image && texture))
796 return InvalidParameter;
797
799 if (stat != Ok) return stat;
801 if (stat != Ok) return stat;
802
803 stat = GdipCreateImageAttributes(&attributes);
804
805 if (stat == Ok)
806 {
807 attributes->wrap = wrapmode;
808
809 stat = GdipCreateTextureIA(image, attributes, 0, 0, width, height,
810 texture);
811
812 GdipDisposeImageAttributes(attributes);
813 }
814
815 return stat;
816}
GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)

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 821 of file brush.c.

823{
824 GpImageAttributes *attributes;
826
827 TRACE("%p %d %f %f %f %f %p\n", image, wrapmode,
828 x, y, width, height, texture);
829
830 stat = GdipCreateImageAttributes(&attributes);
831
832 if (stat == Ok)
833 {
834 attributes->wrap = wrapmode;
835
836 stat = GdipCreateTextureIA(image, attributes, x, y, width, height,
837 texture);
838
839 GdipDisposeImageAttributes(attributes);
840 }
841
842 return stat;
843}

◆ GdipCreateTexture2I()

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

Definition at line 928 of file brush.c.

930{
931 GpImageAttributes *imageattr;
933
934 TRACE("%p %d %d %d %d %d %p\n", image, wrapmode, x, y, width, height,
935 texture);
936
937 stat = GdipCreateImageAttributes(&imageattr);
938
939 if (stat == Ok)
940 {
941 imageattr->wrap = wrapmode;
942
943 stat = GdipCreateTextureIA(image, imageattr, x, y, width, height, texture);
945 }
946
947 return stat;
948}

◆ GdipCreateTextureIA()

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

Definition at line 848 of file brush.c.

851{
853 GpImage *new_image=NULL;
854
855 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)\n", image, imageattr, x, y, width, height,
856 texture);
857
858 if(!image || !texture || x < 0.0 || y < 0.0 || width < 0.0 || height < 0.0)
859 return InvalidParameter;
860
861 *texture = NULL;
862
863 if(image->type != ImageTypeBitmap){
864 FIXME("not implemented for image type %d\n", image->type);
865 return NotImplemented;
866 }
867
869 if (status != Ok)
870 return status;
871
872 *texture = heap_alloc_zero(sizeof(GpTexture));
873 if (!*texture){
875 goto exit;
876 }
877
878 GdipSetMatrixElements(&(*texture)->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
879
880 if (imageattr)
881 {
882 status = GdipCloneImageAttributes(imageattr, &(*texture)->imageattributes);
883 }
884 else
885 {
886 status = GdipCreateImageAttributes(&(*texture)->imageattributes);
887 if (status == Ok)
888 (*texture)->imageattributes->wrap = WrapModeTile;
889 }
890 if (status == Ok)
891 {
892 (*texture)->brush.bt = BrushTypeTextureFill;
893 (*texture)->image = new_image;
894 }
895
896exit:
897 if (status == Ok)
898 {
899 TRACE("<-- %p\n", *texture);
900 }
901 else
902 {
903 if (*texture)
904 {
905 GdipDisposeImageAttributes((*texture)->imageattributes);
907 *texture = NULL;
908 }
909 GdipDisposeImage(new_image);
910 TRACE("<-- error %u\n", status);
911 }
912
913 return status;
914}
@ WrapModeTile
Definition: gdiplusenums.h:207
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 919 of file brush.c.

921{
922 TRACE("(%p, %p, %d, %d, %d, %d, %p)\n", image, imageattr, x, y, width, height,
923 texture);
924
926}

◆ GdipDeleteBrush()

GpStatus WINGDIPAPI GdipDeleteBrush ( GpBrush brush)

Definition at line 994 of file brush.c.

995{
996 TRACE("(%p)\n", brush);
997
998 if(!brush) return InvalidParameter;
999
1000 switch(brush->bt)
1001 {
1003 GdipDeletePath(((GpPathGradient*) brush)->path);
1004 heap_free(((GpPathGradient*) brush)->blendfac);
1005 heap_free(((GpPathGradient*) brush)->blendpos);
1006 heap_free(((GpPathGradient*) brush)->surroundcolors);
1007 heap_free(((GpPathGradient*) brush)->pblendcolor);
1008 heap_free(((GpPathGradient*) brush)->pblendpos);
1009 break;
1011 heap_free(((GpLineGradient*)brush)->blendfac);
1012 heap_free(((GpLineGradient*)brush)->blendpos);
1013 heap_free(((GpLineGradient*)brush)->pblendcolor);
1014 heap_free(((GpLineGradient*)brush)->pblendpos);
1015 break;
1017 GdipDisposeImage(((GpTexture*)brush)->image);
1018 GdipDisposeImageAttributes(((GpTexture*)brush)->imageattributes);
1019 heap_free(((GpTexture*)brush)->bitmap_bits);
1020 break;
1021 default:
1022 break;
1023 }
1024
1025 heap_free(brush);
1026
1027 return Ok;
1028}
static const BYTE bitmap_bits[48 *48/8]
Definition: imagelist.c:135

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_fillpath(), test_fillrect(), 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_hdc_caching(), test_lineblend(), test_linelinearblend(), test_nullframerect(), test_pagetransform(), test_pathgradientblend(), test_pathgradientcenterpoint(), test_pathgradientpath(), test_pathgradientpresetblend(), test_penfilltype(), test_string_functions(), test_texturewrap(), test_transform(), test_type(), and test_worldtransform().

◆ GdipDeleteCachedBitmap()

GpStatus WINGDIPAPI GdipDeleteCachedBitmap ( GpCachedBitmap cachedbmp)

Definition at line 2055 of file image.c.

2056{
2057 TRACE("%p\n", cachedbmp);
2058
2059 if(!cachedbmp)
2060 return InvalidParameter;
2061
2062 GdipDisposeImage(cachedbmp->image);
2063 heap_free(cachedbmp);
2064
2065 return Ok;
2066}

◆ GdipDeleteCustomLineCap()

GpStatus WINGDIPAPI GdipDeleteCustomLineCap ( GpCustomLineCap customCap)

Definition at line 139 of file customlinecap.c.

140{
141 TRACE("(%p)\n", customCap);
142
143 if(!customCap)
144 return InvalidParameter;
145
146 heap_free(customCap->pathdata.Points);
147 heap_free(customCap->pathdata.Types);
148 heap_free(customCap);
149
150 return Ok;
151}
GpPathData pathdata

Referenced by GdipDeletePen(), GdipSetPenCustomEndCap(), GdipSetPenCustomStartCap(), GdipSetPenEndCap(), GdipSetPenLineCap197819(), GdipSetPenStartCap(), test_captype(), test_constructor_destructor(), test_create_adjustable_cap(), test_inset(), test_linejoin(), and test_scale().

◆ GdipDeleteEffect()

GpStatus WINGDIPAPI GdipDeleteEffect ( CGpEffect effect)

Definition at line 5287 of file image.c.

5288{
5289 FIXME("(%p): stub\n", effect);
5290 /* note: According to Jose Roca's GDI+ Docs, this is not implemented
5291 * in Windows's gdiplus */
5292 return NotImplemented;
5293}

◆ GdipDeleteFont()

◆ GdipDeleteFontFamily()

◆ GdipDeleteGraphics()

GpStatus WINGDIPAPI GdipDeleteGraphics ( GpGraphics graphics)

Definition at line 2581 of file graphics.c.

2582{
2584 GpStatus stat;
2585 TRACE("(%p)\n", graphics);
2586
2587 if(!graphics) return InvalidParameter;
2588 if(graphics->busy) return ObjectBusy;
2589
2590 if (graphics->image && graphics->image_type == ImageTypeMetafile)
2591 {
2593 if (stat != Ok)
2594 return stat;
2595 }
2596
2597 if(graphics->owndc)
2598 ReleaseDC(graphics->hwnd, graphics->hdc);
2599
2601 list_remove(&cont->entry);
2602 delete_container(cont);
2603 }
2604
2605 GdipDeleteRegion(graphics->clip);
2606
2607 DeleteObject(graphics->gdi_clip);
2608
2609 /* Native returns ObjectBusy on the second free, instead of crashing as we'd
2610 * do otherwise, but we can't have that in the test suite because it means
2611 * accessing freed memory. */
2612 graphics->busy = TRUE;
2613
2614 heap_free(graphics);
2615
2616 return Ok;
2617}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void delete_container(GraphicsContainerItem *container)
Definition: graphics.c:2156
GpStatus METAFILE_GraphicsDeleted(GpMetafile *metafile) DECLSPEC_HIDDEN
Definition: metafile.c:1500
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
ImageType image_type
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_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_font_height_scaling(), test_font_metrics(), test_font_substitution(), test_font_transform(), test_frameunit(), test_fromhrgn(), test_fromMemoryBitmap(), test_gamma(), test_GdipCreateRegionRgnData(), test_GdipDrawArc(), test_GdipDrawArcI(), test_GdipDrawBezierI(), test_GdipDrawCurve(), test_GdipDrawCurve2(), test_GdipDrawCurve2I(), test_GdipDrawCurve3(), test_GdipDrawCurve3I(), test_GdipDrawCurveI(), 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_hdc_caching(), test_isempty(), test_isequal(), test_isinfinite(), test_isvisible(), test_isvisiblepoint(), test_isvisiblerect(), test_logfont(), test_measure_string(), test_measured_extra_space(), test_nullframerect(), test_pagetransform(), test_pen_thickness(), test_properties(), test_remaptable(), test_resolution(), test_save_restore(), test_string_functions(), test_textcontrast(), test_texturewrap(), test_transform(), test_transformpoints(), test_translate(), test_worldtransform(), and ZoomWnd_OnDraw().

◆ GdipDeleteMatrix()

◆ GdipDeletePath()

GpStatus WINGDIPAPI GdipDeletePath ( GpPath path)

Definition at line 1268 of file graphicspath.c.

1269{
1270 TRACE("(%p)\n", path);
1271
1272 if(!path)
1273 return InvalidParameter;
1274
1275 heap_free(path->pathdata.Points);
1276 heap_free(path->pathdata.Types);
1277 heap_free(path);
1278
1279 return Ok;
1280}

Referenced by brush_fill_pixels(), delete_element(), GdipAddPathRectangle(), GdipAddPathRectangles(), GdipAddPathString(), GdipCloneBrush(), GdipCreatePathGradient(), GdipCreatePathGradientFromPath(), GdipCreatePathGradientI(), GdipCreateRegionHrgn(), GdipDeleteBrush(), GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangle(), GdipDrawRectangles(), GdipEnumerateMetafileSrcRectDestPoints(), GdipFillClosedCurve2(), GdipFillEllipse(), GdipFillPie(), GdipFillPolygon(), GdipFillPolygonI(), GdipFillRectangles(), GdipIsOutlineVisiblePathPoint(), GdipSetClipPath(), GdipWidenPath(), get_region_hrgn(), metafile_deserialize_path(), metafile_free_object_table_entry(), SOFTWARE_GdipDrawPath(), SOFTWARE_GdipDrawThinPath(), test_addclosedcurve(), test_addcurve(), test_addpie(), test_arc(), 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_gethrgn(), test_getpathdata(), test_getregiondata(), test_getsubpathcount(), test_hascurve(), test_inset(), 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_pathgradientpath(), test_pathpath(), test_pen_thickness(), test_polygon(), test_rect(), test_reverse(), test_scale(), test_transform(), test_translate(), test_widen(), test_worldbounds(), and transform_region_element().

◆ 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
78 heap_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 1118 of file font.c.

1119{
1120 INT i;
1121
1122 TRACE("%p\n", fontCollection);
1123
1124 if (!fontCollection)
1125 return InvalidParameter;
1126
1127 for (i = 0; i < (*fontCollection)->count; i++) heap_free((*fontCollection)->FontFamilies[i]);
1128 heap_free((*fontCollection)->FontFamilies);
1129 heap_free(*fontCollection);
1130
1131 return Ok;
1132}

Referenced by test_long_name().

◆ GdipDeleteRegion()

◆ GdipDeleteStringFormat()

◆ GdipDisposeImage()

GpStatus WINGDIPAPI GdipDisposeImage ( GpImage image)

Definition at line 2155 of file image.c.

2156{
2158
2159 TRACE("%p\n", image);
2160
2162 if (status != Ok) return status;
2163 image->type = ~0;
2165
2166 return Ok;
2167}
static GpStatus free_image_data(GpImage *image)
Definition: image.c:2126

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(), SetWallpaper(), sync_metafile(), test_ARGB_conversion(), 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_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_frameunit(), test_FromGdiDib(), test_fromhicon(), test_fromMemoryBitmap(), test_gamma(), test_GdipCloneImage(), test_GdipCreateBitmapFromHBITMAP(), 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_histogram(), test_image_format(), test_image_properties(), test_imageabort(), test_loadwmf(), test_LockBits(), test_LockBits_UserBuf(), test_multiframegif(), test_nullframerect(), test_pagetransform(), test_palette(), test_pen_thickness(), test_png_color_formats(), test_properties(), test_remaptable(), test_resolution(), test_rotateflip(), test_SavingImages(), test_Scan0(), test_supported_encoders(), test_texturewrap(), test_tiff_color_formats(), test_tiff_palette(), test_tiff_properties(), test_transform(), 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 heap_free(imageattr->colorremaptables[i].colormap);
108
109 heap_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 2619 of file graphics.c.

2621{
2623 GpPath *path;
2624
2625 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
2626 width, height, startAngle, sweepAngle);
2627
2628 if(!graphics || !pen || width <= 0 || height <= 0)
2629 return InvalidParameter;
2630
2631 if(graphics->busy)
2632 return ObjectBusy;
2633
2635 if (status != Ok) return status;
2636
2637 status = GdipAddPathArc(path, x, y, width, height, startAngle, sweepAngle);
2638 if (status == Ok)
2639 status = GdipDrawPath(graphics, pen, path);
2640
2642 return status;
2643}
GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:4066

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 2645 of file graphics.c.

2647{
2648 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n", graphics, pen, x, y,
2649 width, height, startAngle, sweepAngle);
2650
2651 return GdipDrawArc(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
2652}
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:2619

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 2654 of file graphics.c.

2656{
2657 GpPointF pt[4];
2658
2659 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x1, y1,
2660 x2, y2, x3, y3, x4, y4);
2661
2662 if(!graphics || !pen)
2663 return InvalidParameter;
2664
2665 if(graphics->busy)
2666 return ObjectBusy;
2667
2668 pt[0].X = x1;
2669 pt[0].Y = y1;
2670 pt[1].X = x2;
2671 pt[1].Y = y2;
2672 pt[2].X = x3;
2673 pt[2].Y = y3;
2674 pt[3].X = x4;
2675 pt[3].Y = y4;
2676 return GdipDrawBeziers(graphics, pen, pt, 4);
2677}
GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:2688

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 2679 of file graphics.c.

2681{
2682 TRACE("(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d)\n", graphics, pen, x1, y1,
2683 x2, y2, x3, y3, x4, y4);
2684
2685 return GdipDrawBezier(graphics, pen, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2, (REAL)x3, (REAL)y3, (REAL)x4, (REAL)y4);
2686}
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:2654

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 2688 of file graphics.c.

2690{
2692 GpPath *path;
2693
2694 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2695
2696 if(!graphics || !pen || !points || (count <= 0))
2697 return InvalidParameter;
2698
2699 if(graphics->busy)
2700 return ObjectBusy;
2701
2703 if (status != Ok) return status;
2704
2706 if (status == Ok)
2707 status = GdipDrawPath(graphics, pen, path);
2708
2710 return status;
2711}

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 2713 of file graphics.c.

2715{
2716 GpPointF *pts;
2717 GpStatus ret;
2718 INT i;
2719
2720 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2721
2722 if(!graphics || !pen || !points || (count <= 0))
2723 return InvalidParameter;
2724
2725 if(graphics->busy)
2726 return ObjectBusy;
2727
2728 pts = heap_alloc_zero(sizeof(GpPointF) * count);
2729 if(!pts)
2730 return OutOfMemory;
2731
2732 for(i = 0; i < count; i++){
2733 pts[i].X = (REAL)points[i].X;
2734 pts[i].Y = (REAL)points[i].Y;
2735 }
2736
2737 ret = GdipDrawBeziers(graphics,pen,pts,count);
2738
2739 heap_free(pts);
2740
2741 return ret;
2742}

Referenced by test_Get_Release_DC().

◆ GdipDrawCachedBitmap()

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

Definition at line 2068 of file image.c.

2070{
2071 TRACE("%p %p %d %d\n", graphics, cachedbmp, x, y);
2072
2073 if(!graphics || !cachedbmp)
2074 return InvalidParameter;
2075
2076 return GdipDrawImage(graphics, cachedbmp->image, (REAL)x, (REAL)y);
2077}
GpStatus WINGDIPAPI GdipDrawImage(GpGraphics *graphics, GpImage *image, REAL x, REAL y)
Definition: graphics.c:2969

◆ GdipDrawClosedCurve()

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

Definition at line 2744 of file graphics.c.

2746{
2747 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2748
2749 return GdipDrawClosedCurve2(graphics, pen, points, count, 1.0);
2750}
GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphics.c:2760

Referenced by test_Get_Release_DC().

◆ GdipDrawClosedCurve2()

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

Definition at line 2760 of file graphics.c.

2762{
2763 GpPath *path;
2765
2766 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2767
2768 if(!graphics || !pen || !points || count <= 0)
2769 return InvalidParameter;
2770
2771 if(graphics->busy)
2772 return ObjectBusy;
2773
2775 if (status != Ok) return status;
2776
2778 if (status == Ok)
2779 status = GdipDrawPath(graphics, pen, path);
2780
2782
2783 return status;
2784}

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 2786 of file graphics.c.

2788{
2789 GpPointF *ptf;
2790 GpStatus stat;
2791 INT i;
2792
2793 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2794
2795 if(!points || count <= 0)
2796 return InvalidParameter;
2797
2798 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
2799 if(!ptf)
2800 return OutOfMemory;
2801
2802 for(i = 0; i < count; i++){
2803 ptf[i].X = (REAL)points[i].X;
2804 ptf[i].Y = (REAL)points[i].Y;
2805 }
2806
2807 stat = GdipDrawClosedCurve2(graphics, pen, ptf, count, tension);
2808
2809 heap_free(ptf);
2810
2811 return stat;
2812}

Referenced by GdipDrawClosedCurveI(), and test_Get_Release_DC().

◆ GdipDrawClosedCurveI()

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

Definition at line 2752 of file graphics.c.

2754{
2755 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2756
2757 return GdipDrawClosedCurve2I(graphics, pen, points, count, 1.0);
2758}
GpStatus WINGDIPAPI GdipDrawClosedCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphics.c:2786

Referenced by test_Get_Release_DC().

◆ GdipDrawCurve()

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

Definition at line 2814 of file graphics.c.

2816{
2817 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2818
2819 return GdipDrawCurve2(graphics,pen,points,count,1.0);
2820}
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count, REAL tension)
Definition: graphics.c:2850

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 2850 of file graphics.c.

2852{
2853 GpPath *path;
2855
2856 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2857
2858 if(!graphics || !pen)
2859 return InvalidParameter;
2860
2861 if(graphics->busy)
2862 return ObjectBusy;
2863
2864 if(count < 2)
2865 return InvalidParameter;
2866
2868 if (status != Ok) return status;
2869
2871 if (status == Ok)
2872 status = GdipDrawPath(graphics, pen, path);
2873
2875 return status;
2876}

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 2878 of file graphics.c.

2880{
2881 GpPointF *pointsF;
2882 GpStatus ret;
2883 INT i;
2884
2885 TRACE("(%p, %p, %p, %d, %.2f)\n", graphics, pen, points, count, tension);
2886
2887 if(!points)
2888 return InvalidParameter;
2889
2890 pointsF = heap_alloc_zero(sizeof(GpPointF)*count);
2891 if(!pointsF)
2892 return OutOfMemory;
2893
2894 for(i = 0; i < count; i++){
2895 pointsF[i].X = (REAL)points[i].X;
2896 pointsF[i].Y = (REAL)points[i].Y;
2897 }
2898
2899 ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension);
2900 heap_free(pointsF);
2901
2902 return ret;
2903}

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 2905 of file graphics.c.

2908{
2909 TRACE("(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen, points, count, offset, numberOfSegments, tension);
2910
2911 if(offset >= count || numberOfSegments > count - offset - 1 || numberOfSegments <= 0){
2912 return InvalidParameter;
2913 }
2914
2915 return GdipDrawCurve2(graphics, pen, points + offset, numberOfSegments + 1, tension);
2916}

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 2918 of file graphics.c.

2921{
2922 TRACE("(%p, %p, %p, %d, %d, %d, %.2f)\n", graphics, pen, points, count, offset, numberOfSegments, tension);
2923
2924 if(count < 0){
2925 return OutOfMemory;
2926 }
2927
2928 if(offset >= count || numberOfSegments > count - offset - 1 || numberOfSegments <= 0){
2929 return InvalidParameter;
2930 }
2931
2932 return GdipDrawCurve2I(graphics, pen, points + offset, numberOfSegments + 1, tension);
2933}
GpStatus WINGDIPAPI GdipDrawCurve2I(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPoint *points, INT count, REAL tension)
Definition: graphics.c:2878

Referenced by test_GdipDrawCurve3I().

◆ GdipDrawCurveI()

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

Definition at line 2822 of file graphics.c.

2824{
2825 GpPointF *pointsF;
2826 GpStatus ret;
2827 INT i;
2828
2829 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
2830
2831 if(!points)
2832 return InvalidParameter;
2833
2834 pointsF = heap_alloc_zero(sizeof(GpPointF)*count);
2835 if(!pointsF)
2836 return OutOfMemory;
2837
2838 for(i = 0; i < count; i++){
2839 pointsF[i].X = (REAL)points[i].X;
2840 pointsF[i].Y = (REAL)points[i].Y;
2841 }
2842
2843 ret = GdipDrawCurve(graphics,pen,pointsF,count);
2844 heap_free(pointsF);
2845
2846 return ret;
2847}
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:2814

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 7458 of file graphics.c.

7462{
7463 TRACE("(%p %s %p %p %p %d %p)\n", graphics, debugstr_wn(text, length), font, brush, positions, flags, matrix);
7464
7465 if (!graphics || !text || !font || !brush || !positions)
7466 return InvalidParameter;
7467
7468 return draw_driver_string(graphics, text, length, font, NULL,
7469 brush, positions, flags, matrix);
7470}
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:7433
const WCHAR * text
Definition: package.c:1799
#define debugstr_wn
Definition: kernel32.h:33

Referenced by test_GdipDrawString().

◆ GdipDrawEllipse()

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

Definition at line 2935 of file graphics.c.

2937{
2938 GpPath *path;
2940
2941 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height);
2942
2943 if(!graphics || !pen)
2944 return InvalidParameter;
2945
2946 if(graphics->busy)
2947 return ObjectBusy;
2948
2950 if (status != Ok) return status;
2951
2953 if (status == Ok)
2954 status = GdipDrawPath(graphics, pen, path);
2955
2957 return status;
2958}

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

◆ GdipDrawEllipseI()

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

Definition at line 2960 of file graphics.c.

2962{
2963 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x, y, width, height);
2964
2965 return GdipDrawEllipse(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
2966}
GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:2935

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawImage()

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

Definition at line 2969 of file graphics.c.

2970{
2971 UINT width, height;
2972
2973 TRACE("(%p, %p, %.2f, %.2f)\n", graphics, image, x, y);
2974
2975 if(!graphics || !image)
2976 return InvalidParameter;
2977
2980
2981 return GdipDrawImagePointRect(graphics, image, x, y,
2982 0.0, 0.0, (REAL)width, (REAL)height, UnitPixel);
2983}
GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit)
Definition: graphics.c:2993

Referenced by GdipDrawCachedBitmap(), and GdipDrawImageI().

◆ GdipDrawImageI()

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

Definition at line 2985 of file graphics.c.

2987{
2988 TRACE("(%p, %p, %d, %d)\n", graphics, image, x, y);
2989
2990 return GdipDrawImage(graphics, image, (REAL)x, (REAL)y);
2991}

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 2993 of file graphics.c.

2996{
2997 GpPointF points[3];
2998 REAL scale_x, scale_y, width, height;
2999
3000 TRACE("(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
3001
3002 if (!graphics || !image) return InvalidParameter;
3003
3004 scale_x = units_scale(srcUnit, graphics->unit, graphics->xres);
3005 scale_x *= graphics->xres / image->xres;
3006 scale_y = units_scale(srcUnit, graphics->unit, graphics->yres);
3007 scale_y *= graphics->yres / image->yres;
3008 width = srcwidth * scale_x;
3009 height = srcheight * scale_y;
3010
3011 points[0].X = points[2].X = x;
3012 points[0].Y = points[1].Y = y;
3013 points[1].X = x + width;
3014 points[2].Y = y + height;
3015
3016 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3017 srcwidth, srcheight, srcUnit, NULL, NULL, NULL);
3018}
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:3071
REAL units_scale(GpUnit from, GpUnit to, REAL dpi)
Definition: gdiplus.c:372

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 3020 of file graphics.c.

3023{
3024 return GdipDrawImagePointRect(graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
3025}

Referenced by test_GdipDrawImagePointRect().

◆ GdipDrawImagePoints()

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

Definition at line 3027 of file graphics.c.

3029{
3030 UINT width, height;
3031
3032 TRACE("(%p, %p, %p, %d)\n", graphics, image, dstpoints, count);
3033
3034 if(!image)
3035 return InvalidParameter;
3036
3039
3040 return GdipDrawImagePointsRect(graphics, image, dstpoints, count, 0, 0,
3042}

Referenced by GdipDrawImagePointsI().

◆ GdipDrawImagePointsI()

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

Definition at line 3044 of file graphics.c.

3046{
3047 GpPointF ptf[3];
3048
3049 TRACE("(%p, %p, %p, %d)\n", graphics, image, dstpoints, count);
3050
3051 if (count != 3 || !dstpoints)
3052 return InvalidParameter;
3053
3054 ptf[0].X = (REAL)dstpoints[0].X;
3055 ptf[0].Y = (REAL)dstpoints[0].Y;
3056 ptf[1].X = (REAL)dstpoints[1].X;
3057 ptf[1].Y = (REAL)dstpoints[1].Y;
3058 ptf[2].X = (REAL)dstpoints[2].X;
3059 ptf[2].Y = (REAL)dstpoints[2].Y;
3060
3061 return GdipDrawImagePoints(graphics, image, ptf, count);
3062}
GpStatus WINGDIPAPI GdipDrawImagePoints(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *dstpoints, INT count)
Definition: graphics.c:3027

◆ 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 3071 of file graphics.c.

3075{
3076 GpPointF ptf[4];
3077 POINT pti[4];
3078 GpStatus stat;
3079
3080 TRACE("(%p, %p, %p, %d, %f, %f, %f, %f, %d, %p, %p, %p)\n", graphics, image, points,
3081 count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
3082 callbackData);
3083
3084 if (count > 3)
3085 return NotImplemented;
3086
3087 if(!graphics || !image || !points || count != 3)
3088 return InvalidParameter;
3089
3090 TRACE("%s %s %s\n", debugstr_pointf(&points[0]), debugstr_pointf(&points[1]),
3091 debugstr_pointf(&points[2]));
3092
3093 if (graphics->image && graphics->image->type == ImageTypeMetafile)
3094 {
3096 image, points, count, srcx, srcy, srcwidth, srcheight,
3097 srcUnit, imageAttributes, callback, callbackData);
3098 }
3099
3100 memcpy(ptf, points, 3 * sizeof(GpPointF));
3101
3102 /* Ensure source width/height is positive */
3103 if (srcwidth < 0)
3104 {
3105 GpPointF tmp = ptf[1];
3106 srcx = srcx + srcwidth;
3107 srcwidth = -srcwidth;
3108 ptf[2].X = ptf[2].X + ptf[1].X - ptf[0].X;
3109 ptf[2].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y;
3110 ptf[1] = ptf[0];
3111 ptf[0] = tmp;
3112 }
3113
3114 if (srcheight < 0)
3115 {
3116 GpPointF tmp = ptf[2];
3117 srcy = srcy + srcheight;
3118 srcheight = -srcheight;
3119 ptf[1].X = ptf[1].X + ptf[2].X - ptf[0].X;
3120 ptf[1].Y = ptf[1].Y + ptf[2].Y - ptf[0].Y;
3121 ptf[2] = ptf[0];
3122 ptf[0] = tmp;
3123 }
3124
3125 ptf[3].X = ptf[2].X + ptf[1].X - ptf[0].X;
3126 ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y;
3127 if (!srcwidth || !srcheight || (ptf[3].X == ptf[0].X && ptf[3].Y == ptf[0].Y))
3128 return Ok;
3130 round_points(pti, ptf, 4);
3131
3132 TRACE("%s %s %s %s\n", wine_dbgstr_point(&pti[0]), wine_dbgstr_point(&pti[1]),
3133 wine_dbgstr_point(&pti[2]), wine_dbgstr_point(&pti[3]));
3134
3135 srcx = units_to_pixels(srcx, srcUnit, image->xres);
3136 srcy = units_to_pixels(srcy, srcUnit, image->yres);
3137 srcwidth = units_to_pixels(srcwidth, srcUnit, image->xres);
3138 srcheight = units_to_pixels(srcheight, srcUnit, image->yres);
3139 TRACE("src pixels: %f,%f %fx%f\n", srcx, srcy, srcwidth, srcheight);
3140
3141 if (image->type == ImageTypeBitmap)
3142 {
3144 BOOL do_resampling = FALSE;
3145 BOOL use_software = FALSE;
3146
3147 TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n",
3148 graphics->xres, graphics->yres,
3149 graphics->image && graphics->image->type == ImageTypeBitmap ? ((GpBitmap *)graphics->image)->format : 0,
3150 graphics->scale, image->xres, image->yres, bitmap->format,
3151 imageAttributes ? imageAttributes->outside_color : 0);
3152
3153 if (ptf[1].Y != ptf[0].Y || ptf[2].X != ptf[0].X ||
3154 ptf[1].X - ptf[0].X != srcwidth || ptf[2].Y - ptf[0].Y != srcheight ||
3155 srcx < 0 || srcy < 0 ||
3156 srcx + srcwidth > bitmap->width || srcy + srcheight > bitmap->height)
3157 do_resampling = TRUE;
3158
3159 if (imageAttributes || graphics->alpha_hdc || do_resampling ||
3160 (graphics->image && graphics->image->type == ImageTypeBitmap))
3161 use_software = TRUE;
3162
3163 if (use_software)
3164 {
3165 RECT dst_area;
3167 GpRect src_area;
3168 int i, x, y, src_stride, dst_stride;
3169 GpMatrix dst_to_src;
3170 REAL m11, m12, m21, m22, mdx, mdy;
3171 LPBYTE src_data, dst_data, dst_dyn_data=NULL;
3172 BitmapData lockeddata;
3173 InterpolationMode interpolation = graphics->interpolation;
3174 PixelOffsetMode offset_mode = graphics->pixeloffset;
3175 GpPointF dst_to_src_points[3] = {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}};
3176 REAL x_dx, x_dy, y_dx, y_dy;
3177 static const GpImageAttributes defaultImageAttributes = {WrapModeClamp, 0, FALSE};
3178
3179 if (!imageAttributes)
3180 imageAttributes = &defaultImageAttributes;
3181
3182 dst_area.left = dst_area.right = pti[0].x;
3183 dst_area.top = dst_area.bottom = pti[0].y;
3184 for (i=1; i<4; i++)
3185 {
3186 if (dst_area.left > pti[i].x) dst_area.left = pti[i].x;
3187 if (dst_area.right < pti[i].x) dst_area.right = pti[i].x;
3188 if (dst_area.top > pti[i].y) dst_area.top = pti[i].y;
3189 if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y;
3190 }
3191
3193 if (stat != Ok) return stat;
3194
3195 if (graphics_bounds.X > dst_area.left) dst_area.left = floorf(graphics_bounds.X);
3196 if (graphics_bounds.Y > dst_area.top) dst_area.top = floorf(graphics_bounds.Y);
3197 if (graphics_bounds.X + graphics_bounds.Width < dst_area.right) dst_area.right = ceilf(graphics_bounds.X + graphics_bounds.Width);
3198 if (graphics_bounds.Y + graphics_bounds.Height < dst_area.bottom) dst_area.bottom = ceilf(graphics_bounds.Y + graphics_bounds.Height);
3199
3200 TRACE("dst_area: %s\n", wine_dbgstr_rect(&dst_area));
3201
3202 if (IsRectEmpty(&dst_area)) return Ok;
3203
3204 m11 = (ptf[1].X - ptf[0].X) / srcwidth;
3205 m21 = (ptf[2].X - ptf[0].X) / srcheight;
3206 mdx = ptf[0].X - m11 * srcx - m21 * srcy;
3207 m12 = (ptf[1].Y - ptf[0].Y) / srcwidth;
3208 m22 = (ptf[2].Y - ptf[0].Y) / srcheight;
3209 mdy = ptf[0].Y - m12 * srcx - m22 * srcy;
3210
3211 GdipSetMatrixElements(&dst_to_src, m11, m12, m21, m22, mdx, mdy);
3212
3213 stat = GdipInvertMatrix(&dst_to_src);
3214 if (stat != Ok) return stat;
3215
3216 if (do_resampling)
3217 {
3218 get_bitmap_sample_size(interpolation, imageAttributes->wrap,
3219 bitmap, srcx, srcy, srcwidth, srcheight, &src_area);
3220 }
3221 else
3222 {
3223 /* Make sure src_area is equal in size to dst_area. */
3224 src_area.X = srcx + dst_area.left - pti[0].x;
3225 src_area.Y = srcy + dst_area.top - pti[0].y;
3226 src_area.Width = dst_area.right - dst_area.left;
3227 src_area.Height = dst_area.bottom - dst_area.top;
3228 }
3229
3230 TRACE("src_area: %d x %d\n", src_area.Width, src_area.Height);
3231
3232 src_data = heap_alloc_zero(sizeof(ARGB) * src_area.Width * src_area.Height);
3233 if (!src_data)
3234 return OutOfMemory;
3235 src_stride = sizeof(ARGB) * src_area.Width;
3236
3237 /* Read the bits we need from the source bitmap into a compatible buffer. */
3238 lockeddata.Width = src_area.Width;
3239 lockeddata.Height = src_area.Height;
3240 lockeddata.Stride = src_stride;
3241 lockeddata.Scan0 = src_data;
3242 if (!do_resampling && bitmap->format == PixelFormat32bppPARGB)
3243 lockeddata.PixelFormat = apply_image_attributes(imageAttributes, NULL, 0, 0, 0, ColorAdjustTypeBitmap, bitmap->format);
3244 else if (imageAttributes != &defaultImageAttributes)
3245 lockeddata.PixelFormat = PixelFormat32bppARGB;
3246 else
3248
3250 lockeddata.PixelFormat, &lockeddata);
3251
3252 if (stat == Ok)
3253 stat = GdipBitmapUnlockBits(bitmap, &lockeddata);
3254
3255 if (stat != Ok)
3256 {
3257 heap_free(src_data);
3258 return stat;
3259 }
3260
3261 apply_image_attributes(imageAttributes, src_data,
3262 src_area.Width, src_area.Height,
3263 src_stride, ColorAdjustTypeBitmap, lockeddata.PixelFormat);
3264
3265 if (do_resampling)
3266 {
3267 REAL delta_xx, delta_xy, delta_yx, delta_yy;
3268
3269 /* Transform the bits as needed to the destination. */
3270 dst_data = dst_dyn_data = heap_alloc_zero(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top));
3271 if (!dst_data)
3272 {
3273 heap_free(src_data);
3274 return OutOfMemory;
3275 }
3276
3277 dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left);
3278
3279 GdipTransformMatrixPoints(&dst_to_src, dst_to_src_points, 3);
3280
3281 x_dx = dst_to_src_points[1].X - dst_to_src_points[0].X;
3282 x_dy = dst_to_src_points[1].Y - dst_to_src_points[0].Y;
3283 y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X;
3284 y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y;
3285
3286 delta_yy = dst_area.top * y_dy;
3287 delta_yx = dst_area.top * y_dx;
3288
3289 for (y=dst_area.top; y<dst_area.bottom; y++)
3290 {
3291 delta_xx = dst_area.left * x_dx;
3292 delta_xy = dst_area.left * x_dy;
3293
3294 for (x=dst_area.left; x<dst_area.right; x++)
3295 {
3296 GpPointF src_pointf;
3297 ARGB *dst_color;
3298
3299 src_pointf.X = dst_to_src_points[0].X + delta_xx + delta_yx;
3300 src_pointf.Y = dst_to_src_points[0].Y + delta_xy + delta_yy;
3301
3302 dst_color = (ARGB*)(dst_data + dst_stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left));
3303
3304 if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy+srcheight)
3305 {
3306 if (lockeddata.PixelFormat != PixelFormat32bppPARGB)
3307 *dst_color = resample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
3308 imageAttributes, interpolation, offset_mode);
3309 else
3310 *dst_color = resample_bitmap_pixel_premult(&src_area, src_data, bitmap->width, bitmap->height, &src_pointf,
3311 imageAttributes, interpolation, offset_mode);
3312 }
3313 else
3314 *dst_color = 0;
3315
3316 delta_xx += x_dx;
3317 delta_yx += y_dx;
3318 }
3319
3320 delta_xy += x_dy;
3321 delta_yy += y_dy;
3322 }
3323 }
3324 else
3325 {
3326 dst_data = src_data;
3327 dst_stride = src_stride;
3328 }
3329
3330 gdi_transform_acquire(graphics);
3331
3332 stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top,
3333 dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride,
3334 lockeddata.PixelFormat);
3335
3336 gdi_transform_release(graphics);
3337
3338 heap_free(src_data);
3339
3340 heap_free(dst_dyn_data);
3341
3342 return stat;
3343 }
3344 else
3345 {
3346 HDC hdc;
3347 BOOL temp_hdc = FALSE, temp_bitmap = FALSE;
3348 HBITMAP hbitmap, old_hbm=NULL;
3349 HRGN hrgn;
3350 INT save_state;
3351
3352 if (!(bitmap->format == PixelFormat16bppRGB555 ||
3353 bitmap->format == PixelFormat24bppRGB ||
3354 bitmap->format == PixelFormat32bppRGB ||
3355 bitmap->format == PixelFormat32bppPARGB))
3356 {
3357 BITMAPINFOHEADER bih;
3358 BYTE *temp_bits;
3360
3361 /* we can't draw a bitmap of this format directly */
3363 temp_hdc = TRUE;
3364 temp_bitmap = TRUE;
3365
3366 bih.biSize = sizeof(BITMAPINFOHEADER);
3367 bih.biWidth = bitmap->width;
3368 bih.biHeight = -bitmap->height;
3369 bih.biPlanes = 1;
3370 bih.biBitCount = 32;
3371 bih.biCompression = BI_RGB;
3372 bih.biSizeImage = 0;
3373 bih.biXPelsPerMeter = 0;
3374 bih.biYPelsPerMeter = 0;
3375 bih.biClrUsed = 0;
3376 bih.biClrImportant = 0;
3377
3379 (void**)&temp_bits, NULL, 0);
3380
3383 else
3385
3387 bitmap->width*4, temp_bits, dst_format,
3388 bitmap->stride, bitmap->bits, bitmap->format,
3389 bitmap->image.palette);
3390 }
3391 else
3392 {
3393 if (bitmap->hbitmap)
3394 hbitmap = bitmap->hbitmap;
3395 else
3396 {
3398 temp_bitmap = TRUE;
3399 }
3400
3401 hdc = bitmap->hdc;
3402 temp_hdc = (hdc == 0);
3403 }
3404
3405 if (temp_hdc)
3406 {
3407 if (!hdc) hdc = CreateCompatibleDC(0);
3408 old_hbm = SelectObject(hdc, hbitmap);
3409 }
3410
3411 save_state = SaveDC(graphics->hdc);
3412
3413 stat = get_clip_hrgn(graphics, &hrgn);
3414
3415 if (stat == Ok)
3416 {
3417 ExtSelectClipRgn(graphics->hdc, hrgn, RGN_COPY);
3419 }
3420
3421 gdi_transform_acquire(graphics);
3422
3424 {
3425 gdi_alpha_blend(graphics, pti[0].x, pti[0].y, pti[1].x - pti[0].x, pti[2].y - pti[0].y,
3426 hdc, srcx, srcy, srcwidth, srcheight);
3427 }
3428 else
3429 {
3430 StretchBlt(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y,
3431 hdc, srcx, srcy, srcwidth, srcheight, SRCCOPY);
3432 }
3433
3434 gdi_transform_release(graphics);
3435
3436 RestoreDC(graphics->hdc, save_state);
3437
3438 if (temp_hdc)
3439 {
3440 SelectObject(hdc, old_hbm);
3441 DeleteDC(hdc);
3442 }
3443
3444 if (temp_bitmap)
3446 }
3447 }
3448 else if (image->type == ImageTypeMetafile && ((GpMetafile*)image)->hemf)
3449 {
3450 GpRectF rc;
3451
3452 rc.X = srcx;
3453 rc.Y = srcy;
3454 rc.Width = srcwidth;
3455 rc.Height = srcheight;
3456
3458 points, count, &rc, srcUnit, play_metafile_proc, image, imageAttributes);
3459 }
3460 else
3461 {
3462 WARN("GpImage with nothing we can draw (metafile in wrong state?)\n");
3463 return InvalidParameter;
3464 }
3465
3466 return Ok;
3467}
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:3064
GpStatus gdip_transform_points(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpPointF *points, INT count)
Definition: graphics.c:6948
static ARGB resample_bitmap_pixel_premult(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width, UINT height, GpPointF *point, GDIPCONST GpImageAttributes *attributes, InterpolationMode interpolation, PixelOffsetMode offset_mode)
Definition: graphics.c:1056
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:870
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:987
GpStatus gdi_transform_acquire(GpGraphics *graphics)
Definition: graphics.c:6842
static void round_points(POINT *pti, GpPointF *ptf, INT count)
Definition: graphics.c:316
GpStatus gdi_transform_release(GpGraphics *graphics)
Definition: graphics.c:6856
static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
Definition: graphics.c:351
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:326
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:554
PixelFormat apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data, UINT width, UINT height, INT stride, ColorAdjustType type, PixelFormat fmt)
Definition: graphics.c:710
static GpStatus get_graphics_device_bounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:2192
GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap *bitmap, HBITMAP *hbmReturn, ARGB background)
Definition: image.c:1479
GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
Definition: matrix.c:363
GpStatus WINGDIPAPI GdipInvertMatrix(GpMatrix *matrix)
Definition: matrix.c:185
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:3435
#define WineCoordinateSpaceGdiDevice
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) DECLSPEC_HIDDEN
Definition: metafile.c:4190
GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ColorPalette *palette) DECLSPEC_HIDDEN
Definition: image.c:562
@ ColorAdjustTypeBitmap
PixelOffsetMode
Definition: gdiplusenums.h:160
@ CoordinateSpaceWorld
Definition: gdiplusenums.h:367
InterpolationMode
Definition: gdiplusenums.h:141
static IPrintDialogCallback callback
Definition: printdlg.c:326
static const char * dst_format
Definition: dib.c:1133
static const RECT graphics_bounds[]
Definition: dib.c:1061
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
PixelOffsetMode pixeloffset
InterpolationMode interpolation
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#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 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 3469 of file graphics.c.

3473{
3474 GpPointF pointsF[3];
3475 INT i;
3476
3477 TRACE("(%p, %p, %p, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n", graphics, image, points, count,
3478 srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
3479 callbackData);
3480
3481 if(!points || count!=3)
3482 return InvalidParameter;
3483
3484 for(i = 0; i < count; i++){
3485 pointsF[i].X = (REAL)points[i].X;
3486 pointsF[i].Y = (REAL)points[i].Y;
3487 }
3488
3489 return GdipDrawImagePointsRect(graphics, image, pointsF, count, (REAL)srcx, (REAL)srcy,
3490 (REAL)srcwidth, (REAL)srcheight, srcUnit, imageAttributes,
3491 callback, callbackData);
3492}

◆ GdipDrawImageRect()

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

Definition at line 3540 of file graphics.c.

3542{
3543 RectF bounds;
3544 GpUnit unit;
3545 GpStatus ret;
3546
3547 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, image, x, y, width, height);
3548
3549 if(!graphics || !image)
3550 return InvalidParameter;
3551
3552 ret = GdipGetImageBounds(image, &bounds, &unit);
3553 if(ret != Ok)
3554 return ret;
3555
3556 return GdipDrawImageRectRect(graphics, image, x, y, width, height,
3557 bounds.X, bounds.Y, bounds.Width, bounds.Height,
3558 unit, NULL, NULL, NULL);
3559}
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:3494
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit)
Definition: image.c:2196
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 3561 of file graphics.c.

3563{
3564 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, image, x, y, width, height);
3565
3566 return GdipDrawImageRect(graphics, image, (REAL)x, (REAL)y, (REAL)width, (REAL)height);
3567}
GpStatus WINGDIPAPI GdipDrawImageRect(GpGraphics *graphics, GpImage *image, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:3540

◆ 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 3494 of file graphics.c.

3499{
3500 GpPointF points[3];
3501
3502 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %d, %p, %p, %p)\n",
3503 graphics, image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3504 srcwidth, srcheight, srcUnit, imageattr, callback, callbackData);
3505
3506 points[0].X = dstx;
3507 points[0].Y = dsty;
3508 points[1].X = dstx + dstwidth;
3509 points[1].Y = dsty;
3510 points[2].X = dstx;
3511 points[2].Y = dsty + dstheight;
3512
3513 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3514 srcwidth, srcheight, srcUnit, imageattr, callback, callbackData);
3515}

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 3517 of file graphics.c.

3522{
3523 GpPointF points[3];
3524
3525 TRACE("(%p, %p, %d, %d, %d, %d, %d, %d, %d, %d, %d, %p, %p, %p)\n",
3526 graphics, image, dstx, dsty, dstwidth, dstheight, srcx, srcy,
3527 srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
3528
3529 points[0].X = dstx;
3530 points[0].Y = dsty;
3531 points[1].X = dstx + dstwidth;
3532 points[1].Y = dsty;
3533 points[2].X = dstx;
3534 points[2].Y = dsty + dstheight;
3535
3536 return GdipDrawImagePointsRect(graphics, image, points, 3, srcx, srcy,
3537 srcwidth, srcheight, srcUnit, imageAttributes, callback, callbackData);
3538}

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 3569 of file graphics.c.

3571{
3572 GpPointF pt[2];
3573
3574 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x1, y1, x2, y2);
3575
3576 if (!pen)
3577 return InvalidParameter;
3578
3579 if (pen->unit == UnitPixel && pen->width <= 0.0)
3580 return Ok;
3581
3582 pt[0].X = x1;
3583 pt[0].Y = y1;
3584 pt[1].X = x2;
3585 pt[1].Y = y2;
3586 return GdipDrawLines(graphics, pen, pt, 2);
3587}
GpStatus WINGDIPAPI GdipDrawLines(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:3597

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 3589 of file graphics.c.

3591{
3592 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x1, y1, x2, y2);
3593
3594 return GdipDrawLine(graphics, pen, (REAL)x1, (REAL)y1, (REAL)x2, (REAL)y2);
3595}
GpStatus WINGDIPAPI GdipDrawLine(GpGraphics *graphics, GpPen *pen, REAL x1, REAL y1, REAL x2, REAL y2)
Definition: graphics.c:3569

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 3597 of file graphics.c.

3599{
3601 GpPath *path;
3602
3603 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
3604
3605 if(!pen || !graphics || (count < 2))
3606 return InvalidParameter;
3607
3608 if(graphics->busy)
3609 return ObjectBusy;
3610
3612 if (status != Ok) return status;
3613
3615 if (status == Ok)
3616 status = GdipDrawPath(graphics, pen, path);
3617
3619 return status;
3620}

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 3622 of file graphics.c.

3624{
3625 GpStatus retval;
3626 GpPointF *ptf;
3627 int i;
3628
3629 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
3630
3631 ptf = heap_alloc_zero(count * sizeof(GpPointF));
3632 if(!ptf) return OutOfMemory;
3633
3634 for(i = 0; i < count; i ++){
3635 ptf[i].X = (REAL) points[i].X;
3636 ptf[i].Y = (REAL) points[i].Y;
3637 }
3638
3639 retval = GdipDrawLines(graphics, pen, ptf, count);
3640
3641 heap_free(ptf);
3642 return retval;
3643}

Referenced by test_GdipDrawLinesI(), and test_Get_Release_DC().

◆ GdipDrawPath()

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

Definition at line 4066 of file graphics.c.

4067{
4068 GpStatus retval;
4069
4070 TRACE("(%p, %p, %p)\n", graphics, pen, path);
4071
4072 if(!pen || !graphics)
4073 return InvalidParameter;
4074
4075 if(graphics->busy)
4076 return ObjectBusy;
4077
4078 if (path->pathdata.Count == 0)
4079 return Ok;
4080
4081 if (graphics->image && graphics->image->type == ImageTypeMetafile)
4082 retval = METAFILE_DrawPath((GpMetafile*)graphics->image, pen, path);
4083 else if (!graphics->hdc || graphics->alpha_hdc || !brush_can_fill_path(pen->brush, FALSE))
4084 retval = SOFTWARE_GdipDrawPath(graphics, pen, path);
4085 else
4086 retval = GDI32_GdipDrawPath(graphics, pen, path);
4087
4088 return retval;
4089}
static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:3645
static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
Definition: graphics.c:1131
static GpStatus SOFTWARE_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:3979
GpStatus METAFILE_DrawPath(GpMetafile *metafile, GpPen *pen, GpPath *path) DECLSPEC_HIDDEN
Definition: metafile.c:4476

Referenced by GdipDrawArc(), GdipDrawBeziers(), GdipDrawClosedCurve2(), GdipDrawCurve2(), GdipDrawEllipse(), GdipDrawLines(), GdipDrawPie(), GdipDrawPolygon(), GdipDrawRectangle(), GdipDrawRectangles(), GdipPlayMetafileRecord(), test_drawpath(), test_Get_Release_DC(), 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 4091 of file graphics.c.

4093{
4095 GpPath *path;
4096
4097 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
4098 width, height, startAngle, sweepAngle);
4099
4100 if(!graphics || !pen)
4101 return InvalidParameter;
4102
4103 if(graphics->busy)
4104 return ObjectBusy;
4105
4107 if (status != Ok) return status;
4108
4109 status = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle);
4110 if (status == Ok)
4111 status = GdipDrawPath(graphics, pen, path);
4112
4114 return status;
4115}

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 4117 of file graphics.c.

4119{
4120 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n", graphics, pen, x, y,
4121 width, height, startAngle, sweepAngle);
4122
4123 return GdipDrawPie(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
4124}
GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4091

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipDrawPolygon()

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

Definition at line 6572 of file graphics.c.

6574{
6576 GpPath* path;
6577
6578 TRACE("(%p, %p, %d)\n", graphics, points, count);
6579
6580 if(!graphics || !pen || count<=0)
6581 return InvalidParameter;
6582
6583 if(graphics->busy)
6584 return ObjectBusy;
6585
6587 if (status != Ok) return status;
6588
6590 if (status == Ok)
6591 status = GdipDrawPath(graphics, pen, path);
6592
6594
6595 return status;
6596}

Referenced by GdipDrawPolygonI(), and test_Get_Release_DC().

◆ GdipDrawPolygonI()

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

Definition at line 6598 of file graphics.c.

6600{
6601 GpStatus ret;
6602 GpPointF *ptf;
6603 INT i;
6604
6605 TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count);
6606
6607 if(count<=0) return InvalidParameter;
6608 ptf = heap_alloc_zero(sizeof(GpPointF) * count);
6609
6610 for(i = 0;i < count; i++){
6611 ptf[i].X = (REAL)points[i].X;
6612 ptf[i].Y = (REAL)points[i].Y;
6613 }
6614
6615 ret = GdipDrawPolygon(graphics,pen,ptf,count);
6616 heap_free(ptf);
6617
6618 return ret;
6619}
GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count)
Definition: graphics.c:6572

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 4126 of file graphics.c.

4128{
4130 GpPath *path;
4131
4132 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y, width, height);
4133
4134 if(!pen || !graphics)
4135 return InvalidParameter;
4136
4137 if(graphics->busy)
4138 return ObjectBusy;
4139
4141 if (status != Ok) return status;
4142
4144 if (status == Ok)
4145 status = GdipDrawPath(graphics, pen, path);
4146
4148 return status;
4149}

Referenced by GdipDrawRectangleI(), and test_Get_Release_DC().

◆ GdipDrawRectangleI()

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

Definition at line 4151 of file graphics.c.

4153{
4154 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, pen, x, y, width, height);
4155
4156 return GdipDrawRectangle(graphics,pen,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
4157}
GpStatus WINGDIPAPI GdipDrawRectangle(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4126

Referenced by test_Get_Release_DC().

◆ GdipDrawRectangles()

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

Definition at line 4159 of file graphics.c.

4161{
4163 GpPath *path;
4164
4165 TRACE("(%p, %p, %p, %d)\n", graphics, pen, rects, count);
4166
4167 if(!graphics || !pen || !rects || count < 1)
4168 return InvalidParameter;
4169
4170 if(graphics->busy)
4171 return ObjectBusy;
4172
4174 if (status != Ok) return status;
4175
4177 if (status == Ok)
4178 status = GdipDrawPath(graphics, pen, path);
4179
4181 return status;
4182}

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

◆ GdipDrawRectanglesI()

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

Definition at line 4184 of file graphics.c.

4186{
4187 GpRectF *rectsF;
4188 GpStatus ret;
4189 INT i;
4190
4191 TRACE("(%p, %p, %p, %d)\n", graphics, pen, rects, count);
4192
4193 if(!rects || count<=0)
4194 return InvalidParameter;
4195
4196 rectsF = heap_alloc_zero(sizeof(GpRectF) * count);
4197 if(!rectsF)
4198 return OutOfMemory;
4199
4200 for(i = 0;i < count;i++){
4201 rectsF[i].X = (REAL)rects[i].X;
4202 rectsF[i].Y = (REAL)rects[i].Y;
4203 rectsF[i].Width = (REAL)rects[i].Width;
4204 rectsF[i].Height = (REAL)rects[i].Height;
4205 }
4206
4207 ret = GdipDrawRectangles(graphics, pen, rectsF, count);
4208 heap_free(rectsF);
4209
4210 return ret;
4211}
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4159

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 5696 of file graphics.c.

5699{
5700 HRGN rgn = NULL;
5701 HFONT gdifont;
5702 GpPointF pt[3], rectcpy[4];
5703 POINT corners[4];
5704 REAL rel_width, rel_height, margin_x;
5705 INT save_state, format_flags = 0;
5706 REAL offsety = 0.0;
5707 struct draw_string_args args;
5708 RectF scaled_rect;
5709 HDC hdc, temp_hdc=NULL;
5710 TEXTMETRICW textmetric;
5711
5712 TRACE("(%p, %s, %i, %p, %s, %p, %p)\n", graphics, debugstr_wn(string, length),
5714
5715 if(!graphics || !string || !font || !brush || !rect)
5716 return InvalidParameter;
5717
5718 if(graphics->hdc)
5719 {
5720 hdc = graphics->hdc;
5721 }
5722 else
5723 {
5724 hdc = temp_hdc = CreateCompatibleDC(0);
5725 }
5726
5727 if(format){
5728 TRACE("may be ignoring some format flags: attr %x\n", format->attr);
5729
5730 format_flags = format->attr;
5731
5732 /* Should be no need to explicitly test for StringAlignmentNear as
5733 * that is default behavior if no alignment is passed. */
5734 if(format->line_align != StringAlignmentNear){
5735 RectF bounds, in_rect = *rect;
5736 in_rect.Height = 0.0; /* avoid height clipping */
5737 GdipMeasureString(graphics, string, length, font, &in_rect, format, &bounds, 0, 0);
5738
5739 TRACE("bounds %s\n", debugstr_rectf(&bounds));
5740
5741 if(format->line_align == StringAlignmentCenter)
5742 offsety = (rect->Height - bounds.Height) / 2;
5743 else if(format->line_align == StringAlignmentFar)
5744 offsety = (rect->Height - bounds.Height);
5745 }
5746 TRACE("line align %d, offsety %f\n", format->line_align, offsety);
5747 }
5748
5749 save_state = SaveDC(hdc);
5750
5751 pt[0].X = 0.0;
5752 pt[0].Y = 0.0;
5753 pt[1].X = 1.0;
5754 pt[1].Y = 0.0;
5755 pt[2].X = 0.0;
5756 pt[2].Y = 1.0;
5758 rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+
5759 (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X));
5760 rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+
5761 (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X));
5762
5763 rectcpy[3].X = rectcpy[0].X = rect->X;
5764 rectcpy[1].Y = rectcpy[0].Y = rect->Y;
5765 rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width;
5766 rectcpy[3].Y = rectcpy[2].Y = rect->Y + rect->Height;
5768 round_points(corners, rectcpy, 4);
5769
5770 margin_x = (format && format->generic_typographic) ? 0.0 : font->emSize / 6.0;
5771 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres);
5772
5773 scaled_rect.X = margin_x * rel_width;
5774 scaled_rect.Y = 0.0;
5775 scaled_rect.Width = rel_width * rect->Width;
5776 scaled_rect.Height = rel_height * rect->Height;
5777 if (scaled_rect.Width >= 0.5)
5778 {
5779 scaled_rect.Width -= margin_x * 2.0 * rel_width;
5780 if (scaled_rect.Width < 0.5) return Ok; /* doesn't fit */
5781 }
5782
5783 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
5784 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
5785
5786 if (!(format_flags & StringFormatFlagsNoClip) &&
5787 scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23 &&
5788 rect->Width > 0.0 && rect->Height > 0.0)
5789 {
5790 /* FIXME: If only the width or only the height is 0, we should probably still clip */
5791 rgn = CreatePolygonRgn(corners, 4, ALTERNATE);
5792 SelectClipRgn(hdc, rgn);
5793 }
5794
5795 get_font_hfont(graphics, font, format, &gdifont, NULL);
5796 SelectObject(hdc, gdifont);
5797
5798 args.graphics = graphics;
5799 args.brush = brush;
5800
5801 args.x = rect->X;
5802 args.y = rect->Y + offsety;
5803
5804 args.rel_width = rel_width;
5805 args.rel_height = rel_height;
5806
5808
5809 GetTextMetricsW(hdc, &textmetric);
5810 args.ascent = textmetric.tmAscent / rel_height;
5811
5812 gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE,
5814
5816
5817 DeleteObject(rgn);
5818 DeleteObject(gdifont);
5819
5820 RestoreDC(hdc, save_state);
5821
5822 DeleteDC(temp_hdc);
5823
5824 return Ok;
5825}
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
#define ALTERNATE
Definition: constants.h:278
GpStatus gdip_format_string(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:5201
static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, GDIPCONST GpStringFormat *format, HFONT *hfont, GDIPCONST GpMatrix *matrix)
Definition: graphics.c:2337
static GpStatus draw_string_callback(HDC hdc, GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, INT lineno, const RectF *bounds, INT *underlined_indexes, INT underlined_index_count, void *user_data)
Definition: graphics.c:5649
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:5546
@ StringAlignmentNear
Definition: gdiplusenums.h:265
@ StringFormatFlagsNoClip
Definition: gdiplusenums.h:288
GDIPCONST GpBrush * brush
Definition: graphics.c:5645
GpGraphics * graphics
Definition: graphics.c:5644
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 3986 of file metafile.c.

3988{
3989 FIXME("(%p, %d, %p, %d, %d): stub\n", hemf, cbData16, pData16, iMapMode, eFlags);
3990 return NotImplemented;
3991}

◆ GdipEndContainer()

GpStatus WINGDIPAPI GdipEndContainer ( GpGraphics graphics,
GraphicsContainer  state 
)

Definition at line 6039 of file graphics.c.

6040{
6041 TRACE("(%p, %x)\n", graphics, state);
6042 return end_container(graphics, BEGIN_CONTAINER, state);
6043}
static GpStatus end_container(GpGraphics *graphics, GraphicsContainerType type, GraphicsContainer state)
Definition: graphics.c:5996

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 3602 of file metafile.c.

3605{
3606 GpRectF destf;
3607
3608 if (!graphics || !metafile || !dest) return InvalidParameter;
3609
3610 destf.X = dest->X;
3611 destf.Y = dest->Y;
3612 destf.Width = units_to_pixels(metafile->bounds.Width, metafile->unit, metafile->image.xres);
3613 destf.Height = units_to_pixels(metafile->bounds.Height, metafile->unit, metafile->image.yres);
3614
3615 return GdipEnumerateMetafileDestRect(graphics, metafile, &destf, callback, cb_data, attrs);
3616}
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect(GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpRectF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
Definition: metafile.c:3569

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 3618 of file metafile.c.

3621{
3622 GpPointF ptf;
3623
3624 if (!graphics || !metafile || !dest) return InvalidParameter;
3625
3626 ptf.X = dest->X;
3627 ptf.Y = dest->Y;
3628
3629 return GdipEnumerateMetafileDestPoint(graphics, metafile, &ptf, callback, cb_data, attrs);
3630}
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint(GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpPointF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
Definition: metafile.c:3602

◆ GdipEnumerateMetafileDestRect()

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

Definition at line 3569 of file metafile.c.

3572{
3573 GpPointF points[3];
3574
3575 if (!graphics || !metafile || !dest) return InvalidParameter;
3576
3577 points[0].X = points[2].X = dest->X;
3578 points[0].Y = points[1].Y = dest->Y;
3579 points[1].X = dest->X + dest->Width;
3580 points[2].Y = dest->Y + dest->Height;
3581
3583 &metafile->bounds, metafile->unit, callback, cb_data, attrs);
3584}

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 3586 of file metafile.c.

3589{
3590 GpRectF destf;
3591
3592 if (!graphics || !metafile || !dest) return InvalidParameter;
3593
3594 destf.X = dest->X;
3595 destf.Y = dest->Y;
3596 destf.Width = dest->Width;
3597 destf.Height = dest->Height;
3598
3599 return GdipEnumerateMetafileDestRect(graphics, metafile, &destf, callback, cb_data, attrs);
3600}

◆ 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 3435 of file metafile.c.

3439{
3440 struct enum_metafile_data data;
3441 GpStatus stat;
3442 GpMetafile *real_metafile = (GpMetafile*)metafile; /* whoever made this const was joking */
3444 GpPath *dst_path;
3445
3446 TRACE("(%p,%p,%p,%i,%p,%i,%p,%p,%p)\n", graphics, metafile,
3447 destPoints, count, srcRect, srcUnit, callback, callbackData,
3448 imageAttributes);
3449
3450 if (!graphics || !metafile || !destPoints || count != 3 || !srcRect)
3451 return InvalidParameter;
3452
3453 if (!metafile->hemf)
3454 return InvalidParameter;
3455
3456 if (metafile->playback_graphics)
3457 return ObjectBusy;
3458
3459 TRACE("%s %i -> %s %s %s\n", debugstr_rectf(srcRect), srcUnit,
3460 debugstr_pointf(&destPoints[0]), debugstr_pointf(&destPoints[1]),
3461 debugstr_pointf(&destPoints[2]));
3462
3463 data.callback = callback;
3464 data.callback_data = callbackData;
3465 data.metafile = real_metafile;
3466
3467 real_metafile->playback_graphics = graphics;
3468 real_metafile->playback_dc = NULL;
3469 real_metafile->src_rect = *srcRect;
3470
3471 memcpy(real_metafile->playback_points, destPoints, sizeof(PointF) * 3);
3473
3474 if (stat == Ok)
3475 stat = GdipBeginContainer2(graphics, &state);
3476
3477 if (stat == Ok)
3478 {
3479 stat = GdipSetPageScale(graphics, 1.0);
3480
3481 if (stat == Ok)
3482 stat = GdipSetPageUnit(graphics, UnitPixel);
3483
3484 if (stat == Ok)
3485 stat = GdipResetWorldTransform(graphics);
3486
3487 if (stat == Ok)
3488 stat = GdipCreateRegion(&real_metafile->base_clip);
3489
3490 if (stat == Ok)
3491 stat = GdipGetClip(graphics, real_metafile->base_clip);
3492
3493 if (stat == Ok)
3494 stat = GdipCreateRegion(&real_metafile->clip);
3495
3496 if (stat == Ok)
3498
3499 if (stat == Ok)
3500 {
3501 GpPointF clip_points[4];
3502
3503 clip_points[0] = real_metafile->playback_points[0];
3504 clip_points[1] = real_metafile->playback_points[1];
3505 clip_points[2].X = real_metafile->playback_points[1].X + real_metafile->playback_points[2].X
3506 - real_metafile->playback_points[0].X;
3507 clip_points[2].Y = real_metafile->playback_points[1].Y + real_metafile->playback_points[2].Y
3508 - real_metafile->playback_points[0].Y;
3509 clip_points[3] = real_metafile->playback_points[2];
3510
3511 stat = GdipAddPathPolygon(dst_path, clip_points, 4);
3512
3513 if (stat == Ok)
3514 stat = GdipCombineRegionPath(real_metafile->base_clip, dst_path, CombineModeIntersect);
3515
3516 GdipDeletePath(dst_path);
3517 }
3518
3519 if (stat == Ok)
3520 stat = GdipCreateMatrix(&real_metafile->world_transform);
3521
3522 if (stat == Ok)
3523 {
3524 real_metafile->page_unit = UnitDisplay;
3525 real_metafile->page_scale = 1.0;
3527 }
3528
3529 if (stat == Ok)
3530 {
3531 stat = METAFILE_PlaybackUpdateClip(real_metafile);
3532 }
3533
3534 if (stat == Ok && (metafile->metafile_type == MetafileTypeEmf ||
3535 metafile->metafile_type == MetafileTypeWmfPlaceable ||
3536 metafile->metafile_type == MetafileTypeWmf))
3537 stat = METAFILE_PlaybackGetDC(real_metafile);
3538
3539 if (stat == Ok)
3541
3542 METAFILE_PlaybackReleaseDC(real_metafile);
3543
3544 GdipDeleteMatrix(real_metafile->world_transform);
3545 real_metafile->world_transform = NULL;
3546
3547 GdipDeleteRegion(real_metafile->base_clip);
3548 real_metafile->base_clip = NULL;
3549
3550 GdipDeleteRegion(real_metafile->clip);
3551 real_metafile->clip = NULL;
3552
3553 while (list_head(&real_metafile->containers))
3554 {
3555 container* cont = LIST_ENTRY(list_head(&real_metafile->containers), container, entry);
3556 list_remove(&cont->entry);
3557 GdipDeleteRegion(cont->clip);
3558 heap_free(cont);
3559 }
3560
3561 GdipEndContainer(graphics, state);
3562 }
3563
3564 real_metafile->playback_graphics = NULL;
3565
3566 return stat;
3567}
GpStatus WINGDIPAPI GdipGetClip(GpGraphics *graphics, GpRegion *region)
Definition: graphics.c:6809
GpStatus WINGDIPAPI GdipEndContainer(GpGraphics *graphics, GraphicsContainer state)
Definition: graphics.c:6039
GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpPointF *points, INT count)
Definition: graphics.c:6960
GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
Definition: graphics.c:6202
GpStatus WINGDIPAPI GdipResetWorldTransform(GpGraphics *graphics)
Definition: graphics.c:5840
GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale)
Definition: graphics.c:6178
GpStatus WINGDIPAPI GdipBeginContainer2(GpGraphics *graphics, GraphicsContainer *state)
Definition: graphics.c:5917
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
Definition: matrix.c:160
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
Definition: matrix.c:140
static GpStatus METAFILE_PlaybackUpdateWorldTransform(GpMetafile *metafile)
Definition: metafile.c:1691
static int CALLBACK enum_metafile_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
Definition: metafile.c:3385
static void METAFILE_PlaybackReleaseDC(GpMetafile *metafile)
Definition: metafile.c:1673
static GpStatus METAFILE_PlaybackUpdateClip(GpMetafile *metafile)
Definition: metafile.c:1682
static GpStatus METAFILE_PlaybackGetDC(GpMetafile *metafile)
Definition: metafile.c:1656
GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, CombineMode mode)
Definition: region.c:232
@ CombineModeIntersect
Definition: gdiplusenums.h:352
UINT GraphicsContainer
Definition: gdiplusenums.h:23
@ MetafileTypeEmf
Definition: gdiplusenums.h:219
@ CoordinateSpaceDevice
Definition: gdiplusenums.h:369
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:161
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(), and play_metafile().

◆ GdipFillClosedCurve()

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

Definition at line 4274 of file graphics.c.

4276{
4277 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4278 return GdipFillClosedCurve2(graphics, brush, points, count,
4279 0.5f, FillModeAlternate);
4280}
GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill)
Definition: graphics.c:4213

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 4213 of file graphics.c.

4215{
4216 GpPath *path;
4218
4219 TRACE("(%p, %p, %p, %d, %.2f, %d)\n", graphics, brush, points,
4220 count, tension, fill);
4221
4222 if(!graphics || !brush || !points)
4223 return InvalidParameter;
4224
4225 if(graphics->busy)
4226 return ObjectBusy;
4227
4228 if(count == 1) /* Do nothing */
4229 return Ok;
4230
4232 if (status != Ok) return status;
4233
4235 if (status == Ok)
4236 status = GdipFillPath(graphics, brush, path);
4237
4239 return status;
4240}
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4391

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 4242 of file graphics.c.

4244{
4245 GpPointF *ptf;
4246 GpStatus stat;
4247 INT i;
4248
4249 TRACE("(%p, %p, %p, %d, %.2f, %d)\n", graphics, brush, points,
4250 count, tension, fill);
4251
4252 if(!points || count == 0)
4253 return InvalidParameter;
4254
4255 if(count == 1) /* Do nothing */
4256 return Ok;
4257
4258 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
4259 if(!ptf)
4260 return OutOfMemory;
4261
4262 for(i = 0;i < count;i++){
4263 ptf[i].X = (REAL)points[i].X;
4264 ptf[i].Y = (REAL)points[i].Y;
4265 }
4266
4267 stat = GdipFillClosedCurve2(graphics, brush, ptf, count, tension, fill);
4268
4269 heap_free(ptf);
4270
4271 return stat;
4272}

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 4282 of file graphics.c.

4284{
4285 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4286 return GdipFillClosedCurve2I(graphics, brush, points, count,
4287 0.5f, FillModeAlternate);
4288}
GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, REAL tension, GpFillMode fill)
Definition: graphics.c:4242

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 4290 of file graphics.c.

4292{
4293 GpStatus stat;
4294 GpPath *path;
4295
4296 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
4297
4298 if(!graphics || !brush)
4299 return InvalidParameter;
4300
4301 if(graphics->busy)
4302 return ObjectBusy;
4303
4305
4306 if (stat == Ok)
4307 {
4309
4310 if (stat == Ok)
4311 stat = GdipFillPath(graphics, brush, path);
4312
4314 }
4315
4316 return stat;
4317}

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

◆ GdipFillEllipseI()

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

Definition at line 4319 of file graphics.c.

4321{
4322 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, brush, x, y, width, height);
4323
4324 return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
4325}
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4290

Referenced by GdipPlayMetafileRecord(), and test_Get_Release_DC().

◆ GdipFillPath()

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

Definition at line 4391 of file graphics.c.

4392{
4394
4395 TRACE("(%p, %p, %p)\n", graphics, brush, path);
4396
4397 if(!brush || !graphics || !path)
4398 return InvalidParameter;
4399
4400 if(graphics->busy)
4401 return ObjectBusy;
4402
4403 if (!path->pathdata.Count)
4404 return Ok;
4405
4406 if (graphics->image && graphics->image->type == ImageTypeMetafile)
4407 return METAFILE_FillPath((GpMetafile*)graphics->image, brush, path);
4408
4409 if (!graphics->image && !graphics->alpha_hdc)
4410 stat = GDI32_GdipFillPath(graphics, brush, path);
4411
4412 if (stat == NotImplemented)
4413 stat = SOFTWARE_GdipFillPath(graphics, brush, path);
4414
4415 if (stat == NotImplemented)
4416 {
4417 FIXME("Not implemented for brushtype %i\n", brush->bt);
4418 stat = Ok;
4419 }
4420
4421 return stat;
4422}
static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4327
static GpStatus SOFTWARE_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4369
GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path) DECLSPEC_HIDDEN
Definition: metafile.c:4505

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 4424 of file graphics.c.

4426{
4427 GpStatus stat;
4428 GpPath *path;
4429
4430 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n",
4431 graphics, brush, x, y, width, height, startAngle, sweepAngle);
4432
4433 if(!graphics || !brush)
4434 return InvalidParameter;
4435
4436 if(graphics->busy)
4437 return ObjectBusy;
4438
4440
4441 if (stat == Ok)
4442 {
4443 stat = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle);
4444
4445 if (stat == Ok)
4446 stat = GdipFillPath(graphics, brush, path);
4447
4449 }
4450
4451 return stat;
4452}

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 4454 of file graphics.c.

4456{
4457 TRACE("(%p, %p, %d, %d, %d, %d, %.2f, %.2f)\n",
4458 graphics, brush, x, y, width, height, startAngle, sweepAngle);
4459
4460 return GdipFillPie(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height,startAngle,sweepAngle);
4461}
GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4424

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 4463 of file graphics.c.

4465{
4466 GpStatus stat;
4467 GpPath *path;
4468
4469 TRACE("(%p, %p, %p, %d, %d)\n", graphics, brush, points, count, fillMode);
4470
4471 if(!graphics || !brush || !points || !count)
4472 return InvalidParameter;
4473
4474 if(graphics->busy)
4475 return ObjectBusy;
4476
4478
4479 if (stat == Ok)
4480 {
4482
4483 if (stat == Ok)
4484 stat = GdipFillPath(graphics, brush, path);
4485
4487 }
4488
4489 return stat;
4490}
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 4521 of file graphics.c.

4523{
4524 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4525
4526 return GdipFillPolygon(graphics, brush, points, count, FillModeAlternate);
4527}
GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, GpFillMode fillMode)
Definition: graphics.c:4463

Referenced by test_Get_Release_DC().

◆ GdipFillPolygon2I()

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

Definition at line 4529 of file graphics.c.

4531{
4532 TRACE("(%p, %p, %p, %d)\n", graphics, brush, points, count);
4533
4534 return GdipFillPolygonI(graphics, brush, points, count, FillModeAlternate);
4535}
GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPoint *points, INT count, GpFillMode fillMode)
Definition: graphics.c:4492

Referenced by test_Get_Release_DC().

◆ GdipFillPolygonI()

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

Definition at line 4492 of file graphics.c.

4494{
4495 GpStatus stat;
4496 GpPath *path;
4497
4498 TRACE("(%p, %p, %p, %d, %d)\n", graphics, brush, points, count, fillMode);
4499
4500 if(!graphics || !brush || !points || !count)
4501 return InvalidParameter;
4502
4503 if(graphics->busy)
4504 return ObjectBusy;
4505
4507
4508 if (stat == Ok)
4509 {
4511
4512 if (stat == Ok)
4513 stat = GdipFillPath(graphics, brush, path);
4514
4516 }
4517
4518 return stat;
4519}
GpStatus WINGDIPAPI GdipAddPathPolygonI(GpPath *path, GDIPCONST GpPoint *points, INT count)
Definition: graphicspath.c:870

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 4537 of file graphics.c.

4539{
4540 GpRectF rect;
4541
4542 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
4543
4544 rect.X = x;
4545 rect.Y = y;
4546 rect.Width = width;
4547 rect.Height = height;
4548
4549 return GdipFillRectangles(graphics, brush, &rect, 1);
4550}
GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4567

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

◆ GdipFillRectangleI()

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

Definition at line 4552 of file graphics.c.

4554{
4555 GpRectF rect;
4556
4557 TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, brush, x, y, width, height);
4558
4559 rect.X = (REAL)x;
4560 rect.Y = (REAL)y;
4561 rect.Width = (REAL)width;
4562 rect.Height = (REAL)height;
4563
4564 return GdipFillRectangles(graphics, brush, &rect, 1);
4565}

Referenced by test_fillrect(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipFillRectanglesOnMemoryDCSolidBrush(), test_GdipFillRectanglesOnMemoryDCTextureBrush(), test_Get_Release_DC(), test_hdc_caching(), test_nullframerect(), test_pagetransform(), and test_worldtransform().

◆ GdipFillRectangles()

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

Definition at line 4567 of file graphics.c.

4569{
4571 GpPath *path;
4572
4573 TRACE("(%p, %p, %p, %d)\n", graphics, brush, rects, count);
4574
4575 if(!graphics || !brush || !rects || count <= 0)
4576 return InvalidParameter;
4577
4578 if (graphics->image && graphics->image->type == ImageTypeMetafile)
4579 {
4580 status = METAFILE_FillRectangles((GpMetafile*)graphics->image, brush, rects, count);
4581 /* FIXME: Add gdi32 drawing. */
4582 return status;
4583 }
4584
4586 if (status != Ok) return status;
4587
4589 if (status == Ok)
4590 status = GdipFillPath(graphics, brush, path);
4591
4593 return status;
4594}
GpStatus METAFILE_FillRectangles(GpMetafile *metafile, GpBrush *brush, GDIPCONST GpRectF *rects, INT count) DECLSPEC_HIDDEN
Definition: metafile.c:1051

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

◆ GdipFillRectanglesI()

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

Definition at line 4596 of file graphics.c.

4598{
4599 GpRectF *rectsF;
4600 GpStatus ret;
4601 INT i;
4602
4603 TRACE("(%p, %p, %p, %d)\n", graphics, brush, rects, count);
4604
4605 if(!rects || count <= 0)
4606 return InvalidParameter;
4607
4608 rectsF = heap_alloc_zero(sizeof(GpRectF)*count);
4609 if(!rectsF)
4610 return OutOfMemory;
4611
4612 for(i = 0; i < count; i++){
4613 rectsF[i].X = (REAL)rects[i].X;
4614 rectsF[i].Y = (REAL)rects[i].Y;
4615 rectsF[i].Width = (REAL)rects[i].Width;
4616 rectsF[i].Height = (REAL)rects[i].Height;
4617 }
4618
4619 ret = GdipFillRectangles(graphics,brush,rectsF,count);
4620 heap_free(rectsF);
4621
4622 return ret;
4623}

Referenced by test_Get_Release_DC().

◆ GdipFillRegion()

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

Definition at line 4758 of file graphics.c.

4760{
4762
4763 TRACE("(%p, %p, %p)\n", graphics, brush, region);
4764
4765 if (!(graphics && brush && region))
4766 return InvalidParameter;
4767
4768 if(graphics->busy)
4769 return ObjectBusy;
4770
4771 if (!graphics->image && !graphics->alpha_hdc)
4772 stat = GDI32_GdipFillRegion(graphics, brush, region);
4773
4774 if (stat == NotImplemented)
4775 stat = SOFTWARE_GdipFillRegion(graphics, brush, region);
4776
4777 if (stat == NotImplemented)
4778 {
4779 FIXME("not implemented for brushtype %i\n", brush->bt);
4780 stat = Ok;
4781 }
4782
4783 return stat;
4784}
static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush, GpRegion *region)
Definition: graphics.c:4675
static GpStatus GDI32_GdipFillRegion(GpGraphics *graphics, GpBrush *brush, GpRegion *region)
Definition: graphics.c:4625

Referenced by SOFTWARE_GdipFillPath(), and test_Get_Release_DC().

◆ GdipFindFirstImageItem()

GpStatus WINGDIPAPI GdipFindFirstImageItem ( GpImage image,
ImageItemData item 
)

Definition at line 2169 of file image.c.

2170{
2171 static int calls;
2172
2173 TRACE("(%p,%p)\n", image, item);
2174
2175 if(!image || !item)
2176 return InvalidParameter;
2177
2178 if (!(calls++))
2179 FIXME("not implemented\n");
2180
2181 return NotImplemented;
2182}
static ATOM item
Definition: dde.c:856

◆ GdipFindNextImageItem()

GpStatus WINGDIPAPI GdipFindNextImageItem ( GpImage ,
ImageItemData  
)

◆ GdipFlattenPath()

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

Definition at line 1282 of file graphicspath.c.

1283{
1285 GpPointF pt;
1286 INT i = 1;
1287 INT startidx = 0;
1288 GpStatus stat;
1289
1290 TRACE("(%p, %p, %.2f)\n", path, matrix, flatness);
1291
1292 if(!path)
1293 return InvalidParameter;
1294
1295 if(path->pathdata.Count == 0)
1296 return Ok;
1297
1299 if(stat != Ok)
1300 return stat;
1301
1302 pt = path->pathdata.Points[0];
1303 if(!init_path_list(&list, pt.X, pt.Y))
1304 return OutOfMemory;
1305
1306 node = list;
1307
1308 while(i < path->pathdata.Count){
1309
1310 BYTE type = path->pathdata.Types[i] & PathPointTypePathTypeMask;
1312
1313 pt = path->pathdata.Points[i];
1314
1315 /* save last start point index */
1317 startidx = i;
1318
1319 /* always add line points and start points */
1321 if(!add_path_list_node(node, pt.X, pt.Y, path->pathdata.Types[i]))
1322 goto memout;
1323
1324 node = node->next;
1325 ++i;
1326 continue;
1327 }
1328
1329 /* Bezier curve */
1330
1331 /* test for closed figure */
1332 if(path->pathdata.Types[i+1] & PathPointTypeCloseSubpath){
1333 pt = path->pathdata.Points[startidx];
1334 ++i;
1335 }
1336 else
1337 {
1338 i += 2;
1339 pt = path->pathdata.Points[i];
1340 };
1341
1342 start = node;
1343 /* add Bezier end point */
1344 type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine;
1345 if(!add_path_list_node(node, pt.X, pt.Y, type))
1346 goto memout;
1347 node = node->next;
1348
1349 /* flatten curve */
1350 if(!flatten_bezier(start, path->pathdata.Points[i-2].X, path->pathdata.Points[i-2].Y,
1351 path->pathdata.Points[i-1].X, path->pathdata.Points[i-1].Y,
1352 node, flatness))
1353 goto memout;
1354
1355 ++i;
1356 }/* while */
1357
1358 /* store path data back */
1360 if(!lengthen_path(path, i))
1361 goto memout;
1362 path->pathdata.Count = i;
1363
1364 node = list;
1365 for(i = 0; i < path->pathdata.Count; i++){
1366 path->pathdata.Points[i] = node->pt;
1367 path->pathdata.Types[i] = node->type;
1368 node = node->next;
1369 }
1370
1372 return Ok;
1373
1374memout:
1376 return OutOfMemory;
1377}
Definition: list.h:37
static INT path_list_count(path_list_node_t *node)
Definition: graphicspath.c:94
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:121
static void free_path_list(path_list_node_t *node)
Definition: graphicspath.c:59
static BOOL init_path_list(path_list_node_t **node, REAL x, REAL y)
Definition: graphicspath.c:44
GpStatus WINGDIPAPI GdipTransformPath(GpPath *path, GpMatrix *matrix)
static path_list_node_t * add_path_list_node(path_list_node_t *node, REAL x, REAL y, BOOL type)
Definition: graphicspath.c:76
@ PathPointTypePathTypeMask
Definition: gdiplusenums.h:87
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 4786 of file graphics.c.

4787{
4788 TRACE("(%p,%u)\n", graphics, intention);
4789
4790 if(!graphics)
4791 return InvalidParameter;
4792
4793 if(graphics->busy)
4794 return ObjectBusy;
4795
4796 /* We have no internal operation queue, so there's no need to clear it. */
4797
4798 if (graphics->hdc)
4799 GdiFlush();
4800
4801 return Ok;
4802}
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 2805 of file image.c.

2807{
2809 HRESULT hr;
2811 IWICEnumMetadataItem *enumerator;
2812 UINT prop_count, prop_size, i;
2813 PROPVARIANT id, value;
2814 char *item_value;
2815
2816 TRACE("(%p,%u,%u,%p)\n", image, size, count, buf);
2817
2818 if (!image || !buf) return InvalidParameter;
2819
2820 if (image->type != ImageTypeBitmap)
2821 {
2822 FIXME("Not implemented for type %d\n", image->type);
2823 return NotImplemented;
2824 }
2825
2826 status = GdipGetPropertySize(image, &prop_size, &prop_count);
2827 if (status != Ok) return status;
2828
2829 if (prop_count != count || prop_size != size) return InvalidParameter;
2830
2831 if (((GpBitmap *)image)->prop_item)
2832 {
2833 memcpy(buf, ((GpBitmap *)image)->prop_item, prop_size);
2834
2835 item_value = (char *)(buf + prop_count);
2836
2837 for (i = 0; i < prop_count; i++)
2838 {
2839 buf[i].value = item_value;
2840 item_value += buf[i].length;
2841 }
2842
2843 return Ok;
2844 }
2845
2846 reader = ((GpBitmap *)image)->metadata_reader;
2847 if (!reader) return PropertyNotFound;
2848
2849 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2850 if (FAILED(hr)) return hresult_to_status(hr);
2851
2852 IWICEnumMetadataItem_Reset(enumerator);
2853
2854 item_value = (char *)(buf + prop_count);
2855
2856 PropVariantInit(&id);
2857 PropVariantInit(&value);
2858
2859 for (i = 0; i < prop_count; i++)
2860 {
2862 UINT items_returned, item_size;
2863
2864 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, &value, &items_returned);
2865 if (hr != S_OK) break;
2866
2867 if (id.vt != VT_UI2)
2868 {
2869 FIXME("not supported propvariant type for id: %u\n", id.vt);
2870 continue;
2871 }
2872
2873 item_size = propvariant_size(&value);
2874 if (item_size)
2875 {
2876 item = heap_alloc(item_size + sizeof(*item));
2877
2878 propvariant_to_item(&value, item, item_size + sizeof(*item), id.u.uiVal);
2879 buf[i].id = item->id;
2880 buf[i].type = item->type;
2881 buf[i].length = item_size;
2882 buf[i].value = item_value;
2883 memcpy(item_value, item->value, item_size);
2884 item_value += item_size;
2885
2886 heap_free(item);
2887 }
2888
2889 PropVariantClear(&id);
2891 }
2892
2893 IWICEnumMetadataItem_Release(enumerator);
2894
2895 if (hr != S_OK) return PropertyNotFound;
2896
2897 return Ok;
2898}
@ VT_UI2
Definition: compat.h:2312
GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT *size, UINT *count)
Definition: image.c:2735
static UINT propvariant_size(PROPVARIANT *value)
Definition: image.c:2502
static GpStatus propvariant_to_item(PROPVARIANT *value, PropertyItem *item, UINT size, PROPID id)
Definition: image.c:2619
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:86
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: ole2.c:2968
@ PropertyNotFound
Definition: gdiplustypes.h:45
GLuint id
Definition: glext.h:5910
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 * u
Definition: glfuncs.h:240
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
Definition: reader.h:84
Definition: pdh_main.c:94

Referenced by test_GdipGetAllPropertyItems(), and test_gif_properties().

◆ GdipGetBrushType()

GpStatus WINGDIPAPI GdipGetBrushType ( GpBrush brush,
GpBrushType type 
)

Definition at line 950 of file brush.c.

951{
952 TRACE("(%p, %p)\n", brush, type);
953
954 if(!brush || !type) return InvalidParameter;
955
956 *type = brush->bt;
957
958 return Ok;
959}

Referenced by test_brushfill(), and test_type().

◆ GdipGetCellAscent()

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

Definition at line 880 of file font.c.

882{
883 if (!(family && CellAscent)) return InvalidParameter;
884
885 *CellAscent = family->ascent;
886 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellAscent);
887
888 return Ok;
889}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetCellDescent()

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

Definition at line 891 of file font.c.

893{
894 TRACE("(%p, %d, %p)\n", family, style, CellDescent);
895
896 if (!(family && CellDescent)) return InvalidParameter;
897
898 *CellDescent = family->descent;
899 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *CellDescent);
900
901 return Ok;
902}

Referenced by gdip_get_font_metrics(), and test_fontfamily_properties().

◆ GdipGetClip()

GpStatus WINGDIPAPI GdipGetClip ( GpGraphics graphics,
GpRegion region 
)

Definition at line 6809 of file graphics.c.

6810{
6811 GpRegion *clip;
6813 GpMatrix device_to_world;
6814
6815 TRACE("(%p, %p)\n", graphics, region);
6816
6817 if(!graphics || !region)
6818 return InvalidParameter;
6819
6820 if(graphics->busy)
6821 return ObjectBusy;
6822
6823 if((status = GdipCloneRegion(graphics->clip, &clip)) != Ok)
6824 return status;
6825
6827 status = GdipTransformRegion(clip, &device_to_world);
6828 if (status != Ok)
6829 {
6830 GdipDeleteRegion(clip);
6831 return status;
6832 }
6833
6834 /* free everything except root node and header */
6835 delete_element(&region->node);
6836 memcpy(region, clip, sizeof(GpRegion));
6837 heap_free(clip);
6838
6839 return Ok;
6840}
GpStatus get_graphics_transform(GpGraphics *graphics, GpCoordinateSpace dst_space, GpCoordinateSpace src_space, GpMatrix *matrix)
Definition: graphics.c:6871
GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix)
Definition: region.c:1480

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 4807 of file graphics.c.

4808{
4810 GpRegion *clip;
4811
4812 TRACE("(%p, %p)\n", graphics, rect);
4813
4814 if(!graphics)
4815 return InvalidParameter;
4816
4817 if(graphics->busy)
4818 return ObjectBusy;
4819
4820 status = GdipCreateRegion(&clip);
4821 if (status != Ok) return status;
4822
4823 status = GdipGetClip(graphics, clip);
4824 if (status == Ok)
4825 status = GdipGetRegionBounds(clip, graphics, rect);
4826
4827 GdipDeleteRegion(clip);
4828 return status;
4829}
GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, GpRectF *rect)
Definition: region.c:587

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

◆ GdipGetClipBoundsI()

GpStatus WINGDIPAPI GdipGetClipBoundsI ( GpGraphics graphics,
GpRect rect 
)

Definition at line 4834 of file graphics.c.

4835{
4836 TRACE("(%p, %p)\n", graphics, rect);
4837
4838 if(!graphics)
4839 return InvalidParameter;
4840
4841 if(graphics->busy)
4842 return ObjectBusy;
4843
4844 return GdipGetRegionBoundsI(graphics->clip, graphics, rect);
4845}
GpStatus WINGDIPAPI GdipGetRegionBoundsI(GpRegion *region, GpGraphics *graphics, GpRect *rect)
Definition: region.c:629

Referenced by test_Get_Release_DC().

◆ GdipGetCompositingMode()

GpStatus WINGDIPAPI GdipGetCompositingMode ( GpGraphics graphics,
CompositingMode mode 
)

Definition at line 4848 of file graphics.c.

4850{
4851 TRACE("(%p, %p)\n", graphics, mode);
4852
4853 if(!graphics || !mode)
4854 return InvalidParameter;
4855
4856 if(graphics->busy)
4857 return ObjectBusy;
4858
4859 *mode = graphics->compmode;
4860
4861 return Ok;
4862}
CompositingMode compmode

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetCompositingQuality()

GpStatus WINGDIPAPI GdipGetCompositingQuality ( GpGraphics graphics,
CompositingQuality quality 
)

Definition at line 4865 of file graphics.c.

4867{
4868 TRACE("(%p, %p)\n", graphics, quality);
4869
4870 if(!graphics || !quality)
4871 return InvalidParameter;
4872
4873 if(graphics->busy)
4874 return ObjectBusy;
4875
4876 *quality = graphics->compqual;
4877
4878 return Ok;
4879}
int quality
Definition: jpeglib.h:992
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->cap;
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 153 of file customlinecap.c.

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

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 166 of file customlinecap.c.

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

Referenced by test_create_adjustable_cap(), and test_scale().

◆ GdipGetDC()

GpStatus WINGDIPAPI GdipGetDC ( GpGraphics graphics,
HDC hdc 
)

Definition at line 6682 of file graphics.c.

6683{
6685
6686 TRACE("(%p, %p)\n", graphics, hdc);
6687
6688 if(!graphics || !hdc)
6689 return InvalidParameter;
6690
6691 if(graphics->busy)
6692 return ObjectBusy;
6693
6694 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6695 {
6696 stat = METAFILE_GetDC((GpMetafile*)graphics->image, hdc);
6697 }
6698 else if (!graphics->hdc ||
6699 (graphics->image && graphics->image->type == ImageTypeBitmap && ((GpBitmap*)graphics->image)->format & PixelFormatAlpha))
6700 {
6701 /* Create a fake HDC and fill it with a constant color. */
6702 HDC temp_hdc;
6704 GpRectF bounds;
6705 BITMAPINFOHEADER bmih;
6706 int i;
6707
6708 stat = get_graphics_bounds(graphics, &bounds);
6709 if (stat != Ok)
6710 return stat;
6711
6712 graphics->temp_hbitmap_width = bounds.Width;
6713 graphics->temp_hbitmap_height = bounds.Height;
6714
6715 bmih.biSize = sizeof(bmih);
6716 bmih.biWidth = graphics->temp_hbitmap_width;
6717 bmih.biHeight = -graphics->temp_hbitmap_height;
6718 bmih.biPlanes = 1;
6719 bmih.biBitCount = 32;
6720 bmih.biCompression = BI_RGB;
6721 bmih.biSizeImage = 0;
6722 bmih.biXPelsPerMeter = 0;
6723 bmih.biYPelsPerMeter = 0;
6724 bmih.biClrUsed = 0;
6725 bmih.biClrImportant = 0;
6726
6728 (void**)&graphics->temp_bits, NULL, 0);
6729 if (!hbitmap)
6730 return GenericError;
6731
6732 temp_hdc = CreateCompatibleDC(0);
6733 if (!temp_hdc)
6734 {
6736 return GenericError;
6737 }
6738
6739 for (i=0; i<(graphics->temp_hbitmap_width * graphics->temp_hbitmap_height); i++)
6740 ((DWORD*)graphics->temp_bits)[i] = DC_BACKGROUND_KEY;
6741
6742 SelectObject(temp_hdc, hbitmap);
6743
6744 graphics->temp_hbitmap = hbitmap;
6745 *hdc = graphics->temp_hdc = temp_hdc;
6746 }
6747 else
6748 {
6749 *hdc = graphics->hdc;
6750 }
6751
6752 if (stat == Ok)
6753 graphics->busy = TRUE;
6754
6755 return stat;
6756}
static const COLORREF DC_BACKGROUND_KEY
Definition: graphics.c:6680
static GpStatus get_graphics_bounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:2239
GpStatus METAFILE_GetDC(GpMetafile *metafile, HDC *hdc) DECLSPEC_HIDDEN
Definition: metafile.c:927
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_gditransform(), test_Get_Release_DC(), test_getdc(), test_getdc_scaled(), and test_nullframerect().

◆ GdipGetDpiX()

GpStatus WINGDIPAPI GdipGetDpiX ( GpGraphics graphics,
REAL dpi 
)

Definition at line 6621 of file graphics.c.

6622{
6623 TRACE("(%p, %p)\n", graphics, dpi);
6624
6625 if(!graphics || !dpi)
6626 return InvalidParameter;
6627
6628 if(graphics->busy)
6629 return ObjectBusy;
6630
6631 *dpi = graphics->xres;
6632 return Ok;
6633}
#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(), and test_resolution().

◆ GdipGetDpiY()

GpStatus WINGDIPAPI GdipGetDpiY ( GpGraphics graphics,
REAL dpi 
)

Definition at line 6635 of file graphics.c.

6636{
6637 TRACE("(%p, %p)\n", graphics, dpi);
6638
6639 if(!graphics || !dpi)
6640 return InvalidParameter;
6641
6642 if(graphics->busy)
6643 return ObjectBusy;
6644
6645 *dpi = graphics->yres;
6646 return Ok;
6647}

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

◆ GdipGetEmHeight()

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

Definition at line 918 of file font.c.

919{
920 if (!(family && EmHeight)) return InvalidParameter;
921
922 TRACE("%p (%s), %d, %p\n", family, debugstr_w(family->FamilyName), style, EmHeight);
923
924 *EmHeight = family->em_height;
925 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *EmHeight);
926
927 return Ok;
928}

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 5093 of file image.c.

5095{
5096 static int calls;
5097
5098 TRACE("(%p,%s,%p)\n", image, debugstr_guid(clsidEncoder), size);
5099
5100 if(!(calls++))
5101 FIXME("not implemented\n");
5102
5103 *size = 0;
5104
5105 return NotImplemented;
5106}
#define debugstr_guid
Definition: kernel32.h:35

◆ GdipGetFamily()

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

Definition at line 319 of file font.c.

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

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

◆ GdipGetFamilyName()

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

Definition at line 837 of file font.c.

839{
840 static int lang_fixme;
841
842 if (family == NULL)
843 return InvalidParameter;
844
845 TRACE("%p, %p, %d\n", family, name, language);
846
847 if (language != LANG_NEUTRAL && !lang_fixme++)
848 FIXME("No support for handling of multiple languages!\n");
849
850 lstrcpynW (name, family->FamilyName, LF_FACESIZE);
851
852 return Ok;
853}
#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 1559 of file font.c.

1561{
1562 TRACE("%p, %p\n", fontCollection, numFound);
1563
1564 if (!(fontCollection && numFound))
1565 return InvalidParameter;
1566
1567 *numFound = fontCollection->count;
1568 return Ok;
1569}

Referenced by test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), and test_long_name().

◆ GdipGetFontCollectionFamilyList()

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

Definition at line 1574 of file font.c.

1577{
1578 INT i;
1580
1581 TRACE("%p, %d, %p, %p\n", fontCollection, numSought, gpfamilies, numFound);
1582
1583 if (!(fontCollection && gpfamilies && numFound))
1584 return InvalidParameter;
1585
1586 memset(gpfamilies, 0, sizeof(*gpfamilies) * numSought);
1587
1588 for (i = 0; i < numSought && i < fontCollection->count && stat == Ok; i++)
1589 {
1590 stat = GdipCloneFontFamily(fontCollection->FontFamilies[i], &gpfamilies[i]);
1591 }
1592
1593 if (stat == Ok)
1594 *numFound = i;
1595 else
1596 {
1597 int numToFree=i;
1598 for (i=0; i<numToFree; i++)
1599 {
1600 GdipDeleteFontFamily(gpfamilies[i]);
1601 gpfamilies[i] = NULL;
1602 }
1603 }
1604
1605 return stat;
1606}
GpFontFamily ** FontFamilies

Referenced by test_GdipGetFontCollectionFamilyList(), and test_long_name().

◆ GdipGetFontHeight()

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

Definition at line 552 of file font.c.

554{
555 REAL dpi;
558
559 TRACE("%p %p %p\n", font, graphics, height);
560
561 if (!font || !height) return InvalidParameter;
562
564 if (stat != Ok) return stat;
565
566 if (!graphics)
567 {
569 TRACE("%s,%d => %f\n",
570 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
571 return Ok;
572 }
573
574 stat = GdipGetDpiY((GpGraphics *)graphics, &dpi);
575 if (stat != Ok) return stat;
576
577 *height = pixels_to_units(font_height, graphics->unit, dpi);
578
579 TRACE("%s,%d(unit %d) => %f\n",
580 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, graphics->unit, *height);
581 return Ok;
582}
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, REAL *height)
Definition: font.c:599
REAL pixels_to_units(REAL pixels, GpUnit unit, REAL dpi)
Definition: gdiplus.c:350
static int font_height(HFONT hFont)
Definition: combo.c:612

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 599 of file font.c.

600{
602 INT style;
603 UINT16 line_spacing, em_height;
605
606 if (!font || !height) return InvalidParameter;
607
608 TRACE("%p (%s), %f, %p\n", font,
609 debugstr_w(font->family->FamilyName), dpi, height);
610
613 stat = GdipGetLineSpacing(font->family, style, &line_spacing);
614 if (stat != Ok) return stat;
615 stat = GdipGetEmHeight(font->family, style, &em_height);
616 if (stat != Ok) return stat;
617
618 *height = (REAL)line_spacing * font_size / (REAL)em_height;
619
620 TRACE("%s,%d => %f\n",
621 debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height);
622
623 return Ok;
624}
static INT get_font_style(const GpFont *font)
Definition: font.c:362
GpStatus WINGDIPAPI GdipGetLineSpacing(GDIPCONST GpFontFamily *family, INT style, UINT16 *LineSpacing)
Definition: font.c:945
static REAL get_font_size(const GpFont *font)
Definition: font.c:329
static FT_F26Dot6 font_size
Definition: ftrandom.c:89

Referenced by GdipGetFontHeight(), and test_heightgivendpi().

◆ GdipGetFontSize()

GpStatus WINGDIPAPI GdipGetFontSize ( GpFont font,
REAL size 
)

Definition at line 350 of file font.c.

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

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

◆ GdipGetFontStyle()

GpStatus WINGDIPAPI GdipGetFontStyle ( GpFont font,
INT style 
)

Definition at line 393 of file font.c.

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

Referenced by gdip_get_font_metrics(), and test_logfont().

◆ GdipGetFontUnit()

GpStatus WINGDIPAPI GdipGetFontUnit ( GpFont font,
Unit unit 
)

Definition at line 417 of file font.c.

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

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

◆ GdipGetGenericFontFamilyMonospace()

GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace ( GpFontFamily **  nativeFamily)

Definition at line 1010 of file font.c.

1011{
1012 static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
1013 static const WCHAR LiberationMono[] = {'L','i','b','e','r','a','t','i','o','n',' ','M','o','n','o','\0'};
1014 GpStatus stat;
1015
1016 if (nativeFamily == NULL) return InvalidParameter;
1017
1018 stat = GdipCreateFontFamilyFromName(CourierNew, NULL, nativeFamily);
1019
1020 if (stat == FontFamilyNotFound)
1021 stat = GdipCreateFontFamilyFromName(LiberationMono, NULL, nativeFamily);
1022
1023 if (stat == FontFamilyNotFound)
1024 ERR("Missing 'Courier New' font\n");
1025
1026 return stat;
1027}
@ FontFamilyNotFound
Definition: gdiplustypes.h:40

Referenced by test_getgenerics().

◆ GdipGetGenericFontFamilySansSerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif ( GpFontFamily **  nativeFamily)

Definition at line 1074 of file font.c.

1075{
1076 GpStatus stat;
1077 static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
1078 static const WCHAR Tahoma[] = {'T','a','h','o','m','a','\0'};
1079
1080 TRACE("(%p)\n", nativeFamily);
1081
1082 if (nativeFamily == NULL) return InvalidParameter;
1083
1084 stat = GdipCreateFontFamilyFromName(MicrosoftSansSerif, NULL, nativeFamily);
1085
1086 if (stat == FontFamilyNotFound)
1087 /* FIXME: Microsoft Sans Serif is not installed on Wine. */
1088 stat = GdipCreateFontFamilyFromName(Tahoma, NULL, nativeFamily);
1089
1090 return stat;
1091}
static const WCHAR Tahoma[]
Definition: font.c:36

Referenced by test_getgenerics().

◆ GdipGetGenericFontFamilySerif()

GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif ( GpFontFamily **  nativeFamily)

Definition at line 1041 of file font.c.

1042{
1043 static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'};
1044 static const WCHAR LiberationSerif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f','\0'};
1045 GpStatus stat;
1046
1047 TRACE("(%p)\n", nativeFamily);
1048
1049 if (nativeFamily == NULL) return InvalidParameter;
1050
1052
1053 if (stat == FontFamilyNotFound)
1054 stat = GdipCreateFontFamilyFromName(LiberationSerif, NULL, nativeFamily);
1055
1056 if (stat == FontFamilyNotFound)
1057 ERR("Missing 'Times New Roman' font\n");
1058
1059 return stat;
1060}
static const WCHAR TimesNewRoman[]
Definition: font.c:35

Referenced by test_getgenerics().

◆ GdipGetHatchBackgroundColor()

GpStatus WINGDIPAPI GdipGetHatchBackgroundColor ( GpHatch brush,
ARGB backcol 
)

Definition at line 961 of file brush.c.

962{
963 TRACE("(%p, %p)\n", brush, backcol);
964
965 if(!brush || !backcol) return InvalidParameter;
966
967 *backcol = brush->backcol;
968
969 return Ok;
970}

◆ GdipGetHatchForegroundColor()

GpStatus WINGDIPAPI GdipGetHatchForegroundColor ( GpHatch brush,
ARGB forecol 
)

Definition at line 972 of file brush.c.

973{
974 TRACE("(%p, %p)\n", brush, forecol);
975
976 if(!brush || !forecol) return InvalidParameter;
977
978 *forecol = brush->forecol;
979
980 return Ok;
981}

◆ GdipGetHatchStyle()

GpStatus WINGDIPAPI GdipGetHatchStyle ( GpHatch brush,
GpHatchStyle hatchstyle 
)

Definition at line 983 of file brush.c.

984{
985 TRACE("(%p, %p)\n", brush, hatchstyle);
986
987 if(!brush || !hatchstyle) return InvalidParameter;
988
989 *hatchstyle = brush->hatchstyle;
990
991 return Ok;
992}

Referenced by test_getHatchStyle().

◆ GdipGetHemfFromMetafile()

GpStatus WINGDIPAPI GdipGetHemfFromMetafile ( GpMetafile metafile,
HENHMETAFILE *  hEmf 
)

Definition at line 1613 of file metafile.c.

1614{
1615 TRACE("(%p,%p)\n", metafile, hEmf);
1616
1617 if (!metafile || !hEmf || !metafile->hemf)
1618 return InvalidParameter;
1619
1620 *hEmf = metafile->hemf;
1621 metafile->hemf = NULL;
1622
1623 return Ok;
1624}

Referenced by sync_metafile(), test_clear(), test_drawimage(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_gditransform(), test_getdc(), and test_properties().

◆ 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) DECLSPEC_HIDDEN
Definition: graphics.c:710
@ ColorAdjustTypeDefault

Referenced by test_getadjustedpalette().

◆ GdipGetImageBounds()

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

Definition at line 2196 of file image.c.

2198{
2199 TRACE("%p %p %p\n", image, srcRect, srcUnit);
2200
2201 if(!image || !srcRect || !srcUnit)
2202 return InvalidParameter;
2203 if(image->type == ImageTypeMetafile){
2204 *srcRect = ((GpMetafile*)image)->bounds;
2205 *srcUnit = ((GpMetafile*)image)->unit;
2206 }
2207 else if(image->type == ImageTypeBitmap){
2208 srcRect->X = srcRect->Y = 0.0;
2209 srcRect->Width = (REAL) ((GpBitmap*)image)->width;
2210 srcRect->Height = (REAL) ((GpBitmap*)image)->height;
2211 *srcUnit = UnitPixel;
2212 }
2213 else{
2214 WARN("GpImage with no image data\n");
2215 return InvalidParameter;
2216 }
2217
2218 TRACE("returning (%f, %f) (%f, %f) unit type %d\n", srcRect->X, srcRect->Y,
2219 srcRect->Width, srcRect->Height, *srcUnit);
2220
2221 return Ok;
2222}
GLeglImageOES image
Definition: gl.h:2204

Referenced by 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 5018 of file image.c.

5019{
5020 int i, decoder_count=0;
5021 TRACE("%u %u %p\n", numDecoders, size, decoders);
5022
5023 if (!decoders ||
5024 size != numDecoders * sizeof(ImageCodecInfo))
5025 return GenericError;
5026
5027 for (i=0; i<NUM_CODECS; i++)
5028 {
5029 if (codecs[i].info.Flags & ImageCodecFlagsDecoder)
5030 {
5031 if (decoder_count == numDecoders) return GenericError;
5032 memcpy(&decoders[decoder_count], &codecs[i].info, sizeof(ImageCodecInfo));
5033 decoder_count++;
5034 }
5035 }
5036
5037 if (decoder_count < numDecoders) return GenericError;
5038
5039 return Ok;
5040}
@ NUM_CODECS
Definition: image.c:4280
static const struct image_codec codecs[NUM_CODECS]
Definition: image.c:4283
@ ImageCodecFlagsDecoder
Definition: gdiplusenums.h:321

Referenced by GdipGetSupportedFileExtensions(), and pBuildFileList().

◆ GdipGetImageDecodersSize()

GpStatus WINGDIPAPI GdipGetImageDecodersSize ( UINT numDecoders,
UINT size 
)

Definition at line 4994 of file image.c.

4995{
4996 int decoder_count=0;
4997 int i;
4998 TRACE("%p %p\n", numDecoders, size);
4999
5000 if (!numDecoders || !size)
5001 return InvalidParameter;
5002
5003 for (i=0; i<NUM_CODECS; i++)
5004 {
5005 if (codecs[i].info.Flags & ImageCodecFlagsDecoder)
5006 decoder_count++;
5007 }
5008
5009 *numDecoders = decoder_count;
5010 *size = decoder_count * sizeof(ImageCodecInfo);
5011
5012 return Ok;
5013}

Referenced by GdipGetSupportedFileExtensions(), and pBuildFileList().

◆ GdipGetImageDimension()

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

Definition at line 2224 of file image.c.

2226{
2227 TRACE("%p %p %p\n", image, width, height);
2228
2229 if(!image || !height || !width)
2230 return InvalidParameter;
2231
2232 if(image->type == ImageTypeMetafile){
2233 *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit, image->yres);
2234 *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit, image->xres);
2235 }
2236 else if(image->type == ImageTypeBitmap){
2237 *height = ((GpBitmap*)image)->height;
2238 *width = ((GpBitmap*)image)->width;
2239 }
2240 else{
2241 WARN("GpImage with no image data\n");
2242 return InvalidParameter;
2243 }
2244
2245 TRACE("returning (%f, %f)\n", *height, *width);
2246 return Ok;
2247}

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

◆ GdipGetImageEncoders()

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

Definition at line 5069 of file image.c.

5070{
5071 int i, encoder_count=0;
5072 TRACE("%u %u %p\n", numEncoders, size, encoders);
5073
5074 if (!encoders ||
5075 size != numEncoders * sizeof(ImageCodecInfo))
5076 return GenericError;
5077
5078 for (i=0; i<NUM_CODECS; i++)
5079 {
5080 if (codecs[i].info.Flags & ImageCodecFlagsEncoder)
5081 {
5082 if (encoder_count == numEncoders) return GenericError;
5083 memcpy(&encoders[encoder_count], &codecs[i].info, sizeof(ImageCodecInfo));
5084 encoder_count++;
5085 }
5086 }
5087
5088 if (encoder_count < numEncoders) return GenericError;
5089
5090 return Ok;
5091}
@ ImageCodecFlagsEncoder
Definition: gdiplusenums.h:320

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 5045 of file image.c.

5046{
5047 int encoder_count=0;
5048 int i;
5049 TRACE("%p %p\n", numEncoders, size);
5050
5051 if (!numEncoders || !size)
5052 return InvalidParameter;
5053
5054 for (i=0; i<NUM_CODECS; i++)
5055 {
5056 if (codecs[i].info.Flags & ImageCodecFlagsEncoder)
5057 encoder_count++;
5058 }
5059
5060 *numEncoders = encoder_count;
5061 *size = encoder_count * sizeof(ImageCodecInfo);
5062
5063 return Ok;
5064}

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 5314 of file image.c.

5315{
5316 TRACE("%p %p\n", image, flags);
5317
5318 if(!image || !flags)
5319 return InvalidParameter;
5320
5321 *flags = image->flags;
5322
5323 return Ok;
5324}

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

◆ GdipGetImageGraphicsContext()

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

Definition at line 2249 of file image.c.

2251{
2252 HDC hdc;
2253 GpStatus stat;
2254
2255 TRACE("%p %p\n", image, graphics);
2256
2257 if(!image || !graphics)
2258 return InvalidParameter;
2259
2260 if (image->type == ImageTypeBitmap && ((GpBitmap*)image)->hbitmap)
2261 {
2262 hdc = ((GpBitmap*)image)->hdc;
2263
2264 if(!hdc){
2267 ((GpBitmap*)image)->hdc = hdc;
2268 }
2269
2270 stat = GdipCreateFromHDC(hdc, graphics);
2271
2272 if (stat == Ok)
2273 {
2274 (*graphics)->image = image;
2275 (*graphics)->xres = image->xres;
2276 (*graphics)->yres = image->yres;
2277 }
2278 }
2279 else if (image->type == ImageTypeMetafile)
2281 else
2282 stat = graphics_from_image(image, graphics);
2283
2284 return stat;
2285}
GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) DECLSPEC_HIDDEN
Definition: graphics.c:2484
GpStatus METAFILE_GetGraphicsContext(GpMetafile *metafile, GpGraphics **result) DECLSPEC_HIDDEN
Definition: metafile.c:908

Referenced by create_graphics(), GdipGetImageThumbnail(), METAFILE_DrawImagePointsRect(), test_clear(), test_clipping(), test_colorkey(), test_colormatrix(), test_containers(), test_converttoemfplus(), test_DrawImage(), test_drawimage(), test_DrawImage_scale(), test_DrawImage_SourceCopy(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_frameunit(), test_fromMemoryBitmap(), test_gamma(), test_GdipDrawImagePointRect(), test_GdipFillRectanglesOnBitmapTextureBrush(), test_GdipGetNearestColor(), test_gditransform(), test_getdc(), test_getdc_scaled(), test_nullframerect(), test_pagetransform(), test_pen_thickness(), test_properties(), test_remaptable(), test_resolution(), and test_worldtransform().

◆ GdipGetImageHeight()

GpStatus WINGDIPAPI GdipGetImageHeight ( GpImage image,
UINT height 
)

Definition at line 2287 of file image.c.

2288{
2289 TRACE("%p %p\n", image, height);
2290
2291 if(!image || !height)
2292 return InvalidParameter;
2293
2294 if(image->type == ImageTypeMetafile)
2295 *height = units_to_pixels(((GpMetafile*)image)->bounds.Height, ((GpMetafile*)image)->unit, image->yres);
2296 else if(image->type == ImageTypeBitmap)
2297 *height = ((GpBitmap*)image)->height;
2298 else
2299 {
2300 WARN("GpImage with no image data\n");
2301 return InvalidParameter;
2302 }
2303
2304 TRACE("returning %d\n", *height);
2305
2306 return Ok;
2307}

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

◆ GdipGetImageHorizontalResolution()

GpStatus WINGDIPAPI GdipGetImageHorizontalResolution ( GpImage image,
REAL res 
)

Definition at line 2309 of file image.c.

2310{
2311 if(!image || !res)
2312 return InvalidParameter;
2313
2314 *res = image->xres;
2315
2316 TRACE("(%p) <-- %0.2f\n", image, *res);
2317
2318 return Ok;
2319}
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 2184 of file image.c.

2185{
2186 static int calls;
2187
2188 TRACE("(%p,%p)\n", image, item);
2189
2190 if (!(calls++))
2191 FIXME("not implemented\n");
2192
2193 return NotImplemented;
2194}

◆ GdipGetImagePalette()

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

Definition at line 4710 of file image.c.

4711{
4712 INT count;
4713
4714 TRACE("(%p,%p,%i)\n", image, palette, size);
4715
4716 if (!image || !palette)
4717 return InvalidParameter;
4718
4719 count = image->palette ? image->palette->Count : 0;
4720
4721 if (size < (sizeof(UINT)*2+sizeof(ARGB)*count))
4722 {
4723 TRACE("<-- InsufficientBuffer\n");
4724 return InsufficientBuffer;
4725 }
4726
4727 if (image->palette)
4728 {
4729 palette->Flags = image->palette->Flags;
4730 palette->Count = image->palette->Count;
4731 memcpy(palette->Entries, image->palette->Entries, sizeof(ARGB)*image->palette->Count);
4732 }
4733 else
4734 {
4735 palette->Flags = 0;
4736 palette->Count = 0;
4737 }
4738 return Ok;
4739}
@ InsufficientBuffer
Definition: gdiplustypes.h:31

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

◆ GdipGetImagePaletteSize()

GpStatus WINGDIPAPI GdipGetImagePaletteSize ( GpImage image,
INT size 
)

Definition at line 2321 of file image.c.

2322{
2323 TRACE("%p %p\n", image, size);
2324
2325 if(!image || !size)
2326 return InvalidParameter;
2327
2328 if (!image->palette || image->palette->Count == 0)
2329 *size = sizeof(ColorPalette);
2330 else
2331 *size = sizeof(UINT)*2 + sizeof(ARGB)*image->palette->Count;
2332
2333 TRACE("<-- %u\n", *size);
2334
2335 return Ok;
2336}

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

◆ GdipGetImagePixelFormat()

GpStatus WINGDIPAPI GdipGetImagePixelFormat ( GpImage image,
PixelFormat format 
)

Definition at line 2339 of file image.c.

2340{
2341 TRACE("%p %p\n", image, format);
2342
2343 if(!image || !format)
2344 return InvalidParameter;
2345
2346 if(image->type != ImageTypeBitmap)
2348 else
2349 *format = ((GpBitmap*) image)->format;
2350
2351 return Ok;
2352}

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

◆ GdipGetImageRawFormat()

GpStatus WINGDIPAPI GdipGetImageRawFormat ( GpImage image,
GUID format 
)

Definition at line 2354 of file image.c.

2355{
2356 TRACE("(%p, %p)\n", image, format);
2357
2358 if(!image || !format)
2359 return InvalidParameter;
2360
2361 memcpy(format, &image->format, sizeof(GUID));
2362
2363 return Ok;
2364}

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 5357 of file image.c.

5360{
5361 GpStatus stat;
5362 GpGraphics *graphics;
5363 UINT srcwidth, srcheight;
5364
5365 TRACE("(%p %u %u %p %p %p)\n",
5366 image, width, height, ret_image, cb, cb_data);
5367
5368 if (!image || !ret_image)
5369 return InvalidParameter;
5370
5371 if (!width) width = 120;
5372 if (!height) height = 120;
5373
5374 GdipGetImageWidth(image, &srcwidth);
5375 GdipGetImageHeight(image, &srcheight);
5376
5378 NULL, (GpBitmap**)ret_image);
5379
5380 if (stat == Ok)
5381 {
5382 stat = GdipGetImageGraphicsContext(*ret_image, &graphics);
5383
5384 if (stat == Ok)
5385 {
5386 stat = GdipDrawImageRectRectI(graphics, image,
5387 0, 0, width, height, 0, 0, srcwidth, srcheight, UnitPixel,
5388 NULL, NULL, NULL);
5389
5390 GdipDeleteGraphics(graphics);
5391 }
5392
5393 if (stat != Ok)
5394 {
5395 GdipDisposeImage(*ret_image);
5396 *ret_image = NULL;
5397 }
5398 }
5399
5400 return stat;
5401}
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:3517
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics)
Definition: image.c:2249
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33

Referenced by test_getthumbnail(), and test_image_format().

◆ GdipGetImageType()

GpStatus WINGDIPAPI GdipGetImageType ( GpImage image,
ImageType type 
)

Definition at line 2366 of file image.c.

2367{
2368 TRACE("%p %p\n", image, type);
2369
2370 if(!image || !type)
2371 return InvalidParameter;
2372
2373 *type = image->type;
2374
2375 return Ok;
2376}

Referenced by load_image(), test_fromhicon(), test_image_properties(), test_png_color_formats(), and test_tiff_color_formats().

◆ GdipGetImageVerticalResolution()

GpStatus WINGDIPAPI GdipGetImageVerticalResolution ( GpImage image,
REAL res 
)

Definition at line 2378 of file image.c.

2379{
2380 if(!image || !res)
2381 return InvalidParameter;
2382
2383 *res = image->yres;
2384
2385 TRACE("(%p) <-- %0.2f\n", image, *res);
2386
2387 return Ok;
2388}

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 2390 of file image.c.

2391{
2392 TRACE("%p %p\n", image, width);
2393
2394 if(!image || !width)
2395 return InvalidParameter;
2396
2397 if(image->type == ImageTypeMetafile)
2398 *width = units_to_pixels(((GpMetafile*)image)->bounds.Width, ((GpMetafile*)image)->unit, image->xres);
2399 else if(image->type == ImageTypeBitmap)
2400 *width = ((GpBitmap*)image)->width;
2401 else
2402 {
2403 WARN("GpImage with no image data\n");
2404 return InvalidParameter;
2405 }
2406
2407 TRACE("returning %d\n", *width);
2408
2409 return Ok;
2410}

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

◆ GdipGetInterpolationMode()

GpStatus WINGDIPAPI GdipGetInterpolationMode ( GpGraphics graphics,
InterpolationMode mode 
)

Definition at line 4882 of file graphics.c.

4884{
4885 TRACE("(%p, %p)\n", graphics, mode);
4886
4887 if(!graphics || !mode)
4888 return InvalidParameter;
4889
4890 if(graphics->busy)
4891 return ObjectBusy;
4892
4893 *mode = graphics->interpolation;
4894
4895 return Ok;
4896}

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 1403 of file brush.c.

1405{
1406 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1407
1408 if (!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient)
1409 return InvalidParameter;
1410
1411 if (count < brush->blendcount)
1412 return InsufficientBuffer;
1413
1414 memcpy(factors, brush->blendfac, brush->blendcount * sizeof(REAL));
1415 memcpy(positions, brush->blendpos, brush->blendcount * sizeof(REAL));
1416
1417 return Ok;
1418}

Referenced by test_lineblend(), and test_linelinearblend().

◆ GdipGetLineBlendCount()

GpStatus WINGDIPAPI GdipGetLineBlendCount ( GpLineGradient brush,
INT count 
)

Definition at line 1420 of file brush.c.

1421{
1422 TRACE("(%p, %p)\n", brush, count);
1423
1424 if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
1425 return InvalidParameter;
1426
1427 *count = brush->blendcount;
1428
1429 return Ok;
1430}

Referenced by test_lineblend(), and test_linelinearblend().

◆ GdipGetLineColors()

GpStatus WINGDIPAPI GdipGetLineColors ( GpLineGradient brush,
ARGB colors 
)

Definition at line 1983 of file brush.c.

1984{
1985 TRACE("(%p, %p)\n", brush, colors);
1986
1987 if(!brush || !colors || brush->brush.bt != BrushTypeLinearGradient)
1988 return InvalidParameter;
1989
1990 colors[0] = brush->startcolor;
1991 colors[1] = brush->endcolor;
1992
1993 return Ok;
1994}

Referenced by test_gradientgetrect().

◆ GdipGetLineGammaCorrection()

GpStatus WINGDIPAPI GdipGetLineGammaCorrection ( GpLineGradient line,
BOOL usinggamma 
)

Definition at line 1030 of file brush.c.

1032{
1033 TRACE("(%p, %p)\n", line, usinggamma);
1034
1035 if(!line || !usinggamma)
1036 return InvalidParameter;
1037
1038 *usinggamma = line->gamma;
1039
1040 return Ok;
1041}

Referenced by test_getgamma().

◆ GdipGetLinePresetBlend()

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

Definition at line 2077 of file brush.c.

2079{
2080 if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient)
2081 return InvalidParameter;
2082
2083 if (brush->pblendcount == 0)
2084 return GenericError;
2085
2086 if (count < brush->pblendcount)
2087 return InsufficientBuffer;
2088
2089 memcpy(blend, brush->pblendcolor, sizeof(ARGB) * brush->pblendcount);
2090 memcpy(positions, brush->pblendpos, sizeof(REAL) * brush->pblendcount);
2091
2092 return Ok;
2093}

Referenced by test_lineblend().

◆ GdipGetLinePresetBlendCount()

GpStatus WINGDIPAPI GdipGetLinePresetBlendCount ( GpLineGradient brush,
INT count 
)

Definition at line 2095 of file brush.c.

2097{
2098 if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
2099 return InvalidParameter;
2100
2101 *count = brush->pblendcount;
2102
2103 return Ok;
2104}

Referenced by test_lineblend().

◆ GdipGetLineRect()

GpStatus WINGDIPAPI GdipGetLineRect ( GpLineGradient brush,
GpRectF rect 
)

Definition at line 2191 of file brush.c.

2192{
2193 TRACE("(%p, %p)\n", brush, rect);
2194
2195 if(!brush || !rect || brush->brush.bt != BrushTypeLinearGradient)
2196 return InvalidParameter;
2197
2198 *rect = brush->rect;
2199
2200 return Ok;
2201}

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

◆ GdipGetLineRectI()

GpStatus WINGDIPAPI GdipGetLineRectI ( GpLineGradient brush,
GpRect rect 
)

Definition at line 2203 of file brush.c.

2204{
2205 GpRectF rectF;
2206 GpStatus ret;
2207
2208 TRACE("(%p, %p)\n", brush, rect);
2209
2210 if(!rect)
2211 return InvalidParameter;
2212
2213 ret = GdipGetLineRect(brush, &rectF);
2214
2215 if(ret == Ok){
2216 rect->X = gdip_round(rectF.X);
2217 rect->Y = gdip_round(rectF.Y);
2218 rect->Width = gdip_round(rectF.Width);
2219 rect->Height = gdip_round(rectF.Height);
2220 }
2221
2222 return ret;
2223}
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
Definition: brush.c:2191

◆ GdipGetLineSpacing()

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

Definition at line 945 of file font.c.

947{
948 TRACE("%p, %d, %p\n", family, style, LineSpacing);
949
950 if (!(family && LineSpacing))
951 return InvalidParameter;
952
953 if (style) FIXME("ignoring style\n");
954
955 *LineSpacing = family->line_spacing;
956 TRACE("%s => %u\n", debugstr_w(family->FamilyName), *LineSpacing);
957
958 return Ok;
959}

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

◆ GdipGetLineTransform()

GpStatus WINGDIPAPI GdipGetLineTransform ( GpLineGradient brush,
GpMatrix matrix 
)

Definition at line 2129 of file brush.c.

2130{
2131 TRACE("(%p,%p)\n", brush, matrix);
2132
2133 if(!brush || !matrix)
2134 return InvalidParameter;
2135
2136 *matrix = brush->transform;
2137
2138 return Ok;
2139}

Referenced by test_gradientgetrect(), and test_transform().

◆ GdipGetLineWrapMode()

GpStatus WINGDIPAPI GdipGetLineWrapMode ( GpLineGradient brush,
GpWrapMode wrapmode 
)

Definition at line 1043 of file brush.c.

1044{
1045 TRACE("(%p, %p)\n", brush, wrapmode);
1046
1047 if(!brush || !wrapmode || brush->brush.bt != BrushTypeLinearGradient)
1048 return InvalidParameter;
1049
1050 *wrapmode = brush->wrap;
1051
1052 return Ok;
1053}

◆ GdipGetLogFontA()

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

Definition at line 432 of file font.c.

434{
436 LOGFONTW lfw;
437
438 TRACE("(%p, %p, %p)\n", font, graphics, lfa);
439
440 status = GdipGetLogFontW(font, graphics, &lfw);
441 if(status != Ok)
442 return status;
443
444 memcpy(lfa, &lfw, FIELD_OFFSET(LOGFONTA,lfFaceName) );
445
447 return GenericError;
448
449 return Ok;
450}
#define WideCharToMultiByte
Definition: compat.h:111
GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
Definition: font.c:455
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 455 of file font.c.

456{
457 REAL angle, rel_height, height;
459 GpPointF pt[3];
460
461 TRACE("(%p, %p, %p)\n", font, graphics, lf);
462
463 if (!font || !graphics || !lf)
464 return InvalidParameter;
465
466 matrix = graphics->worldtrans;
467
468 if (font->unit == UnitPixel || font->unit == UnitWorld)
469 {
470 height = units_to_pixels(font->emSize, graphics->unit, graphics->yres);
471 if (graphics->unit != UnitDisplay)
472 GdipScaleMatrix(&matrix, graphics->scale, graphics->scale, MatrixOrderAppend);
473 }
474 else
475 {
476 if (graphics->unit == UnitDisplay || graphics->unit == UnitPixel)
477 height = units_to_pixels(font->emSize, font->unit, graphics->xres);
478 else
479 height = units_to_pixels(font->emSize, font->unit, graphics->yres);
480 }
481
482 pt[0].X = 0.0;
483 pt[0].Y = 0.0;
484 pt[1].X = 1.0;
485 pt[1].Y = 0.0;
486 pt[2].X = 0.0;
487 pt[2].Y = 1.0;
489 angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X));
490 rel_height = sqrt((pt[2].Y - pt[0].Y) * (pt[2].Y - pt[0].Y)+
491 (pt[2].X - pt[0].X) * (pt[2].X - pt[0].X));
492
493 lf->lfHeight = -gdip_round(height * rel_height);
494 lf->lfWidth = 0;
495 lf->lfEscapement = lf->lfOrientation = gdip_round((angle / M_PI) * 1800.0);
496 if (lf->lfEscapement < 0)
497 {
498 lf->lfEscapement += 3600;
499 lf->lfOrientation += 3600;
500 }
501 lf->lfWeight = font->otm.otmTextMetrics.tmWeight;
502 lf->lfItalic = font->otm.otmTextMetrics.tmItalic ? 1 : 0;
503 lf->lfUnderline = font->otm.otmTextMetrics.tmUnderlined ? 1 : 0;
504 lf->lfStrikeOut = font->otm.otmTextMetrics.tmStruckOut ? 1 : 0;
505 lf->lfCharSet = font->otm.otmTextMetrics.tmCharSet;
509 lf->lfPitchAndFamily = 0;
510 strcpyW(lf->lfFaceName, font->family->FamilyName);
511
512 TRACE("=> %s,%d\n", debugstr_w(lf->lfFaceName), lf->lfHeight);
513
514 return Ok;
515}
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:289
REAL gdiplus_atan2(REAL dy, REAL dx)
Definition: gdiplus.c:304
@ MatrixOrderAppend
Definition: gdiplusenums.h:189
#define strcpyW(d, s)
Definition: unicode.h:29
BYTE lfOutPrecision
Definition: dimm.idl:68
LONG lfOrientation
Definition: dimm.idl:62
LONG lfWidth
Definition: dimm.idl:60
BYTE lfClipPrecision
Definition: dimm.idl:69
LONG lfEscapement
Definition: dimm.idl:61
BYTE lfCharSet
Definition: dimm.idl:67
BYTE lfQuality
Definition: dimm.idl:70
BYTE lfPitchAndFamily
Definition: dimm.idl:71
#define DEFAULT_QUALITY
Definition: wingdi.h:436
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:415
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:426

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

◆ GdipGetMatrixElements()

GpStatus WINGDIPAPI GdipGetMatrixElements ( GDIPCONST GpMatrix matrix,
REAL out 
)

Definition at line 172 of file matrix.c.

174{
175 TRACE("(%p, %p)\n", matrix, out);
176
177 if(!matrix || !out)
178 return InvalidParameter;
179
180 memcpy(out, matrix->matrix, sizeof(matrix->matrix));
181
182 return Ok;
183}
static FILE * out
Definition: regtests2xml.c:44

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

◆ GdipGetMetafileHeaderFromEmf()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf ( HENHMETAFILE  hemf,
MetafileHeader header 
)

Definition at line 3688 of file metafile.c.

3690{
3691 ENHMETAHEADER3 emfheader;
3692 EmfPlusHeader emfplusheader;
3693 MetafileType metafile_type;
3694
3695 TRACE("(%p,%p)\n", hemf, header);
3696
3697 if(!hemf || !header)
3698 return InvalidParameter;
3699
3700 if (GetEnhMetaFileHeader(hemf, sizeof(emfheader), (ENHMETAHEADER*)&emfheader) == 0)
3701 return GenericError;
3702
3703 emfplusheader.Header.Type = 0;
3704
3705 EnumEnhMetaFile(NULL, hemf, get_emfplus_header_proc, &emfplusheader, NULL);
3706
3707 if (emfplusheader.Header.Type == EmfPlusRecordTypeHeader)
3708 {
3709 if ((emfplusheader.Header.Flags & 1) == 1)
3710 metafile_type = MetafileTypeEmfPlusDual;
3711 else
3712 metafile_type = MetafileTypeEmfPlusOnly;
3713 }
3714 else
3715 metafile_type = MetafileTypeEmf;
3716
3717 header->Type = metafile_type;
3718 header->Size = emfheader.nBytes;
3719 header->DpiX = (REAL)emfheader.szlDevice.cx * 25.4 / emfheader.szlMillimeters.cx;
3720 header->DpiY = (REAL)emfheader.szlDevice.cy * 25.4 / emfheader.szlMillimeters.cy;
3721 header->X = gdip_round((REAL)emfheader.rclFrame.left / 2540.0 * header->DpiX);
3722 header->Y = gdip_round((REAL)emfheader.rclFrame.top / 2540.0 * header->DpiY);
3723 header->Width = gdip_round((REAL)(emfheader.rclFrame.right - emfheader.rclFrame.left) / 2540.0 * header->DpiX);
3724 header->Height = gdip_round((REAL)(emfheader.rclFrame.bottom - emfheader.rclFrame.top) / 2540.0 * header->DpiY);
3725 header->u.EmfHeader = emfheader;
3726
3727 if (metafile_type == MetafileTypeEmfPlusDual || metafile_type == MetafileTypeEmfPlusOnly)
3728 {
3729 header->Version = emfplusheader.Version;
3730 header->EmfPlusFlags = emfplusheader.EmfPlusFlags;
3731 header->EmfPlusHeaderSize = emfplusheader.Header.Size;
3732 header->LogicalDpiX = emfplusheader.LogicalDpiX;
3733 header->LogicalDpiY = emfplusheader.LogicalDpiY;
3734 }
3735 else
3736 {
3737 header->Version = emfheader.nVersion;
3738 header->EmfPlusFlags = 0;
3739 header->EmfPlusHeaderSize = 0;
3740 header->LogicalDpiX = 0;
3741 header->LogicalDpiY = 0;
3742 }
3743
3744 return Ok;
3745}
static int CALLBACK get_emfplus_header_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
Definition: metafile.c:3662
@ EmfPlusRecordTypeHeader
Definition: gdiplusenums.h:660
MetafileType
Definition: gdiplusenums.h:215
@ MetafileTypeEmfPlusOnly
Definition: gdiplusenums.h:220
@ MetafileTypeEmfPlusDual
Definition: gdiplusenums.h:221
DWORD Version
Definition: metafile.c:61
EmfPlusRecordHeader Header
Definition: metafile.c:60
DWORD LogicalDpiY
Definition: metafile.c:64
DWORD LogicalDpiX
Definition: metafile.c:63
DWORD EmfPlusFlags
Definition: metafile.c:62
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:2323
SIZEL szlDevice
Definition: wingdi.h:2333
SIZEL szlMillimeters
Definition: wingdi.h:2334
DWORD nVersion
Definition: wingdi.h:2325
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 3764 of file metafile.c.

3766{
3769
3770 TRACE("(%s,%p)\n", debugstr_w(filename), header);
3771
3772 if (!filename || !header)
3773 return InvalidParameter;
3774
3776 if (status == Ok)
3777 {
3779 GdipDisposeImage(&metafile->image);
3780 }
3781 return status;
3782}
GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, GpMetafile **metafile)
Definition: metafile.c:3915
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile *metafile, MetafileHeader *header)
Definition: metafile.c:3632

◆ GdipGetMetafileHeaderFromMetafile()

GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile ( GpMetafile metafile,
MetafileHeader header 
)

Definition at line 3632 of file metafile.c.

3634{
3636
3637 TRACE("(%p, %p)\n", metafile, header);
3638
3639 if(!metafile || !header)
3640 return InvalidParameter;
3641
3642 if (metafile->hemf)
3643 {
3645 if (status != Ok) return status;
3646 }
3647 else
3648 {
3649 memset(header, 0, sizeof(*header));
3650 header->Version = VERSION_MAGIC2;
3651 }
3652
3653 header->Type = metafile->metafile_type;
3654 header->DpiX = metafile->image.xres;
3655 header->DpiY = metafile->image.yres;
3656 header->Width = gdip_round(metafile->bounds.Width);
3657 header->Height = gdip_round(metafile->bounds.Height);
3658
3659 return Ok;
3660}
#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 3784 of file metafile.c.

3786{
3789
3790 TRACE("(%p,%p)\n", stream, header);
3791
3792 if (!stream || !header)
3793 return InvalidParameter;
3794
3796 if (status == Ok)
3797 {
3799 GdipDisposeImage(&metafile->image);
3800 }
3801 return status;
3802}

◆ GdipGetMetafileHeaderFromWmf()

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

Definition at line 3747 of file metafile.c.

3749{
3752
3753 TRACE("(%p,%p,%p)\n", hwmf, placeable, header);
3754
3755 status = GdipCreateMetafileFromWmf(hwmf, FALSE, placeable, &metafile);
3756 if (status == Ok)
3757 {
3759 GdipDisposeImage(&metafile->image);
3760 }
3761 return status;
3762}

◆ GdipGetNearestColor()

GpStatus WINGDIPAPI GdipGetNearestColor ( GpGraphics graphics,
ARGB argb 
)

Definition at line 4899 of file graphics.c.

4900{
4901 FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
4902
4903 if(!graphics || !argb)
4904 return InvalidParameter;
4905
4906 if(graphics->busy)
4907 return ObjectBusy;
4908
4909 return Ok;
4910}

Referenced by test_GdipGetNearestColor(), and test_Get_Release_DC().

◆ GdipGetPageScale()

GpStatus WINGDIPAPI GdipGetPageScale ( GpGraphics graphics,
REAL scale 
)

Definition at line 4912 of file graphics.c.

4913{
4914 TRACE("(%p, %p)\n", graphics, scale);
4915
4916 if(!graphics || !scale)
4917 return InvalidParameter;
4918
4919 if(graphics->busy)
4920 return ObjectBusy;
4921
4922 *scale = graphics->scale;
4923
4924 return Ok;
4925}
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032

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

◆ GdipGetPageUnit()

GpStatus WINGDIPAPI GdipGetPageUnit ( GpGraphics graphics,
GpUnit unit 
)

Definition at line 4927 of file graphics.c.

4928{
4929 TRACE("(%p, %p)\n", graphics, unit);
4930
4931 if(!graphics || !unit)
4932 return InvalidParameter;
4933
4934 if(graphics->busy)
4935 return ObjectBusy;
4936
4937 *unit = graphics->unit;
4938
4939 return Ok;
4940}

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

◆ GdipGetPathData()

GpStatus WINGDIPAPI GdipGetPathData ( GpPath path,
GpPathData pathData 
)

Definition at line 1379 of file graphicspath.c.

1380{
1381 TRACE("(%p, %p)\n", path, pathData);
1382
1383 if(!path || !pathData)
1384 return InvalidParameter;
1385
1386 /* Only copy data. pathData allocation/freeing controlled by wrapper class.
1387 Assumed that pathData is enough wide to get all data - controlled by wrapper too. */
1388 memcpy(pathData->Points, path->pathdata.Points, sizeof(PointF) * pathData->Count);
1389 memcpy(pathData->Types , path->pathdata.Types , pathData->Count);
1390
1391 return Ok;
1392}

Referenced by test_getpathdata().

◆ GdipGetPathFillMode()

GpStatus WINGDIPAPI GdipGetPathFillMode ( GpPath path,
GpFillMode fillmode 
)

Definition at line 1394 of file graphicspath.c.

1395{
1396 TRACE("(%p, %p)\n", path, fillmode);
1397
1398 if(!path || !fillmode)
1399 return InvalidParameter;
1400
1401 *fillmode = path->fill;
1402
1403 return Ok;
1404}

◆ GdipGetPathGradientBlend()

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

Definition at line 1055 of file brush.c.

1057{
1058 TRACE("(%p, %p, %p, %d)\n", brush, blend, positions, count);
1059
1060 if(!brush || !blend || !positions || count <= 0 || brush->brush.bt != BrushTypePathGradient)
1061 return InvalidParameter;
1062
1063 if(count < brush->blendcount)
1064 return InsufficientBuffer;
1065
1066 memcpy(blend, brush->blendfac, count*sizeof(REAL));
1067 if(brush->blendcount > 1){
1068 memcpy(positions, brush->blendpos, count*sizeof(REAL));
1069 }
1070
1071 return Ok;
1072}

Referenced by test_getblend(), and test_pathgradientblend().

◆ GdipGetPathGradientBlendCount()

GpStatus WINGDIPAPI GdipGetPathGradientBlendCount ( GpPathGradient brush,
INT count 
)

Definition at line 1074 of file brush.c.

1075{
1076 TRACE("(%p, %p)\n", brush, count);
1077
1078 if(!brush || !count || brush->brush.bt != BrushTypePathGradient)
1079 return InvalidParameter;
1080
1081 *count = brush->blendcount;
1082
1083 return Ok;
1084}

Referenced by test_gradientblendcount(), and test_pathgradientblend().

◆ GdipGetPathGradientCenterColor()

GpStatus WINGDIPAPI GdipGetPathGradientCenterColor ( GpPathGradient grad,
ARGB colors 
)

Definition at line 1121 of file brush.c.

1123{
1124 TRACE("(%p,%p)\n", grad, colors);
1125
1126 if (!grad || !colors || grad->brush.bt != BrushTypePathGradient)
1127 return InvalidParameter;
1128
1129 *colors = grad->centercolor;
1130
1131 return Ok;
1132}

◆ GdipGetPathGradientCenterPoint()

GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint ( GpPathGradient grad,
GpPointF point 
)

Definition at line 1086 of file brush.c.

1088{
1089 TRACE("(%p, %p)\n", grad, point);
1090
1091 if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
1092 return InvalidParameter;
1093
1094 point->X = grad->center.X;
1095 point->Y = grad->center.Y;
1096
1097 return Ok;
1098}
POINTL point
Definition: edittest.c:50

Referenced by GdipGetPathGradientCenterPointI(), and test_pathgradientcenterpoint().

◆ GdipGetPathGradientCenterPointI()

GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI ( GpPathGradient grad,
GpPoint point 
)

Definition at line 1100 of file brush.c.

1102{
1103 GpStatus ret;
1104 GpPointF ptf;
1105
1106 TRACE("(%p, %p)\n", grad, point);
1107
1108 if(!point)
1109 return InvalidParameter;
1110
1112
1113 if(ret == Ok){
1114 point->X = gdip_round(ptf.X);
1115 point->Y = gdip_round(ptf.Y);
1116 }
1117
1118 return ret;
1119}
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1086

◆ GdipGetPathGradientFocusScales()

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

Definition at line 1134 of file brush.c.

1136{
1137 TRACE("(%p, %p, %p)\n", grad, x, y);
1138
1139 if(!grad || !x || !y || grad->brush.bt != BrushTypePathGradient)
1140 return InvalidParameter;
1141
1142 *x = grad->focus.X;
1143 *y = grad->focus.Y;
1144
1145 return Ok;
1146}

◆ GdipGetPathGradientGammaCorrection()

GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection ( GpPathGradient grad,
BOOL gamma 
)

Definition at line 1148 of file brush.c.

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

◆ GdipGetPathGradientPath()

GpStatus WINGDIPAPI GdipGetPathGradientPath ( GpPathGradient grad,
GpPath path 
)

Definition at line 1161 of file brush.c.

1162{
1163 static int calls;
1164
1165 TRACE("(%p, %p)\n", grad, path);
1166
1167 if (!(calls++))
1168 FIXME("not implemented\n");
1169
1170 return NotImplemented;
1171}

Referenced by test_pathgradientpath().

◆ GdipGetPathGradientPointCount()

GpStatus WINGDIPAPI GdipGetPathGradientPointCount ( GpPathGradient grad,
INT count 
)

Definition at line 1173 of file brush.c.

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

◆ GdipGetPathGradientPresetBlend()

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

Definition at line 1616 of file brush.c.

1618{
1619 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1620
1621 if (count < 0)
1622 return OutOfMemory;
1623
1624 if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient)
1625 return InvalidParameter;
1626
1627 if (brush->pblendcount == 0)
1628 return GenericError;
1629
1630 if (count != brush->pblendcount)
1631 {
1632 /* Native lines up the ends of each array, and copies the destination size. */
1633 FIXME("Braindead behavior on wrong-sized buffer not implemented.\n");
1634 return InvalidParameter;
1635 }
1636
1637 memcpy(blend, brush->pblendcolor, sizeof(ARGB) * brush->pblendcount);
1638 memcpy(pos, brush->pblendpos, sizeof(REAL) * brush->pblendcount);
1639
1640 return Ok;
1641}

Referenced by test_pathgradientpresetblend().

◆ GdipGetPathGradientPresetBlendCount()

GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount ( GpPathGradient brush,
INT count 
)

Definition at line 1643 of file brush.c.

1645{
1646 TRACE("(%p,%p)\n", brush, count);
1647
1648 if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
1649 return InvalidParameter;
1650
1651 *count = brush->pblendcount;
1652
1653 return Ok;
1654}

Referenced by test_pathgradientpresetblend().

◆ GdipGetPathGradientRect()

GpStatus WINGDIPAPI GdipGetPathGradientRect ( GpPathGradient brush,
GpRectF rect 
)

Definition at line 1186 of file brush.c.

1187{
1188 GpStatus stat;
1189
1190 TRACE("(%p, %p)\n", brush, rect);
1191
1192 if(!brush || !rect || brush->brush.bt != BrushTypePathGradient)
1193 return InvalidParameter;
1194
1196
1197 return stat;
1198}
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 1200 of file brush.c.

1201{
1202 GpRectF rectf;
1203 GpStatus stat;
1204
1205 TRACE("(%p, %p)\n", brush, rect);
1206
1207 if(!brush || !rect)
1208 return InvalidParameter;
1209
1210 stat = GdipGetPathGradientRect(brush, &rectf);
1211 if(stat != Ok) return stat;
1212
1213 rect->X = gdip_round(rectf.X);
1214 rect->Y = gdip_round(rectf.Y);
1215 rect->Width = gdip_round(rectf.Width);
1216 rect->Height = gdip_round(rectf.Height);
1217
1218 return Ok;
1219}
GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect)
Definition: brush.c:1186

◆ GdipGetPathGradientSurroundColorCount()

GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount ( GpPathGradient brush,
INT count 
)

Definition at line 1244 of file brush.c.

1245{
1246 TRACE("(%p, %p)\n", brush, count);
1247
1248 if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
1249 return InvalidParameter;
1250
1251 /* Yes, this actually returns the number of points in the path (which is the
1252 * required size of a buffer to get the surround colors), rather than the
1253 * number of surround colors. The real count is returned when getting the
1254 * colors. */
1255 *count = brush->path->pathdata.Count;
1256
1257 return Ok;
1258}

Referenced by test_gradientsurroundcolorcount().

◆ GdipGetPathGradientSurroundColorsWithCount()

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

Definition at line 1221 of file brush.c.

1223{
1224 INT i;
1225
1226 TRACE("(%p,%p,%p)\n", grad, argb, count);
1227
1228 if(!grad || !argb || !count || (*count < grad->path->pathdata.Count) || grad->brush.bt != BrushTypePathGradient)
1229 return InvalidParameter;
1230
1231 for (i=0; i<grad->path->pathdata.Count; i++)
1232 {
1233 if (i < grad->surroundcolorcount)
1234 argb[i] = grad->surroundcolors[i];
1235 else
1236 argb[i] = grad->surroundcolors[grad->surroundcolorcount-1];
1237 }
1238
1239 *count = grad->surroundcolorcount;
1240
1241 return Ok;
1242}

Referenced by test_gradientsurroundcolorcount().

◆ GdipGetPathGradientTransform()

GpStatus WINGDIPAPI GdipGetPathGradientTransform ( GpPathGradient grad,
GpMatrix matrix 
)

Definition at line 1858 of file brush.c.

1860{
1861 TRACE("(%p,%p)\n", grad, matrix);
1862
1863 if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
1864 return InvalidParameter;
1865
1866 *matrix = grad->transform;
1867
1868 return Ok;
1869}

◆ GdipGetPathGradientWrapMode()

GpStatus WINGDIPAPI GdipGetPathGradientWrapMode ( GpPathGradient brush,
GpWrapMode wrapmode 
)

Definition at line 1260 of file brush.c.

1262{
1263 TRACE("(%p, %p)\n", brush, wrapmode);
1264
1265 if(!brush || !wrapmode || brush->brush.bt != BrushTypePathGradient)
1266 return InvalidParameter;
1267
1268 *wrapmode = brush->wrap;
1269
1270 return Ok;
1271}

◆ GdipGetPathLastPoint()

GpStatus WINGDIPAPI GdipGetPathLastPoint ( GpPath path,
GpPointF lastPoint 
)

Definition at line 1406 of file graphicspath.c.

1407{
1408 INT count;
1409
1410 TRACE("(%p, %p)\n", path, lastPoint);
1411
1412 if(!path || !lastPoint)
1413 return InvalidParameter;
1414
1415 count = path->pathdata.Count;
1416 if(count > 0)
1417 *lastPoint = path->pathdata.Points[count-1];
1418
1419 return Ok;
1420}

Referenced by test_lastpoint().

◆ GdipGetPathPoints()

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

Definition at line 1422 of file graphicspath.c.

1423{
1424 TRACE("(%p, %p, %d)\n", path, points, count);
1425
1426 if(!path)
1427 return InvalidParameter;
1428
1429 if(count < path->pathdata.Count)
1430 return InsufficientBuffer;
1431
1432 memcpy(points, path->pathdata.Points, path->pathdata.Count * sizeof(GpPointF));
1433
1434 return Ok;
1435}

Referenced by GdipGetPathPointsI(), and ok_path().

◆ GdipGetPathPointsI()

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

Definition at line 1437 of file graphicspath.c.

1438{
1439 GpStatus ret;
1440 GpPointF *ptf;
1441 INT i;
1442
1443 TRACE("(%p, %p, %d)\n", path, points, count);
1444
1445 if(count <= 0)
1446 return InvalidParameter;
1447
1448 ptf = heap_alloc_zero(sizeof(GpPointF)*count);
1449 if(!ptf) return OutOfMemory;
1450
1452 if(ret == Ok)
1453 for(i = 0;i < count;i++){
1454 points[i].X = gdip_round(ptf[i].X);
1455 points[i].Y = gdip_round(ptf[i].Y);
1456 };
1457 heap_free(ptf);
1458
1459 return ret;
1460}
GpStatus WINGDIPAPI GdipGetPathPoints(GpPath *path, GpPointF *points, INT count)

◆ GdipGetPathTypes()

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

Definition at line 1462 of file graphicspath.c.

1463{
1464 TRACE("(%p, %p, %d)\n", path, types, count);
1465
1466 if(!path)
1467 return InvalidParameter;
1468
1469 if(count < path->pathdata.Count)
1470 return InsufficientBuffer;
1471
1472 memcpy(types, path->pathdata.Types, path->pathdata.Count);
1473
1474 return Ok;
1475}

Referenced by ok_path().

◆ GdipGetPathWorldBounds()

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

Definition at line 1481 of file graphicspath.c.

1483{
1484 GpPointF * points, temp_pts[4];
1485 INT count, i;
1486 REAL path_width = 1.0, width, height, temp, low_x, low_y, high_x, high_y;
1487
1488 TRACE("(%p, %p, %p, %p)\n", path, bounds, matrix, pen);
1489
1490 /* Matrix and pen can be null. */
1491 if(!path || !bounds)
1492 return InvalidParameter;
1493
1494 /* If path is empty just return. */
1495 count = path->pathdata.Count;
1496 if(count == 0){
1497 bounds->X = bounds->Y = bounds->Width = bounds->Height = 0.0;
1498 return Ok;
1499 }
1500
1501 points = path->pathdata.Points;
1502
1503 low_x = high_x = points[0].X;
1504 low_y = high_y = points[0].Y;
1505
1506 for(i = 1; i < count; i++){
1507 low_x = min(low_x, points[i].X);
1508 low_y = min(low_y, points[i].Y);
1509 high_x = max(high_x, points[i].X);
1510 high_y = max(high_y, points[i].Y);
1511 }
1512
1513 width = high_x - low_x;
1514 height = high_y - low_y;
1515
1516 /* This looks unusual but it's the only way I can imitate windows. */
1517 if(matrix){
1518 temp_pts[0].X = low_x;
1519 temp_pts[0].Y = low_y;
1520 temp_pts[1].X = low_x;
1521 temp_pts[1].Y = high_y;
1522 temp_pts[2].X = high_x;
1523 temp_pts[2].Y = high_y;
1524 temp_pts[3].X = high_x;
1525 temp_pts[3].Y = low_y;
1526
1528 low_x = temp_pts[0].X;
1529 low_y = temp_pts[0].Y;
1530
1531 for(i = 1; i < 4; i++){
1532 low_x = min(low_x, temp_pts[i].X);
1533 low_y = min(low_y, temp_pts[i].Y);
1534 }
1535
1536 temp = width;
1537 width = height * fabs(matrix->matrix[2]) + width * fabs(matrix->matrix[0]);
1538 height = height * fabs(matrix->matrix[3]) + temp * fabs(matrix->matrix[1]);
1539 }
1540
1541 if(pen){
1542 path_width = pen->width / 2.0;
1543
1544 if(count > 2)
1545 path_width = max(path_width, pen->width * pen->miterlimit / 2.0);
1546 /* FIXME: this should probably also check for the startcap */
1547 if(pen->endcap & LineCapNoAnchor)
1548 path_width = max(path_width, pen->width * 2.2);
1549
1550 low_x -= path_width;
1551 low_y -= path_width;
1552 width += 2.0 * path_width;
1553 height += 2.0 * path_width;
1554 }
1555
1556 bounds->X = low_x;
1557 bounds->Y = low_y;
1558 bounds->Width = width;
1559 bounds->Height = height;
1560
1561 return Ok;
1562}
@ LineCapNoAnchor
Definition: gdiplusenums.h:66
static calc_node_t temp
Definition: rpn_ieee.c:38

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

◆ GdipGetPathWorldBoundsI()

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

Definition at line 1564 of file graphicspath.c.

1566{
1567 GpStatus ret;
1568 GpRectF boundsF;
1569
1570 TRACE("(%p, %p, %p, %p)\n", path, bounds, matrix, pen);
1571
1572 ret = GdipGetPathWorldBounds(path,&boundsF,matrix,pen);
1573
1574 if(ret == Ok){
1575 bounds->X = gdip_round(boundsF.X);
1576 bounds->Y = gdip_round(boundsF.Y);
1577 bounds->Width = gdip_round(boundsF.Width);
1578 bounds->Height = gdip_round(boundsF.Height);
1579 }
1580
1581 return ret;
1582}

◆ GdipGetPenBrushFill()

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

Definition at line 207 of file pen.c.

208{
209 TRACE("(%p, %p)\n", pen, brush);
210
211 if(!pen || !brush)
212 return InvalidParameter;
213
214 return GdipCloneBrush(pen->brush, brush);
215}

Referenced by test_brushfill().

◆ GdipGetPenColor()

GpStatus WINGDIPAPI GdipGetPenColor ( GpPen pen,
ARGB argb 
)

Definition at line 217 of file pen.c.

218{
219 TRACE("(%p, %p)\n", pen, argb);
220
221 if(!pen || !argb)
222 return InvalidParameter;
223
224 if(pen->brush->bt != BrushTypeSolidColor)
225 return NotImplemented;
226
227 return GdipGetSolidFillColor(((GpSolidFill*)pen->brush), argb);
228}
GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
Definition: brush.c:1273

Referenced by test_brushfill().

◆ GdipGetPenCompoundCount()

GpStatus WINGDIPAPI GdipGetPenCompoundCount ( GpPen pen,
INT count 
)

Definition at line 526 of file pen.c.

527{
528 FIXME("(%p, %p): stub\n", pen, count);
529
530 if (!pen || !count)
531 return InvalidParameter;
532
533 return NotImplemented;
534}

Referenced by test_compoundarray().

◆ GdipGetPenCustomEndCap()

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

Definition at line 230 of file pen.c.

231{
232 TRACE("(%p, %p)\n", pen, customCap);
233
234 if(!pen || !customCap)
235 return InvalidParameter;
236
237 if(!pen->customend){
238 *customCap = NULL;
239 return Ok;
240 }
241
242 return GdipCloneCustomLineCap(pen->customend, customCap);
243}

Referenced by test_customcap().

◆ GdipGetPenCustomStartCap()

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

Definition at line 245 of file pen.c.

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

Referenced by test_customcap().

◆ GdipGetPenDashArray()

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

Definition at line 260 of file pen.c.

261{
262 TRACE("(%p, %p, %d)\n", pen, dash, count);
263
264 if(!pen || !dash || count > pen->numdashes)
265 return InvalidParameter;
266
267 /* note: if you pass a negative value for count, it crashes native gdiplus. */
268 if(count < 0)
269 return GenericError;
270
271 memcpy(dash, pen->dashes, count * sizeof(REAL));
272
273 return Ok;
274}

Referenced by test_dasharray().

◆ GdipGetPenDashCap197819()

GpStatus WINGDIPAPI GdipGetPenDashCap197819 ( GpPen pen,
GpDashCap dashCap 
)

Definition at line 276 of file pen.c.

277{
278 TRACE("(%p, %p)\n", pen, dashCap);
279
280 if(!pen || !dashCap)
281 return InvalidParameter;
282
283 *dashCap = pen->dashcap;
284
285 return Ok;
286}
GpDashCap dashcap

◆ GdipGetPenDashCount()

GpStatus WINGDIPAPI GdipGetPenDashCount ( GpPen pen,
INT count 
)

Definition at line 288 of file pen.c.

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

◆ GdipGetPenDashOffset()

GpStatus WINGDIPAPI GdipGetPenDashOffset ( GpPen pen,
REAL offset 
)

Definition at line 300 of file pen.c.

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

◆ GdipGetPenDashStyle()

GpStatus WINGDIPAPI GdipGetPenDashStyle ( GpPen pen,
GpDashStyle dash 
)

Definition at line 312 of file pen.c.

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

Referenced by test_dasharray().

◆ GdipGetPenEndCap()

GpStatus WINGDIPAPI GdipGetPenEndCap ( GpPen pen,
GpLineCap endCap 
)

Definition at line 324 of file pen.c.

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

◆ GdipGetPenFillType()

GpStatus WINGDIPAPI GdipGetPenFillType ( GpPen pen,
GpPenType type 
)

Definition at line 336 of file pen.c.

337{
338 TRACE("(%p, %p)\n", pen, type);
339
340 if(!pen || !type)
341 return InvalidParameter;
342
343 *type = bt_to_pt(pen->brush->bt);
344
345 return Ok;
346}
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 348 of file pen.c.

349{
350 TRACE("(%p, %p)\n", pen, lineJoin);
351
352 if(!pen || !lineJoin)
353 return InvalidParameter;
354
355 *lineJoin = pen->join;
356
357 return Ok;
358}

◆ GdipGetPenMiterLimit()

GpStatus WINGDIPAPI GdipGetPenMiterLimit ( GpPen pen,
REAL miterLimit 
)

Definition at line 372 of file pen.c.

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

◆ GdipGetPenMode()

GpStatus WINGDIPAPI GdipGetPenMode ( GpPen pen,
GpPenAlignment mode 
)

Definition at line 360 of file pen.c.

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

◆ GdipGetPenStartCap()

GpStatus WINGDIPAPI GdipGetPenStartCap ( GpPen pen,
GpLineCap startCap 
)

Definition at line 384 of file pen.c.

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

◆ GdipGetPenTransform()

GpStatus WINGDIPAPI GdipGetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 449 of file pen.c.

450{
451 TRACE("(%p,%p)\n", pen, matrix);
452
453 if(!pen || !matrix)
454 return InvalidParameter;
455
456 *matrix = pen->transform;
457
458 return Ok;
459}

Referenced by get_pen_transform(), and test_transform().

◆ GdipGetPenUnit()

GpStatus WINGDIPAPI GdipGetPenUnit ( GpPen pen,
GpUnit unit 
)

Definition at line 396 of file pen.c.

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

◆ GdipGetPenWidth()

GpStatus WINGDIPAPI GdipGetPenWidth ( GpPen pen,
REAL width 
)

Definition at line 408 of file pen.c.

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

◆ GdipGetPixelOffsetMode()

GpStatus WINGDIPAPI GdipGetPixelOffsetMode ( GpGraphics graphics,
PixelOffsetMode mode 
)

Definition at line 4943 of file graphics.c.

4945{
4946 TRACE("(%p, %p)\n", graphics, mode);
4947
4948 if(!graphics || !mode)
4949 return InvalidParameter;
4950
4951 if(graphics->busy)
4952 return ObjectBusy;
4953
4954 *mode = graphics->pixeloffset;
4955
4956 return Ok;
4957}

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetPointCount()

GpStatus WINGDIPAPI GdipGetPointCount ( GpPath path,
INT count 
)

Definition at line 1584 of file graphicspath.c.

1585{
1586 TRACE("(%p, %p)\n", path, count);
1587
1588 if(!path)
1589 return InvalidParameter;
1590
1591 *count = path->pathdata.Count;
1592
1593 return Ok;
1594}

Referenced by ok_path(), test_empty_rect(), test_getpathdata(), test_nextmarkerpath(), test_nextsubpathpath(), and test_widen().

◆ GdipGetPropertyCount()

GpStatus WINGDIPAPI GdipGetPropertyCount ( GpImage image,
UINT num 
)

Definition at line 2412 of file image.c.

2413{
2414 TRACE("(%p, %p)\n", image, num);
2415
2416 if (!image || !num) return InvalidParameter;
2417
2418 *num = 0;
2419
2420 if (image->type == ImageTypeBitmap)
2421 {
2422 if (((GpBitmap *)image)->prop_item)
2423 {
2424 *num = ((GpBitmap *)image)->prop_count;
2425 return Ok;
2426 }
2427
2428 if (((GpBitmap *)image)->metadata_reader)
2429 IWICMetadataReader_GetCount(((GpBitmap *)image)->metadata_reader, num);
2430 }
2431
2432 return Ok;
2433}
GLuint GLuint num
Definition: glext.h:9618

Referenced by test_GdipGetAllPropertyItems(), test_gif_properties(), test_image_properties(), and test_tiff_properties().

◆ GdipGetPropertyIdList()

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

Definition at line 2435 of file image.c.

2436{
2437 HRESULT hr;
2439 IWICEnumMetadataItem *enumerator;
2440 UINT prop_count, i, items_returned;
2441
2442 TRACE("(%p, %u, %p)\n", image, num, list);
2443
2444 if (!image || !list) return InvalidParameter;
2445
2446 if (image->type != ImageTypeBitmap)
2447 {
2448 FIXME("Not implemented for type %d\n", image->type);
2449 return NotImplemented;
2450 }
2451
2452 if (((GpBitmap *)image)->prop_item)
2453 {
2454 if (num != ((GpBitmap *)image)->prop_count) return InvalidParameter;
2455
2456 for (i = 0; i < num; i++)
2457 {
2458 list[i] = ((GpBitmap *)image)->prop_item[i].id;
2459 }
2460
2461 return Ok;
2462 }
2463
2464 reader = ((GpBitmap *)image)->metadata_reader;
2465 if (!reader)
2466 {
2467 if (num != 0) return InvalidParameter;
2468 return Ok;
2469 }
2470
2471 hr = IWICMetadataReader_GetCount(reader, &prop_count);
2472 if (FAILED(hr)) return hresult_to_status(hr);
2473
2474 if (num != prop_count) return InvalidParameter;
2475
2476 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2477 if (FAILED(hr)) return hresult_to_status(hr);
2478
2479 IWICEnumMetadataItem_Reset(enumerator);
2480
2481 for (i = 0; i < num; i++)
2482 {
2483 PROPVARIANT id;
2484
2485 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, NULL, &items_returned);
2486 if (hr != S_OK) break;
2487
2488 if (id.vt != VT_UI2)
2489 {
2490 FIXME("not supported propvariant type for id: %u\n", id.vt);
2491 list[i] = 0;
2492 continue;
2493 }
2494 list[i] = id.u.uiVal;
2495 }
2496
2497 IWICEnumMetadataItem_Release(enumerator);
2498
2499 return hr == S_OK ? Ok : hresult_to_status(hr);
2500}

Referenced by test_GdipGetAllPropertyItems(), test_gif_properties(), test_image_properties(), and test_tiff_properties().

◆ GdipGetPropertyItem()

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

Definition at line 2682 of file image.c.

2684{
2685 GpStatus stat;
2686 HRESULT hr;
2688 PROPVARIANT id, value;
2689
2690 TRACE("(%p,%#x,%u,%p)\n", image, propid, size, buffer);
2691
2692 if (!image || !buffer) return InvalidParameter;
2693
2694 if (image->type != ImageTypeBitmap)
2695 {
2696 FIXME("Not implemented for type %d\n", image->type);
2697 return NotImplemented;
2698 }
2699
2700 if (((GpBitmap *)image)->prop_item)
2701 {
2702 UINT i;
2703
2704 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2705 {
2706 if (propid == ((GpBitmap *)image)->prop_item[i].id)
2707 {
2708 if (size != sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length)
2709 return InvalidParameter;
2710
2711 *buffer = ((GpBitmap *)image)->prop_item[i];
2712 buffer->value = buffer + 1;
2713 memcpy(buffer->value, ((GpBitmap *)image)->prop_item[i].value, buffer->length);
2714 return Ok;
2715 }
2716 }
2717
2718 return PropertyNotFound;
2719 }
2720
2721 reader = ((GpBitmap *)image)->metadata_reader;
2722 if (!reader) return PropertyNotFound;
2723
2724 id.vt = VT_UI2;
2725 id.u.uiVal = propid;
2726 hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
2727 if (FAILED(hr)) return PropertyNotFound;
2728
2731
2732 return stat;
2733}
GLuint buffer
Definition: glext.h:5915

Referenced by Anime_LoadInfo(), test_GdipGetAllPropertyItems(), test_gif_properties(), test_image_properties(), and test_tiff_properties().

◆ GdipGetPropertyItemSize()

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

Definition at line 2536 of file image.c.

2537{
2538 HRESULT hr;
2540 PROPVARIANT id, value;
2541
2542 TRACE("(%p,%#x,%p)\n", image, propid, size);
2543
2544 if (!size || !image) return InvalidParameter;
2545
2546 if (image->type != ImageTypeBitmap)
2547 {
2548 FIXME("Not implemented for type %d\n", image->type);
2549 return NotImplemented;
2550 }
2551
2552 if (((GpBitmap *)image)->prop_item)
2553 {
2554 UINT i;
2555
2556 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2557 {
2558 if (propid == ((GpBitmap *)image)->prop_item[i].id)
2559 {
2560 *size = sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length;
2561 return Ok;
2562 }
2563 }
2564
2565 return PropertyNotFound;
2566 }
2567
2568 reader = ((GpBitmap *)image)->metadata_reader;
2569 if (!reader) return PropertyNotFound;
2570
2571 id.vt = VT_UI2;
2572 id.u.uiVal = propid;
2573 hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
2574 if (FAILED(hr)) return PropertyNotFound;
2575
2577 if (*size) *size += sizeof(PropertyItem);
2579
2580 return Ok;
2581}

Referenced by Anime_LoadInfo(), test_GdipGetAllPropertyItems(), test_gif_properties(), test_image_properties(), and test_tiff_properties().

◆ GdipGetPropertySize()

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

Definition at line 2735 of file image.c.

2736{
2737 HRESULT hr;
2739 IWICEnumMetadataItem *enumerator;
2740 UINT prop_count, prop_size, i;
2741 PROPVARIANT id, value;
2742
2743 TRACE("(%p,%p,%p)\n", image, size, count);
2744
2745 if (!image || !size || !count) return InvalidParameter;
2746
2747 if (image->type != ImageTypeBitmap)
2748 {
2749 FIXME("Not implemented for type %d\n", image->type);
2750 return NotImplemented;
2751 }
2752
2753 if (((GpBitmap *)image)->prop_item)
2754 {
2755 *count = ((GpBitmap *)image)->prop_count;
2756 *size = 0;
2757
2758 for (i = 0; i < ((GpBitmap *)image)->prop_count; i++)
2759 {
2760 *size += sizeof(PropertyItem) + ((GpBitmap *)image)->prop_item[i].length;
2761 }
2762
2763 return Ok;
2764 }
2765
2766 reader = ((GpBitmap *)image)->metadata_reader;
2767 if (!reader) return PropertyNotFound;
2768
2769 hr = IWICMetadataReader_GetCount(reader, &prop_count);
2770 if (FAILED(hr)) return hresult_to_status(hr);
2771
2772 hr = IWICMetadataReader_GetEnumerator(reader, &enumerator);
2773 if (FAILED(hr)) return hresult_to_status(hr);
2774
2775 IWICEnumMetadataItem_Reset(enumerator);
2776
2777 prop_size = 0;
2778
2779 PropVariantInit(&id);
2780 PropVariantInit(&value);
2781
2782 for (i = 0; i < prop_count; i++)
2783 {
2784 UINT items_returned, item_size;
2785
2786 hr = IWICEnumMetadataItem_Next(enumerator, 1, NULL, &id, &value, &items_returned);
2787 if (hr != S_OK) break;
2788
2789 item_size = propvariant_size(&value);
2790 if (item_size) prop_size += sizeof(PropertyItem) + item_size;
2791
2792 PropVariantClear(&id);
2794 }
2795
2796 IWICEnumMetadataItem_Release(enumerator);
2797
2798 if (hr != S_OK) return PropertyNotFound;
2799
2800 *count = prop_count;
2801 *size = prop_size;
2802 return Ok;
2803}

Referenced by add_property(), GdipGetAllPropertyItems(), test_GdipGetAllPropertyItems(), and test_gif_properties().

◆ GdipGetRegionBounds()

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

Definition at line 587 of file region.c.

588{
589 HRGN hrgn;
590 RECT r;
592
593 TRACE("(%p, %p, %p)\n", region, graphics, rect);
594
595 if(!region || !graphics || !rect)
596 return InvalidParameter;
597
598 /* Contrary to MSDN, native ignores the graphics transform. */
599 status = GdipGetRegionHRgn(region, NULL, &hrgn);
600 if(status != Ok)
601 return status;
602
603 /* infinite */
604 if(!hrgn){
605 rect->X = rect->Y = -(REAL)(1 << 22);
606 rect->Width = rect->Height = (REAL)(1 << 23);
607 TRACE("%p => infinite\n", region);
608 return Ok;
609 }
610
611 if(GetRgnBox(hrgn, &r)){
612 rect->X = r.left;
613 rect->Y = r.top;
614 rect->Width = r.right - r.left;
615 rect->Height = r.bottom - r.top;
616 TRACE("%p => %s\n", region, debugstr_rectf(rect));
617 }
618 else
620
622
623 return status;
624}
GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn)
Definition: region.c:1194
int WINAPI GetRgnBox(_In_ HRGN, _Out_ LPRECT)

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 629 of file region.c.

630{
631 GpRectF rectf;
633
634 TRACE("(%p, %p, %p)\n", region, graphics, rect);
635
636 if(!rect)
637 return InvalidParameter;
638
639 status = GdipGetRegionBounds(region, graphics, &rectf);
640 if(status == Ok){
641 rect->X = gdip_round(rectf.X);
642 rect->Y = gdip_round(rectf.Y);
643 rect->Width = gdip_round(rectf.Width);
644 rect->Height = gdip_round(rectf.Height);
645 }
646
647 return status;
648}

Referenced by GdipGetClipBoundsI().

◆ GdipGetRegionData()

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

Definition at line 747 of file region.c.

749{
751 UINT required;
752
753 TRACE("%p, %p, %d, %p\n", region, buffer, size, needed);
754
755 if (!region || !buffer || !size)
756 return InvalidParameter;
757
758 required = FIELD_OFFSET(struct region_data_header, header) + write_region_data(region, NULL);
759 if (size < required)
760 {
761 if (needed) *needed = size;
762 return InsufficientBuffer;
763 }
764
768
769 if (needed)
770 *needed = required;
771
772 return Ok;
773}
DWORD write_region_data(const GpRegion *region, void *data)
Definition: region.c:696
DWORD checksum
Definition: region.c:88

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 985 of file region.c.

986{
987 TRACE("%p, %p\n", region, needed);
988
989 if (!(region && needed))
990 return InvalidParameter;
991
992 /* header.size doesn't count header.size and header.checksum */
993 *needed = FIELD_OFFSET(struct region_data_header, header) + write_region_data(region, NULL);
994
995 return Ok;
996}

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 1194 of file region.c.

1195{
1196 TRACE("(%p, %p, %p)\n", region, graphics, hrgn);
1197
1198 if (!region || !hrgn)
1199 return InvalidParameter;
1200
1201 return get_region_hrgn(&region->node, graphics, hrgn);
1202}
static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *graphics, HRGN *hrgn)
Definition: region.c:1062

Referenced by GDI32_GdipFillRegion(), GdipGetRegionBounds(), GdipIsEqualRegion(), GdipIsVisiblePathPoint(), GdipIsVisibleRegionPoint(), GdipIsVisibleRegionRect(), get_clip_hrgn(), get_region_scans_data(), 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 1656 of file region.c.

1657{
1658 GpStatus stat;
1659 DWORD i;
1661 RECT *rects;
1662
1663 if (!region || !count || !matrix)
1664 return InvalidParameter;
1665
1667
1668 if (stat == Ok)
1669 {
1670 *count = data->rdh.nCount;
1671 rects = (RECT*)data->Buffer;
1672
1673 if (scans)
1674 {
1675 for (i=0; i<data->rdh.nCount; i++)
1676 {
1677 scans[i].X = rects[i].left;
1678 scans[i].Y = rects[i].top;
1679 scans[i].Width = rects[i].right - rects[i].left;
1680 scans[i].Height = rects[i].bottom - rects[i].top;
1681 }
1682 }
1683
1684 heap_free(data);
1685 }
1686
1687 return Ok;
1688}
static GpStatus get_region_scans_data(GpRegion *region, GpMatrix *matrix, LPRGNDATA *data)
Definition: region.c:1542

Referenced by test_excludeinfinite(), and test_scans().

◆ GdipGetRegionScansCount()

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

Definition at line 1601 of file region.c.

1602{
1603 GpStatus stat;
1605
1606 TRACE("(%p, %p, %p)\n", region, count, matrix);
1607
1608 if (!region || !count || !matrix)
1609 return InvalidParameter;
1610
1612
1613 if (stat == Ok)
1614 {
1615 *count = data->rdh.nCount;
1616 heap_free(data);
1617 }
1618
1619 return stat;
1620}

Referenced by test_excludeinfinite(), and test_scans().

◆ GdipGetRegionScansI()

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

Definition at line 1622 of file region.c.

1623{
1624 GpStatus stat;
1625 DWORD i;
1627 RECT *rects;
1628
1629 if (!region || !count || !matrix)
1630 return InvalidParameter;
1631
1633
1634 if (stat == Ok)
1635 {
1636 *count = data->rdh.nCount;
1637 rects = (RECT*)data->Buffer;
1638
1639 if (scans)
1640 {
1641 for (i=0; i<data->rdh.nCount; i++)
1642 {
1643 scans[i].X = rects[i].left;
1644 scans[i].Y = rects[i].top;
1645 scans[i].Width = rects[i].right - rects[i].left;
1646 scans[i].Height = rects[i].bottom - rects[i].top;
1647 }
1648 }
1649
1650 heap_free(data);
1651 }
1652
1653 return Ok;
1654}

Referenced by test_scans().

◆ GdipGetRenderingOrigin()

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

Definition at line 6276 of file graphics.c.

6277{
6278 TRACE("(%p,%p,%p)\n", graphics, x, y);
6279
6280 if (!graphics || !x || !y)
6281 return InvalidParameter;
6282
6283 *x = graphics->origin_x;
6284 *y = graphics->origin_y;
6285
6286 return Ok;
6287}

◆ GdipGetSmoothingMode()

GpStatus WINGDIPAPI GdipGetSmoothingMode ( GpGraphics graphics,
SmoothingMode mode 
)

Definition at line 4960 of file graphics.c.

4961{
4962 TRACE("(%p, %p)\n", graphics, mode);
4963
4964 if(!graphics || !mode)
4965 return InvalidParameter;
4966
4967 if(graphics->busy)
4968 return ObjectBusy;
4969
4970 *mode = graphics->smoothing;
4971
4972 return Ok;
4973}
SmoothingMode smoothing

Referenced by test_BeginContainer2(), and test_Get_Release_DC().

◆ GdipGetSolidFillColor()

GpStatus WINGDIPAPI GdipGetSolidFillColor ( GpSolidFill sf,
ARGB argb 
)

Definition at line 1273 of file brush.c.

1274{
1275 TRACE("(%p, %p)\n", sf, argb);
1276
1277 if(!sf || !argb)
1278 return InvalidParameter;
1279
1280 *argb = sf->color;
1281
1282 return Ok;
1283}

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 4975 of file graphics.c.

4976{
4977 TRACE("(%p, %p)\n", graphics, contrast);
4978
4979 if(!graphics || !contrast)
4980 return InvalidParameter;
4981
4982 *contrast = graphics->textcontrast;
4983
4984 return Ok;
4985}

Referenced by test_BeginContainer2(), and test_textcontrast().

◆ GdipGetTextRenderingHint()

GpStatus WINGDIPAPI GdipGetTextRenderingHint ( GpGraphics graphics,
TextRenderingHint hint 
)

Definition at line 4988 of file graphics.c.

4990{
4991 TRACE("(%p, %p)\n", graphics, hint);
4992
4993 if(!graphics || !hint)
4994 return InvalidParameter;
4995
4996 if(graphics->busy)
4997 return ObjectBusy;
4998
4999 *hint = graphics->texthint;
5000
5001 return Ok;
5002}
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 1288 of file brush.c.

1289{
1290 TRACE("(%p, %p)\n", brush, image);
1291
1292 if(!brush || !image)
1293 return InvalidParameter;
1294
1295 return GdipCloneImage(brush->image, image);
1296}
GpImage * image

◆ GdipGetTextureTransform()

GpStatus WINGDIPAPI GdipGetTextureTransform ( GpTexture brush,
GpMatrix matrix 
)

Definition at line 1301 of file brush.c.

1302{
1303 TRACE("(%p, %p)\n", brush, matrix);
1304
1305 if(!brush || !matrix)
1306 return InvalidParameter;
1307
1308 *matrix = brush->transform;
1309
1310 return Ok;
1311}

Referenced by test_transform().

◆ GdipGetTextureWrapMode()

GpStatus WINGDIPAPI GdipGetTextureWrapMode ( GpTexture brush,
GpWrapMode wrapmode 
)

Definition at line 1316 of file brush.c.

1317{
1318 TRACE("(%p, %p)\n", brush, wrapmode);
1319
1320 if(!brush || !wrapmode)
1321 return InvalidParameter;
1322
1323 *wrapmode = brush->imageattributes->wrap;
1324
1325 return Ok;
1326}
GpImageAttributes * imageattributes

Referenced by test_texturewrap().

◆ GdipGetVisibleClipBounds()

GpStatus WINGDIPAPI GdipGetVisibleClipBounds ( GpGraphics graphics,
GpRectF rect 
)

Definition at line 5004 of file graphics.c.

5005{
5006 GpRegion *clip_rgn;
5007 GpStatus stat;
5008 GpMatrix device_to_world;
5009
5010 TRACE("(%p, %p)\n", graphics, rect);
5011
5012 if(!graphics || !rect)
5013 return InvalidParameter;
5014
5015 if(graphics->busy)
5016 return ObjectBusy;
5017
5018 /* intersect window and graphics clipping regions */
5019 if((stat = GdipCreateRegion(&clip_rgn)) != Ok)
5020 return stat;
5021
5022 if((stat = get_visible_clip_region(graphics, clip_rgn)) != Ok)
5023 goto cleanup;
5024
5025 /* transform to world coordinates */
5026 if((stat = get_graphics_transform(graphics, CoordinateSpaceWorld, CoordinateSpaceDevice, &device_to_world)) != Ok)
5027 goto cleanup;
5028
5029 if((stat = GdipTransformRegion(clip_rgn, &device_to_world)) != Ok)
5030 goto cleanup;
5031
5032 /* get bounds of the region */
5033 stat = GdipGetRegionBounds(clip_rgn, graphics, rect);
5034
5035cleanup:
5036 GdipDeleteRegion(clip_rgn);
5037
5038 return stat;
5039}
static GpStatus get_visible_clip_region(GpGraphics *graphics, GpRegion *rgn)
Definition: graphics.c:2276
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 5041 of file graphics.c.

5042{
5043 GpRectF rectf;
5044 GpStatus stat;
5045
5046 TRACE("(%p, %p)\n", graphics, rect);
5047
5048 if(!graphics || !rect)
5049 return InvalidParameter;
5050
5051 if((stat = GdipGetVisibleClipBounds(graphics, &rectf)) == Ok)
5052 {
5053 rect->X = gdip_round(rectf.X);
5054 rect->Y = gdip_round(rectf.Y);
5055 rect->Width = gdip_round(rectf.Width);
5056 rect->Height = gdip_round(rectf.Height);
5057 }
5058
5059 return stat;
5060}
GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect)
Definition: graphics.c:5004

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 5062 of file graphics.c.

5063{
5064 TRACE("(%p, %p)\n", graphics, matrix);
5065
5066 if(!graphics || !matrix)
5067 return InvalidParameter;
5068
5069 if(graphics->busy)
5070 return ObjectBusy;
5071
5072 *matrix = graphics->worldtrans;
5073 return Ok;
5074}

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

◆ GdipGraphicsClear()

GpStatus WINGDIPAPI GdipGraphicsClear ( GpGraphics graphics,
ARGB  color 
)

Definition at line 5076 of file graphics.c.

5077{
5078 GpSolidFill *brush;
5079 GpStatus stat;
5080 GpRectF wnd_rect;
5081
5082 TRACE("(%p, %x)\n", graphics, color);
5083
5084 if(!graphics)
5085 return InvalidParameter;
5086
5087 if(graphics->busy)
5088 return ObjectBusy;
5089
5090 if (graphics->image && graphics->image->type == ImageTypeMetafile)
5091 return METAFILE_GraphicsClear((GpMetafile*)graphics->image, color);
5092
5093 if((stat = GdipCreateSolidFill(color, &brush)) != Ok)
5094 return stat;
5095
5096 if((stat = GdipGetVisibleClipBounds(graphics, &wnd_rect)) != Ok){
5097 GdipDeleteBrush((GpBrush*)brush);
5098 return stat;
5099 }
5100
5101 GdipFillRectangle(graphics, (GpBrush*)brush, wnd_rect.X, wnd_rect.Y,
5102 wnd_rect.Width, wnd_rect.Height);
5103
5104 GdipDeleteBrush((GpBrush*)brush);
5105
5106 return Ok;
5107}
GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4537
GpStatus METAFILE_GraphicsClear(GpMetafile *metafile, ARGB color) DECLSPEC_HIDDEN
Definition: metafile.c:949

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

◆ GdipGraphicsSetAbort()

GpStatus WINGDIPAPI GdipGraphicsSetAbort ( GpGraphics graphics,
GdiplusAbort pabort 
)

Definition at line 7507 of file graphics.c.

7508{
7509 TRACE("(%p, %p)\n", graphics, pabort);
7510
7511 if (!graphics)
7512 return InvalidParameter;
7513
7514 if (pabort)
7515 FIXME("Abort callback is not supported.\n");
7516
7517 return Ok;
7518}

◆ GdipImageForceValidation()

GpStatus WINGDIPAPI GdipImageForceValidation ( GpImage image)

Definition at line 5347 of file image.c.

5348{
5349 TRACE("%p\n", image);
5350
5351 return Ok;
5352}

◆ GdipImageGetFrameCount()

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

Definition at line 2913 of file image.c.

2915{
2916 TRACE("(%p,%s,%p)\n", image, debugstr_guid(dimensionID), count);
2917
2918 if(!image || !count)
2919 return InvalidParameter;
2920
2921 if (!dimensionID ||
2922 IsEqualGUID(dimensionID, &image->format) ||
2923 IsEqualGUID(dimensionID, &FrameDimensionPage) ||
2924 IsEqualGUID(dimensionID, &FrameDimensionTime))
2925 {
2926 *count = image->frame_count;
2927 return Ok;
2928 }
2929
2930 return InvalidParameter;
2931}
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

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

◆ GdipImageGetFrameDimensionsCount()

GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount ( GpImage image,
UINT count 
)

Definition at line 2933 of file image.c.

2935{
2936 TRACE("(%p, %p)\n", image, count);
2937
2938 /* Native gdiplus 1.1 does not yet support multiple frame dimensions. */
2939
2940 if(!image || !count)
2941 return InvalidParameter;
2942
2943 *count = 1;
2944
2945 return Ok;
2946}

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 2948 of file image.c.

2950{
2951 int i;
2952 const GUID *result=NULL;
2953
2954 TRACE("(%p,%p,%u)\n", image, dimensionIDs, count);
2955
2956 if(!image || !dimensionIDs || count != 1)
2957 return InvalidParameter;
2958
2959 for (i=0; image_format_dimensions[i].format; i++)
2960 {
2961 if (IsEqualGUID(&image->format, image_format_dimensions[i].format))
2962 {
2963 result = image_format_dimensions[i].dimension;
2964 break;
2965 }
2966 }
2967
2968 if (!result)
2969 result = &FrameDimensionPage;
2970
2971 memcpy(dimensionIDs, result, sizeof(GUID));
2972
2973 return Ok;
2974}
static const struct image_format_dimension image_format_dimensions[]
Definition: image.c:2906

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 5406 of file image.c.

5407{
5408 GpBitmap *new_bitmap;
5410 int bpp, bytesperpixel;
5411 BOOL rotate_90, flip_x, flip_y;
5412 int src_x_offset, src_y_offset;
5413 LPBYTE src_origin;
5414 UINT x, y, width, height;
5415 BitmapData src_lock, dst_lock;
5416 GpStatus stat;
5417 BOOL unlock;
5418
5419 TRACE("(%p, %u)\n", image, type);
5420
5421 if (!image)
5422 return InvalidParameter;
5423 if (!image_lock(image, &unlock))
5424 return ObjectBusy;
5425
5426 rotate_90 = type&1;
5427 flip_x = (type&6) == 2 || (type&6) == 4;
5428 flip_y = (type&3) == 1 || (type&3) == 2;
5429
5430 if (image->type != ImageTypeBitmap)
5431 {
5432 FIXME("Not implemented for type %i\n", image->type);
5433 image_unlock(image, unlock);
5434 return NotImplemented;
5435 }
5436
5437 bitmap = (GpBitmap*)image;
5438 bpp = PIXELFORMATBPP(bitmap->format);
5439
5440 if (bpp < 8)
5441 {
5442 FIXME("Not implemented for %i bit images\n", bpp);
5443 image_unlock(image, unlock);
5444 return NotImplemented;
5445 }
5446
5447 if (rotate_90)
5448 {
5449 width = bitmap->height;
5450 height = bitmap->width;
5451 }
5452 else
5453 {
5454 width = bitmap->width;
5455 height = bitmap->height;
5456 }
5457
5458 bytesperpixel = bpp/8;
5459
5460 stat = GdipCreateBitmapFromScan0(width, height, 0, bitmap->format, NULL, &new_bitmap);
5461
5462 if (stat != Ok)
5463 {
5464 image_unlock(image, unlock);
5465 return stat;
5466 }
5467
5468 stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, bitmap->format, &src_lock);
5469
5470 if (stat == Ok)
5471 {
5472 stat = GdipBitmapLockBits(new_bitmap, NULL, ImageLockModeWrite, bitmap->format, &dst_lock);
5473
5474 if (stat == Ok)
5475 {
5476 LPBYTE src_row, src_pixel;
5477 LPBYTE dst_row, dst_pixel;
5478
5479 src_origin = src_lock.Scan0;
5480 if (flip_x) src_origin += bytesperpixel * (bitmap->width - 1);
5481 if (flip_y) src_origin += src_lock.Stride * (bitmap->height - 1);
5482
5483 if (rotate_90)
5484 {
5485 if (flip_y) src_x_offset = -src_lock.Stride;
5486 else src_x_offset = src_lock.Stride;
5487 if (flip_x) src_y_offset = -bytesperpixel;
5488 else src_y_offset = bytesperpixel;
5489 }
5490 else
5491 {
5492 if (flip_x) src_x_offset = -bytesperpixel;
5493 else src_x_offset = bytesperpixel;
5494 if (flip_y) src_y_offset = -src_lock.Stride;
5495 else src_y_offset = src_lock.Stride;
5496 }
5497
5498 src_row = src_origin;
5499 dst_row = dst_lock.Scan0;
5500 for (y=0; y<height; y++)
5501 {
5502 src_pixel = src_row;
5503 dst_pixel = dst_row;
5504 for (x=0; x<width; x++)
5505 {
5506 /* FIXME: This could probably be faster without memcpy. */
5507 memcpy(dst_pixel, src_pixel, bytesperpixel);
5508 dst_pixel += bytesperpixel;
5509 src_pixel += src_x_offset;
5510 }
5511 src_row += src_y_offset;
5512 dst_row += dst_lock.Stride;
5513 }
5514
5515 GdipBitmapUnlockBits(new_bitmap, &dst_lock);
5516 }
5517
5518 GdipBitmapUnlockBits(bitmap, &src_lock);
5519 }
5520
5521 if (stat == Ok)
5522 move_bitmap(bitmap, new_bitmap, FALSE);
5523 else
5524 GdipDisposeImage(&new_bitmap->image);
5525
5526 image_unlock(image, unlock);
5527 return stat;
5528}
DWORD bpp
Definition: surface.c:185
static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette)
Definition: image.c:2081

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

◆ GdipImageSelectActiveFrame()

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

Definition at line 4350 of file image.c.

4352{
4353 GpStatus stat;
4354 const struct image_codec *codec = NULL;
4355 BOOL unlock;
4356
4357 TRACE("(%p,%s,%u)\n", image, debugstr_guid(dimensionID), frame);
4358
4359 if (!image || !dimensionID)
4360 return InvalidParameter;
4361 if(!image_lock(image, &unlock))
4362 return ObjectBusy;
4363
4364 if (frame >= image->frame_count)
4365 {
4366 WARN("requested frame %u, but image has only %u\n", frame, image->frame_count);
4367 image_unlock(image, unlock);
4368 return InvalidParameter;
4369 }
4370
4371 if (image->type != ImageTypeBitmap && image->type != ImageTypeMetafile)
4372 {
4373 WARN("invalid image type %d\n", image->type);
4374 image_unlock(image, unlock);
4375 return InvalidParameter;
4376 }
4377
4378 if (image->current_frame == frame)
4379 {
4380 image_unlock(image, unlock);
4381 return Ok;
4382 }
4383
4384 if (!image->decoder)
4385 {
4386 TRACE("image doesn't have an associated decoder\n");
4387 image_unlock(image, unlock);
4388 return Ok;
4389 }
4390
4391 /* choose an appropriate image decoder */
4393 if (stat != Ok)
4394 {
4395 WARN("can't find decoder info\n");
4396 image_unlock(image, unlock);
4397 return stat;
4398 }
4399
4400 stat = codec->select_func(image, frame);
4401 image_unlock(image, unlock);
4402 return stat;
4403}
static GpStatus get_decoder_info_from_image(GpImage *image, const struct image_codec **result)
Definition: image.c:4333
select_image_func select_func
Definition: image.c:4268

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

◆ GdipImageSetAbort()

GpStatus WINGDIPAPI GdipImageSetAbort ( GpImage image,
GdiplusAbort pabort 
)

Definition at line 5533 of file image.c.

5534{
5535 TRACE("(%p, %p)\n", image, pabort);
5536
5537 if (!image)
5538 return InvalidParameter;
5539
5540 if (pabort)
5541 FIXME("Abort callback is not supported.\n");
5542
5543 return Ok;
5544}

◆ GdipInitializePalette()

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

Definition at line 5748 of file image.c.

5750{
5751 TRACE("(%p,%d,%d,%d,%p)\n", palette, type, desired, transparent, bitmap);
5752
5753 if (!palette) return InvalidParameter;
5754
5755 switch (type)
5756 {
5757 case PaletteTypeCustom:
5758 return Ok;
5759
5760 case PaletteTypeOptimal:
5761 return create_optimal_palette(palette, desired, transparent, bitmap);
5762
5763 /* WIC palette type enumeration matches these gdiplus enums */
5764 case PaletteTypeFixedBW:
5772 {
5773 ColorPalette *wic_palette;
5774 GpStatus status = Ok;
5775
5776 wic_palette = get_palette(NULL, type);
5777 if (!wic_palette) return OutOfMemory;
5778
5779 if (palette->Count >= wic_palette->Count)
5780 {
5781 palette->Flags = wic_palette->Flags;
5782 palette->Count = wic_palette->Count;
5783 memcpy(palette->Entries, wic_palette->Entries, wic_palette->Count * sizeof(wic_palette->Entries[0]));
5784 }
5785 else
5787
5788 heap_free(wic_palette);
5789
5790 return status;
5791 }
5792
5793 default:
5794 FIXME("unknown palette type %d\n", type);
5795 break;
5796 }
5797
5798 return InvalidParameter;
5799}
static GpStatus create_optimal_palette(ColorPalette *palette, INT desired, BOOL transparent, GpBitmap *bitmap)
Definition: image.c:5693
static ColorPalette * get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteType palette_type)
Definition: image.c:74
@ PaletteTypeOptimal
@ PaletteTypeCustom
@ PaletteTypeFixedHalftone27
@ PaletteTypeFixedHalftone125
@ PaletteTypeFixedHalftone64
@ PaletteTypeFixedHalftone256
@ PaletteTypeFixedHalftone8
@ PaletteTypeFixedHalftone252
@ PaletteTypeFixedHalftone216
@ PaletteTypeFixedBW
int desired
Definition: jpeglib.h:1119

◆ GdipInvertMatrix()

GpStatus WINGDIPAPI GdipInvertMatrix ( GpMatrix matrix)

Definition at line 185 of file matrix.c.

186{
188 REAL det;
189 BOOL invertible;
190
191 TRACE("(%p)\n", matrix);
192
193 if(!matrix)
194 return InvalidParameter;
195
196 GdipIsMatrixInvertible(matrix, &invertible);
197 if(!invertible)
198 return InvalidParameter;
199
200 /* optimize inverting simple scaling and translation matrices */
201 if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
202 {
203 matrix->matrix[4] = -matrix->matrix[4] / matrix->matrix[0];
204 matrix->matrix[5] = -matrix->matrix[5] / matrix->matrix[3];
205 matrix->matrix[0] = 1 / matrix->matrix[0];
206 matrix->matrix[3] = 1 / matrix->matrix[3];
207
208 return Ok;
209 }
210
211 det = matrix_det(matrix);
212
213 copy = *matrix;
214 /* store result */
215 matrix->matrix[0] = copy.matrix[3] / det;
216 matrix->matrix[1] = -copy.matrix[1] / det;
217 matrix->matrix[2] = -copy.matrix[2] / det;
218 matrix->matrix[3] = copy.matrix[0] / det;
219 matrix->matrix[4] = (copy.matrix[2]*copy.matrix[5]-copy.matrix[3]*copy.matrix[4]) / det;
220 matrix->matrix[5] = -(copy.matrix[0]*copy.matrix[5]-copy.matrix[1]*copy.matrix[4]) / det;
221
222 return Ok;
223}
GpStatus WINGDIPAPI GdipIsMatrixInvertible(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:225
static REAL matrix_det(GDIPCONST GpMatrix *matrix)
Definition: matrix.c:56

Referenced by brush_fill_pixels(), GdipDrawImagePointsRect(), GdipIsOutlineVisiblePathPoint(), get_graphics_transform(), SOFTWARE_GdipDrawPath(), and test_invert().

◆ GdipIsClipEmpty()

GpStatus WINGDIPAPI GdipIsClipEmpty ( GpGraphics graphics,
BOOL res 
)

Definition at line 5109 of file graphics.c.

5110{
5111 TRACE("(%p, %p)\n", graphics, res);
5112
5113 if(!graphics || !res)
5114 return InvalidParameter;
5115
5116 return GdipIsEmptyRegion(graphics->clip, graphics, res);
5117}
GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res)
Definition: region.c:1204

Referenced by test_isempty().

◆ GdipIsEmptyRegion()

GpStatus WINGDIPAPI GdipIsEmptyRegion ( GpRegion region,
GpGraphics graphics,
BOOL res 
)

Definition at line 1204 of file region.c.

1205{
1207 GpRectF rect;
1208
1209 TRACE("(%p, %p, %p)\n", region, graphics, res);
1210
1211 if(!region || !graphics || !res)
1212 return InvalidParameter;
1213
1214 status = GdipGetRegionBounds(region, graphics, &rect);
1215 if (status != Ok) return status;
1216
1217 *res = rect.Width == 0.0 && rect.Height == 0.0;
1218 TRACE("=> %d\n", *res);
1219
1220 return Ok;
1221}

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 1226 of file region.c.

1228{
1229 HRGN hrgn1, hrgn2;
1230 GpStatus stat;
1231
1232 TRACE("(%p, %p, %p, %p)\n", region, region2, graphics, res);
1233
1234 if(!region || !region2 || !graphics || !res)
1235 return InvalidParameter;
1236
1237 stat = GdipGetRegionHRgn(region, graphics, &hrgn1);
1238 if(stat != Ok)
1239 return stat;
1240 stat = GdipGetRegionHRgn(region2, graphics, &hrgn2);
1241 if(stat != Ok){
1242 DeleteObject(hrgn1);
1243 return stat;
1244 }
1245
1246 *res = EqualRgn(hrgn1, hrgn2);
1247
1248 /* one of GpRegions is infinite */
1249 if(*res == ERROR)
1250 *res = (!hrgn1 && !hrgn2);
1251
1252 DeleteObject(hrgn1);
1254
1255 return Ok;
1256}
static HRGN hrgn2
#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 1261 of file region.c.

1262{
1263 /* I think graphics is ignored here */
1264 TRACE("(%p, %p, %p)\n", region, graphics, res);
1265
1266 if(!region || !graphics || !res)
1267 return InvalidParameter;
1268
1269 *res = (region->node.type == RegionDataInfiniteRect);
1270
1271 return Ok;
1272}

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 499 of file matrix.c.

501{
502 TRACE("(%p, %p, %p)\n", matrix, matrix2, result);
503
504 if(!matrix || !matrix2 || !result)
505 return InvalidParameter;
506 /* based on single array member of GpMatrix */
507 *result = (memcmp(matrix->matrix, matrix2->matrix, sizeof(GpMatrix)) == 0);
508
509 return Ok;
510}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by GdipIsMatrixIdentity(), test_invert(), test_shear(), and test_transform().

◆ GdipIsMatrixIdentity()

GpStatus WINGDIPAPI GdipIsMatrixIdentity ( GDIPCONST GpMatrix matrix,
BOOL result 
)

Definition at line 512 of file matrix.c.

513{
514 static const GpMatrix identity =
515 {
516 { 1.0, 0.0,
517 0.0, 1.0,
518 0.0, 0.0 }
519 };
520
521 TRACE("(%p, %p)\n", matrix, result);
522
523 if(!matrix || !result)
524 return InvalidParameter;
525
527}
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result)
Definition: matrix.c:499

Referenced by brush_fill_pixels(), GdipSetClipRect(), GdipSetClipRegion(), get_clip_hrgn(), METAFILE_AddPenObject(), test_gradientgetrect(), test_isidentity(), test_transform(), and test_worldtransform().

◆ GdipIsMatrixInvertible()

GpStatus WINGDIPAPI GdipIsMatrixInvertible ( GDIPCONST GpMatrix matrix,
BOOL result 
)

Definition at line 225 of file matrix.c.

226{
227 TRACE("(%p, %p)\n", matrix, result);
228
229 if(!matrix || !result)
230 return InvalidParameter;
231
232 if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
233 *result = matrix->matrix[0] != 0 && matrix->matrix[3] != 0;
234 else
235 *result = (fabs(matrix_det(matrix)) >= 1e-5);
236
237 return Ok;
238}

Referenced by GdipInvertMatrix(), and test_isinvertible().

◆ GdipIsOutlineVisiblePathPoint()

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPoint ( GpPath path,
REAL  x,
REAL  y,
GpPen pen,
GpGraphics graphics,
BOOL result 
)

Definition at line 1660 of file graphicspath.c.

1662{
1663 GpStatus stat;
1664 GpPath *wide_path;
1666
1667 TRACE("(%p,%0.2f,%0.2f,%p,%p,%p)\n", path, x, y, pen, graphics, result);
1668
1669 if(!path || !pen)
1670 return InvalidParameter;
1671
1672 stat = GdipClonePath(path, &wide_path);
1673
1674 if (stat != Ok)
1675 return stat;
1676
1677 if (pen->unit == UnitPixel && graphics != NULL)
1678 {
1680
1681 if (stat == Ok)
1684 }
1685
1686 if (stat == Ok)
1687 stat = GdipWidenPath(wide_path, pen, transform, 1.0);
1688
1689 if (pen->unit == UnitPixel && graphics != NULL)
1690 {
1691 if (stat == Ok)
1693
1694 if (stat == Ok)
1695 stat = GdipTransformPath(wide_path, transform);
1696 }
1697
1698 if (stat == Ok)
1699 stat = GdipIsVisiblePathPoint(wide_path, x, y, graphics, result);
1700
1702
1703 GdipDeletePath(wide_path);
1704
1705 return stat;
1706}
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) DECLSPEC_HIDDEN
Definition: graphics.c:6871

Referenced by GdipIsOutlineVisiblePathPointI().

◆ GdipIsOutlineVisiblePathPointI()

GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI ( GpPath path,
INT  x,
INT  y,
GpPen pen,
GpGraphics graphics,
BOOL result 
)

Definition at line 1652 of file graphicspath.c.

1654{
1655 TRACE("(%p, %d, %d, %p, %p, %p)\n", path, x, y, pen, graphics, result);
1656
1657 return GdipIsOutlineVisiblePathPoint(path, x, y, pen, graphics, result);
1658}
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 976 of file font.c.

978{
979 HDC hdc;
980
981 TRACE("%p %d %p\n", family, style, IsStyleAvailable);
982
983 if (!(family && IsStyleAvailable))
984 return InvalidParameter;
985
986 *IsStyleAvailable = FALSE;
987
989
990 if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
991 *IsStyleAvailable = TRUE;
992
993 DeleteDC(hdc);
994
995 return Ok;
996}
static INT CALLBACK font_has_style_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:961
LONG_PTR LPARAM
Definition: windef.h:208
int WINAPI EnumFontFamiliesW(_In_ HDC, _In_opt_ LPCWSTR, _In_ FONTENUMPROCW, _In_ LPARAM)

◆ GdipIsVisibleClipEmpty()

GpStatus WINGDIPAPI GdipIsVisibleClipEmpty ( GpGraphics graphics,
BOOL res 
)

Definition at line 7475 of file graphics.c.

7476{
7477 GpStatus stat;
7478 GpRegion* rgn;
7479
7480 TRACE("(%p, %p)\n", graphics, res);
7481
7482 if((stat = GdipCreateRegion(&rgn)) != Ok)
7483 return stat;
7484
7485 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
7486 goto cleanup;
7487
7488 stat = GdipIsEmptyRegion(rgn, graphics, res);
7489
7490cleanup:
7491 GdipDeleteRegion(rgn);
7492 return stat;
7493}

◆ GdipIsVisiblePathPoint()

GpStatus WINGDIPAPI GdipIsVisiblePathPoint ( GpPath path,
REAL  x,
REAL  y,
GpGraphics graphics,
BOOL result 
)

Definition at line 1718 of file graphicspath.c.

1719{
1720 GpRegion *region;
1721 HRGN hrgn;
1723
1724 if(!path || !result) return InvalidParameter;
1725
1726 status = GdipCreateRegionPath(path, &region);
1727 if(status != Ok)
1728 return status;
1729
1730 status = GdipGetRegionHRgn(region, graphics, &hrgn);
1731 if(status != Ok){
1732 GdipDeleteRegion(region);
1733 return status;
1734 }
1735
1737
1739 GdipDeleteRegion(region);
1740
1741 return Ok;
1742}
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 1708 of file graphicspath.c.

1709{
1710 TRACE("(%p, %d, %d, %p, %p)\n", path, x, y, graphics, result);
1711
1712 return GdipIsVisiblePathPoint(path, x, y, graphics, result);
1713}

◆ GdipIsVisiblePoint()

GpStatus WINGDIPAPI GdipIsVisiblePoint ( GpGraphics graphics,
REAL  x,
REAL  y,
BOOL result 
)

Definition at line 5119 of file graphics.c.

5120{
5121 GpStatus stat;
5122 GpRegion* rgn;
5123 GpPointF pt;
5124
5125 TRACE("(%p, %.2f, %.2f, %p)\n", graphics, x, y, result);
5126
5127 if(!graphics || !result)
5128 return InvalidParameter;
5129
5130 if(graphics->busy)
5131 return ObjectBusy;
5132
5133 pt.X = x;
5134 pt.Y = y;
5136 CoordinateSpaceWorld, &pt, 1)) != Ok)
5137 return stat;
5138
5139 if((stat = GdipCreateRegion(&rgn)) != Ok)
5140 return stat;
5141
5142 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
5143 goto cleanup;
5144
5145 stat = GdipIsVisibleRegionPoint(rgn, pt.X, pt.Y, graphics, result);
5146
5147cleanup:
5148 GdipDeleteRegion(rgn);
5149 return stat;
5150}
GpStatus WINGDIPAPI GdipIsVisibleRegionPoint(GpRegion *region, REAL x, REAL y, GpGraphics *graphics, BOOL *res)
Definition: region.c:1320

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 5152 of file graphics.c.

5153{
5154 return GdipIsVisiblePoint(graphics, (REAL)x, (REAL)y, result);
5155}
GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics *graphics, REAL x, REAL y, BOOL *result)
Definition: graphics.c:5119

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 5157 of file graphics.c.

5158{
5159 GpStatus stat;
5160 GpRegion* rgn;
5161 GpPointF pts[2];
5162
5163 TRACE("(%p %.2f %.2f %.2f %.2f %p)\n", graphics, x, y, width, height, result);
5164
5165 if(!graphics || !result)
5166 return InvalidParameter;
5167
5168 if(graphics->busy)
5169 return ObjectBusy;
5170
5171 pts[0].X = x;
5172 pts[0].Y = y;
5173 pts[1].X = x + width;
5174 pts[1].Y = y + height;
5175
5177 CoordinateSpaceWorld, pts, 2)) != Ok)
5178 return stat;
5179
5180 pts[1].X -= pts[0].X;
5181 pts[1].Y -= pts[0].Y;
5182
5183 if((stat = GdipCreateRegion(&rgn)) != Ok)
5184 return stat;
5185
5186 if((stat = get_visible_clip_region(graphics, rgn)) != Ok)
5187 goto cleanup;
5188
5189 stat = GdipIsVisibleRegionRect(rgn, pts[0].X, pts[0].Y, pts[1].X, pts[1].Y, graphics, result);
5190
5191cleanup:
5192 GdipDeleteRegion(rgn);
5193 return stat;
5194}
GpStatus WINGDIPAPI GdipIsVisibleRegionRect(GpRegion *region, REAL x, REAL y, REAL w, REAL h, GpGraphics *graphics, BOOL *res)
Definition: region.c:1277

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 5196 of file graphics.c.

5197{
5198 return GdipIsVisibleRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, result);
5199}
GpStatus WINGDIPAPI GdipIsVisibleRect(GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, BOOL *result)
Definition: graphics.c:5157

Referenced by test_GdipIsVisibleRect().

◆ GdipIsVisibleRegionPoint()

GpStatus WINGDIPAPI GdipIsVisibleRegionPoint ( GpRegion region,
REAL  x,
REAL  y,
GpGraphics graphics,
BOOL res 
)

Definition at line 1320 of file region.c.

1321{
1322 HRGN hrgn;
1323 GpStatus stat;
1324
1325 TRACE("(%p, %.2f, %.2f, %p, %p)\n", region, x, y, graphics, res);
1326
1327 if(!region || !res)
1328 return InvalidParameter;
1329
1330 if((stat = GdipGetRegionHRgn(region, NULL, &hrgn)) != Ok)
1331 return stat;
1332
1333 /* infinite */
1334 if(!hrgn){
1335 *res = TRUE;
1336 return Ok;
1337 }
1338
1340
1342
1343 return Ok;
1344}

Referenced by GdipIsVisiblePoint(), GdipIsVisibleRegionPointI(), and test_isvisiblepoint().

◆ GdipIsVisibleRegionPointI()

GpStatus WINGDIPAPI GdipIsVisibleRegionPointI ( GpRegion region,
INT  x,
INT  y,
GpGraphics graphics,
BOOL res 
)

Definition at line 1349 of file region.c.

1350{
1351 TRACE("(%p, %d, %d, %p, %p)\n", region, x, y, graphics, res);
1352
1353 return GdipIsVisibleRegionPoint(region, (REAL)x, (REAL)y, graphics, res);
1354}

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 1277 of file region.c.

1278{
1279 HRGN hrgn;
1280 GpStatus stat;
1281 RECT rect;
1282
1283 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %p, %p)\n", region, x, y, w, h, graphics, res);
1284
1285 if(!region || !res)
1286 return InvalidParameter;
1287
1288 if((stat = GdipGetRegionHRgn(region, NULL, &hrgn)) != Ok)
1289 return stat;
1290
1291 /* infinite */
1292 if(!hrgn){
1293 *res = TRUE;
1294 return Ok;
1295 }
1296
1297 SetRect(&rect, ceilr(x), ceilr(y), ceilr(x + w), ceilr(y + h));
1298 *res = RectInRegion(hrgn, &rect);
1299
1301
1302 return Ok;
1303}
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 1308 of file region.c.

1309{
1310 TRACE("(%p, %d, %d, %d, %d, %p, %p)\n", region, x, y, w, h, graphics, res);
1311 if(!region || !res)
1312 return InvalidParameter;
1313
1314 return GdipIsVisibleRegionRect(region, (REAL)x, (REAL)y, (REAL)w, (REAL)h, graphics, res);
1315}

Referenced by test_isvisiblerect().

◆ GdipLoadImageFromFile()

GpStatus WINGDIPAPI GdipLoadImageFromFile ( GDIPCONST WCHAR filename,
GpImage **  image 
)

Definition at line 2976 of file image.c.

2978{
2979 GpStatus stat;
2980 IStream *stream;
2981
2982 TRACE("(%s) %p\n", debugstr_w(filename), image);
2983
2984 if (!filename || !image)
2985 return InvalidParameter;
2986
2987 *image = NULL;
2988
2990
2991 if (stat != Ok)
2992 return stat;
2993
2995
2996 IStream_Release(stream);
2997
2998 return stat;
2999}

Referenced by GdipLoadImageFromFileICM(), SetWallpaper(), test_LoadingImages(), and test_SavingImages().

◆ GdipLoadImageFromFileICM()

GpStatus WINGDIPAPI GdipLoadImageFromFileICM ( GDIPCONST WCHAR filename,
GpImage **  image 
)

Definition at line 3002 of file image.c.

3003{
3004 TRACE("(%s) %p\n", debugstr_w(filename), image);
3005
3007}
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
Definition: image.c:2976

Referenced by test_LoadingImages().

◆ GdipLoadImageFromStream()

GpStatus WINGDIPAPI GdipLoadImageFromStream ( IStream stream,
GpImage **  image 
)

Definition at line 4405 of file image.c.

4406{
4407 GpStatus stat;
4409 HRESULT hr;
4410 const struct image_codec *codec=NULL;
4411
4412 TRACE("%p %p\n", stream, image);
4413
4414 if (!stream || !image)
4415 return InvalidParameter;
4416
4417 /* choose an appropriate image decoder */
4418 stat = get_decoder_info(stream, &codec);
4419 if (stat != Ok) return stat;
4420
4421 /* seek to the start of the stream */
4422 seek.QuadPart = 0;
4423 hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, NULL);
4424 if (FAILED(hr)) return hresult_to_status(hr);
4425
4426 /* call on the image decoder to do the real work */
4427 stat = codec->decode_func(stream, image);
4428
4429 /* take note of the original data format */
4430 if (stat == Ok)
4431 {
4432 memcpy(&(*image)->format, &codec->info.FormatID, sizeof(GUID));
4433 return Ok;
4434 }
4435
4436 return stat;
4437}
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
Definition: image.c:4285
int seek(void *fd, ulong off, int mode)
Definition: pe.c:51
decode_image_func decode_func
Definition: image.c:4267
ImageCodecInfo info
Definition: image.c:4265

Referenced by GdipCreateBitmapFromStream(), GdipCreateMetafileFromStream(), GdipLoadImageFromFile(), GdipLoadImageFromStreamICM(), load_image(), Preview_pLoadImage(), test_bufferrawformat(), test_GdipLoadImageFromStream(), and test_loadwmf().

◆ GdipLoadImageFromStreamICM()

GpStatus WINGDIPAPI GdipLoadImageFromStreamICM ( IStream stream,
GpImage **  image 
)

Definition at line 4440 of file image.c.

4441{
4442 TRACE("%p %p\n", stream, image);
4443
4445}

◆ GdiplusNotificationHook()

GpStatus WINAPI GdiplusNotificationHook ( ULONG_PTR token)

Definition at line 110 of file gdiplus.c.

111{
112 FIXME("%p\n", token);
113 return NotificationHook(token);
114}
static Status WINAPI NotificationHook(ULONG_PTR *token)
Definition: gdiplus.c:41
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 116 of file gdiplus.c.

117{
118 FIXME("%ld\n", token);
120}
static void WINAPI NotificationUnhook(ULONG_PTR token)
Definition: gdiplus.c:50

◆ 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 5423 of file graphics.c.

5427{
5428 GpStatus stat;
5429 int i;
5430 HFONT gdifont, oldfont;
5432 HDC hdc, temp_hdc=NULL;
5433 GpPointF pt[3];
5434 RectF scaled_rect;
5435 REAL margin_x;
5436
5437 TRACE("(%p %s %d %p %s %p %d %p)\n", graphics, debugstr_wn(string, length),
5438 length, font, debugstr_rectf(layoutRect), stringFormat, regionCount, regions);
5439
5440 if (!(graphics && string && font && layoutRect && stringFormat && regions))
5441 return InvalidParameter;
5442
5443 if (regionCount < stringFormat->range_count)
5444 return InvalidParameter;
5445
5446 if(!graphics->hdc)
5447 {
5448 hdc = temp_hdc = CreateCompatibleDC(0);
5449 if (!temp_hdc) return OutOfMemory;
5450 }
5451 else
5452 hdc = graphics->hdc;
5453
5454 if (stringFormat->attr)
5455 TRACE("may be ignoring some format flags: attr %x\n", stringFormat->attr);
5456
5457 pt[0].X = 0.0;
5458 pt[0].Y = 0.0;
5459 pt[1].X = 1.0;
5460 pt[1].Y = 0.0;
5461 pt[2].X = 0.0;
5462 pt[2].Y = 1.0;
5464 args.rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+
5465 (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X));
5466 args.rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+
5467 (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X));
5468
5469 margin_x = stringFormat->generic_typographic ? 0.0 : font->emSize / 6.0;
5470 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres);
5471
5472 scaled_rect.X = (layoutRect->X + margin_x) * args.rel_width;
5473 scaled_rect.Y = layoutRect->Y * args.rel_height;
5474 scaled_rect.Width = layoutRect->Width * args.rel_width;
5475 scaled_rect.Height = layoutRect->Height * args.rel_height;
5476
5477 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
5478 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
5479
5480 get_font_hfont(graphics, font, stringFormat, &gdifont, NULL);
5481 oldfont = SelectObject(hdc, gdifont);
5482
5483 for (i=0; i<stringFormat->range_count; i++)
5484 {
5486 if (stat != Ok)
5487 return stat;
5488 }
5489
5490 args.regions = regions;
5491
5492 gdi_transform_acquire(graphics);
5493
5494 stat = gdip_format_string(hdc, string, length, font, &scaled_rect, stringFormat,
5496
5497 gdi_transform_release(graphics);
5498
5499 SelectObject(hdc, oldfont);
5500 DeleteObject(gdifont);
5501
5502 if (temp_hdc)
5503 DeleteDC(temp_hdc);
5504
5505 return stat;
5506}
static const WCHAR stringFormat[]
Definition: wordpad.c:55
static GpStatus measure_ranges_callback(HDC hdc, GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, INT lineno, const RectF *bounds, INT *underlined_indexes, INT underlined_index_count, void *user_data)
Definition: graphics.c:5384
GpRegion ** regions
Definition: graphics.c:5380

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 7059 of file graphics.c.

7062{
7063 static const INT unsupported_flags = ~(DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance);
7064 HFONT hfont;
7065 HDC hdc;
7066 REAL min_x, min_y, max_x, max_y, x, y;
7067 int i;
7068 TEXTMETRICW textmetric;
7069 const WORD *glyph_indices;
7070 WORD *dynamic_glyph_indices=NULL;
7071 REAL rel_width, rel_height, ascent, descent;
7072 GpPointF pt[3];
7073
7074 TRACE("(%p %p %d %p %p %d %p %p)\n", graphics, text, length, font, positions, flags, matrix, boundingBox);
7075
7076 if (!graphics || !text || !font || !positions || !boundingBox)
7077 return InvalidParameter;
7078
7079 if (length == -1)
7080 length = strlenW(text);
7081
7082 if (length == 0)
7083 {
7084 boundingBox->X = 0.0;
7085 boundingBox->Y = 0.0;
7086 boundingBox->Width = 0.0;
7087 boundingBox->Height = 0.0;
7088 }
7089
7090 if (flags & unsupported_flags)
7091 FIXME("Ignoring flags %x\n", flags & unsupported_flags);
7092
7093 get_font_hfont(graphics, font, NULL, &hfont, matrix);
7094
7097
7098 GetTextMetricsW(hdc, &textmetric);
7099
7100 pt[0].X = 0.0;
7101 pt[0].Y = 0.0;
7102 pt[1].X = 1.0;
7103 pt[1].Y = 0.0;
7104 pt[2].X = 0.0;
7105 pt[2].Y = 1.0;
7106 if (matrix)
7107 {
7108 GpMatrix xform = *matrix;
7109 GdipTransformMatrixPoints(&xform, pt, 3);
7110 }
7112 rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+
7113 (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X));
7114 rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+
7115 (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X));
7116
7118 {
7119 glyph_indices = dynamic_glyph_indices = heap_alloc_zero(sizeof(WORD) * length);
7120 if (!glyph_indices)
7121 {
7122 DeleteDC(hdc);
7124 return OutOfMemory;
7125 }
7126
7127 GetGlyphIndicesW(hdc, text, length, dynamic_glyph_indices, 0);
7128 }
7129 else
7130 glyph_indices = text;
7131
7132 min_x = max_x = x = positions[0].X;
7133 min_y = max_y = y = positions[0].Y;
7134
7135 ascent = textmetric.tmAscent / rel_height;
7136 descent = textmetric.tmDescent / rel_height;
7137
7138 for (i=0; i<length; i++)
7139 {
7140 int char_width;
7141 ABC abc;
7142
7144 {
7145 x = positions[i].X;
7146 y = positions[i].Y;
7147 }
7148
7149 GetCharABCWidthsW(hdc, glyph_indices[i], glyph_indices[i], &abc);
7150 char_width = abc.abcA + abc.abcB + abc.abcC;
7151
7152 if (min_y > y - ascent) min_y = y - ascent;
7153 if (max_y < y + descent) max_y = y + descent;
7154 if (min_x > x) min_x = x;
7155
7156 x += char_width / rel_width;
7157
7158 if (max_x < x) max_x = x;
7159 }
7160
7161 heap_free(dynamic_glyph_indices);
7162 DeleteDC(hdc);
7164
7165 boundingBox->X = min_x;
7166 boundingBox->Y = min_y;
7167 boundingBox->Width = max_x - min_x;
7168 boundingBox->Height = max_y - min_y;
7169
7170 return Ok;
7171}
unsigned short WORD
Definition: ntddk_ex.h:93
@ DriverStringOptionsRealizedAdvance
Definition: gdiplusenums.h:49
@ DriverStringOptionsCmapLookup
Definition: gdiplusenums.h:47
static UINT UINT LPWORD LPABC abc
Definition: font.c:44
#define strlenW(s)
Definition: unicode.h:28
Definition: wingdi.h:1410
int abcA
Definition: wingdi.h:1411
UINT abcB
Definition: wingdi.h:1412
int abcC
Definition: wingdi.h:1413
LONG tmDescent
Definition: wingdi.h:2385
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 5546 of file graphics.c.

5550{
5551 HFONT oldfont, gdifont;
5553 HDC temp_hdc=NULL, hdc;
5554 GpPointF pt[3];
5555 RectF scaled_rect;
5556 REAL margin_x;
5557 INT lines, glyphs;
5558
5559 TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics,
5562
5563 if(!graphics || !string || !font || !rect || !bounds)
5564 return InvalidParameter;
5565
5566 if(!graphics->hdc)
5567 {
5568 hdc = temp_hdc = CreateCompatibleDC(0);
5569 if (!temp_hdc) return OutOfMemory;
5570 }
5571 else
5572 hdc = graphics->hdc;
5573
5574 if(linesfilled) *linesfilled = 0;
5576
5577 if(format)
5578 TRACE("may be ignoring some format flags: attr %x\n", format->attr);
5579
5580 pt[0].X = 0.0;
5581 pt[0].Y = 0.0;
5582 pt[1].X = 1.0;
5583 pt[1].Y = 0.0;
5584 pt[2].X = 0.0;
5585 pt[2].Y = 1.0;
5587 args.rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+
5588 (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X));
5589 args.rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+
5590 (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X));
5591
5592 margin_x = (format && format->generic_typographic) ? 0.0 : font->emSize / 6.0;
5593 margin_x *= units_scale(font->unit, graphics->unit, graphics->xres);
5594
5595 scaled_rect.X = (rect->X + margin_x) * args.rel_width;
5596 scaled_rect.Y = rect->Y * args.rel_height;
5597 scaled_rect.Width = rect->Width * args.rel_width;
5598 scaled_rect.Height = rect->Height * args.rel_height;
5599 if (scaled_rect.Width >= 0.5)
5600 {
5601 scaled_rect.Width -= margin_x * 2.0 * args.rel_width;
5602 if (scaled_rect.Width < 0.5) return Ok; /* doesn't fit */
5603 }
5604
5605 if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
5606 if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
5607
5608 get_font_hfont(graphics, font, format, &gdifont, NULL);
5609 oldfont = SelectObject(hdc, gdifont);
5610
5611 bounds->X = rect->X;
5612 bounds->Y = rect->Y;
5613 bounds->Width = 0.0;
5614 bounds->Height = 0.0;
5615
5616 args.bounds = bounds;
5617 args.codepointsfitted = &glyphs;
5618 args.linesfilled = &lines;
5619 lines = glyphs = 0;
5620
5621 gdi_transform_acquire(graphics);
5622
5623 gdip_format_string(hdc, string, length, font, &scaled_rect, format, TRUE,
5625
5626 gdi_transform_release(graphics);
5627
5630
5631 if (lines)
5632 bounds->Width += margin_x * 2.0;
5633
5634 SelectObject(hdc, oldfont);
5635 DeleteObject(gdifont);
5636
5637 if (temp_hdc)
5638 DeleteDC(temp_hdc);
5639
5640 return Ok;
5641}
static GpStatus measure_string_callback(HDC hdc, GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, INT lineno, const RectF *bounds, INT *underlined_indexes, INT underlined_index_count, void *user_data)
Definition: graphics.c:5515
static UINT UINT LPWORD glyphs
Definition: font.c:44
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 2152 of file brush.c.

2154{
2155 TRACE("(%p,%p,%u)\n", brush, matrix, order);
2156
2157 if(!brush)
2158 return InvalidParameter;
2159
2160 if(!matrix)
2161 return Ok;
2162
2163 return GdipMultiplyMatrix(&brush->transform, matrix, order);
2164}
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 240 of file matrix.c.

242{
243 TRACE("(%p, %p, %d)\n", matrix, matrix2, order);
244
245 if(!matrix || !matrix2)
246 return InvalidParameter;
247
249 matrix_multiply(matrix->matrix, matrix2->matrix, matrix->matrix);
250 else if (order == MatrixOrderPrepend)
251 matrix_multiply(matrix2->matrix, matrix->matrix, matrix->matrix);
252 else
253 return InvalidParameter;
254
255 return Ok;
256}
static void matrix_multiply(GDIPCONST REAL *left, GDIPCONST REAL *right, REAL *out)
Definition: matrix.c:42

Referenced by GdipBeginContainer(), 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 1871 of file brush.c.

1873{
1874 TRACE("(%p,%p,%i)\n", grad, matrix, order);
1875
1876 if (!grad || grad->brush.bt != BrushTypePathGradient)
1877 return InvalidParameter;
1878
1879 return GdipMultiplyMatrix(&grad->transform, matrix, order);
1880}

◆ GdipMultiplyPenTransform()

GpStatus WINGDIPAPI GdipMultiplyPenTransform ( GpPen pen,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 491 of file pen.c.

493{
494 TRACE("(%p,%p,%u)\n", pen, matrix, order);
495
496 if(!pen)
497 return InvalidParameter;
498
500}

Referenced by test_transform().

◆ GdipMultiplyTextureTransform()

GpStatus WINGDIPAPI GdipMultiplyTextureTransform ( GpTexture brush,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 1331 of file brush.c.

1333{
1334 TRACE("(%p, %p, %d)\n", brush, matrix, order);
1335
1336 if(!brush || !matrix)
1337 return InvalidParameter;
1338
1339 return GdipMultiplyMatrix(&brush->transform, matrix, order);
1340}

◆ GdipMultiplyWorldTransform()

GpStatus WINGDIPAPI GdipMultiplyWorldTransform ( GpGraphics graphics,
GDIPCONST GpMatrix matrix,
GpMatrixOrder  order 
)

Definition at line 6649 of file graphics.c.

6651{
6652 GpMatrix m;
6653 GpStatus ret;
6654
6655 TRACE("(%p, %p, %d)\n", graphics, matrix, order);
6656
6657 if(!graphics || !matrix)
6658 return InvalidParameter;
6659
6660 if(graphics->busy)
6661 return ObjectBusy;
6662
6663 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
6665
6666 if (ret != Ok)
6667 return ret;
6668 }
6669
6670 m = graphics->worldtrans;
6671
6673 if(ret == Ok)
6674 graphics->worldtrans = m;
6675
6676 return ret;
6677}
GpStatus METAFILE_MultiplyWorldTransform(GpMetafile *metafile, GDIPCONST GpMatrix *matrix, MatrixOrder order) DECLSPEC_HIDDEN
Definition: metafile.c:1284
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 1679 of file font.c.

1681{
1682 TRACE("(%p)\n",fontCollection);
1683
1684 if (!fontCollection)
1685 return InvalidParameter;
1686
1688 {
1689 struct add_font_param param;
1690 HDC hdc;
1691 LOGFONTW lfw;
1692
1694
1696 lfw.lfFaceName[0] = 0;
1697 lfw.lfPitchAndFamily = 0;
1698
1699 param.collection = &installedFontCollection;
1700 param.is_system = TRUE;
1702 {
1704 DeleteDC(hdc);
1705 return param.stat;
1706 }
1707
1708 DeleteDC(hdc);
1709 }
1710
1711 *fontCollection = &installedFontCollection;
1712
1713 return Ok;
1714}
void free_installed_fonts(void)
Definition: font.c:1608
static GpFontCollection installedFontCollection
Definition: font.c:121
static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam)
Definition: font.c:1617
GLfloat param
Definition: glext.h:5796
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
#define DEFAULT_CHARSET
Definition: wingdi.h:384

Referenced by test_GdipGetFontCollectionFamilyCount(), test_GdipGetFontCollectionFamilyList(), and test_installedfonts().

◆ GdipNewPrivateFontCollection()

GpStatus WINGDIPAPI GdipNewPrivateFontCollection ( GpFontCollection **  fontCollection)

Definition at line 1096 of file font.c.

1097{
1098 TRACE("%p\n", fontCollection);
1099
1100 if (!fontCollection)
1101 return InvalidParameter;
1102
1103 *fontCollection = heap_alloc_zero(sizeof(GpFontCollection));
1104 if (!*fontCollection) return OutOfMemory;
1105
1106 (*fontCollection)->FontFamilies = NULL;
1107 (*fontCollection)->count = 0;
1108 (*fontCollection)->allocated = 0;
1109
1110 TRACE("<-- %p\n", *fontCollection);
1111
1112 return Ok;
1113}

Referenced by test_long_name().

◆ 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 267 of file pathiterator.c.

269{
270 TRACE("(%p, %p, %p, %p, %d)\n", iterator, resultCount, points, types, count);
271
272 if((count < 0) || !resultCount)
273 return InvalidParameter;
274
275 if(count == 0){
276 *resultCount = 0;
277 return Ok;
278 }
279
280 return GdipPathIterCopyData(iterator, resultCount, points, types, 0, count-1);
281}
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 255 of file pathiterator.c.

256{
257 TRACE("(%p, %p)\n", iterator, count);
258
259 if(!iterator || !count)
260 return InvalidParameter;
261
262 *count = iterator->pathdata.Count;
263
264 return Ok;
265}

◆ 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 283 of file pathiterator.c.

284{
285 TRACE("(%p, %p)\n", iterator, valid);
286
287 if(!iterator || !valid)
288 return InvalidParameter;
289
290 *valid = TRUE;
291
292 return Ok;
293}
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:89

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 295 of file pathiterator.c.

297{
298 FIXME("(%p, %p, %p, %p, %p) stub\n", iter, result, type, start, end);
299
300 if(!iter || !result || !type || !start || !end)
301 return InvalidParameter;
302
303 return NotImplemented;
304}

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
226 for(i = iterator->subpath_pos + 1; i < count &&
227 !(iterator->pathdata.Types[i] == PathPointTypeStart); i++);
228
229 *endIndex = i - 1;
230 iterator->subpath_pos = i;
231
232 *resultCount = *endIndex - *startIndex + 1;
233
234 if(iterator->pathdata.Types[*endIndex] & PathPointTypeCloseSubpath)
235 *isClosed = TRUE;
236 else
237 *isClosed = FALSE;
238
239 return Ok;
240}

Referenced by GdipPathIterNextSubpathPath(), and test_nextsubpath().

◆ GdipPathIterNextSubpathPath()

GpStatus WINGDIPAPI GdipPathIterNextSubpathPath ( GpPathIterator iter,
INT result,
GpPath path,
BOOL closed 
)

Definition at line 306 of file pathiterator.c.

308{
309 INT start, end;
310
311 TRACE("(%p, %p, %p, %p)\n", iter, result, path, closed);
312
313 if(!iter || !result || !closed)
314 return InvalidParameter;
315
316 GdipPathIterNextSubpath(iter, result, &start, &end, closed);
317 /* return path */
318 if(((*result) > 0) && path){
320
322 return OutOfMemory;
323
324 memcpy(path->pathdata.Points, &(iter->pathdata.Points[start]), sizeof(GpPointF)*(*result));
325 memcpy(path->pathdata.Types, &(iter->pathdata.Types[start]), sizeof(BYTE)*(*result));
326 path->pathdata.Count = *result;
327 }
328
329 return Ok;
330}
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 241 of file pathiterator.c.

242{
243 TRACE("(%p)\n", iterator);
244
245 if(!iterator)
246 return InvalidParameter;
247
248 iterator->subpath_pos = 0;
249 iterator->marker_pos = 0;
250 iterator->pathtype_pos = 0;
251
252 return Ok;
253}

◆ GdipPlayMetafileRecord()

GpStatus WINGDIPAPI GdipPlayMetafileRecord ( GDIPCONST GpMetafile metafile,
EmfPlusRecordType  recordType,
UINT  flags,
UINT  dataSize,
GDIPCONST BYTE data 
)

Definition at line 2461 of file metafile.c.

2463{
2464 GpStatus stat;
2465 GpMetafile *real_metafile = (GpMetafile*)metafile;
2466
2467 TRACE("(%p,%x,%x,%d,%p)\n", metafile, recordType, flags, dataSize, data);
2468
2469 if (!metafile || (dataSize && !data) || !metafile->playback_graphics)
2470 return InvalidParameter;
2471
2472 if (recordType >= 1 && recordType <= 0x7a)
2473 {
2474 /* regular EMF record */
2475 if (metafile->playback_dc)
2476 {
2477 switch (recordType)
2478 {
2479 case EMR_SETMAPMODE:
2480 case EMR_SAVEDC:
2481 case EMR_RESTOREDC:
2482 case EMR_SETWINDOWORGEX:
2483 case EMR_SETWINDOWEXTEX:
2489 FIXME("not implemented for record type %x\n", recordType);
2490 break;
2492 {
2493 const XFORM* xform = (void*)data;
2494 real_metafile->gdiworldtransform = *xform;
2496 break;
2497 }
2499 {
2500 DWORD rgndatasize = *(DWORD*)data;
2501 DWORD mode = *(DWORD*)(data + 4);
2502 const RGNDATA *rgndata = (const RGNDATA*)(data + 8);
2503 HRGN hrgn = NULL;
2504
2505 if (dataSize > 8)
2506 {
2507 XFORM final;
2508
2510
2511 hrgn = ExtCreateRegion(&final, rgndatasize, rgndata);
2512 }
2513
2514 ExtSelectClipRgn(metafile->playback_dc, hrgn, mode);
2515
2517
2518 return Ok;
2519 }
2520 default:
2521 {
2522 ENHMETARECORD *record = heap_alloc_zero(dataSize + 8);
2523
2524 if (record)
2525 {
2526 record->iType = recordType;
2527 record->nSize = dataSize + 8;
2528 memcpy(record->dParm, data, dataSize);
2529
2530 if(PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table,
2531 record, metafile->handle_count) == 0)
2532 ERR("PlayEnhMetaFileRecord failed\n");
2533
2535 }
2536 else
2537 return OutOfMemory;
2538
2539 break;
2540 }
2541 }
2542 }
2543 }
2544 else
2545 {
2547
2549
2550 switch(recordType)
2551 {
2554 break;
2557 break;
2559 {
2561
2562 if (dataSize != sizeof(record->Color))
2563 return InvalidParameter;
2564
2565 return GdipGraphicsClear(metafile->playback_graphics, record->Color);
2566 }
2568 {
2570 GpBrush *brush, *temp_brush=NULL;
2571 GpRectF *rects, *temp_rects=NULL;
2572
2573 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects))
2574 return InvalidParameter;
2575
2576 if (flags & 0x4000)
2577 {
2578 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(EmfPlusRect) * record->Count)
2579 return InvalidParameter;
2580 }
2581 else
2582 {
2583 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(GpRectF) * record->Count)
2584 return InvalidParameter;
2585 }
2586
2587 if (flags & 0x8000)
2588 {
2589 stat = GdipCreateSolidFill(record->BrushID, (GpSolidFill **)&temp_brush);
2590 brush = temp_brush;
2591 }
2592 else
2593 {
2594 if (record->BrushID >= EmfPlusObjectTableSize ||
2595 real_metafile->objtable[record->BrushID].type != ObjectTypeBrush)
2596 return InvalidParameter;
2597
2598 brush = real_metafile->objtable[record->BrushID].u.brush;
2599 stat = Ok;
2600 }
2601
2602 if (stat == Ok)
2603 {
2604 if (flags & 0x4000)
2605 {
2606 EmfPlusRect *int_rects = (EmfPlusRect*)(record+1);
2607 int i;
2608
2609 rects = temp_rects = heap_alloc_zero(sizeof(GpRectF) * record->Count);
2610 if (rects)
2611 {
2612 for (i=0; i<record->Count; i++)
2613 {
2614 rects[i].X = int_rects[i].X;
2615 rects[i].Y = int_rects[i].Y;
2616 rects[i].Width = int_rects[i].Width;
2617 rects[i].Height = int_rects[i].Height;
2618 }
2619 }
2620 else
2621 stat = OutOfMemory;
2622 }
2623 else
2624 rects = (GpRectF*)(record+1);
2625 }
2626
2627 if (stat == Ok)
2628 {
2629 stat = GdipFillRectangles(metafile->playback_graphics, brush, rects, record->Count);
2630 }
2631
2632 GdipDeleteBrush(temp_brush);
2633 heap_free(temp_rects);
2634
2635 return stat;
2636 }
2638 {
2640 CombineMode mode = (CombineMode)((flags >> 8) & 0xf);
2641 GpRegion *region;
2642
2643 if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(*record))
2644 return InvalidParameter;
2645
2646 stat = GdipCreateRegionRect(&record->ClipRect, &region);
2647
2648 if (stat == Ok)
2649 {
2650 stat = metafile_set_clip_region(real_metafile, region, mode);
2651 GdipDeleteRegion(region);
2652 }
2653
2654 return stat;
2655 }
2657 {
2658 CombineMode mode = (flags >> 8) & 0xf;
2659 BYTE regionid = flags & 0xff;
2660 GpRegion *region;
2661
2662 if (dataSize != 0)
2663 return InvalidParameter;
2664
2665 if (regionid >= EmfPlusObjectTableSize || real_metafile->objtable[regionid].type != ObjectTypeRegion)
2666 return InvalidParameter;
2667
2668 stat = GdipCloneRegion(real_metafile->objtable[regionid].u.region, &region);
2669 if (stat == Ok)
2670 {
2671 stat = metafile_set_clip_region(real_metafile, region, mode);
2672 GdipDeleteRegion(region);
2673 }
2674
2675 return stat;
2676 }
2678 {
2679 CombineMode mode = (flags >> 8) & 0xf;
2680 BYTE pathid = flags & 0xff;
2681 GpRegion *region;
2682
2683 if (dataSize != 0)
2684 return InvalidParameter;
2685
2686 if (pathid >= EmfPlusObjectTableSize || real_metafile->objtable[pathid].type != ObjectTypePath)
2687 return InvalidParameter;
2688
2689 stat = GdipCreateRegionPath(real_metafile->objtable[pathid].u.path, &region);
2690 if (stat == Ok)
2691 {
2692 stat = metafile_set_clip_region(real_metafile, region, mode);
2693 GdipDeleteRegion(region);
2694 }
2695
2696 return stat;
2697 }
2699 {
2702
2704 return InvalidParameter;
2705
2706 real_metafile->page_unit = unit;
2707 real_metafile->page_scale = record->PageScale;
2708
2709 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2710 }
2712 {
2714
2716 return InvalidParameter;
2717
2718 memcpy(real_metafile->world_transform->matrix, record->MatrixData, sizeof(record->MatrixData));
2719
2720 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2721 }
2723 {
2726
2728 return InvalidParameter;
2729
2730 GdipScaleMatrix(real_metafile->world_transform, record->Sx, record->Sy, order);
2731
2732 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2733 }
2735 {
2739
2741 return InvalidParameter;
2742
2743 memcpy(matrix.matrix, record->MatrixData, sizeof(matrix.matrix));
2744
2746
2747 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2748 }
2750 {
2753
2755 return InvalidParameter;
2756
2757 GdipRotateMatrix(real_metafile->world_transform, record->Angle, order);
2758
2759 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2760 }
2762 {
2765
2767 return InvalidParameter;
2768
2769 GdipTranslateMatrix(real_metafile->world_transform, record->dx, record->dy, order);
2770
2771 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2772 }
2774 {
2775 GdipSetMatrixElements(real_metafile->world_transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
2776
2777 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2778 }
2780 {
2782 container* cont;
2783 GpUnit unit;
2784 REAL scale_x, scale_y;
2785 GpRectF scaled_srcrect;
2787
2788 cont = heap_alloc_zero(sizeof(*cont));
2789 if (!cont)
2790 return OutOfMemory;
2791
2792 stat = GdipCloneRegion(metafile->clip, &cont->clip);
2793 if (stat != Ok)
2794 {
2795 heap_free(cont);
2796 return stat;
2797 }
2798
2799 stat = GdipBeginContainer2(metafile->playback_graphics, &cont->state);
2800
2801 if (stat != Ok)
2802 {
2803 GdipDeleteRegion(cont->clip);
2804 heap_free(cont);
2805 return stat;
2806 }
2807
2808 cont->id = record->StackIndex;
2809 cont->type = BEGIN_CONTAINER;
2810 cont->world_transform = *metafile->world_transform;
2811 cont->page_unit = metafile->page_unit;
2812 cont->page_scale = metafile->page_scale;
2813 list_add_head(&real_metafile->containers, &cont->entry);
2814
2815 unit = record->Header.Flags & 0xff;
2816
2817 scale_x = units_to_pixels(1.0, unit, metafile->image.xres);
2818 scale_y = units_to_pixels(1.0, unit, metafile->image.yres);
2819
2820 scaled_srcrect.X = scale_x * record->SrcRect.X;
2821 scaled_srcrect.Y = scale_y * record->SrcRect.Y;
2822 scaled_srcrect.Width = scale_x * record->SrcRect.Width;
2823 scaled_srcrect.Height = scale_y * record->SrcRect.Height;
2824
2825 transform.matrix[0] = record->DestRect.Width / scaled_srcrect.Width;
2826 transform.matrix[1] = 0.0;
2827 transform.matrix[2] = 0.0;
2828 transform.matrix[3] = record->DestRect.Height / scaled_srcrect.Height;
2829 transform.matrix[4] = record->DestRect.X - scaled_srcrect.X;
2830 transform.matrix[5] = record->DestRect.Y - scaled_srcrect.Y;
2831
2833
2834 return METAFILE_PlaybackUpdateWorldTransform(real_metafile);
2835 }
2838 {
2840 container* cont;
2841
2842 cont = heap_alloc_zero(sizeof(*cont));
2843 if (!cont)
2844 return OutOfMemory;
2845
2846 stat = GdipCloneRegion(metafile->clip, &cont->clip);
2847 if (stat != Ok)
2848 {
2849 heap_free(cont);
2850 return stat;
2851 }
2852
2854 stat = GdipBeginContainer2(metafile->playback_graphics, &cont->state);
2855 else
2856 stat = GdipSaveGraphics(metafile->playback_graphics, &cont->state);
2857
2858 if (stat != Ok)
2859 {
2860 GdipDeleteRegion(cont->clip);
2861 heap_free(cont);
2862 return stat;
2863 }
2864
2865 cont->id = record->StackIndex;
2867 cont->type = BEGIN_CONTAINER;
2868 else
2869 cont->type = SAVE_GRAPHICS;
2870 cont->world_transform = *metafile->world_transform;
2871 cont->page_unit = metafile->page_unit;
2872 cont->page_scale = metafile->page_scale;
2873 list_add_head(&real_metafile->containers, &cont->entry);
2874
2875 break;
2876 }
2879 {
2881 container* cont;
2882 enum container_type type;
2883 BOOL found=FALSE;
2884
2885 if (recordType == EmfPlusRecordTypeEndContainer)
2887 else
2889
2890 LIST_FOR_EACH_ENTRY(cont, &real_metafile->containers, container, entry)
2891 {
2892 if (cont->id == record->StackIndex && cont->type == type)
2893 {
2894 found = TRUE;
2895 break;
2896 }
2897 }
2898
2899 if (found)
2900 {
2901 container* cont2;
2902
2903 /* pop any newer items on the stack */
2904 while ((cont2 = LIST_ENTRY(list_head(&real_metafile->containers), container, entry)) != cont)
2905 {
2906 list_remove(&cont2->entry);
2907 GdipDeleteRegion(cont2->clip);
2908 heap_free(cont2);
2909 }
2910
2911 if (type == BEGIN_CONTAINER)
2912 GdipEndContainer(real_metafile->playback_graphics, cont->state);
2913 else
2914 GdipRestoreGraphics(real_metafile->playback_graphics, cont->state);
2915
2916 *real_metafile->world_transform = cont->world_transform;
2917 real_metafile->page_unit = cont->page_unit;
2918 real_metafile->page_scale = cont->page_scale;
2919 GdipCombineRegionRegion(real_metafile->clip, cont->clip, CombineModeReplace);
2920
2921 list_remove(&cont->entry);
2922 GdipDeleteRegion(cont->clip);
2923 heap_free(cont);
2924 }
2925
2926 break;
2927 }
2929 {
2930 return GdipSetPixelOffsetMode(real_metafile->playback_graphics, flags & 0xff);
2931 }
2933 {
2934 return GdipSetCompositingQuality(real_metafile->playback_graphics, flags & 0xff);
2935 }
2937 {
2938 return GdipSetInterpolationMode(real_metafile->playback_graphics, flags & 0xff);
2939 }
2941 {
2942 return GdipSetTextRenderingHint(real_metafile->playback_graphics, flags & 0xff);
2943 }
2945 {
2946 return GdipSetSmoothingMode(real_metafile->playback_graphics, (flags >> 1) & 0xff);
2947 }
2949 {
2950 return GdipSetCompositingMode(real_metafile->playback_graphics, flags & 0xff);
2951 }
2953 {
2954 return METAFILE_PlaybackObject(real_metafile, flags, dataSize, data);
2955 }
2957 {
2959 BYTE image = flags & 0xff;
2960 GpPointF points[3];
2961
2962 if (image >= EmfPlusObjectTableSize || real_metafile->objtable[image].type != ObjectTypeImage)
2963 return InvalidParameter;
2964
2965 if (dataSize != FIELD_OFFSET(EmfPlusDrawImage, RectData) - sizeof(EmfPlusRecordHeader) +
2966 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
2967 return InvalidParameter;
2968
2970 real_metafile->objtable[draw->ImageAttributesID].type != ObjectTypeImageAttributes)
2971 return InvalidParameter;
2972
2973 if (flags & 0x4000) /* C */
2974 {
2975 points[0].X = draw->RectData.rect.X;
2976 points[0].Y = draw->RectData.rect.Y;
2977 points[1].X = points[0].X + draw->RectData.rect.Width;
2978 points[1].Y = points[0].Y;
2979 points[2].X = points[1].X;
2980 points[2].Y = points[1].Y + draw->RectData.rect.Height;
2981 }
2982 else
2983 {
2984 points[0].X = draw->RectData.rectF.X;
2985 points[0].Y = draw->RectData.rectF.Y;
2986 points[1].X = points[0].X + draw->RectData.rectF.Width;
2987 points[1].Y = points[0].Y;
2988 points[2].X = points[1].X;
2989 points[2].Y = points[1].Y + draw->RectData.rectF.Height;
2990 }
2991
2992 return GdipDrawImagePointsRect(real_metafile->playback_graphics, real_metafile->objtable[image].u.image,
2993 points, 3, draw->SrcRect.X, draw->SrcRect.Y, draw->SrcRect.Width, draw->SrcRect.Height, draw->SrcUnit,
2994 real_metafile->objtable[draw->ImageAttributesID].u.image_attributes, NULL, NULL);
2995 }
2997 {
2999 static const UINT fixed_part_size = FIELD_OFFSET(EmfPlusDrawImagePoints, PointData) -
3000 FIELD_OFFSET(EmfPlusDrawImagePoints, ImageAttributesID);
3001 BYTE image = flags & 0xff;
3002 GpPointF points[3];
3003 unsigned int i;
3004 UINT size;
3005
3006 if (image >= EmfPlusObjectTableSize || real_metafile->objtable[image].type != ObjectTypeImage)
3007 return InvalidParameter;
3008
3009 if (dataSize <= fixed_part_size)
3010 return InvalidParameter;
3011 dataSize -= fixed_part_size;
3012
3014 real_metafile->objtable[draw->ImageAttributesID].type != ObjectTypeImageAttributes)
3015 return InvalidParameter;
3016
3017 if (draw->count != 3)
3018 return InvalidParameter;
3019
3020 if ((flags >> 13) & 1) /* E */
3021 FIXME("image effects are not supported.\n");
3022
3023 if ((flags >> 11) & 1) /* P */
3024 size = sizeof(EmfPlusPointR7) * draw->count;
3025 else if ((flags >> 14) & 1) /* C */
3026 size = sizeof(EmfPlusPoint) * draw->count;
3027 else
3028 size = sizeof(EmfPlusPointF) * draw->count;
3029
3030 if (dataSize != size)
3031 return InvalidParameter;
3032
3033 if ((flags >> 11) & 1) /* P */
3034 {
3035 points[0].X = draw->PointData.pointsR[0].X;
3036 points[0].Y = draw->PointData.pointsR[0].Y;
3037 for (i = 1; i < 3; i++)
3038 {
3039 points[i].X = points[i-1].X + draw->PointData.pointsR[i].X;
3040 points[i].Y = points[i-1].Y + draw->PointData.pointsR[i].Y;
3041 }
3042 }
3043 else if ((flags >> 14) & 1) /* C */
3044 {
3045 for (i = 0; i < 3; i++)
3046 {
3047 points[i].X = draw->PointData.points[i].X;
3048 points[i].Y = draw->PointData.points[i].Y;
3049 }
3050 }
3051 else
3052 memcpy(points, draw->PointData.pointsF, sizeof(points));
3053
3054 return GdipDrawImagePointsRect(real_metafile->playback_graphics, real_metafile->objtable[image].u.image,
3055 points, 3, draw->SrcRect.X, draw->SrcRect.Y, draw->SrcRect.Width, draw->SrcRect.Height, draw->SrcUnit,
3056 real_metafile->objtable[draw->ImageAttributesID].u.image_attributes, NULL, NULL);
3057 }
3059 {
3061 GpSolidFill *solidfill = NULL;
3062 BYTE path = flags & 0xff;
3063 GpBrush *brush;
3064
3065 if (path >= EmfPlusObjectTableSize || real_metafile->objtable[path].type != ObjectTypePath)
3066 return InvalidParameter;
3067
3068 if (dataSize != sizeof(fill->data.BrushId))
3069 return InvalidParameter;
3070
3071 if (flags & 0x8000)
3072 {
3073 stat = GdipCreateSolidFill(fill->data.Color, (GpSolidFill **)&solidfill);
3074 if (stat != Ok)
3075 return stat;
3076 brush = (GpBrush *)solidfill;
3077 }
3078 else
3079 {
3080 if (fill->data.BrushId >= EmfPlusObjectTableSize ||
3081 real_metafile->objtable[fill->data.BrushId].type != ObjectTypeBrush)
3082 return InvalidParameter;
3083
3084 brush = real_metafile->objtable[fill->data.BrushId].u.brush;
3085 }
3086
3087 stat = GdipFillPath(real_metafile->playback_graphics, brush, real_metafile->objtable[path].u.path);
3088 GdipDeleteBrush((GpBrush *)solidfill);
3089 return stat;
3090 }
3092 {
3093 static const UINT fixed_part_size = FIELD_OFFSET(EmfPlusFillClosedCurve, PointData) -
3094 sizeof(EmfPlusRecordHeader);
3096 GpSolidFill *solidfill = NULL;
3098 GpBrush *brush;
3099 UINT size, i;
3100
3101 if (dataSize <= fixed_part_size)
3102 return InvalidParameter;
3103
3104 if (fill->Count == 0)
3105 return InvalidParameter;
3106
3107 if (flags & 0x800) /* P */
3108 size = (fixed_part_size + sizeof(EmfPlusPointR7) * fill->Count + 3) & ~3;
3109 else if (flags & 0x4000) /* C */
3110 size = fixed_part_size + sizeof(EmfPlusPoint) * fill->Count;
3111 else
3112 size = fixed_part_size + sizeof(EmfPlusPointF) * fill->Count;
3113
3114 if (dataSize != size)
3115 return InvalidParameter;
3116
3117 mode = flags & 0x200 ? FillModeWinding : FillModeAlternate; /* W */
3118
3119 if (flags & 0x8000) /* S */
3120 {
3121 stat = GdipCreateSolidFill(fill->BrushId, (GpSolidFill **)&solidfill);
3122 if (stat != Ok)
3123 return stat;
3124 brush = (GpBrush *)solidfill;
3125 }
3126 else
3127 {
3128 if (fill->BrushId >= EmfPlusObjectTableSize ||
3129 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3130 return InvalidParameter;
3131
3132 brush = real_metafile->objtable[fill->BrushId].u.brush;
3133 }
3134
3135 if (flags & (0x800 | 0x4000))
3136 {
3137 GpPointF *points = GdipAlloc(fill->Count * sizeof(*points));
3138 if (points)
3139 {
3140 if (flags & 0x800) /* P */
3141 {
3142 for (i = 1; i < fill->Count; i++)
3143 {
3144 points[i].X = points[i - 1].X + fill->PointData.pointsR[i].X;
3145 points[i].Y = points[i - 1].Y + fill->PointData.pointsR[i].Y;
3146 }
3147 }
3148 else
3149 {
3150 for (i = 0; i < fill->Count; i++)
3151 {
3152 points[i].X = fill->PointData.points[i].X;
3153 points[i].Y = fill->PointData.points[i].Y;
3154 }
3155 }
3156
3157 stat = GdipFillClosedCurve2(real_metafile->playback_graphics, brush,
3158 points, fill->Count, fill->Tension, mode);
3160 }
3161 else
3162 stat = OutOfMemory;
3163 }
3164 else
3165 stat = GdipFillClosedCurve2(real_metafile->playback_graphics, brush,
3166 (const GpPointF *)fill->PointData.pointsF, fill->Count, fill->Tension, mode);
3167
3168 GdipDeleteBrush((GpBrush *)solidfill);
3169 return stat;
3170 }
3172 {
3174 GpSolidFill *solidfill = NULL;
3175 GpBrush *brush;
3176
3177 if (dataSize <= FIELD_OFFSET(EmfPlusFillEllipse, RectData) - sizeof(EmfPlusRecordHeader))
3178 return InvalidParameter;
3180
3181 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3182 return InvalidParameter;
3183
3184 if (flags & 0x8000)
3185 {
3186 stat = GdipCreateSolidFill(fill->BrushId, (GpSolidFill **)&solidfill);
3187 if (stat != Ok)
3188 return stat;
3189 brush = (GpBrush *)solidfill;
3190 }
3191 else
3192 {
3193 if (fill->BrushId >= EmfPlusObjectTableSize ||
3194 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3195 return InvalidParameter;
3196
3197 brush = real_metafile->objtable[fill->BrushId].u.brush;
3198 }
3199
3200 if (flags & 0x4000)
3201 stat = GdipFillEllipseI(real_metafile->playback_graphics, brush, fill->RectData.rect.X,
3202 fill->RectData.rect.Y, fill->RectData.rect.Width, fill->RectData.rect.Height);
3203 else
3204 stat = GdipFillEllipse(real_metafile->playback_graphics, brush, fill->RectData.rectF.X,
3205 fill->RectData.rectF.Y, fill->RectData.rectF.Width, fill->RectData.rectF.Height);
3206
3207 GdipDeleteBrush((GpBrush *)solidfill);
3208 return stat;
3209 }
3211 {
3213 GpSolidFill *solidfill = NULL;
3214 GpBrush *brush;
3215
3216 if (dataSize <= FIELD_OFFSET(EmfPlusFillPie, RectData) - sizeof(EmfPlusRecordHeader))
3217 return InvalidParameter;
3219
3220 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3221 return InvalidParameter;
3222
3223 if (flags & 0x8000) /* S */
3224 {
3225 stat = GdipCreateSolidFill(fill->BrushId, (GpSolidFill **)&solidfill);
3226 if (stat != Ok)
3227 return stat;
3228 brush = (GpBrush *)solidfill;
3229 }
3230 else
3231 {
3232 if (fill->BrushId >= EmfPlusObjectTableSize ||
3233 real_metafile->objtable[fill->BrushId].type != ObjectTypeBrush)
3234 return InvalidParameter;
3235
3236 brush = real_metafile->objtable[fill->BrushId].u.brush;
3237 }
3238
3239 if (flags & 0x4000) /* C */
3240 stat = GdipFillPieI(real_metafile->playback_graphics, brush, fill->RectData.rect.X,
3241 fill->RectData.rect.Y, fill->RectData.rect.Width, fill->RectData.rect.Height,
3242 fill->StartAngle, fill->SweepAngle);
3243 else
3244 stat = GdipFillPie(real_metafile->playback_graphics, brush, fill->RectData.rectF.X,
3245 fill->RectData.rectF.Y, fill->RectData.rectF.Width, fill->RectData.rectF.Height,
3246 fill->StartAngle, fill->SweepAngle);
3247
3248 GdipDeleteBrush((GpBrush *)solidfill);
3249 return stat;
3250 }
3252 {
3254 BYTE path = flags & 0xff;
3255
3256 if (dataSize != sizeof(draw->PenId))
3257 return InvalidParameter;
3258
3260 return InvalidParameter;
3261
3262 if (real_metafile->objtable[path].type != ObjectTypePath ||
3263 real_metafile->objtable[draw->PenId].type != ObjectTypePen)
3264 return InvalidParameter;
3265
3266 return GdipDrawPath(real_metafile->playback_graphics, real_metafile->objtable[draw->PenId].u.pen,
3267 real_metafile->objtable[path].u.path);
3268 }
3270 {
3272 BYTE pen = flags & 0xff;
3273
3274 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3275 return InvalidParameter;
3276
3277 if (dataSize != FIELD_OFFSET(EmfPlusDrawArc, RectData) - sizeof(EmfPlusRecordHeader) +
3278 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3279 return InvalidParameter;
3280
3281 if (flags & 0x4000) /* C */
3282 return GdipDrawArcI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3283 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3284 draw->RectData.rect.Height, draw->StartAngle, draw->SweepAngle);
3285 else
3286 return GdipDrawArc(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3287 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3288 draw->RectData.rectF.Height, draw->StartAngle, draw->SweepAngle);
3289 }
3291 {
3293 BYTE pen = flags & 0xff;
3294
3295 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3296 return InvalidParameter;
3297
3298 if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3299 return InvalidParameter;
3300
3301 if (flags & 0x4000) /* C */
3302 return GdipDrawEllipseI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3303 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3304 draw->RectData.rect.Height);
3305 else
3306 return GdipDrawEllipse(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3307 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3308 draw->RectData.rectF.Height);
3309 }
3311 {
3313 BYTE pen = flags & 0xff;
3314
3315 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3316 return InvalidParameter;
3317
3318 if (dataSize != FIELD_OFFSET(EmfPlusDrawPie, RectData) - sizeof(EmfPlusRecordHeader) +
3319 (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3320 return InvalidParameter;
3321
3322 if (flags & 0x4000) /* C */
3323 return GdipDrawPieI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3324 draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width,
3325 draw->RectData.rect.Height, draw->StartAngle, draw->SweepAngle);
3326 else
3327 return GdipDrawPie(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3328 draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width,
3329 draw->RectData.rectF.Height, draw->StartAngle, draw->SweepAngle);
3330 }
3332 {
3334 BYTE pen = flags & 0xff;
3335 GpRectF *rects = NULL;
3336
3337 if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen)
3338 return InvalidParameter;
3339
3340 if (dataSize <= FIELD_OFFSET(EmfPlusDrawRects, RectData) - sizeof(EmfPlusRecordHeader))
3341 return InvalidParameter;
3343
3344 if (dataSize != draw->Count * (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF)))
3345 return InvalidParameter;
3346
3347 if (flags & 0x4000)
3348 {
3349 DWORD i;
3350
3351 rects = GdipAlloc(draw->Count * sizeof(*rects));
3352 if (!rects)
3353 return OutOfMemory;
3354
3355 for (i = 0; i < draw->Count; i++)
3356 {
3357 rects[i].X = draw->RectData.rect[i].X;
3358 rects[i].Y = draw->RectData.rect[i].Y;
3359 rects[i].Width = draw->RectData.rect[i].Width;
3360 rects[i].Height = draw->RectData.rect[i].Height;
3361 }
3362 }
3363
3364 stat = GdipDrawRectangles(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen,
3365 rects ? rects : (GpRectF *)draw->RectData.rectF, draw->Count);
3366 GdipFree(rects);
3367 return stat;
3368 }
3369 default:
3370 FIXME("Not implemented for record type %x\n", recordType);
3371 return NotImplemented;
3372 }
3373 }
3374
3375 return Ok;
3376}
GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height)
Definition: graphics.c:2960
GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics, CompositingMode mode)
Definition: graphics.c:6085
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
Definition: graphics.c:5076
GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics, TextRenderingHint hint)
Definition: graphics.c:6330
GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state)
Definition: graphics.c:5911
GpStatus WINGDIPAPI GdipSetCompositingQuality(GpGraphics *graphics, CompositingQuality quality)
Definition: graphics.c:6114
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
Definition: graphics.c:6143
GpStatus WINGDIPAPI GdipDrawPieI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4117
GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:2645
GpStatus WINGDIPAPI GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4454
GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics *graphics, GraphicsState state)
Definition: graphics.c:6045
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
Definition: graphics.c:6289
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height)
Definition: graphics.c:4319
GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode mode)
Definition: graphics.c:6229
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
Definition: matrix.c:418
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
Definition: matrix.c:258
static GpStatus METAFILE_PlaybackUpdateGdiTransform(GpMetafile *metafile)
Definition: metafile.c:1642
struct EmfPlusRecordHeader EmfPlusRecordHeader
static GpStatus metafile_set_clip_region(GpMetafile *metafile, GpRegion *region, CombineMode mode)
Definition: metafile.c:2449
static void METAFILE_GetFinalGdiTransform(const GpMetafile *metafile, XFORM *result)
Definition: metafile.c:1626
static GpStatus METAFILE_PlaybackObject(GpMetafile *metafile, UINT flags, UINT data_size, const BYTE *record_data)
Definition: metafile.c:2249
container_type
Definition: metafile.c:147
@ SAVE_GRAPHICS
Definition: metafile.c:149
@ BEGIN_CONTAINER
Definition: metafile.c:148
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1, GpRegion *region2, CombineMode mode)
Definition: region.c:346
void WINGDIPAPI GdipFree(void *ptr)
Definition: gdiplus.c:150
void *WINGDIPAPI GdipAlloc(SIZE_T size)
Definition: gdiplus.c:142
#define EmfPlusObjectTableSize
@ ObjectTypeImage
@ ObjectTypeImageAttributes
@ ObjectTypePen
@ ObjectTypeRegion
@ ObjectTypeBrush
@ ObjectTypePath
CombineMode
Definition: gdiplusenums.h:350
@ EmfPlusRecordTypeGetDC
Definition: gdiplusenums.h:663
@ EmfPlusRecordTypeDrawPie
Definition: gdiplusenums.h:676
@ EmfPlusRecordTypeSetCompositingQuality
Definition: gdiplusenums.h:695
@ EmfPlusRecordTypeSetClipRect
Definition: gdiplusenums.h:709
@ EmfPlusRecordTypeSetClipPath
Definition: gdiplusenums.h:710
@ EmfPlusRecordTypeResetWorldTransform
Definition: gdiplusenums.h:702
@ EmfPlusRecordTypeEndContainer
Definition: gdiplusenums.h:700
@ EmfPlusRecordTypeSave
Definition: gdiplusenums.h:696
@ EmfPlusRecordTypeRotateWorldTransform
Definition: gdiplusenums.h:706
@ EmfPlusRecordTypeTranslateWorldTransform
Definition: gdiplusenums.h:704
@ EmfPlusRecordTypeDrawImagePoints
Definition: gdiplusenums.h:686
@ EmfPlusRecordTypeRestore
Definition: gdiplusenums.h:697
@ EmfPlusRecordTypeClear
Definition: gdiplusenums.h:668
@ EmfPlusRecordTypeFillPath
Definition: gdiplusenums.h:679
@ EmfPlusRecordTypeSetPixelOffsetMode
Definition: gdiplusenums.h:693
@ EmfPlusRecordTypeDrawArc
Definition: gdiplusenums.h:677
@ EmfPlusRecordTypeSetCompositingMode
Definition: gdiplusenums.h:694
@ EmfPlusRecordTypeBeginContainer
Definition: gdiplusenums.h:698
@ EmfPlusRecordTypeDrawPath
Definition: gdiplusenums.h:680
@ EmfPlusRecordTypeObject
Definition: gdiplusenums.h:667
@ EmfPlusRecordTypeFillClosedCurve
Definition: gdiplusenums.h:681
@ EmfPlusRecordTypeFillPie
Definition: gdiplusenums.h:675
@ EmfPlusRecordTypeSetWorldTransform
Definition: gdiplusenums.h:701
@ EmfPlusRecordTypeFillRects
Definition: gdiplusenums.h:669
@ EmfPlusRecordTypeDrawEllipse
Definition: gdiplusenums.h:674
@ EmfPlusRecordTypeFillEllipse
Definition: gdiplusenums.h:673
@ EmfPlusRecordTypeSetInterpolationMode
Definition: gdiplusenums.h:692
@ EmfPlusRecordTypeEndOfFile
Definition: gdiplusenums.h:661
@ EmfPlusRecordTypeDrawRects
Definition: gdiplusenums.h:670
@ EmfPlusRecordTypeSetPageTransform
Definition: gdiplusenums.h:707
@ EmfPlusRecordTypeSetAntiAliasMode
Definition: gdiplusenums.h:689
@ EmfPlusRecordTypeBeginContainerNoParams
Definition: gdiplusenums.h:699
@ EmfPlusRecordTypeDrawImage
Definition: gdiplusenums.h:685
@ EmfPlusRecordTypeScaleWorldTransform
Definition: gdiplusenums.h:705
@ EmfPlusRecordTypeMultiplyWorldTransform
Definition: gdiplusenums.h:703
@ EmfPlusRecordTypeSetClipRegion
Definition: gdiplusenums.h:711
@ EmfPlusRecordTypeSetTextRenderingHint
Definition: gdiplusenums.h:690
FillMode
Definition: gdiplusenums.h:54
@ FillModeWinding
Definition: gdiplusenums.h:56
MatrixOrder
Definition: gdiplusenums.h:187
Unit GpUnit
GLenum GLsizei dataSize
Definition: glext.h:11123
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
EmfPlusRectF rectF
Definition: metafile.c:456
float SweepAngle
Definition: metafile.c:452
union EmfPlusDrawArc::@422 RectData
EmfPlusRect rect
Definition: metafile.c:455
float StartAngle
Definition: metafile.c:451
EmfPlusRect rect
Definition: metafile.c:465
EmfPlusRectF rectF
Definition: metafile.c:466
union EmfPlusDrawEllipse::@423 RectData
EmfPlusRectF SrcRect
Definition: metafile.c:432
union EmfPlusDrawImagePoints::@421 PointData
EmfPlusPointR7 pointsR[3]
Definition: metafile.c:436
EmfPlusPointF pointsF[3]
Definition: metafile.c:438
EmfPlusPoint points[3]
Definition: metafile.c:437
DWORD ImageAttributesID
Definition: metafile.c:417
EmfPlusRect rect
Definition: metafile.c:422
union EmfPlusDrawImage::@420 RectData
EmfPlusRectF rectF
Definition: metafile.c:423
EmfPlusRectF SrcRect
Definition: metafile.c:419
float SweepAngle
Definition: metafile.c:474
float StartAngle
Definition: metafile.c:473
EmfPlusRect rect
Definition: metafile.c:477
EmfPlusRectF rectF
Definition: metafile.c:478
union EmfPlusDrawPie::@424 RectData
union EmfPlusDrawRects::@425 RectData
EmfPlusRectF rectF[1]
Definition: metafile.c:489
EmfPlusRect rect[1]
Definition: metafile.c:488
float Width
Definition: metafile.c:263
float Height
Definition: metafile.c:264
SHORT Y
Definition: metafile.c:95
SHORT X
Definition: metafile.c:94
SHORT Height
Definition: metafile.c:97
SHORT Width
Definition: metafile.c:96
REAL matrix[6]
struct emfplus_object objtable[EmfPlusObjectTableSize]
XFORM gdiworldtransform
DWORD id
Definition: metafile.c:155
REAL page_scale
Definition: metafile.c:160
GpUnit page_unit
Definition: metafile.c:159
enum container_type type
Definition: metafile.c:156
GpMatrix world_transform
Definition: metafile.c:158
GraphicsContainer state
Definition: metafile.c:157
#define EMR_SAVEDC
Definition: wingdi.h:107
#define EMR_SETWINDOWEXTEX
Definition: wingdi.h:83
#define EMR_SETVIEWPORTEXTEX
Definition: wingdi.h:85
#define EMR_EXTSELECTCLIPRGN
Definition: wingdi.h:148
#define EMR_RESTOREDC
Definition: wingdi.h:108
BOOL WINAPI PlayEnhMetaFileRecord(_In_ HDC hdc, _In_reads_(cht) LPHANDLETABLE pht, _In_ CONST ENHMETARECORD *pmr, _In_ UINT cht)
HRGN WINAPI ExtCreateRegion(_In_opt_ const XFORM *lpx, _In_ DWORD nCount, _In_reads_bytes_(nCount) const RGNDATA *lpData)
#define EMR_SETWINDOWORGEX
Definition: wingdi.h:84
#define EMR_SETVIEWPORTORGEX
Definition: wingdi.h:86
#define EMR_SETMAPMODE
Definition: wingdi.h:91
#define EMR_MODIFYWORLDTRANSFORM
Definition: wingdi.h:110
#define EMR_SCALEWINDOWEXTEX
Definition: wingdi.h:106
#define EMR_SETWORLDTRANSFORM
Definition: wingdi.h:109
#define EMR_SCALEVIEWPORTEXTEX
Definition: wingdi.h:105

Referenced by play_metafile_proc(), and test_gditransform_cb().

◆ GdipPrivateAddFontFile()

GpStatus WINGDIPAPI GdipPrivateAddFontFile ( GpFontCollection collection,
GDIPCONST WCHAR name 
)

Definition at line 1137 of file font.c.

1138{
1141 void *mem;
1143
1144 TRACE("%p, %s\n", collection, debugstr_w(name));
1145
1146 if (!collection || !name) return InvalidParameter;
1147
1150
1151 if (!GetFileSizeEx(file, &size) || size.u.HighPart)
1152 {
1154 return InvalidParameter;
1155 }
1156
1159 if (!mapping) return InvalidParameter;
1160
1163 if (!mem) return InvalidParameter;
1164
1165 /* GdipPrivateAddMemoryFont creates a copy of the memory block */
1168
1169 return status;
1170}
#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
GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
Definition: font.c:1509
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
static ICollection collection
Definition: typelib.c:184
Definition: mem.c:156

Referenced by test_long_name().

◆ GdipPrivateAddMemoryFont()

GpStatus WINGDIPAPI GdipPrivateAddMemoryFont ( GpFontCollection fontCollection,
GDIPCONST void memory,
INT  length 
)

Definition at line 1509 of file font.c.

1511{
1512 WCHAR *name;
1513 DWORD count = 0;
1514 HANDLE font;
1515 GpStatus ret = Ok;
1516 TRACE("%p, %p, %d\n", fontCollection, memory, length);
1517
1518 if (!fontCollection || !memory || !length)
1519 return InvalidParameter;
1520
1522 if (!name)
1523 return OutOfMemory;
1524
1526 TRACE("%s: %p/%u\n", debugstr_w(name), font, count);
1527 if (!font || !count)
1529 else
1530 {
1531 struct add_font_param param;
1532 HDC hdc;
1533 LOGFONTW lfw;
1534
1536
1537 /* Truncate name if necessary, GDI32 can't deal with long names */
1538 if(lstrlenW(name) > LF_FACESIZE - 1)
1539 name[LF_FACESIZE - 1] = 0;
1540
1542 lstrcpyW(lfw.lfFaceName, name);
1543 lfw.lfPitchAndFamily = 0;
1544
1545 param.collection = fontCollection;
1546 param.is_system = FALSE;
1548 ret = param.stat;
1549
1550 DeleteDC(hdc);
1551 }
1552 heap_free(name);
1553 return ret;
1554}
#define lstrlenW
Definition: compat.h:750
#define NAME_ID_FULL_FONT_NAME
Definition: font.c:1185
static WCHAR * load_ttf_name_id(const BYTE *mem, DWORD_PTR size, DWORD id)
Definition: font.c:1426
static char memory[1024 *256]
Definition: process.c:116
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)

Referenced by GdipPrivateAddFontFile().

◆ GdipRecordMetafile()

GpStatus WINGDIPAPI GdipRecordMetafile ( HDC  hdc,
EmfType  type,
GDIPCONST GpRectF frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 735 of file metafile.c.

737{
738 HDC record_dc;
739 REAL dpix, dpiy;
740 REAL framerect_factor_x, framerect_factor_y;
741 RECT rc, *lprc;
743
744 TRACE("(%p %d %p %d %p %p)\n", hdc, type, frameRect, frameUnit, desc, metafile);
745
746 if (!hdc || type < EmfTypeEmfOnly || type > EmfTypeEmfPlusDual || !metafile)
747 return InvalidParameter;
748
751
752 if (frameRect)
753 {
754 switch (frameUnit)
755 {
757 framerect_factor_x = 2540.0 / dpix;
758 framerect_factor_y = 2540.0 / dpiy;
759 break;
761 framerect_factor_x = framerect_factor_y = 2540.0 / 72.0;
762 break;
764 framerect_factor_x = framerect_factor_y = 2540.0;
765 break;
767 framerect_factor_x = framerect_factor_y = 2540.0 / 300.0;
768 break;
770 framerect_factor_x = framerect_factor_y = 100.0;
771 break;
773 framerect_factor_x = framerect_factor_y = 1.0;
774 break;
775 default:
776 return InvalidParameter;
777 }
778
779 rc.left = framerect_factor_x * frameRect->X;
780 rc.top = framerect_factor_y * frameRect->Y;
781 rc.right = rc.left + framerect_factor_x * frameRect->Width;
782 rc.bottom = rc.top + framerect_factor_y * frameRect->Height;
783
784 lprc = &rc;
785 }
786 else
787 lprc = NULL;
788
789 record_dc = CreateEnhMetaFileW(hdc, NULL, lprc, desc);
790
791 if (!record_dc)
792 return GenericError;
793
794 *metafile = heap_alloc_zero(sizeof(GpMetafile));
795 if(!*metafile)
796 {
798 return OutOfMemory;
799 }
800
801 (*metafile)->image.type = ImageTypeMetafile;
802 (*metafile)->image.flags = ImageFlagsNone;
803 (*metafile)->image.palette = NULL;
804 (*metafile)->image.xres = dpix;
805 (*metafile)->image.yres = dpiy;
806 (*metafile)->bounds.X = (*metafile)->bounds.Y = 0.0;
807 (*metafile)->bounds.Width = (*metafile)->bounds.Height = 1.0;
808 (*metafile)->unit = UnitPixel;
809 (*metafile)->metafile_type = type;
810 (*metafile)->record_dc = record_dc;
811 (*metafile)->comment_data = NULL;
812 (*metafile)->comment_data_size = 0;
813 (*metafile)->comment_data_length = 0;
814 (*metafile)->hemf = NULL;
815 list_init(&(*metafile)->containers);
816
817 if (!frameRect)
818 {
819 (*metafile)->auto_frame = TRUE;
820 (*metafile)->auto_frame_min.X = 0;
821 (*metafile)->auto_frame_min.Y = 0;
822 (*metafile)->auto_frame_max.X = -1;
823 (*metafile)->auto_frame_max.Y = -1;
824 }
825
827
828 if (stat != Ok)
829 {
832 *metafile = NULL;
833 return OutOfMemory;
834 }
835
836 return stat;
837}
static GpStatus METAFILE_WriteHeader(GpMetafile *metafile, HDC hdc)
Definition: metafile.c:679
@ EmfTypeEmfPlusDual
Definition: gdiplusenums.h:236
@ MetafileFrameUnitMillimeter
Definition: gdiplusenums.h:385
@ MetafileFrameUnitInch
Definition: gdiplusenums.h:383
@ MetafileFrameUnitPixel
Definition: gdiplusenums.h:381
@ MetafileFrameUnitPoint
Definition: gdiplusenums.h:382
@ MetafileFrameUnitGdi
Definition: gdiplusenums.h:386
@ MetafileFrameUnitDocument
Definition: gdiplusenums.h:384
static const WCHAR desc[]
Definition: protectdata.c:36
#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:4466

Referenced by GdipRecordMetafileI(), GdipRecordMetafileStream(), test_clear(), test_clipping(), test_containers(), test_converttoemfplus(), test_drawimage(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_frameunit(), test_gditransform(), test_getdc(), test_nullframerect(), test_pagetransform(), test_properties(), 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 3993 of file metafile.c.

3997{
3998 FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect,
3999 frameUnit, debugstr_w(desc), metafile);
4000
4001 return NotImplemented;
4002}

◆ GdipRecordMetafileFileNameI()

GpStatus WINGDIPAPI GdipRecordMetafileFileNameI ( GDIPCONST WCHAR fileName,
HDC  hdc,
EmfType  type,
GDIPCONST GpRect pFrameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 4004 of file metafile.c.

4007{
4008 FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect,
4009 frameUnit, debugstr_w(desc), metafile);
4010
4011 return NotImplemented;
4012}

◆ GdipRecordMetafileI()

GpStatus WINGDIPAPI GdipRecordMetafileI ( HDC  hdc,
EmfType  type,
GDIPCONST GpRect frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 842 of file metafile.c.

844{
845 GpRectF frameRectF, *pFrameRectF;
846
847 TRACE("(%p %d %p %d %p %p)\n", hdc, type, frameRect, frameUnit, desc, metafile);
848
849 if (frameRect)
850 {
851 frameRectF.X = frameRect->X;
852 frameRectF.Y = frameRect->Y;
853 frameRectF.Width = frameRect->Width;
854 frameRectF.Height = frameRect->Height;
855 pFrameRectF = &frameRectF;
856 }
857 else
858 pFrameRectF = NULL;
859
860 return GdipRecordMetafile(hdc, type, pFrameRectF, frameUnit, desc, metafile);
861}
GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
Definition: metafile.c:735

◆ GdipRecordMetafileStream()

GpStatus WINGDIPAPI GdipRecordMetafileStream ( IStream stream,
HDC  hdc,
EmfType  type,
GDIPCONST GpRectF frameRect,
MetafileFrameUnit  frameUnit,
GDIPCONST WCHAR desc,
GpMetafile **  metafile 
)

Definition at line 863 of file metafile.c.

865{
867
868 TRACE("(%p %p %d %p %d %p %p)\n", stream, hdc, type, frameRect, frameUnit, desc, metafile);
869
870 if (!stream)
871 return InvalidParameter;
872
873 stat = GdipRecordMetafile(hdc, type, frameRect, frameUnit, desc, metafile);
874
875 if (stat == Ok)
876 {
877 (*metafile)->record_stream = stream;
878 IStream_AddRef(stream);
879 }
880
881 return stat;
882}

◆ GdipReleaseDC()

GpStatus WINGDIPAPI GdipReleaseDC ( GpGraphics graphics,
HDC  hdc 
)

Definition at line 6758 of file graphics.c.

6759{
6761
6762 TRACE("(%p, %p)\n", graphics, hdc);
6763
6764 if(!graphics || !hdc || !graphics->busy)
6765 return InvalidParameter;
6766
6767 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6768 {
6769 stat = METAFILE_ReleaseDC((GpMetafile*)graphics->image, hdc);
6770 }
6771 else if (graphics->temp_hdc == hdc)
6772 {
6773 DWORD* pos;
6774 int i;
6775
6776 /* Find the pixels that have changed, and mark them as opaque. */
6777 pos = (DWORD*)graphics->temp_bits;
6778 for (i=0; i<(graphics->temp_hbitmap_width * graphics->temp_hbitmap_height); i++)
6779 {
6780 if (*pos != DC_BACKGROUND_KEY)
6781 {
6782 *pos |= 0xff000000;
6783 }
6784 pos++;
6785 }
6786
6787 /* Write the changed pixels to the real target. */
6788 alpha_blend_pixels(graphics, 0, 0, graphics->temp_bits,
6789 graphics->temp_hbitmap_width, graphics->temp_hbitmap_height,
6791
6792 /* Clean up. */
6793 DeleteDC(graphics->temp_hdc);
6794 DeleteObject(graphics->temp_hbitmap);
6795 graphics->temp_hdc = NULL;
6796 graphics->temp_hbitmap = NULL;
6797 }
6798 else if (hdc != graphics->hdc)
6799 {
6801 }
6802
6803 if (stat == Ok)
6804 graphics->busy = FALSE;
6805
6806 return stat;
6807}
GpStatus METAFILE_ReleaseDC(GpMetafile *metafile, HDC hdc) DECLSPEC_HIDDEN
Definition: metafile.c:1492

Referenced by METAFILE_PlaybackReleaseDC(), test_alpha_hdc(), test_emfonly(), test_fromMemoryBitmap(), test_gditransform(), test_Get_Release_DC(), test_getdc(), test_getdc_scaled(), and test_nullframerect().

◆ GdipRemovePropertyItem()

GpStatus WINGDIPAPI GdipRemovePropertyItem ( GpImage image,
PROPID  propId 
)

Definition at line 4447 of file image.c.

4448{
4449 static int calls;
4450
4451 TRACE("(%p,%u)\n", image, propId);
4452
4453 if(!image)
4454 return InvalidParameter;
4455
4456 if(!(calls++))
4457 FIXME("not implemented\n");
4458
4459 return NotImplemented;
4460}

◆ GdipResetClip()

GpStatus WINGDIPAPI GdipResetClip ( GpGraphics graphics)

Definition at line 5827 of file graphics.c.

5828{
5829 TRACE("(%p)\n", graphics);
5830
5831 if(!graphics)
5832 return InvalidParameter;
5833
5834 if(graphics->busy)
5835 return ObjectBusy;
5836
5837 return GdipSetInfinite(graphics->clip);
5838}
GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region)
Definition: region.c:1374

Referenced by test_clip_xform(), test_GdipGetVisibleClipBounds_window(), test_Get_Release_DC(), and test_get_set_clip().

◆ 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 2106 of file brush.c.

2107{
2108 TRACE("(%p)\n", brush);
2109
2110 if(!brush)
2111 return InvalidParameter;
2112
2113 return GdipSetMatrixElements(&brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
2114}

Referenced by test_transform().

◆ GdipResetPath()

GpStatus WINGDIPAPI GdipResetPath ( GpPath path)

Definition at line 1756 of file graphicspath.c.

1757{
1758 TRACE("(%p)\n", path);
1759
1760 if(!path)
1761 return InvalidParameter;
1762
1763 path->pathdata.Count = 0;
1764 path->newfigure = TRUE;
1765 path->fill = FillModeAlternate;
1766
1767 return Ok;
1768}

Referenced by GdipPathIterNextMarkerPath(), GdipPathIterNextSubpathPath(), test_addcurve(), test_addpie(), test_flatten(), test_GdipFillPath(), test_transform(), test_translate(), and test_widen().

◆ GdipResetPathGradientTransform()

GpStatus WINGDIPAPI GdipResetPathGradientTransform ( GpPathGradient grad)

Definition at line 1882 of file brush.c.

1883{
1884 TRACE("(%p)\n", grad);
1885
1886 if (!grad || grad->brush.bt != BrushTypePathGradient)
1887 return InvalidParameter;
1888
1889 return GdipSetMatrixElements(&grad->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
1890}

◆ GdipResetPenTransform()

GpStatus WINGDIPAPI GdipResetPenTransform ( GpPen pen)

Definition at line 420 of file pen.c.

421{
422 TRACE("(%p)\n", pen);
423
424 if(!pen)
425 return InvalidParameter;
426
427 GdipSetMatrixElements(&pen->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
428
429 return Ok;
430}

Referenced by test_transform().

◆ GdipResetTextureTransform()

GpStatus WINGDIPAPI GdipResetTextureTransform ( GpTexture brush)

Definition at line 1345 of file brush.c.

1346{
1347 TRACE("(%p)\n", brush);
1348
1349 if(!brush)
1350 return InvalidParameter;
1351
1352 return GdipSetMatrixElements(&brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
1353}

Referenced by test_transform().

◆ GdipResetWorldTransform()

GpStatus WINGDIPAPI GdipResetWorldTransform ( GpGraphics graphics)

Definition at line 5840 of file graphics.c.

5841{
5842 GpStatus stat;
5843
5844 TRACE("(%p)\n", graphics);
5845
5846 if(!graphics)
5847 return InvalidParameter;
5848
5849 if(graphics->busy)
5850 return ObjectBusy;
5851
5852 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
5854
5855 if (stat != Ok)
5856 return stat;
5857 }
5858
5859 return GdipSetMatrixElements(&graphics->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
5860}
GpStatus METAFILE_ResetWorldTransform(GpMetafile *metafile) DECLSPEC_HIDDEN
Definition: metafile.c:1354

Referenced by GdipEnumerateMetafileSrcRectDestPoints(), test_clip_xform(), test_container_rects(), test_Get_Release_DC(), and test_worldtransform().

◆ GdipRestoreGraphics()

GpStatus WINGDIPAPI GdipRestoreGraphics ( GpGraphics graphics,
GraphicsState  state 
)

Definition at line 6045 of file graphics.c.

6046{
6047 TRACE("(%p, %x)\n", graphics, state);
6048 return end_container(graphics, SAVE_GRAPHICS, state);
6049}
@ SAVE_GRAPHICS
Definition: graphics.c:2100

Referenced by GdipPlayMetafileRecord(), test_clipping(), test_containers(), and test_save_restore().

◆ GdipReversePath()

GpStatus WINGDIPAPI GdipReversePath ( GpPath path)

Definition at line 1596 of file graphicspath.c.

1597{
1598 INT i, count;
1599 INT start = 0; /* position in reversed path */
1600 GpPathData revpath;
1601
1602 TRACE("(%p)\n", path);
1603
1604 if(!path)
1605 return InvalidParameter;
1606
1607 count = path->pathdata.Count;
1608
1609 if(count == 0) return Ok;
1610
1611 revpath.Points = heap_alloc_zero(sizeof(GpPointF)*count);
1612 revpath.Types = heap_alloc_zero(sizeof(BYTE)*count);
1613 revpath.Count = count;
1614 if(!revpath.Points || !revpath.Types){
1615 heap_free(revpath.Points);
1616 heap_free(revpath.Types);
1617 return OutOfMemory;
1618 }
1619
1620 for(i = 0; i < count; i++){
1621
1622 /* find next start point */
1623 if(path->pathdata.Types[count-i-1] == PathPointTypeStart){
1624 INT j;
1625 for(j = start; j <= i; j++){
1626 revpath.Points[j] = path->pathdata.Points[count-j-1];
1627 revpath.Types[j] = path->pathdata.Types[count-j-1];
1628 }
1629 /* mark start point */
1630 revpath.Types[start] = PathPointTypeStart;
1631 /* set 'figure' endpoint type */
1632 if(i-start > 1){
1633 revpath.Types[i] = path->pathdata.Types[count-start-1] & ~PathPointTypePathTypeMask;
1634 revpath.Types[i] |= revpath.Types[i-1];
1635 }
1636 else
1637 revpath.Types[i] = path->pathdata.Types[start];
1638
1639 start = i+1;
1640 }
1641 }
1642
1643 memcpy(path->pathdata.Points, revpath.Points, sizeof(GpPointF)*count);
1644 memcpy(path->pathdata.Types, revpath.Types, sizeof(BYTE)*count);
1645
1646 heap_free(revpath.Points);
1647 heap_free(revpath.Types);
1648
1649 return Ok;
1650}
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 2225 of file brush.c.

2227{
2228 static int calls;
2229
2230 TRACE("(%p,%0.2f,%u)\n", brush, angle, order);
2231
2232 if(!brush || brush->brush.bt != BrushTypeLinearGradient)
2233 return InvalidParameter;
2234
2235 if(!(calls++))
2236 FIXME("(%p, %.2f, %d) stub\n", brush, angle, order);
2237
2238 return NotImplemented;
2239}

◆ GdipRotateMatrix()

GpStatus WINGDIPAPI GdipRotateMatrix ( GpMatrix matrix,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 258 of file matrix.c.

260{
261 REAL cos_theta, sin_theta, rotate[6];
262
263 TRACE("(%p, %.2f, %d)\n", matrix, angle, order);
264
265 if(!matrix)
266 return InvalidParameter;
267
269 cos_theta = cos(angle);
270 sin_theta = sin(angle);
271
272 rotate[0] = cos_theta;
273 rotate[1] = sin_theta;
274 rotate[2] = -sin_theta;
275 rotate[3] = cos_theta;
276 rotate[4] = 0.0;
277 rotate[5] = 0.0;
278
280 matrix_multiply(matrix->matrix, rotate, matrix->matrix);
281 else if (order == MatrixOrderPrepend)
282 matrix_multiply(rotate, matrix->matrix, matrix->matrix);
283 else
284 return InvalidParameter;
285
286 return Ok;
287}
_STLP_MOVE_TO_STD_NAMESPACE void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
Definition: _algo.c:519
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)

Referenced by draw_cap(), 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 1892 of file brush.c.

1894{
1895 TRACE("(%p,%0.2f,%i)\n", grad, angle, order);
1896
1897 if (!grad || grad->brush.bt != BrushTypePathGradient)
1898 return InvalidParameter;
1899
1900 return GdipRotateMatrix(&grad->transform, angle, order);
1901}

◆ GdipRotatePenTransform()

GpStatus WINGDIPAPI GdipRotatePenTransform ( GpPen pen,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 481 of file pen.c.

482{
483 TRACE("(%p,%0.2f,%u)\n", pen, angle, order);
484
485 if(!pen)
486 return InvalidParameter;
487
488 return GdipRotateMatrix(&pen->transform, angle, order);
489}

Referenced by test_transform().

◆ GdipRotateTextureTransform()

GpStatus WINGDIPAPI GdipRotateTextureTransform ( GpTexture brush,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 1999 of file brush.c.

2001{
2002 TRACE("(%p, %.2f, %d)\n", brush, angle, order);
2003
2004 if(!brush)
2005 return InvalidParameter;
2006
2007 return GdipRotateMatrix(&brush->transform, angle, order);
2008}

◆ GdipRotateWorldTransform()

GpStatus WINGDIPAPI GdipRotateWorldTransform ( GpGraphics graphics,
REAL  angle,
GpMatrixOrder  order 
)

Definition at line 5862 of file graphics.c.

5864{
5865 GpStatus stat;
5866
5867 TRACE("(%p, %.2f, %d)\n", graphics, angle, order);
5868
5869 if(!graphics)
5870 return InvalidParameter;
5871
5872 if(graphics->busy)
5873 return ObjectBusy;
5874
5875 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
5877
5878 if (stat != Ok)
5879 return stat;
5880 }
5881
5882 return GdipRotateMatrix(&graphics->worldtrans, angle, order);
5883}
GpStatus METAFILE_RotateWorldTransform(GpMetafile *metafile, REAL angle, MatrixOrder order) DECLSPEC_HIDDEN
Definition: metafile.c:1307

Referenced by test_Get_Release_DC(), and test_worldtransform().

◆ GdipSaveAdd()

GpStatus WINGDIPAPI GdipSaveAdd ( GpImage image,
GDIPCONST EncoderParameters params 
)

Definition at line 4701 of file image.c.

4702{
4703 FIXME("(%p,%p): stub\n", image, params);
4704 return Ok;
4705}
GLenum const GLfloat * params
Definition: glext.h:5645

◆ GdipSaveGraphics()

GpStatus WINGDIPAPI GdipSaveGraphics ( GpGraphics graphics,
GraphicsState state 
)

Definition at line 5911 of file graphics.c.

5912{
5913 TRACE("(%p, %p)\n", graphics, state);
5914 return begin_container(graphics, SAVE_GRAPHICS, state);
5915}

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 4476 of file image.c.

4479{
4480 GpStatus stat;
4481 IStream *stream;
4482
4483 TRACE("%p (%s) %p %p\n", image, debugstr_w(filename), clsidEncoder, encoderParams);
4484
4485 if (!image || !filename|| !clsidEncoder)
4486 return InvalidParameter;
4487
4489 if (stat != Ok)
4490 return GenericError;
4491
4492 stat = GdipSaveImageToStream(image, stream, clsidEncoder, encoderParams);
4493
4494 IStream_Release(stream);
4495 return stat;
4496}
GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream *stream, GDIPCONST CLSID *clsid, GDIPCONST EncoderParameters *params)
Definition: image.c:4671

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

◆ GdipSaveImageToStream()

GpStatus WINGDIPAPI GdipSaveImageToStream ( GpImage image,
IStream stream,
GDIPCONST CLSID clsid,
GDIPCONST EncoderParameters params 
)

Definition at line 4671 of file image.c.

4673{
4674 GpStatus stat;
4675 encode_image_func encode_image;
4676 int i;
4677
4678 TRACE("%p, %p, %s, %p\n", image, stream, wine_dbgstr_guid(clsid), params);
4679
4680 if(!image || !stream)
4681 return InvalidParameter;
4682
4683 /* select correct encoder */
4684 encode_image = NULL;
4685 for (i = 0; i < NUM_CODECS; i++) {
4686 if ((codecs[i].info.Flags & ImageCodecFlagsEncoder) &&
4687 IsEqualCLSID(clsid, &codecs[i].info.Clsid))
4688 encode_image = codecs[i].encode_func;
4689 }
4690 if (encode_image == NULL)
4691 return UnknownImageFormat;
4692
4693 stat = encode_image(image, stream, params);
4694
4695 return stat;
4696}
GpStatus(* encode_image_func)(GpImage *image, IStream *stream, GDIPCONST EncoderParameters *params)
Definition: image.c:4257
@ UnknownImageFormat
Definition: gdiplustypes.h:39
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

Referenced by GdipSaveImageToFile(), and test_supported_encoders().

◆ GdipScaleLineTransform()

GpStatus WINGDIPAPI GdipScaleLineTransform ( GpLineGradient brush,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 2141 of file brush.c.

2143{
2144 TRACE("(%p,%0.2f,%0.2f,%u)\n", brush, sx, sy, order);
2145
2146 if(!brush)
2147 return InvalidParameter;
2148
2149 return GdipScaleMatrix(&brush->transform, sx, sy, order);
2150}

Referenced by test_transform().

◆ GdipScaleMatrix()

GpStatus WINGDIPAPI GdipScaleMatrix ( GpMatrix matrix,
REAL  scaleX,
REAL  scaleY,
GpMatrixOrder  order 
)

Definition at line 289 of file matrix.c.

291{
292 REAL scale[6];
293
294 TRACE("(%p, %.2f, %.2f, %d)\n", matrix, scaleX, scaleY, order);
295
296 if(!matrix)
297 return InvalidParameter;
298
299 scale[0] = scaleX;
300 scale[1] = 0.0;
301 scale[2] = 0.0;
302 scale[3] = scaleY;
303 scale[4] = 0.0;
304 scale[5] = 0.0;
305
307 matrix_multiply(matrix->matrix, scale, matrix->matrix);
308 else if (order == MatrixOrderPrepend)
309 matrix_multiply(scale, matrix->matrix, matrix->matrix);
310 else
311 return InvalidParameter;
312
313 return Ok;
314}

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_transform(), and test_widen().

◆ GdipScalePathGradientTransform()

GpStatus WINGDIPAPI GdipScalePathGradientTransform ( GpPathGradient grad,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 1903 of file brush.c.

1905{
1906 TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, sx, sy, order);
1907
1908 if (!grad || grad->brush.bt != BrushTypePathGradient)
1909 return InvalidParameter;
1910
1911 return GdipScaleMatrix(&grad->transform, sx, sy, order);
1912}

◆ GdipScalePenTransform()

GpStatus WINGDIPAPI GdipScalePenTransform ( GpPen pen,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 471 of file pen.c.

472{
473 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, sx, sy, order);
474
475 if(!pen)
476 return InvalidParameter;
477
478 return GdipScaleMatrix(&pen->transform, sx, sy, order);
479}

Referenced by test_transform().

◆ GdipScaleTextureTransform()

GpStatus WINGDIPAPI GdipScaleTextureTransform ( GpTexture brush,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 1358 of file brush.c.

1360{
1361 TRACE("(%p, %.2f, %.2f, %d)\n", brush, sx, sy, order);
1362
1363 if(!brush)
1364 return InvalidParameter;
1365
1366 return GdipScaleMatrix(&brush->transform, sx, sy, order);
1367}

◆ GdipScaleWorldTransform()

GpStatus WINGDIPAPI GdipScaleWorldTransform ( GpGraphics graphics,
REAL  sx,
REAL  sy,
GpMatrixOrder  order 
)

Definition at line 6051 of file graphics.c.

6053{
6054 GpStatus stat;
6055
6056 TRACE("(%p, %.2f, %.2f, %d)\n", graphics, sx, sy, order);
6057
6058 if(!graphics)
6059 return InvalidParameter;
6060
6061 if(graphics->busy)
6062 return ObjectBusy;
6063
6064 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
6065 stat = METAFILE_ScaleWorldTransform((GpMetafile*)graphics->image, sx, sy, order);
6066
6067 if (stat != Ok)
6068 return stat;
6069 }
6070
6071 return GdipScaleMatrix(&graphics->worldtrans, sx, sy, order);
6072}
GpStatus METAFILE_ScaleWorldTransform(GpMetafile *metafile, REAL sx, REAL sy, MatrixOrder order) DECLSPEC_HIDDEN
Definition: metafile.c:1260

Referenced by test_clip_xform(), test_container_rects(), test_containers(), test_font_height_scaling(), test_GdipGetVisibleClipBounds_window(), test_Get_Release_DC(), test_getbounds(), test_getdc_scaled(), test_gethrgn(), 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 test_create_adjustable_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 6074 of file graphics.c.

6076{
6077 TRACE("(%p, %p, %d)\n", graphics, srcgraphics, mode);
6078
6079 if(!graphics || !srcgraphics)
6080 return InvalidParameter;
6081
6082 return GdipCombineRegionRegion(graphics->clip, srcgraphics->clip, mode);
6083}

◆ GdipSetClipHrgn()

GpStatus WINGDIPAPI GdipSetClipHrgn ( GpGraphics graphics,
HRGN  hrgn,
CombineMode  mode 
)

Definition at line 6412 of file graphics.c.

6413{
6414 GpRegion *region;
6417
6418 TRACE("(%p, %p, %d)\n", graphics, hrgn, mode);
6419
6420 if(!graphics)
6421 return InvalidParameter;
6422
6423 if(graphics->busy)
6424 return ObjectBusy;
6425
6426 /* hrgn is in gdi32 device units */
6427 status = GdipCreateRegionHrgn(hrgn, &region);
6428
6429 if (status == Ok)
6430 {
6432
6433 if (status == Ok)
6435
6436 if (status == Ok)
6437 status = GdipCombineRegionRegion(graphics->clip, region, mode);
6438
6439 GdipDeleteRegion(region);
6440 }
6441 return status;
6442}
GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
Definition: region.c:506

Referenced by test_cliphrgn_transform(), and test_Get_Release_DC().

◆ GdipSetClipPath()

GpStatus WINGDIPAPI GdipSetClipPath ( GpGraphics graphics,
GpPath path,
CombineMode  mode 
)

Definition at line 6444 of file graphics.c.

6445{
6447 GpPath *clip_path;
6448
6449 TRACE("(%p, %p, %d)\n", graphics, path, mode);
6450
6451 if(!graphics)
6452 return InvalidParameter;
6453
6454 if(graphics->busy)
6455 return ObjectBusy;
6456
6457 status = GdipClonePath(path, &clip_path);
6458 if (status == Ok)
6459 {
6460 GpMatrix world_to_device;
6461
6463 CoordinateSpaceWorld, &world_to_device);
6464 status = GdipTransformPath(clip_path, &world_to_device);
6465 if (status == Ok)
6466 GdipCombineRegionPath(graphics->clip, clip_path, mode);
6467
6468 GdipDeletePath(clip_path);
6469 }
6470 return status;
6471}

Referenced by test_Get_Release_DC(), and test_get_set_clip().

◆ GdipSetClipRect()

GpStatus WINGDIPAPI GdipSetClipRect ( GpGraphics graphics,
REAL  x,
REAL  y,
REAL  width,
REAL  height,
CombineMode  mode 
)

Definition at line 6473 of file graphics.c.

6476{
6478 GpRectF rect;
6479 GpRegion *region;
6480
6481 TRACE("(%p, %.2f, %.2f, %.2f, %.2f, %d)\n", graphics, x, y, width, height, mode);
6482
6483 if(!graphics)
6484 return InvalidParameter;
6485
6486 if(graphics->busy)
6487 return ObjectBusy;
6488
6489 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6490 {
6492 if (status != Ok)
6493 return status;
6494 }
6495
6496 rect.X = x;
6497 rect.Y = y;
6498 rect.Width = width;
6499 rect.Height = height;
6500 status = GdipCreateRegionRect(&rect, &region);
6501 if (status == Ok)
6502 {
6503 GpMatrix world_to_device;
6504 BOOL identity;
6505
6507 status = GdipIsMatrixIdentity(&world_to_device, &identity);
6508 if (status == Ok && !identity)
6509 status = GdipTransformRegion(region, &world_to_device);
6510 if (status == Ok)
6511 status = GdipCombineRegionRegion(graphics->clip, region, mode);
6512
6513 GdipDeleteRegion(region);
6514 }
6515 return status;
6516}
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:512
GpStatus METAFILE_SetClipRect(GpMetafile *metafile, REAL x, REAL y, REAL width, REAL height, CombineMode mode) DECLSPEC_HIDDEN
Definition: metafile.c:1141

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 6518 of file graphics.c.

6521{
6522 TRACE("(%p, %d, %d, %d, %d, %d)\n", graphics, x, y, width, height, mode);
6523
6524 if(!graphics)
6525 return InvalidParameter;
6526
6527 if(graphics->busy)
6528 return ObjectBusy;
6529
6530 return GdipSetClipRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, mode);
6531}
GpStatus WINGDIPAPI GdipSetClipRect(GpGraphics *graphics, REAL x, REAL y, REAL width, REAL height, CombineMode mode)
Definition: graphics.c:6473

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 6533 of file graphics.c.

6535{
6537 GpRegion *clip;
6538
6539 TRACE("(%p, %p, %d)\n", graphics, region, mode);
6540
6541 if(!graphics || !region)
6542 return InvalidParameter;
6543
6544 if(graphics->busy)
6545 return ObjectBusy;
6546
6547 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6548 {
6549 status = METAFILE_SetClipRegion((GpMetafile*)graphics->image, region, mode);
6550 if (status != Ok)
6551 return status;
6552 }
6553
6554 status = GdipCloneRegion(region, &clip);
6555 if (status == Ok)
6556 {
6557 GpMatrix world_to_device;
6558 BOOL identity;
6559
6561 status = GdipIsMatrixIdentity(&world_to_device, &identity);
6562 if (status == Ok && !identity)
6563 status = GdipTransformRegion(clip, &world_to_device);
6564 if (status == Ok)
6565 status = GdipCombineRegionRegion(graphics->clip, clip, mode);
6566
6567 GdipDeleteRegion(clip);
6568 }
6569 return status;
6570}
GpStatus METAFILE_SetClipRegion(GpMetafile *metafile, GpRegion *region, CombineMode mode) DECLSPEC_HIDDEN
Definition: metafile.c:1189

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 6085 of file graphics.c.

6087{
6088 TRACE("(%p, %d)\n", graphics, mode);
6089
6090 if(!graphics)
6091 return InvalidParameter;
6092
6093 if(graphics->busy)
6094 return ObjectBusy;
6095
6096 if(graphics->compmode == mode)
6097 return Ok;
6098
6099 if(graphics->image && graphics->image->type == ImageTypeMetafile)
6100 {
6101 GpStatus stat;
6102
6105 if(stat != Ok)
6106 return stat;
6107 }
6108
6109 graphics->compmode = mode;
6110
6111 return Ok;
6112}
GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val) DECLSPEC_HIDDEN
Definition: metafile.c:4269

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_DrawImage_SourceCopy(), test_Get_Release_DC(), and test_properties().

◆ GdipSetCompositingQuality()

GpStatus WINGDIPAPI GdipSetCompositingQuality ( GpGraphics graphics,
CompositingQuality  quality 
)

Definition at line 6114 of file graphics.c.

6116{
6117 TRACE("(%p, %d)\n", graphics, quality);
6118
6119 if(!graphics)
6120 return InvalidParameter;
6121
6122 if(graphics->busy)
6123 return ObjectBusy;
6124
6125 if(graphics->compqual == quality)
6126 return Ok;
6127
6128 if(graphics->image && graphics->image->type == ImageTypeMetafile)
6129 {
6130 GpStatus stat;
6131
6134 if(stat != Ok)
6135 return stat;
6136 }
6137
6138 graphics->compqual = quality;
6139
6140 return Ok;
6141}

Referenced by GdipPlayMetafileRecord(), test_BeginContainer2(), test_Get_Release_DC(), and test_properties().

◆ GdipSetCustomLineCapBaseCap()

GpStatus WINGDIPAPI GdipSetCustomLineCapBaseCap ( GpCustomLineCap custom,
GpLineCap  base 
)

Definition at line 195 of file customlinecap.c.

197{
198 static int calls;
199
200 TRACE("(%p,%u)\n", custom, base);
201
202 if(!(calls++))
203 FIXME("not implemented\n");
204
205 return NotImplemented;
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 static int calls;
225
226 TRACE("(%p,%0.2f)\n", custom, inset);
227
228 if(!(calls++))
229 FIXME("not implemented\n");
230
231 return NotImplemented;
232}

◆ GdipSetCustomLineCapStrokeCaps()

GpStatus WINGDIPAPI GdipSetCustomLineCapStrokeCaps ( GpCustomLineCap custom,
GpLineCap  start,
GpLineCap  end 
)

Definition at line 179 of file customlinecap.c.

181{
182 static int calls;
183
184 TRACE("(%p,%u,%u)\n", custom, start, end);
185
186 if(!custom)
187 return InvalidParameter;
188
189 if(!(calls++))
190 FIXME("not implemented\n");
191
192 return NotImplemented;
193}

◆ 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 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 test_scale().

◆ GdipSetEffectParameters()

GpStatus WINGDIPAPI GdipSetEffectParameters ( CGpEffect effect,
const VOID params,
const  UINT 
)

Definition at line 5298 of file image.c.

5300{
5301 static int calls;
5302
5303 TRACE("(%p,%p,%u)\n", effect, params, size);
5304
5305 if(!(calls++))
5306 FIXME("not implemented\n");
5307
5308 return NotImplemented;
5309}

◆ 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,%08x,%08x)\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 = heap_alloc_zero(sizeof(*map) * mapSize);
275
276 if (!new_map)
277 return OutOfMemory;
278
279 memcpy(new_map, map, sizeof(*map) * mapSize);
280
281 heap_free(imageAttr->colorremaptables[type].colormap);
282
283 imageAttr->colorremaptables[type].mapsize = mapSize;
284 imageAttr->colorremaptables[type].colormap = new_map;
285 }
286 else
287 {
288 heap_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,%08x,%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 4744 of file image.c.

4746{
4747 ColorPalette *new_palette;
4748
4749 TRACE("(%p,%p)\n", image, palette);
4750
4751 if(!image || !palette || palette->Count > 256)
4752 return InvalidParameter;
4753
4754 new_palette = heap_alloc_zero(2 * sizeof(UINT) + palette->Count * sizeof(ARGB));
4755 if (!new_palette) return OutOfMemory;
4756
4757 heap_free(image->palette);
4758 image->palette = new_palette;
4759 image->palette->Flags = palette->Flags;
4760 image->palette->Count = palette->Count;
4761 memcpy(image->palette->Entries, palette->Entries, sizeof(ARGB)*palette->Count);
4762
4763 return Ok;
4764}

Referenced by GdipCreateBitmapFromHBITMAP(), metafile_deserialize_image(), test_bitmapbits(), and test_palette().

◆ GdipSetInfinite()

GpStatus WINGDIPAPI GdipSetInfinite ( GpRegion region)

Definition at line 1374 of file region.c.

1375{
1376 GpStatus stat;
1377
1378 TRACE("%p\n", region);
1379
1380 if (!region)
1381 return InvalidParameter;
1382
1383 delete_element(&region->node);
1385
1386 return stat;
1387}

Referenced by GdipResetClip(), test_gethrgn(), test_getregiondata(), and test_isequal().

◆ GdipSetInterpolationMode()

GpStatus WINGDIPAPI GdipSetInterpolationMode ( GpGraphics graphics,
InterpolationMode  mode 
)

Definition at line 6143 of file graphics.c.

6145{
6146 TRACE("(%p, %d)\n", graphics, mode);
6147
6149 return InvalidParameter;
6150
6151 if(graphics->busy)
6152 return ObjectBusy;
6153
6156
6159
6160 if (mode == graphics->interpolation)
6161 return Ok;
6162
6163 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6164 {
6165 GpStatus stat;
6166
6169 if (stat != Ok)
6170 return stat;
6171 }
6172
6173 graphics->interpolation = mode;
6174
6175 return Ok;
6176}
@ InterpolationModeHighQualityBicubic
Definition: gdiplusenums.h:150
@ InterpolationModeInvalid
Definition: gdiplusenums.h:142
@ InterpolationModeHighQuality
Definition: gdiplusenums.h:145
@ InterpolationModeDefault
Definition: gdiplusenums.h:143
@ InterpolationModeLowQuality
Definition: gdiplusenums.h:144

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 1369 of file brush.c.

1371{
1372 REAL *new_blendfac, *new_blendpos;
1373
1374 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1375
1376 if(!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient ||
1377 (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f)))
1378 return InvalidParameter;
1379
1380 new_blendfac = heap_alloc_zero(count * sizeof(REAL));
1381 new_blendpos = heap_alloc_zero(count * sizeof(REAL));
1382
1383 if (!new_blendfac || !new_blendpos)
1384 {
1385 heap_free(new_blendfac);
1386 heap_free(new_blendpos);
1387 return OutOfMemory;
1388 }
1389
1390 memcpy(new_blendfac, factors, count * sizeof(REAL));
1391 memcpy(new_blendpos, positions, count * sizeof(REAL));
1392
1393 heap_free(brush->blendfac);
1394 heap_free(brush->blendpos);
1395
1396 brush->blendcount = count;
1397 brush->blendfac = new_blendfac;
1398 brush->blendpos = new_blendpos;
1399
1400 return Ok;
1401}

Referenced by GdipSetLineLinearBlend(), GdipSetLineSigmaBlend(), metafile_deserialize_brush(), and test_lineblend().

◆ GdipSetLineColors()

GpStatus WINGDIPAPI GdipSetLineColors ( GpLineGradient brush,
ARGB  color1,
ARGB  color2 
)

Definition at line 1969 of file brush.c.

1971{
1972 TRACE("(%p, %x, %x)\n", brush, color1, color2);
1973
1974 if(!brush || brush->brush.bt != BrushTypeLinearGradient)
1975 return InvalidParameter;
1976
1977 brush->startcolor = color1;
1978 brush->endcolor = color2;
1979
1980 return Ok;
1981}

◆ GdipSetLineGammaCorrection()

GpStatus WINGDIPAPI GdipSetLineGammaCorrection ( GpLineGradient line,
BOOL  usegamma 
)

Definition at line 1432 of file brush.c.

1434{
1435 TRACE("(%p, %d)\n", line, usegamma);
1436
1437 if(!line || line->brush.bt != BrushTypeLinearGradient)
1438 return InvalidParameter;
1439
1440 line->gamma = usegamma;
1441
1442 return Ok;
1443}

◆ GdipSetLineLinearBlend()

GpStatus WINGDIPAPI GdipSetLineLinearBlend ( GpLineGradient brush,
REAL  focus,
REAL  scale 
)

Definition at line 2010 of file brush.c.

2012{
2013 REAL factors[3];
2014 REAL positions[3];
2015 int num_points = 0;
2016
2017 TRACE("(%p,%.2f,%.2f)\n", brush, focus, scale);
2018
2019 if (!brush) return InvalidParameter;
2020
2021 if (focus != 0.0)
2022 {
2023 factors[num_points] = 0.0;
2024 positions[num_points] = 0.0;
2025 num_points++;
2026 }
2027
2028 factors[num_points] = scale;
2029 positions[num_points] = focus;
2030 num_points++;
2031
2032 if (focus != 1.0)
2033 {
2034 factors[num_points] = 0.0;
2035 positions[num_points] = 1.0;
2036 num_points++;
2037 }
2038
2039 return GdipSetLineBlend(brush, factors, positions, num_points);
2040}
GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *factors, GDIPCONST REAL *positions, INT count)
Definition: brush.c:1369

Referenced by test_linelinearblend().

◆ GdipSetLinePresetBlend()

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

Definition at line 2042 of file brush.c.

2044{
2045 ARGB *new_color;
2046 REAL *new_pos;
2047 TRACE("(%p,%p,%p,%i)\n", brush, blend, positions, count);
2048
2049 if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient ||
2050 positions[0] != 0.0f || positions[count-1] != 1.0f)
2051 {
2052 return InvalidParameter;
2053 }
2054
2055 new_color = heap_alloc_zero(count * sizeof(ARGB));
2056 new_pos = heap_alloc_zero(count * sizeof(REAL));
2057 if (!new_color || !new_pos)
2058 {
2059 heap_free(new_color);
2060 heap_free(new_pos);
2061 return OutOfMemory;
2062 }
2063
2064 memcpy(new_color, blend, sizeof(ARGB) * count);
2065 memcpy(new_pos, positions, sizeof(REAL) * count);
2066
2067 heap_free(brush->pblendcolor);
2068 heap_free(brush->pblendpos);
2069
2070 brush->pblendcolor = new_color;
2071 brush->pblendpos = new_pos;
2072 brush->pblendcount = count;
2073
2074 return Ok;
2075}

Referenced by metafile_deserialize_brush(), and test_lineblend().

◆ GdipSetLineSigmaBlend()

GpStatus WINGDIPAPI GdipSetLineSigmaBlend ( GpLineGradient line,
REAL  focus,
REAL  scale 
)

Definition at line 1445 of file brush.c.

1447{
1448 REAL factors[33];
1449 REAL positions[33];
1450 int num_points = 0;
1451 int i;
1452 const int precision = 16;
1453 REAL erf_range; /* we use values erf(-erf_range) through erf(+erf_range) */
1454 REAL min_erf;
1455 REAL scale_erf;
1456
1457 TRACE("(%p, %0.2f, %0.2f)\n", line, focus, scale);
1458
1459 if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || line->brush.bt != BrushTypeLinearGradient)
1460 return InvalidParameter;
1461
1462 /* we want 2 standard deviations */
1463 erf_range = 2.0 / sqrt(2);
1464
1465 /* calculate the constants we need to normalize the error function to be
1466 between 0.0 and scale over the range we need */
1467 min_erf = erf(-erf_range);
1468 scale_erf = scale / (-2.0 * min_erf);
1469
1470 if (focus != 0.0)
1471 {
1472 positions[0] = 0.0;
1473 factors[0] = 0.0;
1474 for (i=1; i<precision; i++)
1475 {
1476 positions[i] = focus * i / precision;
1477 factors[i] = scale_erf * (erf(2 * erf_range * i / precision - erf_range) - min_erf);
1478 }
1479 num_points += precision;
1480 }
1481
1482 positions[num_points] = focus;
1483 factors[num_points] = scale;
1484 num_points += 1;
1485
1486 if (focus != 1.0)
1487 {
1488 for (i=1; i<precision; i++)
1489 {
1490 positions[i+num_points-1] = (focus + ((1.0-focus) * i / precision));
1491 factors[i+num_points-1] = scale_erf * (erf(erf_range - 2 * erf_range * i / precision) - min_erf);
1492 }
1493 num_points += precision;
1494 positions[num_points-1] = 1.0;
1495 factors[num_points-1] = 0.0;
1496 }
1497
1498 return GdipSetLineBlend(line, factors, positions, num_points);
1499}
GLenum GLint GLint * precision
Definition: glext.h:7539
double __cdecl erf(double)

◆ GdipSetLineTransform()

GpStatus WINGDIPAPI GdipSetLineTransform ( GpLineGradient brush,
GDIPCONST GpMatrix matrix 
)

Definition at line 2116 of file brush.c.

2118{
2119 TRACE("(%p,%p)\n", brush, matrix);
2120
2121 if(!brush || !matrix)
2122 return InvalidParameter;
2123
2124 brush->transform = *matrix;
2125
2126 return Ok;
2127}

Referenced by metafile_deserialize_brush(), and test_transform().

◆ GdipSetLineWrapMode()

GpStatus WINGDIPAPI GdipSetLineWrapMode ( GpLineGradient line,
GpWrapMode  wrap 
)

Definition at line 1501 of file brush.c.

1503{
1504 TRACE("(%p, %d)\n", line, wrap);
1505
1506 if(!line || wrap == WrapModeClamp || line->brush.bt != BrushTypeLinearGradient)
1507 return InvalidParameter;
1508
1509 line->wrap = wrap;
1510
1511 return Ok;
1512}

◆ GdipSetMatrixElements()

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

◆ GdipSetMetafileDownLevelRasterizationLimit()

GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit ( GpMetafile metafile,
UINT  limitDpi 
)

Definition at line 3956 of file metafile.c.

3958{
3959 TRACE("(%p,%u)\n", metafile, limitDpi);
3960
3961 return Ok;
3962}

◆ GdipSetPageScale()

GpStatus WINGDIPAPI GdipSetPageScale ( GpGraphics graphics,
REAL  scale 
)

Definition at line 6178 of file graphics.c.

6179{
6180 GpStatus stat;
6181
6182 TRACE("(%p, %.2f)\n", graphics, scale);
6183
6184 if(!graphics || (scale <= 0.0))
6185 return InvalidParameter;
6186
6187 if(graphics->busy)
6188 return ObjectBusy;
6189
6190 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6191 {
6192 stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, graphics->unit, scale);
6193 if (stat != Ok)
6194 return stat;
6195 }
6196
6197 graphics->scale = scale;
6198
6199 return Ok;
6200}
GpStatus METAFILE_SetPageTransform(GpMetafile *metafile, GpUnit unit, REAL scale) DECLSPEC_HIDDEN
Definition: metafile.c:1214

Referenced by create_graphics(), GdipEnumerateMetafileSrcRectDestPoints(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_Get_Release_DC(), test_getbounds(), test_pagetransform(), test_pen_thickness(), and test_transformpoints().

◆ GdipSetPageUnit()

GpStatus WINGDIPAPI GdipSetPageUnit ( GpGraphics graphics,
GpUnit  unit 
)

Definition at line 6202 of file graphics.c.

6203{
6204 GpStatus stat;
6205
6206 TRACE("(%p, %d)\n", graphics, unit);
6207
6208 if(!graphics)
6209 return InvalidParameter;
6210
6211 if(graphics->busy)
6212 return ObjectBusy;
6213
6214 if(unit == UnitWorld)
6215 return InvalidParameter;
6216
6217 if (graphics->image && graphics->image->type == ImageTypeMetafile)
6218 {
6219 stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, unit, graphics->scale);
6220 if (stat != Ok)
6221 return stat;
6222 }
6223
6224 graphics->unit = unit;
6225
6226 return Ok;
6227}

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_measured_extra_space(), test_pagetransform(), test_pen_thickness(), and test_transformpoints().

◆ GdipSetPathFillMode()

GpStatus WINGDIPAPI GdipSetPathFillMode ( GpPath path,
GpFillMode  fill 
)

Definition at line 1770 of file graphicspath.c.

1771{
1772 TRACE("(%p, %d)\n", path, fill);
1773
1774 if(!path)
1775 return InvalidParameter;
1776
1777 path->fill = fill;
1778
1779 return Ok;
1780}

◆ GdipSetPathGradientBlend()

GpStatus WINGDIPAPI GdipSetPathGradientBlend ( GpPathGradient brush,
GDIPCONST REAL blend,
GDIPCONST REAL pos,
INT  count 
)

Definition at line 1514 of file brush.c.

1516{
1517 REAL *new_blendfac, *new_blendpos;
1518
1519 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1520
1521 if(!brush || !blend || !pos || count <= 0 || brush->brush.bt != BrushTypePathGradient ||
1522 (count >= 2 && (pos[0] != 0.0f || pos[count-1] != 1.0f)))
1523 return InvalidParameter;
1524
1525 new_blendfac = heap_alloc_zero(count * sizeof(REAL));
1526 new_blendpos = heap_alloc_zero(count * sizeof(REAL));
1527
1528 if (!new_blendfac || !new_blendpos)
1529 {
1530 heap_free(new_blendfac);
1531 heap_free(new_blendpos);
1532 return OutOfMemory;
1533 }
1534
1535 memcpy(new_blendfac, blend, count * sizeof(REAL));
1536 memcpy(new_blendpos, pos, count * sizeof(REAL));
1537
1538 heap_free(brush->blendfac);
1539 heap_free(brush->blendpos);
1540
1541 brush->blendcount = count;
1542 brush->blendfac = new_blendfac;
1543 brush->blendpos = new_blendpos;
1544
1545 return Ok;
1546}

Referenced by GdipSetPathGradientLinearBlend(), GdipSetPathGradientSigmaBlend(), and test_pathgradientblend().

◆ GdipSetPathGradientCenterColor()

GpStatus WINGDIPAPI GdipSetPathGradientCenterColor ( GpPathGradient grad,
ARGB  argb 
)

Definition at line 1656 of file brush.c.

1658{
1659 TRACE("(%p, %x)\n", grad, argb);
1660
1661 if(!grad || grad->brush.bt != BrushTypePathGradient)
1662 return InvalidParameter;
1663
1664 grad->centercolor = argb;
1665 return Ok;
1666}

◆ GdipSetPathGradientCenterPoint()

GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint ( GpPathGradient grad,
GpPointF point 
)

Definition at line 1668 of file brush.c.

1670{
1671 TRACE("(%p, %s)\n", grad, debugstr_pointf(point));
1672
1673 if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
1674 return InvalidParameter;
1675
1676 grad->center.X = point->X;
1677 grad->center.Y = point->Y;
1678
1679 return Ok;
1680}

Referenced by GdipSetPathGradientCenterPointI(), and test_pathgradientcenterpoint().

◆ GdipSetPathGradientCenterPointI()

GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI ( GpPathGradient grad,
GpPoint point 
)

Definition at line 1682 of file brush.c.

1684{
1685 GpPointF ptf;
1686
1687 TRACE("(%p, %p)\n", grad, point);
1688
1689 if(!point)
1690 return InvalidParameter;
1691
1692 ptf.X = (REAL)point->X;
1693 ptf.Y = (REAL)point->Y;
1694
1695 return GdipSetPathGradientCenterPoint(grad,&ptf);
1696}
GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1668

◆ GdipSetPathGradientFocusScales()

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

Definition at line 1698 of file brush.c.

1700{
1701 TRACE("(%p, %.2f, %.2f)\n", grad, x, y);
1702
1703 if(!grad || grad->brush.bt != BrushTypePathGradient)
1704 return InvalidParameter;
1705
1706 grad->focus.X = x;
1707 grad->focus.Y = y;
1708
1709 return Ok;
1710}

◆ GdipSetPathGradientGammaCorrection()

GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection ( GpPathGradient grad,
BOOL  gamma 
)

Definition at line 1712 of file brush.c.

1714{
1715 TRACE("(%p, %d)\n", grad, gamma);
1716
1717 if(!grad || grad->brush.bt != BrushTypePathGradient)
1718 return InvalidParameter;
1719
1720 grad->gamma = gamma;
1721
1722 return Ok;
1723}

◆ GdipSetPathGradientLinearBlend()

GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend ( GpPathGradient brush,
REAL  focus,
REAL  scale 
)

Definition at line 1548 of file brush.c.

1550{
1551 REAL factors[3];
1552 REAL positions[3];
1553 int num_points = 0;
1554
1555 TRACE("(%p,%0.2f,%0.2f)\n", brush, focus, scale);
1556
1557 if (!brush || brush->brush.bt != BrushTypePathGradient)
1558 return InvalidParameter;
1559
1560 if (focus != 0.0)
1561 {
1562 factors[num_points] = 0.0;
1563 positions[num_points] = 0.0;
1564 num_points++;
1565 }
1566
1567 factors[num_points] = scale;
1568 positions[num_points] = focus;
1569 num_points++;
1570
1571 if (focus != 1.0)
1572 {
1573 factors[num_points] = 0.0;
1574 positions[num_points] = 1.0;
1575 num_points++;
1576 }
1577
1578 return GdipSetPathGradientBlend(brush, factors, positions, num_points);
1579}
GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *pos, INT count)
Definition: brush.c:1514

◆ GdipSetPathGradientPath()

GpStatus WINGDIPAPI GdipSetPathGradientPath ( GpPathGradient grad,
GDIPCONST GpPath path 
)

Definition at line 1725 of file brush.c.

1726{
1727 static int calls;
1728
1729 TRACE("(%p, %p)\n", grad, path);
1730
1731 if (!(calls++))
1732 FIXME("not implemented\n");
1733
1734 return NotImplemented;
1735}

◆ GdipSetPathGradientPresetBlend()

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

Definition at line 1581 of file brush.c.

1583{
1584 ARGB *new_color;
1585 REAL *new_pos;
1586 TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
1587
1588 if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient ||
1589 pos[0] != 0.0f || pos[count-1] != 1.0f)
1590 {
1591 return InvalidParameter;
1592 }
1593
1594 new_color = heap_alloc_zero(count * sizeof(ARGB));
1595 new_pos = heap_alloc_zero(count * sizeof(REAL));
1596 if (!new_color || !new_pos)
1597 {
1598 heap_free(new_color);
1599 heap_free(new_pos);
1600 return OutOfMemory;
1601 }
1602
1603 memcpy(new_color, blend, sizeof(ARGB) * count);
1604 memcpy(new_pos, pos, sizeof(REAL) * count);
1605
1606 heap_free(brush->pblendcolor);
1607 heap_free(brush->pblendpos);
1608
1609 brush->pblendcolor = new_color;
1610 brush->pblendpos = new_pos;
1611 brush->pblendcount = count;
1612
1613 return Ok;
1614}

Referenced by test_pathgradientpresetblend().

◆ GdipSetPathGradientSigmaBlend()

GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend ( GpPathGradient grad,
REAL  focus,
REAL  scale 
)

Definition at line 1737 of file brush.c.

1739{
1740 REAL factors[33];
1741 REAL positions[33];
1742 int num_points = 0;
1743 int i;
1744 const int precision = 16;
1745 REAL erf_range; /* we use values erf(-erf_range) through erf(+erf_range) */
1746 REAL min_erf;
1747 REAL scale_erf;
1748
1749 TRACE("(%p,%0.2f,%0.2f)\n", grad, focus, scale);
1750
1751 if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || grad->brush.bt != BrushTypePathGradient)
1752 return InvalidParameter;
1753
1754 /* we want 2 standard deviations */
1755 erf_range = 2.0 / sqrt(2);
1756
1757 /* calculate the constants we need to normalize the error function to be
1758 between 0.0 and scale over the range we need */
1759 min_erf = erf(-erf_range);
1760 scale_erf = scale / (-2.0 * min_erf);
1761
1762 if (focus != 0.0)
1763 {
1764 positions[0] = 0.0;
1765 factors[0] = 0.0;
1766 for (i=1; i<precision; i++)
1767 {
1768 positions[i] = focus * i / precision;
1769 factors[i] = scale_erf * (erf(2 * erf_range * i / precision - erf_range) - min_erf);
1770 }
1771 num_points += precision;
1772 }
1773
1774 positions[num_points] = focus;
1775 factors[num_points] = scale;
1776 num_points += 1;
1777
1778 if (focus != 1.0)
1779 {
1780 for (i=1; i<precision; i++)
1781 {
1782 positions[i+num_points-1] = (focus + ((1.0-focus) * i / precision));
1783 factors[i+num_points-1] = scale_erf * (erf(erf_range - 2 * erf_range * i / precision) - min_erf);
1784 }
1785 num_points += precision;
1786 positions[num_points-1] = 1.0;
1787 factors[num_points-1] = 0.0;
1788 }
1789
1790 return GdipSetPathGradientBlend(grad, factors, positions, num_points);
1791}

◆ GdipSetPathGradientSurroundColorsWithCount()

GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount ( GpPathGradient grad,
GDIPCONST ARGB argb,
INT count 
)

Definition at line 1793 of file brush.c.

1795{
1796 ARGB *new_surroundcolors;
1797 INT i, num_colors;
1798
1799 TRACE("(%p,%p,%p)\n", grad, argb, count);
1800
1801 if(!grad || !argb || !count || (*count <= 0) || grad->brush.bt != BrushTypePathGradient ||
1802 (*count > grad->path->pathdata.Count))
1803 return InvalidParameter;
1804
1805 num_colors = *count;
1806
1807 /* If all colors are the same, only store 1 color. */
1808 if (*count > 1)
1809 {
1810 for (i=1; i < num_colors; i++)
1811 if (argb[i] != argb[i-1])
1812 break;
1813
1814 if (i == num_colors)
1815 num_colors = 1;
1816 }
1817
1818 new_surroundcolors = heap_alloc_zero(num_colors * sizeof(ARGB));
1819 if (!new_surroundcolors)
1820 return OutOfMemory;
1821
1822 memcpy(new_surroundcolors, argb, num_colors * sizeof(ARGB));
1823
1825
1826 grad->surroundcolors = new_surroundcolors;
1827 grad->surroundcolorcount = num_colors;
1828
1829 return Ok;
1830}

Referenced by test_gradientsurroundcolorcount().

◆ GdipSetPathGradientTransform()

GpStatus WINGDIPAPI GdipSetPathGradientTransform ( GpPathGradient grad,
GpMatrix matrix 
)

Definition at line 1845 of file brush.c.

1847{
1848 TRACE("(%p,%p)\n", grad, matrix);
1849
1850 if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
1851 return InvalidParameter;
1852
1853 grad->transform = *matrix;
1854
1855 return Ok;
1856}

◆ GdipSetPathGradientWrapMode()

GpStatus WINGDIPAPI GdipSetPathGradientWrapMode ( GpPathGradient grad,
GpWrapMode  wrap 
)

Definition at line 1832 of file brush.c.

1834{
1835 TRACE("(%p, %d)\n", grad, wrap);
1836
1837 if(!grad || grad->brush.bt != BrushTypePathGradient)
1838 return InvalidParameter;
1839
1840 grad->wrap = wrap;
1841
1842 return Ok;
1843}

◆ GdipSetPathMarker()

GpStatus WINGDIPAPI GdipSetPathMarker ( GpPath path)

Definition at line 2421 of file graphicspath.c.

2422{
2423 INT count;
2424
2425 TRACE("(%p)\n", path);
2426
2427 if(!path)
2428 return InvalidParameter;
2429
2430 count = path->pathdata.Count;
2431
2432 /* set marker flag */
2433 if(count > 0)
2434 path->pathdata.Types[count-1] |= PathPointTypePathMarker;
2435
2436 return Ok;
2437}

Referenced by test_nextmarker(), and test_nextmarkerpath().

◆ GdipSetPenBrushFill()

GpStatus WINGDIPAPI GdipSetPenBrushFill ( GpPen pen,
GpBrush brush 
)

Definition at line 502 of file pen.c.

503{
504 TRACE("(%p, %p)\n", pen, brush);
505
506 if(!pen || !brush)
507 return InvalidParameter;
508
510 return GdipCloneBrush(brush, &pen->brush);
511}

Referenced by test_brushfill().

◆ GdipSetPenColor()

GpStatus WINGDIPAPI GdipSetPenColor ( GpPen pen,
ARGB  argb 
)

Definition at line 513 of file pen.c.

514{
515 TRACE("(%p, %x)\n", pen, argb);
516
517 if(!pen)
518 return InvalidParameter;
519
520 if(pen->brush->bt != BrushTypeSolidColor)
521 return NotImplemented;
522
523 return GdipSetSolidFillColor(((GpSolidFill*)pen->brush), argb);
524}
GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
Definition: brush.c:1925

◆ GdipSetPenCompoundArray()

GpStatus WINGDIPAPI GdipSetPenCompoundArray ( GpPen pen,
GDIPCONST REAL dash,
INT  count 
)

Definition at line 536 of file pen.c.

538{
539 FIXME("(%p, %p, %i): stub\n", pen, dash, count);
540
541 if (!pen || !dash || count < 2 || count%2 == 1)
542 return InvalidParameter;
543
544 return NotImplemented;
545}

Referenced by test_compoundarray().

◆ GdipSetPenCustomEndCap()

GpStatus WINGDIPAPI GdipSetPenCustomEndCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 547 of file pen.c.

548{
551
552 TRACE("(%p, %p)\n", pen, customCap);
553
554 /* native crashes on pen == NULL, customCap != NULL */
555 if(!customCap) return InvalidParameter;
556
557 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
559 pen->endcap = LineCapCustom;
560 pen->customend = cap;
561 }
562
563 return ret;
564}
@ LineCapCustom
Definition: gdiplusenums.h:72
#define cap
Definition: glfuncs.h:226

Referenced by test_customcap().

◆ GdipSetPenCustomStartCap()

GpStatus WINGDIPAPI GdipSetPenCustomStartCap ( GpPen pen,
GpCustomLineCap customCap 
)

Definition at line 566 of file pen.c.

567{
570
571 TRACE("(%p, %p)\n", pen, customCap);
572
573 /* native crashes on pen == NULL, customCap != NULL */
574 if(!customCap) return InvalidParameter;
575
576 if((ret = GdipCloneCustomLineCap(customCap, &cap)) == Ok){
578 pen->startcap = LineCapCustom;
579 pen->customstart = cap;
580 }
581
582 return ret;
583}

Referenced by test_customcap().

◆ GdipSetPenDashArray()

GpStatus WINGDIPAPI GdipSetPenDashArray ( GpPen pen,
GDIPCONST REAL dash,
INT  count 
)

Definition at line 585 of file pen.c.

587{
588 INT i;
589 REAL sum = 0;
590
591 TRACE("(%p, %p, %d)\n", pen, dash, count);
592
593 if(!pen || !dash)
594 return InvalidParameter;
595
596 if(count <= 0)
597 return OutOfMemory;
598
599 for(i = 0; i < count; i++){
600 sum += dash[i];
601 if(dash[i] < 0.0)
602 return InvalidParameter;
603 }
604
605 if(sum == 0.0 && count)
606 return InvalidParameter;
607
608 heap_free(pen->dashes);
609 pen->dashes = NULL;
610
611 if(count > 0)
612 pen->dashes = heap_alloc_zero(count * sizeof(REAL));
613 if(!pen->dashes){
614 pen->numdashes = 0;
615 return OutOfMemory;
616 }
617
619 memcpy(pen->dashes, dash, count * sizeof(REAL));
620 pen->numdashes = count;
621
622 return Ok;
623}
GpStatus WINGDIPAPI GdipSetPenDashStyle(GpPen *pen, GpDashStyle dash)
Definition: pen.c:650
@ DashStyleCustom
Definition: gdiplusenums.h:183
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35

Referenced by test_dasharray().

◆ GdipSetPenDashCap197819()

GpStatus WINGDIPAPI GdipSetPenDashCap197819 ( GpPen pen,
GpDashCap  dashCap 
)

Definition at line 625 of file pen.c.

626{
627 TRACE("(%p, %d)\n", pen, dashCap);
628
629 if(!pen)
630 return InvalidParameter;
631
632 pen->dashcap = dashCap;
633
634 return Ok;
635}

◆ GdipSetPenDashOffset()

GpStatus WINGDIPAPI GdipSetPenDashOffset ( GpPen pen,
REAL  offset 
)

Definition at line 638 of file pen.c.

639{
640 TRACE("(%p, %.2f)\n", pen, offset);
641
642 if(!pen)
643 return InvalidParameter;
644
645 pen->offset = offset;
646
647 return Ok;
648}

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenDashStyle()

GpStatus WINGDIPAPI GdipSetPenDashStyle ( GpPen pen,
GpDashStyle  dash 
)

Definition at line 650 of file pen.c.

651{
652 TRACE("(%p, %d)\n", pen, dash);
653
654 if(!pen)
655 return InvalidParameter;
656
657 if(dash != DashStyleCustom){
658 heap_free(pen->dashes);
659 pen->dashes = NULL;
660 pen->numdashes = 0;
661 }
662
663 pen->dash = dash;
666 pen->style |= gdip_to_gdi_dash(dash);
667
668 return Ok;
669}
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(), and test_widen().

◆ GdipSetPenEndCap()

GpStatus WINGDIPAPI GdipSetPenEndCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 671 of file pen.c.

672{
673 TRACE("(%p, %d)\n", pen, cap);
674
675 if(!pen) return InvalidParameter;
676
677 /* The old custom cap gets deleted even if the new style is LineCapCustom. */
679 pen->customend = NULL;
680 pen->endcap = cap;
681
682 return Ok;
683}

Referenced by METAFILE_PlaybackObject(), and test_worldbounds().

◆ GdipSetPenLineCap197819()

GpStatus WINGDIPAPI GdipSetPenLineCap197819 ( GpPen pen,
GpLineCap  start,
GpLineCap  end,
GpDashCap  dash 
)

Definition at line 686 of file pen.c.

688{
689 TRACE("%p, %d, %d, %d)\n", pen, start, end, dash);
690
691 if(!pen)
692 return InvalidParameter;
693
696 pen->customend = NULL;
697 pen->customstart = NULL;
698
699 pen->startcap = start;
700 pen->endcap = end;
701 pen->dashcap = dash;
702
703 return Ok;
704}

◆ GdipSetPenLineJoin()

GpStatus WINGDIPAPI GdipSetPenLineJoin ( GpPen pen,
GpLineJoin  join 
)

Definition at line 708 of file pen.c.

709{
710 TRACE("(%p, %d)\n", pen, join);
711
712 if(!pen) return InvalidParameter;
713
714 pen->join = join;
716 pen->style |= gdip_to_gdi_join(join);
717
718 return Ok;
719}
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 721 of file pen.c.

722{
723 TRACE("(%p, %.2f)\n", pen, limit);
724
725 if(!pen)
726 return InvalidParameter;
727
728 pen->miterlimit = limit;
729
730 return Ok;
731}
GLint limit
Definition: glext.h:10326

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenMode()

GpStatus WINGDIPAPI GdipSetPenMode ( GpPen pen,
GpPenAlignment  mode 
)

Definition at line 757 of file pen.c.

758{
759 TRACE("(%p, %d)\n", pen, mode);
760
761 if(!pen) return InvalidParameter;
762
763 pen->align = mode;
764
765 return Ok;
766}

◆ GdipSetPenStartCap()

GpStatus WINGDIPAPI GdipSetPenStartCap ( GpPen pen,
GpLineCap  cap 
)

Definition at line 733 of file pen.c.

734{
735 TRACE("(%p, %d)\n", pen, cap);
736
737 if(!pen) return InvalidParameter;
738
740 pen->customstart = NULL;
741 pen->startcap = cap;
742
743 return Ok;
744}

Referenced by METAFILE_PlaybackObject().

◆ GdipSetPenTransform()

GpStatus WINGDIPAPI GdipSetPenTransform ( GpPen pen,
GpMatrix matrix 
)

Definition at line 432 of file pen.c.

433{
434 static int calls;
435
436 TRACE("(%p,%p)\n", pen, matrix);
437
438 if(!pen || !matrix)
439 return InvalidParameter;
440
441 if(!(calls++))
442 FIXME("(%p,%p) Semi-stub\n", pen, matrix);
443
444 pen->transform = *matrix;
445
446 return Ok;
447}

Referenced by test_transform().

◆ GdipSetPenWidth()

GpStatus WINGDIPAPI GdipSetPenWidth ( GpPen pen,
REAL  width 
)

Definition at line 746 of file pen.c.

747{
748 TRACE("(%p, %.2f)\n", pen, width);
749
750 if(!pen) return InvalidParameter;
751
752 pen->width = width;
753
754 return Ok;
755}

◆ GdipSetPixelOffsetMode()

GpStatus WINGDIPAPI GdipSetPixelOffsetMode ( GpGraphics graphics,
PixelOffsetMode  mode 
)

Definition at line 6229 of file graphics.c.

6231{
6232 TRACE("(%p, %d)\n", graphics, mode);
6233
6234 if(!graphics)
6235 return InvalidParameter;
6236
6237 if(graphics->busy)
6238 return ObjectBusy;
6239
6240 if(graphics->pixeloffset == mode)
6241 return Ok;
6242
6243 if(graphics->image && graphics->image->type == ImageTypeMetafile)
6244 {
6245 GpStatus stat;
6246
6249 if(stat != Ok)
6250 return stat;
6251 }
6252
6253 graphics->pixeloffset = mode;
6254
6255 return Ok;
6256}

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 4462 of file image.c.

4463{
4464 static int calls;
4465
4466 if (!image || !item) return InvalidParameter;
4467
4468 TRACE("(%p,%p:%#x,%u,%u,%p)\n", image, item, item->id, item->type, item->length, item->value);
4469
4470 if(!(calls++))
4471 FIXME("not implemented\n");
4472
4473 return Ok;
4474}

◆ GdipSetRenderingOrigin()

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

Definition at line 6258 of file graphics.c.

6259{
6260 static int calls;
6261
6262 TRACE("(%p,%i,%i)\n", graphics, x, y);
6263
6264 if (!(calls++))
6265 FIXME("value is unused in rendering\n");
6266
6267 if (!graphics)
6268 return InvalidParameter;
6269
6270 graphics->origin_x = x;
6271 graphics->origin_y = y;
6272
6273 return Ok;
6274}

◆ GdipSetSmoothingMode()

GpStatus WINGDIPAPI GdipSetSmoothingMode ( GpGraphics graphics,
SmoothingMode  mode 
)

Definition at line 6289 of file graphics.c.

6290{
6291 TRACE("(%p, %d)\n", graphics, mode);
6292
6293 if(!graphics)
6294 return InvalidParameter;
6295
6296 if(graphics->busy)
6297 return ObjectBusy;
6298
6299 if(graphics->smoothing == mode)
6300 return Ok;
6301
6302 if(graphics->image && graphics->image->type == ImageTypeMetafile) {
6303 GpStatus stat;
6304 BOOL antialias = (mode != SmoothingModeDefault &&
6306
6308 EmfPlusRecordTypeSetAntiAliasMode, (mode << 1) + antialias);
6309 if(stat != Ok)
6310 return stat;
6311 }
6312
6313 graphics->smoothing = mode;
6314
6315 return Ok;
6316}
@ SmoothingModeNone
Definition: gdiplusenums.h:126
@ SmoothingModeHighSpeed
Definition: gdiplusenums.h:124

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 1925 of file brush.c.

1926{
1927 TRACE("(%p, %x)\n", sf, argb);
1928
1929 if(!sf)
1930 return InvalidParameter;
1931
1932 sf->color = argb;
1933 return Ok;
1934}

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 357 of file stringformat.c.

358{
359 TRACE("(%p, %x)\n", format, flags);
360
361 if(!format)
362 return InvalidParameter;
363
364 format->attr = flags;
365
366 return Ok;
367}

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:312

◆ 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 = heap_alloc_zero(rangeCount * sizeof(CharacterRange));
301 if (!new_ranges)
302 return OutOfMemory;
303
304 heap_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 /* first time allocation */
323 if(format->tabcount == 0){
324 format->tabs = heap_alloc_zero(sizeof(REAL)*count);
325 if(!format->tabs)
326 return OutOfMemory;
327 }
328 /* reallocation */
329 if((format->tabcount < count) && (format->tabcount > 0)){
330 REAL *ptr;
331 ptr = heap_realloc(format->tabs, sizeof(REAL)*count);
332 if(!ptr)
333 return OutOfMemory;
334 format->tabs = ptr;
335 }
336 format->firsttab = firsttab;
337 format->tabcount = count;
338 memcpy(format->tabs, tabs, sizeof(REAL)*count);
339 }
340
341 return Ok;
342}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71

Referenced by test_tabstops().

◆ GdipSetStringFormatTrimming()

GpStatus WINGDIPAPI GdipSetStringFormatTrimming ( GpStringFormat format,
StringTrimming  trimming 
)

Definition at line 344 of file stringformat.c.

346{
347 TRACE("(%p, %i)\n", format, trimming);
348
349 if(!format)
350 return InvalidParameter;
351
352 format->trimming = trimming;
353
354 return Ok;
355}

◆ GdipSetTextContrast()

GpStatus WINGDIPAPI GdipSetTextContrast ( GpGraphics graphics,
UINT  contrast 
)

Definition at line 6318 of file graphics.c.

6319{
6320 TRACE("(%p, %d)\n", graphics, contrast);
6321
6322 if(!graphics)
6323 return InvalidParameter;
6324
6325 graphics->textcontrast = contrast;
6326
6327 return Ok;
6328}

Referenced by test_BeginContainer2().

◆ GdipSetTextRenderingHint()

GpStatus WINGDIPAPI GdipSetTextRenderingHint ( GpGraphics graphics,
TextRenderingHint  hint 
)

Definition at line 6330 of file graphics.c.

6332{
6333 TRACE("(%p, %d)\n", graphics, hint);
6334
6335 if(!graphics || hint > TextRenderingHintClearTypeGridFit)
6336 return InvalidParameter;
6337
6338 if(graphics->busy)
6339 return ObjectBusy;
6340
6341 if(graphics->texthint == hint)
6342 return Ok;
6343
6344 if(graphics->image && graphics->image->type == ImageTypeMetafile) {
6345 GpStatus stat;
6346
6349 if(stat != Ok)
6350 return stat;
6351 }
6352
6353 graphics->texthint = hint;
6354
6355 return Ok;
6356}
@ TextRenderingHintClearTypeGridFit
Definition: gdiplusenums.h:260

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 1939 of file brush.c.

1941{
1942 TRACE("(%p, %p)\n", texture, matrix);
1943
1944 if(!texture || !matrix)
1945 return InvalidParameter;
1946
1947 texture->transform = *matrix;
1948
1949 return Ok;
1950}

Referenced by metafile_deserialize_brush(), and test_transform().

◆ GdipSetTextureWrapMode()

GpStatus WINGDIPAPI GdipSetTextureWrapMode ( GpTexture brush,
GpWrapMode  wrapmode 
)

Definition at line 1957 of file brush.c.

1958{
1959 TRACE("(%p, %d)\n", brush, wrapmode);
1960
1961 if(!brush)
1962 return InvalidParameter;
1963
1964 brush->imageattributes->wrap = wrapmode;
1965
1966 return Ok;
1967}

Referenced by test_texturewrap().

◆ GdipSetWorldTransform()

GpStatus WINGDIPAPI GdipSetWorldTransform ( GpGraphics graphics,
GpMatrix matrix 
)

Definition at line 6358 of file graphics.c.

6359{
6360 GpStatus stat;
6361
6362 TRACE("(%p, %p)\n", graphics, matrix);
6363
6364 if(!graphics || !matrix)
6365 return InvalidParameter;
6366
6367 if(graphics->busy)
6368 return ObjectBusy;
6369
6370 TRACE("%f,%f,%f,%f,%f,%f\n",
6371 matrix->matrix[0], matrix->matrix[1], matrix->matrix[2],
6372 matrix->matrix[3], matrix->matrix[4], matrix->matrix[5]);
6373
6374 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
6376
6377 if (stat != Ok)
6378 return stat;
6379 }
6380
6381 graphics->worldtrans = *matrix;
6382
6383 return Ok;
6384}
GpStatus METAFILE_SetWorldTransform(GpMetafile *metafile, GDIPCONST GpMatrix *transform) DECLSPEC_HIDDEN
Definition: metafile.c:1237

Referenced by METAFILE_PlaybackUpdateWorldTransform(), test_BeginContainer2(), test_clipping(), test_clipping_2(), test_DrawImage_scale(), test_font_transform(), test_Get_Release_DC(), test_isinfinite(), and test_worldtransform().

◆ GdipShearMatrix()

GpStatus WINGDIPAPI GdipShearMatrix ( GpMatrix matrix,
REAL  shearX,
REAL  shearY,
GpMatrixOrder  order 
)

Definition at line 335 of file matrix.c.

337{
338 REAL shear[6];
339
340 TRACE("(%p, %.2f, %.2f, %d)\n", matrix, shearX, shearY, order);
341
342 if(!matrix)
343 return InvalidParameter;
344
345 /* prepare transformation matrix */
346 shear[0] = 1.0;
347 shear[1] = shearY;
348 shear[2] = shearX;
349 shear[3] = 1.0;
350 shear[4] = 0.0;
351 shear[5] = 0.0;
352
354 matrix_multiply(matrix->matrix, shear, matrix->matrix);
355 else if (order == MatrixOrderPrepend)
356 matrix_multiply(shear, matrix->matrix, matrix->matrix);
357 else
358 return InvalidParameter;
359
360 return Ok;
361}

Referenced by test_font_transform(), and test_shear().

◆ GdipStartPathFigure()

GpStatus WINGDIPAPI GdipStartPathFigure ( GpPath path)

Definition at line 1744 of file graphicspath.c.

1745{
1746 TRACE("(%p)\n", path);
1747
1748 if(!path)
1749 return InvalidParameter;
1750
1751 path->newfigure = TRUE;
1752
1753 return Ok;
1754}

Referenced by test_getsubpathcount().

◆ 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 408 of file stringformat.c.

409{
410 if(!format)
411 return InvalidParameter;
412
414
415 TRACE("%p => %p\n", format, *format);
416
417 return Ok;
418}

Referenced by test_font_transform(), and test_getgenerictypographic().

◆ GdipTestControl()

GpStatus WINGDIPAPI GdipTestControl ( GpTestControlEnum  control,
void param 
)

Definition at line 5326 of file image.c.

5327{
5328 TRACE("(%d, %p)\n", control, param);
5329
5330 switch(control){
5332 if(param)
5333 FIXME("TestControlForceBilinear not handled\n");
5334 break;
5335 case TestControlNoICM:
5336 if(param)
5337 FIXME("TestControlNoICM not handled\n");
5338 break;
5340 *((DWORD*)param) = 3102;
5341 break;
5342 }
5343
5344 return Ok;
5345}
@ TestControlNoICM
Definition: gdiplusenums.h:375
@ TestControlForceBilinear
Definition: gdiplusenums.h:374
@ TestControlGetBuildNumber
Definition: gdiplusenums.h:376

Referenced by test_testcontrol().

◆ GdipTransformMatrixPoints()

GpStatus WINGDIPAPI GdipTransformMatrixPoints ( GpMatrix matrix,
GpPointF pts,
INT  count 
)

Definition at line 363 of file matrix.c.

365{
366 REAL x, y;
367 INT i;
368
369 TRACE("(%p, %p, %d)\n", matrix, pts, count);
370
371 if(!matrix || !pts || count <= 0)
372 return InvalidParameter;
373
374 for(i = 0; i < count; i++)
375 {
376 x = pts[i].X;
377 y = pts[i].Y;
378
379 pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2] + matrix->matrix[4];
380 pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3] + matrix->matrix[5];
381 }
382
383 return Ok;
384}

Referenced by brush_fill_pixels(), draw_cap(), gdip_transform_points(), GdipDrawImagePointsRect(), GdipGetLogFontW(), GdipGetPathWorldBounds(), GdipMeasureDriverString(), GdipTransformMatrixPointsI(), GdipTransformPath(), get_font_hfont(), prepare_dc(), test_transform(), and transform_region_element().

◆ GdipTransformMatrixPointsI()

GpStatus WINGDIPAPI GdipTransformMatrixPointsI ( GpMatrix matrix,
GpPoint pts,
INT  count 
)

Definition at line 386 of file matrix.c.

387{
388 GpPointF *ptsF;
390 INT i;
391
392 TRACE("(%p, %p, %d)\n", matrix, pts, count);
393
394 if(count <= 0)
395 return InvalidParameter;
396
397 ptsF = heap_alloc_zero(sizeof(GpPointF) * count);
398 if(!ptsF)
399 return OutOfMemory;
400
401 for(i = 0; i < count; i++){
402 ptsF[i].X = (REAL)pts[i].X;
403 ptsF[i].Y = (REAL)pts[i].Y;
404 }
405
407
408 if(ret == Ok)
409 for(i = 0; i < count; i++){
410 pts[i].X = gdip_round(ptsF[i].X);
411 pts[i].Y = gdip_round(ptsF[i].Y);
412 }
413 heap_free(ptsF);
414
415 return ret;
416}

◆ GdipTransformPath()

GpStatus WINGDIPAPI GdipTransformPath ( GpPath path,
GpMatrix matrix 
)

Definition at line 1782 of file graphicspath.c.

1783{
1784 TRACE("(%p, %p)\n", path, matrix);
1785
1786 if(!path)
1787 return InvalidParameter;
1788
1789 if(path->pathdata.Count == 0 || !matrix)
1790 return Ok;
1791
1792 return GdipTransformMatrixPoints(matrix, path->pathdata.Points,
1793 path->pathdata.Count);
1794}

Referenced by brush_fill_pixels(), GdipFlattenPath(), GdipIsOutlineVisiblePathPoint(), 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 6960 of file graphics.c.

6962{
6963 if(!graphics || !points || count <= 0 ||
6964 dst_space < 0 || dst_space > CoordinateSpaceDevice ||
6965 src_space < 0 || src_space > CoordinateSpaceDevice)
6966 return InvalidParameter;
6967
6968 if(graphics->busy)
6969 return ObjectBusy;
6970
6971 TRACE("(%p, %d, %d, %p, %d)\n", graphics, dst_space, src_space, points, count);
6972
6973 if (src_space == dst_space) return Ok;
6974
6975 return gdip_transform_points(graphics, dst_space, src_space, points, count);
6976}

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 6978 of file graphics.c.

6980{
6981 GpPointF *pointsF;
6982 GpStatus ret;
6983 INT i;
6984
6985 TRACE("(%p, %d, %d, %p, %d)\n", graphics, dst_space, src_space, points, count);
6986
6987 if(count <= 0)
6988 return InvalidParameter;
6989
6990 pointsF = heap_alloc_zero(sizeof(GpPointF) * count);
6991 if(!pointsF)
6992 return OutOfMemory;
6993
6994 for(i = 0; i < count; i++){
6995 pointsF[i].X = (REAL)points[i].X;
6996 pointsF[i].Y = (REAL)points[i].Y;
6997 }
6998
6999 ret = GdipTransformPoints(graphics, dst_space, src_space, pointsF, count);
7000
7001 if(ret == Ok)
7002 for(i = 0; i < count; i++){
7003 points[i].X = gdip_round(pointsF[i].X);
7004 points[i].Y = gdip_round(pointsF[i].Y);
7005 }
7006 heap_free(pointsF);
7007
7008 return ret;
7009}

Referenced by test_transformpoints().

◆ GdipTransformRegion()

GpStatus WINGDIPAPI GdipTransformRegion ( GpRegion region,
GpMatrix matrix 
)

Definition at line 1480 of file region.c.

1481{
1482 TRACE("(%p, %p)\n", region, matrix);
1483
1484 if (!region || !matrix)
1485 return InvalidParameter;
1486
1487 return transform_region_element(&region->node, matrix);
1488}
static GpStatus transform_region_element(region_element *element, GpMatrix *matrix)
Definition: region.c:1390

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 7026 of file graphics.c.

7027{
7028 TRACE("(%p, %.2f, %.2f)\n", graphics, dx, dy);
7029
7030 if(!graphics)
7031 return InvalidParameter;
7032
7033 if(graphics->busy)
7034 return ObjectBusy;
7035
7036 return GdipTranslateRegion(graphics->clip, dx, dy);
7037}
GpStatus WINGDIPAPI GdipTranslateRegion(GpRegion *region, REAL dx, REAL dy)
Definition: region.c:1520

Referenced by test_Get_Release_DC().

◆ GdipTranslateClipI()

GpStatus WINGDIPAPI GdipTranslateClipI ( GpGraphics graphics,
INT  dx,
INT  dy 
)

Definition at line 7042 of file graphics.c.

7043{
7044 TRACE("(%p, %d, %d)\n", graphics, dx, dy);
7045
7046 if(!graphics)
7047 return InvalidParameter;
7048
7049 if(graphics->busy)
7050 return ObjectBusy;
7051
7052 return GdipTranslateRegion(graphics->clip, (REAL)dx, (REAL)dy);
7053}

Referenced by test_Get_Release_DC().

◆ GdipTranslateLineTransform()

GpStatus WINGDIPAPI GdipTranslateLineTransform ( GpLineGradient brush,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 2166 of file brush.c.

2168{
2169 TRACE("(%p,%f,%f,%d)\n", brush, dx, dy, order);
2170
2171 if(!brush)
2172 return InvalidParameter;
2173
2174 return GdipTranslateMatrix(&brush->transform, dx, dy, order);
2175}

Referenced by test_transform().

◆ GdipTranslateMatrix()

GpStatus WINGDIPAPI GdipTranslateMatrix ( GpMatrix matrix,
REAL  offsetX,
REAL  offsetY,
GpMatrixOrder  order 
)

Definition at line 418 of file matrix.c.

420{
421 REAL translate[6];
422
423 TRACE("(%p, %.2f, %.2f, %d)\n", matrix, offsetX, offsetY, order);
424
425 if(!matrix)
426 return InvalidParameter;
427
428 translate[0] = 1.0;
429 translate[1] = 0.0;
430 translate[2] = 0.0;
431 translate[3] = 1.0;
432 translate[4] = offsetX;
433 translate[5] = offsetY;
434
436 matrix_multiply(matrix->matrix, translate, matrix->matrix);
437 else if (order == MatrixOrderPrepend)
438 matrix_multiply(translate, matrix->matrix, matrix->matrix);
439 else
440 return InvalidParameter;
441
442 return Ok;
443}
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586

Referenced by draw_cap(), GdipPlayMetafileRecord(), GdipTranslateLineTransform(), GdipTranslatePathGradientTransform(), GdipTranslatePenTransform(), GdipTranslateTextureTransform(), GdipTranslateWorldTransform(), linegradient_init_transform(), test_clipping(), test_clipping_2(), and test_font_transform().

◆ GdipTranslatePathGradientTransform()

GpStatus WINGDIPAPI GdipTranslatePathGradientTransform ( GpPathGradient grad,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 1914 of file brush.c.

1916{
1917 TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, dx, dy, order);
1918
1919 if (!grad || grad->brush.bt != BrushTypePathGradient)
1920 return InvalidParameter;
1921
1922 return GdipTranslateMatrix(&grad->transform, dx, dy, order);
1923}

◆ GdipTranslatePenTransform()

GpStatus WINGDIPAPI GdipTranslatePenTransform ( GpPen pen,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 461 of file pen.c.

462{
463 TRACE("(%p,%0.2f,%0.2f,%u)\n", pen, dx, dy, order);
464
465 if(!pen)
466 return InvalidParameter;
467
468 return GdipTranslateMatrix(&pen->transform, dx, dy, order);
469}

Referenced by test_transform().

◆ GdipTranslateRegion()

GpStatus WINGDIPAPI GdipTranslateRegion ( GpRegion region,
REAL  dx,
REAL  dy 
)

Definition at line 1520 of file region.c.

1521{
1522 TRACE("(%p, %f, %f)\n", region, dx, dy);
1523
1524 if(!region)
1525 return InvalidParameter;
1526
1527 translate_region_element(&region->node, dx, dy);
1528
1529 return Ok;
1530}
static void translate_region_element(region_element *element, REAL dx, REAL dy)
Definition: region.c:1491

Referenced by GdipTranslateClip(), GdipTranslateClipI(), GdipTranslateRegionI(), test_getregiondata(), and test_translate().

◆ GdipTranslateRegionI()

GpStatus WINGDIPAPI GdipTranslateRegionI ( GpRegion region,
INT  dx,
INT  dy 
)

Definition at line 1535 of file region.c.

1536{
1537 TRACE("(%p, %d, %d)\n", region, dx, dy);
1538
1539 return GdipTranslateRegion(region, (REAL)dx, (REAL)dy);
1540}

◆ GdipTranslateTextureTransform()

GpStatus WINGDIPAPI GdipTranslateTextureTransform ( GpTexture brush,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 2180 of file brush.c.

2182{
2183 TRACE("(%p, %.2f, %.2f, %d)\n", brush, dx, dy, order);
2184
2185 if(!brush)
2186 return InvalidParameter;
2187
2188 return GdipTranslateMatrix(&brush->transform, dx, dy, order);
2189}

◆ GdipTranslateWorldTransform()

GpStatus WINGDIPAPI GdipTranslateWorldTransform ( GpGraphics graphics,
REAL  dx,
REAL  dy,
GpMatrixOrder  order 
)

Definition at line 6386 of file graphics.c.

6388{
6389 GpStatus stat;
6390
6391 TRACE("(%p, %.2f, %.2f, %d)\n", graphics, dx, dy, order);
6392
6393 if(!graphics)
6394 return InvalidParameter;
6395
6396 if(graphics->busy)
6397 return ObjectBusy;
6398
6399 if (graphics->image && graphics->image->type == ImageTypeMetafile) {
6401
6402 if (stat != Ok)
6403 return stat;
6404 }
6405
6406 return GdipTranslateMatrix(&graphics->worldtrans, dx, dy, order);
6407}
GpStatus METAFILE_TranslateWorldTransform(GpMetafile *metafile, REAL dx, REAL dy, MatrixOrder order) DECLSPEC_HIDDEN
Definition: metafile.c:1330

Referenced by test_GdipIsVisiblePoint(), test_GdipIsVisibleRect(), test_Get_Release_DC(), test_isvisiblepoint(), test_isvisiblerect(), test_transformpoints(), and test_worldtransform().

◆ GdipVectorTransformMatrixPoints()

GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints ( GpMatrix matrix,
GpPointF pts,
INT  count 
)

Definition at line 445 of file matrix.c.

446{
447 REAL x, y;
448 INT i;
449
450 TRACE("(%p, %p, %d)\n", matrix, pts, count);
451
452 if(!matrix || !pts || count <= 0)
453 return InvalidParameter;
454
455 for(i = 0; i < count; i++)
456 {
457 x = pts[i].X;
458 y = pts[i].Y;
459
460 pts[i].X = x * matrix->matrix[0] + y * matrix->matrix[2];
461 pts[i].Y = x * matrix->matrix[1] + y * matrix->matrix[3];
462 }
463
464 return Ok;
465}

Referenced by GdipVectorTransformMatrixPointsI().

◆ GdipVectorTransformMatrixPointsI()

GpStatus WINGDIPAPI GdipVectorTransformMatrixPointsI ( GpMatrix matrix,
GpPoint pts,
INT  count 
)

Definition at line 467 of file matrix.c.

468{
469 GpPointF *ptsF;
471 INT i;
472
473 TRACE("(%p, %p, %d)\n", matrix, pts, count);
474
475 if(count <= 0)
476 return InvalidParameter;
477
478 ptsF = heap_alloc_zero(sizeof(GpPointF) * count);
479 if(!ptsF)
480 return OutOfMemory;
481
482 for(i = 0; i < count; i++){
483 ptsF[i].X = (REAL)pts[i].X;
484 ptsF[i].Y = (REAL)pts[i].Y;
485 }
486
488 /* store back */
489 if(ret == Ok)
490 for(i = 0; i < count; i++){
491 pts[i].X = gdip_round(ptsF[i].X);
492 pts[i].Y = gdip_round(ptsF[i].Y);
493 }
494 heap_free(ptsF);
495
496 return ret;
497}
GpStatus WINGDIPAPI GdipVectorTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count)
Definition: matrix.c:445

◆ 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 1796 of file graphicspath.c.

1799{
1800 FIXME("(%p,%p,%p,%i,%0.2f,%0.2f,%0.2f,%0.2f,%i,%0.2f)\n", path, matrix,
1801 points, count, x, y, width, height, warpmode, flatness);
1802
1803 return NotImplemented;
1804}

◆ GdipWidenPath()

GpStatus WINGDIPAPI GdipWidenPath ( GpPath path,
GpPen pen,
GpMatrix matrix,
REAL  flatness 
)

Definition at line 2197 of file graphicspath.c.

2199{
2200 GpPath *flat_path=NULL;
2202 path_list_node_t *points=NULL, *last_point=NULL;
2203 int i, subpath_start=0, new_length;
2204 BYTE type;
2205
2206 TRACE("(%p,%p,%p,%0.2f)\n", path, pen, matrix, flatness);
2207
2208 if (!path || !pen)
2209 return InvalidParameter;
2210
2211 if (path->pathdata.Count <= 1)
2212 return OutOfMemory;
2213
2214 status = GdipClonePath(path, &flat_path);
2215
2216 if (status == Ok)
2217 status = GdipFlattenPath(flat_path, pen->unit == UnitPixel ? matrix : NULL, flatness);
2218
2219 if (status == Ok && !init_path_list(&points, 314.0, 22.0))
2221
2222 if (status == Ok)
2223 {
2224 last_point = points;
2225
2226 if (pen->endcap > LineCapTriangle)
2227 FIXME("unimplemented end cap %x\n", pen->endcap);
2228
2229 if (pen->startcap > LineCapTriangle)
2230 FIXME("unimplemented start cap %x\n", pen->startcap);
2231
2232 if (pen->dashcap != DashCapFlat)
2233 FIXME("unimplemented dash cap %d\n", pen->dashcap);
2234
2235 if (pen->join == LineJoinRound)
2236 FIXME("unimplemented line join %d\n", pen->join);
2237
2238 if (pen->align != PenAlignmentCenter)
2239 FIXME("unimplemented pen alignment %d\n", pen->align);
2240
2241 for (i=0; i < flat_path->pathdata.Count; i++)
2242 {
2243 type = flat_path->pathdata.Types[i];
2244
2246 subpath_start = i;
2247
2249 {
2250 if (pen->dash != DashStyleSolid)
2251 widen_dashed_figure(flat_path, pen, subpath_start, i, 1, &last_point);
2252 else
2253 widen_closed_figure(flat_path, pen, subpath_start, i, &last_point);
2254 }
2255 else if (i == flat_path->pathdata.Count-1 ||
2257 {
2258 if (pen->dash != DashStyleSolid)
2259 widen_dashed_figure(flat_path, pen, subpath_start, i, 0, &last_point);
2260 else
2261 widen_open_figure(flat_path->pathdata.Points, pen, subpath_start, i, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point);
2262 }
2263 }
2264
2265 new_length = path_list_count(points)-1;
2266
2267 if (!lengthen_path(path, new_length))
2269 }
2270
2271 if (status == Ok)
2272 {
2273 path->pathdata.Count = new_length;
2274
2275 last_point = points->next;
2276 for (i = 0; i < new_length; i++)
2277 {
2278 path->pathdata.Points[i] = last_point->pt;
2279 path->pathdata.Types[i] = last_point->type;
2280 last_point = last_point->next;
2281 }
2282
2283 path->fill = FillModeWinding;
2284 }
2285
2287
2288 GdipDeletePath(flat_path);
2289
2290 if (status == Ok && pen->unit != UnitPixel)
2292
2293 return status;
2294}
static void widen_closed_figure(GpPath *path, GpPen *pen, int start, int end, path_list_node_t **last_point)
static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end, int closed, path_list_node_t **last_point)
static void widen_open_figure(const GpPointF *points, GpPen *pen, int start, int end, GpLineCap start_cap, GpCustomLineCap *start_custom, GpLineCap end_cap, GpCustomLineCap *end_custom, path_list_node_t **last_point)
GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix *matrix, REAL flatness)
@ DashCapFlat
Definition: gdiplusenums.h:171
@ LineJoinRound
Definition: gdiplusenums.h:108
@ PenAlignmentCenter
Definition: gdiplusenums.h:155

Referenced by GdipIsOutlineVisiblePathPoint(), SOFTWARE_GdipDrawPath(), and test_widen().

◆ GdipWindingModeOutline()

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

Definition at line 2458 of file graphicspath.c.

2459{
2460 FIXME("stub: %p, %p, %.2f\n", path, matrix, flatness);
2461 return NotImplemented;
2462}