done
else
+ USES_EXTERNAL_LIBART=1
CPPFLAGS="$CPPFLAGS $LIBART_CFLAGS"
cat >>confdefs.h <<\_ACEOF
#define INTERNAL_LIBART 0
ac_compiler_gnu=$ac_cv_c_compiler_gnu
else
+ USES_EXTERNAL_POPPLER=1
CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
cat >>confdefs.h <<\_ACEOF
#define HAVE_POPPLER 1
if test "x$PYTHON_LIB" '!=' "x" -o "x$PYTHON_INCLUDES" '!=' "x";then
echo "Set both PYTHON_LIB and PYTHON_INCLUDES, or none at all"
fi
- # iterate through version 2.2 to 2.5
- for v in 2 3 4 5; do
+ # iterate through version 2.2 to 2.6
+ for v in 2 3 4 5 6; do
# Linux
if test -f "/usr/include/python2.$v/Python.h";then
PY_VERSION=2.$v
+if test "$USES_EXTERNAL_POPPLER";then
+ echo "*"
+ echo "*"
+ echo "* uses external poppler library"
+ echo "*"
+ echo "*"
+fi
+if test "$USES_EXTERNAL_LIBART";then
+ echo "*"
+ echo "*"
+ echo "* uses external libart library"
+ echo "*"
+ echo "*"
+fi
if test -f "release.in"; then release_in="./release"; fi
if test -f "Makefile.new.in"; then mk_in="./Makefile.new"; fi
#endif // __config_h__
])
-
if test -f "release.in"; then release_in="./release"; fi
if test -f "Makefile.new.in"; then mk_in="./Makefile.new"; fi
FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/readers/Makefile"
NEW(abc_method_body_t,body);array_append(file->method_bodies, NO_KEY, body);
// don't bother to set m->index
body->method = m; m->body = body;
+ if(c->superclass && c->superclass->name && !strcmp(c->superclass->name,"Object")) {
+ __ getlocal_0(body);
+ __ constructsuper(body, 0);
+ }
__ returnvoid(body);
c->constructor = m;
} else {
import select
from optparse import OptionParser
+CMD_ARGS=[]
+#CMD = "./parser"
+CMD="as3compile"
+CMD_ARGS=["-o","abc.swf"]
+
def check(s):
row = None
ok = 0
try:
self.milestone = marshal.load(open(self.filename_milestone, "rb"))
except IOError:
- self.milstone = {}
+ self.milestone = {}
def parse_args(self):
parser = OptionParser()
def compile(self):
try: os.unlink("abc.swf");
except: pass
- ret,output = runcmd("./parser",[self.file],wait=cache.runtime)
+ ret,output = runcmd(CMD,CMD_ARGS+[self.file],wait=cache.runtime)
self.compile_error = 0
self.compile_output = output
self.exit_status = 0
b = swf_CountBits(x,0);
b = swf_CountBits(y,b);
-
+
+ if(b>31) {
+ fprintf(stderr, "Warning: bad moveTo (%f,%f)\n", x/20.0, y/20.0);
+ b=31;
+ }
+
swf_SetBits(t,b,5);
swf_SetBits(t,x,b);
swf_SetBits(t,y,b);
/* calculate the bbox of this character */
int x1 = (int)x, x2 = (int)x+1, y1 = (int)y, y2 = (int)y+1;
- SplashPath*path = clip0dev->getCurrentFont()->getGlyphPath(code);
+ SplashFont*font = clip0dev->getCurrentFont();
+ SplashPath*path = font?font->getGlyphPath(code):NULL;
+
if(!path) {
if(code)
msg("<error> couldn't create outline for char %d", code);
if(current_text_stroke) {
msg("<error> Error: Incompatible change of text rendering to %d while inside cliptext", render);
}
-
msg("<trace> beginString(%s) render=%d", makeStringPrintable(s->getCString()), render);
}
}
Unicode u = uLen?(_u[0]):0;
- msg("<debug> drawChar(%f,%f,c='%c' (%d), u=%d <%d>) CID=%d render=%d glyphid=%d font=%08x",x,y,(charid&127)>=32?charid:'?', charid, u, uLen, font->isCIDFont(), render, glyphid, current_gfxfont);
gfxmatrix_t m = this->current_font_matrix;
this->transformXY(state, x-originX, y-originY, &m.tx, &m.ty);
//m.tx += originX; m.ty += originY;
+
+ msg("<debug> drawChar(%f,%f,c='%c' (%d), u=%d <%d>) CID=%d render=%d glyphid=%d font=%08x",m.tx,m.ty,(charid&127)>=32?charid:'?', charid, u, uLen, font->isCIDFont(), render, glyphid, current_gfxfont);
if(render == RENDER_FILL || render == RENDER_INVISIBLE) {
device->drawchar(device, current_gfxfont, glyphid, &col, &m);
static char _trie_put(trielayer_t**t, unsigned const char*id, void*data)
{
if(!*t) {
- (*t) = rfx_calloc(sizeof(trie_t));
+ (*t) = rfx_calloc(sizeof(trielayer_t));
(*t)->rest = (unsigned char*)strdup(id);
(*t)->data = data;
return 0;
} else {
char contains = trie_contains(t, id);
void*olddata = contains?trie_lookup(t, id):0;
- trie_rollback_removes(t, id, data);
_trie_put(&t->start, id, data);
if(contains) {
trie_rollback_adds(t, id, olddata);
}
+ trie_rollback_removes(t, id, data);
}
}
char trie_remove(trie_t*t, unsigned const char*id)
void*olddata = trie_lookup(t, id);
char exists = _trie_remove(t->start, id);
if(exists) {
- trie_rollback_removes(t, id, olddata);
+ trie_rollback_adds(t, id, olddata);
}
return exists;
}
typedef struct _triememory {
const unsigned char*key;
void*data;
+ char del; // 0/1
struct _triememory*next;
} triememory_t;
typedef struct _trierollback {
- triememory_t*add;
- triememory_t*remove;
+ triememory_t*ops;
struct _trierollback*prev;
} trierollback_t;
-static void trie_rollback_removes(trie_t*t, unsigned const char*id, void*data)
+static void trie_rollback_adds(trie_t*t, unsigned const char*id, void*data)
{
trierollback_t*rollback = (trierollback_t*)t->rollback;
triememory_t*m = (triememory_t*)rfx_calloc(sizeof(triememory_t));
m->key = id;
m->data = data;
- m->next = rollback->add;
- rollback->add = m;
+ m->del = 0;
+ m->next = rollback->ops;
+ rollback->ops = m;
}
-static void trie_rollback_adds(trie_t*t, unsigned const char*id, void*data)
+static void trie_rollback_removes(trie_t*t, unsigned const char*id, void*data)
{
trierollback_t*rollback = (trierollback_t*)t->rollback;
triememory_t*m = (triememory_t*)rfx_calloc(sizeof(triememory_t));
m->key = id;
m->data = data;
- m->next = rollback->remove;
- rollback->remove = m;
+ m->del = 1;
+ m->next = rollback->ops;
+ rollback->ops = m;
}
+void _trie_dump(trielayer_t*t, char*buffer, int pos)
+{
+ int i;
+ for(i=0;i<256;i++) {
+ if(t->row[i]) {
+ buffer[pos]=i;
+ _trie_dump(t->row[i], buffer, pos+1);
+ }
+ }
+ if(t->rest) {
+ buffer[pos]=0;
+ printf("%s%s %08x\n", buffer, t->rest, t->data);
+ }
+}
+
+void trie_dump(trie_t*t)
+{
+ char buffer[256];
+ _trie_dump(t->start, buffer, 0);
+}
+
+
void trie_remember(trie_t*t)
{
trierollback_t*old = (trierollback_t*)t->rollback;
}
t->rollback = ((trierollback_t*)t->rollback)->prev;
- triememory_t*remove = rollback->remove;
- while(remove) {
- triememory_t*next = remove->next;
- if(!trie_remove(t, remove->key)) {
- fprintf(stderr, "Internal error: can't delete key %s in trie during rollback\n", remove->key);
+ triememory_t*op = rollback->ops;
+ while(op) {
+ triememory_t*next = op->next;
+ if(op->del) {
+ if(!_trie_remove(t->start, op->key)) {
+ fprintf(stderr, "Internal error: can't delete key %s in trie during rollback\n", op->key);
+ }
+ } else {
+ if(_trie_put(&t->start, op->key, op->data)) {
+ fprintf(stderr, "Internal error: overwrote key %s in trie during rollback\n", op->key);
+ }
}
- free(remove);
- remove = next;
- }
- triememory_t*add = rollback->add;
- while(add) {
- triememory_t*next = add->next;
- trie_put(t, add->key, add->data);
- add = next;
+ free(op);
+ op = next;
}
}
int trie_contains(trie_t*t, unsigned const char*id);
void trie_remember(trie_t*t);
void trie_rollback(trie_t*t);
+void trie_dump(trie_t*t);
array_t* array_new();
array_t* array_new2(type_t*type);
#define list_prepend(list, e) {sizeof((list)->next);list_prepend_(&(list),(e));}
#define list_free(list) {sizeof((list)->next);list_free_(&(list));}
#define list_deep_free(list) {sizeof((list)->next);list_deep_free_(&(list));}
-#define list_clone(list) (sizeof((list)->next),list_clone_(&(list)))
+#define list_clone(list) (sizeof((list)->next),(list?list_clone_(&(list)):0))
#define list_length(list) (sizeof((list)->next),list_length_(list))
#ifdef __cplusplus
if (!t->readBit) t->readBit = 0x80;
while (nbits)
{ res<<=1;
+#ifdef DEBUG_RFXSWF
+ if (t->pos>=t->len)
+ { fprintf(stderr,"GetBits() out of bounds: TagID = %i, pos=%d, len=%d\n",t->id, t->pos, t->len);
+ int i,m=t->len>10?10:t->len;
+ for(i=-1;i<m;i++) {
+ fprintf(stderr, "(%d)%02x ", i, t->data[i]);
+ }
+ fprintf(stderr, "\n");
+ return res;
+ }
+#endif
if (t->data[t->pos]&t->readBit) res|=1;
t->readBit>>=1;
nbits--;
if (!t->readBit)
{ if (nbits) t->readBit = 0x80;
- #ifdef DEBUG_RFXSWF
- if (t->pos>=t->len)
- { fprintf(stderr,"GetBits() out of bounds: TagID = %i\n",t->id);
- return res;
- }
- #endif
t->pos++;
}
}
while(1) {
U8 b = swf_GetU8(tag);
nr++;
- s|=(b&127)<<shift;
+ nt i,m=t->len>10?10:t->len;
+ for(i=0;i<m;i++) {
+ fprintf(stderr, "%02x ", t->data[i]);
+ }
+ fprintf(stderr, "\n");
+ s|=(b&127)<<shift;
shift+=7;
if(!(b&128) || shift>=32) {
if(b&64) {
${name}/avi2swf/avi2swf.1"
MAKEFILES="${name}/src/Makefile.in \
-${name}/pdf2swf/fonts/Makefile.in \
${name}/lib/readers/Makefile.in \
${name}/lib/art/Makefile.in \
${name}/lib/Makefile.in \
${name}/lib/as3/tokenizer.yy.c \
${name}/lib/as3/parser.tab.c \
${name}/lib/as3/parser.tab.h \
+${name}/lib/as3/scripts.c \
+${name}/lib/as3/scripts.h \
${name}/lib/action/action.h \
${name}/lib/action/actioncompiler.c \
${name}/lib/action/actioncompiler.h \
def system_has_property(self,name):
if name.startswith("STD"):
return 1
+ elif name.startswith("INTERNAL"):
+ return 1
+ elif "POPPLER" in name:
+ return None
elif name.startswith("HAVE_") and name.endswith("_H"):
header = name[5:].lower()
c = header.rfind("_")
static char * filename = 0;
static int verbose;
-struct options_t options[] =
-{
- {"v","verbose"},
- {"V","version"},
- {0,0}
+static struct options_t options[] = {
+{"h", "help"},
+{"v", "verbose"},
+{"V", "version"},
+{0,0}
};
int args_callback_option(char*name,char*val)
{
return args_long2shortoption(options, name, val);
}
-void args_callback_usage(char*name)
-{
- printf("Usage: %s [-at] file.swf\n", name);
- printf("\t-h , --help\t\t Print help and exit\n");
- printf("\t-v , --verbose\t\t Be more verbose\n");
- printf("\t-V , --version\t\t Print program version and exit\n");
+void args_callback_usage(char *name)
+{
+ printf("\n");
+ printf("Usage: %s [-v] file.swf > file.hexdump\n", name);
+ printf("OR: %s file.hexdump\n", name);
+ printf("\n");
+ printf("-h , --help Print help and exit\n");
+ printf("-v , --verbose Be more verbose\n");
+ printf("-V , --version Print program version and exit\n");
+ printf("\n");
}
int args_callback_command(char*name,char*val)
{