ReactOS 0.4.15-dev-7918-g2a2556c
metafile.c File Reference
#include <stdarg.h>
#include <math.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "ocidl.h"
#include "olectl.h"
#include "ole2.h"
#include "winreg.h"
#include "shlwapi.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"
#include "wine/list.h"
Include dependency graph for metafile.c:

Go to the source code of this file.

Classes

struct  EmfPlusRecordHeader
 
struct  EmfPlusHeader
 
struct  EmfPlusClear
 
struct  EmfPlusFillRects
 
struct  EmfPlusSetClipRect
 
struct  EmfPlusSetPageTransform
 
struct  EmfPlusRect
 
struct  EmfPlusSetWorldTransform
 
struct  EmfPlusScaleWorldTransform
 
struct  EmfPlusMultiplyWorldTransform
 
struct  EmfPlusRotateWorldTransform
 
struct  EmfPlusTranslateWorldTransform
 
struct  EmfPlusBeginContainer
 
struct  EmfPlusContainerRecord
 
struct  container
 
struct  EmfPlusTransformMatrix
 
struct  EmfPlusDashedLineData
 
struct  EmfPlusCompoundLineData
 
struct  EmfPlusCustomStartCapData
 
struct  EmfPlusCustomEndCapData
 
struct  EmfPlusPenData
 
struct  EmfPlusSolidBrushData
 
struct  EmfPlusHatchBrushData
 
struct  EmfPlusTextureBrushData
 
struct  EmfPlusRectF
 
struct  EmfPlusLinearGradientBrushData
 
struct  EmfPlusBrush
 
struct  EmfPlusPen
 
struct  EmfPlusPath
 
struct  EmfPlusRegionNodePath
 
struct  EmfPlusRegion
 
struct  EmfPlusPalette
 
struct  EmfPlusBitmap
 
struct  EmfPlusMetafile
 
struct  EmfPlusImage
 
struct  EmfPlusImageAttributes
 
struct  EmfPlusObject
 
struct  EmfPlusPointR7
 
struct  EmfPlusPoint
 
struct  EmfPlusPointF
 
struct  EmfPlusDrawImage
 
struct  EmfPlusDrawImagePoints
 
struct  EmfPlusDrawPath
 
struct  EmfPlusDrawArc
 
struct  EmfPlusDrawEllipse
 
struct  EmfPlusDrawPie
 
struct  EmfPlusDrawRects
 
struct  EmfPlusFillPath
 
struct  EmfPlusFillClosedCurve
 
struct  EmfPlusFillEllipse
 
struct  EmfPlusFillPie
 
struct  EmfPlusFont
 
struct  enum_metafile_data
 

Macros

#define NONAMELESSUNION
 
#define COBJMACROS
 

Typedefs

typedef ARGB EmfPlusARGB
 
typedef struct EmfPlusRecordHeader EmfPlusRecordHeader
 
typedef struct EmfPlusHeader EmfPlusHeader
 
typedef struct EmfPlusClear EmfPlusClear
 
typedef struct EmfPlusFillRects EmfPlusFillRects
 
typedef struct EmfPlusSetClipRect EmfPlusSetClipRect
 
typedef struct EmfPlusSetPageTransform EmfPlusSetPageTransform
 
typedef struct EmfPlusRect EmfPlusRect
 
typedef struct EmfPlusSetWorldTransform EmfPlusSetWorldTransform
 
typedef struct EmfPlusScaleWorldTransform EmfPlusScaleWorldTransform
 
typedef struct EmfPlusMultiplyWorldTransform EmfPlusMultiplyWorldTransform
 
typedef struct EmfPlusRotateWorldTransform EmfPlusRotateWorldTransform
 
typedef struct EmfPlusTranslateWorldTransform EmfPlusTranslateWorldTransform
 
typedef struct EmfPlusBeginContainer EmfPlusBeginContainer
 
typedef struct EmfPlusContainerRecord EmfPlusContainerRecord
 
typedef struct container container
 
typedef struct EmfPlusTransformMatrix EmfPlusTransformMatrix
 
typedef struct EmfPlusDashedLineData EmfPlusDashedLineData
 
typedef struct EmfPlusCompoundLineData EmfPlusCompoundLineData
 
typedef struct EmfPlusCustomStartCapData EmfPlusCustomStartCapData
 
typedef struct EmfPlusCustomEndCapData EmfPlusCustomEndCapData
 
typedef struct EmfPlusPenData EmfPlusPenData
 
typedef struct EmfPlusSolidBrushData EmfPlusSolidBrushData
 
typedef struct EmfPlusHatchBrushData EmfPlusHatchBrushData
 
typedef struct EmfPlusTextureBrushData EmfPlusTextureBrushData
 
typedef struct EmfPlusRectF EmfPlusRectF
 
typedef struct EmfPlusLinearGradientBrushData EmfPlusLinearGradientBrushData
 
typedef struct EmfPlusBrush EmfPlusBrush
 
typedef struct EmfPlusPen EmfPlusPen
 
typedef struct EmfPlusPath EmfPlusPath
 
typedef struct EmfPlusRegionNodePath EmfPlusRegionNodePath
 
typedef struct EmfPlusRegion EmfPlusRegion
 
typedef struct EmfPlusPalette EmfPlusPalette
 
typedef struct EmfPlusBitmap EmfPlusBitmap
 
typedef struct EmfPlusMetafile EmfPlusMetafile
 
typedef enum ImageDataType ImageDataType
 
typedef struct EmfPlusImage EmfPlusImage
 
typedef struct EmfPlusImageAttributes EmfPlusImageAttributes
 
typedef struct EmfPlusObject EmfPlusObject
 
typedef struct EmfPlusPointR7 EmfPlusPointR7
 
typedef struct EmfPlusPoint EmfPlusPoint
 
typedef struct EmfPlusPointF EmfPlusPointF
 
typedef struct EmfPlusDrawImage EmfPlusDrawImage
 
typedef struct EmfPlusDrawImagePoints EmfPlusDrawImagePoints
 
typedef struct EmfPlusDrawPath EmfPlusDrawPath
 
typedef struct EmfPlusDrawArc EmfPlusDrawArc
 
typedef struct EmfPlusDrawEllipse EmfPlusDrawEllipse
 
typedef struct EmfPlusDrawPie EmfPlusDrawPie
 
typedef struct EmfPlusDrawRects EmfPlusDrawRects
 
typedef struct EmfPlusFillPath EmfPlusFillPath
 
typedef struct EmfPlusFillClosedCurve EmfPlusFillClosedCurve
 
typedef struct EmfPlusFillEllipse EmfPlusFillEllipse
 
typedef struct EmfPlusFillPie EmfPlusFillPie
 
typedef struct EmfPlusFont EmfPlusFont
 

Enumerations

enum  container_type { BEGIN_CONTAINER , SAVE_GRAPHICS }
 
