[Swfdec] 13 commits - libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec/Makefile.am libswfdec/swfdec_as_types.c libswfdec/swfdec.h libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_key_as.c libswfdec/swfdec_key.h libswfdec/swfdec_keys.h libswfdec/swfdec_marshal.list libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h player/swfdec_debug_widget.c

Benjamin Otte company at kemper.freedesktop.org
Tue Aug 7 03:20:56 PDT 2007


 libswfdec-gtk/Makefile.am          |    2 
 libswfdec-gtk/swfdec_gtk_keys.c    |   67 +++++++++++++++++
 libswfdec-gtk/swfdec_gtk_keys.h    |   10 +-
 libswfdec-gtk/swfdec_gtk_widget.c  |   73 ++++++++++++++++++
 libswfdec/Makefile.am              |    3 
 libswfdec/swfdec.h                 |    2 
 libswfdec/swfdec_as_types.c        |   68 ++++++++---------
 libswfdec/swfdec_initialize.as     |    8 ++
 libswfdec/swfdec_initialize.h      |  143 +++++++++++++++++++++----------------
 libswfdec/swfdec_key_as.c          |   67 +++++++++++++++++
 libswfdec/swfdec_keys.h            |  125 ++++++++++++++++++++++++++++++++
 libswfdec/swfdec_marshal.list      |    2 
 libswfdec/swfdec_player.c          |   43 +++++++----
 libswfdec/swfdec_player.h          |    7 +
 libswfdec/swfdec_player_as.c       |   41 ++++++++++
 libswfdec/swfdec_player_internal.h |    8 +-
 player/swfdec_debug_widget.c       |    2 
 17 files changed, 547 insertions(+), 124 deletions(-)

New commits:
diff-tree 7e10a396ba62a265cbc1bfb094e8d7146a796f5e (from 26cb7fd5dbc038e9d6d96ddf04af705090100a05)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Aug 7 12:12:20 2007 +0200

    handle keyboard input as good as possible
    
    I'm still not sure how to properly translate X11 key events to Flash key codes,
    but I guess we'll figure it out.

diff --git a/libswfdec-gtk/Makefile.am b/libswfdec-gtk/Makefile.am
index bec8353..e5dec9e 100644
--- a/libswfdec-gtk/Makefile.am
+++ b/libswfdec-gtk/Makefile.am
@@ -13,6 +13,7 @@ js_cflags = -I$(srcdir)/js/ -I$(top_buil
 libswfdec_gtk_ at SWFDEC_MAJORMINOR@_la_SOURCES = \
 	swfdec_playback.c \
 	swfdec_source.c \
+	swfdec_gtk_keys.c \
 	swfdec_gtk_loader.c \
 	swfdec_gtk_player.c \
 	swfdec_gtk_widget.c
@@ -32,6 +33,7 @@ libswfdec_gtk_ at SWFDEC_MAJORMINOR@_la_LDF
 libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/libswfdec-gtk
 libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = \
 	swfdec-gtk.h \
+	swfdec_gtk_keys.h \
 	swfdec_gtk_loader.h \
 	swfdec_gtk_player.h \
 	swfdec_gtk_widget.h
diff --git a/libswfdec-gtk/swfdec_gtk_keys.c b/libswfdec-gtk/swfdec_gtk_keys.c
new file mode 100644
index 0000000..93593e1
--- /dev/null
+++ b/libswfdec-gtk/swfdec_gtk_keys.c
@@ -0,0 +1,67 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "swfdec_gtk_keys.h"
+
+static const guint8 flash_keycodes[] = {
+  /*   0 */ 0, 0, 0, 0, 0, 
+  /*   5 */ 0, 0, 0, 0, SWFDEC_KEY_ESCAPE,
+  /*  10 */ SWFDEC_KEY_1, SWFDEC_KEY_2, SWFDEC_KEY_3, SWFDEC_KEY_4, SWFDEC_KEY_5, 
+  /*  15 */ SWFDEC_KEY_6, SWFDEC_KEY_7, SWFDEC_KEY_8, SWFDEC_KEY_9, SWFDEC_KEY_0,
+  /*  20 */ SWFDEC_KEY_MINUS, SWFDEC_KEY_EQUAL, SWFDEC_KEY_BACKSPACE, SWFDEC_KEY_TAB, SWFDEC_KEY_Q,
+  /*  25 */ SWFDEC_KEY_W, SWFDEC_KEY_E, SWFDEC_KEY_R, SWFDEC_KEY_T, SWFDEC_KEY_Y,
+  /*  30 */ SWFDEC_KEY_U, SWFDEC_KEY_I, SWFDEC_KEY_O, SWFDEC_KEY_P, SWFDEC_KEY_LEFT_BRACKET,
+  /*  35 */ SWFDEC_KEY_RIGHT_BRACKET, SWFDEC_KEY_ENTER, SWFDEC_KEY_CONTROL, SWFDEC_KEY_A, SWFDEC_KEY_S,
+  /*  40 */ SWFDEC_KEY_D, SWFDEC_KEY_F, SWFDEC_KEY_G, SWFDEC_KEY_H, SWFDEC_KEY_J,
+  /*  45 */ SWFDEC_KEY_K, SWFDEC_KEY_L, SWFDEC_KEY_SEMICOLON, SWFDEC_KEY_APOSTROPHE, SWFDEC_KEY_GRAVE,
+  /*  50 */ SWFDEC_KEY_SHIFT, SWFDEC_KEY_BACKSLASH, SWFDEC_KEY_Z, SWFDEC_KEY_X, SWFDEC_KEY_C, 
+  /*  55 */ SWFDEC_KEY_V, SWFDEC_KEY_B, SWFDEC_KEY_N, SWFDEC_KEY_M, 0, 
+  /*  60 */ 0, SWFDEC_KEY_SLASH, SWFDEC_KEY_SHIFT, SWFDEC_KEY_NUMPAD_MULTIPLY, SWFDEC_KEY_ALT,
+  /*  65 */ SWFDEC_KEY_SPACE, 0, SWFDEC_KEY_F1, SWFDEC_KEY_F2, SWFDEC_KEY_F3, 
+  /*  70 */ SWFDEC_KEY_F4, SWFDEC_KEY_F5, SWFDEC_KEY_F6, SWFDEC_KEY_F7, SWFDEC_KEY_F8,
+  /*  75 */ SWFDEC_KEY_F9, SWFDEC_KEY_F10, SWFDEC_KEY_NUM_LOCK, 0, SWFDEC_KEY_NUMPAD_7,
+  /*  80 */ SWFDEC_KEY_NUMPAD_8, SWFDEC_KEY_NUMPAD_9, SWFDEC_KEY_NUMPAD_SUBTRACT, SWFDEC_KEY_NUMPAD_4, SWFDEC_KEY_NUMPAD_5,
+  /*  85 */ SWFDEC_KEY_NUMPAD_6, SWFDEC_KEY_NUMPAD_ADD, SWFDEC_KEY_NUMPAD_1, SWFDEC_KEY_NUMPAD_2, SWFDEC_KEY_NUMPAD_3,
+  /*  90 */ SWFDEC_KEY_NUMPAD_0, SWFDEC_KEY_NUMPAD_DECIMAL, 0, 0, 0,
+  /*  95 */ SWFDEC_KEY_F11, SWFDEC_KEY_F12, SWFDEC_KEY_HOME, SWFDEC_KEY_UP, SWFDEC_KEY_PAGE_UP,
+  /* 100 */ SWFDEC_KEY_LEFT, 0, SWFDEC_KEY_RIGHT, SWFDEC_KEY_END, SWFDEC_KEY_DOWN,
+  /* 105 */ SWFDEC_KEY_PAGE_DOWN, SWFDEC_KEY_INSERT, SWFDEC_KEY_DELETE, SWFDEC_KEY_ENTER, SWFDEC_KEY_CONTROL,
+  /* 110 */ 0, 0, SWFDEC_KEY_NUMPAD_DIVIDE, SWFDEC_KEY_ALT, 0,
+  /* 115 */ 0, 0, 0, 0, 0
+};
+/*
+SWFDEC_KEY_COMMA 59
+SWFDEC_KEY_DOT 60
+SWFDEC_KEY_SCROLL_LOCK 78
+SWFDEC_KEY_BREAK 110
+SWFDEC_KEY_META 115
+SWFDEC_KEY_META_R 116
+SWFDEC_KEY_MENU 117
+*/
+
+guint
+swfdec_keycode_from_hardware_keycode (guint hardware_keycode)
+{
+  if (hardware_keycode >= G_N_ELEMENTS (flash_keycodes))
+    return 0;
+  return flash_keycodes[hardware_keycode];
+}
diff --git a/libswfdec-gtk/swfdec_gtk_keys.h b/libswfdec-gtk/swfdec_gtk_keys.h
new file mode 100644
index 0000000..bb3c80f
--- /dev/null
+++ b/libswfdec-gtk/swfdec_gtk_keys.h
@@ -0,0 +1,30 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef _SWFDEC_GTK_KEYS_H_
+#define _SWFDEC_GTK_KEYS_H_
+
+#include <libswfdec/swfdec.h>
+
+G_BEGIN_DECLS
+
+guint		swfdec_keycode_from_hardware_keycode	(guint	hardware_keycode);
+
+G_END_DECLS
+#endif
diff --git a/libswfdec-gtk/swfdec_gtk_widget.c b/libswfdec-gtk/swfdec_gtk_widget.c
index c126ff0..053308d 100644
--- a/libswfdec-gtk/swfdec_gtk_widget.c
+++ b/libswfdec-gtk/swfdec_gtk_widget.c
@@ -22,7 +22,9 @@
 #endif
 
 #include <math.h>
-#include <libswfdec-gtk/swfdec_gtk_widget.h>
+#include <gdk/gdkkeysyms.h>
+#include "swfdec_gtk_widget.h"
+#include "swfdec_gtk_keys.h"
 
 struct _SwfdecGtkWidgetPrivate
 {
@@ -125,6 +127,67 @@ swfdec_gtk_widget_button_release (GtkWid
   return FALSE;
 }
 
+static guint
+swfdec_gtk_event_to_keycode (GdkEventKey *event)
+{
+  guint ret;
+
+  /* we try to match as well as possible to Flash _Windows_ key codes.
+   * Since a lot of Flash files won't special case weird Linux key codes and we
+   * want the best compatibility possible, we have to do that.
+   */
+  /* FIXME: I have no clue about non-western keyboards, so if you happen to use
+   * such a keyboard, please help out here if it doesn't match.
+   */
+
+  /* try to match latin keys directly */
+  if (event->keyval >= GDK_A && event->keyval <= GDK_Z)
+    return event->keyval - GDK_A + SWFDEC_KEY_A;
+  if (event->keyval >= GDK_a && event->keyval <= GDK_z)
+    return event->keyval - GDK_a + SWFDEC_KEY_A;
+
+  /* last resort: try to translate the hardware keycode directly */
+  ret = swfdec_keycode_from_hardware_keycode (event->hardware_keycode);
+  if (ret == 0)
+    g_printerr ("could not translate key to Flash keycode. HW keycode %u, keyval %u\n",
+	event->hardware_keycode, event->keyval);
+  return ret;
+}
+
+static gboolean
+swfdec_gtk_widget_key_press (GtkWidget *gtkwidget, GdkEventKey *event)
+{
+  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
+  SwfdecGtkWidgetPrivate *priv = widget->priv;
+
+  if (priv->interactive) {
+    guint keycode = swfdec_gtk_event_to_keycode (event);
+    if (keycode != 0) {
+      swfdec_player_key_press (priv->player, keycode, 
+	  gdk_keyval_to_unicode (event->keyval));
+    }
+  }
+
+  return FALSE;
+}
+
+static gboolean
+swfdec_gtk_widget_key_release (GtkWidget *gtkwidget, GdkEventKey *event)
+{
+  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
+  SwfdecGtkWidgetPrivate *priv = widget->priv;
+
+  if (priv->interactive) {
+    guint keycode = swfdec_gtk_event_to_keycode (event);
+    if (keycode != 0) {
+      swfdec_player_key_release (priv->player, keycode, 
+	  gdk_keyval_to_unicode (event->keyval));
+    }
+  }
+
+  return FALSE;
+}
+
 static cairo_surface_t *
 swfdec_gtk_widget_create_renderer (cairo_surface_type_t type, int width, int height)
 {
@@ -341,7 +404,9 @@ swfdec_gtk_widget_realize (GtkWidget *wi
 			   GDK_BUTTON_RELEASE_MASK |
 			   GDK_LEAVE_NOTIFY_MASK | 
 			   GDK_POINTER_MOTION_MASK | 
-			   GDK_POINTER_MOTION_HINT_MASK;
+			   GDK_POINTER_MOTION_HINT_MASK |
+			   GDK_KEY_PRESS_MASK |
+			   GDK_KEY_RELEASE_MASK;
 
   attributes_mask = GDK_WA_X | GDK_WA_Y;
 
@@ -388,6 +453,8 @@ swfdec_gtk_widget_class_init (SwfdecGtkW
   widget_class->button_release_event = swfdec_gtk_widget_button_release;
   widget_class->motion_notify_event = swfdec_gtk_widget_motion_notify;
   widget_class->leave_notify_event = swfdec_gtk_widget_leave_notify;
+  widget_class->key_press_event = swfdec_gtk_widget_key_press;
+  widget_class->key_release_event = swfdec_gtk_widget_key_release;
 
   g_type_class_add_private (object_class, sizeof (SwfdecGtkWidgetPrivate));
 }
@@ -401,6 +468,8 @@ swfdec_gtk_widget_init (SwfdecGtkWidget 
 
   priv->interactive = TRUE;
   priv->renderer = CAIRO_SURFACE_TYPE_IMAGE;
+
+  GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
 }
 
 static void
diff-tree 26cb7fd5dbc038e9d6d96ddf04af705090100a05 (from 8c3d6bef1a6faae513b6d141bb3b61eadf9aea12)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Aug 7 12:00:13 2007 +0200

    compile before commit...

diff --git a/libswfdec/swfdec_keys.h b/libswfdec/swfdec_keys.h
index 8e48e24..2a8b3e4 100644
--- a/libswfdec/swfdec_keys.h
+++ b/libswfdec/swfdec_keys.h
@@ -27,16 +27,16 @@ enum {
   SWFDEC_KEY_ENTER = 13,
   SWFDEC_KEY_SHIFT = 16,
   SWFDEC_KEY_CONTROL = 17,
-  SWFDEC_KEY_ALT = 18
+  SWFDEC_KEY_ALT = 18,
   SWFDEC_KEY_CAPS_LOCK = 20,
-  SWFDEC_KEY_ESCAPE = 27
-  SWFDEC_KEY_SPACE = 32
+  SWFDEC_KEY_ESCAPE = 27,
+  SWFDEC_KEY_SPACE = 32,
   SWFDEC_KEY_PAGE_UP = 33,
   SWFDEC_KEY_PAGE_DOWN = 34,
   SWFDEC_KEY_END = 35,
   SWFDEC_KEY_HOME = 36,
   SWFDEC_KEY_LEFT = 37,
-  SWFDEC_KEY_UP = 38
+  SWFDEC_KEY_UP = 38,
   SWFDEC_KEY_RIGHT = 39,
   SWFDEC_KEY_DOWN = 40,
   SWFDEC_KEY_INSERT = 45,
@@ -117,7 +117,7 @@ enum {
   SWFDEC_KEY_LEFT_BRACKET = 219,
   SWFDEC_KEY_BACKSLASH = 220,
   SWFDEC_KEY_RIGHT_BRACKET = 221,
-  SWFDEC_KEY_APOSTROPHE = 222
+  SWFDEC_KEY_APOSTROPHE = 222,
   SWFDEC_KEY_MAX = 255
 } SwfdecKey;
 
diff-tree 8c3d6bef1a6faae513b6d141bb3b61eadf9aea12 (from 6a1425fdccdf89ca724b26586b2ee842027e9b19)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Aug 7 11:47:40 2007 +0200

    add an enum for all the keys

diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index 1d8bb94..c3ca179 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -131,6 +131,7 @@ public_headers = \
 	swfdec_audio.h \
 	swfdec_buffer.h \
 	swfdec_file_loader.h \
+	swfdec_keys.h \
 	swfdec_loader.h \
 	swfdec_player.h \
 	swfdec_url.h
diff --git a/libswfdec/swfdec.h b/libswfdec/swfdec.h
index d49dc69..b4b9ab8 100644
--- a/libswfdec/swfdec.h
+++ b/libswfdec/swfdec.h
@@ -31,6 +31,7 @@
 #include <libswfdec/swfdec_buffer.h>
 #include <libswfdec/swfdec_enums.h>
 #include <libswfdec/swfdec_file_loader.h>
+#include <libswfdec/swfdec_keys.h>
 #include <libswfdec/swfdec_loader.h>
 #include <libswfdec/swfdec_player.h>
 #include <libswfdec/swfdec_url.h>
diff --git a/libswfdec/swfdec_keys.h b/libswfdec/swfdec_keys.h
new file mode 100644
index 0000000..8e48e24
--- /dev/null
+++ b/libswfdec/swfdec_keys.h
@@ -0,0 +1,125 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef _SWFDEC_KEYS_H_
+#define _SWFDEC_KEYS_H_
+
+enum {
+  SWFDEC_KEY_BACKSPACE = 8,
+  SWFDEC_KEY_TAB = 9,
+  SWFDEC_KEY_CLEAR = 12,
+  SWFDEC_KEY_ENTER = 13,
+  SWFDEC_KEY_SHIFT = 16,
+  SWFDEC_KEY_CONTROL = 17,
+  SWFDEC_KEY_ALT = 18
+  SWFDEC_KEY_CAPS_LOCK = 20,
+  SWFDEC_KEY_ESCAPE = 27
+  SWFDEC_KEY_SPACE = 32
+  SWFDEC_KEY_PAGE_UP = 33,
+  SWFDEC_KEY_PAGE_DOWN = 34,
+  SWFDEC_KEY_END = 35,
+  SWFDEC_KEY_HOME = 36,
+  SWFDEC_KEY_LEFT = 37,
+  SWFDEC_KEY_UP = 38
+  SWFDEC_KEY_RIGHT = 39,
+  SWFDEC_KEY_DOWN = 40,
+  SWFDEC_KEY_INSERT = 45,
+  SWFDEC_KEY_DELETE = 46,
+  SWFDEC_KEY_HELP = 47,
+  SWFDEC_KEY_0 = 48,
+  SWFDEC_KEY_1 = 49,
+  SWFDEC_KEY_2 = 50,
+  SWFDEC_KEY_3 = 51,
+  SWFDEC_KEY_4 = 52,
+  SWFDEC_KEY_5 = 53,
+  SWFDEC_KEY_6 = 54,
+  SWFDEC_KEY_7 = 55,
+  SWFDEC_KEY_8 = 56,
+  SWFDEC_KEY_9 = 57,
+  SWFDEC_KEY_A = 65,
+  SWFDEC_KEY_B = 66,
+  SWFDEC_KEY_C = 67,
+  SWFDEC_KEY_D = 68,
+  SWFDEC_KEY_E = 69,
+  SWFDEC_KEY_F = 70,
+  SWFDEC_KEY_G = 71,
+  SWFDEC_KEY_H = 72,
+  SWFDEC_KEY_I = 73,
+  SWFDEC_KEY_J = 74,
+  SWFDEC_KEY_K = 75,
+  SWFDEC_KEY_L = 76,
+  SWFDEC_KEY_M = 77,
+  SWFDEC_KEY_N = 78,
+  SWFDEC_KEY_O = 79,
+  SWFDEC_KEY_P = 80,
+  SWFDEC_KEY_Q = 81,
+  SWFDEC_KEY_R = 82,
+  SWFDEC_KEY_S = 83,
+  SWFDEC_KEY_T = 84,
+  SWFDEC_KEY_U = 85,
+  SWFDEC_KEY_V = 86,
+  SWFDEC_KEY_W = 87,
+  SWFDEC_KEY_X = 88,
+  SWFDEC_KEY_Y = 89,
+  SWFDEC_KEY_Z = 90,
+  SWFDEC_KEY_NUMPAD_0 = 96,
+  SWFDEC_KEY_NUMPAD_1 = 97,
+  SWFDEC_KEY_NUMPAD_2 = 98,
+  SWFDEC_KEY_NUMPAD_3 = 99,
+  SWFDEC_KEY_NUMPAD_4 = 100,
+  SWFDEC_KEY_NUMPAD_5 = 101,
+  SWFDEC_KEY_NUMPAD_6 = 102,
+  SWFDEC_KEY_NUMPAD_7 = 103,
+  SWFDEC_KEY_NUMPAD_8 = 104,
+  SWFDEC_KEY_NUMPAD_9 = 105,
+  SWFDEC_KEY_NUMPAD_MULTIPLY = 106,
+  SWFDEC_KEY_NUMPAD_ADD = 107,
+  SWFDEC_KEY_NUMPAD_SUBTRACT = 109,
+  SWFDEC_KEY_NUMPAD_DECIMAL = 110,
+  SWFDEC_KEY_NUMPAD_DIVIDE = 111,
+  SWFDEC_KEY_F1 = 112,
+  SWFDEC_KEY_F2 = 113,
+  SWFDEC_KEY_F3 = 114,
+  SWFDEC_KEY_F4 = 115,
+  SWFDEC_KEY_F5 = 116,
+  SWFDEC_KEY_F6 = 117,
+  SWFDEC_KEY_F7 = 118,
+  SWFDEC_KEY_F8 = 119,
+  SWFDEC_KEY_F9 = 120,
+  SWFDEC_KEY_F10 = 121,
+  SWFDEC_KEY_F11 = 122,
+  SWFDEC_KEY_F12 = 123,
+  SWFDEC_KEY_F13 = 124,
+  SWFDEC_KEY_F14 = 125,
+  SWFDEC_KEY_F15 = 126,
+  SWFDEC_KEY_NUM_LOCK = 144,
+  SWFDEC_KEY_SEMICOLON = 186,
+  SWFDEC_KEY_EQUAL = 187,
+  SWFDEC_KEY_MINUS = 189,
+  SWFDEC_KEY_SLASH = 191,
+  SWFDEC_KEY_GRAVE = 192,
+  SWFDEC_KEY_LEFT_BRACKET = 219,
+  SWFDEC_KEY_BACKSLASH = 220,
+  SWFDEC_KEY_RIGHT_BRACKET = 221,
+  SWFDEC_KEY_APOSTROPHE = 222
+  SWFDEC_KEY_MAX = 255
+} SwfdecKey;
+
+G_END_DECLS
+#endif
diff-tree 6a1425fdccdf89ca724b26586b2ee842027e9b19 (from f3ae0f1008fe77005ecce39fc83a6ca9f56f2050)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 21:56:52 2007 +0200

    indent this correctly

diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
index 01c4463..8d69fbb 100644
--- a/libswfdec/swfdec_as_types.c
+++ b/libswfdec/swfdec_as_types.c
@@ -575,34 +575,34 @@ swfdec_as_value_to_object (SwfdecAsConte
 gboolean
 swfdec_as_value_to_boolean (SwfdecAsContext *context, const SwfdecAsValue *value)
 {
-g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), FALSE);
-g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), FALSE);
+  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), FALSE);
+  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), FALSE);
 
-/* FIXME: what do we do when called in flash 4? */
-switch (value->type) {
-case SWFDEC_AS_TYPE_UNDEFINED:
-case SWFDEC_AS_TYPE_NULL:
-return FALSE;
-case SWFDEC_AS_TYPE_BOOLEAN:
-return SWFDEC_AS_VALUE_GET_BOOLEAN (value);
-case SWFDEC_AS_TYPE_NUMBER:
-{
-  double d = SWFDEC_AS_VALUE_GET_NUMBER (value);
-  return d != 0.0 && !isnan (d);
-}
-case SWFDEC_AS_TYPE_STRING:
-if (context->version <= 6) {
-  double d = swfdec_as_value_to_number (context, value);
-  return d != 0.0 && !isnan (d);
-} else {
-  return SWFDEC_AS_VALUE_GET_STRING (value) != SWFDEC_AS_STR_EMPTY;
-}
-case SWFDEC_AS_TYPE_OBJECT:
-return TRUE;
-default:
-g_assert_not_reached ();
-return FALSE;
-}
+  /* FIXME: what do we do when called in flash 4? */
+  switch (value->type) {
+    case SWFDEC_AS_TYPE_UNDEFINED:
+    case SWFDEC_AS_TYPE_NULL:
+      return FALSE;
+    case SWFDEC_AS_TYPE_BOOLEAN:
+      return SWFDEC_AS_VALUE_GET_BOOLEAN (value);
+    case SWFDEC_AS_TYPE_NUMBER:
+      {
+	double d = SWFDEC_AS_VALUE_GET_NUMBER (value);
+	return d != 0.0 && !isnan (d);
+      }
+    case SWFDEC_AS_TYPE_STRING:
+      if (context->version <= 6) {
+	double d = swfdec_as_value_to_number (context, value);
+	return d != 0.0 && !isnan (d);
+      } else {
+	return SWFDEC_AS_VALUE_GET_STRING (value) != SWFDEC_AS_STR_EMPTY;
+      }
+    case SWFDEC_AS_TYPE_OBJECT:
+      return TRUE;
+    default:
+      g_assert_not_reached ();
+      return FALSE;
+  }
 }
 
 /**
@@ -617,11 +617,11 @@ return FALSE;
 void
 swfdec_as_value_to_primitive (SwfdecAsValue *value)
 {
-g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
+  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
 
-if (SWFDEC_AS_VALUE_IS_OBJECT (value) && !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (value))) {
-swfdec_as_object_call (SWFDEC_AS_VALUE_GET_OBJECT (value), SWFDEC_AS_STR_valueOf,
-  0, NULL, value);
-}
+  if (SWFDEC_AS_VALUE_IS_OBJECT (value) && !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (value))) {
+    swfdec_as_object_call (SWFDEC_AS_VALUE_GET_OBJECT (value), SWFDEC_AS_STR_valueOf,
+	0, NULL, value);
+  }
 }
 
diff-tree f3ae0f1008fe77005ecce39fc83a6ca9f56f2050 (from 798d42197cf26808a44e9e588ad62951d94ca4a6)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 21:54:27 2007 +0200

    here be doubles

diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
index e248805..01c4463 100644
--- a/libswfdec/swfdec_as_types.c
+++ b/libswfdec/swfdec_as_types.c
@@ -496,10 +496,10 @@ swfdec_as_value_to_integer (SwfdecAsCont
   if (!isfinite (d))
     return 0;
   if (d < 0) {
-    d = fmod (-d, 4294967296);
+    d = fmod (-d, 4294967296.0);
     return - (guint) d;
   } else {
-    d = fmod (d, 4294967296);
+    d = fmod (d, 4294967296.0);
     return (guint) d;
   }
 }
diff-tree 798d42197cf26808a44e9e588ad62951d94ca4a6 (from 76286beb6f0bed9dee24fb9517ea5be62bc48ba4)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 21:17:56 2007 +0200

    remove leftover comment

diff --git a/libswfdec/swfdec_key_as.c b/libswfdec/swfdec_key_as.c
index 36cddb5..a5523f7 100644
--- a/libswfdec/swfdec_key_as.c
+++ b/libswfdec/swfdec_key_as.c
@@ -26,7 +26,6 @@
 #include "swfdec_debug.h"
 #include "swfdec_player_internal.h"
 
-//getCode,isDown,isToggled
 SWFDEC_AS_NATIVE (800, 0, swfdec_key_getAscii)
 void
 swfdec_key_getAscii (SwfdecAsContext *cx, SwfdecAsObject *object,
diff-tree 76286beb6f0bed9dee24fb9517ea5be62bc48ba4 (from 035ecbe5dd6be8dbb7c47577e84de30fa11444a4)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 21:17:39 2007 +0200

    code style fix

diff --git a/player/swfdec_debug_widget.c b/player/swfdec_debug_widget.c
index 70ced76..65cfa4d 100644
--- a/player/swfdec_debug_widget.c
+++ b/player/swfdec_debug_widget.c
@@ -141,7 +141,7 @@ swfdec_debug_widget_class_init (SwfdecDe
 }
 
 static void
-swfdec_debug_widget_init (SwfdecDebugWidget * debug_widget)
+swfdec_debug_widget_init (SwfdecDebugWidget *widget)
 {
 }
 
diff-tree 035ecbe5dd6be8dbb7c47577e84de30fa11444a4 (from 2004efbfc32550a2e0c700e01f110332a41af683)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 19:42:15 2007 +0200

    guess if I always forget adding files...

diff --git a/libswfdec/swfdec_key_as.c b/libswfdec/swfdec_key_as.c
new file mode 100644
index 0000000..36cddb5
--- /dev/null
+++ b/libswfdec/swfdec_key_as.c
@@ -0,0 +1,68 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "swfdec_as_object.h"
+#include "swfdec_as_strings.h"
+#include "swfdec_debug.h"
+#include "swfdec_player_internal.h"
+
+//getCode,isDown,isToggled
+SWFDEC_AS_NATIVE (800, 0, swfdec_key_getAscii)
+void
+swfdec_key_getAscii (SwfdecAsContext *cx, SwfdecAsObject *object,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+  SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+
+  SWFDEC_AS_VALUE_SET_INT (retval, player->last_character);
+}
+
+SWFDEC_AS_NATIVE (800, 1, swfdec_key_getCode)
+void
+swfdec_key_getCode (SwfdecAsContext *cx, SwfdecAsObject *object,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+  SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+
+  SWFDEC_AS_VALUE_SET_INT (retval, player->last_keycode);
+}
+
+SWFDEC_AS_NATIVE (800, 2, swfdec_key_isDown)
+void
+swfdec_key_isDown (SwfdecAsContext *cx, SwfdecAsObject *object,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
+{
+  guint id;
+  SwfdecPlayer *player = SWFDEC_PLAYER (cx);
+
+  if (argc < 1)
+    return;
+
+  id = swfdec_as_value_to_integer (cx, &argv[0]);
+  if (id >= 256) {
+    SWFDEC_FIXME ("id %u too big for a keycode", id);
+    id %= 256;
+  }
+  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, (player->key_pressed[id / 8] & (1 << (id % 8))) ? TRUE : FALSE);
+}
+
diff-tree 2004efbfc32550a2e0c700e01f110332a41af683 (from 831b2ab362ac6822c0cf35ad2ff0228b4723eedd)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 19:41:35 2007 +0200

    surprise, ASSetNative wasn't implemented

diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index f83dce7..70f5d8d 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -19,6 +19,7 @@
 
 /*** GENERAL ***/
 
