git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed crash in antialize(), truncate image coordinates to integer before bitmap-filling
[swftools.git]
/
lib
/
devices
/
file.c
diff --git
a/lib/devices/file.c
b/lib/devices/file.c
index
72290e8
..
98aaaa2
100644
(file)
--- a/
lib/devices/file.c
+++ b/
lib/devices/file.c
@@
-20,7
+20,10
@@
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
+#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
+#endif
+#include <string.h>
#include <memory.h>
#include "../gfxdevice.h"
#include <memory.h>
#include "../gfxdevice.h"
@@
-33,7
+36,7
@@
int file_setparameter(struct _gfxdevice*dev, const char*key, const char*value)
{
internal_t*i = (internal_t*)dev->internal;
fprintf(i->fi, "setparameter %s=%s\n", key, value);
{
internal_t*i = (internal_t*)dev->internal;
fprintf(i->fi, "setparameter %s=%s\n", key, value);
- return 0;
+ return 1;
}
void file_startpage(struct _gfxdevice*dev, int width, int height)
}
void file_startpage(struct _gfxdevice*dev, int width, int height)
@@
-102,17
+105,17
@@
void file_fillgradient(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*grad
dumpline(i->fi, line);
}
dumpline(i->fi, line);
}
-void file_addfont(struct _gfxdevice*dev, char*fontid, gfxfont_t*font)
+void file_addfont(struct _gfxdevice*dev, gfxfont_t*font)
{
internal_t*i = (internal_t*)dev->internal;
}
{
internal_t*i = (internal_t*)dev->internal;
}
-void file_drawchar(struct _gfxdevice*dev, char*fontid, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix)
+void file_drawchar(struct _gfxdevice*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix)
{
internal_t*i = (internal_t*)dev->internal;
}
{
internal_t*i = (internal_t*)dev->internal;
}
-void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, char*action)
+void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action)
{
internal_t*i = (internal_t*)dev->internal;
fprintf(i->fi, "drawlink %s\n", action);
{
internal_t*i = (internal_t*)dev->internal;
fprintf(i->fi, "drawlink %s\n", action);
@@
-138,7
+141,7
@@
void fileresult_destroy(struct _gfxresult*gfx)
free(i->filename);i->filename = 0;
}
free(i->filename);i->filename = 0;
}
-int fileresult_save(struct _gfxresult*gfx, char*filename)
+int fileresult_save(struct _gfxresult*gfx, const char*filename)
{
gfxresult_internal_t*i = (gfxresult_internal_t*)gfx->internal;
FILE*fi,*fo;
{
gfxresult_internal_t*i = (gfxresult_internal_t*)gfx->internal;
FILE*fi,*fo;
@@
-168,7
+171,7
@@
int fileresult_save(struct _gfxresult*gfx, char*filename)
return 0;
}
return 0;
}
-void* fileresult_get(struct _gfxresult*gfx, char*name)
+void* fileresult_get(struct _gfxresult*gfx, const char*name)
{
return 0;
}
{
return 0;
}
@@
-199,8
+202,11
@@
gfxresult_t* file_finish(struct _gfxdevice*dev)
void gfxdevice_file_init(gfxdevice_t*dev, char*filename)
{
void gfxdevice_file_init(gfxdevice_t*dev, char*filename)
{
- internal_t*i = malloc(sizeof(internal_t));
+ internal_t*i = (internal_t*)malloc(sizeof(internal_t));
memset(dev, 0, sizeof(gfxdevice_t));
memset(dev, 0, sizeof(gfxdevice_t));
+
+ dev->name = "file";
+
dev->internal = i;
dev->setparameter = file_setparameter;
dev->internal = i;
dev->setparameter = file_setparameter;