enum  PenDataFlags {
  PenDataTransform = 0x0001 , PenDataStartCap = 0x0002 , PenDataEndCap = 0x0004 , PenDataJoin = 0x0008 ,
  PenDataMiterLimit = 0x0010 , PenDataLineStyle = 0x0020 , PenDataDashedLineCap = 0x0040 , PenDataDashedLineOffset = 0x0080 ,
  PenDataDashedLine = 0x0100 , PenDataNonCenter = 0x0200 , PenDataCompoundLine = 0x0400 , PenDataCustomStartCap = 0x0800 ,
  PenDataCustomEndCap = 0x1000
}
 
enum  LineStyle {
  LineStyleSolid , LineStyleDash , LineStyleDot , LineStyleDashDot ,
  LineStyleDashDotDot , LineStyleCustom
}
 
enum  BrushDataFlags {
  BrushDataPath = 1 << 0 , BrushDataTransform = 1 << 1 , BrushDataPresetColors = 1 << 2 , BrushDataBlendFactorsH = 1 << 3 ,
  BrushDataBlendFactorsV = 1 << 4 , BrushDataFocusScales = 1 << 6 , BrushDataIsGammaCorrected = 1 << 7 , BrushDataDoNotTransform = 1 << 8
}
 
enum  BitmapDataType { BitmapDataTypePixel , BitmapDataTypeCompressed }
 