+ASSetNative = ASnative (4, 0);
 ASSetNativeAccessor = ASnative (4, 1);
 
 /*** ASBROADCASTER ***/
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 09d52a9..51794cb 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -3,86 +3,88 @@
 /* compiled from swfdec_initialize.as */
 const unsigned char swfdec_initialize[] = {
   0x88, 0xB0, 0x01, 0x2F,  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,
-  0x00, 0x61, 0x64, 0x64,  0x4C, 0x69, 0x73, 0x74,  0x65, 0x6E, 0x65, 0x72,  0x00, 0x74, 0x68, 0x69,
-  0x73, 0x00, 0x78, 0x00,  0x72, 0x65, 0x6D, 0x6F,  0x76, 0x65, 0x4C, 0x69,  0x73, 0x74, 0x65, 0x6E,
-  0x65, 0x72, 0x00, 0x5F,  0x6C, 0x69, 0x73, 0x74,  0x65, 0x6E, 0x65, 0x72,  0x73, 0x00, 0x70, 0x75,
-  0x73, 0x68, 0x00, 0x6C,  0x00, 0x69, 0x00, 0x6C,  0x65, 0x6E, 0x67, 0x74,  0x68, 0x00, 0x73, 0x70,
-  0x6C, 0x69, 0x63, 0x65,  0x00, 0x69, 0x6E, 0x69,  0x74, 0x69, 0x61, 0x6C,  0x69, 0x7A, 0x65, 0x00,
-  0x6F, 0x00, 0x41, 0x72,  0x72, 0x61, 0x79, 0x00,  0x62, 0x72, 0x6F, 0x61,  0x64, 0x63, 0x61, 0x73,
-  0x74, 0x4D, 0x65, 0x73,  0x73, 0x61, 0x67, 0x65,  0x2C, 0x61, 0x64, 0x64,  0x4C, 0x69, 0x73, 0x74,
-  0x65, 0x6E, 0x65, 0x72,  0x2C, 0x72, 0x65, 0x6D,  0x6F, 0x76, 0x65, 0x4C,  0x69, 0x73, 0x74, 0x65,
-  0x6E, 0x65, 0x72, 0x2C,  0x5F, 0x6C, 0x69, 0x73,  0x74, 0x65, 0x6E, 0x65,  0x72, 0x73, 0x00, 0x41,
-  0x53, 0x53, 0x65, 0x74,  0x50, 0x72, 0x6F, 0x70,  0x46, 0x6C, 0x61, 0x67,  0x73, 0x00, 0x4B, 0x65,
-  0x79, 0x00, 0x41, 0x4C,  0x54, 0x00, 0x42, 0x41,  0x43, 0x4B, 0x53, 0x50,  0x41, 0x43, 0x45, 0x00,
-  0x43, 0x41, 0x50, 0x53,  0x4C, 0x4F, 0x43, 0x4B,  0x00, 0x43, 0x4F, 0x4E,  0x54, 0x52, 0x4F, 0x4C,
-  0x00, 0x44, 0x45, 0x4C,  0x45, 0x54, 0x45, 0x4B,  0x45, 0x59, 0x00, 0x44,  0x4F, 0x57, 0x4E, 0x00,
-  0x45, 0x4E, 0x44, 0x00,  0x45, 0x4E, 0x54, 0x45,  0x52, 0x00, 0x45, 0x53,  0x43, 0x41, 0x50, 0x45,
-  0x00, 0x48, 0x4F, 0x4D,  0x45, 0x00, 0x49, 0x4E,  0x53, 0x45, 0x52, 0x54,  0x00, 0x4C, 0x45, 0x46,
-  0x54, 0x00, 0x50, 0x47,  0x44, 0x4E, 0x00, 0x50,  0x47, 0x55, 0x50, 0x00,  0x52, 0x49, 0x47, 0x48,
-  0x54, 0x00, 0x53, 0x48,  0x49, 0x46, 0x54, 0x00,  0x53, 0x50, 0x41, 0x43,  0x45, 0x00, 0x54, 0x41,
-  0x42, 0x00, 0x55, 0x50,  0x00, 0x67, 0x65, 0x74,  0x41, 0x73, 0x63, 0x69,  0x69, 0x2C, 0x67, 0x65,
-  0x74, 0x43, 0x6F, 0x64,  0x65, 0x2C, 0x69, 0x73,  0x44, 0x6F, 0x77, 0x6E,  0x00, 0x41, 0x53, 0x53,
-  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,  0x00, 0x4D, 0x6F, 0x75,  0x73, 0x65, 0x00, 0x4F,
+  0x00, 0x41, 0x53, 0x6E,  0x61, 0x74, 0x69, 0x76,  0x65, 0x00, 0x41, 0x53,  0x53, 0x65, 0x74, 0x4E,
+  0x61, 0x74, 0x69, 0x76,  0x65, 0x41, 0x63, 0x63,  0x65, 0x73, 0x73, 0x6F,  0x72, 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,  0x00, 0x61, 0x64, 0x64,
+  0x4C, 0x69, 0x73, 0x74,  0x65, 0x6E, 0x65, 0x72,  0x00, 0x74, 0x68, 0x69,  0x73, 0x00, 0x78, 0x00,
+  0x72, 0x65, 0x6D, 0x6F,  0x76, 0x65, 0x4C, 0x69,  0x73, 0x74, 0x65, 0x6E,  0x65, 0x72, 0x00, 0x5F,
+  0x6C, 0x69, 0x73, 0x74,  0x65, 0x6E, 0x65, 0x72,  0x73, 0x00, 0x70, 0x75,  0x73, 0x68, 0x00, 0x6C,
+  0x00, 0x69, 0x00, 0x6C,  0x65, 0x6E, 0x67, 0x74,  0x68, 0x00, 0x73, 0x70,  0x6C, 0x69, 0x63, 0x65,
+  0x00, 0x69, 0x6E, 0x69,  0x74, 0x69, 0x61, 0x6C,  0x69, 0x7A, 0x65, 0x00,  0x6F, 0x00, 0x41, 0x72,
+  0x72, 0x61, 0x79, 0x00,  0x62, 0x72, 0x6F, 0x61,  0x64, 0x63, 0x61, 0x73,  0x74, 0x4D, 0x65, 0x73,
+  0x73, 0x61, 0x67, 0x65,  0x2C, 0x61, 0x64, 0x64,  0x4C, 0x69, 0x73, 0x74,  0x65, 0x6E, 0x65, 0x72,
+  0x2C, 0x72, 0x65, 0x6D,  0x6F, 0x76, 0x65, 0x4C,  0x69, 0x73, 0x74, 0x65,  0x6E, 0x65, 0x72, 0x2C,
+  0x5F, 0x6C, 0x69, 0x73,  0x74, 0x65, 0x6E, 0x65,  0x72, 0x73, 0x00, 0x41,  0x53, 0x53, 0x65, 0x74,
+  0x50, 0x72, 0x6F, 0x70,  0x46, 0x6C, 0x61, 0x67,  0x73, 0x00, 0x4B, 0x65,  0x79, 0x00, 0x41, 0x4C,
+  0x54, 0x00, 0x42, 0x41,  0x43, 0x4B, 0x53, 0x50,  0x41, 0x43, 0x45, 0x00,  0x43, 0x41, 0x50, 0x53,
+  0x4C, 0x4F, 0x43, 0x4B,  0x00, 0x43, 0x4F, 0x4E,  0x54, 0x52, 0x4F, 0x4C,  0x00, 0x44, 0x45, 0x4C,
+  0x45, 0x54, 0x45, 0x4B,  0x45, 0x59, 0x00, 0x44,  0x4F, 0x57, 0x4E, 0x00,  0x45, 0x4E, 0x44, 0x00,
+  0x45, 0x4E, 0x54, 0x45,  0x52, 0x00, 0x45, 0x53,  0x43, 0x41, 0x50, 0x45,  0x00, 0x48, 0x4F, 0x4D,
+  0x45, 0x00, 0x49, 0x4E,  0x53, 0x45, 0x52, 0x54,  0x00, 0x4C, 0x45, 0x46,  0x54, 0x00, 0x50, 0x47,
+  0x44, 0x4E, 0x00, 0x50,  0x47, 0x55, 0x50, 0x00,  0x52, 0x49, 0x47, 0x48,  0x54, 0x00, 0x53, 0x48,
+  0x49, 0x46, 0x54, 0x00,  0x53, 0x50, 0x41, 0x43,  0x45, 0x00, 0x54, 0x41,  0x42, 0x00, 0x55, 0x50,
+  0x00, 0x67, 0x65, 0x74,  0x41, 0x73, 0x63, 0x69,  0x69, 0x2C, 0x67, 0x65,  0x74, 0x43, 0x6F, 0x64,
+  0x65, 0x2C, 0x69, 0x73,  0x44, 0x6F, 0x77, 0x6E,  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, 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,
+  0x74, 0x65, 0x72, 0x00,  0x00, 0x00, 0x00, 0x00,  0x96, 0x13, 0x00, 0x08,  0x00, 0x07, 0x00, 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, 0x8C, 0x00, 0x08,  0x13, 0x08, 0x14, 0x07,
-  0x12, 0x00, 0x00, 0x00,  0x08, 0x15, 0x07, 0x08,  0x00, 0x00, 0x00, 0x08,  0x16, 0x07, 0x14, 0x00,
-  0x00, 0x00, 0x08, 0x17,  0x07, 0x11, 0x00, 0x00,  0x00, 0x08, 0x18, 0x07,  0x2E, 0x00, 0x00, 0x00,
-  0x08, 0x19, 0x07, 0x28,  0x00, 0x00, 0x00, 0x08,  0x1A, 0x07, 0x23, 0x00,  0x00, 0x00, 0x08, 0x1B,
-  0x07, 0x0D, 0x00, 0x00,  0x00, 0x08, 0x1C, 0x07,  0x1B, 0x00, 0x00, 0x00,  0x08, 0x1D, 0x07, 0x24,
-  0x00, 0x00, 0x00, 0x08,  0x1E, 0x07, 0x2D, 0x00,  0x00, 0x00, 0x08, 0x1F,  0x07, 0x25, 0x00, 0x00,
-  0x00, 0x08, 0x20, 0x07,  0x22, 0x00, 0x00, 0x00,  0x08, 0x21, 0x07, 0x21,  0x00, 0x00, 0x00, 0x08,
-  0x22, 0x07, 0x27, 0x00,  0x00, 0x00, 0x08, 0x23,  0x07, 0x10, 0x00, 0x00,  0x00, 0x08, 0x24, 0x07,
-  0x20, 0x00, 0x00, 0x00,  0x08, 0x25, 0x07, 0x09,  0x00, 0x00, 0x00, 0x08,  0x26, 0x07, 0x26, 0x00,
-  0x00, 0x00, 0x07, 0x13,  0x00, 0x00, 0x00, 0x43,  0x1D, 0x96, 0x09, 0x00,  0x08, 0x27, 0x07, 0x20,
-  0x03, 0x00, 0x00, 0x08,  0x13, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x28,
-  0x3D, 0x17, 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, 0x08,  0x00, 0x07, 0x07, 0x00,
-  0x00, 0x00, 0x02, 0x08,  0x13, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x12,
-  0x3D, 0x17, 0x96, 0x09,  0x00, 0x08, 0x29, 0x07,  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,
-  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,  0x00, 0x08, 0x2B, 0x07,  0x00, 0x00, 0x00, 0x00,
-  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,
-  0x00, 0x08, 0x29, 0x1C,  0x96, 0x13, 0x00, 0x08,  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,
-  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,
-  0x29, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x02,  0x1C, 0x96, 0x02, 0x00,
-  0x08, 0x0E, 0x52, 0x17,  0x96, 0x09, 0x00, 0x08,  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,
-  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
-  0x08, 0x02, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0E,  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,
-  0x00, 0x00, 0x08, 0x2E,  0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,
-  0x04, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,  0x00
+  0x96, 0x13, 0x00, 0x08,  0x02, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x07,
+  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x1D,  0x96, 0x02, 0x00, 0x08,  0x03, 0x1C, 0x96, 0x13,
+  0x00, 0x08, 0x04, 0x07,  0x0C, 0x00, 0x00, 0x00,  0x07, 0x65, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
+  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x03, 0x1C,  0x96, 0x02, 0x00, 0x08,
+  0x05, 0x9B, 0x07, 0x00,  0x00, 0x01, 0x00, 0x78,  0x00, 0x3C, 0x00, 0x96,  0x02, 0x00, 0x08, 0x07,
+  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,
+  0x08, 0x52, 0x17, 0x96,  0x02, 0x00, 0x08, 0x07,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,
+  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x09, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x0A, 0x52,
+  0x17, 0x96, 0x02, 0x00,  0x05, 0x01, 0x3E, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x03, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x08, 0x9B,  0x07, 0x00, 0x00, 0x01,  0x00, 0x78, 0x00, 0x8F,  0x00, 0x96, 0x04, 0x00,
+  0x08, 0x0B, 0x08, 0x06,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x09, 0x4E, 0x3C,  0x96, 0x02, 0x00, 0x08,
+  0x0C, 0x41, 0x96, 0x07,  0x00, 0x08, 0x0C, 0x07,  0x00, 0x00, 0x00, 0x00,  0x3C, 0x99, 0x02, 0x00,
+  0x09, 0x00, 0x96, 0x02,  0x00, 0x08, 0x0C, 0x4C,  0x1C, 0x50, 0x1D, 0x96,  0x02, 0x00, 0x08, 0x0C,
+  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0B, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0D,  0x4E, 0x48, 0x12, 0x9D,
+  0x02, 0x00, 0x42, 0x00,  0x96, 0x02, 0x00, 0x08,  0x0B, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x0C, 0x1C,
+  0x4E, 0x96, 0x02, 0x00,  0x08, 0x07, 0x1C, 0x49,  0x12, 0x9D, 0x02, 0x00,  0x23, 0x00, 0x96, 0x07,
+  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x0C,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x02, 0x00, 0x00,
+  0x00, 0x08, 0x0B, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x0E, 0x52, 0x17, 0x96,  0x02, 0x00, 0x05, 0x01,
+  0x3E, 0x99, 0x02, 0x00,  0x9C, 0xFF, 0x96, 0x02,  0x00, 0x05, 0x00, 0x3E,  0x4F, 0x96, 0x02, 0x00,
+  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,  0x9B, 0x07, 0x00, 0x00,  0x01, 0x00, 0x6F, 0x00,
+  0x75, 0x00, 0x96, 0x02,  0x00, 0x08, 0x10, 0x1C,  0x96, 0x13, 0x00, 0x08,  0x04, 0x07, 0x0C, 0x00,
+  0x00, 0x00, 0x07, 0x65,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,
+  0x96, 0x02, 0x00, 0x08,  0x10, 0x1C, 0x96, 0x04,  0x00, 0x08, 0x05, 0x08,  0x03, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x05, 0x4E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x10, 0x1C, 0x96,  0x04, 0x00, 0x08, 0x08,
+  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x08,  0x4E, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x10, 0x1C,
+  0x96, 0x09, 0x00, 0x08,  0x09, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x11,  0x40, 0x4F, 0x96, 0x09,
+  0x00, 0x07, 0x83, 0x00,  0x00, 0x00, 0x08, 0x12,  0x08, 0x10, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x03,
+  0x00, 0x00, 0x00, 0x08,  0x13, 0x3D, 0x17, 0x4F,  0x96, 0x08, 0x00, 0x07,  0x83, 0x00, 0x00, 0x00,
+  0x02, 0x08, 0x03, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x13, 0x3D, 0x17,
+  0x96, 0x8C, 0x00, 0x08,  0x14, 0x08, 0x15, 0x07,  0x12, 0x00, 0x00, 0x00,  0x08, 0x16, 0x07, 0x08,
+  0x00, 0x00, 0x00, 0x08,  0x17, 0x07, 0x14, 0x00,  0x00, 0x00, 0x08, 0x18,  0x07, 0x11, 0x00, 0x00,
+  0x00, 0x08, 0x19, 0x07,  0x2E, 0x00, 0x00, 0x00,  0x08, 0x1A, 0x07, 0x28,  0x00, 0x00, 0x00, 0x08,
+  0x1B, 0x07, 0x23, 0x00,  0x00, 0x00, 0x08, 0x1C,  0x07, 0x0D, 0x00, 0x00,  0x00, 0x08, 0x1D, 0x07,
+  0x1B, 0x00, 0x00, 0x00,  0x08, 0x1E, 0x07, 0x24,  0x00, 0x00, 0x00, 0x08,  0x1F, 0x07, 0x2D, 0x00,
+  0x00, 0x00, 0x08, 0x20,  0x07, 0x25, 0x00, 0x00,  0x00, 0x08, 0x21, 0x07,  0x22, 0x00, 0x00, 0x00,
+  0x08, 0x22, 0x07, 0x21,  0x00, 0x00, 0x00, 0x08,  0x23, 0x07, 0x27, 0x00,  0x00, 0x00, 0x08, 0x24,
+  0x07, 0x10, 0x00, 0x00,  0x00, 0x08, 0x25, 0x07,  0x20, 0x00, 0x00, 0x00,  0x08, 0x26, 0x07, 0x09,
+  0x00, 0x00, 0x00, 0x08,  0x27, 0x07, 0x26, 0x00,  0x00, 0x00, 0x07, 0x13,  0x00, 0x00, 0x00, 0x43,
+  0x1D, 0x96, 0x09, 0x00,  0x08, 0x28, 0x07, 0x20,  0x03, 0x00, 0x00, 0x08,  0x14, 0x1C, 0x96, 0x07,
+  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,  0x3D, 0x17, 0x96, 0x02,  0x00, 0x08, 0x14, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,
+  0x52, 0x17, 0x96, 0x08,  0x00, 0x07, 0x07, 0x00,  0x00, 0x00, 0x02, 0x08,  0x14, 0x1C, 0x96, 0x07,
+  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x13,  0x3D, 0x17, 0x96, 0x09,  0x00, 0x08, 0x29, 0x07,
+  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,
+  0x00, 0x08, 0x2B, 0x07,  0x00, 0x00, 0x00, 0x00,  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
+  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,  0x96, 0x13, 0x00, 0x08,
+  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,
+  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,
+  0x00, 0x00, 0x08, 0x03,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x52, 0x17,  0x96, 0x09, 0x00, 0x08,
+  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x2D, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,
+  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,  0x07, 0x9A, 0x02, 0x00,
+  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,  0x08, 0x02, 0x3D, 0x17,
+  0x00
 };
 
