Pekka Lampila
2007-Aug-18 12:32 UTC
[Swfdec] 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_load_object_as.h libswfdec/swfdec_load_object.c libswfdec/swfdec_load_object.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_xml_as.c libswfdec/swfdec_xml_as.h libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h test/trace
libswfdec/Makefile.am | 7 - libswfdec/swfdec_as_strings.c | 2 libswfdec/swfdec_load_object.c | 215 +++++++++++++++++++++++++++++++++++++ libswfdec/swfdec_load_object.h | 35 ++---- libswfdec/swfdec_load_object_as.c | 48 ++++++++ libswfdec/swfdec_load_object_as.h | 31 +++++ libswfdec/swfdec_player.c | 5 libswfdec/swfdec_player_internal.h | 1 libswfdec/swfdec_xml.c | 177 ------------------------------ libswfdec/swfdec_xml_as.c | 17 +- libswfdec/swfdec_xml_as.h | 14 -- test/trace/Makefile.am | 7 + test/trace/loadobject-5.swf |binary test/trace/loadobject-5.swf.trace | 46 +++++++ test/trace/loadobject-6.swf |binary test/trace/loadobject-6.swf.trace | 46 +++++++ test/trace/loadobject-7.swf |binary test/trace/loadobject-7.swf.trace | 46 +++++++ test/trace/loadobject.as | 29 ++++ test/trace/trace.c | 2 20 files changed, 512 insertions(+), 216 deletions(-) New commits: diff-tree 5307f431c31026bf25f1abe9e642bb26256b3a5a (from 036bc27bbf78889a7bea8f8a3288457e46848cec) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 15:25:04 2007 +0300 Add test case loadobject for the load method diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am index 794e7f1..3f7219f 100644 --- a/test/trace/Makefile.am +++ b/test/trace/Makefile.am @@ -478,6 +478,13 @@ EXTRA_DIST = \ load-4.swf.trace \ load-5.swf \ load-5.swf.trace \ + loadobject.as \ + loadobject-5.swf \ + loadobject-5.swf.trace \ + loadobject-6.swf \ + loadobject-6.swf.trace \ + loadobject-7.swf \ + loadobject-7.swf.trace \ local.swf \ local.swf.trace \ lots-of-arguments.as \ diff --git a/test/trace/loadobject-5.swf b/test/trace/loadobject-5.swf new file mode 100644 index 0000000..b3b144d Binary files /dev/null and b/test/trace/loadobject-5.swf differ diff --git a/test/trace/loadobject-5.swf.trace b/test/trace/loadobject-5.swf.trace new file mode 100644 index 0000000..ba49d21 --- /dev/null +++ b/test/trace/loadobject-5.swf.trace @@ -0,0 +1,46 @@ +Loaded: +Total: +false +Loaded: +Total: +true +Loaded: 0 +Total: +true +Loaded: 0 +Total: +Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as + +var obj = new Object (); + +obj.load = ASnative (301, 0); + +obj.onData = function (str) { + trace ("Got: " + typeof (str) + " '" + str + "'"); + trace ("Loaded: " + this._bytesLoaded); + trace ("Total: " + this._bytesTotal); +}; + +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ()); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("loadobject.as")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("404")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); + +function quit () { + loadMovie ("FSCommand:quit", ""); +}; + +setInterval (quit, 1000); +' +Loaded: 755 +Total: 755 +Got: undefined '' +Loaded: 755 +Total: 755 diff --git a/test/trace/loadobject-6.swf b/test/trace/loadobject-6.swf new file mode 100644 index 0000000..3a19ff4 Binary files /dev/null and b/test/trace/loadobject-6.swf differ diff --git a/test/trace/loadobject-6.swf.trace b/test/trace/loadobject-6.swf.trace new file mode 100644 index 0000000..ba49d21 --- /dev/null +++ b/test/trace/loadobject-6.swf.trace @@ -0,0 +1,46 @@ +Loaded: +Total: +false +Loaded: +Total: +true +Loaded: 0 +Total: +true +Loaded: 0 +Total: +Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as + +var obj = new Object (); + +obj.load = ASnative (301, 0); + +obj.onData = function (str) { + trace ("Got: " + typeof (str) + " '" + str + "'"); + trace ("Loaded: " + this._bytesLoaded); + trace ("Total: " + this._bytesTotal); +}; + +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ()); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("loadobject.as")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("404")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); + +function quit () { + loadMovie ("FSCommand:quit", ""); +}; + +setInterval (quit, 1000); +' +Loaded: 755 +Total: 755 +Got: undefined '' +Loaded: 755 +Total: 755 diff --git a/test/trace/loadobject-7.swf b/test/trace/loadobject-7.swf new file mode 100644 index 0000000..4d580e6 Binary files /dev/null and b/test/trace/loadobject-7.swf differ diff --git a/test/trace/loadobject-7.swf.trace b/test/trace/loadobject-7.swf.trace new file mode 100644 index 0000000..8e6d8c0 --- /dev/null +++ b/test/trace/loadobject-7.swf.trace @@ -0,0 +1,46 @@ +Loaded: undefined +Total: undefined +false +Loaded: undefined +Total: undefined +true +Loaded: 0 +Total: undefined +true +Loaded: 0 +Total: undefined +Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as + +var obj = new Object (); + +obj.load = ASnative (301, 0); + +obj.onData = function (str) { + trace ("Got: " + typeof (str) + " '" + str + "'"); + trace ("Loaded: " + this._bytesLoaded); + trace ("Total: " + this._bytesTotal); +}; + +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ()); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("loadobject.as")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("404")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); + +function quit () { + loadMovie ("FSCommand:quit", ""); +}; + +setInterval (quit, 1000); +' +Loaded: 755 +Total: 755 +Got: undefined 'undefined' +Loaded: 755 +Total: 755 diff --git a/test/trace/loadobject.as b/test/trace/loadobject.as new file mode 100644 index 0000000..127e063 --- /dev/null +++ b/test/trace/loadobject.as @@ -0,0 +1,29 @@ +// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as + +var obj = new Object (); + +obj.load = ASnative (301, 0); + +obj.onData = function (str) { + trace ("Got: " + typeof (str) + " '" + str + "'"); + trace ("Loaded: " + this._bytesLoaded); + trace ("Total: " + this._bytesTotal); +}; + +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ()); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("loadobject.as")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); +trace (obj.load ("404")); +trace ("Loaded: " + obj._bytesLoaded); +trace ("Total: " + obj._bytesTotal); + +function quit () { + loadMovie ("FSCommand:quit", ""); +}; + +setInterval (quit, 1000); diff-tree 036bc27bbf78889a7bea8f8a3288457e46848cec (from c2e81f0fcd0fda22a358e9884a539e55d03510e5) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 14:33:06 2007 +0300 Don't use program's output as format string in trace.c diff --git a/test/trace/trace.c b/test/trace/trace.c index 0f986e5..9725a0b 100644 --- a/test/trace/trace.c +++ b/test/trace/trace.c @@ -248,7 +248,7 @@ main (int argc, char **argv) Test *test = walk->data; run_test (test, NULL); - g_print (test->output); + g_print ("%s", test->output); if (!test->success) { failures++; g_string_append_printf (failed_tests, diff-tree c2e81f0fcd0fda22a358e9884a539e55d03510e5 (from 1e15b5e20599d5193ba0745cf1e11fac076e66f6) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 14:21:22 2007 +0300 Allow calling XML.load with 0 params to return FALSE diff --git a/libswfdec/swfdec_xml_as.c b/libswfdec/swfdec_xml_as.c index 10f9d13..db31bc0 100644 --- a/libswfdec/swfdec_xml_as.c +++ b/libswfdec/swfdec_xml_as.c @@ -65,6 +65,6 @@ swfdec_xml_init_context (SwfdecPlayer *p SWFDEC_AS_VALUE_SET_OBJECT (&val, xml); swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_load, SWFDEC_TYPE_XML, - swfdec_load_object_load, 1); + swfdec_load_object_load, 0); } diff-tree 1e15b5e20599d5193ba0745cf1e11fac076e66f6 (from d0bd628cea984172d9dfb185b9fbeba64348ed81) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 14:12:48 2007 +0300 Fix load method crash when called without params and fix it's return values diff --git a/libswfdec/swfdec_load_object_as.c b/libswfdec/swfdec_load_object_as.c index e4ab4de..9df8c9f 100644 --- a/libswfdec/swfdec_load_object_as.c +++ b/libswfdec/swfdec_load_object_as.c @@ -36,6 +36,13 @@ swfdec_load_object_load (SwfdecAsContext { const char *url; + if (argc < 1) { + SWFDEC_AS_VALUE_SET_BOOLEAN (rval, FALSE); + return; + } + url = swfdec_as_value_to_string (cx, &argv[0]); swfdec_load_object_new (obj, url); + + SWFDEC_AS_VALUE_SET_BOOLEAN (rval, TRUE); } diff-tree d0bd628cea984172d9dfb185b9fbeba64348ed81 (from e068c79c89238e20d94e93992489aef7a078fada) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 14:08:43 2007 +0300 Reformat LoadObject code a little diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c index ae017e2..6542f7c 100644 --- a/libswfdec/swfdec_load_object.c +++ b/libswfdec/swfdec_load_object.c @@ -42,13 +42,15 @@ swfdec_load_object_loader_target_parse ( SwfdecLoader *loader) { SwfdecAsValue val; - SwfdecAsObject *object = SWFDEC_LOAD_OBJECT (target)->target; + SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target); SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_loaded (loader)); - swfdec_as_object_set_variable (object, SWFDEC_AS_STR__bytesLoaded, &val); + swfdec_as_object_set_variable (load_object->target, + SWFDEC_AS_STR__bytesLoaded, &val); SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_size (loader)); - swfdec_as_object_set_variable (object, SWFDEC_AS_STR__bytesTotal, &val); + swfdec_as_object_set_variable (load_object->target, SWFDEC_AS_STR__bytesTotal, + &val); } static void @@ -58,15 +60,18 @@ swfdec_load_object_ondata (SwfdecLoadObj if (load_object->text) { SWFDEC_AS_VALUE_SET_STRING (&val, - swfdec_as_context_get_string (SWFDEC_AS_OBJECT (load_object->target)->context, load_object->text)); + swfdec_as_context_get_string (load_object->target->context, + load_object->text)); } else { SWFDEC_AS_VALUE_SET_UNDEFINED (&val); } - swfdec_as_object_call (load_object->target, SWFDEC_AS_STR_onData, 1, &val, NULL); + swfdec_as_object_call (load_object->target, SWFDEC_AS_STR_onData, 1, &val, + NULL); } static void -swfdec_load_object_loader_target_error (SwfdecLoaderTarget *target, SwfdecLoader *loader) +swfdec_load_object_loader_target_error (SwfdecLoaderTarget *target, + SwfdecLoader *loader) { SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target); @@ -79,7 +84,8 @@ swfdec_load_object_loader_target_error ( } static void -swfdec_load_object_loader_target_eof (SwfdecLoaderTarget *target, SwfdecLoader *loader) +swfdec_load_object_loader_target_eof (SwfdecLoaderTarget *target, + SwfdecLoader *loader) { SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target); guint size; @@ -173,8 +179,10 @@ swfdec_load_object_load (SwfdecLoadObjec g_return_if_fail (url != NULL); swfdec_load_object_reset (load_object); - load_object->loader = swfdec_player_load (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (load_object)->context), url); - swfdec_loader_set_target (load_object->loader, SWFDEC_LOADER_TARGET (load_object)); + load_object->loader = swfdec_player_load ( + SWFDEC_PLAYER (SWFDEC_AS_OBJECT (load_object)->context), url); + swfdec_loader_set_target (load_object->loader, + SWFDEC_LOADER_TARGET (load_object)); swfdec_loader_set_data_type (load_object->loader, SWFDEC_LOADER_DATA_TEXT); SWFDEC_AS_VALUE_SET_INT (&val, 0); @@ -193,7 +201,8 @@ swfdec_load_object_new (SwfdecAsObject * if (!swfdec_as_context_use_mem (target->context, sizeof (SwfdecLoadObject))) return NULL; load_object = g_object_new (SWFDEC_TYPE_LOAD_OBJECT, NULL); - swfdec_as_object_add (load_object, target->context, sizeof (SwfdecLoadObject)); + swfdec_as_object_add (load_object, target->context, + sizeof (SwfdecLoadObject)); SWFDEC_LOAD_OBJECT (load_object)->target = target; diff --git a/libswfdec/swfdec_load_object_as.c b/libswfdec/swfdec_load_object_as.c index 740c4de..e4ab4de 100644 --- a/libswfdec/swfdec_load_object_as.c +++ b/libswfdec/swfdec_load_object_as.c @@ -31,7 +31,8 @@ SWFDEC_AS_NATIVE (301, 0, swfdec_load_object_load) void -swfdec_load_object_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval) +swfdec_load_object_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, + SwfdecAsValue *argv, SwfdecAsValue *rval) { const char *url; diff-tree e068c79c89238e20d94e93992489aef7a078fada (from 962fb2b3504c1e3205f80a8e66f1a5ba9f8b104b) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 14:02:41 2007 +0300 Set _bytesLoaded to 0 when LoadObject is started diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c index b570849..ae017e2 100644 --- a/libswfdec/swfdec_load_object.c +++ b/libswfdec/swfdec_load_object.c @@ -42,7 +42,7 @@ swfdec_load_object_loader_target_parse ( SwfdecLoader *loader) { SwfdecAsValue val; - SwfdecLoadObject *object = SWFDEC_LOAD_OBJECT (target)->target; + SwfdecAsObject *object = SWFDEC_LOAD_OBJECT (target)->target; SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_loaded (loader)); swfdec_as_object_set_variable (object, SWFDEC_AS_STR__bytesLoaded, &val); @@ -167,6 +167,8 @@ swfdec_load_object_init (SwfdecLoadObjec static void swfdec_load_object_load (SwfdecLoadObject *load_object, const char *url) { + SwfdecAsValue val; + g_return_if_fail (SWFDEC_IS_LOAD_OBJECT (load_object)); g_return_if_fail (url != NULL); @@ -174,6 +176,10 @@ swfdec_load_object_load (SwfdecLoadObjec load_object->loader = swfdec_player_load (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (load_object)->context), url); swfdec_loader_set_target (load_object->loader, SWFDEC_LOADER_TARGET (load_object)); swfdec_loader_set_data_type (load_object->loader, SWFDEC_LOADER_DATA_TEXT); + + SWFDEC_AS_VALUE_SET_INT (&val, 0); + swfdec_as_object_set_variable (load_object->target, + SWFDEC_AS_STR__bytesLoaded, &val); } SwfdecAsObject * diff-tree 962fb2b3504c1e3205f80a8e66f1a5ba9f8b104b (from 0c9f29a8c03fea12e171e839cbc26df4d57705cf) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 12:24:03 2007 +0300 Set _bytesLoaded and _bytesTotal properties in LoadObject diff --git a/libswfdec/swfdec_as_strings.c b/libswfdec/swfdec_as_strings.c index 75589b7..7674f3b 100644 --- a/libswfdec/swfdec_as_strings.c +++ b/libswfdec/swfdec_as_strings.c @@ -250,6 +250,8 @@ const char swfdec_as_strings[] = 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") /* add more here */ ; diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c index 7085397..b570849 100644 --- a/libswfdec/swfdec_load_object.c +++ b/libswfdec/swfdec_load_object.c @@ -38,6 +38,20 @@ swfdec_load_object_loader_target_get_pla } static void +swfdec_load_object_loader_target_parse (SwfdecLoaderTarget *target, + SwfdecLoader *loader) +{ + SwfdecAsValue val; + SwfdecLoadObject *object = SWFDEC_LOAD_OBJECT (target)->target; + + SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_loaded (loader)); + swfdec_as_object_set_variable (object, SWFDEC_AS_STR__bytesLoaded, &val); + + SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_size (loader)); + swfdec_as_object_set_variable (object, SWFDEC_AS_STR__bytesTotal, &val); +} + +static void swfdec_load_object_ondata (SwfdecLoadObject *load_object) { SwfdecAsValue val; @@ -48,7 +62,7 @@ swfdec_load_object_ondata (SwfdecLoadObj } else { SWFDEC_AS_VALUE_SET_UNDEFINED (&val); } - swfdec_as_object_call (SWFDEC_AS_OBJECT (load_object->target), SWFDEC_AS_STR_onData, 1, &val, NULL); + swfdec_as_object_call (load_object->target, SWFDEC_AS_STR_onData, 1, &val, NULL); } static void @@ -105,6 +119,7 @@ static void swfdec_load_object_loader_target_init (SwfdecLoaderTargetInterface *iface) { iface->get_player = swfdec_load_object_loader_target_get_player; + iface->parse = swfdec_load_object_loader_target_parse; iface->eof = swfdec_load_object_loader_target_eof; iface->error = swfdec_load_object_loader_target_error; } diff-tree 0c9f29a8c03fea12e171e839cbc26df4d57705cf (from c7b0dabb45c6522f1cb4413a2f997dd2be63568f) Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Sat Aug 18 12:01:10 2007 +0300 Move XML.load code to new LoadObject class, make it work with any Object diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am index 2f48811..85ec276 100644 --- a/libswfdec/Makefile.am +++ b/libswfdec/Makefile.am @@ -74,6 +74,8 @@ libswfdec_ at SWFDEC_MAJORMINOR@_la_SOURCES swfdec_image.c \ swfdec_interval.c \ swfdec_key_as.c \ + swfdec_load_object.c \ + swfdec_load_object_as.c \ swfdec_loader.c \ swfdec_loadertarget.c \ swfdec_marshal.c \ @@ -107,7 +109,6 @@ libswfdec_ at SWFDEC_MAJORMINOR@_la_SOURCES swfdec_video.c \ swfdec_video_movie.c \ swfdec_video_movie_as.c \ - swfdec_xml.c \ swfdec_xml_as.c libswfdec_ at SWFDEC_MAJORMINOR@_la_CFLAGS = \ @@ -187,6 +188,8 @@ noinst_HEADERS = \ swfdec_initialize.h \ swfdec_internal.h \ swfdec_interval.h \ + swfdec_load_object.h \ + swfdec_load_object_as.h \ swfdec_loader_internal.h \ swfdec_loadertarget.h \ swfdec_marshal.h \ @@ -213,7 +216,7 @@ noinst_HEADERS = \ swfdec_utils.h \ swfdec_video.h \ swfdec_video_movie.h \ - swfdec_xml.h + swfdec_xml_as.h EXTRA_DIST = \ compiler.c \ diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c new file mode 100644 index 0000000..7085397 --- /dev/null +++ b/libswfdec/swfdec_load_object.c @@ -0,0 +1,185 @@ +/* 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_load_object.h" +#include "swfdec_as_strings.h" +#include "swfdec_debug.h" +#include "swfdec_loader_internal.h" +#include "swfdec_loadertarget.h" +#include "swfdec_player_internal.h" + +/*** SWFDEC_LOADER_TARGET ***/ + +static SwfdecPlayer * +swfdec_load_object_loader_target_get_player (SwfdecLoaderTarget *target) +{ + return SWFDEC_PLAYER (SWFDEC_AS_OBJECT (target)->context); +} + +static void +swfdec_load_object_ondata (SwfdecLoadObject *load_object) +{ + SwfdecAsValue val; + + if (load_object->text) { + SWFDEC_AS_VALUE_SET_STRING (&val, + swfdec_as_context_get_string (SWFDEC_AS_OBJECT (load_object->target)->context, load_object->text)); + } else { + SWFDEC_AS_VALUE_SET_UNDEFINED (&val); + } + swfdec_as_object_call (SWFDEC_AS_OBJECT (load_object->target), SWFDEC_AS_STR_onData, 1, &val, NULL); +} + +static void +swfdec_load_object_loader_target_error (SwfdecLoaderTarget *target, SwfdecLoader *loader) +{ + SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target); + + /* break reference to the loader */ + swfdec_loader_set_target (loader, NULL); + load_object->loader = NULL; + g_object_unref (loader); + /* emit onData */ + swfdec_load_object_ondata (load_object); +} + +static void +swfdec_load_object_loader_target_eof (SwfdecLoaderTarget *target, SwfdecLoader *loader) +{ + SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target); + guint size; + + /* get the text from the loader */ + size = swfdec_buffer_queue_get_depth (loader->queue); + load_object->text = g_try_malloc (size + 1); + if (load_object->text) { + SwfdecBuffer *buffer; + guint i = 0; + while ((buffer = swfdec_buffer_queue_pull_buffer (loader->queue))) { + memcpy (load_object->text + i, buffer->data, buffer->length); + i += buffer->length; + swfdec_buffer_unref (buffer); + } + g_assert (i == size); + load_object->text[size] = '\0'; + /* FIXME: validate otherwise? */ + if (!g_utf8_validate (load_object->text, size, NULL)) { + SWFDEC_ERROR ("downloaded data is not valid utf-8"); + g_free (load_object->text); + load_object->text = NULL; + } + } else { + SWFDEC_ERROR ("not enough memory to copy %u bytes", size); + } + + /* break reference to the loader */ + swfdec_loader_set_target (loader, NULL); + load_object->loader = NULL; + g_object_unref (loader); + /* emit onData */ + swfdec_load_object_ondata (load_object); +} + +static void +swfdec_load_object_loader_target_init (SwfdecLoaderTargetInterface *iface) +{ + iface->get_player = swfdec_load_object_loader_target_get_player; + iface->eof = swfdec_load_object_loader_target_eof; + iface->error = swfdec_load_object_loader_target_error; +} + +/*** SWFDEC_LOAD_OBJECT ***/ + +G_DEFINE_TYPE_WITH_CODE (SwfdecLoadObject, swfdec_load_object, SWFDEC_TYPE_AS_OBJECT, + G_IMPLEMENT_INTERFACE (SWFDEC_TYPE_LOADER_TARGET, swfdec_load_object_loader_target_init)) + +static void +swfdec_load_object_reset (SwfdecLoadObject *load_object) +{ + if (load_object->loader) { + swfdec_loader_set_target (load_object->loader, NULL); + g_object_unref (load_object->loader); + load_object->loader = NULL; + } + g_free (load_object->text); + load_object->text = NULL; +} + +static void +swfdec_load_object_dispose (GObject *object) +{ + SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (object); + + swfdec_load_object_reset (load_object); + + G_OBJECT_CLASS (swfdec_load_object_parent_class)->dispose (object); +} + +static void +swfdec_load_object_class_init (SwfdecLoadObjectClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = swfdec_load_object_dispose; +} + +static void +swfdec_load_object_init (SwfdecLoadObject *load_object) +{ +} + +static void +swfdec_load_object_load (SwfdecLoadObject *load_object, const char *url) +{ + g_return_if_fail (SWFDEC_IS_LOAD_OBJECT (load_object)); + g_return_if_fail (url != NULL); + + swfdec_load_object_reset (load_object); + load_object->loader = swfdec_player_load (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (load_object)->context), url); + swfdec_loader_set_target (load_object->loader, SWFDEC_LOADER_TARGET (load_object)); + swfdec_loader_set_data_type (load_object->loader, SWFDEC_LOADER_DATA_TEXT); +} + +SwfdecAsObject * +swfdec_load_object_new (SwfdecAsObject *target, const char *url) +{ + SwfdecAsObject *load_object; + + g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (target), NULL); + g_return_val_if_fail (url != NULL, NULL); + + if (!swfdec_as_context_use_mem (target->context, sizeof (SwfdecLoadObject))) + return NULL; + load_object = g_object_new (SWFDEC_TYPE_LOAD_OBJECT, NULL); + swfdec_as_object_add (load_object, target->context, sizeof (SwfdecLoadObject)); + + SWFDEC_LOAD_OBJECT (load_object)->target = target; + + SWFDEC_PLAYER (target->context)->load_objects + g_list_append (SWFDEC_PLAYER (target->context)->load_objects, load_object); + + swfdec_load_object_load (SWFDEC_LOAD_OBJECT (load_object), url); + + return load_object; +} diff --git a/libswfdec/swfdec_load_object.h b/libswfdec/swfdec_load_object.h new file mode 100644 index 0000000..9a07b59 --- /dev/null +++ b/libswfdec/swfdec_load_object.h @@ -0,0 +1,58 @@ +/* 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_LOAD_OBJECT_H_ +#define _SWFDEC_LOAD_OBJECT_H_ + +#include <libswfdec/swfdec.h> +#include <libswfdec/swfdec_as_object.h> + +G_BEGIN_DECLS + + +typedef struct _SwfdecLoadObject SwfdecLoadObject; +typedef struct _SwfdecLoadObjectClass SwfdecLoadObjectClass; + +#define SWFDEC_TYPE_LOAD_OBJECT (swfdec_load_object_get_type()) +#define SWFDEC_IS_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_LOAD_OBJECT)) +#define SWFDEC_IS_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_LOAD_OBJECT)) +#define SWFDEC_LOAD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObject)) +#define SWFDEC_LOAD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass)) +#define SWFDEC_LOAD_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_LOAD_OBJECT, SwfdecLoadObjectClass)) + +struct _SwfdecLoadObject { + SwfdecAsObject object; + + SwfdecAsObject *target; /* target object */ + char * text; /* string that this LOAD_OBJECT displays */ + SwfdecLoader * loader; /* loader when loading or NULL */ +}; + +struct _SwfdecLoadObjectClass { + SwfdecAsObjectClass object_class; +}; + +GType swfdec_load_object_get_type (void); + +SwfdecAsObject *swfdec_load_object_new (SwfdecAsObject * target, + const char * url); + + +G_END_DECLS +#endif diff --git a/libswfdec/swfdec_load_object_as.c b/libswfdec/swfdec_load_object_as.c new file mode 100644 index 0000000..740c4de --- /dev/null +++ b/libswfdec/swfdec_load_object_as.c @@ -0,0 +1,40 @@ +/* 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_load_object.h" +#include "swfdec_as_strings.h" +#include "swfdec_debug.h" +#include "swfdec_loader_internal.h" +#include "swfdec_loadertarget.h" +#include "swfdec_player_internal.h" + +SWFDEC_AS_NATIVE (301, 0, swfdec_load_object_load) +void +swfdec_load_object_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval) +{ + const char *url; + + url = swfdec_as_value_to_string (cx, &argv[0]); + swfdec_load_object_new (obj, url); +} diff --git a/libswfdec/swfdec_load_object_as.h b/libswfdec/swfdec_load_object_as.h new file mode 100644 index 0000000..f14f0e2 --- /dev/null +++ b/libswfdec/swfdec_load_object_as.h @@ -0,0 +1,31 @@ +/* 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_LOADABLE_H_ +#define _SWFDEC_LOADABLE_H_ + +#include <libswfdec/swfdec.h> +#include <libswfdec/swfdec_as_object.h> + +G_BEGIN_DECLS + +void swfdec_load_object_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval); + +G_END_DECLS +#endif diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c index 98ded92..39a1cb1 100644 --- a/libswfdec/swfdec_player.c +++ b/libswfdec/swfdec_player.c @@ -38,6 +38,7 @@ #include "swfdec_initialize.h" #include "swfdec_internal.h" #include "swfdec_loader_internal.h" +#include "swfdec_load_object.h" #include "swfdec_marshal.h" #include "swfdec_movie.h" #include "swfdec_script.h" @@ -1095,6 +1096,10 @@ swfdec_player_mark (SwfdecAsContext *con for (walk = player->roots; walk; walk = walk->next) { swfdec_as_object_mark (walk->data); } + for (walk = player->load_objects; walk; walk = walk->next) { + swfdec_as_object_mark (walk->data); + swfdec_as_object_mark (SWFDEC_LOAD_OBJECT (walk->data)->target); + } SWFDEC_AS_CONTEXT_CLASS (swfdec_player_parent_class)->mark (context); } diff --git a/libswfdec/swfdec_player_internal.h b/libswfdec/swfdec_player_internal.h index 0d27ec8..45d9103 100644 --- a/libswfdec/swfdec_player_internal.h +++ b/libswfdec/swfdec_player_internal.h @@ -56,6 +56,7 @@ struct _SwfdecPlayer guint width; /* width of movie */ guint height; /* height of movie */ GList * roots; /* all the root movies */ + GList * load_objects; /* all the load objects */ SwfdecCache * cache; /* player cache */ gboolean bgcolor_set; /* TRUE if the background color has been set */ SwfdecColor bgcolor; /* background color */ diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c deleted file mode 100644 index c418ca4..0000000 --- a/libswfdec/swfdec_xml.c +++ /dev/null @@ -1,177 +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_xml.h" -#include "swfdec_as_strings.h" -#include "swfdec_debug.h" -#include "swfdec_loader_internal.h" -#include "swfdec_loadertarget.h" -#include "swfdec_player_internal.h" - -/*** SWFDEC_LOADER_TARGET ***/ - -static SwfdecPlayer * -swfdec_xml_loader_target_get_player (SwfdecLoaderTarget *target) -{ - return SWFDEC_PLAYER (SWFDEC_AS_OBJECT (target)->context); -} - -static void -swfdec_xml_ondata (SwfdecXml *xml) -{ - SwfdecAsValue val; - - if (xml->text) { - SWFDEC_AS_VALUE_SET_STRING (&val, - swfdec_as_context_get_string (SWFDEC_AS_OBJECT (xml)->context, xml->text)); - } else { - SWFDEC_AS_VALUE_SET_UNDEFINED (&val); - } - swfdec_as_object_call (SWFDEC_AS_OBJECT (xml), SWFDEC_AS_STR_onData, 1, &val, NULL); -} - -static void -swfdec_xml_loader_target_error (SwfdecLoaderTarget *target, SwfdecLoader *loader) -{ - SwfdecXml *xml = SWFDEC_XML (target); - - /* break reference to the loader */ - swfdec_loader_set_target (loader, NULL); - xml->loader = NULL; - g_object_unref (loader); - /* emit onData */ - swfdec_xml_ondata (xml); -} - -static void -swfdec_xml_loader_target_eof (SwfdecLoaderTarget *target, SwfdecLoader *loader) -{ - SwfdecXml *xml = SWFDEC_XML (target); - guint size; - - /* get the text from the loader */ - size = swfdec_buffer_queue_get_depth (loader->queue); - xml->text = g_try_malloc (size + 1); - if (xml->text) { - SwfdecBuffer *buffer; - guint i = 0; - while ((buffer = swfdec_buffer_queue_pull_buffer (loader->queue))) { - memcpy (xml->text + i, buffer->data, buffer->length); - i += buffer->length; - swfdec_buffer_unref (buffer); - } - g_assert (i == size); - xml->text[size] = '\0'; - /* FIXME: validate otherwise? */ - if (!g_utf8_validate (xml->text, size, NULL)) { - SWFDEC_ERROR ("downloaded data is not valid utf-8"); - g_free (xml->text); - xml->text = NULL; - } - } else { - SWFDEC_ERROR ("not enough memory to copy %u bytes", size); - } - - /* break reference to the loader */ - swfdec_loader_set_target (loader, NULL); - xml->loader = NULL; - g_object_unref (loader); - /* emit onData */ - swfdec_xml_ondata (xml); -} - -static void -swfdec_xml_loader_target_init (SwfdecLoaderTargetInterface *iface) -{ - iface->get_player = swfdec_xml_loader_target_get_player; - iface->eof = swfdec_xml_loader_target_eof; - iface->error = swfdec_xml_loader_target_error; -} - -/*** SWFDEC_XML ***/ - -G_DEFINE_TYPE_WITH_CODE (SwfdecXml, swfdec_xml, SWFDEC_TYPE_AS_OBJECT, - G_IMPLEMENT_INTERFACE (SWFDEC_TYPE_LOADER_TARGET, swfdec_xml_loader_target_init)) - -static void -swfdec_xml_reset (SwfdecXml *xml) -{ - if (xml->loader) { - swfdec_loader_set_target (xml->loader, NULL); - g_object_unref (xml->loader); - xml->loader = NULL; - } - g_free (xml->text); - xml->text = NULL; -} - -static void -swfdec_xml_dispose (GObject *object) -{ - SwfdecXml *xml = SWFDEC_XML (object); - - swfdec_xml_reset (xml); - - G_OBJECT_CLASS (swfdec_xml_parent_class)->dispose (object); -} - -static void -swfdec_xml_class_init (SwfdecXmlClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->dispose = swfdec_xml_dispose; -} - -static void -swfdec_xml_init (SwfdecXml *xml) -{ -} - -SwfdecAsObject * -swfdec_xml_new (SwfdecAsContext *context) -{ - SwfdecAsObject *xml; - - g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL); - - if (!swfdec_as_context_use_mem (context, sizeof (SwfdecXml))) - return NULL; - xml = g_object_new (SWFDEC_TYPE_XML, NULL); - swfdec_as_object_add (xml, context, sizeof (SwfdecXml)); - - return xml; -} - -void -swfdec_xml_load (SwfdecXml *xml, const char *url) -{ - g_return_if_fail (SWFDEC_IS_XML (xml)); - g_return_if_fail (url != NULL); - - swfdec_xml_reset (xml); - xml->loader = swfdec_player_load (SWFDEC_PLAYER (SWFDEC_AS_OBJECT (xml)->context), url); - swfdec_loader_set_target (xml->loader, SWFDEC_LOADER_TARGET (xml)); - swfdec_loader_set_data_type (xml->loader, SWFDEC_LOADER_DATA_TEXT); -} diff --git a/libswfdec/swfdec_xml.h b/libswfdec/swfdec_xml.h deleted file mode 100644 index 77b355a..0000000 --- a/libswfdec/swfdec_xml.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_XML_H_ -#define _SWFDEC_XML_H_ - -#include <libswfdec/swfdec.h> -#include <libswfdec/swfdec_as_object.h> - -G_BEGIN_DECLS - - -typedef struct _SwfdecXml SwfdecXml; -typedef struct _SwfdecXmlClass SwfdecXmlClass; - -#define SWFDEC_TYPE_XML (swfdec_xml_get_type()) -#define SWFDEC_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_XML)) -#define SWFDEC_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_XML)) -#define SWFDEC_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_XML, SwfdecXml)) -#define SWFDEC_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_XML, SwfdecXmlClass)) -#define SWFDEC_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_XML, SwfdecXmlClass)) - -struct _SwfdecXml { - SwfdecAsObject object; - - char * text; /* string that this XML displays */ - SwfdecLoader * loader; /* loader when loading or NULL */ -}; - -struct _SwfdecXmlClass { - SwfdecAsObjectClass object_class; -}; - -GType swfdec_xml_get_type (void); - -SwfdecAsObject *swfdec_xml_new (SwfdecAsContext * context); - -void swfdec_xml_load (SwfdecXml * xml, - const char * url); - - -G_END_DECLS -#endif diff --git a/libswfdec/swfdec_xml_as.c b/libswfdec/swfdec_xml_as.c index 8159977..10f9d13 100644 --- a/libswfdec/swfdec_xml_as.c +++ b/libswfdec/swfdec_xml_as.c @@ -21,22 +21,25 @@ #include "config.h" #endif -#include "swfdec_xml.h" +#include "swfdec_xml_as.h" #include "swfdec_as_native_function.h" #include "swfdec_as_object.h" #include "swfdec_as_strings.h" #include "swfdec_debug.h" #include "swfdec_internal.h" #include "swfdec_player_internal.h" +#include "swfdec_load_object_as.h" + +G_DEFINE_TYPE (SwfdecXml, swfdec_xml, SWFDEC_TYPE_AS_OBJECT) static void -swfdec_xml_do_load (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval) +swfdec_xml_class_init (SwfdecXmlClass *klass) { - SwfdecXml *xml = SWFDEC_XML (obj); - const char *url; +} - url = swfdec_as_value_to_string (cx, &argv[0]); - swfdec_xml_load (xml, url); +static void +swfdec_xml_init (SwfdecXml *xml) +{ } void @@ -62,6 +65,6 @@ swfdec_xml_init_context (SwfdecPlayer *p SWFDEC_AS_VALUE_SET_OBJECT (&val, xml); swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val); swfdec_as_object_add_function (proto, SWFDEC_AS_STR_load, SWFDEC_TYPE_XML, - swfdec_xml_do_load, 1); + swfdec_load_object_load, 1); } diff --git a/libswfdec/swfdec_xml_as.h b/libswfdec/swfdec_xml_as.h new file mode 100644 index 0000000..1681a8f --- /dev/null +++ b/libswfdec/swfdec_xml_as.h @@ -0,0 +1,51 @@ +/* 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_XML_H_ +#define _SWFDEC_XML_H_ + +#include <libswfdec/swfdec_as_object.h> +#include <libswfdec/swfdec_types.h> +#include <libswfdec/swfdec_script.h> + +G_BEGIN_DECLS + +typedef struct _SwfdecXml SwfdecXml; +typedef struct _SwfdecXmlClass SwfdecXmlClass; + +#define SWFDEC_TYPE_XML (swfdec_xml_get_type()) +#define SWFDEC_IS_XML(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_XML)) +#define SWFDEC_IS_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_XML)) +#define SWFDEC_XML(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_XML, SwfdecXml)) +#define SWFDEC_XML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_XML, SwfdecXmlClass)) +#define SWFDEC_XML_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_XML, SwfdecXmlClass)) + +struct _SwfdecXml { + SwfdecAsObject object; +}; + +struct _SwfdecXmlClass { + SwfdecAsObjectClass object_class; +}; + +GType swfdec_xml_get_type (void); + +G_END_DECLS +#endif
Maybe Matching Threads
- Branch 'vivi' - 60 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c
- 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_load_object.c libswfdec/swfdec_loadvars_as.c test/trace
- 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_load_object_as.c libswfdec/swfdec_load_object.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c
- 23 commits - doc/.gitignore doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_keys.c libswfdec-gtk/swfdec_gtk_keys.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec/Makefile.am
- 28 commits - configure.ac debian/changelog debian/control debian/copyright debian/.gitignore debian/libswfdec0.dirs debian/libswfdec0.files debian/libswfdec0.shlibs debian/libswfdec-dev.dirs debian/libswfdec-dev.files debian/rules debian/swf-player.dirs