enum  ImageDataType {
  ImageDataTypeUnknown , ImageDataTypeBitmap , ImageDataTypeMetafile , ImageDataTypeUnknown ,
  ImageDataTypeBitmap , ImageDataTypeMetafile
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (gdiplus)
 
HRESULT WINAPI WICCreateImagingFactory_Proxy (UINT, IWICImagingFactory **)
 
static void metafile_free_object_table_entry (GpMetafile *metafile, BYTE id)
 
void METAFILE_Free (GpMetafile *metafile)
 
static DWORD METAFILE_AddObjectId (GpMetafile *metafile)
 
static GpStatus METAFILE_AllocateRecord (GpMetafile *metafile, DWORD size, void **result)
 
static void METAFILE_RemoveLastRecord (GpMetafile *metafile, EmfPlusRecordHeader *record)
 
static void METAFILE_WriteRecords (GpMetafile *metafile)
 
static GpStatus METAFILE_WriteHeader (GpMetafile *metafile, HDC hdc)
 
static GpStatus METAFILE_WriteEndOfFile (GpMetafile *metafile)
 
GpStatus WINGDIPAPI GdipRecordMetafile (HDC hdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipRecordMetafileI (HDC hdc, EmfType type, GDIPCONST GpRect *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipRecordMetafileStream (IStream *stream, HDC hdc, EmfType type, GDIPCONST GpRectF *frameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
 
static void METAFILE_AdjustFrame (GpMetafile *metafile, const GpPointF *points, UINT num_points)
 
GpStatus METAFILE_GetGraphicsContext (GpMetafile *metafile, GpGraphics **result)
 
GpStatus METAFILE_GetDC (GpMetafile *metafile, HDC *hdc)
 
GpStatus METAFILE_GraphicsClear (GpMetafile *metafile, ARGB color)
 
static BOOL is_integer_rect (const GpRectF *rect)
 
static GpStatus METAFILE_PrepareBrushData (GpBrush *brush, DWORD *size)
 
static void METAFILE_FillBrushData (GpBrush *brush, EmfPlusBrush *data)
 
static GpStatus METAFILE_AddBrushObject (GpMetafile *metafile, GpBrush *brush, DWORD *id)
 
GpStatus METAFILE_FillRectangles (GpMetafile *metafile, GpBrush *brush, GDIPCONST GpRectF *rects, INT count)
 
GpStatus METAFILE_SetClipRect (GpMetafile *metafile, REAL x, REAL y, REAL width, REAL height, CombineMode mode)
 
static GpStatus METAFILE_AddRegionObject (GpMetafile *metafile, GpRegion *region, DWORD *id)
 
GpStatus METAFILE_SetClipRegion (GpMetafile *metafile, GpRegion *region, CombineMode mode)
 
GpStatus METAFILE_SetPageTransform (GpMetafile *metafile, GpUnit unit, REAL scale)
 
GpStatus METAFILE_SetWorldTransform (GpMetafile *metafile, GDIPCONST GpMatrix *transform)
 
GpStatus METAFILE_ScaleWorldTransform (GpMetafile *metafile, REAL sx, REAL sy, MatrixOrder order)
 
GpStatus METAFILE_MultiplyWorldTransform (GpMetafile *metafile, GDIPCONST GpMatrix *matrix, MatrixOrder order)
 
GpStatus METAFILE_RotateWorldTransform (GpMetafile *metafile, REAL angle, MatrixOrder order)
 
GpStatus METAFILE_TranslateWorldTransform (GpMetafile *metafile, REAL dx, REAL dy, MatrixOrder order)
 
GpStatus METAFILE_ResetWorldTransform (GpMetafile *metafile)
 
GpStatus METAFILE_BeginContainer (GpMetafile *metafile, GDIPCONST GpRectF *dstrect, GDIPCONST GpRectF *srcrect, GpUnit unit, DWORD StackIndex)
 
GpStatus METAFILE_BeginContainerNoParams (GpMetafile *metafile, DWORD StackIndex)
 
GpStatus METAFILE_EndContainer (GpMetafile *metafile, DWORD StackIndex)
 
GpStatus METAFILE_SaveGraphics (GpMetafile *metafile, DWORD StackIndex)
 
GpStatus METAFILE_RestoreGraphics (GpMetafile *metafile, DWORD StackIndex)
 
GpStatus METAFILE_ReleaseDC (GpMetafile *metafile, HDC hdc)
 
GpStatus METAFILE_GraphicsDeleted (GpMetafile *metafile)
 
GpStatus WINGDIPAPI GdipGetHemfFromMetafile (GpMetafile *metafile, HENHMETAFILE *hEmf)
 
static void METAFILE_GetFinalGdiTransform (const GpMetafile *metafile, XFORM *result)
 
static GpStatus METAFILE_PlaybackUpdateGdiTransform (GpMetafile *metafile)
 
static GpStatus METAFILE_PlaybackGetDC (GpMetafile *metafile)
 
static void METAFILE_PlaybackReleaseDC (GpMetafile *metafile)
 
static GpStatus METAFILE_PlaybackUpdateClip (GpMetafile *metafile)
 
static GpStatus METAFILE_PlaybackUpdateWorldTransform (GpMetafile *metafile)
 
static void metafile_set_object_table_entry (GpMetafile *metafile, BYTE id, BYTE type, void *object)
 
static GpStatus metafile_deserialize_image (const BYTE *record_data, UINT data_size, GpImage **image)
 
static GpStatus metafile_deserialize_path (const BYTE *record_data, UINT data_size, GpPath **path)
 
static GpStatus metafile_read_region_node (struct memory_buffer *mbuf, GpRegion *region, region_element *node, UINT *count)
 
static GpStatus metafile_deserialize_region (const BYTE *record_data, UINT data_size, GpRegion **region)
 
static GpStatus metafile_deserialize_brush (const BYTE *record_data, UINT data_size, GpBrush **brush)
 
static GpStatus metafile_get_pen_brush_data_offset (EmfPlusPen *data, UINT data_size, DWORD *ret)
 
static GpStatus METAFILE_PlaybackObject (GpMetafile *metafile, UINT flags, UINT data_size, const BYTE *record_data)
 
static GpStatus metafile_set_clip_region (GpMetafile *metafile, GpRegion *region, CombineMode mode)
 
GpStatus WINGDIPAPI GdipPlayMetafileRecord (GDIPCONST GpMetafile *metafile, EmfPlusRecordType recordType, UINT flags, UINT dataSize, GDIPCONST BYTE *data)
 
static int CALLBACK enum_metafile_proc (HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
 
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)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpRectF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpRect *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpPointF *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
 
GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI (GpGraphics *graphics, GDIPCONST GpMetafile *metafile, GDIPCONST GpPoint *dest, EnumerateMetafileProc callback, VOID *cb_data, GDIPCONST GpImageAttributes *attrs)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile (GpMetafile *metafile, MetafileHeader *header)
 
static int CALLBACK get_emfplus_header_proc (HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf (HENHMETAFILE hemf, MetafileHeader *header)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromWmf (HMETAFILE hwmf, GDIPCONST WmfPlaceableFileHeader *placeable, MetafileHeader *header)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile (GDIPCONST WCHAR *filename, MetafileHeader *header)
 
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream (IStream *stream, MetafileHeader *header)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf (HENHMETAFILE hemf, BOOL delete, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromWmf (HMETAFILE hwmf, BOOL delete, GDIPCONST WmfPlaceableFileHeader *placeable, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile (GDIPCONST WCHAR *file, GDIPCONST WmfPlaceableFileHeader *placeable, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromFile (GDIPCONST WCHAR *file, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipCreateMetafileFromStream (IStream *stream, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit (GpMetafile *metafile, UINT limitDpi)
 
GpStatus WINGDIPAPI GdipConvertToEmfPlus (const GpGraphics *ref, GpMetafile *metafile, BOOL *succ, EmfType emfType, const WCHAR *description, GpMetafile **out_metafile)
 
GpStatus WINGDIPAPI GdipEmfToWmfBits (HENHMETAFILE hemf, UINT cbData16, LPBYTE pData16, INT iMapMode, INT eFlags)
 
GpStatus WINGDIPAPI GdipRecordMetafileFileName (GDIPCONST WCHAR *fileName, HDC hdc, EmfType type, GDIPCONST GpRectF *pFrameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipRecordMetafileFileNameI (GDIPCONST WCHAR *fileName, HDC hdc, EmfType type, GDIPCONST GpRect *pFrameRect, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile)
 
GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile (const GpGraphics *refGraphics, GpMetafile *metafile, BOOL *conversionSuccess, const WCHAR *filename, EmfType emfType, const WCHAR *description, GpMetafile **out_metafile)
 
static GpStatus METAFILE_CreateCompressedImageStream (GpImage *image, IStream **stream, DWORD *size)
 
static GpStatus METAFILE_FillEmfPlusBitmap (EmfPlusBitmap *record, IStream *stream, DWORD size)
 
static GpStatus METAFILE_AddImageObject (GpMetafile *metafile, GpImage *image, DWORD *id)
 
static GpStatus METAFILE_AddImageAttributesObject (GpMetafile *metafile, const GpImageAttributes *attrs, DWORD *id)
 
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)
 
GpStatus METAFILE_AddSimpleProperty (GpMetafile *metafile, SHORT prop, SHORT val)
 
static GpStatus METAFILE_AddPathObject (GpMetafile *metafile, GpPath *path, DWORD *id)
 
static GpStatus METAFILE_AddPenObject (GpMetafile *metafile, GpPen *pen, DWORD *id)
 
GpStatus METAFILE_DrawPath (GpMetafile *metafile, GpPen *pen, GpPath *path)
 
GpStatus METAFILE_FillPath (GpMetafile *metafile, GpBrush *brush, GpPath *path)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 30 of file metafile.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 23 of file metafile.c.

Typedef Documentation

◆ container

◆ EmfPlusARGB

typedef ARGB EmfPlusARGB

Definition at line 48 of file metafile.c.

◆ EmfPlusBeginContainer

◆ EmfPlusBitmap

◆ EmfPlusBrush

◆ EmfPlusClear

◆ EmfPlusCompoundLineData

◆ EmfPlusContainerRecord

◆ EmfPlusCustomEndCapData

◆ EmfPlusCustomStartCapData

◆ EmfPlusDashedLineData

◆ EmfPlusDrawArc

◆ EmfPlusDrawEllipse

◆ EmfPlusDrawImage

◆ EmfPlusDrawImagePoints

◆ EmfPlusDrawPath

◆ EmfPlusDrawPie

◆ EmfPlusDrawRects

◆ EmfPlusFillClosedCurve

◆ EmfPlusFillEllipse

◆ EmfPlusFillPath

◆ EmfPlusFillPie

◆ EmfPlusFillRects

◆ EmfPlusFont

◆ EmfPlusHatchBrushData

◆ EmfPlusHeader

◆ EmfPlusImage

◆ EmfPlusImageAttributes

◆ EmfPlusLinearGradientBrushData

◆ EmfPlusMetafile

◆ EmfPlusMultiplyWorldTransform

◆ EmfPlusObject

◆ EmfPlusPalette

◆ EmfPlusPath

◆ EmfPlusPen

◆ EmfPlusPenData

◆ EmfPlusPoint

◆ EmfPlusPointF

◆ EmfPlusPointR7

◆ EmfPlusRecordHeader

◆ EmfPlusRect

◆ EmfPlusRectF

◆ EmfPlusRegion

◆ EmfPlusRegionNodePath

◆ EmfPlusRotateWorldTransform

◆ EmfPlusScaleWorldTransform

◆ EmfPlusSetClipRect

◆ EmfPlusSetPageTransform

◆ EmfPlusSetWorldTransform

◆ EmfPlusSolidBrushData

◆ EmfPlusTextureBrushData

◆ EmfPlusTransformMatrix

◆ EmfPlusTranslateWorldTransform

◆ ImageDataType

Enumeration Type Documentation

◆ BitmapDataType

Enumerator
BitmapDataTypePixel 
BitmapDataTypeCompressed 

Definition at line 331 of file metafile.c.

332{
BitmapDataType
Definition: metafile.c:332
@ BitmapDataTypePixel
Definition: metafile.c:333
@ BitmapDataTypeCompressed
Definition: metafile.c:334

◆ BrushDataFlags

Enumerator
BrushDataPath 
BrushDataTransform 
BrushDataPresetColors 
BrushDataBlendFactorsH 
BrushDataBlendFactorsV 
BrushDataFocusScales 
BrushDataIsGammaCorrected 
BrushDataDoNotTransform 

Definition at line 228 of file metafile.c.

229{
230 BrushDataPath = 1 << 0,
231 BrushDataTransform = 1 << 1,
232 BrushDataPresetColors = 1 << 2,
233 BrushDataBlendFactorsH = 1 << 3,
234 BrushDataBlendFactorsV = 1 << 4,
235 BrushDataFocusScales = 1 << 6,
238};
@ BrushDataBlendFactorsH
Definition: metafile.c:233
@ BrushDataTransform
Definition: metafile.c:231
@ BrushDataBlendFactorsV
Definition: metafile.c:234
@ BrushDataPresetColors
Definition: metafile.c:232
@ BrushDataDoNotTransform
Definition: metafile.c:237
@ BrushDataFocusScales
Definition: metafile.c:235
@ BrushDataPath
Definition: metafile.c:230
@ BrushDataIsGammaCorrected
Definition: metafile.c:236

◆ container_type

Enumerator
BEGIN_CONTAINER 
SAVE_GRAPHICS 

Definition at line 146 of file metafile.c.

147{
150};
@ SAVE_GRAPHICS
Definition: metafile.c:149
@ BEGIN_CONTAINER
Definition: metafile.c:148

◆ ImageDataType

Enumerator
ImageDataTypeUnknown 
ImageDataTypeBitmap 
ImageDataTypeMetafile 
ImageDataTypeUnknown 
ImageDataTypeBitmap 
ImageDataTypeMetafile 

Definition at line 354 of file metafile.c.

355{
ImageDataType
Definition: metafile.c:355
@ ImageDataTypeBitmap
Definition: metafile.c:357
@ ImageDataTypeUnknown
Definition: metafile.c:356
@ ImageDataTypeMetafile
Definition: metafile.c:358

◆ LineStyle

Enumerator
LineStyleSolid 
LineStyleDash 
LineStyleDot 
LineStyleDashDot 
LineStyleDashDotDot 
LineStyleCustom 

Definition at line 186 of file metafile.c.

187{
194};
@ LineStyleDot
Definition: metafile.c:190
@ LineStyleDashDotDot
Definition: metafile.c:192
@ LineStyleDashDot
Definition: metafile.c:191
@ LineStyleSolid
Definition: metafile.c:188
@ LineStyleDash
Definition: metafile.c:189
@ LineStyleCustom
Definition: metafile.c:193

◆ PenDataFlags

Enumerator
PenDataTransform 
PenDataStartCap 
PenDataEndCap 
PenDataJoin 
PenDataMiterLimit 
PenDataLineStyle 
PenDataDashedLineCap 
PenDataDashedLineOffset 
PenDataDashedLine 
PenDataNonCenter 
PenDataCompoundLine 
PenDataCustomStartCap 
PenDataCustomEndCap 

Definition at line 164 of file metafile.c.

165{
166 PenDataTransform = 0x0001,
167 PenDataStartCap = 0x0002,
168 PenDataEndCap = 0x0004,
169 PenDataJoin = 0x0008,
170 PenDataMiterLimit = 0x0010,
171 PenDataLineStyle = 0x0020,
172 PenDataDashedLineCap = 0x0040,
174 PenDataDashedLine = 0x0100,
175 PenDataNonCenter = 0x0200,
176 PenDataCompoundLine = 0x0400,
177 PenDataCustomStartCap = 0x0800,
178 PenDataCustomEndCap = 0x1000
179};
@ PenDataNonCenter
Definition: metafile.c:175
@ PenDataDashedLineCap
Definition: metafile.c:172
@ PenDataJoin
Definition: metafile.c:169
@ PenDataCustomEndCap
Definition: metafile.c:178
@ PenDataMiterLimit
Definition: metafile.c:170
@ PenDataStartCap
Definition: metafile.c:167
@ PenDataLineStyle
Definition: metafile.c:171
@ PenDataDashedLineOffset
Definition: metafile.c:173
@ PenDataCustomStartCap
Definition: metafile.c:177
@ PenDataTransform
Definition: metafile.c:166
@ PenDataCompoundLine
Definition: metafile.c:176
@ PenDataDashedLine
Definition: metafile.c:174
@ PenDataEndCap
Definition: metafile.c:168

Function Documentation

◆ enum_metafile_proc()

static int CALLBACK enum_metafile_proc ( HDC  hDC,
HANDLETABLE lpHTable,
const ENHMETARECORD lpEMFR,
int  nObj,
LPARAM  lpData 
)
static

Definition at line 3385 of file metafile.c.

3387{
3388 BOOL ret;
3389 struct enum_metafile_data *data = (struct enum_metafile_data*)lpData;
3390 const BYTE* pStr;
3391
3392 data->metafile->handle_table = lpHTable;
3393 data->metafile->handle_count = nObj;
3394
3395 /* First check for an EMF+ record. */
3396 if (lpEMFR->iType == EMR_GDICOMMENT)
3397 {
3398 const EMRGDICOMMENT *comment = (const EMRGDICOMMENT*)lpEMFR;
3399
3400 if (comment->cbData >= 4 && memcmp(comment->Data, "EMF+", 4) == 0)
3401 {
3402 int offset = 4;
3403
3404 while (offset + sizeof(EmfPlusRecordHeader) <= comment->cbData)
3405 {
3407
3408 if (record->DataSize)
3409 pStr = (const BYTE*)(record+1);
3410 else
3411 pStr = NULL;
3412
3413 ret = data->callback(record->Type, record->Flags, record->DataSize,
3414 pStr, data->callback_data);
3415
3416 if (!ret)
3417 return 0;
3418
3419 offset += record->Size;
3420 }
3421
3422 return 1;
3423 }
3424 }
3425
3426 if (lpEMFR->nSize != 8)
3427 pStr = (const BYTE*)lpEMFR->dParm;
3428 else
3429 pStr = NULL;
3430
3431 return data->callback(lpEMFR->iType, 0, lpEMFR->nSize-8,
3432 pStr, data->callback_data);
3433}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define NULL
Definition: types.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLintptr offset
Definition: glext.h:5920
if(dx< 0)
Definition: linetemp.h:194
#define comment(fmt, arg1)
Definition: rebar.c:820
HANDLETABLE * handle_table
GpMetafile * metafile
Definition: metafile.c:3382
DWORD dParm[1]
Definition: wingdi.h:2352
int ret
#define EMR_GDICOMMENT
Definition: wingdi.h:143
unsigned char BYTE
Definition: xxhash.c:193

Referenced by check_metafile(), and GdipEnumerateMetafileSrcRectDestPoints().

◆ GdipConvertToEmfPlus()

GpStatus WINGDIPAPI GdipConvertToEmfPlus ( const GpGraphics ref,
GpMetafile metafile,
BOOL succ,
EmfType  emfType,
const WCHAR description,
GpMetafile **  out_metafile 
)

Definition at line 3964 of file metafile.c.

3967{
3968 static int calls;
3969
3970 TRACE("(%p,%p,%p,%u,%s,%p)\n", ref, metafile, succ, emfType,
3971 debugstr_w(description), out_metafile);
3972
3973 if(!ref || !metafile || !out_metafile || emfType < EmfTypeEmfOnly || emfType > EmfTypeEmfPlusDual)
3974 return InvalidParameter;
3975
3976 if(succ)
3977 *succ = FALSE;
3978 *out_metafile = NULL;
3979
3980 if(!(calls++))
3981 FIXME("not implemented\n");
3982
3983 return NotImplemented;
3984}
#define FIXME(fmt,...)
Definition: debug.h:111
#define FALSE
Definition: types.h:117
@ EmfTypeEmfPlusDual
Definition: gdiplusenums.h:236
@ InvalidParameter
Definition: gdiplustypes.h:28
@ NotImplemented
Definition: gdiplustypes.h:32
#define debugstr_w
Definition: kernel32.h:32
static const unsigned char metafile[]
Definition: olepicture.c:138
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
const char * description
Definition: directx.c:2497

◆ GdipConvertToEmfPlusToFile()

GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile ( const GpGraphics refGraphics,
GpMetafile metafile,
BOOL conversionSuccess,
const WCHAR filename,
EmfType  emfType,
const WCHAR description,
GpMetafile **  out_metafile 
)

Definition at line 4018 of file metafile.c.

4022{
4023 FIXME("stub: %p, %p, %p, %p, %u, %p, %p\n", refGraphics, metafile, conversionSuccess, filename, emfType, description, out_metafile);
4024 return NotImplemented;
4025}
const char * filename
Definition: ioapi.h:137

◆ 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}
#define stat
Definition: acwin.h:99
static void list_init(struct list_entry *head)
Definition: list.h:51
float REAL
Definition: types.h:41
GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hemf, MetafileHeader *header)
Definition: metafile.c:3688
@ ImageTypeMetafile
Definition: gdiplusenums.h:196
@ UnitPixel
Definition: gdiplusenums.h:29
Status
Definition: gdiplustypes.h:25
@ Ok
Definition: gdiplustypes.h:26
@ OutOfMemory
Definition: gdiplustypes.h:29
Definition: stat.h:55

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}
#define GENERIC_READ
Definition: compat.h:135
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR *filename, UINT access, IStream **stream)
Definition: graphics.c:2558
GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, GpMetafile **metafile)
Definition: metafile.c:3936
Definition: fci.c:127
Definition: ps.c:97
Definition: parse.h:23

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}
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2155
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
Definition: image.c:4405
@ GenericError
Definition: gdiplustypes.h:27

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
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define TRUE
Definition: types.h:120
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete, GpMetafile **metafile)
Definition: metafile.c:3804
@ MetafileTypeWmf
Definition: gdiplusenums.h:217
@ MetafileTypeWmfPlaceable
Definition: gdiplusenums.h:218
unsigned int UINT
Definition: ndis.h:50
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().

◆ 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}

◆ 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
REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi)
Definition: gdiplus.c:327
static IPrintDialogCallback callback
Definition: printdlg.c:326
static char * dest
Definition: rtl.c:135
REAL Height
Definition: gdiplustypes.h:664
REAL X
Definition: gdiplustypes.h:661
REAL Width
Definition: gdiplustypes.h:663
REAL Y
Definition: gdiplustypes.h:662

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
REAL Y
Definition: gdiplustypes.h:649
REAL X
Definition: gdiplustypes.h:648

◆ 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}
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
GLsizei const GLfloat * points
Definition: glext.h:8112

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}
static int state
Definition: maze.c:121
static void list_remove(struct list_entry *entry)
Definition: list.h:90
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 GdipCreatePath(GpFillMode fill, GpPath **path)
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipAddPathPolygon(GpPath *path, GDIPCONST GpPointF *points, INT count)
Definition: graphicspath.c:844
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
GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
Definition: region.c:390
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
Definition: region.c:571
const char * debugstr_rectf(const RectF *rc)
Definition: gdiplus.c:476
const char * debugstr_pointf(const PointF *pt)
Definition: gdiplus.c:482
@ CombineModeIntersect
Definition: gdiplusenums.h:352
UINT GraphicsContainer
Definition: gdiplusenums.h:23
@ FillModeAlternate
Definition: gdiplusenums.h:55
@ UnitDisplay
Definition: gdiplusenums.h:28
@ MetafileTypeEmf
Definition: gdiplusenums.h:219
@ CoordinateSpaceDevice
Definition: gdiplusenums.h:369
@ CoordinateSpaceWorld
Definition: gdiplusenums.h:367
@ ObjectBusy
Definition: gdiplustypes.h:30
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GpRegion * base_clip
struct list containers
GpMatrix * world_transform
GpGraphics * playback_graphics
GpUnit page_unit
GpRectF src_rect
GpRegion * clip
GpPointF playback_points[3]
struct list entry
Definition: metafile.c:154
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().

◆ 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().

◆ 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
static INT gdip_round(REAL x)
@ 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
#define memset(x, y, z)
Definition: compat.h:39

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}

