emf-inout.h revision 034d7ccaa6acbcd03e37974a2d164706862c32a2
/** @file
*/
/* Authors:
* Ulf Erikson <ulferikson@users.sf.net>
* David Mathog
*
* Copyright (C) 2006-2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_EXTENSION_INTERNAL_EMF_H
#define SEEN_EXTENSION_INTERNAL_EMF_H
#include "extension/internal/metafile-inout.h" // picks up PNG
#include "extension/implementation/implementation.h"
#include "style.h"
#include "text_reassemble.h"
#define DIRTY_NONE 0x00
#define DIRTY_TEXT 0x01
#define DIRTY_FILL 0x02
#define DIRTY_STROKE 0x04
typedef struct emf_object {
emf_object() :
type(0),
level(0),
{};
int type;
int level;
char *lpEMFR;
} EMF_OBJECT, *PEMF_OBJECT;
typedef struct emf_strings {
emf_strings() :
size(0),
count(0),
{};
int size; // number of slots allocated in strings
int count; // number of slots used in strings
char **strings; // place to store strings
} EMF_STRINGS, *PEMF_STRINGS;
typedef struct emf_device_context {
// SPStyle: class with constructor
clip_id(0),
dirty(0),
// sizeWnd, sizeView, winorg, vieworg,
// bkColor, textColor
textAlign(0)
// worldTransform, cur
{
cur = point32_set( 0, 0 );
};
char *font_name;
int clip_id; // 0 if none, else 1 + index into clips
bool stroke_set;
int stroke_mode; // enumeration from drawmode, not used if fill_set is not True
int stroke_idx; // used with DRAW_PATTERN and DRAW_IMAGE to return the appropriate fill
int stroke_recidx;// record used to regenerate hatch when it needs to be redone due to bkmode, textmode, etc. change
bool fill_set;
int fill_mode; // enumeration from drawmode, not used if fill_set is not True
int fill_idx; // used with DRAW_PATTERN and DRAW_IMAGE to return the appropriate fill
int fill_recidx; // record used to regenerate hatch when it needs to be redone due to bkmode, textmode, etc. change
int dirty; // holds the dirty bits for text, stroke, fill
#define EMF_MAX_DC 128
typedef struct emf_callback_data {
// dc: array, structure w/ constructor
level(0),
E2IdirY(1.0),
PixelsOutX(0), PixelsOutY(0),
ulCornerInX(0), ulCornerInY(0),
ulCornerOutX(0), ulCornerOutY(0),
mask(0),
drawtype(0),
// hatches, images, gradients, struct w/ constructor
n_obj(0)
// emf_obj;
{};
int level;
double E2IdirY; // EMF Y direction relative to Inkscape Y direction. Will be negative for MM_LOMETRIC etc.
int arcdir; //U_AD_COUNTERCLOCKWISE 1 or U_AD_CLOCKWISE 2
float MMX;
float MMY;
unsigned int drawtype; // one of 0 or U_EMR_FILLPATH, U_EMR_STROKEPATH, U_EMR_STROKEANDFILLPATH
char *pDesc;
// both of these end up in <defs> under the names shown here. These structures allow duplicates to be avoided.
EMF_STRINGS hatches; // hold pattern names, all like EMFhatch#_$$$$$$ where # is the EMF hatch code and $$$$$$ is the color
EMF_STRINGS gradients; // hold gradient names, all like EMF[HV]_$$$$$$_$$$$$$ where $$$$$$ are the colors
int n_obj;
{
Emf(); // Empty constructor
static void init(void);//Initialize the class
static double current_scale(PEMF_CALLBACK_DATA d);
static double current_rotation(PEMF_CALLBACK_DATA d);
static void enlarge_hatches(PEMF_CALLBACK_DATA d);
static void enlarge_images(PEMF_CALLBACK_DATA d);
static void enlarge_gradients(PEMF_CALLBACK_DATA d);
static uint32_t add_gradient(PEMF_CALLBACK_DATA d, uint32_t gradientType, U_TRIVERTEX tv1, U_TRIVERTEX tv2);
static void enlarge_clips(PEMF_CALLBACK_DATA d);
};
} } } /* namespace Inkscape, Extension, Implementation */
#endif /* EXTENSION_INTERNAL_EMF_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :