struct options_t
{
- char*shortoption;
- char*longoption;
+ const char*shortoption;
+ const char*longoption;
};
static int args_long2shortoption(struct options_t*options, char*name, char*val)
static void swf_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix);
static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix);
static void swf_addfont(gfxdevice_t*dev, gfxfont_t*font);
-static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, char*action);
+static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action);
static void swf_startframe(gfxdevice_t*dev, int width, int height);
static void swf_endframe(gfxdevice_t*dev);
static gfxresult_t* swf_finish(gfxdevice_t*driver);
i->swf->compressed = 1;
}
- if(i->config_reordertags)
- swf_Optimize(i->swf);
+// if(i->config_reordertags)
+// swf_Optimize(i->swf);
}
-int swfresult_save(gfxresult_t*gfx, char*filename)
+int swfresult_save(gfxresult_t*gfx, const char*filename)
{
SWF*swf = (SWF*)gfx->internal;
int fi;
close(fi);
return 0;
}
-void* swfresult_get(gfxresult_t*gfx, char*name)
+void* swfresult_get(gfxresult_t*gfx, const char*name)
{
SWF*swf = (SWF*)gfx->internal;
if(!strcmp(name, "swf")) {
static void drawlink(gfxdevice_t*dev, ActionTAG*,ActionTAG*, gfxline_t*points, char mouseover);
static void swfoutput_namedlink(gfxdevice_t*dev, char*name, gfxline_t*points);
static void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points);
-static void swfoutput_linktourl(gfxdevice_t*dev, char*url, gfxline_t*points);
+static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points);
-void swfoutput_drawlink(gfxdevice_t*dev, char*url, gfxline_t*points)
+/*void swfoutput_drawlink(gfxdevice_t*dev, char*url, gfxline_t*points)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
dev->drawlink(dev, points, url);
-}
+}*/
-void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, char*url)
+void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, const char*url)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
swfoutput_linktourl(dev, url, points);
}
}
-void swfoutput_linktourl(gfxdevice_t*dev, char*url, gfxline_t*points)
+void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points)
{
ActionTAG* actions = 0;
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
swf_switchfont(dev, font->id); // set the current font
}
setfontscale(dev, matrix->m00, matrix->m01, matrix->m10, matrix->m11);
-
+
/* printf("%f %f\n", m.m31, m.m32);
{
static int xpos = 40;
gfxcoord_t advance;
int unicode; // array?
- char*name;
+ const char*name;
} gfxglyph_t;
typedef struct _gfxfont
{
- char*id;
+ const char*id;
int num_glyphs;
int max_unicode;
gfxglyph_t*glyphs;
typedef struct _gfxresult
{
void (*write)(struct _gfxresult*gfx, int filedesc);
- int (*save)(struct _gfxresult*gfx, char*filename);
- void* (*get)(struct _gfxresult*gfx, char*name);
+ int (*save)(struct _gfxresult*gfx, const char*filename);
+ void* (*get)(struct _gfxresult*gfx, const char*name);
void (*destroy)(struct _gfxresult*gfx);
void*internal;
typedef struct _gfxdevice
{
- char* name; // gfx device name
+ const char* name; // gfx device name
int (*setparameter)(struct _gfxdevice*dev, const char*key, const char*value);
void (*drawchar)(struct _gfxdevice*dev, gfxfont_t*fontid, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix);
- void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, char*action);
+ void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, const char*action);
void (*endpage)(struct _gfxdevice*dev);
typedef struct _gfxsource
{
- void (*set_parameter)(char*name, char*value);
- struct _gfxdocument* (*open)(char*filename);
+ void (*set_parameter)(const char*name, const char*value);
+ struct _gfxdocument* (*open)(const char*filename);
void*internal;
} gfxsource_t;
{
gfxsource_t*driver;
int num_pages;
- void* (*get)(struct _gfxdocument*gfx, char*name);
+ void* (*get)(struct _gfxdocument*gfx, const char*name);
void (*destroy)(struct _gfxdocument*gfx);
- void (*set_parameter)(struct _gfxdocument*gfx, char*name, char*value);
- char* (*getinfo)(struct _gfxdocument*gfx, char*key);
+ void (*set_parameter)(struct _gfxdocument*gfx, const char*name, const char*value);
+ char* (*getinfo)(struct _gfxdocument*gfx, const char*key);
struct _gfxpage* (*getpage)(struct _gfxdocument*gfx, int page);
void*internal;
} gfxdocument_t;
*(U8*)&atag->tmp[2] = index>>8;
return atag;
}
-ActionTAG* action_PushString(ActionTAG*atag, char*str)
+ActionTAG* action_PushString(ActionTAG*atag, const char*str)
{
int l = strlen(str);
char*ptr = (char*)rfx_alloc(l+2);
#define FT_SCALE 1
#define FT_SUBPIXELS 64
-static int ft_move_to(FT_Vector* _to, void* user)
+static int ft_move_to(const FT_Vector* _to, void* user)
{
drawer_t* draw = (drawer_t*)user;
FPOINT to;
draw->moveTo(draw, &to);
return 0;
}
-static int ft_line_to(FT_Vector* _to, void* user)
+static int ft_line_to(const FT_Vector* _to, void* user)
{
drawer_t* draw = (drawer_t*)user;
FPOINT to;
draw->lineTo(draw, &to);
return 0;
}
-static int ft_cubic_to(FT_Vector* _c1, FT_Vector* _c2, FT_Vector* _to, void* user)
+static int ft_conic_to(const FT_Vector* _c, const FT_Vector* _to, void* user)
{
drawer_t* draw = (drawer_t*)user;
- FPOINT c1,c2,to;
+ FPOINT c,to;
to.x = _to->x*FT_SCALE/(float)FT_SUBPIXELS;
to.y = -_to->y*FT_SCALE/(float)FT_SUBPIXELS;
- c1.x = _c1->x*FT_SCALE/(float)FT_SUBPIXELS;
- c1.y = -_c1->y*FT_SCALE/(float)FT_SUBPIXELS;
- c2.x = _c2->x*FT_SCALE/(float)FT_SUBPIXELS;
- c2.y = -_c2->y*FT_SCALE/(float)FT_SUBPIXELS;
- draw_cubicTo(draw, &c1, &c2, &to);
+ c.x = _c->x*FT_SCALE/(float)FT_SUBPIXELS;
+ c.y = -_c->y*FT_SCALE/(float)FT_SUBPIXELS;
+ draw_conicTo(draw, &c, &to);
return 0;
}
-static int ft_conic_to(FT_Vector* _c, FT_Vector* _to, void* user)
+static int ft_cubic_to(const FT_Vector* _c1, const FT_Vector* _c2, const FT_Vector* _to, void* user)
{
drawer_t* draw = (drawer_t*)user;
- FPOINT c,to;
+ FPOINT c1,c2,to;
to.x = _to->x*FT_SCALE/(float)FT_SUBPIXELS;
to.y = -_to->y*FT_SCALE/(float)FT_SUBPIXELS;
- c.x = _c->x*FT_SCALE/(float)FT_SUBPIXELS;
- c.y = -_c->y*FT_SCALE/(float)FT_SUBPIXELS;
- draw_conicTo(draw, &c, &to);
+ c1.x = _c1->x*FT_SCALE/(float)FT_SUBPIXELS;
+ c1.y = -_c1->y*FT_SCALE/(float)FT_SUBPIXELS;
+ c2.x = _c2->x*FT_SCALE/(float)FT_SUBPIXELS;
+ c2.y = -_c2->y*FT_SCALE/(float)FT_SUBPIXELS;
+ draw_cubicTo(draw, &c1, &c2, &to);
return 0;
}
static FT_Outline_Funcs outline_functions =
}
f->use->used_glyphs = j;
for (i = 0; i < f->maxascii; i++) {
- if(f->ascii2glyph[i] > -1)
+ if(f->ascii2glyph[i] > -1) {
if (f->use->chars[f->ascii2glyph[i]]<0) {
f->use->chars[f->ascii2glyph[i]] = 0;
f->ascii2glyph[i] = -1;
max_unicode = i + 1;
}
}
+ }
f->maxascii = max_unicode;
f->use->is_reduced = 1;
f->numchars = j;
#endif
}
-char* concatPaths(char*base, char*add)
+char* concatPaths(const char*base, const char*add)
{
int l1 = strlen(base);
int l2 = strlen(add);
return n;
}
-char* stripFilename(char*filename, char*newext)
+char* stripFilename(const char*filename, const char*newext)
{
char*last1 = strrchr(filename, '/');
char*last2 = strrchr(filename, '\\');
- char*pos = filename;
+ const char*pos = filename;
char*name;
char*dot;
if(last1>pos) pos = last1 + 1;
return dir;
}
-char* mktempname(char*ptr) {
+char* mktempname(const char*ptr) {
static char tmpbuf[128];
char*dir = getTempDir();
int l = strlen(dir);
#endif
char* getInstallationPath();
-char* concatPaths(char*base, char*add);
-char* stripFilename(char*filename, char*newext);
+char* concatPaths(const char*base, const char*add);
+char* stripFilename(const char*filename, const char*newext);
-char* mktempname(char*);
+char* mktempname(const char*);
#ifdef __cplusplus
}
struct _parameter*next;
} parameter_t;
-void addGlobalFont(char*filename);
-void addGlobalLanguageDir(char*dir);
-void addGlobalFontDir(char*dirname);
+void addGlobalFont(const char*filename);
+void addGlobalLanguageDir(const char*dir);
+void addGlobalFontDir(const char*dirname);
class GFXOutputDev: public OutputDev {
public:
void clipToGfxLine(GfxState *state, gfxline_t*line);
void fillGfxLine(GfxState *state, gfxline_t*line);
- void showfeature(char*feature,char fully, char warn);
- void warnfeature(char*feature,char fully);
- void infofeature(char*feature);
+ void showfeature(const char*feature,char fully, char warn);
+ void warnfeature(const char*feature,char fully);
+ void infofeature(const char*feature);
char outer_clip_box; //whether the page clip box is still on
PDFDoc*doc;
XRef*xref;
- char* searchFont(char*name);
+ char* searchFont(const char*name);
char* substituteFont(GfxFont*gfxFont, char*oldname);
char* writeEmbeddedFontToFile(XRef*ref, GfxFont*font);
int t1id;
char type3Warning;
- char* substitutetarget[256];
- char* substitutesource[256];
+ const char* substitutetarget[256];
+ const char* substitutesource[256];
int substitutepos;
int user_movex,user_movey;
ActionTAG* action_GotoLabel(ActionTAG*atag, char* label);
ActionTAG* action_WaitForFrame2(ActionTAG*atag, U8 skip);
ActionTAG* action_With(ActionTAG*atag, char*object);
-ActionTAG* action_PushString(ActionTAG*atag, char*str);
+ActionTAG* action_PushString(ActionTAG*atag, const char*str);
ActionTAG* action_PushFloat(ActionTAG*atag, float f);
ActionTAG* action_PushNULL(ActionTAG*atag);
ActionTAG* action_PushRegister(ActionTAG*atag, U8 reg);