◆ 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}
static HRGN hrgn
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algobase.h:449
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define ERR(fmt,...)
Definition: debug.h:110
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
Definition: brush.c:994
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
Definition: brush.c:757
GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4567
GpStatus WINGDIPAPI GdipDrawEllipseI(GpGraphics *graphics, GpPen *pen, INT x, INT y, INT width, INT height)
Definition: graphics.c:2960
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4290
GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics, CompositingMode mode)
Definition: graphics.c:6085
GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill)
Definition: graphics.c:4213
GpStatus WINGDIPAPI GdipDrawPie(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4091
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
Definition: graphics.c:5076
GpStatus WINGDIPAPI GdipDrawRectangles(GpGraphics *graphics, GpPen *pen, GDIPCONST GpRectF *rects, INT count)
Definition: graphics.c:4159
GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:4424
GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics, TextRenderingHint hint)
Definition: graphics.c:6330
GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics *graphics, GraphicsState *state)
Definition: graphics.c:5911
GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path)
Definition: graphics.c:4066
GpStatus WINGDIPAPI GdipSetCompositingQuality(GpGraphics *graphics, CompositingQuality quality)
Definition: graphics.c:6114
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
Definition: graphics.c:6143
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
GpStatus WINGDIPAPI GdipDrawEllipse(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:2935
GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
Definition: graphics.c:4391
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 GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
Definition: graphics.c:2619
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 GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:289
GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, GpMatrixOrder order)
Definition: matrix.c:240
GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix *matrix, REAL offsetX, REAL offsetY, GpMatrixOrder order)
Definition: matrix.c:418
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
Definition: matrix.c:316
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
GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, GpRegion **region)
Definition: region.c:459
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1, GpRegion *region2, CombineMode mode)
Definition: region.c:346
GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
Definition: region.c:425
GpStatus WINGDIPAPI GdipCloneRegion(GpRegion *region, GpRegion **clone)
Definition: region.c:211
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
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
@ CombineModeReplace
Definition: gdiplusenums.h:351
@ 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
@ MatrixOrderAppend
Definition: gdiplusenums.h:189
@ MatrixOrderPrepend
Definition: gdiplusenums.h:188
Unit
Definition: gdiplusenums.h:26
Unit GpUnit
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLuint GLenum matrix
Definition: glext.h:9407
GLenum mode
Definition: glext.h:6217
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei dataSize
Definition: glext.h:11123
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
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
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
#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 FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#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
int WINAPI ExtSelectClipRgn(_In_ HDC, _In_opt_ HRGN, _In_ int)
#define EMR_SCALEVIEWPORTEXTEX
Definition: wingdi.h:105

