[Swfdec] 6 commits - libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_stage_as.c test/trace
Benjamin Otte
company at kemper.freedesktop.org
Thu Jul 26 14:00:43 PDT 2007
libswfdec/swfdec_initialize.as | 2
libswfdec/swfdec_initialize.h | 83 ++++++++++++++++-----------------
libswfdec/swfdec_player.c | 8 +++
libswfdec/swfdec_player_internal.h | 2
libswfdec/swfdec_stage_as.c | 93 +++++++++++++++++++++++++++++++++++++
test/trace/Makefile.am | 27 ++++++++++
test/trace/scalemode-5.swf |binary
test/trace/scalemode-5.swf.trace | 27 ++++++++++
test/trace/scalemode-6.swf |binary
test/trace/scalemode-6.swf.trace | 27 ++++++++++
test/trace/scalemode-7.swf |binary
test/trace/scalemode-7.swf.trace | 27 ++++++++++
test/trace/scalemode-8.swf |binary
test/trace/scalemode-8.swf.trace | 27 ++++++++++
test/trace/scalemode.as | 29 +++++++++++
test/trace/stage-align-5.swf |binary
test/trace/stage-align-5.swf.trace | 17 ++++++
test/trace/stage-align-6.swf |binary
test/trace/stage-align-6.swf.trace | 17 ++++++
test/trace/stage-align-7.swf |binary
test/trace/stage-align-7.swf.trace | 17 ++++++
test/trace/stage-align-8.swf |binary
test/trace/stage-align-8.swf.trace | 17 ++++++
test/trace/stage-align.as | 30 +++++++++++
test/trace/stage-size-5.swf |binary
test/trace/stage-size-5.swf.trace | 5 +
test/trace/stage-size-6.swf |binary
test/trace/stage-size-6.swf.trace | 5 +
test/trace/stage-size-7.swf |binary
test/trace/stage-size-7.swf.trace | 5 +
test/trace/stage-size-8.swf |binary
test/trace/stage-size-8.swf.trace | 5 +
test/trace/stage-size.as | 13 +++++
33 files changed, 441 insertions(+), 42 deletions(-)
New commits:
diff-tree 53d6aae6f5cf72dc934950928315ca48897365d5 (from d15cd39c16d02fc2caa2dda630486b935ad4d0ac)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 23:00:56 2007 +0200
add test for Stage.width and Stage.height
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 2c00771..e273dfe 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -815,6 +815,15 @@ EXTRA_DIST = \
stage-align-7.swf.trace \
stage-align-8.swf \
stage-align-8.swf.trace \
+ stage-size.as \
+ stage-size-5.swf \
+ stage-size-5.swf.trace \
+ stage-size-6.swf \
+ stage-size-6.swf.trace \
+ stage-size-7.swf \
+ stage-size-7.swf.trace \
+ stage-size-8.swf \
+ stage-size-8.swf.trace \
string-construct.as \
string-construct-5.swf \
string-construct-5.swf.trace \
diff --git a/test/trace/stage-size-5.swf b/test/trace/stage-size-5.swf
new file mode 100644
index 0000000..1454cb2
Binary files /dev/null and b/test/trace/stage-size-5.swf differ
diff --git a/test/trace/stage-size-5.swf.trace b/test/trace/stage-size-5.swf.trace
new file mode 100644
index 0000000..bd00598
--- /dev/null
+++ b/test/trace/stage-size-5.swf.trace
@@ -0,0 +1,5 @@
+Simple test for Stage size
+200
+200
+150
+150
diff --git a/test/trace/stage-size-6.swf b/test/trace/stage-size-6.swf
new file mode 100644
index 0000000..66aebbc
Binary files /dev/null and b/test/trace/stage-size-6.swf differ
diff --git a/test/trace/stage-size-6.swf.trace b/test/trace/stage-size-6.swf.trace
new file mode 100644
index 0000000..bd00598
--- /dev/null
+++ b/test/trace/stage-size-6.swf.trace
@@ -0,0 +1,5 @@
+Simple test for Stage size
+200
+200
+150
+150
diff --git a/test/trace/stage-size-7.swf b/test/trace/stage-size-7.swf
new file mode 100644
index 0000000..9203709
Binary files /dev/null and b/test/trace/stage-size-7.swf differ
diff --git a/test/trace/stage-size-7.swf.trace b/test/trace/stage-size-7.swf.trace
new file mode 100644
index 0000000..bd00598
--- /dev/null
+++ b/test/trace/stage-size-7.swf.trace
@@ -0,0 +1,5 @@
+Simple test for Stage size
+200
+200
+150
+150
diff --git a/test/trace/stage-size-8.swf b/test/trace/stage-size-8.swf
new file mode 100644
index 0000000..6d5e8b2
Binary files /dev/null and b/test/trace/stage-size-8.swf differ
diff --git a/test/trace/stage-size-8.swf.trace b/test/trace/stage-size-8.swf.trace
new file mode 100644
index 0000000..bd00598
--- /dev/null
+++ b/test/trace/stage-size-8.swf.trace
@@ -0,0 +1,5 @@
+Simple test for Stage size
+200
+200
+150
+150
diff --git a/test/trace/stage-size.as b/test/trace/stage-size.as
new file mode 100644
index 0000000..2ee922c
--- /dev/null
+++ b/test/trace/stage-size.as
@@ -0,0 +1,13 @@
+// makeswf -v 7 -s 200x150 -r 1 -o stage-size.swf stage-size.as
+
+trace ("Simple test for Stage size");
+
+trace (Stage.width);
+Stage.width = Stage.width / 2;
+trace (Stage.width);
+
+trace (Stage.height);
+Stage.height = Stage.height / 2;
+trace (Stage.height);
+
+loadMovie ("FSCommand:quit", "");
diff-tree d15cd39c16d02fc2caa2dda630486b935ad4d0ac (from 30acac7648a6342d0393bc765b30d43de1d8cf72)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 22:58:58 2007 +0200
implement Stage.width and Stage.height
diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index b58505b..f81e1e6 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -65,5 +65,5 @@ AsBroadcaster.initialize (Mouse);
/*** STAGE ***/
Stage = new Object ();
-ASSetNativeAccessor (Stage, 666, "scaleMode,align", 1);
+ASSetNativeAccessor (Stage, 666, "scaleMode,align,width,height", 1);
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 0da2706..3e15dd3 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -2,7 +2,7 @@
/* compiled from swfdec_initialize.as */
const unsigned char swfdec_initialize[] = {
- 0x88, 0x08, 0x01, 0x19, 0x00, 0x41, 0x53, 0x53, 0x65, 0x74, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x88, 0x15, 0x01, 0x19, 0x00, 0x41, 0x53, 0x53, 0x65, 0x74, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6F, 0x72, 0x00, 0x41, 0x53, 0x6E, 0x61, 0x74, 0x69, 0x76,
0x65, 0x00, 0x41, 0x73, 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00,
0x62, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
@@ -18,45 +18,46 @@ const unsigned char swfdec_initialize[]
0x53, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6F, 0x70, 0x46, 0x6C, 0x61, 0x67, 0x73, 0x00, 0x4D, 0x6F,
0x75, 0x73, 0x65, 0x00, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x73, 0x68, 0x6F, 0x77, 0x00,
0x68, 0x69, 0x64, 0x65, 0x00, 0x53, 0x74, 0x61, 0x67, 0x65, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65,
- 0x4D, 0x6F, 0x64, 0x65, 0x2C, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x00, 0x9B, 0x12, 0x00, 0x41, 0x73,
- 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x96, 0x13, 0x00, 0x08, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x07,
- 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x13,
- 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00, 0x00, 0x00, 0x07, 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00,
- 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x04, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x96, 0x02, 0x00, 0x08, 0x06,
- 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x07, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00,
- 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x09, 0x52,
- 0x17, 0x96, 0x02, 0x00, 0x05, 0x01, 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x07, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x8F, 0x00, 0x96, 0x04, 0x00,
- 0x08, 0x0A, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x3C, 0x96, 0x02, 0x00, 0x08,
- 0x0B, 0x41, 0x96, 0x07, 0x00, 0x08, 0x0B, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x99, 0x02, 0x00,
- 0x09, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x4C, 0x1C, 0x50, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x0B,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x48, 0x12, 0x9D,
- 0x02, 0x00, 0x42, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C,
- 0x4E, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x49, 0x12, 0x9D, 0x02, 0x00, 0x23, 0x00, 0x96, 0x07,
- 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x0B, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x02, 0x00, 0x00,
- 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x52, 0x17, 0x96, 0x02, 0x00, 0x05, 0x01,
- 0x3E, 0x99, 0x02, 0x00, 0x9C, 0xFF, 0x96, 0x02, 0x00, 0x05, 0x00, 0x3E, 0x4F, 0x96, 0x02, 0x00,
- 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00,
- 0x75, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00,
- 0x00, 0x00, 0x07, 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F,
- 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x04, 0x08, 0x02, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x04, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x07,
- 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C,
- 0x96, 0x09, 0x00, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x4F, 0x96, 0x09,
- 0x00, 0x07, 0x83, 0x00, 0x00, 0x00, 0x08, 0x11, 0x08, 0x0F, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03,
- 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17, 0x4F, 0x96, 0x08, 0x00, 0x07, 0x83, 0x00, 0x00, 0x00,
- 0x02, 0x08, 0x02, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17,
- 0x96, 0x09, 0x00, 0x08, 0x13, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x02,
- 0x00, 0x08, 0x13, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x15, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x05,
- 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08,
- 0x13, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x16, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00,
- 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C,
- 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E,
- 0x52, 0x17, 0x96, 0x09, 0x00, 0x08, 0x17, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D,
- 0x96, 0x0E, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x18, 0x07, 0x9A, 0x02, 0x00, 0x00, 0x08,
- 0x17, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3D, 0x17, 0x00
+ 0x4D, 0x6F, 0x64, 0x65, 0x2C, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x2C, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x2C, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x00, 0x9B, 0x12, 0x00, 0x41, 0x73, 0x42, 0x72, 0x6F,
+ 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x13, 0x00,
+ 0x08, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00,
+ 0x00, 0x08, 0x01, 0x3D, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03,
+ 0x07, 0x0C, 0x00, 0x00, 0x00, 0x07, 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08,
+ 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x9B, 0x07,
+ 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x96, 0x07,
+ 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07, 0x52, 0x17,
+ 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x05,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x09, 0x52, 0x17, 0x96, 0x02,
+ 0x00, 0x05, 0x01, 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07,
+ 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x8F, 0x00, 0x96, 0x04, 0x00, 0x08, 0x0A, 0x08,
+ 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x3C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x41, 0x96,
+ 0x07, 0x00, 0x08, 0x0B, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x99, 0x02, 0x00, 0x09, 0x00, 0x96,
+ 0x02, 0x00, 0x08, 0x0B, 0x4C, 0x1C, 0x50, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x48, 0x12, 0x9D, 0x02, 0x00, 0x42,
+ 0x00, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C, 0x4E, 0x96, 0x02,
+ 0x00, 0x08, 0x06, 0x1C, 0x49, 0x12, 0x9D, 0x02, 0x00, 0x23, 0x00, 0x96, 0x07, 0x00, 0x07, 0x01,
+ 0x00, 0x00, 0x00, 0x08, 0x0B, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x0A,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x52, 0x17, 0x96, 0x02, 0x00, 0x05, 0x01, 0x3E, 0x99, 0x02,
+ 0x00, 0x9C, 0xFF, 0x96, 0x02, 0x00, 0x05, 0x00, 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x0E, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x75, 0x00, 0x96,
+ 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00, 0x00, 0x00, 0x07,
+ 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00,
+ 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x04, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04,
+ 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x07, 0x08, 0x02, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x07, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x09, 0x00,
+ 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x4F, 0x96, 0x09, 0x00, 0x07, 0x83,
+ 0x00, 0x00, 0x00, 0x08, 0x11, 0x08, 0x0F, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00,
+ 0x08, 0x12, 0x3D, 0x17, 0x4F, 0x96, 0x08, 0x00, 0x07, 0x83, 0x00, 0x00, 0x00, 0x02, 0x08, 0x02,
+ 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17, 0x96, 0x09, 0x00,
+ 0x08, 0x13, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x13,
+ 0x1C, 0x96, 0x13, 0x00, 0x08, 0x15, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x00,
+ 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x96,
+ 0x13, 0x00, 0x08, 0x16, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x00, 0x07, 0x02,
+ 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x96, 0x07, 0x00,
+ 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E, 0x52, 0x17, 0x96,
+ 0x09, 0x00, 0x08, 0x17, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x0E, 0x00,
+ 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x18, 0x07, 0x9A, 0x02, 0x00, 0x00, 0x08, 0x17, 0x1C, 0x96,
+ 0x07, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3D, 0x17, 0x00
};
diff --git a/libswfdec/swfdec_stage_as.c b/libswfdec/swfdec_stage_as.c
index eee9a6b..85fc9ea 100644
--- a/libswfdec/swfdec_stage_as.c
+++ b/libswfdec/swfdec_stage_as.c
@@ -126,3 +126,47 @@ set_align (SwfdecAsContext *cx, SwfdecAs
g_object_notify (G_OBJECT (player), "alignment");
}
}
+
+SWFDEC_AS_NATIVE (666, 5, get_width)
+void
+get_width (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+
+ if (player->stage_width > -1) {
+ SWFDEC_AS_VALUE_SET_INT (ret, player->stage_width);
+ } else {
+ SWFDEC_AS_VALUE_SET_INT (ret, player->width);
+ }
+}
+
+SWFDEC_AS_NATIVE (666, 7, get_height)
+void
+get_height (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+
+ if (player->stage_height > -1) {
+ SWFDEC_AS_VALUE_SET_INT (ret, player->stage_height);
+ } else {
+ SWFDEC_AS_VALUE_SET_INT (ret, player->height);
+ }
+}
+
+/* FIXME: do this smarter */
+SWFDEC_AS_NATIVE (666, 6, set_width)
+void
+set_width (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+}
+
+SWFDEC_AS_NATIVE (666, 8, set_height)
+void
+set_height (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+}
+
diff-tree 30acac7648a6342d0393bc765b30d43de1d8cf72 (from a075ac9c14cab3d9e089ba08d97c1401655c297c)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 22:58:42 2007 +0200
initialize stage size to -1 so the default size is taken
diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 5bbf545..398db18 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -1188,6 +1188,8 @@ swfdec_player_init (SwfdecPlayer *player
player->iterate_timeout.callback = swfdec_player_iterate;
player->init_queue = g_queue_new ();
player->construct_queue = g_queue_new ();
+ player->stage_width = -1;
+ player->stage_height = -1;
}
void
diff-tree a075ac9c14cab3d9e089ba08d97c1401655c297c (from 5a3788d18061faee3612389568d05efb5fff4f54)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 22:42:01 2007 +0200
add test for Stage.align
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 3f9cf9d..2c00771 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -806,6 +806,15 @@ EXTRA_DIST = \
stack-segments2-7.swf.trace \
stack-segments2-8.swf \
stack-segments2-8.swf.trace \
+ stage-align.as \
+ stage-align-5.swf \
+ stage-align-5.swf.trace \
+ stage-align-6.swf \
+ stage-align-6.swf.trace \
+ stage-align-7.swf \
+ stage-align-7.swf.trace \
+ stage-align-8.swf \
+ stage-align-8.swf.trace \
string-construct.as \
string-construct-5.swf \
string-construct-5.swf.trace \
diff --git a/test/trace/stage-align-5.swf b/test/trace/stage-align-5.swf
new file mode 100644
index 0000000..5bf9272
Binary files /dev/null and b/test/trace/stage-align-5.swf differ
diff --git a/test/trace/stage-align-5.swf.trace b/test/trace/stage-align-5.swf.trace
new file mode 100644
index 0000000..1a235f1
--- /dev/null
+++ b/test/trace/stage-align-5.swf.trace
@@ -0,0 +1,17 @@
+Check Stage.align
+
+L ==> L
+R ==> R
+LR ==> LR
+RL ==> LR
+LRL ==> LR
+RLR ==> LR
+T ==> T
+B ==> B
+BT ==> TB
+TB ==> TB
+BTB ==> TB
+TBT ==> TB
+TRLB ==> LTRB
+tlrb ==> LTRB
+RmoviesdsdgaRsdgagaergBafsgafgaS ==> RB
diff --git a/test/trace/stage-align-6.swf b/test/trace/stage-align-6.swf
new file mode 100644
index 0000000..2b5fd59
Binary files /dev/null and b/test/trace/stage-align-6.swf differ
diff --git a/test/trace/stage-align-6.swf.trace b/test/trace/stage-align-6.swf.trace
new file mode 100644
index 0000000..1a235f1
--- /dev/null
+++ b/test/trace/stage-align-6.swf.trace
@@ -0,0 +1,17 @@
+Check Stage.align
+
+L ==> L
+R ==> R
+LR ==> LR
+RL ==> LR
+LRL ==> LR
+RLR ==> LR
+T ==> T
+B ==> B
+BT ==> TB
+TB ==> TB
+BTB ==> TB
+TBT ==> TB
+TRLB ==> LTRB
+tlrb ==> LTRB
+RmoviesdsdgaRsdgagaergBafsgafgaS ==> RB
diff --git a/test/trace/stage-align-7.swf b/test/trace/stage-align-7.swf
new file mode 100644
index 0000000..4bf78bb
Binary files /dev/null and b/test/trace/stage-align-7.swf differ
diff --git a/test/trace/stage-align-7.swf.trace b/test/trace/stage-align-7.swf.trace
new file mode 100644
index 0000000..1a235f1
--- /dev/null
+++ b/test/trace/stage-align-7.swf.trace
@@ -0,0 +1,17 @@
+Check Stage.align
+
+L ==> L
+R ==> R
+LR ==> LR
+RL ==> LR
+LRL ==> LR
+RLR ==> LR
+T ==> T
+B ==> B
+BT ==> TB
+TB ==> TB
+BTB ==> TB
+TBT ==> TB
+TRLB ==> LTRB
+tlrb ==> LTRB
+RmoviesdsdgaRsdgagaergBafsgafgaS ==> RB
diff --git a/test/trace/stage-align-8.swf b/test/trace/stage-align-8.swf
new file mode 100644
index 0000000..500f658
Binary files /dev/null and b/test/trace/stage-align-8.swf differ
diff --git a/test/trace/stage-align-8.swf.trace b/test/trace/stage-align-8.swf.trace
new file mode 100644
index 0000000..1a235f1
--- /dev/null
+++ b/test/trace/stage-align-8.swf.trace
@@ -0,0 +1,17 @@
+Check Stage.align
+
+L ==> L
+R ==> R
+LR ==> LR
+RL ==> LR
+LRL ==> LR
+RLR ==> LR
+T ==> T
+B ==> B
+BT ==> TB
+TB ==> TB
+BTB ==> TB
+TBT ==> TB
+TRLB ==> LTRB
+tlrb ==> LTRB
+RmoviesdsdgaRsdgagaergBafsgafgaS ==> RB
diff --git a/test/trace/stage-align.as b/test/trace/stage-align.as
new file mode 100644
index 0000000..3a3b8e0
--- /dev/null
+++ b/test/trace/stage-align.as
@@ -0,0 +1,30 @@
+// makeswf -v 7 -s 200x150 -r 1 -o stage-align.swf stage-align.as
+
+trace ("Check Stage.align");
+
+values = [
+ "L",
+ "R",
+ "LR",
+ "RL",
+ "LRL",
+ "RLR",
+ "T",
+ "B",
+ "BT",
+ "TB",
+ "BTB",
+ "TBT",
+ "TRLB",
+ "tlrb",
+ "RmoviesdsdgaRsdgagaergBafsgafgaS"
+];
+
+trace (Stage.align);
+for (i = 0; i < values.length; i++) {
+ Stage.align = values[i];
+ trace (values[i] + " ==> " + Stage.align);
+};
+
+loadMovie ("FSCommand:quit", "");
+
diff-tree 5a3788d18061faee3612389568d05efb5fff4f54 (from d5cb0796cf85bd83832d71b8a87ed38495c53b01)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 22:41:01 2007 +0200
implement Stage.align
diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index 6012fbb..b58505b 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -65,5 +65,5 @@ AsBroadcaster.initialize (Mouse);
/*** STAGE ***/
Stage = new Object ();
-ASSetNativeAccessor (Stage, 666, "scaleMode", 1);
+ASSetNativeAccessor (Stage, 666, "scaleMode,align", 1);
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index c8799fb..0da2706 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -2,7 +2,7 @@
/* compiled from swfdec_initialize.as */
const unsigned char swfdec_initialize[] = {
- 0x88, 0x02, 0x01, 0x19, 0x00, 0x41, 0x53, 0x53, 0x65, 0x74, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x88, 0x08, 0x01, 0x19, 0x00, 0x41, 0x53, 0x53, 0x65, 0x74, 0x4E, 0x61, 0x74, 0x69, 0x76, 0x65,
0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6F, 0x72, 0x00, 0x41, 0x53, 0x6E, 0x61, 0x74, 0x69, 0x76,
0x65, 0x00, 0x41, 0x73, 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00,
0x62, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4D, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
@@ -18,45 +18,45 @@ const unsigned char swfdec_initialize[]
0x53, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6F, 0x70, 0x46, 0x6C, 0x61, 0x67, 0x73, 0x00, 0x4D, 0x6F,
0x75, 0x73, 0x65, 0x00, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x73, 0x68, 0x6F, 0x77, 0x00,
0x68, 0x69, 0x64, 0x65, 0x00, 0x53, 0x74, 0x61, 0x67, 0x65, 0x00, 0x73, 0x63, 0x61, 0x6C, 0x65,
- 0x4D, 0x6F, 0x64, 0x65, 0x00, 0x9B, 0x12, 0x00, 0x41, 0x73, 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63,
- 0x61, 0x73, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x13, 0x00, 0x08, 0x00, 0x07,
- 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
- 0x3D, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00,
+ 0x4D, 0x6F, 0x64, 0x65, 0x2C, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x00, 0x9B, 0x12, 0x00, 0x41, 0x73,
+ 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x96, 0x13, 0x00, 0x08, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x07,
+ 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x13,
+ 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00, 0x00, 0x00, 0x07, 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00,
+ 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x04, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x96, 0x02, 0x00, 0x08, 0x06,
+ 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x07, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00,
+ 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x09, 0x52,
+ 0x17, 0x96, 0x02, 0x00, 0x05, 0x01, 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x07, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x78, 0x00, 0x8F, 0x00, 0x96, 0x04, 0x00,
+ 0x08, 0x0A, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x3C, 0x96, 0x02, 0x00, 0x08,
+ 0x0B, 0x41, 0x96, 0x07, 0x00, 0x08, 0x0B, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x99, 0x02, 0x00,
+ 0x09, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x4C, 0x1C, 0x50, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x0B,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x48, 0x12, 0x9D,
+ 0x02, 0x00, 0x42, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C,
+ 0x4E, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x49, 0x12, 0x9D, 0x02, 0x00, 0x23, 0x00, 0x96, 0x07,
+ 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x0B, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x02, 0x00, 0x00,
+ 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x52, 0x17, 0x96, 0x02, 0x00, 0x05, 0x01,
+ 0x3E, 0x99, 0x02, 0x00, 0x9C, 0xFF, 0x96, 0x02, 0x00, 0x05, 0x00, 0x3E, 0x4F, 0x96, 0x02, 0x00,
+ 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00,
+ 0x75, 0x00, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00,
0x00, 0x00, 0x07, 0x65, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F,
- 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x9B, 0x07, 0x00, 0x00, 0x01,
- 0x00, 0x78, 0x00, 0x3C, 0x00, 0x96, 0x02, 0x00, 0x08, 0x06, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01,
- 0x00, 0x00, 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07, 0x52, 0x17, 0x96, 0x02, 0x00,
- 0x08, 0x06, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x05, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x08, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x09, 0x52, 0x17, 0x96, 0x02, 0x00, 0x05, 0x01,
- 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07, 0x9B, 0x07, 0x00,
- 0x00, 0x01, 0x00, 0x78, 0x00, 0x8F, 0x00, 0x96, 0x04, 0x00, 0x08, 0x0A, 0x08, 0x05, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x08, 0x4E, 0x3C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x41, 0x96, 0x07, 0x00, 0x08,
- 0x0B, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x99, 0x02, 0x00, 0x09, 0x00, 0x96, 0x02, 0x00, 0x08,
- 0x0B, 0x4C, 0x1C, 0x50, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0A,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x48, 0x12, 0x9D, 0x02, 0x00, 0x42, 0x00, 0x96, 0x02,
- 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0B, 0x1C, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x06,
- 0x1C, 0x49, 0x12, 0x9D, 0x02, 0x00, 0x23, 0x00, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00,
- 0x08, 0x0B, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x0A, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x0D, 0x52, 0x17, 0x96, 0x02, 0x00, 0x05, 0x01, 0x3E, 0x99, 0x02, 0x00, 0x9C, 0xFF,
- 0x96, 0x02, 0x00, 0x05, 0x00, 0x3E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x0E, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x6F, 0x00, 0x75, 0x00, 0x96, 0x02, 0x00, 0x08,
- 0x0F, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x03, 0x07, 0x0C, 0x00, 0x00, 0x00, 0x07, 0x65, 0x00, 0x00,
- 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C,
- 0x96, 0x04, 0x00, 0x08, 0x04, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x4F, 0x96,
- 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x07, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x07, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x09, 0x00, 0x08, 0x08, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x4F, 0x96, 0x09, 0x00, 0x07, 0x83, 0x00, 0x00, 0x00,
- 0x08, 0x11, 0x08, 0x0F, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D,
- 0x17, 0x4F, 0x96, 0x08, 0x00, 0x07, 0x83, 0x00, 0x00, 0x00, 0x02, 0x08, 0x02, 0x1C, 0x96, 0x07,
- 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17, 0x96, 0x09, 0x00, 0x08, 0x13, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x96, 0x13,
- 0x00, 0x08, 0x15, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00,
- 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x96, 0x13, 0x00, 0x08,
- 0x16, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00,
- 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00,
- 0x00, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E, 0x52, 0x17, 0x96, 0x09, 0x00, 0x08,
- 0x17, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x0E, 0x00, 0x07, 0x01, 0x00,
- 0x00, 0x00, 0x08, 0x18, 0x07, 0x9A, 0x02, 0x00, 0x00, 0x08, 0x17, 0x1C, 0x96, 0x07, 0x00, 0x07,
- 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3D, 0x17, 0x00
+ 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x04, 0x08, 0x02, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x04, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x07,
+ 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x07, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x1C,
+ 0x96, 0x09, 0x00, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x4F, 0x96, 0x09,
+ 0x00, 0x07, 0x83, 0x00, 0x00, 0x00, 0x08, 0x11, 0x08, 0x0F, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03,
+ 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17, 0x4F, 0x96, 0x08, 0x00, 0x07, 0x83, 0x00, 0x00, 0x00,
+ 0x02, 0x08, 0x02, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x3D, 0x17,
+ 0x96, 0x09, 0x00, 0x08, 0x13, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D, 0x96, 0x02,
+ 0x00, 0x08, 0x13, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x15, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x05,
+ 0x00, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08,
+ 0x13, 0x1C, 0x96, 0x13, 0x00, 0x08, 0x16, 0x07, 0x01, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00,
+ 0x00, 0x07, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01, 0x3D, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x13, 0x1C,
+ 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x02, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0E,
+ 0x52, 0x17, 0x96, 0x09, 0x00, 0x08, 0x17, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x40, 0x1D,
+ 0x96, 0x0E, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x18, 0x07, 0x9A, 0x02, 0x00, 0x00, 0x08,
+ 0x17, 0x1C, 0x96, 0x07, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3D, 0x17, 0x00
};
diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 72313a4..5bbf545 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -1891,6 +1891,12 @@ swfdec_player_set_alignment (SwfdecPlaye
g_return_if_fail (SWFDEC_IS_PLAYER (player));
flags = swfdec_player_alignment_to_flags (align);
+ swfdec_player_set_align_flags (player, flags);
+}
+
+void
+swfdec_player_set_align_flags (SwfdecPlayer *player, guint flags)
+{
if (flags != player->align_flags) {
player->align_flags = flags;
swfdec_player_update_scale (player);
diff --git a/libswfdec/swfdec_player_internal.h b/libswfdec/swfdec_player_internal.h
index 9c3ef99..84946ff 100644
--- a/libswfdec/swfdec_player_internal.h
+++ b/libswfdec/swfdec_player_internal.h
@@ -160,6 +160,8 @@ void swfdec_player_set_drag_movie (Swfd
SwfdecMovie * drag,
gboolean center,
SwfdecRect * rect);
+void swfdec_player_set_align_flags (SwfdecPlayer * player,
+ guint flags);
void swfdec_player_stop_all_sounds (SwfdecPlayer * player);
SwfdecMovie * swfdec_player_add_level_from_loader
(SwfdecPlayer * player,
diff --git a/libswfdec/swfdec_stage_as.c b/libswfdec/swfdec_stage_as.c
index 119d69c..eee9a6b 100644
--- a/libswfdec/swfdec_stage_as.c
+++ b/libswfdec/swfdec_stage_as.c
@@ -21,6 +21,7 @@
#include "config.h"
#endif
+#include <string.h>
#include "swfdec_as_strings.h"
#include "swfdec_debug.h"
#include "swfdec_player_internal.h"
@@ -77,3 +78,51 @@ set_scaleMode (SwfdecAsContext *cx, Swfd
swfdec_player_set_scale_mode (player, mode);
}
+SWFDEC_AS_NATIVE (666, 3, get_align)
+void
+get_align (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+ char s[5];
+ guint i = 0;
+
+ if (player->align_flags & SWFDEC_ALIGN_FLAG_LEFT)
+ s[i++] = 'L';
+ if (player->align_flags & SWFDEC_ALIGN_FLAG_TOP)
+ s[i++] = 'T';
+ if (player->align_flags & SWFDEC_ALIGN_FLAG_RIGHT)
+ s[i++] = 'R';
+ if (player->align_flags & SWFDEC_ALIGN_FLAG_BOTTOM)
+ s[i++] = 'B';
+ s[i] = 0;
+ SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, s));
+}
+
+SWFDEC_AS_NATIVE (666, 4, set_align)
+void
+set_align (SwfdecAsContext *cx, SwfdecAsObject *object,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+ SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+ guint flags = 0;
+ const char *s;
+
+ if (argc == 0)
+ return;
+
+ s = swfdec_as_value_to_string (cx, &argv[0]);
+ if (strchr (s, 'l') || strchr (s, 'L'))
+ flags |= SWFDEC_ALIGN_FLAG_LEFT;
+ if (strchr (s, 't') || strchr (s, 'T'))
+ flags |= SWFDEC_ALIGN_FLAG_TOP;
+ if (strchr (s, 'r') || strchr (s, 'R'))
+ flags |= SWFDEC_ALIGN_FLAG_RIGHT;
+ if (strchr (s, 'b') || strchr (s, 'B'))
+ flags |= SWFDEC_ALIGN_FLAG_BOTTOM;
+
+ if (flags != player->align_flags) {
+ player->align_flags = flags;
+ g_object_notify (G_OBJECT (player), "alignment");
+ }
+}
diff-tree d5cb0796cf85bd83832d71b8a87ed38495c53b01 (from 13033450e2eb8c051d53c6a17a7aa11b88daad9e)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jul 26 22:38:25 2007 +0200
add test for Stage.scaleMode
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 3f3d6f1..3f9cf9d 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -717,6 +717,15 @@ EXTRA_DIST = \
round-direction-7.swf.trace \
round-direction-8.swf \
round-direction-8.swf.trace \
+ scalemode.as \
+ scalemode-5.swf \
+ scalemode-5.swf.trace \
+ scalemode-6.swf \
+ scalemode-6.swf.trace \
+ scalemode-7.swf \
+ scalemode-7.swf.trace \
+ scalemode-8.swf \
+ scalemode-8.swf.trace \
scope.swf \
scope.swf.trace \
scope2.swf \
diff --git a/test/trace/scalemode-5.swf b/test/trace/scalemode-5.swf
new file mode 100644
index 0000000..45166c4
Binary files /dev/null and b/test/trace/scalemode-5.swf differ
diff --git a/test/trace/scalemode-5.swf.trace b/test/trace/scalemode-5.swf.trace
new file mode 100644
index 0000000..f9f029b
--- /dev/null
+++ b/test/trace/scalemode-5.swf.trace
@@ -0,0 +1,27 @@
+test Stage.scaleMode
+showAll
+noborder ==> noBorder
+noBorder ==> noBorder
+NOBORDER ==> noBorder
+exactfit ==> exactFit
+exactFit ==> exactFit
+EXACTFIT ==> exactFit
+showall ==> showAll
+showAll ==> showAll
+SHOWALL ==> showAll
+noscale ==> noScale
+noScale ==> noScale
+NOSCALE ==> noScale
+foo ==> showAll
+bar ==> showAll
+null ==> showAll
+ ==> showAll
+ ==> showAll
+0 ==> showAll
+1 ==> showAll
+2 ==> showAll
+3 ==> showAll
+4 ==> showAll
+thishasnoborder ==> showAll
+noBorder
+exactFit
diff --git a/test/trace/scalemode-6.swf b/test/trace/scalemode-6.swf
new file mode 100644
index 0000000..5329a13
Binary files /dev/null and b/test/trace/scalemode-6.swf differ
diff --git a/test/trace/scalemode-6.swf.trace b/test/trace/scalemode-6.swf.trace
new file mode 100644
index 0000000..f9f029b
--- /dev/null
+++ b/test/trace/scalemode-6.swf.trace
@@ -0,0 +1,27 @@
+test Stage.scaleMode
+showAll
+noborder ==> noBorder
+noBorder ==> noBorder
+NOBORDER ==> noBorder
+exactfit ==> exactFit
+exactFit ==> exactFit
+EXACTFIT ==> exactFit
+showall ==> showAll
+showAll ==> showAll
+SHOWALL ==> showAll
+noscale ==> noScale
+noScale ==> noScale
+NOSCALE ==> noScale
+foo ==> showAll
+bar ==> showAll
+null ==> showAll
+ ==> showAll
+ ==> showAll
+0 ==> showAll
+1 ==> showAll
+2 ==> showAll
+3 ==> showAll
+4 ==> showAll
+thishasnoborder ==> showAll
+noBorder
+exactFit
diff --git a/test/trace/scalemode-7.swf b/test/trace/scalemode-7.swf
new file mode 100644
index 0000000..f024415
Binary files /dev/null and b/test/trace/scalemode-7.swf differ
diff --git a/test/trace/scalemode-7.swf.trace b/test/trace/scalemode-7.swf.trace
new file mode 100644
index 0000000..7ca5b70
--- /dev/null
+++ b/test/trace/scalemode-7.swf.trace
@@ -0,0 +1,27 @@
+test Stage.scaleMode
+showAll
+noborder ==> noBorder
+noBorder ==> noBorder
+NOBORDER ==> noBorder
+exactfit ==> exactFit
+exactFit ==> exactFit
+EXACTFIT ==> exactFit
+showall ==> showAll
+showAll ==> showAll
+SHOWALL ==> showAll
+noscale ==> noScale
+noScale ==> noScale
+NOSCALE ==> noScale
+foo ==> showAll
+bar ==> showAll
+null ==> showAll
+undefined ==> showAll
+ ==> showAll
+0 ==> showAll
+1 ==> showAll
+2 ==> showAll
+3 ==> showAll
+4 ==> showAll
+thishasnoborder ==> showAll
+noBorder
+exactFit
diff --git a/test/trace/scalemode-8.swf b/test/trace/scalemode-8.swf
new file mode 100644
index 0000000..21ec76a
Binary files /dev/null and b/test/trace/scalemode-8.swf differ
diff --git a/test/trace/scalemode-8.swf.trace b/test/trace/scalemode-8.swf.trace
new file mode 100644
index 0000000..7ca5b70
--- /dev/null
+++ b/test/trace/scalemode-8.swf.trace
@@ -0,0 +1,27 @@
+test Stage.scaleMode
+showAll
+noborder ==> noBorder
+noBorder ==> noBorder
+NOBORDER ==> noBorder
+exactfit ==> exactFit
+exactFit ==> exactFit
+EXACTFIT ==> exactFit
+showall ==> showAll
+showAll ==> showAll
+SHOWALL ==> showAll
+noscale ==> noScale
+noScale ==> noScale
+NOSCALE ==> noScale
+foo ==> showAll
+bar ==> showAll
+null ==> showAll
+undefined ==> showAll
+ ==> showAll
+0 ==> showAll
+1 ==> showAll
+2 ==> showAll
+3 ==> showAll
+4 ==> showAll
+thishasnoborder ==> showAll
+noBorder
+exactFit
diff --git a/test/trace/scalemode.as b/test/trace/scalemode.as
new file mode 100644
index 0000000..a0e84b6
--- /dev/null
+++ b/test/trace/scalemode.as
@@ -0,0 +1,29 @@
+// makeswf -v 7 -s 200x150 -r 1 -o scalemode.swf scalemode.as
+
+trace ("test Stage.scaleMode");
+
+trace (Stage.scaleMode);
+modes = [
+ "noborder", "noBorder", "NOBORDER",
+ "exactfit", "exactFit", "EXACTFIT",
+ "showall", "showAll", "SHOWALL",
+ "noscale", "noScale", "NOSCALE",
+ "foo", "bar", null, undefined, "",
+ 0, 1, 2, 3, 4,
+ "thishasnoborder"
+];
+
+for (i = 0; i < modes.length; i++) {
+ Stage.scaleMode = modes[i];
+ trace (modes[i] + " ==> " + Stage.scaleMode);
+ Stage.scaleMode = "showAll";
+};
+
+Stage.scaleMode = "noBorder";
+foo = ASnative (666, 2);
+foo ();
+trace (Stage.scaleMode);
+foo ("exactfit");
+trace (Stage.scaleMode);
+
+loadMovie ("FSCommand:quit", "");
More information about the Swfdec
mailing list