changed from preparePage() to setPageMap()
[swftools.git] / lib / pdf / GFXOutputDev.h
index 51e6312..063aff6 100644 (file)
@@ -29,14 +29,9 @@ class GFXOutputState {
     gfxresult_t* softmaskrecording; // for soft masks
 
     gfxdevice_t* olddevice;
-};
 
-typedef struct _parameter
-{
-    char*name;
-    char*value;
-    struct _parameter*next;
-} parameter_t;
+    GfxState*state;
+};
 
 typedef struct _feature
 {
@@ -48,6 +43,22 @@ void addGlobalFont(const char*filename);
 void addGlobalLanguageDir(const char*dir);
 void addGlobalFontDir(const char*dirname);
 
+class GFXOutputGlobals {
+public:
+  feature_t*featurewarnings;
+  gfxfontlist_t*gfxfontlist;
+  int textmodeinfo; // did we write "Text will be rendered as polygon" yet?
+  int jpeginfo; // did we write "File contains jpegs" yet?
+  int pbminfo; // did we write "File contains jpegs" yet?
+  int linkinfo; // did we write "File contains links" yet?
+  int*pages;
+  int pagebuflen;
+  int pagepos;
+
+  GFXOutputGlobals();
+  ~GFXOutputGlobals();
+};
+
 class GFXOutputDev:  public CommonOutputDev {
 public:
   gfxdevice_t* device;
@@ -86,6 +97,7 @@ public:
 
   //----- update graphics state
 
+  virtual void updateLineDash(GfxState *state);
   virtual void updateFont(GfxState *state);
   virtual void updateFontMatrix(GfxState *state);
   virtual void updateFillColor(GfxState *state);
@@ -213,51 +225,35 @@ public:
                                   int width, int height, GfxImageColorMap*colorMap, GBool invert,
                                   GBool inlineImg, int mask, int *maskColors,
                                   Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap);
-  int setGfxFont(char*id, char*name, char*filename, double maxSize, CharCodeToUnicode*ctu);
+
   void strokeGfxline(GfxState *state, gfxline_t*line, int flags);
   void clipToGfxLine(GfxState *state, gfxline_t*line);
   void fillGfxLine(GfxState *state, gfxline_t*line);
 
+  gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src);
+
   void showfeature(const char*feature,char fully, char warn);
   void warnfeature(const char*feature,char fully);
   void infofeature(const char*feature);
+  
+  char* searchFont(const char*name);
+  char* substituteFont(GfxFont*gfxFont, char*oldname);
+  char* writeEmbeddedFontToFile(XRef*ref, GfxFont*font);
 
-  feature_t*featurewarnings;
 
+  int currentpage;
   char outer_clip_box; //whether the page clip box is still on
-
-  gfxfontlist_t*gfxfontlist;
-
-  GBool do_interpretType3Chars;
-
   InfoOutputDev*info;
   GFXOutputState states[64];
   int statepos;
 
-  int currentpage;
-
   PDFDoc*doc;
   XRef*xref;
 
-  char* searchFont(const char*name);
-  char* substituteFont(GfxFont*gfxFont, char*oldname);
-  char* writeEmbeddedFontToFile(XRef*ref, GfxFont*font);
-  int t1id;
-  int textmodeinfo; // did we write "Text will be rendered as polygon" yet?
-  int jpeginfo; // did we write "File contains jpegs" yet?
-  int pbminfo; // did we write "File contains jpegs" yet?
-  int linkinfo; // did we write "File contains links" yet?
-
   int type3active; // are we between beginType3()/endType3()?
 
   GfxState *laststate;
 
-  char type3Warning;
-
-  const char* substitutetarget[256];
-  const char* substitutesource[256];
-  int substitutepos;
-
   int user_movex,user_movey;
   int user_clipx1,user_clipx2,user_clipy1,user_clipy2;
 
@@ -273,10 +269,6 @@ public:
   FontInfo*current_fontinfo;
   gfxmatrix_t current_font_matrix;
 
-  int*pages;
-  int pagebuflen;
-  int pagepos;
-
   /* config */
   int config_use_fontconfig;
   int config_break_on_warning;
@@ -285,9 +277,13 @@ public:
   int config_extrafontdata;
   int config_convertgradients;
   int config_optimize_polygons;
+  int config_multiply;
+  int config_bigchar;
   double config_fontquality;
-
-  parameter_t*parameters;
+    
+  double *dashPattern;
+  int dashLength;
+  double dashStart;
 };
 
 class GFXGlobalParams:  public GlobalParams {