Referenced by play_metafile_proc(), and test_gditransform_cb().

◆ 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
@ ImageFlagsNone
Definition: gdiplusenums.h:333
@ 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
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static const WCHAR desc[]
Definition: protectdata.c:36
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 HORZRES
Definition: wingdi.h:716
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#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}

◆ 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}

◆ get_emfplus_header_proc()

static int CALLBACK get_emfplus_header_proc ( HDC  hDC,
HANDLETABLE lpHTable,
const ENHMETARECORD lpEMFR,
int  nObj,
LPARAM  lpData 
)
static

Definition at line 3662 of file metafile.c.

3664{
3665 EmfPlusHeader *dst_header = (EmfPlusHeader*)lpData;
3666
3667 if (lpEMFR->iType == EMR_GDICOMMENT)
3668 {
3669 const EMRGDICOMMENT *comment = (const EMRGDICOMMENT*)lpEMFR;
3670
3671 if (comment->cbData >= 4 && memcmp(comment->Data, "EMF+", 4) == 0)
3672 {
3673 const EmfPlusRecordHeader *header = (const EmfPlusRecordHeader*)&comment->Data[4];
3674
3675 if (4 + sizeof(EmfPlusHeader) <= comment->cbData &&
3677 {
3678 memcpy(dst_header, header, sizeof(*dst_header));
3679 }
3680 }
3681 }
3682 else if (lpEMFR->iType == EMR_HEADER)
3683 return TRUE;
3684
3685 return FALSE;
3686}
#define EMR_HEADER
Definition: wingdi.h:75

Referenced by GdipGetMetafileHeaderFromEmf().

◆ is_integer_rect()

static BOOL is_integer_rect ( const GpRectF rect)
static

Definition at line 970 of file metafile.c.

971{
972 SHORT x, y, width, height;
973 x = rect->X;
974 y = rect->Y;
975 width = rect->Width;
976 height = rect->Height;
977 if (rect->X != (REAL)x || rect->Y != (REAL)y ||
978 rect->Width != (REAL)width || rect->Height != (REAL)height)
979 return FALSE;
980 return TRUE;
981}
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
short SHORT
Definition: pedump.c:59
& rect
Definition: startmenu.cpp:1413

Referenced by METAFILE_FillRectangles().

◆ METAFILE_AddBrushObject()

static GpStatus METAFILE_AddBrushObject ( GpMetafile metafile,
GpBrush brush,
DWORD id 
)
static

Definition at line 1027 of file metafile.c.

1028{
1029 EmfPlusObject *object_record;
1030 GpStatus stat;
1031 DWORD size;
1032
1033 *id = -1;
1034 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
1035 return Ok;
1036
1038 if (stat != Ok) return stat;
1039
1041 FIELD_OFFSET(EmfPlusObject, ObjectData) + size, (void**)&object_record);
1042 if (stat != Ok) return stat;
1043
1045 object_record->Header.Type = EmfPlusRecordTypeObject;
1046 object_record->Header.Flags = *id | ObjectTypeBrush << 8;
1047 METAFILE_FillBrushData(brush, &object_record->ObjectData.brush);
1048 return Ok;
1049}
static GpStatus METAFILE_AllocateRecord(GpMetafile *metafile, DWORD size, void **result)
Definition: metafile.c:618
static DWORD METAFILE_AddObjectId(GpMetafile *metafile)
Definition: metafile.c:613
static void METAFILE_FillBrushData(GpBrush *brush, EmfPlusBrush *data)
Definition: metafile.c:1001
static GpStatus METAFILE_PrepareBrushData(GpBrush *brush, DWORD *size)
Definition: metafile.c:983
union EmfPlusObject::@419 ObjectData
EmfPlusRecordHeader Header
Definition: metafile.c:384
EmfPlusBrush brush
Definition: metafile.c:387

