wmf-inout.h revision 034d7ccaa6acbcd03e37974a2d164706862c32a2
/** @file
*/
/* Authors:
* Ulf Erikson <ulferikson@users.sf.net>
*
* Copyright (C) 2006-2008 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_EXTENSION_INTERNAL_WMF_H
#define SEEN_EXTENSION_INTERNAL_WMF_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
typedef struct wmf_object {
wmf_object() :
type(0),
level(0),
{};
int type;
int level;
char *record;
} WMF_OBJECT, *PWMF_OBJECT;
typedef struct wmf_strings {
wmf_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
} WMF_STRINGS, *PWMF_STRINGS;
typedef struct wmf_device_context {
// SPStyle: class with constructor
clip_id(0),
dirty(0),
// sizeWnd, sizeView, winorg, vieworg,
// bkColor, textColor
textAlign(0)
// worldTransform, cur
{
};
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
int active_pen; // used when the active object is deleted to set the default values, -1 is none active
int active_brush; // ditto
int active_font; // ditto. also used to hold object number in case font needs to be remade due to textcolor change.
#define WMF_MAX_DC 128
// like this causes a mysterious crash on the return from Wmf::open
//typedef struct emf_callback_data {
// this fixes it, so some confusion between this struct and the one in emf-inout???
//typedef struct wmf_callback_data {
// as does this
typedef struct wmf_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),
// hatches, images, gradients, struct w/ constructor
n_obj(0),
low_water(0)
//wmf_obj
{};
int level;
double E2IdirY; // WMF 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
unsigned int id;
unsigned int drawtype; // one of 0 or U_WMR_FILLPATH, U_WMR_STROKEPATH, U_WMR_STROKEANDFILLPATH
// both of these end up in <defs> under the names shown here. These structures allow duplicates to be avoided.
WMF_STRINGS hatches; // hold pattern names, all like WMFhatch#_$$$$$$ where # is the WMF hatch code and $$$$$$ is the color
int n_obj;
int low_water; // first object slot which _might_ be unoccupied. Everything below is filled.
{
Wmf(); // Empty constructor
static void init(void);//Initialize the class
static double current_scale(PWMF_CALLBACK_DATA d);
static double current_rotation(PWMF_CALLBACK_DATA d);
static void enlarge_hatches(PWMF_CALLBACK_DATA d);
static void enlarge_images(PWMF_CALLBACK_DATA d);
static void enlarge_clips(PWMF_CALLBACK_DATA d);
static void output_style(PWMF_CALLBACK_DATA d);
static int insertable_object(PWMF_CALLBACK_DATA d);
};
} } } /* namespace Inkscape, Extension, Implementation */
#endif /* EXTENSION_INTERNAL_WMF_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 :