[Swfdec-commits] 15 commits - configure.ac doc/Makefile.am doc/swfdec.types libswfdec/compiler.c libswfdec/.gitignore libswfdec-gtk/.gitignore libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_loader.h libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_socket.c libswfdec-gtk/swfdec_gtk_socket.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_gtk_widget.h libswfdec-gtk/swfdec_playback_alsa.c libswfdec-gtk/swfdec_playback.h libswfdec-gtk/swfdec_playback_none.c libswfdec-gtk/swfdec_playback_oss.c libswfdec-gtk/swfdec_playback_pa.c libswfdec-gtk/swfdec_source.c libswfdec-gtk/swfdec_source.h libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_accessibility.c libswfdec/swfdec_amf.c libswfdec/swfdec_amf.h libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_date.c libswfdec/swfdec_as_date.h libswfdec/swfdec_as_debugger.c libswfdec/swfdec_as_debugger.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_native_function.h libswfdec/swfdec_as_number.c libswfdec/swfdec_as_number.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_script_function.c libswfdec/swfdec_as_script_function.h libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_audio.c libswfdec/swfdec_audio_event.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_audio_flv.c libswfdec/swfdec_audio_flv.h libswfdec/swfdec_audio.h libswfdec/swfdec_audio_internal.h libswfdec/swfdec_audio_stream.c libswfdec/swfdec_audio_stream.h libswfdec/swfdec_bevel_filter.c libswfdec/swfdec_bitmap_data.c libswfdec/swfdec_bitmap_filter.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_blur_filter.c libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie_as.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_cache.c libswfdec/swfdec_cached.c libswfdec/swfdec_cached.h libswfdec/swfdec_cache.h libswfdec/swfdec_camera.c libswfdec/swfdec_character.c libswfdec/swfdec_character.h libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_audio.h libswfdec/swfdec_codec_ffmpeg.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec_mad.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_codec_video.h libswfdec/swfdec_codec_vp6_alpha.c libswfdec/swfdec_color_as.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_color_matrix_filter.c libswfdec/swfdec_color_transform.c libswfdec/swfdec_convolution_filter.c libswfdec/swfdec_debug.c libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_debug.h libswfdec/swfdec_decoder.c libswfdec/swfdec_decoder.h libswfdec/swfdec_displacement_map_filter.c libswfdec/swfdec_draw.c libswfdec/swfdec_draw.h libswfdec/swfdec_drop_shadow_filter.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_external_interface.c libswfdec/swfdec_file_loader.c libswfdec/swfdec_file_loader.h libswfdec/swfdec_file_reference.c libswfdec/swfdec_file_reference_list.c libswfdec/swfdec_filter_as.c libswfdec/swfdec_filter.c libswfdec/swfdec_filter.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_flv_decoder.h libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_function_list.c libswfdec/swfdec_function_list.h libswfdec/swfdec_glow_filter.c libswfdec/swfdec_gradient_filter.c libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_graphic.c libswfdec/swfdec_graphic.h libswfdec/swfdec_graphic_movie.c libswfdec/swfdec_graphic_movie.h libswfdec/swfdec.h libswfdec/swfdec_image.c libswfdec/swfdec_image_decoder.c libswfdec/swfdec_image_decoder.h libswfdec/swfdec_image.h libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_internal.h libswfdec/swfdec_interval.c libswfdec/swfdec_interval.h libswfdec/swfdec_key_as.c libswfdec/swfdec_keys.h libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loader_internal.h libswfdec/swfdec_load_object_as.c libswfdec/swfdec_load_object.c libswfdec/swfdec_load_object.h libswfdec/swfdec_loadvars_as.c libswfdec/swfdec_local_connection.c libswfdec/swfdec_marshal.list libswfdec/swfdec_microphone.c libswfdec/swfdec_morph_movie.c libswfdec/swfdec_morph_movie.h libswfdec/swfdec_morphshape.c libswfdec/swfdec_morphshape.h libswfdec/swfdec_mouse_as.c libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie_clip_loader.c libswfdec/swfdec_movie_clip_loader.h libswfdec/swfdec_movie.h libswfdec/swfdec_net_connection.c libswfdec/swfdec_net_connection.h libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_net_stream.h libswfdec/swfdec_path.c libswfdec/swfdec_path.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h libswfdec/swfdec_player_scripting.c libswfdec/swfdec_player_scripting.h libswfdec/swfdec_policy_file.c libswfdec/swfdec_policy_file.h libswfdec/swfdec_print_job.c libswfdec/swfdec_rectangle.c libswfdec/swfdec_rectangle.h libswfdec/swfdec_rect.c libswfdec/swfdec_rect.h libswfdec/swfdec_resource.c libswfdec/swfdec_resource.h libswfdec/swfdec_ringbuffer.c libswfdec/swfdec_ringbuffer.h libswfdec/swfdec_sandbox.c libswfdec/swfdec_sandbox.h libswfdec/swfdec_script.c libswfdec/swfdec_script.h libswfdec/swfdec_script_internal.h libswfdec/swfdec_selection.c libswfdec/swfdec_shape.c libswfdec/swfdec_shape.h libswfdec/swfdec_shape_parser.c libswfdec/swfdec_shape_parser.h libswfdec/swfdec_shared_object.c libswfdec/swfdec_socket.c libswfdec/swfdec_socket.h libswfdec/swfdec_sound.c libswfdec/swfdec_sound.h libswfdec/swfdec_sound_object.c libswfdec/swfdec_sound_object.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_sprite_movie.h libswfdec/swfdec_stage_as.c libswfdec/swfdec_stream.c libswfdec/swfdec_stream.h libswfdec/swfdec_stream_target.c libswfdec/swfdec_stream_target.h libswfdec/swfdec_stroke.c libswfdec/swfdec_stroke.h libswfdec/swfdec_style_sheet.c libswfdec/swfdec_style_sheet.h libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_swf_decoder.h libswfdec/swfdec_system_as.c libswfdec/swfdec_system.c libswfdec/swfdec_system.h libswfdec/swfdec_system_ime.c libswfdec/swfdec_system_security.c libswfdec/swfdec_tag.c libswfdec/swfdec_tag.h libswfdec/swfdec_text.c libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie.h libswfdec/swfdec_text_field_movie_html.c libswfdec/swfdec_text_format.c libswfdec/swfdec_text_format.h libswfdec/swfdec_text.h libswfdec/swfdec_text_renderer.c libswfdec/swfdec_text_snapshot.c libswfdec/swfdec_transform.c libswfdec/swfdec_types.h libswfdec/swfdec_url.c libswfdec/swfdec_url.h libswfdec/swfdec_utils.c libswfdec/swfdec_utils.h libswfdec/swfdec_video.c libswfdec/swfdec_video.h libswfdec/swfdec_video_movie_as.c libswfdec/swfdec_video_movie.c libswfdec/swfdec_video_movie.h libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h libswfdec/swfdec_xml_socket.c libswfdec/swfdec_xml_socket.h Makefile.am player/swfdec_debug_script.h player/swfdec_debug_scripts.c player/swfdec_debug_scripts.h player/swfdec_debug_stack.c player/swfdec_player_manager.c player/swfdec_player_manager.h player/swfplay.c README swfdec/compiler.c swfdec/.gitignore swfdec-gtk/.gitignore swfdec-gtk/Makefile.am swfdec-gtk/swfdec-gtk.h swfdec-gtk/swfdec_gtk_keys.c swfdec-gtk/swfdec_gtk_keys.h swfdec-gtk/swfdec_gtk_loader.c swfdec-gtk/swfdec_gtk_loader.h swfdec-gtk/swfdec_gtk_player.c swfdec-gtk/swfdec_gtk_player.h swfdec-gtk/swfdec_gtk_socket.c swfdec-gtk/swfdec_gtk_socket.h swfdec-gtk/swfdec_gtk_widget.c swfdec-gtk/swfdec_gtk_widget.h swfdec-gtk/swfdec_playback_alsa.c swfdec-gtk/swfdec_playback.h swfdec-gtk/swfdec_playback_none.c swfdec-gtk/swfdec_playback_oss.c swfdec-gtk/swfdec_playback_pa.c swfdec-gtk/swfdec_source.c swfdec-gtk/swfdec_source.h swfdec/jpeg swfdec/Makefile.am swfdec/swfdec_accessibility.c swfdec/swfdec_amf.c swfdec/swfdec_amf.h swfdec/swfdec_as_array.c swfdec/swfdec_as_array.h swfdec/swfdec_as_boolean.c swfdec/swfdec_as_boolean.h swfdec/swfdec_asbroadcaster.c swfdec/swfdec_as_context.c swfdec/swfdec_as_context.h swfdec/swfdec_as_date.c swfdec/swfdec_as_date.h swfdec/swfdec_as_debugger.c swfdec/swfdec_as_debugger.h swfdec/swfdec_as_frame.c swfdec/swfdec_as_frame.h swfdec/swfdec_as_frame_internal.h swfdec/swfdec_as_function.c swfdec/swfdec_as_function.h swfdec/swfdec_as_initialize.as swfdec/swfdec_as_initialize.h swfdec/swfdec_as_internal.h swfdec/swfdec_as_interpret.c swfdec/swfdec_as_interpret.h swfdec/swfdec_as_math.c swfdec/swfdec_as_native_function.c swfdec/swfdec_as_native_function.h swfdec/swfdec_as_number.c swfdec/swfdec_as_number.h swfdec/swfdec_as_object.c swfdec/swfdec_as_object.h swfdec/swfdec_as_script_function.c swfdec/swfdec_as_script_function.h swfdec/swfdec_as_stack.c swfdec/swfdec_as_stack.h swfdec/swfdec_as_string.c swfdec/swfdec_as_string.h swfdec/swfdec_as_strings.c swfdec/swfdec_as_super.c swfdec/swfdec_as_super.h swfdec/swfdec_as_types.c swfdec/swfdec_as_types.h swfdec/swfdec_audio.c swfdec/swfdec_audio_event.c swfdec/swfdec_audio_event.h swfdec/swfdec_audio_flv.c swfdec/swfdec_audio_flv.h swfdec/swfdec_audio.h swfdec/swfdec_audio_internal.h swfdec/swfdec_audio_stream.c swfdec/swfdec_audio_stream.h swfdec/swfdec_bevel_filter.c swfdec/swfdec_bitmap_data.c swfdec/swfdec_bitmap_filter.c swfdec/swfdec_bits.c swfdec/swfdec_bits.h swfdec/swfdec_blur_filter.c swfdec/swfdec_buffer.c swfdec/swfdec_buffer.h swfdec/swfdec_button.c swfdec/swfdec_button.h swfdec/swfdec_button_movie_as.c swfdec/swfdec_button_movie.c swfdec/swfdec_button_movie.h swfdec/swfdec_cache.c swfdec/swfdec_cached.c swfdec/swfdec_cached.h swfdec/swfdec_cache.h swfdec/swfdec_camera.c swfdec/swfdec_character.c swfdec/swfdec_character.h swfdec/swfdec_codec_adpcm.c swfdec/swfdec_codec_audio.c swfdec/swfdec_codec_audio.h swfdec/swfdec_codec_ffmpeg.c swfdec/swfdec_codec_gst.c swfdec/swfdec_codec_mad.c swfdec/swfdec_codec_screen.c swfdec/swfdec_codec_video.c swfdec/swfdec_codec_video.h swfdec/swfdec_codec_vp6_alpha.c swfdec/swfdec_color_as.c swfdec/swfdec_color.c swfdec/swfdec_color.h swfdec/swfdec_color_matrix_filter.c swfdec/swfdec_color_transform.c swfdec/swfdec_convolution_filter.c swfdec/swfdec_debug.c swfdec/swfdec_debugger.c swfdec/swfdec_debugger.h swfdec/swfdec_debug.h swfdec/swfdec_decoder.c swfdec/swfdec_decoder.h swfdec/swfdec_displacement_map_filter.c swfdec/swfdec_draw.c swfdec/swfdec_draw.h swfdec/swfdec_drop_shadow_filter.c swfdec/swfdec_event.c swfdec/swfdec_event.h swfdec/swfdec_external_interface.c swfdec/swfdec_file_loader.c swfdec/swfdec_file_loader.h swfdec/swfdec_file_reference.c swfdec/swfdec_file_reference_list.c swfdec/swfdec_filter_as.c swfdec/swfdec_filter.c swfdec/swfdec_filter.h swfdec/swfdec_flv_decoder.c swfdec/swfdec_flv_decoder.h swfdec/swfdec_font.c swfdec/swfdec_font.h swfdec/swfdec_function_list.c swfdec/swfdec_function_list.h swfdec/swfdec_glow_filter.c swfdec/swfdec_gradient_filter.c swfdec/swfdec_gradient_pattern.c swfdec/swfdec_gradient_pattern.h swfdec/swfdec_graphic.c swfdec/swfdec_graphic.h swfdec/swfdec_graphic_movie.c swfdec/swfdec_graphic_movie.h swfdec/swfdec.h swfdec/swfdec_image.c swfdec/swfdec_image_decoder.c swfdec/swfdec_image_decoder.h swfdec/swfdec_image.h swfdec/swfdec_initialize.as swfdec/swfdec_initialize.h swfdec/swfdec_internal.h swfdec/swfdec_interval.c swfdec/swfdec_interval.h swfdec/swfdec_key_as.c swfdec/swfdec_keys.h swfdec/swfdec_loader.c swfdec/swfdec_loader.h swfdec/swfdec_loader_internal.h swfdec/swfdec_load_object_as.c swfdec/swfdec_load_object.c swfdec/swfdec_load_object.h swfdec/swfdec_loadvars_as.c swfdec/swfdec_local_connection.c swfdec/swfdec_marshal.list swfdec/swfdec_microphone.c swfdec/swfdec_morph_movie.c swfdec/swfdec_morph_movie.h swfdec/swfdec_morphshape.c swfdec/swfdec_morphshape.h swfdec/swfdec_mouse_as.c swfdec/swfdec_movie_as_drawing.c swfdec/swfdec_movie_asprops.c swfdec/swfdec_movie.c swfdec/swfdec_movie_clip_loader.c swfdec/swfdec_movie_clip_loader.h swfdec/swfdec_movie.h swfdec/swfdec_net_connection.c swfdec/swfdec_net_connection.h swfdec/swfdec_net_stream_as.c swfdec/swfdec_net_stream.c swfdec/swfdec_net_stream.h swfdec/swfdec_path.c swfdec/swfdec_path.h swfdec/swfdec_pattern.c swfdec/swfdec_pattern.h swfdec/swfdec_player_as.c swfdec/swfdec_player.c swfdec/swfdec_player.h swfdec/swfdec_player_internal.h swfdec/swfdec_player_scripting.c swfdec/swfdec_player_scripting.h swfdec/swfdec_policy_file.c swfdec/swfdec_policy_file.h swfdec/swfdec_print_job.c swfdec/swfdec_rectangle.c swfdec/swfdec_rectangle.h swfdec/swfdec_rect.c swfdec/swfdec_rect.h swfdec/swfdec_resource.c swfdec/swfdec_resource.h swfdec/swfdec_ringbuffer.c swfdec/swfdec_ringbuffer.h swfdec/swfdec_sandbox.c swfdec/swfdec_sandbox.h swfdec/swfdec_script.c swfdec/swfdec_script.h swfdec/swfdec_script_internal.h swfdec/swfdec_selection.c swfdec/swfdec_shape.c swfdec/swfdec_shape.h swfdec/swfdec_shape_parser.c swfdec/swfdec_shape_parser.h swfdec/swfdec_shared_object.c swfdec/swfdec_socket.c swfdec/swfdec_socket.h swfdec/swfdec_sound.c swfdec/swfdec_sound.h swfdec/swfdec_sound_object.c swfdec/swfdec_sound_object.h swfdec/swfdec_sprite.c swfdec/swfdec_sprite.h swfdec/swfdec_sprite_movie_as.c swfdec/swfdec_sprite_movie.c swfdec/swfdec_sprite_movie.h swfdec/swfdec_stage_as.c swfdec/swfdec_stream.c swfdec/swfdec_stream.h swfdec/swfdec_stream_target.c swfdec/swfdec_stream_target.h swfdec/swfdec_stroke.c swfdec/swfdec_stroke.h swfdec/swfdec_style_sheet.c swfdec/swfdec_style_sheet.h swfdec/swfdec_swf_decoder.c swfdec/swfdec_swf_decoder.h swfdec/swfdec_system_as.c swfdec/swfdec_system.c swfdec/swfdec_system.h swfdec/swfdec_system_ime.c swfdec/swfdec_system_security.c swfdec/swfdec_tag.c swfdec/swfdec_tag.h swfdec/swfdec_text.c swfdec/swfdec_text_field.c swfdec/swfdec_text_field.h swfdec/swfdec_text_field_movie_as.c swfdec/swfdec_text_field_movie.c swfdec/swfdec_text_field_movie.h swfdec/swfdec_text_field_movie_html.c swfdec/swfdec_text_format.c swfdec/swfdec_text_format.h swfdec/swfdec_text.h swfdec/swfdec_text_renderer.c swfdec/swfdec_text_snapshot.c swfdec/swfdec_transform.c swfdec/swfdec_types.h swfdec/swfdec_url.c swfdec/swfdec_url.h swfdec/swfdec_utils.c swfdec/swfdec_utils.h swfdec/swfdec_video.c swfdec/swfdec_video.h swfdec/swfdec_video_movie_as.c swfdec/swfdec_video_movie.c swfdec/swfdec_video_movie.h swfdec/swfdec_xml.c swfdec/swfdec_xml.h swfdec/swfdec_xml_node.c swfdec/swfdec_xml_node.h swfdec/swfdec_xml_socket.c swfdec/swfdec_xml_socket.h test/rtmp test/sound test/swfdec_test.c test/swfdec_test_function.h test/swfdec_test_global.c test/swfdec_test_image.h test/swfdec_test_test.c test/swfdec_test_test.h test/various tools/crashfinder.c tools/dump.c tools/swfdec-extract.c tools/swfdec_out.h tools/swfedit_file.c tools/swfedit_file.h tools/swfedit_tag.c tools/swfedit_tag.h tools/swfedit_token.c tools/swfedit_token.h tools/swfscript.c vivified/core vivified/ui

Benjamin Otte company at kemper.freedesktop.org
Fri Jan 25 09:37:07 PST 2008


 Makefile.am                                |    4 
 README                                     |   10 
 configure.ac                               |   14 
 doc/Makefile.am                            |   16 
 doc/swfdec.types                           |    4 
 libswfdec-gtk/.gitignore                   |   14 
 libswfdec-gtk/Makefile.am                  |   45 
 libswfdec-gtk/swfdec-gtk.h                 |   29 
 libswfdec-gtk/swfdec_gtk_keys.c            |   77 
 libswfdec-gtk/swfdec_gtk_keys.h            |   30 
 libswfdec-gtk/swfdec_gtk_loader.c          |  230 --
 libswfdec-gtk/swfdec_gtk_loader.h          |   44 
 libswfdec-gtk/swfdec_gtk_player.c          |  343 ---
 libswfdec-gtk/swfdec_gtk_player.h          |   57 
 libswfdec-gtk/swfdec_gtk_socket.c          |  220 -
 libswfdec-gtk/swfdec_gtk_socket.h          |   42 
 libswfdec-gtk/swfdec_gtk_widget.c          |  683 ------
 libswfdec-gtk/swfdec_gtk_widget.h          |   69 
 libswfdec-gtk/swfdec_playback.h            |   35 
 libswfdec-gtk/swfdec_playback_alsa.c       |  360 ---
 libswfdec-gtk/swfdec_playback_none.c       |   38 
 libswfdec-gtk/swfdec_playback_oss.c        |  265 --
 libswfdec-gtk/swfdec_playback_pa.c         |  350 ---
 libswfdec-gtk/swfdec_source.c              |  183 -
 libswfdec-gtk/swfdec_source.h              |   34 
 libswfdec/.gitignore                       |   19 
 libswfdec/Makefile.am                      |  372 ---
 libswfdec/compiler.c                       |   92 
 libswfdec/jpeg/.gitignore                  |   14 
 libswfdec/jpeg/Makefile.am                 |   20 
 libswfdec/jpeg/cogcompat.h                 |   14 
 libswfdec/jpeg/jpeg.c                      | 1126 ---------
 libswfdec/jpeg/jpeg.h                      |  190 -
 libswfdec/jpeg/jpeg_bits.c                 |  154 -
 libswfdec/jpeg/jpeg_bits.h                 |   32 
 libswfdec/jpeg/jpeg_huffman.c              |  168 -
 libswfdec/jpeg/jpeg_huffman.h              |   37 
 libswfdec/jpeg/jpeg_markers.h              |   44 
 libswfdec/jpeg/jpeg_rgb_decoder.c          |  352 ---
 libswfdec/jpeg/jpeg_rgb_decoder.h          |   18 
 libswfdec/jpeg/jpeg_tables.c               |   54 
 libswfdec/swfdec.h                         |   48 
 libswfdec/swfdec_accessibility.c           |   50 
 libswfdec/swfdec_amf.c                     |  225 -
 libswfdec/swfdec_amf.h                     |   59 
 libswfdec/swfdec_as_array.c                | 1399 ------------
 libswfdec/swfdec_as_array.h                |   84 
 libswfdec/swfdec_as_boolean.c              |  103 
 libswfdec/swfdec_as_boolean.h              |   52 
 libswfdec/swfdec_as_context.c              | 1461 ------------
 libswfdec/swfdec_as_context.h              |  143 -
 libswfdec/swfdec_as_date.c                 | 1162 ----------
 libswfdec/swfdec_as_date.h                 |   60 
 libswfdec/swfdec_as_debugger.c             |   82 
 libswfdec/swfdec_as_debugger.h             |   80 
 libswfdec/swfdec_as_frame.c                |  895 -------
 libswfdec/swfdec_as_frame.h                |   63 
 libswfdec/swfdec_as_frame_internal.h       |  106 
 libswfdec/swfdec_as_function.c             |  279 --
 libswfdec/swfdec_as_function.h             |   61 
 libswfdec/swfdec_as_initialize.as          |  100 
 libswfdec/swfdec_as_initialize.h           |  175 -
 libswfdec/swfdec_as_internal.h             |   78 
 libswfdec/swfdec_as_interpret.c            | 3268 -----------------------------
 libswfdec/swfdec_as_interpret.h            |  150 -
 libswfdec/swfdec_as_math.c                 |  149 -
 libswfdec/swfdec_as_native_function.c      |  395 ---
 libswfdec/swfdec_as_native_function.h      |   95 
 libswfdec/swfdec_as_number.c               |  121 -
 libswfdec/swfdec_as_number.h               |   52 
 libswfdec/swfdec_as_object.c               | 1773 ---------------
 libswfdec/swfdec_as_object.h               |  190 -
 libswfdec/swfdec_as_script_function.c      |  154 -
 libswfdec/swfdec_as_script_function.h      |   61 
 libswfdec/swfdec_as_stack.c                |  200 -
 libswfdec/swfdec_as_stack.h                |  101 
 libswfdec/swfdec_as_string.c               |  914 --------
 libswfdec/swfdec_as_string.h               |   62 
 libswfdec/swfdec_as_strings.c              |  491 ----
 libswfdec/swfdec_as_super.c                |  217 -
 libswfdec/swfdec_as_super.h                |   59 
 libswfdec/swfdec_as_types.c                |  677 ------
 libswfdec/swfdec_as_types.h                |  139 -
 libswfdec/swfdec_asbroadcaster.c           |   84 
 libswfdec/swfdec_audio.c                   |  346 ---
 libswfdec/swfdec_audio.h                   |   47 
 libswfdec/swfdec_audio_event.c             |  330 --
 libswfdec/swfdec_audio_event.h             |   74 
 libswfdec/swfdec_audio_flv.c               |  227 --
 libswfdec/swfdec_audio_flv.h               |   66 
 libswfdec/swfdec_audio_internal.h          |   77 
 libswfdec/swfdec_audio_stream.c            |  205 -
 libswfdec/swfdec_audio_stream.h            |   65 
 libswfdec/swfdec_bevel_filter.c            |  226 --
 libswfdec/swfdec_bitmap_data.c             |  306 --
 libswfdec/swfdec_bitmap_filter.c           |   43 
 libswfdec/swfdec_bits.c                    |  760 ------
 libswfdec/swfdec_bits.h                    |   75 
 libswfdec/swfdec_blur_filter.c             |   82 
 libswfdec/swfdec_buffer.c                  |  641 -----
 libswfdec/swfdec_buffer.h                  |   85 
 libswfdec/swfdec_button.c                  |  302 --
 libswfdec/swfdec_button.h                  |   83 
 libswfdec/swfdec_button_movie.c            |  320 --
 libswfdec/swfdec_button_movie.h            |   54 
 libswfdec/swfdec_button_movie_as.c         |  108 
 libswfdec/swfdec_cache.c                   |  164 -
 libswfdec/swfdec_cache.h                   |   63 
 libswfdec/swfdec_cached.c                  |  123 -
 libswfdec/swfdec_cached.h                  |   65 
 libswfdec/swfdec_camera.c                  |   89 
 libswfdec/swfdec_character.c               |   42 
 libswfdec/swfdec_character.h               |   62 
 libswfdec/swfdec_codec_adpcm.c             |  186 -
 libswfdec/swfdec_codec_audio.c             |  284 --
 libswfdec/swfdec_codec_audio.h             |   57 
 libswfdec/swfdec_codec_ffmpeg.c            |  317 --
 libswfdec/swfdec_codec_gst.c               |  615 -----
 libswfdec/swfdec_codec_mad.c               |  235 --
 libswfdec/swfdec_codec_screen.c            |  134 -
 libswfdec/swfdec_codec_video.c             |  320 --
 libswfdec/swfdec_codec_video.h             |   75 
 libswfdec/swfdec_codec_vp6_alpha.c         |  111 
 libswfdec/swfdec_color.c                   |  299 --
 libswfdec/swfdec_color.h                   |   75 
 libswfdec/swfdec_color_as.c                |  181 -
 libswfdec/swfdec_color_matrix_filter.c     |   53 
 libswfdec/swfdec_color_transform.c         |  206 -
 libswfdec/swfdec_convolution_filter.c      |  197 -
 libswfdec/swfdec_debug.c                   |   78 
 libswfdec/swfdec_debug.h                   |   65 
 libswfdec/swfdec_debugger.c                |  617 -----
 libswfdec/swfdec_debugger.h                |  108 
 libswfdec/swfdec_decoder.c                 |  103 
 libswfdec/swfdec_decoder.h                 |   92 
 libswfdec/swfdec_displacement_map_filter.c |  197 -
 libswfdec/swfdec_draw.c                    |  190 -
 libswfdec/swfdec_draw.h                    |   85 
 libswfdec/swfdec_drop_shadow_filter.c      |  233 --
 libswfdec/swfdec_event.c                   |  231 --
 libswfdec/swfdec_event.h                   |   77 
 libswfdec/swfdec_external_interface.c      |  228 --
 libswfdec/swfdec_file_loader.c             |  137 -
 libswfdec/swfdec_file_loader.h             |   53 
 libswfdec/swfdec_file_reference.c          |  139 -
 libswfdec/swfdec_file_reference_list.c     |   33 
 libswfdec/swfdec_filter.c                  |  124 -
 libswfdec/swfdec_filter.h                  |   60 
 libswfdec/swfdec_filter_as.c               |   47 
 libswfdec/swfdec_flv_decoder.c             |  595 -----
 libswfdec/swfdec_flv_decoder.h             |   83 
 libswfdec/swfdec_font.c                    |  457 ----
 libswfdec/swfdec_font.h                    |   89 
 libswfdec/swfdec_function_list.c           |  132 -
 libswfdec/swfdec_function_list.h           |   50 
 libswfdec/swfdec_glow_filter.c             |  162 -
 libswfdec/swfdec_gradient_filter.c         |  243 --
 libswfdec/swfdec_gradient_pattern.c        |  129 -
 libswfdec/swfdec_gradient_pattern.h        |   67 
 libswfdec/swfdec_graphic.c                 |   71 
 libswfdec/swfdec_graphic.h                 |   78 
 libswfdec/swfdec_graphic_movie.c           |  113 -
 libswfdec/swfdec_graphic_movie.h           |   51 
 libswfdec/swfdec_image.c                   |  710 ------
 libswfdec/swfdec_image.h                   |   84 
 libswfdec/swfdec_image_decoder.c           |  131 -
 libswfdec/swfdec_image_decoder.h           |   59 
 libswfdec/swfdec_initialize.as             | 1521 -------------
 libswfdec/swfdec_initialize.h              | 2196 -------------------
 libswfdec/swfdec_internal.h                |   68 
 libswfdec/swfdec_interval.c                |  193 -
 libswfdec/swfdec_interval.h                |   80 
 libswfdec/swfdec_key_as.c                  |   83 
 libswfdec/swfdec_keys.h                    |  126 -
 libswfdec/swfdec_load_object.c             |  253 --
 libswfdec/swfdec_load_object.h             |   76 
 libswfdec/swfdec_load_object_as.c          |  141 -
 libswfdec/swfdec_loader.c                  |  506 ----
 libswfdec/swfdec_loader.h                  |   97 
 libswfdec/swfdec_loader_internal.h         |   51 
 libswfdec/swfdec_loadvars_as.c             |   46 
 libswfdec/swfdec_local_connection.c        |   57 
 libswfdec/swfdec_marshal.list              |    6 
 libswfdec/swfdec_microphone.c              |   74 
 libswfdec/swfdec_morph_movie.c             |  133 -
 libswfdec/swfdec_morph_movie.h             |   54 
 libswfdec/swfdec_morphshape.c              |   96 
 libswfdec/swfdec_morphshape.h              |   53 
 libswfdec/swfdec_mouse_as.c                |   51 
 libswfdec/swfdec_movie.c                   | 1815 ----------------
 libswfdec/swfdec_movie.h                   |  306 --
 libswfdec/swfdec_movie_as_drawing.c        |  456 ----
 libswfdec/swfdec_movie_asprops.c           |  484 ----
 libswfdec/swfdec_movie_clip_loader.c       |  127 -
 libswfdec/swfdec_movie_clip_loader.h       |   51 
 libswfdec/swfdec_net_connection.c          |  186 -
 libswfdec/swfdec_net_connection.h          |   57 
 libswfdec/swfdec_net_stream.c              |  644 -----
 libswfdec/swfdec_net_stream.h              |   98 
 libswfdec/swfdec_net_stream_as.c           |  187 -
 libswfdec/swfdec_path.c                    |  273 --
 libswfdec/swfdec_path.h                    |   67 
 libswfdec/swfdec_pattern.c                 |  559 ----
 libswfdec/swfdec_pattern.h                 |   75 
 libswfdec/swfdec_player.c                  | 2873 -------------------------
 libswfdec/swfdec_player.h                  |  173 -
 libswfdec/swfdec_player_as.c               |  367 ---
 libswfdec/swfdec_player_internal.h         |  252 --
 libswfdec/swfdec_player_scripting.c        |   39 
 libswfdec/swfdec_player_scripting.h        |   62 
 libswfdec/swfdec_policy_file.c             |  350 ---
 libswfdec/swfdec_policy_file.h             |   65 
 libswfdec/swfdec_print_job.c               |  130 -
 libswfdec/swfdec_rect.c                    |  223 -
 libswfdec/swfdec_rect.h                    |   51 
 libswfdec/swfdec_rectangle.c               |  203 -
 libswfdec/swfdec_rectangle.h               |   55 
 libswfdec/swfdec_resource.c                |  684 ------
 libswfdec/swfdec_resource.h                |   98 
 libswfdec/swfdec_ringbuffer.c              |  125 -
 libswfdec/swfdec_ringbuffer.h              |   59 
 libswfdec/swfdec_sandbox.c                 |  303 --
 libswfdec/swfdec_sandbox.h                 |   83 
 libswfdec/swfdec_script.c                  |  316 --
 libswfdec/swfdec_script.h                  |   38 
 libswfdec/swfdec_script_internal.h         |   95 
 libswfdec/swfdec_selection.c               |   75 
 libswfdec/swfdec_shape.c                   |  387 ---
 libswfdec/swfdec_shape.h                   |   63 
 libswfdec/swfdec_shape_parser.c            |  675 -----
 libswfdec/swfdec_shape_parser.h            |   48 
 libswfdec/swfdec_shared_object.c           |   82 
 libswfdec/swfdec_socket.c                  |   99 
 libswfdec/swfdec_socket.h                  |   58 
 libswfdec/swfdec_sound.c                   |  558 ----
 libswfdec/swfdec_sound.h                   |  107 
 libswfdec/swfdec_sound_object.c            |  340 ---
 libswfdec/swfdec_sound_object.h            |   54 
 libswfdec/swfdec_sprite.c                  |  217 -
 libswfdec/swfdec_sprite.h                  |  100 
 libswfdec/swfdec_sprite_movie.c            |  883 -------
 libswfdec/swfdec_sprite_movie.h            |   76 
 libswfdec/swfdec_sprite_movie_as.c         |  891 -------
 libswfdec/swfdec_stage_as.c                |  246 --
 libswfdec/swfdec_stream.c                  |  399 ---
 libswfdec/swfdec_stream.h                  |   68 
 libswfdec/swfdec_stream_target.c           |  136 -
 libswfdec/swfdec_stream_target.h           |   67 
 libswfdec/swfdec_stroke.c                  |  361 ---
 libswfdec/swfdec_stroke.h                  |   76 
 libswfdec/swfdec_style_sheet.c             |  366 ---
 libswfdec/swfdec_style_sheet.h             |   57 
 libswfdec/swfdec_swf_decoder.c             |  487 ----
 libswfdec/swfdec_swf_decoder.h             |   98 
 libswfdec/swfdec_system.c                  |  315 --
 libswfdec/swfdec_system.h                  |   76 
 libswfdec/swfdec_system_as.c               |  347 ---
 libswfdec/swfdec_system_ime.c              |   79 
 libswfdec/swfdec_system_security.c         |  123 -
 libswfdec/swfdec_tag.c                     |  628 -----
 libswfdec/swfdec_tag.h                     |  121 -
 libswfdec/swfdec_text.c                    |  133 -
 libswfdec/swfdec_text.h                    |   67 
 libswfdec/swfdec_text_field.c              |  198 -
 libswfdec/swfdec_text_field.h              |   93 
 libswfdec/swfdec_text_field_movie.c        | 1627 --------------
 libswfdec/swfdec_text_field_movie.h        |  160 -
 libswfdec/swfdec_text_field_movie_as.c     | 1539 -------------
 libswfdec/swfdec_text_field_movie_html.c   |  777 ------
 libswfdec/swfdec_text_format.c             | 1274 -----------
 libswfdec/swfdec_text_format.h             |  101 
 libswfdec/swfdec_text_renderer.c           |   94 
 libswfdec/swfdec_text_snapshot.c           |  109 
 libswfdec/swfdec_transform.c               |  121 -
 libswfdec/swfdec_types.h                   |   63 
 libswfdec/swfdec_url.c                     |  553 ----
 libswfdec/swfdec_url.h                     |   65 
 libswfdec/swfdec_utils.c                   |   74 
 libswfdec/swfdec_utils.h                   |   40 
 libswfdec/swfdec_video.c                   |  302 --
 libswfdec/swfdec_video.h                   |   61 
 libswfdec/swfdec_video_movie.c             |  197 -
 libswfdec/swfdec_video_movie.h             |   77 
 libswfdec/swfdec_video_movie_as.c          |   94 
 libswfdec/swfdec_xml.c                     |  940 --------
 libswfdec/swfdec_xml.h                     |   90 
 libswfdec/swfdec_xml_node.c                | 1113 ---------
 libswfdec/swfdec_xml_node.h                |  103 
 libswfdec/swfdec_xml_socket.c              |  245 --
 libswfdec/swfdec_xml_socket.h              |   56 
 player/swfdec_debug_script.h               |    2 
 player/swfdec_debug_scripts.c              |    2 
 player/swfdec_debug_scripts.h              |    2 
 player/swfdec_debug_stack.c                |    2 
 player/swfdec_player_manager.c             |    8 
 player/swfdec_player_manager.h             |    4 
 player/swfplay.c                           |   52 
 swfdec-gtk/.gitignore                      |   14 
 swfdec-gtk/Makefile.am                     |   45 
 swfdec-gtk/swfdec-gtk.h                    |   29 
 swfdec-gtk/swfdec_gtk_keys.c               |   77 
 swfdec-gtk/swfdec_gtk_keys.h               |   30 
 swfdec-gtk/swfdec_gtk_loader.c             |  215 +
 swfdec-gtk/swfdec_gtk_loader.h             |   42 
 swfdec-gtk/swfdec_gtk_player.c             |  318 ++
 swfdec-gtk/swfdec_gtk_player.h             |   69 
 swfdec-gtk/swfdec_gtk_socket.c             |  224 +
 swfdec-gtk/swfdec_gtk_socket.h             |   42 
 swfdec-gtk/swfdec_gtk_widget.c             |  683 ++++++
 swfdec-gtk/swfdec_gtk_widget.h             |   69 
 swfdec-gtk/swfdec_playback.h               |   35 
 swfdec-gtk/swfdec_playback_alsa.c          |  360 +++
 swfdec-gtk/swfdec_playback_none.c          |   38 
 swfdec-gtk/swfdec_playback_oss.c           |  265 ++
 swfdec-gtk/swfdec_playback_pa.c            |  350 +++
 swfdec-gtk/swfdec_source.c                 |  183 +
 swfdec-gtk/swfdec_source.h                 |   34 
 swfdec/.gitignore                          |   19 
 swfdec/Makefile.am                         |  373 +++
 swfdec/compiler.c                          |   92 
 swfdec/jpeg/.gitignore                     |   14 
 swfdec/jpeg/Makefile.am                    |   20 
 swfdec/jpeg/cogcompat.h                    |   14 
 swfdec/jpeg/jpeg.c                         | 1126 +++++++++
 swfdec/jpeg/jpeg.h                         |  190 +
 swfdec/jpeg/jpeg_bits.c                    |  154 +
 swfdec/jpeg/jpeg_bits.h                    |   32 
 swfdec/jpeg/jpeg_huffman.c                 |  168 +
 swfdec/jpeg/jpeg_huffman.h                 |   37 
 swfdec/jpeg/jpeg_markers.h                 |   44 
 swfdec/jpeg/jpeg_rgb_decoder.c             |  352 +++
 swfdec/jpeg/jpeg_rgb_decoder.h             |   18 
 swfdec/jpeg/jpeg_tables.c                  |   54 
 swfdec/swfdec.h                            |   48 
 swfdec/swfdec_accessibility.c              |   50 
 swfdec/swfdec_amf.c                        |  225 +
 swfdec/swfdec_amf.h                        |   59 
 swfdec/swfdec_as_array.c                   | 1399 ++++++++++++
 swfdec/swfdec_as_array.h                   |   84 
 swfdec/swfdec_as_boolean.c                 |  103 
 swfdec/swfdec_as_boolean.h                 |   52 
 swfdec/swfdec_as_context.c                 | 1461 ++++++++++++
 swfdec/swfdec_as_context.h                 |  143 +
 swfdec/swfdec_as_date.c                    | 1162 ++++++++++
 swfdec/swfdec_as_date.h                    |   60 
 swfdec/swfdec_as_debugger.c                |   82 
 swfdec/swfdec_as_debugger.h                |   80 
 swfdec/swfdec_as_frame.c                   |  895 +++++++
 swfdec/swfdec_as_frame.h                   |   63 
 swfdec/swfdec_as_frame_internal.h          |  106 
 swfdec/swfdec_as_function.c                |  279 ++
 swfdec/swfdec_as_function.h                |   61 
 swfdec/swfdec_as_initialize.as             |  100 
 swfdec/swfdec_as_initialize.h              |  175 +
 swfdec/swfdec_as_internal.h                |   78 
 swfdec/swfdec_as_interpret.c               | 3268 +++++++++++++++++++++++++++++
 swfdec/swfdec_as_interpret.h               |  150 +
 swfdec/swfdec_as_math.c                    |  149 +
 swfdec/swfdec_as_native_function.c         |  395 +++
 swfdec/swfdec_as_native_function.h         |   95 
 swfdec/swfdec_as_number.c                  |  121 +
 swfdec/swfdec_as_number.h                  |   52 
 swfdec/swfdec_as_object.c                  | 1773 +++++++++++++++
 swfdec/swfdec_as_object.h                  |  190 +
 swfdec/swfdec_as_script_function.c         |  154 +
 swfdec/swfdec_as_script_function.h         |   61 
 swfdec/swfdec_as_stack.c                   |  200 +
 swfdec/swfdec_as_stack.h                   |  101 
 swfdec/swfdec_as_string.c                  |  914 ++++++++
 swfdec/swfdec_as_string.h                  |   62 
 swfdec/swfdec_as_strings.c                 |  491 ++++
 swfdec/swfdec_as_super.c                   |  217 +
 swfdec/swfdec_as_super.h                   |   59 
 swfdec/swfdec_as_types.c                   |  677 ++++++
 swfdec/swfdec_as_types.h                   |  139 +
 swfdec/swfdec_asbroadcaster.c              |   84 
 swfdec/swfdec_audio.c                      |  346 +++
 swfdec/swfdec_audio.h                      |   47 
 swfdec/swfdec_audio_event.c                |  330 ++
 swfdec/swfdec_audio_event.h                |   74 
 swfdec/swfdec_audio_flv.c                  |  227 ++
 swfdec/swfdec_audio_flv.h                  |   66 
 swfdec/swfdec_audio_internal.h             |   77 
 swfdec/swfdec_audio_stream.c               |  205 +
 swfdec/swfdec_audio_stream.h               |   65 
 swfdec/swfdec_bevel_filter.c               |  226 ++
 swfdec/swfdec_bitmap_data.c                |  306 ++
 swfdec/swfdec_bitmap_filter.c              |   43 
 swfdec/swfdec_bits.c                       |  760 ++++++
 swfdec/swfdec_bits.h                       |   75 
 swfdec/swfdec_blur_filter.c                |   82 
 swfdec/swfdec_buffer.c                     |  641 +++++
 swfdec/swfdec_buffer.h                     |   85 
 swfdec/swfdec_button.c                     |  302 ++
 swfdec/swfdec_button.h                     |   83 
 swfdec/swfdec_button_movie.c               |  320 ++
 swfdec/swfdec_button_movie.h               |   54 
 swfdec/swfdec_button_movie_as.c            |  108 
 swfdec/swfdec_cache.c                      |  164 +
 swfdec/swfdec_cache.h                      |   63 
 swfdec/swfdec_cached.c                     |  123 +
 swfdec/swfdec_cached.h                     |   65 
 swfdec/swfdec_camera.c                     |   89 
 swfdec/swfdec_character.c                  |   42 
 swfdec/swfdec_character.h                  |   62 
 swfdec/swfdec_codec_adpcm.c                |  186 +
 swfdec/swfdec_codec_audio.c                |  284 ++
 swfdec/swfdec_codec_audio.h                |   57 
 swfdec/swfdec_codec_ffmpeg.c               |  317 ++
 swfdec/swfdec_codec_gst.c                  |  615 +++++
 swfdec/swfdec_codec_mad.c                  |  235 ++
 swfdec/swfdec_codec_screen.c               |  134 +
 swfdec/swfdec_codec_video.c                |  320 ++
 swfdec/swfdec_codec_video.h                |   75 
 swfdec/swfdec_codec_vp6_alpha.c            |  111 
 swfdec/swfdec_color.c                      |  299 ++
 swfdec/swfdec_color.h                      |   75 
 swfdec/swfdec_color_as.c                   |  181 +
 swfdec/swfdec_color_matrix_filter.c        |   53 
 swfdec/swfdec_color_transform.c            |  206 +
 swfdec/swfdec_convolution_filter.c         |  197 +
 swfdec/swfdec_debug.c                      |   78 
 swfdec/swfdec_debug.h                      |   65 
 swfdec/swfdec_debugger.c                   |  617 +++++
 swfdec/swfdec_debugger.h                   |  108 
 swfdec/swfdec_decoder.c                    |  103 
 swfdec/swfdec_decoder.h                    |   93 
 swfdec/swfdec_displacement_map_filter.c    |  197 +
 swfdec/swfdec_draw.c                       |  190 +
 swfdec/swfdec_draw.h                       |   85 
 swfdec/swfdec_drop_shadow_filter.c         |  233 ++
 swfdec/swfdec_event.c                      |  231 ++
 swfdec/swfdec_event.h                      |   77 
 swfdec/swfdec_external_interface.c         |  228 ++
 swfdec/swfdec_file_loader.c                |   98 
 swfdec/swfdec_file_loader.h                |   52 
 swfdec/swfdec_file_reference.c             |  139 +
 swfdec/swfdec_file_reference_list.c        |   33 
 swfdec/swfdec_filter.c                     |  124 +
 swfdec/swfdec_filter.h                     |   60 
 swfdec/swfdec_filter_as.c                  |   47 
 swfdec/swfdec_flv_decoder.c                |  595 +++++
 swfdec/swfdec_flv_decoder.h                |   83 
 swfdec/swfdec_font.c                       |  457 ++++
 swfdec/swfdec_font.h                       |   89 
 swfdec/swfdec_function_list.c              |  132 +
 swfdec/swfdec_function_list.h              |   50 
 swfdec/swfdec_glow_filter.c                |  162 +
 swfdec/swfdec_gradient_filter.c            |  243 ++
 swfdec/swfdec_gradient_pattern.c           |  129 +
 swfdec/swfdec_gradient_pattern.h           |   67 
 swfdec/swfdec_graphic.c                    |   71 
 swfdec/swfdec_graphic.h                    |   78 
 swfdec/swfdec_graphic_movie.c              |  113 +
 swfdec/swfdec_graphic_movie.h              |   51 
 swfdec/swfdec_image.c                      |  710 ++++++
 swfdec/swfdec_image.h                      |   84 
 swfdec/swfdec_image_decoder.c              |  131 +
 swfdec/swfdec_image_decoder.h              |   59 
 swfdec/swfdec_initialize.as                | 1521 +++++++++++++
 swfdec/swfdec_initialize.h                 | 2196 +++++++++++++++++++
 swfdec/swfdec_internal.h                   |   68 
 swfdec/swfdec_interval.c                   |  193 +
 swfdec/swfdec_interval.h                   |   80 
 swfdec/swfdec_key_as.c                     |   83 
 swfdec/swfdec_keys.h                       |  126 +
 swfdec/swfdec_load_object.c                |  259 ++
 swfdec/swfdec_load_object.h                |   76 
 swfdec/swfdec_load_object_as.c             |  141 +
 swfdec/swfdec_loader.c                     |  443 +++
 swfdec/swfdec_loader.h                     |   97 
 swfdec/swfdec_loader_internal.h            |   47 
 swfdec/swfdec_loadvars_as.c                |   46 
 swfdec/swfdec_local_connection.c           |   57 
 swfdec/swfdec_marshal.list                 |    6 
 swfdec/swfdec_microphone.c                 |   74 
 swfdec/swfdec_morph_movie.c                |  133 +
 swfdec/swfdec_morph_movie.h                |   54 
 swfdec/swfdec_morphshape.c                 |   96 
 swfdec/swfdec_morphshape.h                 |   53 
 swfdec/swfdec_mouse_as.c                   |   51 
 swfdec/swfdec_movie.c                      | 1820 ++++++++++++++++
 swfdec/swfdec_movie.h                      |  306 ++
 swfdec/swfdec_movie_as_drawing.c           |  456 ++++
 swfdec/swfdec_movie_asprops.c              |  484 ++++
 swfdec/swfdec_movie_clip_loader.c          |  127 +
 swfdec/swfdec_movie_clip_loader.h          |   51 
 swfdec/swfdec_net_connection.c             |  186 +
 swfdec/swfdec_net_connection.h             |   57 
 swfdec/swfdec_net_stream.c                 |  662 +++++
 swfdec/swfdec_net_stream.h                 |   99 
 swfdec/swfdec_net_stream_as.c              |  187 +
 swfdec/swfdec_path.c                       |  273 ++
 swfdec/swfdec_path.h                       |   67 
 swfdec/swfdec_pattern.c                    |  559 ++++
 swfdec/swfdec_pattern.h                    |   75 
 swfdec/swfdec_player.c                     | 3033 ++++++++++++++++++++++++++
 swfdec/swfdec_player.h                     |  177 +
 swfdec/swfdec_player_as.c                  |  367 +++
 swfdec/swfdec_player_internal.h            |  263 ++
 swfdec/swfdec_player_scripting.c           |   39 
 swfdec/swfdec_player_scripting.h           |   62 
 swfdec/swfdec_policy_file.c                |  350 +++
 swfdec/swfdec_policy_file.h                |   65 
 swfdec/swfdec_print_job.c                  |  130 +
 swfdec/swfdec_rect.c                       |  223 +
 swfdec/swfdec_rect.h                       |   51 
 swfdec/swfdec_rectangle.c                  |  203 +
 swfdec/swfdec_rectangle.h                  |   55 
 swfdec/swfdec_resource.c                   |  691 ++++++
 swfdec/swfdec_resource.h                   |   98 
 swfdec/swfdec_ringbuffer.c                 |  125 +
 swfdec/swfdec_ringbuffer.h                 |   59 
 swfdec/swfdec_sandbox.c                    |  303 ++
 swfdec/swfdec_sandbox.h                    |   83 
 swfdec/swfdec_script.c                     |  316 ++
 swfdec/swfdec_script.h                     |   38 
 swfdec/swfdec_script_internal.h            |   95 
 swfdec/swfdec_selection.c                  |   75 
 swfdec/swfdec_shape.c                      |  387 +++
 swfdec/swfdec_shape.h                      |   63 
 swfdec/swfdec_shape_parser.c               |  675 +++++
 swfdec/swfdec_shape_parser.h               |   48 
 swfdec/swfdec_shared_object.c              |   82 
 swfdec/swfdec_socket.c                     |   98 
 swfdec/swfdec_socket.h                     |   61 
 swfdec/swfdec_sound.c                      |  558 ++++
 swfdec/swfdec_sound.h                      |  107 
 swfdec/swfdec_sound_object.c               |  340 +++
 swfdec/swfdec_sound_object.h               |   54 
 swfdec/swfdec_sprite.c                     |  217 +
 swfdec/swfdec_sprite.h                     |  100 
 swfdec/swfdec_sprite_movie.c               |  883 +++++++
 swfdec/swfdec_sprite_movie.h               |   76 
 swfdec/swfdec_sprite_movie_as.c            |  891 +++++++
 swfdec/swfdec_stage_as.c                   |  246 ++
 swfdec/swfdec_stream.c                     |  427 +++
 swfdec/swfdec_stream.h                     |   71 
 swfdec/swfdec_stream_target.c              |  136 +
 swfdec/swfdec_stream_target.h              |   67 
 swfdec/swfdec_stroke.c                     |  361 +++
 swfdec/swfdec_stroke.h                     |   76 
 swfdec/swfdec_style_sheet.c                |  366 +++
 swfdec/swfdec_style_sheet.h                |   57 
 swfdec/swfdec_swf_decoder.c                |  487 ++++
 swfdec/swfdec_swf_decoder.h                |   98 
 swfdec/swfdec_system.c                     |  315 ++
 swfdec/swfdec_system.h                     |   76 
 swfdec/swfdec_system_as.c                  |  347 +++
 swfdec/swfdec_system_ime.c                 |   79 
 swfdec/swfdec_system_security.c            |  123 +
 swfdec/swfdec_tag.c                        |  628 +++++
 swfdec/swfdec_tag.h                        |  121 +
 swfdec/swfdec_text.c                       |  133 +
 swfdec/swfdec_text.h                       |   67 
 swfdec/swfdec_text_field.c                 |  198 +
 swfdec/swfdec_text_field.h                 |   93 
 swfdec/swfdec_text_field_movie.c           | 1627 ++++++++++++++
 swfdec/swfdec_text_field_movie.h           |  160 +
 swfdec/swfdec_text_field_movie_as.c        | 1539 +++++++++++++
 swfdec/swfdec_text_field_movie_html.c      |  777 ++++++
 swfdec/swfdec_text_format.c                | 1274 +++++++++++
 swfdec/swfdec_text_format.h                |  101 
 swfdec/swfdec_text_renderer.c              |   94 
 swfdec/swfdec_text_snapshot.c              |  109 
 swfdec/swfdec_transform.c                  |  121 +
 swfdec/swfdec_types.h                      |   63 
 swfdec/swfdec_url.c                        |  709 ++++++
 swfdec/swfdec_url.h                        |   69 
 swfdec/swfdec_utils.c                      |   74 
 swfdec/swfdec_utils.h                      |   40 
 swfdec/swfdec_video.c                      |  302 ++
 swfdec/swfdec_video.h                      |   61 
 swfdec/swfdec_video_movie.c                |  197 +
 swfdec/swfdec_video_movie.h                |   77 
 swfdec/swfdec_video_movie_as.c             |   94 
 swfdec/swfdec_xml.c                        |  940 ++++++++
 swfdec/swfdec_xml.h                        |   90 
 swfdec/swfdec_xml_node.c                   | 1113 +++++++++
 swfdec/swfdec_xml_node.h                   |  103 
 swfdec/swfdec_xml_socket.c                 |  245 ++
 swfdec/swfdec_xml_socket.h                 |   56 
 test/rtmp/rtmp_server.c                    |    2 
 test/sound/sound.c                         |   21 
 test/swfdec_test.c                         |    6 
 test/swfdec_test_function.h                |    2 
 test/swfdec_test_global.c                  |    2 
 test/swfdec_test_image.h                   |    2 
 test/swfdec_test_test.c                    |    7 
 test/swfdec_test_test.h                    |    2 
 test/various/gc.c                          |   12 
 test/various/ringbuffer.c                  |    2 
 tools/crashfinder.c                        |   20 
 tools/dump.c                               |   34 
 tools/swfdec-extract.c                     |   28 
 tools/swfdec_out.h                         |    6 
 tools/swfedit_file.c                       |    8 
 tools/swfedit_file.h                       |    2 
 tools/swfedit_tag.c                        |    8 
 tools/swfedit_tag.h                        |    4 
 tools/swfedit_token.c                      |    6 
 tools/swfedit_token.h                      |    2 
 tools/swfscript.c                          |    2 
 vivified/core/vivi_application.c           |   10 
 vivified/core/vivi_application.h           |    2 
 vivified/core/vivi_breakpoint.h            |    2 
 vivified/core/vivi_debugger.c              |    2 
 vivified/core/vivi_debugger.h              |    2 
 vivified/core/vivi_function.h              |    2 
 vivified/core/vivi_ming.h                  |    2 
 vivified/core/vivi_player_as.c             |    2 
 vivified/core/vivi_wrap.h                  |    2 
 vivified/ui/main.c                         |    2 
 vivified/ui/vivi_movie_list.c              |    4 
 vivified/ui/vivi_movies.c                  |    2 
 vivified/ui/vivi_player.c                  |    2 
 vivified/ui/vivi_widget.h                  |    2 
 vivified/ui/vivi_window.h                  |    2 
 618 files changed, 74195 insertions(+), 73949 deletions(-)

New commits:
commit 222cb3e42603590d7ca94d6d81aad941cc511c38
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Jan 25 16:53:05 2008 +0100

    set varaible before using it

diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c
index e9e50bc..419a6b8 100644
--- a/swfdec/swfdec_player.c
+++ b/swfdec/swfdec_player.c
@@ -3025,6 +3025,7 @@ swfdec_player_set_variables (SwfdecPlayer *player, const char *variables)
   g_return_if_fail (SWFDEC_IS_PLAYER (player));
   g_return_if_fail (player->priv->url == NULL);
 
+  priv = player->priv;
   g_free (priv->variables);
   priv->variables = g_strdup (variables);
   g_object_notify (G_OBJECT (player), "variables");
commit e142c2e56c24ab42a91f9519fd9a8dbfd8cf043e
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Jan 25 14:00:36 2008 +0100

    skip events for uninitialized movies

diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index 278a067..10662c5 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -526,6 +526,11 @@ swfdec_movie_queue_script (SwfdecMovie *movie, SwfdecEventType condition)
 
   if (!SWFDEC_IS_SPRITE_MOVIE (movie) && !SWFDEC_IS_BUTTON_MOVIE (movie))
     return;
+  /* can happen for mouse/keyboard events on the initial movie */
+  if (movie->resource->sandbox == NULL) {
+    SWFDEC_INFO ("movie %s not yet initialized, skipping event", movie->name);
+    return;
+  }
 
   switch (condition) {
     case SWFDEC_EVENT_INITIALIZE:
commit c3f1a527ce2f222d140bc77554ecec42232010ad
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Jan 25 13:57:25 2008 +0100

    use the right private object
    
    Oops, stupid copy/paste errors

diff --git a/swfdec-gtk/swfdec_gtk_player.c b/swfdec-gtk/swfdec_gtk_player.c
index f8f9d5c..42fc01b 100644
--- a/swfdec-gtk/swfdec_gtk_player.c
+++ b/swfdec-gtk/swfdec_gtk_player.c
@@ -149,7 +149,7 @@ swfdec_gtk_player_init (SwfdecGtkPlayer * player)
 {
   SwfdecGtkPlayerPrivate *priv;
 
-  player->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (player, SWFDEC_TYPE_PLAYER, SwfdecGtkPlayerPrivate);
+  player->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (player, SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayerPrivate);
 
   priv->speed = 1.0;
   priv->audio_enabled = TRUE;
commit 5d70b97559f75125f9a310b41360ff350140b5f8
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Jan 25 10:57:46 2008 +0100

    initialize url and base-url properties before requesting the first loader
    
    This allows the loader to access these values

diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c
index 2795d82..e9e50bc 100644
--- a/swfdec/swfdec_player.c
+++ b/swfdec/swfdec_player.c
@@ -2971,13 +2971,15 @@ swfdec_player_set_url (SwfdecPlayer *player, const SwfdecURL *url)
   g_object_freeze_notify (G_OBJECT (player));
   priv = player->priv;
   priv->url = swfdec_url_copy (url);
-  loader = swfdec_player_load (player, swfdec_url_get_url (url), 
-      SWFDEC_LOADER_REQUEST_DEFAULT, NULL);
-  priv->resource = swfdec_resource_new (player, loader, priv->variables);
   if (priv->base_url == NULL) {
-    priv->base_url = swfdec_url_new_parent (swfdec_loader_get_url (loader));
+    priv->base_url = swfdec_url_new_parent (url);
     g_object_notify (G_OBJECT (player), "base-url");
   }
+  /* we initialize url and base_url before requesting the loader, so the loader
+   * can query them */
+  loader = swfdec_player_load (player, swfdec_url_get_url (url), 
+      SWFDEC_LOADER_REQUEST_DEFAULT, NULL);
+  priv->resource = swfdec_resource_new (player, loader, priv->variables);
   movie = swfdec_movie_new (player, -16384, NULL, priv->resource, NULL, SWFDEC_AS_STR__level0);
   movie->name = SWFDEC_AS_STR_EMPTY;
   g_object_unref (loader);
commit 66074294ab0f9d0f4908223ecfaa41f2a3bd6c3d
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jan 24 20:54:58 2008 +0100

    make SwfdecGtkPlayer subclassable

diff --git a/swfdec-gtk/swfdec_gtk_player.c b/swfdec-gtk/swfdec_gtk_player.c
index 71ff829..f8f9d5c 100644
--- a/swfdec-gtk/swfdec_gtk_player.c
+++ b/swfdec-gtk/swfdec_gtk_player.c
@@ -27,21 +27,14 @@
 #include "swfdec-gtk/swfdec_playback.h"
 #include "swfdec-gtk/swfdec_source.h"
 
-struct _SwfdecGtkPlayer
+struct _SwfdecGtkPlayerPrivate
 {
-  SwfdecPlayer		player;
-
   GSource *		source;		/* source if playing, NULL otherwise */
   SwfdecPlayback *	playback;	/* audio playback object */
   gboolean		audio_enabled;	/* TRUE if audio should be played */
   double		speed;		/* desired playback speed */
 };
 
-struct _SwfdecGtkPlayerClass
-{
-  SwfdecPlayerClass   	player_class;
-};
-
 enum {
   PROP_0,
   PROP_PLAYING,
@@ -78,17 +71,17 @@ static void
 swfdec_gtk_player_get_property (GObject *object, guint param_id, GValue *value, 
     GParamSpec * pspec)
 {
-  SwfdecGtkPlayer *player = SWFDEC_GTK_PLAYER (object);
+  SwfdecGtkPlayerPrivate *priv = SWFDEC_GTK_PLAYER (object)->priv;
   
   switch (param_id) {
     case PROP_PLAYING:
-      g_value_set_boolean (value, player->source != NULL);
+      g_value_set_boolean (value, priv->source != NULL);
       break;
     case PROP_AUDIO:
-      g_value_set_boolean (value, player->audio_enabled);
+      g_value_set_boolean (value, priv->audio_enabled);
       break;
     case PROP_SPEED:
-      g_value_set_double (value, player->speed);
+      g_value_set_double (value, priv->speed);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -124,7 +117,7 @@ swfdec_gtk_player_dispose (GObject *object)
   SwfdecGtkPlayer *player = SWFDEC_GTK_PLAYER (object);
 
   swfdec_gtk_player_set_playing (player, FALSE);
-  g_assert (player->playback == NULL);
+  g_assert (player->priv->playback == NULL);
 
   G_OBJECT_CLASS (swfdec_gtk_player_parent_class)->dispose (object);
 }
@@ -134,6 +127,8 @@ swfdec_gtk_player_class_init (SwfdecGtkPlayerClass * g_class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (g_class);
 
+  g_type_class_add_private (g_class, sizeof (SwfdecGtkPlayerPrivate));
+
   object_class->dispose = swfdec_gtk_player_dispose;
   object_class->get_property = swfdec_gtk_player_get_property;
   object_class->set_property = swfdec_gtk_player_set_property;
@@ -152,8 +147,12 @@ swfdec_gtk_player_class_init (SwfdecGtkPlayerClass * g_class)
 static void
 swfdec_gtk_player_init (SwfdecGtkPlayer * player)
 {
-  player->speed = 1.0;
-  player->audio_enabled = TRUE;
+  SwfdecGtkPlayerPrivate *priv;
+
+  player->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (player, SWFDEC_TYPE_PLAYER, SwfdecGtkPlayerPrivate);
+
+  priv->speed = 1.0;
+  priv->audio_enabled = TRUE;
 }
 
 /*** PUBLIC API ***/
@@ -183,17 +182,18 @@ swfdec_gtk_player_new (SwfdecAsDebugger *debugger)
 static void
 swfdec_gtk_player_update_audio (SwfdecGtkPlayer *player)
 {
-  gboolean should_play = player->audio_enabled;
+  SwfdecGtkPlayerPrivate *priv = player->priv;
+  gboolean should_play = priv->audio_enabled;
   
-  should_play &= (player->source != NULL);
-  should_play &= (player->speed == 1.0);
+  should_play &= (priv->source != NULL);
+  should_play &= (priv->speed == 1.0);
 
-  if (should_play && player->playback == NULL) {
-    player->playback = swfdec_playback_open (SWFDEC_PLAYER (player),
+  if (should_play && priv->playback == NULL) {
+    priv->playback = swfdec_playback_open (SWFDEC_PLAYER (player),
 	g_main_context_default ());
-  } else if (!should_play && player->playback != NULL) {
-    swfdec_playback_close (player->playback);
-    player->playback = NULL;
+  } else if (!should_play && priv->playback != NULL) {
+    swfdec_playback_close (priv->playback);
+    priv->playback = NULL;
   }
 }
 
@@ -209,15 +209,18 @@ swfdec_gtk_player_update_audio (SwfdecGtkPlayer *player)
 void
 swfdec_gtk_player_set_playing (SwfdecGtkPlayer *player, gboolean playing)
 {
+  SwfdecGtkPlayerPrivate *priv;
+
   g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
 
-  if (playing && player->source == NULL) {
-    player->source = swfdec_iterate_source_new (SWFDEC_PLAYER (player), player->speed);
-    g_source_attach (player->source, NULL);
-  } else if (!playing && player->source != NULL) {
-    g_source_destroy (player->source);
-    g_source_unref (player->source);
-    player->source = NULL;
+  priv = player->priv;
+  if (playing && priv->source == NULL) {
+    priv->source = swfdec_iterate_source_new (SWFDEC_PLAYER (player), priv->speed);
+    g_source_attach (priv->source, NULL);
+  } else if (!playing && priv->source != NULL) {
+    g_source_destroy (priv->source);
+    g_source_unref (priv->source);
+    priv->source = NULL;
   }
   swfdec_gtk_player_update_audio (player);
   g_object_notify (G_OBJECT (player), "playing");
@@ -236,7 +239,7 @@ swfdec_gtk_player_get_playing (SwfdecGtkPlayer *player)
 {
   g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
 
-  return player->source != NULL;
+  return player->priv->source != NULL;
 }
 
 /**
@@ -251,9 +254,9 @@ swfdec_gtk_player_set_audio_enabled (SwfdecGtkPlayer *player, gboolean enabled)
 {
   g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
 
-  if (player->audio_enabled == enabled)
+  if (player->priv->audio_enabled == enabled)
     return;
-  player->audio_enabled = enabled;
+  player->priv->audio_enabled = enabled;
   swfdec_gtk_player_update_audio (player);
   g_object_notify (G_OBJECT (player), "audio-enabled");
 }
@@ -271,7 +274,7 @@ swfdec_gtk_player_get_audio_enabled (SwfdecGtkPlayer *player)
 {
   g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
 
-  return player->audio_enabled;
+  return player->priv->audio_enabled;
 }
 
 /**
@@ -290,10 +293,10 @@ swfdec_gtk_player_set_speed (SwfdecGtkPlayer *player, double speed)
   g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
   g_return_if_fail (speed > 0.0);
 
-  player->speed = speed;
+  player->priv->speed = speed;
   swfdec_gtk_player_update_audio (player);
-  if (player->source)
-    swfdec_iterate_source_set_speed (player->source, player->speed);
+  if (player->priv->source)
+    swfdec_iterate_source_set_speed (player->priv->source, player->priv->speed);
   g_object_notify (G_OBJECT (player), "speed");
 }
 
@@ -311,5 +314,5 @@ swfdec_gtk_player_get_speed (SwfdecGtkPlayer *player)
 {
   g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
 
-  return player->speed;
+  return player->priv->speed;
 }
diff --git a/swfdec-gtk/swfdec_gtk_player.h b/swfdec-gtk/swfdec_gtk_player.h
index dd4b51d..4abef90 100644
--- a/swfdec-gtk/swfdec_gtk_player.h
+++ b/swfdec-gtk/swfdec_gtk_player.h
@@ -25,6 +25,7 @@
 G_BEGIN_DECLS
 
 typedef struct _SwfdecGtkPlayer SwfdecGtkPlayer;
+typedef struct _SwfdecGtkPlayerPrivate SwfdecGtkPlayerPrivate;
 typedef struct _SwfdecGtkPlayerClass SwfdecGtkPlayerClass;
 
 #define SWFDEC_TYPE_GTK_PLAYER                    (swfdec_gtk_player_get_type())
@@ -34,6 +35,18 @@ typedef struct _SwfdecGtkPlayerClass SwfdecGtkPlayerClass;
 #define SWFDEC_GTK_PLAYER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayerClass))
 #define SWFDEC_GTK_PLAYER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayerClass))
 
+struct _SwfdecGtkPlayer
+{
+  SwfdecPlayer	  		player;
+
+  SwfdecGtkPlayerPrivate *	priv;
+};
+
+struct _SwfdecGtkPlayerClass
+{
+  SwfdecPlayerClass     	player_class;
+};
+
 GType 		swfdec_gtk_player_get_type    	(void);
 
 SwfdecPlayer *	swfdec_gtk_player_new	      	(SwfdecAsDebugger *	debugger);
commit f30a1b7475cdf50938d830926e65cc9e9588874a
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jan 24 16:42:52 2008 +0100

    port to libsoup 2.4

diff --git a/configure.ac b/configure.ac
index 2d34a55..02281c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,7 +107,7 @@ dnl
 GTK_VER=2.8.0
 AC_SUBST(GTK_VER)
 if test "$enable_gtk" = "yes"; then
-	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER libsoup-2.2 >= 2.2.0, HAVE_GTK=yes)
+	PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER libsoup-2.4, HAVE_GTK=yes)
 	AC_DEFINE(HAVE_GTK, 1, [Define if Gtk is enabled])
 else
 	AC_MSG_NOTICE([Gtk support was not enabled.])
diff --git a/swfdec-gtk/swfdec_gtk_loader.c b/swfdec-gtk/swfdec_gtk_loader.c
index 375ca60..ec6d78f 100644
--- a/swfdec-gtk/swfdec_gtk_loader.c
+++ b/swfdec-gtk/swfdec_gtk_loader.c
@@ -68,22 +68,6 @@ struct _SwfdecGtkLoaderClass {
 G_DEFINE_TYPE (SwfdecGtkLoader, swfdec_gtk_loader, SWFDEC_TYPE_FILE_LOADER)
 
 static void
-swfdec_gtk_loader_set_size (SwfdecGtkLoader *gtk)
-{
-  const char *s = soup_message_get_header (gtk->message->response_headers, "Content-Length");
-  unsigned long l;
-  char *end;
-
-  if (s == NULL)
-    return;
-
-  errno = 0;
-  l = strtoul (s, &end, 10);
-  if (errno == 0 && *end == 0 && l <= G_MAXLONG)
-    swfdec_loader_set_size (SWFDEC_LOADER (gtk), l);
-}
-
-static void
 swfdec_gtk_loader_ensure_open (SwfdecGtkLoader *gtk)
 {
   char *real_uri;
@@ -92,25 +76,39 @@ swfdec_gtk_loader_ensure_open (SwfdecGtkLoader *gtk)
     return;
 
   real_uri = soup_uri_to_string (soup_message_get_uri (gtk->message), FALSE);
-  swfdec_gtk_loader_set_size (gtk);
   swfdec_loader_set_url (SWFDEC_LOADER (gtk), real_uri);
+  g_free (real_uri);
+  if (soup_message_headers_get_encoding (gtk->message->response_headers) == SOUP_ENCODING_CONTENT_LENGTH) {
+    swfdec_loader_set_size (SWFDEC_LOADER (gtk), 
+	soup_message_headers_get_content_length (gtk->message->response_headers));
+  }
   swfdec_stream_open (SWFDEC_STREAM (gtk));
   gtk->opened = TRUE;
-  g_free (real_uri);
 }
 
 static void
-swfdec_gtk_loader_push (SoupMessage *msg, gpointer loader)
+swfdec_gtk_loader_free_soup_buffer (unsigned char *data, gpointer chunk)
+{
+  soup_buffer_free (chunk);
+}
+
+static void
+swfdec_gtk_loader_push (SoupMessage *msg, SoupBuffer *chunk, gpointer loader)
 {
   SwfdecGtkLoader *gtk = SWFDEC_GTK_LOADER (loader);
   SwfdecBuffer *buffer;
 
+  chunk = soup_buffer_copy (chunk);
+
   swfdec_gtk_loader_ensure_open (gtk);
-  buffer = swfdec_buffer_new_and_alloc (msg->response.length);
-  memcpy (buffer->data, msg->response.body, msg->response.length);
+  buffer = swfdec_buffer_new ();
+  buffer->data = (unsigned char *) chunk->data;
+  buffer->length = chunk->length;
+  buffer->priv = chunk;
+  buffer->free = swfdec_gtk_loader_free_soup_buffer;
   swfdec_stream_push (loader, buffer);
 }
-
+  
 static void
 swfdec_gtk_loader_finished (SoupMessage *msg, gpointer loader)
 {
@@ -167,8 +165,8 @@ swfdec_gtk_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
     g_signal_connect (gtk->message, "got-chunk", G_CALLBACK (swfdec_gtk_loader_push), gtk);
     g_signal_connect (gtk->message, "finished", G_CALLBACK (swfdec_gtk_loader_finished), gtk);
     if (buffer)
-      soup_message_set_request (gtk->message, "appliation/x-www-urlencoded",
-	  SOUP_BUFFER_USER_OWNED, (char *) buffer->data, buffer->length);
+      soup_message_set_request (gtk->message, "appliation/x-www-form-urlencoded",
+	  SOUP_MEMORY_COPY, (char *) buffer->data, buffer->length);
     g_object_ref (gtk->message);
     soup_session_queue_message (klass->session, gtk->message, NULL, NULL);
   }
@@ -187,7 +185,7 @@ swfdec_gtk_loader_close (SwfdecStream *stream)
     if (!eof) {
       SwfdecGtkLoaderClass *klass = SWFDEC_GTK_LOADER_GET_CLASS (gtk);
 
-      soup_session_cancel_message (klass->session, gtk->message);
+      soup_session_cancel_message (klass->session, gtk->message, SOUP_STATUS_CANCELLED);
       g_object_unref (gtk->message);
       gtk->message = NULL;
     }
diff --git a/swfdec-gtk/swfdec_gtk_socket.c b/swfdec-gtk/swfdec_gtk_socket.c
index 03bedd9..8385cf1 100644
--- a/swfdec-gtk/swfdec_gtk_socket.c
+++ b/swfdec-gtk/swfdec_gtk_socket.c
@@ -70,12 +70,12 @@ swfdec_gtk_socket_close (SwfdecStream *stream)
 }
 
 static void
-swfdec_gtk_socket_do_connect (SoupSocket *sock, int status, SwfdecGtkSocket *gtk)
+swfdec_gtk_socket_do_connect (SoupSocket *sock, guint status, gpointer gtk)
 {
   if (SOUP_STATUS_IS_SUCCESSFUL (status))
-    swfdec_stream_open (SWFDEC_STREAM (gtk));
+    swfdec_stream_open (gtk);
   else
-    swfdec_stream_error (SWFDEC_STREAM (gtk), "error connecting");
+    swfdec_stream_error (gtk, "error connecting");
 
 }
 
@@ -92,10 +92,12 @@ swfdec_gtk_socket_do_read (SoupSocket *sock, SwfdecGtkSocket *gtk)
   SwfdecBuffer *buffer;
   SoupSocketIOStatus status;
   gsize len;
+  GError *error = NULL;
 
   do {
     buffer = swfdec_buffer_new_and_alloc (SWFDEC_GTK_SOCKET_BLOCK_SIZE);
-    status = soup_socket_read (sock, buffer, SWFDEC_GTK_SOCKET_BLOCK_SIZE, &len);
+    status = soup_socket_read (sock, buffer, SWFDEC_GTK_SOCKET_BLOCK_SIZE, 
+	&len, NULL, &error);
     buffer->length = len;
     switch (status) {
       case SOUP_SOCKET_OK:
@@ -107,7 +109,8 @@ swfdec_gtk_socket_do_read (SoupSocket *sock, SwfdecGtkSocket *gtk)
 	break;
       case SOUP_SOCKET_ERROR:
 	swfdec_buffer_unref (buffer);
-	swfdec_stream_error (SWFDEC_STREAM (gtk), "error reading data");
+	swfdec_stream_error (SWFDEC_STREAM (gtk), "%s", error->message);
+	g_error_free (error);
 	break;
       default:
 	g_warning ("unhandled status code %u from soup_socket_read()", (guint) status);
@@ -121,11 +124,13 @@ swfdec_gtk_socket_do_write (SoupSocket *sock, SwfdecGtkSocket *gtk)
 {
   SwfdecBuffer *buffer;
   SoupSocketIOStatus status;
+  GError *error = NULL;
   gsize len;
 
   gtk->sock_writable = TRUE;
   while ((buffer = swfdec_buffer_queue_peek_buffer (gtk->queue))) {
-    status = soup_socket_write (sock, buffer->data, buffer->length, &len);
+    status = soup_socket_write (sock, buffer->data, buffer->length, 
+	&len, NULL, &error);
     swfdec_buffer_unref (buffer);
     switch (status) {
       case SOUP_SOCKET_OK:
@@ -137,8 +142,9 @@ swfdec_gtk_socket_do_write (SoupSocket *sock, SwfdecGtkSocket *gtk)
 	gtk->sock_writable = FALSE;
 	break;
       case SOUP_SOCKET_ERROR:
-	swfdec_stream_error (SWFDEC_STREAM (gtk), "error writing data");
-	break;
+	swfdec_stream_error (SWFDEC_STREAM (gtk), "%s", error->message);
+	g_error_free (error);
+	return;
       default:
 	g_warning ("unhandled status code %u from soup_socket_read()", (guint) status);
 	break;
@@ -156,17 +162,14 @@ swfdec_gtk_socket_connect (SwfdecSocket *sock_, SwfdecPlayer *player,
   addr = soup_address_new (hostname, port);
   sock->sock = soup_socket_new (
       SOUP_SOCKET_FLAG_NONBLOCKING, TRUE,
-      /* FIXME: we should set nodelay, no? */
-      SOUP_SOCKET_FLAG_NODELAY, TRUE, NULL);
-  g_signal_connect (sock->sock, "connect-result", 
-      G_CALLBACK (swfdec_gtk_socket_do_connect), socket);
+      SOUP_SOCKET_REMOTE_ADDRESS, addr, NULL);
   g_signal_connect (sock->sock, "disconnect", 
       G_CALLBACK (swfdec_gtk_socket_do_disconnect), socket);
   g_signal_connect (sock->sock, "readable", 
       G_CALLBACK (swfdec_gtk_socket_do_read), socket);
   g_signal_connect (sock->sock, "writable", 
       G_CALLBACK (swfdec_gtk_socket_do_write), socket);
-  soup_socket_connect (sock->sock, addr);
+  soup_socket_connect_async (sock->sock, NULL, swfdec_gtk_socket_do_connect, sock);
 }
 
 static void
commit a61fbe67383e2395da7c3f83c82c5126af326d57
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jan 24 16:02:31 2008 +0100

    make SwfdecSocket creation work like SwfdecLoader creation
    
    This allows for better subclassing

diff --git a/swfdec-gtk/swfdec_gtk_socket.c b/swfdec-gtk/swfdec_gtk_socket.c
index 08cbb76..03bedd9 100644
--- a/swfdec-gtk/swfdec_gtk_socket.c
+++ b/swfdec-gtk/swfdec_gtk_socket.c
@@ -146,14 +146,16 @@ swfdec_gtk_socket_do_write (SoupSocket *sock, SwfdecGtkSocket *gtk)
   };
 }
 
-static SwfdecSocket *
-swfdec_gtk_socket_create (const char *hostname, guint port)
+static void
+swfdec_gtk_socket_connect (SwfdecSocket *sock_, SwfdecPlayer *player, 
+    const char *hostname, guint port)
 {
-  SwfdecGtkSocket *sock = g_object_new (SWFDEC_TYPE_GTK_SOCKET, NULL);
+  SwfdecGtkSocket *sock = SWFDEC_GTK_SOCKET (sock_);
   SoupAddress *addr;
 
   addr = soup_address_new (hostname, port);
-  sock->sock = soup_socket_new (SOUP_SOCKET_FLAG_NONBLOCKING, TRUE,
+  sock->sock = soup_socket_new (
+      SOUP_SOCKET_FLAG_NONBLOCKING, TRUE,
       /* FIXME: we should set nodelay, no? */
       SOUP_SOCKET_FLAG_NODELAY, TRUE, NULL);
   g_signal_connect (sock->sock, "connect-result", 
@@ -164,8 +166,7 @@ swfdec_gtk_socket_create (const char *hostname, guint port)
       G_CALLBACK (swfdec_gtk_socket_do_read), socket);
   g_signal_connect (sock->sock, "writable", 
       G_CALLBACK (swfdec_gtk_socket_do_write), socket);
-
-  return SWFDEC_SOCKET (sock);
+  soup_socket_connect (sock->sock, addr);
 }
 
 static void
@@ -207,7 +208,7 @@ swfdec_gtk_socket_class_init (SwfdecGtkSocketClass *klass)
 
   stream_class->close = swfdec_gtk_socket_close;
 
-  socket_class->create = swfdec_gtk_socket_create;
+  socket_class->connect = swfdec_gtk_socket_connect;
   socket_class->send = swfdec_gtk_socket_send;
 }
 
diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c
index 5b996ef..2795d82 100644
--- a/swfdec/swfdec_player.c
+++ b/swfdec/swfdec_player.c
@@ -2151,9 +2151,9 @@ swfdec_player_create_socket (SwfdecPlayer *player, const char *hostname, guint p
     SWFDEC_INFO ("can't create socket, no socket type set.");
     return NULL;
   }
-  klass = g_type_class_ref (player->priv->socket_type);
-  sock = klass->create (hostname, port);
-  g_type_class_unref (klass);
+  sock = g_object_new (player->priv->socket_type, NULL);
+  klass = SWFDEC_SOCKET_GET_CLASS (sock);
+  klass->connect (sock, player, hostname, port);
 
   return sock;
 }
diff --git a/swfdec/swfdec_socket.c b/swfdec/swfdec_socket.c
index c02c790..19f47aa 100644
--- a/swfdec/swfdec_socket.c
+++ b/swfdec/swfdec_socket.c
@@ -51,10 +51,9 @@
 
 /**
  * SwfdecSocketClass:
- * @create: Create a new socket for the given hostname and port. This function 
- *          must return a new socket, returning %NULL is not allowed. If you
- *          encounter an error, create a new socket and call 
- *          swfdec_stream_error() on it.
+ * @connect: Connect the given newly created socket to the given hostname and 
+ *           port. If you encounter an error, call swfdec_stream_error(), but 
+ *           still make sure the socket object does not break.
  * @send: Called to send data down the given socket. This function will only be
  *        called when the socket is open. You get passed a reference to the 
  *        buffer, so it is your responsibility to call swfdec_buffer_unref() on
diff --git a/swfdec/swfdec_socket.h b/swfdec/swfdec_socket.h
index ca750af..6b43f22 100644
--- a/swfdec/swfdec_socket.h
+++ b/swfdec/swfdec_socket.h
@@ -22,6 +22,7 @@
 
 #include <glib-object.h>
 #include <swfdec/swfdec_stream.h>
+#include <swfdec/swfdec_player.h>
 
 G_BEGIN_DECLS
 
@@ -44,7 +45,9 @@ struct _SwfdecSocketClass
 {
   SwfdecStreamClass   	stream_class;
 
-  SwfdecSocket *	(* create)		(const char *	hostname,
+  void			(* connect)		(SwfdecSocket *	socket,
+						 SwfdecPlayer *	player,
+						 const char *	hostname,
 						 guint		port);
 
   void			(* send)		(SwfdecSocket *	socket,
commit 4fe9f9476eb098ae6381e196647d0d00bdda9715
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jan 24 15:38:06 2008 +0100

    s/libswfdec/swfdec part 2
    
    I didn't want to do it in 1 part, otherwise the renames wouldn't have been
    renames

diff --git a/Makefile.am b/Makefile.am
index d13fae6..012b3e7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 if WITH_GTK
 GTK_SUBDIRS = \
-	libswfdec-gtk \
+	swfdec-gtk \
 	doc \
 	player
 else
@@ -14,7 +14,7 @@ VIVI_SUBDIRS =
 endif
 
 SUBDIRS= \
-	libswfdec \
+	swfdec \
 	$(GTK_SUBDIRS) \
 	$(VIVI_SUBDIRS) \
 	data \
diff --git a/README b/README
index 60130b9..3c51157 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ Swfdec is a decoder/renderer for Macromedia Flash animations. The decoding and
 rendering engine is provided in a library that can be used by other 
 applications.  
 
-An additional library named libswfdec-gtk is provided for easy integration of
+An additional library named swfdec-gtk is provided for easy integration of
 Swfdec into Gtk applications. This library is what developers most likely want 
 to target their applications at. Building this library can be disabled.
 
@@ -14,8 +14,8 @@ it crashes. If you encounter such a crash however, make sure to file a bug
 immediately.
 
 Swfdec contains some applications for testing and debugging the library. These 
-are available in the player/ and test/ directory. They are not installed. Most 
-of them require the libswfdec-gtk library.
+are available in the player/, test/ and tools/ directories. They are not 
+installed. Most of them require the swfdec-gtk library.
 
 The test/ directory contains subdirectories that run automated tests with the 
 provided SWF files in the directory. See the README files in those directories
@@ -69,7 +69,7 @@ Dependencies:
   GStreamer (>= 0.10.11 - optional, required for various audio and video formats)
   MAD (>= 0.15.1b - optional, required for MP3 audio format support)
 
-  GTK+ (>= 2.8.0 - used by libswfdec-gtk)
-  ALSA (>= 1.0 - used by libswfdec-gtk)
+  GTK+ (>= 2.8.0 - used by swfdec-gtk)
+  ALSA (>= 1.0 - optional, required for sound output by swfdec-gtk)
 
 
diff --git a/configure.ac b/configure.ac
index 2690e2f..2d34a55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,7 +97,7 @@ AC_SUBST(PANGO_CFLAGS)
 
 AC_ARG_ENABLE(gtk,
 	AS_HELP_STRING([--enable-gtk],
-			[enable build of libswfdec-gtk (default=yes)])],
+			[enable build of swfdec-gtk (default=yes)])],
 	enable_gtk=$enableval,
 	enable_gtk="yes")
 
@@ -287,12 +287,12 @@ AC_SUBST(GLOBAL_CFLAGS)
 AC_SUBST(GLOBAL_CFLAGS)
 
 SWFDEC_CFLAGS="-I\$(top_srcdir) $GLIB_CFLAGS $CAIRO_CFLAGS"
-SWFDEC_LIBS="\$(top_builddir)/libswfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz"
+SWFDEC_LIBS="\$(top_builddir)/swfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz"
 AC_SUBST(SWFDEC_LIBS)
 AC_SUBST(SWFDEC_CFLAGS)
 
 SWFDEC_GTK_CFLAGS="$SWFDEC_CFLAGS $GTK_CFLAGS"
-SWFDEC_GTK_LIBS="\$(top_builddir)/libswfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"
+SWFDEC_GTK_LIBS="\$(top_builddir)/swfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"
 AC_SUBST(SWFDEC_GTK_LIBS)
 AC_SUBST(SWFDEC_GTK_CFLAGS)
 
@@ -325,9 +325,9 @@ data/icons/scalable/Makefile
 data/swfdec.pc
 data/swfdec-gtk.pc
 doc/Makefile
-libswfdec/Makefile
-libswfdec/jpeg/Makefile
-libswfdec-gtk/Makefile
+swfdec/Makefile
+swfdec/jpeg/Makefile
+swfdec-gtk/Makefile
 player/Makefile
 test/Makefile
 test/custom/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d7e384b..37f9fb4 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -18,7 +18,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
 # gtk-doc will search all .c & .h files beneath here for inline comments
 # documenting the functions and macros.
 # e.g. DOC_SOURCE_DIR=../../../gtk
-DOC_SOURCE_DIR=../libswfdec
+DOC_SOURCE_DIR=../swfdec
 
 # Extra options to pass to gtkdoc-scangobj. Not normally needed.
 SCANGOBJ_OPTIONS=--type-init-func="swfdec_init();"
@@ -29,7 +29,7 @@ SCAN_OPTIONS=
 
 # Extra options to supply to gtkdoc-mkdb.
 # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
-MKDB_OPTIONS=--sgml-mode --output-format=xml --source-dir=../libswfdec-gtk
+MKDB_OPTIONS=--sgml-mode --output-format=xml --source-dir=../swfdec-gtk
 
 # Extra options to supply to gtkdoc-mktmpl
 # e.g. MKTMPL_OPTIONS=--only-section-tmpl
@@ -42,8 +42,8 @@ FIXXREF_OPTIONS=
 # Used for dependencies. The docs will be rebuilt if any of these change.
 # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
 # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
-HFILE_GLOB=$(top_srcdir)/libswfdec/*.h $(top_srcdir)/libswfdec-gtk/*.h
-CFILE_GLOB=$(top_srcdir)/libswfdec/*.c $(top_srcdir)/libswfdec-gtk/*.c
+HFILE_GLOB=$(top_srcdir)/swfdec/*.h $(top_srcdir)/swfdec-gtk/*.h
+CFILE_GLOB=$(top_srcdir)/swfdec/*.c $(top_srcdir)/swfdec-gtk/*.c
 
 # Header files to ignore when scanning.
 # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
@@ -146,10 +146,10 @@ IGNORE_HFILES= \
 
 if WITH_GTK
 EXTRA_HFILES = \
-	../libswfdec-gtk/swfdec_gtk_keys.h \
-	../libswfdec-gtk/swfdec_gtk_loader.h \
-	../libswfdec-gtk/swfdec_gtk_player.h \
-	../libswfdec-gtk/swfdec_gtk_widget.h
+	../swfdec-gtk/swfdec_gtk_keys.h \
+	../swfdec-gtk/swfdec_gtk_loader.h \
+	../swfdec-gtk/swfdec_gtk_player.h \
+	../swfdec-gtk/swfdec_gtk_widget.h
 else
 EXTRA_HFILES =
 endif
diff --git a/doc/swfdec.types b/doc/swfdec.types
index c89c6d5..4ef3276 100644
--- a/doc/swfdec.types
+++ b/doc/swfdec.types
@@ -1,5 +1,5 @@
-#include <libswfdec/swfdec.h>
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec/swfdec.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 
 swfdec_as_context_get_type
 swfdec_as_object_get_type
diff --git a/player/swfdec_debug_script.h b/player/swfdec_debug_script.h
index 7c8bb5e..318a3be 100644
--- a/player/swfdec_debug_script.h
+++ b/player/swfdec_debug_script.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_DEBUG_SCRIPT_H_
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec_debugger.h>
+#include <swfdec/swfdec_debugger.h>
 
 G_BEGIN_DECLS
 
diff --git a/player/swfdec_debug_scripts.c b/player/swfdec_debug_scripts.c
index 14471c3..b845f84 100644
--- a/player/swfdec_debug_scripts.c
+++ b/player/swfdec_debug_scripts.c
@@ -22,7 +22,7 @@
 #endif
 
 #include "swfdec_debug_scripts.h"
-#include <libswfdec/swfdec_script_internal.h>
+#include <swfdec/swfdec_script_internal.h>
 
 G_DEFINE_TYPE (SwfdecDebugScripts, swfdec_debug_scripts, GTK_TYPE_TREE_VIEW)
 
diff --git a/player/swfdec_debug_scripts.h b/player/swfdec_debug_scripts.h
index b16dcc8..bfb65ff 100644
--- a/player/swfdec_debug_scripts.h
+++ b/player/swfdec_debug_scripts.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_DEBUG_SCRIPTS_H_
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec_debugger.h>
+#include <swfdec/swfdec_debugger.h>
 
 G_BEGIN_DECLS
 
diff --git a/player/swfdec_debug_stack.c b/player/swfdec_debug_stack.c
index fa70b56..452ec0b 100644
--- a/player/swfdec_debug_stack.c
+++ b/player/swfdec_debug_stack.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include "swfdec_debug_stack.h"
 
 G_DEFINE_TYPE (SwfdecDebugStack, swfdec_debug_stack, GTK_TYPE_TREE_VIEW)
diff --git a/player/swfdec_player_manager.c b/player/swfdec_player_manager.c
index 7eb1edc..9d67709 100644
--- a/player/swfdec_player_manager.c
+++ b/player/swfdec_player_manager.c
@@ -23,11 +23,11 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <libswfdec/swfdec_debugger.h>
-#include <libswfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_debugger.h>
+#include <swfdec/swfdec_as_object.h>
 #include "swfdec_player_manager.h"
-#include <libswfdec/swfdec_script_internal.h>
-#include <libswfdec-gtk/swfdec_source.h>
+#include <swfdec/swfdec_script_internal.h>
+#include <swfdec-gtk/swfdec_source.h>
 
 enum {
   PROP_0,
diff --git a/player/swfdec_player_manager.h b/player/swfdec_player_manager.h
index d68ef3e..31e99a4 100644
--- a/player/swfdec_player_manager.h
+++ b/player/swfdec_player_manager.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_PLAYER_MANAGER_H_
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_debugger.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_debugger.h>
 
 G_BEGIN_DECLS
 
diff --git a/player/swfplay.c b/player/swfplay.c
index 7f98bbe..1db23f3 100644
--- a/player/swfplay.c
+++ b/player/swfplay.c
@@ -22,9 +22,9 @@
 #endif
 #include <gtk/gtk.h>
 #include <math.h>
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 
 static GMainLoop *loop = NULL;
 
diff --git a/swfdec-gtk/Makefile.am b/swfdec-gtk/Makefile.am
index 4f724cf..2fdd027 100644
--- a/swfdec-gtk/Makefile.am
+++ b/swfdec-gtk/Makefile.am
@@ -29,7 +29,7 @@ libswfdec_gtk_ at SWFDEC_MAJORMINOR@_la_LDFLAGS = \
 	-version-info $(SWFDEC_LIBVERSION) \
 	-export-symbols-regex '^(swfdec_.*)' \
 	$(GTK_LIBS) $(SWFDEC_LIBS) $(AUDIO_LIBS) 
-libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/libswfdec-gtk
+libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/swfdec-gtk
 libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = \
 	swfdec-gtk.h \
 	swfdec_gtk_keys.h \
diff --git a/swfdec-gtk/swfdec-gtk.h b/swfdec-gtk/swfdec-gtk.h
index b64cf83..1f5359f 100644
--- a/swfdec-gtk/swfdec-gtk.h
+++ b/swfdec-gtk/swfdec-gtk.h
@@ -20,10 +20,10 @@
 #ifndef __SWFDEC_GTK_H__
 #define __SWFDEC_GTK_H__
 
-#include <libswfdec-gtk/swfdec_gtk_keys.h>
-#include <libswfdec-gtk/swfdec_gtk_loader.h>
-#include <libswfdec-gtk/swfdec_gtk_player.h>
-#include <libswfdec-gtk/swfdec_gtk_socket.h>
-#include <libswfdec-gtk/swfdec_gtk_widget.h>
+#include <swfdec-gtk/swfdec_gtk_keys.h>
+#include <swfdec-gtk/swfdec_gtk_loader.h>
+#include <swfdec-gtk/swfdec_gtk_player.h>
+#include <swfdec-gtk/swfdec_gtk_socket.h>
+#include <swfdec-gtk/swfdec_gtk_widget.h>
 
 #endif
diff --git a/swfdec-gtk/swfdec_gtk_keys.h b/swfdec-gtk/swfdec_gtk_keys.h
index d9b985b..f1aa55d 100644
--- a/swfdec-gtk/swfdec_gtk_keys.h
+++ b/swfdec-gtk/swfdec_gtk_keys.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_GTK_KEYS_H_
 #define _SWFDEC_GTK_KEYS_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_gtk_loader.h b/swfdec-gtk/swfdec_gtk_loader.h
index ccae174..1e82f9f 100644
--- a/swfdec-gtk/swfdec_gtk_loader.h
+++ b/swfdec-gtk/swfdec_gtk_loader.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_GTK_LOADER_H_
 #define _SWFDEC_GTK_LOADER_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_gtk_player.c b/swfdec-gtk/swfdec_gtk_player.c
index 6d0a0a3..71ff829 100644
--- a/swfdec-gtk/swfdec_gtk_player.c
+++ b/swfdec-gtk/swfdec_gtk_player.c
@@ -21,11 +21,11 @@
 #include "config.h"
 #endif
 
-#include "libswfdec-gtk/swfdec_gtk_loader.h"
-#include "libswfdec-gtk/swfdec_gtk_player.h"
-#include "libswfdec-gtk/swfdec_gtk_socket.h"
-#include "libswfdec-gtk/swfdec_playback.h"
-#include "libswfdec-gtk/swfdec_source.h"
+#include "swfdec-gtk/swfdec_gtk_loader.h"
+#include "swfdec-gtk/swfdec_gtk_player.h"
+#include "swfdec-gtk/swfdec_gtk_socket.h"
+#include "swfdec-gtk/swfdec_playback.h"
+#include "swfdec-gtk/swfdec_source.h"
 
 struct _SwfdecGtkPlayer
 {
diff --git a/swfdec-gtk/swfdec_gtk_player.h b/swfdec-gtk/swfdec_gtk_player.h
index 3ff77bf..dd4b51d 100644
--- a/swfdec-gtk/swfdec_gtk_player.h
+++ b/swfdec-gtk/swfdec_gtk_player.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_GTK_PLAYER_H_
 #define _SWFDEC_GTK_PLAYER_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_gtk_socket.h b/swfdec-gtk/swfdec_gtk_socket.h
index 62bb546..c14a488 100644
--- a/swfdec-gtk/swfdec_gtk_socket.h
+++ b/swfdec-gtk/swfdec_gtk_socket.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_GTK_SOCKET_H_
 #define _SWFDEC_GTK_SOCKET_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_gtk_widget.h b/swfdec-gtk/swfdec_gtk_widget.h
index 86b03fd..370fc20 100644
--- a/swfdec-gtk/swfdec_gtk_widget.h
+++ b/swfdec-gtk/swfdec_gtk_widget.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_GTK_WIDGET_H_
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_playback.h b/swfdec-gtk/swfdec_playback.h
index 8be67dd..0358293 100644
--- a/swfdec-gtk/swfdec_playback.h
+++ b/swfdec-gtk/swfdec_playback.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_PLAYBACK_H_
 #define _SWFDEC_PLAYBACK_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec-gtk/swfdec_source.h b/swfdec-gtk/swfdec_source.h
index 0c7c383..b75077f 100644
--- a/swfdec-gtk/swfdec_source.h
+++ b/swfdec-gtk/swfdec_source.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_SOURCE_H_
 #define _SWFDEC_SOURCE_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/Makefile.am b/swfdec/Makefile.am
index dc62604..dccac20 100644
--- a/swfdec/Makefile.am
+++ b/swfdec/Makefile.am
@@ -199,7 +199,8 @@ public_headers = \
 	swfdec_url.h
 
 libswfdec_ at SWFDEC_MAJORMINOR@_la_LIBADD = jpeg/libjpeg.la 
-libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/libswfdec
+
+libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/swfdec
 libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = $(public_headers) swfdec_enums.h
 
 noinst_HEADERS = \
diff --git a/swfdec/swfdec.h b/swfdec/swfdec.h
index e2432eb..1e769b3 100644
--- a/swfdec/swfdec.h
+++ b/swfdec/swfdec.h
@@ -22,27 +22,27 @@
 #ifndef __SWFDEC_H__
 #define __SWFDEC_H__
 
-#include <libswfdec/swfdec_as_context.h>
-#include <libswfdec/swfdec_as_debugger.h>
-#include <libswfdec/swfdec_as_frame.h>
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_native_function.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_context.h>
+#include <swfdec/swfdec_as_debugger.h>
+#include <swfdec/swfdec_as_frame.h>
+#include <swfdec/swfdec_as_function.h>
+#include <swfdec/swfdec_as_native_function.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script.h>
 
-#include <libswfdec/swfdec_audio.h>
-#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_player_scripting.h>
-#include <libswfdec/swfdec_rectangle.h>
-#include <libswfdec/swfdec_socket.h>
-#include <libswfdec/swfdec_stream.h>
-#include <libswfdec/swfdec_system.h>
-#include <libswfdec/swfdec_url.h>
+#include <swfdec/swfdec_audio.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_enums.h>
+#include <swfdec/swfdec_file_loader.h>
+#include <swfdec/swfdec_keys.h>
+#include <swfdec/swfdec_loader.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_player_scripting.h>
+#include <swfdec/swfdec_rectangle.h>
+#include <swfdec/swfdec_socket.h>
+#include <swfdec/swfdec_stream.h>
+#include <swfdec/swfdec_system.h>
+#include <swfdec/swfdec_url.h>
 
 #endif
diff --git a/swfdec/swfdec_amf.h b/swfdec/swfdec_amf.h
index 0f9c67e..2b493dd 100644
--- a/swfdec/swfdec_amf.h
+++ b/swfdec/swfdec_amf.h
@@ -20,8 +20,8 @@
 #ifndef __SWFDEC_AMF_H__
 #define __SWFDEC_AMF_H__
 
-#include <libswfdec/swfdec_as_context.h>
-#include <libswfdec/swfdec_bits.h>
+#include <swfdec/swfdec_as_context.h>
+#include <swfdec/swfdec_bits.h>
 
 typedef enum {
   SWFDEC_AMF_NUMBER = 0,
diff --git a/swfdec/swfdec_as_array.h b/swfdec/swfdec_as_array.h
index 4c23a7f..22665a0 100644
--- a/swfdec/swfdec_as_array.h
+++ b/swfdec/swfdec_as_array.h
@@ -21,8 +21,8 @@
 #ifndef _SWFDEC_AS_ARRAY_H_
 #define _SWFDEC_AS_ARRAY_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_boolean.h b/swfdec/swfdec_as_boolean.h
index 723f076..7206da2 100644
--- a/swfdec/swfdec_as_boolean.h
+++ b/swfdec/swfdec_as_boolean.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_BOOLEAN_H_
 #define _SWFDEC_AS_BOOLEAN_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_context.h b/swfdec/swfdec_as_context.h
index d5ef066..3b19a7e 100644
--- a/swfdec/swfdec_as_context.h
+++ b/swfdec/swfdec_as_context.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_AS_CONTEXT_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_date.h b/swfdec/swfdec_as_date.h
index b095520..77d4eab 100644
--- a/swfdec/swfdec_as_date.h
+++ b/swfdec/swfdec_as_date.h
@@ -21,9 +21,9 @@
 #ifndef _SWFDEC_AS_DATE_H_
 #define _SWFDEC_AS_DATE_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_debugger.h b/swfdec/swfdec_as_debugger.h
index 2e2c0e7..3cd4b4f 100644
--- a/swfdec/swfdec_as_debugger.h
+++ b/swfdec/swfdec_as_debugger.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_AS_DEBUGGER_H_
 #define _SWFDEC_AS_DEBUGGER_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_frame.h b/swfdec/swfdec_as_frame.h
index 344eaa7..db58580 100644
--- a/swfdec/swfdec_as_frame.h
+++ b/swfdec/swfdec_as_frame.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_FRAME_H_
 #define _SWFDEC_AS_FRAME_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_frame_internal.h b/swfdec/swfdec_as_frame_internal.h
index 866d1fa..07175a1 100644
--- a/swfdec/swfdec_as_frame_internal.h
+++ b/swfdec/swfdec_as_frame_internal.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_FRAME_INTERNAL_H_
 #define _SWFDEC_AS_FRAME_INTERNAL_H_
 
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script_internal.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script_internal.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_function.h b/swfdec/swfdec_as_function.h
index 534aad5..fbc461d 100644
--- a/swfdec/swfdec_as_function.h
+++ b/swfdec/swfdec_as_function.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_AS_FUNCTION_H_
 #define _SWFDEC_AS_FUNCTION_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_internal.h b/swfdec/swfdec_as_internal.h
index 30a556c..7b634d7 100644
--- a/swfdec/swfdec_as_internal.h
+++ b/swfdec/swfdec_as_internal.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_INTERNAL_H_
 #define _SWFDEC_AS_INTERNAL_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_interpret.h b/swfdec/swfdec_as_interpret.h
index 6b9402b..09201dd 100644
--- a/swfdec/swfdec_as_interpret.h
+++ b/swfdec/swfdec_as_interpret.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_AS_INTERPRET_H_
 #define _SWFDEC_AS_INTERPRET_H_
 
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_native_function.h b/swfdec/swfdec_as_native_function.h
index 88c172d..8089e5b 100644
--- a/swfdec/swfdec_as_native_function.h
+++ b/swfdec/swfdec_as_native_function.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_NATIVE_FUNCTION_H_
 #define _SWFDEC_AS_NATIVE_FUNCTION_H_
 
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_function.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_number.h b/swfdec/swfdec_as_number.h
index 9b6ede0..eeb1c1c 100644
--- a/swfdec/swfdec_as_number.h
+++ b/swfdec/swfdec_as_number.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_NUMBER_H_
 #define _SWFDEC_AS_NUMBER_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_object.h b/swfdec/swfdec_as_object.h
index 2fe888f..d8fcf32 100644
--- a/swfdec/swfdec_as_object.h
+++ b/swfdec/swfdec_as_object.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_AS_OBJECT_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_script_function.h b/swfdec/swfdec_as_script_function.h
index 1972e15..ab04a72 100644
--- a/swfdec/swfdec_as_script_function.h
+++ b/swfdec/swfdec_as_script_function.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_AS_SCRIPT_FUNCTION_H_
 #define _SWFDEC_AS_SCRIPT_FUNCTION_H_
 
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_function.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_script.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_stack.h b/swfdec/swfdec_as_stack.h
index 26e66ea..644095c 100644
--- a/swfdec/swfdec_as_stack.h
+++ b/swfdec/swfdec_as_stack.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_AS_STACK_H_
 #define _SWFDEC_AS_STACK_H_
 
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
@@ -36,7 +36,7 @@ void		swfdec_as_stack_pop_segment   	(SwfdecAsContext *	context);
 
 //#define SWFDEC_MAD_CHECKS
 #ifdef SWFDEC_MAD_CHECKS
-#include <libswfdec/swfdec_as_context.h>
+#include <swfdec/swfdec_as_context.h>
 static inline SwfdecAsValue *
 swfdec_as_stack_peek (SwfdecAsContext *cx, guint n)
 {
diff --git a/swfdec/swfdec_as_string.h b/swfdec/swfdec_as_string.h
index c0cd621..915ced0 100644
--- a/swfdec/swfdec_as_string.h
+++ b/swfdec/swfdec_as_string.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_STRING_H_
 #define _SWFDEC_AS_STRING_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_as_super.h b/swfdec/swfdec_as_super.h
index ad082e9..a1a8e6a 100644
--- a/swfdec/swfdec_as_super.h
+++ b/swfdec/swfdec_as_super.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AS_SUPER_H_
 #define _SWFDEC_AS_SUPER_H_
 
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_as_function.h>
+#include <swfdec/swfdec_as_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_audio_event.h b/swfdec/swfdec_audio_event.h
index 40a0eb6..b2e3d6c 100644
--- a/swfdec/swfdec_audio_event.h
+++ b/swfdec/swfdec_audio_event.h
@@ -22,8 +22,8 @@
 #ifndef _SWFDEC_AUDIO_EVENT_H_
 #define _SWFDEC_AUDIO_EVENT_H_
 
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_sound.h>
+#include <swfdec/swfdec_audio_internal.h>
+#include <swfdec/swfdec_sound.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_audio_flv.h b/swfdec/swfdec_audio_flv.h
index 52ac2a5..91671f7 100644
--- a/swfdec/swfdec_audio_flv.h
+++ b/swfdec/swfdec_audio_flv.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_AUDIO_FLV_H_
 #define _SWFDEC_AUDIO_FLV_H_
 
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_flv_decoder.h>
+#include <swfdec/swfdec_audio_internal.h>
+#include <swfdec/swfdec_flv_decoder.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_audio_internal.h b/swfdec/swfdec_audio_internal.h
index 512f6e7..2332baa 100644
--- a/swfdec/swfdec_audio_internal.h
+++ b/swfdec/swfdec_audio_internal.h
@@ -22,10 +22,10 @@
 #ifndef _SWFDEC_AUDIO_INTERNAL_H_
 #define _SWFDEC_AUDIO_INTERNAL_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_audio.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_audio.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_audio_stream.h b/swfdec/swfdec_audio_stream.h
index 306c9c8..5d7c531 100644
--- a/swfdec/swfdec_audio_stream.h
+++ b/swfdec/swfdec_audio_stream.h
@@ -22,8 +22,8 @@
 #ifndef _SWFDEC_AUDIO_STREAM_H_
 #define _SWFDEC_AUDIO_STREAM_H_
 
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_codec_audio.h>
+#include <swfdec/swfdec_audio_internal.h>
+#include <swfdec/swfdec_codec_audio.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_bits.h b/swfdec/swfdec_bits.h
index c56bc99..36e9a6a 100644
--- a/swfdec/swfdec_bits.h
+++ b/swfdec/swfdec_bits.h
@@ -23,8 +23,8 @@
 #define __SWFDEC_BITS_H__
 
 #include <cairo.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_buffer.h>
 
 typedef struct _SwfdecBits SwfdecBits;
 
diff --git a/swfdec/swfdec_button.h b/swfdec/swfdec_button.h
index ddf5900..b69ed5a 100644
--- a/swfdec/swfdec_button.h
+++ b/swfdec/swfdec_button.h
@@ -22,8 +22,8 @@
 #ifndef _SWFDEC_BUTTON_H_
 #define _SWFDEC_BUTTON_H_
 
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_color.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_color.h>
 
 G_BEGIN_DECLS
 //typedef struct _SwfdecButton SwfdecButton;
diff --git a/swfdec/swfdec_button_movie.h b/swfdec/swfdec_button_movie.h
index 1f6dfaf..3c3ded4 100644
--- a/swfdec/swfdec_button_movie.h
+++ b/swfdec/swfdec_button_movie.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_BUTTON_MOVIE_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_button.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_button.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_cache.h b/swfdec/swfdec_cache.h
index 5e58aa4..89b589d 100644
--- a/swfdec/swfdec_cache.h
+++ b/swfdec/swfdec_cache.h
@@ -21,7 +21,7 @@
 #ifndef _SWFDEC_CACHE_H_
 #define _SWFDEC_CACHE_H_
 
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_cached.h b/swfdec/swfdec_cached.h
index bc9a1f7..52365f4 100644
--- a/swfdec/swfdec_cached.h
+++ b/swfdec/swfdec_cached.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_CACHED_H_
 
 #include <cairo.h>
-#include <libswfdec/swfdec_cache.h>
-#include <libswfdec/swfdec_character.h>
+#include <swfdec/swfdec_cache.h>
+#include <swfdec/swfdec_character.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_character.h b/swfdec/swfdec_character.h
index 50b577b..e884887 100644
--- a/swfdec/swfdec_character.h
+++ b/swfdec/swfdec_character.h
@@ -23,8 +23,8 @@
 #define _SWFDEC_CHARACTER_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 //typedef struct _SwfdecCharacter SwfdecCharacter;
diff --git a/swfdec/swfdec_codec_audio.h b/swfdec/swfdec_codec_audio.h
index 48eb139..6f9e4f9 100644
--- a/swfdec/swfdec_codec_audio.h
+++ b/swfdec/swfdec_codec_audio.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_CODEC_H_
 
 #include <glib.h>
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_audio_internal.h>
+#include <swfdec/swfdec_buffer.h>
 
 typedef struct _SwfdecAudioDecoder SwfdecAudioDecoder;
 
diff --git a/swfdec/swfdec_codec_video.h b/swfdec/swfdec_codec_video.h
index a7c968a..c58fd03 100644
--- a/swfdec/swfdec_codec_video.h
+++ b/swfdec/swfdec_codec_video.h
@@ -22,7 +22,7 @@
 
 #include <glib.h>
 #include <cairo.h>
-#include <libswfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_buffer.h>
 
 #define SWFDEC_VIDEO_CODEC_UNDEFINED 0
 #define SWFDEC_VIDEO_CODEC_H263 2
diff --git a/swfdec/swfdec_color.h b/swfdec/swfdec_color.h
index d2ba7a1..188e6dd 100644
--- a/swfdec/swfdec_color.h
+++ b/swfdec/swfdec_color.h
@@ -22,7 +22,7 @@
 #ifndef __SWFDEC_COLOR_H__
 #define __SWFDEC_COLOR_H__
 
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_types.h>
 
 struct _SwfdecColorTransform {
   gboolean mask;			/* TRUE if this is a mask - masks are always black */
diff --git a/swfdec/swfdec_debugger.h b/swfdec/swfdec_debugger.h
index 139e93b..00999ba 100644
--- a/swfdec/swfdec_debugger.h
+++ b/swfdec/swfdec_debugger.h
@@ -21,10 +21,10 @@
 #define _SWFDEC_DEBUGGER_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_player_internal.h>
-#include <libswfdec/swfdec_script.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_script.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_decoder.h b/swfdec/swfdec_decoder.h
index 3a58015..1dc762c 100644
--- a/swfdec/swfdec_decoder.h
+++ b/swfdec/swfdec_decoder.h
@@ -21,10 +21,10 @@
 #define _SWFDEC_DECODER_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_buffer.h>
-#include <libswfdec/swfdec_loader.h>
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_loader.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_draw.h b/swfdec/swfdec_draw.h
index e56a4ae..a892e47 100644
--- a/swfdec/swfdec_draw.h
+++ b/swfdec/swfdec_draw.h
@@ -22,8 +22,8 @@
 
 #include <glib-object.h>
 #include <cairo.h>
-#include <libswfdec/swfdec_swf_decoder.h>
-#include <libswfdec/swfdec_color.h>
+#include <swfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_color.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_event.h b/swfdec/swfdec_event.h
index 4b1ba40..ed13327 100644
--- a/swfdec/swfdec_event.h
+++ b/swfdec/swfdec_event.h
@@ -17,10 +17,10 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_types.h>
 
 #ifndef _SWFDEC_EVENT_H_
 #define _SWFDEC_EVENT_H_
diff --git a/swfdec/swfdec_file_loader.h b/swfdec/swfdec_file_loader.h
index facd8c5..8350063 100644
--- a/swfdec/swfdec_file_loader.h
+++ b/swfdec/swfdec_file_loader.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_FILE_LOADER_H_
 #define _SWFDEC_FILE_LOADER_H_
 
-#include <libswfdec/swfdec_loader.h>
+#include <swfdec/swfdec_loader.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_filter.h b/swfdec/swfdec_filter.h
index 2f39f15..ff0ce72 100644
--- a/swfdec/swfdec_filter.h
+++ b/swfdec/swfdec_filter.h
@@ -20,10 +20,10 @@
 #ifndef _SWFDEC_FILTER_H_
 #define _SWFDEC_FILTER_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_flv_decoder.h b/swfdec/swfdec_flv_decoder.h
index 635fea4..0061c02 100644
--- a/swfdec/swfdec_flv_decoder.h
+++ b/swfdec/swfdec_flv_decoder.h
@@ -20,9 +20,9 @@
 #ifndef __SWFDEC_FLV_DECODER_H__
 #define __SWFDEC_FLV_DECODER_H__
 
-#include <libswfdec/swfdec_codec_audio.h>
-#include <libswfdec/swfdec_codec_video.h>
-#include <libswfdec/swfdec_decoder.h>
+#include <swfdec/swfdec_codec_audio.h>
+#include <swfdec/swfdec_codec_video.h>
+#include <swfdec/swfdec_decoder.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_font.h b/swfdec/swfdec_font.h
index b9ff5d7..a34eb39 100644
--- a/swfdec/swfdec_font.h
+++ b/swfdec/swfdec_font.h
@@ -23,8 +23,8 @@
 #define _SWFDEC_FONT_H_
 
 #include <pango/pangocairo.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_character.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_character.h>
 
 G_BEGIN_DECLS
 //typedef struct _SwfdecFont SwfdecFont;
diff --git a/swfdec/swfdec_gradient_pattern.h b/swfdec/swfdec_gradient_pattern.h
index 6b85608..b025314 100644
--- a/swfdec/swfdec_gradient_pattern.h
+++ b/swfdec/swfdec_gradient_pattern.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_GRADIENT_PATTERN_H_
 #define _SWFDEC_GRADIENT_PATTERN_H_
 
-#include <libswfdec/swfdec_pattern.h>
+#include <swfdec/swfdec_pattern.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_graphic.h b/swfdec/swfdec_graphic.h
index 0b48d19..52e0f74 100644
--- a/swfdec/swfdec_graphic.h
+++ b/swfdec/swfdec_graphic.h
@@ -23,9 +23,9 @@
 #define _SWFDEC_GRAPHIC_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_character.h>
-#include <libswfdec/swfdec_rect.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_character.h>
+#include <swfdec/swfdec_rect.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_graphic_movie.h b/swfdec/swfdec_graphic_movie.h
index 4d6e454..ede8a0f 100644
--- a/swfdec/swfdec_graphic_movie.h
+++ b/swfdec/swfdec_graphic_movie.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_GRAPHIC_MOVIE_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_graphic.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_image.h b/swfdec/swfdec_image.h
index e648e08..8e41db9 100644
--- a/swfdec/swfdec_image.h
+++ b/swfdec/swfdec_image.h
@@ -23,8 +23,8 @@
 #define _SWFDEC_IMAGE_H_
 
 #include <cairo.h>
-#include <libswfdec/swfdec_cached.h>
-#include <libswfdec/swfdec_decoder.h>
+#include <swfdec/swfdec_cached.h>
+#include <swfdec/swfdec_decoder.h>
 
 G_BEGIN_DECLS
 //typedef struct _SwfdecImage SwfdecImage;
diff --git a/swfdec/swfdec_image_decoder.h b/swfdec/swfdec_image_decoder.h
index b5f3a84..0b3f743 100644
--- a/swfdec/swfdec_image_decoder.h
+++ b/swfdec/swfdec_image_decoder.h
@@ -22,10 +22,10 @@
 
 #include <glib.h>
 
-#include <libswfdec/swfdec_decoder.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_decoder.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_internal.h b/swfdec/swfdec_internal.h
index 79d49c1..41d8664 100644
--- a/swfdec/swfdec_internal.h
+++ b/swfdec/swfdec_internal.h
@@ -22,9 +22,9 @@
 #ifndef _SWFDEC_INTERNAL_H_
 #define _SWFDEC_INTERNAL_H_
 
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_codec_audio.h>
-#include <libswfdec/swfdec_codec_video.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_codec_audio.h>
+#include <swfdec/swfdec_codec_video.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_interval.h b/swfdec/swfdec_interval.h
index 48941bf..8e82511 100644
--- a/swfdec/swfdec_interval.h
+++ b/swfdec/swfdec_interval.h
@@ -20,10 +20,10 @@
 #ifndef _SWFDEC_INTERVAL_H_
 #define _SWFDEC_INTERVAL_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_player_internal.h>
-#include <libswfdec/swfdec_sandbox.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_sandbox.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_load_object.h b/swfdec/swfdec_load_object.h
index 51b3baa..cd899a9 100644
--- a/swfdec/swfdec_load_object.h
+++ b/swfdec/swfdec_load_object.h
@@ -21,9 +21,9 @@
 #ifndef _SWFDEC_LOAD_OBJECT_H_
 #define _SWFDEC_LOAD_OBJECT_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_resource.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_resource.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_loader.h b/swfdec/swfdec_loader.h
index 3d0ebff..6f15477 100644
--- a/swfdec/swfdec_loader.h
+++ b/swfdec/swfdec_loader.h
@@ -21,10 +21,10 @@
 #define _SWFDEC_LOADER_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_buffer.h>
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_stream.h>
-#include <libswfdec/swfdec_url.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_stream.h>
+#include <swfdec/swfdec_url.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_morph_movie.h b/swfdec/swfdec_morph_movie.h
index c8dd6cc..db19692 100644
--- a/swfdec/swfdec_morph_movie.h
+++ b/swfdec/swfdec_morph_movie.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_MORPH_MOVIE_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_morphshape.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_morphshape.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_morphshape.h b/swfdec/swfdec_morphshape.h
index e460109..8a5107e 100644
--- a/swfdec/swfdec_morphshape.h
+++ b/swfdec/swfdec_morphshape.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_MORPH_SHAPE_H_
 #define _SWFDEC_MORPH_SHAPE_H_
 
-#include <libswfdec/swfdec_shape.h>
+#include <swfdec/swfdec_shape.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_movie.h b/swfdec/swfdec_movie.h
index 623707f..296e495 100644
--- a/swfdec/swfdec_movie.h
+++ b/swfdec/swfdec_movie.h
@@ -21,12 +21,12 @@
 #define _SWFDEC_MOVIE_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_event.h>
-#include <libswfdec/swfdec_rect.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_event.h>
+#include <swfdec/swfdec_rect.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_movie_clip_loader.h b/swfdec/swfdec_movie_clip_loader.h
index 9ef0d1c..5bf7aae 100644
--- a/swfdec/swfdec_movie_clip_loader.h
+++ b/swfdec/swfdec_movie_clip_loader.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_MOVIE_CLIP_LOADER_H_
 #define _SWFDEC_MOVIE_CLIP_LOADER_H_
 
-#include <libswfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_object.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_net_connection.h b/swfdec/swfdec_net_connection.h
index e7bd3fa..c14daac 100644
--- a/swfdec/swfdec_net_connection.h
+++ b/swfdec/swfdec_net_connection.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_NET_CONNECTION_H_
 #define _SWFDEC_NET_CONNECTION_H_
 
-#include <libswfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_object.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_net_stream.h b/swfdec/swfdec_net_stream.h
index 943c834..5520d05 100644
--- a/swfdec/swfdec_net_stream.h
+++ b/swfdec/swfdec_net_stream.h
@@ -20,14 +20,14 @@
 #ifndef _SWFDEC_NET_STREAM_H_
 #define _SWFDEC_NET_STREAM_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_codec_video.h>
-#include <libswfdec/swfdec_net_connection.h>
-#include <libswfdec/swfdec_flv_decoder.h>
-#include <libswfdec/swfdec_player_internal.h>
-#include <libswfdec/swfdec_sandbox.h>
-#include <libswfdec/swfdec_video_movie.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_codec_video.h>
+#include <swfdec/swfdec_net_connection.h>
+#include <swfdec/swfdec_flv_decoder.h>
+#include <swfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_sandbox.h>
+#include <swfdec/swfdec_video_movie.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_path.h b/swfdec/swfdec_path.h
index 502a049..bfe0607 100644
--- a/swfdec/swfdec_path.h
+++ b/swfdec/swfdec_path.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_PATH_H_
 
 #include <cairo.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_pattern.h b/swfdec/swfdec_pattern.h
index 3fdcf99..811389d 100644
--- a/swfdec/swfdec_pattern.h
+++ b/swfdec/swfdec_pattern.h
@@ -22,8 +22,8 @@
 
 #include <glib-object.h>
 #include <cairo.h>
-#include <libswfdec/swfdec_draw.h>
-#include <libswfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_draw.h>
+#include <swfdec/swfdec_swf_decoder.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_player.h b/swfdec/swfdec_player.h
index b3ec5f5..5c32f59 100644
--- a/swfdec/swfdec_player.h
+++ b/swfdec/swfdec_player.h
@@ -22,9 +22,9 @@
 
 #include <glib-object.h>
 #include <cairo.h>
-#include <libswfdec/swfdec_as_context.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_url.h>
+#include <swfdec/swfdec_as_context.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_url.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_player_internal.h b/swfdec/swfdec_player_internal.h
index a38b957..453ce3d 100644
--- a/swfdec/swfdec_player_internal.h
+++ b/swfdec/swfdec_player_internal.h
@@ -20,16 +20,16 @@
 #ifndef _SWFDEC_PLAYER_INTERNAL_H_
 #define _SWFDEC_PLAYER_INTERNAL_H_
 
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_audio.h>
-#include <libswfdec/swfdec_event.h>
-#include <libswfdec/swfdec_function_list.h>
-#include <libswfdec/swfdec_loader.h>
-#include <libswfdec/swfdec_player_scripting.h>
-#include <libswfdec/swfdec_rect.h>
-#include <libswfdec/swfdec_ringbuffer.h>
-#include <libswfdec/swfdec_socket.h>
-#include <libswfdec/swfdec_system.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_audio.h>
+#include <swfdec/swfdec_event.h>
+#include <swfdec/swfdec_function_list.h>
+#include <swfdec/swfdec_loader.h>
+#include <swfdec/swfdec_player_scripting.h>
+#include <swfdec/swfdec_rect.h>
+#include <swfdec/swfdec_ringbuffer.h>
+#include <swfdec/swfdec_socket.h>
+#include <swfdec/swfdec_system.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_player_scripting.h b/swfdec/swfdec_player_scripting.h
index 8ad3c8f..03dbbae 100644
--- a/swfdec/swfdec_player_scripting.h
+++ b/swfdec/swfdec_player_scripting.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_PLAYER_SCRIPTING_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_player.h>
+#include <swfdec/swfdec_player.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_policy_file.h b/swfdec/swfdec_policy_file.h
index b849562..337e236 100644
--- a/swfdec/swfdec_policy_file.h
+++ b/swfdec/swfdec_policy_file.h
@@ -21,8 +21,8 @@
 #ifndef _SWFDEC_FLASH_SECURITY_POLICY_H_
 #define _SWFDEC_FLASH_SECURITY_POLICY_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_player.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_player.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_rect.h b/swfdec/swfdec_rect.h
index d43cee4..6833b8c 100644
--- a/swfdec/swfdec_rect.h
+++ b/swfdec/swfdec_rect.h
@@ -22,8 +22,8 @@
 #ifndef __SWFDEC_RECT_H__
 #define __SWFDEC_RECT_H__
 
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_rectangle.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_rectangle.h>
 
 struct _SwfdecRect
 {
diff --git a/swfdec/swfdec_resource.h b/swfdec/swfdec_resource.h
index fba2f95..3496789 100644
--- a/swfdec/swfdec_resource.h
+++ b/swfdec/swfdec_resource.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_RESOURCE_H_
 #define _SWFDEC_RESOURCE_H_
 
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_sandbox.h>
-#include <libswfdec/swfdec_sprite_movie.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_sandbox.h>
+#include <swfdec/swfdec_sprite_movie.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_sandbox.h b/swfdec/swfdec_sandbox.h
index 6fda9b7..fa5baca 100644
--- a/swfdec/swfdec_sandbox.h
+++ b/swfdec/swfdec_sandbox.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_SANDBOX_H_
 #define _SWFDEC_SANDBOX_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_url.h>
-#include <libswfdec/swfdec_player.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_url.h>
+#include <swfdec/swfdec_player.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_script.h b/swfdec/swfdec_script.h
index fe90428..0881831 100644
--- a/swfdec/swfdec_script.h
+++ b/swfdec/swfdec_script.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_SCRIPT_H_
 #define _SWFDEC_SCRIPT_H_
 
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_buffer.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_script_internal.h b/swfdec/swfdec_script_internal.h
index 23acb0d..8dc4308 100644
--- a/swfdec/swfdec_script_internal.h
+++ b/swfdec/swfdec_script_internal.h
@@ -20,10 +20,10 @@
 #ifndef _SWFDEC_SCRIPT_INTERNAL_H_
 #define _SWFDEC_SCRIPT_INTERNAL_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_bits.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_as_types.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_bits.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_shape.h b/swfdec/swfdec_shape.h
index 312dc9f..b97189c 100644
--- a/swfdec/swfdec_shape.h
+++ b/swfdec/swfdec_shape.h
@@ -22,13 +22,13 @@
 #ifndef _SWFDEC_SHAPE_H_
 #define _SWFDEC_SHAPE_H_
 
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_pattern.h>
-#include <libswfdec/swfdec_stroke.h>
-#include <libswfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_pattern.h>
+#include <swfdec/swfdec_stroke.h>
+#include <swfdec/swfdec_swf_decoder.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_shape_parser.h b/swfdec/swfdec_shape_parser.h
index 9dccbf0..75e3ee5 100644
--- a/swfdec/swfdec_shape_parser.h
+++ b/swfdec/swfdec_shape_parser.h
@@ -22,8 +22,8 @@
 #ifndef _SWFDEC_SHAPE_PARSER_H_
 #define _SWFDEC_SHAPE_PARSER_H_
 
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_draw.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_draw.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_socket.c b/swfdec/swfdec_socket.c
index 723050c..c02c790 100644
--- a/swfdec/swfdec_socket.c
+++ b/swfdec/swfdec_socket.c
@@ -34,7 +34,7 @@
  * SwfdecSockets are used to implement TCP streams. These are for example used 
  * to implement RTMP support or the XMLSocket script class. Backends are 
  * supposed to provide an implementation for this, as by default this class is
- * unimplemented. However, libswfdec-gtk or other convenience libraries provide
+ * unimplemented. However, swfdec-gtk or other convenience libraries provide
  * a socket implementation by default. 
  *
  * The socket implementation used by a #SwfdecPlayer can be set with the 
diff --git a/swfdec/swfdec_socket.h b/swfdec/swfdec_socket.h
index 7e062ca..ca750af 100644
--- a/swfdec/swfdec_socket.h
+++ b/swfdec/swfdec_socket.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_SOCKET_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_stream.h>
+#include <swfdec/swfdec_stream.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_sound.h b/swfdec/swfdec_sound.h
index 75e917e..cea0a58 100644
--- a/swfdec/swfdec_sound.h
+++ b/swfdec/swfdec_sound.h
@@ -22,10 +22,10 @@
 #ifndef _SWFDEC_SOUND_H_
 #define _SWFDEC_SOUND_H_
 
-#include <libswfdec/swfdec_cached.h>
-#include <libswfdec/swfdec_codec_audio.h>
-#include <libswfdec/swfdec_swf_decoder.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_cached.h>
+#include <swfdec/swfdec_codec_audio.h>
+#include <swfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_sound_object.h b/swfdec/swfdec_sound_object.h
index cdceaeb..c36d12e 100644
--- a/swfdec/swfdec_sound_object.h
+++ b/swfdec/swfdec_sound_object.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_SOUND_OBJECT_H_
 #define _SWFDEC_SOUND_OBJECT_H_
 
-#include <libswfdec/swfdec_movie.h>
+#include <swfdec/swfdec_movie.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_sprite.h b/swfdec/swfdec_sprite.h
index 6c9d4b9..cbca787 100644
--- a/swfdec/swfdec_sprite.h
+++ b/swfdec/swfdec_sprite.h
@@ -22,10 +22,10 @@
 #ifndef _SWFDEC_SPRITE_H_
 #define _SWFDEC_SPRITE_H_
 
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_event.h>
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_event.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_sprite_movie.h b/swfdec/swfdec_sprite_movie.h
index 093154d..93fe320 100644
--- a/swfdec/swfdec_sprite_movie.h
+++ b/swfdec/swfdec_sprite_movie.h
@@ -20,9 +20,9 @@
 #ifndef _SWFDEC_SPRITE_MOVIE_H_
 #define _SWFDEC_SPRITE_MOVIE_H_
 
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_audio.h>
-#include <libswfdec/swfdec_types.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_audio.h>
+#include <swfdec/swfdec_types.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_stream.h b/swfdec/swfdec_stream.h
index f1cb86c..973863d 100644
--- a/swfdec/swfdec_stream.h
+++ b/swfdec/swfdec_stream.h
@@ -21,7 +21,7 @@
 #define _SWFDEC_STREAM_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_buffer.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_stream_target.h b/swfdec/swfdec_stream_target.h
index 42b8e16..9f0ddff 100644
--- a/swfdec/swfdec_stream_target.h
+++ b/swfdec/swfdec_stream_target.h
@@ -20,7 +20,7 @@
 #ifndef __SWFDEC_STREAM_TARGET_H__
 #define __SWFDEC_STREAM_TARGET_H__
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_stroke.h b/swfdec/swfdec_stroke.h
index 8d1e7cd..01c2eba 100644
--- a/swfdec/swfdec_stroke.h
+++ b/swfdec/swfdec_stroke.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_STROKE_H_
 #define _SWFDEC_STROKE_H_
 
-#include <libswfdec/swfdec_pattern.h>
+#include <swfdec/swfdec_pattern.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_style_sheet.h b/swfdec/swfdec_style_sheet.h
index 847d7f7..226ff87 100644
--- a/swfdec/swfdec_style_sheet.h
+++ b/swfdec/swfdec_style_sheet.h
@@ -21,10 +21,10 @@
 #ifndef _SWFDEC_STYLESHEET_H_
 #define _SWFDEC_STYLESHEET_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_script.h>
-#include <libswfdec/swfdec_text_format.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_script.h>
+#include <swfdec/swfdec_text_format.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_swf_decoder.h b/swfdec/swfdec_swf_decoder.h
index dcd2e16..0566c99 100644
--- a/swfdec/swfdec_swf_decoder.h
+++ b/swfdec/swfdec_swf_decoder.h
@@ -25,10 +25,10 @@
 #include <glib.h>
 #include <zlib.h>
 
-#include <libswfdec/swfdec_decoder.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_decoder.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_text.h b/swfdec/swfdec_text.h
index a590470..867e6f4 100644
--- a/swfdec/swfdec_text.h
+++ b/swfdec/swfdec_text.h
@@ -22,8 +22,8 @@
 #ifndef _SWFDEC_TEXT_H_
 #define _SWFDEC_TEXT_H_
 
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_color.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_color.h>
 
 G_BEGIN_DECLS
 //typedef struct _SwfdecText SwfdecText;
diff --git a/swfdec/swfdec_text_field.h b/swfdec/swfdec_text_field.h
index a321a1c..2ad0414 100644
--- a/swfdec/swfdec_text_field.h
+++ b/swfdec/swfdec_text_field.h
@@ -22,11 +22,11 @@
 #define _SWFDEC_TEXT_FIELD_H_
 
 #include <pango/pango.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_player.h>
-#include <libswfdec/swfdec_text_format.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_player.h>
+#include <swfdec/swfdec_text_format.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_text_field_movie.h b/swfdec/swfdec_text_field_movie.h
index 8d719d3..07d7a0e 100644
--- a/swfdec/swfdec_text_field_movie.h
+++ b/swfdec/swfdec_text_field_movie.h
@@ -21,10 +21,10 @@
 #ifndef _SWFDEC_TEXT_FIELD_MOVIE_H_
 #define _SWFDEC_TEXT_FIELD_MOVIE_H_
 
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_text_field.h>
-#include <libswfdec/swfdec_style_sheet.h>
-#include <libswfdec/swfdec_text_format.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_text_field.h>
+#include <swfdec/swfdec_style_sheet.h>
+#include <swfdec/swfdec_text_format.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_text_format.h b/swfdec/swfdec_text_format.h
index 77dddb4..34e1e5e 100644
--- a/swfdec/swfdec_text_format.h
+++ b/swfdec/swfdec_text_format.h
@@ -21,10 +21,10 @@
 #ifndef _SWFDEC_TEXT_FORMAT_H_
 #define _SWFDEC_TEXT_FORMAT_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_array.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_script.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_as_array.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_script.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_video.h b/swfdec/swfdec_video.h
index 585c726..94569f7 100644
--- a/swfdec/swfdec_video.h
+++ b/swfdec/swfdec_video.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_VIDEO_H_
 #define _SWFDEC_VIDEO_H_
 
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_codec_video.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_codec_video.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_video_movie.h b/swfdec/swfdec_video_movie.h
index 958bc49..9d5af15 100644
--- a/swfdec/swfdec_video_movie.h
+++ b/swfdec/swfdec_video_movie.h
@@ -21,8 +21,8 @@
 #define _SWFDEC_VIDEO_MOVIE_H_
 
 #include <glib-object.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_video.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_video.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_xml.h b/swfdec/swfdec_xml.h
index 3be92d5..45c8ee8 100644
--- a/swfdec/swfdec_xml.h
+++ b/swfdec/swfdec_xml.h
@@ -21,10 +21,10 @@
 #ifndef _SWFDEC_XML_H_
 #define _SWFDEC_XML_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_script.h>
-#include <libswfdec/swfdec_xml_node.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_script.h>
+#include <swfdec/swfdec_xml_node.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_xml_node.h b/swfdec/swfdec_xml_node.h
index 7135613..49b5d48 100644
--- a/swfdec/swfdec_xml_node.h
+++ b/swfdec/swfdec_xml_node.h
@@ -21,10 +21,10 @@
 #ifndef _SWFDEC_XML_NODE_H_
 #define _SWFDEC_XML_NODE_H_
 
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_types.h>
-#include <libswfdec/swfdec_script.h>
-#include <libswfdec/swfdec_player.h>
+#include <swfdec/swfdec_as_object.h>
+#include <swfdec/swfdec_types.h>
+#include <swfdec/swfdec_script.h>
+#include <swfdec/swfdec_player.h>
 
 G_BEGIN_DECLS
 
diff --git a/swfdec/swfdec_xml_socket.h b/swfdec/swfdec_xml_socket.h
index 95f19c2..eb751d5 100644
--- a/swfdec/swfdec_xml_socket.h
+++ b/swfdec/swfdec_xml_socket.h
@@ -20,8 +20,8 @@
 #ifndef _SWFDEC_XML_SOCKET_H_
 #define _SWFDEC_XML_SOCKET_H_
 
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_as_object.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_as_object.h>
 
 G_BEGIN_DECLS
 
diff --git a/test/rtmp/rtmp_server.c b/test/rtmp/rtmp_server.c
index ec431e8..a5f6362 100644
--- a/test/rtmp/rtmp_server.c
+++ b/test/rtmp/rtmp_server.c
@@ -22,7 +22,7 @@
 #endif
 #include <libsoup/soup.h>
 #include <libsoup/soup-address.h>
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <glib/gprintf.h>
 
 static void
diff --git a/test/sound/sound.c b/test/sound/sound.c
index 332ca12..ab8f566 100644
--- a/test/sound/sound.c
+++ b/test/sound/sound.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 #include <string.h>
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 /**
  * audio_diff:
diff --git a/test/swfdec_test.c b/test/swfdec_test.c
index 957b35b..35e99d1 100644
--- a/test/swfdec_test.c
+++ b/test/swfdec_test.c
@@ -24,10 +24,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 /* FIXME: no internal headers please */
-#include <libswfdec/swfdec_as_array.h>
-#include <libswfdec/swfdec_as_internal.h>
+#include <swfdec/swfdec_as_array.h>
+#include <swfdec/swfdec_as_internal.h>
 
 #include "swfdec_test_function.h"
 #include "swfdec_test_initialize.h"
diff --git a/test/swfdec_test_function.h b/test/swfdec_test_function.h
index 08b6c27..a523fcd 100644
--- a/test/swfdec_test_function.h
+++ b/test/swfdec_test_function.h
@@ -17,7 +17,7 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 #ifndef _SWFDEC_TEST_FUNCTION_H_
 #define _SWFDEC_TEST_FUNCTION_H_
diff --git a/test/swfdec_test_global.c b/test/swfdec_test_global.c
index 6926944..7edd8d2 100644
--- a/test/swfdec_test_global.c
+++ b/test/swfdec_test_global.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 #include "swfdec_test_function.h"
 #include "swfdec_test_initialize.h"
diff --git a/test/swfdec_test_image.h b/test/swfdec_test_image.h
index ef5bb2a..6de6ccc 100644
--- a/test/swfdec_test_image.h
+++ b/test/swfdec_test_image.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_TEST_IMAGE_H_
 #define _SWFDEC_TEST_IMAGE_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/test/swfdec_test_test.h b/test/swfdec_test_test.h
index fe20221..aac940f 100644
--- a/test/swfdec_test_test.h
+++ b/test/swfdec_test_test.h
@@ -20,7 +20,7 @@
 #ifndef _SWFDEC_TEST_TEST_H_
 #define _SWFDEC_TEST_TEST_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/test/various/gc.c b/test/various/gc.c
index cb21202..6f485b6 100644
--- a/test/various/gc.c
+++ b/test/various/gc.c
@@ -21,9 +21,9 @@
 #include "config.h"
 #endif
 
-#include "libswfdec/swfdec_as_context.h"
-#include "libswfdec/swfdec_as_object.h"
-#include "libswfdec/swfdec_as_strings.h"
+#include "swfdec/swfdec_as_context.h"
+#include "swfdec/swfdec_as_object.h"
+#include "swfdec/swfdec_as_strings.h"
 
 #define ERROR(...) G_STMT_START { \
   g_printerr ("ERROR (line %u): ", __LINE__); \
diff --git a/test/various/ringbuffer.c b/test/various/ringbuffer.c
index 3f2c4dc..5be9da7 100644
--- a/test/various/ringbuffer.c
+++ b/test/various/ringbuffer.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include "libswfdec/swfdec_ringbuffer.h"
+#include "swfdec/swfdec_ringbuffer.h"
 
 #define SIZE 5
 
diff --git a/tools/crashfinder.c b/tools/crashfinder.c
index 5840862..956a5a6 100644
--- a/tools/crashfinder.c
+++ b/tools/crashfinder.c
@@ -22,7 +22,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 int
 main (int argc, char **argv)
diff --git a/tools/dump.c b/tools/dump.c
index 0ab7d59..1b8d701 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -29,20 +29,20 @@
 #include <sys/stat.h>
 #include <glib.h>
 #include <glib-object.h>
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_button.h>
-#include <libswfdec/swfdec_text_field.h>
-#include <libswfdec/swfdec_font.h>
-#include <libswfdec/swfdec_image.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_player_internal.h>
-#include <libswfdec/swfdec_sprite.h>
-#include <libswfdec/swfdec_shape.h>
-#include <libswfdec/swfdec_sound.h>
-#include <libswfdec/swfdec_swf_decoder.h>
-#include <libswfdec/swfdec_resource.h>
-#include <libswfdec/swfdec_tag.h>
-#include <libswfdec/swfdec_text.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_button.h>
+#include <swfdec/swfdec_text_field.h>
+#include <swfdec/swfdec_font.h>
+#include <swfdec/swfdec_image.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_sprite.h>
+#include <swfdec/swfdec_shape.h>
+#include <swfdec/swfdec_sound.h>
+#include <swfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_resource.h>
+#include <swfdec/swfdec_tag.h>
+#include <swfdec/swfdec_text.h>
 
 static gboolean verbose = FALSE;
 
diff --git a/tools/swfdec-extract.c b/tools/swfdec-extract.c
index 2c72f3b..b233818 100644
--- a/tools/swfdec-extract.c
+++ b/tools/swfdec-extract.c
@@ -31,17 +31,17 @@
 #ifdef CAIRO_HAS_PDF_SURFACE
 #  include <cairo-pdf.h>
 #endif
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_audio_stream.h>
-#include <libswfdec/swfdec_button.h>
-#include <libswfdec/swfdec_graphic.h>
-#include <libswfdec/swfdec_image.h>
-#include <libswfdec/swfdec_player_internal.h>
-#include <libswfdec/swfdec_sound.h>
-#include <libswfdec/swfdec_sprite.h>
-#include <libswfdec/swfdec_sprite_movie.h>
-#include <libswfdec/swfdec_swf_decoder.h>
-#include <libswfdec/swfdec_resource.h>
+#include <swfdec/swfdec.h>
+#include <swfdec/swfdec_audio_stream.h>
+#include <swfdec/swfdec_button.h>
+#include <swfdec/swfdec_graphic.h>
+#include <swfdec/swfdec_image.h>
+#include <swfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_sound.h>
+#include <swfdec/swfdec_sprite.h>
+#include <swfdec/swfdec_sprite_movie.h>
+#include <swfdec/swfdec_swf_decoder.h>
+#include <swfdec/swfdec_resource.h>
 
 static SwfdecBuffer *
 encode_wav (SwfdecBuffer *buffer, SwfdecAudioFormat format)
diff --git a/tools/swfdec_out.h b/tools/swfdec_out.h
index e343f9d..2544f33 100644
--- a/tools/swfdec_out.h
+++ b/tools/swfdec_out.h
@@ -20,9 +20,9 @@
 #ifndef __SWFDEC_OUT_H__
 #define __SWFDEC_OUT_H__
 
-#include <libswfdec/swfdec_buffer.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 
diff --git a/tools/swfedit_file.c b/tools/swfedit_file.c
index e257010..22684a3 100644
--- a/tools/swfedit_file.c
+++ b/tools/swfedit_file.c
@@ -23,10 +23,10 @@
 
 #include <zlib.h>
 
-#include "libswfdec/swfdec_bits.h"
-#include "libswfdec/swfdec_buffer.h"
-#include "libswfdec/swfdec_debug.h"
-#include "libswfdec/swfdec_swf_decoder.h"
+#include "swfdec/swfdec_bits.h"
+#include "swfdec/swfdec_buffer.h"
+#include "swfdec/swfdec_debug.h"
+#include "swfdec/swfdec_swf_decoder.h"
 #include "swfdec_out.h"
 #include "swfedit_file.h"
 #include "swfedit_tag.h"
diff --git a/tools/swfedit_file.h b/tools/swfedit_file.h
index ecd096a..212c7b7 100644
--- a/tools/swfedit_file.h
+++ b/tools/swfedit_file.h
@@ -20,7 +20,7 @@
 #ifndef __SWFEDIT_FILE_H__
 #define __SWFEDIT_FILE_H__
 
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_rect.h>
 #include "swfedit_token.h"
 
 G_BEGIN_DECLS
diff --git a/tools/swfedit_tag.c b/tools/swfedit_tag.c
index 4a4bf67..868632c 100644
--- a/tools/swfedit_tag.c
+++ b/tools/swfedit_tag.c
@@ -24,10 +24,10 @@
 #include <stdlib.h>
 #include <gtk/gtk.h>
 
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_debug.h>
-#include <libswfdec/swfdec_script_internal.h>
-#include <libswfdec/swfdec_tag.h>
+#include <swfdec/swfdec_bits.h>
+#include <swfdec/swfdec_debug.h>
+#include <swfdec/swfdec_script_internal.h>
+#include <swfdec/swfdec_tag.h>
 #include "swfedit_tag.h"
 #include "swfdec_out.h"
 #include "swfedit_file.h"
diff --git a/tools/swfedit_tag.h b/tools/swfedit_tag.h
index 2f1d231..b148f24 100644
--- a/tools/swfedit_tag.h
+++ b/tools/swfedit_tag.h
@@ -20,8 +20,8 @@
 #ifndef __SWFEDIT_TAG_H__
 #define __SWFEDIT_TAG_H__
 
-#include <libswfdec/swfdec_buffer.h>
-#include <libswfdec/swfdec_bits.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_bits.h>
 #include "swfdec_out.h"
 #include "swfedit_token.h"
 
diff --git a/tools/swfedit_token.c b/tools/swfedit_token.c
index 34496df..11bedfc 100644
--- a/tools/swfedit_token.c
+++ b/tools/swfedit_token.c
@@ -24,9 +24,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec_buffer.h>
-#include <libswfdec/swfdec_color.h>
-#include <libswfdec/swfdec_script_internal.h>
+#include <swfdec/swfdec_buffer.h>
+#include <swfdec/swfdec_color.h>
+#include <swfdec/swfdec_script_internal.h>
 #include "swfedit_token.h"
 
 /*** CONVERTERS ***/
diff --git a/tools/swfedit_token.h b/tools/swfedit_token.h
index 448f4cb..c46e0ef 100644
--- a/tools/swfedit_token.h
+++ b/tools/swfedit_token.h
@@ -21,7 +21,7 @@
 #define __SWFEDIT_TOKEN_H__
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec_rect.h>
+#include <swfdec/swfdec_rect.h>
 
 G_BEGIN_DECLS
 
diff --git a/tools/swfscript.c b/tools/swfscript.c
index 4e2a9e4..71435f4 100644
--- a/tools/swfscript.c
+++ b/tools/swfscript.c
@@ -22,7 +22,7 @@
 #endif
 
 #include <gtk/gtk.h>
-#include "libswfdec/swfdec_script_internal.h"
+#include "swfdec/swfdec_script_internal.h"
 #include "swfdec_out.h"
 #include "swfedit_file.h"
 
diff --git a/vivified/core/vivi_application.c b/vivified/core/vivi_application.c
index ab41662..623e293 100644
--- a/vivified/core/vivi_application.c
+++ b/vivified/core/vivi_application.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 #include "vivi_application.h"
 #include "vivi_debugger.h"
 #include "vivi_function.h"
diff --git a/vivified/core/vivi_application.h b/vivified/core/vivi_application.h
index d5d0c2b..0ebe0fd 100644
--- a/vivified/core/vivi_application.h
+++ b/vivified/core/vivi_application.h
@@ -20,7 +20,7 @@
 #ifndef _VIVI_APPLICATION_H_
 #define _VIVI_APPLICATION_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 
 G_BEGIN_DECLS
 
diff --git a/vivified/core/vivi_breakpoint.h b/vivified/core/vivi_breakpoint.h
index 35a8d28..ed9af66 100644
--- a/vivified/core/vivi_breakpoint.h
+++ b/vivified/core/vivi_breakpoint.h
@@ -20,7 +20,7 @@
 #ifndef _VIVI_BREAKPOINT_H_
 #define _VIVI_BREAKPOINT_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <vivified/core/vivi_application.h>
 
 G_BEGIN_DECLS
diff --git a/vivified/core/vivi_debugger.c b/vivified/core/vivi_debugger.c
index b65392f..98f4466 100644
--- a/vivified/core/vivi_debugger.c
+++ b/vivified/core/vivi_debugger.c
@@ -25,7 +25,7 @@
 #include "vivi_application.h"
 #include "vivi_marshal.h"
 /* FIXME: oops */
-#include "libswfdec/swfdec_player_internal.h"
+#include "swfdec/swfdec_player_internal.h"
 
 enum {
   ADD,
diff --git a/vivified/core/vivi_debugger.h b/vivified/core/vivi_debugger.h
index 76873ab..80a6765 100644
--- a/vivified/core/vivi_debugger.h
+++ b/vivified/core/vivi_debugger.h
@@ -20,7 +20,7 @@
 #ifndef _VIVI_DEBUGGER_H_
 #define _VIVI_DEBUGGER_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <vivified/core/vivi_application.h>
 
 G_BEGIN_DECLS
diff --git a/vivified/core/vivi_function.h b/vivified/core/vivi_function.h
index 2642579..f1d497c 100644
--- a/vivified/core/vivi_function.h
+++ b/vivified/core/vivi_function.h
@@ -17,7 +17,7 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <vivified/core/vivi_application.h>
 
 #ifndef _VIVI_FUNCTION_H_
diff --git a/vivified/core/vivi_ming.h b/vivified/core/vivi_ming.h
index 98d3b85..f33eb5a 100644
--- a/vivified/core/vivi_ming.h
+++ b/vivified/core/vivi_ming.h
@@ -17,7 +17,7 @@
  * Boston, MA  02110-1301  USA
  */
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <ming.h>
 
 #ifndef _VIVI_MING_H_
diff --git a/vivified/core/vivi_player_as.c b/vivified/core/vivi_player_as.c
index 4552cd4..f2d79e8 100644
--- a/vivified/core/vivi_player_as.c
+++ b/vivified/core/vivi_player_as.c
@@ -24,7 +24,7 @@
 #include "vivi_wrap.h"
 #include "vivi_application.h"
 #include "vivi_function.h"
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 
 VIVI_FUNCTION ("player_frame_get", vivi_player_as_frame_get)
 void
diff --git a/vivified/core/vivi_wrap.h b/vivified/core/vivi_wrap.h
index 2c551e0..9f0aec0 100644
--- a/vivified/core/vivi_wrap.h
+++ b/vivified/core/vivi_wrap.h
@@ -20,7 +20,7 @@
 #ifndef _VIVI_WRAP_H_
 #define _VIVI_WRAP_H_
 
-#include <libswfdec/swfdec.h>
+#include <swfdec/swfdec.h>
 #include <vivified/core/vivi_application.h>
 
 G_BEGIN_DECLS
diff --git a/vivified/ui/main.c b/vivified/ui/main.c
index 3462be6..38568ec 100644
--- a/vivified/ui/main.c
+++ b/vivified/ui/main.c
@@ -22,7 +22,7 @@
 #endif
 
 #include <gtk/gtk.h>
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 #include "vivified/core/vivified-core.h"
 #include "vivified/dock/vivified-dock.h"
 #include "vivi_window.h"
diff --git a/vivified/ui/vivi_movie_list.c b/vivified/ui/vivi_movie_list.c
index 35aa0dd..61a471f 100644
--- a/vivified/ui/vivi_movie_list.c
+++ b/vivified/ui/vivi_movie_list.c
@@ -22,8 +22,8 @@
 #endif
 
 #include <gtk/gtk.h>
-#include <libswfdec/swfdec_movie.h>
-#include <libswfdec/swfdec_player_internal.h>
+#include <swfdec/swfdec_movie.h>
+#include <swfdec/swfdec_player_internal.h>
 #include "vivi_movie_list.h"
 
 /*** GTK_TREE_MODEL ***/
diff --git a/vivified/ui/vivi_movies.c b/vivified/ui/vivi_movies.c
index a4c8e37..cc88466 100644
--- a/vivified/ui/vivi_movies.c
+++ b/vivified/ui/vivi_movies.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 #include "vivi_vivi_docklet.h"
 #include "vivi_movie_list.h"
 
diff --git a/vivified/ui/vivi_player.c b/vivified/ui/vivi_player.c
index e8134b2..f456e07 100644
--- a/vivified/ui/vivi_player.c
+++ b/vivified/ui/vivi_player.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #endif
 
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 #include "vivi_vivi_docklet.h"
 #include "vivi_widget.h"
 
diff --git a/vivified/ui/vivi_widget.h b/vivified/ui/vivi_widget.h
index b861ed1..f7d4727 100644
--- a/vivified/ui/vivi_widget.h
+++ b/vivified/ui/vivi_widget.h
@@ -20,7 +20,7 @@
 #ifndef _VIVI_WIDGET_H_
 #define _VIVI_WIDGET_H_
 
-#include <libswfdec-gtk/swfdec-gtk.h>
+#include <swfdec-gtk/swfdec-gtk.h>
 #include <vivified/core/vivified-core.h>
 
 G_BEGIN_DECLS
diff --git a/vivified/ui/vivi_window.h b/vivified/ui/vivi_window.h
index 80c0b27..7edcd5a 100644
--- a/vivified/ui/vivi_window.h
+++ b/vivified/ui/vivi_window.h
@@ -23,7 +23,7 @@
 #include <vivified/dock/vivified-dock.h>
 #include <vivified/core/vivified-core.h>
 /* FIXME */
-#include <libswfdec/swfdec_movie.h>
+#include <swfdec/swfdec_movie.h>
 
 G_BEGIN_DECLS
 
commit 8bd46798336662f4167d967791aac394ed1881c6
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jan 24 13:09:46 2008 +0100

    rename "libswfdec" to "swfdec" and "libswfdec-gtk" to "swfdec-gtk"

diff --git a/libswfdec-gtk/.gitignore b/libswfdec-gtk/.gitignore
deleted file mode 100644
index cad6c66..0000000
--- a/libswfdec-gtk/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-*.loT
-
-swfdec_playback.c
diff --git a/libswfdec-gtk/Makefile.am b/libswfdec-gtk/Makefile.am
deleted file mode 100644
index 4f724cf..0000000
--- a/libswfdec-gtk/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# this workaround is needed or autotools don't generate the .deps/*.Plo files correctly
-swfdec_playback.c: swfdec_playback_$(AUDIO_TYPE).c Makefile
-	cmp -s $(srcdir)/swfdec_playback_$(AUDIO_TYPE).c swfdec_playback.c \
-	|| cp $(srcdir)/swfdec_playback_$(AUDIO_TYPE).c swfdec_playback.c
-
-BUILT_SOURCES = swfdec_playback.c
-CLEANFILES = swfdec_playback.c
-
-lib_LTLIBRARIES = libswfdec-gtk- at SWFDEC_MAJORMINOR@.la
-
-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_socket.c \
-	swfdec_gtk_widget.c
-
-noinst_HEADERS = \
-	swfdec_playback.h \
-	swfdec_source.h
-
-libswfdec_gtk_ at SWFDEC_MAJORMINOR@_la_CFLAGS = \
-	-I$(top_srcdir) $(GLOBAL_CFLAGS) $(SWFDEC_CFLAGS) $(GTK_CFLAGS) \
-	$(AUDIO_CFLAGS) \
-	-DG_LOG_DOMAIN=\"Swfdec-Gtk\"
-libswfdec_gtk_ at SWFDEC_MAJORMINOR@_la_LDFLAGS = \
-	-version-info $(SWFDEC_LIBVERSION) \
-	-export-symbols-regex '^(swfdec_.*)' \
-	$(GTK_LIBS) $(SWFDEC_LIBS) $(AUDIO_LIBS) 
-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_socket.h \
-	swfdec_gtk_widget.h
-
-EXTRA_DIST = \
-	swfdec_playback_alsa.c \
-	swfdec_playback_oss.c \
-	swfdec_playback_pa.c \
-	swfdec_playback_none.c
diff --git a/libswfdec-gtk/swfdec-gtk.h b/libswfdec-gtk/swfdec-gtk.h
deleted file mode 100644
index b64cf83..0000000
--- a/libswfdec-gtk/swfdec-gtk.h
+++ /dev/null
@@ -1,29 +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_GTK_H__
-#define __SWFDEC_GTK_H__
-
-#include <libswfdec-gtk/swfdec_gtk_keys.h>
-#include <libswfdec-gtk/swfdec_gtk_loader.h>
-#include <libswfdec-gtk/swfdec_gtk_player.h>
-#include <libswfdec-gtk/swfdec_gtk_socket.h>
-#include <libswfdec-gtk/swfdec_gtk_widget.h>
-
-#endif
diff --git a/libswfdec-gtk/swfdec_gtk_keys.c b/libswfdec-gtk/swfdec_gtk_keys.c
deleted file mode 100644
index 69e0a6e..0000000
--- a/libswfdec-gtk/swfdec_gtk_keys.c
+++ /dev/null
@@ -1,77 +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
- */
-
-#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
-*/
-
-/**
- * swfdec_gtk_keycode_from_hardware_keycode:
- * @hardware_keycode: a hardware keycode sent from the X server
- *
- * Tries to transform an X hardware keycode to the corresponding #SwfdecKey.
- * This is a utility function for cases where key events need to be transformed
- * manually.
- *
- * Returns: the corresponding key code as used in Flash.
- **/
-guint
-swfdec_gtk_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
deleted file mode 100644
index d9b985b..0000000
--- a/libswfdec-gtk/swfdec_gtk_keys.h
+++ /dev/null
@@ -1,30 +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_GTK_KEYS_H_
-#define _SWFDEC_GTK_KEYS_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-guint		swfdec_gtk_keycode_from_hardware_keycode	(guint	hardware_keycode);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_gtk_loader.c b/libswfdec-gtk/swfdec_gtk_loader.c
deleted file mode 100644
index 375ca60..0000000
--- a/libswfdec-gtk/swfdec_gtk_loader.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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 <libsoup/soup.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include "swfdec_gtk_loader.h"
-
-/*** GTK-DOC ***/
-
-/**
- * SECTION:SwfdecGtkLoader
- * @title: SwfdecGtkLoader
- * @short_description: advanced loader able to load network ressources
- * @see_also: #SwfdecLoader
- *
- * #SwfdecGtkLoader is a #SwfdecLoader that is intended as an easy way to be 
- * access ressources that are not stored in files, such as HTTP. It can 
- * however be compiled with varying support for different protocols, so don't
- * rely on support for a particular protocol being available. If you need this,
- * code your own SwfdecLoader subclass.
- */
-
-/**
- * SwfdecGtkLoader:
- *
- * This is the object used to represent a loader. Since it may use varying 
- * backends, it is completely private.
- */
-
-struct _SwfdecGtkLoader
-{
-  SwfdecLoader		loader;
-
-  SoupMessage *		message;	/* the message we're sending */
-  gboolean		opened;		/* set after first bytes of data have arrived */
-};
-
-struct _SwfdecGtkLoaderClass {
-  SwfdecLoaderClass	loader_class;
-
-  SoupSession *		session;	/* the session used by the loader */
-};
-
-/*** SwfdecGtkLoader ***/
-
-G_DEFINE_TYPE (SwfdecGtkLoader, swfdec_gtk_loader, SWFDEC_TYPE_FILE_LOADER)
-
-static void
-swfdec_gtk_loader_set_size (SwfdecGtkLoader *gtk)
-{
-  const char *s = soup_message_get_header (gtk->message->response_headers, "Content-Length");
-  unsigned long l;
-  char *end;
-
-  if (s == NULL)
-    return;
-
-  errno = 0;
-  l = strtoul (s, &end, 10);
-  if (errno == 0 && *end == 0 && l <= G_MAXLONG)
-    swfdec_loader_set_size (SWFDEC_LOADER (gtk), l);
-}
-
-static void
-swfdec_gtk_loader_ensure_open (SwfdecGtkLoader *gtk)
-{
-  char *real_uri;
-
-  if (gtk->opened)
-    return;
-
-  real_uri = soup_uri_to_string (soup_message_get_uri (gtk->message), FALSE);
-  swfdec_gtk_loader_set_size (gtk);
-  swfdec_loader_set_url (SWFDEC_LOADER (gtk), real_uri);
-  swfdec_stream_open (SWFDEC_STREAM (gtk));
-  gtk->opened = TRUE;
-  g_free (real_uri);
-}
-
-static void
-swfdec_gtk_loader_push (SoupMessage *msg, gpointer loader)
-{
-  SwfdecGtkLoader *gtk = SWFDEC_GTK_LOADER (loader);
-  SwfdecBuffer *buffer;
-
-  swfdec_gtk_loader_ensure_open (gtk);
-  buffer = swfdec_buffer_new_and_alloc (msg->response.length);
-  memcpy (buffer->data, msg->response.body, msg->response.length);
-  swfdec_stream_push (loader, buffer);
-}
-
-static void
-swfdec_gtk_loader_finished (SoupMessage *msg, gpointer loader)
-{
-  if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) {
-    swfdec_gtk_loader_ensure_open (loader);
-    swfdec_stream_eof (loader);
-  } else {
-    swfdec_stream_error (loader, "%u %s", msg->status_code, msg->reason_phrase);
-  }
-}
-
-static void
-swfdec_gtk_loader_dispose (GObject *object)
-{
-  SwfdecGtkLoader *gtk = SWFDEC_GTK_LOADER (object);
-
-  if (gtk->message) {
-    g_signal_handlers_disconnect_by_func (gtk->message, swfdec_gtk_loader_push, gtk);
-    g_signal_handlers_disconnect_by_func (gtk->message, swfdec_gtk_loader_finished, gtk);
-    g_object_unref (gtk->message);
-    gtk->message = NULL;
-  }
-
-  G_OBJECT_CLASS (swfdec_gtk_loader_parent_class)->dispose (object);
-}
-
-static void
-swfdec_gtk_loader_load (SwfdecLoader *loader, SwfdecPlayer *player, 
-    const char *url_string, SwfdecLoaderRequest request, SwfdecBuffer *buffer)
-{
-  SwfdecURL *url;
-  
-  if (swfdec_url_path_is_relative (url_string)) {
-    url = swfdec_url_new_relative (swfdec_player_get_base_url (player), url_string);
-  } else {
-    url = swfdec_url_new (url_string);
-  }
-
-  if (url == NULL) {
-    swfdec_stream_error (SWFDEC_STREAM (loader), "invalid URL %s", url_string);
-    return;
-  };
-  if (!swfdec_url_has_protocol (url, "http") &&
-      !swfdec_url_has_protocol (url, "https")) {
-    SWFDEC_LOADER_CLASS (swfdec_gtk_loader_parent_class)->load (loader, player,
-	url_string, request, buffer);
-  } else {
-    SwfdecGtkLoader *gtk = SWFDEC_GTK_LOADER (loader);
-    SwfdecGtkLoaderClass *klass = SWFDEC_GTK_LOADER_GET_CLASS (gtk);
-
-    gtk->message = soup_message_new (request == SWFDEC_LOADER_REQUEST_POST ? "POST" : "GET",
-	swfdec_url_get_url (url));
-    soup_message_set_flags (gtk->message, SOUP_MESSAGE_OVERWRITE_CHUNKS);
-    g_signal_connect (gtk->message, "got-chunk", G_CALLBACK (swfdec_gtk_loader_push), gtk);
-    g_signal_connect (gtk->message, "finished", G_CALLBACK (swfdec_gtk_loader_finished), gtk);
-    if (buffer)
-      soup_message_set_request (gtk->message, "appliation/x-www-urlencoded",
-	  SOUP_BUFFER_USER_OWNED, (char *) buffer->data, buffer->length);
-    g_object_ref (gtk->message);
-    soup_session_queue_message (klass->session, gtk->message, NULL, NULL);
-  }
-  swfdec_url_free (url);
-}
-
-static void
-swfdec_gtk_loader_close (SwfdecStream *stream)
-{
-  SwfdecGtkLoader *gtk = SWFDEC_GTK_LOADER (stream);
-
-  if (gtk->message) {
-    gboolean eof;
-
-    g_object_get (stream, "eof", &eof, NULL);
-    if (!eof) {
-      SwfdecGtkLoaderClass *klass = SWFDEC_GTK_LOADER_GET_CLASS (gtk);
-
-      soup_session_cancel_message (klass->session, gtk->message);
-      g_object_unref (gtk->message);
-      gtk->message = NULL;
-    }
-  }
-}
-
-static void
-swfdec_gtk_loader_class_init (SwfdecGtkLoaderClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecStreamClass *stream_class = SWFDEC_STREAM_CLASS (klass);
-  SwfdecLoaderClass *loader_class = SWFDEC_LOADER_CLASS (klass);
-
-  object_class->dispose = swfdec_gtk_loader_dispose;
-
-  stream_class->close = swfdec_gtk_loader_close;
-
-  loader_class->load = swfdec_gtk_loader_load;
-  
-  klass->session = soup_session_async_new ();
-}
-
-static void
-swfdec_gtk_loader_init (SwfdecGtkLoader *gtk_loader)
-{
-}
-
diff --git a/libswfdec-gtk/swfdec_gtk_loader.h b/libswfdec-gtk/swfdec_gtk_loader.h
deleted file mode 100644
index ccae174..0000000
--- a/libswfdec-gtk/swfdec_gtk_loader.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_LOADER_H_
-#define _SWFDEC_GTK_LOADER_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _SwfdecGtkLoader SwfdecGtkLoader;
-typedef struct _SwfdecGtkLoaderClass SwfdecGtkLoaderClass;
-
-#define SWFDEC_TYPE_GTK_LOADER                    (swfdec_gtk_loader_get_type())
-#define SWFDEC_IS_GTK_LOADER(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_GTK_LOADER))
-#define SWFDEC_IS_GTK_LOADER_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_GTK_LOADER))
-#define SWFDEC_GTK_LOADER(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_GTK_LOADER, SwfdecGtkLoader))
-#define SWFDEC_GTK_LOADER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_GTK_LOADER, SwfdecGtkLoaderClass))
-#define SWFDEC_GTK_LOADER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_GTK_LOADER, SwfdecGtkLoaderClass))
-
-GType		swfdec_gtk_loader_get_type   	(void);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_gtk_player.c b/libswfdec-gtk/swfdec_gtk_player.c
deleted file mode 100644
index 6d0a0a3..0000000
--- a/libswfdec-gtk/swfdec_gtk_player.c
+++ /dev/null
@@ -1,315 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "libswfdec-gtk/swfdec_gtk_loader.h"
-#include "libswfdec-gtk/swfdec_gtk_player.h"
-#include "libswfdec-gtk/swfdec_gtk_socket.h"
-#include "libswfdec-gtk/swfdec_playback.h"
-#include "libswfdec-gtk/swfdec_source.h"
-
-struct _SwfdecGtkPlayer
-{
-  SwfdecPlayer		player;
-
-  GSource *		source;		/* source if playing, NULL otherwise */
-  SwfdecPlayback *	playback;	/* audio playback object */
-  gboolean		audio_enabled;	/* TRUE if audio should be played */
-  double		speed;		/* desired playback speed */
-};
-
-struct _SwfdecGtkPlayerClass
-{
-  SwfdecPlayerClass   	player_class;
-};
-
-enum {
-  PROP_0,
-  PROP_PLAYING,
-  PROP_AUDIO,
-  PROP_SPEED
-};
-
-/*** gtk-doc ***/
-
-/**
- * SECTION:SwfdecGtkPlayer
- * @title: SwfdecGtkPlayer
- * @short_description: an improved #SwfdecPlayer
- *
- * The #SwfdecGtkPlayer adds common functionality to the rather barebones 
- * #SwfdecPlayer class, such as automatic playback and audio handling. Note 
- * that by default, the player will be paused, so you need to call 
- * swfdec_gtk_player_set_playing () on the new player.
- *
- * @see_also: SwfdecPlayer
- */
-
-/**
- * SwfdecGtkPlayer:
- *
- * The structure for the Swfdec Gtk player contains no public fields.
- */
-
-/*** SWFDEC_GTK_PLAYER ***/
-
-G_DEFINE_TYPE (SwfdecGtkPlayer, swfdec_gtk_player, SWFDEC_TYPE_PLAYER)
-
-static void
-swfdec_gtk_player_get_property (GObject *object, guint param_id, GValue *value, 
-    GParamSpec * pspec)
-{
-  SwfdecGtkPlayer *player = SWFDEC_GTK_PLAYER (object);
-  
-  switch (param_id) {
-    case PROP_PLAYING:
-      g_value_set_boolean (value, player->source != NULL);
-      break;
-    case PROP_AUDIO:
-      g_value_set_boolean (value, player->audio_enabled);
-      break;
-    case PROP_SPEED:
-      g_value_set_double (value, player->speed);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_gtk_player_set_property (GObject *object, guint param_id, const GValue *value,
-    GParamSpec *pspec)
-{
-  SwfdecGtkPlayer *player = SWFDEC_GTK_PLAYER (object);
-  
-  switch (param_id) {
-    case PROP_PLAYING:
-      swfdec_gtk_player_set_playing (player, g_value_get_boolean (value));
-      break;
-    case PROP_AUDIO:
-      swfdec_gtk_player_set_audio_enabled (player, g_value_get_boolean (value));
-      break;
-    case PROP_SPEED:
-      swfdec_gtk_player_set_speed (player, g_value_get_double (value));
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_gtk_player_dispose (GObject *object)
-{
-  SwfdecGtkPlayer *player = SWFDEC_GTK_PLAYER (object);
-
-  swfdec_gtk_player_set_playing (player, FALSE);
-  g_assert (player->playback == NULL);
-
-  G_OBJECT_CLASS (swfdec_gtk_player_parent_class)->dispose (object);
-}
-
-static void
-swfdec_gtk_player_class_init (SwfdecGtkPlayerClass * g_class)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (g_class);
-
-  object_class->dispose = swfdec_gtk_player_dispose;
-  object_class->get_property = swfdec_gtk_player_get_property;
-  object_class->set_property = swfdec_gtk_player_set_property;
-
-  g_object_class_install_property (object_class, PROP_PLAYING,
-      g_param_spec_boolean ("playing", "playing", "TRUE if the player is playing (d'oh)",
-	  FALSE, G_PARAM_READWRITE));
-  g_object_class_install_property (object_class, PROP_AUDIO,
-      g_param_spec_boolean ("audio-enabled", "audio enabled", "TRUE if automatic audio handling is enabled",
-	  TRUE, G_PARAM_READWRITE));
-  g_object_class_install_property (object_class, PROP_SPEED,
-      g_param_spec_double ("speed", "speed", "desired playback speed",
-	  G_MINDOUBLE, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE));
-}
-
-static void
-swfdec_gtk_player_init (SwfdecGtkPlayer * player)
-{
-  player->speed = 1.0;
-  player->audio_enabled = TRUE;
-}
-
-/*** PUBLIC API ***/
-
-/**
- * swfdec_gtk_player_new:
- * @debugger: %NULL or a #SwfdecAsDebugger to debug this player
- *
- * Creates a new Swfdec Gtk player.
- * This function calls swfdec_init () for you if it wasn't called before.
- *
- * Returns: The new player
- **/
-SwfdecPlayer *
-swfdec_gtk_player_new (SwfdecAsDebugger *debugger)
-{
-  SwfdecPlayer *player;
-
-  swfdec_init ();
-  player = g_object_new (SWFDEC_TYPE_GTK_PLAYER, 
-      "loader-type", SWFDEC_TYPE_GTK_LOADER, "socket-type", SWFDEC_TYPE_GTK_SOCKET,
-      "debugger", debugger, NULL);
-
-  return player;
-}
-
-static void
-swfdec_gtk_player_update_audio (SwfdecGtkPlayer *player)
-{
-  gboolean should_play = player->audio_enabled;
-  
-  should_play &= (player->source != NULL);
-  should_play &= (player->speed == 1.0);
-
-  if (should_play && player->playback == NULL) {
-    player->playback = swfdec_playback_open (SWFDEC_PLAYER (player),
-	g_main_context_default ());
-  } else if (!should_play && player->playback != NULL) {
-    swfdec_playback_close (player->playback);
-    player->playback = NULL;
-  }
-}
-
-/**
- * swfdec_gtk_player_set_playing:
- * @player: a #SwfdecGtkPlayer
- * @playing: if the player should play or not
- *
- * Sets if @player should be playing or not. If the player is playing, a timer 
- * will be attached to the default main loop that periodically calls 
- * swfdec_player_advance().
- **/
-void
-swfdec_gtk_player_set_playing (SwfdecGtkPlayer *player, gboolean playing)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
-
-  if (playing && player->source == NULL) {
-    player->source = swfdec_iterate_source_new (SWFDEC_PLAYER (player), player->speed);
-    g_source_attach (player->source, NULL);
-  } else if (!playing && player->source != NULL) {
-    g_source_destroy (player->source);
-    g_source_unref (player->source);
-    player->source = NULL;
-  }
-  swfdec_gtk_player_update_audio (player);
-  g_object_notify (G_OBJECT (player), "playing");
-}
-
-/**
- * swfdec_gtk_player_get_playing:
- * @player: a #SwfdecGtkPlayer
- *
- * Queries if the player is playing.
- *
- * Returns: %TRUE if the player is playing
- **/
-gboolean
-swfdec_gtk_player_get_playing (SwfdecGtkPlayer *player)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
-
-  return player->source != NULL;
-}
-
-/**
- * swfdec_gtk_player_set_audio_enabled:
- * @player: a #SwfdecGtkPlayer
- * @enabled: %TRUE to enable audio
- *
- * Enables or disables automatic audio playback.
- **/
-void
-swfdec_gtk_player_set_audio_enabled (SwfdecGtkPlayer *player, gboolean enabled)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
-
-  if (player->audio_enabled == enabled)
-    return;
-  player->audio_enabled = enabled;
-  swfdec_gtk_player_update_audio (player);
-  g_object_notify (G_OBJECT (player), "audio-enabled");
-}
-
-/**
- * swfdec_gtk_player_get_audio_enabled:
- * @player: a #SwfdecGtkPlayer
- *
- * Queries if audio playback for @player is enabled or not.
- *
- * Returns: %TRUE if audio playback is enabled
- **/
-gboolean
-swfdec_gtk_player_get_audio_enabled (SwfdecGtkPlayer *player)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
-
-  return player->audio_enabled;
-}
-
-/**
- * swfdec_gtk_player_set_speed:
- * @player: a #SwfdecGtkPlayer
- * @speed: the new playback speed
- *
- * Sets the new playback speed. 1.0 means the default speed, bigger values
- * make playback happen faster. Audio will only play back if the speed is 
- * 1.0. Note that if the player is not playing when calling this function,
- * it will not automatically start.
- **/
-void
-swfdec_gtk_player_set_speed (SwfdecGtkPlayer *player, double speed)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_PLAYER (player));
-  g_return_if_fail (speed > 0.0);
-
-  player->speed = speed;
-  swfdec_gtk_player_update_audio (player);
-  if (player->source)
-    swfdec_iterate_source_set_speed (player->source, player->speed);
-  g_object_notify (G_OBJECT (player), "speed");
-}
-
-/**
- * swfdec_gtk_player_get_speed:
- * @player: a #SwfdecGtkPlayer
- *
- * Queries the current playback speed. If the player is currently paused, it
- * will report the speed that it would use if playing.
- *
- * Returns: the current playback speed.
- **/
-double
-swfdec_gtk_player_get_speed (SwfdecGtkPlayer *player)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_PLAYER (player), FALSE);
-
-  return player->speed;
-}
diff --git a/libswfdec-gtk/swfdec_gtk_player.h b/libswfdec-gtk/swfdec_gtk_player.h
deleted file mode 100644
index 3ff77bf..0000000
--- a/libswfdec-gtk/swfdec_gtk_player.h
+++ /dev/null
@@ -1,56 +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_GTK_PLAYER_H_
-#define _SWFDEC_GTK_PLAYER_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecGtkPlayer SwfdecGtkPlayer;
-typedef struct _SwfdecGtkPlayerClass SwfdecGtkPlayerClass;
-
-#define SWFDEC_TYPE_GTK_PLAYER                    (swfdec_gtk_player_get_type())
-#define SWFDEC_IS_GTK_PLAYER(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_GTK_PLAYER))
-#define SWFDEC_IS_GTK_PLAYER_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_GTK_PLAYER))
-#define SWFDEC_GTK_PLAYER(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayer))
-#define SWFDEC_GTK_PLAYER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayerClass))
-#define SWFDEC_GTK_PLAYER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_GTK_PLAYER, SwfdecGtkPlayerClass))
-
-GType 		swfdec_gtk_player_get_type    	(void);
-
-SwfdecPlayer *	swfdec_gtk_player_new	      	(SwfdecAsDebugger *	debugger);
-
-void		swfdec_gtk_player_set_playing 	(SwfdecGtkPlayer *	player,
-						 gboolean		playing);
-gboolean	swfdec_gtk_player_get_playing 	(SwfdecGtkPlayer *	player);
-void		swfdec_gtk_player_set_audio_enabled	
-						(SwfdecGtkPlayer *	player,
-						 gboolean		enabled);
-gboolean	swfdec_gtk_player_get_audio_enabled
-						(SwfdecGtkPlayer *	player);
-void		swfdec_gtk_player_set_speed	(SwfdecGtkPlayer *	player,
-						 double			speed);
-double		swfdec_gtk_player_get_speed 	(SwfdecGtkPlayer *	player);
-
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_gtk_socket.c b/libswfdec-gtk/swfdec_gtk_socket.c
deleted file mode 100644
index 08cbb76..0000000
--- a/libswfdec-gtk/swfdec_gtk_socket.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_socket.h"
-#include <libsoup/soup.h>
-#include <libsoup/soup-address.h>
-
-/*** GTK-DOC ***/
-
-/**
- * SECTION:SwfdecGtkSocket
- * @title: SwfdecGtkSocket
- * @short_description: a socket implementation integrating into the Gtk main loop
- * @see_also: #SwfdecSocket, #SwfdecGtkPlayer
- *
- * #SwfdecGtkSocket is a #SwfdecSocket that is a socket implementation that 
- * uses libsoup and integrates with the Gtk main loop. It is used by default
- * by the #SwfecGtkPlayer.
- */
-
-/**
- * SwfdecGtkSocket:
- *
- * This is the object used to represent a socket. It is completely private.
- */
-
-struct _SwfdecGtkSocket
-{
-  SwfdecSocket		socket;
-
-  SoupSocket *		sock;		/* libsoup socket we're using */
-  gboolean		sock_writable;	/* FALSE if writing would block */
-  SwfdecBufferQueue *	queue;		/* buffers we still need to push */
-};
-
-struct _SwfdecGtkSocketClass {
-  SwfdecSocketClass	socket_class;
-};
-
-/*** SwfdecGtkSocket ***/
-
-G_DEFINE_TYPE (SwfdecGtkSocket, swfdec_gtk_socket, SWFDEC_TYPE_SOCKET)
-
-static void
-swfdec_gtk_socket_close (SwfdecStream *stream)
-{
-  SwfdecGtkSocket *gtk = SWFDEC_GTK_SOCKET (stream);
-
-  soup_socket_disconnect (gtk->sock);
-}
-
-static void
-swfdec_gtk_socket_do_connect (SoupSocket *sock, int status, SwfdecGtkSocket *gtk)
-{
-  if (SOUP_STATUS_IS_SUCCESSFUL (status))
-    swfdec_stream_open (SWFDEC_STREAM (gtk));
-  else
-    swfdec_stream_error (SWFDEC_STREAM (gtk), "error connecting");
-
-}
-
-static void
-swfdec_gtk_socket_do_disconnect (SoupSocket *sock, SwfdecGtkSocket *gtk)
-{
-  swfdec_stream_eof (SWFDEC_STREAM (gtk));
-}
-
-static void
-swfdec_gtk_socket_do_read (SoupSocket *sock, SwfdecGtkSocket *gtk)
-{
-#define SWFDEC_GTK_SOCKET_BLOCK_SIZE 1024
-  SwfdecBuffer *buffer;
-  SoupSocketIOStatus status;
-  gsize len;
-
-  do {
-    buffer = swfdec_buffer_new_and_alloc (SWFDEC_GTK_SOCKET_BLOCK_SIZE);
-    status = soup_socket_read (sock, buffer, SWFDEC_GTK_SOCKET_BLOCK_SIZE, &len);
-    buffer->length = len;
-    switch (status) {
-      case SOUP_SOCKET_OK:
-	swfdec_stream_push (SWFDEC_STREAM (gtk), buffer);
-	break;
-      case SOUP_SOCKET_WOULD_BLOCK:
-      case SOUP_SOCKET_EOF:
-	swfdec_buffer_unref (buffer);
-	break;
-      case SOUP_SOCKET_ERROR:
-	swfdec_buffer_unref (buffer);
-	swfdec_stream_error (SWFDEC_STREAM (gtk), "error reading data");
-	break;
-      default:
-	g_warning ("unhandled status code %u from soup_socket_read()", (guint) status);
-	break;
-    }
-  } while (status == SOUP_SOCKET_OK);
-}
-
-static void
-swfdec_gtk_socket_do_write (SoupSocket *sock, SwfdecGtkSocket *gtk)
-{
-  SwfdecBuffer *buffer;
-  SoupSocketIOStatus status;
-  gsize len;
-
-  gtk->sock_writable = TRUE;
-  while ((buffer = swfdec_buffer_queue_peek_buffer (gtk->queue))) {
-    status = soup_socket_write (sock, buffer->data, buffer->length, &len);
-    swfdec_buffer_unref (buffer);
-    switch (status) {
-      case SOUP_SOCKET_OK:
-	buffer = swfdec_buffer_queue_pull (gtk->queue, len);
-	swfdec_buffer_unref (buffer);
-	break;
-      case SOUP_SOCKET_WOULD_BLOCK:
-      case SOUP_SOCKET_EOF:
-	gtk->sock_writable = FALSE;
-	break;
-      case SOUP_SOCKET_ERROR:
-	swfdec_stream_error (SWFDEC_STREAM (gtk), "error writing data");
-	break;
-      default:
-	g_warning ("unhandled status code %u from soup_socket_read()", (guint) status);
-	break;
-    }
-  };
-}
-
-static SwfdecSocket *
-swfdec_gtk_socket_create (const char *hostname, guint port)
-{
-  SwfdecGtkSocket *sock = g_object_new (SWFDEC_TYPE_GTK_SOCKET, NULL);
-  SoupAddress *addr;
-
-  addr = soup_address_new (hostname, port);
-  sock->sock = soup_socket_new (SOUP_SOCKET_FLAG_NONBLOCKING, TRUE,
-      /* FIXME: we should set nodelay, no? */
-      SOUP_SOCKET_FLAG_NODELAY, TRUE, NULL);
-  g_signal_connect (sock->sock, "connect-result", 
-      G_CALLBACK (swfdec_gtk_socket_do_connect), socket);
-  g_signal_connect (sock->sock, "disconnect", 
-      G_CALLBACK (swfdec_gtk_socket_do_disconnect), socket);
-  g_signal_connect (sock->sock, "readable", 
-      G_CALLBACK (swfdec_gtk_socket_do_read), socket);
-  g_signal_connect (sock->sock, "writable", 
-      G_CALLBACK (swfdec_gtk_socket_do_write), socket);
-
-  return SWFDEC_SOCKET (sock);
-}
-
-static void
-swfdec_gtk_socket_send (SwfdecSocket *sock, SwfdecBuffer *buffer)
-{
-  SwfdecGtkSocket *gtk = SWFDEC_GTK_SOCKET (sock);
-
-  swfdec_buffer_queue_push (gtk->queue, buffer);
-  if (gtk->sock_writable)
-    swfdec_gtk_socket_do_write (gtk->sock, gtk);
-}
-
-static void
-swfdec_gtk_socket_dispose (GObject *object)
-{
-  SwfdecGtkSocket *gtk = SWFDEC_GTK_SOCKET (object);
-
-  if (gtk->sock) {
-    g_signal_handlers_disconnect_matched (gtk->sock, G_SIGNAL_MATCH_DATA,
-      0, 0, NULL, NULL, gtk);
-    g_object_unref (gtk->sock);
-    gtk->sock = NULL;
-  }
-  if (gtk->queue) {
-    swfdec_buffer_queue_unref (gtk->queue);
-    gtk->queue = NULL;
-  }
-  G_OBJECT_CLASS (swfdec_gtk_socket_parent_class)->dispose (object);
-}
-
-static void
-swfdec_gtk_socket_class_init (SwfdecGtkSocketClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecStreamClass *stream_class = SWFDEC_STREAM_CLASS (klass);
-  SwfdecSocketClass *socket_class = SWFDEC_SOCKET_CLASS (klass);
-
-  object_class->dispose = swfdec_gtk_socket_dispose;
-
-  stream_class->close = swfdec_gtk_socket_close;
-
-  socket_class->create = swfdec_gtk_socket_create;
-  socket_class->send = swfdec_gtk_socket_send;
-}
-
-static void
-swfdec_gtk_socket_init (SwfdecGtkSocket *gtk)
-{
-  gtk->sock_writable = TRUE;
-  gtk->queue = swfdec_buffer_queue_new ();
-}
-
diff --git a/libswfdec-gtk/swfdec_gtk_socket.h b/libswfdec-gtk/swfdec_gtk_socket.h
deleted file mode 100644
index 62bb546..0000000
--- a/libswfdec-gtk/swfdec_gtk_socket.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_SOCKET_H_
-#define _SWFDEC_GTK_SOCKET_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _SwfdecGtkSocket SwfdecGtkSocket;
-typedef struct _SwfdecGtkSocketClass SwfdecGtkSocketClass;
-
-#define SWFDEC_TYPE_GTK_SOCKET                    (swfdec_gtk_socket_get_type())
-#define SWFDEC_IS_GTK_SOCKET(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_GTK_SOCKET))
-#define SWFDEC_IS_GTK_SOCKET_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_GTK_SOCKET))
-#define SWFDEC_GTK_SOCKET(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_GTK_SOCKET, SwfdecGtkSocket))
-#define SWFDEC_GTK_SOCKET_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_GTK_SOCKET, SwfdecGtkSocketClass))
-#define SWFDEC_GTK_SOCKET_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_GTK_SOCKET, SwfdecGtkSocketClass))
-
-GType		swfdec_gtk_socket_get_type   	(void);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_gtk_widget.c b/libswfdec-gtk/swfdec_gtk_widget.c
deleted file mode 100644
index 4836aa0..0000000
--- a/libswfdec-gtk/swfdec_gtk_widget.c
+++ /dev/null
@@ -1,683 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006-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 <math.h>
-#include <gdk/gdkkeysyms.h>
-#include "swfdec_gtk_widget.h"
-#include "swfdec_gtk_keys.h"
-
-struct _SwfdecGtkWidgetPrivate
-{
-  SwfdecPlayer *	player;		/* the video we play */
-
-  gboolean		renderer_set;	/* TRUE if a special renderer has been set */
-  cairo_surface_type_t	renderer;	/* the renderer that was set */
-  gboolean		interactive;	/* TRUE if this widget propagates keyboard and mouse events */
-};
-
-enum {
-  PROP_0,
-  PROP_PLAYER,
-  PROP_INTERACTIVE,
-  PROP_RENDERER_SET,
-  PROP_RENDERER
-};
-
-/*** gtk-doc ***/
-
-/**
- * SECTION:SwfdecGtkWidget
- * @title: SwfdecGtkWidget
- * @short_description: a #GtkWidget for embedding SWF files
- *
- * This is a widget for playing Flash movies rendered with Swfdec in a Gtk 
- * application. It supports a lot of advanced features, if you want to use
- * them. If you don't want to use them and just want to embed a movie in 
- * your application, swfdec_gtk_widget_new() will probably be the only 
- * function you need.
- *
- * @see_also: SwfdecGtkPlayer
- */
-
-/**
- * SwfdecGtkWidget:
- *
- * The structure for the Swfdec Gtk widget contains no public fields.
- */
-
-/*** SWFDEC_GTK_WIDGET ***/
-
-G_DEFINE_TYPE (SwfdecGtkWidget, swfdec_gtk_widget, GTK_TYPE_WIDGET)
-
-static gboolean
-swfdec_gtk_widget_motion_notify (GtkWidget *gtkwidget, GdkEventMotion *event)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-  int x, y;
-
-  gdk_window_get_pointer (gtkwidget->window, &x, &y, NULL);
-
-  if (priv->interactive && priv->player)
-    swfdec_player_mouse_move (priv->player, x, y);
-  
-  return FALSE;
-}
-
-static gboolean
-swfdec_gtk_widget_leave_notify (GtkWidget *gtkwidget, GdkEventCrossing *event)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  if (priv->interactive && priv->player) {
-    swfdec_player_mouse_move (priv->player, event->x, event->y);
-  }
-  return FALSE;
-}
-
-static gboolean
-swfdec_gtk_widget_button_press (GtkWidget *gtkwidget, GdkEventButton *event)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  if (event->type == GDK_BUTTON_PRESS && event->button <= 32 && priv->interactive && priv->player) {
-    swfdec_player_mouse_press (priv->player, event->x, event->y, event->button);
-  }
-  return FALSE;
-}
-
-static gboolean
-swfdec_gtk_widget_button_release (GtkWidget *gtkwidget, GdkEventButton *event)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  if (event->button <= 32 && priv->interactive && priv->player) {
-    swfdec_player_mouse_release (priv->player, event->x, event->y, event->button);
-  }
-  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_gtk_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 && priv->player) {
-    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 TRUE;
-  }
-
-  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 && priv->player) {
-    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 TRUE;
-  }
-
-  return FALSE;
-}
-
-static cairo_surface_t *
-swfdec_gtk_widget_create_renderer (cairo_surface_type_t type, int width, int height)
-{
-  if (type == CAIRO_SURFACE_TYPE_IMAGE) {
-    return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
-  } else {
-    return NULL;
-  }
-}
-
-static gboolean
-swfdec_gtk_widget_expose (GtkWidget *gtkwidget, GdkEventExpose *event)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-  cairo_t *cr;
-  cairo_surface_t *surface = NULL;
-
-  if (event->window != gtkwidget->window)
-    return FALSE;
-  if (priv->player == NULL)
-    return FALSE;
-
-  if (!priv->renderer_set ||
-      (surface = swfdec_gtk_widget_create_renderer (priv->renderer, 
-	      event->area.width, event->area.height)) == NULL) {
-    cr = gdk_cairo_create (gtkwidget->window);
-  } else {
-    cr = cairo_create (surface);
-    cairo_translate (cr, -event->area.x, -event->area.y);
-  }
-  swfdec_player_render (priv->player, cr,
-      event->area.x, event->area.y, event->area.width, event->area.height);
-  cairo_show_page (cr);
-  cairo_destroy (cr);
-
-  if (surface) {
-    cairo_t *crw = gdk_cairo_create (gtkwidget->window);
-    cairo_set_source_surface (crw, surface, event->area.x, event->area.y);
-    cairo_paint (crw);
-    cairo_destroy (crw);
-    cairo_surface_destroy (surface);
-  }
-
-  return FALSE;
-}
-
-static void
-swfdec_gtk_widget_get_property (GObject *object, guint param_id, GValue *value, 
-    GParamSpec * pspec)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (object);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-  
-  switch (param_id) {
-    case PROP_PLAYER:
-      g_value_set_object (value, priv->player);
-      break;
-    case PROP_INTERACTIVE:
-      g_value_set_boolean (value, priv->interactive);
-      break;
-    case PROP_RENDERER_SET:
-      g_value_set_boolean (value, priv->renderer_set);
-      break;
-    case PROP_RENDERER:
-      g_value_set_uint (value, priv->renderer);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_gtk_widget_set_property (GObject *object, guint param_id, const GValue *value,
-    GParamSpec *pspec)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (object);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-  
-  switch (param_id) {
-    case PROP_PLAYER:
-      swfdec_gtk_widget_set_player (widget, g_value_get_object (value));
-      break;
-    case PROP_INTERACTIVE:
-      swfdec_gtk_widget_set_interactive (widget, g_value_get_boolean (value));
-      break;
-    case PROP_RENDERER_SET:
-      priv->renderer_set = g_value_get_boolean (value);
-      gtk_widget_queue_draw (GTK_WIDGET (widget));
-      break;
-    case PROP_RENDERER:
-      priv->renderer = g_value_get_uint (value);
-      if (priv->renderer_set)
-	gtk_widget_queue_draw (GTK_WIDGET (widget));
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_gtk_widget_dispose (GObject *object)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (object);
-
-  swfdec_gtk_widget_set_player (widget, NULL);
-
-  G_OBJECT_CLASS (swfdec_gtk_widget_parent_class)->dispose (object);
-}
-
-static void
-swfdec_gtk_widget_size_allocate (GtkWidget *gtkwidget, GtkAllocation *allocation)
-{
-  SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  gtkwidget->allocation = *allocation;
-
-  if (priv->player && swfdec_player_is_initialized (priv->player))
-    swfdec_player_set_size (priv->player, allocation->width, allocation->height);
-  if (GTK_WIDGET_REALIZED (gtkwidget)) {
-    gdk_window_move_resize (gtkwidget->window, 
-	allocation->x, allocation->y, allocation->width, allocation->height);
-  }
-}
-
-static void
-swfdec_gtk_widget_size_request (GtkWidget *gtkwidget, GtkRequisition *req)
-{
-  SwfdecGtkWidget * widget = SWFDEC_GTK_WIDGET (gtkwidget);
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  if (priv->player == NULL) {
-    req->width = req->height = 0;
-  } else {
-    guint w, h;
-    swfdec_player_get_default_size (priv->player, &w, &h);
-    /* FIXME: set some sane upper limit here? */
-    req->width = MIN (w, G_MAXINT);
-    req->height = MIN (h, G_MAXINT);
-  } 
-}
-
-static void
-swfdec_gtk_widget_update_cursor (SwfdecGtkWidget *widget)
-{
-  GdkWindow *window = GTK_WIDGET (widget)->window;
-  GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (widget));
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-  SwfdecMouseCursor swfcursor;
-  GdkCursor *cursor;
-
-  if (window == NULL)
-    return;
-  if (priv->interactive)
-    g_object_get (priv->player, "mouse-cursor", &swfcursor, NULL);
-  else
-    swfcursor = SWFDEC_MOUSE_CURSOR_NORMAL;
-
-  switch (swfcursor) {
-    case SWFDEC_MOUSE_CURSOR_NONE:
-      {
-	GdkBitmap *bitmap;
-	GdkColor color = { 0, 0, 0, 0 };
-	char data = 0;
-
-	bitmap = gdk_bitmap_create_from_data (window, &data, 1, 1);
-	if (bitmap == NULL)
-	  return;
-	cursor = gdk_cursor_new_from_pixmap (bitmap, bitmap, &color, &color, 0, 0);
-	gdk_window_set_cursor (window, cursor);
-	gdk_cursor_unref (cursor);
-	g_object_unref (bitmap);
-	break;
-      }
-    case SWFDEC_MOUSE_CURSOR_TEXT:
-      cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
-      gdk_window_set_cursor (window, cursor);
-      gdk_cursor_unref (cursor);
-      break;
-    case SWFDEC_MOUSE_CURSOR_CLICK:
-      cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
-      gdk_window_set_cursor (window, cursor);
-      gdk_cursor_unref (cursor);
-      break;
-    case SWFDEC_MOUSE_CURSOR_NORMAL:
-      cursor = gdk_cursor_new_for_display (display, GDK_LEFT_PTR);
-      gdk_window_set_cursor (window, cursor);
-      gdk_cursor_unref (cursor);
-      break;
-    default:
-      g_warning ("invalid cursor %d", (int) swfcursor);
-      gdk_window_set_cursor (window, NULL);
-      break;
-  }
-}
-
-static void
-swfdec_gtk_widget_realize (GtkWidget *widget)
-{
-  GdkWindowAttr attributes;
-  gint attributes_mask;
-
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.event_mask = gtk_widget_get_events (widget);
-  attributes.event_mask |= GDK_EXPOSURE_MASK | 
-			   GDK_BUTTON_PRESS_MASK |
-			   GDK_BUTTON_RELEASE_MASK |
-			   GDK_LEAVE_NOTIFY_MASK | 
-			   GDK_POINTER_MOTION_MASK | 
-			   GDK_POINTER_MOTION_HINT_MASK |
-			   GDK_KEY_PRESS_MASK |
-			   GDK_KEY_RELEASE_MASK;
-
-  attributes_mask = GDK_WA_X | GDK_WA_Y;
-
-  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
-      &attributes, attributes_mask);
-  gdk_window_set_user_data (widget->window, widget);
-
-  widget->style = gtk_style_attach (widget->style, widget->window);
-
-  if (SWFDEC_GTK_WIDGET (widget)->priv->player) {
-    swfdec_gtk_widget_update_cursor (SWFDEC_GTK_WIDGET (widget));
-  }
-}
-
-static void
-swfdec_gtk_widget_class_init (SwfdecGtkWidgetClass * g_class)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (g_class);
-  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (g_class);
-
-  object_class->dispose = swfdec_gtk_widget_dispose;
-  object_class->get_property = swfdec_gtk_widget_get_property;
-  object_class->set_property = swfdec_gtk_widget_set_property;
-
-  g_object_class_install_property (object_class, PROP_PLAYER,
-      g_param_spec_object ("player", "player", "player that is displayed",
-	  SWFDEC_TYPE_PLAYER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-  g_object_class_install_property (object_class, PROP_INTERACTIVE,
-      g_param_spec_boolean ("interactive", "interactive", "if mouse events are processed",
-	  TRUE, G_PARAM_READWRITE));
-  g_object_class_install_property (object_class, PROP_RENDERER_SET,
-      g_param_spec_boolean ("renderer-set", "renderer set", "if an intermediate renderer should be used",
-	  TRUE, G_PARAM_READWRITE));
-  /* FIXME: get an enum for cairo_surface_type_t */
-  g_object_class_install_property (object_class, PROP_RENDERER,
-      g_param_spec_uint ("renderer", "renderer", "cairo_surface_type_t of intermediate renderer to use",
-	  0, G_MAXUINT, CAIRO_SURFACE_TYPE_IMAGE, G_PARAM_READWRITE));
-
-  widget_class->realize = swfdec_gtk_widget_realize;
-  widget_class->size_request = swfdec_gtk_widget_size_request;
-  widget_class->size_allocate = swfdec_gtk_widget_size_allocate;
-  widget_class->expose_event = swfdec_gtk_widget_expose;
-  widget_class->button_press_event = swfdec_gtk_widget_button_press;
-  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));
-}
-
-static void
-swfdec_gtk_widget_init (SwfdecGtkWidget * widget)
-{
-  SwfdecGtkWidgetPrivate *priv;
-  
-  priv = widget->priv = G_TYPE_INSTANCE_GET_PRIVATE (widget, SWFDEC_TYPE_GTK_WIDGET, SwfdecGtkWidgetPrivate);
-
-  priv->interactive = TRUE;
-  priv->renderer = CAIRO_SURFACE_TYPE_IMAGE;
-
-  GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
-}
-
-static void
-swfdec_gtk_widget_invalidate_cb (SwfdecPlayer *player, const SwfdecRectangle *extents,
-    const SwfdecRectangle *rect, guint n_rects, SwfdecGtkWidget *widget)
-{
-  GdkRegion *region;
-  guint i;
-
-  if (!GTK_WIDGET_REALIZED (widget))
-    return;
-
-  region = gdk_region_new ();
-  for (i = 0; i < n_rects; i++) {
-    gdk_region_union_with_rect (region, (GdkRectangle *) &rect[i]);
-  }
-  gdk_window_invalidate_region (GTK_WIDGET (widget)->window, region, FALSE);
-  gdk_region_destroy (region);
-}
-
-static void
-swfdec_gtk_widget_notify_cb (SwfdecPlayer *player, GParamSpec *pspec, SwfdecGtkWidget *widget)
-{
-  if (g_str_equal (pspec->name, "mouse-cursor")) {
-    swfdec_gtk_widget_update_cursor (widget);
-  } else if (g_str_equal (pspec->name, "initialized")) {
-    gtk_widget_queue_resize (GTK_WIDGET (widget));
-  }
-}
-
-/*** PUBLIC API ***/
-
-/**
- * swfdec_gtk_widget_set_player:
- * @widget: a #SwfdecGtkWidget
- * @player: the #SwfdecPlayer to display or %NULL for none
- *
- * Sets the new player to display in @widget.
- **/
-void
-swfdec_gtk_widget_set_player (SwfdecGtkWidget *widget, SwfdecPlayer *player)
-{
-  SwfdecGtkWidgetPrivate *priv = widget->priv;
-
-  g_return_if_fail (SWFDEC_IS_GTK_WIDGET (widget));
-  g_return_if_fail (player == NULL || SWFDEC_IS_PLAYER (player));
-  
-  if (priv->player) {
-    g_signal_handlers_disconnect_by_func (priv->player, swfdec_gtk_widget_invalidate_cb, widget);
-    g_signal_handlers_disconnect_by_func (priv->player, swfdec_gtk_widget_notify_cb, widget);
-    g_object_unref (priv->player);
-  }
-  priv->player = player;
-  if (player) {
-    g_signal_connect (player, "invalidate", G_CALLBACK (swfdec_gtk_widget_invalidate_cb), widget);
-    g_signal_connect (player, "notify", G_CALLBACK (swfdec_gtk_widget_notify_cb), widget);
-    g_object_ref (player);
-    swfdec_gtk_widget_update_cursor (widget);
-  } else {
-    if (GTK_WIDGET (widget)->window)
-      gdk_window_set_cursor (GTK_WIDGET (widget)->window, NULL); 
-  }
-  gtk_widget_queue_resize (GTK_WIDGET (widget));
-  g_object_notify (G_OBJECT (widget), "player");
-}
-
-/**
- * swfdec_gtk_widget_get_player:
- * @widget: a #SwfdecGtkWidget
- *
- * Gets the player that is currently played back in this @widget.
- *
- * Returns: the #SwfdecPlayer or %NULL if none
- **/
-SwfdecPlayer *
-swfdec_gtk_widget_get_player (SwfdecGtkWidget *widget)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_WIDGET (widget), NULL);
-
-  return widget->priv->player;
-}
-
-/**
- * swfdec_gtk_widget_new:
- * @player: a #SwfdecPlayer or %NULL
- *
- * Creates a new #SwfdecGtkWidget to display @player.
- *
- * Returns: the new widget that displays @player
- **/
-GtkWidget *
-swfdec_gtk_widget_new (SwfdecPlayer *player)
-{
-  SwfdecGtkWidget *widget;
-  
-  g_return_val_if_fail (player == NULL || SWFDEC_IS_PLAYER (player), NULL);
-
-  widget = g_object_new (SWFDEC_TYPE_GTK_WIDGET, "player", player, NULL);
-
-  return GTK_WIDGET (widget);
-}
-
-/**
- * swfdec_gtk_widget_set_interactive:
- * @widget: a #SwfdecGtkWidget
- * @interactive: %TRUE to make the widget interactive
- *
- * Sets the widget to be interactive or not. An interactive widget processes 
- * mouse and keyboard events, while a non-interactive widget does not care about
- * user input. Widgets are interactive by default.
- **/
-void
-swfdec_gtk_widget_set_interactive (SwfdecGtkWidget *widget, gboolean interactive)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_WIDGET (widget));
-
-  widget->priv->interactive = interactive;
-  swfdec_gtk_widget_update_cursor (widget);
-  g_object_notify (G_OBJECT (widget), "interactive");
-}
-
-/**
- * swfdec_gtk_widget_get_interactive:
- * @widget: a #SwfdecGtkWidget
- *
- * Queries if the @widget is currently interactive. See 
- * swfdec_gtk_widget_set_interactive() for details.
- *
- * Returns: %TRUE if the widget is interactive, %FALSE otherwise.
- **/
-gboolean
-swfdec_gtk_widget_get_interactive (SwfdecGtkWidget *widget)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_WIDGET (widget), FALSE);
-
-  return widget->priv->interactive;
-}
-
-/**
- * swfdec_gtk_widget_set_renderer:
- * @widget: a #SwfdecGtkWidget
- * @renderer: a #cairo_surface_type_t for the intermediate renderer
- *
- * Tells @widget to use an intermediate surface for rendering. This is
- * useful for debugging or performance measurements inside swfdec and is 
- * probably not interesting for anyone else.
- **/
-void
-swfdec_gtk_widget_set_renderer (SwfdecGtkWidget *widget, cairo_surface_type_t renderer)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_WIDGET (widget));
-
-  widget->priv->renderer = renderer;
-  if (widget->priv->renderer_set == FALSE) {
-    widget->priv->renderer_set = TRUE;
-    g_object_notify (G_OBJECT (widget), "renderer-set");
-  }
-  g_object_notify (G_OBJECT (widget), "renderer");
-}
-
-/**
- * swfdec_gtk_widget_unset_renderer:
- * @widget: a #SwfdecGtkWidget
- *
- * Unsets the use of an intermediate rendering surface. See 
- * swfdec_gtk_widget_set_renderer() for details.
- **/
-void
-swfdec_gtk_widget_unset_renderer (SwfdecGtkWidget *widget)
-{
-  g_return_if_fail (SWFDEC_IS_GTK_WIDGET (widget));
-
-  if (widget->priv->renderer_set == FALSE)
-    return;
-  widget->priv->renderer_set = FALSE;
-  g_object_notify (G_OBJECT (widget), "renderer-set");
-}
-
-/**
- * swfdec_gtk_widget_get_renderer:
- * @widget: a #SwfdecGtkWidget
- *
- * Gets the intermediate renderer that is or would be in use by @widget. Use
- * swfdec_gtk_widget_uses_renderer() to check if an intermediate renderer is in
- * use. See swfdec_gtk_widget_set_renderer() for details.
- *
- * Returns: the type of the intermediate renderer
- **/
-cairo_surface_type_t
-swfdec_gtk_widget_get_renderer (SwfdecGtkWidget *widget)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_WIDGET (widget), CAIRO_SURFACE_TYPE_IMAGE);
-
-  return widget->priv->renderer;
-}
-
-/**
- * swfdec_gtk_widget_uses_renderer:
- * @widget: a #SwfdecGtkWidget
- *
- * Queries if an intermediate renderer set via swfdec_gtk_widget_set_renderer()
- * is currently in use.
- *
- * Returns: %TRUE if an intermediate renderer is used.
- **/
-gboolean
-swfdec_gtk_widget_uses_renderer (SwfdecGtkWidget *widget)
-{
-  g_return_val_if_fail (SWFDEC_IS_GTK_WIDGET (widget), FALSE);
-
-  return widget->priv->renderer_set;
-}
-
diff --git a/libswfdec-gtk/swfdec_gtk_widget.h b/libswfdec-gtk/swfdec_gtk_widget.h
deleted file mode 100644
index 86b03fd..0000000
--- a/libswfdec-gtk/swfdec_gtk_widget.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006-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_WIDGET_H_
-#define _SWFDEC_GTK_WIDGET_H_
-
-#include <gtk/gtk.h>
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecGtkWidget SwfdecGtkWidget;
-typedef struct _SwfdecGtkWidgetClass SwfdecGtkWidgetClass;
-typedef struct _SwfdecGtkWidgetPrivate SwfdecGtkWidgetPrivate;
-
-#define SWFDEC_TYPE_GTK_WIDGET                    (swfdec_gtk_widget_get_type())
-#define SWFDEC_IS_GTK_WIDGET(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_GTK_WIDGET))
-#define SWFDEC_IS_GTK_WIDGET_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_GTK_WIDGET))
-#define SWFDEC_GTK_WIDGET(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_GTK_WIDGET, SwfdecGtkWidget))
-#define SWFDEC_GTK_WIDGET_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_GTK_WIDGET, SwfdecGtkWidgetClass))
-
-struct _SwfdecGtkWidget
-{
-  GtkWidget			widget;
-
-  /*< private >*/
-  SwfdecGtkWidgetPrivate *	priv;
-};
-
-struct _SwfdecGtkWidgetClass
-{
-  GtkWidgetClass		widget_class;
-};
-
-GType		swfdec_gtk_widget_get_type		(void);
-
-GtkWidget *	swfdec_gtk_widget_new			(SwfdecPlayer *		player);
-
-void		swfdec_gtk_widget_set_player		(SwfdecGtkWidget *	widget,
-							 SwfdecPlayer *		player);
-SwfdecPlayer *	swfdec_gtk_widget_get_player		(SwfdecGtkWidget *	widget);
-void		swfdec_gtk_widget_set_renderer		(SwfdecGtkWidget *	widget,
-							 cairo_surface_type_t	renderer);
-void		swfdec_gtk_widget_unset_renderer	(SwfdecGtkWidget *      widget);
-cairo_surface_type_t
-		swfdec_gtk_widget_get_renderer		(SwfdecGtkWidget *	widget);
-gboolean	swfdec_gtk_widget_uses_renderer		(SwfdecGtkWidget *	widget);
-void		swfdec_gtk_widget_set_interactive	(SwfdecGtkWidget *	widget,
-							 gboolean		interactive);
-gboolean	swfdec_gtk_widget_get_interactive	(SwfdecGtkWidget *	widget);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_playback.h b/libswfdec-gtk/swfdec_playback.h
deleted file mode 100644
index 8be67dd..0000000
--- a/libswfdec-gtk/swfdec_playback.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_PLAYBACK_H_
-#define _SWFDEC_PLAYBACK_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecPlayback SwfdecPlayback;
-
-SwfdecPlayback *swfdec_playback_open	(SwfdecPlayer *		player,
-					 GMainContext *		context);
-
-void		swfdec_playback_close	(SwfdecPlayback *	sound);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec-gtk/swfdec_playback_alsa.c b/libswfdec-gtk/swfdec_playback_alsa.c
deleted file mode 100644
index bddd189..0000000
--- a/libswfdec-gtk/swfdec_playback_alsa.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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 <alsa/asoundlib.h>
-#include "swfdec_playback.h"
-
-/* Why ALSA sucks for beginners:
- * - snd_pcm_delay is not sample-exact, but period-exact most of the time.
- *   Yay for getting told the time every 512 samples when a human notices
- *   a delay of 100 samples (oooops)
- * - lots of functions are simply not implemented. So the super-smart idea
- *   of using snd_pcm_rewind to avoid XRUNS and still get low latency has
- *   some issues when dmix just returns -EIO all of the time. That wouldn't
- *   be so bad if there was actually a way to query if it's supported.
- * - But to make up for all this, you have 10 hardware parameters, 10 
- *   software parameters and 10 configuration parameters. All of this is
- *   naturally supported on 10 driver APIs depending on kernel. So if your
- *   sound card seems to do weird stuff, that is not my fault.
- * Welcome to Linux sound in the 21st century.
- */
-
-/*** DEFINITIONS ***/
-
-struct _SwfdecPlayback {
-  SwfdecPlayer *	player;
-  GList *		streams;	/* all Stream objects */
-  GMainContext *	context;	/* context we work in */
-};
-
-typedef struct {
-  SwfdecPlayback *     	sound;		/* reference to sound object */
-  SwfdecAudio *		audio;		/* the audio we play back */
-  snd_pcm_t *		pcm;		/* the pcm we play back to */
-  GSource **		sources;	/* sources for writing data */
-  guint			n_sources;	/* number of sources */
-  guint			offset;		/* offset into sound */
-} Stream;
-
-#define ALSA_TRY(func,msg) G_STMT_START{ \
-  int err = func; \
-  if (err < 0) \
-    g_printerr (msg ": %s\n", snd_strerror (err)); \
-}G_STMT_END
-
-#define ALSA_ERROR(func,msg,retval) G_STMT_START { \
-  int err = func; \
-  if (err < 0) { \
-    g_printerr (msg ": %s\n", snd_strerror (err)); \
-    return retval; \
-  } \
-}G_STMT_END
-
-/*** STREAMS ***/
-
-static snd_pcm_uframes_t
-write_player (Stream *stream, const snd_pcm_channel_area_t *dst, 
-    snd_pcm_uframes_t offset, snd_pcm_uframes_t avail)
-{
-  /* FIXME: do a long path if this doesn't hold */
-  g_assert (dst[1].first - dst[0].first == 16);
-  g_assert (dst[0].addr == dst[1].addr);
-  g_assert (dst[0].step == dst[1].step);
-  g_assert (dst[0].step == 32);
-
-  memset ((guint8 *) dst[0].addr + offset * dst[0].step / 8, 0, avail * 4);
-  swfdec_audio_render (stream->audio, (gint16 *) ((guint8 *) dst[0].addr + offset * dst[0].step / 8), 
-      stream->offset, avail);
-  //g_print ("rendering %u %u\n", stream->offset, (guint) avail);
-  return avail;
-}
-
-static gboolean
-try_write (Stream *stream)
-{
-  snd_pcm_sframes_t avail_result;
-  snd_pcm_uframes_t offset, avail;
-  const snd_pcm_channel_area_t *dst;
-
-  while (TRUE) {
-    avail_result = snd_pcm_avail_update (stream->pcm);
-    ALSA_ERROR (avail_result, "snd_pcm_avail_update failed", FALSE);
-    if (avail_result == 0)
-      return TRUE;
-    avail = avail_result;
-    ALSA_ERROR (snd_pcm_mmap_begin (stream->pcm, &dst, &offset, &avail),
-	"snd_pcm_mmap_begin failed", FALSE);
-    //g_print ("  avail = %u\n", (guint) avail);
-
-    avail = write_player (stream, dst, offset, avail);
-    if (snd_pcm_mmap_commit (stream->pcm, offset, avail) < 0) {
-      g_printerr ("snd_pcm_mmap_commit failed\n");
-      return FALSE;
-    }
-    stream->offset += avail;
-    //g_print ("offset: %u (+%u)\n", stream->offset, (guint) avail);
-  }
-  return TRUE;
-}
-
-static void
-swfdec_playback_stream_remove_handlers (Stream *stream)
-{
-  guint i;
-
-  for (i = 0; i < stream->n_sources; i++) {
-    if (stream->sources[i]) {
-      g_source_destroy (stream->sources[i]);
-      g_source_unref (stream->sources[i]);
-      stream->sources[i] = NULL;
-    }
-  }
-}
-
-static void swfdec_playback_stream_start (Stream *stream);
-static gboolean
-handle_stream (GIOChannel *source, GIOCondition cond, gpointer data)
-{
-  Stream *stream = data;
-  snd_pcm_state_t state;
-
-  state = snd_pcm_state (stream->pcm);
-  if (state != SND_PCM_STATE_RUNNING) {
-    swfdec_playback_stream_start (stream);
-  } else {
-    try_write (stream);
-  }
-  return TRUE;
-}
-
-static void
-swfdec_playback_stream_install_handlers (Stream *stream)
-{
-  GIOChannel *channel;
-
-  if (stream->n_sources > 0) {
-    struct pollfd polls[stream->n_sources];
-    guint i, count;
-    if (stream->n_sources > 1)
-      g_printerr ("attention: more than one fd!\n");
-    count = snd_pcm_poll_descriptors (stream->pcm, polls, stream->n_sources);
-    for (i = 0; i < count; i++) {
-      if (stream->sources[i] != NULL)
-	continue;
-      channel = g_io_channel_unix_new (polls[i].fd);
-      stream->sources[i] = g_io_create_watch (channel, polls[i].events);
-      g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
-      g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
-      g_io_channel_unref (channel);
-      g_source_attach (stream->sources[i], stream->sound->context);
-    }
-  }
-}
-
-static void
-swfdec_playback_stream_start (Stream *stream)
-{
-  snd_pcm_state_t state = snd_pcm_state (stream->pcm);
-  switch (state) {
-    case SND_PCM_STATE_XRUN:
-      ALSA_ERROR (snd_pcm_prepare (stream->pcm), "no prepare",);
-      //g_print ("XRUN!\n");
-      /* fall through */
-    case SND_PCM_STATE_SUSPENDED:
-    case SND_PCM_STATE_PREPARED:
-      stream->offset = 0;
-      //g_print ("offset: %u (delay: %ld)\n", sound->offset, delay);
-      if (try_write (stream)) {
-	ALSA_ERROR (snd_pcm_start (stream->pcm), "error starting",);
-	swfdec_playback_stream_install_handlers (stream);
-      }
-      break;
-    case SND_PCM_STATE_OPEN:
-    case SND_PCM_STATE_SETUP:
-    case SND_PCM_STATE_RUNNING:
-    case SND_PCM_STATE_DRAINING:
-    case SND_PCM_STATE_PAUSED:
-    case SND_PCM_STATE_DISCONNECTED:
-    default:
-      g_assert_not_reached ();
-  }
-}
-
-static void
-swfdec_playback_stream_open (SwfdecPlayback *sound, SwfdecAudio *audio)
-{
-  Stream *stream;
-  snd_pcm_t *ret;
-  snd_pcm_hw_params_t *hw_params;
-  guint rate;
-  snd_pcm_uframes_t uframes;
-
-  /* "default" uses dmix, and dmix ticks way slow, so this thingy here stutters */
-  ALSA_ERROR (snd_pcm_open (&ret, "default", SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK),
-      "Failed to open sound device", );
-
-  snd_pcm_hw_params_alloca (&hw_params);
-  if (snd_pcm_hw_params_any (ret, hw_params) < 0) {
-    g_printerr ("No sound format available\n");
-    return;
-  }
-  if (snd_pcm_hw_params_set_access (ret, hw_params, SND_PCM_ACCESS_MMAP_INTERLEAVED) < 0) {
-    g_printerr ("Failed setting access\n");
-    goto fail;
-  }
-  if (snd_pcm_hw_params_set_format (ret, hw_params, SND_PCM_FORMAT_S16) < 0) {
-    g_printerr ("Failed setting format\n");
-    goto fail;
-  }
-  if (snd_pcm_hw_params_set_channels (ret, hw_params, 2) < 0) {
-    g_printerr ("Failed setting channels\n");
-    goto fail;
-  }
-  rate = 44100;
-  if (snd_pcm_hw_params_set_rate_near (ret, hw_params, &rate, 0) < 0) {
-    g_printerr ("Failed setting rate\n");
-    goto fail;
-  }
-  uframes = 16384;
-  if (snd_pcm_hw_params_set_buffer_size_near (ret, hw_params, &uframes) < 0) {
-    g_printerr ("Failed setting buffer size\n");
-    goto fail;
-  }
-  if (snd_pcm_hw_params (ret, hw_params) < 0) {
-    g_printerr ("Could not set hardware parameters\n");
-    goto fail;
-  }
-#if 0
-  {
-    snd_output_t *log;
-    snd_output_stdio_attach (&log, stderr, 0);
-    snd_pcm_hw_params_dump (hw_params, log);
-  }
-#endif
-  stream = g_new0 (Stream, 1);
-  stream->sound = sound;
-  stream->audio = g_object_ref (audio);
-  stream->pcm = ret;
-  stream->n_sources = snd_pcm_poll_descriptors_count (ret);
-  if (stream->n_sources > 0)
-    stream->sources = g_new0 (GSource *, stream->n_sources);
-  sound->streams = g_list_prepend (sound->streams, stream);
-  swfdec_playback_stream_start (stream);
-  return;
-
-fail:
-  snd_pcm_close (ret);
-}
-
-static void
-swfdec_playback_stream_close (Stream *stream)
-{
-  ALSA_TRY (snd_pcm_close (stream->pcm), "failed closing");
-  swfdec_playback_stream_remove_handlers (stream);
-  g_free (stream->sources);
-  stream->sound->streams = g_list_remove (stream->sound->streams, stream);
-  g_object_unref (stream->audio);
-  g_free (stream);
-}
-
-/*** SOUND ***/
-
-static void
-advance_before (SwfdecPlayer *player, guint msecs, guint audio_samples, gpointer data)
-{
-  SwfdecPlayback *sound = data;
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (audio_samples >= stream->offset) {
-      stream->offset = 0;
-    } else {
-      stream->offset -= audio_samples;
-    }
-  }
-}
-
-static void
-audio_added (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  swfdec_playback_stream_open (sound, audio);
-}
-
-static void
-audio_removed (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (stream->audio == audio) {
-      swfdec_playback_stream_close (stream);
-      return;
-    }
-  }
-}
-
-SwfdecPlayback *
-swfdec_playback_open (SwfdecPlayer *player, GMainContext *context)
-{
-  SwfdecPlayback *sound;
-  const GList *walk;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (context != NULL, NULL);
-
-  sound = g_new0 (SwfdecPlayback, 1);
-  sound->player = player;
-  g_signal_connect (player, "advance", G_CALLBACK (advance_before), sound);
-  g_signal_connect (player, "audio-added", G_CALLBACK (audio_added), sound);
-  g_signal_connect (player, "audio-removed", G_CALLBACK (audio_removed), sound);
-  for (walk = swfdec_player_get_audio (player); walk; walk = walk->next) {
-    swfdec_playback_stream_open (sound, walk->data);
-  }
-  g_main_context_ref (context);
-  sound->context = context;
-  return sound;
-}
-
-void
-swfdec_playback_close (SwfdecPlayback *sound)
-{
-#define REMOVE_HANDLER_FULL(obj,func,data,count) G_STMT_START {\
-  if (g_signal_handlers_disconnect_by_func ((obj), \
-	G_CALLBACK (func), (data)) != (count)) { \
-    g_assert_not_reached (); \
-  } \
-} G_STMT_END
-#define REMOVE_HANDLER(obj,func,data) REMOVE_HANDLER_FULL (obj, func, data, 1)
-
-  while (sound->streams)
-    swfdec_playback_stream_close (sound->streams->data);
-  REMOVE_HANDLER (sound->player, advance_before, sound);
-  REMOVE_HANDLER (sound->player, audio_added, sound);
-  REMOVE_HANDLER (sound->player, audio_removed, sound);
-  g_main_context_unref (sound->context);
-  g_free (sound);
-}
-
-
diff --git a/libswfdec-gtk/swfdec_playback_none.c b/libswfdec-gtk/swfdec_playback_none.c
deleted file mode 100644
index 79651d6..0000000
--- a/libswfdec-gtk/swfdec_playback_none.c
+++ /dev/null
@@ -1,38 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_playback.h"
-
-/* STUBS ONLY - audio is disabled */
-
-SwfdecPlayback *
-swfdec_playback_open (SwfdecPlayer *player, GMainContext *context)
-{
-  return GINT_TO_POINTER (-1);
-}
-
-void
-swfdec_playback_close (SwfdecPlayback *sound)
-{
-  g_assert (sound == GINT_TO_POINTER (-1));
-}
diff --git a/libswfdec-gtk/swfdec_playback_oss.c b/libswfdec-gtk/swfdec_playback_oss.c
deleted file mode 100644
index c2eb493..0000000
--- a/libswfdec-gtk/swfdec_playback_oss.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* Swfdec
- * Copyright © 2006 Benjamin Otte <otte at gnome.org>
- * Copyright © 2007 Eric Anholt <eric at anholt.net>
- *
- * 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 <sys/soundcard.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "swfdec_playback.h"
-
-/** @file Implements swfdec audio playback by opening /dev/dsp per stream
- * and playing out through that.
- *
- * Allowing multiple access to /dev/dsp is not required by the OSS API spec,
- * but FreeBSD's sound system lets you, which is what this file was written
- * for.
- */
-
-/*** DEFINITIONS ***/
-
-struct _SwfdecPlayback {
-  SwfdecPlayer *	player;
-  GList *		streams;	/* all Stream objects */
-  GMainContext *	context;	/* context we work in */
-};
-
-typedef struct {
-  SwfdecPlayback *     	sound;		/* reference to sound object */
-  SwfdecAudio *		audio;		/* the audio we play back */
-  int			dsp_fd;
-  int			fragsize;	/* Audio fragment size */
-  GSource *		source;		/* source for writing data */
-  guint			offset;		/* offset into sound */
-} Stream;
-
-/* Size of one of our audio samples, in bytes */
-#define SAMPLESIZE	2
-#define CHANNELS	2
-
-/*** STREAMS ***/
-
-static gboolean
-handle_stream (GIOChannel *source, GIOCondition cond, gpointer data)
-{
-  Stream *stream = data;
-  char *frag = malloc(stream->fragsize);
-
-  if (frag == NULL) {
-    g_printerr ("Failed to allocate fragment of size %d\n",
-		stream->fragsize);
-    return FALSE;
-  }
-
-  while (TRUE) {
-    int ret;
-    audio_buf_info spaceinfo;
-
-    ret = ioctl(stream->dsp_fd, SNDCTL_DSP_GETOSPACE, &spaceinfo);
-    if (ret == -1) {
-      g_printerr ("Failed to get output buffer availability\n");
-      free(frag);
-      return FALSE;
-    }
-    g_assert(spaceinfo.fragsize == stream->fragsize);
-
-    if (spaceinfo.fragments == 0)
-      break;
-
-    memset (frag, 0, stream->fragsize);
-    swfdec_audio_render (stream->audio, (gint16 *)frag, stream->offset,
-			 stream->fragsize / SAMPLESIZE / CHANNELS);
-
-    ret = write (stream->dsp_fd, frag, stream->fragsize);
-    if (ret != stream->fragsize) {
-      g_printerr ("Failed to write fragment\n");
-      free(frag);
-      return FALSE;
-    }
-
-    stream->offset += stream->fragsize / SAMPLESIZE / CHANNELS;
-  }
-
-  free(frag);
-
-  return TRUE;
-}
-
-static void
-swfdec_playback_stream_open (SwfdecPlayback *sound, SwfdecAudio *audio)
-{
-  GIOChannel *channel;
-  Stream *stream;
-  guint rate;
-  int dsp_fd, ret, format, channels, fragsize;
-
-  dsp_fd = open("/dev/dsp", O_WRONLY);
-  if (dsp_fd == -1) {
-    g_printerr ("Failed to open /dev/dsp\n");
-    return;
-  }
-
-  format = AFMT_S16_LE;
-  ret = ioctl(dsp_fd, SNDCTL_DSP_SETFMT, &format);
-  if (ret == -1) {
-    g_printerr ("Failed to set sound format\n");
-    close(dsp_fd);
-    return;
-  }
-
-  channels = 2;
-  ret = ioctl(dsp_fd, SNDCTL_DSP_CHANNELS, &channels);
-  if (ret == -1) {
-    g_printerr ("Failed to set stereo\n");
-    close(dsp_fd);
-    return;
-  }
-
-  rate = 44100;
-  ret = ioctl(dsp_fd, SNDCTL_DSP_SPEED, &rate);
-  if (ret == -1) {
-    g_printerr ("Failed to set rate\n");
-    close(dsp_fd);
-    return;
-  }
-
-  ret = ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, &fragsize);
-  if (ret == -1) {
-    g_printerr ("Failed to get fragment size\n");
-    close(dsp_fd);
-    return;
-  }
-
-  stream = g_new0 (Stream, 1);
-  stream->sound = sound;
-  stream->audio = g_object_ref (audio);
-  stream->dsp_fd = dsp_fd;
-  stream->fragsize = fragsize;
-  sound->streams = g_list_prepend (sound->streams, stream);
-
-  channel = g_io_channel_unix_new (stream->dsp_fd);
-  stream->source = g_io_create_watch (channel, G_IO_OUT);
-  g_source_set_priority (stream->source, G_PRIORITY_HIGH);
-  g_source_set_callback (stream->source, (GSourceFunc) handle_stream, stream,
-			 NULL);
-  g_io_channel_unref (channel);
-  g_source_attach (stream->source, stream->sound->context);
-
-  return;
-}
-
-static void
-swfdec_playback_stream_close (Stream *stream)
-{
-  close (stream->dsp_fd);
-  g_source_destroy (stream->source);
-  g_source_unref (stream->source);
-  stream->sound->streams = g_list_remove (stream->sound->streams, stream);
-  g_object_unref (stream->audio);
-  g_free (stream);
-}
-
-/*** SOUND ***/
-
-static void
-advance_before (SwfdecPlayer *player, guint msecs, guint audio_samples, gpointer data)
-{
-  SwfdecPlayback *sound = data;
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (audio_samples >= stream->offset) {
-      stream->offset = 0;
-    } else {
-      stream->offset -= audio_samples;
-    }
-  }
-}
-
-static void
-audio_added (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  swfdec_playback_stream_open (sound, audio);
-}
-
-static void
-audio_removed (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (stream->audio == audio) {
-      swfdec_playback_stream_close (stream);
-      return;
-    }
-  }
-  g_assert_not_reached ();
-}
-
-SwfdecPlayback *
-swfdec_playback_open (SwfdecPlayer *player, GMainContext *context)
-{
-  SwfdecPlayback *sound;
-  const GList *walk;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (context != NULL, NULL);
-
-  sound = g_new0 (SwfdecPlayback, 1);
-  sound->player = player;
-  g_signal_connect (player, "advance", G_CALLBACK (advance_before), sound);
-  g_signal_connect (player, "audio-added", G_CALLBACK (audio_added), sound);
-  g_signal_connect (player, "audio-removed", G_CALLBACK (audio_removed), sound);
-  for (walk = swfdec_player_get_audio (player); walk; walk = walk->next) {
-    swfdec_playback_stream_open (sound, walk->data);
-  }
-  g_main_context_ref (context);
-  sound->context = context;
-  return sound;
-}
-
-void
-swfdec_playback_close (SwfdecPlayback *sound)
-{
-#define REMOVE_HANDLER_FULL(obj,func,data,count) G_STMT_START {\
-  if (g_signal_handlers_disconnect_by_func ((obj), \
-	G_CALLBACK (func), (data)) != (count)) { \
-    g_assert_not_reached (); \
-  } \
-} G_STMT_END
-#define REMOVE_HANDLER(obj,func,data) REMOVE_HANDLER_FULL (obj, func, data, 1)
-
-  while (sound->streams)
-    swfdec_playback_stream_close (sound->streams->data);
-  REMOVE_HANDLER (sound->player, advance_before, sound);
-  REMOVE_HANDLER (sound->player, audio_added, sound);
-  REMOVE_HANDLER (sound->player, audio_removed, sound);
-  g_main_context_unref (sound->context);
-  g_free (sound);
-}
-
-
diff --git a/libswfdec-gtk/swfdec_playback_pa.c b/libswfdec-gtk/swfdec_playback_pa.c
deleted file mode 100644
index 755b033..0000000
--- a/libswfdec-gtk/swfdec_playback_pa.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* Swfdec
- * Copyright © 2006 Benjamin Otte <otte at gnome.org>
- * Copyright © 2007 Eric Anholt <eric at anholt.net>
- *
- * 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 <stdlib.h>
-#include <string.h>
-
-#include "swfdec_playback.h"
-#include "pulse/pulseaudio.h"
-#include "pulse/glib-mainloop.h"
-
-/** @file Implements swfdec audio playback by dumping swfdec streams out
- * using pulseaudio streams.
- */
-
-/*** DEFINITIONS ***/
-
-struct _SwfdecPlayback {
-  SwfdecPlayer *	player;
-  GList *		streams;	/* all Stream objects */
-  GMainContext *	context;	/* glib context we work in */
-  pa_glib_mainloop *	pa_mainloop;	/* PA to glib mainloop connection */
-  pa_context *		pa;		/* PA context for sound rendering */
-};
-
-typedef struct {
-  SwfdecPlayback *     	sound;		/* reference to sound object */
-  SwfdecAudio *		audio;		/* the audio we play back */
-  guint			offset;		/* offset into sound */
-  pa_stream *		pa;		/* PA stream */
-  pa_cvolume		volume;		/* Volume control.  Not yet used. */
-  gboolean		no_more;
-} Stream;
-
-/* Size of one of our audio samples, in bytes */
-#define SAMPLESIZE	2
-#define CHANNELS	2
-
-/*** STREAMS ***/
-
-static void
-stream_write_callback (pa_stream *pa,
-		       size_t bytes,
-		       void *data)
-{
-  Stream *stream = data;
-  char *frag;
-  unsigned int samples = bytes / SAMPLESIZE / CHANNELS;
-  int err;
-
-  if (stream->no_more)
-    return;
-
-  /* Adjust to our rounded-down number */
-  bytes = samples * SAMPLESIZE * CHANNELS;
-
-  frag = malloc (bytes);
-  if (frag == NULL) {
-    g_printerr ("Failed to allocate fragment of size %d\n", (int)bytes);
-    return;
-  }
-
-  /* Set up our fragment and render swfdec's audio into it. The swfdec audio
-   * decoder renders deltas from the existing data in the fragment.
-   */
-  memset (frag, 0, bytes);
-  swfdec_audio_render (stream->audio, (gint16 *)frag, stream->offset,
-		       samples);
-
-  /* Send the new fragment out the PA stream */
-  err = pa_stream_write (pa, frag, bytes, NULL, 0, PA_SEEK_RELATIVE);
-  if (err != 0) {
-    g_printerr ("Failed to write fragment to PA stream: %s\n",
-		pa_strerror(pa_context_errno(stream->sound->pa)));
-  }
-
-  /* Advance playback pointer */
-  stream->offset += samples;
-
-  free(frag);
-}
-
-static void
-stream_drain_complete (pa_stream *pa, int success, void *data)
-{
-  Stream *stream = data;
-
-  pa_stream_disconnect (stream->pa);
-  pa_stream_unref (stream->pa);
-  g_object_unref (stream->audio);
-  g_free (stream);
-}
-
-static void
-swfdec_playback_stream_close (Stream *stream)
-{
-  /* Pull it off of the active stream list. */
-  stream->sound->streams = g_list_remove (stream->sound->streams, stream);
-
-  /* If we have created a PA stream, defer freeing until we drain it. */
-  if (stream->pa != NULL) {
-    stream->no_more = 1;
-    pa_operation_unref (pa_stream_drain (stream->pa,
-					 stream_drain_complete,
-					 stream));
-  } else {
-    g_object_unref (stream->audio);
-    g_free (stream);
-  }
-}
-
-static void
-stream_state_callback (pa_stream *pa, void *data)
-{
-  switch (pa_stream_get_state(pa)) {
-  case PA_STREAM_CREATING:
-  case PA_STREAM_TERMINATED:
-  case PA_STREAM_READY:
-  case PA_STREAM_UNCONNECTED:
-    break;
-
-  case PA_STREAM_FAILED:
-    g_printerr("PA stream failed: %s\n",
-	       pa_strerror(pa_context_errno(pa_stream_get_context(pa))));
-  default:
-    break;
-  }
-}
-
-static void
-swfdec_playback_stream_open (SwfdecPlayback *sound, SwfdecAudio *audio)
-{
-  Stream *stream;
-  pa_sample_spec spec = {
-    .format = PA_SAMPLE_S16LE,
-    .rate = 44100,
-    .channels = CHANNELS,
-  };
-  int err;
-
-  stream = g_new0 (Stream, 1);
-  stream->sound = sound;
-  stream->audio = g_object_ref (audio);
-  sound->streams = g_list_prepend (sound->streams, stream);
-
-  /* If we failed to initialize the context, don't try to create the stream.
-   * We still have to get put in the list, because swfdec_playback.c expects
-   * to find it in the list for removal later.
-   */
-  if (sound->pa == NULL)
-    return;
-
-  /* Create our stream */
-  stream->pa = pa_stream_new(sound->pa,
-			     "swfdec stream",
-			     &spec,
-			     NULL /* Default channel map */
-			     );
-  if (stream->pa == NULL) {
-    g_printerr("Failed to create PA stream\n");
-    swfdec_playback_stream_close(stream);
-    return;
-  }
-
-  /* Start at default volume */
-  pa_cvolume_set(&stream->volume, CHANNELS, PA_VOLUME_NORM);
-
-  /* Hook up our stream write callback for when new data is needed */
-  pa_stream_set_state_callback(stream->pa, stream_state_callback, stream);
-  pa_stream_set_write_callback(stream->pa, stream_write_callback, stream);
-
-  /* Connect it up as a playback stream. */
-  err = pa_stream_connect_playback(stream->pa,
-				   NULL, /* Default device */
-				   NULL /* Default buffering */,
-				   0, /* No flags */
-				   &stream->volume,
-				   NULL /* Don't sync to any stream */
-				   );
-  if (err != 0) {
-    g_printerr ("Failed to connect PA stream: %s\n",
-		pa_strerror(pa_context_errno(sound->pa)));
-    swfdec_playback_stream_close(stream);
-    return;
-  }
-}
-
-/*** SOUND ***/
-
-static void
-advance_before (SwfdecPlayer *player, guint msecs, guint audio_samples, gpointer data)
-{
-  SwfdecPlayback *sound = data;
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (audio_samples >= stream->offset) {
-      stream->offset = 0;
-    } else {
-      stream->offset -= audio_samples;
-    }
-  }
-}
- 
-static void
-audio_added (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  swfdec_playback_stream_open (sound, audio);
-}
-
-static void
-audio_removed (SwfdecPlayer *player, SwfdecAudio *audio, SwfdecPlayback *sound)
-{
-  GList *walk;
-
-  for (walk = sound->streams; walk; walk = walk->next) {
-    Stream *stream = walk->data;
-    if (stream->audio == audio) {
-      swfdec_playback_stream_close (stream);
-      return;
-    }
-  }
-  g_assert_not_reached ();
-}
-static void
-context_state_callback (pa_context *pa, void *data)
-{
-  SwfdecPlayback *sound = data;
-
-  switch (pa_context_get_state(pa)) {
-  case PA_CONTEXT_FAILED:
-    g_printerr ("PA context failed\n");
-    pa_context_unref (pa);
-    sound->pa = NULL;
-    break;
-
-  default:
-  case PA_CONTEXT_TERMINATED:
-  case PA_CONTEXT_UNCONNECTED:
-  case PA_CONTEXT_CONNECTING:
-  case PA_CONTEXT_AUTHORIZING:
-  case PA_CONTEXT_SETTING_NAME:
-  case PA_CONTEXT_READY:
-    break;
-
-  }
-}
-
-SwfdecPlayback *
-swfdec_playback_open (SwfdecPlayer *player, GMainContext *context)
-{
-  SwfdecPlayback *sound;
-  const GList *walk;
-  pa_mainloop_api *pa_api;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (context != NULL, NULL);
-
-  sound = g_new0 (SwfdecPlayback, 1);
-  sound->player = player;
-  g_signal_connect (player, "advance", G_CALLBACK (advance_before), sound);
-  g_signal_connect (player, "audio-added", G_CALLBACK (audio_added), sound);
-  g_signal_connect (player, "audio-removed", G_CALLBACK (audio_removed), sound);
-
-  /* Create our mainloop attachment to glib.  XXX: I hope this means we don't
-   * have to run the main loop using pa functions.
-   */
-  sound->pa_mainloop = pa_glib_mainloop_new (context);
-  pa_api = pa_glib_mainloop_get_api (sound->pa_mainloop);
-
-  sound->pa = pa_context_new (pa_api, "swfdec");
-
-  pa_context_set_state_callback (sound->pa, context_state_callback, sound);
-  pa_context_connect (sound->pa,
-		      NULL, /* default server */
-		      0, /* default flags */
-		      NULL /* spawning api */
-		      );
-
-  for (walk = swfdec_player_get_audio (player); walk; walk = walk->next) {
-    swfdec_playback_stream_open (sound, walk->data);
-  }
-  g_main_context_ref (context);
-  sound->context = context;
-  return sound;
-}
-
-static void
-context_drain_complete (pa_context *pa, void *data)
-{
-  pa_context_disconnect (pa);
-  pa_context_unref (pa);
-}
-
-void
-swfdec_playback_close (SwfdecPlayback *sound)
-{
-  pa_operation *op;
-
-#define REMOVE_HANDLER_FULL(obj,func,data,count) G_STMT_START {\
-  if (g_signal_handlers_disconnect_by_func ((obj), \
-	G_CALLBACK (func), (data)) != (count)) { \
-    g_assert_not_reached (); \
-  } \
-} G_STMT_END
-#define REMOVE_HANDLER(obj,func,data) REMOVE_HANDLER_FULL (obj, func, data, 1)
-
-  while (sound->streams)
-    swfdec_playback_stream_close (sound->streams->data);
-  REMOVE_HANDLER (sound->player, advance_before, sound);
-  REMOVE_HANDLER (sound->player, audio_added, sound);
-  REMOVE_HANDLER (sound->player, audio_removed, sound);
-
-  if (sound->pa != NULL) {
-    op = pa_context_drain (sound->pa, context_drain_complete, NULL);
-    if (op == NULL) {
-      pa_context_disconnect (sound->pa);
-      pa_context_unref (sound->pa);
-    } else {
-      pa_operation_unref (op);
-    }
-    pa_glib_mainloop_free (sound->pa_mainloop);
-  }
-
-  g_main_context_unref (sound->context);
-  g_free (sound);
-}
-
-
diff --git a/libswfdec-gtk/swfdec_source.c b/libswfdec-gtk/swfdec_source.c
deleted file mode 100644
index 471b99b..0000000
--- a/libswfdec-gtk/swfdec_source.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_source.h"
-
-static glong
-my_time_val_difference (const GTimeVal *compare, const GTimeVal *now)
-{
-  return (compare->tv_sec - now->tv_sec) * 1000 + 
-    (compare->tv_usec - now->tv_usec) / 1000;
-}
-
-/*** SwfdecIterateSource ***/
-
-typedef struct _SwfdecIterateSource SwfdecIterateSource;
-struct _SwfdecIterateSource {
-  GSource		source;
-  SwfdecPlayer *	player;		/* player we manage or NULL if player was deleted */
-  double		speed;		/* inverse playback speed (so 0.5 means double speed) */
-  gulong		notify;		/* set for iterate notifications (only valid when player != NULL) */
-  GTimeVal		last;		/* last time */
-};
-
-static glong
-swfdec_iterate_get_msecs_to_next_event (GSource *source_)
-{
-  SwfdecIterateSource *source = (SwfdecIterateSource *) source_;
-  GTimeVal now;
-  glong diff;
-
-  g_assert (source->player);
-  diff = swfdec_player_get_next_event (source->player);
-  if (diff == -1)
-    return G_MAXLONG;
-  diff *= source->speed;
-  g_source_get_current_time (source_, &now);
-  /* should really add to source->last instead of subtracting from now */
-  g_time_val_add (&now, -diff * 1000);
-  diff = my_time_val_difference (&source->last, &now);
-
-  return diff;
-}
-
-static gboolean
-swfdec_iterate_prepare (GSource *source, gint *timeout)
-{
-  glong diff;
-  
-  diff = swfdec_iterate_get_msecs_to_next_event (source);
-  if (((SwfdecIterateSource *) source)->player == NULL) {
-    *timeout = 0;
-    return TRUE;
-  }
-
-  if (diff == G_MAXLONG) {
-    *timeout = -1;
-    return FALSE;
-  } else if (diff <= 0) {
-    *timeout = 0;
-    return TRUE;
-  } else {
-    *timeout = diff;
-    return FALSE;
-  }
-}
-
-static gboolean
-swfdec_iterate_check (GSource *source)
-{
-  glong diff;
-  
-  if (((SwfdecIterateSource *) source)->player == NULL)
-    return 0;
-  diff = swfdec_iterate_get_msecs_to_next_event (source);
-  return diff < 0;
-}
-
-static gboolean
-swfdec_iterate_dispatch (GSource *source_, GSourceFunc callback, gpointer user_data)
-{
-  SwfdecIterateSource *source = (SwfdecIterateSource *) source_;
-  glong diff;
-  
-  if (source->player == NULL)
-    return FALSE;
-  diff = swfdec_iterate_get_msecs_to_next_event (source_);
-  if (diff > 0)
-    return TRUE;
-  diff = swfdec_player_get_next_event (source->player) - diff;
-  swfdec_player_advance (source->player, diff);
-  return TRUE;
-}
-
-static void
-swfdec_iterate_finalize (GSource *source_)
-{
-  SwfdecIterateSource *source = (SwfdecIterateSource *) source_;
-
-  if (source->notify && source->player) {
-    g_signal_handler_disconnect (source->player, source->notify);
-  }
-  if (source->player) {
-    g_object_remove_weak_pointer (G_OBJECT (source->player), (gpointer) &source->player);
-  }
-}
-
-GSourceFuncs swfdec_iterate_funcs = {
-  swfdec_iterate_prepare,
-  swfdec_iterate_check,
-  swfdec_iterate_dispatch,
-  swfdec_iterate_finalize
-};
-
-static void
-swfdec_iterate_source_advance_cb (SwfdecPlayer *player, guint msecs, 
-    guint audio_frames, SwfdecIterateSource *source)
-{
-  g_time_val_add (&source->last, msecs * 1000 * source->speed);
-}
-
-GSource *
-swfdec_iterate_source_new (SwfdecPlayer *player, double speed)
-{
-  SwfdecIterateSource *source;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (speed > 0.0, NULL);
-
-  source = (SwfdecIterateSource *) g_source_new (&swfdec_iterate_funcs, 
-      sizeof (SwfdecIterateSource));
-  source->player = player;
-  g_object_add_weak_pointer (G_OBJECT (source->player), (gpointer) &source->player);
-  source->speed = 1.0 / speed;
-  source->notify = g_signal_connect (player, "advance",
-      G_CALLBACK (swfdec_iterate_source_advance_cb), source);
-  g_get_current_time (&source->last);
-  
-  return (GSource *) source;
-}
-
-void
-swfdec_iterate_source_set_speed (GSource *source, double speed)
-{
-  /* FIXME: need a return_if_fail if wrong source? */
-  g_return_if_fail (speed > 0.0);
-
-  ((SwfdecIterateSource *) source)->speed = 1.0 / speed;
-}
-
-guint
-swfdec_iterate_add (SwfdecPlayer *player)
-{
-  GSource *source;
-  guint id;
-  
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), 0);
-
-  source = swfdec_iterate_source_new (player, 1.0);
-
-  id = g_source_attach (source, NULL);
-  g_source_unref (source);
-
-  return id;
-}
diff --git a/libswfdec-gtk/swfdec_source.h b/libswfdec-gtk/swfdec_source.h
deleted file mode 100644
index 0c7c383..0000000
--- a/libswfdec-gtk/swfdec_source.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Swfdec
- * Copyright (C) 2006 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_SOURCE_H_
-#define _SWFDEC_SOURCE_H_
-
-#include <libswfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-GSource *	swfdec_iterate_source_new	(SwfdecPlayer *		player,
-						 double			speed);
-void		swfdec_iterate_source_set_speed (GSource *		source,
-						 double			speed);
-guint		swfdec_iterate_add		(SwfdecPlayer *		player);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/.gitignore b/libswfdec/.gitignore
deleted file mode 100644
index 9f923f0..0000000
--- a/libswfdec/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-*.loT
-
-swfdec_as_strings.h
-swfdec_asnative.h
-swfdec_enums.[ch]
-swfdec_marshal.[ch]
-
-compiler
diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
deleted file mode 100644
index dc62604..0000000
--- a/libswfdec/Makefile.am
+++ /dev/null
@@ -1,372 +0,0 @@
-SUBDIRS = jpeg
-
-CODECS =
-
-if HAVE_FFMPEG
-CODECS += swfdec_codec_ffmpeg.c
-endif
-if HAVE_GST
-CODECS += swfdec_codec_gst.c
-endif
-if HAVE_MAD
-CODECS += swfdec_codec_mad.c
-endif
-
-lib_LTLIBRARIES = libswfdec- at SWFDEC_MAJORMINOR@.la
-
-# these are files that must be in SRCDIR
-libswfdec_source_files = \
-	swfdec_accessibility.c \
-	swfdec_as_array.c \
-	swfdec_as_boolean.c \
-	swfdec_as_context.c \
-	swfdec_as_date.c \
-	swfdec_as_debugger.c \
-	swfdec_as_frame.c \
-	swfdec_as_function.c \
-	swfdec_as_interpret.c \
-	swfdec_as_math.c \
-	swfdec_as_native_function.c \
-	swfdec_as_number.c \
-	swfdec_as_object.c \
-	swfdec_as_script_function.c \
-	swfdec_as_stack.c \
-	swfdec_as_string.c \
-	swfdec_as_strings.c \
-	swfdec_as_super.c \
-	swfdec_as_types.c \
-	swfdec_amf.c \
-	swfdec_asbroadcaster.c \
-	swfdec_audio.c \
-	swfdec_audio_event.c \
-	swfdec_audio_flv.c \
-	swfdec_audio_stream.c \
-	swfdec_bevel_filter.c \
-	swfdec_bitmap_data.c \
-	swfdec_bitmap_filter.c \
-	swfdec_bits.c \
-	swfdec_blur_filter.c \
-	swfdec_buffer.c \
-	swfdec_button.c \
-	swfdec_button_movie.c \
-	swfdec_button_movie_as.c \
-	swfdec_cache.c \
-	swfdec_cached.c \
-	swfdec_camera.c \
-	swfdec_character.c \
-	swfdec_codec_adpcm.c \
-	swfdec_codec_audio.c \
-	$(CODECS) \
-	swfdec_codec_screen.c \
-	swfdec_codec_video.c \
-	swfdec_codec_vp6_alpha.c \
-	swfdec_color.c \
-	swfdec_color_as.c \
-	swfdec_color_matrix_filter.c \
-	swfdec_color_transform.c \
-	swfdec_convolution_filter.c \
-	swfdec_debug.c \
-	swfdec_decoder.c \
-	swfdec_displacement_map_filter.c \
-	swfdec_draw.c \
-	swfdec_drop_shadow_filter.c \
-	swfdec_event.c \
-	swfdec_external_interface.c \
-	swfdec_file_loader.c \
-	swfdec_file_reference.c \
-	swfdec_file_reference_list.c \
-	swfdec_filter.c \
-	swfdec_filter_as.c \
-	swfdec_flv_decoder.c \
-	swfdec_font.c \
-	swfdec_function_list.c \
-	swfdec_glow_filter.c \
-	swfdec_gradient_filter.c \
-	swfdec_gradient_pattern.c \
-	swfdec_graphic.c \
-	swfdec_graphic_movie.c \
-	swfdec_image.c \
-	swfdec_image_decoder.c \
-	swfdec_interval.c \
-	swfdec_key_as.c \
-	swfdec_load_object.c \
-	swfdec_load_object_as.c \
-	swfdec_loader.c \
-	swfdec_loadvars_as.c \
-	swfdec_local_connection.c \
-	swfdec_microphone.c \
-	swfdec_morph_movie.c \
-	swfdec_morphshape.c \
-	swfdec_mouse_as.c \
-	swfdec_movie.c \
-	swfdec_movie_as_drawing.c \
-	swfdec_movie_asprops.c \
-	swfdec_movie_clip_loader.c \
-	swfdec_net_connection.c \
-	swfdec_net_stream.c \
-	swfdec_net_stream_as.c \
-	swfdec_path.c \
-	swfdec_pattern.c \
-	swfdec_player.c \
-	swfdec_player_as.c \
-	swfdec_player_scripting.c \
-	swfdec_print_job.c \
-	swfdec_policy_file.c \
-	swfdec_rect.c \
-	swfdec_rectangle.c \
-	swfdec_resource.c \
-	swfdec_ringbuffer.c \
-	swfdec_sandbox.c \
-	swfdec_script.c \
-	swfdec_selection.c \
-	swfdec_shape.c \
-	swfdec_shape_parser.c \
-	swfdec_shared_object.c \
-	swfdec_socket.c \
-	swfdec_sound.c \
-	swfdec_sound_object.c \
-	swfdec_sprite.c \
-	swfdec_sprite_movie.c \
-	swfdec_sprite_movie_as.c \
-	swfdec_stage_as.c \
-	swfdec_stream.c \
-	swfdec_stream_target.c \
-	swfdec_stroke.c \
-	swfdec_style_sheet.c \
-	swfdec_swf_decoder.c \
-	swfdec_system.c \
-	swfdec_system_as.c \
-	swfdec_system_ime.c \
-	swfdec_system_security.c \
-	swfdec_tag.c \
-	swfdec_text.c \
-	swfdec_text_field.c \
-	swfdec_text_field_movie.c \
-	swfdec_text_field_movie_as.c \
-	swfdec_text_field_movie_html.c \
-	swfdec_text_format.c \
-	swfdec_text_renderer.c \
-	swfdec_text_snapshot.c \
-	swfdec_transform.c \
-	swfdec_url.c \
-	swfdec_utils.c \
-	swfdec_video.c \
-	swfdec_video_movie.c \
-	swfdec_video_movie_as.c \
-	swfdec_xml_node.c \
-	swfdec_xml.c \
-	swfdec_xml_socket.c
-
-libswfdec_ at SWFDEC_MAJORMINOR@_la_SOURCES = \
-  	$(libswfdec_source_files) \
-	swfdec_enums.c \
-	swfdec_marshal.c
-
-libswfdec_ at SWFDEC_MAJORMINOR@_la_CFLAGS = \
-	$(GLOBAL_CFLAGS) $(CAIRO_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) \
-	-I$(top_srcdir) -I$(srcdir)/jpeg/ $(LIBOIL_CFLAGS) \
-	$(GST_CFLAGS) $(FFMPEG_CFLAGS) $(MAD_CFLAGS) \
-	-DG_LOG_DOMAIN=\"Swfdec\"
-libswfdec_ at SWFDEC_MAJORMINOR@_la_LDFLAGS = \
-	$(SYMBOLIC_LDFLAGS) \
-	-version-info $(SWFDEC_LIBVERSION) \
-	-export-symbols-regex '^(swfdec_.*)' \
-	$(CAIRO_LIBS) $(GLIB_LIBS) $(PANGO_LIBS) $(LIBOIL_LIBS) -lz \
-	$(MAD_LIBS) $(FFMPEG_LIBS) $(GST_LIBS)
-
-public_headers = \
-	swfdec.h \
-	swfdec_as_array.h \
-	swfdec_as_context.h \
-	swfdec_as_debugger.h \
-	swfdec_as_frame.h \
-	swfdec_as_function.h \
-	swfdec_as_native_function.h \
-	swfdec_as_object.h \
-	swfdec_as_types.h \
-	swfdec_audio.h \
-	swfdec_buffer.h \
-	swfdec_file_loader.h \
-	swfdec_keys.h \
-	swfdec_loader.h \
-	swfdec_player.h \
-	swfdec_player_scripting.h \
-	swfdec_rectangle.h \
-	swfdec_script.h \
-	swfdec_socket.h \
-	swfdec_stream.h \
-	swfdec_system.h \
-	swfdec_url.h
-
-libswfdec_ at SWFDEC_MAJORMINOR@_la_LIBADD = jpeg/libjpeg.la 
-libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/libswfdec
-libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = $(public_headers) swfdec_enums.h
-
-noinst_HEADERS = \
-	swfdec_as_boolean.h \
-	swfdec_as_frame_internal.h \
-	swfdec_as_initialize.h \
-	swfdec_as_internal.h \
-	swfdec_as_date.h \
-	swfdec_as_interpret.h \
-	swfdec_as_number.h \
-	swfdec_as_script_function.h \
-	swfdec_as_stack.h \
-	swfdec_as_string.h \
-	swfdec_as_strings.h \
-	swfdec_as_super.h \
-	swfdec_asnative.h \
-	swfdec_amf.h \
-	swfdec_audio_internal.h \
-	swfdec_audio_event.h \
-	swfdec_audio_flv.h \
-	swfdec_audio_stream.h \
-	swfdec_bits.h \
-	swfdec_button.h \
-	swfdec_button_movie.h \
-	swfdec_cache.h \
-	swfdec_cached.h \
-	swfdec_character.h \
-	swfdec_codec_audio.h \
-	swfdec_codec_video.h \
-	swfdec_color.h \
-	swfdec_debug.h \
-	swfdec_decoder.h \
-	swfdec_draw.h \
-	swfdec_text_field.h \
-	swfdec_text_field_movie.h \
-	swfdec_event.h \
-	swfdec_filter.h \
-	swfdec_flv_decoder.h \
-	swfdec_font.h \
-	swfdec_function_list.h \
-	swfdec_gradient_pattern.h \
-	swfdec_graphic.h \
-	swfdec_graphic_movie.h \
-	swfdec_image.h \
-	swfdec_image_decoder.h \
-	swfdec_initialize.h \
-	swfdec_internal.h \
-	swfdec_interval.h \
-	swfdec_load_object.h \
-	swfdec_loader_internal.h \
-	swfdec_marshal.h \
-	swfdec_morph_movie.h \
-	swfdec_morphshape.h \
-	swfdec_movie.h \
-	swfdec_movie_clip_loader.h \
-	swfdec_net_connection.h \
-	swfdec_net_stream.h \
-	swfdec_path.h \
-	swfdec_pattern.h \
-	swfdec_player_internal.h \
-	swfdec_policy_file.h \
-	swfdec_rect.h \
-	swfdec_resource.h \
-	swfdec_ringbuffer.h \
-	swfdec_sandbox.h \
-	swfdec_script_internal.h \
-	swfdec_shape.h \
-	swfdec_shape_parser.h \
-	swfdec_sound.h \
-	swfdec_sound_object.h \
-	swfdec_sprite.h \
-	swfdec_sprite_movie.h \
-	swfdec_swf_decoder.h \
-	swfdec_stream_target.h \
-	swfdec_stroke.h \
-	swfdec_style_sheet.h \
-	swfdec_tag.h \
-	swfdec_text.h \
-	swfdec_text_format.h \
-	swfdec_types.h \
-	swfdec_utils.h \
-	swfdec_video.h \
-	swfdec_video_movie.h \
-	swfdec_xml_node.h \
-	swfdec_xml.h \
-	swfdec_xml_socket.h
-
-EXTRA_DIST = \
-	compiler.c \
-	swfdec_as_initialize.as \
-	swfdec_initialize.as \
-	swfdec_marshal.list
-
-BUILT_SOURCES = \
-	swfdec_asnative.h \
-	swfdec_as_strings.h \
-	swfdec_enums.c \
-	swfdec_enums.h \
-	swfdec_marshal.c \
-	swfdec_marshal.h
-
-CLEANFILES = \
-	$(BUILT_SOURCES)
-
-swfdec_asnative.h: $(libswfdec_source_files)
-	(cd $(srcdir) \
-	  && echo "#include \"swfdec_as_types.h\"" \
-	  && echo "#define SWFDEC_AS_NATIVE(x,y,func) void func (SwfdecAsContext *cx, \\" \
-	  && echo "    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret);" \
-	  && echo "#define SWFDEC_AS_CONSTRUCTOR(x,y,func,type) SWFDEC_AS_NATIVE(x,y,func) GType type (void);" \
-	  && grep -he "^SWFDEC_AS_CONSTRUCTOR" $(libswfdec_source_files) \
-	  && grep -he "^SWFDEC_AS_NATIVE" $(libswfdec_source_files) \
-	  && echo "#undef SWFDEC_AS_CONSTRUCTOR" \
-	  && echo "#undef SWFDEC_AS_NATIVE" \
-	  && echo "#define SWFDEC_AS_NATIVE(x,y,func) SWFDEC_AS_CONSTRUCTOR(x,y,func,NULL)" \
-	  && echo "#define SWFDEC_AS_CONSTRUCTOR(x,y,func,type) { x, y, func, G_STRINGIFY (func), type }," \
-	  && echo "static const struct { guint x, y; SwfdecAsNative func; const char *name; GType (* get_type) (void); } native_funcs[] = {" \
-	  && grep -he "^SWFDEC_AS_CONSTRUCTOR" $(libswfdec_source_files) \
-	  && grep -he "^SWFDEC_AS_NATIVE" $(libswfdec_source_files) \
-	  && echo "  { 0, 0, NULL }" \
-	  && echo "};" \
-	  && echo "#undef SWFDEC_AS_CONSTRUCTOR" \
-	  && echo "#undef SWFDEC_AS_NATIVE" \
-	 ) >> xgen-san \
-	&& (cmp -s xgen-san swfdec_asnative.h || cp xgen-san swfdec_asnative.h) \
-	&& rm -f xgen-san
-
-swfdec_marshal.h: swfdec_marshal.list Makefile
-	$(GLIB_GENMARSHAL) --prefix=swfdec_marshal $(srcdir)/swfdec_marshal.list --header >> xgen-smh \
-	&& (cmp -s xgen-smh swfdec_marshal.h || cp xgen-smh swfdec_marshal.h) \
-	&& rm -f xgen-smh
-
-swfdec_marshal.c: swfdec_marshal.list swfdec_marshal.h Makefile
-	(echo "#include \"swfdec_marshal.h\""; \
-	 $(GLIB_GENMARSHAL) --prefix=swfdec_marshal $(srcdir)/swfdec_marshal.list --body;) >> xgen-smc \
-	&& cp xgen-smc swfdec_marshal.c \
-	&& rm -f xgen-smc 
-
-swfdec_enums.h: $(public_headers) Makefile
-	( cd $(srcdir) && $(GLIB_MKENUMS) \
-			--fhead "#ifndef __SWFDEC_ENUMS_H__\n#define __SWFDEC_ENUMS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
-			--fprod "/* enumerations from \"@filename@\" */\n" \
-			--vhead "GType @enum_name at _get_type (void) G_GNUC_CONST;\n#define SWFDEC_TYPE_ at ENUMSHORT@ (@enum_name at _get_type())\n" \
-			--ftail "G_END_DECLS\n\n#endif /* __SWFDEC_ENUMS_H__ */" \
-		$(public_headers) ) >> xgen-seh \
-	&& (cmp -s xgen-seh swfdec_enums.h || cp xgen-seh swfdec_enums.h ) \
-	&& rm -f xgen-seh
-
-swfdec_enums.c: $(public_headers) Makefile
-	( cd $(srcdir) && $(GLIB_MKENUMS) \
-			--fhead "#include \"swfdec.h\"\n" \
-			--fprod "\n/* enumerations from \"@filename@\" */" \
-			--vhead "GType\n at enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G at Type@Value values[] = {" \
-			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
-			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ at type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
-		$(public_headers) ) > xgen-sec \
-	&& (cmp -s xgen-sec swfdec_enums.c || cp xgen-sec swfdec_enums.c ) \
-	&& rm -f xgen-sec
-
-swfdec_as_strings.h: swfdec_as_strings.c
-	( cd $(srcdir) && echo "/* This is a generated file. See swfdec_as_strings.c for details. */" \
-	  && echo "#ifndef _SWFDEC_AS_STRINGS_H_" \
-	  && echo "#define _SWFDEC_AS_STRINGS_H_" \
-	  && echo "extern const char swfdec_as_strings[];" \
-	  && grep "  SWFDEC_AS_CONSTANT_STRING" swfdec_as_strings.c \
-	  | sed "s/.*(\"\(.*\)\").*/\1/" \
-	  | $(AWK) '{ if ($$0 == "") name = "EMPTY"; else if ($$0 == ",") name = "COMMA"; else if ($$0 == "/") name = "SLASH"; else name = $$0; gsub("[^a-zA-Z0-9\\$$]","_",name); print "#define SWFDEC_AS_STR_" name " &swfdec_as_strings[" x + 1 "]"; x = x + length ($$0) + 2 }' \
-	  && echo "#endif" ) > xgen-sas \
-	&& (cmp -s xgen-sas swfdec_as_strings.h || cp xgen-sas swfdec_as_strings.h ) \
-	&& rm -f xgen-sas
diff --git a/libswfdec/compiler.c b/libswfdec/compiler.c
deleted file mode 100644
index 5593cec..0000000
--- a/libswfdec/compiler.c
+++ /dev/null
@@ -1,92 +0,0 @@
-//gcc -Wall -Werror `pkg-config --libs --cflags libming glib-2.0` compiler.c -o compiler
-
-#include <glib.h>
-#include <ming.h>
-#include <string.h>
-
-/* This is what is used to compile the Actionscript parts of the source to
- * includable C data that can later be executed.
- * Note that this is pretty much a hack until someone writes a proper
- * Actionscript compiler for Swfdec.
- * Also note that the creation of the include-scripts should probably not be 
- * autorun, as we don't want to depend on external bugs, only on internal ones.
- */
-static gboolean
-write_data (guint8 *data, gsize len)
-{
-  gsize i;
-
-  for (i = 0; i < len; i++) {
-    switch (i % 16) {
-      case 0:
-	if (i == 0)
-	  g_print ("  0x%02X", data[i]);
-	else
-	  g_print (",\n  0x%02X", data[i]);
-	break;
-      case 4:
-      case 8:
-      case 12:
-	g_print (",  0x%02X", data[i]);
-	break;
-      default:
-	g_print (", 0x%02X", data[i]);
-	break;
-    }
-  }
-  g_print ("\n");
-  return TRUE;
-}
-
-static char *
-get_name (const char *filename)
-{
-  char *end;
-
-  end = strrchr (filename, '/');
-  if (end)
-    filename = end + 1;
-  end = strchr (filename, '.');
-  if (end)
-    return g_strndup (filename, end - filename);
-  else
-    return g_strdup (filename);
-}
-
-int
-main (int argc, char **argv)
-{
-  SWFAction action;
-  char *contents;
-  GError *error = NULL;
-  guint i;
-  gsize len;
-  byte *data;
-
-  if (argc < 2) {
-    g_print ("usage: %s FILE ...\n\n", argv[0]);
-    return 1;
-  }
-
-  Ming_init ();
-  Ming_setSWFCompression (-1);
-
-  g_print ("/* This file is autogenerated, do not edit! */\n\n");
-  for (i = 1; i < argc; i++) {
-    if (!g_file_get_contents (argv[1], &contents, NULL, &error)) {
-      g_printerr ("%s\n", error->message);
-      g_error_free (error);
-      error = NULL;
-      return 1;
-    }
-    action = newSWFAction (contents);
-    data = SWFAction_getByteCode (action, &len);
-    contents = get_name (argv[i]);
-    g_print ("/* compiled from %s */\n", argv[i]);
-    g_print ("static const unsigned char %s[] = {\n", contents);
-    g_free (contents);
-    write_data (data, len);
-    g_print ("};\n\n");
-  }
-  return 0;
-}
diff --git a/libswfdec/jpeg/.gitignore b/libswfdec/jpeg/.gitignore
deleted file mode 100644
index 5bb735b..0000000
--- a/libswfdec/jpeg/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-
-jpeg_test
-jpeg_rgb_test
diff --git a/libswfdec/jpeg/Makefile.am b/libswfdec/jpeg/Makefile.am
deleted file mode 100644
index d6475cc..0000000
--- a/libswfdec/jpeg/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-noinst_LTLIBRARIES = libjpeg.la
-
-libjpeg_la_SOURCES = \
-	jpeg.c \
-	jpeg_bits.c \
-	jpeg_huffman.c \
-	jpeg_rgb_decoder.c \
-	jpeg_tables.c
-
-noinst_HEADERS = \
-	cogcompat.h \
-	jpeg.h \
-	jpeg_bits.h \
-	jpeg_huffman.h \
-	jpeg_rgb_decoder.h
-
-libjpeg_la_CFLAGS = $(GLOBAL_CFLAGS) $(GLIB_CFLAGS) $(LIBOIL_CFLAGS) -I$(srcdir)/..
-
diff --git a/libswfdec/jpeg/cogcompat.h b/libswfdec/jpeg/cogcompat.h
deleted file mode 100644
index bf2370f..0000000
--- a/libswfdec/jpeg/cogcompat.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#ifndef _COG_COMPAT_H_
-#define _COG_COMPAT_H_
-
-#include <swfdec_debug.h>
-
-#define COG_LOG(...) SWFDEC_LOG(__VA_ARGS__)
-#define COG_DEBUG(...) SWFDEC_DEBUG(__VA_ARGS__)
-#define COG_INFO(...) SWFDEC_INFO(__VA_ARGS__)
-#define COG_WARNING(...) SWFDEC_WARNING(__VA_ARGS__)
-#define COG_ERROR(...) SWFDEC_ERROR(__VA_ARGS__)
-
-#endif
-
diff --git a/libswfdec/jpeg/jpeg.c b/libswfdec/jpeg/jpeg.c
deleted file mode 100644
index 52143dc..0000000
--- a/libswfdec/jpeg/jpeg.c
+++ /dev/null
@@ -1,1126 +0,0 @@
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <liboil/liboil.h>
-#include <liboil/liboil-stdint.h>
-#include <cogcompat.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "jpeg.h"
-
-
-extern uint8_t jpeg_standard_tables[];
-extern int jpeg_standard_tables_size;
-
-void jpeg_decoder_define_huffman_tables (JpegDecoder * dec);
-void jpeg_decoder_define_arithmetic_conditioning (JpegDecoder *dec);
-void jpeg_decoder_define_quantization_tables (JpegDecoder *dec);
-void jpeg_decoder_define_restart_interval (JpegDecoder *dec);
-void jpeg_decoder_start_of_frame (JpegDecoder * dec, int marker);
-void jpeg_decoder_start_of_scan (JpegDecoder * dec);
-
-
-/* misc helper function declarations */
-
-static void jpeg_load_standard_huffman_tables (JpegDecoder * dec);
-
-static void jpeg_decoder_verify_header (JpegDecoder *dec);
-static void jpeg_decoder_init_decoder (JpegDecoder *dec);
-
-
-void
-jpeg_decoder_error(JpegDecoder *dec, const char *fmt, ...)
-{
-  va_list varargs;
-
-  if (dec->error) return;
-
-  va_start (varargs, fmt);
-#ifdef HAVE_VASPRINTF
-  vasprintf(&dec->error_message, fmt, varargs);
-#else
-  dec->error_message = malloc(250);
-  vsnprintf(dec->error_message, 250 - 1, fmt, varargs);
-  dec->error_message[250 - 1] = 0;
-#endif
-  va_end (varargs);
-
-  dec->error = TRUE;
-}
-
-#define jpeg_decoder_error(dec, ...) { \
-  COG_ERROR("decoder error: "__VA_ARGS__); \
-  jpeg_decoder_error (dec, __VA_ARGS__); \
-}
-
-static void
-jpeg_decoder_verify_header (JpegDecoder *dec)
-{
-  int max_quant_table = 0;
-  int i;
-
-  if (dec->sof_type != JPEG_MARKER_SOF_0) {
-    COG_ERROR("only handle baseline DCT");
-    dec->error = TRUE;
-  }
-
-  if (dec->width < 1) {
-    COG_ERROR("height can't be 0");
-    dec->error = TRUE;
-  }
-
-  switch (dec->sof_type) {
-    case JPEG_MARKER_SOF_0:
-      /* baseline DCT */
-      max_quant_table = 3;
-      if (dec->depth != 8) {
-        COG_ERROR("depth must be 8 (%d)", dec->depth);
-        dec->error = TRUE;
-      }
-      break;
-    case JPEG_MARKER_SOF_1:
-      /* extended DCT */
-      max_quant_table = 3;
-      if (dec->depth != 8 && dec->depth != 12) {
-        COG_ERROR("depth must be 8 or 12 (%d)", dec->depth);
-        dec->error = TRUE;
-      }
-      break;
-    case JPEG_MARKER_SOF_2:
-      /* progressive DCT */
-      max_quant_table = 3;
-      if (dec->depth != 8 && dec->depth != 12) {
-        COG_ERROR("depth must be 8 or 12 (%d)", dec->depth);
-        dec->error = TRUE;
-      }
-      break;
-    case JPEG_MARKER_SOF_3:
-      /* lossless DCT */
-      max_quant_table = 0;
-      if (dec->depth < 2 || dec->depth > 16) {
-        COG_ERROR("depth must be between 2 and 16 (%d)", dec->depth);
-        dec->error = TRUE;
-      }
-      break;
-    default:
-      break;
-  }
-
-  if (dec->n_components < 0 || dec->n_components > 255) {
-    COG_ERROR("n_components must be in the range 0-255 (%d)",
-        dec->n_components);
-    dec->error = TRUE;
-  }
-  if (dec->sof_type == JPEG_MARKER_SOF_2 && dec->n_components > 4) {
-    COG_ERROR("n_components must be <= 4 for progressive DCT (%d)",
-        dec->n_components);
-    dec->error = TRUE;
-  }
-
-  for (i = 0; i < dec->n_components; i++) {
-    if (dec->components[i].id < 0 || dec->components[i].id > 255) {
-      COG_ERROR("component ID out of range");
-      dec->error = TRUE;
-      break;
-    }
-    if (dec->components[i].h_sample < 1 || dec->components[i].h_sample > 4 ||
-        dec->components[i].v_sample < 1 || dec->components[i].v_sample > 4) {
-      COG_ERROR("sample factor(s) for component %d out of range %d %d",
-          i, dec->components[i].h_sample, dec->components[i].v_sample);
-      dec->error = TRUE;
-      break;
-    }
-    if (dec->components[i].quant_table < 0 ||
-        dec->components[i].quant_table > max_quant_table) {
-      COG_ERROR("quant table for component %d out of range (%d)",
-          i, dec->components[i].quant_table);
-      dec->error = TRUE;
-      break;
-    }
-  }
-}
-
-static void
-jpeg_decoder_init_decoder (JpegDecoder *dec)
-{
-  int max_h_sample = 0;
-  int max_v_sample = 0;
-  int i;
-
-  /* decoder limitations */
-  if (dec->n_components != 3) {
-    jpeg_decoder_error(dec, "wrong number of components %d", dec->n_components);
-    return;
-  }
-  if (dec->sof_type != JPEG_MARKER_SOF_0) {
-    jpeg_decoder_error(dec, "only handle baseline DCT");
-    return;
-  }
-
-
-
-
-  for (i=0; i < dec->n_components; i++) {
-    max_h_sample = MAX (max_h_sample, dec->components[i].h_sample);
-    max_v_sample = MAX (max_v_sample, dec->components[i].v_sample);
-  }
-
-  dec->width_blocks =
-      (dec->width + 8 * max_h_sample - 1) / (8 * max_h_sample);
-  dec->height_blocks =
-      (dec->height + 8 * max_v_sample - 1) / (8 * max_v_sample);
-  for (i = 0; i < dec->n_components; i++) {
-    int rowstride;
-    int image_size;
-
-    dec->components[i].h_subsample = max_h_sample /
-        dec->components[i].h_sample;
-    dec->components[i].v_subsample = max_v_sample /
-        dec->components[i].v_sample;
-
-    rowstride = dec->width_blocks * 8 * max_h_sample /
-        dec->components[i].h_subsample;
-    image_size = rowstride *
-        (dec->height_blocks * 8 * max_v_sample /
-        dec->components[i].v_subsample);
-    dec->components[i].rowstride = rowstride;
-    dec->components[i].image = malloc (image_size);
-  }
-}
-
-#if 0
-static char *
-sprintbits (char *str, unsigned int bits, int n)
-{
-  int i;
-  int bit = 1 << (n - 1);
-
-  for (i = 0; i < n; i++) {
-    str[i] = (bits & bit) ? '1' : '0';
-    bit >>= 1;
-  }
-  str[i] = 0;
-
-  return str;
-}
-
-static void
-generate_code_table (int *huffsize)
-{
-  int code;
-  int i;
-  int j;
-  int k;
-  char str[33];
-
-  //int l;
-
-  code = 0;
-  k = 0;
-  for (i = 0; i < 16; i++) {
-    for (j = 0; j < huffsize[i]; j++) {
-      COG_DEBUG ("huffcode[%d] = %s", k,
-          sprintbits (str, code >> (15 - i), i + 1));
-      code++;
-      k++;
-    }
-    code <<= 1;
-  }
-
-}
-#endif
-
-static int
-huffman_table_init_jpeg (JpegDecoder *decoder, HuffmanTable *table, JpegBits * bits)
-{
-  int n_symbols;
-  int huffsize[16];
-  int i, j, k;
-  unsigned int symbol;
-  int n = 0;
-
-  huffman_table_init (table);
-
-  /* huffsize[i] is the number of symbols that have length
-   * (i+1) bits.  Maximum bit length is 16 bits, so there are
-   * 16 entries. */
-  n_symbols = 0;
-  for (i = 0; i < 16; i++) {
-    huffsize[i] = jpeg_bits_get_u8 (bits);
-    n++;
-    n_symbols += huffsize[i];
-  }
-
-  /* Build up the symbol table.  The first symbol is all 0's, with
-   * the number of bits determined by the first non-zero entry in
-   * huffsize[].  Subsequent symbols with the same bit length are
-   * incremented by 1.  Increasing the bit length shifts the
-   * symbol 1 bit to the left. */
-  symbol = 0;
-  k = 0;
-  for (i = 0; i < 16; i++) {
-    for (j = 0; j < huffsize[i]; j++) {
-      huffman_table_add (table, symbol, i + 1, jpeg_bits_get_u8 (bits));
-      n++;
-      symbol++;
-      k++;
-    }
-    /* This checks that our symbol is actually less than the
-     * number of bits we think it is.  This is only triggered
-     * for bad huffsize[] arrays. */
-    if (symbol >= (1U << (i + 1))) {
-      jpeg_decoder_error (decoder, "bad huffsize[] array");
-      return -1;
-    }
-
-    symbol <<= 1;
-  }
-
-  huffman_table_dump (table);
-
-  return n;
-}
-
-static int
-jpeg_decoder_find_component_by_id (JpegDecoder * dec, int id)
-{
-  int i;
-
-  for (i = 0; i < dec->n_components; i++) {
-    if (dec->components[i].id == id)
-      return i;
-  }
-  COG_DEBUG ("undefined component id %d", id);
-  return 0;
-}
-
-int
-jpeg_decoder_application0 (JpegDecoder * dec, JpegBits * bits)
-{
-  int length;
-
-  COG_DEBUG ("app0");
-
-  length = get_be_u16 (bits);
-  COG_DEBUG ("length=%d", length);
-
-  if (memcmp (bits->ptr, "JFIF", 4) == 0 && bits->ptr[4] == 0) {
-    int version;
-    int units;
-    int x_density;
-    int y_density;
-    int x_thumbnail;
-    int y_thumbnail;
-
-    COG_DEBUG ("JFIF");
-    bits->ptr += 5;
-
-    version = get_be_u16 (bits);
-    units = get_u8 (bits);
-    x_density = get_be_u16 (bits);
-    y_density = get_be_u16 (bits);
-    x_thumbnail = get_u8 (bits);
-    y_thumbnail = get_u8 (bits);
-
-    COG_DEBUG ("version = %04x", version);
-    COG_DEBUG ("units = %d", units);
-    COG_DEBUG ("x_density = %d", x_density);
-    COG_DEBUG ("y_density = %d", y_density);
-    COG_DEBUG ("x_thumbnail = %d", x_thumbnail);
-    COG_DEBUG ("y_thumbnail = %d", y_thumbnail);
-
-  }
-
-  if (memcmp (bits->ptr, "JFXX", 4) == 0 && bits->ptr[4] == 0) {
-    COG_DEBUG ("JFIF extension (not handled)");
-    bits->ptr += length - 2;
-  }
-
-  return length;
-}
-
-int
-jpeg_decoder_application_misc (JpegDecoder * dec, JpegBits * bits)
-{
-  int length;
-
-  COG_DEBUG ("appX");
-
-  length = get_be_u16 (bits);
-  COG_DEBUG ("length=%d", length);
-
-  COG_DEBUG ("JPEG application tag X ignored");
-  //dumpbits (bits);
-
-  bits->ptr += length - 2;
-
-  return length;
-}
-
-int
-jpeg_decoder_comment (JpegDecoder * dec, JpegBits * bits)
-{
-  int length;
-
-  COG_DEBUG ("comment");
-
-  length = get_be_u16 (bits);
-  COG_DEBUG ("length=%d", length);
-
-  //dumpbits (bits);
-
-  bits->ptr += length - 2;
-
-  return length;
-}
-
-int
-jpeg_decoder_restart_interval (JpegDecoder * dec, JpegBits * bits)
-{
-  int length;
-
-  COG_DEBUG ("comment");
-
-  length = get_be_u16 (bits);
-  COG_DEBUG ("length=%d", length);
-
-  dec->restart_interval = get_be_u16 (bits);
-  COG_DEBUG ("restart_interval=%d", dec->restart_interval);
-
-  return length;
-}
-
-int
-jpeg_decoder_restart (JpegDecoder * dec, JpegBits * bits)
-{
-  COG_DEBUG ("restart");
-
-  return 0;
-}
-
-void
-jpeg_decoder_decode_entropy_segment (JpegDecoder * dec)
-{
-  JpegBits * bits = &dec->bits;
-  JpegBits b2, *bits2 = &b2;
-  short block[64];
-  short block2[64];
-  unsigned char *newptr;
-  int len;
-  int maxlen;
-  int j;
-  int i;
-  int go;
-  int x, y;
-  int n;
-  int ret;
-
-  len = 0;
-  maxlen = jpeg_bits_available (bits) - 1;
-  j = 0;
-  while (len < maxlen) {
-    if (bits->ptr[len] == 0xff && bits->ptr[len + 1] != 0x00) {
-      break;
-    }
-    len++;
-  }
-  COG_DEBUG ("entropy length = %d", len);
-
-  /* we allocate extra space, since the getbits() code can
-   * potentially read past the end of the buffer */
-  newptr = malloc (len + 2);
-  for (i = 0; i < len; i++) {
-    newptr[j] = bits->ptr[i];
-    j++;
-    if (bits->ptr[i] == 0xff)
-      i++;
-  }
-  bits->ptr += len;
-
-  bits2->ptr = newptr;
-  bits2->idx = 0;
-  bits2->end = newptr + j;
-  newptr[j] = 0;
-  newptr[j + 1] = 0;
-
-  dec->dc[0] = dec->dc[1] = dec->dc[2] = dec->dc[3] = 128 * 8;
-  go = 1;
-  x = dec->x;
-  y = dec->y;
-  n = dec->restart_interval;
-  if (n == 0) n = (1<<26); /* max number of blocks */
-  while (go && n-- > 0) {
-    for (i = 0; i < dec->scan_list_length; i++) {
-      int dc_table_index;
-      int ac_table_index;
-      int quant_index;
-      unsigned char *ptr;
-      int component_index;
-
-      COG_DEBUG ("%d,%d: component=%d dc_table=%d ac_table=%d",
-          x, y,
-          dec->scan_list[i].component_index,
-          dec->scan_list[i].dc_table, dec->scan_list[i].ac_table);
-
-      component_index = dec->scan_list[i].component_index;
-      dc_table_index = dec->scan_list[i].dc_table;
-      ac_table_index = dec->scan_list[i].ac_table;
-      quant_index = dec->scan_list[i].quant_table;
-
-      ret = huffman_table_decode_macroblock (dec, block,
-          &dec->dc_huff_table[dc_table_index],
-          &dec->ac_huff_table[ac_table_index], bits2);
-      if (ret < 0) {
-        COG_DEBUG ("%d,%d: component=%d dc_table=%d ac_table=%d",
-            x, y,
-            dec->scan_list[i].component_index,
-            dec->scan_list[i].dc_table, dec->scan_list[i].ac_table);
-        n = 0;
-        break;
-      }
-
-      COG_DEBUG ("using quant table %d", quant_index);
-      oil_mult8x8_s16 (block2, block, dec->quant_tables[quant_index].quantizer,
-          sizeof (short) * 8, sizeof(short) * 8, sizeof (short) * 8);
-      dec->dc[component_index] += block2[0];
-      block2[0] = dec->dc[component_index];
-      oil_unzigzag8x8_s16 (block, sizeof (short) * 8, block2,
-          sizeof (short) * 8);
-      oil_idct8x8_s16 (block2, sizeof (short) * 8, block, sizeof (short) * 8);
-      oil_trans8x8_s16 (block, sizeof (short) * 8, block2, sizeof (short) * 8);
-
-      ptr = dec->components[component_index].image +
-          x * dec->components[component_index].h_sample +
-          dec->scan_list[i].offset +
-          dec->components[component_index].rowstride * y *
-          dec->components[component_index].v_sample;
-
-      oil_clipconv8x8_u8_s16 (ptr,
-          dec->components[component_index].rowstride,
-          block, sizeof (short) * 8);
-    }
-    x += 8;
-    if (x * dec->scan_h_subsample >= dec->width) {
-      x = 0;
-      y += 8;
-    }
-    if (y * dec->scan_v_subsample >= dec->height) {
-      go = 0;
-    }
-  }
-  dec->x = x;
-  dec->y = y;
-  free (newptr);
-}
-
-
-
-JpegDecoder *
-jpeg_decoder_new (void)
-{
-  JpegDecoder *dec;
-
-  oil_init ();
-
-  dec = malloc (sizeof(JpegDecoder));
-  memset (dec, 0, sizeof(JpegDecoder));
-
-  jpeg_load_standard_huffman_tables (dec);
-
-  return dec;
-}
-
-void
-jpeg_decoder_free (JpegDecoder * dec)
-{
-  int i;
-
-  for (i = 0; i < JPEG_LIMIT_COMPONENTS; i++) {
-    if (dec->components[i].image)
-      free (dec->components[i].image);
-  }
-
-  if (dec->data)
-    free (dec->data);
-
-  free (dec);
-}
-
-static int
-jpeg_decoder_get_marker (JpegDecoder *dec, int *marker)
-{
-  int a,b;
-  JpegBits *bits = &dec->bits;
-
-  if (jpeg_bits_available(bits) < 2) {
-    return FALSE;
-  }
-
-  a = jpeg_bits_get_u8(bits);
-  if (a != 0xff) {
-    jpeg_decoder_error(dec, "expected marker, not 0x%02x", a);
-    return FALSE;
-  }
-
-  do {
-    b = jpeg_bits_get_u8 (bits);
-  } while (b == 0xff && jpeg_bits_error(bits));
-
-  *marker = b;
-  return TRUE;
-}
-
-static void
-jpeg_decoder_skip (JpegDecoder *dec)
-{
-  int length;
-
-  length = jpeg_bits_get_u16_be (&dec->bits);
-  jpeg_bits_skip (&dec->bits, length - 2);
-}
-
-int
-jpeg_decoder_decode (JpegDecoder *dec)
-{
-  JpegBits *bits;
-  int marker;
-
-  dec->error = FALSE;
-
-  bits = &dec->bits;
-
-  /* Note: The spec is ambiguous as to whether fill bytes can come
-   * before the first marker.  We'll assume yes. */
-  if (!jpeg_decoder_get_marker (dec, &marker)) {
-    return FALSE;
-  }
-  if (dec->strict && marker != JPEG_MARKER_SOI) {
-    jpeg_decoder_error(dec, "not a JPEG image");
-    return FALSE;
-  }
-
-  /* Interpret markers up to the start of frame */
-  while (!dec->error) {
-    if (!jpeg_decoder_get_marker (dec, &marker)) {
-      return FALSE;
-    }
-
-    if (marker == JPEG_MARKER_DEFINE_HUFFMAN_TABLES) {
-      jpeg_decoder_define_huffman_tables (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_ARITHMETIC_CONDITIONING) {
-      jpeg_decoder_define_arithmetic_conditioning (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_QUANTIZATION_TABLES) {
-      jpeg_decoder_define_quantization_tables (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_RESTART_INTERVAL) {
-      jpeg_decoder_define_restart_interval (dec);
-    } else if (JPEG_MARKER_IS_APP(marker)) {
-      /* FIXME decode app segment */
-      jpeg_decoder_skip (dec);
-    } else if (marker == JPEG_MARKER_COMMENT) {
-      jpeg_decoder_skip (dec);
-    } else if (JPEG_MARKER_IS_START_OF_FRAME(marker)) {
-      break;
-    } else if (marker == JPEG_MARKER_SOI) {
-      if (dec->strict) {
-        jpeg_decoder_error (dec, "unexpected SOI");
-        return FALSE;
-      }
-    } else if (marker == JPEG_MARKER_EOI) {
-      if (dec->strict) {
-        jpeg_decoder_error (dec, "unexpected EOI");
-        return FALSE;
-      }
-    } else {
-      jpeg_decoder_error(dec, "unexpected marker 0x%02x", marker);
-      return FALSE;
-    }
-  }
-  if (dec->error) {
-    return FALSE;
-  }
-
-  jpeg_decoder_start_of_frame(dec, marker);
-
-  jpeg_decoder_verify_header (dec);
-  if (dec->error) {
-    return FALSE;
-  }
-
-  jpeg_decoder_init_decoder (dec);
-  if (dec->error) {
-    return FALSE;
-  }
-
-  /* In this section, we loop over parse units until we reach the end
-   * of the image. */
-  while (!dec->error) {
-    if (!jpeg_decoder_get_marker (dec, &marker)) {
-      return FALSE;
-    }
-
-    if (marker == JPEG_MARKER_DEFINE_HUFFMAN_TABLES) {
-      jpeg_decoder_define_huffman_tables (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_ARITHMETIC_CONDITIONING) {
-      jpeg_decoder_define_arithmetic_conditioning (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_QUANTIZATION_TABLES) {
-      jpeg_decoder_define_quantization_tables (dec);
-    } else if (marker == JPEG_MARKER_DEFINE_RESTART_INTERVAL) {
-      jpeg_decoder_define_restart_interval (dec);
-    } else if (JPEG_MARKER_IS_APP(marker)) {
-      jpeg_decoder_skip (dec);
-    } else if (marker == JPEG_MARKER_COMMENT) {
-      jpeg_decoder_skip (dec);
-    } else if (marker == JPEG_MARKER_SOS) {
-      jpeg_decoder_start_of_scan (dec);
-      if (dec->error) {
-        return FALSE;
-      }
-      jpeg_decoder_decode_entropy_segment (dec);
-    } else if (JPEG_MARKER_IS_RESET(marker)) {
-      jpeg_decoder_decode_entropy_segment (dec);
-    } else if (marker == JPEG_MARKER_SOI) {
-      if (dec->strict) {
-        jpeg_decoder_error (dec, "unexpected SOI");
-        return FALSE;
-      }
-    } else if (marker == JPEG_MARKER_EOI) {
-      if (dec->strict) {
-        jpeg_decoder_error (dec, "unexpected EOI");
-        return FALSE;
-      } else {
-        break;
-      }
-    } else {
-      jpeg_decoder_error(dec, "unexpected marker 0x%02x", marker);
-      return FALSE;
-    }
-  }
-  if (dec->error) {
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/* handle markers */
-
-void
-jpeg_decoder_define_huffman_tables (JpegDecoder * dec)
-{
-  JpegBits *bits = &dec->bits;
-  int length;
-  int tc;
-  int th;
-  int x;
-  HuffmanTable *hufftab;
-
-  COG_DEBUG ("define huffman tables");
-
-  length = jpeg_bits_get_u16_be (bits);
-  if (length < 2) {
-    jpeg_decoder_error(dec, "length too short");
-    return;
-  }
-  length -= 2;
-
-  while (length > 0) {
-    x = jpeg_bits_get_u8 (bits);
-    length--;
-
-    tc = x >> 4;
-    th = x & 0xf;
-
-    COG_DEBUG ("huff table type %d (%s) idx %d", tc, tc ? "ac" : "dc", th);
-    if (tc > 1 || th > 3) {
-      jpeg_decoder_error(dec, "huffman table type or idx out of range");
-      return;
-    }
-
-    if (tc) {
-      hufftab = &dec->ac_huff_table[th];
-      length -= huffman_table_init_jpeg (dec, hufftab, bits);
-    } else {
-      hufftab = &dec->dc_huff_table[th];
-      length -= huffman_table_init_jpeg (dec, hufftab, bits);
-    }
-    if (dec->error) {
-      return;
-    }
-  }
-  if (length < 0) {
-    jpeg_decoder_error(dec, "huffman table overran available bytes");
-    return;
-  }
-}
-
-void
-jpeg_decoder_define_quantization_tables (JpegDecoder *dec)
-{
-  JpegBits *bits = &dec->bits;
-  JpegQuantTable *table;
-  int length;
-  int pq;
-  int tq;
-  int i;
-
-  COG_INFO ("define quantization table");
-
-  length = jpeg_bits_get_u16_be (bits);
-  if (length < 2) {
-    jpeg_decoder_error(dec, "length too short");
-    return;
-  }
-  length -= 2;
-
-  while (length > 0) {
-    int x;
-    
-    x = jpeg_bits_get_u8 (bits);
-    length--;
-    pq = x >> 4;
-    tq = x & 0xf;
-
-    if (pq > 1) {
-      jpeg_decoder_error (dec, "bad pq value");
-      return;
-    }
-    if (tq > 3) {
-      jpeg_decoder_error (dec, "bad tq value");
-      return;
-    }
-
-    table = &dec->quant_tables[tq];
-    if (pq) {
-      for (i = 0; i < 64; i++) {
-        table->quantizer[i] = jpeg_bits_get_u16_be (bits);
-        length -= 2;
-      }
-    } else {
-      for (i = 0; i < 64; i++) {
-        table->quantizer[i] = jpeg_bits_get_u8 (bits);
-        length -= 1;
-      }
-    }
-  }
-  if (length < 0) {
-    jpeg_decoder_error(dec, "quantization table overran available bytes");
-    return;
-  }
-}
-
-void
-jpeg_decoder_define_restart_interval (JpegDecoder *dec)
-{
-  JpegBits *bits = &dec->bits;
-  int length;
-
-  length = jpeg_bits_get_u16_be (bits);
-  if (length != 4) {
-    jpeg_decoder_error(dec, "length supposed to be 4 (%d)", length);
-    return;
-  }
-
-  /* FIXME this needs to be checked somewhere */
-  dec->restart_interval = jpeg_bits_get_u16_be (bits);
-}
-
-void
-jpeg_decoder_define_arithmetic_conditioning (JpegDecoder *dec)
-{
-  /* we don't handle arithmetic coding, so skip it */
-  jpeg_decoder_skip (dec);
-}
-
-void
-jpeg_decoder_start_of_frame (JpegDecoder * dec, int marker)
-{
-  JpegBits *bits = &dec->bits;
-  int i;
-  int length;
-
-  COG_INFO ("start of frame");
-
-  dec->sof_type = marker;
-
-  length = jpeg_bits_get_u16_be (bits);
-
-  if (jpeg_bits_available(bits) < length) {
-    jpeg_decoder_error(dec, "not enough data for start_of_frame (%d < %d)",
-        length, jpeg_bits_available(bits));
-    return;
-  }
-
-  dec->depth = jpeg_bits_get_u8 (bits);
-  dec->height = jpeg_bits_get_u16_be (bits);
-  dec->width = jpeg_bits_get_u16_be (bits);
-  dec->n_components = jpeg_bits_get_u8 (bits);
-
-  COG_DEBUG (
-      "frame_length=%d depth=%d height=%d width=%d n_components=%d", length,
-      dec->depth, dec->height, dec->width, dec->n_components);
-
-  if (dec->n_components * 3 + 8 != length) {
-    jpeg_decoder_error(dec, "inconsistent header");
-    return;
-  }
-
-  for (i = 0; i < dec->n_components; i++) {
-    dec->components[i].id = get_u8 (bits);
-    dec->components[i].h_sample = getbits (bits, 4);
-    dec->components[i].v_sample = getbits (bits, 4);
-    dec->components[i].quant_table = get_u8 (bits);
-
-    COG_DEBUG (
-        "[%d] id=%d h_sample=%d v_sample=%d quant_table=%d", i,
-        dec->components[i].id, dec->components[i].h_sample,
-        dec->components[i].v_sample, dec->components[i].quant_table);
-  }
-}
-
-void
-jpeg_decoder_start_of_scan (JpegDecoder * dec)
-{
-  JpegBits *bits = &dec->bits;
-  int length;
-  int i;
-  int spectral_start;
-  int spectral_end;
-  int approx_high;
-  int approx_low;
-  int n;
-  int tmp;
-  int n_components;
-
-  COG_DEBUG ("start of scan");
-
-  length = jpeg_bits_get_u16_be (bits);
-  COG_DEBUG ("length=%d", length);
-
-  n_components = jpeg_bits_get_u8 (bits);
-  n = 0;
-  dec->scan_h_subsample = 0;
-  dec->scan_v_subsample = 0;
-  for (i = 0; i < n_components; i++) {
-    int component_id;
-    int dc_table;
-    int ac_table;
-    int x;
-    int y;
-    int idx;
-    int h_subsample;
-    int v_subsample;
-    int quant_index;
-
-    component_id = jpeg_bits_get_u8 (bits);
-    tmp = jpeg_bits_get_u8 (bits);
-    dc_table = tmp >> 4;
-    ac_table = tmp & 0xf;
-    idx = jpeg_decoder_find_component_by_id (dec, component_id);
-
-    h_subsample = dec->components[idx].h_sample;
-    v_subsample = dec->components[idx].v_sample;
-    quant_index = dec->components[idx].quant_table;
-
-    for (y = 0; y < v_subsample; y++) {
-      for (x = 0; x < h_subsample; x++) {
-        dec->scan_list[n].component_index = idx;
-        dec->scan_list[n].dc_table = dc_table;
-        dec->scan_list[n].ac_table = ac_table;
-        dec->scan_list[n].quant_table = quant_index;
-        dec->scan_list[n].x = x;
-        dec->scan_list[n].y = y;
-        dec->scan_list[n].offset =
-            y * 8 * dec->components[idx].rowstride + x * 8;
-        n++;
-        if (n > JPEG_LIMIT_SCAN_LIST_LENGTH) {
-          jpeg_decoder_error(dec, "scan list too long");
-          return;
-        }
-      }
-    }
-
-    dec->scan_h_subsample = MAX (dec->scan_h_subsample, h_subsample);
-    dec->scan_v_subsample = MAX (dec->scan_v_subsample, v_subsample);
-
-    COG_DEBUG ("component %d: idx=%d dc_table=%d ac_table=%d n=%d",
-        component_id, idx, dc_table, ac_table, n);
-  }
-  dec->scan_list_length = n;
-
-
-  spectral_start = jpeg_bits_get_u8 (bits);
-  spectral_end = jpeg_bits_get_u8 (bits);
-  COG_DEBUG ("spectral range [%d,%d]", spectral_start, spectral_end);
-  tmp = jpeg_bits_get_u8 (bits);
-  approx_high = tmp >> 4;
-  approx_low = tmp & 0xf;
-  COG_DEBUG ("approx range [%d,%d]", approx_low, approx_high);
-
-  dec->x = 0;
-  dec->y = 0;
-  dec->dc[0] = dec->dc[1] = dec->dc[2] = dec->dc[3] = 128 * 8;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-int
-jpeg_decoder_addbits (JpegDecoder * dec, unsigned char *data, unsigned int len)
-{
-  unsigned int offset;
-
-  offset = dec->bits.ptr - dec->data;
-
-  dec->data = realloc (dec->data, dec->data_len + len);
-  memcpy (dec->data + dec->data_len, data, len);
-  dec->data_len += len;
-
-  dec->bits.ptr = dec->data + offset;
-  dec->bits.end = dec->data + dec->data_len;
-
-  return 0;
-}
-
-int
-jpeg_decoder_get_image_size (JpegDecoder * dec, int *width, int *height)
-{
-  if (width)
-    *width = dec->width;
-  if (height)
-    *height = dec->height;
-
-  return 0;
-}
-
-int
-jpeg_decoder_get_component_ptr (JpegDecoder * dec, int id,
-    unsigned char **image, int *rowstride)
-{
-  int i;
-
-  i = jpeg_decoder_find_component_by_id (dec, id);
-  if (image)
-    *image = dec->components[i].image;
-  if (rowstride)
-    *rowstride = dec->components[i].rowstride;
-
-  return 0;
-}
-
-int
-jpeg_decoder_get_component_size (JpegDecoder * dec, int id,
-    int *width, int *height)
-{
-  int i;
-
-  /* subsampling sizes are rounded up */
-
-  i = jpeg_decoder_find_component_by_id (dec, id);
-  if (width)
-    *width = (dec->width - 1) / dec->components[i].h_subsample + 1;
-  if (height)
-    *height = (dec->height - 1) / dec->components[i].v_subsample + 1;
-
-  return 0;
-}
-
-int
-jpeg_decoder_get_component_subsampling (JpegDecoder * dec, int id,
-    int *h_subsample, int *v_subsample)
-{
-  int i;
-
-  i = jpeg_decoder_find_component_by_id (dec, id);
-  if (h_subsample)
-    *h_subsample = dec->components[i].h_subsample;
-  if (v_subsample)
-    *v_subsample = dec->components[i].v_subsample;
-
-  return 0;
-}
-
-#if 0
-int
-jpeg_decoder_parse (JpegDecoder * dec)
-{
-  JpegBits *bits = &dec->bits;
-  JpegBits b2;
-  unsigned int x;
-  unsigned int tag;
-  int i;
-
-  while (bits->ptr < bits->end) {
-    x = get_u8 (bits);
-    if (x != 0xff) {
-      int n = 0;
-
-      while (x != 0xff) {
-        x = get_u8 (bits);
-        n++;
-      }
-      OIL_DEBUG ("lost sync, skipped %d bytes", n);
-    }
-    while (x == 0xff) {
-      x = get_u8 (bits);
-    }
-    tag = x;
-    OIL_DEBUG ("tag %02x", tag);
-
-    b2 = *bits;
-
-    for (i = 0; i < n_jpeg_markers - 1; i++) {
-      if (tag == jpeg_markers[i].tag) {
-        break;
-      }
-    }
-    OIL_DEBUG ("tag: %s", jpeg_markers[i].name);
-    if (jpeg_markers[i].func) {
-      jpeg_markers[i].func (dec, &b2);
-    } else {
-      OIL_DEBUG ("unhandled or illegal JPEG marker (0x%02x)", tag);
-      dumpbits (&b2);
-    }
-    if (jpeg_markers[i].flags & JPEG_ENTROPY_SEGMENT) {
-      jpeg_decoder_decode_entropy_segment (dec, &b2);
-    }
-    syncbits (&b2);
-    bits->ptr = b2.ptr;
-  }
-
-  return 0;
-}
-#endif
-
-
-/* misc helper functins */
-
-static void
-jpeg_load_standard_huffman_tables (JpegDecoder * dec)
-{
-  JpegBits b, *bits = &b;
-
-  bits->ptr = jpeg_standard_tables;
-  bits->idx = 0;
-  bits->end = jpeg_standard_tables + jpeg_standard_tables_size;
-
-  huffman_table_init_jpeg (dec, &dec->dc_huff_table[0], bits);
-  huffman_table_init_jpeg (dec, &dec->ac_huff_table[0], bits);
-  huffman_table_init_jpeg (dec, &dec->dc_huff_table[1], bits);
-  huffman_table_init_jpeg (dec, &dec->ac_huff_table[1], bits);
-}
-
-
-
diff --git a/libswfdec/jpeg/jpeg.h b/libswfdec/jpeg/jpeg.h
deleted file mode 100644
index 6c0ba41..0000000
--- a/libswfdec/jpeg/jpeg.h
+++ /dev/null
@@ -1,190 +0,0 @@
-
-#ifndef _JPEG_DECODER_H_
-#define _JPEG_DECODER_H_
-
-#include <jpeg/jpeg_bits.h>
-
-#include <stdint.h>
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#define JPEG_LIMIT_COMPONENTS 256
-#define JPEG_LIMIT_SCAN_LIST_LENGTH 10
-
-
-typedef struct _JpegDecoder JpegDecoder;
-typedef struct _JpegQuantTable JpegQuantTable;
-typedef struct _HuffmanEntry HuffmanEntry;
-typedef struct _HuffmanTable HuffmanTable;
-
-struct _HuffmanEntry {
-  unsigned int symbol;
-  unsigned int mask;
-  int n_bits;
-  unsigned char value;
-};
-
-struct _HuffmanTable {
-  int len;
-  HuffmanEntry entries[256];
-};
-
-struct _JpegQuantTable {
-  int pq;
-  int16_t quantizer[64];
-};
-
-struct _JpegDecoder {
-  int width;
-  int height;
-  int depth;
-  int n_components;
-  JpegBits bits;
-  int error;
-  int strict;
-  char *error_message;
-
-  int sof_type;
-
-  int width_blocks;
-  int height_blocks;
-
-  int restart_interval;
-
-  unsigned char *data;
-  unsigned int data_len;
-
-  struct{
-    int id;
-    int h_sample;
-    int v_sample;
-    int quant_table;
-
-    int h_subsample;
-    int v_subsample;
-    unsigned char *image;
-    int rowstride;
-  } components[JPEG_LIMIT_COMPONENTS];
-
-  JpegQuantTable quant_tables[4];
-  HuffmanTable dc_huff_table[4];
-  HuffmanTable ac_huff_table[4];
-
-  int scan_list_length;
-  struct{
-    int component_index;
-    int dc_table;
-    int ac_table;
-    int quant_table;
-    int x;
-    int y;
-    int offset;
-  }scan_list[JPEG_LIMIT_SCAN_LIST_LENGTH];
-  int scan_h_subsample;
-  int scan_v_subsample;
-
-  /* scan state */
-  int x,y;
-  int dc[4];
-};
-
-#define JPEG_MARKER_STUFFED		0x00
-#define JPEG_MARKER_TEM			0x01
-#define JPEG_MARKER_RES			0x02
-
-#define JPEG_MARKER_SOF_0		0xc0
-#define JPEG_MARKER_SOF_1		0xc1
-#define JPEG_MARKER_SOF_2		0xc2
-#define JPEG_MARKER_SOF_3		0xc3
-#define JPEG_MARKER_DEFINE_HUFFMAN_TABLES		0xc4
-#define JPEG_MARKER_SOF_5		0xc5
-#define JPEG_MARKER_SOF_6		0xc6
-#define JPEG_MARKER_SOF_7		0xc7
-#define JPEG_MARKER_JPG			0xc8
-#define JPEG_MARKER_SOF_9		0xc9
-#define JPEG_MARKER_SOF_10		0xca
-#define JPEG_MARKER_SOF_11		0xcb
-#define JPEG_MARKER_DEFINE_ARITHMETIC_CONDITIONING	0xcc
-#define JPEG_MARKER_SOF_13		0xcd
-#define JPEG_MARKER_SOF_14		0xce
-#define JPEG_MARKER_SOF_15		0xcf
-
-#define JPEG_MARKER_RST_0		0xd0
-#define JPEG_MARKER_RST_1		0xd1
-#define JPEG_MARKER_RST_2		0xd2
-#define JPEG_MARKER_RST_3		0xd3
-#define JPEG_MARKER_RST_4		0xd4
-#define JPEG_MARKER_RST_5		0xd5
-#define JPEG_MARKER_RST_6		0xd6
-#define JPEG_MARKER_RST_7		0xd7
-
-#define JPEG_MARKER_SOI			0xd8
-#define JPEG_MARKER_EOI			0xd9
-#define JPEG_MARKER_SOS			0xda
-#define JPEG_MARKER_DEFINE_QUANTIZATION_TABLES		0xdb
-#define JPEG_MARKER_DNL			0xdc
-#define JPEG_MARKER_DEFINE_RESTART_INTERVAL		0xdd
-#define JPEG_MARKER_DHP			0xde
-#define JPEG_MARKER_EXP			0xdf
-#define JPEG_MARKER_APP(x)		(0xe0 + (x))
-#define JPEG_MARKER_JPG_(x)		(0xf0 + (x))
-#define JPEG_MARKER_COMMENT                             0xfe
-
-#define JPEG_MARKER_JFIF		JPEG_MARKER_APP(0)
-
-#define JPEG_MARKER_IS_START_OF_FRAME(x) ((x)>=0xc0 && (x) <= 0xcf && (x)!=0xc4 && (x)!=0xc8 && (x)!=0xcc)
-#define JPEG_MARKER_IS_APP(x) ((x)>=0xe0 && (x) <= 0xef)
-#define JPEG_MARKER_IS_RESET(x) ((x)>=0xd0 && (x)<=0xd7)
-
-
-
-JpegDecoder *jpeg_decoder_new(void);
-void jpeg_decoder_free(JpegDecoder *dec);
-int jpeg_decoder_addbits(JpegDecoder *dec, unsigned char *data, unsigned int len);
-int jpeg_decoder_decode (JpegDecoder *dec);
-int jpeg_decoder_get_image_size(JpegDecoder *dec, int *width, int *height);
-int jpeg_decoder_get_component_size(JpegDecoder *dec, int id,
-	int *width, int *height);
-int jpeg_decoder_get_component_subsampling(JpegDecoder *dec, int id,
-	int *h_subsample, int *v_subsample);
-int jpeg_decoder_get_component_ptr(JpegDecoder *dec, int id,
-	unsigned char **image, int *rowstride);
-
-uint32_t *jpeg_decoder_get_argb_image (JpegDecoder *dec);
-int jpeg_decode_argb (uint8_t *data, int length, uint32_t **image,
-    int *width, int *height);
-
-void jpeg_decoder_error(JpegDecoder *dec, const char *fmt, ...);
-
-int jpeg_decoder_sof_baseline_dct(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_define_quant_table(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_define_huffman_table(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_sos(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_soi(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_eoi(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_application0(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_application_misc(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_comment(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_restart_interval(JpegDecoder *dec, JpegBits *bits);
-int jpeg_decoder_restart(JpegDecoder *dec, JpegBits *bits);
-void jpeg_decoder_decode_entropy_segment(JpegDecoder *dec);
-
-
-void huffman_table_init(HuffmanTable *table);
-
-void huffman_table_dump(HuffmanTable *table);
-void huffman_table_add(HuffmanTable *table, uint32_t code, int n_bits,
-	int value);
-unsigned int huffman_table_decode_jpeg(JpegDecoder *dec, HuffmanTable *tab, JpegBits *bits);
-int huffman_table_decode_macroblock(JpegDecoder *dec, short *block, HuffmanTable *dc_tab,
-	HuffmanTable *ac_tab, JpegBits *bits);
-int huffman_table_decode(JpegDecoder *dec, HuffmanTable *dc_tab, HuffmanTable *ac_tab, JpegBits *bits);
-
-
-#endif
-
diff --git a/libswfdec/jpeg/jpeg_bits.c b/libswfdec/jpeg/jpeg_bits.c
deleted file mode 100644
index 87700e9..0000000
--- a/libswfdec/jpeg/jpeg_bits.c
+++ /dev/null
@@ -1,154 +0,0 @@
-
-#include <stdio.h>
-
-#include "jpeg_bits.h"
-
-/* FIXME */
-#define TRUE 1
-#define FALSE 0
-
-int jpeg_bits_error (JpegBits *bits)
-{
-  return bits->error;
-}
-
-int jpeg_bits_get_u8 (JpegBits *bits)
-{
-  if (bits->ptr < bits->end) {
-    return *bits->ptr++;
-  } 
-  bits->error = TRUE;
-  return 0;
-}
-
-void jpeg_bits_skip (JpegBits *bits, int n)
-{
-  bits->ptr += n;
-  if (bits->ptr > bits->end) {
-    bits->error = TRUE;
-    bits->ptr = bits->end;
-  }
-}
-
-int jpeg_bits_get_u16_be (JpegBits *bits)
-{
-  int x;
-
-  x = jpeg_bits_get_u8 (bits) << 8;
-  x |= jpeg_bits_get_u8 (bits);
-
-  return x;
-}
-
-int jpeg_bits_available (JpegBits *bits)
-{
-  return bits->end - bits->ptr;
-}
-
-int bits_needbits(JpegBits *b, int n_bytes)
-{
-  if(b->ptr==NULL)return 1;
-  if(b->ptr + n_bytes > b->end)return 1;
-
-  return 0;
-}
-
-int getbit(JpegBits *b)
-{
-	int r;
-
-	r = ((*b->ptr)>>(7-b->idx))&1;
-
-	b->idx++;
-	if(b->idx>=8){
-		b->ptr++;
-		b->idx = 0;
-	}
-
-	return r;
-}
-
-unsigned int getbits(JpegBits *b, int n)
-{
-	unsigned long r = 0;
-	int i;
-
-	for(i=0;i<n;i++){
-		r <<=1;
-		r |= getbit(b);
-	}
-
-	return r;
-}
-
-unsigned int peekbits(JpegBits *b, int n)
-{
-	JpegBits tmp = *b;
-
-	return getbits(&tmp, n);
-}
-
-int getsbits(JpegBits *b, int n)
-{
-	unsigned long r = 0;
-	int i;
-
-	if(n==0)return 0;
-	r = -getbit(b);
-	for(i=1;i<n;i++){
-		r <<=1;
-		r |= getbit(b);
-	}
-
-	return r;
-}
-
-unsigned int peek_u8(JpegBits *b)
-{
-	return *b->ptr;
-}
-
-unsigned int get_u8(JpegBits *b)
-{
-	return *b->ptr++;
-}
-
-unsigned int get_u16(JpegBits *b)
-{
-	unsigned int r;
-
-	r = b->ptr[0] | (b->ptr[1]<<8);
-	b->ptr+=2;
-
-	return r;
-}
-
-unsigned int get_be_u16(JpegBits *b)
-{
-	unsigned int r;
-
-	r = (b->ptr[0]<<8) | b->ptr[1];
-	b->ptr+=2;
-
-	return r;
-}
-
-unsigned int get_u32(JpegBits *b)
-{
-	unsigned int r;
-
-	r = b->ptr[0] | (b->ptr[1]<<8) | (b->ptr[2]<<16) | (b->ptr[3]<<24);
-	b->ptr+=4;
-
-	return r;
-}
-
-void syncbits(JpegBits *b)
-{
-	if(b->idx){
-		b->ptr++;
-		b->idx=0;
-	}
-
-}
-
diff --git a/libswfdec/jpeg/jpeg_bits.h b/libswfdec/jpeg/jpeg_bits.h
deleted file mode 100644
index 90cdcec..0000000
--- a/libswfdec/jpeg/jpeg_bits.h
+++ /dev/null
@@ -1,32 +0,0 @@
-
-#ifndef __BITS_H__
-#define __BITS_H__
-
-typedef struct _JpegBits JpegBits;
-struct _JpegBits {
-	unsigned char *ptr;
-	int idx;
-	unsigned char *end;
-        int error;
-};
-
-int jpeg_bits_error (JpegBits *bits);
-int jpeg_bits_get_u8 (JpegBits *bits);
-void jpeg_bits_skip (JpegBits *bits, int n);
-int jpeg_bits_get_u16_be (JpegBits *bits);
-int jpeg_bits_available (JpegBits *bits);
-
-int bits_needbits(JpegBits *b, int n_bytes);
-int getbit(JpegBits *b);
-unsigned int getbits(JpegBits *b, int n);
-unsigned int peekbits(JpegBits *b, int n);
-int getsbits(JpegBits *b, int n);
-unsigned int peek_u8(JpegBits *b);
-unsigned int get_u8(JpegBits *b);
-unsigned int get_u16(JpegBits *b);
-unsigned int get_be_u16(JpegBits *b);
-unsigned int get_u32(JpegBits *b);
-void syncbits(JpegBits *b);
-
-#endif
-
diff --git a/libswfdec/jpeg/jpeg_huffman.c b/libswfdec/jpeg/jpeg_huffman.c
deleted file mode 100644
index d5b7f61..0000000
--- a/libswfdec/jpeg/jpeg_huffman.c
+++ /dev/null
@@ -1,168 +0,0 @@
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <cogcompat.h>
-#include <liboil/liboil.h>
-
-#include <string.h>
-
-#include "jpeg.h"
-
-/* misc helper function definitions */
-
-static char *sprintbits (char *str, unsigned int bits, int n);
-
-
-void
-huffman_table_dump (HuffmanTable * table)
-{
-  unsigned int n_bits;
-  unsigned int code;
-  char str[33];
-  int i;
-  HuffmanEntry *entry;
-
-  COG_DEBUG ("dumping huffman table %p", table);
-  for (i = 0; i < table->len; i++) {
-    entry = table->entries + i;
-    n_bits = entry->n_bits;
-    code = entry->symbol >> (16 - n_bits);
-    sprintbits (str, code, n_bits);
-    COG_DEBUG ("%s --> %d", str, entry->value);
-  }
-}
-
-void
-huffman_table_init (HuffmanTable *table)
-{
-  memset (table, 0, sizeof(HuffmanTable));
-}
-
-void
-huffman_table_add (HuffmanTable * table, uint32_t code, int n_bits, int value)
-{
-  HuffmanEntry *entry = table->entries + table->len;
-
-  entry->value = value;
-  entry->symbol = code << (16 - n_bits);
-  entry->mask = 0xffff ^ (0xffff >> n_bits);
-  entry->n_bits = n_bits;
-
-  table->len++;
-}
-
-unsigned int
-huffman_table_decode_jpeg (JpegDecoder *dec, HuffmanTable * tab, JpegBits * bits)
-{
-  unsigned int code;
-  int i;
-  char str[33];
-  HuffmanEntry *entry;
-
-  code = peekbits (bits, 16);
-  for (i = 0; i < tab->len; i++) {
-    entry = tab->entries + i;
-    if ((code & entry->mask) == entry->symbol) {
-      code = getbits (bits, entry->n_bits);
-      sprintbits (str, code, entry->n_bits);
-      COG_DEBUG ("%s --> %d", str, entry->value);
-      return entry->value;
-    }
-  }
-  COG_ERROR ("huffman sync lost");
-
-  return -1;
-}
-
-int
-huffman_table_decode_macroblock (JpegDecoder *dec, short *block, HuffmanTable * dc_tab,
-    HuffmanTable * ac_tab, JpegBits * bits)
-{
-  int r, s, x, rs;
-  int k;
-  char str[33];
-
-  memset (block, 0, sizeof (short) * 64);
-
-  s = huffman_table_decode_jpeg (dec, dc_tab, bits);
-  if (s < 0)
-    return -1;
-  x = getbits (bits, s);
-  if ((x >> (s - 1)) == 0) {
-    x -= (1 << s) - 1;
-  }
-  COG_DEBUG ("s=%d (block[0]=%d)", s, x);
-  block[0] = x;
-
-  for (k = 1; k < 64; k++) {
-    rs = huffman_table_decode_jpeg (dec, ac_tab, bits);
-    if (rs < 0) {
-      COG_DEBUG ("huffman error");
-      return -1;
-    }
-    if (bits->ptr > bits->end) {
-      COG_DEBUG ("overrun");
-      return -1;
-    }
-    s = rs & 0xf;
-    r = rs >> 4;
-    if (s == 0) {
-      if (r == 15) {
-        COG_DEBUG ("r=%d s=%d (skip 16)", r, s);
-        k += 15;
-      } else {
-        COG_DEBUG ("r=%d s=%d (eob)", r, s);
-        break;
-      }
-    } else {
-      k += r;
-      if (k >= 64) {
-        jpeg_decoder_error (dec, "macroblock overrun");
-        return -1;
-      }
-      x = getbits (bits, s);
-      sprintbits (str, x, s);
-      if ((x >> (s - 1)) == 0) {
-        x -= (1 << s) - 1;
-      }
-      block[k] = x;
-      COG_DEBUG ("r=%d s=%d (%s -> block[%d]=%d)", r, s, str, k, x);
-    }
-  }
-  return 0;
-}
-
-int
-huffman_table_decode (JpegDecoder *dec, HuffmanTable * dc_tab, HuffmanTable * ac_tab,
-    JpegBits * bits)
-{
-  int16_t zz[64];
-  int ret;
-
-  while (bits->ptr < bits->end) {
-    ret = huffman_table_decode_macroblock (dec, zz, dc_tab, ac_tab, bits);
-    if (ret < 0)
-      return -1;
-  }
-
-  return 0;
-}
-
-/* misc helper functins */
-
-static char *
-sprintbits (char *str, unsigned int bits, int n)
-{
-  int i;
-  int bit = 1 << (n - 1);
-
-  for (i = 0; i < n; i++) {
-    str[i] = (bits & bit) ? '1' : '0';
-    bit >>= 1;
-  }
-  str[i] = 0;
-
-  return str;
-}
diff --git a/libswfdec/jpeg/jpeg_huffman.h b/libswfdec/jpeg/jpeg_huffman.h
deleted file mode 100644
index 9763e09..0000000
--- a/libswfdec/jpeg/jpeg_huffman.h
+++ /dev/null
@@ -1,37 +0,0 @@
-
-#ifndef _HUFFMAN_H_
-#define _HUFFMAN_H_
-
-#include <liboil/liboil-stdint.h>
-
-#include "jpeg_bits.h"
-
-typedef struct _HuffmanEntry HuffmanEntry;
-typedef struct _HuffmanTable HuffmanTable;
-
-struct _HuffmanEntry {
-  unsigned int symbol;
-  unsigned int mask;
-  int n_bits;
-  unsigned char value;
-};
-
-struct _HuffmanTable {
-  int len;
-  HuffmanEntry entries[256];
-};
-
-
-void huffman_table_init(HuffmanTable *table);
-
-void huffman_table_dump(HuffmanTable *table);
-void huffman_table_add(HuffmanTable *table, uint32_t code, int n_bits,
-	int value);
-unsigned int huffman_table_decode_jpeg(HuffmanTable *tab, JpegBits *bits);
-int huffman_table_decode_macroblock(short *block, HuffmanTable *dc_tab,
-	HuffmanTable *ac_tab, JpegBits *bits);
-int huffman_table_decode(HuffmanTable *dc_tab, HuffmanTable *ac_tab, JpegBits *bits);
-
-
-#endif
-
diff --git a/libswfdec/jpeg/jpeg_markers.h b/libswfdec/jpeg/jpeg_markers.h
deleted file mode 100644
index 584cb23..0000000
--- a/libswfdec/jpeg/jpeg_markers.h
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#define JPEG_MARKER_STUFFED		0x00
-#define JPEG_MARKER_TEM			0x01
-#define JPEG_MARKER_RES			0x02
-
-#define JPEG_MARKER_SOF_0		0xc0
-#define JPEG_MARKER_SOF_1		0xc1
-#define JPEG_MARKER_SOF_2		0xc2
-#define JPEG_MARKER_SOF_3		0xc3
-#define JPEG_MARKER_DHT			0xc4
-#define JPEG_MARKER_SOF_5		0xc5
-#define JPEG_MARKER_SOF_6		0xc6
-#define JPEG_MARKER_SOF_7		0xc7
-#define JPEG_MARKER_JPG			0xc8
-#define JPEG_MARKER_SOF_9		0xc9
-#define JPEG_MARKER_SOF_10		0xca
-#define JPEG_MARKER_SOF_11		0xcb
-#define JPEG_MARKER_DAC			0xcc
-#define JPEG_MARKER_SOF_13		0xcd
-#define JPEG_MARKER_SOF_14		0xce
-#define JPEG_MARKER_SOF_15		0xcf
-
-#define JPEG_MARKER_RST_0		0xd0
-#define JPEG_MARKER_RST_1		0xd1
-#define JPEG_MARKER_RST_2		0xd2
-#define JPEG_MARKER_RST_3		0xd3
-#define JPEG_MARKER_RST_4		0xd4
-#define JPEG_MARKER_RST_5		0xd5
-#define JPEG_MARKER_RST_6		0xd6
-#define JPEG_MARKER_RST_7		0xd7
-#define JPEG_MARKER_SOI			0xd8
-#define JPEG_MARKER_EOI			0xd9
-#define JPEG_MARKER_SOS			0xda
-#define JPEG_MARKER_DQT			0xdb
-#define JPEG_MARKER_DNL			0xdc
-#define JPEG_MARKER_DRI			0xdd
-#define JPEG_MARKER_DHP			0xde
-#define JPEG_MARKER_EXP			0xdf
-#define JPEG_MARKER_APP(x)		(0xe0 + (x))
-#define JPEG_MARKER_JPG_(x)		(0xf0 + (x))
-#define JPEG_MARKER_COM			0xfe
-
-#define JPEG_MARKER_JFIF		JPEG_MARKER_APP(0)
-
diff --git a/libswfdec/jpeg/jpeg_rgb_decoder.c b/libswfdec/jpeg/jpeg_rgb_decoder.c
deleted file mode 100644
index 3c01914..0000000
--- a/libswfdec/jpeg/jpeg_rgb_decoder.c
+++ /dev/null
@@ -1,352 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "jpeg.h"
-
-#include <liboil/liboil.h>
-#include <liboil/liboildebug.h>
-
-#define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
-#define oil_argb(a,r,g,b) \
-  ((oil_clamp_255(a)<<24) | \
-   (oil_clamp_255(r)<<16) | \
-   (oil_clamp_255(g)<<8) | \
-   (oil_clamp_255(b)<<0))
-#define oil_max(x,y) ((x)>(y)?(x):(y))
-#define oil_min(x,y) ((x)<(y)?(x):(y))
-#define oil_clamp_255(x) oil_max(0,oil_min((x),255))
-
-
-static int16_t jfif_matrix[24] = {
-  0,      0,      -8192,   -8192,
-  16384,  0,      0,       0,
-  0,      16384,  16384,   16384,
-  0,      0,      -5638,   29032,
-  0,      22970,  -11700,  0,
-  0, 0, 0, 0
-};
-
-
-uint32_t * get_argb_444 (JpegDecoder *dec);
-uint32_t * get_argb_422 (JpegDecoder *dec);
-uint32_t * get_argb_422v (JpegDecoder *dec);
-uint32_t * get_argb_420 (JpegDecoder *dec);
-
-#if 0
-static void imagescale2h_u8 (unsigned char *dest, int d_rowstride,
-    unsigned char *src, int src_rowstride, int width, int height);
-static void imagescale2v_u8 (unsigned char *dest, int d_rowstride,
-    unsigned char *src, int src_rowstride, int width, int height);
-static void imagescale2h2v_u8 (unsigned char *dest, int d_rowstride,
-    unsigned char *src, int src_rowstride, int width, int height);
-static void scanlinescale2_u8 (unsigned char *dest, unsigned char *src,
-    int len);
-#endif
-
-
-int jpeg_decode_argb (uint8_t *data, int length, uint32_t **image,
-    int *width, int *height)
-{
-  JpegDecoder *dec;
-  int ret;
-
-  dec = jpeg_decoder_new();
-
-  jpeg_decoder_addbits (dec, data, length);
-  ret = jpeg_decoder_decode(dec);
-
-  if (!ret) return FALSE;
-
-  jpeg_decoder_get_image_size (dec, width, height);
-  *image = (uint32_t *)jpeg_decoder_get_argb_image (dec);
-  jpeg_decoder_free (dec);
-
-  return TRUE;
-}
-
-uint32_t *
-jpeg_decoder_get_argb_image (JpegDecoder *dec)
-{
-
-  if (dec->n_components == 3) {
-    if (dec->components[0].h_subsample == 1 &&
-        dec->components[0].v_subsample == 1 &&
-        dec->components[1].h_subsample == dec->components[2].h_subsample &&
-        dec->components[1].v_subsample == dec->components[2].v_subsample) {
-      if (dec->components[1].h_subsample == 1 &&
-          dec->components[1].v_subsample == 1) {
-        return get_argb_444 (dec);
-      } else if (dec->components[1].h_subsample == 2 &&
-          dec->components[1].v_subsample == 1) {
-        return get_argb_422 (dec);
-      } else if (dec->components[1].h_subsample == 1 &&
-          dec->components[1].v_subsample == 2) {
-        return get_argb_422v (dec);
-      } else if (dec->components[1].h_subsample == 2 &&
-          dec->components[1].v_subsample == 2) {
-        return get_argb_420 (dec);
-      }
-    }
-  }
-
-  return NULL;
-}
-
-static void
-yuv_mux (uint32_t *dest, uint8_t *src_y, uint8_t *src_u, uint8_t *src_v,
-    int n)
-{
-  int i;
-  for (i = 0; i < n; i++) {
-    dest[i] = oil_argb(255, src_y[i], src_u[i], src_v[i]);
-  }
-}
-
-static void
-upsample (uint8_t *d, uint8_t *s, int n)
-{
-  int i;
-
-  d[0] = s[0];
-
-  for (i = 0; i < n-3; i+=2) {
-    d[i + 1] = (3*s[i/2] + s[i/2+1] + 2)>>2;
-    d[i + 2] = (s[i/2] + 3*s[i/2+1] + 2)>>2;
-  }
-
-  if (n&1) {
-    i = n-3;
-    d[n-2] = s[n/2];
-    d[n-1] = s[n/2];
-  } else {
-    d[n-1] = s[n/2-1];
-  }
-
-}
-
-uint32_t *
-get_argb_444 (JpegDecoder *dec)
-{
-  uint32_t *tmp;
-  uint32_t *argb_image;
-  uint8_t *yp, *up, *vp;
-  uint32_t *argbp;
-  int j;
-
-  tmp = malloc (4 * dec->width * dec->height);
-  argb_image = malloc (4 * dec->width * dec->height);
-
-  yp = dec->components[0].image;
-  up = dec->components[1].image;
-  vp = dec->components[2].image;
-  argbp = argb_image;
-  for(j=0;j<dec->height;j++){
-    yuv_mux (tmp, yp, up, vp, dec->width);
-    oil_colorspace_argb(argbp, tmp, jfif_matrix, dec->width);
-    yp += dec->components[0].rowstride;
-    up += dec->components[1].rowstride;
-    vp += dec->components[2].rowstride;
-    argbp += dec->width;
-  }
-  free(tmp);
-  return argb_image;
-}
-
-uint32_t *
-get_argb_422 (JpegDecoder *dec)
-{
-  uint32_t *tmp;
-  uint8_t *tmp_u;
-  uint8_t *tmp_v;
-  uint32_t *argb_image;
-  uint8_t *yp, *up, *vp;
-  uint32_t *argbp;
-  int j;
-
-  tmp = malloc (4 * dec->width * dec->height);
-  tmp_u = malloc (dec->width);
-  tmp_v = malloc (dec->width);
-  argb_image = malloc (4 * dec->width * dec->height);
-
-  yp = dec->components[0].image;
-  up = dec->components[1].image;
-  vp = dec->components[2].image;
-  argbp = argb_image;
-  for(j=0;j<dec->height;j++){
-    upsample (tmp_u, up, dec->width);
-    upsample (tmp_v, vp, dec->width);
-    yuv_mux (tmp, yp, tmp_u, tmp_v, dec->width);
-    oil_colorspace_argb(argbp, tmp, jfif_matrix, dec->width);
-    yp += dec->components[0].rowstride;
-    up += dec->components[1].rowstride;
-    vp += dec->components[2].rowstride;
-    argbp += dec->width;
-  }
-  free(tmp);
-  free(tmp_u);
-  free(tmp_v);
-  return argb_image;
-}
-
-uint32_t *
-get_argb_422v (JpegDecoder *dec)
-{
-  uint32_t *tmp;
-  uint8_t *tmp_u;
-  uint8_t *tmp_v;
-  uint32_t *argb_image;
-  uint8_t *yp, *up, *vp;
-  uint32_t *argbp;
-  int halfheight;
-  int j;
-
-  tmp = malloc (4 * dec->width * dec->height);
-  tmp_u = malloc (dec->width);
-  tmp_v = malloc (dec->width);
-  argb_image = malloc (4 * dec->width * dec->height);
-
-  yp = dec->components[0].image;
-  up = dec->components[1].image;
-  vp = dec->components[2].image;
-  argbp = argb_image;
-  halfheight = (dec->height+1)>>1;
-  for(j=0;j<dec->height;j++){
-    uint32_t weight = 192 - 128*(j&1);
-
-    oil_merge_linear_u8(tmp_u,
-        up + dec->components[1].rowstride * CLAMP((j-1)/2,0,halfheight-1),
-        up + dec->components[1].rowstride * CLAMP((j+1)/2,0,halfheight-1),
-        &weight, dec->width);
-    oil_merge_linear_u8(tmp_v,
-        vp + dec->components[2].rowstride * CLAMP((j-1)/2,0,halfheight-1),
-        vp + dec->components[2].rowstride * CLAMP((j+1)/2,0,halfheight-1),
-        &weight, dec->width);
-
-    yuv_mux (tmp, yp, tmp_u, tmp_v, dec->width);
-    oil_colorspace_argb(argbp, tmp, jfif_matrix, dec->width);
-    yp += dec->components[0].rowstride;
-    argbp += dec->width;
-  }
-  free(tmp);
-  free(tmp_u);
-  free(tmp_v);
-  return argb_image;
-}
-
-uint32_t *
-get_argb_420 (JpegDecoder *dec)
-{
-  uint32_t *tmp;
-  uint8_t *tmp_u;
-  uint8_t *tmp_v;
-  uint8_t *tmp1;
-  uint32_t *argb_image;
-  uint8_t *yp, *up, *vp;
-  uint32_t *argbp;
-  int j;
-  int halfwidth;
-  int halfheight;
-
-  halfwidth = (dec->width + 1)>>1;
-  tmp = malloc (4 * dec->width * dec->height);
-  tmp_u = malloc (dec->width);
-  tmp_v = malloc (dec->width);
-  tmp1 = malloc (halfwidth);
-  argb_image = malloc (4 * dec->width * dec->height);
-
-  yp = dec->components[0].image;
-  up = dec->components[1].image;
-  vp = dec->components[2].image;
-  argbp = argb_image;
-  halfheight = (dec->height+1)>>1;
-  for(j=0;j<dec->height;j++){
-    uint32_t weight = 192 - 128*(j&1);
-
-    oil_merge_linear_u8(tmp1,
-        up + dec->components[1].rowstride * CLAMP((j-1)/2,0,halfheight-1),
-        up + dec->components[1].rowstride * CLAMP((j+1)/2,0,halfheight-1),
-        &weight, halfwidth);
-    upsample (tmp_u, tmp1, dec->width);
-    oil_merge_linear_u8(tmp1,
-        vp + dec->components[2].rowstride * CLAMP((j-1)/2,0,halfheight-1),
-        vp + dec->components[2].rowstride * CLAMP((j+1)/2,0,halfheight-1),
-        &weight, halfwidth);
-    upsample (tmp_v, tmp1, dec->width);
-
-    yuv_mux (tmp, yp, tmp_u, tmp_v, dec->width);
-    oil_colorspace_argb(argbp, tmp, jfif_matrix, dec->width);
-    yp += dec->components[0].rowstride;
-    argbp += dec->width;
-  }
-  free(tmp);
-  free(tmp_u);
-  free(tmp_v);
-  free(tmp1);
-  return argb_image;
-}
-
-#if 0
-int
-jpeg_rgb_decoder_get_image (JpegRGBDecoder * rgbdec,
-    unsigned char **image, int *rowstride, int *width, int *height)
-{
-  int i;
-
-  jpeg_decoder_get_image_size (rgbdec->dec, &rgbdec->width, &rgbdec->height);
-  for (i = 0; i < 3; i++) {
-    jpeg_decoder_get_component_ptr (rgbdec->dec, i + 1,
-        &rgbdec->component[i].image, &rgbdec->component[i].rowstride);
-    jpeg_decoder_get_component_subsampling (rgbdec->dec, i + 1,
-        &rgbdec->component[i].h_subsample, &rgbdec->component[i].v_subsample);
-    rgbdec->component[i].alloc = 0;
-    if (rgbdec->component[i].h_subsample > 1 ||
-        rgbdec->component[i].v_subsample > 1) {
-      unsigned char *dest;
-
-      dest = malloc (rgbdec->width * rgbdec->height);
-      if (rgbdec->component[i].v_subsample > 1) {
-        if (rgbdec->component[i].h_subsample > 1) {
-          imagescale2h2v_u8 (dest,
-              rgbdec->width,
-              rgbdec->component[i].image,
-              rgbdec->component[i].rowstride, rgbdec->width, rgbdec->height);
-        } else {
-          imagescale2v_u8 (dest,
-              rgbdec->width,
-              rgbdec->component[i].image,
-              rgbdec->component[i].rowstride, rgbdec->width, rgbdec->height);
-        }
-      } else {
-        imagescale2h_u8 (dest,
-            rgbdec->width,
-            rgbdec->component[i].image,
-            rgbdec->component[i].rowstride, rgbdec->width, rgbdec->height);
-      }
-      rgbdec->component[i].alloc = 1;
-      rgbdec->component[i].image = dest;
-      rgbdec->component[i].rowstride = rgbdec->width;
-      rgbdec->component[i].h_subsample = 1;
-      rgbdec->component[i].v_subsample = 1;
-    }
-  }
-
-  rgbdec->image = malloc (rgbdec->width * rgbdec->height * 4);
-
-  convert (rgbdec);
-
-  if (image)
-    *image = rgbdec->image;
-  if (rowstride)
-    *rowstride = rgbdec->width * 4;
-  if (width)
-    *width = rgbdec->width;
-  if (height)
-    *height = rgbdec->height;
-
-  return 0;
-}
-#endif
-
-
diff --git a/libswfdec/jpeg/jpeg_rgb_decoder.h b/libswfdec/jpeg/jpeg_rgb_decoder.h
deleted file mode 100644
index 08501ff..0000000
--- a/libswfdec/jpeg/jpeg_rgb_decoder.h
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#ifndef _JPEG_RGB_DECODER_H_
-#define _JPEG_RGB_DECODER_H_
-
-typedef struct jpeg_rgb_decoder_struct JpegRGBDecoder;
-
-
-JpegRGBDecoder *jpeg_rgb_decoder_new(void);
-void jpeg_rgb_decoder_free(JpegRGBDecoder *dec);
-int jpeg_rgb_decoder_addbits(JpegRGBDecoder *dec, unsigned char *data, unsigned int len);
-int jpeg_rgb_decoder_parse(JpegRGBDecoder *dec);
-int jpeg_rgb_decoder_get_image(JpegRGBDecoder *dec,
-	unsigned char **image, int *rowstride, int *width, int *height);
-
-
-
-#endif
-
diff --git a/libswfdec/jpeg/jpeg_tables.c b/libswfdec/jpeg/jpeg_tables.c
deleted file mode 100644
index bd2d22a..0000000
--- a/libswfdec/jpeg/jpeg_tables.c
+++ /dev/null
@@ -1,54 +0,0 @@
-
-unsigned char jpeg_standard_tables[] = {
-  0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
-  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
-
-  0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
-  0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
-  0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31,
-  0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32,
-  0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52,
-  0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
-  0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
-  0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45,
-  0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57,
-  0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-  0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83,
-  0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94,
-  0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
-  0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
-  0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-  0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
-  0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
-  0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
-  0xf9, 0xfa,
-
-  0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
-  0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
-  0x0a, 0x0b,
-
-  0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
-  0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
-  0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06,
-  0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81,
-  0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33,
-  0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
-  0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28,
-  0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44,
-  0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56,
-  0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
-  0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
-  0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92,
-  0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3,
-  0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
-  0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
-  0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-  0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
-  0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
-  0xf9, 0xfa,
-};
-
-int jpeg_standard_tables_size = sizeof(jpeg_standard_tables);
-
diff --git a/libswfdec/swfdec.h b/libswfdec/swfdec.h
deleted file mode 100644
index e2432eb..0000000
--- a/libswfdec/swfdec.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-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_H__
-#define __SWFDEC_H__
-
-#include <libswfdec/swfdec_as_context.h>
-#include <libswfdec/swfdec_as_debugger.h>
-#include <libswfdec/swfdec_as_frame.h>
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_native_function.h>
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
-
-#include <libswfdec/swfdec_audio.h>
-#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_player_scripting.h>
-#include <libswfdec/swfdec_rectangle.h>
-#include <libswfdec/swfdec_socket.h>
-#include <libswfdec/swfdec_stream.h>
-#include <libswfdec/swfdec_system.h>
-#include <libswfdec/swfdec_url.h>
-
-#endif
diff --git a/libswfdec/swfdec_accessibility.c b/libswfdec/swfdec_accessibility.c
deleted file mode 100644
index 46497d2..0000000
--- a/libswfdec/swfdec_accessibility.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_internal.h"
-#include "swfdec_debug.h"
-
-SWFDEC_AS_NATIVE (1999, 0, swfdec_accessibility_isActive)
-void
-swfdec_accessibility_isActive (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("Accessibility.isActive (static)");
-}
-
-SWFDEC_AS_NATIVE (1999, 1, swfdec_accessibility_sendEvent)
-void
-swfdec_accessibility_sendEvent (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("Accessibility.sendEvent (static)");
-}
-
-SWFDEC_AS_NATIVE (1999, 2, swfdec_accessibility_updateProperties)
-void
-swfdec_accessibility_updateProperties (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("Accessibility.updateProperties (static)");
-}
diff --git a/libswfdec/swfdec_amf.c b/libswfdec/swfdec_amf.c
deleted file mode 100644
index 688df0a..0000000
--- a/libswfdec/swfdec_amf.c
+++ /dev/null
@@ -1,225 +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 HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_amf.h"
-#include "swfdec_as_array.h"
-#include "swfdec_debug.h"
-
-typedef gboolean (* SwfdecAmfParseFunc) (SwfdecAsContext *cx, SwfdecBits *bits, SwfdecAsValue *val);
-extern const SwfdecAmfParseFunc parse_funcs[SWFDEC_AMF_N_TYPES];
-
-static gboolean
-swfdec_amf_parse_boolean (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  SWFDEC_AS_VALUE_SET_BOOLEAN (val, swfdec_bits_get_u8 (bits) ? TRUE : FALSE);
-  return TRUE;
-}
-
-static gboolean
-swfdec_amf_parse_number (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  SWFDEC_AS_VALUE_SET_NUMBER (val, swfdec_bits_get_bdouble (bits));
-  return TRUE;
-}
-
-static gboolean
-swfdec_amf_parse_string (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  guint len = swfdec_bits_get_bu16 (bits);
-  char *s;
-  
-  /* FIXME: the supplied version is likely incorrect */
-  s = swfdec_bits_get_string_length (bits, len, context->version);
-  if (s == NULL)
-    return FALSE;
-  SWFDEC_AS_VALUE_SET_STRING (val, swfdec_as_context_give_string (context, s));
-  return TRUE;
-}
-
-static gboolean
-swfdec_amf_parse_properties (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsObject *object)
-{
-  guint type;
-  SwfdecAmfParseFunc func;
-
-  while (swfdec_bits_left (bits)) {
-    SwfdecAsValue val;
-    const char *name;
-
-    if (!swfdec_amf_parse_string (context, bits, &val))
-      return FALSE;
-    name = SWFDEC_AS_VALUE_GET_STRING (&val);
-    type = swfdec_bits_get_u8 (bits);
-    if (type == SWFDEC_AMF_END_OBJECT)
-      break;
-    if (type >= SWFDEC_AMF_N_TYPES ||
-	(func = parse_funcs[type]) == NULL) {
-      SWFDEC_ERROR ("no parse func for AMF type %u", type);
-      goto error;
-    }
-    swfdec_as_object_set_variable (object, name, &val); /* GC... */
-    if (!func (context, bits, &val)) {
-      goto error;
-    }
-    swfdec_as_object_set_variable (object, name, &val);
-  }
-  /* no more bytes seems to end automatically */
-  return TRUE;
-
-error:
-  return FALSE;
-}
-
-static gboolean
-swfdec_amf_parse_object (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  SwfdecAsObject *object;
-  
-  object = swfdec_as_object_new (context);
-  if (object == NULL)
-    return FALSE;
-  if (!swfdec_amf_parse_properties (context, bits, object))
-    return FALSE;
-  SWFDEC_AS_VALUE_SET_OBJECT (val, object);
-  return TRUE;
-}
-
-static gboolean
-swfdec_amf_parse_mixed_array (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  guint len;
-  SwfdecAsObject *array;
-  
-  len = swfdec_bits_get_bu32 (bits);
-  array = swfdec_as_array_new (context);
-  if (array == NULL)
-    return FALSE;
-  if (!swfdec_amf_parse_properties (context, bits, array))
-    return FALSE;
-  SWFDEC_AS_VALUE_SET_OBJECT (val, array);
-  return TRUE;
-}
-
-static gboolean
-swfdec_amf_parse_array (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsValue *val)
-{
-  guint i, len;
-  SwfdecAsObject *array;
-  guint type;
-  SwfdecAmfParseFunc func;
-  
-  len = swfdec_bits_get_bu32 (bits);
-  array = swfdec_as_array_new (context);
-  if (array == NULL)
-    return FALSE;
-  for (i = 0; i < len; i++) {
-    SwfdecAsValue tmp;
-    type = swfdec_bits_get_u8 (bits);
-    if (type >= SWFDEC_AMF_N_TYPES ||
-	(func = parse_funcs[type]) == NULL) {
-      SWFDEC_ERROR ("no parse func for AMF type %u", type);
-      goto fail;
-    }
-    if (!func (context, bits, &tmp))
-      goto fail;
-    swfdec_as_array_push (SWFDEC_AS_ARRAY (array), &tmp);
-  }
-
-  SWFDEC_AS_VALUE_SET_OBJECT (val, array);
-  return TRUE;
-
-fail:
-  return FALSE;
-}
-
-const SwfdecAmfParseFunc parse_funcs[SWFDEC_AMF_N_TYPES] = {
-  [SWFDEC_AMF_NUMBER] = swfdec_amf_parse_number,
-  [SWFDEC_AMF_BOOLEAN] = swfdec_amf_parse_boolean,
-  [SWFDEC_AMF_STRING] = swfdec_amf_parse_string,
-  [SWFDEC_AMF_OBJECT] = swfdec_amf_parse_object,
-  [SWFDEC_AMF_MIXED_ARRAY] = swfdec_amf_parse_mixed_array,
-  [SWFDEC_AMF_ARRAY] = swfdec_amf_parse_array,
-#if 0
-  SWFDEC_AMF_MOVIECLIP = 4,
-  SWFDEC_AMF_NULL = 5,
-  SWFDEC_AMF_UNDEFINED = 6,
-  SWFDEC_AMF_REFERENCE = 7,
-  SWFDEC_AMF_END_OBJECT = 9,
-  SWFDEC_AMF_ARRAY = 10,
-  SWFDEC_AMF_DATE = 11,
-  SWFDEC_AMF_BIG_STRING = 12,
-  SWFDEC_AMF_RECORDSET = 14,
-  SWFDEC_AMF_XML = 15,
-  SWFDEC_AMF_CLASS = 16,
-  SWFDEC_AMF_FLASH9 = 17,
-#endif
-};
-
-gboolean
-swfdec_amf_parse_one (SwfdecAsContext *context, SwfdecBits *bits, 
-    SwfdecAmfType expected_type, SwfdecAsValue *rval)
-{
-  SwfdecAmfParseFunc func;
-  guint type;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), 0);
-  g_return_val_if_fail (context->global != NULL, 0);
-  g_return_val_if_fail (bits != NULL, FALSE);
-  g_return_val_if_fail (rval != NULL, FALSE);
-  g_return_val_if_fail (expected_type < SWFDEC_AMF_N_TYPES, FALSE);
-
-  type = swfdec_bits_get_u8 (bits);
-  if (type != expected_type) {
-    SWFDEC_ERROR ("parse object should be type %u, but is %u", 
-	expected_type, type);
-    return FALSE;
-  }
-  if (type >= SWFDEC_AMF_N_TYPES ||
-      (func = parse_funcs[type]) == NULL) {
-    SWFDEC_ERROR ("no parse func for AMF type %u", type);
-    return FALSE;
-  }
-  return func (context, bits, rval);
-}
-
-guint
-swfdec_amf_parse (SwfdecAsContext *context, SwfdecBits *bits, guint n_items, ...)
-{
-  va_list args;
-  guint i;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), 0);
-  g_return_val_if_fail (context->global != NULL, 0);
-  g_return_val_if_fail (bits != NULL, 0);
-
-  va_start (args, n_items);
-  for (i = 0; i < n_items; i++) {
-    SwfdecAmfType type = va_arg (args, SwfdecAmfType);
-    SwfdecAsValue *val = va_arg (args, SwfdecAsValue *);
-    if (!swfdec_amf_parse_one (context, bits, type, val))
-      break;
-  }
-  va_end (args);
-  return i;
-}
-
diff --git a/libswfdec/swfdec_amf.h b/libswfdec/swfdec_amf.h
deleted file mode 100644
index 0f9c67e..0000000
--- a/libswfdec/swfdec_amf.h
+++ /dev/null
@@ -1,59 +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_AMF_H__
-#define __SWFDEC_AMF_H__
-
-#include <libswfdec/swfdec_as_context.h>
-#include <libswfdec/swfdec_bits.h>
-
-typedef enum {
-  SWFDEC_AMF_NUMBER = 0,
-  SWFDEC_AMF_BOOLEAN = 1,
-  SWFDEC_AMF_STRING = 2,
-  SWFDEC_AMF_OBJECT = 3,
-  SWFDEC_AMF_MOVIECLIP = 4,
-  SWFDEC_AMF_NULL = 5,
-  SWFDEC_AMF_UNDEFINED = 6,
-  SWFDEC_AMF_REFERENCE = 7,
-  SWFDEC_AMF_MIXED_ARRAY = 8,
-  SWFDEC_AMF_END_OBJECT = 9,
-  SWFDEC_AMF_ARRAY = 10,
-  SWFDEC_AMF_DATE = 11,
-  SWFDEC_AMF_BIG_STRING = 12,
-  /* what is 13? */
-  SWFDEC_AMF_RECORDSET = 14,
-  SWFDEC_AMF_XML = 15,
-  SWFDEC_AMF_CLASS = 16,
-  SWFDEC_AMF_FLASH9 = 17,
-  /* add more items here */
-  SWFDEC_AMF_N_TYPES
-} SwfdecAmfType;
-
-gboolean	swfdec_amf_parse_one		(SwfdecAsContext *	context, 
-						 SwfdecBits *		bits,
-						 SwfdecAmfType		expected_type,
-						 SwfdecAsValue *	rval);
-guint		swfdec_amf_parse		(SwfdecAsContext *	context, 
-						 SwfdecBits *		bits,
-						 guint			n_items,
-						 ...);
-
-
-#endif
diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c
deleted file mode 100644
index 344c087..0000000
--- a/libswfdec/swfdec_as_array.c
+++ /dev/null
@@ -1,1399 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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 <stdlib.h>
-#include <string.h>
-
-#include "swfdec_as_array.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_string.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_movie.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsArray, swfdec_as_array, SWFDEC_TYPE_AS_OBJECT)
-
-/**
- * SECTION:SwfdecAsArray
- * @title: SwfdecAsArray
- * @short_description: the array object
- *
- * The array object provides some convenience functions for creating and
- * modifying arrays.
- */
-
-/**
- * SwfdecAsArray
- *
- * This is the type of the array object.
- */
-
-/*
- * Internal helper functions
- */
-
-/* NB: type is important for overflow */
-static inline gint32
-swfdec_as_array_to_index (const char *str)
-{
-  char *end;
-  gulong l;
-
-  g_return_val_if_fail (str != NULL, -1);
-
-  l = strtoul (str, &end, 10);
-
-  if (*end != 0 || l > G_MAXINT32)
-    return -1;
-
-  return l;
-}
-
-static gint32
-swfdec_as_array_length_as_integer (SwfdecAsObject *object)
-{
-  SwfdecAsValue val;
-  gint32 length;
-
-  g_return_val_if_fail (object != NULL, 0);
-
-  swfdec_as_object_get_variable (object, SWFDEC_AS_STR_length, &val);
-  length = swfdec_as_value_to_integer (object->context, &val);
-
-  return length;
-}
-
-static gint32
-swfdec_as_array_length (SwfdecAsObject *object)
-{
-  gint32 length;
-
-  length = swfdec_as_array_length_as_integer (object);
-
-  if (length < 0)
-    return 0;
-
-  return length;
-}
-
-/**
- * swfdec_as_array_get_length:
- * @array: a #SwfdecAsArray
- *
- * Gets the current length of the @array.
- *
- * Returns: Current length of the @array, always >= 0
- **/
-gint32
-swfdec_as_array_get_length (SwfdecAsArray *array)
-{
-  return swfdec_as_array_length (SWFDEC_AS_OBJECT (array));
-}
-
-static void
-swfdec_as_array_set_length_object (SwfdecAsObject *object, gint32 length)
-{
-  SwfdecAsValue val;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-
-  SWFDEC_AS_VALUE_SET_INT (&val, length);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_length, &val,
-      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-}
-
-/**
- * swfdec_as_array_set_length:
- * @array: a #SwfdecAsArray
- * @length: the new length
- *
- * Sets the length of the @array. Values outside the new length will be
- * removed.
- **/
-void
-swfdec_as_array_set_length (SwfdecAsArray *array, gint32 length)
-{
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array));
-  g_return_if_fail (length >= 0);
-
-  swfdec_as_array_set_length_object (SWFDEC_AS_OBJECT (array), length);
-}
-
-typedef struct {
-  gint32	start_index;
-  gint32	num;
-} ForeachRemoveRangeData;
-
-static gboolean
-swfdec_as_array_foreach_remove_range (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachRemoveRangeData *fdata = data;
-  gint32 idx;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1)
-    return FALSE;
-
-  if (idx >= fdata->start_index && idx < fdata->start_index + fdata->num)
-    return TRUE;
-
-  return FALSE;
-}
-
-static void
-swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index,
-    gint32 num)
-{
-  SwfdecAsObject *object = SWFDEC_AS_OBJECT (array);
-
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array));
-  g_return_if_fail (start_index >= 0);
-  g_return_if_fail (num >= 0);
-  g_return_if_fail (start_index + num <= swfdec_as_array_length (object));
-
-  if (num == 0)
-    return;
-
-  // to avoid foreach loop, use special case when removing just one variable
-  if (num == 1) {
-    swfdec_as_object_delete_variable (object,
-	swfdec_as_integer_to_string (object->context, start_index));
-  } else {
-    ForeachRemoveRangeData fdata = { start_index, num };
-    swfdec_as_object_foreach_remove (object,
-	swfdec_as_array_foreach_remove_range, &fdata);
-  }
-}
-
-typedef struct {
-  gint32	start_index;
-  gint32	num;
-  gint32	to_index;
-} ForeachMoveRangeData;
-
-static const char *
-swfdec_as_array_foreach_move_range (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachMoveRangeData *fdata = data;
-  gint32 idx;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1)
-    return variable;
-
-  if (idx >= fdata->start_index && idx < fdata->start_index + fdata->num) {
-    return swfdec_as_integer_to_string (object->context,
-	fdata->to_index + idx - fdata->start_index);
-  } else if (idx >= fdata->to_index && idx < fdata->to_index + fdata->num) {
-    return NULL;
-  } else {
-    return variable;
-  }
-}
-
-static void
-swfdec_as_array_move_range (SwfdecAsObject *object, gint32 from_index,
-    gint32 num, gint32 to_index)
-{
-  ForeachMoveRangeData fdata = { from_index, num, to_index };
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (from_index >= 0);
-  g_return_if_fail (num >= 0);
-  g_return_if_fail (from_index + num <= swfdec_as_array_length (object));
-  g_return_if_fail (to_index >= 0);
-
-  if (num == 0 || from_index == to_index)
-    return;
-
-  swfdec_as_object_foreach_rename (object, swfdec_as_array_foreach_move_range,
-      &fdata);
-
-  // only changes length if it becomes bigger, not if it becomes smaller
-  if (to_index + num > swfdec_as_array_length (object))
-    swfdec_as_array_set_length_object (object, to_index + num);
-}
-
-static void
-swfdec_as_array_set_range_with_flags (SwfdecAsObject *object,
-    gint32 start_index, gint32 num, const SwfdecAsValue *value,
-    SwfdecAsVariableFlag flags)
-{
-  gint32 i;
-  const char *var;
-
-  // allow negative indexes
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (num >= 0);
-  g_return_if_fail (num == 0 || value != NULL);
-
-  for (i = 0; i < num; i++) {
-    var = swfdec_as_integer_to_string (object->context, start_index + i);
-    swfdec_as_object_set_variable_and_flags (object, var, &value[i], flags);
-  }
-}
-
-static void
-swfdec_as_array_set_range (SwfdecAsObject *object, gint32 start_index,
-    gint32 num, const SwfdecAsValue *value)
-{
-  swfdec_as_array_set_range_with_flags (object, start_index, num, value, 0);
-}
-
-static void
-swfdec_as_array_append_internal (SwfdecAsObject *object, guint n,
-    const SwfdecAsValue *value)
-{
-  // allow negative length
-  swfdec_as_array_set_range (object,
-      swfdec_as_array_length_as_integer (object), n, value);
-}
-
-/**
- * swfdec_as_array_push:
- * @array: a #SwfdecAsArray
- * @value: the value to add
- *
- * Adds the given @value to the @array. This is a macro that just calls
- * swfdec_as_array_append_with_flags().
- */
-
-/**
- * swfdec_as_array_push_with_flags:
- * @array: a #SwfdecAsArray
- * @value: the value to add
- * @flags: the #SwfdecAsVariableFlag flags to use
- *
- * Adds the given @value to the @array with the given @flags. This is a macro
- * that just calls swfdec_as_array_append_with_flags().
- */
-
-/**
- * swfdec_as_array_append:
- * @array: a #SwfdecAsArray
- * @n: number of values to add
- * @values: the values to add
- *
- * Appends the given @values to the @array. This is a macro that just calls
- * swfdec_as_array_append_with_flags().
- **/
-
-/**
- * swfdec_as_array_append_with_flags:
- * @array: a #SwfdecAsArray
- * @n: number of values to add
- * @values: the values to add
- * @flags: the #SwfdecAsVariableFlag flags to use
- *
- * Appends the given @values to the @array using the given @flags.
- **/
-void
-swfdec_as_array_append_with_flags (SwfdecAsArray *array, guint n,
-    const SwfdecAsValue *value, SwfdecAsVariableFlag flags)
-{
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array));
-  g_return_if_fail (n == 0 || value != NULL);
-
-  // don't allow negative length
-  swfdec_as_array_set_range_with_flags (SWFDEC_AS_OBJECT (array),
-      swfdec_as_array_length (SWFDEC_AS_OBJECT (array)), n, value, flags);
-}
-
-/**
- * swfdec_as_array_insert:
- * @array: a #SwfdecAsArray
- * @idx: index to insert the value to
- * @value: a #SwfdecAsValue
- *
- * Inserts @value to @array at given index, making room for it by moving
- * elements to bigger indexes if necessary. This is a macro that just calls
- * swfdec_as_array_insert_with_flags().
- **/
-/**
- * swfdec_as_array_insert_with_flags:
- * @array: a #SwfdecAsArray
- * @idx: index to insert the value to
- * @value: a #SwfdecAsValue
- * @flags: the #SwfdecAsVariableFlag flags to use
- *
- * Inserts @value to @array at given index using given @flags, making room for
- * it by moving elements to bigger indexes if necessary.
- **/
-void
-swfdec_as_array_insert_with_flags (SwfdecAsArray *array, gint32 idx,
-    const SwfdecAsValue *value, SwfdecAsVariableFlag flags)
-{
-  gint32 length;
-  SwfdecAsObject *object;
-
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array));
-  g_return_if_fail (idx >= 0);
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
-
-  object = SWFDEC_AS_OBJECT (array);
-  length = swfdec_as_array_length (object);
-
-  if (idx < length)
-    swfdec_as_array_move_range (object, idx, length - idx, idx + 1);
-  swfdec_as_array_set_range_with_flags (object, idx, 1, value, flags);
-}
-
-/**
- * swfdec_as_array_remove:
- * @array: a #SwfdecAsArray
- * @idx: index of the value to remove
- *
- * Removes value at given index from the @array, elements with higher indexes
- * will be moved towards the start of the @array.
- **/
-void
-swfdec_as_array_remove (SwfdecAsArray *array, gint32 idx)
-{
-  gint32 length;
-  SwfdecAsObject *object;
-
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array));
-  g_return_if_fail (idx >= 0);
-
-  object = SWFDEC_AS_OBJECT (array);
-  length = swfdec_as_array_length (object);
-
-  if (idx >= length)
-    return;
-
-  swfdec_as_array_move_range (object, idx + 1, length - (idx + 1), idx);
-  swfdec_as_array_set_length (array, length - 1);
-}
-
-/**
- * swfdec_as_array_get_value:
- * @array: a #SwfdecAsArray
- * @idx: index of the value to get
- * @value: a pointer to #SwfdecAsValue that will be set
- *
- * Gets a value from given index, if the value doesn't exists an undefined
- * value is set.
- **/
-void
-swfdec_as_array_get_value (SwfdecAsArray *array, gint32 idx,
-    SwfdecAsValue *value)
-{
-  const char *var;
-
-  g_assert (SWFDEC_IS_AS_ARRAY (array));
-  g_assert (idx >= 0);
-  g_assert (value != NULL);
-
-  var = swfdec_as_integer_to_string (SWFDEC_AS_OBJECT (array)->context, idx);
-  swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (array), var, value);
-}
-
-/**
- * swfdec_as_array_set_value:
- * @array: a #SwfdecAsArray
- * @idx: index of the value to set
- * @value: a pointer to #SwfdecAsValue
- *
- * Sets a @value to given index. The @array's length will be increased if
- * necessary.
- **/
-void
-swfdec_as_array_set_value (SwfdecAsArray *array, gint32 idx,
-    SwfdecAsValue *value)
-{
-  const char *var;
-
-  g_assert (SWFDEC_IS_AS_ARRAY (array));
-  g_assert (idx >= 0);
-  g_assert (SWFDEC_IS_AS_VALUE (value));
-
-  var = swfdec_as_integer_to_string (SWFDEC_AS_OBJECT (array)->context, idx);
-  swfdec_as_object_set_variable (SWFDEC_AS_OBJECT (array), var, value);
-}
-
-typedef struct {
-  SwfdecAsObject		*object_to;
-  gint32			offset;
-  gint32			start_index;
-  gint32			num;
-} ForeachAppendArrayRangeData;
-
-static gboolean
-swfdec_as_array_foreach_append_array_range (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachAppendArrayRangeData *fdata = data;
-  gint32 idx;
-  const char *var;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx >= fdata->start_index && idx < fdata->start_index + fdata->num) {
-    var = swfdec_as_integer_to_string (fdata->object_to->context,
-	fdata->offset + (idx - fdata->start_index));
-    swfdec_as_object_set_variable (fdata->object_to, var, value);
-  }
-
-  return TRUE;
-}
-
-static void
-swfdec_as_array_append_array_range (SwfdecAsArray *array_to,
-    SwfdecAsObject *object_from, gint32 start_index, gint32 num)
-{
-  ForeachAppendArrayRangeData fdata;
-
-  g_return_if_fail (SWFDEC_IS_AS_ARRAY (array_to));
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object_from));
-  g_return_if_fail (start_index >= 0);
-  g_return_if_fail (
-      start_index + num <= swfdec_as_array_length (object_from));
-
-  if (num == 0)
-    return;
-
-  fdata.object_to = SWFDEC_AS_OBJECT (array_to);
-  fdata.offset = swfdec_as_array_length (SWFDEC_AS_OBJECT (array_to));
-  fdata.start_index = start_index;
-  fdata.num = num;
-
-  swfdec_as_array_set_length_object (fdata.object_to,
-      fdata.offset + fdata.num);
-  swfdec_as_object_foreach (object_from,
-      swfdec_as_array_foreach_append_array_range, &fdata);
-}
-
-static void
-swfdec_as_array_append_array (SwfdecAsArray *array_to,
-    SwfdecAsObject *object_from)
-{
-  swfdec_as_array_append_array_range (array_to, object_from, 0,
-      swfdec_as_array_length (object_from));
-}
-
-/*
- * Class functions
- */
-
-static void
-swfdec_as_array_set (SwfdecAsObject *object, const char *variable,
-    const SwfdecAsValue *val, guint flags)
-{
-  char *end;
-  gboolean indexvar = TRUE;
-  gint32 l = strtoul (variable, &end, 10);
-
-  if (*end != 0 || l > G_MAXINT32)
-    indexvar = FALSE;
-
-  // if we changed to smaller length, destroy all values that are outside it
-  if (!strcmp (variable, SWFDEC_AS_STR_length)) {
-    gint32 length_old = swfdec_as_array_length (object);
-    gint32 length_new = MAX (0,
-	swfdec_as_value_to_integer (object->context, val));
-    if (length_old > length_new) {
-      swfdec_as_array_remove_range (SWFDEC_AS_ARRAY (object), length_new,
-	  length_old - length_new);
-    }
-  }
-
-  SWFDEC_AS_OBJECT_CLASS (swfdec_as_array_parent_class)->set (object, variable,
-      val, flags);
-
-  // if we added new value outside the current length, set a bigger length
-  if (indexvar) {
-    if (++l > swfdec_as_array_length_as_integer (object))
-      swfdec_as_array_set_length_object (object, l);
-  }
-}
-
-static void
-swfdec_as_array_class_init (SwfdecAsArrayClass *klass)
-{
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-
-  asobject_class->set = swfdec_as_array_set;
-}
-
-static void
-swfdec_as_array_init (SwfdecAsArray *array)
-{
-}
-
-/*
- * The rest
- */
-
-/**
- * swfdec_as_array_new:
- * @context: a #SwfdecAsContext
- *
- * Creates a new #SwfdecAsArray. 
- *
- * Returns: the new array or %NULL on OOM.
- **/
-SwfdecAsObject *
-swfdec_as_array_new (SwfdecAsContext *context)
-{
-  SwfdecAsObject *ret;
-  SwfdecAsValue val;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-
-  if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsArray)))
-    return NULL;
-
-  ret = g_object_new (SWFDEC_TYPE_AS_ARRAY, NULL);
-  swfdec_as_object_add (ret, context, sizeof (SwfdecAsArray));
-  swfdec_as_object_get_variable (context->global, SWFDEC_AS_STR_Array, &val);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
-    swfdec_as_object_set_constructor (ret, SWFDEC_AS_VALUE_GET_OBJECT (&val));
-
-  swfdec_as_array_set_length (SWFDEC_AS_ARRAY (ret), 0);
-
-  return ret;
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_NATIVE (252, 7, swfdec_as_array_join)
-void
-swfdec_as_array_join (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
-    SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  int i, length;
-  const char *var, *str, *sep;
-  SwfdecAsValue val;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  if (argc > 0) {
-    sep = swfdec_as_value_to_string (cx, &argv[0]);
-  } else {
-    sep = SWFDEC_AS_STR_COMMA;
-  }
-
-  length = swfdec_as_array_length (object);
-  if (length > 0) {
-    /* FIXME: implement this with the StringBuilder class */
-    GString *string;
-    swfdec_as_object_get_variable (object, SWFDEC_AS_STR_0, &val);
-    str = swfdec_as_value_to_string (cx, &val);
-    string = g_string_new (str);
-    for (i = 1; i < length; i++) {
-      var = swfdec_as_integer_to_string (cx, i);
-      swfdec_as_object_get_variable (object, var, &val);
-      var = swfdec_as_value_to_string (cx, &val);
-      g_string_append (string, sep);
-      g_string_append (string, var);
-    }
-    str = swfdec_as_context_give_string (cx, g_string_free (string, FALSE));
-  } else {
-    str = SWFDEC_AS_STR_EMPTY;
-  }
-
-  SWFDEC_AS_VALUE_SET_STRING (ret, str);
-}
-
-SWFDEC_AS_NATIVE (252, 9, swfdec_as_array_toString)
-void
-swfdec_as_array_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  swfdec_as_array_join (cx, object, 0, NULL, ret);
-}
-
-SWFDEC_AS_NATIVE (252, 1, swfdec_as_array_do_push)
-void
-swfdec_as_array_do_push (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  // if 0 args, just return the length
-  // manually set the length here to make the function work on non-Arrays
-  if (argc > 0) {
-    gint32 length = swfdec_as_array_length_as_integer (object);
-    swfdec_as_array_append_internal (object, argc, argv);
-    swfdec_as_array_set_length_object (object, length + argc);
-  }
-
-  SWFDEC_AS_VALUE_SET_INT (ret, swfdec_as_array_length_as_integer (object));
-}
-
-SWFDEC_AS_NATIVE (252, 2, swfdec_as_array_do_pop)
-void
-swfdec_as_array_do_pop (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length;
-  const char *var;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  // we allow negative indexes here, but not 0
-  length = swfdec_as_array_length_as_integer (object);
-  if (length == 0)
-    return;
-
-  var = swfdec_as_integer_to_string (object->context, length - 1);
-  swfdec_as_object_get_variable (object, var, ret);
-
-  // if Array, the length is reduced by one (which destroys the variable also)
-  // else the length is not reduced at all, but the variable is still deleted
-  if (SWFDEC_IS_AS_ARRAY (object)) {
-    swfdec_as_array_set_length_object (object, length - 1);
-  } else {
-    swfdec_as_object_delete_variable (object, var);
-  }
-}
-
-SWFDEC_AS_NATIVE (252, 5, swfdec_as_array_do_unshift)
-void
-swfdec_as_array_do_unshift (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  if (argc) {
-    // don't allow negative length
-    length = swfdec_as_array_length (object);
-    swfdec_as_array_move_range (object, 0, length, argc);
-    swfdec_as_array_set_range (object, 0, argc, argv);
-    // if not Array, leave the length unchanged
-    if (!SWFDEC_IS_AS_ARRAY (object))
-      swfdec_as_array_set_length_object (object, length);
-  }
-
-  SWFDEC_AS_VALUE_SET_INT (ret, swfdec_as_array_length (object));
-}
-
-SWFDEC_AS_NATIVE (252, 4, swfdec_as_array_do_shift)
-void
-swfdec_as_array_do_shift (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length;
-  const char *var;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  // don't allow negative length
-  length = swfdec_as_array_length (object);
-  if (length <= 0)
-    return;
-
-  swfdec_as_object_get_variable (object, SWFDEC_AS_STR_0, ret);
-
-  swfdec_as_array_move_range (object, 1, length - 1, 0);
-
-  // if not Array, leave the length unchanged, and don't remove the element
-  if (SWFDEC_IS_AS_ARRAY (object)) {
-    swfdec_as_array_set_length_object (object, length - 1);
-  } else {
-    // we have to put the last element back, because we used move, not copy
-    SwfdecAsValue val;
-    if (length > 1) {
-      var = swfdec_as_integer_to_string (object->context, length - 2);
-      swfdec_as_object_get_variable (object, var, &val);
-    } else {
-      val = *ret;
-    }
-    var = swfdec_as_integer_to_string (object->context, length - 1);
-    swfdec_as_object_set_variable (object, var, &val);
-  }
-}
-
-static const char *
-swfdec_as_array_foreach_reverse (SwfdecAsObject *object, const char *variable,
-    SwfdecAsValue *value, guint flags, gpointer data)
-{
-  gint32 *length = data;
-  gint32 idx;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1 || idx >= *length)
-    return variable;
-
-  return swfdec_as_integer_to_string (object->context, *length - 1 - idx);
-}
-
-SWFDEC_AS_NATIVE (252, 11, swfdec_as_array_reverse)
-void
-swfdec_as_array_reverse (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  length = swfdec_as_array_length (object);
-  swfdec_as_object_foreach_rename (object, swfdec_as_array_foreach_reverse,
-      &length);
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-}
-
-SWFDEC_AS_NATIVE (252, 3, swfdec_as_array_concat)
-void
-swfdec_as_array_concat (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint j;
-  SwfdecAsObject *object_new;
-  SwfdecAsArray *array_new;
-  const char *var;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  object_new = swfdec_as_array_new (cx);
-  if (object_new == NULL)
-    return;
-  array_new = SWFDEC_AS_ARRAY (object_new);
-
-  swfdec_as_array_append_array (array_new, object);
-
-  for (j = 0; j < argc; j++) {
-    if (SWFDEC_AS_VALUE_IS_OBJECT (&argv[j]) &&
-	SWFDEC_IS_AS_ARRAY (SWFDEC_AS_VALUE_GET_OBJECT (&argv[j])))
-    {
-      swfdec_as_array_append_array (array_new,
-	  SWFDEC_AS_VALUE_GET_OBJECT (&argv[j]));
-    }
-    else
-    {
-      var = swfdec_as_integer_to_string (object->context,
-	  swfdec_as_array_length (object_new));
-      swfdec_as_object_set_variable (object_new, var, &argv[j]);
-    }
-  }
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, object_new);
-}
-
-SWFDEC_AS_NATIVE (252, 6, swfdec_as_array_slice)
-void
-swfdec_as_array_slice (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
-    SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length, start_index, num;
-  SwfdecAsArray *array_new;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  length = swfdec_as_array_length (object);
-
-  if (argc > 0) {
-    start_index = swfdec_as_value_to_integer (cx, &argv[0]);
-    if (start_index < 0)
-      start_index = length + start_index;
-    start_index = CLAMP (start_index, 0, length);
-  } else {
-    start_index = 0;
-  }
-
-  if (argc > 1) {
-    gint32 endIndex = swfdec_as_value_to_integer (cx, &argv[1]);
-    if (endIndex < 0)
-      endIndex = length + endIndex;
-    endIndex = CLAMP (endIndex, start_index, length);
-    num = endIndex - start_index;
-  } else {
-    num = length - start_index;
-  }
-
-  array_new = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
-  if (array_new == NULL)
-    return;
-
-  swfdec_as_array_append_array_range (array_new, object, start_index, num);
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (array_new));
-}
-
-SWFDEC_AS_NATIVE (252, 8, swfdec_as_array_splice)
-void
-swfdec_as_array_splice (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gint32 length, start_index, num_remove, num_add;
-  SwfdecAsArray *array_new;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object) || argc == 0)
-    return;
-
-  length = swfdec_as_array_length (object);
-
-  start_index = swfdec_as_value_to_integer (cx, &argv[0]);
-  if (start_index < 0)
-    start_index = length + start_index;
-  start_index = CLAMP (start_index, 0, length);
-
-  if (argc > 1) {
-    num_remove = CLAMP (swfdec_as_value_to_integer (cx, &argv[1]), 0,
-	length - start_index);
-  } else {
-    num_remove = length - start_index;
-  }
-
-  num_add = (argc > 2 ? argc - 2 : 0);
-
-  array_new = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
-  if (array_new == NULL)
-    return;
-
-  swfdec_as_array_append_array_range (array_new, object, start_index,
-      num_remove);
-  swfdec_as_array_move_range (object, start_index + num_remove,
-      length - (start_index + num_remove), start_index + num_add);
-  if (num_remove > num_add)
-    swfdec_as_array_set_length_object (object, length - (num_remove - num_add));
-  if (argc > 2)
-    swfdec_as_array_set_range (object, start_index, argc - 2, argv + 2);
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (array_new));
-}
-
-// Sorting
-
-typedef enum {
-  ARRAY_SORT_OPTION_CASEINSENSITIVE = 1,
-  ARRAY_SORT_OPTION_DESCENDING = 2,
-  ARRAY_SORT_OPTION_UNIQUESORT = 4,
-  ARRAY_SORT_OPTION_RETURNINDEXEDARRAY = 8,
-  ARRAY_SORT_OPTION_NUMERIC = 16
-} ArraySortOptions;
-
-typedef struct {
-  SwfdecAsValue		**order;
-  gint32		order_size;
-  SwfdecAsValue		undefined;
-  gint32		defined_values;
-  gint32		length;
-  gint32		options;
-  SwfdecAsFunction	*compare_custom_func;
-  const char **		fields;
-  SwfdecAsObject	*object_new;
-} ForeachSortData;
-
-// inner function for swfdec_as_array_sort_compare
-static int
-swfdec_as_array_sort_compare_values (SwfdecAsContext *cx,
-    const SwfdecAsValue *a, const SwfdecAsValue *b, gint32 options,
-    SwfdecAsFunction *fun)
-{
-  int retval;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (a), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (b), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (b), 0);
-  g_return_val_if_fail (fun == NULL || SWFDEC_IS_AS_FUNCTION (fun), 0);
-
-  if (fun != NULL)
-  {
-    SwfdecAsValue argv[2] = { *a, *b };
-    SwfdecAsValue ret;
-    swfdec_as_function_call (fun, NULL, 2, argv, &ret);
-    swfdec_as_context_run (fun->object.context);
-    retval = swfdec_as_value_to_integer (cx, &ret);
-  }
-  else if (options & ARRAY_SORT_OPTION_NUMERIC &&
-      (SWFDEC_AS_VALUE_IS_NUMBER (a) ||
-       SWFDEC_AS_VALUE_IS_NUMBER (b)) &&
-      !SWFDEC_AS_VALUE_IS_UNDEFINED (a) &&
-      !SWFDEC_AS_VALUE_IS_UNDEFINED (b))
-  {
-    if (!SWFDEC_AS_VALUE_IS_NUMBER (a)) {
-      retval = 1;
-    } else if (!SWFDEC_AS_VALUE_IS_NUMBER (b)) {
-      retval = -1;
-    } else {
-      double an = swfdec_as_value_to_number (cx, a);
-      double bn = swfdec_as_value_to_number (cx, b);
-      retval = (an < bn ? -1 : (an > bn ? 1 : 0));
-    }
-  }
-  else if (options & ARRAY_SORT_OPTION_CASEINSENSITIVE)
-  {
-    retval = g_strcasecmp (swfdec_as_value_to_string (cx, a),
-	swfdec_as_value_to_string (cx, b));
-  }
-  else
-  {
-    retval = strcmp (swfdec_as_value_to_string (cx, a),
-	swfdec_as_value_to_string (cx, b));
-  }
-
-  if (options & ARRAY_SORT_OPTION_DESCENDING) {
-    return -retval;
-  } else {
-    return retval;
-  }
-}
-
-static int
-swfdec_as_array_sort_compare (SwfdecAsContext *cx, const SwfdecAsValue *a,
-    const SwfdecAsValue *b, gint32 options, SwfdecAsFunction *fun,
-    const char **fields)
-{
-  int i, retval;
-  SwfdecAsValue a_comp, b_comp;
-  SwfdecAsObject *object;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (a), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (b), 0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (b), 0);
-  g_return_val_if_fail (fun == NULL || SWFDEC_IS_AS_FUNCTION (fun), 0);
-  g_return_val_if_fail (fields == NULL || fields[0] != NULL, 0);
-
-  if (fields == NULL)
-    return swfdec_as_array_sort_compare_values (cx, a, b, options, fun);
-
-  i = 0;
-  do {
-    object = swfdec_as_value_to_object (cx, a);
-    if (object) {
-      swfdec_as_object_get_variable (object, fields[i], &a_comp);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&a_comp);
-    }
-
-    object = swfdec_as_value_to_object (cx, b);
-    if (object) {
-      swfdec_as_object_get_variable (object, fields[i], &b_comp);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&b_comp);
-    }
-
-    retval =
-      swfdec_as_array_sort_compare_values (cx, &a_comp, &b_comp, options, fun);
-  } while (retval == 0 && fields[++i] != NULL);
-
-  return retval;
-}
-
-// renames values in the array based on fdata->order values
-static const char *
-swfdec_as_array_foreach_sort_rename (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachSortData *fdata = data;
-  gint32 idx, i;
-  gboolean after_undefined = FALSE;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1 || idx >= fdata->length)
-    return variable;
-
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (value))
-    return NULL;
-
-  for (i = 0; i < fdata->order_size; i++) {
-    if (fdata->order[i] == value) {
-      fdata->order[i] = NULL;
-      // leave room for undefined values
-      if (after_undefined)
-	i += fdata->length - fdata->defined_values - 1;
-      return swfdec_as_integer_to_string (object->context, i);
-    }
-    if (fdata->order[i] == &fdata->undefined)
-      after_undefined = TRUE;
-  }
-
-  g_assert_not_reached ();
-  return NULL;
-}
-
-// fills fdata->object_new array using indexes based on the fdata->order
-static gboolean
-swfdec_as_array_foreach_sort_indexedarray (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachSortData *fdata = data;
-  SwfdecAsValue val;
-  const char *var;
-  gint32 idx, i;
-  gboolean after_undefined = FALSE;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1 || idx >= fdata->length)
-    return TRUE;
-
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (value))
-    return TRUE;
-
-  for (i = 0; i < fdata->order_size; i++) {
-    if (fdata->order[i] == value) {
-      fdata->order[i] = NULL;
-      // leave room for undefined values, that are filled in afterwards
-      if (after_undefined)
-	i += fdata->length - fdata->defined_values - 1;
-      var = swfdec_as_integer_to_string (object->context, i);
-      SWFDEC_AS_VALUE_SET_INT (&val, idx);
-      swfdec_as_object_set_variable (fdata->object_new, var, &val);
-      return TRUE;
-    }
-    if (fdata->order[i] == &fdata->undefined)
-      after_undefined = TRUE;
-  }
-
-  g_assert_not_reached ();
-  return FALSE;
-}
-
-// sets undefined values in the fdata->object_new array to indexes of undefined
-// values in the object array
-static void
-swfdec_as_array_sort_set_undefined_indexedarray (SwfdecAsObject *object,
-    ForeachSortData *fdata)
-{
-  SwfdecAsValue val;
-  const char *var;
-  gint32 idx, i, length, num;
-
-  for (idx = 0; idx < fdata->order_size; idx++) {
-    if (fdata->order[idx] == &fdata->undefined)
-      break;
-  }
-
-  num = 0;
-  length = swfdec_as_array_length (object);
-  for (i = 0; i < length - fdata->defined_values; i++) {
-    do {
-      var = swfdec_as_integer_to_string (object->context, num);
-      num++;
-    } while (swfdec_as_object_get_variable (object, var, &val) &&
-	!SWFDEC_AS_VALUE_IS_UNDEFINED (&val));
-    var = swfdec_as_integer_to_string (fdata->object_new->context, idx + i);
-    SWFDEC_AS_VALUE_SET_INT (&val, num - 1);
-    swfdec_as_object_set_variable (fdata->object_new, var, &val);
-  }
-}
-
-// tests if any value in the array is equal to a undefined value
-// (in the sense that sorting compare function returns 0)
-// used by uniquesort when there is exactly one undefined value in the array
-static gboolean
-swfdec_as_array_foreach_sort_compare_undefined (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachSortData *fdata = data;
-  gint32 idx;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1 || idx >= fdata->length)
-    return TRUE;
-
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (value))
-    return TRUE;
-
-  // when testing for uniquesort the custom compare function is NOT used
-  if (swfdec_as_array_sort_compare (object->context, value, &fdata->undefined,
-	fdata->options, NULL, fdata->fields) == 0)
-    return FALSE;
-
-  return TRUE;
-}
-
-// fill fdata->order and fdata->defined_values
-static gboolean
-swfdec_as_array_foreach_sort_populate (SwfdecAsObject *object,
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data)
-{
-  ForeachSortData *fdata = data;
-  gint32 idx, i;
-  gint cval = -1;
-
-  idx = swfdec_as_array_to_index (variable);
-  if (idx == -1 || idx >= fdata->length)
-    return TRUE;
-
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (value))
-    return TRUE;
-
-  fdata->defined_values++;
-
-  // find the position for this value
-  for (i = 0; i < fdata->order_size; i++)
-  {
-    if (fdata->order[i] == NULL ||
-	(cval = swfdec_as_array_sort_compare (object->context, value,
-	    fdata->order[i], fdata->options, fdata->compare_custom_func,
-	    fdata->fields)) <= 0)
-    {
-      SwfdecAsValue *tmp2, *tmp;
-
-      // if we are doing uniquesort, see if this value is the same as some
-      // earlier value
-      if (fdata->options & ARRAY_SORT_OPTION_UNIQUESORT &&
-	  fdata->order[i] != NULL && fdata->order[i] != &fdata->undefined) {
-	// when using custom function, uniquesort is still based on the
-	// equality given by the normal method, not the custom function
-	if (fdata->compare_custom_func != NULL) {
-	  if (swfdec_as_array_sort_compare (object->context, value,
-		fdata->order[i], fdata->options, NULL, fdata->fields) == 0) {
-	    return FALSE;
-	  }
-	} else {
-	  if (cval == 0)
-	    return FALSE;
-	}
-      }
-
-      // move rest of the values forward
-      tmp = fdata->order[i];
-      fdata->order[i] = value;
-      while (tmp != NULL && ++i < fdata->order_size) {
-	tmp2 = fdata->order[i];
-	fdata->order[i] = tmp;
-	tmp = tmp2;
-      }
-      return TRUE;
-    }
-  }
-
-  g_assert_not_reached ();
-  return FALSE;
-}
-
-static void
-swfdec_as_array_do_sort (SwfdecAsObject *object, gint32 options,
-    SwfdecAsFunction *custom_compare_func, const char **fields,
-    SwfdecAsValue *ret)
-{
-  ForeachSortData fdata;
-
-  // init foreach data
-  fdata.length = swfdec_as_array_length (object);
-  // FIXME: limit based on the actual amount of properties?
-  fdata.order_size = fdata.length + 1;
-  fdata.order = g_new0 (SwfdecAsValue *, fdata.order_size);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (&fdata.undefined);
-  fdata.order[0] = &fdata.undefined;
-  fdata.defined_values = 0;
-  fdata.options = options;
-  fdata.compare_custom_func = custom_compare_func;
-  fdata.fields = fields;
-
-  // generate fdata.order which points to the values
-  if (!swfdec_as_object_foreach (object, swfdec_as_array_foreach_sort_populate,
-	&fdata))
-  {
-    // uniquesort failed
-    SWFDEC_AS_VALUE_SET_INT (ret, 0);
-    g_free (fdata.order);
-    return;
-  }
-
-  if (fdata.options & ARRAY_SORT_OPTION_UNIQUESORT &&
-      fdata.defined_values + 1 < fdata.length)
-  {
-    // uniquesort fails, because we have more than one undefined value
-    SWFDEC_AS_VALUE_SET_INT (ret, 0);
-    g_free (fdata.order);
-    return;
-  }
-
-  if (fdata.options & ARRAY_SORT_OPTION_UNIQUESORT &&
-      fdata.defined_values < fdata.length)
-  {
-    // uniquesort used, and we have exactly one undefined value test if
-    // anything equals to that
-    if (!swfdec_as_object_foreach (object,
-	  swfdec_as_array_foreach_sort_compare_undefined, &fdata))
-    {
-      SWFDEC_AS_VALUE_SET_INT (ret, 0);
-      g_free (fdata.order);
-      return;
-    }
-  }
-
-  if (fdata.options & ARRAY_SORT_OPTION_RETURNINDEXEDARRAY) {
-    // make a new array and fill it with numbers based on the order
-    fdata.object_new = swfdec_as_array_new (object->context);
-    if (fdata.object_new != NULL) {
-      swfdec_as_object_foreach (object,
-	  swfdec_as_array_foreach_sort_indexedarray, &fdata);
-      // we have values that have been set now, fill in the undefined values
-      swfdec_as_array_sort_set_undefined_indexedarray (object, &fdata);
-      SWFDEC_AS_VALUE_SET_OBJECT (ret, fdata.object_new);
-    }
-  } else {
-    // rename properties based on the new order
-    swfdec_as_object_foreach_rename (object,
-	swfdec_as_array_foreach_sort_rename, &fdata);
-    SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-  }
-
-  g_free (fdata.order);
-}
-
-SWFDEC_AS_NATIVE (252, 10, swfdec_as_array_sort)
-void
-swfdec_as_array_sort (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
-    SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint pos;
-  gint32 options;
-  SwfdecAsFunction *custom_compare_func;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  pos = 0;
-  if (argc > 0 && !SWFDEC_AS_VALUE_IS_NUMBER (&argv[0])) {
-    SwfdecAsFunction *fun;
-    if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[0]) ||
-	!SWFDEC_IS_AS_FUNCTION (
-	  fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&argv[0])))
-	return;
-    custom_compare_func = fun;
-    pos++;
-  } else {
-    custom_compare_func = NULL;
-  }
-
-  if (argc > pos) {
-    options = swfdec_as_value_to_integer (cx, &argv[pos]);
-  } else {
-    options = 0;
-  }
-
-  swfdec_as_array_do_sort (object, options, custom_compare_func, NULL, ret);
-}
-
-SWFDEC_AS_NATIVE (252, 12, swfdec_as_array_sortOn)
-void
-swfdec_as_array_sortOn (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char **fields;
-  gint32 options;
-
-  if (object == NULL || SWFDEC_IS_MOVIE (object))
-    return;
-
-  if (argc < 1)
-    return;
-
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&argv[0])) {
-    gint32 length, i;
-    SwfdecAsValue val;
-    SwfdecAsObject *array;
-
-    array = SWFDEC_AS_VALUE_GET_OBJECT (&argv[0]);
-    if (!SWFDEC_IS_AS_ARRAY (array)) {
-      SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-      return;
-    }
-    length = swfdec_as_array_get_length (SWFDEC_AS_ARRAY (array));
-    if (length <= 0) {
-      SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-      return;
-    }
-    fields = g_malloc (sizeof (const char *) * (length + 1));
-    for (i = 0; i < length; i++) {
-      swfdec_as_array_get_value (SWFDEC_AS_ARRAY (array), i, &val);
-      if (SWFDEC_AS_VALUE_IS_OBJECT (&val) &&
-	  SWFDEC_IS_AS_STRING (SWFDEC_AS_VALUE_GET_OBJECT (&val))) {
-	fields[i] =
-	  SWFDEC_AS_STRING (SWFDEC_AS_VALUE_GET_OBJECT (&val))->string;
-      } else {
-	fields[i] = swfdec_as_value_to_string (cx, &val);
-      }
-    }
-    fields[i] = NULL;
-  } else {
-    fields = g_malloc (sizeof (const char *) * 2);
-    fields[0] = swfdec_as_value_to_string (cx, &argv[0]);
-    fields[1] = NULL;
-  }
-
-  if (argc > 1) {
-    options = swfdec_as_value_to_integer (cx, &argv[1]);
-  } else {
-    options = 0;
-  }
-
-  swfdec_as_array_do_sort (object, options, NULL, fields, ret);
-
-  g_free (fields);
-}
-
-// Constructor
-
-SWFDEC_AS_CONSTRUCTOR (252, 0, swfdec_as_array_construct, swfdec_as_array_get_type)
-void
-swfdec_as_array_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsArray *array;
-
-  if (!cx->frame->construct) {
-    SwfdecAsValue val;
-    if (!swfdec_as_context_use_mem (cx, sizeof (SwfdecAsArray)))
-      return;
-    object = g_object_new (SWFDEC_TYPE_AS_ARRAY, NULL);
-    swfdec_as_object_add (object, cx, sizeof (SwfdecAsArray));
-    swfdec_as_object_get_variable (cx->global, SWFDEC_AS_STR_Array, &val);
-    if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-      swfdec_as_object_set_constructor (object,
-	  SWFDEC_AS_VALUE_GET_OBJECT (&val));
-    } else {
-      SWFDEC_INFO ("\"Array\" is not an object");
-    }
-  }
-
-  array = SWFDEC_AS_ARRAY (object);
-  if (argc == 1 && SWFDEC_AS_VALUE_IS_NUMBER (&argv[0])) {
-    int l = swfdec_as_value_to_integer (cx, &argv[0]);
-    swfdec_as_array_set_length (array, l < 0 ? 0 : l);
-  } else if (argc > 0) {
-    swfdec_as_array_append (array, argc, argv);
-  } else {
-    swfdec_as_array_set_length (array, 0);
-  }
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-}
diff --git a/libswfdec/swfdec_as_array.h b/libswfdec/swfdec_as_array.h
deleted file mode 100644
index 4c23a7f..0000000
--- a/libswfdec/swfdec_as_array.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_AS_ARRAY_H_
-#define _SWFDEC_AS_ARRAY_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsArrayClass SwfdecAsArrayClass;
-
-#define SWFDEC_TYPE_AS_ARRAY                    (swfdec_as_array_get_type())
-#define SWFDEC_IS_AS_ARRAY(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_ARRAY))
-#define SWFDEC_IS_AS_ARRAY_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_ARRAY))
-#define SWFDEC_AS_ARRAY(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_ARRAY, SwfdecAsArray))
-#define SWFDEC_AS_ARRAY_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_ARRAY, SwfdecAsArrayClass))
-#define SWFDEC_AS_ARRAY_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_ARRAY, SwfdecAsArrayClass))
-
-struct _SwfdecAsArray {
-  /*< private >*/
-  SwfdecAsObject	object;
-};
-
-struct _SwfdecAsArrayClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-GType		swfdec_as_array_get_type	(void);
-
-SwfdecAsObject *swfdec_as_array_new		(SwfdecAsContext *	context);
-
-#define		swfdec_as_array_push(array,value) \
-  swfdec_as_array_append_with_flags ((array), 1, (value), 0)
-#define		swfdec_as_array_push_with_flags(array,value,flags) \
-  swfdec_as_array_append_with_flags ((array), 1, (value), (flags))
-#define		swfdec_as_array_append(array,n,values) \
-  swfdec_as_array_append_with_flags ((array), (n), (values), 0)
-void		swfdec_as_array_append_with_flags (SwfdecAsArray *	array,
-						 guint			n,
-						 const SwfdecAsValue *	values,
-						 SwfdecAsVariableFlag	flags);
-void		swfdec_as_array_insert		(SwfdecAsArray *	array,
-						 gint32			idx,
-						 SwfdecAsValue *	value);
-#define		swfdec_as_array_insert(array,idx,value) \
-  swfdec_as_array_insert_with_flags ((array), (idx), (value), 0)
-void		swfdec_as_array_insert_with_flags (SwfdecAsArray *	array,
-						 gint32			idx,
-						 const SwfdecAsValue *	value,
-						 SwfdecAsVariableFlag	flags);
-gint32		swfdec_as_array_get_length	(SwfdecAsArray *	array);
-void		swfdec_as_array_set_length	(SwfdecAsArray *	array,
-						 gint32			length);
-void		swfdec_as_array_get_value	(SwfdecAsArray *	array,
-						 gint32			idx,
-						 SwfdecAsValue *	value);
-void		swfdec_as_array_set_value	(SwfdecAsArray *	array,
-						 gint32			idx,
-						 SwfdecAsValue *	value);
-void		swfdec_as_array_remove		(SwfdecAsArray *	array,
-						 gint32			idx);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_boolean.c b/libswfdec/swfdec_as_boolean.c
deleted file mode 100644
index b3d81dd..0000000
--- a/libswfdec/swfdec_as_boolean.c
+++ /dev/null
@@ -1,103 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-
-#include "swfdec_as_boolean.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsBoolean, swfdec_as_boolean, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_as_boolean_class_init (SwfdecAsBooleanClass *klass)
-{
-}
-
-static void
-swfdec_as_boolean_init (SwfdecAsBoolean *boolean)
-{
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_CONSTRUCTOR (107, 2, swfdec_as_boolean_construct, swfdec_as_boolean_get_type)
-void
-swfdec_as_boolean_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gboolean b;
-
-  if (argc > 0) {
-    b = swfdec_as_value_to_boolean (object->context, &argv[0]);
-  } else {
-    b = FALSE;
-  }
-
-  if (swfdec_as_context_is_constructing (cx)) {
-    SWFDEC_AS_BOOLEAN (object)->boolean = b;
-    SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-  } else {
-    SWFDEC_AS_VALUE_SET_BOOLEAN (ret, b);
-  }
-}
-
-SWFDEC_AS_NATIVE (107, 1, swfdec_as_boolean_toString)
-void
-swfdec_as_boolean_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsBoolean *b;
-  
-  if (!SWFDEC_IS_AS_BOOLEAN (object))
-    return;
-  b = SWFDEC_AS_BOOLEAN (object);
-  
-  SWFDEC_AS_VALUE_SET_STRING (ret, b->boolean ? SWFDEC_AS_STR_true : SWFDEC_AS_STR_false);
-}
-
-SWFDEC_AS_NATIVE (107, 0, swfdec_as_boolean_valueOf)
-void
-swfdec_as_boolean_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsBoolean *b;
-
-  if (!SWFDEC_IS_AS_BOOLEAN (object))
-    return;
-  b = SWFDEC_AS_BOOLEAN (object);
-  
-  SWFDEC_AS_VALUE_SET_BOOLEAN (ret, b->boolean);
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (3, 2, swfdec_as_boolean_old_constructor)
-void
-swfdec_as_boolean_old_constructor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("old 'Boolean' function (only available as ASnative)");
-}
diff --git a/libswfdec/swfdec_as_boolean.h b/libswfdec/swfdec_as_boolean.h
deleted file mode 100644
index 723f076..0000000
--- a/libswfdec/swfdec_as_boolean.h
+++ /dev/null
@@ -1,52 +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_AS_BOOLEAN_H_
-#define _SWFDEC_AS_BOOLEAN_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsBoolean SwfdecAsBoolean;
-typedef struct _SwfdecAsBooleanClass SwfdecAsBooleanClass;
-
-#define SWFDEC_TYPE_AS_BOOLEAN                    (swfdec_as_boolean_get_type())
-#define SWFDEC_IS_AS_BOOLEAN(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_BOOLEAN))
-#define SWFDEC_IS_AS_BOOLEAN_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_BOOLEAN))
-#define SWFDEC_AS_BOOLEAN(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_BOOLEAN, SwfdecAsBoolean))
-#define SWFDEC_AS_BOOLEAN_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_BOOLEAN, SwfdecAsBooleanClass))
-#define SWFDEC_AS_BOOLEAN_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_BOOLEAN, SwfdecAsBooleanClass))
-
-struct _SwfdecAsBoolean {
-  SwfdecAsObject	object;
-
-  gboolean		boolean;		/* boolean represented by this boolean object */
-};
-
-struct _SwfdecAsBooleanClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-GType		swfdec_as_boolean_get_type	(void);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c
deleted file mode 100644
index ccce123..0000000
--- a/libswfdec/swfdec_as_context.c
+++ /dev/null
@@ -1,1461 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <string.h>
-#include <stdlib.h>
-#include "swfdec_as_context.h"
-#include "swfdec_as_array.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_initialize.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_interpret.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_object.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_types.h"
-#include "swfdec_debug.h"
-#include "swfdec_internal.h" /* for swfdec_player_preinit_global() */
-#include "swfdec_script.h"
-
-/*** GARBAGE COLLECTION DOCS ***/
-
-#define SWFDEC_AS_GC_MARK (1 << 0)		/* only valid during GC */
-#define SWFDEC_AS_GC_ROOT (1 << 1)		/* for objects: rooted, for strings: static */
-
-/**
- * SECTION:Internals
- * @title: Internals and garbage collection
- * @short_description: understanding internals such as garbage collection
- * @see_also: #SwfdecAsContext
- *
- * This section deals with the internals of the Swfdec Actionscript engine. You
- * should probably read this first when trying to write code with it. If you're
- * just trying to use Swfdec for creating Flash content, you can probably skip
- * this section.
- *
- * First, I'd like to note that the Swfdec script engine has to be modeled very 
- * closely after the existing Flash players. So if there are some behaviours
- * that seem stupid at first sight, it might very well be that it was chosen for
- * a very particular reason. Now on to the features.
- *
- * The Swfdec script engine tries to imitate Actionscript as good as possible.
- * Actionscript is similar to Javascript, but not equal. Depending on the 
- * version of the script executed it might be more or less similar. An important
- * example is that Flash in versions up to 6 did case-insensitive variable 
- * lookups.
- *
- * The script engine starts its life when it is initialized via 
- * swfdec_as_context_startup (). At that point, the basic objects are created.
- * After this function has been called, you can start executing code. All code
- * execution happens by creating a new #SwfdecAsFrame and then calling 
- * swfdec_as_context_run() to execute it. This function is the single entry 
- * point for code execution. Convenience functions exist that make executing 
- * code easy, most notably swfdec_as_object_run() and 
- * swfdec_as_object_call().
- *
- * It is also easily possible to extend the environment by adding new objects.
- * In fact, without doing so, the environment is pretty bare as it just contains
- * the basic Math, String, Number, Array, Date and Boolean objects. This is done
- * by adding #SwfdecAsNative functions to the environment. The easy way
- * to do this is via swfdec_as_object_add_function().
- *
- * The Swfdec script engine is dynamically typed and knows about different types
- * of values. See #SwfdecAsValue for the different values. Memory management is
- * done using a mark and sweep garbage collector. You can initiate a garbage 
- * collection cycle by calling swfdec_as_context_gc() or 
- * swfdec_as_context_maybe_gc(). You should do this regularly to avoid excessive
- * memory use. The #SwfdecAsContext will then collect the objects and strings it
- * is keeping track of. If you want to use an object or string in the script 
- * engine, you'll have to add it first via swfdec_as_object_add() or
- * swfdec_as_context_get_string() and swfdec_as_context_give_string(), 
- * respectively.
- *
- * Garbage-collected strings are special in Swfdec in that they are unique. This
- * means the same string exists exactly once. Because of this you can do 
- * equality comparisons using == instead of strcmp. It also means that if you 
- * forget to add a string to the context before using it, your app will most 
- * likely not work, since the string will not compare equal to any other string.
- *
- * When a garbage collection cycle happens, all reachable objects and strings 
- * are marked and all unreachable ones are freed. This is done by calling the
- * context class's mark function which will mark all reachable objects. This is
- * usually called the "root set". For any reachable object, the object's mark
- * function is called so that the object in turn can mark all objects it can 
- * reach itself. Marking is done via functions described below.
- */
-
-/*** GTK-DOC ***/
-
-/**
- * SECTION:SwfdecAsContext
- * @title: SwfdecAsContext
- * @short_description: the main script engine context
- * @see_also: SwfdecPlayer
- *
- * A #SwfdecAsContext provides the main execution environment for Actionscript
- * execution. It provides the objects typically available in ECMAScript and
- * manages script execution, garbage collection etc. #SwfdecPlayer is a
- * subclass of the context that implements Flash specific objects on top of it.
- * However, it is possible to use the context for completely different functions
- * where a sandboxed scripting environment is needed. An example is the Swfdec 
- * debugger.
- * <note>The Actionscript engine is similar, but not equal to Javascript. It
- * is not very different, but it is different.</note>
- */
-
-/**
- * SwfdecAsContext
- *
- * This is the main object ued to hold the state of a script engine. All members 
- * are private and should not be accessed.
- *
- * Subclassing this structure to get scripting support in your own appliation is
- * encouraged.
- */
-
-/**
- * SwfdecAsContextState
- * @SWFDEC_AS_CONTEXT_NEW: the context is not yet initialized, 
- *                         swfdec_as_context_startup() needs to be called.
- * @SWFDEC_AS_CONTEXT_RUNNING: the context is running normally
- * @SWFDEC_AS_CONTEXT_INTERRUPTED: the context has been interrupted by a 
- *                             debugger
- * @SWFDEC_AS_CONTEXT_ABORTED: the context has aborted execution due to a 
- *                         fatal error
- *
- * The state of the context describes what operations are possible on the context.
- * It will be in the state @SWFDEC_AS_CONTEXT_STATE_RUNNING almost all the time. If
- * it is in the state @SWFDEC_AS_CONTEXT_STATE_ABORTED, it will not work anymore and
- * every operation on it will instantly fail.
- */
-
-/*** RUNNING STATE ***/
-
-/**
- * swfdec_as_context_abort:
- * @context: a #SwfdecAsContext
- * @reason: a string describing why execution was aborted
- *
- * Aborts script execution in @context. Call this functon if the script engine 
- * encountered a fatal error and cannot continue. A possible reason for this is
- * an out-of-memory condition.
- **/
-void
-swfdec_as_context_abort (SwfdecAsContext *context, const char *reason)
-{
-  g_return_if_fail (context);
-
-  SWFDEC_ERROR ("%s", reason);
-  if (context->state != SWFDEC_AS_CONTEXT_ABORTED) {
-    context->state = SWFDEC_AS_CONTEXT_ABORTED;
-    g_object_notify (G_OBJECT (context), "aborted");
-  }
-}
-
-/*** MEMORY MANAGEMENT ***/
-
-/**
- * swfdec_as_context_use_mem:
- * @context: a #SwfdecAsContext
- * @bytes: number of bytes to use
- *
- * Registers @bytes additional bytes as in use by the @context. This function
- * keeps track of the memory that script code consumes. If too many memory is 
- * in use, this function may decide to stop the script engine with an out of 
- * memory error.
- *
- * Returns: %TRUE if the memory could be allocated. %FALSE on OOM.
- **/
-gboolean
-swfdec_as_context_use_mem (SwfdecAsContext *context, gsize bytes)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), FALSE);
-  g_return_val_if_fail (bytes > 0, FALSE);
-
-  if (context->state == SWFDEC_AS_CONTEXT_ABORTED)
-    return FALSE;
-  
-  context->memory += bytes;
-  context->memory_since_gc += bytes;
-  SWFDEC_LOG ("+%4"G_GSIZE_FORMAT" bytes, total %7"G_GSIZE_FORMAT" (%7"G_GSIZE_FORMAT" since GC)",
-      bytes, context->memory, context->memory_since_gc);
-  /* FIXME: Don't foget to abort on OOM */
-  return TRUE;
-}
-
-/**
- * swfdec_as_context_unuse_mem:
- * @context: a #SwfdecAsContext
- * @bytes: number of bytes to release
- *
- * Releases a number of bytes previously allocated using 
- * swfdec_as_context_use_mem(). See that function for details.
- **/
-void
-swfdec_as_context_unuse_mem (SwfdecAsContext *context, gsize bytes)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (bytes > 0);
-  g_return_if_fail (context->memory >= bytes);
-
-  context->memory -= bytes;
-  SWFDEC_LOG ("-%4"G_GSIZE_FORMAT" bytes, total %7"G_GSIZE_FORMAT" (%7"G_GSIZE_FORMAT" since GC)",
-      bytes, context->memory, context->memory_since_gc);
-}
-
-/*** GC ***/
-
-static gboolean
-swfdec_as_context_remove_strings (gpointer key, gpointer value, gpointer data)
-{
-  SwfdecAsContext *context = data;
-  char *string;
-
-  string = (char *) value;
-  /* it doesn't matter that rooted strings aren't destroyed, they're constant */
-  if (string[0] & SWFDEC_AS_GC_ROOT) {
-    SWFDEC_LOG ("rooted: %s", (char *) key);
-    return FALSE;
-  } else if (string[0] & SWFDEC_AS_GC_MARK) {
-    SWFDEC_LOG ("marked: %s", (char *) key);
-    string[0] &= ~SWFDEC_AS_GC_MARK;
-    return FALSE;
-  } else {
-    gsize len;
-    SWFDEC_LOG ("deleted: %s", (char *) key);
-    len = (strlen ((char *) key) + 2);
-    swfdec_as_context_unuse_mem (context, len);
-    g_slice_free1 (len, value);
-    return TRUE;
-  }
-}
-
-static gboolean
-swfdec_as_context_remove_objects (gpointer key, gpointer value, gpointer debugger)
-{
-  SwfdecAsObject *object;
-
-  object = key;
-  /* we only check for mark here, not root, since this works on destroy, too */
-  if (object->flags & SWFDEC_AS_GC_MARK) {
-    object->flags &= ~SWFDEC_AS_GC_MARK;
-    SWFDEC_LOG ("%s: %s %p", (object->flags & SWFDEC_AS_GC_ROOT) ? "rooted" : "marked",
-	G_OBJECT_TYPE_NAME (object), object);
-    return FALSE;
-  } else {
-    SWFDEC_LOG ("deleted: %s %p", G_OBJECT_TYPE_NAME (object), object);
-    if (debugger) {
-      SwfdecAsDebuggerClass *klass = SWFDEC_AS_DEBUGGER_GET_CLASS (debugger);
-      if (klass->remove)
-	klass->remove (debugger, object->context, object);
-    }
-    swfdec_as_object_collect (object);
-    return TRUE;
-  }
-}
-
-static void
-swfdec_as_context_collect (SwfdecAsContext *context)
-{
-  SWFDEC_INFO (">> collecting garbage");
-  /* NB: This functions is called without GC from swfdec_as_context_dispose */
-  g_hash_table_foreach_remove (context->strings, 
-    swfdec_as_context_remove_strings, context);
-  g_hash_table_foreach_remove (context->objects, 
-    swfdec_as_context_remove_objects, context->debugger);
-  SWFDEC_INFO (">> done collecting garbage");
-}
-
-/**
- * swfdec_as_object_mark:
- * @object: a #SwfdecAsObject
- *
- * Mark @object as being in use. Calling this function is only valid during
- * the marking phase of garbage collection.
- **/
-void
-swfdec_as_object_mark (SwfdecAsObject *object)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-
-  if (object->flags & SWFDEC_AS_GC_MARK)
-    return;
-  object->flags |= SWFDEC_AS_GC_MARK;
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  g_assert (klass->mark);
-  klass->mark (object);
-}
-
-/**
- * swfdec_as_string_mark:
- * @string: a garbage-collected string
- *
- * Mark @string as being in use. Calling this function is only valid during
- * the marking phase of garbage collection.
- **/
-void
-swfdec_as_string_mark (const char *string)
-{
-  char *str;
-
-  g_return_if_fail (string != NULL);
-
-  str = (char *) string - 1;
-  if (*str == 0)
-    *str = SWFDEC_AS_GC_MARK;
-}
-
-/**
- * swfdec_as_value_mark:
- * @value: a #SwfdecAsValue
- *
- * Mark @value as being in use. This is just a convenience function that calls
- * the right marking function depending on the value's type. Calling this 
- * function is only valid during the marking phase of garbage collection.
- **/
-void
-swfdec_as_value_mark (SwfdecAsValue *value)
-{
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
-
-  if (SWFDEC_AS_VALUE_IS_OBJECT (value)) {
-    swfdec_as_object_mark (SWFDEC_AS_VALUE_GET_OBJECT (value));
-  } else if (SWFDEC_AS_VALUE_IS_STRING (value)) {
-    swfdec_as_string_mark (SWFDEC_AS_VALUE_GET_STRING (value));
-  }
-}
-
-static void
-swfdec_as_context_mark_roots (gpointer key, gpointer value, gpointer data)
-{
-  SwfdecAsObject *object = key;
-
-  if ((object->flags & (SWFDEC_AS_GC_MARK | SWFDEC_AS_GC_ROOT)) == SWFDEC_AS_GC_ROOT)
-    swfdec_as_object_mark (object);
-}
-
-static void
-swfdec_as_context_do_mark (SwfdecAsContext *context)
-{
-  /* This if is needed for SwfdecPlayer */
-  if (context->global) {
-    swfdec_as_object_mark (context->global);
-    swfdec_as_object_mark (context->Function);
-    swfdec_as_object_mark (context->Function_prototype);
-    swfdec_as_object_mark (context->Object);
-    swfdec_as_object_mark (context->Object_prototype);
-  }
-  if (context->exception)
-    swfdec_as_value_mark (&context->exception_value);
-  g_hash_table_foreach (context->objects, swfdec_as_context_mark_roots, NULL);
-}
-
-/**
- * swfdec_as_context_gc:
- * @context: a #SwfdecAsContext
- *
- * Calls the Swfdec Gargbage collector and reclaims any unused memory. You 
- * should call this function or swfdec_as_context_maybe_gc() regularly.
- * <warning>Calling the GC during execution of code or initialization is not
- *          allowed.</warning>
- **/
-void
-swfdec_as_context_gc (SwfdecAsContext *context)
-{
-  SwfdecAsContextClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (context->frame == NULL);
-  g_return_if_fail (context->state == SWFDEC_AS_CONTEXT_RUNNING);
-
-  if (context->state == SWFDEC_AS_CONTEXT_ABORTED)
-    return;
-  SWFDEC_INFO ("invoking the garbage collector");
-  klass = SWFDEC_AS_CONTEXT_GET_CLASS (context);
-  g_assert (klass->mark);
-  klass->mark (context);
-  swfdec_as_context_collect (context);
-  context->memory_since_gc = 0;
-}
-
-static gboolean
-swfdec_as_context_needs_gc (SwfdecAsContext *context)
-{
-  return context->memory_since_gc >= context->memory_until_gc;
-}
-
-/**
- * swfdec_as_context_maybe_gc:
- * @context: a #SwfdecAsContext
- *
- * Calls the garbage collector if necessary. It's a good idea to call this
- * function regularly instead of swfdec_as_context_gc() as it only does collect
- * garage as needed. For example, #SwfdecPlayer calls this function after every
- * frame advancement.
- **/
-void
-swfdec_as_context_maybe_gc (SwfdecAsContext *context)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (context->state == SWFDEC_AS_CONTEXT_RUNNING);
-  g_return_if_fail (context->frame == NULL);
-
-  if (swfdec_as_context_needs_gc (context))
-    swfdec_as_context_gc (context);
-}
-
-/*** SWFDEC_AS_CONTEXT ***/
-
-enum {
-  TRACE,
-  LAST_SIGNAL
-};
-
-enum {
-  PROP_0,
-  PROP_DEBUGGER,
-  PROP_RANDOM_SEED,
-  PROP_ABORTED,
-  PROP_UNTIL_GC
-};
-
-G_DEFINE_TYPE (SwfdecAsContext, swfdec_as_context, G_TYPE_OBJECT)
-static guint signals[LAST_SIGNAL] = { 0, };
-
-static void
-swfdec_as_context_get_property (GObject *object, guint param_id, GValue *value, 
-    GParamSpec * pspec)
-{
-  SwfdecAsContext *context = SWFDEC_AS_CONTEXT (object);
-
-  switch (param_id) {
-    case PROP_DEBUGGER:
-      g_value_set_object (value, context->debugger);
-      break;
-    case PROP_ABORTED:
-      g_value_set_boolean (value, context->state == SWFDEC_AS_CONTEXT_ABORTED);
-      break;
-    case PROP_UNTIL_GC:
-      g_value_set_ulong (value, (gulong) context->memory_until_gc);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_as_context_set_property (GObject *object, guint param_id, const GValue *value, 
-    GParamSpec * pspec)
-{
-  SwfdecAsContext *context = SWFDEC_AS_CONTEXT (object);
-
-  switch (param_id) {
-    case PROP_DEBUGGER:
-      context->debugger = SWFDEC_AS_DEBUGGER (g_value_dup_object (value));
-      break;
-    case PROP_RANDOM_SEED:
-      g_rand_set_seed (context->rand, g_value_get_uint (value));
-      break;
-    case PROP_UNTIL_GC:
-      context->memory_until_gc = g_value_get_ulong (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
-      break;
-  }
-}
-
-static void
-swfdec_as_context_dispose (GObject *object)
-{
-  SwfdecAsContext *context = SWFDEC_AS_CONTEXT (object);
-
-  while (context->stack)
-    swfdec_as_stack_pop_segment (context);
-  swfdec_as_context_collect (context);
-  if (context->memory != 0) {
-    g_critical ("%zu bytes of memory left over\n", context->memory);
-  }
-  g_assert (g_hash_table_size (context->objects) == 0);
-  g_hash_table_destroy (context->objects);
-  g_hash_table_destroy (context->strings);
-  g_rand_free (context->rand);
-  if (context->debugger) {
-    g_object_unref (context->debugger);
-    context->debugger = NULL;
-  }
-
-  G_OBJECT_CLASS (swfdec_as_context_parent_class)->dispose (object);
-}
-
-static void
-swfdec_as_context_class_init (SwfdecAsContextClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->dispose = swfdec_as_context_dispose;
-  object_class->get_property = swfdec_as_context_get_property;
-  object_class->set_property = swfdec_as_context_set_property;
-
-  g_object_class_install_property (object_class, PROP_DEBUGGER,
-      g_param_spec_object ("debugger", "debugger", "debugger used in this player",
-	  SWFDEC_TYPE_AS_DEBUGGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (object_class, PROP_RANDOM_SEED,
-      g_param_spec_uint ("random-seed", "random seed", 
-	  "seed used for calculating random numbers",
-	  0, G_MAXUINT32, 0, G_PARAM_WRITABLE)); /* FIXME: make this readwrite for replaying? */
-  g_object_class_install_property (object_class, PROP_ABORTED,
-      g_param_spec_boolean ("aborted", "aborted", "set when the script engine aborts due to an error",
-	FALSE, G_PARAM_READABLE));
-  g_object_class_install_property (object_class, PROP_UNTIL_GC,
-      g_param_spec_ulong ("memory-until-gc", "memory until gc", 
-	  "amount of bytes that need to be allocated before garbage collection triggers",
-	  0, G_MAXULONG, 8 * 1024 * 1024, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-
-  /**
-   * SwfdecAsContext::trace:
-   * @context: the #SwfdecAsContext affected
-   * @text: the debugging string
-   *
-   * Emits a debugging string while running. The effect of calling any swfdec 
-   * functions on the emitting @context is undefined.
-   */
-  signals[TRACE] = g_signal_new ("trace", G_TYPE_FROM_CLASS (klass),
-      G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING,
-      G_TYPE_NONE, 1, G_TYPE_STRING);
-
-  klass->mark = swfdec_as_context_do_mark;
-}
-
-static void
-swfdec_as_context_init (SwfdecAsContext *context)
-{
-  const char *s;
-
-  context->version = G_MAXUINT;
-
-  context->strings = g_hash_table_new (g_str_hash, g_str_equal);
-  context->objects = g_hash_table_new (g_direct_hash, g_direct_equal);
-
-  for (s = swfdec_as_strings; *s == '\2'; s += strlen (s) + 1) {
-    g_hash_table_insert (context->strings, (char *) s + 1, (char *) s);
-  }
-  g_assert (*s == 0);
-  context->rand = g_rand_new ();
-  g_get_current_time (&context->start_time);
-}
-
-/*** STRINGS ***/
-
-static const char *
-swfdec_as_context_create_string (SwfdecAsContext *context, const char *string, gsize len)
-{
-  char *new;
-  
-  if (!swfdec_as_context_use_mem (context, sizeof (char) * (2 + len)))
-    return SWFDEC_AS_STR_EMPTY;
-
-  new = g_slice_alloc (2 + len);
-  memcpy (&new[1], string, len);
-  new[len + 1] = 0;
-  new[0] = 0; /* GC flags */
-  g_hash_table_insert (context->strings, new + 1, new);
-
-  return new + 1;
-}
-
-/**
- * swfdec_as_context_get_string:
- * @context: a #SwfdecAsContext
- * @string: a sting that is not garbage-collected
- *
- * Gets the garbage-collected version of @string. You need to call this function
- * for every not garbage-collected string that you want to use in Swfdecs script
- * interpreter.
- *
- * Returns: the garbage-collected version of @string
- **/
-const char *
-swfdec_as_context_get_string (SwfdecAsContext *context, const char *string)
-{
-  const char *ret;
-  gsize len;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_return_val_if_fail (string != NULL, NULL);
-
-  if (g_hash_table_lookup_extended (context->strings, string, (gpointer) &ret, NULL))
-    return ret;
-
-  len = strlen (string);
-  return swfdec_as_context_create_string (context, string, len);
-}
-
-/**
- * swfdec_as_context_give_string:
- * @context: a #SwfdecAsContext
- * @string: string to make refcounted
- *
- * Takes ownership of @string and returns a refcounted version of the same 
- * string. This function is the same as swfdec_as_context_get_string(), but 
- * takes ownership of @string.
- *
- * Returns: A refcounted string
- **/
-const char *
-swfdec_as_context_give_string (SwfdecAsContext *context, char *string)
-{
-  const char *ret;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_return_val_if_fail (string != NULL, NULL);
-
-  ret = swfdec_as_context_get_string (context, string);
-  g_free (string);
-  return ret;
-}
-
-/**
- * swfdec_as_context_is_constructing:
- * @context: a #SwfdecAsConstruct
- *
- * Determines if the contexxt is currently constructing. This information is
- * used by various constructors to do different things when they are 
- * constructing and when they are not. The Boolean, Number and String functions
- * for example setup the newly constructed objects when constructing but only
- * cast the provided argument when being called.
- *
- * Returns: %TRUE if the currently executing frame is a constructor
- **/
-gboolean
-swfdec_as_context_is_constructing (SwfdecAsContext *context)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), FALSE);
-
-  return context->frame && context->frame->construct;
-}
-
-/**
- * swfdec_as_context_get_frame:
- * @context: a #SwfdecAsContext
- *
- * This is a debugging function. It gets the topmost stack frame that is 
- * currently executing. If no function is executing, %NULL is returned. You can
- * easily get a backtrace with code like this:
- * |[for (frame = swfdec_as_context_get_frame (context); frame != NULL; 
- *     frame = swfdec_as_frame_get_next (frame)) {
- *   char *s = swfdec_as_object_get_debug (SWFDEC_AS_OBJECT (frame));
- *   g_print ("%s\n", s);
- *   g_free (s);
- * }]|
- *
- * Returns: the currently executing frame or %NULL if none
- **/
-SwfdecAsFrame *
-swfdec_as_context_get_frame (SwfdecAsContext *context)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-
-  return context->frame;
-}
-
-/**
- * swfdec_as_context_throw:
- * @context: a #SwfdecAsContext
- * @value: a #SwfdecAsValue to be thrown
- *
- * Throws a new exception in the @context using the given @value. This function
- * can only be called if the @context is not already throwing an exception.
- **/
-void
-swfdec_as_context_throw (SwfdecAsContext *context, const SwfdecAsValue *value)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
-  g_return_if_fail (!context->exception);
-
-  context->exception = TRUE;
-  context->exception_value = *value;
-}
-
-/**
- * swfdec_as_context_catch:
- * @context: a #SwfdecAsContext
- * @value: a #SwfdecAsValue to be thrown
- *
- * Removes the currently thrown exception from @context and sets @value to the
- * thrown value
- *
- * Returns: %TRUE if an exception was catched, %FALSE otherwise
- **/
-gboolean
-swfdec_as_context_catch (SwfdecAsContext *context, SwfdecAsValue *value)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), FALSE);
-
-  if (!context->exception)
-    return FALSE;
-
-  if (value != NULL)
-    *value = context->exception_value;
-
-  context->exception = FALSE;
-  SWFDEC_AS_VALUE_SET_UNDEFINED (&context->exception_value);
-
-  return TRUE;
-}
-
-/**
- * swfdec_as_context_get_time:
- * @context: a #SwfdecAsContext
- * @tv: a #GTimeVal to be set to the context's time
- *
- * This function queries the time to be used inside this context. By default,
- * this is the same as g_get_current_time(), but it may be overwriten to allow
- * things such as slower or faster playback.
- **/
-void
-swfdec_as_context_get_time (SwfdecAsContext *context, GTimeVal *tv)
-{
-  SwfdecAsContextClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (tv != NULL);
-
-  klass = SWFDEC_AS_CONTEXT_GET_CLASS (context);
-  if (klass->get_time)
-    klass->get_time (context, tv);
-  else
-    g_get_current_time (tv);
-}
-
-/**
- * swfdec_as_context_run:
- * @context: a #SwfdecAsContext
- *
- * Continues running the script engine. Executing code in this engine works
- * in 2 steps: First, you push the frame to be executed onto the stack, then
- * you call this function to execute it. So this function is the single entry
- * point to script execution. This might be helpful when debugging your 
- * application. 
- * <note>A lot of convenience functions like swfdec_as_object_run() call this 
- * function automatically.</note>
- **/
-void
-swfdec_as_context_run (SwfdecAsContext *context)
-{
-  SwfdecAsFrame *frame, *last_frame;
-  SwfdecScript *script;
-  const SwfdecActionSpec *spec;
-  const guint8 *startpc, *pc, *endpc, *nextpc, *exitpc;
-#ifndef G_DISABLE_ASSERT
-  SwfdecAsValue *check;
-#endif
-  guint action, len;
-  const guint8 *data;
-  guint original_version;
-  void (* step) (SwfdecAsDebugger *debugger, SwfdecAsContext *context);
-  gboolean check_block; /* some opcodes avoid a scope check */
-
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-
-  if (context->frame == NULL || context->state == SWFDEC_AS_CONTEXT_ABORTED)
-    return;
-
-  if (context->debugger) {
-    SwfdecAsDebuggerClass *klass = SWFDEC_AS_DEBUGGER_GET_CLASS (context->debugger);
-    step = klass->step;
-  } else {
-    step = NULL;
-  }
-
-  last_frame = context->last_frame;
-  context->last_frame = context->frame->next;
-  original_version = context->version;
-start:
-  g_return_if_fail (context->global); /* check here because of swfdec_sandbox_(un)use() */
-  if (!swfdec_as_context_check_continue (context))
-    goto error;
-  /* setup data */
-  frame = context->frame;
-  if (frame == context->last_frame)
-    goto out;
-  if (context->call_depth > 256) {
-    /* we've exceeded our maximum call depth, throw an error and abort */
-    swfdec_as_context_abort (context, "Stack overflow");
-    goto error;
-  }
-  if (SWFDEC_IS_AS_NATIVE_FUNCTION (frame->function)) {
-    SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (frame->function);
-    SwfdecAsValue rval = { 0, };
-    if (frame->argc >= native->min_args && 
-	(native->type == 0 || 
-	 g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type))) {
-      SwfdecAsValue *argv;
-      /* accumulate argv */
-      if (frame->argc == 0 || frame->argv != NULL) {
-	/* FIXME FIXME FIXME: no casting here please! */
-	argv = (SwfdecAsValue *) frame->argv;
-      } else {
-	SwfdecAsStack *stack;
-	SwfdecAsValue *cur;
-	guint i;
-	if (frame->argc > 128) {
-	  SWFDEC_FIXME ("allow calling native functions with more than 128 args (this one has %u)",
-	      frame->argc);
-	  frame->argc = 128;
-	}
-	argv = g_new (SwfdecAsValue, frame->argc);
-	stack = context->stack;
-	cur = context->cur;
-	for (i = 0; i < frame->argc; i++) {
-	  if (cur <= &stack->elements[0]) {
-	    stack = stack->next;
-	    cur = &stack->elements[stack->used_elements];
-	  }
-	  cur--;
-	  argv[i] = *cur;
-	}
-      }
-      native->native (context, frame->thisp, frame->argc, 
-	  argv, &rval);
-      if (argv != frame->argv)
-	g_free (argv);
-    }
-    swfdec_as_frame_return (frame, &rval);
-    goto start;
-  }
-  g_assert (frame->script);
-  g_assert (frame->target);
-  script = frame->script;
-  context->version = script->version;
-  startpc = script->buffer->data;
-  endpc = startpc + script->buffer->length;
-  exitpc = script->exit;
-  pc = frame->pc;
-  check_block = TRUE;
-
-  while (context->state < SWFDEC_AS_CONTEXT_ABORTED) {
-    if (context->exception) {
-      swfdec_as_frame_handle_exception (frame);
-      if (frame != context->frame)
-	goto start;
-      pc = frame->pc;
-      continue;
-    }
-    if (pc == exitpc) {
-      swfdec_as_frame_return (frame, NULL);
-      goto start;
-    }
-    if (pc < startpc || pc >= endpc) {
-      SWFDEC_ERROR ("pc %p not in valid range [%p, %p) anymore", pc, startpc, endpc);
-      goto error;
-    }
-    if (check_block && (pc < frame->block_start || pc >= frame->block_end)) {
-      SWFDEC_LOG ("code exited block");
-      swfdec_as_frame_pop_block (frame);
-      pc = frame->pc;
-      if (frame != context->frame)
-	goto start;
-    }
-
-    /* decode next action */
-    action = *pc;
-    if (action == 0) {
-      swfdec_as_frame_return (frame, NULL);
-      goto start;
-    }
-    /* invoke debugger if there is one */
-    if (step) {
-      frame->pc = pc;
-      (* step) (context->debugger, context);
-      if (frame != context->frame || 
-	  frame->pc != pc) {
-	goto start;
-      }
-    }
-    /* prepare action */
-    spec = swfdec_as_actions + action;
-    if (action & 0x80) {
-      if (pc + 2 >= endpc) {
-	SWFDEC_ERROR ("action %u length value out of range", action);
-	goto error;
-      }
-      data = pc + 3;
-      len = pc[1] | pc[2] << 8;
-      if (data + len > endpc) {
-	SWFDEC_ERROR ("action %u length %u out of range", action, len);
-	goto error;
-      }
-      nextpc = pc + 3 + len;
-    } else {
-      data = NULL;
-      len = 0;
-      nextpc = pc + 1;
-    }
-    /* check action is valid */
-    if (!spec->exec) {
-      SWFDEC_WARNING ("cannot interpret action %3u 0x%02X %s for version %u, skipping it", action,
-	  action, spec->name ? spec->name : "Unknown", script->version);
-      frame->pc = pc = nextpc;
-      check_block = TRUE;
-      continue;
-    }
-    if (script->version < spec->version) {
-      SWFDEC_WARNING ("cannot interpret action %3u 0x%02X %s for version %u, using version %u instead",
-	  action, action, spec->name ? spec->name : "Unknown", script->version, spec->version);
-    }
-    if (spec->remove > 0) {
-      if (spec->add > spec->remove)
-	swfdec_as_stack_ensure_free (context, spec->add - spec->remove);
-      swfdec_as_stack_ensure_size (context, spec->remove);
-    } else {
-      if (spec->add > 0)
-	swfdec_as_stack_ensure_free (context, spec->add);
-    }
-    if (context->state > SWFDEC_AS_CONTEXT_RUNNING) {
-      SWFDEC_WARNING ("context not running anymore, aborting");
-      goto error;
-    }
-#ifndef G_DISABLE_ASSERT
-    check = (spec->add >= 0 && spec->remove >= 0) ? context->cur + spec->add - spec->remove : NULL;
-#endif
-    /* execute action */
-    spec->exec (context, action, data, len);
-    /* adapt the pc if the action did not, otherwise, leave it alone */
-    /* FIXME: do this via flag? */
-    if (frame->pc == pc) {
-      frame->pc = pc = nextpc;
-      check_block = TRUE;
-    } else {
-      if (frame->pc < pc &&
-	  !swfdec_as_context_check_continue (context)) {
-	goto error;
-      }
-      pc = frame->pc;
-      check_block = FALSE;
-    }
-    if (frame == context->frame) {
-#ifndef G_DISABLE_ASSERT
-      if (check != NULL && check != context->cur) {
-	g_error ("action %s was supposed to change the stack by %d (+%d -%d), but it changed by %td",
-	    spec->name, spec->add - spec->remove, spec->add, spec->remove,
-	    context->cur - check + spec->add - spec->remove);
-      }
-#endif
-    } else {
-      /* someone called/returned from a function, reread variables */
-      goto start;
-    }
-  }
-
-error:
-  while (context->frame != context->last_frame)
-    swfdec_as_frame_return (context->frame, NULL);
-out:
-  context->last_frame = last_frame;
-  context->version = original_version;
-  return;
-}
-
-/*** EVAL ***/
-
-static char *
-swfdec_as_slash_to_dot (const char *slash_str)
-{
-  const char *cur = slash_str;
-  GString *str = g_string_new ("");
-
-  if (*cur == '/') {
-    g_string_append (str, "_root");
-  } else {
-    goto start;
-  }
-  while (cur && *cur == '/') {
-    cur++;
-start:
-    if (str->len > 0)
-      g_string_append_c (str, '.');
-    if (cur[0] == '.' && cur[1] == '.') {
-      g_string_append (str, "_parent");
-      cur += 2;
-    } else {
-      char *slash = strchr (cur, '/');
-      if (slash) {
-	g_string_append_len (str, cur, slash - cur);
-	cur = slash;
-      } else {
-	g_string_append (str, cur);
-	cur = NULL;
-      }
-    }
-    /* cur should now point to the slash */
-  }
-  if (cur) {
-    if (*cur != '\0')
-      goto fail;
-  }
-  SWFDEC_DEBUG ("parsed slash-notated string \"%s\" into dot notation \"%s\"",
-      slash_str, str->str);
-  return g_string_free (str, FALSE);
-
-fail:
-  SWFDEC_WARNING ("failed to parse slash-notated string \"%s\" into dot notation", slash_str);
-  g_string_free (str, TRUE);
-  return NULL;
-}
-
-static void
-swfdec_as_context_eval_get_property (SwfdecAsContext *cx, 
-    SwfdecAsObject *obj, const char *name, SwfdecAsValue *ret)
-{
-  if (obj) {
-    swfdec_as_object_get_variable (obj, name, ret);
-  } else {
-    if (cx->frame) {
-      swfdec_as_frame_get_variable (cx->frame, name, ret);
-    } else {
-      SWFDEC_WARNING ("eval called without a frame");
-      swfdec_as_object_get_variable (cx->global, name, ret);
-    }
-  }
-}
-
-static void
-swfdec_as_context_eval_set_property (SwfdecAsContext *cx, 
-    SwfdecAsObject *obj, const char *name, const SwfdecAsValue *ret)
-{
-  if (obj == NULL) {
-    if (cx->frame == NULL) {
-      SWFDEC_ERROR ("no frame in eval_set?");
-      return;
-    }
-    swfdec_as_frame_set_variable (cx->frame, name, ret);
-  } else {
-    swfdec_as_object_set_variable (obj, name, ret);
-  }
-}
-
-static void
-swfdec_as_context_eval_internal (SwfdecAsContext *cx, SwfdecAsObject *obj, const char *str,
-        SwfdecAsValue *val, gboolean set)
-{
-  SwfdecAsValue cur;
-  char **varlist;
-  guint i;
-
-  SWFDEC_LOG ("eval called with \"%s\" on %p", str, obj);
-  if (strchr (str, '/')) {
-    char *work = swfdec_as_slash_to_dot (str);
-    if (!work) {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-      return;
-    }
-    varlist = g_strsplit (work, ".", -1);
-    g_free (work);
-  } else {
-    varlist = g_strsplit (str, ".", -1);
-  }
-  for (i = 0; varlist[i] != NULL; i++) {
-    const char *dot = swfdec_as_context_get_string (cx, varlist[i]);
-    if (varlist[i+1] != NULL) {
-      swfdec_as_context_eval_get_property (cx, obj, dot, &cur);
-      if (!SWFDEC_AS_VALUE_IS_OBJECT (&cur)) {
-	SWFDEC_AS_VALUE_SET_UNDEFINED (&cur);
-	break;
-      }
-      obj = SWFDEC_AS_VALUE_GET_OBJECT (&cur);
-    } else {
-      if (set) {
-	swfdec_as_context_eval_set_property (cx, obj, dot, val);
-      } else {
-	swfdec_as_context_eval_get_property (cx, obj, dot, &cur);
-      }
-      goto finish;
-    }
-  }
-  if (obj == NULL) {
-    if (cx->frame)
-      obj = cx->frame->target;
-    else
-      obj = cx->global;
-  }
-  g_assert (obj != NULL);
-  SWFDEC_AS_VALUE_SET_OBJECT (&cur, obj);
-
-finish:
-  g_strfreev (varlist);
-  *val = cur;
-}
-
-/**
- * swfdec_as_context_eval:
- * @context: a #SwfdecAsContext
- * @obj: #SwfdecAsObject to use as source for evaluating or NULL for the 
- *       current frame's scope
- * @str: The string to evaluate
- * @val: location for the return value
- *
- * This function works like the Actionscript eval function used on @obj.
- * It handles both slash-style and dot-style notation. If an error occured
- * during evaluation, the return value will be the undefined value.
- **/
-void
-swfdec_as_context_eval (SwfdecAsContext *context, SwfdecAsObject *obj, const char *str, 
-    SwfdecAsValue *val)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (obj == NULL || SWFDEC_IS_AS_OBJECT (obj));
-  g_return_if_fail (str != NULL);
-  g_return_if_fail (val != NULL);
-
-  swfdec_as_context_eval_internal (context, obj, str, val, FALSE);
-}
-
-/**
- * swfdec_as_context_eval_set:
- * @context: a #SwfdecAsContext
- * @obj: #SwfdecAsObject to use as source for evaluating or NULL for the 
- *       default object.
- * @str: The string to evaluate
- * @val: the value to set the variable to
- *
- * Sets the variable referenced by @str to @val. If @str does not reference 
- * a valid property, nothing happens.
- **/
-void
-swfdec_as_context_eval_set (SwfdecAsContext *context, SwfdecAsObject *obj, const char *str,
-    const SwfdecAsValue *val)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (obj == NULL || SWFDEC_IS_AS_OBJECT (obj));
-  g_return_if_fail (str != NULL);
-  g_return_if_fail (val != NULL);
-
-  swfdec_as_context_eval_internal (context, obj, str, (SwfdecAsValue *) val, TRUE);
-}
-
-/*** AS CODE ***/
-
-static void
-swfdec_as_context_ASSetPropFlags_set_one_flag (SwfdecAsObject *object,
-    const char *s, guint *flags)
-{
-  swfdec_as_object_unset_variable_flags (object, s, flags[1]);
-  swfdec_as_object_set_variable_flags (object, s, flags[0]);
-}
-
-static gboolean
-swfdec_as_context_ASSetPropFlags_foreach (SwfdecAsObject *object,
-    const char *s, SwfdecAsValue *val, guint cur_flags, gpointer data)
-{
-  guint *flags = data;
-
-  /* shortcut if the flags already match */
-  if (cur_flags == ((cur_flags &~ flags[1]) | flags[0]))
-    return TRUE;
-
-  swfdec_as_context_ASSetPropFlags_set_one_flag (object, s, flags);
-  return TRUE;
-}
-
-SWFDEC_AS_NATIVE (1, 0, swfdec_as_context_ASSetPropFlags)
-void
-swfdec_as_context_ASSetPropFlags (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  guint flags[2]; /* flags and mask - array so we can pass it as data pointer */
-  SwfdecAsObject *obj;
-
-  if (argc < 3)
-    return;
-
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[0]))
-    return;
-  obj = SWFDEC_AS_VALUE_GET_OBJECT (&argv[0]);
-  flags[0] = swfdec_as_value_to_integer (cx, &argv[2]);
-  flags[1] = (argc > 3) ? swfdec_as_value_to_integer (cx, &argv[3]) : 0;
-
-  if (flags[0] == 0 && flags[1] == 0) {
-    // we should add autosizing length attribute here
-    SWFDEC_FIXME ("ASSetPropFlags to set special length attribute not implemented");
-    return;
-  }
-
-  if (SWFDEC_AS_VALUE_IS_NULL (&argv[1])) {
-    swfdec_as_object_foreach (obj, swfdec_as_context_ASSetPropFlags_foreach, flags);
-  } else {
-    char **split =
-      g_strsplit (swfdec_as_value_to_string (cx, &argv[1]), ",", -1);
-    guint i;
-    for (i = 0; split[i]; i++) {
-      swfdec_as_context_ASSetPropFlags_set_one_flag (obj, 
-	  swfdec_as_context_get_string (cx, split[i]), flags);
-    }
-    g_strfreev (split); 
-  }
-}
-
-SWFDEC_AS_NATIVE (200, 19, swfdec_as_context_isFinite)
-void
-swfdec_as_context_isFinite (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  double d;
-
-  if (argc < 1)
-    return;
-
-  d = swfdec_as_value_to_number (cx, &argv[0]);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, isfinite (d) ? TRUE : FALSE);
-}
-
-SWFDEC_AS_NATIVE (200, 18, swfdec_as_context_isNaN)
-void
-swfdec_as_context_isNaN (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  double d;
-
-  if (argc < 1)
-    return;
-
-  d = swfdec_as_value_to_number (cx, &argv[0]);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, isnan (d) ? TRUE : FALSE);
-}
-
-SWFDEC_AS_NATIVE (100, 2, swfdec_as_context_parseInt)
-void
-swfdec_as_context_parseInt (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  const char *s;
-  char *tail;
-  int radix;
-  gint64 i;
-
-  if (argc < 1)
-    return;
-
-  s = swfdec_as_value_to_string (cx, &argv[0]);
-
-  if (argc >= 2) {
-    radix = swfdec_as_value_to_integer (cx, &argv[1]);
-
-    if (radix < 2 || radix > 36) {
-      SWFDEC_AS_VALUE_SET_NUMBER (retval, NAN);
-      return;
-    }
-
-    // special case, strtol parses things that we shouldn't parse
-    if (radix == 16) {
-      const char *end = s + strspn (s, " \t\r\n");
-      if (end != s && (end[0] == '-' || end[0] == '+'))
-	end++;
-      if (end != s && end[0] == '0' && (end[1] == 'x' || end[1] == 'X')) {
-	SWFDEC_AS_VALUE_SET_NUMBER (retval, 0);
-	return;
-      }
-    }
-  } else {
-    radix = 0;
-  }
-
-  // special case, don't allow sign in front of the 0x
-  if ((s[0] == '-' || s[0] == '+') && s[1] == '0' &&
-      (s[2] == 'x' || s[2] == 'X')) {
-    SWFDEC_AS_VALUE_SET_NUMBER (retval, NAN);
-    return;
-  }
-
-  if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) {
-    s = s + 2;
-    i = g_ascii_strtoll (s, &tail, (radix != 0 ? radix : 16));
-  } else if (s[0] == '0' && s[strspn (s, "01234567")] == '\0') {
-    i = g_ascii_strtoll (s, &tail, (radix != 0 ? radix : 8));
-  } else {
-    i = g_ascii_strtoll (s, &tail, (radix != 0 ? radix : 10));
-  }
-
-  if (tail == s) {
-    SWFDEC_AS_VALUE_SET_NUMBER (retval, NAN);
-    return;
-  }
-
-  if (i > G_MAXINT32 || i < G_MININT32) {
-    SWFDEC_AS_VALUE_SET_NUMBER (retval, i);
-  } else {
-    SWFDEC_AS_VALUE_SET_INT (retval, i);
-  }
-}
-
-SWFDEC_AS_NATIVE (100, 3, swfdec_as_context_parseFloat)
-void
-swfdec_as_context_parseFloat (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  char *s, *p, *tail;
-  double d;
-
-  if (argc < 1)
-    return;
-
-  // we need to remove everything after x or I, since strtod parses hexadecimal
-  // numbers and Infinity
-  s = g_strdup (swfdec_as_value_to_string (cx, &argv[0]));
-  if ((p = strpbrk (s, "xXiI")) != NULL) {
-    *p = '\0';
-  }
-
-  d = g_ascii_strtod (s, &tail);
-
-  if (tail == s) {
-    SWFDEC_AS_VALUE_SET_NUMBER (retval, NAN);
-  } else {
-    SWFDEC_AS_VALUE_SET_NUMBER (retval, d);
-  }
-
-  g_free (s);
-}
-
-static void
-swfdec_as_context_init_global (SwfdecAsContext *context)
-{
-  SwfdecAsValue val;
-
-  SWFDEC_AS_VALUE_SET_NUMBER (&val, NAN);
-  swfdec_as_object_set_variable (context->global, SWFDEC_AS_STR_NaN, &val);
-  SWFDEC_AS_VALUE_SET_NUMBER (&val, HUGE_VAL);
-  swfdec_as_object_set_variable (context->global, SWFDEC_AS_STR_Infinity, &val);
-}
-
-void
-swfdec_as_context_run_init_script (SwfdecAsContext *context, const guint8 *data, 
-    gsize length, guint version)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (data != NULL);
-  g_return_if_fail (length > 0);
-
-  if (version > 4) {
-    SwfdecBits bits;
-    SwfdecScript *script;
-    swfdec_bits_init_data (&bits, data, length);
-    script = swfdec_script_new_from_bits (&bits, "init", version);
-    if (script == NULL) {
-      g_warning ("script passed to swfdec_as_context_run_init_script is invalid");
-      return;
-    }
-    swfdec_as_object_run (context->global, script);
-    swfdec_script_unref (script);
-  } else {
-    SWFDEC_LOG ("not running init script, since version is <= 4");
-  }
-}
-
-/**
- * swfdec_as_context_startup:
- * @context: a #SwfdecAsContext
- * @version: Flash version to use
- *
- * Starts up the context. This function must be called before any Actionscript
- * is called on @context. The version is responsible for deciding which native
- * functions and properties are available in the context.
- **/
-void
-swfdec_as_context_startup (SwfdecAsContext *context)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (context->state == SWFDEC_AS_CONTEXT_NEW);
-
-  if (context->cur == NULL &&
-      !swfdec_as_stack_push_segment (context))
-    return;
-  if (context->global == NULL)
-    context->global = swfdec_as_object_new_empty (context);
-  /* init the two internal functions */
-  /* FIXME: remove them for normal contexts? */
-  swfdec_player_preinit_global (context);
-  /* get the necessary objects up to define objects and functions sanely */
-  swfdec_as_function_init_context (context);
-  swfdec_as_object_init_context (context);
-  /* define the global object and other important ones */
-  swfdec_as_context_init_global (context);
-
-  /* run init script */
-  swfdec_as_context_run_init_script (context, swfdec_as_initialize, sizeof (swfdec_as_initialize), 8);
-
-  if (context->state == SWFDEC_AS_CONTEXT_NEW)
-    context->state = SWFDEC_AS_CONTEXT_RUNNING;
-}
-
-/**
- * swfdec_as_context_check_continue:
- * @context: the context that might be running too long
- *
- * Checks if the context has been running too long. If it has, it gets aborted.
- *
- * Returns: %TRUE if this player aborted.
- **/
-gboolean
-swfdec_as_context_check_continue (SwfdecAsContext *context)
-{
-  SwfdecAsContextClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), TRUE);
-
-  klass = SWFDEC_AS_CONTEXT_GET_CLASS (context);
-  if (klass->check_continue == NULL)
-    return TRUE;
-  if (!klass->check_continue (context)) {
-    swfdec_as_context_abort (context, "Runtime exceeded");
-    return FALSE;
-  }
-  return TRUE;
-}
-
-/**
- * swfdec_as_context_is_aborted:
- * @context: a #SwfdecAsContext
- *
- * Determines if the given context is aborted. An aborted context is not able
- * to execute any scripts. Aborting can happen if the script engine detects bad 
- * scripts that cause excessive memory usage, infinite loops or other problems.
- * In that case the script engine aborts for safety reasons.
- *
- * Returns: %TRUE if the player is aborted, %FALSE if it runs normally.
- **/
-gboolean
-swfdec_as_context_is_aborted (SwfdecAsContext *context)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), TRUE);
-
-  return context->state == SWFDEC_AS_CONTEXT_ABORTED;
-}
-
diff --git a/libswfdec/swfdec_as_context.h b/libswfdec/swfdec_as_context.h
deleted file mode 100644
index d5ef066..0000000
--- a/libswfdec/swfdec_as_context.h
+++ /dev/null
@@ -1,143 +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_AS_CONTEXT_H_
-#define _SWFDEC_AS_CONTEXT_H_
-
-#include <glib-object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
-  SWFDEC_AS_CONTEXT_NEW,
-  SWFDEC_AS_CONTEXT_RUNNING,
-  SWFDEC_AS_CONTEXT_INTERRUPTED,
-  SWFDEC_AS_CONTEXT_ABORTED
-} SwfdecAsContextState;
-
-typedef struct _SwfdecAsContextClass SwfdecAsContextClass;
-
-#define SWFDEC_TYPE_AS_CONTEXT                    (swfdec_as_context_get_type())
-#define SWFDEC_IS_AS_CONTEXT(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_CONTEXT))
-#define SWFDEC_IS_AS_CONTEXT_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_CONTEXT))
-#define SWFDEC_AS_CONTEXT(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_CONTEXT, SwfdecAsContext))
-#define SWFDEC_AS_CONTEXT_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_CONTEXT, SwfdecAsContextClass))
-#define SWFDEC_AS_CONTEXT_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_CONTEXT, SwfdecAsContextClass))
-
-struct _SwfdecAsContext {
-  GObject		object;
-
-  SwfdecAsContextState	state;		/* our current state */
-  SwfdecAsObject *	global;		/* the global object or NULL if not initialized yet. 
-					   In SwfdecPlayer is NULL unless a sandbox is in use */
-  GRand *		rand;		/* random number generator */
-  GTimeVal		start_time;   	/* time this movie started (for GetTime action) */
-
-  /* GC properties */
-  gsize			memory_until_gc;/* amount of memory allocations that trigger a GC */
-
-  /* bookkeeping for GC */
-  gsize			memory;		/* total memory currently in use */
-  gsize			memory_since_gc;/* memory allocated since last GC run */
-  GHashTable *		strings;	/* string=>memory mapping the context manages */
-  GHashTable *		objects;	/* all objects the context manages */
-
-  /* execution state */
-  unsigned int	      	version;	/* currently active version */
-  unsigned int		call_depth;   	/* current depth of call stack (equals length of frame list) */
-  SwfdecAsFrame *	frame;		/* topmost stack frame */
-  SwfdecAsFrame *	last_frame;   	/* last frame before calling context_run */
-  gboolean		exception;	/* whether we are throwing an exception */
-  SwfdecAsValue		exception_value; /* value of the exception being thrown, can be anything including undefined */
-
-  /* stack */
-  SwfdecAsValue	*	base;		/* stack base */
-  SwfdecAsValue	*	end;		/* end of stack */
-  SwfdecAsValue	*	cur;		/* pointer to current top of stack */
-  SwfdecAsStack *	stack;		/* current stack */
-
-  /* magic objects - initialized during swfdec_as_context_startup() */
-  SwfdecAsObject *	Function;	/* Function */
-  SwfdecAsObject *	Function_prototype;	/* Function.prototype */
-  SwfdecAsObject *	Object;		/* Object */
-  SwfdecAsObject *	Object_prototype;	/* Object.prototype */
-
-  /* debugging */
-  SwfdecAsDebugger *	debugger;	/* debugger (or NULL if none) */
-};
-
-struct _SwfdecAsContextClass {
-  GObjectClass		object_class;
-
-  /* mark all objects that should not be collected */
-  void			(* mark)		(SwfdecAsContext *	context);
-  /* overwrite if you want to report a different time than gettimeofday */
-  void			(* get_time)		(SwfdecAsContext *      context,
-						 GTimeVal *		tv);
-  /* overwrite if you want to abort on infinite loops */
-  gboolean		(* check_continue)	(SwfdecAsContext *	context);
-};
-
-GType		swfdec_as_context_get_type	(void);
-
-void		swfdec_as_context_startup     	(SwfdecAsContext *	context);
-
-gboolean	swfdec_as_context_is_aborted	(SwfdecAsContext *	context);
-gboolean	swfdec_as_context_is_constructing
-						(SwfdecAsContext *	context);
-SwfdecAsFrame *	swfdec_as_context_get_frame	(SwfdecAsContext *	context);
-void		swfdec_as_context_get_time	(SwfdecAsContext *	context,
-						 GTimeVal *		tv);
-const char *	swfdec_as_context_get_string	(SwfdecAsContext *	context,
-						 const char *		string);
-const char *	swfdec_as_context_give_string	(SwfdecAsContext *	context,
-						 char *			string);
-
-void		swfdec_as_context_abort		(SwfdecAsContext *	context,
-						 const char *		reason);
-
-void		swfdec_as_context_throw		(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-gboolean	swfdec_as_context_catch		(SwfdecAsContext *	context,
-						 SwfdecAsValue *	value);
-
-gboolean	swfdec_as_context_use_mem     	(SwfdecAsContext *	context, 
-						 gsize			bytes);
-void		swfdec_as_context_unuse_mem   	(SwfdecAsContext *	context,
-						 gsize			bytes);
-void		swfdec_as_object_mark		(SwfdecAsObject *	object);
-void		swfdec_as_value_mark		(SwfdecAsValue *	value);
-void		swfdec_as_string_mark		(const char *		string);
-void		swfdec_as_context_gc		(SwfdecAsContext *	context);
-void		swfdec_as_context_maybe_gc	(SwfdecAsContext *	context);
-
-void		swfdec_as_context_run		(SwfdecAsContext *	context);
-
-void		swfdec_as_context_eval		(SwfdecAsContext *	context,
-						 SwfdecAsObject *	obj,
-						 const char *		str,
-						 SwfdecAsValue *	val);
-void		swfdec_as_context_eval_set	(SwfdecAsContext *	context,
-						 SwfdecAsObject *	obj,
-						 const char *		str,
-						 const SwfdecAsValue *	val);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_date.c b/libswfdec/swfdec_as_date.c
deleted file mode 100644
index 890d274..0000000
--- a/libswfdec/swfdec_as_date.c
+++ /dev/null
@@ -1,1162 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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 <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "swfdec_as_date.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_object.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_system.h"
-#include "swfdec_player_internal.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsDate, swfdec_as_date, SWFDEC_TYPE_AS_OBJECT)
-
-/*
- * Class functions
- */
-
-static void
-swfdec_as_date_class_init (SwfdecAsDateClass *klass)
-{
-}
-
-static void
-swfdec_as_date_init (SwfdecAsDate *date)
-{
-}
-
-/*** Helper functions ***/
-
-/* Kind of replacement for gmtime_r, timegm that works the way Flash works */
-
-#define MILLISECONDS_PER_SECOND 1000
-#define SECONDS_PER_MINUTE 60
-#define MINUTES_PER_HOUR 60
-#define HOURS_PER_DAY 24
-#define MONTHS_PER_YEAR 12
-
-#define MILLISECONDS_PER_MINUTE 60000
-#define MILLISECONDS_PER_HOUR 3600000
-#define MILLISECONDS_PER_DAY 86400000
-
-static const int month_offsets[2][13] = {
-  // Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec  Total
-  {    0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
-  {    0,  31,  60,  91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
-};
-
-typedef struct {
-  int milliseconds;
-  int seconds;
-  int minutes;
-  int hours;
-  int day_of_month;
-  int month;
-  int year;
-
-  int day_of_week;
-} BrokenTime;
-
-static int
-swfdec_as_date_days_in_year (int year)
-{
-  if (year % 4) {
-    return 365;
-  } else if (year % 100) {
-    return 366;
-  } else if (year % 400) {
-    return 365;
-  } else {
-    return 366;
-  }
-}
-
-#define IS_LEAP(year) (swfdec_as_date_days_in_year ((year)) == 366)
-
-static double
-swfdec_as_date_days_since_utc_for_year (int year)
-{
-  double year_big = year;
-
-  return (
-      365 * (year_big - 1970) +
-      floor (((year_big - 1969) / 4.0f)) -
-      floor (((year_big - 1901) / 100.0f)) +
-      floor (((year_big - 1601) / 400.0f))
-    );
-}
-
-static int
-swfdec_as_date_days_from_utc_to_year (double days)
-{
-  int low, high, pivot;
-
-  low = floor ((days >= 0 ? days / 366.0 : days / 365.0)) + 1970;
-  high = ceil ((days >= 0 ? days / 365.0 : days / 366.0)) + 1970;
-
-  while (low < high) {
-    pivot = ((double)low + (double)high) / 2.0;
-
-    if (swfdec_as_date_days_since_utc_for_year (pivot) <= days) {
-      if (swfdec_as_date_days_since_utc_for_year (pivot + 1) > days) {
-	high = low = pivot;
-      } else {
-	low = pivot + 1;
-      }
-    } else {
-      high = pivot - 1;
-    }
-  }
-
-  return low;
-}
-
-static void
-swfdec_as_date_milliseconds_to_brokentime (double milliseconds,
-    BrokenTime *brokentime)
-{
-  double remaining;
-  int year;
-
-  g_assert (brokentime != NULL);
-
-  /* special case: hours are calculated from different value */
-  if (isfinite (milliseconds)) {
-    remaining = floor (milliseconds + 0.5);
-  } else {
-    remaining = 0;
-  }
-
-  remaining = floor (remaining / MILLISECONDS_PER_HOUR);
-  brokentime->hours = fmod (remaining, HOURS_PER_DAY);
-
-  /* hours done, on with the rest */
-  if (isfinite (milliseconds)) {
-    remaining = milliseconds;
-  } else {
-    remaining = 0;
-  }
-
-  brokentime->milliseconds = fmod (remaining, MILLISECONDS_PER_SECOND);
-  remaining = floor (remaining / MILLISECONDS_PER_SECOND);
-
-  brokentime->seconds = fmod (remaining, SECONDS_PER_MINUTE);
-  remaining = floor (remaining / SECONDS_PER_MINUTE);
-
-  brokentime->minutes = fmod (remaining, MINUTES_PER_HOUR);
-  remaining = floor (remaining / MINUTES_PER_HOUR);
-  remaining = floor (remaining / HOURS_PER_DAY);
-
-  if (milliseconds < 0) {
-    if (brokentime->milliseconds < 0)
-      brokentime->milliseconds += MILLISECONDS_PER_SECOND;
-    if (brokentime->seconds < 0)
-      brokentime->seconds += SECONDS_PER_MINUTE;
-    if (brokentime->minutes < 0)
-      brokentime->minutes += MINUTES_PER_HOUR;
-    if (brokentime->hours < 0)
-      brokentime->hours += HOURS_PER_DAY;
-  }
-
-  // now remaining == days since 1970
-
-  if (isfinite (milliseconds)) {
-    brokentime->day_of_week = fmod ((remaining + 4), 7);
-    if (brokentime->day_of_week < 0)
-      brokentime->day_of_week += 7;
-  } else {
-    // special case
-    brokentime->day_of_week = 0;
-  }
-
-  year = swfdec_as_date_days_from_utc_to_year (remaining);
-  brokentime->year = year - 1900;
-
-  remaining -= swfdec_as_date_days_since_utc_for_year (year);
-  g_assert (remaining >= 0 && remaining <= 365);
-
-  brokentime->month = 0;
-  while (month_offsets[IS_LEAP (year)][brokentime->month + 1] <= remaining)
-    brokentime->month++;
-
-  brokentime->day_of_month =
-    remaining - month_offsets[IS_LEAP (year)][brokentime->month] + 1;
-}
-
-static double
-swfdec_as_date_brokentime_to_milliseconds (const BrokenTime *brokentime)
-{
-  double milliseconds;
-  int month, year;
-
-  year = 1900 + brokentime->year;
-
-  milliseconds = brokentime->milliseconds;
-  milliseconds += brokentime->seconds * MILLISECONDS_PER_SECOND;
-  milliseconds += brokentime->minutes * MILLISECONDS_PER_MINUTE;
-  milliseconds += brokentime->hours * MILLISECONDS_PER_HOUR;
-  milliseconds += (double)(brokentime->day_of_month - 1) * MILLISECONDS_PER_DAY;
-
-  milliseconds +=
-    swfdec_as_date_days_since_utc_for_year (year) * MILLISECONDS_PER_DAY;
-
-  for (month = brokentime->month; month < 0; month += MONTHS_PER_YEAR) {
-    milliseconds -=
-      (double)month_offsets[IS_LEAP (--year)][MONTHS_PER_YEAR] * MILLISECONDS_PER_DAY;
-  }
-
-  for (month = month; month >= MONTHS_PER_YEAR; month -= MONTHS_PER_YEAR) {
-    milliseconds +=
-      (double)month_offsets[IS_LEAP (year++)][MONTHS_PER_YEAR] * MILLISECONDS_PER_DAY;
-  }
-
-  milliseconds += (double)month_offsets[IS_LEAP (year)][month] * MILLISECONDS_PER_DAY;
-
-  return milliseconds;
-}
-
-/* Wrappers for swfdec_as_value_to_number because we need both double and int
- * often, and need to generate the right valueOf etc. */
-
-// returns TRUE if d is not Infinite or NAN
-static gboolean
-swfdec_as_date_value_to_number_and_integer_floor (SwfdecAsContext *context,
-    const SwfdecAsValue *value, double *d, int *num)
-{
-  *d = swfdec_as_value_to_number (context, value);
-  if (!isfinite (*d)) {
-    *num = 0;
-    return FALSE;
-  }
-
-  *num = floor (*d);
-  return TRUE;
-}
-
-// returns TRUE if d is not Infinite or NAN
-static gboolean
-swfdec_as_date_value_to_number_and_integer (SwfdecAsContext *context,
-    const SwfdecAsValue *value, double *d, int *num)
-{
-  g_assert (d != NULL);
-  g_assert (num != NULL);
-
-  // undefined == NAN here, even in version < 7
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (value)) {
-    *d = NAN;
-  } else {
-    *d = swfdec_as_value_to_number (context, value);
-  }
-  if (!isfinite (*d)) {
-    *num = 0;
-    return FALSE;
-  }
-
-  if (*d < 0) {
-    *num = - (guint) fmod (-*d, 4294967296);
-  } else {
-    *num =  (guint) fmod (*d, 4294967296);
-  }
-  return TRUE;
-}
-
-/* The functions to query/modify the current time */
-
-// returns TRUE with Infinite and -Infinite, because those values should be
-// handles like 0 that is returned by below functions
-static gboolean
-swfdec_as_date_is_valid (const SwfdecAsDate *date)
-{
-  return !isnan (date->milliseconds);
-}
-
-static void
-swfdec_as_date_set_invalid (SwfdecAsDate *date)
-{
-  date->milliseconds = NAN;
-}
-
-static double
-swfdec_as_date_get_milliseconds_utc (const SwfdecAsDate *date)
-{
-  g_assert (swfdec_as_date_is_valid (date));
-
-  if (isfinite (date->milliseconds)) {
-    return date->milliseconds;
-  } else {
-    return 0;
-  }
-}
-
-static void
-swfdec_as_date_set_milliseconds_utc (SwfdecAsDate *date, double milliseconds)
-{
-  date->milliseconds = milliseconds;
-}
-
-/*static double
-swfdec_as_date_get_milliseconds_local (const SwfdecAsDate *date)
-{
-  g_assert (swfdec_as_date_is_valid (date));
-
-  if (isfinite (date->milliseconds)) {
-    return date->milliseconds + (double) date->utc_offset * 60 * 1000;
-  } else {
-    return 0;
-  }
-}*/
-
-static void
-swfdec_as_date_set_milliseconds_local (SwfdecAsDate *date, double milliseconds)
-{
-  date->milliseconds =
-    milliseconds - (double) date->utc_offset * 60 * 1000;
-}
-
-static void
-swfdec_as_date_get_brokentime_utc (const SwfdecAsDate *date,
-    BrokenTime *brokentime)
-{
-  g_assert (swfdec_as_date_is_valid (date));
-
-  swfdec_as_date_milliseconds_to_brokentime (date->milliseconds, brokentime);
-}
-
-static void
-swfdec_as_date_set_brokentime_utc (SwfdecAsDate *date, BrokenTime *brokentime)
-{
-  date->milliseconds = swfdec_as_date_brokentime_to_milliseconds (brokentime);
-}
-
-static void
-swfdec_as_date_get_brokentime_local (const SwfdecAsDate *date,
-    BrokenTime *brokentime)
-{
-  g_assert (swfdec_as_date_is_valid (date));
-
-  swfdec_as_date_milliseconds_to_brokentime (
-      date->milliseconds + date->utc_offset * 60 * 1000, brokentime);
-}
-
-static void
-swfdec_as_date_set_brokentime_local (SwfdecAsDate *date, BrokenTime *brokentime)
-{
-  date->milliseconds = swfdec_as_date_brokentime_to_milliseconds (brokentime) -
-    date->utc_offset * 60 * 1000;
-}
-
-/* set and get function helpers */
-
-typedef enum {
-  FIELD_MILLISECONDS,
-  FIELD_SECONDS,
-  FIELD_MINUTES,
-  FIELD_HOURS,
-  FIELD_WEEK_DAYS,
-  FIELD_MONTH_DAYS,
-  FIELD_MONTHS,
-  FIELD_YEAR,
-  FIELD_FULL_YEAR
-} field_t;
-
-static int field_offsets[] = {
-  G_STRUCT_OFFSET (BrokenTime, milliseconds),
-  G_STRUCT_OFFSET (BrokenTime, seconds),
-  G_STRUCT_OFFSET (BrokenTime, minutes),
-  G_STRUCT_OFFSET (BrokenTime, hours),
-  G_STRUCT_OFFSET (BrokenTime, day_of_week),
-  G_STRUCT_OFFSET (BrokenTime, day_of_month),
-  G_STRUCT_OFFSET (BrokenTime, month),
-  G_STRUCT_OFFSET (BrokenTime, year),
-  G_STRUCT_OFFSET (BrokenTime, year)
-};
-
-static int
-swfdec_as_date_get_brokentime_value (SwfdecAsDate *date, gboolean utc,
-    int field_offset)
-{
-  BrokenTime brokentime;
-
-  if (utc) {
-    swfdec_as_date_get_brokentime_utc (date, &brokentime);
-  } else {
-    swfdec_as_date_get_brokentime_local (date, &brokentime);
-  }
-
-  return G_STRUCT_MEMBER (int, &brokentime, field_offset);
-}
-
-static void
-swfdec_as_date_set_brokentime_value (SwfdecAsDate *date, gboolean utc,
-    int field_offset, SwfdecAsContext *cx, int number)
-{
-  BrokenTime brokentime;
-
-  if (utc) {
-    swfdec_as_date_get_brokentime_utc (date, &brokentime);
-  } else {
-    swfdec_as_date_get_brokentime_local (date, &brokentime);
-  }
-
-  G_STRUCT_MEMBER (int, &brokentime, field_offset) = number;
-
-  if (utc) {
-    swfdec_as_date_set_brokentime_utc (date, &brokentime);
-  } else {
-    swfdec_as_date_set_brokentime_local (date, &brokentime);
-  }
-}
-
-static void
-swfdec_as_date_set_field (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret, field_t field,
-    gboolean utc)
-{
-  SwfdecAsDate *date;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  if (!swfdec_as_date_is_valid (date))
-    swfdec_as_value_to_number (cx, &argv[0]); // calls valueOf
-
-  if (swfdec_as_date_is_valid (date) && argc > 0)
-  {
-    gboolean set;
-    double milliseconds;
-    double d;
-    int number;
-
-    set = TRUE;
-    swfdec_as_date_value_to_number_and_integer (cx, &argv[0], &d, &number);
-
-    switch (field) {
-      case FIELD_MONTHS:
-	if (!isfinite (d)) {
-	  if (!isnan (d)) {
-	    swfdec_as_date_set_brokentime_value (date, utc,
-		field_offsets[FIELD_YEAR], cx, 0 - 1900);
-	  }
-	  swfdec_as_date_set_brokentime_value (date, utc, field_offsets[field],
-	      cx, 0);
-	  set = FALSE;
-	}
-	break;
-      case FIELD_YEAR:
-	// NOTE: Test against double, not the integer
-	if (d >= 100 || d < 0)
-	  number -= 1900;
-	// fall trough
-      case FIELD_FULL_YEAR:
-	if (!isfinite (d)) {
-	  swfdec_as_date_set_brokentime_value (date, utc, field_offsets[field],
-	      cx, 0 - 1900);
-	  set = FALSE;
-	}
-	break;
-      case FIELD_MILLISECONDS:
-      case FIELD_SECONDS:
-      case FIELD_MINUTES:
-      case FIELD_HOURS:
-      case FIELD_WEEK_DAYS:
-      case FIELD_MONTH_DAYS:
-	if (!isfinite (d)) {
-	  swfdec_as_date_set_invalid (date);
-	  set = FALSE;
-	}
-	break;
-      default:
-	g_assert_not_reached ();
-    }
-
-    if (set) {
-      swfdec_as_date_set_brokentime_value (date, utc, field_offsets[field], cx,
-	  number);
-    }
-
-    if (swfdec_as_date_is_valid (date)) {
-      milliseconds = swfdec_as_date_get_milliseconds_utc (date);
-      if (milliseconds < -8.64e15 || milliseconds > 8.64e15)
-	swfdec_as_date_set_invalid (date);
-    }
-  }
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, date->milliseconds);
-}
-
-static void
-swfdec_as_date_get_field (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret, field_t field,
-    gboolean utc)
-{
-  SwfdecAsDate *date;
-  int number;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  if (!swfdec_as_date_is_valid (date)) {
-    SWFDEC_AS_VALUE_SET_NUMBER (ret, NAN);
-    return;
-  }
-
-  number = swfdec_as_date_get_brokentime_value (date, utc,
-      field_offsets[field]);
-
-  if (field == FIELD_FULL_YEAR)
-    number += 1900;
-
-  SWFDEC_AS_VALUE_SET_INT (ret, number);
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_NATIVE (103, 19, swfdec_as_date_toString)
-void
-swfdec_as_date_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  static const char *weekday_names[] =
-    { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-  static const char *month_names[] =
-    { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-      "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-  SwfdecAsDate *date;
-  BrokenTime brokentime;
-  char *result;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  if (!swfdec_as_date_is_valid (date)) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, "Invalid Date");
-    return;
-  }
-
-  swfdec_as_date_get_brokentime_local (date, &brokentime);
-
-  result = g_strdup_printf ("%s %s %i %02i:%02i:%02i GMT%+03i%02i %i",
-      weekday_names[brokentime.day_of_week % 7],
-      month_names[brokentime.month % 12],
-      brokentime.day_of_month,
-      brokentime.hours, brokentime.minutes, brokentime.seconds,
-      date->utc_offset / 60, ABS (date->utc_offset % 60),
-      1900 + brokentime.year);
-
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx, result));
-}
-
-SWFDEC_AS_NATIVE (103, 16, swfdec_as_date_getTime)
-void
-swfdec_as_date_getTime (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsDate *date;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, date->milliseconds);
-}
-
-SWFDEC_AS_NATIVE (103, 18, swfdec_as_date_getTimezoneOffset)
-void
-swfdec_as_date_getTimezoneOffset (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsDate *date;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  // reverse of utc_offset
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, -(date->utc_offset));
-}
-
-// get* functions
-
-SWFDEC_AS_NATIVE (103, 8, swfdec_as_date_getMilliseconds)
-void
-swfdec_as_date_getMilliseconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MILLISECONDS,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 8, swfdec_as_date_getUTCMilliseconds)
-void
-swfdec_as_date_getUTCMilliseconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MILLISECONDS,
-      TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 7, swfdec_as_date_getSeconds)
-void
-swfdec_as_date_getSeconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_SECONDS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 7, swfdec_as_date_getUTCSeconds)
-void
-swfdec_as_date_getUTCSeconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_SECONDS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 6, swfdec_as_date_getMinutes)
-void
-swfdec_as_date_getMinutes (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MINUTES, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 6, swfdec_as_date_getUTCMinutes)
-void
-swfdec_as_date_getUTCMinutes (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MINUTES, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 5, swfdec_as_date_getHours)
-void
-swfdec_as_date_getHours (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_HOURS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 5, swfdec_as_date_getUTCHours)
-void
-swfdec_as_date_getUTCHours (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_HOURS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 4, swfdec_as_date_getDay)
-void
-swfdec_as_date_getDay (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
-    SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_WEEK_DAYS,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 4, swfdec_as_date_getUTCDay)
-void
-swfdec_as_date_getUTCDay (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_WEEK_DAYS,
-      TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 3, swfdec_as_date_getDate)
-void
-swfdec_as_date_getDate (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MONTH_DAYS,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 3, swfdec_as_date_getUTCDate)
-void
-swfdec_as_date_getUTCDate (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MONTH_DAYS,
-      TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 2, swfdec_as_date_getMonth)
-void
-swfdec_as_date_getMonth (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MONTHS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 2, swfdec_as_date_getUTCMonth)
-void
-swfdec_as_date_getUTCMonth (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_MONTHS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 1, swfdec_as_date_getYear)
-void
-swfdec_as_date_getYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_YEAR, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 1, swfdec_as_date_getUTCYear)
-void
-swfdec_as_date_getUTCYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_YEAR, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 0, swfdec_as_date_getFullYear)
-void
-swfdec_as_date_getFullYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_FULL_YEAR,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 0, swfdec_as_date_getUTCFullYear)
-void
-swfdec_as_date_getUTCFullYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_get_field (cx, object, argc, argv, ret, FIELD_FULL_YEAR,
-      TRUE);
-}
-
-// set* functions
-
-SWFDEC_AS_NATIVE (103, 17, swfdec_as_date_setTime)
-void
-swfdec_as_date_setTime (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsDate *date;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_DATE, &date, "");
-
-  if (argc > 0) {
-    swfdec_as_date_set_milliseconds_utc (date,
-	swfdec_as_value_to_integer (cx, &argv[0]));
-  }
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, date->milliseconds);
-}
-
-SWFDEC_AS_NATIVE (103, 15, swfdec_as_date_setMilliseconds)
-void
-swfdec_as_date_setMilliseconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MILLISECONDS,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 15, swfdec_as_date_setUTCMilliseconds)
-void
-swfdec_as_date_setUTCMilliseconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MILLISECONDS,
-      TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 14, swfdec_as_date_setSeconds)
-void
-swfdec_as_date_setSeconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_SECONDS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 14, swfdec_as_date_setUTCSeconds)
-void
-swfdec_as_date_setUTCSeconds (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_SECONDS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 13, swfdec_as_date_setMinutes)
-void
-swfdec_as_date_setMinutes (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MINUTES, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 13, swfdec_as_date_setUTCMinutes)
-void
-swfdec_as_date_setUTCMinutes (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MINUTES, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 12, swfdec_as_date_setHours)
-void
-swfdec_as_date_setHours (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_HOURS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 12, swfdec_as_date_setUTCHours)
-void
-swfdec_as_date_setUTCHours (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_HOURS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 11, swfdec_as_date_setDate)
-void
-swfdec_as_date_setDate (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MONTH_DAYS,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 11, swfdec_as_date_setUTCDate)
-void
-swfdec_as_date_setUTCDate (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MONTH_DAYS,
-      TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 10, swfdec_as_date_setMonth)
-void
-swfdec_as_date_setMonth (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MONTHS, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 10, swfdec_as_date_setUTCMonth)
-void
-swfdec_as_date_setUTCMonth (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_MONTHS, TRUE);
-}
-
-SWFDEC_AS_NATIVE (103, 20, swfdec_as_date_setYear)
-void
-swfdec_as_date_setYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_YEAR, FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 9, swfdec_as_date_setFullYear)
-void
-swfdec_as_date_setFullYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_FULL_YEAR,
-      FALSE);
-}
-
-SWFDEC_AS_NATIVE (103, 128 + 9, swfdec_as_date_setUTCFullYear)
-void
-swfdec_as_date_setUTCFullYear (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  swfdec_as_date_set_field (cx, object, argc, argv, ret, FIELD_FULL_YEAR,
-      TRUE);
-}
-
-// Static methods
-
-SWFDEC_AS_NATIVE (103, 257, swfdec_as_date_UTC)
-void
-swfdec_as_date_UTC (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
-    SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint i;
-  int year, num;
-  double d;
-  BrokenTime brokentime;
-
-  // special case: ignore undefined and everything after it
-  for (i = 0; i < argc; i++) {
-    if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[i])) {
-      argc = i;
-      break;
-    }
-  }
-
-  memset (&brokentime, 0, sizeof (brokentime));
-
-  if (argc > 0) {
-    if (swfdec_as_date_value_to_number_and_integer_floor (cx, &argv[0], &d,
-	  &num)) {
-      year = num;
-    } else {
-      // special case: if year is not finite set it to -1900
-      year = -1900;
-    }
-  } else {
-    return;
-  }
-
-  // if we don't got atleast two values, return undefined
-  // do it only here, so valueOf first arg is called
-  if (argc < 2) 
-    return;
-
-  if (swfdec_as_date_value_to_number_and_integer (cx, &argv[1], &d,
-	&num)) {
-    brokentime.month = num;
-  } else {
-    // special case: if month is not finite set year to -1900
-    year = -1900;
-    brokentime.month = 0;
-  }
-
-  if (argc > 2) {
-    if (swfdec_as_date_value_to_number_and_integer (cx, &argv[2], &d,
-	  &num)) {
-      brokentime.day_of_month = num;
-    } else {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-      return;
-    }
-  } else {
-    brokentime.day_of_month = 1;
-  }
-
-  if (argc > 3) {
-    if (swfdec_as_date_value_to_number_and_integer (cx, &argv[3], &d,
-	  &num)) {
-      brokentime.hours = num;
-    } else {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-      return;
-    }
-  }
-
-  if (argc > 4) {
-    if (swfdec_as_date_value_to_number_and_integer (cx, &argv[4], &d,
-	  &num)) {
-      brokentime.minutes = num;
-    } else {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-      return;
-    }
-  }
-
-  if (argc > 5) {
-    if (swfdec_as_date_value_to_number_and_integer (cx, &argv[5], &d,
-	  &num)) {
-      brokentime.seconds = num;
-    } else {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-      return;
-    }
-  }
-
-  if (year >= 100) {
-    brokentime.year = year - 1900;
-  } else {
-    brokentime.year = year;
-  }
-
-  if (argc > 6) {
-    if (swfdec_as_date_value_to_number_and_integer (cx, &argv[6], &d,
-	  &num)) {
-      brokentime.milliseconds = num;
-    } else {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-      return;
-    }
-  }
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret,
-      swfdec_as_date_brokentime_to_milliseconds (&brokentime));
-}
-
-// Constructor
-
-SWFDEC_AS_CONSTRUCTOR (103, 256, swfdec_as_date_construct, swfdec_as_date_get_type)
-void
-swfdec_as_date_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint i;
-  SwfdecAsDate *date;
-
-  if (!cx->frame->construct) {
-    SwfdecAsValue val;
-    if (!swfdec_as_context_use_mem (cx, sizeof (SwfdecAsDate)))
-      return;
-    object = g_object_new (SWFDEC_TYPE_AS_DATE, NULL);
-    swfdec_as_object_add (object, cx, sizeof (SwfdecAsDate));
-    swfdec_as_object_get_variable (cx->global, SWFDEC_AS_STR_Date, &val);
-    if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-      swfdec_as_object_set_constructor (object,
-	  SWFDEC_AS_VALUE_GET_OBJECT (&val));
-    } else {
-      SWFDEC_INFO ("\"Date\" is not an object");
-    }
-  }
-
-  date = SWFDEC_AS_DATE (object);
-
-  /* FIXME: find a general solution here */
-  if (SWFDEC_IS_PLAYER (SWFDEC_AS_OBJECT (date)->context)) {
-    date->utc_offset =
-      SWFDEC_PLAYER (SWFDEC_AS_OBJECT (date)->context)->priv->system->utc_offset;
-  }
-
-  // don't accept arguments when not constructing
-  if (!cx->frame->construct)
-    argc = 0;
-
-  // special case: ignore undefined and everything after it
-  for (i = 0; i < argc; i++) {
-    if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[i])) {
-      argc = i;
-      break;
-    }
-  }
-
-  if (argc == 0) // current time, local
-  {
-    GTimeVal tv;
-
-    swfdec_as_context_get_time (cx, &tv);
-    swfdec_as_date_set_milliseconds_utc (date,
-	tv.tv_sec * 1000.0 + tv.tv_usec / 1000.0);
-  }
-  else if (argc == 1) // milliseconds from epoch, local
-  {
-    // need to save directly to keep fractions of a milliseconds
-    date->milliseconds = swfdec_as_value_to_number (cx, &argv[0]);
-  }
-  else // year, month etc. local
-  {
-    int year, num;
-    double d;
-    BrokenTime brokentime;
-
-    date->milliseconds = 0;
-
-    memset (&brokentime, 0, sizeof (brokentime));
-
-    i = 0;
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer_floor (cx, &argv[i++], &d,
-	    &num)) {
-	year = num;
-      } else {
-	// special case: if year is not finite set it to -1900
-	year = -1900;
-      }
-    } else {
-      year = -1900;
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.month = num;
-      } else {
-	// special case: if month is not finite set year to -1900
-	year = -1900;
-	brokentime.month = 0;
-      }
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.day_of_month = num;
-      } else {
-	date->milliseconds = d;
-      }
-    } else {
-      brokentime.day_of_month = 1;
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.hours = num;
-      } else {
-	date->milliseconds = d;
-      }
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.minutes = num;
-      } else {
-	date->milliseconds = d;
-      }
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.seconds = num;
-      } else {
-	date->milliseconds = d;
-      }
-    }
-
-    if (year >= 100) {
-      brokentime.year = year - 1900;
-    } else {
-      brokentime.year = year;
-    }
-
-    if (argc > i) {
-      if (swfdec_as_date_value_to_number_and_integer (cx, &argv[i++], &d,
-	    &num)) {
-	brokentime.milliseconds += num;
-      } else {
-	date->milliseconds = d;
-      }
-    }
-
-    if (date->milliseconds == 0) {
-      swfdec_as_date_set_milliseconds_local (date,
-	  swfdec_as_date_brokentime_to_milliseconds (&brokentime));
-    }
-  }
-
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-}
diff --git a/libswfdec/swfdec_as_date.h b/libswfdec/swfdec_as_date.h
deleted file mode 100644
index b095520..0000000
--- a/libswfdec/swfdec_as_date.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_AS_DATE_H_
-#define _SWFDEC_AS_DATE_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsDate SwfdecAsDate;
-typedef struct _SwfdecAsDateClass SwfdecAsDateClass;
-
-#define SWFDEC_TYPE_AS_DATE                    (swfdec_as_date_get_type())
-#define SWFDEC_IS_AS_DATE(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_DATE))
-#define SWFDEC_IS_AS_DATE_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_DATE))
-#define SWFDEC_AS_DATE(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_DATE, SwfdecAsDate))
-#define SWFDEC_AS_DATE_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_DATE, SwfdecAsDateClass))
-#define SWFDEC_AS_DATE_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_DATE, SwfdecAsDateClass))
-
-struct _SwfdecAsDate {
-  SwfdecAsObject	object;
-
-  // time from epoch in UTC
-  double		milliseconds;
-
-  // the difference between local timezone and UTC in minutes
-  int			utc_offset;
-};
-
-struct _SwfdecAsDateClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-GType		swfdec_as_date_get_type	(void);
-
-SwfdecAsObject *swfdec_as_date_new		(SwfdecAsContext *	context);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_debugger.c b/libswfdec/swfdec_as_debugger.c
deleted file mode 100644
index d9f34f3..0000000
--- a/libswfdec/swfdec_as_debugger.c
+++ /dev/null
@@ -1,82 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "swfdec_as_debugger.h"
-#include "swfdec_as_context.h"
-
-G_DEFINE_TYPE (SwfdecAsDebugger, swfdec_as_debugger, G_TYPE_OBJECT)
-
-/**
- * SECTION:SwfdecAsDebugger
- * @title: SwfdecAsDebugger
- * @short_description: the debugger object
- * @see also: SwfdecAsContext
- *
- * The debugger object is a special object that can be set on a #SwfdecAsContext
- * upon creation. If that is done, the debugger can then be used to inspect the 
- * running Actionscript application.
- */
-
-/**
- * SwfdecAsDebugger
- *
- * This is the type of the debugger object.
- */
-
-/**
- * SwfdecAsDebuggerClass:
- * @add: Called whenever an object is added to the garbage collection engine 
- *       using swfdec_as_object_add ()
- * @remove: Called whenever an object is about to be collected by the garbage 
- *          collector.
- * @step: This function is called everytime just before a bytecode is executed 
- *        by the script engine. So it's very powerful, but can also slow down 
- *        the script engine a lot.
- * @enter_frame: Called after a new #SwfdecAsFrame has been initialized and 
- *               pushed to the top of the execution stack.
- * @leave_frame: Called just after a #SwfdecAsFrame has been removed from the
- *		  execution stack. The return value has not been forwarded to
- *		  the parent when this function is called.
- * @set_variable: Called whenever swfdec_as_object_set_variable() is called, 
- *                before actually setting the variable. This function is also
- *                called when variables are set by internal code, not just when
- *                interpreting scripts. It also doesn't matter if setting the 
- *                variable will succeed. 
- *
- * The class object for the debugger. You need to override these functions to 
- * get useful functionality for the debugger.
- */
-
-static void
-swfdec_as_debugger_class_init (SwfdecAsDebuggerClass *klass)
-{
-}
-
-static void
-swfdec_as_debugger_init (SwfdecAsDebugger *debugger)
-{
-}
-
diff --git a/libswfdec/swfdec_as_debugger.h b/libswfdec/swfdec_as_debugger.h
deleted file mode 100644
index 2e2c0e7..0000000
--- a/libswfdec/swfdec_as_debugger.h
+++ /dev/null
@@ -1,80 +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_AS_DEBUGGER_H_
-#define _SWFDEC_AS_DEBUGGER_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsDebuggerClass SwfdecAsDebuggerClass;
-
-#define SWFDEC_TYPE_AS_DEBUGGER                    (swfdec_as_debugger_get_type())
-#define SWFDEC_IS_AS_DEBUGGER(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_DEBUGGER))
-#define SWFDEC_IS_AS_DEBUGGER_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_DEBUGGER))
-#define SWFDEC_AS_DEBUGGER(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_DEBUGGER, SwfdecAsDebugger))
-#define SWFDEC_AS_DEBUGGER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_DEBUGGER, SwfdecAsDebuggerClass))
-#define SWFDEC_AS_DEBUGGER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_DEBUGGER, SwfdecAsDebuggerClass))
-
-struct _SwfdecAsDebugger {
-  /*< private >*/
-  GObject		object;
-};
-
-struct _SwfdecAsDebuggerClass {
-  /*< private >*/
-  GObjectClass		object_class;
-
-  /*< public >*/
-  /* a new object was added to the GC */
-  void			(* add)		(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context,
-					 SwfdecAsObject *	object);
-  /* an object was removed from the GC */
-  void			(* remove)    	(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context,
-					 SwfdecAsObject *	object);
-  /* called before executing a bytecode */
-  void			(* step)	(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context);
-  /* called after adding a frame from the function stack */
-  void			(* enter_frame)	(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context,
-					 SwfdecAsFrame *	frame);
-  /* called after removing a frame from the function stack */
-  void			(* leave_frame)	(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context,
-					 SwfdecAsFrame *	frame,
-					 const SwfdecAsValue *	return_value);
-  /* called before setting a variable */
-  void			(* set_variable)(SwfdecAsDebugger *	debugger,
-					 SwfdecAsContext *	context,
-					 SwfdecAsObject *	object,
-					 const char *		variable,
-					 const SwfdecAsValue *	value);
-};
-
-GType		swfdec_as_debugger_get_type	(void);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
deleted file mode 100644
index 39888b6..0000000
--- a/libswfdec/swfdec_as_frame.c
+++ /dev/null
@@ -1,895 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_frame.h"
-#include "swfdec_as_array.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_super.h"
-#include "swfdec_debug.h"
-
-/**
- * SECTION:SwfdecAsFrame
- * @title: SwfdecAsFrame
- * @short_description: information about currently executing frames
- *
- * This section is only interesting for people that want to look into debugging.
- * A SwfdecAsFrame describes a currently executing function while it is
- * running. On every new function call, a new frame is created and pushed on top
- * of the frame stack. To get the topmost one, use 
- * swfdec_as_context_get_frame(). After that you can inspect various properties
- * of the frame, like the current stack.
- *
- * a #SwfdecAsFrame is a #SwfdecAsObject, so it is possible to set variables on
- * it. These are local variables inside the executing function. So you can use
- * functions such as swfdec_as_object_get_variable() to inspect them.
- */
-
-/**
- * SwfdecAsFrame:
- *
- * the object used to represent an executing function.
- */
-
-/*** STACK ITERATOR ***/
-
-/**
- * SwfdecAsStackIterator:
- *
- * This is a struct used to walk the stack of a frame. It is supposed to be 
- * allocated on the stack. All of its members are private.
- */
-
-/**
- * swfdec_as_stack_iterator_init_arguments:
- * @iter: iterator to be initialized
- * @frame: the frame to initialize from
- *
- * Initializes a stack iterator to walk the arguments passed to the given @frame. See
- * swfdec_as_stack_iterator_init() about suggested iterator usage.
- *
- * Returns: The value of the first argument
- **/
-SwfdecAsValue *
-swfdec_as_stack_iterator_init_arguments (SwfdecAsStackIterator *iter, SwfdecAsFrame *frame)
-{
-  SwfdecAsContext *context;
-
-  g_return_val_if_fail (iter != NULL, NULL);
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  if (frame->argc == 0) {
-    iter->i = iter->n = 0;
-    iter->stack = NULL;
-    iter->current = NULL;
-    return NULL;
-  }
-  context = SWFDEC_AS_OBJECT (frame)->context;
-  if (frame->argv) {
-    iter->stack = NULL;
-    iter->current = (SwfdecAsValue *) frame->argv;
-  } else {
-    SwfdecAsStack *stack = context->stack;
-    SwfdecAsValue *end;
-    iter->current = frame->stack_begin - 1;
-    end = context->cur;
-    while (iter->current < stack->elements ||
-	iter->current > end) {
-      stack = stack->next;
-      end = &stack->elements[stack->used_elements];
-    }
-    iter->stack = stack;
-  }
-  iter->i = 0;
-  iter->n = frame->argc;
-  return iter->current;
-}
-
-/**
- * swfdec_as_stack_iterator_init:
- * @iter: a #SwfdecStackIterator
- * @frame: the frame to initialize from
- *
- * Initializes @iter to walk the stack of @frame. The first value on the stack
- * will alread be returned. This makes it possible to write a simple loop to 
- * print the whole stack:
- * |[for (value = swfdec_as_stack_iterator_init (&amp;iter, frame); value != NULL;
- *     value = swfdec_as_stack_iterator_next (&amp;iter)) {
- *   char *s = swfdec_as_value_to_debug (value);
- *   g_print ("%s\n", s);
- *   g_free (s);
- * }]|
- *
- * Returns: the topmost value on the stack of @frame or %NULL if none
- **/
-SwfdecAsValue *
-swfdec_as_stack_iterator_init (SwfdecAsStackIterator *iter, SwfdecAsFrame *frame)
-{
-  SwfdecAsContext *context;
-  SwfdecAsStack *stack;
-
-  g_return_val_if_fail (iter != NULL, NULL);
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  context = SWFDEC_AS_OBJECT (frame)->context;
-  iter->i = 0;
-  stack = context->stack;
-  if (context->frame == frame) {
-    iter->current = context->cur;
-  } else {
-    SwfdecAsFrame *follow = context->frame;
-    while (follow->next != frame)
-      follow = follow->next;
-    iter->current = follow->stack_begin;
-    /* FIXME: get rid of arguments on stack */
-    while (iter->current < &stack->elements[0] || iter->current > &stack->elements[stack->n_elements]) {
-      stack = stack->next;
-      g_assert (stack);
-    }
-  }
-  iter->stack = stack;
-  /* figure out number of args */
-  iter->n = iter->current - &stack->elements[0];
-  while (frame->stack_begin < &stack->elements[0] && frame->stack_begin > &stack->elements[stack->n_elements]) {
-    iter->n += stack->used_elements;
-    stack = stack->next;
-  };
-  g_assert (iter->n >= (guint) (frame->stack_begin - &stack->elements[0]));
-  iter->n -= frame->stack_begin - &stack->elements[0];
-  if (iter->n == 0)
-    return NULL;
-  if (iter->current == &iter->stack->elements[0]) {
-    iter->stack = iter->stack->next;
-    g_assert (iter->stack);
-    iter->current = &iter->stack->elements[iter->stack->used_elements];
-  }
-  iter->current--;
-  return iter->current;
-}
-
-/**
- * swfdec_as_stack_iterator_next:
- * @iter: a #SwfdecAsStackIterator
- *
- * Gets the next value on the stack.
- *
- * Returns: The next value on the stack or %NULL if no more values are on the stack
- **/
-SwfdecAsValue *
-swfdec_as_stack_iterator_next (SwfdecAsStackIterator *iter)
-{
-  if (iter->i < iter->n)
-    iter->i++;
-  if (iter->i >= iter->n)
-    return NULL;
-  if (iter->stack) {
-    if (iter->current == &iter->stack->elements[0]) {
-      iter->stack = iter->stack->next;
-      g_assert (iter->stack);
-      iter->current = &iter->stack->elements[iter->stack->used_elements];
-    }
-    iter->current--;
-  } else {
-    iter->current++;
-  }
-  return iter->current;
-}
-
-/*** BLOCK HANDLING ***/
-
-typedef struct {
-  const guint8 *		start;	/* start of block */
-  const guint8 *		end;	/* end of block (hitting this address will exit the block) */
-  SwfdecAsFrameBlockFunc	func;	/* function to call when block is exited (or frame is destroyed) */
-  gpointer			data;	/* data to pass to function */
-} SwfdecAsFrameBlock;
-
-/**
- * swfdec_as_frame_push_block:
- * @frame: a #SwfdecAsFrame
- * @start: start of block
- * @end: byte after end of block
- * @func: function to call when block gets exited
- * @data: data to pass to @func
- *
- * Registers a function that guards a block of memory. When the function 
- * exits this block of memory, it will call this function. This can happen
- * either when the program counter leaves the guarded region, when the 
- * function returns or when the context aborted due to an unrecoverable error.
- **/
-void
-swfdec_as_frame_push_block (SwfdecAsFrame *frame, const guint8 *start, 
-    const guint8 *end, SwfdecAsFrameBlockFunc func, gpointer data)
-{
-  SwfdecAsFrameBlock block = { start, end, func, data };
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (start <= end);
-  g_return_if_fail (start >= frame->block_start);
-  g_return_if_fail (end <= frame->block_end);
-  g_return_if_fail (func != NULL);
-
-  frame->block_start = start;
-  frame->block_end = end;
-  g_array_append_val (frame->blocks, block);
-}
-
-void
-swfdec_as_frame_pop_block (SwfdecAsFrame *frame)
-{
-  SwfdecAsFrameBlockFunc func;
-  gpointer data;
-  SwfdecAsFrameBlock *block;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (frame->blocks->len > 0);
-
-  block = &g_array_index (frame->blocks, SwfdecAsFrameBlock, frame->blocks->len - 1);
-  func = block->func;
-  data = block->data;
-  g_array_set_size (frame->blocks, frame->blocks->len - 1);
-  if (frame->blocks->len) {
-    block--;
-    frame->block_start = block->start;
-    frame->block_end = block->end;
-  } else {
-    frame->block_start = frame->script->buffer->data;
-    frame->block_end = frame->script->buffer->data + frame->script->buffer->length;
-  }
-  /* only call function after we popped the block, so the block can push a new one */
-  func (frame, data);
-}
-
-/*** FRAME ***/
-
-G_DEFINE_TYPE (SwfdecAsFrame, swfdec_as_frame, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_as_frame_dispose (GObject *object)
-{
-  SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
-
-  /* pop blocks while state is intact */
-  while (frame->blocks->len > 0)
-    swfdec_as_frame_pop_block (frame);
-
-  /* clean up */
-  g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers);
-  if (frame->constant_pool) {
-    swfdec_constant_pool_free (frame->constant_pool);
-    frame->constant_pool = NULL;
-  }
-  if (frame->constant_pool_buffer) {
-    swfdec_buffer_unref (frame->constant_pool_buffer);
-    frame->constant_pool_buffer = NULL;
-  }
-  g_array_free (frame->blocks, TRUE);
-  g_slist_free (frame->scope_chain);
-  if (frame->script) {
-    swfdec_script_unref (frame->script);
-    frame->script = NULL;
-  }
-
-  G_OBJECT_CLASS (swfdec_as_frame_parent_class)->dispose (object);
-}
-
-static void
-swfdec_as_frame_mark (SwfdecAsObject *object)
-{
-  SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
-  guint i;
-
-  if (frame->next)
-    swfdec_as_object_mark (SWFDEC_AS_OBJECT (frame->next));
-  g_slist_foreach (frame->scope_chain, (GFunc) swfdec_as_object_mark, NULL);
-  if (frame->thisp)
-    swfdec_as_object_mark (frame->thisp);
-  if (frame->super)
-    swfdec_as_object_mark (frame->super);
-  swfdec_as_object_mark (frame->target);
-  swfdec_as_object_mark (frame->original_target);
-  if (frame->function)
-    swfdec_as_object_mark (SWFDEC_AS_OBJECT (frame->function));
-  for (i = 0; i < frame->n_registers; i++) {
-    swfdec_as_value_mark (&frame->registers[i]);
-  }
-  /* don't mark argv, it's const, others have to take care of it */
-  SWFDEC_AS_OBJECT_CLASS (swfdec_as_frame_parent_class)->mark (object);
-}
-
-static char *
-swfdec_as_frame_debug (SwfdecAsObject *object)
-{
-  SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object);
-  GString *string = g_string_new ("");
-  SwfdecAsStackIterator iter;
-  SwfdecAsValue *val;
-  char *s;
-  guint i;
-
-  if (frame->thisp) {
-    s = swfdec_as_object_get_debug (frame->thisp);
-    g_string_append (string, s);
-    g_string_append (string, ".");
-    g_free (s);
-  }
-  g_string_append (string, frame->function_name);
-  g_string_append (string, " (");
-  i = 0;
-  for (val = swfdec_as_stack_iterator_init_arguments (&iter, frame); val && i < 4;
-      val = swfdec_as_stack_iterator_next (&iter)) {
-    if (i > 0)
-      g_string_append (string, ", ");
-    i++;
-    if (i == 3 && frame->argc > 4) {
-      g_string_append (string, "...");
-    } else {
-      s = swfdec_as_value_to_debug (val);
-      g_string_append (string, s);
-      g_free (s);
-    }
-  }
-  g_string_append (string, ")");
-  return g_string_free (string, FALSE);
-}
-
-static void
-swfdec_as_frame_class_init (SwfdecAsFrameClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-
-  object_class->dispose = swfdec_as_frame_dispose;
-
-  asobject_class->mark = swfdec_as_frame_mark;
-  asobject_class->debug = swfdec_as_frame_debug;
-}
-
-static void
-swfdec_as_frame_init (SwfdecAsFrame *frame)
-{
-  frame->function_name = "unnamed";
-  frame->blocks = g_array_new (FALSE, FALSE, sizeof (SwfdecAsFrameBlock));
-  frame->block_end = (gpointer) -1;
-}
-
-static void
-swfdec_as_frame_load (SwfdecAsFrame *frame)
-{
-  SwfdecAsContext *context = SWFDEC_AS_OBJECT (frame)->context;
-
-  frame->stack_begin = context->cur;
-  context->base = frame->stack_begin;
-  frame->next = context->frame;
-  context->frame = frame;
-  context->call_depth++;
-}
-
-SwfdecAsFrame *
-swfdec_as_frame_new (SwfdecAsContext *context, SwfdecScript *script)
-{
-  SwfdecAsFrame *frame;
-  gsize size;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_return_val_if_fail (script != NULL, NULL);
-  
-  size = sizeof (SwfdecAsFrame) + sizeof (SwfdecAsValue) * script->n_registers;
-  if (!swfdec_as_context_use_mem (context, size))
-    return NULL;
-  frame = g_object_new (SWFDEC_TYPE_AS_FRAME, NULL);
-  swfdec_as_object_add (SWFDEC_AS_OBJECT (frame), context, size);
-  frame->script = swfdec_script_ref (script);
-  frame->function_name = script->name;
-  SWFDEC_DEBUG ("new frame for function %s", frame->function_name);
-  frame->pc = script->main;
-  frame->scope_chain = g_slist_prepend (frame->scope_chain, frame);
-  frame->n_registers = script->n_registers;
-  frame->registers = g_slice_alloc0 (sizeof (SwfdecAsValue) * frame->n_registers);
-  if (script->constant_pool) {
-    frame->constant_pool_buffer = swfdec_buffer_ref (script->constant_pool);
-    frame->constant_pool = swfdec_constant_pool_new_from_action (
-	script->constant_pool->data, script->constant_pool->length, script->version);
-    if (frame->constant_pool) {
-      swfdec_constant_pool_attach_to_context (frame->constant_pool, context);
-    } else {
-      SWFDEC_ERROR ("couldn't create constant pool");
-    }
-  }
-  swfdec_as_frame_load (frame);
-  return frame;
-}
-
-SwfdecAsFrame *
-swfdec_as_frame_new_native (SwfdecAsContext *context)
-{
-  SwfdecAsFrame *frame;
-  gsize size;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  
-  size = sizeof (SwfdecAsFrame);
-  if (!swfdec_as_context_use_mem (context, size))
-    return NULL;
-  frame = g_object_new (SWFDEC_TYPE_AS_FRAME, NULL);
-  SWFDEC_DEBUG ("new native frame");
-  swfdec_as_object_add (SWFDEC_AS_OBJECT (frame), context, size);
-  swfdec_as_frame_load (frame);
-  return frame;
-}
-
-/**
- * swfdec_as_frame_return:
- * @frame: a #SwfdecAsFrame that is currently executing.
- * @return_value: return value of the function or %NULL for none. An undefined
- *                value will be used in that case.
- *
- * Ends execution of the frame and instructs the frame's context to continue 
- * execution with its parent frame. This function may only be called on the
- * currently executing frame.
- **/
-void
-swfdec_as_frame_return (SwfdecAsFrame *frame, SwfdecAsValue *return_value)
-{
-  SwfdecAsContext *context;
-  SwfdecAsValue retval;
-  SwfdecAsFrame *next;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  context = SWFDEC_AS_OBJECT (frame)->context;
-  g_return_if_fail (frame == context->frame);
-
-  /* save return value in case it was on the stack somewhere */
-  if (frame->construct) {
-    SWFDEC_AS_VALUE_SET_OBJECT (&retval, frame->thisp);
-  } else if (return_value) {
-    retval = *return_value;
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (&retval);
-  }
-  /* pop frame and leftover stack */
-  next = frame->next;
-  context->frame = next;
-  g_assert (context->call_depth > 0);
-  context->call_depth--;
-  while (context->base > frame->stack_begin || 
-      context->end < frame->stack_begin)
-    swfdec_as_stack_pop_segment (context);
-  context->cur = frame->stack_begin;
-  /* setup stack for previous frame */
-  if (next) {
-    if (next->stack_begin >= &context->stack->elements[0] &&
-	next->stack_begin <= context->cur) {
-      context->base = next->stack_begin;
-    } else {
-      context->base = &context->stack->elements[0];
-    }
-  } else {
-    g_assert (context->stack->next == NULL);
-    context->base = &context->stack->elements[0];
-  }
-  /* pop argv if on stack */
-  if (frame->argv == NULL && frame->argc > 0) {
-    guint i = frame->argc;
-    while (TRUE) {
-      guint n = context->cur - context->base;
-      n = MIN (n, i);
-      swfdec_as_stack_pop_n (context, n);
-      i -= n;
-      if (i == 0)
-	break;
-      swfdec_as_stack_pop_segment (context);
-    }
-  }
-  if (context->debugger) {
-    SwfdecAsDebuggerClass *klass = SWFDEC_AS_DEBUGGER_GET_CLASS (context->debugger);
-
-    if (klass->leave_frame)
-      klass->leave_frame (context->debugger, context, frame, &retval);
-  }
-  /* set return value */
-  if (frame->return_value) {
-    *frame->return_value = retval;
-  } else {
-    swfdec_as_stack_ensure_free (context, 1);
-    *swfdec_as_stack_push (context) = retval;
-  }
-}
-
-/**
- * swfdec_as_frame_set_this:
- * @frame: a #SwfdecAsFrame
- * @thisp: object to use as the this object
- *
- * Sets the object to be used as this pointer. If this function is not called,
- * the this value will be undefined.
- * You may only call this function once per @frame and it must be called 
- * directly after creating the frame and before calling swfdec_as_frame_preload().
- **/
-void
-swfdec_as_frame_set_this (SwfdecAsFrame *frame, SwfdecAsObject *thisp)
-{
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (frame->thisp == NULL);
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (thisp));
-
-  g_assert (!SWFDEC_IS_AS_SUPER (thisp));
-  frame->thisp = thisp;
-  if (frame->target == NULL) {
-    frame->target = thisp;
-    frame->original_target = thisp;
-  }
-}
-
-/**
- * swfdec_as_frame_get_variable_and_flags:
- * @frame: a #SwfdecAsFrame
- * @variable: name of the variable
- * @value: pointer to take value of the variable or %NULL
- * @flags: pointer to take flags or %NULL
- * @pobject: pointer to take the actual object that held the variable or %NULL
- *
- * Walks the scope chain of @frame trying to resolve the given @variable and if
- * found, returns its value and flags. Note that there might be a difference 
- * between @pobject and the returned object, since the returned object will be
- * part of the scope chain while @pobject will contain the actual property. It
- * will be a prototype of the returned object though.
- *
- * Returns: Object in scope chain that contained the variable.
- **/
-SwfdecAsObject *
-swfdec_as_frame_get_variable_and_flags (SwfdecAsFrame *frame, const char *variable,
-    SwfdecAsValue *value, guint *flags, SwfdecAsObject **pobject)
-{
-  GSList *walk;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-  g_return_val_if_fail (variable != NULL, NULL);
-
-  for (walk = frame->scope_chain; walk; walk = walk->next) {
-    if (swfdec_as_object_get_variable_and_flags (walk->data, variable, value, 
-	  flags, pobject))
-      return walk->data;
-  }
-  /* we've walked the scope chain down. Now look in the special objects. */
-  /* 1) the target */
-  if (swfdec_as_object_get_variable_and_flags (frame->target, variable, value, 
-	flags, pobject))
-    return frame->target;
-  /* 2) the global object */
-  if (swfdec_as_object_get_variable_and_flags (
-	SWFDEC_AS_OBJECT (frame)->context->global, variable, value, flags, pobject))
-    return SWFDEC_AS_OBJECT (frame)->context->global;
-
-  return NULL;
-}
-
-void
-swfdec_as_frame_set_variable_and_flags (SwfdecAsFrame *frame, const char *variable,
-    const SwfdecAsValue *value, guint default_flags)
-{
-  SwfdecAsObject *pobject, *set;
-  GSList *walk;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (variable != NULL);
-
-  set = NULL;
-  for (walk = frame->scope_chain; walk; walk = walk->next) {
-    if (swfdec_as_object_get_variable_and_flags (walk->data, variable, NULL, NULL, &pobject) &&
-	pobject == walk->data) {
-      set = walk->data;
-      break;
-    }
-  }
-  if (set == NULL)
-    set = frame->target;
-
-  swfdec_as_object_set_variable_and_flags (set, variable, value, default_flags);
-}
-
-SwfdecAsDeleteReturn
-swfdec_as_frame_delete_variable (SwfdecAsFrame *frame, const char *variable)
-{
-  GSList *walk;
-  SwfdecAsDeleteReturn ret;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), FALSE);
-  g_return_val_if_fail (variable != NULL, FALSE);
-
-  for (walk = frame->scope_chain; walk; walk = walk->next) {
-    ret = swfdec_as_object_delete_variable (walk->data, variable);
-    if (ret)
-      return ret;
-  }
-  /* we've walked the scope chain down. Now look in the special objects. */
-  /* 1) the target set via SetTarget */
-  ret = swfdec_as_object_delete_variable (frame->target, variable);
-  if (ret)
-    return ret;
-  /* 2) the global object */
-  return swfdec_as_object_delete_variable (SWFDEC_AS_OBJECT (frame)->context->global, variable);
-}
-
-/**
- * swfdec_as_frame_set_target:
- * @frame: a #SwfdecAsFrame
- * @target: the new object to use as target or %NULL to unset
- *
- * Sets the new target to be used in this @frame. The target is a legacy 
- * Actionscript concept that is similar to "with". If you don't have to,
- * you shouldn't use this function.
- **/
-void
-swfdec_as_frame_set_target (SwfdecAsFrame *frame, SwfdecAsObject *target)
-{
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (target == NULL || SWFDEC_IS_AS_OBJECT (target));
-
-  if (target) {
-    frame->target = target;
-  } else {
-    frame->target = frame->original_target;
-  }
-}
-
-void
-swfdec_as_frame_preload (SwfdecAsFrame *frame)
-{
-  SwfdecAsObject *object, *args;
-  guint i, current_reg = 1;
-  SwfdecScript *script;
-  SwfdecAsValue val;
-  const SwfdecAsValue *cur;
-  SwfdecAsContext *context;
-  SwfdecAsStackIterator iter;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-
-
-  /* setup */
-  object = SWFDEC_AS_OBJECT (frame);
-  context = object->context;
-  script = frame->script;
-  if (frame->script == NULL)
-    goto out;
-
-  /* create arguments and super object if necessary */
-  if ((script->flags & (SWFDEC_SCRIPT_PRELOAD_ARGS | SWFDEC_SCRIPT_SUPPRESS_ARGS)) != SWFDEC_SCRIPT_SUPPRESS_ARGS) {
-    SwfdecAsFrame *next;
-    args = swfdec_as_array_new (context);
-    if (!args)
-      goto out;
-    for (cur = swfdec_as_stack_iterator_init_arguments (&iter, frame); cur != NULL;
-	cur = swfdec_as_stack_iterator_next (&iter)) {
-      swfdec_as_array_push (SWFDEC_AS_ARRAY (args), cur);
-    }
-
-    next = frame->next;
-    while (next != NULL && (next->function == NULL ||
-	SWFDEC_IS_AS_NATIVE_FUNCTION (next->function))) {
-      next = next->next;
-    }
-    if (next != NULL) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (next->function));
-    } else {
-      SWFDEC_AS_VALUE_SET_NULL (&val);
-    }
-    swfdec_as_object_set_variable (args, SWFDEC_AS_STR_caller, &val);
-
-    if (frame->function != NULL) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (frame->function));
-    } else {
-      SWFDEC_AS_VALUE_SET_NULL (&val);
-    }
-    swfdec_as_object_set_variable (args, SWFDEC_AS_STR_callee, &val);
-  } else {
-    /* silence gcc */
-    args = NULL;
-  }
-
-  /* set the default variables (unless suppressed */
-  if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_THIS)) {
-    if (frame->thisp) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&val, frame->thisp);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&val);
-    }
-    swfdec_as_object_set_variable (object, SWFDEC_AS_STR_this, &val);
-  }
-  if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_ARGS)) {
-    SWFDEC_AS_VALUE_SET_OBJECT (&val, args);
-    swfdec_as_object_set_variable (object, SWFDEC_AS_STR_arguments, &val);
-  }
-  if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_SUPER)) {
-    if (frame->super) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&val, frame->super);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&val);
-    }
-    swfdec_as_object_set_variable (object, SWFDEC_AS_STR_super, &val);
-  }
-
-  /* set and preload argument variables */
-  SWFDEC_AS_VALUE_SET_UNDEFINED (&val);
-  cur = swfdec_as_stack_iterator_init_arguments (&iter, frame);
-  for (i = 0; i < script->n_arguments; i++) {
-    if (cur == NULL)
-      cur = &val;
-    /* set this value at the right place */
-    if (script->arguments[i].preload) {
-      if (script->arguments[i].preload < frame->n_registers) {
-	frame->registers[script->arguments[i].preload] = *cur;
-      } else {
-	SWFDEC_ERROR ("trying to set %uth argument %s in nonexisting register %u", 
-	    i, script->arguments[i].name, script->arguments[i].preload);
-      }
-    } else {
-      const char *tmp = swfdec_as_context_get_string (context, script->arguments[i].name);
-      swfdec_as_object_set_variable (object, tmp, cur);
-    }
-    /* get the next argument */
-    cur = swfdec_as_stack_iterator_next (&iter);
-  }
-
-  /* preload from flags */
-  if ((script->flags & (SWFDEC_SCRIPT_PRELOAD_THIS | SWFDEC_SCRIPT_SUPPRESS_THIS)) == SWFDEC_SCRIPT_PRELOAD_THIS
-      && current_reg < script->n_registers) {
-    if (frame->thisp) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], frame->thisp);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&frame->registers[current_reg++]);
-    }
-  }
-  if (script->flags & SWFDEC_SCRIPT_PRELOAD_ARGS && current_reg < script->n_registers) {
-    SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], args);
-  }
-  if (script->flags & SWFDEC_SCRIPT_PRELOAD_SUPER && current_reg < script->n_registers) {
-    if (frame->super) {
-      SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], frame->super);
-    } else {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (&frame->registers[current_reg++]);
-    }
-  }
-  if (script->flags & SWFDEC_SCRIPT_PRELOAD_ROOT && current_reg < script->n_registers) {
-    if (!swfdec_as_frame_get_variable (frame, SWFDEC_AS_STR__root, &frame->registers[current_reg])) {
-      SWFDEC_WARNING ("no root to preload");
-    }
-    current_reg++;
-  }
-  if (script->flags & SWFDEC_SCRIPT_PRELOAD_PARENT && current_reg < script->n_registers) {
-    if (!swfdec_as_frame_get_variable (frame, SWFDEC_AS_STR__parent, &frame->registers[current_reg])) {
-      SWFDEC_WARNING ("no root to preload");
-    }
-    current_reg++;
-  }
-  if (script->flags & SWFDEC_SCRIPT_PRELOAD_GLOBAL && current_reg < script->n_registers) {
-    SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], context->global);
-  }
-  /* set block boundaries */
-  frame->block_start = frame->script->buffer->data;
-  frame->block_end = frame->script->buffer->data + frame->script->buffer->length;
-
-out:
-  if (context->state == SWFDEC_AS_CONTEXT_ABORTED) {
-    swfdec_as_frame_return (frame, NULL);
-    return;
-  }
-  if (context->debugger) {
-    SwfdecAsDebuggerClass *klass = SWFDEC_AS_DEBUGGER_GET_CLASS (context->debugger);
-
-    if (klass->enter_frame)
-      klass->enter_frame (context->debugger, context, frame);
-  }
-}
-
-void
-swfdec_as_frame_handle_exception (SwfdecAsFrame *frame)
-{
-  SwfdecAsContext *cx;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  cx = SWFDEC_AS_OBJECT (frame)->context;
-  g_return_if_fail (cx->exception);
-
-  /* pop blocks in the hope that we are inside a Try block */
-  while (cx->exception && frame->blocks->len) {
-    swfdec_as_frame_pop_block (frame);
-  }
-  /* no Try blocks caught it, exit frame */
-  if (cx->exception) {
-    swfdec_as_frame_return (frame, NULL);
-  }
-}
-
-/**
- * swfdec_as_frame_get_next:
- * @frame: a #SwfdecAsFrame
- *
- * Gets the next frame in the frame stack. The next frame is the frame that
- * will be executed after this @frame.
- *
- * Returns: the next #SwfdecAsFrame or %NULL if this is the bottommost frame.
- **/
-SwfdecAsFrame *
-swfdec_as_frame_get_next (SwfdecAsFrame *frame)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  return frame->next;
-}
-
-/**
- * swfdec_as_frame_get_function_name:
- * @frame: a #SwfdecAsFrame
- *
- * Gets the name of the function that is currently executing. This function is
- * intended for debugging purposes.
- *
- * Returns: a string. Do not free.
- **/
-const char *
-swfdec_as_frame_get_function_name (SwfdecAsFrame *frame)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  g_assert (frame->function_name);
-  return frame->function_name;
-}
-
-/**
- * swfdec_as_frame_get_script:
- * @frame: a #SwfdecAsFrame
- *
- * Gets the script associated with the given @frame. If the frame references
- * a native function, there will be no script and this function returns %NULL.
- *
- * Returns: The script executed by this frame or %NULL
- **/
-SwfdecScript *
-swfdec_as_frame_get_script (SwfdecAsFrame *frame)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  return frame->script;
-}
-
-/**
- * swfdec_as_frame_get_this:
- * @frame: a #SwfdecAsFrame
- *
- * Gets the this object of the given @frame. If the frame has no this object,
- * %NULL is returned.
- *
- * Returns: The this object of the frame or %NULL if none.
- **/
-SwfdecAsObject *
-swfdec_as_frame_get_this (SwfdecAsFrame *frame)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
-
-  return frame->thisp;
-}
-
diff --git a/libswfdec/swfdec_as_frame.h b/libswfdec/swfdec_as_frame.h
deleted file mode 100644
index 344eaa7..0000000
--- a/libswfdec/swfdec_as_frame.h
+++ /dev/null
@@ -1,63 +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_AS_FRAME_H_
-#define _SWFDEC_AS_FRAME_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsFrameClass SwfdecAsFrameClass;
-typedef struct _SwfdecAsStackIterator SwfdecAsStackIterator;
-
-struct _SwfdecAsStackIterator {
-  /*< private >*/
-  SwfdecAsStack *	stack;
-  SwfdecAsValue *	current;
-  guint			i;
-  guint			n;
-};
-
-
-#define SWFDEC_TYPE_AS_FRAME                    (swfdec_as_frame_get_type())
-#define SWFDEC_IS_AS_FRAME(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_FRAME))
-#define SWFDEC_IS_AS_FRAME_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_FRAME))
-#define SWFDEC_AS_FRAME(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrame))
-#define SWFDEC_AS_FRAME_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrameClass))
-#define SWFDEC_AS_FRAME_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrameClass))
-
-GType		swfdec_as_frame_get_type	(void);
-
-SwfdecAsFrame *	swfdec_as_frame_get_next	(SwfdecAsFrame *		frame);
-const char *	swfdec_as_frame_get_function_name (SwfdecAsFrame *		frame);
-SwfdecScript *	swfdec_as_frame_get_script	(SwfdecAsFrame *		frame);
-SwfdecAsObject *swfdec_as_frame_get_this	(SwfdecAsFrame *		frame);
-
-SwfdecAsValue *	swfdec_as_stack_iterator_init	(SwfdecAsStackIterator *	iter,
-						 SwfdecAsFrame *		frame);
-SwfdecAsValue *	swfdec_as_stack_iterator_init_arguments 
-						(SwfdecAsStackIterator *	iter,
-						 SwfdecAsFrame *		frame);
-SwfdecAsValue *	swfdec_as_stack_iterator_next	(SwfdecAsStackIterator *	iter);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_frame_internal.h b/libswfdec/swfdec_as_frame_internal.h
deleted file mode 100644
index 866d1fa..0000000
--- a/libswfdec/swfdec_as_frame_internal.h
+++ /dev/null
@@ -1,106 +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_AS_FRAME_INTERNAL_H_
-#define _SWFDEC_AS_FRAME_INTERNAL_H_
-
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script_internal.h>
-
-G_BEGIN_DECLS
-
-typedef void (* SwfdecAsFrameBlockFunc) (SwfdecAsFrame *frame, gpointer data);
-
-struct _SwfdecAsFrame {
-  SwfdecAsObject	object;
-
-  SwfdecAsFrame *	next;		/* next frame (FIXME: keep a list in the context instead?) */
-  SwfdecAsFunction *	function;	/* function we're executing or NULL if toplevel */
-  SwfdecAsObject *	thisp;		/* this object in current frame or NULL if none */
-  SwfdecAsObject *	super;		/* super object in current frame or NULL if none */
-  gboolean		construct;	/* TRUE if this is the constructor for thisp */
-  SwfdecAsValue *	return_value;	/* pointer to where to store the return value */
-  guint			argc;		/* number of arguments */
-  const SwfdecAsValue *	argv;		/* arguments or %NULL if taken from stack */
-  /* debugging */
-  const char *		function_name;	/* name of function */
-  /* script execution */
-  SwfdecScript *	script;		/* script being executed */
-  GSList *		scope_chain;  	/* the scope chain (with objects etc) */
-  const guint8 *      	block_start;	/* start of current block */
-  const guint8 *      	block_end;	/* end of current block */
-  GArray *		blocks;		/* blocks we have entered (like With) */
-  SwfdecAsObject *	target;		/* target to use as last object in scope chain or for SetVariable */
-  SwfdecAsObject *	original_target;/* original target (used when resetting target) */
-  gboolean		is_local;	/* TRUE if this frame takes local variables */
-  SwfdecAsValue *	registers;	/* the registers */
-  guint			n_registers;	/* number of allocated registers */
-  SwfdecConstantPool *	constant_pool;	/* constant pool currently in use */
-  SwfdecBuffer *	constant_pool_buffer;	/* buffer containing the raw data for constant_pool */
-  SwfdecAsValue *	stack_begin;	/* beginning of stack */
-  const guint8 *	pc;		/* program counter on stack */
-  /* native function */
-};
-
-struct _SwfdecAsFrameClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-SwfdecAsFrame *	swfdec_as_frame_new		(SwfdecAsContext *	context,
-						 SwfdecScript *		script);
-SwfdecAsFrame *	swfdec_as_frame_new_native	(SwfdecAsContext *	context);
-void		swfdec_as_frame_return		(SwfdecAsFrame *	frame,
-						 SwfdecAsValue *	return_value);
-
-void		swfdec_as_frame_set_this	(SwfdecAsFrame *	frame,
-						 SwfdecAsObject *	thisp);
-void		swfdec_as_frame_preload		(SwfdecAsFrame *	frame);
-
-#define swfdec_as_frame_get_variable(frame, variable, value) \
-  swfdec_as_frame_get_variable_and_flags (frame, variable, value, NULL, NULL)
-SwfdecAsObject *swfdec_as_frame_get_variable_and_flags 
-						(SwfdecAsFrame *	frame,
-						 const char *		variable,
-						 SwfdecAsValue *	value,
-						 guint *		flags,
-						 SwfdecAsObject **	pobject);
-#define swfdec_as_frame_set_variable(frame, variable, value) \
-  swfdec_as_frame_set_variable_and_flags (frame, variable, value, 0)
-void		swfdec_as_frame_set_variable_and_flags
-						(SwfdecAsFrame *	frame,
-						 const char *		variable,
-						 const SwfdecAsValue *	value,
-						 guint			default_flags);
-SwfdecAsDeleteReturn
-		swfdec_as_frame_delete_variable	(SwfdecAsFrame *	frame,
-						 const char *		variable);
-
-void		swfdec_as_frame_set_target	(SwfdecAsFrame *	frame,
-						 SwfdecAsObject *	target);
-void		swfdec_as_frame_push_block	(SwfdecAsFrame *	frame,
-						 const guint8 *		start,
-						 const guint8 *		end,
-						 SwfdecAsFrameBlockFunc	func,
-						 gpointer		data);
-void		swfdec_as_frame_pop_block	(SwfdecAsFrame *	frame);
-void		swfdec_as_frame_handle_exception(SwfdecAsFrame *	frame);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
deleted file mode 100644
index cc0e975..0000000
--- a/libswfdec/swfdec_as_function.c
+++ /dev/null
@@ -1,279 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_as_function.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_super.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_ABSTRACT_TYPE (SwfdecAsFunction, swfdec_as_function, SWFDEC_TYPE_AS_OBJECT)
-
-/**
- * SECTION:SwfdecAsFunction
- * @title: SwfdecAsFunction
- * @short_description: script objects that can be executed
- *
- * Functions is the basic object for executing code in the Swfdec script engine.
- * There is multiple different variants of functions, such as script-created 
- * ones and native functions.
- *
- * If you want to create your own functions, you should create native functions.
- * The easiest way to do this is with swfdec_as_object_add_function() or
- * swfdec_as_native_function_new().
- *
- * In Actionscript, every function can be used as a constructor. If you want to
- * make a native function be used as a constructor for your own #SwfdecAsObject
- * subclass, have a look at swfdec_as_native_function_set_construct_type().
- */
-
-/**
- * SwfdecAsFunction
- *
- * This is the base executable object in Swfdec. It is an abstract object. If 
- * you want to create functions yourself, use #SwfdecAsNativeFunction.
- */
-
-static void
-swfdec_as_function_class_init (SwfdecAsFunctionClass *klass)
-{
-}
-
-static void
-swfdec_as_function_init (SwfdecAsFunction *function)
-{
-}
-
-/**
- * swfdec_as_function_set_constructor:
- * @fun: a #SwfdecAsFunction
- *
- * Sets the constructor and prototype of @fun. This is a shortcut for calling
- * swfdec_as_object_set_constructor() with the right arguments.
- **/
-void
-swfdec_as_function_set_constructor (SwfdecAsFunction *fun)
-{
-  SwfdecAsContext *context;
-  SwfdecAsObject *object;
-  SwfdecAsValue val;
-
-  g_return_if_fail (SWFDEC_IS_AS_FUNCTION (fun));
-
-  object = SWFDEC_AS_OBJECT (fun);
-  context = object->context;
-  if (context->Function == NULL)
-    return;
-  
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function_prototype);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR___proto__,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
-      SWFDEC_AS_VARIABLE_VERSION_6_UP);
-}
-
-SwfdecAsFrame *
-swfdec_as_function_call_no_preload (SwfdecAsFunction *function, 
-    SwfdecAsObject *thisp, guint n_args, const SwfdecAsValue *args, 
-    SwfdecAsValue *return_value)
-{
-  SwfdecAsFrame *frame;
-  SwfdecAsFunctionClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_FUNCTION (function), NULL);
-  g_return_val_if_fail (thisp == NULL || SWFDEC_IS_AS_OBJECT (thisp), NULL);
-
-  /* just to be sure... */
-  if (return_value)
-    SWFDEC_AS_VALUE_SET_UNDEFINED (return_value);
-
-  klass = SWFDEC_AS_FUNCTION_GET_CLASS (function);
-  g_assert (klass->call);
-  frame = klass->call (function);
-  /* FIXME: figure out what to do in these situations?
-   * It's a problem when called inside swfdec_as_function_call () as the
-   * user of that function expects success, but super may fail here */
-  if (frame == NULL)
-    return NULL;
-  /* second check especially for super object */
-  if (thisp != NULL && frame->thisp == NULL) {
-    swfdec_as_frame_set_this (frame, swfdec_as_object_resolve (thisp));
-  }
-  frame->is_local = TRUE;
-  frame->argc = n_args;
-  frame->argv = args;
-  frame->return_value = return_value;
-  return frame;
-}
-
-/**
- * swfdec_as_function_call:
- * @function: the #SwfdecAsFunction to call
- * @thisp: this argument to use for the call or %NULL for none
- * @n_args: number of arguments to pass to the function
- * @args: the arguments to pass or %NULL to read the last @n_args stack elements.
- *        The memory must be unchanged until the function call has completed.
- *        This is after the call to swfdec_as_context_run () has finished.
- * @return_value: pointer for return value or %NULL to push the return value to 
- *                the stack
- *
- * Calls the given function. This means a #SwfdecAsFrame is created for the 
- * function and pushed on top of the execution stack. The function is however
- * not executed. Call swfdec_as_context_run () to execute it.
- **/
-void
-swfdec_as_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp, guint n_args,
-    const SwfdecAsValue *args, SwfdecAsValue *return_value)
-{
-  SwfdecAsFrame *frame;
-
-  g_return_if_fail (SWFDEC_IS_AS_FUNCTION (function));
-  g_return_if_fail (thisp == NULL || SWFDEC_IS_AS_OBJECT (thisp));
-
-  frame = swfdec_as_function_call_no_preload (function, thisp, n_args, args, return_value);
-  if (frame == NULL)
-    return;
-  if (thisp != NULL) {
-    swfdec_as_super_new (frame, thisp, thisp->prototype);
-  } else {
-    SWFDEC_FIXME ("does the super object really reference the function when thisp is NULL?");
-    swfdec_as_super_new (frame, SWFDEC_AS_OBJECT (function), SWFDEC_AS_OBJECT (function)->prototype);
-  }
-  swfdec_as_frame_preload (frame);
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_NATIVE (101, 10, swfdec_as_function_do_call)
-void
-swfdec_as_function_do_call (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsFunction *fun;
-  SwfdecAsObject *thisp;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_FUNCTION, &fun, "|O", &thisp);
-
-  if (thisp == NULL) {
-    thisp = swfdec_as_object_new_empty (cx);
-    if (thisp == NULL)
-      return;
-  }
-  if (argc > 0) {
-    argc--;
-    argv++;
-  }
-  swfdec_as_function_call (fun, thisp, argc, argv, ret);
-  swfdec_as_context_run (cx);
-}
-
-SWFDEC_AS_NATIVE (101, 11, swfdec_as_function_apply)
-void
-swfdec_as_function_apply (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsValue *argv_pass = NULL;
-  int length = 0;
-  SwfdecAsFunction *fun;
-  SwfdecAsObject *thisp;
-
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_FUNCTION, &fun, "|O", &thisp);
-
-  if (thisp == NULL) {
-    thisp = swfdec_as_object_new_empty (cx);
-    if (thisp == NULL)
-      return;
-  }
-
-  if (argc > 1 && SWFDEC_AS_VALUE_IS_OBJECT (&argv[1])) {
-    int i;
-    SwfdecAsObject *array;
-    SwfdecAsValue val;
-
-    array = SWFDEC_AS_VALUE_GET_OBJECT (&argv[1]);
-
-    swfdec_as_object_get_variable (array, SWFDEC_AS_STR_length, &val);
-    length = swfdec_as_value_to_integer (cx, &val);
-
-    if (length > 0) {
-      /* FIXME: find a smarter way to do this, like providing argv not as an array */
-      if (!swfdec_as_context_use_mem (cx, sizeof (SwfdecAsValue) * length))
-	return;
-      argv_pass = g_malloc (sizeof (SwfdecAsValue) * length);
-
-      for (i = 0; i < length; i++) {
-	swfdec_as_object_get_variable (array,
-	    swfdec_as_integer_to_string (cx, i), &argv_pass[i]);
-      }
-    } else {
-      length = 0;
-    }
-  }
-
-  swfdec_as_function_call (fun, thisp, length, argv_pass, ret);
-  swfdec_as_context_run (cx);
-
-  if (argv_pass) {
-    swfdec_as_context_unuse_mem (cx, sizeof (SwfdecAsValue) * length);
-    g_free (argv_pass);
-  }
-}
-
-void
-swfdec_as_function_init_context (SwfdecAsContext *context)
-{
-  SwfdecAsObject *function, *proto;
-  SwfdecAsValue val;
-
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-
-  function = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
-      SWFDEC_AS_STR_Function, 0, NULL, 0));
-  if (!function)
-    return;
-  swfdec_as_object_set_variable_flags (context->global, SWFDEC_AS_STR_Function, SWFDEC_AS_VARIABLE_VERSION_6_UP);
-  context->Function = function;
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
-  swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  proto = swfdec_as_object_new_empty (context);
-  if (!proto)
-    return;
-  context->Function_prototype = proto;
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR_prototype,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  swfdec_as_object_set_variable_and_flags (function, SWFDEC_AS_STR___proto__,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
-      SWFDEC_AS_VARIABLE_VERSION_6_UP);
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
-  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-}
-
diff --git a/libswfdec/swfdec_as_function.h b/libswfdec/swfdec_as_function.h
deleted file mode 100644
index 534aad5..0000000
--- a/libswfdec/swfdec_as_function.h
+++ /dev/null
@@ -1,61 +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_AS_FUNCTION_H_
-#define _SWFDEC_AS_FUNCTION_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsFunctionClass SwfdecAsFunctionClass;
-
-#define SWFDEC_TYPE_AS_FUNCTION                    (swfdec_as_function_get_type())
-#define SWFDEC_IS_AS_FUNCTION(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_FUNCTION))
-#define SWFDEC_IS_AS_FUNCTION_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_FUNCTION))
-#define SWFDEC_AS_FUNCTION(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_FUNCTION, SwfdecAsFunction))
-#define SWFDEC_AS_FUNCTION_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_FUNCTION, SwfdecAsFunctionClass))
-#define SWFDEC_AS_FUNCTION_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_FUNCTION, SwfdecAsFunctionClass))
-
-/* FIXME: do two obejcts, one for scripts and one for native? */
-struct _SwfdecAsFunction {
-  /*< private >*/
-  SwfdecAsObject	object;
-};
-
-struct _SwfdecAsFunctionClass {
-  SwfdecAsObjectClass	object_class;
-
-  /* return a frame that calls this function or NULL if uncallable */
-  SwfdecAsFrame *	(* call)			(SwfdecAsFunction *	function);
-};
-
-GType			swfdec_as_function_get_type	(void);
-
-void			swfdec_as_function_call		(SwfdecAsFunction *	function,
-							 SwfdecAsObject *	thisp,
-							 guint			n_args,
-							 const SwfdecAsValue *	args,
-							 SwfdecAsValue *	return_value);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_initialize.as b/libswfdec/swfdec_as_initialize.as
deleted file mode 100644
index 4e60ec2..0000000
--- a/libswfdec/swfdec_as_initialize.as
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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
- */
-
-/*** GENERAL ***/
-
-ASSetPropFlags = ASnative (1, 0);
-ASSetNative = ASnative (4, 0);
-ASSetNativeAccessor = ASnative (4, 1);
-
-/*** BASE OBJECTS ***/
-
-ASSetNative (Object.constructor.prototype, 101, "6call,6apply", 10);
-ASSetPropFlags (Object.constructor.prototype, null, 3);
-
-ASSetNative(Object.prototype, 101, "6watch,6unwatch,6addProperty,valueOf,toString,6hasOwnProperty,6isPrototypeOf,6isPropertyEnumerable");
-Object.prototype.toLocaleString = function () {
-  return this.toString ();
-};
-ASSetPropFlags (Object.prototype, null, 3);
-ASSetPropFlags (Object, null, 7);
-
-Boolean = ASconstructor(107, 2);
-ASSetNative(Boolean.prototype, 107, "valueOf,toString");
-ASSetPropFlags(Boolean.prototype, null, 3);
-
-Number = ASconstructor (106, 2);
-ASSetNative (Number.prototype, 106, "valueOf,toString");
-ASSetPropFlags(Number.prototype, null, 3);
-Number.NaN = NaN;
-Number.POSITIVE_INFINITY = Infinity;
-Number.NEGATIVE_INFINITY = -Infinity;
-Number.MIN_VALUE = 4.94065645841247e-324;
-Number.MAX_VALUE = 1.79769313486231e+308;
-ASSetPropFlags(Number, null, 7);
-
-String = ASconstructor(251, 0);
-ASSetNative(String.prototype, 251, "valueOf,toString,toUpperCase,toLowerCase,charAt,charCodeAt,concat,indexOf,lastIndexOf,slice,substring,split,substr", 1);
-ASSetPropFlags(String.prototype, null, 3);
-String.fromCharCode = ASnative(251, 14);
-ASSetPropFlags(String, null, 3);
-
-Math = {
-  E: 2.71828182845905,
-  LN10: 2.30258509299405,
-  LN2: 0.693147180559945,
-  LOG10E: 0.434294481903252,
-  LOG2E: 1.44269504088896,
-  PI: 3.14159265358979,
-  SQRT1_2: 0.707106781186548,
-  SQRT2: 1.4142135623731
-};
-ASSetNative (Math, 200, "abs,min,max,sin,cos,atan2,tan,exp,log,sqrt,round,random,floor,ceil,atan,asin,acos,pow");
-ASSetPropFlags (Math, null, 7);
-
-Date = ASconstructor (103, 256);
-ASSetNative (Date.prototype, 103, "getFullYear,getYear,getMonth,getDate,getDay,getHours,getMinutes,getSeconds,getMilliseconds,setFullYear,setMonth,setDate,setHours,setMinutes,setSeconds,setMilliseconds,getTime,setTime,getTimezoneOffset,toString,setYear");
-ASSetNative (Date.prototype, 103, "getUTCFullYear,getUTCYear,getUTCMonth,getUTCDate,getUTCDay,getUTCHours,getUTCMinutes,getUTCSeconds,getUTCMilliseconds,setUTCFullYear,setUTCMonth,setUTCDate,setUTCHours,setUTCMinutes,setUTCSeconds,setUTCMilliseconds", 128);
-Date.prototype.valueOf = Date.prototype.getTime;
-Date.UTC = ASnative (103, 257);
-ASSetPropFlags (Date.prototype, null, 3);
-ASSetPropFlags (Date, null, 7);
-
-Array = ASconstructor (252, 0);
-ASSetNative (Array.prototype, 252, "push,pop,concat,shift,unshift,slice,join,splice,toString,sort,reverse,sortOn", 1);
-ASSetPropFlags (Array.prototype, null, 3);
-Array.CASEINSENSITIVE = 1;
-Array.DESCENDING = 2;
-Array.UNIQUESORT = 4;
-Array.RETURNINDEXEDARRAY = 8;
-Array.NUMERIC = 16;
-
-/* GLOBAL FUNCTIONS */
-
-escape = ASnative (100, 0);
-unescape = ASnative (100, 1);
-parseInt = ASnative (100, 2);
-parseFloat = ASnative (100, 3);
-isNaN = ASnative (200, 18);
-isFinite = ASnative (200, 19);
-
-/*** GLOBAL PROPFLAGS */
-
-ASSetPropFlags (this, null, 1, 6);
diff --git a/libswfdec/swfdec_as_initialize.h b/libswfdec/swfdec_as_initialize.h
deleted file mode 100644
index 2fbca42..0000000
--- a/libswfdec/swfdec_as_initialize.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* This file is autogenerated, do not edit! */
-
-/* compiled from swfdec_as_initialize.as */
-static const unsigned char swfdec_as_initialize[] = {
-  0x88, 0xF3, 0x04, 0x36,  0x00, 0x41, 0x53, 0x53,  0x65, 0x74, 0x50, 0x72,  0x6F, 0x70, 0x46, 0x6C,
-  0x61, 0x67, 0x73, 0x00,  0x41, 0x53, 0x6E, 0x61,  0x74, 0x69, 0x76, 0x65,  0x00, 0x41, 0x53, 0x53,
-  0x65, 0x74, 0x4E, 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, 0x4F, 0x62, 0x6A,
-  0x65, 0x63, 0x74, 0x00,  0x63, 0x6F, 0x6E, 0x73,  0x74, 0x72, 0x75, 0x63,  0x74, 0x6F, 0x72, 0x00,
-  0x70, 0x72, 0x6F, 0x74,  0x6F, 0x74, 0x79, 0x70,  0x65, 0x00, 0x36, 0x63,  0x61, 0x6C, 0x6C, 0x2C,
-  0x36, 0x61, 0x70, 0x70,  0x6C, 0x79, 0x00, 0x36,  0x77, 0x61, 0x74, 0x63,  0x68, 0x2C, 0x36, 0x75,
-  0x6E, 0x77, 0x61, 0x74,  0x63, 0x68, 0x2C, 0x36,  0x61, 0x64, 0x64, 0x50,  0x72, 0x6F, 0x70, 0x65,
-  0x72, 0x74, 0x79, 0x2C,  0x76, 0x61, 0x6C, 0x75,  0x65, 0x4F, 0x66, 0x2C,  0x74, 0x6F, 0x53, 0x74,
-  0x72, 0x69, 0x6E, 0x67,  0x2C, 0x36, 0x68, 0x61,  0x73, 0x4F, 0x77, 0x6E,  0x50, 0x72, 0x6F, 0x70,
-  0x65, 0x72, 0x74, 0x79,  0x2C, 0x36, 0x69, 0x73,  0x50, 0x72, 0x6F, 0x74,  0x6F, 0x74, 0x79, 0x70,
-  0x65, 0x4F, 0x66, 0x2C,  0x36, 0x69, 0x73, 0x50,  0x72, 0x6F, 0x70, 0x65,  0x72, 0x74, 0x79, 0x45,
-  0x6E, 0x75, 0x6D, 0x65,  0x72, 0x61, 0x62, 0x6C,  0x65, 0x00, 0x74, 0x6F,  0x4C, 0x6F, 0x63, 0x61,
-  0x6C, 0x65, 0x53, 0x74,  0x72, 0x69, 0x6E, 0x67,  0x00, 0x74, 0x68, 0x69,  0x73, 0x00, 0x74, 0x6F,
-  0x53, 0x74, 0x72, 0x69,  0x6E, 0x67, 0x00, 0x42,  0x6F, 0x6F, 0x6C, 0x65,  0x61, 0x6E, 0x00, 0x41,
-  0x53, 0x63, 0x6F, 0x6E,  0x73, 0x74, 0x72, 0x75,  0x63, 0x74, 0x6F, 0x72,  0x00, 0x76, 0x61, 0x6C,
-  0x75, 0x65, 0x4F, 0x66,  0x2C, 0x74, 0x6F, 0x53,  0x74, 0x72, 0x69, 0x6E,  0x67, 0x00, 0x4E, 0x75,
-  0x6D, 0x62, 0x65, 0x72,  0x00, 0x4E, 0x61, 0x4E,  0x00, 0x50, 0x4F, 0x53,  0x49, 0x54, 0x49, 0x56,
-  0x45, 0x5F, 0x49, 0x4E,  0x46, 0x49, 0x4E, 0x49,  0x54, 0x59, 0x00, 0x49,  0x6E, 0x66, 0x69, 0x6E,
-  0x69, 0x74, 0x79, 0x00,  0x4E, 0x45, 0x47, 0x41,  0x54, 0x49, 0x56, 0x45,  0x5F, 0x49, 0x4E, 0x46,
-  0x49, 0x4E, 0x49, 0x54,  0x59, 0x00, 0x4D, 0x49,  0x4E, 0x5F, 0x56, 0x41,  0x4C, 0x55, 0x45, 0x00,
-  0x4D, 0x41, 0x58, 0x5F,  0x56, 0x41, 0x4C, 0x55,  0x45, 0x00, 0x53, 0x74,  0x72, 0x69, 0x6E, 0x67,
-  0x00, 0x76, 0x61, 0x6C,  0x75, 0x65, 0x4F, 0x66,  0x2C, 0x74, 0x6F, 0x53,  0x74, 0x72, 0x69, 0x6E,
-  0x67, 0x2C, 0x74, 0x6F,  0x55, 0x70, 0x70, 0x65,  0x72, 0x43, 0x61, 0x73,  0x65, 0x2C, 0x74, 0x6F,
-  0x4C, 0x6F, 0x77, 0x65,  0x72, 0x43, 0x61, 0x73,  0x65, 0x2C, 0x63, 0x68,  0x61, 0x72, 0x41, 0x74,
-  0x2C, 0x63, 0x68, 0x61,  0x72, 0x43, 0x6F, 0x64,  0x65, 0x41, 0x74, 0x2C,  0x63, 0x6F, 0x6E, 0x63,
-  0x61, 0x74, 0x2C, 0x69,  0x6E, 0x64, 0x65, 0x78,  0x4F, 0x66, 0x2C, 0x6C,  0x61, 0x73, 0x74, 0x49,
-  0x6E, 0x64, 0x65, 0x78,  0x4F, 0x66, 0x2C, 0x73,  0x6C, 0x69, 0x63, 0x65,  0x2C, 0x73, 0x75, 0x62,
-  0x73, 0x74, 0x72, 0x69,  0x6E, 0x67, 0x2C, 0x73,  0x70, 0x6C, 0x69, 0x74,  0x2C, 0x73, 0x75, 0x62,
-  0x73, 0x74, 0x72, 0x00,  0x66, 0x72, 0x6F, 0x6D,  0x43, 0x68, 0x61, 0x72,  0x43, 0x6F, 0x64, 0x65,
-  0x00, 0x4D, 0x61, 0x74,  0x68, 0x00, 0x45, 0x00,  0x4C, 0x4E, 0x31, 0x30,  0x00, 0x4C, 0x4E, 0x32,
-  0x00, 0x4C, 0x4F, 0x47,  0x31, 0x30, 0x45, 0x00,  0x4C, 0x4F, 0x47, 0x32,  0x45, 0x00, 0x50, 0x49,
-  0x00, 0x53, 0x51, 0x52,  0x54, 0x31, 0x5F, 0x32,  0x00, 0x53, 0x51, 0x52,  0x54, 0x32, 0x00, 0x61,
-  0x62, 0x73, 0x2C, 0x6D,  0x69, 0x6E, 0x2C, 0x6D,  0x61, 0x78, 0x2C, 0x73,  0x69, 0x6E, 0x2C, 0x63,
-  0x6F, 0x73, 0x2C, 0x61,  0x74, 0x61, 0x6E, 0x32,  0x2C, 0x74, 0x61, 0x6E,  0x2C, 0x65, 0x78, 0x70,
-  0x2C, 0x6C, 0x6F, 0x67,  0x2C, 0x73, 0x71, 0x72,  0x74, 0x2C, 0x72, 0x6F,  0x75, 0x6E, 0x64, 0x2C,
-  0x72, 0x61, 0x6E, 0x64,  0x6F, 0x6D, 0x2C, 0x66,  0x6C, 0x6F, 0x6F, 0x72,  0x2C, 0x63, 0x65, 0x69,
-  0x6C, 0x2C, 0x61, 0x74,  0x61, 0x6E, 0x2C, 0x61,  0x73, 0x69, 0x6E, 0x2C,  0x61, 0x63, 0x6F, 0x73,
-  0x2C, 0x70, 0x6F, 0x77,  0x00, 0x44, 0x61, 0x74,  0x65, 0x00, 0x67, 0x65,  0x74, 0x46, 0x75, 0x6C,
-  0x6C, 0x59, 0x65, 0x61,  0x72, 0x2C, 0x67, 0x65,  0x74, 0x59, 0x65, 0x61,  0x72, 0x2C, 0x67, 0x65,
-  0x74, 0x4D, 0x6F, 0x6E,  0x74, 0x68, 0x2C, 0x67,  0x65, 0x74, 0x44, 0x61,  0x74, 0x65, 0x2C, 0x67,
-  0x65, 0x74, 0x44, 0x61,  0x79, 0x2C, 0x67, 0x65,  0x74, 0x48, 0x6F, 0x75,  0x72, 0x73, 0x2C, 0x67,
-  0x65, 0x74, 0x4D, 0x69,  0x6E, 0x75, 0x74, 0x65,  0x73, 0x2C, 0x67, 0x65,  0x74, 0x53, 0x65, 0x63,
-  0x6F, 0x6E, 0x64, 0x73,  0x2C, 0x67, 0x65, 0x74,  0x4D, 0x69, 0x6C, 0x6C,  0x69, 0x73, 0x65, 0x63,
-  0x6F, 0x6E, 0x64, 0x73,  0x2C, 0x73, 0x65, 0x74,  0x46, 0x75, 0x6C, 0x6C,  0x59, 0x65, 0x61, 0x72,
-  0x2C, 0x73, 0x65, 0x74,  0x4D, 0x6F, 0x6E, 0x74,  0x68, 0x2C, 0x73, 0x65,  0x74, 0x44, 0x61, 0x74,
-  0x65, 0x2C, 0x73, 0x65,  0x74, 0x48, 0x6F, 0x75,  0x72, 0x73, 0x2C, 0x73,  0x65, 0x74, 0x4D, 0x69,
-  0x6E, 0x75, 0x74, 0x65,  0x73, 0x2C, 0x73, 0x65,  0x74, 0x53, 0x65, 0x63,  0x6F, 0x6E, 0x64, 0x73,
-  0x2C, 0x73, 0x65, 0x74,  0x4D, 0x69, 0x6C, 0x6C,  0x69, 0x73, 0x65, 0x63,  0x6F, 0x6E, 0x64, 0x73,
-  0x2C, 0x67, 0x65, 0x74,  0x54, 0x69, 0x6D, 0x65,  0x2C, 0x73, 0x65, 0x74,  0x54, 0x69, 0x6D, 0x65,
-  0x2C, 0x67, 0x65, 0x74,  0x54, 0x69, 0x6D, 0x65,  0x7A, 0x6F, 0x6E, 0x65,  0x4F, 0x66, 0x66, 0x73,
-  0x65, 0x74, 0x2C, 0x74,  0x6F, 0x53, 0x74, 0x72,  0x69, 0x6E, 0x67, 0x2C,  0x73, 0x65, 0x74, 0x59,
-  0x65, 0x61, 0x72, 0x00,  0x67, 0x65, 0x74, 0x55,  0x54, 0x43, 0x46, 0x75,  0x6C, 0x6C, 0x59, 0x65,
-  0x61, 0x72, 0x2C, 0x67,  0x65, 0x74, 0x55, 0x54,  0x43, 0x59, 0x65, 0x61,  0x72, 0x2C, 0x67, 0x65,
-  0x74, 0x55, 0x54, 0x43,  0x4D, 0x6F, 0x6E, 0x74,  0x68, 0x2C, 0x67, 0x65,  0x74, 0x55, 0x54, 0x43,
-  0x44, 0x61, 0x74, 0x65,  0x2C, 0x67, 0x65, 0x74,  0x55, 0x54, 0x43, 0x44,  0x61, 0x79, 0x2C, 0x67,
-  0x65, 0x74, 0x55, 0x54,  0x43, 0x48, 0x6F, 0x75,  0x72, 0x73, 0x2C, 0x67,  0x65, 0x74, 0x55, 0x54,
-  0x43, 0x4D, 0x69, 0x6E,  0x75, 0x74, 0x65, 0x73,  0x2C, 0x67, 0x65, 0x74,  0x55, 0x54, 0x43, 0x53,
-  0x65, 0x63, 0x6F, 0x6E,  0x64, 0x73, 0x2C, 0x67,  0x65, 0x74, 0x55, 0x54,  0x43, 0x4D, 0x69, 0x6C,
-  0x6C, 0x69, 0x73, 0x65,  0x63, 0x6F, 0x6E, 0x64,  0x73, 0x2C, 0x73, 0x65,  0x74, 0x55, 0x54, 0x43,
-  0x46, 0x75, 0x6C, 0x6C,  0x59, 0x65, 0x61, 0x72,  0x2C, 0x73, 0x65, 0x74,  0x55, 0x54, 0x43, 0x4D,
-  0x6F, 0x6E, 0x74, 0x68,  0x2C, 0x73, 0x65, 0x74,  0x55, 0x54, 0x43, 0x44,  0x61, 0x74, 0x65, 0x2C,
-  0x73, 0x65, 0x74, 0x55,  0x54, 0x43, 0x48, 0x6F,  0x75, 0x72, 0x73, 0x2C,  0x73, 0x65, 0x74, 0x55,
-  0x54, 0x43, 0x4D, 0x69,  0x6E, 0x75, 0x74, 0x65,  0x73, 0x2C, 0x73, 0x65,  0x74, 0x55, 0x54, 0x43,
-  0x53, 0x65, 0x63, 0x6F,  0x6E, 0x64, 0x73, 0x2C,  0x73, 0x65, 0x74, 0x55,  0x54, 0x43, 0x4D, 0x69,
-  0x6C, 0x6C, 0x69, 0x73,  0x65, 0x63, 0x6F, 0x6E,  0x64, 0x73, 0x00, 0x76,  0x61, 0x6C, 0x75, 0x65,
-  0x4F, 0x66, 0x00, 0x67,  0x65, 0x74, 0x54, 0x69,  0x6D, 0x65, 0x00, 0x55,  0x54, 0x43, 0x00, 0x41,
-  0x72, 0x72, 0x61, 0x79,  0x00, 0x70, 0x75, 0x73,  0x68, 0x2C, 0x70, 0x6F,  0x70, 0x2C, 0x63, 0x6F,
-  0x6E, 0x63, 0x61, 0x74,  0x2C, 0x73, 0x68, 0x69,  0x66, 0x74, 0x2C, 0x75,  0x6E, 0x73, 0x68, 0x69,
-  0x66, 0x74, 0x2C, 0x73,  0x6C, 0x69, 0x63, 0x65,  0x2C, 0x6A, 0x6F, 0x69,  0x6E, 0x2C, 0x73, 0x70,
-  0x6C, 0x69, 0x63, 0x65,  0x2C, 0x74, 0x6F, 0x53,  0x74, 0x72, 0x69, 0x6E,  0x67, 0x2C, 0x73, 0x6F,
-  0x72, 0x74, 0x2C, 0x72,  0x65, 0x76, 0x65, 0x72,  0x73, 0x65, 0x2C, 0x73,  0x6F, 0x72, 0x74, 0x4F,
-  0x6E, 0x00, 0x43, 0x41,  0x53, 0x45, 0x49, 0x4E,  0x53, 0x45, 0x4E, 0x53,  0x49, 0x54, 0x49, 0x56,
-  0x45, 0x00, 0x44, 0x45,  0x53, 0x43, 0x45, 0x4E,  0x44, 0x49, 0x4E, 0x47,  0x00, 0x55, 0x4E, 0x49,
-  0x51, 0x55, 0x45, 0x53,  0x4F, 0x52, 0x54, 0x00,  0x52, 0x45, 0x54, 0x55,  0x52, 0x4E, 0x49, 0x4E,
-  0x44, 0x45, 0x58, 0x45,  0x44, 0x41, 0x52, 0x52,  0x41, 0x59, 0x00, 0x4E,  0x55, 0x4D, 0x45, 0x52,
-  0x49, 0x43, 0x00, 0x65,  0x73, 0x63, 0x61, 0x70,  0x65, 0x00, 0x75, 0x6E,  0x65, 0x73, 0x63, 0x61,
-  0x70, 0x65, 0x00, 0x70,  0x61, 0x72, 0x73, 0x65,  0x49, 0x6E, 0x74, 0x00,  0x70, 0x61, 0x72, 0x73,
-  0x65, 0x46, 0x6C, 0x6F,  0x61, 0x74, 0x00, 0x69,  0x73, 0x4E, 0x61, 0x4E,  0x00, 0x69, 0x73, 0x46,
-  0x69, 0x6E, 0x69, 0x74,  0x65, 0x00, 0x96, 0x13,  0x00, 0x08, 0x00, 0x07,  0x00, 0x00, 0x00, 0x00,
-  0x07, 0x01, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,
-  0x00, 0x08, 0x02, 0x07,  0x00, 0x00, 0x00, 0x00,  0x07, 0x04, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,  0x00, 0x08, 0x03, 0x07,  0x01, 0x00, 0x00, 0x00,
-  0x07, 0x04, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x0E,
-  0x00, 0x07, 0x0A, 0x00,  0x00, 0x00, 0x08, 0x07,  0x07, 0x65, 0x00, 0x00,  0x00, 0x08, 0x04, 0x1C,
-  0x96, 0x02, 0x00, 0x08,  0x05, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,  0x96, 0x07, 0x00, 0x07,
-  0x04, 0x00, 0x00, 0x00,  0x08, 0x02, 0x3D, 0x17,  0x96, 0x08, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,
-  0x02, 0x08, 0x04, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x05, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,
-  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,  0x96, 0x09, 0x00, 0x08,
-  0x08, 0x07, 0x65, 0x00,  0x00, 0x00, 0x08, 0x04,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x4E, 0x96,
-  0x07, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x08,  0x02, 0x3D, 0x17, 0x96,  0x02, 0x00, 0x08, 0x04,
-  0x1C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x4E, 0x96,  0x02, 0x00, 0x08, 0x09,  0x8E, 0x08, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00,  0x00, 0x12, 0x00, 0x96,  0x07, 0x00, 0x07, 0x00,  0x00, 0x00, 0x00, 0x08,
-  0x0A, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x0B, 0x52,  0x3E, 0x4F, 0x96, 0x08,  0x00, 0x07, 0x03, 0x00,
-  0x00, 0x00, 0x02, 0x08,  0x04, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,  0x96, 0x07, 0x00, 0x07,
-  0x03, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,  0x96, 0x08, 0x00, 0x07,  0x07, 0x00, 0x00, 0x00,
-  0x02, 0x08, 0x04, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,
-  0x96, 0x13, 0x00, 0x08,  0x0C, 0x07, 0x02, 0x00,  0x00, 0x00, 0x07, 0x6B,  0x00, 0x00, 0x00, 0x07,
-  0x02, 0x00, 0x00, 0x00,  0x08, 0x0D, 0x3D, 0x1D,  0x96, 0x09, 0x00, 0x08,  0x0E, 0x07, 0x6B, 0x00,
-  0x00, 0x00, 0x08, 0x0C,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x4E, 0x96,  0x07, 0x00, 0x07, 0x03,
-  0x00, 0x00, 0x00, 0x08,  0x02, 0x3D, 0x17, 0x96,  0x08, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x02,
-  0x08, 0x0C, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x06,  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,
-  0x00, 0x08, 0x00, 0x3D,  0x17, 0x96, 0x13, 0x00,  0x08, 0x0F, 0x07, 0x02,  0x00, 0x00, 0x00, 0x07,
-  0x6A, 0x00, 0x00, 0x00,  0x07, 0x02, 0x00, 0x00,  0x00, 0x08, 0x0D, 0x3D,  0x1D, 0x96, 0x09, 0x00,
-  0x08, 0x0E, 0x07, 0x6A,  0x00, 0x00, 0x00, 0x08,  0x0F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,
-  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x02, 0x3D, 0x17,  0x96, 0x08, 0x00, 0x07,
-  0x03, 0x00, 0x00, 0x00,  0x02, 0x08, 0x0F, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x06, 0x4E, 0x96, 0x07,
-  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,  0x3D, 0x17, 0x96, 0x02,  0x00, 0x08, 0x0F, 0x1C,
-  0x96, 0x04, 0x00, 0x08,  0x10, 0x08, 0x10, 0x1C,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x1C, 0x96,
-  0x04, 0x00, 0x08, 0x11,  0x08, 0x12, 0x1C, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x0F, 0x1C, 0x96, 0x04,
-  0x00, 0x08, 0x13, 0x08,  0x12, 0x1C, 0x96, 0x05,  0x00, 0x07, 0xFF, 0xFF,  0xFF, 0xFF, 0x0C, 0x4F,
-  0x96, 0x02, 0x00, 0x08,  0x0F, 0x1C, 0x96, 0x0B,  0x00, 0x08, 0x14, 0x06,  0x00, 0x00, 0x00, 0x00,
-  0x01, 0x00, 0x00, 0x00,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x1C, 0x96,  0x0B, 0x00, 0x08, 0x15,
-  0x06, 0xFF, 0xFF, 0xEF,  0x7F, 0xE2, 0xFF, 0xFF,  0xFF, 0x4F, 0x96, 0x08,  0x00, 0x07, 0x07, 0x00,
-  0x00, 0x00, 0x02, 0x08,  0x0F, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,
-  0x3D, 0x17, 0x96, 0x13,  0x00, 0x08, 0x16, 0x07,  0x00, 0x00, 0x00, 0x00,  0x07, 0xFB, 0x00, 0x00,
-  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x0D,  0x3D, 0x1D, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,
-  0x00, 0x00, 0x08, 0x17,  0x07, 0xFB, 0x00, 0x00,  0x00, 0x08, 0x16, 0x1C,  0x96, 0x02, 0x00, 0x08,
-  0x06, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x04, 0x00,  0x00, 0x00, 0x08, 0x02,  0x3D, 0x17, 0x96, 0x08,
-  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x02, 0x08,  0x16, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,
-  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x00, 0x3D, 0x17,  0x96, 0x02, 0x00, 0x08,
-  0x16, 0x1C, 0x96, 0x13,  0x00, 0x08, 0x18, 0x07,  0x0E, 0x00, 0x00, 0x00,  0x07, 0xFB, 0x00, 0x00,
-  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x08,  0x00, 0x07, 0x03, 0x00,
-  0x00, 0x00, 0x02, 0x08,  0x16, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,
-  0x3D, 0x17, 0x96, 0x5F,  0x00, 0x08, 0x19, 0x08,  0x1A, 0x06, 0x0A, 0xBF,  0x05, 0x40, 0x74, 0x57,
-  0x14, 0x8B, 0x08, 0x1B,  0x06, 0xB1, 0x6B, 0x02,  0x40, 0x1F, 0x55, 0xB5,  0xBB, 0x08, 0x1C, 0x06,
-  0x42, 0x2E, 0xE6, 0x3F,  0xEC, 0x39, 0xFA, 0xFE,  0x08, 0x1D, 0x06, 0x7B,  0xCB, 0xDB, 0x3F, 0x11,
-  0xE5, 0x26, 0x15, 0x08,  0x1E, 0x06, 0x47, 0x15,  0xF7, 0x3F, 0xEF, 0x82,  0x2B, 0x65, 0x08, 0x1F,
-  0x06, 0xFB, 0x21, 0x09,  0x40, 0x11, 0x2D, 0x44,  0x54, 0x08, 0x20, 0x06,  0x9E, 0xA0, 0xE6, 0x3F,
-  0xD1, 0x3B, 0x7F, 0x66,  0x08, 0x21, 0x06, 0x9E,  0xA0, 0xF6, 0x3F, 0xE3,  0x3B, 0x7F, 0x66, 0x07,
-  0x08, 0x00, 0x00, 0x00,  0x43, 0x1D, 0x96, 0x09,  0x00, 0x08, 0x22, 0x07,  0xC8, 0x00, 0x00, 0x00,
-  0x08, 0x19, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x08,  0x02, 0x3D, 0x17, 0x96,
-  0x08, 0x00, 0x07, 0x07,  0x00, 0x00, 0x00, 0x02,  0x08, 0x19, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x03,
-  0x00, 0x00, 0x00, 0x08,  0x00, 0x3D, 0x17, 0x96,  0x13, 0x00, 0x08, 0x23,  0x07, 0x00, 0x01, 0x00,
-  0x00, 0x07, 0x67, 0x00,  0x00, 0x00, 0x07, 0x02,  0x00, 0x00, 0x00, 0x08,  0x0D, 0x3D, 0x1D, 0x96,
-  0x09, 0x00, 0x08, 0x24,  0x07, 0x67, 0x00, 0x00,  0x00, 0x08, 0x23, 0x1C,  0x96, 0x02, 0x00, 0x08,
-  0x06, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x02,  0x3D, 0x17, 0x96, 0x0E,
-  0x00, 0x07, 0x80, 0x00,  0x00, 0x00, 0x08, 0x25,  0x07, 0x67, 0x00, 0x00,  0x00, 0x08, 0x23, 0x1C,
-  0x96, 0x02, 0x00, 0x08,  0x06, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x04, 0x00,  0x00, 0x00, 0x08, 0x02,
-  0x3D, 0x17, 0x96, 0x02,  0x00, 0x08, 0x23, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x06, 0x4E, 0x96, 0x04,
-  0x00, 0x08, 0x26, 0x08,  0x23, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x06, 0x4E,  0x96, 0x02, 0x00, 0x08,
-  0x27, 0x4E, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x23,  0x1C, 0x96, 0x13, 0x00,  0x08, 0x28, 0x07, 0x01,
-  0x01, 0x00, 0x00, 0x07,  0x67, 0x00, 0x00, 0x00,  0x07, 0x02, 0x00, 0x00,  0x00, 0x08, 0x01, 0x3D,
-  0x4F, 0x96, 0x08, 0x00,  0x07, 0x03, 0x00, 0x00,  0x00, 0x02, 0x08, 0x23,  0x1C, 0x96, 0x02, 0x00,
-  0x08, 0x06, 0x4E, 0x96,  0x07, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x08,  0x00, 0x3D, 0x17, 0x96,
-  0x08, 0x00, 0x07, 0x07,  0x00, 0x00, 0x00, 0x02,  0x08, 0x23, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x03,
-  0x00, 0x00, 0x00, 0x08,  0x00, 0x3D, 0x17, 0x96,  0x13, 0x00, 0x08, 0x29,  0x07, 0x00, 0x00, 0x00,
-  0x00, 0x07, 0xFC, 0x00,  0x00, 0x00, 0x07, 0x02,  0x00, 0x00, 0x00, 0x08,  0x0D, 0x3D, 0x1D, 0x96,
-  0x0E, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x2A, 0x07, 0xFC, 0x00,  0x00, 0x00, 0x08, 0x29,
-  0x1C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x4E, 0x96,  0x07, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x08,
-  0x02, 0x3D, 0x17, 0x96,  0x08, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x02,  0x08, 0x29, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x06,  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,  0x00, 0x08, 0x00, 0x3D,
-  0x17, 0x96, 0x02, 0x00,  0x08, 0x29, 0x1C, 0x96,  0x07, 0x00, 0x08, 0x2B,  0x07, 0x01, 0x00, 0x00,
-  0x00, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,  0x96, 0x07, 0x00, 0x08,  0x2C, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x29,  0x1C, 0x96, 0x07, 0x00,  0x08, 0x2D, 0x07, 0x04,
-  0x00, 0x00, 0x00, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x07,  0x00, 0x08, 0x2E, 0x07,
-  0x08, 0x00, 0x00, 0x00,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x29, 0x1C, 0x96,  0x07, 0x00, 0x08, 0x2F,
-  0x07, 0x10, 0x00, 0x00,  0x00, 0x4F, 0x96, 0x13,  0x00, 0x08, 0x30, 0x07,  0x00, 0x00, 0x00, 0x00,
-  0x07, 0x64, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,
-  0x00, 0x08, 0x31, 0x07,  0x01, 0x00, 0x00, 0x00,  0x07, 0x64, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,  0x00, 0x08, 0x32, 0x07,  0x02, 0x00, 0x00, 0x00,
-  0x07, 0x64, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,
-  0x00, 0x08, 0x33, 0x07,  0x03, 0x00, 0x00, 0x00,  0x07, 0x64, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,  0x00, 0x08, 0x34, 0x07,  0x12, 0x00, 0x00, 0x00,
-  0x07, 0xC8, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x13,
-  0x00, 0x08, 0x35, 0x07,  0x13, 0x00, 0x00, 0x00,  0x07, 0xC8, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x1D, 0x96, 0x0D,  0x00, 0x07, 0x06, 0x00,  0x00, 0x00, 0x07, 0x01,
-  0x00, 0x00, 0x00, 0x02,  0x08, 0x0A, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x08,
-  0x00, 0x3D, 0x17, 0x00
-};
-
diff --git a/libswfdec/swfdec_as_internal.h b/libswfdec/swfdec_as_internal.h
deleted file mode 100644
index 30a556c..0000000
--- a/libswfdec/swfdec_as_internal.h
+++ /dev/null
@@ -1,78 +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_AS_INTERNAL_H_
-#define _SWFDEC_AS_INTERNAL_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-/* This header contains all the non-exported symbols that can't go into 
- * exported headers 
- */
-#define SWFDEC_AS_NATIVE(x, y, func) SWFDEC_AS_CONSTRUCTOR (x, y, func, NULL)
-#define SWFDEC_AS_CONSTRUCTOR(x, y, func, type) void func (SwfdecAsContext *cx, \
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret);
-
-#define SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT 256
-
-void		swfdec_as_function_set_constructor	(SwfdecAsFunction *	fun);
-void		swfdec_as_function_init_context		(SwfdecAsContext *	context);
-SwfdecAsFrame *	swfdec_as_function_call_no_preload	(SwfdecAsFunction *	function, 
-							 SwfdecAsObject *	thisp,
-							 guint			n_args,
-							 const SwfdecAsValue *	args, 
-							 SwfdecAsValue *	return_value);
-
-/* swfdec_as_context.c */
-gboolean	swfdec_as_context_check_continue (SwfdecAsContext *	context);
-void		swfdec_as_context_run_init_script (SwfdecAsContext *	context,
-						 const guint8 *		data,
-						 gsize			length,
-						 guint			version);
-
-/* swfdec_as_object.c */
-typedef SwfdecAsVariableForeach SwfdecAsVariableForeachRemove;
-typedef const char *(* SwfdecAsVariableForeachRename) (SwfdecAsObject *object, 
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data);
-
-SwfdecAsValue *	swfdec_as_object_peek_variable	(SwfdecAsObject *       object,
-						 const char *		name);
-void		swfdec_as_object_collect	(SwfdecAsObject *     	object);
-guint		swfdec_as_object_foreach_remove	(SwfdecAsObject *       object,
-						 SwfdecAsVariableForeach func,
-						 gpointer		data);
-void		swfdec_as_object_foreach_rename	(SwfdecAsObject *       object,
-						 SwfdecAsVariableForeachRename func,
-						 gpointer		data);
-
-void		swfdec_as_object_init_context	(SwfdecAsContext *	context);
-void		swfdec_as_object_decode		(SwfdecAsObject *	obj,
-						 const char *		str);
-SwfdecAsObject * swfdec_as_object_get_prototype (SwfdecAsObject *	object);
-void		swfdec_as_object_add_native_variable (SwfdecAsObject *	object,
-						 const char *		variable,
-						 SwfdecAsNative		get,
-						 SwfdecAsNative		set);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
deleted file mode 100644
index 813c1ce..0000000
--- a/libswfdec/swfdec_as_interpret.c
+++ /dev/null
@@ -1,3268 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- *               2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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.
- * 
- * 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_interpret.h"
-#include "swfdec_as_array.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_script_function.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_string.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_super.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_debug.h"
-
-#include <errno.h>
-#include <math.h>
-#include <string.h>
-#include "swfdec_decoder.h"
-#include "swfdec_load_object.h"
-#include "swfdec_movie.h"
-#include "swfdec_player_internal.h"
-#include "swfdec_sprite.h"
-#include "swfdec_sprite_movie.h"
-#include "swfdec_resource.h"
-#include "swfdec_text_field_movie.h" // for typeof
-
-/* Define this to get SWFDEC_WARN'd about missing properties of objects.
- * This can be useful to find out about unimplemented native properties,
- * but usually just causes a lot of spam. */
-//#define SWFDEC_WARN_MISSING_PROPERTIES
-
-/*** SUPPORT FUNCTIONS ***/
-
-#define swfdec_action_has_register(cx, i) \
-  ((i) < (cx)->frame->n_registers)
-
-/*** ALL THE ACTION IS HERE ***/
-
-static void
-swfdec_action_stop (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target))
-    SWFDEC_SPRITE_MOVIE (cx->frame->target)->playing = FALSE;
-  else
-    SWFDEC_ERROR ("no movie to stop");
-}
-
-static void
-swfdec_action_play (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target))
-    SWFDEC_SPRITE_MOVIE (cx->frame->target)->playing = TRUE;
-  else
-    SWFDEC_ERROR ("no movie to play");
-}
-
-static void
-swfdec_action_next_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-    if (movie->frame < movie->n_frames) {
-      swfdec_sprite_movie_goto (movie, movie->frame + 1);
-    } else {
-      SWFDEC_INFO ("can't execute nextFrame, already at last frame");
-    }
-  } else {
-    SWFDEC_ERROR ("no movie to nextFrame on");
-  }
-}
-
-static void
-swfdec_action_previous_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-    if (movie->frame > 1) {
-      swfdec_sprite_movie_goto (movie, movie->frame - 1);
-    } else {
-      SWFDEC_INFO ("can't execute previousFrame, already at first frame");
-    }
-  } else {
-    SWFDEC_ERROR ("no movie to previousFrame on");
-  }
-}
-
-static void
-swfdec_action_goto_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  guint frame;
-
-  if (len != 2) {
-    SWFDEC_ERROR ("GotoFrame action length invalid (is %u, should be 2", len);
-    return;
-  }
-  frame = (data[0] | data[1] << 8);
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-    swfdec_sprite_movie_goto (movie, frame + 1);
-    movie->playing = FALSE;
-  } else {
-    SWFDEC_ERROR ("no movie to goto on");
-  }
-}
-
-static void
-swfdec_action_goto_label (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (!memchr (data, 0, len)) {
-    SWFDEC_ERROR ("GotoLabel action does not specify a string");
-    return;
-  }
-
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-    int frame;
-    if (movie->sprite == NULL ||
-	(frame = swfdec_sprite_get_frame (movie->sprite, (const char *) data)) == -1)
-      return;
-    swfdec_sprite_movie_goto (movie, frame + 1);
-    movie->playing = FALSE;
-  } else {
-    SWFDEC_ERROR ("no movie to goto on");
-  }
-}
-
-/* returns: frame to go to or 0 on error */
-static guint
-swfdec_value_to_frame (SwfdecAsContext *cx, SwfdecSpriteMovie *movie, SwfdecAsValue *val)
-{
-  int frame;
-
-  if (movie->sprite == NULL)
-    return 0;
-  if (SWFDEC_AS_VALUE_IS_STRING (val)) {
-    const char *name = SWFDEC_AS_VALUE_GET_STRING (val);
-    double d;
-    if (strchr (name, ':')) {
-      SWFDEC_ERROR ("FIXME: handle targets");
-    }
-    /* treat valid encoded numbers as numbers, otherwise assume it's a frame label */
-    d = swfdec_as_value_to_number (cx, val);
-    if (isnan (d))
-      frame = swfdec_sprite_get_frame (movie->sprite, name) + 1;
-    else
-      frame = d;
-  } else if (SWFDEC_AS_VALUE_IS_NUMBER (val)) {
-    frame = swfdec_as_value_to_integer (cx, val);
-  } else {
-    SWFDEC_WARNING ("cannot convert value to frame number");
-    /* FIXME: how do we treat undefined etc? */
-    frame = 0;
-  }
-  return frame <= 0 ? 0 : frame;
-}
-
-static void
-swfdec_action_goto_frame2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-  guint bias;
-  gboolean play;
-  SwfdecAsValue *val;
-
-  swfdec_bits_init_data (&bits, data, len);
-  if (swfdec_bits_getbits (&bits, 6)) {
-    SWFDEC_WARNING ("reserved bits in GotoFrame2 aren't 0");
-  }
-  bias = swfdec_bits_getbit (&bits);
-  play = swfdec_bits_getbit (&bits);
-  if (bias) {
-    bias = swfdec_bits_get_u16 (&bits);
-  }
-  val = swfdec_as_stack_peek (cx, 1);
-  /* now set it */
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-    guint frame = swfdec_value_to_frame (cx, movie, val);
-    if (frame > 0) {
-      frame += bias;
-      frame = CLAMP (frame, 1, movie->n_frames);
-      swfdec_sprite_movie_goto (movie, frame);
-      movie->playing = play;
-    }
-  } else {
-    SWFDEC_ERROR ("no movie to GotoFrame2 on");
-  }
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_script_skip_actions (SwfdecAsContext *cx, guint jump)
-{
-  SwfdecScript *script = cx->frame->script;
-  const guint8 *pc = cx->frame->pc;
-  const guint8 *endpc = script->buffer->data + script->buffer->length;
-
-  /* jump instructions */
-  do {
-    if (pc >= endpc)
-      break;
-    if (*pc & 0x80) {
-      if (pc + 2 >= endpc)
-	break;
-      pc += 3 + (pc[1] | (pc[2] << 8));
-    } else {
-      pc++;
-    }
-  } while (jump-- > 0);
-  cx->frame->pc = pc;
-}
-
-#if 0
-static void
-swfdec_action_wait_for_frame2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  jsval val;
-
-  if (len != 1) {
-    SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
-    return JS_FALSE;
-  }
-  val = cx->fp->sp[-1];
-  cx->fp->sp--;
-  if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SwfdecMovie *movie = SWFDEC_MOVIE (cx->frame->target);
-    int frame = swfdec_value_to_frame (cx, movie, val);
-    guint jump = data[2];
-    guint loaded;
-    if (frame < 0)
-      return JS_TRUE;
-    if (SWFDEC_IS_ROOT_MOVIE (movie)) {
-      SwfdecDecoder *dec = SWFDEC_ROOT_MOVIE (movie)->decoder;
-      loaded = dec->frames_loaded;
-      g_assert (loaded <= movie->n_frames);
-    } else {
-      loaded = movie->n_frames;
-    }
-    if (loaded <= (guint) frame)
-      swfdec_script_skip_actions (cx, jump);
-  } else {
-    SWFDEC_ERROR ("no movie to WaitForFrame2 on");
-  }
-  return JS_TRUE;
-}
-#endif
-
-static void
-swfdec_action_wait_for_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecSpriteMovie *movie;
-  guint jump;
-  int frame, loaded;
-
-  if (len != 3) {
-    SWFDEC_ERROR ("WaitForFrame action length invalid (is %u, should be 3", len);
-    return;
-  }
-  if (!SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
-    SWFDEC_ERROR ("no movie for WaitForFrame");
-    return;
-  }
-
-  movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-  frame = data[0] || (data[1] << 8);
-  jump = data[2];
-  loaded = swfdec_sprite_movie_get_frames_loaded (movie);
-  if (loaded < (int) movie->n_frames &&
-      loaded <= frame)
-    swfdec_script_skip_actions (cx, jump);
-}
-
-static void
-swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecConstantPool *pool;
-  SwfdecAsFrame *frame;
-
-  frame = cx->frame;
-  pool = swfdec_constant_pool_new_from_action (data, len, cx->version);
-  if (pool == NULL)
-    return;
-  swfdec_constant_pool_attach_to_context (pool, cx);
-  if (frame->constant_pool)
-    swfdec_constant_pool_free (frame->constant_pool);
-  frame->constant_pool = pool;
-  if (frame->constant_pool_buffer)
-    swfdec_buffer_unref (frame->constant_pool_buffer);
-  frame->constant_pool_buffer = swfdec_buffer_new_subbuffer (frame->script->buffer,
-      data - frame->script->buffer->data, len);
-}
-
-static void
-swfdec_action_push (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-
-  swfdec_bits_init_data (&bits, data, len);
-  while (swfdec_bits_left (&bits)) {
-    guint type = swfdec_bits_get_u8 (&bits);
-    SWFDEC_LOG ("push type %u", type);
-    swfdec_as_stack_ensure_free (cx, 1);
-    switch (type) {
-      case 0: /* string */
-	{
-	  char *s = swfdec_bits_get_string (&bits, cx->version);
-	  if (s == NULL)
-	    return;
-	  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), 
-	      swfdec_as_context_give_string (cx, s));
-	  break;
-	}
-      case 1: /* float */
-	SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_push (cx), 
-	    swfdec_bits_get_float (&bits));
-	break;
-      case 2: /* null */
-	SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_push (cx));
-	break;
-      case 3: /* undefined */
-	SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx));
-	break;
-      case 4: /* register */
-	{
-	  guint regnum = swfdec_bits_get_u8 (&bits);
-	  if (!swfdec_action_has_register (cx, regnum)) {
-	    SWFDEC_ERROR ("cannot Push register %u: not enough registers", regnum);
-	    SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx));
-	  } else {
-	    *swfdec_as_stack_push (cx) = cx->frame->registers[regnum];
-	  }
-	  break;
-	}
-      case 5: /* boolean */
-	SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_push (cx), 
-	    swfdec_bits_get_u8 (&bits) ? TRUE : FALSE);
-	break;
-      case 6: /* double */
-	SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_push (cx), 
-	    swfdec_bits_get_double (&bits));
-	break;
-      case 7: /* 32bit int */
-	SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_push (cx), 
-	    (int) swfdec_bits_get_u32 (&bits));
-	break;
-      case 8: /* 8bit ConstantPool address */
-	{
-	  guint i = swfdec_bits_get_u8 (&bits);
-	  SwfdecConstantPool *pool = cx->frame->constant_pool;
-	  if (pool == NULL) {
-	    SWFDEC_ERROR ("no constant pool to push from");
-	    return;
-	  }
-	  if (i >= swfdec_constant_pool_size (pool)) {
-	    SWFDEC_ERROR ("constant pool index %u too high - only %u elements",
-		i, swfdec_constant_pool_size (pool));
-	    return;
-	  }
-	  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), 
-	      swfdec_constant_pool_get (pool, i));
-	  break;
-	}
-      case 9: /* 16bit ConstantPool address */
-	{
-	  guint i = swfdec_bits_get_u16 (&bits);
-	  SwfdecConstantPool *pool = cx->frame->constant_pool;
-	  if (pool == NULL) {
-	    SWFDEC_ERROR ("no constant pool to push from");
-	    return;
-	  }
-	  if (i >= swfdec_constant_pool_size (pool)) {
-	    SWFDEC_ERROR ("constant pool index %u too high - only %u elements",
-		i, swfdec_constant_pool_size (pool));
-	    return;
-	  }
-	  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), 
-	      swfdec_constant_pool_get (pool, i));
-	  break;
-	}
-      default:
-	SWFDEC_ERROR ("Push: type %u not implemented", type);
-	return;
-    }
-  }
-}
-
-/* NB: name must be GC'd */
-static SwfdecAsObject *
-super_special_movie_lookup_magic (SwfdecAsContext *cx, SwfdecAsObject *o, const char *name)
-{
-  SwfdecAsValue val;
-
-  if (o == NULL) {
-    o = swfdec_as_frame_get_variable (cx->frame, name, NULL);
-    if (o == NULL)
-      return NULL;
-  }
-  if (SWFDEC_IS_MOVIE (o)) {
-    SwfdecMovie *ret = swfdec_movie_get_by_name (SWFDEC_MOVIE (o), name, TRUE);
-    if (ret)
-      return SWFDEC_AS_OBJECT (ret);
-  }
-  if (!swfdec_as_object_get_variable (o, name, &val))
-    return NULL;
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
-    return NULL;
-  return SWFDEC_AS_VALUE_GET_OBJECT (&val);
-}
-
-static SwfdecAsObject *
-swfdec_action_get_movie_by_slash_path (SwfdecAsContext *cx, const char *path)
-{
-  SwfdecAsObject *o;
-
-  o = cx->frame->target;
-  if (!SWFDEC_IS_MOVIE (o))
-    return NULL;
-  if (*path == '/') {
-    o = SWFDEC_AS_OBJECT (swfdec_movie_get_root (SWFDEC_MOVIE (o)));
-    path++;
-  }
-  while (*path) {
-    char *slash = strchr (path, '/');
-    const char *name;
-    if (slash) {
-      if (slash == path)
-	return NULL;
-      name = swfdec_as_context_give_string (cx, g_strndup (path, slash - path));
-      path = slash + 1;
-    } else {
-      name = swfdec_as_context_get_string (cx, path);
-      path += strlen (path);
-    }
-    o = super_special_movie_lookup_magic (cx, o, name);
-    if (!SWFDEC_IS_MOVIE (o))
-      return NULL;
-  }
-  return o;
-}
-
-SwfdecAsObject *
-swfdec_action_lookup_object (SwfdecAsContext *cx, SwfdecAsObject *o, const char *path, const char *end)
-{
-  gboolean dot_allowed = TRUE;
-  const char *start;
-
-  if (path == end) {
-    if (o == NULL)
-      o = cx->frame->target;
-    if (SWFDEC_IS_MOVIE (o))
-      return o;
-    else
-      return NULL;
-  }
-
-  if (path[0] == '/') {
-    if (o == NULL)
-      o = cx->frame->target;
-    if (!SWFDEC_IS_MOVIE (o))
-      return NULL;
-    o = SWFDEC_AS_OBJECT (swfdec_movie_get_root (SWFDEC_MOVIE (o)));
-    path++;
-    dot_allowed = FALSE;
-  }
-  while (path < end) {
-    for (start = path; path < end; path++) {
-      if (dot_allowed && path[0] == '.') {
-	if (end - path >= 2 && path[1] == '.') {
-	  dot_allowed = FALSE;
-	  continue;
-	}
-      } else if (path[0] == ':') {
-	if (path[1] == '/')
-	  continue;
-	if (path == start) {
-	  start++;
-	  continue;
-	}
-      } else if (path[0] == '/') {
-	dot_allowed = FALSE;
-      } else if (path - start < 127) {
-	continue;
-      }
-
-      break;
-    }
-
-    /* parse variable */
-    if (start[0] == '.' && start[1] == '.' && start + 2 == path) {
-      if (o == NULL) {
-	GSList *walk;
-	for (walk = cx->frame->scope_chain; walk; walk = walk->next) {
-	  if (SWFDEC_IS_MOVIE (walk->data)) {
-	    o = walk->data;
-	    break;
-	  }
-	}
-	if (o == NULL)
-	  o = cx->frame->target;
-      }
-      /* ".." goes back to parent */
-      if (!SWFDEC_IS_MOVIE (o))
-	return NULL;
-      o = SWFDEC_AS_OBJECT (SWFDEC_MOVIE (o)->parent);
-      if (o == NULL)
-	return NULL;
-    } else {
-      o = super_special_movie_lookup_magic (cx, o, 
-	      swfdec_as_context_give_string (cx, g_strndup (start, path - start)));
-      if (o == NULL)
-	return NULL;
-    }
-    if (path - start < 127)
-      path++;
-  }
-
-  return o;
-}
-
-/* FIXME: this function belongs into swfdec_movie.c */
-SwfdecMovie *
-swfdec_player_get_movie_from_value (SwfdecPlayer *player, SwfdecAsValue *val)
-{
-  SwfdecAsContext *cx;
-  const char *s;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (val), NULL);
-
-  cx = SWFDEC_AS_CONTEXT (player);
-  s = swfdec_as_value_to_string (cx, val);
-  return swfdec_player_get_movie_from_string (player, s);
-}
-
-SwfdecMovie *
-swfdec_player_get_movie_from_string (SwfdecPlayer *player, const char *s)
-{
-  SwfdecAsObject *ret;
-
-  g_return_val_if_fail (SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (s != NULL, NULL);
-
-  ret = swfdec_action_lookup_object (SWFDEC_AS_CONTEXT (player), NULL, s, s + strlen (s));
-  if (!SWFDEC_IS_MOVIE (ret)) {
-    SWFDEC_WARNING ("\"%s\" does not reference a movie", s);
-    return NULL;
-  }
-  return SWFDEC_MOVIE (ret);
-}
-
-/**
- * swfdec_action_get_movie_by_path:
- * @cx: a #SwfdecAsContext
- * @path: the path to look up
- * @object: pointer that takes the object that was looked up. The object may be 
- *          %NULL.
- * @variable: pointer that takes variable part of the path. The variable will 
- *            be either %NULL or a non-gc'ed variable name.
- *
- * Looks up a Flash4-compatible path using "/", ":" and "." style syntax.
- *
- * Returns: The #SwfdecMovie that was looked up or %NULL if the path does not 
- *          specify a valid movie.
- **/
-static gboolean
-swfdec_action_get_movie_by_path (SwfdecAsContext *cx, const char *path, 
-    SwfdecAsObject **object, const char **variable)
-{
-  SwfdecAsObject *movie;
-  char *end, *s;
-
-  g_assert (path != NULL);
-  g_assert (object != NULL); 
-  g_assert (variable != NULL);
-  g_assert (cx->frame != NULL);
-
-  /* find dot or colon */
-  end = strpbrk (path, ".:");
-
-  /* if no dot or colon, look up slash-path */
-  if (end == NULL) {
-    /* shortcut for the general case */
-    if (strchr (path, '/') != NULL) {
-      movie = swfdec_action_get_movie_by_slash_path (cx, path);
-      if (movie) {
-	*object = movie;
-	*variable = NULL;
-	return TRUE;
-      }
-    }
-
-    *object = NULL;
-    *variable = path;
-    return TRUE;
-  }
-  /* find last dot or colon */
-  while ((s = strpbrk (end + 1, ".:")) != NULL)
-    end = s;
-
-  /* variable to use is the part after the last dot or colon */
-  *variable = end + 1;
-  /* look up object for start of path */
-  if (path == end)
-    movie = NULL;
-  else
-    movie = swfdec_action_lookup_object (cx, NULL, path, end);
-  if (movie) {
-    *object = movie;
-    return TRUE;
-  } else {
-    *variable = NULL;
-    return FALSE;
-  }
-}
-
-static void
-swfdec_action_get_variable (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  const char *s;
-  SwfdecAsObject *object;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  s = swfdec_as_value_to_string (cx, val);
-  if (swfdec_action_get_movie_by_path (cx, s, &object, &s)) {
-    if (object) {
-      if (s) {
-	swfdec_as_object_get_variable (object, swfdec_as_context_get_string (cx, s), val);
-      } else {
-	SWFDEC_AS_VALUE_SET_OBJECT (val, object);
-      }
-    } else {
-      swfdec_as_frame_get_variable (cx->frame, swfdec_as_context_get_string (cx, s), val);
-    }
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-#ifdef SWFDEC_WARN_MISSING_PROPERTIES
-    SWFDEC_WARNING ("no variable named %s", s);
-#endif
-  }
-}
-
-static void
-swfdec_action_set_variable (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *s, *rest;
-  SwfdecAsObject *object;
-
-  s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-  if (swfdec_action_get_movie_by_path (cx, s, &object, &rest)) {
-    if (object && rest) {
-      swfdec_as_object_set_variable (object, swfdec_as_context_get_string (cx, rest), 
-	  swfdec_as_stack_peek (cx, 1));
-    } else {
-      if (object)
-	rest = s;
-      else
-	rest = swfdec_as_context_get_string (cx, rest);
-      swfdec_as_frame_set_variable (cx->frame, rest, swfdec_as_stack_peek (cx, 1));
-    }
-  }
-  swfdec_as_stack_pop_n (cx, 2);
-}
-
-/* FIXME: this sucks */
-extern struct {
-  gboolean needs_movie;
-  const char * name; /* GC'd */
-  void (* get) (SwfdecMovie *movie, SwfdecAsValue *ret);
-  void (* set) (SwfdecMovie *movie, const SwfdecAsValue *val);
-} swfdec_movieclip_props[];
-static void
-swfdec_action_get_property (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecMovie *movie;
-  guint id;
-
-  id = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_INFO ("tried using GetProperty in a non-SwfdecPlayer context");
-    goto error;
-  } else {
-    movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx),
-	swfdec_as_stack_peek (cx, 2));
-    if (movie == NULL)
-      goto error;
-  }
-  if (id > (cx->version > 4 ? 21 : 18)) {
-    SWFDEC_WARNING ("trying to SetProperty %u, doesn't exist", id);
-    goto error;
-  }
-  swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (movie), swfdec_movieclip_props[id].name,
-      swfdec_as_stack_peek (cx, 2));
-  swfdec_as_stack_pop (cx);
-  return;
-
-error :
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 1));
-}
-
-static void
-swfdec_action_set_property (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecMovie *movie;
-  guint id;
-
-  id = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-  if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_INFO ("tried using GetProperty in a non-SwfdecPlayer context");
-    goto error;
-  } else {
-    movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx),
-	swfdec_as_stack_peek (cx, 3));
-    if (movie == NULL)
-      goto error;
-  }
-  if (id > (cx->version > 4 ? 21 : 18)) {
-    SWFDEC_WARNING ("trying to SetProperty %u, doesn't exist", id);
-    goto error;
-  }
-  swfdec_as_object_set_variable (SWFDEC_AS_OBJECT (movie), swfdec_movieclip_props[id].name,
-      swfdec_as_stack_peek (cx, 1));
-  swfdec_as_stack_pop_n (cx, 3);
-  return;
-
-error :
-  swfdec_as_stack_pop_n (cx, 3);
-}
-
-static void
-swfdec_action_get_member (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsObject *object = swfdec_as_value_to_object (cx, swfdec_as_stack_peek (cx, 2));
-  if (object) {
-    const char *name;
-    name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-    swfdec_as_object_get_variable (object, name, swfdec_as_stack_peek (cx, 2));
-#ifdef SWFDEC_WARN_MISSING_PROPERTIES
-    if (SWFDEC_AS_VALUE_IS_UNDEFINED (swfdec_as_stack_peek (cx, 2))) {
-	SWFDEC_WARNING ("no variable named %s:%s", G_OBJECT_TYPE_NAME (object), name);
-    }
-#endif
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 2));
-  }
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_set_member (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (cx, 3))) {
-    const char *name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-    swfdec_as_object_set_variable (SWFDEC_AS_VALUE_GET_OBJECT (swfdec_as_stack_peek (cx, 3)),
-	name, swfdec_as_stack_peek (cx, 1));
-  }
-  swfdec_as_stack_pop_n (cx, 3);
-}
-
-static void
-swfdec_action_trace (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  const char *s;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  if (val->type == SWFDEC_AS_TYPE_UNDEFINED) {
-    s = SWFDEC_AS_STR_undefined;
-  } else if (val->type == SWFDEC_AS_TYPE_OBJECT &&
-      SWFDEC_IS_AS_STRING (swfdec_as_value_to_object (cx, val))) {
-    s = SWFDEC_AS_STRING (swfdec_as_value_to_object (cx, val))->string;
-  } else {
-    s = swfdec_as_value_to_string (cx, val);
-  }
-  swfdec_as_stack_pop (cx);
-  g_signal_emit_by_name (cx, "trace", s);
-}
-
-/* stack looks like this: [ function, this, arg1, arg2, ... ] */
-/* stack must be at least 2 elements big */
-static SwfdecAsFrame *
-swfdec_action_call (SwfdecAsContext *cx, guint n_args)
-{
-  SwfdecAsFrame *frame;
-  SwfdecAsFunction *fun;
-  SwfdecAsObject *thisp;
-
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (cx, 1)))
-    goto error;
-  fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (swfdec_as_stack_peek (cx, 1));
-  if (!SWFDEC_IS_AS_FUNCTION (fun))
-    goto error;
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (swfdec_as_stack_peek (cx, 2))) {
-    thisp = NULL;
-  } else {
-    thisp = SWFDEC_AS_VALUE_GET_OBJECT (swfdec_as_stack_peek (cx, 2));
-  }
-  swfdec_as_stack_pop_n (cx, 2);
-  /* sanitize argument count */
-  if (n_args >= swfdec_as_stack_get_size (cx))
-    n_args = swfdec_as_stack_get_size (cx);
-  frame = swfdec_as_function_call_no_preload (fun, thisp, n_args, NULL, NULL);
-  if (frame == NULL)
-    return NULL;
-  if (SWFDEC_IS_AS_SUPER (fun)) {
-    SWFDEC_LOG ("replacing super object on frame");
-    swfdec_as_super_new_chain (frame, SWFDEC_AS_SUPER (fun), NULL);
-  }
-  return frame;
-
-error:
-  n_args += 2;
-  if (n_args > swfdec_as_stack_get_size (cx))
-    n_args = swfdec_as_stack_get_size (cx);
-  swfdec_as_stack_pop_n (cx, n_args);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx));
-  return NULL;
-}
-
-static void
-swfdec_action_call_function (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsFrame *frame = cx->frame;
-  SwfdecAsObject *obj;
-  guint n_args;
-  const char *name;
-  SwfdecAsValue *fun, *thisp;
-  
-  swfdec_as_stack_ensure_size (cx, 2);
-  n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-  name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  thisp = swfdec_as_stack_peek (cx, 2);
-  fun = swfdec_as_stack_peek (cx, 1);
-  obj = swfdec_as_frame_get_variable (frame, name, fun);
-  if (obj) {
-    SWFDEC_AS_VALUE_SET_OBJECT (thisp, obj);
-  } else {
-    SWFDEC_AS_VALUE_SET_NULL (thisp);
-    SWFDEC_AS_VALUE_SET_UNDEFINED (fun);
-  }
-  frame = swfdec_action_call (cx, n_args);
-  if (frame) {
-    swfdec_as_frame_preload (frame);
-  } else {
-    SWFDEC_WARNING ("no function named %s", name);
-  }
-}
-
-static void
-swfdec_action_call_method (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsFrame *frame = cx->frame;
-  SwfdecAsValue *val;
-  SwfdecAsObject *obj;
-  SwfdecAsObject *pobj = NULL;
-  guint n_args;
-  const char *name;
-  
-  swfdec_as_stack_ensure_size (cx, 3);
-  obj = swfdec_as_value_to_object (cx, swfdec_as_stack_peek (cx, 2));
-  n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 3));
-  val = swfdec_as_stack_peek (cx, 1);
-  if (obj) {
-    name = swfdec_as_value_to_string (cx, val);
-    if (SWFDEC_AS_VALUE_IS_UNDEFINED (val) ||
-	name == SWFDEC_AS_STR_EMPTY) {
-      SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 3));
-      SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_peek (cx, 2), obj);
-      name = "";
-      pobj = obj;
-    } else {
-      SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_peek (cx, 3), obj);
-      swfdec_as_object_get_variable_and_flags (obj, name, swfdec_as_stack_peek (cx, 2), NULL, &pobj);
-    }
-  } else {
-    if (SWFDEC_AS_VALUE_IS_STRING (val))
-      name = SWFDEC_AS_VALUE_GET_STRING (val);
-    else
-      name = "???";
-    SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_peek (cx, 3));
-    SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 2));
-  }
-  swfdec_as_stack_pop (cx);
-  frame = swfdec_action_call (cx, n_args);
-  if (frame) {
-    /* setup super to point to the right prototype */
-    if (SWFDEC_IS_AS_SUPER (obj)) {
-      swfdec_as_super_new_chain (frame, SWFDEC_AS_SUPER (obj), name);
-    } else if (cx->version > 6) {
-      swfdec_as_super_new (frame, obj, pobj == obj ? obj->prototype : pobj);
-    } else {
-      swfdec_as_super_new (frame, obj, obj->prototype);
-    }
-    swfdec_as_frame_preload (frame);
-  } else {
-    SWFDEC_WARNING ("no function named \"%s\" on object %s", name, obj ? G_OBJECT_TYPE_NAME(obj) : "unknown");
-  }
-}
-
-static void
-swfdec_action_pop (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_binary (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  double l, r;
-
-  r = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1));
-  l = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 2));
-  switch (action) {
-    case SWFDEC_AS_ACTION_ADD:
-      l = l + r;
-      break;
-    case SWFDEC_AS_ACTION_SUBTRACT:
-      l = l - r;
-      break;
-    case SWFDEC_AS_ACTION_MULTIPLY:
-      l = l * r;
-      break;
-    case SWFDEC_AS_ACTION_DIVIDE:
-      if (cx->version < 5) {
-	if (r == 0) {
-	  swfdec_as_stack_pop (cx);
-	  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1), SWFDEC_AS_STR__ERROR_);
-	  return;
-	}
-      }
-      if (r == 0) {
-	if (l > 0)
-	  l = INFINITY;
-	else if (l < 0)
-	  l = -INFINITY;
-	else
-	  l = NAN;
-      } else {
-	l = l / r;
-      }
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
-  }
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), l);
-}
-
-static void
-swfdec_action_add2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *rval, *lval, rtmp, ltmp;
-
-  rval = swfdec_as_stack_peek (cx, 1);
-  lval = swfdec_as_stack_peek (cx, 2);
-  rtmp = *rval;
-  ltmp = *lval;
-  swfdec_as_value_to_primitive (&rtmp);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&rtmp) || SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&rtmp)))
-    rval = &rtmp;
-  swfdec_as_value_to_primitive (&ltmp);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&ltmp) || SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&ltmp)))
-    lval = &ltmp;
-
-  if (SWFDEC_AS_VALUE_IS_STRING (lval) || SWFDEC_AS_VALUE_IS_STRING (rval)) {
-    const char *lstr, *rstr;
-    lstr = swfdec_as_value_to_string (cx, lval);
-    rstr = swfdec_as_value_to_string (cx, rval);
-    lstr = swfdec_as_str_concat (cx, lstr, rstr);
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1), lstr);
-  } else {
-    double d, d2;
-    d = swfdec_as_value_to_number (cx, lval);
-    d2 = swfdec_as_value_to_number (cx, rval);
-    d += d2;
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), d);
-  }
-}
-
-static void
-swfdec_action_new_comparison (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *lval, *rval;
-  double l, r;
-
-  rval = swfdec_as_stack_peek (cx, 1);
-  lval = swfdec_as_stack_peek (cx, 2);
-
-  /* swap if we do a greater comparison */
-  if (action == SWFDEC_AS_ACTION_GREATER) {
-    SwfdecAsValue *tmp = lval;
-    lval = rval;
-    rval = tmp;
-  }
-  /* comparison with object is always false */
-  swfdec_as_value_to_primitive (lval);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (lval) &&
-      !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (lval))) {
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), FALSE);
-    return;
-  }
-  /* same for the rval */
-  swfdec_as_value_to_primitive (rval);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (rval) &&
-      !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (rval))) {
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), FALSE);
-    return;
-  }
-  /* movieclips are not objects, but they evaluate to NaN, so we can handle them here */
-  if (SWFDEC_AS_VALUE_IS_OBJECT (rval) ||
-      SWFDEC_AS_VALUE_IS_OBJECT (lval)) {
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 1));
-    return;
-  }
-  /* if both are strings, compare strings */
-  if (SWFDEC_AS_VALUE_IS_STRING (rval) &&
-      SWFDEC_AS_VALUE_IS_STRING (lval)) {
-    const char *ls = SWFDEC_AS_VALUE_GET_STRING (lval);
-    const char *rs = SWFDEC_AS_VALUE_GET_STRING (rval);
-    int cmp;
-    if (ls == SWFDEC_AS_STR_EMPTY) {
-      cmp = rs == SWFDEC_AS_STR_EMPTY ? 0 : 1;
-    } else if (rs == SWFDEC_AS_STR_EMPTY) {
-      cmp = -1;
-    } else {
-      cmp = strcmp (ls, rs);
-    }
-    swfdec_as_stack_pop (cx);
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cmp < 0);
-    return;
-  }
-  /* convert to numbers and compare those */
-  l = swfdec_as_value_to_number (cx, lval);
-  r = swfdec_as_value_to_number (cx, rval);
-  swfdec_as_stack_pop (cx);
-  /* NaN results in undefined */
-  if (isnan (l) || isnan (r)) {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 1));
-    return;
-  }
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), l < r);
-}
-
-static void
-swfdec_action_not (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (cx->version <= 4) {
-    double d = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1));
-    SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), d == 0 ? 1 : 0);
-  } else {
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), 
-	!swfdec_as_value_to_boolean (cx, swfdec_as_stack_peek (cx, 1)));
-  }
-}
-
-static void
-swfdec_action_jump (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  gint16 offset;
-
-  if (len != 2) {
-    SWFDEC_ERROR ("Jump action length invalid (is %u, should be 2", len);
-    return;
-  }
-  offset = data[0] | (data[1] << 8);
-  cx->frame->pc += 5 + (int) offset;
-}
-
-static void
-swfdec_action_if (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (len != 2) {
-    SWFDEC_ERROR ("Jump action length invalid (is %u, should be 2", len);
-    return;
-  }
-  if (swfdec_as_value_to_boolean (cx, swfdec_as_stack_peek (cx, 1))) {
-    gint16 offset = data[0] | (data[1] << 8);
-    cx->frame->pc += 5 + (int) offset;
-  }
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_decrement (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  SWFDEC_AS_VALUE_SET_NUMBER (val, swfdec_as_value_to_number (cx, val) - 1);
-}
-
-static void
-swfdec_action_increment (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  SWFDEC_AS_VALUE_SET_NUMBER (val, swfdec_as_value_to_number (cx, val) + 1);
-}
-
-static void
-swfdec_action_get_url (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-  char *url, *target;
-
-  swfdec_bits_init_data (&bits, data, len);
-  url = swfdec_bits_get_string (&bits, cx->version);
-  target = swfdec_bits_get_string (&bits, cx->version);
-  if (url == NULL || target == NULL) {
-    SWFDEC_ERROR ("not enough data in GetURL");
-    g_free (url);
-    g_free (target);
-    return;
-  }
-  if (swfdec_bits_left (&bits)) {
-    SWFDEC_WARNING ("leftover bytes in GetURL action");
-  }
-  if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_ERROR ("GetURL without a SwfdecPlayer");
-  } else {
-    swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, 
-	SWFDEC_LOADER_REQUEST_DEFAULT, NULL, NULL, FALSE);
-  }
-  g_free (url);
-  g_free (target);
-}
-
-static void
-swfdec_as_interpret_load_variables_on_finish (SwfdecAsObject *target,
-    const char *text)
-{
-  if (text != NULL)
-    swfdec_as_object_decode (target, text);
-
-  // only call onData for sprite movies
-  // FIXME: is it called even when loading fails?
-  swfdec_movie_queue_script (SWFDEC_MOVIE (target), SWFDEC_EVENT_DATA);
-}
-
-static void
-swfdec_action_get_url2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *target, *url;
-  guint method, internal, variables;
-
-  if (len != 1) {
-    SWFDEC_ERROR ("GetURL2 requires 1 byte of data, not %u", len);
-    return;
-  }
-
-  method = data[0] & 3;
-  if (method == 3) {
-    SWFDEC_ERROR ("GetURL method 3 invalid");
-    method = 0;
-  }
-  internal = data[0] & 64;
-  variables = data[0] & 128;
-  if (method == 1 || method == 2) {
-    SWFDEC_FIXME ("encode variables");
-  }
-
-  target = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  url = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-
-  if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_ERROR ("GetURL2 action requires a SwfdecPlayer");
-  } else if (variables) {
-    SwfdecMovie *movie;
-    
-    movie = swfdec_player_get_movie_from_string (SWFDEC_PLAYER (cx), target);
-    if (movie != NULL) {
-      swfdec_load_object_create (SWFDEC_AS_OBJECT (movie), url, method, NULL, NULL,
-	  swfdec_as_interpret_load_variables_on_finish);
-    }
-  } else {
-    swfdec_resource_load (SWFDEC_PLAYER (cx), target, url, method, NULL, NULL, internal);
-  }
-
-  swfdec_as_stack_pop_n (cx, 2);
-}
-
-static void
-swfdec_action_string_add (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *lval, *rval;
-
-  rval = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  lval = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-  lval = swfdec_as_str_concat (cx, lval, rval);
-  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 2), lval);
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_push_duplicate (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val = swfdec_as_stack_peek (cx, 1);
-
-  *swfdec_as_stack_push (cx) = *val;
-}
-
-static void
-swfdec_action_random_number (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  gint32 max;
-  SwfdecAsValue *val;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  max = swfdec_as_value_to_integer (cx, val);
-  
-  if (max <= 0)
-    SWFDEC_AS_VALUE_SET_NUMBER (val, 0);
-  else
-    SWFDEC_AS_VALUE_SET_NUMBER (val, g_rand_int_range (cx->rand, 0, max));
-}
-
-static void
-swfdec_action_old_compare (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  double l, r;
-  gboolean cond;
-
-  l = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 2));
-  r = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1));
-  switch (action) {
-    case SWFDEC_AS_ACTION_EQUALS:
-      cond = l == r;
-      break;
-    case SWFDEC_AS_ACTION_LESS:
-      cond = l < r;
-      break;
-    default: 
-      g_assert_not_reached ();
-      return;
-  }
-  swfdec_as_stack_pop (cx);
-  if (cx->version < 5) {
-    SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), cond ? 1 : 0);
-  } else {
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cond);
-  }
-}
-
-static void
-swfdec_action_string_extract (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  int start, n, left;
-  const char *s;
-
-  n = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  start = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-  s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 3));
-  swfdec_as_stack_pop_n (cx, 2);
-  left = g_utf8_strlen (s, -1);
-  if (start > left) {
-    SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1), SWFDEC_AS_STR_EMPTY);
-    return;
-  } else if (start < 2) {
-    start = 0;
-  } else {
-    start--;
-  }
-  left -= start;
-  if (n < 0 || n > left)
-    n = left;
-
-  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1),
-      swfdec_as_str_sub (cx, s, start, n));
-}
-
-static void
-swfdec_action_string_length (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *s;
-  SwfdecAsValue *v;
-
-  v = swfdec_as_stack_peek (cx, 1);
-  s = swfdec_as_value_to_string (cx, v);
-  SWFDEC_AS_VALUE_SET_INT (v, g_utf8_strlen (s, -1));  
-}
-
-static void
-swfdec_action_string_compare (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *l, *r;
-  gboolean cond;
-
-  r = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  l = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-  switch (action) {
-    case SWFDEC_AS_ACTION_STRING_EQUALS:
-      cond = l == r;
-      break;
-    case SWFDEC_AS_ACTION_STRING_LESS:
-      cond = strcmp (l, r) < 0;
-      break;
-    default:
-      cond = FALSE;
-      g_assert_not_reached ();
-      break;
-  }
-  swfdec_as_stack_pop (cx);
-  if (cx->version < 5) {
-    SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), cond ? 1 : 0);
-  } else {
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cond);
-  }
-}
-
-static void
-swfdec_action_equals2_5 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *rval, *lval;
-  SwfdecAsValue rtmp, ltmp;
-  SwfdecAsValueType ltype, rtype;
-  double l, r;
-  gboolean cond;
-
-  rval = swfdec_as_stack_peek (cx, 1);
-  lval = swfdec_as_stack_peek (cx, 2);
-  rtmp = *rval;
-  ltmp = *lval;
-  swfdec_as_value_to_primitive (&rtmp);
-  swfdec_as_value_to_primitive (&ltmp);
-  ltype = ltmp.type;
-  rtype = rtmp.type;
-  
-  /* get objects compared */
-  if (ltype == SWFDEC_AS_TYPE_OBJECT && rtype == SWFDEC_AS_TYPE_OBJECT) {
-    SwfdecAsObject *lo = SWFDEC_AS_VALUE_GET_OBJECT (&ltmp);
-    SwfdecAsObject *ro = SWFDEC_AS_VALUE_GET_OBJECT (&rtmp);
-
-    if (SWFDEC_IS_MOVIE (lo) && SWFDEC_IS_MOVIE (ro)) {
-      lo = SWFDEC_AS_OBJECT (swfdec_movie_resolve (SWFDEC_MOVIE (lo)));
-      ro = SWFDEC_AS_OBJECT (swfdec_movie_resolve (SWFDEC_MOVIE (ro)));
-    } else if (SWFDEC_IS_MOVIE (lo)) {
-      swfdec_as_value_to_primitive (rval);
-      rtype = rval->type;
-      if (rtype != SWFDEC_AS_TYPE_OBJECT) {
-	cond = FALSE;
-	goto out;
-      }
-      ro = SWFDEC_AS_VALUE_GET_OBJECT (rval);
-    } else if (SWFDEC_IS_MOVIE (ro)) {
-      swfdec_as_value_to_primitive (lval);
-      ltype = lval->type;
-      if (ltype != SWFDEC_AS_TYPE_OBJECT) {
-	cond = FALSE;
-	goto out;
-      }
-      lo = SWFDEC_AS_VALUE_GET_OBJECT (lval);
-    } else {
-      lo = SWFDEC_AS_VALUE_GET_OBJECT (lval);
-      ro = SWFDEC_AS_VALUE_GET_OBJECT (rval);
-    }
-    cond = lo == ro;
-    goto out;
-  }
-
-  /* compare strings */
-  if (ltype == SWFDEC_AS_TYPE_STRING && rtype == SWFDEC_AS_TYPE_STRING) {
-    /* FIXME: flash 5 case insensitive? */
-    cond = SWFDEC_AS_VALUE_GET_STRING (&ltmp) == SWFDEC_AS_VALUE_GET_STRING (&rtmp);
-    goto out;
-  }
-
-  /* convert to numbers */
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&ltmp) && !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&ltmp))) {
-    l = swfdec_as_value_to_number (cx, lval);
-  } else {
-    l = swfdec_as_value_to_number (cx, &ltmp);
-  }
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&rtmp) && !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&rtmp))) {
-    r = swfdec_as_value_to_number (cx, rval);
-  } else {
-    r = swfdec_as_value_to_number (cx, &rtmp);
-  }
-
-  /* get rid of undefined and null */
-  cond = rtype == SWFDEC_AS_TYPE_UNDEFINED || rtype == SWFDEC_AS_TYPE_NULL;
-  if (ltype == SWFDEC_AS_TYPE_UNDEFINED || ltype == SWFDEC_AS_TYPE_NULL) {
-    goto out;
-  } else if (cond) {
-    cond = FALSE;
-    goto out;
-  }
-
-  /* else compare as numbers */
-  if (isnan (l) && isnan (r))
-    cond = ltype == rtype;
-  else
-    cond = l == r;
-
-out:
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cond);
-}
-
-static void
-swfdec_action_equals2_6 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *rval, *lval;
-  SwfdecAsValueType ltype, rtype;
-  double l, r;
-  gboolean cond;
-
-  rval = swfdec_as_stack_peek (cx, 1);
-  lval = swfdec_as_stack_peek (cx, 2);
-  ltype = lval->type;
-  rtype = rval->type;
-  
-  /* get objects compared */
-  if (ltype == SWFDEC_AS_TYPE_OBJECT && rtype == SWFDEC_AS_TYPE_OBJECT) {
-    SwfdecAsObject *lo = SWFDEC_AS_VALUE_GET_OBJECT (lval);
-    SwfdecAsObject *ro = SWFDEC_AS_VALUE_GET_OBJECT (rval);
-
-    if (SWFDEC_IS_MOVIE (lo) && SWFDEC_IS_MOVIE (ro)) {
-      lo = SWFDEC_AS_OBJECT (swfdec_movie_resolve (SWFDEC_MOVIE (lo)));
-      ro = SWFDEC_AS_OBJECT (swfdec_movie_resolve (SWFDEC_MOVIE (ro)));
-    } else if (SWFDEC_IS_MOVIE (lo)) {
-      swfdec_as_value_to_primitive (rval);
-      rtype = rval->type;
-      if (rtype != SWFDEC_AS_TYPE_OBJECT) {
-	cond = FALSE;
-	goto out;
-      }
-      ro = SWFDEC_AS_VALUE_GET_OBJECT (rval);
-    } else if (SWFDEC_IS_MOVIE (ro)) {
-      swfdec_as_value_to_primitive (lval);
-      ltype = lval->type;
-      if (ltype != SWFDEC_AS_TYPE_OBJECT) {
-	cond = FALSE;
-	goto out;
-      }
-      lo = SWFDEC_AS_VALUE_GET_OBJECT (lval);
-    }
-    cond = lo == ro;
-    goto out;
-  }
-
-  /* if one of the values is an object, call valueOf. 
-   * If it's still an object, return FALSE */
-  swfdec_as_value_to_primitive (lval);
-  ltype = lval->type;
-  if (ltype == SWFDEC_AS_TYPE_OBJECT) {
-    cond = FALSE;
-    goto out;
-  }
-  swfdec_as_value_to_primitive (rval);
-  rtype = rval->type;
-  if (rtype == SWFDEC_AS_TYPE_OBJECT) {
-    cond = FALSE;
-    goto out;
-  }
-  /* now we have a comparison without objects */
-
-  /* get rid of undefined and null */
-  cond = rtype == SWFDEC_AS_TYPE_UNDEFINED || rtype == SWFDEC_AS_TYPE_NULL;
-  if (ltype == SWFDEC_AS_TYPE_UNDEFINED || ltype == SWFDEC_AS_TYPE_NULL) {
-    goto out;
-  } else if (cond) {
-    cond = FALSE;
-    goto out;
-  }
-
-  /* compare strings */
-  if (ltype == SWFDEC_AS_TYPE_STRING && rtype == SWFDEC_AS_TYPE_STRING) {
-    /* FIXME: flash 5 case insensitive? */
-    cond = SWFDEC_AS_VALUE_GET_STRING (lval) == SWFDEC_AS_VALUE_GET_STRING (rval);
-    goto out;
-  }
-
-  /* else compare as numbers */
-  l = swfdec_as_value_to_number (cx, lval);
-  r = swfdec_as_value_to_number (cx, rval);
-
-  if (isnan (l) && isnan (r))
-    cond = ltype == rtype;
-  else
-    cond = l == r;
-
-out:
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cond);
-}
-
-static void
-swfdec_action_equals2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (cx->version <= 5) {
-    swfdec_action_equals2_5 (cx, action, data, len);
-  } else {
-    swfdec_action_equals2_6 (cx, action, data, len);
-  }
-}
-
-static void
-swfdec_action_strict_equals (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *rval, *lval;
-  gboolean cond;
-
-  rval = swfdec_as_stack_peek (cx, 1);
-  lval = swfdec_as_stack_peek (cx, 2);
-
-  if (rval->type != lval->type) {
-    cond = FALSE;
-  } else {
-    switch (rval->type) {
-      case SWFDEC_AS_TYPE_UNDEFINED:
-      case SWFDEC_AS_TYPE_NULL:
-	cond = TRUE;
-	break;
-      case SWFDEC_AS_TYPE_BOOLEAN:
-	cond = SWFDEC_AS_VALUE_GET_BOOLEAN (rval) == SWFDEC_AS_VALUE_GET_BOOLEAN (lval);
-	break;
-      case SWFDEC_AS_TYPE_NUMBER:
-	{
-	  double l, r;
-	  r = SWFDEC_AS_VALUE_GET_NUMBER (rval);
-	  l = SWFDEC_AS_VALUE_GET_NUMBER (lval);
-	  cond = (l == r) || (isnan (l) && isnan (r));
-	}
-	break;
-      case SWFDEC_AS_TYPE_STRING:
-	cond = SWFDEC_AS_VALUE_GET_STRING (rval) == SWFDEC_AS_VALUE_GET_STRING (lval);
-	break;
-      case SWFDEC_AS_TYPE_OBJECT:
-	{
-	  SwfdecAsObject *lo = SWFDEC_AS_VALUE_GET_OBJECT (lval);
-	  SwfdecAsObject *ro = SWFDEC_AS_VALUE_GET_OBJECT (rval);
-	  if (SWFDEC_IS_MOVIE (lo) && SWFDEC_IS_MOVIE (ro)) {
-	    cond = swfdec_movie_resolve (SWFDEC_MOVIE (lo)) == swfdec_movie_resolve (SWFDEC_MOVIE (ro));
-	  } else if (!SWFDEC_IS_MOVIE (lo) && !SWFDEC_IS_MOVIE (ro)) {
-	    cond = lo == ro;
-	  } else {
-	    cond = FALSE;
-	  }
-	}
-	break;
-      case SWFDEC_AS_TYPE_INT:
-      default:
-	g_assert_not_reached ();
-	cond = FALSE;
-    }
-  }
-
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 1), cond);
-}
-
-static void
-swfdec_action_do_set_target (SwfdecAsContext *cx, const char *target, const char *end)
-{
-  swfdec_as_frame_set_target (cx->frame, NULL);
-
-  if (target != end) {
-    SwfdecAsObject *o = swfdec_action_lookup_object (cx, NULL, target, end);
-    if (o == NULL) {
-      SWFDEC_WARNING ("target \"%s\" is not an object", target);
-    } else if (!SWFDEC_IS_MOVIE (o)) {
-      SWFDEC_FIXME ("target \"%s\" is not a movie, something weird is supposed to happen now", target);
-      o = NULL;
-    }
-    swfdec_as_frame_set_target (cx->frame, o);
-  }
-}
-
-static void
-swfdec_action_set_target (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  char *end;
-
-  end = memchr (data, 0, len);
-  if (end == NULL) {
-    SWFDEC_ERROR ("SetTarget action does not specify a string");
-    return;
-  }
-  swfdec_action_do_set_target (cx, (const char *) data, end);
-}
-
-static void
-swfdec_action_set_target2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  const char *s;
-
-  s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  swfdec_action_do_set_target (cx, s, s + strlen (s));
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_start_drag (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecRect rect, *rectp = NULL;
-  SwfdecMovie *movie;
-  gboolean center;
-  guint stack_size = 3;
-
-  swfdec_as_stack_ensure_size (cx, 3);
-  center = swfdec_as_value_to_boolean (cx, swfdec_as_stack_peek (cx, 2));
-  if (swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 3))) {
-    swfdec_as_stack_ensure_size (cx, 7);
-    rect.x0 = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 7));
-    rect.y0 = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 6));
-    rect.x1 = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 5));
-    rect.y1 = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 4));
-    swfdec_rect_scale (&rect, &rect, SWFDEC_TWIPS_SCALE_FACTOR);
-    stack_size = 7;
-    rectp = &rect;
-  }
-  if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_ERROR ("called startDrag on a non-SwfdecPlayer");
-  } else {
-    movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx), swfdec_as_stack_peek (cx, 1));
-    if (movie != NULL) {
-      swfdec_player_set_drag_movie (SWFDEC_PLAYER (cx), movie, center, rectp);
-    } else {
-      SWFDEC_ERROR ("startDrag on something not a Movie");
-    }
-  }
-  swfdec_as_stack_pop_n (cx, stack_size);
-}
-
-static void
-swfdec_action_end_drag (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_PLAYER (cx)) {
-    swfdec_player_set_drag_movie (SWFDEC_PLAYER (cx), NULL, FALSE, NULL);
-  } else {
-    SWFDEC_WARNING ("can't end a drag on non-players");
-  }
-}
-
-static void
-swfdec_action_stop_sounds (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (SWFDEC_IS_PLAYER (cx)) {
-    swfdec_player_stop_all_sounds (SWFDEC_PLAYER (cx));
-  }
-}
-
-static void
-swfdec_action_new_object (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *constructor;
-  SwfdecAsFunction *fun;
-  guint n_args;
-
-  swfdec_as_stack_ensure_size (cx, 2);
-  swfdec_action_get_variable (cx, action, data, len);
-  constructor = swfdec_as_stack_peek (cx, 1);
-  n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-  n_args = MIN (swfdec_as_stack_get_size (cx) - 2, n_args);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (constructor) ||
-      !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (constructor))) {
-    SWFDEC_WARNING ("not a constructor");
-    goto fail;
-  }
-
-  swfdec_as_stack_pop_n (cx, 2);
-  swfdec_as_object_create (fun, n_args, NULL, NULL);
-  return;
-
-fail:
-  swfdec_as_stack_pop_n (cx, n_args + 1);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 1));
-}
-
-static void
-swfdec_action_new_method (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *constructor;
-  SwfdecAsFunction *fun;
-  guint n_args;
-  const char *name;
-
-  swfdec_as_stack_ensure_size (cx, 3);
-  name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-
-  constructor = swfdec_as_stack_peek (cx, 2);
-  n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 3));
-  n_args = MIN (swfdec_as_stack_get_size (cx) - 3, n_args);
-  if (name != SWFDEC_AS_STR_EMPTY) {
-    if (!SWFDEC_AS_VALUE_IS_OBJECT (constructor)) {
-      SWFDEC_WARNING ("NewMethod called without an object to get variable %s from", name);
-      goto fail;
-    }
-    swfdec_as_object_get_variable (SWFDEC_AS_VALUE_GET_OBJECT (constructor),
-	name, constructor);
-  }
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (constructor) ||
-      !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (constructor))) {
-    SWFDEC_WARNING ("%s is not a constructor", name);
-    goto fail;
-  }
-
-  swfdec_as_stack_pop_n (cx, 3);
-  swfdec_as_object_create (fun, n_args, NULL, NULL);
-  return;
-
-fail:
-  swfdec_as_stack_pop_n (cx, n_args + 2);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (cx, 1));
-}
-
-static void
-swfdec_action_init_object (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsObject *object;
-  guint i, n_args, size;
-
-  n_args = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  swfdec_as_stack_pop (cx);
-  if (n_args * 2 > swfdec_as_stack_get_size (cx)) {
-    size = swfdec_as_stack_get_size (cx);
-    SWFDEC_FIXME ("InitObject action with too small stack, help!");
-    n_args = size / 2;
-    size &= 1;
-  } else {
-    size = 0;
-  }
-
-  object = swfdec_as_object_new (cx);
-  if (object == NULL)
-    return;
-  for (i = 0; i < n_args; i++) {
-    const char *s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-    swfdec_as_object_set_variable (object, s, swfdec_as_stack_peek (cx, 1));
-    swfdec_as_stack_pop_n (cx, 2);
-  }
-  swfdec_as_stack_pop_n (cx, size);
-  SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (cx), object);
-}
-
-static void
-swfdec_action_init_array (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  int i, n;
-  SwfdecAsObject *array;
-
-  swfdec_as_stack_ensure_size (cx, 1);
-  n = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  swfdec_as_stack_pop (cx);
-  array = swfdec_as_array_new (cx);
-  if (array == NULL)
-    return;
-  /* NB: we can't increase the stack here, as the number can easily be MAXINT */
-  for (i = 0; i < n && swfdec_as_stack_get_size (cx) > 0; i++) {
-    swfdec_as_stack_ensure_size (cx, 1);
-    swfdec_as_array_push (SWFDEC_AS_ARRAY (array), swfdec_as_stack_pop (cx));
-  }
-  if (i != n) {
-    SwfdecAsValue val;
-    SWFDEC_AS_VALUE_SET_INT (&val, i);
-    swfdec_as_object_set_variable (array, SWFDEC_AS_STR_length, &val);
-  }
-  SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (cx), array);
-}
-
-static void
-swfdec_action_define_function (SwfdecAsContext *cx, guint action,
-    const guint8 *data, guint len)
-{
-  char *function_name;
-  const char *name = NULL;
-  guint i, n_args, size, n_registers;
-  SwfdecBits bits;
-  SwfdecBuffer *buffer;
-  SwfdecAsFunction *fun;
-  SwfdecAsFrame *frame;
-  SwfdecScript *script;
-  guint flags = 0;
-  SwfdecScriptArgument *args;
-  gboolean v2 = (action == 0x8e);
-
-  frame = cx->frame;
-  swfdec_bits_init_data (&bits, data, len);
-  function_name = swfdec_bits_get_string (&bits, cx->version);
-  if (function_name == NULL) {
-    SWFDEC_ERROR ("could not parse function name");
-    return;
-  }
-  n_args = swfdec_bits_get_u16 (&bits);
-  if (v2) {
-    n_registers = swfdec_bits_get_u8 (&bits);
-    if (n_registers == 0)
-      n_registers = 4;
-    flags = swfdec_bits_get_u16 (&bits);
-  } else {
-    n_registers = 5;
-  }
-  if (n_args) {
-    args = g_new0 (SwfdecScriptArgument, n_args);
-    for (i = 0; i < n_args && swfdec_bits_left (&bits); i++) {
-      if (v2) {
-	args[i].preload = swfdec_bits_get_u8 (&bits);
-	if (args[i].preload && args[i].preload >= n_registers) {
-	  SWFDEC_ERROR ("argument %u cannot be preloaded into register %u out of %u", 
-	      i, args[i].preload, n_registers);
-	  /* FIXME: figure out correct error handling here */
-	  args[i].preload = 0;
-	}
-      }
-      args[i].name = swfdec_bits_get_string (&bits, cx->version);
-      if (args[i].name == NULL || args[i].name == '\0') {
-	SWFDEC_ERROR ("empty argument name not allowed");
-	g_free (args);
-	return;
-      }
-      /* FIXME: check duplicate arguments */
-    }
-  } else {
-    args = NULL;
-  }
-  size = swfdec_bits_get_u16 (&bits);
-  /* check the script can be created */
-  if (frame->script->buffer->data + frame->script->buffer->length < frame->pc + 3 + len + size) {
-    SWFDEC_ERROR ("size of function is too big");
-    g_free (args);
-    g_free (function_name);
-    return;
-  }
-  /* create the script */
-  buffer = swfdec_buffer_new_subbuffer (frame->script->buffer, 
-      frame->pc + 3 + len - frame->script->buffer->data, size);
-  swfdec_bits_init (&bits, buffer);
-  if (*function_name) {
-    name = function_name;
-  } else if (swfdec_as_stack_get_size (cx) > 0) {
-    /* This is kind of a hack that uses a feature of the Adobe compiler:
-     * foo = function () {} is compiled as these actions:
-     * Push "foo", DefineFunction, SetVariable/SetMember
-     * With this knowledge we can inspect the topmost stack member, since
-     * it will contain the name this function will soon be assigned to.
-     */
-    if (SWFDEC_AS_VALUE_IS_STRING (swfdec_as_stack_peek (cx, 1)))
-      name = SWFDEC_AS_VALUE_GET_STRING (swfdec_as_stack_peek (cx, 1));
-  }
-  if (name == NULL)
-    name = "unnamed_function";
-  script = swfdec_script_new_from_bits (&bits, name, cx->version);
-  swfdec_buffer_unref (buffer);
-  if (script == NULL) {
-    SWFDEC_ERROR ("failed to create script");
-    g_free (args);
-    g_free (function_name);
-    return;
-  }
-  if (frame->constant_pool_buffer)
-    script->constant_pool = swfdec_buffer_ref (frame->constant_pool_buffer);
-  script->flags = flags;
-  script->n_registers = n_registers;
-  script->n_arguments = n_args;
-  script->arguments = args;
-  /* see function-scope tests */
-  if (cx->version > 5) {
-    /* FIXME: or original target? */
-    fun = swfdec_as_script_function_new (frame->original_target, frame->scope_chain, script);
-  } else {
-    fun = swfdec_as_script_function_new (frame->original_target, NULL, script);
-  }
-  if (fun == NULL)
-    return;
-  /* This is a hack that should only trigger for functions defined in the init scripts.
-   * It is supposed to ensure that those functions inherit their target when being 
-   * called instead of when being defined */
-  if (!SWFDEC_IS_MOVIE (frame->original_target))
-    SWFDEC_AS_SCRIPT_FUNCTION (fun)->target = NULL;
-  /* attach the function */
-  if (*function_name == '\0') {
-    swfdec_as_stack_ensure_free (cx, 1);
-    SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (cx), SWFDEC_AS_OBJECT (fun));
-  } else {
-    SwfdecAsValue funval;
-    /* FIXME: really varobj? Not eval or sth like that? */
-    name = swfdec_as_context_get_string (cx, function_name);
-    SWFDEC_AS_VALUE_SET_OBJECT (&funval, SWFDEC_AS_OBJECT (fun));
-    swfdec_as_object_set_variable (frame->target, name, &funval);
-  }
-
-  /* update current context */
-  frame->pc += 3 + len + size;
-  g_free (function_name);
-}
-
-static void
-swfdec_action_bitwise (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  int a, b;
-
-  a = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  b = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-
-  switch (action) {
-    case 0x60:
-      a = (int) (a & b);
-      break;
-    case 0x61:
-      a = (int) (a | b);
-      break;
-    case 0x62:
-      a = (int) (a ^ b);
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
-  }
-
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_peek (cx, 1), a);
-}
-
-static void
-swfdec_action_shift (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  int amount, value;
-
-  amount = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1));
-  amount &= 31;
-  value = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 2));
-
-  switch (action) {
-    case 0x63:
-      value = value << amount;
-      break;
-    case 0x64:
-      value = ((gint) value) >> amount;
-      break;
-    case 0x65:
-      value = ((guint) value) >> amount;
-      break;
-    default:
-      g_assert_not_reached ();
-  }
-
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_peek (cx, 1), value);
-}
-
-static void
-swfdec_action_to_integer (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val = swfdec_as_stack_peek (cx, 1);
-
-  SWFDEC_AS_VALUE_SET_INT (val, swfdec_as_value_to_integer (cx, val));
-}
-
-static void
-swfdec_action_target_path (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  SwfdecMovie *movie;
-  char *s;
-
-  val = swfdec_as_stack_peek (cx, 1);
-
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (val) ||
-      !SWFDEC_IS_MOVIE (movie = (SwfdecMovie *) SWFDEC_AS_VALUE_GET_OBJECT (val))) {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-    return;
-  }
-  s = swfdec_movie_get_path (movie, TRUE);
-  SWFDEC_AS_VALUE_SET_STRING (val, swfdec_as_context_give_string (cx, s));
-}
-
-static void
-swfdec_action_define_local (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsObject *target;
-  const char *name;
-
-  name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-  if (cx->frame->is_local) {
-    target = SWFDEC_AS_OBJECT (cx->frame);
-  } else {
-    target = cx->frame->target;
-  }
-  swfdec_as_object_set_variable (target, name,
-      swfdec_as_stack_peek (cx, 1));
-  swfdec_as_stack_pop_n (cx, 2);
-}
-
-static void
-swfdec_action_define_local2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue val = { 0, };
-  SwfdecAsObject *target;
-  const char *name;
-
-  name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  if (cx->frame->is_local) {
-    target = SWFDEC_AS_OBJECT (cx->frame);
-  } else {
-    target = cx->frame->target;
-  }
-  swfdec_as_object_set_variable (target, name, &val);
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_return (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  swfdec_as_frame_return (cx->frame, swfdec_as_stack_pop (cx));
-}
-
-static void
-swfdec_action_delete (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  const char *name;
-  gboolean success = FALSE;
-  
-  name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1));
-  val = swfdec_as_stack_peek (cx, 2);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    success = swfdec_as_object_delete_variable (
-	SWFDEC_AS_VALUE_GET_OBJECT (val), name) == SWFDEC_AS_DELETE_DELETED;
-  }
-  SWFDEC_AS_VALUE_SET_BOOLEAN (val, success);
-  swfdec_as_stack_pop_n (cx, 1);
-}
-
-static void
-swfdec_action_delete2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  const char *name;
-  gboolean success = FALSE;
-  
-  val = swfdec_as_stack_peek (cx, 1);
-  name = swfdec_as_value_to_string (cx, val);
-  success = swfdec_as_frame_delete_variable (cx->frame, name) == SWFDEC_AS_DELETE_DELETED;
-  SWFDEC_AS_VALUE_SET_BOOLEAN (val, success);
-}
-
-static void
-swfdec_action_store_register (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (len != 1) {
-    SWFDEC_ERROR ("StoreRegister action requires a length of 1, but got %u", len);
-    return;
-  }
-  if (!swfdec_action_has_register (cx, *data)) {
-    SWFDEC_ERROR ("Cannot store into register %u, not enough registers", (guint) *data);
-    return;
-  }
-  cx->frame->registers[*data] = *swfdec_as_stack_peek (cx, 1);
-}
-
-static void
-swfdec_action_modulo (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  double x, y;
-
-  y = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1));
-  x = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 2));
-  /* yay, we're portable! */
-  if (y == 0.0) {
-    x = NAN;
-  } else {
-    errno = 0;
-    x = fmod (x, y);
-    if (errno != 0) {
-      SWFDEC_FIXME ("errno set after fmod");
-    }
-  }
-  swfdec_as_stack_pop (cx);
-  SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1), x);
-}
-
-static void
-swfdec_action_swap (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  swfdec_as_stack_swap (cx, 1, 2);
-}
-
-static void
-swfdec_action_to_number (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SWFDEC_AS_VALUE_SET_NUMBER (swfdec_as_stack_peek (cx, 1),
-      swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1)));
-}
-
-static void
-swfdec_action_to_string (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_peek (cx, 1),
-      swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 1)));
-}
-
-static void
-swfdec_action_type_of (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  const char *type;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  switch (val->type) {
-    case SWFDEC_AS_TYPE_NUMBER:
-      type = SWFDEC_AS_STR_number;
-      break;
-    case SWFDEC_AS_TYPE_BOOLEAN:
-      type = SWFDEC_AS_STR_boolean;
-      break;
-    case SWFDEC_AS_TYPE_STRING:
-      type = SWFDEC_AS_STR_string;
-      break;
-    case SWFDEC_AS_TYPE_UNDEFINED:
-      type = SWFDEC_AS_STR_undefined;
-      break;
-    case SWFDEC_AS_TYPE_NULL:
-      type = SWFDEC_AS_STR_null;
-      break;
-    case SWFDEC_AS_TYPE_OBJECT:
-      {
-	SwfdecAsObject *obj = SWFDEC_AS_VALUE_GET_OBJECT (val);
-	if (SWFDEC_IS_MOVIE (obj)) {
-	  if (SWFDEC_IS_TEXT_FIELD_MOVIE (obj)) {
-	    type = SWFDEC_AS_STR_object;
-	  } else {
-	    type = SWFDEC_AS_STR_movieclip;
-	  }
-	} else if (SWFDEC_IS_AS_FUNCTION (obj)) {
-	  type = SWFDEC_AS_STR_function;
-	} else {
-	  type = SWFDEC_AS_STR_object;
-	}
-      }
-      break;
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      type = SWFDEC_AS_STR_EMPTY;
-      break;
-  }
-  SWFDEC_AS_VALUE_SET_STRING (val, type);
-}
-
-static void
-swfdec_action_get_time (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  GTimeVal tv;
-  gulong diff;
-
-  swfdec_as_context_get_time (cx, &tv);
-  /* we assume here that swfdec_as_context_get_time always returns a tv > start_time */
-  diff = tv.tv_sec - cx->start_time.tv_sec;
-  if (diff > G_MAXULONG / 1000 - 1) {
-    SWFDEC_ERROR ("FIXME: time overflow");
-  }
-  diff *= 1000;
-  diff = diff + (tv.tv_usec - cx->start_time.tv_usec) / 1000;
-
-  SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_push (cx), diff);
-}
-
-static gboolean
-swfdec_action_is_instance_of (SwfdecAsObject *object,
-    SwfdecAsObject *constructor)
-{
-  SwfdecAsValue val;
-  SwfdecAsObject *class, *prototype;
-  GSList *iter;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (constructor), FALSE);
-
-  // FIXME: propflag tests are wrong, and we shouldn't get __proto__.prototype
-  swfdec_as_object_get_variable (constructor, SWFDEC_AS_STR_prototype, &val);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
-    return FALSE;
-  prototype = SWFDEC_AS_VALUE_GET_OBJECT (&val);
-
-  class = object;
-  while ((class = swfdec_as_object_get_prototype (class)) != NULL) {
-    if (class == prototype)
-      return TRUE;
-    for (iter = class->interfaces; iter != NULL; iter = iter->next) {
-      if (iter->data == prototype)
-	return TRUE;
-    }
-  }
-
-  return FALSE;
-}
-
-static void
-swfdec_action_instance_of (SwfdecAsContext *cx, guint action,
-    const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  SwfdecAsObject *object, *constructor;
-
-  val = swfdec_as_stack_pop (cx);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    constructor = SWFDEC_AS_VALUE_GET_OBJECT (val);
-  } else {
-    constructor = NULL;
-  }
-
-  val = swfdec_as_stack_pop (cx);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    object = SWFDEC_AS_VALUE_GET_OBJECT (val);
-  } else {
-    object = NULL;
-  }
-
-
-  if (object == NULL || constructor == NULL) {
-    SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_push (cx), FALSE);
-    return;
-  }
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_push (cx),
-      swfdec_action_is_instance_of (object, constructor));
-}
-
-static void
-swfdec_action_cast (SwfdecAsContext *cx, guint action, const guint8 *data,
-    guint len)
-{
-  SwfdecAsValue *val;
-  SwfdecAsObject *object, *constructor;
-
-  val = swfdec_as_stack_pop (cx);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    object = SWFDEC_AS_VALUE_GET_OBJECT (val);
-  } else {
-    object = NULL;
-  }
- 
-  val = swfdec_as_stack_pop (cx);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    constructor = SWFDEC_AS_VALUE_GET_OBJECT (val);
-  } else {
-    constructor = NULL;
-  }
-
-  if (object == NULL || constructor == NULL) {
-    SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_push (cx));
-    return;
-  }
-
-  if (swfdec_action_is_instance_of (object, constructor)) {
-    SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (cx), object);
-  } else {
-    SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_push (cx));
-  }
-}
-
-static void
-swfdec_action_implements (SwfdecAsContext *cx, guint action,
-    const guint8 *data, guint len)
-{
-  SwfdecAsValue *val, *argv;
-  SwfdecAsObject *object, *proto, *interface;
-  int argc, i;
-
-  swfdec_as_stack_ensure_size (cx, 2);
-
-  val = swfdec_as_stack_pop (cx);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    object = SWFDEC_AS_VALUE_GET_OBJECT (val);
-    swfdec_as_object_get_variable (object, SWFDEC_AS_STR_prototype, val);
-    if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-      proto = SWFDEC_AS_VALUE_GET_OBJECT (val);
-    } else {
-      proto = NULL;
-    }
-  } else {
-    object = NULL;
-    proto = NULL;
-  }
-
-  val = swfdec_as_stack_pop (cx);
-  argc = swfdec_as_value_to_integer (cx, val);
-
-  if (argc > 0) {
-    swfdec_as_stack_ensure_size (cx, argc);
-    argv = swfdec_as_stack_pop_n (cx, argc);
-  } else {
-    argv = NULL;
-  }
-
-  if (proto == NULL)
-    return;
-
-  for (i = 0; i < argc; i++) {
-    if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[i]))
-      continue;
-    interface = SWFDEC_AS_VALUE_GET_OBJECT (&argv[i]);
-    swfdec_as_object_get_variable (interface, SWFDEC_AS_STR_prototype, val);
-    if (!SWFDEC_AS_VALUE_IS_OBJECT (val))
-      continue;
-    proto->interfaces =
-      g_slist_prepend (proto->interfaces, SWFDEC_AS_VALUE_GET_OBJECT (val));
-  }
-}
-
-static void
-swfdec_action_extends (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *superclass, *subclass, proto;
-  SwfdecAsObject *prototype;
-  SwfdecAsObject *super;
-
-  superclass = swfdec_as_stack_peek (cx, 1);
-  subclass = swfdec_as_stack_peek (cx, 2);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (superclass) ||
-      !SWFDEC_IS_AS_FUNCTION (SWFDEC_AS_VALUE_GET_OBJECT (superclass))) {
-    SWFDEC_ERROR ("superclass is not a function");
-    goto fail;
-  }
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (subclass)) {
-    SWFDEC_ERROR ("subclass is not an object");
-    goto fail;
-  }
-  super = SWFDEC_AS_VALUE_GET_OBJECT (superclass);
-  prototype = swfdec_as_object_new_empty (cx);
-  if (prototype == NULL)
-    goto fail;
-  swfdec_as_object_get_variable (super, SWFDEC_AS_STR_prototype, &proto);
-  swfdec_as_object_set_variable (prototype, SWFDEC_AS_STR___proto__, &proto);
-  if (cx->version > 5) {
-    swfdec_as_object_set_variable_and_flags (prototype, SWFDEC_AS_STR___constructor__,
-	superclass, SWFDEC_AS_VARIABLE_HIDDEN);
-  }
-  SWFDEC_AS_VALUE_SET_OBJECT (&proto, prototype);
-  swfdec_as_object_set_variable (SWFDEC_AS_VALUE_GET_OBJECT (subclass),
-      SWFDEC_AS_STR_prototype, &proto);
-fail:
-  swfdec_as_stack_pop_n (cx, 2);
-}
-
-static gboolean
-swfdec_action_enumerate_foreach (SwfdecAsObject *object, const char *variable,
-    SwfdecAsValue *value, guint flags, gpointer listp)
-{
-  GSList **list = listp;
-
-  if (flags & SWFDEC_AS_VARIABLE_HIDDEN)
-    return TRUE;
-
-  *list = g_slist_remove (*list, variable);
-  *list = g_slist_prepend (*list, (gpointer) variable);
-  return TRUE;
-}
-
-static void
-swfdec_action_do_enumerate (SwfdecAsContext *cx, SwfdecAsObject *object)
-{
-  guint i;
-  GSList *walk, *list = NULL;
-  
-  for (i = 0; i < 256 && object; i++) {
-    swfdec_as_object_foreach (object, swfdec_action_enumerate_foreach, &list);
-    object = swfdec_as_object_get_prototype (object);
-  }
-  if (i == 256) {
-    swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
-    g_slist_free (list);
-    return;
-  }
-  list = g_slist_reverse (list);
-  i = 0;
-  for (walk = list; walk; walk = walk->next) {
-    /* 8 is an arbitrary value */
-    if (i % 8 == 0) {
-      swfdec_as_stack_ensure_free (cx, 8);
-      i = 0;
-    }
-    i++;
-    SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), walk->data);
-  }
-  g_slist_free (list);
-}
-
-static void
-swfdec_action_enumerate2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val;
-  SwfdecAsObject *obj;
-
-  val = swfdec_as_stack_peek (cx, 1);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (val)) {
-    SWFDEC_WARNING ("Enumerate called without an object");
-    SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-    return;
-  }
-  obj = SWFDEC_AS_VALUE_GET_OBJECT (val);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-  swfdec_action_do_enumerate (cx, obj);
-}
-
-static void
-swfdec_action_enumerate (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  /* FIXME: make this proper functions */
-  swfdec_action_get_variable (cx, action, data, len);
-  swfdec_action_enumerate2 (cx, action, data, len);
-}
-
-static void
-swfdec_action_logical (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  gboolean l, r;
-
-  if (cx->version <= 4) {
-    l = (swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 1)) != 0);
-    // don't call second parameter if not necessary
-    if ((action == SWFDEC_AS_ACTION_AND && !l) ||
-	(action != SWFDEC_AS_ACTION_AND && l)) {
-      r = (swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx, 2)) != 0);
-    } else {
-      r = FALSE;
-    }
-  } else {
-    l = swfdec_as_value_to_boolean (cx, swfdec_as_stack_peek (cx, 1));
-    r = swfdec_as_value_to_boolean (cx, swfdec_as_stack_peek (cx, 2));
-  }
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_peek (cx, 2),
-    (action == SWFDEC_AS_ACTION_AND) ? (l && r) : (l || r));
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_char_to_ascii (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val = swfdec_as_stack_peek (cx, 1);
-  const char *s = swfdec_as_value_to_string (cx, val);
-
-  if (cx->version <= 5) {
-    char *ascii = g_convert (s, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
-
-    if (ascii == NULL) {
-      /* This can happen if a Flash 5 movie gets loaded into a Flash 7 movie */
-      SWFDEC_FIXME ("Someone threw unconvertible text %s at Flash <= 5", s);
-      SWFDEC_AS_VALUE_SET_INT (val, 0); /* FIXME: what to return??? */
-    } else {
-      SWFDEC_AS_VALUE_SET_INT (val, (guchar) ascii[0]);
-      g_free (ascii);
-    }
-  } else {
-    gunichar *uni = g_utf8_to_ucs4_fast (s, -1, NULL);
-
-    if (uni == NULL) {
-      /* This should never happen, everything is valid UTF-8 in here */
-      g_warning ("conversion of character %s failed", s);
-      SWFDEC_AS_VALUE_SET_INT (val, 0);
-    } else {
-      SWFDEC_AS_VALUE_SET_INT (val, uni[0]);
-      g_free (uni);
-    }
-  }
-}
-
-static void
-swfdec_action_ascii_to_char (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsValue *val = swfdec_as_stack_peek (cx, 1);
-
-  if (cx->version <= 5) {
-    char s[3];
-    char *utf8;
-    guint i;
-
-    if (action == SWFDEC_AS_ACTION_ASCII_TO_CHAR) {
-      s[0] = ((guint) swfdec_as_value_to_integer (cx, val)) % 256;
-      s[1] = 0;
-    } else {
-      g_assert (action == SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR);
-
-      i = ((guint) swfdec_as_value_to_integer (cx, val));
-      if (i > 255) {
-	s[0] = i / 256;
-	s[1] = i % 256;
-	s[2] = 0;
-      } else {
-	s[0] = i;
-	s[1] = 0;
-      }
-    }
-
-    utf8 = g_convert (s, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
-    if (utf8 == NULL) {
-      g_warning ("conversion of character %u failed", (guint) s[0]);
-      SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY);
-    } else {
-      SWFDEC_AS_VALUE_SET_STRING (val, swfdec_as_context_get_string (cx, utf8));
-      g_free (utf8);
-    }
-  } else {
-    char *s;
-    gunichar c = ((guint) swfdec_as_value_to_integer (cx, val)) % 65536;
-
-    s = g_ucs4_to_utf8 (&c, 1, NULL, NULL, NULL);
-    if (s == NULL) {
-      g_warning ("conversion of character %u failed", (guint) c);
-      SWFDEC_AS_VALUE_SET_STRING (val, SWFDEC_AS_STR_EMPTY);
-    } else {
-      SWFDEC_AS_VALUE_SET_STRING (val, swfdec_as_context_get_string (cx, s));
-      g_free (s);
-    }
-  }
-}
-
-static void
-swfdec_action_throw (SwfdecAsContext *cx, guint action, const guint8 *data,
-    guint len)
-{
-  swfdec_as_context_throw (cx, swfdec_as_stack_pop (cx));
-}
-
-typedef struct {
-  const guint8 *	catch_start;
-  const guint8 *	finally_start;
-  guint			catch_size;
-  guint			finally_size;
-
-  gboolean		use_register;
-  union {
-    guint		register_number;
-    char *		variable_name;
-  };
-} TryData;
-
-static void
-swfdec_action_try_data_free (gpointer data)
-{
-  TryData *try_data = data;
-
-  g_return_if_fail (try_data != NULL);
-
-  if (!try_data->use_register)
-    g_free (try_data->variable_name);
-  g_free (try_data);
-}
-
-static void
-swfdec_action_try_end_finally (SwfdecAsFrame *frame, gpointer data)
-{
-  SwfdecAsValue *exception_value = data;
-  SwfdecAsContext *cx;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (exception_value));
-
-  cx = SWFDEC_AS_OBJECT (frame)->context;
-
-  // finally has ended and we had exception stored, throw it
-  if (!cx->exception)
-    swfdec_as_context_throw (cx, exception_value);
-
-  g_free (data);
-}
-
-static void
-swfdec_action_try_end_catch (SwfdecAsFrame *frame, gpointer data)
-{
-  TryData *try_data = data;
-  SwfdecAsContext *cx;
-  SwfdecAsValue *exception_value, val;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (try_data != NULL);
-
-  cx = SWFDEC_AS_OBJECT (frame)->context;
-
-  if (swfdec_as_context_catch (cx, &val))
-  {
-    // we got an exception while in catch block:
-    // create new block for finally to pass on the exception
-    // jump to that block
-
-    exception_value = g_malloc (sizeof (SwfdecAsValue));
-    *exception_value = val;
-
-    // FIXME: the exception value is not marked while finally block runs
-    swfdec_as_frame_push_block (frame, try_data->finally_start,
-	try_data->finally_start + try_data->finally_size,
-	swfdec_action_try_end_finally, exception_value);
-    frame->pc = try_data->finally_start;
-  }
-
-  swfdec_action_try_data_free (try_data);
-}
-
-static void
-swfdec_action_try_end_try (SwfdecAsFrame *frame, gpointer data)
-{
-  TryData *try_data = data;
-  SwfdecAsContext *cx;
-  SwfdecAsValue val;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (try_data != NULL);
-
-  // if we don't have a catch block, we handle try block exactly like it was
-  // catch block
-  if (!try_data->catch_start) {
-    swfdec_action_try_end_catch (frame, try_data);
-    return;
-  }
-
-  cx = SWFDEC_AS_OBJECT (frame)->context;
-
-  if (swfdec_as_context_catch (cx, &val))
-  {
-    // we got an exception while in try block:
-    // set the exception variable
-    // add new block for catch and jump to it
-
-    if (try_data->use_register)
-    {
-      if (try_data->register_number < frame->n_registers) {
-	frame->registers[try_data->register_number] = val;
-      } else {
-	SWFDEC_ERROR ("cannot set Error to register %u: not enough registers",
-	    try_data->register_number);
-      }
-    }
-    else
-    {
-      // FIXME: this is duplicate of SetVariable
-      SwfdecAsObject *object;
-      const char *s, *rest;
-
-      s = swfdec_as_context_get_string (cx, try_data->variable_name);
-      if (swfdec_action_get_movie_by_path (cx, s, &object, &rest)) {
-	if (object && rest) {
-	  swfdec_as_object_set_variable (object,
-	      swfdec_as_context_get_string (cx, rest), &val);
-	} else {
-	  if (object) {
-	    rest = s;
-	  } else {
-	    rest = swfdec_as_context_get_string (cx, rest);
-	  }
-	  swfdec_as_frame_set_variable (frame, rest, &val);
-	}
-      }
-      else
-      {
-	SWFDEC_ERROR ("cannot set Error to variable %s",
-	    try_data->variable_name);
-      }
-    }
-
-    swfdec_as_frame_push_block (frame, try_data->catch_start,
-	try_data->catch_start + try_data->catch_size,
-	swfdec_action_try_end_catch, try_data);
-    frame->pc = try_data->catch_start;
-  }
-  else
-  {
-    swfdec_action_try_data_free (try_data);
-  }
-}
-
-static void
-swfdec_action_try (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-  TryData *try_data;
-  guint try_size;
-  gboolean use_finally, use_catch;
-
-  if (len < 8) {
-    SWFDEC_ERROR ("With action requires a length of at least 8, but got %u",
-	len);
-    return;
-  }
-
-  try_data = g_malloc0 (sizeof (TryData));
-
-  swfdec_bits_init_data (&bits, data, len);
-
-  swfdec_bits_getbits (&bits, 5); // reserved
-  try_data->use_register = swfdec_bits_getbit (&bits);
-  use_finally = swfdec_bits_getbit (&bits);
-  use_catch = swfdec_bits_getbit (&bits);
-
-  try_size = swfdec_bits_get_u16 (&bits);
-  try_data->catch_size = swfdec_bits_get_u16 (&bits);
-  try_data->finally_size = swfdec_bits_get_u16 (&bits);
-  if (use_catch)
-    try_data->catch_start = data + len + try_size;
-  if (use_finally)
-    try_data->finally_start = try_data->catch_start + try_data->catch_size;
-
-  if (try_data->use_register) {
-    try_data->register_number = swfdec_bits_get_u8 (&bits);
-  } else {
-    try_data->variable_name =
-      swfdec_bits_get_string (&bits, cx->version);
-  }
-
-  if (swfdec_bits_left (&bits)) {
-    SWFDEC_WARNING ("leftover bytes in Try action");
-  }
-
-  if (try_data->catch_start || try_data->finally_start) {
-    swfdec_as_frame_push_block (cx->frame, data + len, data + len + try_size,
-	swfdec_action_try_end_try, try_data);
-  } else {
-    SWFDEC_WARNING ("Try with neither catch nor finally block");
-    swfdec_action_try_data_free (try_data);
-  }
-}
-
-static void
-swfdec_action_pop_with (SwfdecAsFrame *frame, gpointer with_object)
-{
-  g_assert (frame->scope_chain->data == with_object);
-  frame->scope_chain = g_slist_delete_link (frame->scope_chain, frame->scope_chain);
-}
-
-static void
-swfdec_action_with (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecAsObject *object;
-  guint offset;
-
-  if (len != 2) {
-    SWFDEC_ERROR ("With action requires a length of 2, but got %u", len);
-    swfdec_as_stack_pop (cx);
-    return;
-  }
-  offset = data[0] | (data[1] << 8);
-  object = swfdec_as_value_to_object (cx, swfdec_as_stack_peek (cx, 1));
-  if (object == NULL) {
-    SWFDEC_INFO ("With called without an object, skipping");
-    cx->frame->pc = (guint8 *) data + len + offset;
-  } else {
-    cx->frame->scope_chain = g_slist_prepend (cx->frame->scope_chain, object);
-    swfdec_as_frame_push_block (cx->frame, data + len, data + len + offset,
-	swfdec_action_pop_with, object);
-  }
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_remove_sprite (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  if (!SWFDEC_IS_MOVIE (cx->frame->target)) {
-    SWFDEC_FIXME ("target is not a movie in RemoveSprite");
-  } else if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_INFO ("tried using RemoveSprite in a non-SwfdecPlayer context");
-  } else {
-    SwfdecMovie *movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx),
-	swfdec_as_stack_peek (cx, 1));
-    if (movie && swfdec_depth_classify (movie->depth) == SWFDEC_DEPTH_CLASS_DYNAMIC) {
-      SWFDEC_LOG ("removing clip %s", movie->name);
-      swfdec_movie_remove (movie);
-    } else {
-      SWFDEC_INFO ("cannot remove movie");
-    }
-  }
-  swfdec_as_stack_pop (cx);
-}
-
-static void
-swfdec_action_clone_sprite (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
-{
-  SwfdecMovie *movie, *new_movie;
-  const char *new_name;
-  int depth;
-
-  depth = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx, 1)) - 16384;
-  new_name = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (cx, 2));
-  if (!SWFDEC_IS_MOVIE (cx->frame->target)) {
-    SWFDEC_FIXME ("target is not a movie in CloneSprite");
-  } else if (!SWFDEC_IS_PLAYER (cx)) {
-    SWFDEC_INFO ("tried using CloneSprite in a non-SwfdecPlayer context");
-  } else {
-    movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx), 
-	swfdec_as_stack_peek (cx, 3));
-    if (movie == NULL) {
-      SWFDEC_ERROR ("Object is not an SwfdecMovie object");
-      swfdec_as_stack_pop_n (cx, 3);
-      return;
-    }
-    new_movie = swfdec_movie_duplicate (movie, new_name, depth);
-    if (new_movie) {
-      SWFDEC_LOG ("duplicated %s as %s to depth %u", movie->name, new_movie->name, new_movie->depth);
-    }
-  }
-  swfdec_as_stack_pop_n (cx, 3);
-}
-
-/*** PRINT FUNCTIONS ***/
-
-static char *
-swfdec_action_print_with (guint action, const guint8 *data, guint len)
-{
-  if (len != 2) {
-    SWFDEC_ERROR ("With action requires a length of 2, but got %u", len);
-    return NULL;
-  }
-  return g_strdup_printf ("With %u", data[0] | (data[1] << 8));
-}
-
-static char *
-swfdec_action_print_store_register (guint action, const guint8 *data, guint len)
-{
-  if (len != 1) {
-    SWFDEC_ERROR ("StoreRegister action requires a length of 1, but got %u", len);
-    return NULL;
-  }
-  return g_strdup_printf ("StoreRegister %u", (guint) *data);
-}
-
-static char *
-swfdec_action_print_set_target (guint action, const guint8 *data, guint len)
-{
-  if (!memchr (data, 0, len)) {
-    SWFDEC_ERROR ("SetTarget action does not specify a string");
-    return NULL;
-  }
-  return g_strconcat ("SetTarget ", data, NULL);
-}
-
-static char *
-swfdec_action_print_define_function (guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-  GString *string;
-  const char *function_name;
-  guint i, n_args, size;
-  gboolean v2 = (action == 0x8e);
-
-  string = g_string_new (v2 ? "DefineFunction2 " : "DefineFunction ");
-  swfdec_bits_init_data (&bits, data, len);
-  /* FIXME: version! */
-  function_name = swfdec_bits_get_string (&bits, 7);
-  if (function_name == NULL) {
-    SWFDEC_ERROR ("could not parse function name");
-    g_string_free (string, TRUE);
-    return NULL;
-  }
-  if (*function_name) {
-    g_string_append (string, function_name);
-    g_string_append_c (string, ' ');
-  }
-  n_args = swfdec_bits_get_u16 (&bits);
-  g_string_append_c (string, '(');
-  if (v2) {
-  /* n_regs = */ swfdec_bits_get_u8 (&bits);
-  /* flags = */ swfdec_bits_get_u16 (&bits);
-  }
- 
-  for (i = 0; i < n_args; i++) {
-    guint preload;
-    const char *arg_name;
-    if (v2)
-      preload = swfdec_bits_get_u8 (&bits);
-    else
-      preload = 0;
-    arg_name = swfdec_bits_get_string (&bits, 7);
-    if (preload == 0 && (arg_name == NULL || *arg_name == '\0')) {
-      SWFDEC_ERROR ("empty argument name not allowed");
-      g_string_free (string, TRUE);
-      return NULL;
-    }
-    if (i)
-      g_string_append (string, ", ");
-    g_string_append (string, arg_name);
-    if (preload)
-      g_string_append_printf (string, " (%u)", preload);
-  }
-  g_string_append_c (string, ')');
-  size = swfdec_bits_get_u16 (&bits);
-  g_string_append_printf (string, " %u", size);
-  return g_string_free (string, FALSE);
-}
-
-static char *
-swfdec_action_print_get_url2 (guint action, const guint8 *data, guint len)
-{
-  guint method;
-
-  if (len != 1) {
-    SWFDEC_ERROR ("GetURL2 requires 1 byte of data, not %u", len);
-    return NULL;
-  }
-  method = data[0] >> 6;
-  if (method == 3) {
-    SWFDEC_ERROR ("GetURL method 3 invalid");
-    method = 0;
-  }
-  if (method) {
-    SWFDEC_FIXME ("implement encoding variables using %s", method == 1 ? "GET" : "POST");
-  }
-  return g_strdup_printf ("GetURL2%s%s%s", method == 0 ? "" : (method == 1 ? " GET" : " POST"),
-      data[0] & 2 ? " LoadTarget" : "", data[0] & 1 ? " LoadVariables" : "");
-}
-
-static char *
-swfdec_action_print_get_url (guint action, const guint8 *data, guint len)
-{
-  SwfdecBits bits;
-  char *url, *target, *ret;
-
-  swfdec_bits_init_data (&bits, data, len);
-  url = swfdec_bits_get_string (&bits, 7);
-  target = swfdec_bits_get_string (&bits, 7);
-  if (url == NULL) {
-    SWFDEC_ERROR ("not enough data in GetURL");
-    url = g_strdup ("???");
-  }
-  if (target == NULL) {
-    SWFDEC_ERROR ("not enough data in GetURL");
-    target = g_strdup ("???");
-  }
-  if (swfdec_bits_left (&bits)) {
-    SWFDEC_WARNING ("leftover bytes in GetURL action");
-  }
-  ret = g_strdup_printf ("GetURL %s %s", url, target);
-  g_free (url);
-  g_free (target);
-  return ret;
-}
-
-static char *
-swfdec_action_print_if (guint action, const guint8 *data, guint len)
-{
-  gint16 offset;
-
-  if (len != 2) {
-    SWFDEC_ERROR ("If action length invalid (is %u, should be 2", len);
-    return NULL;
-  }
-  offset = data[0] | (data[1] << 8);
-  return g_strdup_printf ("If %d", (int) offset);
-}
-
-static char *
-swfdec_action_print_jump (guint action, const guint8 *data, guint len)
-{
-  gint16 offset;
-
-  if (len != 2) {
-    SWFDEC_ERROR ("Jump action length invalid (is %u, should be 2", len);
-    return NULL;
-  }
-  offset = data[0] | (data[1] << 8);
-  return g_strdup_printf ("Jump %d", (int) offset);
-}
-
-static char *
-swfdec_action_print_push (guint action, const guint8 *data, guint len)
-{
-  gboolean first = TRUE;
-  SwfdecBits bits;
-  GString *string = g_string_new ("Push");
-
-  swfdec_bits_init_data (&bits, data, len);
-  while (swfdec_bits_left (&bits)) {
-    guint type = swfdec_bits_get_u8 (&bits);
-    if (first)
-      g_string_append (string, " ");
-    else
-      g_string_append (string, ", ");
-    first = FALSE;
-    switch (type) {
-      case 0: /* string */
-	{
-	  /* FIXME: need version! */
-	  char *s = swfdec_bits_get_string (&bits, 7);
-	  if (!s) {
-	    g_string_free (string, TRUE);
-	    return NULL;
-	  }
-	  g_string_append_c (string, '"');
-	  g_string_append (string, s);
-	  g_string_append_c (string, '"');
-	  g_free (s);
-	  break;
-	}
-      case 1: /* float */
-	g_string_append_printf (string, "%g", swfdec_bits_get_float (&bits));
-	break;
-      case 2: /* null */
-	g_string_append (string, "null");
-	break;
-      case 3: /* undefined */
-	g_string_append (string, "void");
-	break;
-      case 4: /* register */
-	g_string_append_printf (string, "Register %u", swfdec_bits_get_u8 (&bits));
-	break;
-      case 5: /* boolean */
-	g_string_append (string, swfdec_bits_get_u8 (&bits) ? "True" : "False");
-	break;
-      case 6: /* double */
-	g_string_append_printf (string, "%g", swfdec_bits_get_double (&bits));
-	break;
-      case 7: /* 32bit int */
-	g_string_append_printf (string, "%d", swfdec_bits_get_u32 (&bits));
-	break;
-      case 8: /* 8bit ConstantPool address */
-	g_string_append_printf (string, "Pool %u", swfdec_bits_get_u8 (&bits));
-	break;
-      case 9: /* 16bit ConstantPool address */
-	g_string_append_printf (string, "Pool %u", swfdec_bits_get_u16 (&bits));
-	break;
-      default:
-	SWFDEC_ERROR ("Push: type %u not implemented", type);
-	return NULL;
-    }
-  }
-  return g_string_free (string, FALSE);
-}
-
-/* NB: constant pool actions are special in that they are called at init time */
-static char *
-swfdec_action_print_constant_pool (guint action, const guint8 *data, guint len)
-{
-  guint i;
-  GString *string;
-  SwfdecConstantPool *pool;
-
-  /* FIXME: version */
-  pool = swfdec_constant_pool_new_from_action (data, len, 6);
-  if (pool == NULL)
-    return g_strdup ("ConstantPool (invalid)");
-  string = g_string_new ("ConstantPool");
-  for (i = 0; i < swfdec_constant_pool_size (pool); i++) {
-    g_string_append (string, i ? ", " : " ");
-    g_string_append (string, swfdec_constant_pool_get (pool, i));
-    g_string_append_printf (string, " (%u)", i);
-  }
-  return g_string_free (string, FALSE);
-}
-
-#if 0
-static char *
-swfdec_action_print_wait_for_frame2 (guint action, const guint8 *data, guint len)
-{
-  if (len != 1) {
-    SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
-    return NULL;
-  }
-  return g_strdup_printf ("WaitForFrame2 %u", (guint) *data);
-}
-#endif
-
-static char *
-swfdec_action_print_goto_frame2 (guint action, const guint8 *data, guint len)
-{
-  gboolean play, bias;
-  SwfdecBits bits;
-
-  swfdec_bits_init_data (&bits, data, len);
-  if (swfdec_bits_getbits (&bits, 6)) {
-    SWFDEC_WARNING ("reserved bits in GotoFrame2 aren't 0");
-  }
-  bias = swfdec_bits_getbit (&bits);
-  play = swfdec_bits_getbit (&bits);
-  if (bias) {
-    return g_strdup_printf ("GotoFrame2 %s +%u", play ? "play" : "stop",
-	swfdec_bits_get_u16 (&bits));
-  } else {
-    return g_strdup_printf ("GotoFrame2 %s", play ? "play" : "stop");
-  }
-}
-
-static char *
-swfdec_action_print_goto_frame (guint action, const guint8 *data, guint len)
-{
-  guint frame;
-
-  if (len != 2)
-    return NULL;
-
-  frame = data[0] | (data[1] << 8);
-  return g_strdup_printf ("GotoFrame %u", frame);
-}
-
-static char *
-swfdec_action_print_goto_label (guint action, const guint8 *data, guint len)
-{
-  if (!memchr (data, 0, len)) {
-    SWFDEC_ERROR ("GotoLabel action does not specify a string");
-    return NULL;
-  }
-
-  return g_strdup_printf ("GotoLabel %s", data);
-}
-
-static char *
-swfdec_action_print_wait_for_frame (guint action, const guint8 *data, guint len)
-{
-  guint frame, jump;
-
-  if (len != 3)
-    return NULL;
-
-  frame = data[0] | (data[1] << 8);
-  jump = data[2];
-  return g_strdup_printf ("WaitForFrame %u %u", frame, jump);
-}
-
-/*** BIG FUNCTION TABLE ***/
-
-const SwfdecActionSpec swfdec_as_actions[256] = {
-  /* version 1 */
-  [SWFDEC_AS_ACTION_NEXT_FRAME] = { "NextFrame", NULL, 0, 0, swfdec_action_next_frame, 1 },
-  [SWFDEC_AS_ACTION_PREVIOUS_FRAME] = { "PreviousFrame", NULL, 0, 0, swfdec_action_previous_frame, 1 },
-  [SWFDEC_AS_ACTION_PLAY] = { "Play", NULL, 0, 0, swfdec_action_play, 1 },
-  [SWFDEC_AS_ACTION_STOP] = { "Stop", NULL, 0, 0, swfdec_action_stop, 1 },
-  [SWFDEC_AS_ACTION_TOGGLE_QUALITY] = { "ToggleQuality", NULL, -1, -1, NULL, 1 },
-  /* version 2 */
-  [SWFDEC_AS_ACTION_STOP_SOUNDS] = { "StopSounds", NULL, 0, 0, swfdec_action_stop_sounds, 2 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_ADD] = { "Add", NULL, 2, 1, swfdec_action_binary, 4 },
-  [SWFDEC_AS_ACTION_SUBTRACT] = { "Subtract", NULL, 2, 1, swfdec_action_binary, 4 },
-  [SWFDEC_AS_ACTION_MULTIPLY] = { "Multiply", NULL, 2, 1, swfdec_action_binary, 4 },
-  [SWFDEC_AS_ACTION_DIVIDE] = { "Divide", NULL, 2, 1, swfdec_action_binary, 4 },
-  [SWFDEC_AS_ACTION_EQUALS] = { "Equals", NULL, 2, 1, swfdec_action_old_compare, 4 },
-  [SWFDEC_AS_ACTION_LESS] = { "Less", NULL, 2, 1, swfdec_action_old_compare, 4 },
-  [SWFDEC_AS_ACTION_AND] = { "And", NULL, 2, 1, swfdec_action_logical, 4 },
-  [SWFDEC_AS_ACTION_OR] = { "Or", NULL, 2, 1, swfdec_action_logical, 4 },
-  [SWFDEC_AS_ACTION_NOT] = { "Not", NULL, 1, 1, swfdec_action_not, 4 },
-  [SWFDEC_AS_ACTION_STRING_EQUALS] = { "StringEquals", NULL, 2, 1, swfdec_action_string_compare, 4 },
-  [SWFDEC_AS_ACTION_STRING_LENGTH] = { "StringLength", NULL, 1, 1, swfdec_action_string_length, 4 },
-  [SWFDEC_AS_ACTION_STRING_EXTRACT] = { "StringExtract", NULL, 3, 1, swfdec_action_string_extract, 4 },
-  [SWFDEC_AS_ACTION_POP] = { "Pop", NULL, 1, 0, swfdec_action_pop, 4 },
-  [SWFDEC_AS_ACTION_TO_INTEGER] = { "ToInteger", NULL, 1, 1, swfdec_action_to_integer, 4 },
-  [SWFDEC_AS_ACTION_GET_VARIABLE] = { "GetVariable", NULL, 1, 1, swfdec_action_get_variable, 4 },
-  [SWFDEC_AS_ACTION_SET_VARIABLE] = { "SetVariable", NULL, 2, 0, swfdec_action_set_variable, 4 },
-  /* version 3 */
-  [SWFDEC_AS_ACTION_SET_TARGET2] = { "SetTarget2", NULL, 1, 0, swfdec_action_set_target2, 3 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_STRING_ADD] = { "StringAdd", NULL, 2, 1, swfdec_action_string_add, 4 },
-  [SWFDEC_AS_ACTION_GET_PROPERTY] = { "GetProperty", NULL, 2, 1, swfdec_action_get_property, 4 },
-  [SWFDEC_AS_ACTION_SET_PROPERTY] = { "SetProperty", NULL, 3, 0, swfdec_action_set_property, 4 },
-  [SWFDEC_AS_ACTION_CLONE_SPRITE] = { "CloneSprite", NULL, 3, 0, swfdec_action_clone_sprite, 4 },
-  [SWFDEC_AS_ACTION_REMOVE_SPRITE] = { "RemoveSprite", NULL, 1, 0, swfdec_action_remove_sprite, 4 },
-  [SWFDEC_AS_ACTION_TRACE] = { "Trace", NULL, 1, 0, swfdec_action_trace, 4 },
-  [SWFDEC_AS_ACTION_START_DRAG] = { "StartDrag", NULL, -1, 0, swfdec_action_start_drag, 4 },
-  [SWFDEC_AS_ACTION_END_DRAG] = { "EndDrag", NULL, 0, 0, swfdec_action_end_drag, 4 },
-  [SWFDEC_AS_ACTION_STRING_LESS] = { "StringLess", NULL, 2, 1, swfdec_action_string_compare, 4 },
-  /* version 7 */
-  [SWFDEC_AS_ACTION_THROW] = { "Throw", NULL, 1, 0, swfdec_action_throw, 7 },
-  [SWFDEC_AS_ACTION_CAST] = { "Cast", NULL, 2, 1, swfdec_action_cast, 7 },
-  [SWFDEC_AS_ACTION_IMPLEMENTS] = { "Implements", NULL, -1, 0, swfdec_action_implements, 7 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_RANDOM] = { "RandomNumber", NULL, 1, 1, swfdec_action_random_number, 4 },
-  [SWFDEC_AS_ACTION_MB_STRING_LENGTH] = { "MBStringLength", NULL, -1, -1, NULL, 4 },
-  [SWFDEC_AS_ACTION_CHAR_TO_ASCII] = { "CharToAscii", NULL, 1, 1, swfdec_action_char_to_ascii, 4 },
-  [SWFDEC_AS_ACTION_ASCII_TO_CHAR] = { "AsciiToChar", NULL, 1, 1, swfdec_action_ascii_to_char, 4 },
-  [SWFDEC_AS_ACTION_GET_TIME] = { "GetTime", NULL, 0, 1, swfdec_action_get_time, 4 },
-  [SWFDEC_AS_ACTION_MB_STRING_EXTRACT] = { "MBStringExtract", NULL, 3, 1, swfdec_action_string_extract, 4 },
-  [SWFDEC_AS_ACTION_MB_CHAR_TO_ASCII] = { "MBCharToAscii", NULL, -1, -1, NULL, 4 },
-  [SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR] = { "MBAsciiToChar", NULL, 1, 1, swfdec_action_ascii_to_char, 4 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_DELETE] = { "Delete", NULL, 2, 1, swfdec_action_delete, 5 },
-  [SWFDEC_AS_ACTION_DELETE2] = { "Delete2", NULL, 1, 1, swfdec_action_delete2, 5 },
-  [SWFDEC_AS_ACTION_DEFINE_LOCAL] = { "DefineLocal", NULL, 2, 0, swfdec_action_define_local, 5 },
-  [SWFDEC_AS_ACTION_CALL_FUNCTION] = { "CallFunction", NULL, -1, 1, swfdec_action_call_function, 5 },
-  [SWFDEC_AS_ACTION_RETURN] = { "Return", NULL, 1, 0, swfdec_action_return, 5 },
-  [SWFDEC_AS_ACTION_MODULO] = { "Modulo", NULL, 2, 1, swfdec_action_modulo, 5 },
-  [SWFDEC_AS_ACTION_NEW_OBJECT] = { "NewObject", NULL, -1, 1, swfdec_action_new_object, 5 },
-  [SWFDEC_AS_ACTION_DEFINE_LOCAL2] = { "DefineLocal2", NULL, 1, 0, swfdec_action_define_local2, 5 },
-  [SWFDEC_AS_ACTION_INIT_ARRAY] = { "InitArray", NULL, -1, 1, swfdec_action_init_array, 5 },
-  [SWFDEC_AS_ACTION_INIT_OBJECT] = { "InitObject", NULL, -1, 1, swfdec_action_init_object, 5 },
-  [SWFDEC_AS_ACTION_TYPE_OF] = { "TypeOf", NULL, 1, 1, swfdec_action_type_of, 5 },
-  [SWFDEC_AS_ACTION_TARGET_PATH] = { "TargetPath", NULL, 1, 1, swfdec_action_target_path, 5 },
-  [SWFDEC_AS_ACTION_ENUMERATE] = { "Enumerate", NULL, 1, -1, swfdec_action_enumerate, 5 },
-  [SWFDEC_AS_ACTION_ADD2] = { "Add2", NULL, 2, 1, swfdec_action_add2, 5 },
-  [SWFDEC_AS_ACTION_LESS2] = { "Less2", NULL, 2, 1, swfdec_action_new_comparison, 5 },
-  [SWFDEC_AS_ACTION_EQUALS2] = { "Equals2", NULL, 2, 1, swfdec_action_equals2, 5 },
-  [SWFDEC_AS_ACTION_TO_NUMBER] = { "ToNumber", NULL, 1, 1, swfdec_action_to_number, 5 },
-  [SWFDEC_AS_ACTION_TO_STRING] = { "ToString", NULL, 1, 1, swfdec_action_to_string, 5 },
-  [SWFDEC_AS_ACTION_PUSH_DUPLICATE] = { "PushDuplicate", NULL, 1, 2, swfdec_action_push_duplicate, 5 },
-  [SWFDEC_AS_ACTION_SWAP] = { "Swap", NULL, 2, 2, swfdec_action_swap, 5 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_GET_MEMBER] = { "GetMember", NULL, 2, 1, swfdec_action_get_member, 4 },
-  [SWFDEC_AS_ACTION_SET_MEMBER] = { "SetMember", NULL, 3, 0, swfdec_action_set_member, 4 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_INCREMENT] = { "Increment", NULL, 1, 1, swfdec_action_increment, 5 },
-  [SWFDEC_AS_ACTION_DECREMENT] = { "Decrement", NULL, 1, 1, swfdec_action_decrement, 5 },
-  [SWFDEC_AS_ACTION_CALL_METHOD] = { "CallMethod", NULL, -1, 1, swfdec_action_call_method, 5 },
-  [SWFDEC_AS_ACTION_NEW_METHOD] = { "NewMethod", NULL, -1, 1, swfdec_action_new_method, 5 },
-  /* version 6 */
-  [SWFDEC_AS_ACTION_INSTANCE_OF] = { "InstanceOf", NULL, 2, 1, swfdec_action_instance_of, 6 },
-  [SWFDEC_AS_ACTION_ENUMERATE2] = { "Enumerate2", NULL, 1, -1, swfdec_action_enumerate2, 6 },
-  [SWFDEC_AS_ACTION_BREAKPOINT] = { "Breakpoint", NULL, -1, -1, NULL, 6 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_BIT_AND] = { "BitAnd", NULL, 2, 1, swfdec_action_bitwise, 5 },
-  [SWFDEC_AS_ACTION_BIT_OR] = { "BitOr", NULL, 2, 1, swfdec_action_bitwise, 5 },
-  [SWFDEC_AS_ACTION_BIT_XOR] = { "BitXor", NULL, 2, 1, swfdec_action_bitwise, 5 },
-  [SWFDEC_AS_ACTION_BIT_LSHIFT] = { "BitLShift", NULL, 2, 1, swfdec_action_shift, 5 },
-  [SWFDEC_AS_ACTION_BIT_RSHIFT] = { "BitRShift", NULL, 2, 1, swfdec_action_shift, 5 },
-  [SWFDEC_AS_ACTION_BIT_URSHIFT] = { "BitURShift", NULL, 2, 1, swfdec_action_shift, 5 },
-  /* version 6 */
-  [SWFDEC_AS_ACTION_STRICT_EQUALS] = { "StrictEquals", NULL, 2, 1, swfdec_action_strict_equals, 6 },
-  [SWFDEC_AS_ACTION_GREATER] = { "Greater", NULL, 2, 1, swfdec_action_new_comparison, 6 },
-  [SWFDEC_AS_ACTION_STRING_GREATER] = { "StringGreater", NULL, -1, -1, NULL, 6 },
-  /* version 7 */
-  [SWFDEC_AS_ACTION_EXTENDS] = { "Extends", NULL, 2, 0, swfdec_action_extends, 7 },
-  /* version 1 */
-  [SWFDEC_AS_ACTION_GOTO_FRAME] = { "GotoFrame", swfdec_action_print_goto_frame, 0, 0, swfdec_action_goto_frame, 1 },
-  [SWFDEC_AS_ACTION_GET_URL] = { "GetURL", swfdec_action_print_get_url, 0, 0, swfdec_action_get_url, 1 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_STORE_REGISTER] = { "StoreRegister", swfdec_action_print_store_register, 1, 1, swfdec_action_store_register, 5 },
-  [SWFDEC_AS_ACTION_CONSTANT_POOL] = { "ConstantPool", swfdec_action_print_constant_pool, 0, 0, swfdec_action_constant_pool, 5 },
-  [SWFDEC_AS_ACTION_STRICT_MODE] = { "StrictMode", NULL, -1, -1, NULL, 5 },
-  /* version 1 */
-  [SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, swfdec_action_wait_for_frame, 1 },
-  [SWFDEC_AS_ACTION_SET_TARGET] = { "SetTarget", swfdec_action_print_set_target, 0, 0, swfdec_action_set_target, 1 },
-  /* version 3 */
-  [SWFDEC_AS_ACTION_GOTO_LABEL] = { "GotoLabel", swfdec_action_print_goto_label, 0, 0, swfdec_action_goto_label, 3 },
-#if 0
-  /* version 4 */
-  [0x8d] = { "WaitForFrame2", swfdec_action_print_wait_for_frame2, 1, 0, { NULL, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2 } },
-#endif
-  /* version 7 */
-  [SWFDEC_AS_ACTION_DEFINE_FUNCTION2] = { "DefineFunction2", swfdec_action_print_define_function, 0, -1, swfdec_action_define_function, 7 },
-  [SWFDEC_AS_ACTION_TRY] = { "Try", NULL, 0, 0, swfdec_action_try, 7 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_WITH] = { "With", swfdec_action_print_with, 1, 0, swfdec_action_with, 5 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_PUSH] = { "Push", swfdec_action_print_push, 0, -1, swfdec_action_push, 4 },
-  [SWFDEC_AS_ACTION_JUMP] = { "Jump", swfdec_action_print_jump, 0, 0, swfdec_action_jump, 4 },
-  [SWFDEC_AS_ACTION_GET_URL2] = { "GetURL2", swfdec_action_print_get_url2, 2, 0, swfdec_action_get_url2, 4 },
-  /* version 5 */
-  [SWFDEC_AS_ACTION_DEFINE_FUNCTION] = { "DefineFunction", swfdec_action_print_define_function, 0, -1, swfdec_action_define_function, 5 },
-  /* version 4 */
-  [SWFDEC_AS_ACTION_IF] = { "If", swfdec_action_print_if, 1, 0, swfdec_action_if, 4 },
-  [SWFDEC_AS_ACTION_CALL] = { "Call", NULL, -1, -1, NULL, 4 },
-  [SWFDEC_AS_ACTION_GOTO_FRAME2] = { "GotoFrame2", swfdec_action_print_goto_frame2, 1, 0, swfdec_action_goto_frame2, 4 }
-};
-
diff --git a/libswfdec/swfdec_as_interpret.h b/libswfdec/swfdec_as_interpret.h
deleted file mode 100644
index 6b9402b..0000000
--- a/libswfdec/swfdec_as_interpret.h
+++ /dev/null
@@ -1,150 +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_AS_INTERPRET_H_
-#define _SWFDEC_AS_INTERPRET_H_
-
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct {
-  const char *		name;		/* name identifying the action */
-  char *		(* print)	(guint action, const guint8 *data, guint len);
-  int			remove;		/* values removed from stack or -1 for dynamic */
-  int			add;		/* values added to the stack or -1 for dynamic */
-  void			(* exec)	(SwfdecAsContext *cx, guint action, const guint8 *data, guint len);
-  guint			version;	/* the version this action was introduced in */
-} SwfdecActionSpec;
-
-extern const SwfdecActionSpec swfdec_as_actions[256];
-
-/* all known actions */
-typedef enum {
-  SWFDEC_AS_ACTION_NEXT_FRAME = 0x04,
-  SWFDEC_AS_ACTION_PREVIOUS_FRAME = 0x05,
-  SWFDEC_AS_ACTION_PLAY = 0x06,
-  SWFDEC_AS_ACTION_STOP = 0x07,
-  SWFDEC_AS_ACTION_TOGGLE_QUALITY = 0x08,
-  SWFDEC_AS_ACTION_STOP_SOUNDS = 0x09,
-  SWFDEC_AS_ACTION_ADD = 0x0A,
-  SWFDEC_AS_ACTION_SUBTRACT = 0x0B,
-  SWFDEC_AS_ACTION_MULTIPLY = 0x0C,
-  SWFDEC_AS_ACTION_DIVIDE = 0x0D,
-  SWFDEC_AS_ACTION_EQUALS = 0x0E,
-  SWFDEC_AS_ACTION_LESS = 0x0F,
-  SWFDEC_AS_ACTION_AND = 0x10,
-  SWFDEC_AS_ACTION_OR = 0x11,
-  SWFDEC_AS_ACTION_NOT = 0x12,
-  SWFDEC_AS_ACTION_STRING_EQUALS = 0x13,
-  SWFDEC_AS_ACTION_STRING_LENGTH = 0x14,
-  SWFDEC_AS_ACTION_STRING_EXTRACT = 0x15,
-  SWFDEC_AS_ACTION_POP = 0x17,
-  SWFDEC_AS_ACTION_TO_INTEGER = 0x18,
-  SWFDEC_AS_ACTION_GET_VARIABLE = 0x1C,
-  SWFDEC_AS_ACTION_SET_VARIABLE = 0x1D,
-  SWFDEC_AS_ACTION_SET_TARGET2 = 0x20,
-  SWFDEC_AS_ACTION_STRING_ADD = 0x21,
-  SWFDEC_AS_ACTION_GET_PROPERTY = 0x22,
-  SWFDEC_AS_ACTION_SET_PROPERTY = 0x23,
-  SWFDEC_AS_ACTION_CLONE_SPRITE = 0x24,
-  SWFDEC_AS_ACTION_REMOVE_SPRITE = 0x25,
-  SWFDEC_AS_ACTION_TRACE = 0x26,
-  SWFDEC_AS_ACTION_START_DRAG = 0x27,
-  SWFDEC_AS_ACTION_END_DRAG = 0x28,
-  SWFDEC_AS_ACTION_STRING_LESS = 0x29,
-  SWFDEC_AS_ACTION_THROW = 0x2A,
-  SWFDEC_AS_ACTION_CAST = 0x2B,
-  SWFDEC_AS_ACTION_IMPLEMENTS = 0x2C,
-  SWFDEC_AS_ACTION_RANDOM = 0x30,
-  SWFDEC_AS_ACTION_MB_STRING_LENGTH = 0x31,
-  SWFDEC_AS_ACTION_CHAR_TO_ASCII = 0x32,
-  SWFDEC_AS_ACTION_ASCII_TO_CHAR = 0x33,
-  SWFDEC_AS_ACTION_GET_TIME = 0x34,
-  SWFDEC_AS_ACTION_MB_STRING_EXTRACT = 0x35,
-  SWFDEC_AS_ACTION_MB_CHAR_TO_ASCII = 0x36,
-  SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR = 0x37,
-  SWFDEC_AS_ACTION_DELETE = 0x3A,
-  SWFDEC_AS_ACTION_DELETE2 = 0x3B,
-  SWFDEC_AS_ACTION_DEFINE_LOCAL = 0x3C,
-  SWFDEC_AS_ACTION_CALL_FUNCTION = 0x3D,
-  SWFDEC_AS_ACTION_RETURN = 0x3E,
-  SWFDEC_AS_ACTION_MODULO = 0x3F,
-  SWFDEC_AS_ACTION_NEW_OBJECT = 0x40,
-  SWFDEC_AS_ACTION_DEFINE_LOCAL2 = 0x41,
-  SWFDEC_AS_ACTION_INIT_ARRAY = 0x42,
-  SWFDEC_AS_ACTION_INIT_OBJECT = 0x43,
-  SWFDEC_AS_ACTION_TYPE_OF = 0x44,
-  SWFDEC_AS_ACTION_TARGET_PATH = 0x45,
-  SWFDEC_AS_ACTION_ENUMERATE = 0x46,
-  SWFDEC_AS_ACTION_ADD2 = 0x47,
-  SWFDEC_AS_ACTION_LESS2 = 0x48,
-  SWFDEC_AS_ACTION_EQUALS2 = 0x49,
-  SWFDEC_AS_ACTION_TO_NUMBER = 0x4A,
-  SWFDEC_AS_ACTION_TO_STRING = 0x4B,
-  SWFDEC_AS_ACTION_PUSH_DUPLICATE = 0x4C,
-  SWFDEC_AS_ACTION_SWAP = 0x4D,
-  SWFDEC_AS_ACTION_GET_MEMBER = 0x4E,
-  SWFDEC_AS_ACTION_SET_MEMBER = 0x4F,
-  SWFDEC_AS_ACTION_INCREMENT = 0x50,
-  SWFDEC_AS_ACTION_DECREMENT = 0x51,
-  SWFDEC_AS_ACTION_CALL_METHOD = 0x52,
-  SWFDEC_AS_ACTION_NEW_METHOD = 0x53,
-  SWFDEC_AS_ACTION_INSTANCE_OF = 0x54,
-  SWFDEC_AS_ACTION_ENUMERATE2 = 0x55,
-  SWFDEC_AS_ACTION_BREAKPOINT = 0x5F,
-  SWFDEC_AS_ACTION_BIT_AND = 0x60,
-  SWFDEC_AS_ACTION_BIT_OR = 0x61,
-  SWFDEC_AS_ACTION_BIT_XOR = 0x62,
-  SWFDEC_AS_ACTION_BIT_LSHIFT = 0x63,
-  SWFDEC_AS_ACTION_BIT_RSHIFT = 0x64,
-  SWFDEC_AS_ACTION_BIT_URSHIFT = 0x65,
-  SWFDEC_AS_ACTION_STRICT_EQUALS = 0x66,
-  SWFDEC_AS_ACTION_GREATER = 0x67,
-  SWFDEC_AS_ACTION_STRING_GREATER = 0x68,
-  SWFDEC_AS_ACTION_EXTENDS = 0x69,
-  SWFDEC_AS_ACTION_GOTO_FRAME = 0x81,
-  SWFDEC_AS_ACTION_GET_URL = 0x83,
-  SWFDEC_AS_ACTION_STORE_REGISTER = 0x87,
-  SWFDEC_AS_ACTION_CONSTANT_POOL = 0x88,
-  SWFDEC_AS_ACTION_STRICT_MODE = 0x89,
-  SWFDEC_AS_ACTION_WAIT_FOR_FRAME = 0x8A,
-  SWFDEC_AS_ACTION_SET_TARGET = 0x8B,
-  SWFDEC_AS_ACTION_GOTO_LABEL = 0x8C,
-  SWFDEC_AS_ACTION_WAIT_FOR_FRAME2 = 0x8D,
-  SWFDEC_AS_ACTION_DEFINE_FUNCTION2 = 0x8E,
-  SWFDEC_AS_ACTION_TRY = 0x8F,
-  SWFDEC_AS_ACTION_WITH = 0x94,
-  SWFDEC_AS_ACTION_PUSH = 0x96,
-  SWFDEC_AS_ACTION_JUMP = 0x99,
-  SWFDEC_AS_ACTION_GET_URL2 = 0x9A,
-  SWFDEC_AS_ACTION_DEFINE_FUNCTION = 0x9B,
-  SWFDEC_AS_ACTION_IF = 0x9D,
-  SWFDEC_AS_ACTION_CALL = 0x9E,
-  SWFDEC_AS_ACTION_GOTO_FRAME2 = 0x9F
-} SwfdecAsAction;
-
-// FIXME: move
-SwfdecAsObject *	swfdec_action_lookup_object	(SwfdecAsContext *	cx,
-							 SwfdecAsObject *	o,
-							 const char *		path,
-							 const char *		end);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_math.c b/libswfdec/swfdec_as_math.c
deleted file mode 100644
index 30b0c6e..0000000
--- a/libswfdec/swfdec_as_math.c
+++ /dev/null
@@ -1,149 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-
-#include "swfdec_as_object.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_debug.h"
-
-/*** AS CODE ***/
-
-#define MATH_FUN(name) \
-void \
-swfdec_as_math_ ## name (SwfdecAsContext *cx, SwfdecAsObject *object, \
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) \
-{ \
-  double d; \
-\
-  SWFDEC_AS_CHECK (0, NULL, "n", &d); \
-\
-  d = name (d); \
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, d); \
-}
-
-SWFDEC_AS_NATIVE (200, 16, swfdec_as_math_acos)
-MATH_FUN (acos)
-SWFDEC_AS_NATIVE (200, 15, swfdec_as_math_asin)
-MATH_FUN (asin)
-SWFDEC_AS_NATIVE (200, 14, swfdec_as_math_atan)
-MATH_FUN (atan)
-SWFDEC_AS_NATIVE (200, 13, swfdec_as_math_ceil)
-MATH_FUN (ceil)
-SWFDEC_AS_NATIVE (200, 4, swfdec_as_math_cos)
-MATH_FUN (cos)
-SWFDEC_AS_NATIVE (200, 7, swfdec_as_math_exp)
-MATH_FUN (exp)
-SWFDEC_AS_NATIVE (200, 12, swfdec_as_math_floor)
-MATH_FUN (floor)
-SWFDEC_AS_NATIVE (200, 8, swfdec_as_math_log)
-MATH_FUN (log)
-SWFDEC_AS_NATIVE (200, 3, swfdec_as_math_sin)
-MATH_FUN (sin)
-SWFDEC_AS_NATIVE (200, 9, swfdec_as_math_sqrt)
-MATH_FUN (sqrt)
-SWFDEC_AS_NATIVE (200, 6, swfdec_as_math_tan)
-MATH_FUN (tan)
-
-SWFDEC_AS_NATIVE (200, 0, swfdec_as_math_abs)
-void
-swfdec_as_math_abs (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double d;
-
-  SWFDEC_AS_CHECK (0, NULL, "n", &d);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, fabs (d));
-}
-
-SWFDEC_AS_NATIVE (200, 5, swfdec_as_math_atan2)
-void
-swfdec_as_math_atan2 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double x, y;
-
-  SWFDEC_AS_CHECK (0, NULL, "nn", &y, &x);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, atan2 (y, x));
-}
-
-SWFDEC_AS_NATIVE (200, 2, swfdec_as_math_max)
-void
-swfdec_as_math_max (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double x, y;
-
-  SWFDEC_AS_CHECK (0, NULL, "nn", &x, &y);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, MAX (x, y));
-}
-
-SWFDEC_AS_NATIVE (200, 1, swfdec_as_math_min)
-void
-swfdec_as_math_min (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double x, y;
-
-  SWFDEC_AS_CHECK (0, NULL, "nn", &x, &y);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, MIN (x, y));
-}
-
-SWFDEC_AS_NATIVE (200, 17, swfdec_as_math_pow)
-void
-swfdec_as_math_pow (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double x, y;
-
-  SWFDEC_AS_CHECK (0, NULL, "nn", &x, &y);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, pow (x, y));
-}
-
-SWFDEC_AS_NATIVE (200, 11, swfdec_as_math_random)
-void
-swfdec_as_math_random (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, g_rand_double (cx->rand));
-}
-
-SWFDEC_AS_NATIVE (200, 10, swfdec_as_math_round)
-void
-swfdec_as_math_round (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double d;
-
-  SWFDEC_AS_CHECK (0, NULL, "n", &d);
-
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, floor (d + 0.5));
-}
diff --git a/libswfdec/swfdec_as_native_function.c b/libswfdec/swfdec_as_native_function.c
deleted file mode 100644
index 74ba3e6..0000000
--- a/libswfdec/swfdec_as_native_function.c
+++ /dev/null
@@ -1,395 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-/*** GTK-DOC ***/
-
-/**
- * SwfdecAsNative:
- * @context: #SwfdecAsContext
- * @thisp: the this object. <warning>Can be %NULL.</warning>
- * @argc: number of arguments passed to this function
- * @argv: the @argc arguments passed to this function
- * @retval: set to the return value. Initialized to undefined by default
- *
- * This is the prototype for all native functions.
- */
-
-/**
- * SwfdecAsNativeFunction:
- *
- * This is the object type for native functions.
- */
-
-/*** IMPLEMENTATION ***/
-
-G_DEFINE_TYPE (SwfdecAsNativeFunction, swfdec_as_native_function, SWFDEC_TYPE_AS_FUNCTION)
-
-static SwfdecAsFrame *
-swfdec_as_native_function_call (SwfdecAsFunction *function)
-{
-  SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (function);
-  SwfdecAsFrame *frame;
-  SwfdecAsContext *cx;
-
-  cx = SWFDEC_AS_OBJECT (function)->context;
-  frame = swfdec_as_frame_new_native (cx);
-  if (frame == NULL)
-    return NULL;
-  g_assert (native->name);
-  frame->function_name = native->name;
-  frame->function = function;
-  /* We copy the target here so we have a proper SwfdecMovie reference inside native 
-   * functions. This is for example necessary for swfdec_player_get_movie_by_value()
-   * and probably other stuff that does variable lookups inside native functions.
-   */
-  /* FIXME: copy target or original target? */
-  if (frame->next) {
-    frame->target = frame->next->original_target;
-    frame->original_target = frame->target;
-  }
-  return frame;
-}
-
-static char *
-swfdec_as_native_function_debug (SwfdecAsObject *object)
-{
-  SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (object);
-
-  return g_strdup_printf ("%s ()", native->name);
-}
-
-static void
-swfdec_as_native_function_dispose (GObject *object)
-{
-  SwfdecAsNativeFunction *function = SWFDEC_AS_NATIVE_FUNCTION (object);
-
-  g_free (function->name);
-  function->name = NULL;
-
-  G_OBJECT_CLASS (swfdec_as_native_function_parent_class)->dispose (object);
-}
-
-static void
-swfdec_as_native_function_class_init (SwfdecAsNativeFunctionClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-  SwfdecAsFunctionClass *function_class = SWFDEC_AS_FUNCTION_CLASS (klass);
-
-  object_class->dispose = swfdec_as_native_function_dispose;
-
-  asobject_class->debug = swfdec_as_native_function_debug;
-
-  function_class->call = swfdec_as_native_function_call;
-}
-
-static void
-swfdec_as_native_function_init (SwfdecAsNativeFunction *function)
-{
-}
-
-/**
- * swfdec_as_native_function_new:
- * @context: a #SwfdecAsContext
- * @name: name of the function
- * @native: function to call when executed
- * @min_args: minimum number of arguments required
- * @prototype: The object to be used as "prototype" property for the created 
- *             function or %NULL for none.
- *
- * Creates a new native function, that will execute @native when called. The
- * @min_args parameter sets a requirement for the minimum number of arguments
- * to pass to @native. If the function gets called with less arguments, it
- * will just redurn undefined. You might want to use 
- * swfdec_as_object_add_function() instead of this function.
- *
- * Returns: a new #SwfdecAsFunction or %NULL on OOM
- **/
-SwfdecAsFunction *
-swfdec_as_native_function_new (SwfdecAsContext *context, const char *name,
-    SwfdecAsNative native, guint min_args, SwfdecAsObject *prototype)
-{
-  SwfdecAsNativeFunction *fun;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_return_val_if_fail (native != NULL, NULL);
-  g_return_val_if_fail (prototype == NULL || SWFDEC_IS_AS_OBJECT (prototype), NULL);
-
-  if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsNativeFunction)))
-    return NULL;
-  fun = g_object_new (SWFDEC_TYPE_AS_NATIVE_FUNCTION, NULL);
-  if (fun == NULL)
-    return NULL;
-  fun->native = native;
-  fun->min_args = min_args;
-  fun->name = g_strdup (name);
-  swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsNativeFunction));
-  /* need to set prototype before setting the constructor or Function.constructor 
-   * being CONSTANT disallows setting it. */
-  if (prototype) {
-    SwfdecAsValue val;
-    SWFDEC_AS_VALUE_SET_OBJECT (&val, prototype);
-    swfdec_as_object_set_variable_and_flags (SWFDEC_AS_OBJECT (fun), SWFDEC_AS_STR_prototype, 
-	&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  }
-  swfdec_as_function_set_constructor (SWFDEC_AS_FUNCTION (fun));
-
-  return SWFDEC_AS_FUNCTION (fun);
-}
-
-/**
- * swfdec_as_native_function_set_object_type:
- * @function: a #SwfdecAsNativeFunction
- * @type: required #GType for the this object
- *
- * Sets the required type for the this object to @type. If the this object 
- * isn't of the required type, the function will not be called and its
- * return value will be undefined.
- **/
-void
-swfdec_as_native_function_set_object_type (SwfdecAsNativeFunction *function, GType type)
-{
-  GTypeQuery query;
-
-  g_return_if_fail (SWFDEC_IS_AS_NATIVE_FUNCTION (function));
-  g_return_if_fail (g_type_is_a (type, SWFDEC_TYPE_AS_OBJECT));
-
-  g_type_query (type, &query);
-  function->type = type;
-}
-
-/**
- * swfdec_as_native_function_set_construct_type:
- * @function: a #SwfdecAsNativeFunction
- * @type: #GType used when constructing an object with @function
- *
- * Sets the @type to be used when using @function as a constructor. If this is
- * not set, using @function as a constructor will create a #SwfdecAsObject.
- **/
-void
-swfdec_as_native_function_set_construct_type (SwfdecAsNativeFunction *function, GType type)
-{
-  GTypeQuery query;
-
-  g_return_if_fail (SWFDEC_IS_AS_NATIVE_FUNCTION (function));
-  g_return_if_fail (g_type_is_a (type, SWFDEC_TYPE_AS_OBJECT));
-
-  g_type_query (type, &query);
-  function->construct_type = type;
-  function->construct_size = query.instance_size;
-}
-
-/**
- * SWFDEC_AS_CHECK:
- * @type: required type of this object or 0 for ignoring
- * @result: converted this object
- * @...: conversion string and pointers taking converted values
- *
- * This is a shortcut macro for calling swfdec_as_native_function_check() at
- * the beginning of a native function. See that function for details.
- * It requires the native function parameters to have the default name. So your
- * function must be declared like this:
- * |[static void
- * my_function (SwfdecAsContext *cx, SwfdecAsObject *object,
- *     guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval);]|
- */
-/**
- * swfdec_as_native_function_check:
- * @cx: a #SwfdecAsContext
- * @object: this object passed to the native function
- * @type: expected type of @object or 0 for any
- * @result: pointer to variable taking cast result of @object
- * @argc: count of arguments passed to the function
- * @argv: arguments passed to the function
- * @args: argument conversion string
- * @...: pointers to variables taking converted arguments
- *
- * This function is a convenience function to validate and convert arguments to 
- * a native function while avoiding common pitfalls. You typically want to call
- * it at the beginning of every native function you write. Or you can use the 
- * SWFDEC_AS_CHECK() macro instead which calls this function.
- * The @cx, @object, @argc and @argv paramters should be passed verbatim from 
- * the function call to your native function. If @type is not 0, @object is then
- * checked to be of that type and cast to @result. After that the @args string 
- * is used to convert the arguments. Every character in @args describes the 
- * conversion of one argument. For that argument, you have to pass a pointer 
- * that takes the value. For the conversion, the default conversion functions 
- * like swfdec_as_value_to_string() are used. If not enough arguments are 
- * available, the function stops converting and returns %NULL. The following 
- * conversion characters are allowed:<itemizedlist>
- * <listitem><para>"b": convert to boolean. Requires a %gboolean pointer
- *                 </para></listitem>
- * <listitem><para>"i": convert to integer. Requires an %integer pointer
- *                 </para></listitem>
- * <listitem><para>"n": convert to number. Requires a %double pointer
- *                 </para></listitem>
- * <listitem><para>"o": convert to object. Requires a #SwfdecAsObject pointer.
- *                 If the conversion fails, this function immediately return %
- *                 FALSE.</para></listitem>
- * <listitem><para>"O": convert to object or %NULL. Requires a #SwfdecAsObject
- *                 pointer.</para></listitem>
- * <listitem><para>"s": convert to garbage-collected string. Requires a const 
- *                 %char pointer</para></listitem>
- * <listitem><para>"v": copy the value. The given argument must be a pointer 
- *                 to a #SwfdecAsValue</para></listitem>
- * <listitem><para>"|": optional arguments follow. Optional arguments will be
- *		   initialized to the empty value for their type. This 
- *		   conversion character is only allowed once in the conversion 
- *		   string.</para></listitem>
- * </itemizedlist>
- *
- * Returns: %TRUE if the conversion succeeded, %FALSE otherwise
- **/
-gboolean
-swfdec_as_native_function_check (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    GType type, gpointer *result, guint argc, SwfdecAsValue *argv, 
-    const char *args, ...)
-{
-  gboolean ret;
-  va_list varargs;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), FALSE);
-  g_return_val_if_fail (type == 0 || result != NULL, FALSE);
-
-  va_start (varargs, args);
-  ret = swfdec_as_native_function_checkv (cx, object, type, result, argc, argv, args, varargs);
-  va_end (varargs);
-  return ret;
-}
-
-/**
- * swfdec_as_native_function_checkv:
- * @cx: a #SwfdecAsContext
- * @object: this object passed to the native function
- * @type: expected type of @object
- * @result: pointer to variable taking cast result of @object
- * @argc: count of arguments passed to the function
- * @argv: arguments passed to the function
- * @args: argument conversion string
- * @varargs: pointers to variables taking converted arguments
- *
- * This is the valist version of swfdec_as_native_function_check(). See that
- * function for details.
- *
- * Returns: %TRUE if the conversion succeeded, %FALSE otherwise
- **/
-gboolean
-swfdec_as_native_function_checkv (SwfdecAsContext *cx, SwfdecAsObject *object, 
-    GType type, gpointer *result, guint argc, SwfdecAsValue *argv, 
-    const char *args, va_list varargs)
-{
-  guint i;
-  gboolean optional = FALSE;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), FALSE);
-  g_return_val_if_fail (type == 0 || result != NULL, FALSE);
-
-  /* check that we got a valid type */
-  if (type) {
-    if (!G_TYPE_CHECK_INSTANCE_TYPE (object, type))
-      return FALSE;
-    *result = object;
-  }
-  for (i = 0; *args; i++, args++) {
-    if (!optional && i >= argc && *args != '|')
-      break;
-    switch (*args) {
-      case 'v':
-	{
-	  SwfdecAsValue *val = va_arg (varargs, SwfdecAsValue *);
-	  if (i < argc)
-	    *val = argv[i];
-	  else
-	    SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-	}
-	break;
-      case 'b':
-	{
-	  gboolean *b = va_arg (varargs, gboolean *);
-	  if (i < argc)
-	    *b = swfdec_as_value_to_boolean (cx, &argv[i]);
-	  else
-	    *b = FALSE;
-	}
-	break;
-      case 'i':
-	{
-	  int *j = va_arg (varargs, int *);
-	  if (i < argc)
-	    *j = swfdec_as_value_to_integer (cx, &argv[i]);
-	  else
-	    *j = 0;
-	}
-	break;
-      case 'n':
-	{
-	  double *d = va_arg (varargs, double *);
-	  if (i < argc)
-	    *d = swfdec_as_value_to_number (cx, &argv[i]);
-	  else
-	    *d = 0;
-	}
-	break;
-      case 's':
-	{
-	  const char **s = va_arg (varargs, const char **);
-	  if (i < argc)
-	    *s = swfdec_as_value_to_string (cx, &argv[i]);
-	  else
-	    *s = SWFDEC_AS_STR_EMPTY;
-	}
-	break;
-      case 'o':
-      case 'O':
-	{
-	  SwfdecAsObject **o = va_arg (varargs, SwfdecAsObject **);
-	  if (i < argc)
-	    *o = swfdec_as_value_to_object (cx, &argv[i]);
-	  else
-	    *o = NULL;
-	  if (*o == NULL && *args != 'O')
-	    return FALSE;
-	}
-	break;
-      case '|':
-	g_return_val_if_fail (optional == FALSE, FALSE);
-	optional = TRUE;
-	i--;
-	break;
-      default:
-	g_warning ("'%c' is not a valid type conversion", *args);
-	return FALSE;
-    }
-  }
-  if (*args)
-    return FALSE;
-  return TRUE;
-}
diff --git a/libswfdec/swfdec_as_native_function.h b/libswfdec/swfdec_as_native_function.h
deleted file mode 100644
index 88c172d..0000000
--- a/libswfdec/swfdec_as_native_function.h
+++ /dev/null
@@ -1,95 +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_AS_NATIVE_FUNCTION_H_
-#define _SWFDEC_AS_NATIVE_FUNCTION_H_
-
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsNativeFunction SwfdecAsNativeFunction;
-typedef struct _SwfdecAsNativeFunctionClass SwfdecAsNativeFunctionClass;
-
-#define SWFDEC_TYPE_AS_NATIVE_FUNCTION                    (swfdec_as_native_function_get_type())
-#define SWFDEC_IS_AS_NATIVE_FUNCTION(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_NATIVE_FUNCTION))
-#define SWFDEC_IS_AS_NATIVE_FUNCTION_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_NATIVE_FUNCTION))
-#define SWFDEC_AS_NATIVE_FUNCTION(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_NATIVE_FUNCTION, SwfdecAsNativeFunction))
-#define SWFDEC_AS_NATIVE_FUNCTION_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_NATIVE_FUNCTION, SwfdecAsNativeFunctionClass))
-#define SWFDEC_AS_NATIVE_FUNCTION_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_NATIVE_FUNCTION, SwfdecAsNativeFunctionClass))
-
-/* FIXME: do two obejcts, one for scripts and one for native? */
-struct _SwfdecAsNativeFunction {
-  /*< private >*/
-  SwfdecAsFunction	function;
-
-  SwfdecAsNative	native;		/* native call or NULL when script */
-  char *		name;		/* function name */
-  /* checks for calling this function */
-  GType			type;		/* required type for this object when caling function */
-  guint			min_args;	/* minimum number of required arguments */
-  /* constructor info */
-  GType			construct_type;	/* type used when used as a constructor or 0 */
-  guint			construct_size;	/* instance size of type */
-};
-
-struct _SwfdecAsNativeFunctionClass {
-  SwfdecAsFunctionClass	function_class;
-};
-
-GType		swfdec_as_native_function_get_type	(void);
-
-SwfdecAsFunction *swfdec_as_native_function_new	(SwfdecAsContext *	context,
-						 const char *		name,
-						 SwfdecAsNative		native,
-						 guint			min_args,
-						 SwfdecAsObject *	prototype);
-
-void		swfdec_as_native_function_set_object_type
-						(SwfdecAsNativeFunction *function,
-						 GType			type);
-void		swfdec_as_native_function_set_construct_type
-						(SwfdecAsNativeFunction *function,
-						 GType			type);
-
-gboolean	swfdec_as_native_function_check	(SwfdecAsContext *	cx,
-						 SwfdecAsObject *	object,
-						 GType			type,
-						 gpointer *		result,
-						 guint			argc,
-						 SwfdecAsValue *	argv,
-						 const char *	      	args,
-						 ...);
-gboolean	swfdec_as_native_function_checkv(SwfdecAsContext *	cx,
-						 SwfdecAsObject *	object,
-						 GType			type,
-						 gpointer *		result,
-						 guint			argc,
-						 SwfdecAsValue *	argv,
-						 const char *	      	args,
-						 va_list		varargs);
-#define SWFDEC_AS_CHECK(type,result,...) G_STMT_START {\
-  if (!swfdec_as_native_function_check (cx, object, type, (gpointer) result, argc, argv, __VA_ARGS__)) \
-    return; \
-}G_STMT_END
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_number.c b/libswfdec/swfdec_as_number.c
deleted file mode 100644
index 71472ee..0000000
--- a/libswfdec/swfdec_as_number.c
+++ /dev/null
@@ -1,121 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-
-#include "swfdec_as_number.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsNumber, swfdec_as_number, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_as_number_class_init (SwfdecAsNumberClass *klass)
-{
-}
-
-static void
-swfdec_as_number_init (SwfdecAsNumber *number)
-{
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_CONSTRUCTOR (106, 2, swfdec_as_number_construct, swfdec_as_number_get_type)
-void
-swfdec_as_number_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  double d;
-
-  if (argc > 0) {
-    d = swfdec_as_value_to_number (object->context, &argv[0]);
-  } else {
-    d = NAN;
-  }
-
-  if (swfdec_as_context_is_constructing (cx)) {
-    SwfdecAsNumber *num = SWFDEC_AS_NUMBER (object);
-    num->number = d;
-    SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-  } else {
-    SWFDEC_AS_VALUE_SET_NUMBER (ret, d);
-  }
-}
-
-SWFDEC_AS_NATIVE (106, 1, swfdec_as_number_toString)
-void
-swfdec_as_number_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsNumber *num;
-  SwfdecAsValue val;
-  const char *s;
-  
-  if (!SWFDEC_IS_AS_NUMBER (object))
-    return;
-
-  num = SWFDEC_AS_NUMBER (object);
-  if (argc > 0) {
-    SWFDEC_FIXME ("radix is not yet implemented");
-  }
-  SWFDEC_AS_VALUE_SET_NUMBER (&val, num->number);
-  s = swfdec_as_value_to_string (object->context, &val);
-  SWFDEC_AS_VALUE_SET_STRING (ret, s);
-}
-
-SWFDEC_AS_NATIVE (106, 0, swfdec_as_number_valueOf)
-void
-swfdec_as_number_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsNumber *num;
-
-  if (!SWFDEC_IS_AS_NUMBER (object))
-    return;
-
-  num = SWFDEC_AS_NUMBER (object);
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, num->number);
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (3, 1, swfdec_as_number_old_constructor)
-void
-swfdec_as_number_old_constructor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("old 'Number' function (only available as ASnative)");
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (3, 4, swfdec_as_number_old_toString)
-void
-swfdec_as_number_old_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("old 'Number.prototype.toString' function (only available as ASnative)");
-}
diff --git a/libswfdec/swfdec_as_number.h b/libswfdec/swfdec_as_number.h
deleted file mode 100644
index 9b6ede0..0000000
--- a/libswfdec/swfdec_as_number.h
+++ /dev/null
@@ -1,52 +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_AS_NUMBER_H_
-#define _SWFDEC_AS_NUMBER_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsNumber SwfdecAsNumber;
-typedef struct _SwfdecAsNumberClass SwfdecAsNumberClass;
-
-#define SWFDEC_TYPE_AS_NUMBER                    (swfdec_as_number_get_type())
-#define SWFDEC_IS_AS_NUMBER(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_NUMBER))
-#define SWFDEC_IS_AS_NUMBER_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_NUMBER))
-#define SWFDEC_AS_NUMBER(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_NUMBER, SwfdecAsNumber))
-#define SWFDEC_AS_NUMBER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_NUMBER, SwfdecAsNumberClass))
-#define SWFDEC_AS_NUMBER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_NUMBER, SwfdecAsNumberClass))
-
-struct _SwfdecAsNumber {
-  SwfdecAsObject	object;
-
-  double		number;		/* number represented by this number object */
-};
-
-struct _SwfdecAsNumberClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-GType		swfdec_as_number_get_type	(void);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
deleted file mode 100644
index d898f01..0000000
--- a/libswfdec/swfdec_as_object.c
+++ /dev/null
@@ -1,1773 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include "swfdec_as_object.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_string.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_super.h"
-#include "swfdec_debug.h"
-#include "swfdec_movie.h"
-
-/**
- * SECTION:SwfdecAsObject
- * @title: SwfdecAsObject
- * @short_description: the base object type for scriptable objects
- *
- * This is the basic object type in Swfdec. Every object used by the script 
- * engine must be a #SwfdecAsObject. It handles memory management and assigning
- * variables to it. Almost all functions that are called on objects require that
- * the objects have been added to the garbage collector previously. For 
- * custom-created objects, you need to do this using swfdec_as_object_add(), 
- * built-in functions that create objects do this manually.
- *
- * Note that you cannot know the lifetime of a #SwfdecAsObject, since scripts 
- * may assign it as a variable to other objects. So you should not assume to 
- * know when an object gets removed.
- */
-
-/**
- * SwfdecAsObject:
- *
- * Every object value inside the Swfdec script engine must be a SwfdecAsObject.
- * If you want to add custom objects to your script engine, you need to create a
- * subclass. The class provides a number of virtual functions that you can 
- * override to achieve the desired behaviour.
- */
-
-/**
- * SwfdecAsVariableFlag:
- * @SWFDEC_AS_VARIABLE_HIDDEN: Do not include variable in enumerations and
- *                                swfdec_as_object_foreach().
- * @SWFDEC_AS_VARIABLE_PERMANENT: Do not allow swfdec_as_object_delete_variable()
- *                                to delete this variable.
- * @SWFDEC_AS_VARIABLE_CONSTANT: Do not allow changing the value with
- *                               swfdec_as_object_set_variable().
- * @SWFDEC_AS_VARIABLE_VERSION_6_UP: This symbol is only visible in version 6 
- *                                   and above.
- * @SWFDEC_AS_VARIABLE_VERSION_NOT_6: This symbols is visible in all versions 
- *                                    but version 6.
- * @SWFDEC_AS_VARIABLE_VERSION_7_UP: This symbol is only visible in version 7 
- *                                   and above.
- * @SWFDEC_AS_VARIABLE_VERSION_8_UP: This symbol is only visible in version 8 
- *                                   and above.
- * @SWFDEC_AS_VARIABLE_VERSION_9_UP: This symbol is only visible in version 9 
- *                                   and above.
- *
- * These flags are used to describe various properties of a variable inside
- * Swfdec. You can manually set them with swfdec_as_object_set_variable_flags().
- */
-
-/**
- * SwfdecAsDeleteReturn:
- * @SWFDEC_AS_DELETE_NOT_FOUND: The variable was not found and therefore 
- *                              couldn't be deleted.
- * @SWFDEC_AS_DELETE_DELETED: The variable was deleted.
- * @SWFDEC_AS_DELETE_NOT_DELETED: The variable was found but could not be 
- *                                deleted.
- *
- * This is the return value used by swfdec_as_object_delete_variable(). It 
- * describes the various outcomes of trying to delete a variable.
- */
-
-/**
- * SwfdecAsVariableForeach:
- * @object: The object this function is run on
- * @variable: garbage-collected name of the current variables
- * @value: value of the current variable
- * @flags: Flags associated with the current variable
- * @data: User data passed to swfdec_as_object_foreach()
- *
- * Function prototype for the swfdec_as_object_foreach() function.
- *
- * Returns: %TRUE to continue running the foreach function, %FALSE to stop
- */
-
-typedef struct _SwfdecAsVariable SwfdecAsVariable;
-struct _SwfdecAsVariable {
-  guint			flags;		/* SwfdecAsVariableFlag values */
-  SwfdecAsValue     	value;		/* value of property */
-  SwfdecAsFunction *	get;		/* getter set with swfdec_as_object_add_property */
-  SwfdecAsFunction *	set;		/* setter or %NULL */
-};
-
-typedef struct {
-  SwfdecAsFunction *	watch;		/* watcher or %NULL */
-  SwfdecAsValue		watch_data;	/* user data to watcher */
-  guint			refcount;	/* refcount - misused for recursion detection */
-} SwfdecAsWatch;
-
-G_DEFINE_TYPE (SwfdecAsObject, swfdec_as_object, G_TYPE_OBJECT)
-
-static void
-swfdec_as_object_dispose (GObject *gobject)
-{
-  SwfdecAsObject *object = SWFDEC_AS_OBJECT (gobject);
-
-  g_assert (object->properties == NULL);
-  g_slist_free (object->interfaces);
-  object->interfaces = NULL;
-
-  G_OBJECT_CLASS (swfdec_as_object_parent_class)->dispose (gobject);
-}
-
-static void
-swfdec_as_object_mark_property (gpointer key, gpointer value, gpointer unused)
-{
-  SwfdecAsVariable *var = value;
-
-  swfdec_as_string_mark (key);
-  if (var->get) {
-    swfdec_as_object_mark (SWFDEC_AS_OBJECT (var->get));
-    if (var->set)
-      swfdec_as_object_mark (SWFDEC_AS_OBJECT (var->set));
-  } else {
-    swfdec_as_value_mark (&var->value);
-  }
-}
-
-static void
-swfdec_as_object_mark_watch (gpointer key, gpointer value, gpointer unused)
-{
-  SwfdecAsWatch *watch = value;
-
-  swfdec_as_string_mark (key);
-  swfdec_as_object_mark (SWFDEC_AS_OBJECT (watch->watch));
-  swfdec_as_value_mark (&watch->watch_data);
-}
-
-static void
-swfdec_as_object_do_mark (SwfdecAsObject *object)
-{
-  if (object->prototype)
-    swfdec_as_object_mark (object->prototype);
-  g_hash_table_foreach (object->properties, swfdec_as_object_mark_property, NULL);
-  if (object->watches)
-    g_hash_table_foreach (object->watches, swfdec_as_object_mark_watch, NULL);
-  g_slist_foreach (object->interfaces, (GFunc) swfdec_as_object_mark, NULL); 
-}
-
-static void
-swfdec_as_object_do_add (SwfdecAsObject *object)
-{
-}
-
-static gboolean
-swfdec_as_object_lookup_case_insensitive (gpointer key, gpointer value, gpointer user_data)
-{
-  return g_ascii_strcasecmp (key, user_data) == 0;
-}
-
-static gboolean
-swfdec_as_variable_name_is_valid (const char *name)
-{
-  return name != SWFDEC_AS_STR_EMPTY;
-}
-
-static inline SwfdecAsVariable *
-swfdec_as_object_hash_lookup (SwfdecAsObject *object, const char *variable)
-{
-  SwfdecAsVariable *var = g_hash_table_lookup (object->properties, variable);
-
-  if (var || object->context->version >= 7)
-    return var;
-  var = g_hash_table_find (object->properties, swfdec_as_object_lookup_case_insensitive, (gpointer) variable);
-  return var;
-}
-
-static inline SwfdecAsVariable *
-swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable, guint flags)
-{
-  SwfdecAsVariable *var;
-
-  if (!swfdec_as_context_use_mem (object->context, sizeof (SwfdecAsVariable)))
-    return NULL;
-  if (!swfdec_as_variable_name_is_valid (variable))
-    return NULL;
-  var = g_slice_new0 (SwfdecAsVariable);
-  var->flags = flags;
-  g_hash_table_insert (object->properties, (gpointer) variable, var);
-
-  return var;
-}
-
-static gboolean
-swfdec_as_object_variable_enabled_in_version (SwfdecAsVariable *var,
-    guint version)
-{
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_6_UP && version < 6)
-    return FALSE;
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_NOT_6 && version == 6)
-    return FALSE;
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_7_UP && version < 7)
-    return FALSE;
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_8_UP && version < 8)
-    return FALSE;
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_9_UP && version < 9)
-    return FALSE;
-
-  return TRUE;
-}
-
-static gboolean
-swfdec_as_object_do_get (SwfdecAsObject *object, SwfdecAsObject *orig,
-    const char *variable, SwfdecAsValue *val, guint *flags)
-{
-  SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
-
-  if (var == NULL)
-    return FALSE;
-
-  /* variable flag checks */
-  if (!swfdec_as_object_variable_enabled_in_version (var,
-	object->context->version))
-    return FALSE;
-
-  if (var->get) {
-    swfdec_as_function_call (var->get, orig, 0, NULL, val);
-    swfdec_as_context_run (object->context);
-    *flags = var->flags;
-  } else {
-    *val = var->value;
-    *flags = var->flags;
-  }
-  return TRUE;
-}
-
-static SwfdecAsWatch *
-swfdec_as_watch_new (SwfdecAsFunction *function)
-{
-  SwfdecAsWatch *watch;
-
-  if (!swfdec_as_context_use_mem (SWFDEC_AS_OBJECT (function)->context, 
-	sizeof (SwfdecAsWatch)))
-    return NULL;
-
-  watch = g_slice_new (SwfdecAsWatch);
-  watch->refcount = 1;
-  watch->watch = function;
-  SWFDEC_AS_VALUE_SET_UNDEFINED (&watch->watch_data);
-  return watch;
-}
-
-static inline gboolean
-swfdec_as_watch_can_recurse (SwfdecAsWatch *watch)
-{
-  guint version;
-
-  version = SWFDEC_AS_OBJECT (watch->watch)->context->version;
-  if (version <= 6) {
-    return watch->refcount <= 1;
-  } else {
-    return watch->refcount <= 64 + 1;
-  }
-}
-
-static inline void
-swfdec_as_watch_ref (SwfdecAsWatch *watch)
-{
-  watch->refcount++;
-}
-
-static inline void
-swfdec_as_watch_unref (SwfdecAsWatch *watch)
-{
-  watch->refcount--;
-  if (watch->refcount == 0) {
-    swfdec_as_context_unuse_mem (SWFDEC_AS_OBJECT (watch->watch)->context, 
-	sizeof (SwfdecAsWatch));
-    g_slice_free (SwfdecAsWatch, watch);
-  }
-}
-
-/*
- * Like swfdec_as_object_get_prototype, but doesn't check 8_UP flag when
- * version is 7 and doesn't check if the property has been deleted if version
- * is 6 or earlier
- */
-static SwfdecAsObject *
-swfdec_as_object_get_prototype_internal (SwfdecAsObject *object)
-{
-  int version;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-
-  version = object->context->version;
-
-  if (object->prototype == NULL)
-    return NULL;
-
-  if (object->prototype_flags & SWFDEC_AS_VARIABLE_VERSION_6_UP && version < 6)
-    return NULL;
-  // don't check for NOT_6 flag
-  if (object->prototype_flags & SWFDEC_AS_VARIABLE_VERSION_7_UP && version < 7)
-    return NULL;
-  // don't check 8_UP or 9_UP for version 6, 7 or 8
-  if (object->prototype_flags & (SWFDEC_AS_VARIABLE_VERSION_8_UP | SWFDEC_AS_VARIABLE_VERSION_9_UP) && version < 6)
-    return NULL;
-  // check that it exists, if version < 7
-  if (version < 7 &&
-      !swfdec_as_object_hash_lookup (object, SWFDEC_AS_STR___proto__))
-    return NULL;
-
-  return object->prototype;
-}
-
-/*
- * Get's the object->prototype, if propflags allow it for current version and
- * if it hasn't been deleted from the object already
- */
-SwfdecAsObject *
-swfdec_as_object_get_prototype (SwfdecAsObject *object)
-{
-  int version;
-  SwfdecAsObject *prototype;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-
-  version = object->context->version;
-
-  prototype = swfdec_as_object_get_prototype_internal (object);
-
-  if (prototype == NULL)
-    return NULL;
-  // check 8_UP for version 7, still not for version 6
-  if (object->prototype_flags & SWFDEC_AS_VARIABLE_VERSION_8_UP &&
-      version == 7)
-    return NULL;
-  // check 9_UP flag for version 8, still not for version 7 or 6
-  if (object->prototype_flags & SWFDEC_AS_VARIABLE_VERSION_9_UP &&
-      version == 8)
-    return NULL;
-  // require it to exist even on version >= 7
-  if (version >= 7 &&
-      !swfdec_as_object_hash_lookup (object, SWFDEC_AS_STR___proto__))
-    return NULL;
-
-  return object->prototype;
-}
-
-static SwfdecAsVariable *
-swfdec_as_object_hash_lookup_with_prototype (SwfdecAsObject *object,
-    const char *variable, SwfdecAsObject **proto)
-{
-  SwfdecAsVariable *var;
-  SwfdecAsObject *proto_;
-
-  g_return_val_if_fail (swfdec_as_variable_name_is_valid (variable), NULL);
-
-  proto_ = NULL;
-
-  // match first level variable even if it has version flags that hide it in
-  // this version
-  var = swfdec_as_object_hash_lookup (object, variable);
-  if (var == NULL && variable != SWFDEC_AS_STR___proto__) {
-    guint i;
-
-    proto_ = swfdec_as_object_get_prototype (object);
-
-    for (i = 0; i < SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && proto_; i++) {
-      var = swfdec_as_object_hash_lookup (proto_, variable);
-      if (var && var->get)
-	break;
-      proto_ = swfdec_as_object_get_prototype (proto_);
-      var = NULL;
-    }
-
-    if (i == SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT) {
-      swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
-      return NULL;
-    }
-  }
-
-  if (proto != NULL)
-    *proto = proto_;
-
-  return var;
-}
-
-static void
-swfdec_as_object_do_set (SwfdecAsObject *object, const char *variable, 
-    const SwfdecAsValue *val, guint flags)
-{
-  SwfdecAsVariable *var;
-  SwfdecAsWatch *watch;
-  SwfdecAsObject *proto;
-
-  if (!swfdec_as_variable_name_is_valid (variable))
-    return;
-
-  var = swfdec_as_object_hash_lookup_with_prototype (object, variable, &proto);
-  if (swfdec_as_context_is_aborted (object->context))
-    return;
-
-  // if variable is disabled in this version
-  if (var != NULL && !swfdec_as_object_variable_enabled_in_version (var,
-	object->context->version)) {
-    if (proto == NULL) {
-      // it's at the top level, remove getter and setter plus overwrite
-      var->get = NULL;
-      var->set = NULL;
-    } else {
-      // it's in proto, we create a new one at the top level
-      var = NULL;
-    }
-  }
-
-  if (var == NULL) {
-    var = swfdec_as_object_hash_create (object, variable, flags);
-    if (var == NULL)
-      return;
-  } else {
-    if (var->flags & SWFDEC_AS_VARIABLE_CONSTANT)
-      return;
-    // remove the flags that could make this variable hidden
-    if (object->context->version == 6) {
-      // version 6, so let's forget SWFDEC_AS_VARIABLE_VERSION_7_UP flag, oops!
-      // we will still set the value though, even if that flag is set
-      var->flags &= ~(SWFDEC_AS_VARIABLE_VERSION_6_UP |
-	  SWFDEC_AS_VARIABLE_VERSION_NOT_6 | SWFDEC_AS_VARIABLE_VERSION_8_UP |
-	  SWFDEC_AS_VARIABLE_VERSION_9_UP);
-    } else {
-      var->flags &= ~(SWFDEC_AS_VARIABLE_VERSION_6_UP |
-	  SWFDEC_AS_VARIABLE_VERSION_NOT_6 | SWFDEC_AS_VARIABLE_VERSION_7_UP |
-	  SWFDEC_AS_VARIABLE_VERSION_8_UP | SWFDEC_AS_VARIABLE_VERSION_9_UP);
-    }
-  }
-  if (object->watches) {
-    SwfdecAsValue ret = *val;
-    watch = g_hash_table_lookup (object->watches, variable);
-    /* FIXME: figure out if this limit here is correct. Add a watch in Flash 7 
-     * and set a variable using Flash 6 */
-    if (watch && swfdec_as_watch_can_recurse (watch)) {
-      SwfdecAsValue args[4];
-      SWFDEC_AS_VALUE_SET_STRING (&args[0], variable);
-      args[1] = var->value;
-      args[2] = *val;
-      args[3] = watch->watch_data;
-      swfdec_as_watch_ref (watch);
-      swfdec_as_function_call (watch->watch, object, 4, args, &ret);
-      swfdec_as_context_run (object->context);
-      swfdec_as_watch_unref (watch);
-      var = swfdec_as_object_hash_lookup_with_prototype (object, variable,
-	  NULL);
-      if (swfdec_as_context_is_aborted (object->context))
-	return;
-      if (var == NULL) {
-	SWFDEC_INFO ("watch removed variable %s", variable);
-	return;
-      }
-    }
-
-    var->value = ret;
-  } else {
-    watch = NULL;
-  }
-  if (var->get) {
-    if (var->set) {
-      SwfdecAsValue tmp;
-      swfdec_as_function_call (var->set, object, 1, val, &tmp);
-      swfdec_as_context_run (object->context);
-    }
-  } else if (watch == NULL) {
-    var->value = *val;
-  }
-
-  if (variable == SWFDEC_AS_STR___proto__) {
-    if (SWFDEC_AS_VALUE_IS_OBJECT (val) &&
-	!SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (val))) {
-      object->prototype = SWFDEC_AS_VALUE_GET_OBJECT (val);
-      object->prototype_flags = var->flags;
-    } else {
-      object->prototype = NULL;
-      object->prototype_flags = 0;
-    }
-  }
-}
-
-static void
-swfdec_as_object_do_set_flags (SwfdecAsObject *object, const char *variable, guint flags, guint mask)
-{
-  SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
-
-  if (var) {
-    var->flags = (var->flags & ~mask) | flags;
-
-    if (variable == SWFDEC_AS_STR___proto__)
-      object->prototype_flags = var->flags;
-  }
-}
-
-static void
-swfdec_as_object_free_property (gpointer key, gpointer value, gpointer data)
-{
-  SwfdecAsObject *object = data;
-
-  swfdec_as_context_unuse_mem (object->context, sizeof (SwfdecAsVariable));
-  g_slice_free (SwfdecAsVariable, value);
-}
-
-static SwfdecAsDeleteReturn
-swfdec_as_object_do_delete (SwfdecAsObject *object, const char *variable)
-{
-  SwfdecAsVariable *var;
-
-  var = g_hash_table_lookup (object->properties, variable);
-  if (var == NULL)
-    return SWFDEC_AS_DELETE_NOT_FOUND;
-  if (var->flags & SWFDEC_AS_VARIABLE_PERMANENT)
-    return SWFDEC_AS_DELETE_NOT_DELETED;
-
-  // Note: We won't remove object->prototype, even if __proto__ is deleted
-
-  swfdec_as_object_free_property (NULL, var, object);
-  if (!g_hash_table_remove (object->properties, variable)) {
-    g_assert_not_reached ();
-  }
-  return SWFDEC_AS_DELETE_DELETED;
-}
-
-typedef struct {
-  SwfdecAsObject *		object;
-  SwfdecAsVariableForeach	func;
-  gpointer			data;
-  gboolean			retval;
-} ForeachData;
-
-static void
-swfdec_as_object_hash_foreach (gpointer key, gpointer value, gpointer data)
-{
-  ForeachData *fdata = data;
-  SwfdecAsVariable *var = value;
-
-  if (!fdata->retval)
-    return;
-
-  fdata->retval = fdata->func (fdata->object, key, &var->value, var->flags, fdata->data);
-}
-
-/* FIXME: does not do Adobe Flash's order for Enumerate actions */
-static gboolean
-swfdec_as_object_do_foreach (SwfdecAsObject *object, SwfdecAsVariableForeach func, gpointer data)
-{
-  ForeachData fdata = { object, func, data, TRUE };
-
-  g_hash_table_foreach (object->properties, swfdec_as_object_hash_foreach, &fdata);
-  return fdata.retval;
-}
-
-typedef struct {
-  SwfdecAsObject *		object;
-  SwfdecAsVariableForeachRemove	func;
-  gpointer			data;
-} ForeachRemoveData;
-
-static gboolean
-swfdec_as_object_hash_foreach_remove (gpointer key, gpointer value, gpointer data)
-{
-  ForeachRemoveData *fdata = data;
-  SwfdecAsVariable *var = value;
-
-  if (!fdata->func (fdata->object, key, &var->value, var->flags, fdata->data))
-    return FALSE;
-
-  swfdec_as_object_free_property (NULL, var, fdata->object);
-  return TRUE;
-}
-
-/**
- * swfdec_as_object_foreach_remove:
- * @object: a #SwfdecAsObject
- * @func: function that determines which object to remove
- * @data: data to pass to @func
- *
- * Removes all variables form @object where @func returns %TRUE. This is an 
- * internal function for array operations.
- *
- * Returns: he number of variables removed
- **/
-guint
-swfdec_as_object_foreach_remove (SwfdecAsObject *object, SwfdecAsVariableForeach func,
-    gpointer data)
-{
-  ForeachRemoveData fdata = { object, func, data };
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), 0);
-  g_return_val_if_fail (func != NULL, 0);
-
-  return g_hash_table_foreach_remove (object->properties,
-      swfdec_as_object_hash_foreach_remove, &fdata);
-}
-
-typedef struct {
-  SwfdecAsObject *		object;
-  GHashTable *			properties_new;
-  SwfdecAsVariableForeachRename	func;
-  gpointer			data;
-} ForeachRenameData;
-
-static gboolean
-swfdec_as_object_hash_foreach_rename (gpointer key, gpointer value, gpointer data)
-{
-  ForeachRenameData *fdata = data;
-  SwfdecAsVariable *var = value;
-  const char *key_new;
-
-  key_new = fdata->func (fdata->object, key, &var->value, var->flags, fdata->data);
-  if (key_new) {
-    g_hash_table_insert (fdata->properties_new, (gpointer) key_new, var);
-  } else {
-    swfdec_as_object_free_property (NULL, var, fdata->object);
-  }
-
-  return TRUE;
-}
-
-/**
- * swfdec_as_object_foreach_rename:
- * @object: a #SwfdecAsObject
- * @func: function determining the new name
- * @data: data to pass to @func
- *
- * Calls @func for each variable of @object. The function is then supposed 
- * to return the new name of the variable or %NULL if the variable should be 
- * removed. This is an internal function for array operations.
- **/
-void
-swfdec_as_object_foreach_rename (SwfdecAsObject *object, SwfdecAsVariableForeachRename func,
-    gpointer data)
-{
-  ForeachRenameData fdata = { object, NULL, func, data };
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (func != NULL);
-
-  fdata.properties_new = g_hash_table_new (g_direct_hash, g_direct_equal);
-  g_hash_table_foreach_remove (object->properties, swfdec_as_object_hash_foreach_rename, &fdata);
-  g_hash_table_destroy (object->properties);
-  object->properties = fdata.properties_new;
-}
-
-static char *
-swfdec_as_object_do_debug (SwfdecAsObject *object)
-{
-  if (G_OBJECT_TYPE (object) != SWFDEC_TYPE_AS_OBJECT)
-    return g_strdup (G_OBJECT_TYPE_NAME (object));
-
-  return g_strdup ("Object");
-}
-
-static void
-swfdec_as_object_class_init (SwfdecAsObjectClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->dispose = swfdec_as_object_dispose;
-
-  klass->mark = swfdec_as_object_do_mark;
-  klass->add = swfdec_as_object_do_add;
-  klass->get = swfdec_as_object_do_get;
-  klass->set = swfdec_as_object_do_set;
-  klass->set_flags = swfdec_as_object_do_set_flags;
-  klass->del = swfdec_as_object_do_delete;
-  klass->foreach = swfdec_as_object_do_foreach;
-  klass->debug = swfdec_as_object_do_debug;
-}
-
-static void
-swfdec_as_object_init (SwfdecAsObject *object)
-{
-}
-
-/**
- * swfdec_as_object_new_empty:
- * @context: a #SwfdecAsContext
- *
- * Creates an empty object. The prototype and constructor properties of the
- * returned object will not be set. You probably want to call 
- * swfdec_as_object_set_constructor() on the returned object yourself.
- * You may want to use swfdec_as_object_new() instead.
- *
- * Returns: A new #SwfdecAsObject adde to @context or %NULL on OOM.
- **/
-SwfdecAsObject *
-swfdec_as_object_new_empty (SwfdecAsContext *context)
-{
-  SwfdecAsObject *object;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  
-  if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsObject)))
-    return NULL;
-  object = g_object_new (SWFDEC_TYPE_AS_OBJECT, NULL);
-  swfdec_as_object_add (object, context, sizeof (SwfdecAsObject));
-  return object;
-}
-
-/**
- * swfdec_as_object_new:
- * @context: a #SwfdecAsContext
- *
- * Allocates a new Object. This does the same as the Actionscript code 
- * "new Object()".
- *
- * Returns: the new object or NULL on out of memory.
- **/
-SwfdecAsObject *
-swfdec_as_object_new (SwfdecAsContext *context)
-{
-  SwfdecAsObject *object;
-  SwfdecAsValue val;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_assert (context->Object);
-  g_assert (context->Object_prototype);
-  
-  object = swfdec_as_object_new_empty (context);
-  if (object == NULL)
-    return NULL;
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR___proto__,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  return object;
-}
-
-/**
- * swfdec_as_object_add:
- * @object: #SwfdecAsObject to make garbage-collected
- * @context: #SwfdecAsContext that should manage the object
- * @size: size the object currently uses
- *
- * Takes over the reference to @object for the garbage collector of @context. 
- * The object may not already be part of a different context. The given @size 
- * must have been allocated before with swfdec_as_context_use_mem ().
- * Note that after swfdec_as_object_add() the garbage collector might hold the
- * only reference to @object.
- **/
-void
-swfdec_as_object_add (SwfdecAsObject *object, SwfdecAsContext *context, gsize size)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (object->properties == NULL);
-
-  object->context = context;
-  object->size = size;
-  g_hash_table_insert (context->objects, object, object);
-  object->properties = g_hash_table_new (g_direct_hash, g_direct_equal);
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  g_return_if_fail (klass->add);
-  klass->add (object);
-  if (context->debugger) {
-    SwfdecAsDebuggerClass *dklass = SWFDEC_AS_DEBUGGER_GET_CLASS (context->debugger);
-    if (dklass->add)
-      dklass->add (context->debugger, context, object);
-  }
-}
-
-/* This is a huge hack design-wise, but we can't use watch->watch, 
- * it might be gone already */
-static gboolean
-swfdec_as_object_steal_watches (gpointer key, gpointer value, gpointer object)
-{
-  SwfdecAsWatch *watch = value;
-
-  g_assert (watch->refcount == 1);
-  watch->watch = (SwfdecAsFunction *) object;
-  swfdec_as_watch_unref (watch);
-  return TRUE;
-}
-
-void
-swfdec_as_object_collect (SwfdecAsObject *object)
-{
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (object->properties != NULL);
-
-  g_hash_table_foreach (object->properties, swfdec_as_object_free_property, object);
-  g_hash_table_destroy (object->properties);
-  object->properties = NULL;
-  if (object->watches) {
-    g_hash_table_foreach_steal (object->watches, swfdec_as_object_steal_watches, object);
-    g_hash_table_destroy (object->watches);
-    object->watches = NULL;
-  }
-  if (object->size)
-    swfdec_as_context_unuse_mem (object->context, object->size);
-  g_object_unref (object);
-}
-
-/**
- * swfdec_as_object_set_variable:
- * @object: a #SwfdecAsObject
- * @variable: garbage-collected name of the variable to set
- * @value: value to set the variable to
- *
- * Sets a variable on @object. It is not guaranteed that getting the variable
- * after setting it results in the same value. This is a mcaro that calls 
- * swfdec_as_object_set_variable_and_flags()
- **/
-/**
- * swfdec_as_object_set_variable_and_flags:
- * @object: a #SwfdecAsObject
- * @variable: garbage-collected name of the variable to set
- * @value: value to set the variable to
- * @default_flags: flags to use if creating the variable anew - the flags will
- *                 be ignored if the property already exists.
- *
- * Sets a variable on @object. It is not guaranteed that getting the variable
- * after setting it results in the same value, because various mechanisms (like
- * the Actionscript Object.addProperty function or constant variables) can 
- * avoid this.
- **/
-void
-swfdec_as_object_set_variable_and_flags (SwfdecAsObject *object,
-    const char *variable, const SwfdecAsValue *value, guint default_flags)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (variable != NULL);
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
-
-  if (object->context->debugger) {
-    SwfdecAsDebugger *debugger = object->context->debugger;
-    SwfdecAsDebuggerClass *dklass = SWFDEC_AS_DEBUGGER_GET_CLASS (debugger);
-    if (dklass->set_variable)
-      dklass->set_variable (debugger, object->context, object, variable, value);
-  }
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  klass->set (object, variable, value, default_flags);
-}
-
-/**
- * swfdec_as_object_peek_variable:
- * @object: the object to query
- * @name: name of the variable to query
- *
- * Checks if the given @object contains a variable wih the given @name and if 
- * so, returns a pointer to its value. This pointer will be valid until calling
- * a setting function on the given object again.
- * <warning><para>This function is internal as it provides a pointer to an 
- * internal structure. Do not use it unless you are sure you need to. This
- * function skips prototypes, variables added via swfdec_as_value_add_variable()
- * and does not verify visibility flags.</para></warning>
- *
- * Returns: a pointer to the queried variable or %NULL if it doesn't exist
- **/
-SwfdecAsValue *
-swfdec_as_object_peek_variable (SwfdecAsObject *object, const char *name)
-{
-  SwfdecAsVariable *var;
-  
-  var = swfdec_as_object_hash_lookup (object, name);
-  if (var == NULL ||
-      var->get != NULL)
-    return NULL;
-
-  return &var->value;
-}
-
-/**
- * swfdec_as_object_get_variable:
- * @object: a #SwfdecAsObject
- * @variable: a garbage-collected string containing the name of the variable
- * @value: pointer to a #SwfdecAsValue that takes the return value or %NULL
- *
- * Gets the value of the given @variable on @object. It walks the prototype 
- * chain. This is a shortcut macro for 
- * swfdec_as_object_get_variable_and_flags().
- *
- * Returns: %TRUE if the variable existed, %FALSE otherwise
- */
-
-/**
- * swfdec_as_object_get_variable_and_flags:
- * @object: a #SwfdecAsObject
- * @variable: a garbage-collected string containing the name of the variable
- * @value: pointer to a #SwfdecAsValue that takes the return value or %NULL
- * @flags: pointer to a guint taking the variable's flags or %NULL
- * @pobject: pointer to set to the object that really holds the property or 
- *           %NULL
- *
- * Looks up @variable on @object. It also walks the object's prototype chain.
- * If the variable exists, its value, flags and the real object containing the
- * variable will be set and %TRUE will be returned.
- *
- * Returns: %TRUE if the variable exists, %FALSE otherwise
- **/
-gboolean
-swfdec_as_object_get_variable_and_flags (SwfdecAsObject *object, 
-    const char *variable, SwfdecAsValue *value, guint *flags, SwfdecAsObject **pobject)
-{
-  SwfdecAsObjectClass *klass;
-  guint i;
-  SwfdecAsValue tmp_val;
-  guint tmp_flags;
-  SwfdecAsObject *tmp_pobject, *cur;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
-  g_return_val_if_fail (variable != NULL, FALSE);
-
-  if (value == NULL)
-    value = &tmp_val;
-  if (flags == NULL)
-    flags = &tmp_flags;
-  if (pobject == NULL)
-    pobject = &tmp_pobject;
-
-  cur = object;
-  for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && cur != NULL; i++) {
-    klass = SWFDEC_AS_OBJECT_GET_CLASS (cur);
-    if (klass->get (cur, object, variable, value, flags)) {
-      *pobject = cur;
-      return TRUE;
-    }
-    cur = swfdec_as_object_get_prototype_internal (cur);
-  }
-  if (i > SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT) {
-    swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
-    *flags = 0;
-    *pobject = NULL;
-    return FALSE;
-  }
-  //SWFDEC_WARNING ("no such variable %s", variable);
-  SWFDEC_AS_VALUE_SET_UNDEFINED (value);
-  *flags = 0;
-  *pobject = NULL;
-  return FALSE;
-}
-
-/**
- * swfdec_as_object_has_variable:
- * @object: a #SwfdecAsObject
- * @variable: garbage-collected variable name
- *
- * Checks if a user-set @variable with the given name exists on @object. This 
- * function does not check variables that are available via an overwritten get 
- * function of the object's class.
- *
- * Returns: %TRUE if the @object contains the given @variable
- **/
-gboolean
-swfdec_as_object_has_variable (SwfdecAsObject *object, const char *variable)
-{
-  guint i;
-  SwfdecAsVariable *var;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
-  
-  for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && object != NULL; i++) {
-    var = swfdec_as_object_hash_lookup (object, variable);
-    if (var) {
-      /* FIXME: propflags? */
-      return TRUE;
-    }
-    object = swfdec_as_object_get_prototype_internal (object);
-  }
-  return FALSE;
-}
-
-/**
- * swfdec_as_object_delete_variable:
- * @object: a #SwfdecAsObject
- * @variable: garbage-collected name of the variable
- *
- * Deletes the given variable if possible. If the variable is protected from 
- * deletion, it will not be deleted.
- *
- * Returns: See #SwfdecAsDeleteReturn for details of the return value.
- **/
-SwfdecAsDeleteReturn
-swfdec_as_object_delete_variable (SwfdecAsObject *object, const char *variable)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
-  g_return_val_if_fail (variable != NULL, FALSE);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  return klass->del (object, variable);
-}
-
-/**
- * swfdec_as_object_delete_all_variables:
- * @object: a #SwfdecAsObject
- *
- * Deletes all user-set variables from the given object.
- **/
-void
-swfdec_as_object_delete_all_variables (SwfdecAsObject *object)
-{
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-
-  g_hash_table_foreach (object->properties, swfdec_as_object_free_property, object);
-  g_hash_table_remove_all (object->properties);
-}
-
-/**
- * swfdec_as_object_set_variable_flags:
- * @object: a #SwfdecAsObject
- * @variable: the variable to modify
- * @flags: flags to set
- *
- * Sets the given flags for the given variable.
- **/
-void
-swfdec_as_object_set_variable_flags (SwfdecAsObject *object, 
-    const char *variable, SwfdecAsVariableFlag flags)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (variable != NULL);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  klass->set_flags (object, variable, flags, flags);
-}
-
-/**
- * swfdec_as_object_unset_variable_flags:
- * @object: a #SwfdecAsObject
- * @variable: the variable to modify
- * @flags: flags to unset
- *
- * Unsets the given flags for the given variable. The variable must exist in 
- * @object.
- **/
-void
-swfdec_as_object_unset_variable_flags (SwfdecAsObject *object,
-    const char *variable, SwfdecAsVariableFlag flags)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (variable != NULL);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  klass->set_flags (object, variable, 0, flags);
-}
-
-/**
- * swfdec_as_object_foreach:
- * @object: a #SwfdecAsObject
- * @func: function to call
- * @data: data to pass to @func
- *
- * Calls @func for every variable of @object or until @func returns %FALSE. The
- * variables of @object must not be modified by @func.
- *
- * Returns: %TRUE if @func always returned %TRUE
- **/
-gboolean
-swfdec_as_object_foreach (SwfdecAsObject *object, SwfdecAsVariableForeach func,
-    gpointer data)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
-  g_return_val_if_fail (func != NULL, FALSE);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  g_return_val_if_fail (klass->foreach != NULL, FALSE);
-  return klass->foreach (object, func, data);
-}
-
-/*** SIMPLIFICATIONS ***/
-
-static void
-swfdec_as_object_do_nothing (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-}
-
-/**
- * swfdec_as_object_add_function:
- * @object: a #SwfdecAsObject
- * @name: name of the function. The string does not have to be 
- *        garbage-collected.
- * @type: the required type of the this Object to make this function execute.
- *        May be 0 to accept any type.
- * @native: a native function or %NULL to just not do anything
- * @min_args: minimum number of arguments to pass to @native
- *
- * Adds @native as a variable named @name to @object. The newly added variable
- * will not be enumerated.
- *
- * Returns: the newly created #SwfdecAsFunction or %NULL on error.
- **/
-SwfdecAsFunction *
-swfdec_as_object_add_function (SwfdecAsObject *object, const char *name, GType type,
-    SwfdecAsNative native, guint min_args)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
-  g_return_val_if_fail (type == 0 || g_type_is_a (type, SWFDEC_TYPE_AS_OBJECT), NULL);
-
-  return swfdec_as_object_add_constructor (object, name, type, 0, native, min_args, NULL);
-}
-
-/**
- * swfdec_as_object_add_constructor:
- * @object: a #SwfdecAsObject
- * @name: name of the function. The string does not have to be 
- *        garbage-collected.
- * @type: the required type of the this Object to make this function execute.
- *        May be 0 to accept any type.
- * @construct_type: type used when using this function as a constructor. May 
- *                  be 0 to use the default type.
- * @native: a native function or %NULL to just not do anything
- * @min_args: minimum number of arguments to pass to @native
- * @prototype: An optional object to be set as the "prototype" property of the
- *             new function. The prototype will be hidden and constant.
- *
- * Adds @native as a constructor named @name to @object. The newly added variable
- * will not be enumerated.
- *
- * Returns: the newly created #SwfdecAsFunction or %NULL on error.
- **/
-SwfdecAsFunction *
-swfdec_as_object_add_constructor (SwfdecAsObject *object, const char *name, GType type,
-    GType construct_type, SwfdecAsNative native, guint min_args, SwfdecAsObject *prototype)
-{
-  SwfdecAsFunction *function;
-  SwfdecAsValue val;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-  g_return_val_if_fail (name != NULL, NULL);
-  g_return_val_if_fail (type == 0 || g_type_is_a (type, SWFDEC_TYPE_AS_OBJECT), NULL);
-  g_return_val_if_fail (construct_type == 0 || g_type_is_a (construct_type, SWFDEC_TYPE_AS_OBJECT), NULL);
-  g_return_val_if_fail (prototype == NULL || SWFDEC_IS_AS_OBJECT (prototype), NULL);
-
-  if (!native)
-    native = swfdec_as_object_do_nothing;
-  function = swfdec_as_native_function_new (object->context, name, native, min_args, prototype);
-  if (function == NULL)
-    return NULL;
-  if (type != 0)
-    swfdec_as_native_function_set_object_type (SWFDEC_AS_NATIVE_FUNCTION (function), type);
-  if (construct_type != 0)
-    swfdec_as_native_function_set_construct_type (SWFDEC_AS_NATIVE_FUNCTION (function), construct_type);
-  name = swfdec_as_context_get_string (object->context, name);
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (function));
-  /* FIXME: I'd like to make sure no such property exists yet */
-  swfdec_as_object_set_variable_and_flags (object, name, &val,
-      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  return function;
-}
-
-/**
- * swfdec_as_object_run:
- * @object: a #SwfdecAsObject
- * @script: script to execute
- *
- * Executes the given @script with @object as this pointer.
- **/
-void
-swfdec_as_object_run (SwfdecAsObject *object, SwfdecScript *script)
-{
-  SwfdecAsContext *context;
-  SwfdecAsFrame *frame;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (script != NULL);
-
-  context = object->context;
-  frame = swfdec_as_frame_new (context, script);
-  if (frame == NULL)
-    return;
-  swfdec_as_frame_set_this (frame, object);
-  swfdec_as_frame_preload (frame);
-  swfdec_as_context_run (context);
-  swfdec_as_stack_pop (context);
-}
-
-/**
- * swfdec_as_object_call:
- * @object: a #SwfdecAsObject
- * @name: garbage-collected string naming the function to call. 
- * @argc: number of arguments to provide to function
- * @argv: arguments or %NULL when @argc is 0
- * @return_value: location to take the return value of the call or %NULL to 
- *                ignore the return value.
- *
- * Calls the function named @name on the given object. This function is 
- * essentially equal to the folloeing Actionscript code: 
- * <informalexample><programlisting>
- * @return_value = @object. at name (@argv[0], ..., @argv[argc-1]);
- * </programlisting></informalexample>
- **/
-void
-swfdec_as_object_call (SwfdecAsObject *object, const char *name, guint argc, 
-    SwfdecAsValue *argv, SwfdecAsValue *return_value)
-{
-  SwfdecAsValue tmp;
-  SwfdecAsFunction *fun;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (name != NULL);
-  g_return_if_fail (argc == 0 || argv != NULL);
-  g_return_if_fail (object->context->global != NULL); /* for SwfdecPlayer */
-
-  if (return_value)
-    SWFDEC_AS_VALUE_SET_UNDEFINED (return_value);
-  swfdec_as_object_get_variable (object, name, &tmp);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&tmp))
-    return;
-  fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&tmp);
-  if (!SWFDEC_IS_AS_FUNCTION (fun))
-    return;
-  swfdec_as_function_call (fun, object, argc, argv, return_value ? return_value : &tmp);
-  if (swfdec_as_context_is_aborted (object->context))
-    return;
-  swfdec_as_context_run (object->context);
-}
-
-/**
- * swfdec_as_object_create:
- * @fun: constructor
- * @n_args: number of arguments
- * @args: arguments to pass to constructor
- * @return_value: pointer for return value or %NULL to push the return value to 
- *                the stack
- *
- * Creates a new object for the given constructor and pushes the constructor on
- * top of the stack. To actually run the constructor, you need to call 
- * swfdec_as_context_run().
- **/
-void
-swfdec_as_object_create (SwfdecAsFunction *fun, guint n_args, 
-    const SwfdecAsValue *args, SwfdecAsValue *return_value)
-{
-  SwfdecAsValue val;
-  SwfdecAsObject *new;
-  SwfdecAsContext *context;
-  SwfdecAsFunction *cur;
-  SwfdecAsFrame *frame;
-  guint size = 0;
-  GType type = 0;
-
-  g_return_if_fail (SWFDEC_IS_AS_FUNCTION (fun));
-
-  context = SWFDEC_AS_OBJECT (fun)->context;
-  cur = fun;
-  do {
-    if (SWFDEC_IS_AS_NATIVE_FUNCTION (cur)) {
-      SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (cur);
-      if (native->construct_size) {
-	type = native->construct_type;
-	size = native->construct_size;
-	break;
-      }
-    }
-    swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (cur), SWFDEC_AS_STR_prototype, &val);
-    if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-      SwfdecAsObject *proto = SWFDEC_AS_VALUE_GET_OBJECT (&val);
-      swfdec_as_object_get_variable (proto, SWFDEC_AS_STR___constructor__, &val);
-      if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-	cur = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&val);
-	if (SWFDEC_IS_AS_FUNCTION (cur)) {
-	  continue;
-	}
-      }
-    }
-    cur = NULL;
-  } while (type == 0 && cur != NULL);
-  if (type == 0) {
-    type = SWFDEC_TYPE_AS_OBJECT;
-    size = sizeof (SwfdecAsObject);
-  }
-  if (!swfdec_as_context_use_mem (context, size))
-    return;
-
-  new = g_object_new (type, NULL);
-  swfdec_as_object_add (new, context, size);
-  /* set initial variables */
-  if (swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (fun), SWFDEC_AS_STR_prototype, &val)) {
-      swfdec_as_object_set_variable_and_flags (new, SWFDEC_AS_STR___proto__,
-	  &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  }
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (fun));
-  if (context->version < 7) {
-    swfdec_as_object_set_variable_and_flags (new, SWFDEC_AS_STR_constructor, 
-	&val, SWFDEC_AS_VARIABLE_HIDDEN);
-  }
-  swfdec_as_object_set_variable_and_flags (new, SWFDEC_AS_STR___constructor__, 
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_VERSION_6_UP);
-
-  frame = swfdec_as_function_call_no_preload (fun, new, n_args, args, return_value);
-  frame->construct = TRUE;
-  swfdec_as_super_new (frame, new, new->prototype);
-  swfdec_as_frame_preload (frame);
-}
-
-/**
- * swfdec_as_object_set_constructor:
- * @object: a #SwfdecAsObject
- * @construct: the constructor of @object
- *
- * Sets the constructor variables for @object. Most objects get these 
- * variables set automatically, but for objects you created yourself, you want
- * to call this function. This is essentially the same as the following script
- * code:
- * |[ object.constructor = construct;
- * object.__proto__ = construct.prototype; ]|
- **/
-void
-swfdec_as_object_set_constructor (SwfdecAsObject *object, SwfdecAsObject *construct)
-{
-  SwfdecAsValue val;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (construct));
-
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, construct);
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_constructor, 
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (construct),
-      SWFDEC_AS_STR_prototype, &val);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-    SwfdecAsObject *proto = SWFDEC_AS_VALUE_GET_OBJECT (&val);
-    SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-    swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR___proto__, 
-	&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  } else {
-    SWFDEC_WARNING ("constructor has no prototype, not setting any");
-  }
-}
-
-/**
- * swfdec_as_object_add_variable:
- * @object: a #SwfdecAsObject
- * @variable: name of the variable
- * @get: getter function to call when reading the variable
- * @set: setter function to call when writing the variable or %NULL if read-only
- * @default_flags: flags to use if creating the variable anew - the flags will
- *                 be ignored if the property already exists.
- *
- * Adds a variable to @object in the same way as the Actionscript code 
- * "object.addProperty()" would do. Accessing the variable will from now on be
- * handled by calling the @get or @set functions. A previous value of the 
- * variable or a previous call to this function will be overwritten.
- **/
-void
-swfdec_as_object_add_variable (SwfdecAsObject *object, const char *variable, 
-    SwfdecAsFunction *get, SwfdecAsFunction *set, guint default_flags)
-{
-  SwfdecAsVariable *var;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (variable != NULL);
-  g_return_if_fail (SWFDEC_IS_AS_FUNCTION (get));
-  g_return_if_fail (set == NULL || SWFDEC_IS_AS_FUNCTION (set));
-
-  var = swfdec_as_object_hash_lookup (object, variable);
-  if (var == NULL)
-    var = swfdec_as_object_hash_create (object, variable, default_flags);
-  if (var == NULL)
-    return;
-  var->get = get;
-  var->set = set;
-}
-
-void
-swfdec_as_object_add_native_variable (SwfdecAsObject *object,
-    const char *variable, SwfdecAsNative get, SwfdecAsNative set)
-{
-  SwfdecAsFunction *get_func, *set_func;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (variable != NULL);
-  g_return_if_fail (get != NULL);
-
-  get_func =
-    swfdec_as_native_function_new (object->context, variable, get, 0, NULL);
-  if (get_func == NULL)
-    return;
-
-  if (set != NULL) {
-    set_func =
-      swfdec_as_native_function_new (object->context, variable, set, 0, NULL);
-  } else {
-    set_func = NULL;
-  }
-
-  swfdec_as_object_add_variable (object, variable, get_func, set_func, 0);
-}
-
-/*** AS CODE ***/
-
-SWFDEC_AS_NATIVE (101, 2, swfdec_as_object_addProperty)
-void
-swfdec_as_object_addProperty (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  SwfdecAsFunction *get, *set;
-  const char *name;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-  if (argc < 3)
-    return;
-  name = swfdec_as_value_to_string (cx, &argv[0]);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[1]) ||
-      !SWFDEC_IS_AS_FUNCTION ((get = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&argv[1]))))
-    return;
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&argv[2])) {
-    set = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&argv[2]);
-    if (!SWFDEC_IS_AS_FUNCTION (set))
-      return;
-  } else if (SWFDEC_AS_VALUE_IS_NULL (&argv[2])) {
-    set = NULL;
-  } else {
-    return;
-  }
-
-  swfdec_as_object_add_variable (object, name, get, set, 0);
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-}
-
-SWFDEC_AS_NATIVE (101, 5, swfdec_as_object_hasOwnProperty)
-void
-swfdec_as_object_hasOwnProperty (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  SwfdecAsVariable *var;
-  const char *name;
-
-  if (object == NULL)
-    return;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-
-  // return false even if no params
-  if (argc < 1)
-    return;
-
-  name = swfdec_as_value_to_string (object->context, &argv[0]);
-
-  if (!(var = swfdec_as_object_hash_lookup (object, name)))
-    return;
-
-  /* This functions only checks NOT 6 flag, and checks it on ALL VERSIONS */
-  if (var->flags & SWFDEC_AS_VARIABLE_VERSION_NOT_6)
-    return;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-}
-
-SWFDEC_AS_NATIVE (101, 7, swfdec_as_object_isPropertyEnumerable)
-void
-swfdec_as_object_isPropertyEnumerable (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *retval)
-{
-  SwfdecAsVariable *var;
-  const char *name;
-
-  if (object == NULL)
-    return;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-
-  // return false even if no params
-  if (argc < 1)
-    return;
-
-  name = swfdec_as_value_to_string (object->context, &argv[0]);
-
-  if (!(var = swfdec_as_object_hash_lookup (object, name)))
-    return;
-
-  if (var->flags & SWFDEC_AS_VARIABLE_HIDDEN)
-    return;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-}
-
-SWFDEC_AS_NATIVE (101, 6, swfdec_as_object_isPrototypeOf)
-void
-swfdec_as_object_isPrototypeOf (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *retval)
-{
-  SwfdecAsObject *class;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-
-  // return false even if no params
-  if (argc < 1)
-    return;
-
-  class = swfdec_as_value_to_object (cx, &argv[0]);
-  if (class == NULL)
-    return;
-
-  while ((class = swfdec_as_object_get_prototype (class)) != NULL) {
-    if (object == class) {
-      SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-      return;
-    }
-  }
-
-  // not found, nothing to do
-}
-
-SWFDEC_AS_NATIVE (101, 0, swfdec_as_object_watch)
-void
-swfdec_as_object_watch (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  SwfdecAsWatch *watch;
-  const char *name;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-
-  if (argc < 2)
-    return;
-
-  name = swfdec_as_value_to_string (cx, &argv[0]);
-
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[1]))
-    return;
-
-  if (!SWFDEC_IS_AS_FUNCTION (SWFDEC_AS_VALUE_GET_OBJECT (&argv[1])))
-    return;
-
-  if (object->watches == NULL) {
-    object->watches = g_hash_table_new_full (g_direct_hash, g_direct_equal, 
-	NULL, (GDestroyNotify) swfdec_as_watch_unref);
-    watch = NULL;
-  } else {
-    watch = g_hash_table_lookup (object->watches, name);
-  }
-  if (watch == NULL) {
-    watch = swfdec_as_watch_new (SWFDEC_AS_FUNCTION (SWFDEC_AS_VALUE_GET_OBJECT (&argv[1])));
-    if (watch == NULL)
-      return;
-    g_hash_table_insert (object->watches, (char *) name, watch);
-  } else {
-    watch->watch = SWFDEC_AS_FUNCTION (SWFDEC_AS_VALUE_GET_OBJECT (&argv[1]));
-  }
-
-  if (argc >= 3) {
-    watch->watch_data = argv[2];
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (&watch->watch_data);
-  }
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-}
-
-SWFDEC_AS_NATIVE (101, 1, swfdec_as_object_unwatch)
-void
-swfdec_as_object_unwatch (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  SwfdecAsVariable *var;
-  const char *name;
-
-  if (object == NULL)
-    return;
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE);
-
-  if (argc < 1)
-    return;
-
-  name = swfdec_as_value_to_string (cx, &argv[0]);
-
-  // special case: can't unwatch native properties
-  if ((var = swfdec_as_object_hash_lookup (object, name))&& var->get != NULL)
-      return;
-
-  if (object->watches != NULL && 
-      g_hash_table_remove (object->watches, name)) {
-
-    SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-
-    if (g_hash_table_size (object->watches) == 0) {
-      g_hash_table_destroy (object->watches);
-      object->watches = NULL;
-    }
-  }
-}
-
-SWFDEC_AS_NATIVE (101, 3, swfdec_as_object_valueOf)
-void
-swfdec_as_object_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  if (object != NULL)
-    SWFDEC_AS_VALUE_SET_OBJECT (retval, object);
-}
-
-SWFDEC_AS_NATIVE (101, 4, swfdec_as_object_toString)
-void
-swfdec_as_object_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-  if (SWFDEC_IS_AS_FUNCTION (object)) {
-    SWFDEC_AS_VALUE_SET_STRING (retval, SWFDEC_AS_STR__type_Function_);
-  } else {
-    SWFDEC_AS_VALUE_SET_STRING (retval, SWFDEC_AS_STR__object_Object_);
-  }
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (3, 3, swfdec_as_object_old_constructor)
-void
-swfdec_as_object_old_constructor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("old 'Object' function (only available as ASnative)");
-}
-
-void
-swfdec_as_object_decode (SwfdecAsObject *object, const char *str)
-{
-  SwfdecAsContext *cx = object->context;
-  SwfdecAsValue val;
-  char **varlist, *p, *unescaped;
-  guint i;
-
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (object));
-  g_return_if_fail (str != NULL);
-
-  varlist = g_strsplit (str, "&", -1);
-
-  for (i = 0; varlist[i] != NULL; i++) {
-    p = strchr (varlist[i], '=');
-    if (p != NULL) {
-      *p++ = '\0';
-      if (*p == '\0')
-	p = NULL;
-    }
-
-    if (p != NULL) {
-      unescaped = swfdec_as_string_unescape (cx, p);
-      if (unescaped != NULL) {
-	SWFDEC_AS_VALUE_SET_STRING (&val,
-	    swfdec_as_context_give_string (cx, unescaped));
-      } else {
-	SWFDEC_AS_VALUE_SET_STRING (&val, SWFDEC_AS_STR_EMPTY);
-      }
-    } else {
-      SWFDEC_AS_VALUE_SET_STRING (&val, SWFDEC_AS_STR_EMPTY);
-    }
-    unescaped = swfdec_as_string_unescape (cx, varlist[i]);
-    if (unescaped != NULL) {
-      swfdec_as_object_set_variable (object,
-	  swfdec_as_context_give_string (cx, unescaped), &val);
-    }
-  }
-  g_strfreev (varlist);
-}
-
-void
-swfdec_as_object_init_context (SwfdecAsContext *context)
-{
-  SwfdecAsValue val;
-  SwfdecAsObject *object, *proto;
-
-  proto = swfdec_as_object_new_empty (context);
-  if (!proto)
-    return;
-  object = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global, 
-      SWFDEC_AS_STR_Object, 0, NULL, 0));
-  if (!object)
-    return;
-  context->Object = object;
-  context->Object_prototype = proto;
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  /* first, set our own */
-  swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_prototype,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT |
-      SWFDEC_AS_VARIABLE_CONSTANT);
-
-  /* then finish the function prototype (use this order or 
-   * SWFDEC_AS_VARIABLE_CONSTANT won't let us */
-  swfdec_as_object_set_variable_and_flags (context->Function_prototype,
-      SWFDEC_AS_STR___proto__, &val,
-      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, object);
-  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-}
-
-/**
- * swfdec_as_object_get_debug:
- * @object: a #SwfdecAsObject
- *
- * Gets a representation string suitable for debugging. This function is 
- * guaranteed to not modify the state of the script engine, unlike 
- * swfdec_as_value_to_string() for example.
- *
- * Returns: A newly allocated string. Free it with g_free() after use.
- **/
-char *
-swfdec_as_object_get_debug (SwfdecAsObject *object)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  return klass->debug (object);
-}
-
-/**
- * swfdec_as_object_resolve:
- * @object: a #SwfdecAsObject
- *
- * Resolves the object to its real object. Some internal objects should not be
- * exposed to scripts, for example #SwfdecAsFrame objects. If an object you want
- * to expose might be internal, call this function to resolve it to an object
- * that is safe to expose.
- *
- * Returns: a non-internal object
- **/
-SwfdecAsObject *
-swfdec_as_object_resolve (SwfdecAsObject *object)
-{
-  SwfdecAsObjectClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL);
-
-  klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  if (klass->resolve == NULL)
-    return object;
-
-  return klass->resolve (object);
-}
diff --git a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h
deleted file mode 100644
index 2fe888f..0000000
--- a/libswfdec/swfdec_as_object.h
+++ /dev/null
@@ -1,190 +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_AS_OBJECT_H_
-#define _SWFDEC_AS_OBJECT_H_
-
-#include <glib-object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-/* NB: matches ASSetPropFlags */
-typedef enum {
-  SWFDEC_AS_VARIABLE_HIDDEN = (1 << 0),
-  SWFDEC_AS_VARIABLE_PERMANENT = (1 << 1),
-  SWFDEC_AS_VARIABLE_CONSTANT = (1 << 2),
-
-  SWFDEC_AS_VARIABLE_VERSION_6_UP = (1 << 7),
-  SWFDEC_AS_VARIABLE_VERSION_NOT_6 = (1 << 8),
-  SWFDEC_AS_VARIABLE_VERSION_7_UP = (1 << 10),
-  SWFDEC_AS_VARIABLE_VERSION_8_UP = (1 << 12),
-  SWFDEC_AS_VARIABLE_VERSION_9_UP = (1 << 13),
-} SwfdecAsVariableFlag;
-
-typedef enum {
-  SWFDEC_AS_DELETE_NOT_FOUND = 0,
-  SWFDEC_AS_DELETE_DELETED,
-  SWFDEC_AS_DELETE_NOT_DELETED
-} SwfdecAsDeleteReturn;
-
-typedef struct _SwfdecAsObjectClass SwfdecAsObjectClass;
-typedef gboolean (* SwfdecAsVariableForeach) (SwfdecAsObject *object, 
-    const char *variable, SwfdecAsValue *value, guint flags, gpointer data);
-
-#define SWFDEC_TYPE_AS_OBJECT                    (swfdec_as_object_get_type())
-#define SWFDEC_IS_AS_OBJECT(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_OBJECT))
-#define SWFDEC_IS_AS_OBJECT_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_OBJECT))
-#define SWFDEC_AS_OBJECT(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_OBJECT, SwfdecAsObject))
-#define SWFDEC_AS_OBJECT_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_OBJECT, SwfdecAsObjectClass))
-#define SWFDEC_AS_OBJECT_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_OBJECT, SwfdecAsObjectClass))
-
-struct _SwfdecAsObject {
-  /*< protected >*/
-  GObject		object;
-  SwfdecAsContext *	context;	/* context the object belongs to */
-  /*< private >*/
-  SwfdecAsObject *	prototype;	/* prototype object (referred to as __proto__) */
-  guint			prototype_flags; /* propflags for the prototype object */
-  GHashTable *		properties;	/* string->SwfdecAsVariable mapping or NULL when not in GC */
-  GHashTable *		watches;	/* string->WatchData mapping or NULL when not watching anything */
-  guint8		flags;		/* GC flags */
-  gsize			size;		/* size reserved in GC */
-  GSList *		interfaces;	/* list of interfaces this object implements */
-};
-
-struct _SwfdecAsObjectClass {
-  GObjectClass		object_class;
-
-  /* mark everything that should survive during GC */
-  void			(* mark)		(SwfdecAsObject *	object);
-  /* object was added to the context */
-  void			(* add)			(SwfdecAsObject *	object);
-  /* get the value and flags for a variables */
-  gboolean	      	(* get)			(SwfdecAsObject *       object,
-						 SwfdecAsObject *	orig,
-						 const char *		variable,
-						 SwfdecAsValue *	val,
-						 guint *      		flags);
-  /* set the variable - and return it (or NULL on error) */
-  void			(* set)			(SwfdecAsObject *	object,
-						 const char *		variable,
-						 const SwfdecAsValue *	val,
-						 guint			default_flags);
-  /* set flags of a variable */
-  void			(* set_flags)	      	(SwfdecAsObject *	object,
-						 const char *		variable,
-						 guint			flags,
-						 guint			mask);
-  /* delete the variable - return TRUE if it exists */
-  SwfdecAsDeleteReturn	(* del)			(SwfdecAsObject *       object,
-						 const char *		variable);
-  /* call with every variable until func returns FALSE */
-  gboolean		(* foreach)		(SwfdecAsObject *	object,
-						 SwfdecAsVariableForeach func,
-						 gpointer		data);
-  /* get the real object referenced by this object (useful for internal objects) */
-  SwfdecAsObject *	(* resolve)		(SwfdecAsObject *	object);
-  /* get a debug string representation for this object */
-  char *		(* debug)		(SwfdecAsObject *	object);
-};
-
-GType		swfdec_as_object_get_type	(void);
-
-SwfdecAsObject *swfdec_as_object_new		(SwfdecAsContext *    	context);
-SwfdecAsObject *swfdec_as_object_new_empty    	(SwfdecAsContext *    	context);
-void		swfdec_as_object_create		(SwfdecAsFunction *	fun,
-						 guint			n_args,
-						 const SwfdecAsValue *	args,
-						 SwfdecAsValue *	return_value);
-void		swfdec_as_object_set_constructor(SwfdecAsObject *	object,
-						 SwfdecAsObject *	construct);
-SwfdecAsObject *swfdec_as_object_resolve	(SwfdecAsObject *	object);
-char *		swfdec_as_object_get_debug	(SwfdecAsObject *	object);
-
-void		swfdec_as_object_add		(SwfdecAsObject *     	object,
-						 SwfdecAsContext *    	context,
-						 gsize			size);
-
-/* I'd like to name these [gs]et_property, but binding authors will complain
- * about overlap with g_object_[gs]et_property then */
-#define swfdec_as_object_set_variable(object, variable, value) \
-  swfdec_as_object_set_variable_and_flags (object, variable, value, 0)
-void		swfdec_as_object_set_variable_and_flags
-						(SwfdecAsObject *	object,
-						 const char *		variable,
-						 const SwfdecAsValue *	value,
-						 guint			default_flags);
-void		swfdec_as_object_add_variable	(SwfdecAsObject *	object,
-						 const char *		variable, 
-						 SwfdecAsFunction *	get,
-						 SwfdecAsFunction *	set,
-						 SwfdecAsVariableFlag	default_flags);
-#define swfdec_as_object_get_variable(object, variable, value) \
-  swfdec_as_object_get_variable_and_flags (object, variable, value, NULL, NULL)
-gboolean	swfdec_as_object_get_variable_and_flags
-						(SwfdecAsObject *	object,
-						 const char *		variable,
-						 SwfdecAsValue *	value,
-						 guint *		flags,
-						 SwfdecAsObject **	pobject);
-gboolean	swfdec_as_object_has_variable	(SwfdecAsObject *	object,
-						 const char *		variable);
-SwfdecAsDeleteReturn
-		swfdec_as_object_delete_variable(SwfdecAsObject *	object,
-						 const char *		variable);
-void		swfdec_as_object_delete_all_variables
-						(SwfdecAsObject *	object);
-void		swfdec_as_object_set_variable_flags
-						(SwfdecAsObject *       object,
-						 const char *		variable,
-						 SwfdecAsVariableFlag	flags);
-void		swfdec_as_object_unset_variable_flags
-						(SwfdecAsObject *       object,
-						 const char *		variable,
-						 SwfdecAsVariableFlag	flags);
-gboolean	swfdec_as_object_foreach	(SwfdecAsObject *       object,
-						 SwfdecAsVariableForeach func,
-						 gpointer		data);
-
-SwfdecAsFunction *swfdec_as_object_add_function	(SwfdecAsObject *	object,
-						 const char *		name,
-						 GType			type,
-						 SwfdecAsNative		native,
-						 guint			min_args);
-SwfdecAsFunction *swfdec_as_object_add_constructor
-						(SwfdecAsObject *	object,
-						 const char *		name,
-						 GType			type,
-						 GType			construct_type,
-						 SwfdecAsNative		native,
-						 guint			min_args,
-						 SwfdecAsObject *	prototype);
-
-void		swfdec_as_object_call		(SwfdecAsObject *       object,
-						 const char *		name,
-						 guint			argc,
-						 SwfdecAsValue *	argv,
-						 SwfdecAsValue *	return_value);
-void		swfdec_as_object_run		(SwfdecAsObject *       object,
-						 SwfdecScript *		script);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_script_function.c b/libswfdec/swfdec_as_script_function.c
deleted file mode 100644
index c696305..0000000
--- a/libswfdec/swfdec_as_script_function.c
+++ /dev/null
@@ -1,154 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_as_script_function.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsScriptFunction, swfdec_as_script_function, SWFDEC_TYPE_AS_FUNCTION)
-
-static SwfdecAsFrame *
-swfdec_as_script_function_call (SwfdecAsFunction *function)
-{
-  SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (function);
-  SwfdecAsFrame *frame;
-
-  frame = swfdec_as_frame_new (SWFDEC_AS_OBJECT (function)->context, script->script);
-  if (frame == NULL)
-    return NULL;
-  frame->scope_chain = g_slist_concat (frame->scope_chain, g_slist_copy (script->scope_chain));
-  frame->function = function;
-  frame->target = script->target;
-  frame->original_target = script->target;
-  return frame;
-}
-
-static void
-swfdec_as_script_function_dispose (GObject *object)
-{
-  SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (object);
-
-  if (script->script) {
-    swfdec_script_unref (script->script);
-    script->script = NULL;
-  }
-  g_slist_free (script->scope_chain);
-  script->scope_chain = NULL;
-
-  G_OBJECT_CLASS (swfdec_as_script_function_parent_class)->dispose (object);
-}
-
-static void
-swfdec_as_script_function_mark (SwfdecAsObject *object)
-{
-  SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (object);
-
-  g_slist_foreach (script->scope_chain, (GFunc) swfdec_as_object_mark, NULL);
-
-  SWFDEC_AS_OBJECT_CLASS (swfdec_as_script_function_parent_class)->mark (object);
-}
-
-static char *
-swfdec_as_script_function_debug (SwfdecAsObject *object)
-{
-  SwfdecAsScriptFunction *script = SWFDEC_AS_SCRIPT_FUNCTION (object);
-  SwfdecScript *s = script->script;
-  GString *string;
-  guint i;
-
-  string = g_string_new (s->name);
-  g_string_append (string, " (");
-  for (i = 0; i < s->n_arguments; i++) {
-    if (i > 0)
-      g_string_append (string, ", ");
-    g_string_append (string, s->arguments[i].name);
-  }
-  g_string_append (string, ")");
-
-  return g_string_free (string, FALSE);
-}
-
-static void
-swfdec_as_script_function_class_init (SwfdecAsScriptFunctionClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-  SwfdecAsFunctionClass *function_class = SWFDEC_AS_FUNCTION_CLASS (klass);
-
-  object_class->dispose = swfdec_as_script_function_dispose;
-
-  asobject_class->mark = swfdec_as_script_function_mark;
-  asobject_class->debug = swfdec_as_script_function_debug;
-
-  function_class->call = swfdec_as_script_function_call;
-}
-
-static void
-swfdec_as_script_function_init (SwfdecAsScriptFunction *script_function)
-{
-}
-
-SwfdecAsFunction *
-swfdec_as_script_function_new (SwfdecAsObject *target, const GSList *scope_chain, SwfdecScript *script)
-{
-  SwfdecAsValue val;
-  SwfdecAsScriptFunction *fun;
-  SwfdecAsObject *proto;
-  SwfdecAsContext *context;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (target), NULL);
-  g_return_val_if_fail (script != NULL, NULL);
-
-  context = target->context;
-  if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsScriptFunction)))
-    return NULL;
-  fun = g_object_new (SWFDEC_TYPE_AS_SCRIPT_FUNCTION, NULL);
-  if (fun == NULL)
-    return NULL;
-  fun->scope_chain = g_slist_copy ((GSList *) scope_chain);
-  fun->script = script;
-  fun->target = target;
-  swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsScriptFunction));
-  /* set prototype */
-  proto = swfdec_as_object_new_empty (context);
-  if (proto == NULL)
-    return NULL;
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
-  swfdec_as_object_set_variable_and_flags (SWFDEC_AS_OBJECT (fun),
-      SWFDEC_AS_STR_prototype, &val,
-      SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  swfdec_as_function_set_constructor (SWFDEC_AS_FUNCTION (fun));
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (fun));
-  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-  SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
-  swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__,
-      &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-
-  return SWFDEC_AS_FUNCTION (fun);
-}
-
diff --git a/libswfdec/swfdec_as_script_function.h b/libswfdec/swfdec_as_script_function.h
deleted file mode 100644
index 1972e15..0000000
--- a/libswfdec/swfdec_as_script_function.h
+++ /dev/null
@@ -1,61 +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_AS_SCRIPT_FUNCTION_H_
-#define _SWFDEC_AS_SCRIPT_FUNCTION_H_
-
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
-#include <libswfdec/swfdec_script.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsScriptFunction SwfdecAsScriptFunction;
-typedef struct _SwfdecAsScriptFunctionClass SwfdecAsScriptFunctionClass;
-
-#define SWFDEC_TYPE_AS_SCRIPT_FUNCTION                    (swfdec_as_script_function_get_type())
-#define SWFDEC_IS_AS_SCRIPT_FUNCTION(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_SCRIPT_FUNCTION))
-#define SWFDEC_IS_AS_SCRIPT_FUNCTION_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_SCRIPT_FUNCTION))
-#define SWFDEC_AS_SCRIPT_FUNCTION(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_SCRIPT_FUNCTION, SwfdecAsScriptFunction))
-#define SWFDEC_AS_SCRIPT_FUNCTION_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_SCRIPT_FUNCTION, SwfdecAsScriptFunctionClass))
-#define SWFDEC_AS_SCRIPT_FUNCTION_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_SCRIPT_FUNCTION, SwfdecAsScriptFunctionClass))
-
-/* FIXME: do two obejcts, one for scripts and one for native? */
-struct _SwfdecAsScriptFunction {
-  SwfdecAsFunction	function;
-
-  /* for script script_functions */
-  SwfdecScript *	script;		/* script being executed or NULL when native */
-  GSList *		scope_chain;  	/* scope this script_function was defined in */
-  SwfdecAsObject *	target;		/* target this object was defined in or NULL if in init script */
-};
-
-struct _SwfdecAsScriptFunctionClass {
-  SwfdecAsFunctionClass	function_class;
-};
-
-GType			swfdec_as_script_function_get_type	(void);
-
-SwfdecAsFunction *	swfdec_as_script_function_new		(SwfdecAsObject *	target,
-								 const GSList *		scope_chain,
-								 SwfdecScript *		script);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_stack.c b/libswfdec/swfdec_as_stack.c
deleted file mode 100644
index f86e1e0..0000000
--- a/libswfdec/swfdec_as_stack.c
+++ /dev/null
@@ -1,200 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include "swfdec_as_stack.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_debug.h"
-
-/* FIXME: make this configurable? */
-#define SWFDEC_AS_STACK_SIZE 8192 /* random big number */
-
-/* minimum number of elements that need to stay free that makes us remove a stack segment */
-#define SWFDEC_AS_STACK_LEFTOVER 16
-
-static SwfdecAsStack *
-swfdec_as_stack_new (SwfdecAsContext *context, guint n_elements)
-{
-  gsize size;
-  SwfdecAsStack *stack;
-
-  size = sizeof (SwfdecAsStack) + n_elements * sizeof (SwfdecAsValue);
-  if (!swfdec_as_context_use_mem (context, size))
-    return NULL;
-
-  stack = g_slice_alloc (size);
-  stack->n_elements = n_elements;
-  stack->used_elements = 0;
-  stack->next = NULL;
-  return stack;
-}
-
-static void
-swfdec_as_stack_set (SwfdecAsContext *context, SwfdecAsStack *stack)
-{
-  context->stack = stack;
-  context->base = &stack->elements[0];
-  context->cur = context->base + stack->used_elements;
-  context->end = context->base + SWFDEC_AS_STACK_SIZE;
-}
-
-gboolean
-swfdec_as_stack_push_segment (SwfdecAsContext *context)
-{
-  SwfdecAsStack *stack;
-
-  /* finish current stack */
-  if (context->stack) {
-    context->stack->used_elements = context->cur - context->base;
-    g_assert (context->stack->used_elements <= context->stack->n_elements);
-  }
-
-  stack = swfdec_as_stack_new (context, SWFDEC_AS_STACK_SIZE);
-  if (stack == NULL)
-    return FALSE;
-  SWFDEC_DEBUG ("pushing new stack segment %p", stack);
-  stack->next = context->stack;
-  swfdec_as_stack_set (context, stack);
-  return TRUE;
-}
-
-static void
-swfdec_as_stack_free (SwfdecAsContext *context, SwfdecAsStack *stack)
-{
-  gsize size;
-
-  size = sizeof (SwfdecAsStack) + stack->n_elements * sizeof (SwfdecAsValue);
-  swfdec_as_context_unuse_mem (context, size);
-  g_slice_free1 (size, stack);
-}
-
-void
-swfdec_as_stack_pop_segment (SwfdecAsContext *context)
-{
-  SwfdecAsStack *stack = context->stack;
-  if (stack->next) {
-    swfdec_as_stack_set (context, stack->next);
-  } else {
-    context->base = context->cur = context->end = NULL;
-    context->stack = NULL;
-  }
-  SWFDEC_DEBUG ("popping stack segment %p, next is %p", stack, context->stack);
-  swfdec_as_stack_free (context, stack);
-}
-
-void
-swfdec_as_stack_mark (SwfdecAsStack *stack)
-{
-  guint i;
-
-  for (i = 0; i < stack->used_elements; i++) {
-    swfdec_as_value_mark (&stack->elements[i]);
-  }
-  if (stack->next)
-    swfdec_as_stack_mark (stack->next);
-}
-
-void
-swfdec_as_stack_ensure_size (SwfdecAsContext *context, guint n_elements)
-{
-  guint current;
-  SwfdecAsStack *next;
-  
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (n_elements < SWFDEC_AS_STACK_SIZE / 2);
-
-  current = (guint) (context->cur - context->base);
-  if (G_LIKELY (current >= n_elements))
-    return;
-  next = context->stack->next;
-  /* check if we can move this to the last stack */
-  if (next && context->base != context->frame->stack_begin &&
-      (next->n_elements - next->used_elements > SWFDEC_AS_STACK_LEFTOVER + current)) {
-    memmove (&next->elements[next->used_elements], context->base, current * sizeof (SwfdecAsValue));
-    next->used_elements += current;
-    swfdec_as_stack_pop_segment (context);
-    return;
-  }
-  if (current) {
-    n_elements -= current;
-    memmove (context->base + n_elements, context->base, current * sizeof (SwfdecAsValue));
-  }
-  context->cur += n_elements;
-  if (n_elements) {
-    if (next && context->base != context->frame->stack_begin) {
-      /* this should be true by a huge amount */
-      g_assert (next->used_elements >= n_elements);
-      if (context->frame->stack_begin <= &next->elements[next->used_elements] &&
-	  context->frame->stack_begin >= &next->elements[0]) {
-	current = &next->elements[next->used_elements] - context->frame->stack_begin;
-	current = MIN (n_elements, current);
-      } else {
-	current = n_elements;
-      }
-      next->used_elements -= current;
-      n_elements -= current;
-      memmove (context->base + n_elements, &next->elements[next->used_elements], current * sizeof (SwfdecAsValue));
-    }
-    if (n_elements) {
-      memset (context->base, 0, n_elements * sizeof (SwfdecAsValue));
-    }
-  }
-}
-
-void
-swfdec_as_stack_ensure_free (SwfdecAsContext *context, guint n_elements)
-{
-  g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
-  g_return_if_fail (n_elements < SWFDEC_AS_STACK_SIZE / 2);
-
-  if (G_LIKELY ((guint) (context->end - context->cur) >= n_elements))
-    return;
-
-  if (!swfdec_as_stack_push_segment (context))
-    context->cur = context->end - n_elements;
-}
-
-guint
-swfdec_as_stack_get_size (SwfdecAsContext *context)
-{
-  SwfdecAsStack *stack;
-  SwfdecAsValue *target;
-  guint ret;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), 0);
-
-  if (context->frame == NULL)
-    return 0;
-  target = context->frame->stack_begin;
-  if (target == context->base)
-    return context->cur - context->base;
-  stack = context->stack->next;
-  ret = context->cur - context->base;
-  while (target < &stack->elements[0] && target > &stack->elements[stack->used_elements]) {
-    ret += stack->n_elements;
-    stack = stack->next;
-  }
-  ret += &stack->elements[stack->used_elements] - target;
-  return ret;
-}
diff --git a/libswfdec/swfdec_as_stack.h b/libswfdec/swfdec_as_stack.h
deleted file mode 100644
index 26e66ea..0000000
--- a/libswfdec/swfdec_as_stack.h
+++ /dev/null
@@ -1,101 +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_AS_STACK_H_
-#define _SWFDEC_AS_STACK_H_
-
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-struct _SwfdecAsStack {
-  guint			n_elements;	/* number of elements */
-  guint			used_elements;	/* elements in use (only set on stored stack) */
-  SwfdecAsStack *	next;		/* pointer to next stack */
-  SwfdecAsValue		elements[0];	/* the elements */
-};
-
-gboolean	swfdec_as_stack_push_segment  	(SwfdecAsContext *	context);
-void		swfdec_as_stack_pop_segment   	(SwfdecAsContext *	context);
-
-//#define SWFDEC_MAD_CHECKS
-#ifdef SWFDEC_MAD_CHECKS
-#include <libswfdec/swfdec_as_context.h>
-static inline SwfdecAsValue *
-swfdec_as_stack_peek (SwfdecAsContext *cx, guint n)
-{
-  g_assert (cx != NULL);
-  g_assert (n > 0);
-  g_assert (cx->cur - n >= cx->base);
-
-  return &(cx)->cur[-(gssize)(n)];
-}
-
-static inline SwfdecAsValue *
-swfdec_as_stack_pop (SwfdecAsContext *cx)
-{
-  g_assert (cx != NULL);
-  g_assert (cx->cur > cx->base);
-
-  return --cx->cur;
-}
-
-static inline SwfdecAsValue *
-swfdec_as_stack_pop_n (SwfdecAsContext *cx, guint n)
-{
-  g_assert (cx != NULL);
-  g_assert ((guint) (cx->cur - cx->base) >= n);
-
-  return cx->cur -= n;
-}
-
-static inline SwfdecAsValue *
-swfdec_as_stack_push (SwfdecAsContext *cx)
-{
-  g_assert (cx != NULL);
-  g_assert (cx->cur < cx->end);
-
-  cx->cur->type = SWFDEC_AS_TYPE_OBJECT + 1;
-  return cx->cur++;
-}
-#else /* SWFDEC_MAD_CHECKS */
-#define swfdec_as_stack_peek(cx,n) (&(cx)->cur[-(gssize)(n)])
-#define swfdec_as_stack_pop(cx) (--(cx)->cur)
-#define swfdec_as_stack_pop_n(cx, n) ((cx)->cur -= (n))
-#define swfdec_as_stack_push(cx) ((cx)->cur++)
-#endif
-#define swfdec_as_stack_swap(cx,x,y) G_STMT_START { \
-  SwfdecAsContext *__cx = (cx); \
-  SwfdecAsValue __tmp; \
-  guint __x = (x), __y = (y); \
-  __tmp = *swfdec_as_stack_peek(__cx, __x); \
-  *swfdec_as_stack_peek(__cx, __x) = *swfdec_as_stack_peek(__cx, __y); \
-  *swfdec_as_stack_peek(__cx, __y) = __tmp; \
-}G_STMT_END
-
-void		swfdec_as_stack_mark		(SwfdecAsStack *	stack);
-void		swfdec_as_stack_ensure_size	(SwfdecAsContext *	context,
-						 guint	  		n_elements);
-void		swfdec_as_stack_ensure_free	(SwfdecAsContext *	context,
-						 guint	  		n_elements);
-guint		swfdec_as_stack_get_size	(SwfdecAsContext *	context);
-						
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
deleted file mode 100644
index 69f5719..0000000
--- a/libswfdec/swfdec_as_string.c
+++ /dev/null
@@ -1,914 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <string.h>
-
-#include "swfdec_as_string.h"
-#include "swfdec_as_array.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_native_function.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-
-G_DEFINE_TYPE (SwfdecAsString, swfdec_as_string, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_as_string_do_mark (SwfdecAsObject *object)
-{
-  SwfdecAsString *string = SWFDEC_AS_STRING (object);
-
-  swfdec_as_string_mark (string->string);
-
-  SWFDEC_AS_OBJECT_CLASS (swfdec_as_string_parent_class)->mark (object);
-}
-
-static char *
-swfdec_as_string_debug (SwfdecAsObject *object)
-{
-  SwfdecAsString *string = SWFDEC_AS_STRING (object);
-
-  return g_strdup (string->string);
-}
-
-static void
-swfdec_as_string_class_init (SwfdecAsStringClass *klass)
-{
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-
-  asobject_class->mark = swfdec_as_string_do_mark;
-  asobject_class->debug = swfdec_as_string_debug;
-}
-
-static void
-swfdec_as_string_init (SwfdecAsString *string)
-{
-  string->string = SWFDEC_AS_STR_EMPTY;
-}
-
-/*** AS CODE ***/
-
-static const char *
-swfdec_as_string_object_to_string (SwfdecAsContext *context,
-    SwfdecAsObject *object)
-{
-  SwfdecAsValue val;
-
-  g_return_val_if_fail (object == NULL || SWFDEC_IS_AS_OBJECT (object),
-      SWFDEC_AS_STR_EMPTY);
-
-  if (object == NULL) {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (&val);
-  } else {
-    SWFDEC_AS_VALUE_SET_OBJECT (&val, object);
-  }
-
-  return swfdec_as_value_to_string (context, &val);
-}
-
-static inline const char *
-swfdec_as_str_nth_char (const char *s, guint n)
-{
-  while (*s && n--)
-    s = g_utf8_next_char (s);
-  return s;
-}
-
-SWFDEC_AS_NATIVE (251, 9, swfdec_as_string_lastIndexOf)
-void
-swfdec_as_string_lastIndexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  gsize len;
-  const char *s;
-
-  if (argc < 1)
-    return;
-
-  s = swfdec_as_value_to_string (cx, &argv[0]);
-  if (argc == 2) {
-    int offset = swfdec_as_value_to_integer (cx, &argv[1]);
-    if (offset < 0) {
-      SWFDEC_AS_VALUE_SET_INT (ret, -1);
-      return;
-    }
-    len = g_utf8_offset_to_pointer (string, offset + 1) - string;
-  } else {
-    len = G_MAXSIZE;
-  }
-  s = g_strrstr_len (string, len, s);
-  if (s) {
-    SWFDEC_AS_VALUE_SET_INT (ret, g_utf8_pointer_to_offset (string, s));
-  } else {
-    SWFDEC_AS_VALUE_SET_INT (ret, -1);
-  }
-}
-
-SWFDEC_AS_NATIVE (251, 8, swfdec_as_string_indexOf)
-void
-swfdec_as_string_indexOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  int offset=0, len, i=-1;
-  const char *s, *t = NULL;
-
-  if (argc < 1)
-    return;
-
-  s = swfdec_as_value_to_string (cx, &argv[0]);
-  if (argc == 2)
-    offset = swfdec_as_value_to_integer (cx, &argv[1]);
-  if (offset < 0)
-    offset = 0;
-  len = g_utf8_strlen (string, -1);
-  if (offset < len) {
-    t = strstr (g_utf8_offset_to_pointer (string, offset), s);
-  }
-  if (t != NULL) {
-    i = g_utf8_pointer_to_offset (string, t);
-  }
-
-  SWFDEC_AS_VALUE_SET_INT (ret, i);
-}
-
-SWFDEC_AS_NATIVE (251, 5, swfdec_as_string_charAt)
-void
-swfdec_as_string_charAt (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  int i;
-  const char *s, *t;
-
-  if (argc < 1)
-    return;
-
-  i = swfdec_as_value_to_integer (cx, &argv[0]);
-  if (i < 0) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
-    return;
-  }
-  s = swfdec_as_str_nth_char (string, i);
-  if (*s == 0) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
-    return;
-  }
-  t = g_utf8_next_char (s);
-  s = swfdec_as_context_give_string (cx, g_strndup (s, t - s));
-  SWFDEC_AS_VALUE_SET_STRING (ret, s);
-}
-
-SWFDEC_AS_NATIVE (251, 6, swfdec_as_string_charCodeAt)
-void
-swfdec_as_string_charCodeAt (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  int i;
-  const char *s;
-  gunichar c;
-
-  if (argc < 1)
-    return;
-
-  i = swfdec_as_value_to_integer (cx, &argv[0]);
-  if (i < 0) {
-    SWFDEC_AS_VALUE_SET_NUMBER (ret, NAN);
-    return;
-  }
-  s = swfdec_as_str_nth_char (string, i);
-  if (*s == 0) {
-    if (cx->version > 5) {
-      SWFDEC_AS_VALUE_SET_NUMBER (ret, NAN);
-    } else {
-      SWFDEC_AS_VALUE_SET_INT (ret, 0);
-    }
-    return;
-  }
-  c = g_utf8_get_char (s);
-  SWFDEC_AS_VALUE_SET_NUMBER (ret, c);
-}
-
-static void
-swfdec_as_string_fromCharCode_5 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint i, c;
-  guint8 append;
-  GError *error = NULL;
-  char *s;
-  GByteArray *array = g_byte_array_new ();
-
-  if (argc > 0) {
-    for (i = 0; i < argc; i++) {
-      c = ((guint) swfdec_as_value_to_integer (cx, &argv[i])) % 65536;
-      if (c > 255) {
-	append = c / 256;
-	g_byte_array_append (array, &append, 1);
-      }
-      append = c;
-      g_byte_array_append (array, &append, 1);
-    }
-
-    /* FIXME: are these the correct charset names? */
-    s = g_convert ((char *) array->data, array->len, "UTF-8", "LATIN1", NULL, NULL, &error);
-  } else{
-    s = g_strdup ("");
-  }
-
-  if (s) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, s));
-    g_free (s);
-  } else {
-    SWFDEC_ERROR ("%s", error->message);
-    g_error_free (error);
-  }
-  g_byte_array_free (array, TRUE);
-}
-
-static void
-swfdec_as_string_fromCharCode_6 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  gunichar tmp[8];
-  gunichar *chars;
-  guint i;
-  char *s;
-  GError *error = NULL;
-
-  if (argc <= 8)
-    chars = tmp;
-  else
-    chars = g_new (gunichar, argc);
-
-  for (i = 0; i < argc; i++) {
-    chars[i] = ((guint) swfdec_as_value_to_integer (cx, &argv[i])) % 65536;
-  }
-
-  s = g_ucs4_to_utf8 (chars, argc, NULL, NULL, &error);
-  if (s) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, s));
-    g_free (s);
-  } else {
-    SWFDEC_ERROR ("%s", error->message);
-    g_error_free (error);
-  }
-
-  if (chars != tmp)
-    g_free (chars);
-}
-
-SWFDEC_AS_NATIVE (251, 14, swfdec_as_string_fromCharCode)
-void
-swfdec_as_string_fromCharCode (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (cx->version <= 5) {
-    swfdec_as_string_fromCharCode_5 (cx, object, argc, argv, ret);
-  } else {
-    swfdec_as_string_fromCharCode_6 (cx, object, argc, argv, ret);
-  }
-}
-
-SWFDEC_AS_CONSTRUCTOR (251, 0, swfdec_as_string_construct, swfdec_as_string_get_type)
-void
-swfdec_as_string_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *s;
-
-  if (argc > 0) {
-    s = swfdec_as_value_to_string (cx, &argv[0]);
-  } else {
-    s = SWFDEC_AS_STR_EMPTY;
-  }
-
-  if (swfdec_as_context_is_constructing (cx)) {
-    SwfdecAsString *string = SWFDEC_AS_STRING (object);
-    SwfdecAsValue val;
-
-    string->string = s;
-    SWFDEC_AS_VALUE_SET_INT (&val, g_utf8_strlen (string->string, -1));
-    swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_length,
-	&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
-    SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
-  } else {
-    SWFDEC_AS_VALUE_SET_STRING (ret, s);
-  }
-}
-
-SWFDEC_AS_NATIVE (251, 2, swfdec_as_string_toString)
-void
-swfdec_as_string_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (!SWFDEC_IS_AS_STRING (object))
-    return;
-
-  SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STRING (object)->string);
-}
-
-SWFDEC_AS_NATIVE (251, 1, swfdec_as_string_valueOf)
-void
-swfdec_as_string_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (!SWFDEC_IS_AS_STRING (object))
-    return;
-
-  SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STRING (object)->string);
-}
-
-#if 0
-charAt(index:Number) : String
-charCodeAt(index:Number) : Number
-concat(value:Object) : String
-indexOf(value:String, [startIndex:Number]) : Number
-slice(start:Number, end:Number) : String
-split(delimiter:String, [limit:Number]) : Array
-#endif
-
-static void
-swfdec_as_string_split_5 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsArray *arr;
-  SwfdecAsValue val;
-  const char *str, *end, *delim;
-  int count;
-
-  if (argc < 1)
-    return;
-
-  str = swfdec_as_string_object_to_string (cx, object);
-  arr = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
-  if (arr == NULL)
-    return;
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (arr));
-  /* hi, i'm the special case */
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
-    delim = SWFDEC_AS_STR_COMMA;
-  } else {
-    delim = swfdec_as_value_to_string (cx, &argv[0]);
-  }
-  if (delim == SWFDEC_AS_STR_EMPTY) {
-    SWFDEC_AS_VALUE_SET_STRING (&val, str);
-    swfdec_as_array_push (arr, &val);
-    return;
-  }
-  if (argc > 1) {
-    swfdec_as_value_to_string (cx, &argv[0]);
-    count = swfdec_as_value_to_integer (cx, &argv[1]);
-  } else {
-    count = G_MAXINT;
-  }
-  if (count <= 0)
-    return;
-  if (str == SWFDEC_AS_STR_EMPTY || delim[1] != 0) {
-    SWFDEC_AS_VALUE_SET_STRING (&val, str);
-    swfdec_as_array_push (arr, &val);
-    return;
-  }
-  while (count > 0) {
-    end = strchr (str, delim[0]);
-    if (end == NULL) {
-      SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_get_string (cx, str));
-      swfdec_as_array_push (arr, &val);
-      break;
-    }
-    SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_give_string (cx, g_strndup (str, end - str)));
-    swfdec_as_array_push (arr, &val);
-    if (count)
-      count--;
-    str = end + 1;
-  }
-}
-
-static void
-swfdec_as_string_split_6 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsArray *arr;
-  SwfdecAsValue val;
-  const char *str, *end, *delim;
-  int count;
-  guint len;
-
-  if (argc < 1)
-    return;
-
-  str = swfdec_as_string_object_to_string (cx, object);
-  arr = SWFDEC_AS_ARRAY (swfdec_as_array_new (cx));
-  if (arr == NULL)
-    return;
-  SWFDEC_AS_VALUE_SET_OBJECT (ret, SWFDEC_AS_OBJECT (arr));
-  /* hi, i'm the special case */
-  if (SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[0])) {
-    SWFDEC_AS_VALUE_SET_STRING (&val, str);
-    swfdec_as_array_push (arr, &val);
-    return;
-  }
-  delim = swfdec_as_value_to_string (cx, &argv[0]);
-  if (str == SWFDEC_AS_STR_EMPTY) {
-    SWFDEC_AS_VALUE_SET_STRING (&val, str);
-    swfdec_as_array_push (arr, &val);
-    return;
-  }
-  if (argc > 1)
-    count = swfdec_as_value_to_integer (cx, &argv[1]);
-  else
-    count = G_MAXINT;
-  if (count <= 0)
-    return;
-  len = strlen (delim);
-  while (count > 0) {
-    if (delim == SWFDEC_AS_STR_EMPTY) {
-      if (*str)
-	end = str + 1;
-      else
-	break;
-    } else {
-      end = strstr (str, delim);
-      if (end == NULL) {
-	SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_get_string (cx, str));
-	swfdec_as_array_push (arr, &val);
-	break;
-      }
-    }
-    SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_give_string (cx, g_strndup (str, end - str)));
-    swfdec_as_array_push (arr, &val);
-    if (count)
-      count--;
-    str = end + len;
-  }
-}
-
-SWFDEC_AS_NATIVE (251, 12, swfdec_as_string_split)
-void
-swfdec_as_string_split (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  if (cx->version <= 5) {
-    swfdec_as_string_split_5 (cx, object, argc, argv, ret);
-  } else {
-    swfdec_as_string_split_6 (cx, object, argc, argv, ret);
-  }
-}
-
-SWFDEC_AS_NATIVE (251, 10, swfdec_as_string_slice)
-void
-swfdec_as_string_slice (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  int start, end, length;
-  const char *str;
-
-  if (argc == 0)
-    return;
-
-  str = swfdec_as_string_object_to_string (cx, object);
-  length = strlen (str);
-
-  start = swfdec_as_value_to_integer (cx, &argv[0]);
-  if (start < 0)
-    start += length;
-  start = CLAMP (start, 0, length);
-
-  if (argc > 1) {
-    end = swfdec_as_value_to_integer (cx, &argv[1]);
-    if (end < 0)
-      end += length;
-    end = CLAMP (end, start, length);
-  } else {
-    end = length;
-  }
-
-  SWFDEC_AS_VALUE_SET_STRING (ret,
-      swfdec_as_context_give_string (cx, g_strndup (str + start, end - start)));
-}
-
-SWFDEC_AS_NATIVE (251, 7, swfdec_as_string_concat)
-void
-swfdec_as_string_concat (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  guint i;
-  GString *string;
-
-  string = g_string_new (swfdec_as_string_object_to_string (cx, object));
-
-  for (i = 0; i < argc; i++) {
-    string = g_string_append (string, swfdec_as_value_to_string (cx, &argv[i]));
-  }
-
-  SWFDEC_AS_VALUE_SET_STRING (ret,
-      swfdec_as_context_give_string (cx, g_string_free (string, FALSE)));
-}
-
-const char *
-swfdec_as_str_sub (SwfdecAsContext *cx, const char *str, guint offset, guint len)
-{
-  const char *end;
-
-  str = g_utf8_offset_to_pointer (str, offset);
-  end = g_utf8_offset_to_pointer (str, len);
-  str = swfdec_as_context_give_string (cx, g_strndup (str, end - str));
-  return str;
-}
-
-SWFDEC_AS_NATIVE (251, 13, swfdec_as_string_substr)
-void
-swfdec_as_string_substr (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  int from, to, len;
-
-  if (argc < 1)
-    return;
-
-  from = swfdec_as_value_to_integer (cx, &argv[0]);
-  len = g_utf8_strlen (string, -1);
-  
-  if (argc > 1 && !SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[1])) {
-    to = swfdec_as_value_to_integer (cx, &argv[1]);
-    /* FIXME: wtf? */
-    if (to < 0) {
-      if (-to <= from)
-	to = 0;
-      else
-	to += len;
-      if (to < 0)
-	to = 0;
-      if (from < 0 && to >= -from)
-	to = 0;
-    }
-  } else {
-    to = G_MAXINT;
-  }
-  if (from < 0)
-    from += len;
-  from = CLAMP (from, 0, len);
-  to = CLAMP (to, 0, len - from);
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_str_sub (cx, string, from, to));
-}
-
-SWFDEC_AS_NATIVE (251, 11, swfdec_as_string_substring)
-void
-swfdec_as_string_substring (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  int from, to, len;
-
-  if (argc < 1)
-    return;
-
-  len = g_utf8_strlen (string, -1);
-  from = swfdec_as_value_to_integer (cx, &argv[0]);
-  if (argc > 1 && !SWFDEC_AS_VALUE_IS_UNDEFINED (&argv[1])) {
-    to = swfdec_as_value_to_integer (cx, &argv[1]);
-  } else {
-    to = len;
-  }
-  from = MAX (from, 0);
-  if (from >= len) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
-    return;
-  }
-  to = CLAMP (to, 0, len);
-  if (to < from) {
-    int tmp = to;
-    to = from;
-    from = tmp;
-  }
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_str_sub (cx, string, from, to - from));
-}
-
-SWFDEC_AS_NATIVE (251, 4, swfdec_as_string_toLowerCase)
-void
-swfdec_as_string_toLowerCase (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  char *s;
-
-  s = g_utf8_strdown (string, -1);
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx, s));
-}
-
-SWFDEC_AS_NATIVE (251, 3, swfdec_as_string_toUpperCase)
-void
-swfdec_as_string_toUpperCase (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  char *s;
-
-  s = g_utf8_strup (string, -1);
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx, s));
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (102, 1, swfdec_as_string_old_toLowerCase)
-void
-swfdec_as_string_old_toLowerCase (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  char *s;
-
-  s = g_ascii_strdown (string, -1);
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx, s));
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (102, 0, swfdec_as_string_old_toUpperCase)
-void
-swfdec_as_string_old_toUpperCase (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *string = swfdec_as_string_object_to_string (cx, object);
-  char *s;
-
-  s = g_ascii_strup (string, -1);
-  SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_give_string (cx, s));
-}
-
-/* escape and unescape are implemented here so the mad string functions share the same place */
-
-static char *
-swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg)
-{
-  GByteArray *array;
-  char cur = 0; /* currently decoded character */
-  char *out, *in, *s;
-  guint decoding = 0; /* set if we're decoding a %XY string */
-
-/* attention: c is a char* */
-#define APPEND(chr) G_STMT_START{ \
-  g_byte_array_append (array, (guchar *) chr, 1); \
-}G_STMT_END
-  in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
-  if (s == NULL) {
-    SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", msg);
-    return NULL;
-  }
-  array = g_byte_array_new ();
-  while (*s != 0) {
-    if (decoding) {
-      decoding++;
-      if (*s >= '0' && *s <= '9') {
-	cur = cur * 16 + *s - '0';
-      } else if (*s >= 'A' && *s <= 'F') {
-	cur = cur * 16 + *s - 'A' + 10;
-      } else if (*s >= 'a' && *s <= 'f') {
-	cur = cur * 16 + *s - 'a' + 10;
-      } else {
-	cur = 0;
-	decoding = 0;
-      }
-      if (decoding == 3) {
-	APPEND (&cur);
-	cur = 0;
-	decoding = 0;
-      }
-    } else if (*s == '%') {
-      decoding = 1;
-    } else if (*s == '+') {
-      char tmp = ' ';
-      APPEND (&tmp);
-    } else {
-      APPEND (s);
-    }
-    s++;
-  }
-  g_free (in);
-  if (array->len == 0) {
-    g_byte_array_free (array, TRUE);
-    return NULL;
-  }
-  cur = 0;
-  g_byte_array_append (array, (guchar *) &cur, 1);
-  out = g_convert ((char *) array->data, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
-  g_byte_array_free (array, TRUE);
-  if (out) {
-    return out;
-  } else {
-    g_warning ("can't convert %s to UTF-8", msg);
-    g_free (out);
-    return g_strdup ("");
-  }
-#undef APPEND
-}
-
-char *
-swfdec_as_string_escape (SwfdecAsContext *cx, const char *s)
-{
-  GByteArray *array;
-  char *in = NULL;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), NULL);
-  g_return_val_if_fail (s != NULL, NULL);
-
-  array = g_byte_array_new ();
-  if (cx->version <= 5) {
-    in = g_convert (s, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
-    if (s == NULL) {
-      SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", s);
-      return NULL;
-    } else {
-      s = in;
-    }
-  }
-  while (*s) {
-    if ((*s >= '0' && *s <= '9') ||
-        (*s >= 'A' && *s <= 'Z') ||
-        (*s >= 'a' && *s <= 'z')) {
-      g_byte_array_append (array, (guchar *) s, 1);
-    } else {
-      guchar add[3] = { '%', 0, 0 };
-      add[1] = (guchar) *s / 16;
-      add[2] = (guchar) *s % 16;
-      add[1] += add[1] < 10 ? '0' : ('A' - 10);
-      add[2] += add[2] < 10 ? '0' : ('A' - 10);
-      g_byte_array_append (array, add, 3);
-    }
-    s++;
-  }
-  g_byte_array_append (array, (guchar *) s, 1);
-  g_free (in);
-  return (char *) g_byte_array_free (array, FALSE);
-}
-
-SWFDEC_AS_NATIVE (100, 0, swfdec_as_string_escape_internal)
-void
-swfdec_as_string_escape_internal (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *s;
-  char *result;
-
-  SWFDEC_AS_CHECK (0, NULL, "s", &s);
-
-  result = swfdec_as_string_escape (cx, s);
-  if (result != NULL) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, result));
-    g_free (result);
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (ret);
-  }
-}
-
-static char *
-swfdec_as_string_unescape_6 (SwfdecAsContext *cx, const char *s)
-{
-  GByteArray *array;
-  const char *msg;
-  char cur = 0; /* currently decoded character */
-  guint decoding = 0; /* set if we're decoding a %XY string */
-  guint utf8left = 0; /* how many valid utf8 chars are still required */
-  const guchar invalid[3] = { 0xEF, 0xBF, 0xBD };
-
-/* attention: c is a char* */
-#define APPEND(chr) G_STMT_START{ \
-  guchar c = *chr; \
-  if (utf8left) { \
-    if ((c & 0xC0) == 0x80) { \
-      g_byte_array_append (array, &c, 1); \
-      utf8left--; \
-    } else { \
-      guint __len = array->len - 1; \
-      while ((array->data[__len] & 0xC0) != 0xC0) \
-	__len--; \
-      g_byte_array_set_size (array, __len); \
-      g_byte_array_append (array, invalid, 3); \
-      utf8left = 0; \
-    } \
-  } else { \
-    if (c < 0x80) { \
-      g_byte_array_append (array, &c, 1); \
-    } else if (c < 0xC0) { \
-      guchar __foo = 0xC2; \
-      g_byte_array_append (array, &__foo, 1); \
-      g_byte_array_append (array, &c, 1); \
-    } else if (c > 0xF7) { \
-      break; \
-    } else { \
-      g_byte_array_append (array, &c, 1); \
-      utf8left = (c < 0xE0) ? 1 : ((c < 0xF0) ? 2 : 3); \
-    } \
-  } \
-}G_STMT_END
-  array = g_byte_array_new ();
-  msg = s;
-  while (*s != 0) {
-    if (decoding) {
-      decoding++;
-      if (*s >= '0' && *s <= '9') {
-	cur = cur * 16 + *s - '0';
-      } else if (*s >= 'A' && *s <= 'F') {
-	cur = cur * 16 + *s - 'A' + 10;
-      } else if (*s >= 'a' && *s <= 'f') {
-	cur = cur * 16 + *s - 'a' + 10;
-      } else {
-	cur = 0;
-	decoding = 0;
-	if ((guchar) *s > 0x7F) {
-	  APPEND (s);
-	}
-      }
-      if (decoding == 3) {
-	APPEND (&cur);
-	cur = 0;
-	decoding = 0;
-      }
-    } else if (*s == '%') {
-      decoding = 1;
-    } else if (*s == '+') {
-      char tmp = ' ';
-      APPEND (&tmp);
-    } else {
-      APPEND (s);
-    }
-    s++;
-  }
-  cur = 0;
-  /* loop for break statement in APPEND macro */
-  if (utf8left) {
-    guint __len = array->len - 1;
-    while ((array->data[__len] & 0xC0) != 0xC0)
-      __len--;
-    g_byte_array_set_size (array, __len);
-  }
-  g_byte_array_append (array, (guchar *) &cur, 1);
-  if (g_utf8_validate ((char *) array->data, -1, NULL)) {
-    return (char *) g_byte_array_free (array, FALSE);
-  } else {
-    g_warning ("%s unescaped is invalid UTF-8", msg);
-    g_byte_array_free (array, TRUE);
-    return g_strdup ("");
-  }
-#undef APPEND
-}
-
-char *
-swfdec_as_string_unescape (SwfdecAsContext *context, const char *string)
-{
-  if (context->version < 6) {
-    return swfdec_as_string_unescape_5 (context, string);
-  } else {
-    return swfdec_as_string_unescape_6 (context, string);
-  }
-}
-
-SWFDEC_AS_NATIVE (100, 1, swfdec_as_string_unescape_internal)
-void
-swfdec_as_string_unescape_internal (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  const char *s;
-  char *result;
-
-  SWFDEC_AS_CHECK (0, NULL, "s", &s);
-
-  result = swfdec_as_string_unescape (cx, s);
-  if (result != NULL) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, result));
-    g_free (result);
-  } else {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (ret);
-  }
-}
-
-// only available as ASnative
-SWFDEC_AS_NATIVE (3, 0, swfdec_as_string_old_constructor)
-void
-swfdec_as_string_old_constructor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("old 'String' function (only available as ASnative)");
-}
diff --git a/libswfdec/swfdec_as_string.h b/libswfdec/swfdec_as_string.h
deleted file mode 100644
index c0cd621..0000000
--- a/libswfdec/swfdec_as_string.h
+++ /dev/null
@@ -1,62 +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_AS_STRING_H_
-#define _SWFDEC_AS_STRING_H_
-
-#include <libswfdec/swfdec_as_object.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsString SwfdecAsString;
-typedef struct _SwfdecAsStringClass SwfdecAsStringClass;
-
-#define SWFDEC_TYPE_AS_STRING                    (swfdec_as_string_get_type())
-#define SWFDEC_IS_AS_STRING(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_STRING))
-#define SWFDEC_IS_AS_STRING_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_STRING))
-#define SWFDEC_AS_STRING(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_STRING, SwfdecAsString))
-#define SWFDEC_AS_STRING_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_STRING, SwfdecAsStringClass))
-#define SWFDEC_AS_STRING_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_STRING, SwfdecAsStringClass))
-
-struct _SwfdecAsString {
-  SwfdecAsObject	object;
-
-  const char *		string;		/* string represented by this string object */
-};
-
-struct _SwfdecAsStringClass {
-  SwfdecAsObjectClass	object_class;
-};
-
-GType		swfdec_as_string_get_type	(void);
-
-const char *	swfdec_as_str_sub		(SwfdecAsContext *	cx,
-						 const char *		str,
-						 guint			offset,
-						 guint			len);
-
-char *		swfdec_as_string_escape		(SwfdecAsContext *	context,
-						 const char *		string);
-char *		swfdec_as_string_unescape	(SwfdecAsContext *	context,
-						 const char *		string);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_strings.c b/libswfdec/swfdec_as_strings.c
deleted file mode 100644
index 7f880aa..0000000
--- a/libswfdec/swfdec_as_strings.c
+++ /dev/null
@@ -1,491 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define SWFDEC_AS_CONSTANT_STRING(str) "\2" str "\0"
-const char swfdec_as_strings[] = 
-  SWFDEC_AS_CONSTANT_STRING ("")
-  SWFDEC_AS_CONSTANT_STRING ("__proto__")
-  SWFDEC_AS_CONSTANT_STRING ("this")
-  SWFDEC_AS_CONSTANT_STRING ("code")
-  SWFDEC_AS_CONSTANT_STRING ("level")
-  SWFDEC_AS_CONSTANT_STRING ("description")
-  SWFDEC_AS_CONSTANT_STRING ("status")
-  SWFDEC_AS_CONSTANT_STRING ("NetConnection.Connect.Success")
-  SWFDEC_AS_CONSTANT_STRING ("onLoad")
-  SWFDEC_AS_CONSTANT_STRING ("onEnterFrame")
-  SWFDEC_AS_CONSTANT_STRING ("onUnload")
-  SWFDEC_AS_CONSTANT_STRING ("onMouseMove")
-  SWFDEC_AS_CONSTANT_STRING ("onMouseDown")
-  SWFDEC_AS_CONSTANT_STRING ("onMouseUp")
-  SWFDEC_AS_CONSTANT_STRING ("onKeyUp")
-  SWFDEC_AS_CONSTANT_STRING ("onKeyDown")
-  SWFDEC_AS_CONSTANT_STRING ("onData")
-  SWFDEC_AS_CONSTANT_STRING ("onPress")
-  SWFDEC_AS_CONSTANT_STRING ("onRelease")
-  SWFDEC_AS_CONSTANT_STRING ("onReleaseOutside")
-  SWFDEC_AS_CONSTANT_STRING ("onRollOver")
-  SWFDEC_AS_CONSTANT_STRING ("onRollOut")
-  SWFDEC_AS_CONSTANT_STRING ("onDragOver")
-  SWFDEC_AS_CONSTANT_STRING ("onDragOut")
-  SWFDEC_AS_CONSTANT_STRING ("onConstruct")
-  SWFDEC_AS_CONSTANT_STRING ("onStatus")
-  SWFDEC_AS_CONSTANT_STRING ("error")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Buffer.Empty")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Buffer.Full")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Buffer.Flush")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Play.Start")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Play.Stop")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream.Play.StreamNotFound")
-  SWFDEC_AS_CONSTANT_STRING ("undefined")
-  SWFDEC_AS_CONSTANT_STRING ("null")
-  SWFDEC_AS_CONSTANT_STRING ("[object Object]")
-  SWFDEC_AS_CONSTANT_STRING ("true")
-  SWFDEC_AS_CONSTANT_STRING ("false")
-  SWFDEC_AS_CONSTANT_STRING ("_x")
-  SWFDEC_AS_CONSTANT_STRING ("_y")
-  SWFDEC_AS_CONSTANT_STRING ("_xscale")
-  SWFDEC_AS_CONSTANT_STRING ("_yscale")
-  SWFDEC_AS_CONSTANT_STRING ("_currentframe")
-  SWFDEC_AS_CONSTANT_STRING ("_totalframes")
-  SWFDEC_AS_CONSTANT_STRING ("_alpha")
-  SWFDEC_AS_CONSTANT_STRING ("_visible")
-  SWFDEC_AS_CONSTANT_STRING ("_width")
-  SWFDEC_AS_CONSTANT_STRING ("_height")
-  SWFDEC_AS_CONSTANT_STRING ("_rotation") 
-  SWFDEC_AS_CONSTANT_STRING ("_target")
-  SWFDEC_AS_CONSTANT_STRING ("_framesloaded")
-  SWFDEC_AS_CONSTANT_STRING ("_name") 
-  SWFDEC_AS_CONSTANT_STRING ("_droptarget")
-  SWFDEC_AS_CONSTANT_STRING ("_url") 
-  SWFDEC_AS_CONSTANT_STRING ("_highquality") 
-  SWFDEC_AS_CONSTANT_STRING ("_focusrect") 
-  SWFDEC_AS_CONSTANT_STRING ("_soundbuftime") 
-  SWFDEC_AS_CONSTANT_STRING ("_quality")
-  SWFDEC_AS_CONSTANT_STRING ("_xmouse") 
-  SWFDEC_AS_CONSTANT_STRING ("_ymouse")
-  SWFDEC_AS_CONSTANT_STRING ("_parent")
-  SWFDEC_AS_CONSTANT_STRING ("_root")
-  SWFDEC_AS_CONSTANT_STRING ("#ERROR#")
-  SWFDEC_AS_CONSTANT_STRING ("number")
-  SWFDEC_AS_CONSTANT_STRING ("boolean")
-  SWFDEC_AS_CONSTANT_STRING ("string")
-  SWFDEC_AS_CONSTANT_STRING ("movieclip")
-  SWFDEC_AS_CONSTANT_STRING ("function")
-  SWFDEC_AS_CONSTANT_STRING ("object")
-  SWFDEC_AS_CONSTANT_STRING ("toString")
-  SWFDEC_AS_CONSTANT_STRING ("valueOf")
-  SWFDEC_AS_CONSTANT_STRING ("Function")
-  SWFDEC_AS_CONSTANT_STRING ("prototype")
-  SWFDEC_AS_CONSTANT_STRING ("constructor")
-  SWFDEC_AS_CONSTANT_STRING ("Object")
-  SWFDEC_AS_CONSTANT_STRING ("hasOwnProperty")
-  SWFDEC_AS_CONSTANT_STRING ("NUMERIC")
-  SWFDEC_AS_CONSTANT_STRING ("RETURNINDEXEDARRAY")
-  SWFDEC_AS_CONSTANT_STRING ("UNIQUESORT")
-  SWFDEC_AS_CONSTANT_STRING ("DESCENDING")
-  SWFDEC_AS_CONSTANT_STRING ("CASEINSENSITIVE")
-  SWFDEC_AS_CONSTANT_STRING ("Array")
-  SWFDEC_AS_CONSTANT_STRING ("ASSetPropFlags")
-  SWFDEC_AS_CONSTANT_STRING ("0")
-  SWFDEC_AS_CONSTANT_STRING ("-Infinity")
-  SWFDEC_AS_CONSTANT_STRING ("Infinity")
-  SWFDEC_AS_CONSTANT_STRING ("NaN")
-  SWFDEC_AS_CONSTANT_STRING ("Number")
-  SWFDEC_AS_CONSTANT_STRING ("NAN")
-  SWFDEC_AS_CONSTANT_STRING ("MAX_VALUE")
-  SWFDEC_AS_CONSTANT_STRING ("MIN_VALUE")
-  SWFDEC_AS_CONSTANT_STRING ("NEGATIVE_INFINITY")
-  SWFDEC_AS_CONSTANT_STRING ("POSITIVE_INFINITY")
-  SWFDEC_AS_CONSTANT_STRING ("[type Object]")
-  SWFDEC_AS_CONSTANT_STRING ("startDrag")
-  SWFDEC_AS_CONSTANT_STRING ("Mouse")
-  SWFDEC_AS_CONSTANT_STRING ("hide")
-  SWFDEC_AS_CONSTANT_STRING ("show")
-  SWFDEC_AS_CONSTANT_STRING ("addListener")
-  SWFDEC_AS_CONSTANT_STRING ("removeListener")
-  SWFDEC_AS_CONSTANT_STRING ("MovieClip")
-  SWFDEC_AS_CONSTANT_STRING ("attachMovie")
-  SWFDEC_AS_CONSTANT_STRING ("duplicateMovieClip")
-  SWFDEC_AS_CONSTANT_STRING ("getBytesLoaded")
-  SWFDEC_AS_CONSTANT_STRING ("getBytesTotal")
-  SWFDEC_AS_CONSTANT_STRING ("getDepth")
-  SWFDEC_AS_CONSTANT_STRING ("getNextHighestDepth")
-  SWFDEC_AS_CONSTANT_STRING ("getURL")
-  SWFDEC_AS_CONSTANT_STRING ("gotoAndPlay")
-  SWFDEC_AS_CONSTANT_STRING ("gotoAndStop")
-  SWFDEC_AS_CONSTANT_STRING ("hitTest")
-  SWFDEC_AS_CONSTANT_STRING ("nextFrame")
-  SWFDEC_AS_CONSTANT_STRING ("play")
-  SWFDEC_AS_CONSTANT_STRING ("prevFrame")
-  SWFDEC_AS_CONSTANT_STRING ("removeMovieClip")
-  SWFDEC_AS_CONSTANT_STRING ("stop")
-  SWFDEC_AS_CONSTANT_STRING ("stopDrag")
-  SWFDEC_AS_CONSTANT_STRING ("swapDepths")
-  SWFDEC_AS_CONSTANT_STRING ("super")
-  SWFDEC_AS_CONSTANT_STRING ("length")
-  SWFDEC_AS_CONSTANT_STRING ("[type Function]")
-  SWFDEC_AS_CONSTANT_STRING ("arguments")
-  SWFDEC_AS_CONSTANT_STRING (",")
-  SWFDEC_AS_CONSTANT_STRING ("registerClass")
-  SWFDEC_AS_CONSTANT_STRING ("__constructor__")
-  SWFDEC_AS_CONSTANT_STRING ("_global")
-  SWFDEC_AS_CONSTANT_STRING ("aa")
-  SWFDEC_AS_CONSTANT_STRING ("ab")
-  SWFDEC_AS_CONSTANT_STRING ("ba")
-  SWFDEC_AS_CONSTANT_STRING ("bb")
-  SWFDEC_AS_CONSTANT_STRING ("ga")
-  SWFDEC_AS_CONSTANT_STRING ("gb")
-  SWFDEC_AS_CONSTANT_STRING ("ra")
-  SWFDEC_AS_CONSTANT_STRING ("rb")
-  SWFDEC_AS_CONSTANT_STRING ("getRGB")
-  SWFDEC_AS_CONSTANT_STRING ("getTransform")
-  SWFDEC_AS_CONSTANT_STRING ("setRGB")
-  SWFDEC_AS_CONSTANT_STRING ("setTransform")
-  SWFDEC_AS_CONSTANT_STRING ("Color")
-  SWFDEC_AS_CONSTANT_STRING ("push")
-  SWFDEC_AS_CONSTANT_STRING ("parseInt")
-  SWFDEC_AS_CONSTANT_STRING ("Math")
-  SWFDEC_AS_CONSTANT_STRING ("abs")
-  SWFDEC_AS_CONSTANT_STRING ("acos")
-  SWFDEC_AS_CONSTANT_STRING ("asin")
-  SWFDEC_AS_CONSTANT_STRING ("atan")
-  SWFDEC_AS_CONSTANT_STRING ("ceil")
-  SWFDEC_AS_CONSTANT_STRING ("cos")
-  SWFDEC_AS_CONSTANT_STRING ("exp")
-  SWFDEC_AS_CONSTANT_STRING ("floor")
-  SWFDEC_AS_CONSTANT_STRING ("log")
-  SWFDEC_AS_CONSTANT_STRING ("sin")
-  SWFDEC_AS_CONSTANT_STRING ("sqrt")
-  SWFDEC_AS_CONSTANT_STRING ("tan")
-  SWFDEC_AS_CONSTANT_STRING ("E")
-  SWFDEC_AS_CONSTANT_STRING ("LN10")
-  SWFDEC_AS_CONSTANT_STRING ("LN2")
-  SWFDEC_AS_CONSTANT_STRING ("LOG10E")
-  SWFDEC_AS_CONSTANT_STRING ("LOG2E")
-  SWFDEC_AS_CONSTANT_STRING ("PI")
-  SWFDEC_AS_CONSTANT_STRING ("SQRT1_2")
-  SWFDEC_AS_CONSTANT_STRING ("SQRT2")
-  SWFDEC_AS_CONSTANT_STRING ("atan2")
-  SWFDEC_AS_CONSTANT_STRING ("min")
-  SWFDEC_AS_CONSTANT_STRING ("max")
-  SWFDEC_AS_CONSTANT_STRING ("pow")
-  SWFDEC_AS_CONSTANT_STRING ("random")
-  SWFDEC_AS_CONSTANT_STRING ("round")
-  SWFDEC_AS_CONSTANT_STRING ("String")
-  SWFDEC_AS_CONSTANT_STRING ("fromCharCode")
-  SWFDEC_AS_CONSTANT_STRING ("substr")
-  SWFDEC_AS_CONSTANT_STRING ("substring")
-  SWFDEC_AS_CONSTANT_STRING ("toLowerCase")
-  SWFDEC_AS_CONSTANT_STRING ("toUpperCase")
-  SWFDEC_AS_CONSTANT_STRING ("isFinite")
-  SWFDEC_AS_CONSTANT_STRING ("isNaN")
-  SWFDEC_AS_CONSTANT_STRING ("setInterval")
-  SWFDEC_AS_CONSTANT_STRING ("clearInterval")
-  SWFDEC_AS_CONSTANT_STRING ("escape")
-  SWFDEC_AS_CONSTANT_STRING ("unescape")
-  SWFDEC_AS_CONSTANT_STRING ("charAt")
-  SWFDEC_AS_CONSTANT_STRING ("charCodeAt")
-  SWFDEC_AS_CONSTANT_STRING ("NetConnection")
-  SWFDEC_AS_CONSTANT_STRING ("connect")
-  SWFDEC_AS_CONSTANT_STRING ("createEmptyMovieClip")
-  SWFDEC_AS_CONSTANT_STRING ("split")
-  SWFDEC_AS_CONSTANT_STRING ("join")
-  SWFDEC_AS_CONSTANT_STRING ("pop")
-  SWFDEC_AS_CONSTANT_STRING ("shift")
-  SWFDEC_AS_CONSTANT_STRING ("unshift")
-  SWFDEC_AS_CONSTANT_STRING ("reverse")
-  SWFDEC_AS_CONSTANT_STRING ("concat")
-  SWFDEC_AS_CONSTANT_STRING ("slice")
-  SWFDEC_AS_CONSTANT_STRING ("splice")
-  SWFDEC_AS_CONSTANT_STRING ("sort")
-  SWFDEC_AS_CONSTANT_STRING ("sortOn")
-  SWFDEC_AS_CONSTANT_STRING ("NetStream")
-  SWFDEC_AS_CONSTANT_STRING ("pause")
-  SWFDEC_AS_CONSTANT_STRING ("seek")
-  SWFDEC_AS_CONSTANT_STRING ("setBufferTime")
-  SWFDEC_AS_CONSTANT_STRING ("load")
-  SWFDEC_AS_CONSTANT_STRING ("XML")
-  SWFDEC_AS_CONSTANT_STRING ("Video")
-  SWFDEC_AS_CONSTANT_STRING ("attachVideo")
-  SWFDEC_AS_CONSTANT_STRING ("clear")
-  SWFDEC_AS_CONSTANT_STRING ("time")
-  SWFDEC_AS_CONSTANT_STRING ("bytesLoaded")
-  SWFDEC_AS_CONSTANT_STRING ("bytesTotal")
-  SWFDEC_AS_CONSTANT_STRING ("indexOf")
-  SWFDEC_AS_CONSTANT_STRING ("call")
-  SWFDEC_AS_CONSTANT_STRING ("Boolean")
-  SWFDEC_AS_CONSTANT_STRING ("addProperty")
-  SWFDEC_AS_CONSTANT_STRING ("ASnative")
-  SWFDEC_AS_CONSTANT_STRING ("_listeners")
-  SWFDEC_AS_CONSTANT_STRING ("broadcastMessage")
-  SWFDEC_AS_CONSTANT_STRING ("showAll")
-  SWFDEC_AS_CONSTANT_STRING ("noBorder")
-  SWFDEC_AS_CONSTANT_STRING ("exactFit")
-  SWFDEC_AS_CONSTANT_STRING ("noScale")
-  SWFDEC_AS_CONSTANT_STRING ("Stage")
-  SWFDEC_AS_CONSTANT_STRING ("onResize")
-  SWFDEC_AS_CONSTANT_STRING ("getBounds")
-  SWFDEC_AS_CONSTANT_STRING ("xMin")
-  SWFDEC_AS_CONSTANT_STRING ("xMax")
-  SWFDEC_AS_CONSTANT_STRING ("yMin")
-  SWFDEC_AS_CONSTANT_STRING ("yMax")
-  SWFDEC_AS_CONSTANT_STRING ("close")
-  SWFDEC_AS_CONSTANT_STRING ("_bytesLoaded")
-  SWFDEC_AS_CONSTANT_STRING ("_bytesTotal")
-  SWFDEC_AS_CONSTANT_STRING ("xmlDecl")
-  SWFDEC_AS_CONSTANT_STRING ("docTypeDecl")
-  SWFDEC_AS_CONSTANT_STRING ("XMLNode")
-  SWFDEC_AS_CONSTANT_STRING ("namespaceURI")
-  SWFDEC_AS_CONSTANT_STRING ("localName")
-  SWFDEC_AS_CONSTANT_STRING ("prefix")
-  SWFDEC_AS_CONSTANT_STRING ("previousSibling")
-  SWFDEC_AS_CONSTANT_STRING ("parentNode")
-  SWFDEC_AS_CONSTANT_STRING ("nodeName")
-  SWFDEC_AS_CONSTANT_STRING ("nodeType")
-  SWFDEC_AS_CONSTANT_STRING ("nodeValue")
-  SWFDEC_AS_CONSTANT_STRING ("nextSibling")
-  SWFDEC_AS_CONSTANT_STRING ("lastChild")
-  SWFDEC_AS_CONSTANT_STRING ("firstChild")
-  SWFDEC_AS_CONSTANT_STRING ("childNodes")
-  SWFDEC_AS_CONSTANT_STRING ("cloneNode")
-  SWFDEC_AS_CONSTANT_STRING ("removeNode")
-  SWFDEC_AS_CONSTANT_STRING ("insertBefore")
-  SWFDEC_AS_CONSTANT_STRING ("appendChild")
-  SWFDEC_AS_CONSTANT_STRING ("getNamespaceForPrefix")
-  SWFDEC_AS_CONSTANT_STRING ("getPrefixForNamespace")
-  SWFDEC_AS_CONSTANT_STRING ("hasChildNodes")
-  SWFDEC_AS_CONSTANT_STRING ("attributes")
-  SWFDEC_AS_CONSTANT_STRING ("loaded")
-  SWFDEC_AS_CONSTANT_STRING ("lastIndexOf")
-  SWFDEC_AS_CONSTANT_STRING ("hasAudio")
-  SWFDEC_AS_CONSTANT_STRING ("hasStreamingAudio")
-  SWFDEC_AS_CONSTANT_STRING ("hasStreamingVideo")
-  SWFDEC_AS_CONSTANT_STRING ("hasEmbeddedVideo")
-  SWFDEC_AS_CONSTANT_STRING ("hasMP3")
-  SWFDEC_AS_CONSTANT_STRING ("hasAudioEncoder")
-  SWFDEC_AS_CONSTANT_STRING ("hasVideoEncoder")
-  SWFDEC_AS_CONSTANT_STRING ("hasAccessibility")
-  SWFDEC_AS_CONSTANT_STRING ("hasPrinting")
-  SWFDEC_AS_CONSTANT_STRING ("hasScreenPlayback")
-  SWFDEC_AS_CONSTANT_STRING ("hasScreenBroadcast")
-  SWFDEC_AS_CONSTANT_STRING ("isDebugger")
-  SWFDEC_AS_CONSTANT_STRING ("version")
-  SWFDEC_AS_CONSTANT_STRING ("manufacturer")
-  SWFDEC_AS_CONSTANT_STRING ("screenResolutionX")
-  SWFDEC_AS_CONSTANT_STRING ("screenResolutionY")
-  SWFDEC_AS_CONSTANT_STRING ("screenDPI")
-  SWFDEC_AS_CONSTANT_STRING ("screenColor")
-  SWFDEC_AS_CONSTANT_STRING ("pixelAspectRatio")
-  SWFDEC_AS_CONSTANT_STRING ("os")
-  SWFDEC_AS_CONSTANT_STRING ("language")
-  SWFDEC_AS_CONSTANT_STRING ("hasIME")
-  SWFDEC_AS_CONSTANT_STRING ("playerType")
-  SWFDEC_AS_CONSTANT_STRING ("avHardwareDisable")
-  SWFDEC_AS_CONSTANT_STRING ("localFileReadDisable")
-  SWFDEC_AS_CONSTANT_STRING ("windowlessDisable")
-  SWFDEC_AS_CONSTANT_STRING ("hasTLS")
-  SWFDEC_AS_CONSTANT_STRING ("serverString")
-  SWFDEC_AS_CONSTANT_STRING ("$version")
-  SWFDEC_AS_CONSTANT_STRING ("contentType")
-  SWFDEC_AS_CONSTANT_STRING ("application/x-www-form-urlencoded")
-  SWFDEC_AS_CONSTANT_STRING ("ignoreWhite")
-  SWFDEC_AS_CONSTANT_STRING ("ASconstructor")
-  SWFDEC_AS_CONSTANT_STRING ("Date")
-  SWFDEC_AS_CONSTANT_STRING ("UTC")
-  SWFDEC_AS_CONSTANT_STRING ("getTime")
-  SWFDEC_AS_CONSTANT_STRING ("getTimezoneOffset")
-  SWFDEC_AS_CONSTANT_STRING ("getMilliseconds")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCMilliseconds")
-  SWFDEC_AS_CONSTANT_STRING ("getSeconds")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCSeconds")
-  SWFDEC_AS_CONSTANT_STRING ("getMinutes")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCMinutes")
-  SWFDEC_AS_CONSTANT_STRING ("getHours")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCHours")
-  SWFDEC_AS_CONSTANT_STRING ("getDay")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCDay")
-  SWFDEC_AS_CONSTANT_STRING ("getDate")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCDate")
-  SWFDEC_AS_CONSTANT_STRING ("getMonth")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCMonth")
-  SWFDEC_AS_CONSTANT_STRING ("getYear")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCYear")
-  SWFDEC_AS_CONSTANT_STRING ("getFullYear")
-  SWFDEC_AS_CONSTANT_STRING ("getUTCFullYear")
-  SWFDEC_AS_CONSTANT_STRING ("setTime")
-  SWFDEC_AS_CONSTANT_STRING ("setMilliseconds")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCMilliseconds")
-  SWFDEC_AS_CONSTANT_STRING ("setSeconds")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCSeconds")
-  SWFDEC_AS_CONSTANT_STRING ("setMinutes")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCMinutes")
-  SWFDEC_AS_CONSTANT_STRING ("setHours")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCHours")
-  SWFDEC_AS_CONSTANT_STRING ("setDate")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCDate")
-  SWFDEC_AS_CONSTANT_STRING ("setMonth")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCMonth")
-  SWFDEC_AS_CONSTANT_STRING ("setYear")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCYear")
-  SWFDEC_AS_CONSTANT_STRING ("setFullYear")
-  SWFDEC_AS_CONSTANT_STRING ("setUTCFullYear")
-  SWFDEC_AS_CONSTANT_STRING ("target")
-  SWFDEC_AS_CONSTANT_STRING ("isPropertyEnumerable")
-  SWFDEC_AS_CONSTANT_STRING ("watch")
-  SWFDEC_AS_CONSTANT_STRING ("unwatch")
-  SWFDEC_AS_CONSTANT_STRING ("apply")
-  SWFDEC_AS_CONSTANT_STRING ("isPrototypeOf")
-  SWFDEC_AS_CONSTANT_STRING ("/")
-  SWFDEC_AS_CONSTANT_STRING ("_typewriter")
-  SWFDEC_AS_CONSTANT_STRING ("_sans")
-  SWFDEC_AS_CONSTANT_STRING ("_serif")
-  SWFDEC_AS_CONSTANT_STRING ("align")
-  SWFDEC_AS_CONSTANT_STRING ("left")
-  SWFDEC_AS_CONSTANT_STRING ("right")
-  SWFDEC_AS_CONSTANT_STRING ("center")
-  SWFDEC_AS_CONSTANT_STRING ("justify")
-  SWFDEC_AS_CONSTANT_STRING ("font")
-  SWFDEC_AS_CONSTANT_STRING ("url")
-  SWFDEC_AS_CONSTANT_STRING ("bullet")
-  SWFDEC_AS_CONSTANT_STRING ("bold")
-  SWFDEC_AS_CONSTANT_STRING ("italic")
-  SWFDEC_AS_CONSTANT_STRING ("kerning")
-  SWFDEC_AS_CONSTANT_STRING ("underline")
-  SWFDEC_AS_CONSTANT_STRING ("blockIndent")
-  SWFDEC_AS_CONSTANT_STRING ("color")
-  SWFDEC_AS_CONSTANT_STRING ("indent")
-  SWFDEC_AS_CONSTANT_STRING ("leading")
-  SWFDEC_AS_CONSTANT_STRING ("leftMargin")
-  SWFDEC_AS_CONSTANT_STRING ("rightMargin")
-  SWFDEC_AS_CONSTANT_STRING ("size")
-  SWFDEC_AS_CONSTANT_STRING ("tabStops")
-  SWFDEC_AS_CONSTANT_STRING ("letterSpacing")
-  SWFDEC_AS_CONSTANT_STRING ("display")
-  SWFDEC_AS_CONSTANT_STRING ("none")
-  SWFDEC_AS_CONSTANT_STRING ("inline")
-  SWFDEC_AS_CONSTANT_STRING ("block")
-  SWFDEC_AS_CONSTANT_STRING ("TextField")
-  SWFDEC_AS_CONSTANT_STRING ("text")
-  SWFDEC_AS_CONSTANT_STRING ("htmlText")
-  SWFDEC_AS_CONSTANT_STRING ("html")
-  SWFDEC_AS_CONSTANT_STRING ("TextFormat")
-  SWFDEC_AS_CONSTANT_STRING ("Times New Roman")
-  SWFDEC_AS_CONSTANT_STRING ("condenseWhite")
-  SWFDEC_AS_CONSTANT_STRING ("textColor")
-  SWFDEC_AS_CONSTANT_STRING ("embedFonts")
-  SWFDEC_AS_CONSTANT_STRING ("autoSize")
-  SWFDEC_AS_CONSTANT_STRING ("wordWrap")
-  SWFDEC_AS_CONSTANT_STRING ("border")
-  SWFDEC_AS_CONSTANT_STRING ("Key")
-  SWFDEC_AS_CONSTANT_STRING ("background")
-  SWFDEC_AS_CONSTANT_STRING ("backgroundColor")
-  SWFDEC_AS_CONSTANT_STRING ("borderColor")
-  SWFDEC_AS_CONSTANT_STRING ("multiline")
-  SWFDEC_AS_CONSTANT_STRING ("type")
-  SWFDEC_AS_CONSTANT_STRING ("input")
-  SWFDEC_AS_CONSTANT_STRING ("dynamic")
-  SWFDEC_AS_CONSTANT_STRING ("scroll")
-  SWFDEC_AS_CONSTANT_STRING ("maxChars")
-  SWFDEC_AS_CONSTANT_STRING ("selectable")
-  SWFDEC_AS_CONSTANT_STRING ("password")
-  SWFDEC_AS_CONSTANT_STRING ("variable")
-  SWFDEC_AS_CONSTANT_STRING ("restrict")
-  SWFDEC_AS_CONSTANT_STRING ("mouseWheelEnabled")
-  SWFDEC_AS_CONSTANT_STRING ("_level0")
-  SWFDEC_AS_CONSTANT_STRING ("hscroll")
-  SWFDEC_AS_CONSTANT_STRING ("maxhscroll")
-  SWFDEC_AS_CONSTANT_STRING ("maxscroll")
-  SWFDEC_AS_CONSTANT_STRING ("bottomScroll")
-  SWFDEC_AS_CONSTANT_STRING ("Sans")
-  SWFDEC_AS_CONSTANT_STRING ("Serif")
-  SWFDEC_AS_CONSTANT_STRING ("Monospace")
-  SWFDEC_AS_CONSTANT_STRING ("textHeight")
-  SWFDEC_AS_CONSTANT_STRING ("textWidth")
-  SWFDEC_AS_CONSTANT_STRING ("onScroller")
-  SWFDEC_AS_CONSTANT_STRING ("styleSheet")
-  SWFDEC_AS_CONSTANT_STRING ("_styles")
-  SWFDEC_AS_CONSTANT_STRING ("onLoadStart")
-  SWFDEC_AS_CONSTANT_STRING ("onLoadComplete")
-  SWFDEC_AS_CONSTANT_STRING ("onLoadError")
-  SWFDEC_AS_CONSTANT_STRING ("onLoadInit")
-  SWFDEC_AS_CONSTANT_STRING ("onLoadProgress")
-  SWFDEC_AS_CONSTANT_STRING ("URLNotFound")
-  SWFDEC_AS_CONSTANT_STRING ("IllegalRequest")
-  SWFDEC_AS_CONSTANT_STRING ("LoadNeverCompleted")
-  SWFDEC_AS_CONSTANT_STRING ("creationDate")
-  SWFDEC_AS_CONSTANT_STRING ("creator")
-  SWFDEC_AS_CONSTANT_STRING ("modificationDate")
-  SWFDEC_AS_CONSTANT_STRING ("name")
-  SWFDEC_AS_CONSTANT_STRING ("postData")
-  SWFDEC_AS_CONSTANT_STRING ("PrintJob")
-  SWFDEC_AS_CONSTANT_STRING ("orientation")
-  SWFDEC_AS_CONSTANT_STRING ("pageHeight")
-  SWFDEC_AS_CONSTANT_STRING ("pageWidth")
-  SWFDEC_AS_CONSTANT_STRING ("paperHeight")
-  SWFDEC_AS_CONSTANT_STRING ("paperWidth")
-  SWFDEC_AS_CONSTANT_STRING ("callee")
-  SWFDEC_AS_CONSTANT_STRING ("caller")
-  SWFDEC_AS_CONSTANT_STRING ("enableDebugConsole")
-  SWFDEC_AS_CONSTANT_STRING ("remote")
-  SWFDEC_AS_CONSTANT_STRING ("localWithFile")
-  SWFDEC_AS_CONSTANT_STRING ("localWithNetwork")
-  SWFDEC_AS_CONSTANT_STRING ("localTrusted")
-  SWFDEC_AS_CONSTANT_STRING ("normal")
-  SWFDEC_AS_CONSTANT_STRING ("layer")
-  SWFDEC_AS_CONSTANT_STRING ("multiply")
-  SWFDEC_AS_CONSTANT_STRING ("screen")
-  SWFDEC_AS_CONSTANT_STRING ("lighten")
-  SWFDEC_AS_CONSTANT_STRING ("darken")
-  SWFDEC_AS_CONSTANT_STRING ("difference")
-  SWFDEC_AS_CONSTANT_STRING ("add")
-  SWFDEC_AS_CONSTANT_STRING ("subtract")
-  SWFDEC_AS_CONSTANT_STRING ("invert")
-  SWFDEC_AS_CONSTANT_STRING ("alpha")
-  SWFDEC_AS_CONSTANT_STRING ("erase")
-  SWFDEC_AS_CONSTANT_STRING ("overlay")
-  SWFDEC_AS_CONSTANT_STRING ("hardlight")
-  SWFDEC_AS_CONSTANT_STRING ("getTextExtent")
-  SWFDEC_AS_CONSTANT_STRING ("domain")
-  SWFDEC_AS_CONSTANT_STRING ("linear")
-  SWFDEC_AS_CONSTANT_STRING ("radial")
-  SWFDEC_AS_CONSTANT_STRING ("matrixType")
-  SWFDEC_AS_CONSTANT_STRING ("box")
-  SWFDEC_AS_CONSTANT_STRING ("a")
-  SWFDEC_AS_CONSTANT_STRING ("b")
-  SWFDEC_AS_CONSTANT_STRING ("c")
-  SWFDEC_AS_CONSTANT_STRING ("d")
-  SWFDEC_AS_CONSTANT_STRING ("e")
-  SWFDEC_AS_CONSTANT_STRING ("f")
-  SWFDEC_AS_CONSTANT_STRING ("g")
-  SWFDEC_AS_CONSTANT_STRING ("h")
-  SWFDEC_AS_CONSTANT_STRING ("i")
-  SWFDEC_AS_CONSTANT_STRING ("r")
-  SWFDEC_AS_CONSTANT_STRING ("w")
-  SWFDEC_AS_CONSTANT_STRING ("x")
-  SWFDEC_AS_CONSTANT_STRING ("y")
-  SWFDEC_AS_CONSTANT_STRING ("idMap")
-  SWFDEC_AS_CONSTANT_STRING ("id")
-  SWFDEC_AS_CONSTANT_STRING ("onClose")
-  SWFDEC_AS_CONSTANT_STRING ("onConnect")
-  /* add more here */
-;
diff --git a/libswfdec/swfdec_as_super.c b/libswfdec/swfdec_as_super.c
deleted file mode 100644
index 9e67b40..0000000
--- a/libswfdec/swfdec_as_super.c
+++ /dev/null
@@ -1,217 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-
-#include "swfdec_as_super.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_internal.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_debug.h"
-#include "swfdec_movie.h"
-
-G_DEFINE_TYPE (SwfdecAsSuper, swfdec_as_super, SWFDEC_TYPE_AS_FUNCTION)
-
-static SwfdecAsFrame *
-swfdec_as_super_call (SwfdecAsFunction *function)
-{
-  SwfdecAsSuper *super = SWFDEC_AS_SUPER (function);
-  SwfdecAsValue val;
-  SwfdecAsFunction *fun;
-  SwfdecAsFunctionClass *klass;
-  SwfdecAsFrame *frame;
-
-  if (super->object == NULL) {
-    SWFDEC_WARNING ("super () called without an object.");
-    return NULL;
-  }
-
-  swfdec_as_object_get_variable (super->object, SWFDEC_AS_STR___constructor__, &val);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&val) ||
-      !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&val)))
-    return NULL;
-
-  klass = SWFDEC_AS_FUNCTION_GET_CLASS (fun);
-  frame = klass->call (fun);
-  if (frame == NULL)
-    return NULL;
-  /* We set the real function here. 1) swfdec_as_context_run() requires it. 
-   * And b) it makes more sense reading the constructor's name than reading "super" 
-   * in a debugger
-   */
-  frame->function = fun;
-  frame->construct = frame->next->construct;
-  swfdec_as_frame_set_this (frame, super->thisp);
-  return frame;
-}
-
-static gboolean
-swfdec_as_super_get (SwfdecAsObject *object, SwfdecAsObject *orig,
-    const char *variable, SwfdecAsValue *val, guint *flags)
-{
-  SwfdecAsSuper *super = SWFDEC_AS_SUPER (object);
-  SwfdecAsObjectClass *klass;
-  SwfdecAsObject *cur;
-  guint i;
-
-  if (super->object == NULL) {
-    SWFDEC_WARNING ("super.%s () called without an object.", variable);
-    return FALSE;
-  }
-  cur = super->object->prototype;
-  for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && cur != NULL; i++) {
-    klass = SWFDEC_AS_OBJECT_GET_CLASS (cur);
-    /* FIXME: is the orig pointer correct? */
-    if (klass->get (cur, super->object, variable, val, flags))
-      return TRUE;
-    /* FIXME: need get_prototype_internal here? */
-    cur = swfdec_as_object_get_prototype (cur);
-  }
-  if (i > SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT)
-    swfdec_as_context_abort (object->context, "Prototype recursion limit exceeded");
-  SWFDEC_AS_VALUE_SET_UNDEFINED (val);
-  *flags = 0;
-  return FALSE;
-}
-
-static void
-swfdec_as_super_set (SwfdecAsObject *object, const char *variable, const SwfdecAsValue *val, guint flags)
-{
-  /* This seems to be ignored completely */
-}
-
-static void
-swfdec_as_super_set_flags (SwfdecAsObject *object, const char *variable, guint flags, guint mask)
-{
-  /* if we have no variables, we also can't set its flags... */
-}
-
-static SwfdecAsDeleteReturn
-swfdec_as_super_delete (SwfdecAsObject *object, const char *variable)
-{
-  /* if we have no variables... */
-  return SWFDEC_AS_DELETE_NOT_FOUND;
-}
-
-static SwfdecAsObject *
-swfdec_as_super_resolve (SwfdecAsObject *object)
-{
-  SwfdecAsSuper *super = SWFDEC_AS_SUPER (object);
-
-  return super->thisp;
-}
-
-static void
-swfdec_as_super_class_init (SwfdecAsSuperClass *klass)
-{
-  SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-  SwfdecAsFunctionClass *function_class = SWFDEC_AS_FUNCTION_CLASS (klass);
-
-  asobject_class->get = swfdec_as_super_get;
-  asobject_class->set = swfdec_as_super_set;
-  asobject_class->set_flags = swfdec_as_super_set_flags;
-  asobject_class->del = swfdec_as_super_delete;
-  asobject_class->resolve = swfdec_as_super_resolve;
-
-  function_class->call = swfdec_as_super_call;
-}
-
-static void
-swfdec_as_super_init (SwfdecAsSuper *super)
-{
-}
-
-void
-swfdec_as_super_new (SwfdecAsFrame *frame, SwfdecAsObject *thisp, SwfdecAsObject *ref)
-{
-  SwfdecAsContext *context;
-  SwfdecAsSuper *super;
-
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (SWFDEC_IS_AS_OBJECT (thisp));
-  g_return_if_fail (ref == NULL || SWFDEC_IS_AS_OBJECT (ref));
-  
-  if (frame->super != NULL)
-    return;
-  context = SWFDEC_AS_OBJECT (frame)->context;
-  if (context->version <= 5)
-    return;
-
-  if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsSuper)))
-    return;
-  super = g_object_new (SWFDEC_TYPE_AS_SUPER, NULL);
-  frame->super = SWFDEC_AS_OBJECT (super);
-  swfdec_as_object_add (SWFDEC_AS_OBJECT (super), context, sizeof (SwfdecAsSuper));
-  super->thisp = thisp;
-  if (context->version <= 5) {
-    super->object = NULL;
-  } else {
-    super->object = ref;
-  }
-}
-
-/**
- * swfdec_as_super_new_chain:
- * @frame: the frame that is called
- * @super: the super object to chain from
- * @chain_to: object to chain to. Must be in the prototype chain of @super. Or
- *            %NULL to just use the super object's prototype
- *
- * This function creates a super object relative to the given @super object. It
- * is only needed when calling functions on the @super object.
- **/
-void
-swfdec_as_super_new_chain (SwfdecAsFrame *frame, SwfdecAsSuper *super,
-    const char *function_name)
-{
-  SwfdecAsObject *ref;
-  SwfdecAsContext *context;
-	  
-  g_return_if_fail (SWFDEC_IS_AS_FRAME (frame));
-  g_return_if_fail (SWFDEC_IS_AS_SUPER (super));
-
-  if (frame->super != NULL)
-    return;
-  
-  if (super->object == NULL)
-    return;
-  ref = super->object->prototype;
-  if (ref == NULL)
-    return;
-  context = SWFDEC_AS_OBJECT (frame)->context;
-  if (function_name && context->version > 6) {
-    /* skip prototypes to find the next one that has this function defined */
-    SwfdecAsObject *res;
-    if (swfdec_as_object_get_variable_and_flags (ref, 
-         function_name, NULL, NULL, &res) && ref != res) {
-      while (ref->prototype != res) {
-        ref = ref->prototype;
-        g_return_if_fail (ref);
-      }
-    }
-  }
-  swfdec_as_super_new (frame, super->thisp, ref);
-}
-
diff --git a/libswfdec/swfdec_as_super.h b/libswfdec/swfdec_as_super.h
deleted file mode 100644
index ad082e9..0000000
--- a/libswfdec/swfdec_as_super.h
+++ /dev/null
@@ -1,59 +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_AS_SUPER_H_
-#define _SWFDEC_AS_SUPER_H_
-
-#include <libswfdec/swfdec_as_function.h>
-#include <libswfdec/swfdec_as_types.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAsSuper SwfdecAsSuper;
-typedef struct _SwfdecAsSuperClass SwfdecAsSuperClass;
-
-#define SWFDEC_TYPE_AS_SUPER                    (swfdec_as_super_get_type())
-#define SWFDEC_IS_AS_SUPER(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_SUPER))
-#define SWFDEC_IS_AS_SUPER_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_SUPER))
-#define SWFDEC_AS_SUPER(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_SUPER, SwfdecAsSuper))
-#define SWFDEC_AS_SUPER_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_SUPER, SwfdecAsSuperClass))
-#define SWFDEC_AS_SUPER_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_SUPER, SwfdecAsSuperClass))
-
-struct _SwfdecAsSuper {
-  SwfdecAsFunction	function;
-
-  SwfdecAsObject *	thisp;		/* object super was called on */
-  SwfdecAsObject *	object;		/* current prototype we reference or NULL if none */
-};
-
-struct _SwfdecAsSuperClass {
-  SwfdecAsFunctionClass	function_class;
-};
-
-GType		swfdec_as_super_get_type	(void);
-
-void		swfdec_as_super_new		(SwfdecAsFrame *	frame,
-						 SwfdecAsObject *	thisp,
-						 SwfdecAsObject *	ref);
-void		swfdec_as_super_new_chain	(SwfdecAsFrame *	frame,
-						 SwfdecAsSuper *	super,
-						 const char *		function_name);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
deleted file mode 100644
index e5253d3..0000000
--- a/libswfdec/swfdec_as_types.c
+++ /dev/null
@@ -1,677 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <string.h>
-
-#include "swfdec_as_types.h"
-#include "swfdec_as_object.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_function.h"
-#include "swfdec_as_number.h"
-#include "swfdec_as_stack.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_super.h"
-#include "swfdec_debug.h"
-#include "swfdec_movie.h"
-
-/*** GTK-DOC ***/
-
-/**
- * SECTION:SwfdecAsValue
- * @title: SwfdecAsValue
- * @short_description: exchanging values with the Actionscript engine
- *
- * This section describes how values are handled inside the Actionscript 
- * engine. Since Actionscript is a dynamically typed language, the variable type 
- * has to be carried with every value. #SwfdecAsValue accomplishes that. Swfdec
- * allows two possible ways of accessing these values: The common method is to
- * use the provided functions to explicitly convert the values to a given type
- * with a function such as swfdec_as_value_to_string (). This is convenient, 
- * but can be very slow as it can call back into the Actionscript engine when
- * converting various objects. So it can be unsuitable in some cases.
- * A different possibiltiy is accessing the values directly using the accessor
- * macros. You must check the type before doing so though. For setting values,
- * there only exist macros, since type conversion is not necessary.
- */
-
-/**
- * SwfdecAsValueType:
- * @SWFDEC_AS_TYPE_UNDEFINED: the special undefined value
- * @SWFDEC_AS_TYPE_BOOLEAN: a boolean value - true or false
- * @SWFDEC_AS_TYPE_INT: reserved value for integers. Should the need arise for
- *                      performance enhancements - especially on embedded 
- *                      devices - it might be useful to implement this type.
- *                      For now, this type will never appear in Swfdec. Using 
- *                      it will cause Swfdec to crash.
- * @SWFDEC_AS_TYPE_NUMBER: a double value - also used for integer numbers
- * @SWFDEC_AS_TYPE_STRING: a string. Strings are garbage-collected and unique.
- * @SWFDEC_AS_TYPE_NULL: the spaecial null value
- * @SWFDEC_AS_TYPE_OBJECT: an object - must be of type #SwfdecAsObject
- *
- * These are the possible values the Swfdec Actionscript engine knows about.
- */
-
-/**
- * SwfdecAsValue:
- * @type: the type of this value.
- *
- * This is the type used to present an opaque value in the Actionscript 
- * engine. See #SwfdecAsValueType for possible types. It's similar in 
- * spirit to #GValue. The value held is garbage-collected. Apart from the type 
- * member, use the provided macros to access this structure.
- * <note>If you memset a SwfdecAsValue to 0, it is a valid undefined value.</note>
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_UNDEFINED:
- * @val: value to set as undefined
- *
- * Sets @val to the special undefined value. If you create a temporary value, 
- * you can instead use code such as |[ SwfdecAsValue val = { 0, }; ]|
- */
-
-/**
- * SWFDEC_AS_VALUE_GET_BOOLEAN:
- * @val: value to get, the value must reference a boolean
- *
- * Gets the boolean associated with value. If you are not sure if the value is
- * a boolean, use swfdec_as_value_to_boolean () instead.
- *
- * Returns: %TRUE or %FALSE
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_BOOLEAN:
- * @val: value to set
- * @b: boolean value to set, must be either %TRUE or %FALSE
- *
- * Sets @val to the specified boolean value.
- */
-
-/**
- * SWFDEC_AS_VALUE_GET_NUMBER:
- * @val: value to get, the value must reference a number
- *
- * Gets the number associated with @val. If you are not sure that the value is
- * a valid number value, consider using swfdec_as_value_to_number() or 
- * swfdec_as_value_to_int() instead.
- *
- * Returns: a double. It can be NaN or +-Infinity, but not -0.0
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_NUMBER:
- * @val: value to set
- * @d: double value to set
- *
- * Sets @val to the given value. If you are sure the value is a valid
- * integer value, use SWFDEC_AS_VALUE_SET_INT() instead.
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_INT:
- * @val: value to set
- * @d: integer value to set
- *
- * Sets @val to the given value. Currently this macro is equivalent to
- * SWFDEC_AS_VALUE_SET_NUMBER(), but this may change in future versions of
- * Swfdec.
- */
-
-/**
- * SWFDEC_AS_VALUE_GET_STRING:
- * @val: value to get, the value must reference a string
- *
- * Gets the string associated with @val. If you are not sure that the value is
- * a string value, consider using swfdec_as_value_to_string() instead.
- *
- * Returns: a garbage-collected string.
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_STRING:
- * @val: value to set
- * @s: garbage-collected string to use
- *
- * Sets @val to the given string value.
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_NULL:
- * @val: value to set
- *
- * Sets @val to the special null value.
- */
-
-/**
- * SWFDEC_AS_VALUE_GET_OBJECT:
- * @val: value to get, the value must reference an object
- *
- * Gets the object associated with @val. If you are not sure that the value is
- * an object value, consider using swfdec_as_value_to_object() instead.
- *
- * Returns: a #SwfdecAsObject
- */
-
-/**
- * SWFDEC_AS_VALUE_SET_OBJECT:
- * @val: value to set
- * @o: garbage-collected #SwfdecAsObject to use
- *
- * Sets @val to the given object. The object must have been added to the 
- * garbage collector via swfdec_as_object_add() previously.
- */
-
-/*** actual code ***/
-
-/**
- * swfdec_as_str_concat:
- * @cx: a #SwfdecAsContext
- * @s1: first string
- * @s2: second string
- *
- * Convenience function to concatenate two garbage-collected strings. This
- * function is equivalent to g_strconcat ().
- *
- * Returns: A new garbage-collected string
- **/
-const char *
-swfdec_as_str_concat (SwfdecAsContext *cx, const char * s1, const char *s2)
-{
-  const char *ret;
-  char *s;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (cx), SWFDEC_AS_STR_EMPTY);
-  g_return_val_if_fail (s1, SWFDEC_AS_STR_EMPTY);
-  g_return_val_if_fail (s2, SWFDEC_AS_STR_EMPTY);
-
-  s = g_strconcat (s1, s2, NULL);
-  ret = swfdec_as_context_get_string (cx, s);
-  g_free (s);
-
-  return ret;
-}
-
-/**
- * swfdec_as_integer_to_string:
- * @context: a #SwfdecAsContext
- * @i: an integer that fits into 32 bits
- *
- * Converts @d into a string using the same conversion algorithm as the 
- * official Flash player.
- *
- * Returns: a garbage-collected string
- **/
-const char *
-swfdec_as_integer_to_string (SwfdecAsContext *context, int i)
-{
-  return swfdec_as_context_give_string (context, g_strdup_printf ("%d", i));
-}
-
-/**
- * swfdec_as_double_to_string:
- * @context: a #SwfdecAsContext
- * @d: a double
- *
- * Converts @d into a string using the same conversion algorithm as the 
- * official Flash player.
- *
- * Returns: a garbage-collected string
- **/
-/* FIXME: this function is still buggy - and it's ugly as hell.
- * Someone with the right expertise should rewrite it 
- * Some pointers:
- * http://www.cs.indiana.edu/~burger/FP-Printing-PLDI96.pdf
- * http://lxr.mozilla.org/mozilla/source/js/tamarin/core/MathUtils.cpp
- */
-const char *
-swfdec_as_double_to_string (SwfdecAsContext *context, double d)
-{
-  gboolean found = FALSE, gotdot = FALSE;
-  guint digits = 15;
-  char tmp[50], *end, *start, *s;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), SWFDEC_AS_STR_EMPTY);
-
-  if (isnan (d))
-    return SWFDEC_AS_STR_NaN;
-  if (isinf (d))
-    return d < 0 ? SWFDEC_AS_STR__Infinity : SWFDEC_AS_STR_Infinity;
-  /* stupid -0.0 */
-  if (fabs (d) == 0.0)
-    return SWFDEC_AS_STR_0;
-
-  tmp[0] = ' ';
-  s = &tmp[1];
-  if (ABS (d) > 0.00001 && ABS (d) < 1e+15) {
-    g_ascii_formatd (s, 50, "%.22f", d);
-  } else {
-    g_ascii_formatd (s, 50, "%.25e", d);
-  }
-  start = s;
-  /* skip - sign */
-  if (*start == '-')
-    start++;
-  /* count digits (maximum allowed is 15) */
-  while (digits) {
-    if (*start == '.') {
-      start++;
-      gotdot = TRUE;
-      continue;
-    }
-    if (*start < '0' || *start > '9')
-      break;
-    if (found || *start != '0') {
-      digits--;
-      found = TRUE;
-    }
-    start++;
-  }
-  end = start;
-  /* go to end of string */
-  while (*end != 'e' && *end != 0)
-    end++;
-  /* round using the next digit */
-  if (*start >= '5' && *start <= '9') {
-    char *finish = NULL;
-    /* skip all 9s at the end */
-    while (start[-1] == '9')
-      start--;
-    /* if we're before the dot, replace 9s with 0s */
-    if (start[-1] == '.') {
-      finish = start;
-      start--;
-    }
-    while (start[-1] == '9') {
-      start[-1] = '0';
-      start--;
-    }
-    /* write out correct number */
-    if (start[-1] == '-') {
-      s--;
-      start[-2] = '-';
-      start[-1] = '1';
-    } else if (start[-1] == ' ') {
-      s--;
-      start[-1] = '1';
-    } else {
-      start[-1]++;
-    }
-    /* reposition cursor at end */
-    if (finish)
-      start = finish;
-  }
-  /* remove trailing zeros (note we skipped zero above, so there will be non-0 bytes left) */
-  if (gotdot) {
-    while (start[-1] == '0')
-      start--;
-    if (start[-1] == '.')
-      start--;
-  }
-  /* add exponent */
-  if (*end == 'e') {
-    /* 'e' */
-    *start++ = *end++;
-    /* + or - */
-    *start++ = *end++;
-    /* skip 0s */
-    while (*end == '0')
-      end++;
-    /* add rest */
-    while (*end != 0)
-      *start++ = *end++;
-  }
-  /* end string */
-  *start = 0;
-  return swfdec_as_context_get_string (context, s);
-}
-
-/**
- * swfdec_as_value_to_string:
- * @context: a #SwfdecAsContext
- * @value: value to be expressed as string
- *
- * Converts @value to a string according to the rules of Flash. This might 
- * cause calling back into the script engine if the @value is an object. In
- * that case, the object's valueOf function is called. 
- * <warning>Never use this function for debugging purposes.</warning>
- *
- * Returns: a garbage-collected string representing @value. The value will 
- *          never be %NULL.
- **/
-const char *
-swfdec_as_value_to_string (SwfdecAsContext *context, const SwfdecAsValue *value)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), SWFDEC_AS_STR_EMPTY);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), SWFDEC_AS_STR_EMPTY);
-
-  switch (value->type) {
-    case SWFDEC_AS_TYPE_STRING:
-      return SWFDEC_AS_VALUE_GET_STRING (value);
-    case SWFDEC_AS_TYPE_UNDEFINED:
-      if (context->version > 6)
-	return SWFDEC_AS_STR_undefined;
-      else
-	return SWFDEC_AS_STR_EMPTY;
-    case SWFDEC_AS_TYPE_BOOLEAN:
-      return SWFDEC_AS_VALUE_GET_BOOLEAN (value) ? SWFDEC_AS_STR_true : SWFDEC_AS_STR_false;
-    case SWFDEC_AS_TYPE_NULL:
-      return SWFDEC_AS_STR_null;
-    case SWFDEC_AS_TYPE_NUMBER:
-      return swfdec_as_double_to_string (context, SWFDEC_AS_VALUE_GET_NUMBER (value));
-    case SWFDEC_AS_TYPE_OBJECT:
-      {
-	SwfdecAsObject *object = SWFDEC_AS_VALUE_GET_OBJECT (value);
-	if (SWFDEC_IS_MOVIE (object)) {
-	  SwfdecMovie *movie = swfdec_movie_resolve (SWFDEC_MOVIE (object));
-	  if (movie == NULL) {
-	    return SWFDEC_AS_STR_EMPTY;
-	  } else {
-	    char *str = swfdec_movie_get_path (SWFDEC_MOVIE (object), TRUE);
-	    return swfdec_as_context_give_string (context, str);
-	  }
-	} else {
-	  SwfdecAsValue ret;
-	  swfdec_as_object_call (object, SWFDEC_AS_STR_toString, 0, NULL, &ret);
-	  if (SWFDEC_AS_VALUE_IS_STRING (&ret))
-	    return SWFDEC_AS_VALUE_GET_STRING (&ret);
-	  else if (SWFDEC_IS_AS_SUPER (SWFDEC_AS_VALUE_GET_OBJECT (value)))
-	    return SWFDEC_AS_STR__type_Object_;
-	  else if (SWFDEC_IS_AS_FUNCTION (SWFDEC_AS_VALUE_GET_OBJECT (value)))
-	    return SWFDEC_AS_STR__type_Function_;
-	  else
-	    return SWFDEC_AS_STR__type_Object_;
-	}
-      }
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      return SWFDEC_AS_STR_EMPTY;
-  }
-}
-
-/**
- * swfdec_as_value_to_debug:
- * @value: a #SwfdecAsValue
- *
- * Converts the given @value to a string in a safe way. It will not call into
- * the scripting engine. Its intended use is for output in debuggers.
- *
- * Returns: a newly allocated string. Free with g_free().
- **/
-char *
-swfdec_as_value_to_debug (const SwfdecAsValue *value)
-{
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), NULL);
-
-  switch (value->type) {
-    case SWFDEC_AS_TYPE_STRING:
-      return g_shell_quote (SWFDEC_AS_VALUE_GET_STRING (value));
-    case SWFDEC_AS_TYPE_UNDEFINED:
-      return g_strdup ("undefined");
-    case SWFDEC_AS_TYPE_BOOLEAN:
-      return g_strdup (SWFDEC_AS_VALUE_GET_BOOLEAN (value) ? "true" : "false");
-    case SWFDEC_AS_TYPE_NULL:
-      return g_strdup ("null");
-    case SWFDEC_AS_TYPE_NUMBER:
-      return g_strdup_printf ("%g", SWFDEC_AS_VALUE_GET_NUMBER (value));
-    case SWFDEC_AS_TYPE_OBJECT:
-      return swfdec_as_object_get_debug (SWFDEC_AS_VALUE_GET_OBJECT (value));
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      return NULL;
-  }
-}
-
-/**
- * swfdec_as_value_to_number:
- * @context: a #SwfdecAsContext
- * @value: a #SwfdecAsValue used by context
- *
- * Converts the value to a number according to Flash's conversion routines and
- * the current Flash version. This conversion routine is similar, but not equal
- * to ECMAScript. For objects, it can call back into the script engine by 
- * calling the object's valueOf function.
- *
- * Returns: a double value. It can be NaN or +-Infinity. It will not be -0.0.
- **/
-double
-swfdec_as_value_to_number (SwfdecAsContext *context, const SwfdecAsValue *value)
-{
-  SwfdecAsValue tmp;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), 0.0);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), 0.0);
-
-  tmp = *value;
-  swfdec_as_value_to_primitive (&tmp);
-
-  switch (tmp.type) {
-    case SWFDEC_AS_TYPE_UNDEFINED:
-    case SWFDEC_AS_TYPE_NULL:
-      return (context->version >= 7) ? NAN : 0.0;
-    case SWFDEC_AS_TYPE_BOOLEAN:
-      return SWFDEC_AS_VALUE_GET_BOOLEAN (&tmp) ? 1 : 0;
-    case SWFDEC_AS_TYPE_NUMBER:
-      return SWFDEC_AS_VALUE_GET_NUMBER (&tmp);
-    case SWFDEC_AS_TYPE_STRING:
-      {
-	const char *s;
-	char *end;
-	double d;
-	
-	// FIXME: We should most likely copy Tamarin's code here (MathUtils.cpp)
-	s = SWFDEC_AS_VALUE_GET_STRING (&tmp);
-	if (s == SWFDEC_AS_STR_EMPTY)
-	  return NAN;
-	if (context->version > 5 && s[0] == '0' &&
-	    (s[1] == 'x' || s[1] == 'X')) {
-	  d = g_ascii_strtoll (s + 2, &end, 16);
-	} else if (context->version > 5 && s[0] == '0' &&
-	    s[strspn (s, "01234567")] == '\0') {
-	  d = g_ascii_strtoll (s, &end, 8);
-	} else {
-	  if (strpbrk (s, "xXiI") != NULL)
-	    return NAN;
-	  d = g_ascii_strtod (s, &end);
-	}
-	if (*end == '\0')
-	  return d == -0.0 ? 0.0 : d;
-	else
-	  return NAN;
-      }
-    case SWFDEC_AS_TYPE_OBJECT:
-      return NAN;
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      return NAN;
-  }
-}
-
-/**
- * swfdec_as_double_to_integer:
- * @d: any double
- *
- * Converts the given double to an integer using the same rules as the Flash
- * player.
- *
- * Returns: an integer
- **/
-int
-swfdec_as_double_to_integer (double d)
-{
-  if (!isfinite (d))
-    return 0;
-  if (d < 0) {
-    d = fmod (-d, 4294967296.0);
-    return - (guint) d;
-  } else {
-    d = fmod (d, 4294967296.0);
-    return (guint) d;
-  }
-}
-
-/**
- * swfdec_as_value_to_integer:
- * @context: a #SwfdecAsContext
- * @value: value to convert
- *
- * Converts the given value to an integer. This is done similar to the 
- * conversion used by swfdec_as_value_to_number().
- *
- * Returns: An Integer that can be represented in 32 bits.
- **/
-int
-swfdec_as_value_to_integer (SwfdecAsContext *context, const SwfdecAsValue *value)
-{
-  double d;
-  
-  d = swfdec_as_value_to_number (context, value);
-  return swfdec_as_double_to_integer (d);
-}
-
-/**
- * swfdec_as_value_to_object:
- * @context: a #SwfdecAsContext
- * @value: value to convert
- *
- * Converts a given value to its representation as an object. The object 
- * representation for primitive types is a wrapper object of the corresponding 
- * class (Number for numbers, String for strings, Boolean for bools). If the 
- * value does not have an object representing it, such as undefined and null 
- * values, %NULL is returned.
- *
- * Returns: object representing @value or %NULL.
- **/
-SwfdecAsObject *
-swfdec_as_value_to_object (SwfdecAsContext *context, const SwfdecAsValue *value)
-{
-  SwfdecAsFunction *fun;
-  SwfdecAsValue val;
-  const char *s;
-
-  g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
-  g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), NULL);
-
-  switch (value->type) {
-    case SWFDEC_AS_TYPE_UNDEFINED:
-    case SWFDEC_AS_TYPE_NULL:
-      return NULL;
-    case SWFDEC_AS_TYPE_NUMBER:
-      s = SWFDEC_AS_STR_Number;
-      break;
-    case SWFDEC_AS_TYPE_STRING:
-      s = SWFDEC_AS_STR_String;
-      break;
-    case SWFDEC_AS_TYPE_BOOLEAN:
-      s = SWFDEC_AS_STR_Boolean;
-      break;
-    case SWFDEC_AS_TYPE_OBJECT:
-      return SWFDEC_AS_VALUE_GET_OBJECT (value);
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      return NULL;
-  }
-
-  swfdec_as_object_get_variable (context->global, s, &val);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&val) ||
-      !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (&val)))
-    return NULL;
-  swfdec_as_object_create (fun, 1, value, &val);
-  swfdec_as_context_run (context);
-  if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
-    return SWFDEC_AS_VALUE_GET_OBJECT (&val);
-  } else {
-    SWFDEC_ERROR ("did not construct an object");
-    return NULL;
-  }
-}
-
-/**
-* swfdec_as_value_to_boolean:
-* @context: a #SwfdecAsContext
-* @value: value to convert
-*
-* Converts the given value to a boolean according to Flash's rules. Note that
-* these rules changed significantly for strings between Flash 6 and 7.
-*
-* Returns: either %TRUE or %FALSE.
-**/
-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);
-
-  /* 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;
-    case SWFDEC_AS_TYPE_INT:
-    default:
-      g_assert_not_reached ();
-      return FALSE;
-  }
-}
-
-/**
-* swfdec_as_value_to_primitive:
-* @value: value to convert
-*
-* Tries to convert the given @value inline to its primitive value. Primitive 
-* values are values that are not objects. If the value is an object, the 
-* object's valueOf function is called. If the result of that function is still 
-* an object, it is returned nonetheless.
-**/
-void
-swfdec_as_value_to_primitive (SwfdecAsValue *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);
-  }
-}
-
diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_as_types.h
deleted file mode 100644
index ff22c8f..0000000
--- a/libswfdec/swfdec_as_types.h
+++ /dev/null
@@ -1,139 +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_AS_TYPES_H_
-#define _SWFDEC_AS_TYPES_H_
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-/* fundamental types */
-typedef enum {
-  SWFDEC_AS_TYPE_UNDEFINED = 0,
-  SWFDEC_AS_TYPE_BOOLEAN,
-  SWFDEC_AS_TYPE_INT, /* unimplemented, but reserved if someone wants it */
-  SWFDEC_AS_TYPE_NUMBER,
-  SWFDEC_AS_TYPE_STRING,
-  SWFDEC_AS_TYPE_NULL,
-  SWFDEC_AS_TYPE_OBJECT
-} SwfdecAsValueType;
-
-typedef struct _SwfdecAsArray SwfdecAsArray;
-typedef struct _SwfdecAsContext SwfdecAsContext;
-typedef struct _SwfdecAsDebugger SwfdecAsDebugger;
-typedef struct _SwfdecAsFrame SwfdecAsFrame;
-typedef struct _SwfdecAsFunction SwfdecAsFunction;
-typedef struct _SwfdecAsObject SwfdecAsObject;
-typedef struct _SwfdecAsScope SwfdecAsScope;
-typedef struct _SwfdecAsStack SwfdecAsStack;
-typedef struct _SwfdecAsValue SwfdecAsValue;
-typedef void (* SwfdecAsNative) (SwfdecAsContext *	context, 
-				 SwfdecAsObject *	thisp,
-				 guint			argc,
-				 SwfdecAsValue *	argv,
-				 SwfdecAsValue *	retval);
-typedef struct _SwfdecScript SwfdecScript;
-
-
-/* IMPORTANT: a SwfdecAsValue memset to 0 is a valid undefined value */
-struct _SwfdecAsValue {
-  SwfdecAsValueType	type;
-  /*< private >*/
-  union {
-    gboolean		boolean;
-    double		number;
-    const char *	string;
-    SwfdecAsObject *	object;
-  } value;
-};
-
-#define SWFDEC_IS_AS_VALUE(val) ((val) != NULL && (val)->type <= SWFDEC_TYPE_AS_OBJECT)
-
-#define SWFDEC_AS_VALUE_IS_UNDEFINED(val) ((val)->type == SWFDEC_AS_TYPE_UNDEFINED)
-#define SWFDEC_AS_VALUE_SET_UNDEFINED(val) (val)->type = SWFDEC_AS_TYPE_UNDEFINED
-
-#define SWFDEC_AS_VALUE_IS_BOOLEAN(val) ((val)->type == SWFDEC_AS_TYPE_BOOLEAN)
-#define SWFDEC_AS_VALUE_GET_BOOLEAN(val) ((val)->value.boolean)
-#define SWFDEC_AS_VALUE_SET_BOOLEAN(val,b) G_STMT_START { \
-  SwfdecAsValue *__val = (val); \
-  gboolean __tmp = (b); \
-  g_assert (__tmp == TRUE || __tmp == FALSE); \
-  (__val)->value.boolean = __tmp; \
-  (__val)->type = SWFDEC_AS_TYPE_BOOLEAN; \
-} G_STMT_END
-
-#define SWFDEC_AS_VALUE_IS_NUMBER(val) ((val)->type == SWFDEC_AS_TYPE_NUMBER)
-#define SWFDEC_AS_VALUE_GET_NUMBER(val) ((val)->value.number)
-#define SWFDEC_AS_VALUE_SET_NUMBER(val,d) G_STMT_START { \
-  SwfdecAsValue *__val = (val); \
-  (__val)->value.number = (d); \
-  (__val)->type = SWFDEC_AS_TYPE_NUMBER; \
-} G_STMT_END
-
-#define SWFDEC_AS_VALUE_SET_INT(val,d) SWFDEC_AS_VALUE_SET_NUMBER(val,(int) (d))
-
-#define SWFDEC_AS_VALUE_IS_STRING(val) ((val)->type == SWFDEC_AS_TYPE_STRING)
-#define SWFDEC_AS_VALUE_GET_STRING(val) ((val)->value.string)
-#define SWFDEC_AS_VALUE_SET_STRING(val,s) G_STMT_START { \
-  SwfdecAsValue *__val = (val); \
-  (__val)->value.string = s; \
-  (__val)->type = SWFDEC_AS_TYPE_STRING; \
-} G_STMT_END
-
-#define SWFDEC_AS_VALUE_IS_NULL(val) ((val)->type == SWFDEC_AS_TYPE_NULL)
-#define SWFDEC_AS_VALUE_SET_NULL(val) (val)->type = SWFDEC_AS_TYPE_NULL
-
-#define SWFDEC_AS_VALUE_IS_OBJECT(val) ((val)->type == SWFDEC_AS_TYPE_OBJECT)
-#define SWFDEC_AS_VALUE_GET_OBJECT(val) ((val)->value.object)
-#define SWFDEC_AS_VALUE_SET_OBJECT(val,o) G_STMT_START { \
-  SwfdecAsValue *__val = (val); \
-  SwfdecAsObject *__o = (o); \
-  g_assert (__o != NULL); \
-  (__val)->type = SWFDEC_AS_TYPE_OBJECT; \
-  (__val)->value.object = __o; \
-} G_STMT_END
-
-/* value conversion functions */
-gboolean	swfdec_as_value_to_boolean	(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-int		swfdec_as_value_to_integer	(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-double		swfdec_as_value_to_number	(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-SwfdecAsObject *swfdec_as_value_to_object	(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-void		swfdec_as_value_to_primitive	(SwfdecAsValue *	value);
-const char *	swfdec_as_value_to_string	(SwfdecAsContext *	context,
-						 const SwfdecAsValue *	value);
-char *		swfdec_as_value_to_debug	(const SwfdecAsValue *	value);
-
-/* special conversion functions */
-const char *	swfdec_as_integer_to_string	(SwfdecAsContext *      context,
-						 int			i);
-int		swfdec_as_double_to_integer	(double			d);
-const char *	swfdec_as_double_to_string	(SwfdecAsContext *	context,
-						 double			d);
-const char *	swfdec_as_str_concat		(SwfdecAsContext *	cx,
-						 const char *		s1,
-						 const char *		s2);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_asbroadcaster.c b/libswfdec/swfdec_asbroadcaster.c
deleted file mode 100644
index f15b828..0000000
--- a/libswfdec/swfdec_asbroadcaster.c
+++ /dev/null
@@ -1,84 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "swfdec_as_internal.h"
-#include "swfdec_as_object.h"
-#include "swfdec_as_strings.h"
-#include "swfdec_as_context.h"
-#include "swfdec_as_frame_internal.h"
-#include "swfdec_debug.h"
-
-/*** AS CODE ***/
-
-SWFDEC_AS_NATIVE (101, 12, broadcastMessage)
-void
-broadcastMessage (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SwfdecAsValue val;
-  SwfdecAsObject *listeners, *o;
-  gint i, length;
-  const char *name;
-  GSList *list = NULL, *walk;
-
-  if (object == NULL)
-    return;
-
-  if (argc < 1)
-    return;
-  name = swfdec_as_value_to_string (cx, &argv[0]);
-  argv += 1;
-  argc--;
-
-  swfdec_as_object_get_variable (object, SWFDEC_AS_STR__listeners, &val);
-  if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
-    return;
-
-  listeners = SWFDEC_AS_VALUE_GET_OBJECT (&val);
-  swfdec_as_object_get_variable (listeners, SWFDEC_AS_STR_length, &val);
-  length = swfdec_as_value_to_integer (cx, &val);
-
-  /* return undefined if we won't try to call anything */
-  if (length <= 0)
-    return;
-
-  /* FIXME: solve this wth foreach, so it gets faster for weird cases */
-  for (i = 0; i < length; i++) {
-    swfdec_as_object_get_variable (listeners, swfdec_as_integer_to_string (cx, i), &val);
-    o = swfdec_as_value_to_object (cx, &val);
-    if (o == NULL)
-      continue;
-    list = g_slist_prepend (list, o);
-  }
-  if (list == NULL)
-    return;
-
-  list = g_slist_reverse (list);
-  for (walk = list; walk; walk = walk->next) {
-    swfdec_as_object_call (walk->data, name, argc, argv, &val);
-  }
-  g_slist_free (list);
-
-  SWFDEC_AS_VALUE_SET_BOOLEAN (ret, TRUE);
-}
-
diff --git a/libswfdec/swfdec_audio.c b/libswfdec/swfdec_audio.c
deleted file mode 100644
index e9a5e5f..0000000
--- a/libswfdec/swfdec_audio.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		      2006 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 <string.h>
-#include "swfdec_audio_internal.h"
-#include "swfdec_debug.h"
-#include "swfdec_player_internal.h"
-
-/**
- * SECTION:SwfdecAudio
- * @title: SwfdecAudio
- * @see_also: SwfdecPlayer
- * @short_description: object used for audio output
- *
- * SwfdecAudio is the way audio output is provided by a #SwfdecPlayer. See
- * its documentation on how to access #SwfdecAudio objects.
- *
- * An audio object gives access to one audio stream played inside a player.
- * You are responsible for outputting this data, swfdec does not try to do this
- * for you.
- *
- * Audio data is always provided in 16bit host-endian stereo. If the data was
- * encoded into a different format originally, Swfdec will already have decoded 
- * it. The data is always referenced relative to the player. Sample 0 
- * references the first sample to be played at the current position. If the 
- * player gets iterated, sample 0 changes. There is no way to access samples
- * belonging to a previous state.
- */
-
-/**
- * SwfdecAudio
- *
- * This object is used for audio output. It is an abstract class.
- */
-
-G_DEFINE_ABSTRACT_TYPE (SwfdecAudio, swfdec_audio, G_TYPE_OBJECT)
-
-static void
-swfdec_audio_dispose (GObject *object)
-{
-  SwfdecAudio *audio = SWFDEC_AUDIO (object);
-
-  g_assert (audio->player == NULL);
-
-  G_OBJECT_CLASS (swfdec_audio_parent_class)->dispose (object);
-}
-
-static void
-swfdec_audio_class_init (SwfdecAudioClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-  object_class->dispose = swfdec_audio_dispose;
-}
-
-static void
-swfdec_audio_init (SwfdecAudio *audio)
-{
-}
-
-/**
- * swfdec_audio_add:
- * @audio: audio to add
- * @player: a #SwfdecPlayer to attach to or NULL
- *
- * Registers a new audio object for playback in @player. If player is %NULL,
- * this function does nothing.
- * The starting point of the audio stream will be equivalent the player's time.
- **/
-void
-swfdec_audio_add (SwfdecAudio *audio, SwfdecPlayer *player)
-{
-  SwfdecPlayerPrivate *priv;
-
-  g_return_if_fail (SWFDEC_IS_AUDIO (audio));
-  g_return_if_fail (audio->player == NULL);
-  if (player == NULL)
-    return;
-  g_return_if_fail (SWFDEC_IS_PLAYER (player));
-
-  g_object_ref (audio);
-  audio->player = player;
-  priv = player->priv;
-  priv->audio = g_list_append (priv->audio, audio);
-  SWFDEC_INFO ("adding %s %p", G_OBJECT_TYPE_NAME (audio), audio);
-}
-
-void	
-swfdec_audio_remove (SwfdecAudio *audio)
-{
-  g_return_if_fail (SWFDEC_IS_AUDIO (audio));
-
-  if (audio->player != NULL) {
-    SwfdecPlayerPrivate *priv = audio->player->priv;
-    SWFDEC_INFO ("removing %s %p", G_OBJECT_TYPE_NAME (audio), audio);
-    priv->audio = g_list_remove (priv->audio, audio);
-    if (audio->added) {
-      g_signal_emit_by_name (audio->player, "audio-removed", audio);
-      audio->added = FALSE;
-    }
-    audio->player = NULL;
-    g_object_unref (audio);
-  }
-}
-
-/**
- * swfdec_audio_iterate:
- * @audio: the #SwfdecAudio to iterate
- * @n_samples: number of samples to remove
- *
- * Iterates the @audio. Iterating means discarding the first @n_samples
- * samples of the audio stream.
- *
- * Returns: maximum number of remaining frames. If G_MAXUINT is returned,
- *          then the number of frames isn't known yet.
- **/
-guint
-swfdec_audio_iterate (SwfdecAudio *audio, guint n_samples)
-{
-  SwfdecAudioClass *klass;
-
-  g_return_val_if_fail (SWFDEC_IS_AUDIO (audio), 0);
-  g_return_val_if_fail (n_samples > 0, 0);
-
-  klass = SWFDEC_AUDIO_GET_CLASS (audio);
-  g_assert (klass->iterate);
-  return klass->iterate (audio, n_samples);
-}
-
-/**
- * swfdec_audio_render:
- * @audio: a #SwfdecAudio
- * @dest: memory area to render to
- * @start_offset: offset in samples at which to start rendering. The offset is 
- *		  calculated relative to the last iteration, so the value set 
- *		  by swfdec_player_set_audio_advance() is ignored.
- * @n_samples: amount of samples to render.
- *
- * Renders the samples from @audio into the area pointed to by @dest. The data 
- * is added to @dest, so you probably want to initialize @dest to silence 
- * before calling this function.
- **/
-void
-swfdec_audio_render (SwfdecAudio *audio, gint16 *dest, 
-    guint start_offset, guint n_samples)
-{
-  SwfdecAudioClass *klass;
-
-  g_return_if_fail (SWFDEC_IS_AUDIO (audio));
-  g_return_if_fail (dest != NULL);
-  g_return_if_fail (n_samples > 0);
-
-  klass = SWFDEC_AUDIO_GET_CLASS (audio);
-  klass->render (audio, dest, start_offset, n_samples);
-}
-
-/**
- * swfdec_player_render_audio:
- * @player: a #SwfdecPlayer
- * @dest: location to add audio signal to. The audio signal will be in 
- *        44100kHz signed 16bit stereo.
- * @start_offset: offset in samples at which to start rendering. The offset is 
- *		  calculated relative to the last iteration, so the value set 
- *		  by swfdec_player_set_audio_advance() is ignored.
- * @n_samples: amount of samples to render.
- *
- * Renders the data for this frame into the given location. The data is added to @dest, 
- * so you probably want to initialize @dest to silence before calling this function.
- **/
-void 
-swfdec_player_render_audio (SwfdecPlayer *player, gint16* dest, 
-    guint start_offset, guint n_samples)
-{
-  GList *walk;
-  SwfdecAudio *audio;
-
-  g_return_if_fail (SWFDEC_IS_PLAYER (player));
-  g_return_if_fail (dest != NULL);
-  g_return_if_fail (n_samples > 0);
-
-  SWFDEC_LOG ("rendering offset %u, samples %u", start_offset, n_samples);
-  for (walk = player->priv->audio; walk; walk = walk->next) {
-    audio = walk->data;
-    swfdec_audio_render (audio, dest, start_offset, n_samples);
-  }
-}
-
-/*** SWFDEC_AUDIO_FORMAT ***/
-
-/* SwfdecAudioFormat is represented in the least significant bits of a uint:
- * - the LSBit is 1 if it's 16bit audio, 0 for 8bit
- * - the next bit is 1 for stereo, 0 for mono
- * - the other two bits are for the rate, see swfdec_audio_format_new()
- * This is the same format the Flash file format uses to store audio formats.
- */
-
-SwfdecAudioFormat
-swfdec_audio_format_parse (SwfdecBits *bits)
-{
-  g_return_val_if_fail (bits != NULL, 0);
-
-  return swfdec_bits_getbits (bits, 4);
-}
-
-SwfdecAudioFormat
-swfdec_audio_format_new (guint rate, guint channels, gboolean is_16bit)
-{
-  SwfdecAudioFormat ret;
-
-  g_return_val_if_fail (channels == 1 || channels == 2, 0);
-
-  switch (rate) {
-    case 44100:
-      ret = 3 << 2; 
-      break;
-    case 22050:
-      ret = 2 << 2; 
-      break;
-    case 11025:
-      ret = 1 << 2; 
-      break;
-    case 5512:
-      ret = 0 << 2; 
-      break;
-    default:
-      g_return_val_if_reached (0);
-      break;
-  }
-  if (is_16bit)
-    ret |= 2;
-  if (channels == 2)
-    ret |= 1;
-
-  return ret;
-}
-
-guint
-swfdec_audio_format_get_channels (SwfdecAudioFormat format)
-{
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), 2);
-
-  return (format & 0x1) + 1;
-}
-
-gboolean
-swfdec_audio_format_is_16bit (SwfdecAudioFormat	format)
-{
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), TRUE);
-
-  return format & 0x2 ? TRUE : FALSE;
-}
-
-guint
-swfdec_audio_format_get_rate (SwfdecAudioFormat	format)
-{
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), 44100);
-
-  return 44100 / swfdec_audio_format_get_granularity (format);
-}
-
-/**
- * swfdec_audio_format_get_granularity:
- * @format: an auio format
- *
- * The granularity is a Swfdec-specific name, describing how often a sample in
- * a 44100Hz audio stream is defined. So for example 44100Hz has a granularity 
- * of 1 and 11025Hz has a granularity of 4 (because only every fourth sample 
- * is defined).
- *
- * Returns: the granularity of the format
- **/
-guint
-swfdec_audio_format_get_granularity (SwfdecAudioFormat format)
-{
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), 1);
-
-  return 1 << (3 - (format >> 2));
-}
-
-const char *
-swfdec_audio_format_to_string (SwfdecAudioFormat format)
-{
-  static const char *names[] = {
-    "8bit 5.5kHz mono",
-    "8bit 5.5kHz stereo",
-    "16bit 5.5kHz mono",
-    "16bit 5.5kHz stereo",
-    "8bit 11kHz mono",
-    "8bit 11kHz stereo",
-    "16bit 11kHz mono",
-    "16bit 11kHz stereo",
-    "8bit 22kHz mono",
-    "8bit 22kHz stereo",
-    "16bit 22kHz mono",
-    "16bit 22kHz stereo",
-    "8bit 44kHz mono",
-    "8bit 44kHz stereo",
-    "16bit 44kHz mono",
-    "16bit 44kHz stereo"
-  };
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), "");
-
-  return names[format];
-}
-
-/**
- * swfdec_audio_format_get_bytes_per_sample:
- * @format: audio format to check
- *
- * Computes the number of bytes required to store one sample of audio encoded
- * in @format.
- *
- * Returns: The number of bytes for one sample
- **/
-guint
-swfdec_audio_format_get_bytes_per_sample (SwfdecAudioFormat format)
-{
-  guint bps[4] = { 1, 2, 2, 4 };
-
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_FORMAT (format), 1);
-
-  return bps [format & 0x3];
-}
-
diff --git a/libswfdec/swfdec_audio.h b/libswfdec/swfdec_audio.h
deleted file mode 100644
index 4352faf..0000000
--- a/libswfdec/swfdec_audio.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		      2006 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_AUDIO_H_
-#define _SWFDEC_AUDIO_H_
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAudio SwfdecAudio;
-typedef struct _SwfdecAudioClass SwfdecAudioClass;
-
-#define SWFDEC_TYPE_AUDIO                    (swfdec_audio_get_type())
-#define SWFDEC_IS_AUDIO(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AUDIO))
-#define SWFDEC_IS_AUDIO_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AUDIO))
-#define SWFDEC_AUDIO(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AUDIO, SwfdecAudio))
-#define SWFDEC_AUDIO_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AUDIO, SwfdecAudioClass))
-#define SWFDEC_AUDIO_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AUDIO, SwfdecAudioClass))
-
-GType		swfdec_audio_get_type		(void);
-
-void		swfdec_audio_render		(SwfdecAudio *	audio,
-						 gint16 *	dest,
-						 guint		start_offset,
-						 guint		n_samples);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_audio_event.c b/libswfdec/swfdec_audio_event.c
deleted file mode 100644
index fa43359..0000000
--- a/libswfdec/swfdec_audio_event.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-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 <string.h>
-#include "swfdec_audio_event.h"
-#include "swfdec_debug.h"
-#include "swfdec_player_internal.h"
-
-
-G_DEFINE_TYPE (SwfdecAudioEvent, swfdec_audio_event, SWFDEC_TYPE_AUDIO)
-
-
-static guint
-swfdec_audio_event_iterate (SwfdecAudio *audio, guint remove)
-{
-  SwfdecAudioEvent *event = SWFDEC_AUDIO_EVENT (audio);
-
-  if (event->n_samples == 0)
-    return 0;
-
-  event->offset += remove;
-  event->loop += event->offset / event->n_samples;
-  event->offset %= event->n_samples;
-  
-  if (event->loop < event->n_loops)
-    return event->n_samples * (event->n_loops - event->loop) - event->offset;
-  else
-    return 0;
-}
-
-static guint16
-swfdec_audio_event_get_envelop_volume (SwfdecAudioEvent *event, guint pos,
-    guint offset, guint channel)
-{
-  double distance;
-
-  g_return_val_if_fail (SWFDEC_IS_AUDIO_EVENT (event), 32768);
-  g_return_val_if_fail (pos <= event->n_envelopes, 32768);
-  g_return_val_if_fail (channel == 0 || channel == 1, 32768);
-
-  if (event->n_envelopes == 0)
-    return 32768;
-
-  if (pos == 0)
-    return event->envelope[pos].volume[channel];
-
-  if (pos == event->n_envelopes)
-    return event->envelope[pos - 1].volume[channel];
-
-  distance = event->envelope[pos].offset - event->envelope[pos - 1].offset;
-  g_return_val_if_fail (offset >= event->envelope[pos - 1].offset, 1);
-  offset -= event->envelope[pos - 1].offset;
-  g_return_val_if_fail (offset < distance, 1);
-
-  return event->envelope[pos - 1].volume[channel] * (1 - offset / distance) +
-    event->envelope[pos].volume[channel] * (offset / distance);
-}
-
-static void
-swfdec_audio_event_render (SwfdecAudio *audio, gint16* dest, guint start,
-    guint n_samples)
-{
-  SwfdecAudioEvent *event = SWFDEC_AUDIO_EVENT (audio);
-  guint offset = event->offset + start;
-  guint loop, samples, global_offset, pos, i, granularity, channels;
-  gint16 *dest_end;
-
-  if (event->n_samples == 0)
-    return;
-
-  granularity = swfdec_audio_format_get_granularity (event->decoded_format);
-  channels = swfdec_audio_format_get_channels (event->decoded_format);
-
-  global_offset = (channels - 1) * granularity * (event->loop *
-    ((event->stop_sample != 0 ? event->stop_sample : event->n_samples) -
-     event->start_sample) + event->offset - event->start_sample);
-
-  dest_end = dest;
-  loop = event->loop + offset / event->n_samples;
-  offset %= event->n_samples;
-  for (; loop < event->n_loops && n_samples > 0; loop++) {
-    samples = MIN (n_samples, event->n_samples - offset);
-    swfdec_sound_buffer_render (dest_end, event->decoded,
-	event->decoded_format, loop == 0 ? NULL : event->decoded, offset,
-	samples);
-    n_samples -= samples;
-    dest_end += samples * 2;
-    offset = 0;
-  }
-
-  if (event->n_envelopes == 0)
-    return;
-
-  pos = 0;
-  for (i = 0; i < (guint) (dest_end - dest); i++) {
-    while (pos < event->n_envelopes &&
-	event->envelope[pos].offset <= global_offset + (i / 2))
-      pos++;
-    if (channels == 1) {
-      dest[i] *= (swfdec_audio_event_get_envelop_volume (event, pos,
-	  global_offset + (i / 2), 0) * 0.5 +
-	  swfdec_audio_event_get_envelop_volume (event, pos,
-	    global_offset + (i / 2), 1) * 0.5) / 32768.0;
-    } else {
-      dest[i] *= swfdec_audio_event_get_envelop_volume (event, pos,
-	  global_offset + (i / 2), i % 2) / 32768.0;
-    }
-  }
-}
-
-static void
-swfdec_audio_event_dispose (GObject *object)
-{
-  SwfdecAudioEvent *audio = SWFDEC_AUDIO_EVENT (object);
-
-  g_free (audio->envelope);
-  audio->envelope = NULL;
-  audio->n_envelopes = 0;
-  if (audio->decoded) {
-    swfdec_buffer_unref (audio->decoded);
-    audio->decoded = NULL;
-  }
-
-  G_OBJECT_CLASS (swfdec_audio_event_parent_class)->dispose (object);
-}
-
-static void
-swfdec_audio_event_class_init (SwfdecAudioEventClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAudioClass *audio_class = SWFDEC_AUDIO_CLASS (klass);
-
-  object_class->dispose = swfdec_audio_event_dispose;
-
-  audio_class->iterate = swfdec_audio_event_iterate;
-  audio_class->render = swfdec_audio_event_render;
-}
-
-static void
-swfdec_audio_event_init (SwfdecAudioEvent *audio_event)
-{
-}
-
-static void
-swfdec_audio_event_decode (SwfdecAudioEvent *event)
-{
-  guint granule, bytes_per_sample;
-
-  event->decoded = swfdec_sound_get_decoded (event->sound,
-      &event->decoded_format);
-  if (event->decoded == NULL) {
-    SWFDEC_INFO ("Could not decode audio. Will assume %u samples of silence instead.",
-	event->sound->n_samples);
-    event->decoded = swfdec_buffer_new_and_alloc0 (event->sound->n_samples / 4);
-    event->decoded_format = swfdec_audio_format_new (5512, 1, FALSE);
-  } else {
-    swfdec_buffer_ref (event->decoded);
-  }
-  granule = swfdec_audio_format_get_granularity (event->decoded_format);
-  bytes_per_sample = swfdec_audio_format_get_channels (event->decoded_format) *
-      (swfdec_audio_format_is_16bit (event->decoded_format) ? 2 : 1);
-  if (event->start_sample) {
-    guint skip;
-    if (event->start_sample % granule) {
-      SWFDEC_FIXME ("figure out how high resolution start samples work");
-    }
-    skip = bytes_per_sample * (event->start_sample / granule);
-    if (skip >= event->decoded->length) {
-      SWFDEC_WARNING ("start sample %u > total number of samples %"G_GSIZE_FORMAT,
-	  event->start_sample / granule, event->decoded->length / bytes_per_sample);
-      swfdec_buffer_unref (event->decoded);
-      event->decoded = swfdec_buffer_new ();
-    } else {
-      SwfdecBuffer *sub = swfdec_buffer_new_subbuffer (event->decoded,
-	  skip, event->decoded->length - skip);
-      swfdec_buffer_unref (event->decoded);
-      event->decoded = sub;
-    }
-  }
-  if (event->stop_sample) {
-    guint keep;
-    if (event->stop_sample % granule) {
-      SWFDEC_FIXME ("figure out how high resolution stop samples work");
-    }
-    keep = bytes_per_sample * (event->stop_sample / granule - event->start_sample / granule);
-    if (keep > event->decoded->length) {
-      SWFDEC_WARNING ("stop sample %u outside of decoded number of samples %"G_GSIZE_FORMAT,
-	  event->stop_sample / granule, event->decoded->length / bytes_per_sample +
-	  event->start_sample / granule);
-    } else if (keep < event->decoded->length) {
-      SwfdecBuffer *sub = swfdec_buffer_new_subbuffer (event->decoded,
-	  0, keep);
-      swfdec_buffer_unref (event->decoded);
-      event->decoded = sub;
-    }
-  }
-  event->n_samples = event->decoded->length / bytes_per_sample * granule;
-  SWFDEC_LOG ("total 44100Hz samples: %u", event->n_samples);
-}
-
-static SwfdecAudioEvent *
-swfdec_audio_event_create (SwfdecSound *sound, guint offset, guint end_offset, guint n_loops)
-{
-  SwfdecAudioEvent *event;
-  
-  event = g_object_new (SWFDEC_TYPE_AUDIO_EVENT, NULL);
-  event->sound = sound;
-  event->start_sample = offset;
-  event->n_loops = n_loops;
-  event->stop_sample = end_offset;
-  swfdec_audio_event_decode (event);
-  event->offset = 0;
-
-  return event;
-}
-
-/**
- * swfdec_audio_event_new:
- * @player: the #SwfdecPlayer to play the sound in
- * @sound: the sound to be played
- * @offset: offset into sound at which to start playing
- * @n_loops: number of times the sound should be played
- *
- * Starts playing back a sound from the given offset and loops the sound 
- * @n_loops times.
- *
- * Returns: a new #SwfdecAudio
- **/
-SwfdecAudio *
-swfdec_audio_event_new (SwfdecPlayer *player, SwfdecSound *sound, guint	offset,
-    guint n_loops)
-{
-  SwfdecAudioEvent *event;
-
-  g_return_val_if_fail (player == NULL || SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (SWFDEC_IS_SOUND (sound), NULL);
-
-  event = swfdec_audio_event_create (sound, offset, 0, n_loops);
-  swfdec_audio_add (SWFDEC_AUDIO (event), player);
-
-  return SWFDEC_AUDIO (event);
-}
-
-static SwfdecAudio *
-swfdec_audio_event_get (SwfdecPlayer *player, SwfdecSound *sound)
-{
-  GList *walk;
-
-  if (player == NULL)
-    return NULL;
-
-  for (walk = player->priv->audio; walk; walk = walk->next) {
-    SwfdecAudio *audio = walk->data;
-    if (!SWFDEC_IS_AUDIO_EVENT (audio))
-      continue;
-    if (SWFDEC_AUDIO_EVENT (audio)->sound == sound) {
-      return audio;
-    }
-  }
-  return NULL;
-}
-
-/**
- * swfdec_audio_event_new_from_chunk:
- * @player: a #SwfdecPlayer or NULL
- * @event: a sound event to start playing back
- *
- * Starts playback of the given sound event (or, when @player is NULL, creates
- * an element for playing back the given sound).
- *
- * Returns: the sound effect or NULL if no new sound was created.
- **/
-SwfdecAudio *
-swfdec_audio_event_new_from_chunk (SwfdecPlayer *player, SwfdecSoundChunk *chunk)
-{
-  SwfdecAudioEvent *event;
-
-  g_return_val_if_fail (player == NULL || SWFDEC_IS_PLAYER (player), NULL);
-  g_return_val_if_fail (chunk != NULL, NULL);
-
-  if (chunk->stop) {
-    SwfdecAudio *audio = swfdec_audio_event_get (player, chunk->sound);
-    if (audio) {
-      SWFDEC_LOG ("stopping sound %d", SWFDEC_CHARACTER (chunk->sound)->id);
-      swfdec_audio_remove (audio);
-    }
-    return NULL;
-  }
-  SWFDEC_LOG ("adding sound %d to playing sounds", SWFDEC_CHARACTER (chunk->sound)->id);
-  if (chunk->no_restart &&
-      (event = (SwfdecAudioEvent *) swfdec_audio_event_get (player, chunk->sound))) {
-    SWFDEC_DEBUG ("sound %d is already playing, reusing it", 
-	SWFDEC_CHARACTER (event->sound)->id);
-    g_object_ref (event);
-    return SWFDEC_AUDIO (event);
-  }
-  event = swfdec_audio_event_create (chunk->sound, chunk->start_sample, 
-      chunk->stop_sample, chunk->loop_count);
-  event->n_envelopes = chunk->n_envelopes;
-  if (event->n_envelopes)
-    event->envelope = g_memdup (chunk->envelope, sizeof (SwfdecSoundEnvelope) * event->n_envelopes);
-  SWFDEC_DEBUG ("playing sound %d from offset %d now", SWFDEC_CHARACTER (event->sound)->id,
-      event->start_sample);
-  swfdec_audio_add (SWFDEC_AUDIO (event), player);
-
-  return SWFDEC_AUDIO (event);
-}
-
diff --git a/libswfdec/swfdec_audio_event.h b/libswfdec/swfdec_audio_event.h
deleted file mode 100644
index 40a0eb6..0000000
--- a/libswfdec/swfdec_audio_event.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-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_AUDIO_EVENT_H_
-#define _SWFDEC_AUDIO_EVENT_H_
-
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_sound.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAudioEvent SwfdecAudioEvent;
-typedef struct _SwfdecAudioEventClass SwfdecAudioEventClass;
-
-#define SWFDEC_TYPE_AUDIO_EVENT                    (swfdec_audio_event_get_type())
-#define SWFDEC_IS_AUDIO_EVENT(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AUDIO_EVENT))
-#define SWFDEC_IS_AUDIO_EVENT_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AUDIO_EVENT))
-#define SWFDEC_AUDIO_EVENT(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AUDIO_EVENT, SwfdecAudioEvent))
-#define SWFDEC_AUDIO_EVENT_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AUDIO_EVENT, SwfdecAudioEventClass))
-#define SWFDEC_AUDIO_EVENT_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AUDIO_EVENT, SwfdecAudioEventClass))
-
-struct _SwfdecAudioEvent
-{
-  SwfdecAudio		audio;
-
-  /* static data */
-  SwfdecSound *		sound;		      	/* sound we're playing */
-  guint			start_sample; 		/* sample at which to start playing */
-  guint			stop_sample;	      	/* first sample to not play anymore or 0 for playing all */
-  guint			n_loops;		/* amount of times this sample still needs to be played back */
-  guint			n_envelopes;		/* amount of points in the envelope */
-  SwfdecSoundEnvelope *	envelope;		/* volume envelope or NULL if none */
-  /* dynamic data */
-  SwfdecBuffer *	decoded;		/* the decoded buffer we play back */
-  SwfdecAudioFormat	decoded_format;		/* format of the decoded buffer */
-  guint			offset;			/* current offset in 44.1kHz */
-  guint			loop;			/* current loop we're in */
-  guint			n_samples;	      	/* length of decoded buffer in 44.1kHz samples - can be 0 */
-};
-
-struct _SwfdecAudioEventClass
-{
-  SwfdecAudioClass	audio_class;
-};
-
-GType		swfdec_audio_event_get_type		(void);
-
-SwfdecAudio *	swfdec_audio_event_new			(SwfdecPlayer *		player,
-							 SwfdecSound *		sound,
-							 guint			offset,
-							 guint			n_loops);
-SwfdecAudio *	swfdec_audio_event_new_from_chunk     	(SwfdecPlayer *		player,
-							 SwfdecSoundChunk *	chunk);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_audio_flv.c b/libswfdec/swfdec_audio_flv.c
deleted file mode 100644
index 59de5c5..0000000
--- a/libswfdec/swfdec_audio_flv.c
+++ /dev/null
@@ -1,227 +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
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include "swfdec_audio_flv.h"
-#include "swfdec_debug.h"
-#include "swfdec_sound.h"
-
-
-G_DEFINE_TYPE (SwfdecAudioFlv, swfdec_audio_flv, SWFDEC_TYPE_AUDIO)
-
-static void
-swfdec_audio_flv_dispose (GObject *object)
-{
-  SwfdecAudioFlv *flv = SWFDEC_AUDIO_FLV (object);
-
-  if (flv->decoder != NULL) {
-    swfdec_audio_decoder_free (flv->decoder);
-    flv->decoder = NULL;
-  }
-  g_queue_foreach (flv->playback_queue, (GFunc) swfdec_buffer_unref, NULL);
-  g_queue_free (flv->playback_queue);
-  g_object_unref (flv->flvdecoder);
-
-  G_OBJECT_CLASS (swfdec_audio_flv_parent_class)->dispose (object);
-}
-
-static SwfdecBuffer *
-swfdec_audio_flv_decode_one (SwfdecAudioFlv *flv)
-{
-  SwfdecBuffer *buffer;
-  guint format;
-  SwfdecAudioFormat in;
-  guint now, soon;
-
-  if  (g_queue_is_empty (flv->playback_queue)) {
-    /* sync */
-    guint last;
-    swfdec_flv_decoder_get_audio (flv->flvdecoder, 
-	SWFDEC_TICKS_TO_MSECS (flv->timestamp),
-	NULL, NULL, &last, NULL);
-    flv->playback_skip = SWFDEC_TICKS_TO_SAMPLES (
-	flv->timestamp - SWFDEC_MSECS_TO_TICKS (last));
-    flv->next_timestamp = last;
-    SWFDEC_DEBUG ("syncing to %ums: next timestamp to decode is %ums, skipping %u samples", 
-	(guint) SWFDEC_TICKS_TO_MSECS (flv->timestamp), 
-	flv->next_timestamp, flv->playback_skip);
-  }
-  if (flv->decoder)
-    buffer = swfdec_audio_decoder_pull (flv->decoder);
-  else
-    buffer = NULL;
-  while (buffer == NULL) {
-    if (flv->decoder && flv->next_timestamp == 0)
-      return NULL;
-    buffer = swfdec_flv_decoder_get_audio (flv->flvdecoder, flv->next_timestamp,
-      &format, &in, &now, &soon);
-
-    if (flv->next_timestamp != now) {
-      /* FIXME: do sync on first frame here */
-      SWFDEC_WARNING ("FIXME: didn't get requested timestamp - still loading?");
-    }
-    /* FIXME FIXME FIXME: This avoids decoding the last frame forever, however it ensures sync */
-    if (soon == 0)
-      return NULL;
-    flv->next_timestamp = soon;
-    if (flv->in == 0) {
-      /* init */
-      if (flv->decoder) {
-	swfdec_audio_decoder_free (flv->decoder);
-	flv->decoder = NULL;
-      }
-      flv->format = format;
-      flv->in = in;
-      flv->decoder = swfdec_audio_decoder_new (flv->format, flv->in);
-      if (flv->decoder == NULL)
-	return NULL;
-    } else if (format != flv->format ||
-	in != flv->in) {
-      SWFDEC_ERROR ("FIXME: format change not implemented");
-      return NULL;
-    } else if (flv->decoder == NULL) {
-      return NULL;
-    }
-    swfdec_audio_decoder_push (flv->decoder, buffer);
-    if (flv->next_timestamp == 0)
-      swfdec_audio_decoder_push (flv->decoder, NULL);
-    buffer = swfdec_audio_decoder_pull (flv->decoder);
-  }
-
-  g_queue_push_tail (flv->playback_queue, buffer);
-  return buffer;
-}
-
-static void
-swfdec_audio_flv_render (SwfdecAudio *audio, gint16* dest,
-    guint start, guint n_samples)
-{
-  SwfdecAudioFlv *flv = SWFDEC_AUDIO_FLV (audio);
-  GList *walk;
-  guint samples;
-  SwfdecBuffer *buffer, *previous;
-
-  g_assert (start < G_MAXINT);
-  start += flv->playback_skip;
-  SWFDEC_LOG ("flv %p rendering offset %u, samples %u", flv, start, n_samples);
-  walk = g_queue_peek_head_link (flv->playback_queue);
-  previous = NULL;
-  while (n_samples) {
-    if (walk) {
-      buffer = walk->data;
-      walk = walk->next;
-    } else {
-      buffer = swfdec_audio_flv_decode_one (flv);
-      if (!buffer)
-	break;
-    }
-    samples = swfdec_sound_buffer_get_n_samples (buffer, 
-	swfdec_audio_decoder_get_format (flv->decoder));
-    if (start) {
-      if (samples <= start) {
-	start -= samples;
-	continue;
-      }
-      samples -= start;
-      SWFDEC_LOG ("rendering %u samples, skipping %u",
-	  samples, start);
-    } else {
-      SWFDEC_LOG ("rendering %u samples", samples);
-    }
-    samples = MIN (samples, n_samples);
-    swfdec_sound_buffer_render (dest, buffer, 
-	swfdec_audio_decoder_get_format (flv->decoder), previous, start, 
-	samples);
-    start = 0;
-    n_samples -= samples;
-    dest += 2 * samples;
-    previous = buffer;
-  }
-}
-
-static guint
-swfdec_audio_flv_iterate (SwfdecAudio *audio, guint remove)
-{
-  SwfdecAudioFlv *flv = SWFDEC_AUDIO_FLV (audio);
-  SwfdecBuffer *buffer;
-  guint next;
-
-  flv->playback_skip += remove;
-  buffer = g_queue_peek_head (flv->playback_queue);
-  while (buffer && flv->playback_skip >= 
-	 swfdec_sound_buffer_get_n_samples (buffer, swfdec_audio_decoder_get_format (flv->decoder)) 
-	 + swfdec_audio_format_get_granularity (swfdec_audio_decoder_get_format (flv->decoder))) {
-    buffer = g_queue_pop_head (flv->playback_queue);
-    SWFDEC_LOG ("removing buffer with %u samples", 
-	swfdec_sound_buffer_get_n_samples (buffer, 
-	  swfdec_audio_decoder_get_format (flv->decoder)));
-    flv->playback_skip -= swfdec_sound_buffer_get_n_samples (buffer, 
-	swfdec_audio_decoder_get_format (flv->decoder));
-    swfdec_buffer_unref (buffer);
-    buffer = g_queue_peek_head (flv->playback_queue);
-  }
-  flv->timestamp += SWFDEC_SAMPLES_TO_TICKS (remove);
-  
-  if (!g_queue_is_empty (flv->playback_queue))
-    return G_MAXUINT;
-  swfdec_flv_decoder_get_audio (flv->flvdecoder,
-      SWFDEC_TICKS_TO_MSECS (flv->timestamp),
-      NULL, NULL, NULL, &next);
-  return next ? G_MAXUINT : 0;
-}
-
-static void
-swfdec_audio_flv_class_init (SwfdecAudioFlvClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAudioClass *audio_class = SWFDEC_AUDIO_CLASS (klass);
-
-  object_class->dispose = swfdec_audio_flv_dispose;
-
-  audio_class->iterate = swfdec_audio_flv_iterate;
-  audio_class->render = swfdec_audio_flv_render;
-}
-
-static void
-swfdec_audio_flv_init (SwfdecAudioFlv *flv)
-{
-  flv->playback_queue = g_queue_new ();
-}
-
-SwfdecAudio *
-swfdec_audio_flv_new (SwfdecPlayer *player, SwfdecFlvDecoder *decoder, guint timestamp)
-{
-  SwfdecAudioFlv *flv;
-  
-  flv = g_object_new (SWFDEC_TYPE_AUDIO_FLV, NULL);
-
-  SWFDEC_DEBUG ("new audio flv for decoder %p, starting at %ums", 
-      decoder, timestamp);
-  g_object_ref (decoder);
-  flv->flvdecoder = decoder;
-  flv->timestamp = SWFDEC_MSECS_TO_TICKS (timestamp);
-  swfdec_audio_add (SWFDEC_AUDIO (flv), player);
-
-  return SWFDEC_AUDIO (flv);
-}
-
diff --git a/libswfdec/swfdec_audio_flv.h b/libswfdec/swfdec_audio_flv.h
deleted file mode 100644
index 52ac2a5..0000000
--- a/libswfdec/swfdec_audio_flv.h
+++ /dev/null
@@ -1,66 +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_AUDIO_FLV_H_
-#define _SWFDEC_AUDIO_FLV_H_
-
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_flv_decoder.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAudioFlv SwfdecAudioFlv;
-typedef struct _SwfdecAudioFlvClass SwfdecAudioFlvClass;
-
-#define SWFDEC_TYPE_AUDIO_FLV                    (swfdec_audio_flv_get_type())
-#define SWFDEC_IS_AUDIO_FLV(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AUDIO_FLV))
-#define SWFDEC_IS_AUDIO_FLV_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AUDIO_FLV))
-#define SWFDEC_AUDIO_FLV(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AUDIO_FLV, SwfdecAudioFlv))
-#define SWFDEC_AUDIO_FLV_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AUDIO_FLV, SwfdecAudioFlvClass))
-#define SWFDEC_AUDIO_FLV_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AUDIO_FLV, SwfdecAudioFlvClass))
-
-struct _SwfdecAudioFlv
-{
-  SwfdecAudio		audio;
-
-  SwfdecFlvDecoder *	flvdecoder;	/* decoder we play back */
-  guint			format;		/* codec format of audio */
-  gboolean		width;		/* width of audio */
-  SwfdecAudioFormat	in;		/* input format of data */
-  SwfdecAudioDecoder *	decoder;	/* decoder used for playback */
-
-  SwfdecTick		timestamp;	/* current playback timestamp */
-  guint			next_timestamp;	/* next timestamp in FLV file we request from */
-  guint			playback_skip;	/* number of samples to skip at start of queue */
-  GQueue *		playback_queue;	/* all the samples we've decoded so far */
-};
-
-struct _SwfdecAudioFlvClass
-{
-  SwfdecAudioClass    	audio_class;
-};
-
-GType		swfdec_audio_flv_get_type		(void);
-
-SwfdecAudio *	swfdec_audio_flv_new			(SwfdecPlayer *	  	player,
-							 SwfdecFlvDecoder *	decoder,
-							 guint			timestamp);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_audio_internal.h b/libswfdec/swfdec_audio_internal.h
deleted file mode 100644
index 512f6e7..0000000
--- a/libswfdec/swfdec_audio_internal.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-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_AUDIO_INTERNAL_H_
-#define _SWFDEC_AUDIO_INTERNAL_H_
-
-#include <libswfdec/swfdec.h>
-#include <libswfdec/swfdec_audio.h>
-#include <libswfdec/swfdec_bits.h>
-#include <libswfdec/swfdec_types.h>
-
-G_BEGIN_DECLS
-
-typedef guint SwfdecAudioFormat;
-#define SWFDEC_IS_AUDIO_FORMAT(format) ((format) <= 0xF)
-#define SWFDEC_AUDIO_FORMAT_INVALID ((SwfdecAudioFormat) -1)
-
-
-struct _SwfdecAudio {
-  GObject		object;
-
-  SwfdecPlayer *	player;		/* the player that plays us */
-  gboolean		added;		/* set to TRUE after the added signal has been emitted */
-};
-
-struct _SwfdecAudioClass {
-  GObjectClass		object_class;
-
-  guint			(* iterate)	  		(SwfdecAudio *	audio,
-							 guint		n_samples);
-  void			(* render)			(SwfdecAudio *	audio,
-							 gint16 *	dest,
-							 guint		start, 
-							 guint		n_samples);
-};
-
-void			swfdec_audio_add		(SwfdecAudio *	audio,
-							 SwfdecPlayer *	player);
-void			swfdec_audio_remove		(SwfdecAudio *	audio);
-
-guint			swfdec_audio_iterate		(SwfdecAudio *	audio,
-							 guint		n_samples);
-
-SwfdecAudioFormat	swfdec_audio_format_parse	(SwfdecBits *	  	bits);
-SwfdecAudioFormat	swfdec_audio_format_new		(guint			rate,
-							 guint			channels,
-							 gboolean		is_16bit);
-guint			swfdec_audio_format_get_channels(SwfdecAudioFormat	format);
-gboolean		swfdec_audio_format_is_16bit	(SwfdecAudioFormat	format);
-guint			swfdec_audio_format_get_rate	(SwfdecAudioFormat	format);
-guint			swfdec_audio_format_get_granularity
-							(SwfdecAudioFormat	format);
-guint			swfdec_audio_format_get_bytes_per_sample
-							(SwfdecAudioFormat	format);
-const char *		swfdec_audio_format_to_string	(SwfdecAudioFormat	format);
-
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_audio_stream.c b/libswfdec/swfdec_audio_stream.c
deleted file mode 100644
index d4eb6ca..0000000
--- a/libswfdec/swfdec_audio_stream.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		      2006 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 <string.h>
-#include "swfdec_audio_stream.h"
-#include "swfdec_debug.h"
-#include "swfdec_sound.h"
-#include "swfdec_sprite.h"
-
-
-G_DEFINE_TYPE (SwfdecAudioStream, swfdec_audio_stream, SWFDEC_TYPE_AUDIO)
-
-static void
-swfdec_audio_stream_dispose (GObject *object)
-{
-  SwfdecAudioStream *stream = SWFDEC_AUDIO_STREAM (object);
-
-  if (stream->decoder != NULL) {
-    swfdec_audio_decoder_free (stream->decoder);
-    stream->decoder = NULL;
-  }
-  g_queue_foreach (stream->playback_queue, (GFunc) swfdec_buffer_unref, NULL);
-  g_queue_free (stream->playback_queue);
-
-  G_OBJECT_CLASS (swfdec_audio_stream_parent_class)->dispose (object);
-}
-
-static SwfdecBuffer *
-swfdec_audio_stream_decode_one (SwfdecAudioStream *stream)
-{
-  SwfdecSpriteFrame *frame;
-  SwfdecBuffer *buffer;
-
-  g_assert (!stream->done);
-  if (stream->decoder == NULL)
-    return NULL;
-
-  while (!(buffer = swfdec_audio_decoder_pull (stream->decoder)) &&
-         !stream->done) {
-    if (stream->current_frame >= stream->sprite->n_frames)
-      goto end;
-    frame = &stream->sprite->frames[stream->current_frame];
-    stream->current_frame++;
-    if (frame->sound_head != stream->sound) 
-      goto end;
-    if (frame->sound_samples == 0)
-      continue;
-    if (frame->sound_block)
-      swfdec_audio_decoder_push (stream->decoder, frame->sound_block);
-    continue;
-end:
-    swfdec_audio_decoder_push (stream->decoder, NULL);
-    stream->done = TRUE;
-  }
-  return buffer;
-}
-
-static void
-swfdec_audio_stream_render (SwfdecAudio *audio, gint16* dest,
-    guint start, guint n_samples)
-{
-  SwfdecAudioStream *stream = SWFDEC_AUDIO_STREAM (audio);
-  GList *walk;
-  guint samples;
-  SwfdecBuffer *buffer, *previous;
-
-  g_assert (start < G_MAXINT);
-  start += stream->playback_skip;
-  SWFDEC_LOG ("stream %p rendering offset %u, samples %u", stream, start, n_samples);
-  walk = g_queue_peek_head_link (stream->playback_queue);
-  previous = NULL;
-  while (n_samples) {
-    if (walk) {
-      buffer = walk->data;
-      walk = walk->next;
-    } else {
-      if (stream->done)
-	break;
-      buffer = swfdec_audio_stream_decode_one (stream);
-      if (!buffer)
-	break;
-      g_queue_push_tail (stream->playback_queue, buffer);
-    }
-    samples = swfdec_sound_buffer_get_n_samples (buffer, 
-	swfdec_audio_decoder_get_format (stream->decoder));
-    if (start) {
-      if (samples <= start) {
-	start -= samples;
-	continue;
-      }
-      samples -= start;
-      SWFDEC_LOG ("rendering %u samples, skipping %u",
-	  samples, start);
-    } else {
-      SWFDEC_LOG ("rendering %u samples", samples);
-    }
-    samples = MIN (samples, n_samples);
-    swfdec_sound_buffer_render (dest, buffer, 
-	swfdec_audio_decoder_get_format (stream->decoder), 
-	previous, start, samples);
-    start = 0;
-    n_samples -= samples;
-    dest += 2 * samples;
-    previous = buffer;
-  }
-}
-
-static guint
-swfdec_audio_stream_iterate (SwfdecAudio *audio, guint remove)
-{
-  SwfdecAudioStream *stream = SWFDEC_AUDIO_STREAM (audio);
-  SwfdecBuffer *buffer;
-
-  stream->playback_skip += remove;
-  buffer = g_queue_peek_head (stream->playback_queue);
-  while (buffer && stream->playback_skip >= 
-	 swfdec_sound_buffer_get_n_samples (buffer, swfdec_audio_decoder_get_format (stream->decoder)) 
-	 + swfdec_audio_format_get_granularity (swfdec_audio_decoder_get_format (stream->decoder))) {
-    buffer = g_queue_pop_head (stream->playback_queue);
-    SWFDEC_LOG ("removing buffer with %u samples", 
-	swfdec_sound_buffer_get_n_samples (buffer, 
-	  swfdec_audio_decoder_get_format (stream->decoder)));
-    stream->playback_skip -= swfdec_sound_buffer_get_n_samples (buffer, 
-	swfdec_audio_decoder_get_format (stream->decoder));
-    swfdec_buffer_unref (buffer);
-    buffer = g_queue_peek_head (stream->playback_queue);
-  }
-  
-  if (!stream->done) {
-    return G_MAXUINT;
-  } else {
-    GList *walk;
-    guint ret = 0;
-    SwfdecAudioFormat format = swfdec_audio_decoder_get_format (stream->decoder);
-    
-    for (walk = g_queue_peek_head_link (stream->playback_queue); walk; walk = walk->next) {
-      ret += swfdec_sound_buffer_get_n_samples (walk->data, format);
-    }
-    return ret - stream->playback_skip;
-  }
-}
-
-static void
-swfdec_audio_stream_class_init (SwfdecAudioStreamClass *klass)
-{
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  SwfdecAudioClass *audio_class = SWFDEC_AUDIO_CLASS (klass);
-
-  object_class->dispose = swfdec_audio_stream_dispose;
-
-  audio_class->iterate = swfdec_audio_stream_iterate;
-  audio_class->render = swfdec_audio_stream_render;
-}
-
-static void
-swfdec_audio_stream_init (SwfdecAudioStream *stream)
-{
-  stream->playback_queue = g_queue_new ();
-}
-
-SwfdecAudio *
-swfdec_audio_stream_new (SwfdecPlayer *player, SwfdecSprite *sprite, guint start_frame)
-{
-  SwfdecAudioStream *stream;
-  SwfdecSpriteFrame *frame;
-  
-  stream = g_object_new (SWFDEC_TYPE_AUDIO_STREAM, NULL);
-
-  SWFDEC_DEBUG ("new audio stream for sprite %d, starting at %u", 
-      SWFDEC_CHARACTER (sprite)->id, start_frame);
-  stream->sprite = sprite;
-  frame = &sprite->frames[start_frame];
-  g_assert (frame->sound_head);
-  stream->sound = frame->sound_head;
-  stream->playback_skip = frame->sound_skip;
-  stream->current_frame = start_frame;
-  stream->decoder = swfdec_audio_decoder_new (stream->sound->codec, 
-      stream->sound->format);
-  swfdec_audio_add (SWFDEC_AUDIO (stream), player);
-
-  return SWFDEC_AUDIO (stream);
-}
-
diff --git a/libswfdec/swfdec_audio_stream.h b/libswfdec/swfdec_audio_stream.h
deleted file mode 100644
index 306c9c8..0000000
--- a/libswfdec/swfdec_audio_stream.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		      2006 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_AUDIO_STREAM_H_
-#define _SWFDEC_AUDIO_STREAM_H_
-
-#include <libswfdec/swfdec_audio_internal.h>
-#include <libswfdec/swfdec_codec_audio.h>
-
-G_BEGIN_DECLS
-
-typedef struct _SwfdecAudioStream SwfdecAudioStream;
-typedef struct _SwfdecAudioStreamClass SwfdecAudioStreamClass;
-
-#define SWFDEC_TYPE_AUDIO_STREAM                    (swfdec_audio_stream_get_type())
-#define SWFDEC_IS_AUDIO_STREAM(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AUDIO_STREAM))
-#define SWFDEC_IS_AUDIO_STREAM_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AUDIO_STREAM))
-#define SWFDEC_AUDIO_STREAM(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AUDIO_STREAM, SwfdecAudioStream))
-#define SWFDEC_AUDIO_STREAM_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AUDIO_STREAM, SwfdecAudioStreamClass))
-#define SWFDEC_AUDIO_STREAM_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AUDIO_STREAM, SwfdecAudioStreamClass))
-
-struct _SwfdecAudioStream
-{
-  SwfdecAudio		audio;
-
-  SwfdecSprite *	sprite;		/* sprite we're playing back */
-  SwfdecSound *		sound;	      	/* sound we're playing */
-  SwfdecAudioDecoder *	decoder;	/* decoder used for this frame */
-  guint			playback_skip;	/* number of samples to skip at the beginning of queue */
-  GQueue *		playback_queue;	/* all the samples we've decoded so far */
-  guint			current_frame;	/* last decoded frame */
-  gboolean		done;		/* TRUE when no new data will be made available */
-};
-
-struct _SwfdecAudioStreamClass
-{
-  SwfdecAudioClass    	audio_class;
-};
-
-GType		swfdec_audio_stream_get_type		(void);
-
-SwfdecAudio *	swfdec_audio_stream_new			(SwfdecPlayer *	player,
-							 SwfdecSprite *	sprite,
-							 guint		start_frame);
-
-G_END_DECLS
-#endif
diff --git a/libswfdec/swfdec_bevel_filter.c b/libswfdec/swfdec_bevel_filter.c
deleted file mode 100644
index 4e6c4f7..0000000
--- a/libswfdec/swfdec_bevel_filter.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_internal.h"
-#include "swfdec_debug.h"
-
-SWFDEC_AS_NATIVE (1107, 1, swfdec_bevel_filter_get_distance)
-void
-swfdec_bevel_filter_get_distance (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.distance (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 2, swfdec_bevel_filter_set_distance)
-void
-swfdec_bevel_filter_set_distance (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.distance (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 3, swfdec_bevel_filter_get_angle)
-void
-swfdec_bevel_filter_get_angle (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.angle (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 4, swfdec_bevel_filter_set_angle)
-void
-swfdec_bevel_filter_set_angle (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.angle (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 5, swfdec_bevel_filter_get_highlightColor)
-void
-swfdec_bevel_filter_get_highlightColor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.highlightColor (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 6, swfdec_bevel_filter_set_highlightColor)
-void
-swfdec_bevel_filter_set_highlightColor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.highlightColor (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 7, swfdec_bevel_filter_get_highlightAlpha)
-void
-swfdec_bevel_filter_get_highlightAlpha (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.highlightAlpha (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 8, swfdec_bevel_filter_set_highlightAlpha)
-void
-swfdec_bevel_filter_set_highlightAlpha (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.highlightAlpha (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 9, swfdec_bevel_filter_get_shadowColor)
-void
-swfdec_bevel_filter_get_shadowColor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.shadowColor (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 10, swfdec_bevel_filter_set_shadowColor)
-void
-swfdec_bevel_filter_set_shadowColor (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.shadowColor (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 11, swfdec_bevel_filter_get_shadowAlpha)
-void
-swfdec_bevel_filter_get_shadowAlpha (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.shadowAlpha (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 12, swfdec_bevel_filter_set_shadowAlpha)
-void
-swfdec_bevel_filter_set_shadowAlpha (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.shadowAlpha (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 13, swfdec_bevel_filter_get_quality)
-void
-swfdec_bevel_filter_get_quality (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.quality (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 14, swfdec_bevel_filter_set_quality)
-void
-swfdec_bevel_filter_set_quality (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.quality (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 15, swfdec_bevel_filter_get_strength)
-void
-swfdec_bevel_filter_get_strength (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.strength (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 16, swfdec_bevel_filter_set_strength)
-void
-swfdec_bevel_filter_set_strength (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.strength (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 17, swfdec_bevel_filter_get_knockout)
-void
-swfdec_bevel_filter_get_knockout (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.knockout (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 18, swfdec_bevel_filter_set_knockout)
-void
-swfdec_bevel_filter_set_knockout (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.knockout (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 19, swfdec_bevel_filter_get_blurX)
-void
-swfdec_bevel_filter_get_blurX (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.blurX (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 20, swfdec_bevel_filter_set_blurX)
-void
-swfdec_bevel_filter_set_blurX (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.blurX (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 21, swfdec_bevel_filter_get_blurY)
-void
-swfdec_bevel_filter_get_blurY (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.blurY (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 22, swfdec_bevel_filter_set_blurY)
-void
-swfdec_bevel_filter_set_blurY (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.blurY (set)");
-}
-
-SWFDEC_AS_NATIVE (1107, 23, swfdec_bevel_filter_get_type)
-void
-swfdec_bevel_filter_get_type (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.type (get)");
-}
-
-SWFDEC_AS_NATIVE (1107, 24, swfdec_bevel_filter_set_type)
-void
-swfdec_bevel_filter_set_type (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter.type (set)");
-}
-
-// constructor
-SWFDEC_AS_NATIVE (1107, 0, swfdec_bevel_filter_construct)
-void
-swfdec_bevel_filter_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BevelFilter");
-}
diff --git a/libswfdec/swfdec_bitmap_data.c b/libswfdec/swfdec_bitmap_data.c
deleted file mode 100644
index 4686140..0000000
--- a/libswfdec/swfdec_bitmap_data.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_internal.h"
-#include "swfdec_debug.h"
-
-// static
-SWFDEC_AS_NATIVE (1100, 40, swfdec_bitmap_data_loadBitmap)
-void
-swfdec_bitmap_data_loadBitmap (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.loadBitmap (static)");
-}
-
-// properties
-SWFDEC_AS_NATIVE (1100, 100, swfdec_bitmap_data_get_width)
-void
-swfdec_bitmap_data_get_width (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.width (get)");
-}
-
-SWFDEC_AS_NATIVE (1100, 101, swfdec_bitmap_data_set_width)
-void
-swfdec_bitmap_data_set_width (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.width (set)");
-}
-
-SWFDEC_AS_NATIVE (1100, 102, swfdec_bitmap_data_get_height)
-void
-swfdec_bitmap_data_get_height (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.height (get)");
-}
-
-SWFDEC_AS_NATIVE (1100, 103, swfdec_bitmap_data_set_height)
-void
-swfdec_bitmap_data_set_height (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.height (set)");
-}
-
-SWFDEC_AS_NATIVE (1100, 104, swfdec_bitmap_data_get_rectangle)
-void
-swfdec_bitmap_data_get_rectangle (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.rectangle (get)");
-}
-
-SWFDEC_AS_NATIVE (1100, 105, swfdec_bitmap_data_set_rectangle)
-void
-swfdec_bitmap_data_set_rectangle (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.rectangle (set)");
-}
-
-SWFDEC_AS_NATIVE (1100, 106, swfdec_bitmap_data_get_transparent)
-void
-swfdec_bitmap_data_get_transparent (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.transparent (get)");
-}
-
-SWFDEC_AS_NATIVE (1100, 107, swfdec_bitmap_data_set_transparent)
-void
-swfdec_bitmap_data_set_transparent (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.transparent (set)");
-}
-
-// normal
-SWFDEC_AS_NATIVE (1100, 1, swfdec_bitmap_data_getPixel)
-void
-swfdec_bitmap_data_getPixel (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.getPixel");
-}
-
-SWFDEC_AS_NATIVE (1100, 2, swfdec_bitmap_data_setPixel)
-void
-swfdec_bitmap_data_setPixel (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.setPixel");
-}
-
-SWFDEC_AS_NATIVE (1100, 3, swfdec_bitmap_data_fillRect)
-void
-swfdec_bitmap_data_fillRect (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.fillRect");
-}
-
-SWFDEC_AS_NATIVE (1100, 4, swfdec_bitmap_data_copyPixels)
-void
-swfdec_bitmap_data_copyPixels (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.copyPixels");
-}
-
-SWFDEC_AS_NATIVE (1100, 5, swfdec_bitmap_data_applyFilter)
-void
-swfdec_bitmap_data_applyFilter (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.applyFilter");
-}
-
-SWFDEC_AS_NATIVE (1100, 6, swfdec_bitmap_data_scroll)
-void
-swfdec_bitmap_data_scroll (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.scroll");
-}
-
-SWFDEC_AS_NATIVE (1100, 7, swfdec_bitmap_data_threshold)
-void
-swfdec_bitmap_data_threshold (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.threshold");
-}
-
-SWFDEC_AS_NATIVE (1100, 8, swfdec_bitmap_data_draw)
-void
-swfdec_bitmap_data_draw (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.draw");
-}
-
-SWFDEC_AS_NATIVE (1100, 9, swfdec_bitmap_data_pixelDissolve)
-void
-swfdec_bitmap_data_pixelDissolve (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.pixelDissolve");
-}
-
-SWFDEC_AS_NATIVE (1100, 10, swfdec_bitmap_data_getPixel32)
-void
-swfdec_bitmap_data_getPixel32 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.getPixel32");
-}
-
-SWFDEC_AS_NATIVE (1100, 11, swfdec_bitmap_data_setPixel32)
-void
-swfdec_bitmap_data_setPixel32 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.setPixel32");
-}
-
-SWFDEC_AS_NATIVE (1100, 12, swfdec_bitmap_data_floodFill)
-void
-swfdec_bitmap_data_floodFill (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.floodFill");
-}
-
-SWFDEC_AS_NATIVE (1100, 13, swfdec_bitmap_data_getColorBoundsRect)
-void
-swfdec_bitmap_data_getColorBoundsRect (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.getColorBoundsRect");
-}
-
-SWFDEC_AS_NATIVE (1100, 14, swfdec_bitmap_data_perlinNoise)
-void
-swfdec_bitmap_data_perlinNoise (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.perlinNoise");
-}
-
-SWFDEC_AS_NATIVE (1100, 15, swfdec_bitmap_data_colorTransform)
-void
-swfdec_bitmap_data_colorTransform (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.colorTransform");
-}
-
-SWFDEC_AS_NATIVE (1100, 16, swfdec_bitmap_data_hitTest)
-void
-swfdec_bitmap_data_hitTest (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.hitTest");
-}
-
-SWFDEC_AS_NATIVE (1100, 17, swfdec_bitmap_data_paletteMap)
-void
-swfdec_bitmap_data_paletteMap (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.paletteMap");
-}
-
-SWFDEC_AS_NATIVE (1100, 18, swfdec_bitmap_data_merge)
-void
-swfdec_bitmap_data_merge (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.merge");
-}
-
-SWFDEC_AS_NATIVE (1100, 19, swfdec_bitmap_data_noise)
-void
-swfdec_bitmap_data_noise (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.noise");
-}
-
-SWFDEC_AS_NATIVE (1100, 20, swfdec_bitmap_data_copyChannel)
-void
-swfdec_bitmap_data_copyChannel (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.copyChannel");
-}
-
-SWFDEC_AS_NATIVE (1100, 21, swfdec_bitmap_data_clone)
-void
-swfdec_bitmap_data_clone (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.clone");
-}
-
-SWFDEC_AS_NATIVE (1100, 22, swfdec_bitmap_data_dispose)
-void
-swfdec_bitmap_data_dispose (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.dispose");
-}
-
-SWFDEC_AS_NATIVE (1100, 23, swfdec_bitmap_data_generateFilterRect)
-void
-swfdec_bitmap_data_generateFilterRect (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.generateFilterRect");
-}
-
-SWFDEC_AS_NATIVE (1100, 24, swfdec_bitmap_data_compare)
-void
-swfdec_bitmap_data_compare (SwfdecAsContext *cx,
-    SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
-    SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData.compare");
-}
-
-// constructor
-SWFDEC_AS_NATIVE (1100, 0, swfdec_bitmap_data_construct)
-void
-swfdec_bitmap_data_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapData");
-}
diff --git a/libswfdec/swfdec_bitmap_filter.c b/libswfdec/swfdec_bitmap_filter.c
deleted file mode 100644
index ae9af4c..0000000
--- a/libswfdec/swfdec_bitmap_filter.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Pekka Lampila <pekka.lampila at iki.fi>
- *
- * 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_internal.h"
-#include "swfdec_debug.h"
-
-SWFDEC_AS_NATIVE (1112, 1, swfdec_bitmap_filter_getPixel)
-void
-swfdec_bitmap_filter_getPixel (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  SWFDEC_STUB ("BitmapFilter.clone");
-}
-
-SWFDEC_AS_NATIVE (1112, 0, swfdec_bitmap_filter_construct)
-void
-swfdec_bitmap_filter_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
-{
-  // FIXME: this is just commented out so that it won't always output warning
-  // when running initialization scripts
-  //SWFDEC_STUB ("BitmapFilter");
-}
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
deleted file mode 100644
index 1cf166d..0000000
--- a/libswfdec/swfdec_bits.c
+++ /dev/null
@@ -1,760 +0,0 @@
-/* Swfdec
- * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
- *		 2005-2006 Eric Anholt <eric at anholt.net>
- *		 2006-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 <string.h>
-#include <zlib.h>
-
-#include "swfdec_bits.h"
-#include "swfdec_color.h"
-#include "swfdec_debug.h"
-#include "swfdec_rect.h"
-
-
-#define SWFDEC_BITS_CHECK(b,n) G_STMT_START { \
-  if (swfdec_bits_left(b) < (n)) { \
-    SWFDEC_ERROR ("reading past end of buffer"); \
-    b->ptr = b->end; \
-    b->idx = 0; \
-    return 0; \
-  } \
-}G_STMT_END
-#define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \
-  g_assert (b->end >= b->ptr); \
-  g_assert (b->idx == 0); \
-  if ((unsi