Referenced by METAFILE_FillPath(), and METAFILE_FillRectangles().

◆ METAFILE_AddImageAttributesObject()

static GpStatus METAFILE_AddImageAttributesObject ( GpMetafile metafile,
const GpImageAttributes attrs,
DWORD id 
)
static

Definition at line 4158 of file metafile.c.

4159{
4160 EmfPlusObject *object_record;
4161 EmfPlusImageAttributes *attrs_record;
4162 GpStatus stat;
4163
4164 *id = -1;
4165
4166 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
4167 return Ok;
4168
4169 if (!attrs)
4170 return Ok;
4171
4174 (void**)&object_record);
4175 if (stat != Ok) return stat;
4176
4178 object_record->Header.Type = EmfPlusRecordTypeObject;
4179 object_record->Header.Flags = *id | (ObjectTypeImageAttributes << 8);
4180 attrs_record = &object_record->ObjectData.image_attributes;
4181 attrs_record->Version = VERSION_MAGIC2;
4182 attrs_record->Reserved1 = 0;
4183 attrs_record->WrapMode = attrs->wrap;
4184 attrs_record->ClampColor = attrs->outside_color;
4185 attrs_record->ObjectClamp = attrs->clamp;
4186 attrs_record->Reserved2 = 0;
4187 return Ok;
4188}
EmfPlusARGB ClampColor
Definition: metafile.c:377
EmfPlusImageAttributes image_attributes
Definition: metafile.c:392

Referenced by METAFILE_DrawImagePointsRect().

◆ METAFILE_AddImageObject()

static GpStatus METAFILE_AddImageObject ( GpMetafile metafile,
GpImage image,
DWORD id 
)
static

Definition at line 4080 of file metafile.c.