diff --git a/libswfdec/swfdec_player_as.c b/libswfdec/swfdec_player_as.c
index f480226..125b9e8 100644
--- a/libswfdec/swfdec_player_as.c
+++ b/libswfdec/swfdec_player_as.c
@@ -129,6 +129,47 @@ swfdec_player_ASnative (SwfdecAsContext 
   }
 }
 
+SWFDEC_AS_NATIVE (4, 0, ASSetNative)
+void
+ASSetNative (SwfdecAsContext *cx, SwfdecAsObject *object,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
+{
+  SwfdecAsFunction *function;
+  SwfdecAsObject *target;
+  SwfdecAsValue val;
+  const char *s;
+  char **names;
+  guint i, x, y;
+
+  if (argc < 3)
+    return;
+
+  target = swfdec_as_value_to_object (cx, &argv[0]);
+  x = swfdec_as_value_to_integer (cx, &argv[1]);
+  s = swfdec_as_value_to_string (cx, &argv[2]);
+  if (argc > 3)
+    y = swfdec_as_value_to_integer (cx, &argv[3]);
+  else
+    y = 0;
+  names = g_strsplit (s, ",", -1);
+  for (i = 0; names[i]; i++) {
+    s = names[i];
+    if (s[0] >= '0' && s[0] <= '9') {
+      SWFDEC_FIXME ("implement the weird numbers");
+      s++;
+    }
+    function = swfdec_get_asnative (cx, x, y);
+    if (function == NULL) {
+      SWFDEC_FIXME ("no ASnative function for %u, %u, what now?", x, y);
+      return;
+    }
+    SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (function));
+    swfdec_as_object_set_variable (target, swfdec_as_context_get_string (cx, s), &val);
+    y++;
+  }
+  g_free (names);
+}
+
 SWFDEC_AS_NATIVE (4, 1, ASSetNativeAccessor)
 void
 ASSetNativeAccessor (SwfdecAsContext *cx, SwfdecAsObject *object,
diff-tree 831b2ab362ac6822c0cf35ad2ff0228b4723eedd (from 9e1a3e76ca70561dfb77aa1329b12c0b16c1da1c)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 18:01:37 2007 +0200

    compile the init code after changing it
    
    d'oh

diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 2697a27..09d52a9 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, 0xBA, 0x01, 0x2F,  0x00, 0x41, 0x53, 0x53,  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,
+  0x88, 0xB0, 0x01, 0x2F,  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,
@@ -24,66 +24,65 @@ const unsigned char swfdec_initialize[] 
   0x54, 0x00, 0x50, 0x47,  0x44, 0x4E, 0x00, 0x50,  0x47, 0x55, 0x50, 0x00,  0x52, 0x49, 0x47, 0x48,
   0x54, 0x00, 0x53, 0x48,  0x49, 0x46, 0x54, 0x00,  0x53, 0x50, 0x41, 0x43,  0x45, 0x00, 0x54, 0x41,
   0x42, 0x00, 0x55, 0x50,  0x00, 0x67, 0x65, 0x74,  0x41, 0x73, 0x63, 0x69,  0x69, 0x2C, 0x67, 0x65,
-  0x74, 0x43, 0x6F, 0x64,  0x65, 0x2C, 0x69, 0x73,  0x44, 0x6F, 0x77, 0x6E,  0x2C, 0x69, 0x73, 0x54,
-  0x6F, 0x67, 0x67, 0x6C,  0x65, 0x64, 0x00, 0x41,  0x53, 0x53, 0x65, 0x74,  0x4E, 0x61, 0x74, 0x69,
-  0x76, 0x65, 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, 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,
+  0x74, 0x43, 0x6F, 0x64,  0x65, 0x2C, 0x69, 0x73,  0x44, 0x6F, 0x77, 0x6E,  0x00, 0x41, 0x53, 0x53,
+  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,  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, 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,  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, 0x8C,  0x00, 0x08, 0x13, 0x08,  0x14, 0x07, 0x12, 0x00,  0x00, 0x00, 0x08, 0x15,
-  0x07, 0x08, 0x00, 0x00,  0x00, 0x08, 0x16, 0x07,  0x14, 0x00, 0x00, 0x00,  0x08, 0x17, 0x07, 0x11,
-  0x00, 0x00, 0x00, 0x08,  0x18, 0x07, 0x2E, 0x00,  0x00, 0x00, 0x08, 0x19,  0x07, 0x28, 0x00, 0x00,
-  0x00, 0x08, 0x1A, 0x07,  0x23, 0x00, 0x00, 0x00,  0x08, 0x1B, 0x07, 0x0D,  0x00, 0x00, 0x00, 0x08,
-  0x1C, 0x07, 0x1B, 0x00,  0x00, 0x00, 0x08, 0x1D,  0x07, 0x24, 0x00, 0x00,  0x00, 0x08, 0x1E, 0x07,
-  0x2D, 0x00, 0x00, 0x00,  0x08, 0x1F, 0x07, 0x25,  0x00, 0x00, 0x00, 0x08,  0x20, 0x07, 0x22, 0x00,
-  0x00, 0x00, 0x08, 0x21,  0x07, 0x21, 0x00, 0x00,  0x00, 0x08, 0x22, 0x07,  0x27, 0x00, 0x00, 0x00,
-  0x08, 0x23, 0x07, 0x10,  0x00, 0x00, 0x00, 0x08,  0x24, 0x07, 0x20, 0x00,  0x00, 0x00, 0x08, 0x25,
-  0x07, 0x09, 0x00, 0x00,  0x00, 0x08, 0x26, 0x07,  0x26, 0x00, 0x00, 0x00,  0x07, 0x13, 0x00, 0x00,
-  0x00, 0x43, 0x1D, 0x96,  0x09, 0x00, 0x08, 0x27,  0x07, 0x20, 0x03, 0x00,  0x00, 0x08, 0x13, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x28, 0x3D, 0x17,  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, 0x08, 0x00, 0x07,  0x07, 0x00, 0x00, 0x00,  0x02, 0x08, 0x13, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x12, 0x3D, 0x17,  0x96, 0x09, 0x00, 0x08,
-  0x29, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,
-  0x96, 0x13, 0x00, 0x08,  0x2B, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,
-  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,
-  0x00, 0x08, 0x2C, 0x07,  0x01, 0x00, 0x00, 0x00,  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,  0x96, 0x07, 0x00, 0x07,
-  0x01, 0x00, 0x00, 0x00,  0x08, 0x02, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0E,  0x52, 0x17, 0x96, 0x09,
-  0x00, 0x08, 0x2D, 0x07,  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,  0x96, 0x02, 0x00, 0x08,
-  0x2D, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x02,  0x1C, 0x96, 0x02, 0x00,
-  0x08, 0x0E, 0x52, 0x17,  0x96, 0x0E, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x2E, 0x07, 0x9A,
-  0x02, 0x00, 0x00, 0x08,  0x2D, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x04, 0x00,  0x00, 0x00, 0x08, 0x00,
-  0x3D, 0x17, 0x00
+  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, 0x8C, 0x00, 0x08,  0x13, 0x08, 0x14, 0x07,
+  0x12, 0x00, 0x00, 0x00,  0x08, 0x15, 0x07, 0x08,  0x00, 0x00, 0x00, 0x08,  0x16, 0x07, 0x14, 0x00,
+  0x00, 0x00, 0x08, 0x17,  0x07, 0x11, 0x00, 0x00,  0x00, 0x08, 0x18, 0x07,  0x2E, 0x00, 0x00, 0x00,
+  0x08, 0x19, 0x07, 0x28,  0x00, 0x00, 0x00, 0x08,  0x1A, 0x07, 0x23, 0x00,  0x00, 0x00, 0x08, 0x1B,
+  0x07, 0x0D, 0x00, 0x00,  0x00, 0x08, 0x1C, 0x07,  0x1B, 0x00, 0x00, 0x00,  0x08, 0x1D, 0x07, 0x24,
+  0x00, 0x00, 0x00, 0x08,  0x1E, 0x07, 0x2D, 0x00,  0x00, 0x00, 0x08, 0x1F,  0x07, 0x25, 0x00, 0x00,
+  0x00, 0x08, 0x20, 0x07,  0x22, 0x00, 0x00, 0x00,  0x08, 0x21, 0x07, 0x21,  0x00, 0x00, 0x00, 0x08,
+  0x22, 0x07, 0x27, 0x00,  0x00, 0x00, 0x08, 0x23,  0x07, 0x10, 0x00, 0x00,  0x00, 0x08, 0x24, 0x07,
+  0x20, 0x00, 0x00, 0x00,  0x08, 0x25, 0x07, 0x09,  0x00, 0x00, 0x00, 0x08,  0x26, 0x07, 0x26, 0x00,
+  0x00, 0x00, 0x07, 0x13,  0x00, 0x00, 0x00, 0x43,  0x1D, 0x96, 0x09, 0x00,  0x08, 0x27, 0x07, 0x20,
+  0x03, 0x00, 0x00, 0x08,  0x13, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x28,
+  0x3D, 0x17, 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, 0x08,  0x00, 0x07, 0x07, 0x00,
+  0x00, 0x00, 0x02, 0x08,  0x13, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x12,
+  0x3D, 0x17, 0x96, 0x09,  0x00, 0x08, 0x29, 0x07,  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,
+  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,  0x00, 0x08, 0x2B, 0x07,  0x00, 0x00, 0x00, 0x00,
+  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,
+  0x00, 0x08, 0x29, 0x1C,  0x96, 0x13, 0x00, 0x08,  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,
+  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,
+  0x29, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x02,  0x1C, 0x96, 0x02, 0x00,
+  0x08, 0x0E, 0x52, 0x17,  0x96, 0x09, 0x00, 0x08,  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,
+  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
+  0x08, 0x02, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0E,  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,
+  0x00, 0x00, 0x08, 0x2E,  0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,
+  0x04, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,  0x00
 };
 
