extern GpStatus METAFILE_AddSimpleProperty(GpMetafile *metafile, SHORT prop, SHORT val) DECLSPEC_HIDDEN;
extern GpStatus METAFILE_DrawPath(GpMetafile *metafile, GpPen *pen, GpPath *path) DECLSPEC_HIDDEN;
extern GpStatus METAFILE_FillPath(GpMetafile *metafile, GpBrush *brush, GpPath *path) DECLSPEC_HIDDEN;
+extern void METAFILE_Free(GpMetafile *metafile) DECLSPEC_HIDDEN;
extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1,
REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN;
typedef struct region_element region_element;
extern void delete_element(region_element *element) DECLSPEC_HIDDEN;
-extern GpStatus get_hatch_data(HatchStyle hatchstyle, const char **result) DECLSPEC_HIDDEN;
+extern GpStatus get_hatch_data(GpHatchStyle hatchstyle, const char **result) DECLSPEC_HIDDEN;
static inline INT gdip_round(REAL x)
{
INT origin_x, origin_y;
INT gdi_transform_acquire_count, gdi_transform_save;
GpMatrix gdi_transform;
+ HRGN gdi_clip;
/* For giving the caller an HDC when we technically can't: */
HBITMAP temp_hbitmap;
int temp_hbitmap_width;
struct GpHatch{
GpBrush brush;
- HatchStyle hatchstyle;
+ GpHatchStyle hatchstyle;
ARGB forecol;
ARGB backcol;
};
LONG busy;
};
+#define EmfPlusObjectTableSize 64
+
+typedef enum EmfPlusObjectType
+{
+ ObjectTypeInvalid,
+ ObjectTypeBrush,
+ ObjectTypePen,
+ ObjectTypePath,
+ ObjectTypeRegion,
+ ObjectTypeImage,
+ ObjectTypeFont,
+ ObjectTypeStringFormat,
+ ObjectTypeImageAttributes,
+ ObjectTypeCustomLineCap,
+ ObjectTypeMax = ObjectTypeCustomLineCap,
+} EmfPlusObjectType;
+
+/* Deserialized EmfPlusObject record. */
+struct emfplus_object {
+ EmfPlusObjectType type;
+ union {
+ GpBrush *brush;
+ GpPen *pen;
+ GpPath *path;
+ GpRegion *region;
+ GpImage *image;
+ GpFont *font;
+ GpImageAttributes *image_attributes;
+ void *object;
+ } u;
+};
+
struct GpMetafile{
GpImage image;
GpRectF bounds;
GpRegion *base_clip; /* clip region in device space for all metafile output */
GpRegion *clip; /* clip region within the metafile */
struct list containers;
+ struct emfplus_object objtable[EmfPlusObjectTableSize];
};
struct GpBitmap{
ColorMap *colormap;
};
+enum imageattr_noop{
+ IMAGEATTR_NOOP_UNDEFINED,
+ IMAGEATTR_NOOP_SET,
+ IMAGEATTR_NOOP_CLEAR,
+};
+
struct GpImageAttributes{
WrapMode wrap;
ARGB outside_color;
struct color_remap_table colorremaptables[ColorAdjustTypeCount];
BOOL gamma_enabled[ColorAdjustTypeCount];
REAL gamma[ColorAdjustTypeCount];
+ enum imageattr_noop noop[ColorAdjustTypeCount];
};
struct GpFont{
region_element node;
};
+struct memory_buffer
+{
+ const BYTE *buffer;
+ INT size, pos;
+};
+
+static inline void init_memory_buffer(struct memory_buffer *mbuf, const BYTE *buffer, INT size)
+{
+ mbuf->buffer = buffer;
+ mbuf->size = size;
+ mbuf->pos = 0;
+}
+
+static inline const void *buffer_read(struct memory_buffer *mbuf, INT size)
+{
+ if (mbuf->size - mbuf->pos >= size)
+ {
+ const void *data = mbuf->buffer + mbuf->pos;
+ mbuf->pos += size;
+ return data;
+ }
+ return NULL;
+}
+
typedef GpStatus (*gdip_format_string_callback)(HDC hdc,
GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font,
GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format,