4081{
4082 EmfPlusObject *object_record;
4083 GpStatus stat;
4084 DWORD size;
4085
4086 *id = -1;
4087
4088 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
4089 return Ok;
4090
4091 if (image->type == ImageTypeBitmap)
4092 {
4093 IStream *stream;
4094 DWORD aligned_size;
4095
4097 if (stat != Ok) return stat;
4098 aligned_size = (size + 3) & ~3;
4099
4101 FIELD_OFFSET(EmfPlusObject, ObjectData.image.ImageData.bitmap.BitmapData[aligned_size]),
4102 (void**)&object_record);
4103 if (stat != Ok)
4104 {
4105 IStream_Release(stream);
4106 return stat;
4107 }
4108 memset(object_record->ObjectData.image.ImageData.bitmap.BitmapData + size, 0, aligned_size - size);
4109
4111 object_record->Header.Type = EmfPlusRecordTypeObject;
4112 object_record->Header.Flags = *id | ObjectTypeImage << 8;
4113 object_record->ObjectData.image.Version = VERSION_MAGIC2;
4114 object_record->ObjectData.image.Type = ImageDataTypeBitmap;
4115
4117 IStream_Release(stream);
4118 if (stat != Ok) METAFILE_RemoveLastRecord(metafile, &object_record->Header);
4119 return stat;
4120 }
4121 else if (image->type == ImageTypeMetafile)
4122 {
4123 HENHMETAFILE hemf = ((GpMetafile*)image)->hemf;
4124 EmfPlusMetafile *metafile_record;
4125
4126 if (!hemf) return InvalidParameter;
4127
4128 size = GetEnhMetaFileBits(hemf, 0, NULL);
4129 if (!size) return GenericError;
4130
4133 (void**)&object_record);
4134 if (stat != Ok) return stat;
4135
4137 object_record->Header.Type = EmfPlusRecordTypeObject;
4138 object_record->Header.Flags = *id | ObjectTypeImage << 8;
4139 object_record->ObjectData.image.Version = VERSION_MAGIC2;
4140 object_record->ObjectData.image.Type = ImageDataTypeMetafile;
4141 metafile_record = &object_record->ObjectData.image.ImageData.metafile;
4142 metafile_record->Type = ((GpMetafile*)image)->metafile_type;
4143 metafile_record->MetafileDataSize = size;
4144 if (GetEnhMetaFileBits(hemf, size, metafile_record->MetafileData) != size)
4145 {
4146 METAFILE_RemoveLastRecord(metafile, &object_record->Header);
4147 return GenericError;
4148 }
4149 return Ok;
4150 }
4151 else
4152 {
4153 FIXME("not supported image type (%d)\n", image->type);
4154 return NotImplemented;
4155 }
4156}
static GpStatus METAFILE_FillEmfPlusBitmap(EmfPlusBitmap *record, IStream *stream, DWORD size)
Definition: metafile.c:4065
static void METAFILE_RemoveLastRecord(GpMetafile *metafile, EmfPlusRecordHeader *record)
Definition: metafile.c:664
static GpStatus METAFILE_CreateCompressedImageStream(GpImage *image, IStream **stream, DWORD *size)
Definition: metafile.c:4027
@ ImageTypeBitmap
Definition: gdiplusenums.h:195
BYTE BitmapData[1]
Definition: metafile.c:344
union EmfPlusImage::@418 ImageData
ImageDataType Type
Definition: metafile.c:364
EmfPlusMetafile metafile
Definition: metafile.c:368
DWORD Version
Definition: metafile.c:363
EmfPlusBitmap bitmap
Definition: metafile.c:367
DWORD MetafileDataSize
Definition: metafile.c:350
BYTE MetafileData[1]
Definition: metafile.c:351
EmfPlusImage image
Definition: metafile.c:391
UINT WINAPI GetEnhMetaFileBits(_In_ HENHMETAFILE hEMF, _In_ UINT nSize, _Out_writes_bytes_opt_(nSize) LPBYTE lpData)

Referenced by METAFILE_DrawImagePointsRect().

◆ METAFILE_AddObjectId()

static DWORD METAFILE_AddObjectId ( GpMetafile metafile)
static

◆ METAFILE_AddPathObject()

static GpStatus METAFILE_AddPathObject ( GpMetafile metafile,
GpPath path,
DWORD id 
)
static

Definition at line 4287 of file metafile.c.

4288{
4289 EmfPlusObject *object_record;
4290 GpStatus stat;
4291 DWORD size;
4292
4293 *id = -1;
4294 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
4295 return Ok;
4296
4299 FIELD_OFFSET(EmfPlusObject, ObjectData.path) + size,
4300 (void**)&object_record);
4301 if (stat != Ok) return stat;
4302
4304 object_record->Header.Type = EmfPlusRecordTypeObject;
4305 object_record->Header.Flags = *id | ObjectTypePath << 8;
4306 write_path_data(path, &object_record->ObjectData.path);
4307 return Ok;
4308}
DWORD write_path_data(GpPath *path, void *data) DECLSPEC_HIDDEN
EmfPlusPath path
Definition: metafile.c:389

Referenced by METAFILE_DrawPath(), and METAFILE_FillPath().

◆ METAFILE_AddPenObject()

static GpStatus METAFILE_AddPenObject ( GpMetafile metafile,
GpPen pen,
DWORD id 
)
static

Definition at line 4310 of file metafile.c.