diff-tree 9e1a3e76ca70561dfb77aa1329b12c0b16c1da1c (from 7eb1784afeed610b0e88c544403de129a7d21fb9)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 17:48:28 2007 +0200

    implement Key.getAscii(), Key.getCode() and Key.isDown()
    
    untested, bla bla bla
    I need to figure out how to do tests

diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index b8d2e07..1d8bb94 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -73,6 +73,7 @@ libswfdec_ at SWFDEC_MAJORMINOR@_la_SOURCES
 	swfdec_html_parser.c \
 	swfdec_image.c \
 	swfdec_interval.c \
+	swfdec_key_as.c \
 	swfdec_loader.c \
 	swfdec_loadertarget.c \
 	swfdec_marshal.c \
diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index 624cfdc..f83dce7 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -55,6 +55,13 @@ AsBroadcaster.initialize = function (o) 
 };
 ASSetPropFlags(AsBroadcaster, null, 131);
 
+Key = { ALT: 18, BACKSPACE: 8, CAPSLOCK: 20, CONTROL: 17, DELETEKEY: 46, 
+    DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, 
+    PGDN: 34, PGUP: 33, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 };
+ASSetNative(Key, 800, "getAscii,getCode,isDown");
+AsBroadcaster.initialize(Key);
+ASSetPropFlags(Key, null, 7);
+
 /*** MOUSE ***/
 
 Mouse = new Object ();
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 993de28..2697a27 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, 0x15, 0x01, 0x19,  0x00, 0x41, 0x53, 0x53,  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,
+  0x88, 0xBA, 0x01, 0x2F,  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,
@@ -15,51 +15,75 @@ const unsigned char swfdec_initialize[] 
   0x74, 0x4D, 0x65, 0x73,  0x73, 0x61, 0x67, 0x65,  0x2C, 0x61, 0x64, 0x64,  0x4C, 0x69, 0x73, 0x74,
   0x65, 0x6E, 0x65, 0x72,  0x2C, 0x72, 0x65, 0x6D,  0x6F, 0x76, 0x65, 0x4C,  0x69, 0x73, 0x74, 0x65,
   0x6E, 0x65, 0x72, 0x2C,  0x5F, 0x6C, 0x69, 0x73,  0x74, 0x65, 0x6E, 0x65,  0x72, 0x73, 0x00, 0x41,