4311{
4312 DWORD i, data_flags, pen_data_size, brush_size;
4313 EmfPlusObject *object_record;
4314 EmfPlusPenData *pen_data;
4315 GpStatus stat;
4316 BOOL result;
4317
4318 *id = -1;
4319 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
4320 return Ok;
4321
4322 data_flags = 0;
4323 pen_data_size = FIELD_OFFSET(EmfPlusPenData, OptionalData);
4324
4326 if (!result)
4327 {
4328 data_flags |= PenDataTransform;
4329 pen_data_size += sizeof(EmfPlusTransformMatrix);
4330 }
4331 if (pen->startcap != LineCapFlat)
4332 {
4333 data_flags |= PenDataStartCap;
4334 pen_data_size += sizeof(DWORD);
4335 }
4336 if (pen->endcap != LineCapFlat)
4337 {
4338 data_flags |= PenDataEndCap;
4339 pen_data_size += sizeof(DWORD);
4340 }
4341 if (pen->join != LineJoinMiter)
4342 {
4343 data_flags |= PenDataJoin;
4344 pen_data_size += sizeof(DWORD);
4345 }
4346 if (pen->miterlimit != 10.0)
4347 {
4348 data_flags |= PenDataMiterLimit;
4349 pen_data_size += sizeof(REAL);
4350 }
4351 if (pen->style != GP_DEFAULT_PENSTYLE)
4352 {
4353 data_flags |= PenDataLineStyle;
4354 pen_data_size += sizeof(DWORD);
4355 }
4356 if (pen->dashcap != DashCapFlat)
4357 {
4358 data_flags |= PenDataDashedLineCap;
4359 pen_data_size += sizeof(DWORD);
4360 }
4361 data_flags |= PenDataDashedLineOffset;
4362 pen_data_size += sizeof(REAL);
4363 if (pen->numdashes)
4364 {
4365 data_flags |= PenDataDashedLine;
4366 pen_data_size += sizeof(DWORD) + pen->numdashes*sizeof(REAL);
4367 }
4368 if (pen->align != PenAlignmentCenter)
4369 {
4370 data_flags |= PenDataNonCenter;
4371 pen_data_size += sizeof(DWORD);
4372 }
4373 /* TODO: Add support for PenDataCompoundLine */
4374 if (pen->customstart)
4375 {
4376 FIXME("ignoring custom start cup\n");
4377 }
4378 if (pen->customend)
4379 {
4380 FIXME("ignoring custom end cup\n");
4381 }
4382
4383 stat = METAFILE_PrepareBrushData(pen->brush, &brush_size);
4384 if (stat != Ok) return stat;
4385
4387 FIELD_OFFSET(EmfPlusObject, ObjectData.pen.data) + pen_data_size + brush_size,
4388 (void**)&object_record);
4389 if (stat != Ok) return stat;
4390
4392 object_record->Header.Type = EmfPlusRecordTypeObject;
4393 object_record->Header.Flags = *id | ObjectTypePen << 8;
4394 object_record->ObjectData.pen.Version = VERSION_MAGIC2;
4395 object_record->ObjectData.pen.Type = 0;
4396
4397 pen_data = (EmfPlusPenData*)object_record->ObjectData.pen.data;
4398 pen_data->PenDataFlags = data_flags;
4399 pen_data->PenUnit = pen->unit;
4400 pen_data->PenWidth = pen->width;
4401
4402 i = 0;
4403 if (data_flags & PenDataTransform)
4404 {
4406 memcpy(m, &pen->transform, sizeof(*m));
4407 i += sizeof(EmfPlusTransformMatrix);
4408 }
4409 if (data_flags & PenDataStartCap)
4410 {
4411 *(DWORD*)(pen_data->OptionalData + i) = pen->startcap;
4412 i += sizeof(DWORD);
4413 }
4414 if (data_flags & PenDataEndCap)
4415 {
4416 *(DWORD*)(pen_data->OptionalData + i) = pen->endcap;
4417 i += sizeof(DWORD);
4418 }
4419 if (data_flags & PenDataJoin)
4420 {
4421 *(DWORD*)(pen_data->OptionalData + i) = pen->join;
4422 i += sizeof(DWORD);
4423 }
4424 if (data_flags & PenDataMiterLimit)
4425 {
4426 *(REAL*)(pen_data->OptionalData + i) = pen->miterlimit;
4427 i += sizeof(REAL);
4428 }
4429 if (data_flags & PenDataLineStyle)
4430 {
4431 switch (pen->style & PS_STYLE_MASK)
4432 {
4433 case PS_SOLID: *(DWORD*)(pen_data->OptionalData + i) = LineStyleSolid; break;
4434 case PS_DASH: *(DWORD*)(pen_data->OptionalData + i) = LineStyleDash; break;
4435 case PS_DOT: *(DWORD*)(pen_data->OptionalData + i) = LineStyleDot; break;
4436 case PS_DASHDOT: *(DWORD*)(pen_data->OptionalData + i) = LineStyleDashDot; break;
4437 case PS_DASHDOTDOT: *(DWORD*)(pen_data->OptionalData + i) = LineStyleDashDotDot; break;
4438 default: *(DWORD*)(pen_data->OptionalData + i) = LineStyleCustom; break;
4439 }
4440 i += sizeof(DWORD);
4441 }
4442 if (data_flags & PenDataDashedLineCap)
4443 {
4444 *(DWORD*)(pen_data->OptionalData + i) = pen->dashcap;
4445 i += sizeof(DWORD);
4446 }
4447 if (data_flags & PenDataDashedLineOffset)
4448 {
4449 *(REAL*)(pen_data->OptionalData + i) = pen->offset;
4450 i += sizeof(REAL);
4451 }
4452 if (data_flags & PenDataDashedLine)
4453 {
4454 int j;
4455
4456 *(DWORD*)(pen_data->OptionalData + i) = pen->numdashes;
4457 i += sizeof(DWORD);
4458
4459 for (j=0; j<pen->numdashes; j++)
4460 {
4461 *(REAL*)(pen_data->OptionalData + i) = pen->dashes[j];
4462 i += sizeof(REAL);
4463 }
4464 }
4465 if (data_flags & PenDataNonCenter)
4466 {
4467 *(REAL*)(pen_data->OptionalData + i) = pen->align;
4468 i += sizeof(DWORD);
4469 }
4470
4472 (EmfPlusBrush*)(object_record->ObjectData.pen.data + pen_data_size));
4473 return Ok;
4474}
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:512
#define GP_DEFAULT_PENSTYLE
@ DashCapFlat
Definition: gdiplusenums.h:171
@ LineJoinMiter
Definition: gdiplusenums.h:106
@ LineCapFlat
Definition: gdiplusenums.h:61
@ PenAlignmentCenter
Definition: gdiplusenums.h:155
GLuint64EXT * result
Definition: glext.h:11304
const GLfloat * m
Definition: glext.h:10848
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
#define DWORD
Definition: nt_native.h:44
EmfPlusPen pen
Definition: metafile.c:388
DWORD PenDataFlags
Definition: metafile.c:222
DWORD PenUnit
Definition: metafile.c:223
BYTE OptionalData[1]
Definition: metafile.c:225
DWORD Type
Definition: metafile.c:294
DWORD Version
Definition: metafile.c:293
BYTE data[1]
Definition: metafile.c:297
GpLineCap startcap
INT numdashes
REAL * dashes
GpCustomLineCap * customend
GpMatrix transform
REAL offset
REAL miterlimit
GpLineCap endcap
UINT style
GpLineJoin join
GpDashCap dashcap
GpBrush * brush
GpPenAlignment align
GpUnit unit
REAL width
GpCustomLineCap * customstart
#define PS_DASH
Definition: wingdi.h:587
#define PS_DOT
Definition: wingdi.h:588
#define PS_STYLE_MASK
Definition: wingdi.h:601
#define PS_SOLID
Definition: wingdi.h:586
#define PS_DASHDOT
Definition: wingdi.h:589
#define PS_DASHDOTDOT
Definition: wingdi.h:590

Referenced by METAFILE_DrawPath().

◆ METAFILE_AddRegionObject()

static GpStatus METAFILE_AddRegionObject ( GpMetafile metafile,
GpRegion region,
DWORD id 
)
static

Definition at line 1167 of file metafile.c.

1168{
1169 EmfPlusObject *object_record;
1170 DWORD size;
1171 GpStatus stat;
1172
1173 *id = -1;
1174 if (metafile->metafile_type != MetafileTypeEmfPlusOnly && metafile->metafile_type != MetafileTypeEmfPlusDual)
1175 return Ok;
1176
1177 size = write_region_data(region, NULL);
1179 FIELD_OFFSET(EmfPlusObject, ObjectData.region) + size, (void**)&object_record);
1180 if (stat != Ok) return stat;
1181
1183 object_record->Header.Type = EmfPlusRecordTypeObject;
1184 object_record->Header.Flags = *id | ObjectTypeRegion << 8;
1185 write_region_data(region, &object_record->ObjectData.region);
1186 return Ok;
1187}
DWORD write_region_data(const GpRegion *region, void *data) DECLSPEC_HIDDEN
Definition: region.c:696
EmfPlusRegion region
Definition: metafile.c:390

Referenced by METAFILE_SetClipRegion().

◆ METAFILE_AddSimpleProperty()

GpStatus METAFILE_AddSimpleProperty ( GpMetafile metafile,
SHORT  prop,