-  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, 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, 0x02, 0x00,
-  0x08, 0x17, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x02, 0x1C, 0x96, 0x02,
-  0x00, 0x08, 0x0E, 0x52,  0x17, 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
+  0x53, 0x53, 0x65, 0x74,  0x50, 0x72, 0x6F, 0x70,  0x46, 0x6C, 0x61, 0x67,  0x73, 0x00, 0x4B, 0x65,
+  0x79, 0x00, 0x41, 0x4C,  0x54, 0x00, 0x42, 0x41,  0x43, 0x4B, 0x53, 0x50,  0x41, 0x43, 0x45, 0x00,
+  0x43, 0x41, 0x50, 0x53,  0x4C, 0x4F, 0x43, 0x4B,  0x00, 0x43, 0x4F, 0x4E,  0x54, 0x52, 0x4F, 0x4C,
+  0x00, 0x44, 0x45, 0x4C,  0x45, 0x54, 0x45, 0x4B,  0x45, 0x59, 0x00, 0x44,  0x4F, 0x57, 0x4E, 0x00,
+  0x45, 0x4E, 0x44, 0x00,  0x45, 0x4E, 0x54, 0x45,  0x52, 0x00, 0x45, 0x53,  0x43, 0x41, 0x50, 0x45,
+  0x00, 0x48, 0x4F, 0x4D,  0x45, 0x00, 0x49, 0x4E,  0x53, 0x45, 0x52, 0x54,  0x00, 0x4C, 0x45, 0x46,
+  0x54, 0x00, 0x50, 0x47,  0x44, 0x4E, 0x00, 0x50,  0x47, 0x55, 0x50, 0x00,  0x52, 0x49, 0x47, 0x48,
+  0x54, 0x00, 0x53, 0x48,  0x49, 0x46, 0x54, 0x00,  0x53, 0x50, 0x41, 0x43,  0x45, 0x00, 0x54, 0x41,
+  0x42, 0x00, 0x55, 0x50,  0x00, 0x67, 0x65, 0x74,  0x41, 0x73, 0x63, 0x69,  0x69, 0x2C, 0x67, 0x65,
+  0x74, 0x43, 0x6F, 0x64,  0x65, 0x2C, 0x69, 0x73,  0x44, 0x6F, 0x77, 0x6E,  0x2C, 0x69, 0x73, 0x54,
+  0x6F, 0x67, 0x67, 0x6C,  0x65, 0x64, 0x00, 0x41,  0x53, 0x53, 0x65, 0x74,  0x4E, 0x61, 0x74, 0x69,
+  0x76, 0x65, 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, 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, 0x8C,  0x00, 0x08, 0x13, 0x08,  0x14, 0x07, 0x12, 0x00,  0x00, 0x00, 0x08, 0x15,
+  0x07, 0x08, 0x00, 0x00,  0x00, 0x08, 0x16, 0x07,  0x14, 0x00, 0x00, 0x00,  0x08, 0x17, 0x07, 0x11,
+  0x00, 0x00, 0x00, 0x08,  0x18, 0x07, 0x2E, 0x00,  0x00, 0x00, 0x08, 0x19,  0x07, 0x28, 0x00, 0x00,
+  0x00, 0x08, 0x1A, 0x07,  0x23, 0x00, 0x00, 0x00,  0x08, 0x1B, 0x07, 0x0D,  0x00, 0x00, 0x00, 0x08,
+  0x1C, 0x07, 0x1B, 0x00,  0x00, 0x00, 0x08, 0x1D,  0x07, 0x24, 0x00, 0x00,  0x00, 0x08, 0x1E, 0x07,
+  0x2D, 0x00, 0x00, 0x00,  0x08, 0x1F, 0x07, 0x25,  0x00, 0x00, 0x00, 0x08,  0x20, 0x07, 0x22, 0x00,
+  0x00, 0x00, 0x08, 0x21,  0x07, 0x21, 0x00, 0x00,  0x00, 0x08, 0x22, 0x07,  0x27, 0x00, 0x00, 0x00,
+  0x08, 0x23, 0x07, 0x10,  0x00, 0x00, 0x00, 0x08,  0x24, 0x07, 0x20, 0x00,  0x00, 0x00, 0x08, 0x25,
+  0x07, 0x09, 0x00, 0x00,  0x00, 0x08, 0x26, 0x07,  0x26, 0x00, 0x00, 0x00,  0x07, 0x13, 0x00, 0x00,
+  0x00, 0x43, 0x1D, 0x96,  0x09, 0x00, 0x08, 0x27,  0x07, 0x20, 0x03, 0x00,  0x00, 0x08, 0x13, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x28, 0x3D, 0x17,  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, 0x08, 0x00, 0x07,  0x07, 0x00, 0x00, 0x00,  0x02, 0x08, 0x13, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x12, 0x3D, 0x17,  0x96, 0x09, 0x00, 0x08,
+  0x29, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,
+  0x96, 0x13, 0x00, 0x08,  0x2B, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,
+  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,
+  0x00, 0x08, 0x2C, 0x07,  0x01, 0x00, 0x00, 0x00,  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
+  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,  0x96, 0x07, 0x00, 0x07,
+  0x01, 0x00, 0x00, 0x00,  0x08, 0x02, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0E,  0x52, 0x17, 0x96, 0x09,
+  0x00, 0x08, 0x2D, 0x07,  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,  0x96, 0x02, 0x00, 0x08,
+  0x2D, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x02,  0x1C, 0x96, 0x02, 0x00,
+  0x08, 0x0E, 0x52, 0x17,  0x96, 0x0E, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x2E, 0x07, 0x9A,
+  0x02, 0x00, 0x00, 0x08,  0x2D, 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 bdcc495..98ded92 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -895,6 +895,16 @@ swfdec_player_do_handle_key (SwfdecPlaye
 {
   g_assert (keycode < 256);
 
+  /* set the correct variables */
+  player->last_keycode = keycode;
+  player->last_character = character;
+  if (down) {
+    player->key_pressed[keycode / 8] |= 1 << keycode % 8;
+  } else {
+    player->key_pressed[keycode / 8] &= ~(1 << keycode % 8);
+  }
+  swfdec_player_broadcast (player, SWFDEC_AS_STR_Stage, down ? SWFDEC_AS_STR_onKeyDown : SWFDEC_AS_STR_onKeyUp);
+
   return TRUE;
 }
 
diff --git a/libswfdec/swfdec_player_internal.h b/libswfdec/swfdec_player_internal.h
index 665a5db..0d27ec8 100644
--- a/libswfdec/swfdec_player_internal.h
+++ b/libswfdec/swfdec_player_internal.h
@@ -96,6 +96,11 @@ struct _SwfdecPlayer
   double		mouse_drag_x;		/* offset of mouse in x direction */
   double		mouse_drag_y;		/* offset of mouse in y direction */
 
+  /* key */
+  guint			last_keycode;		/* last keycode that was pressed/released */
+  guint			last_character;		/* UCS4 of last character pressed/released */
+  guint8		key_pressed[256/8];   	/* boolean array for isDown */
+
   /* audio */
   GList *		audio;		 	/* list of playing SwfdecAudio */
   guint			audio_skip;		/* number of frames to auto-skip when adding new audio */
diff-tree 7eb1784afeed610b0e88c544403de129a7d21fb9 (from 1ae84b8de6ca7287b174a22b71835aaf2add8062)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 13:56:49 2007 +0200

    remove swfdec_key.h again

diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index 1c25bee..b8d2e07 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -130,7 +130,6 @@ public_headers = \
 	swfdec_audio.h \
 	swfdec_buffer.h \
 	swfdec_file_loader.h \
-	swfdec_key.h \
 	swfdec_loader.h \
 	swfdec_player.h \
 	swfdec_url.h
diff --git a/libswfdec/swfdec.h b/libswfdec/swfdec.h
index 9a82dd1..d49dc69 100644
--- a/libswfdec/swfdec.h
+++ b/libswfdec/swfdec.h
@@ -31,7 +31,6 @@
 #include <libswfdec/swfdec_buffer.h>
 #include <libswfdec/swfdec_enums.h>
 #include <libswfdec/swfdec_file_loader.h>
-#include <libswfdec/swfdec_key.h>
 #include <libswfdec/swfdec_loader.h>
 #include <libswfdec/swfdec_player.h>
 #include <libswfdec/swfdec_url.h>
diff --git a/libswfdec/swfdec_key.h b/libswfdec/swfdec_key.h
deleted file mode 100644
index f87c9ab..0000000
--- a/libswfdec/swfdec_key.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
- * Boston, MA  02110-1301  USA
- */
-
-#ifndef _SWFDEC_KEY_H_
-#define _SWFDEC_KEY_H_
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-/* can't make this a guint8 because of signal handlers, but it should be a guint8 */
-typedef guint SwfdecKey;
-					 
-
-G_END_DECLS
-#endif
diff-tree 1ae84b8de6ca7287b174a22b71835aaf2add8062 (from ee784e2bc20dc17a4e842d70d661f228903d32ae)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Aug 6 13:07:35 2007 +0200

    update the API for keys once again

diff --git a/libswfdec/swfdec_marshal.list b/libswfdec/swfdec_marshal.list
index e04f7f5..ce6782c 100644
--- a/libswfdec/swfdec_marshal.list
+++ b/libswfdec/swfdec_marshal.list
@@ -1,5 +1,5 @@
 BOOLEAN:DOUBLE,DOUBLE,INT
-BOOLEAN:UINT,BOOLEAN
+BOOLEAN:UINT,UINT,BOOLEAN
 VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE
 VOID:STRING,STRING
 VOID:UINT,UINT
diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 4ea85e6..bdcc495 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -891,9 +891,9 @@ swfdec_player_emit_signals (SwfdecPlayer
 }
 
 static gboolean
-swfdec_player_do_handle_key (SwfdecPlayer *player, SwfdecKey key, gboolean down)
+swfdec_player_do_handle_key (SwfdecPlayer *player, guint keycode, guint character, gboolean down)
 {
-  g_assert (key < 256);
+  g_assert (keycode < 256);
 
   return TRUE;
 }
@@ -1179,8 +1179,8 @@ swfdec_player_class_init (SwfdecPlayerCl
    **/
   signals[HANDLE_KEY] = g_signal_new ("handle-key", G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (SwfdecPlayerClass, handle_key), 
-      swfdec_accumulate_or, NULL, swfdec_marshal_BOOLEAN__UINT_BOOLEAN,
-      G_TYPE_BOOLEAN, 2, G_TYPE_UINT, G_TYPE_BOOLEAN);
+      swfdec_accumulate_or, NULL, swfdec_marshal_BOOLEAN__UINT_UINT_BOOLEAN,
+      G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_BOOLEAN);
   /**
    * SwfdecPlayer::handle-mouse:
    * @player: the #SwfdecPlayer affected
@@ -1657,23 +1657,25 @@ swfdec_player_handle_mouse (SwfdecPlayer
 /**
  * swfdec_player_key_press:
  * @player: a #SwfdecPlayer
- * @key: the key that was pressed
+ * @keycode: the key that was pressed
+ * @character: UCS4 of the character that was inserted or 0 if none
  *
  * Call this function to make the @player react to a key press. Be sure to
- * transform the keycode to the right #SwfdecKey.
+ * check that keycode transformations are done correctly. For a list of 
+ * keycodes see FIXME.
  *
  * Returns: %TRUE if the key press was handled by the @player, %FALSE if it
  *          should be propagated further
  **/
 gboolean
-swfdec_player_key_press (SwfdecPlayer *player, SwfdecKey key)
+swfdec_player_key_press (SwfdecPlayer *player, guint keycode, guint character)
 {
   gboolean ret;
 
   g_return_val_if_fail (SWFDEC_IS_PLAYER (player), FALSE);
-  g_return_val_if_fail (key >= 256, FALSE);
+  g_return_val_if_fail (keycode < 256, FALSE);
 
-  g_signal_emit (player, signals[HANDLE_KEY], 0, key, TRUE, &ret);
+  g_signal_emit (player, signals[HANDLE_KEY], 0, keycode, character, TRUE, &ret);
 
   return ret;
 }
@@ -1681,23 +1683,24 @@ swfdec_player_key_press (SwfdecPlayer *p
 /**
  * swfdec_player_key_release:
  * @player: a #SwfdecPlayer
- * @key: the key that was released
+ * @keycode: the key that was released
+ * @character: UCS4 of the character that was inserted or 0 if none
  *
- * Call this function to make the @player react to a key being released. Be 
- * sure to transform the keycode to the right #SwfdecKey.
+ * Call this function to make the @player react to a key being released. See
+ * swfdec_player_key_press() for details.
  *
  * Returns: %TRUE if the key press was handled by the @player, %FALSE if it
  *          should be propagated further
  **/
 gboolean
-swfdec_player_key_release (SwfdecPlayer *player, SwfdecKey key)
+swfdec_player_key_release (SwfdecPlayer *player, guint keycode, guint character)
 {
   gboolean ret;
 
   g_return_val_if_fail (SWFDEC_IS_PLAYER (player), FALSE);
-  g_return_val_if_fail (key >= 256, FALSE);
+  g_return_val_if_fail (keycode < 256, FALSE);
 
-  g_signal_emit (player, signals[HANDLE_KEY], 0, key, FALSE, &ret);
+  g_signal_emit (player, signals[HANDLE_KEY], 0, keycode, character, FALSE, &ret);
 
   return ret;
 }
diff --git a/libswfdec/swfdec_player.h b/libswfdec/swfdec_player.h
index 11333b0..905235a 100644
--- a/libswfdec/swfdec_player.h
+++ b/libswfdec/swfdec_player.h
@@ -22,7 +22,6 @@
 
 #include <glib-object.h>
 #include <cairo.h>
-#include <libswfdec/swfdec_key.h>
 #include <libswfdec/swfdec_loader.h>
 
 G_BEGIN_DECLS
@@ -113,9 +112,11 @@ gboolean	swfdec_player_handle_mouse	(Swf
 						 double		y,
 						 int		button);
 gboolean	swfdec_player_key_press		(SwfdecPlayer *	player,
-						 SwfdecKey	key);
+						 guint		keycode,
+						 guint		character);
 gboolean	swfdec_player_key_release	(SwfdecPlayer *	player,
-						 SwfdecKey	key);
+						 guint		keycode,
+						 guint		character);
 /* audio - see swfdec_audio.c */
 void		swfdec_player_render_audio	(SwfdecPlayer *	player,
 						 gint16 *	dest, 
diff --git a/libswfdec/swfdec_player_internal.h b/libswfdec/swfdec_player_internal.h
index b02e573..665a5db 100644
--- a/libswfdec/swfdec_player_internal.h
+++ b/libswfdec/swfdec_player_internal.h
@@ -122,7 +122,8 @@ struct _SwfdecPlayerClass
 						 guint			msecs,
 						 guint			audio_samples);
   gboolean		(* handle_key)		(SwfdecPlayer *		player,
-						 SwfdecKey		key,
+						 guint			key,
+						 guint			character,
 						 gboolean		down);
   gboolean		(* handle_mouse)	(SwfdecPlayer *		player,
 						 double			x,


More information about the Swfdec mailing list