[Swfdec-commits] 5 commits - configure.ac swfdec/swfdec_load_object_as.c swfdec/swfdec_player.c swfdec/swfdec_player_internal.h swfdec/swfdec_xml_socket.c swfdec/swfdec_xml_socket.h test/Makefile.am test/swfdec_test_function.c test/swfdec_test_http_request.c test/swfdec_test_http_request.h test/swfdec_test_http_server.c test/swfdec_test_http_server.h test/swfdec_test_initialize.as test/swfdec_test_initialize.h test/swfdec_test_socket.c test/swfdec_test_socket.h test/swfdec_test_test.c test/swfdec_test_test.h vivified/core vivified/dock vivified/Makefile.am vivified/ui
Benjamin Otte
company at kemper.freedesktop.org
Wed Nov 5 10:39:24 PST 2008
configure.ac | 3
swfdec/swfdec_load_object_as.c | 12
swfdec/swfdec_player.c | 2
swfdec/swfdec_player_internal.h | 1
swfdec/swfdec_xml_socket.c | 65 +----
swfdec/swfdec_xml_socket.h | 1
test/Makefile.am | 10
test/swfdec_test_function.c | 4
test/swfdec_test_http_request.c | 347 ---------------------------
test/swfdec_test_http_request.h | 71 -----
test/swfdec_test_http_server.c | 215 ----------------
test/swfdec_test_http_server.h | 63 ----
test/swfdec_test_initialize.as | 19 -
test/swfdec_test_initialize.h | 215 ++++++----------
test/swfdec_test_socket.c | 85 ++----
test/swfdec_test_socket.h | 13 -
test/swfdec_test_test.c | 50 +--
test/swfdec_test_test.h | 3
vivified/Makefile.am | 2
vivified/core/.gitignore | 16 -
vivified/core/Makefile.am | 66 -----
vivified/core/vivi_application.c | 416 --------------------------------
vivified/core/vivi_application.h | 113 --------
vivified/core/vivi_application_as.c | 114 --------
vivified/core/vivi_breakpoint.c | 187 --------------
vivified/core/vivi_breakpoint.h | 58 ----
vivified/core/vivi_debugger.c | 209 ----------------
vivified/core/vivi_debugger.h | 55 ----
vivified/core/vivi_function.c | 75 -----
vivified/core/vivi_function.h | 36 --
vivified/core/vivi_initialize.as | 158 ------------
vivified/core/vivi_initialize.s | 7
vivified/core/vivi_marshal.list | 4
vivified/core/vivi_ming.c | 111 --------
vivified/core/vivi_ming.h | 34 --
vivified/core/vivi_player_as.c | 132 ----------
vivified/core/vivi_wrap.c | 106 --------
vivified/core/vivi_wrap.h | 60 ----
vivified/core/vivi_wrap_as.c | 157 ------------
vivified/core/vivified-core.h | 25 -
vivified/dock/.gitignore | 12
vivified/dock/Makefile.am | 15 -
vivified/dock/vivi_docker.c | 93 -------
vivified/dock/vivi_docker.h | 55 ----
vivified/dock/vivi_docklet.c | 172 -------------
vivified/dock/vivi_docklet.h | 61 ----
vivified/dock/vivi_vdock.c | 159 ------------
vivified/dock/vivi_vdock.h | 60 ----
vivified/dock/vivified-dock.h | 26 --
vivified/ui/.gitignore | 14 -
vivified/ui/Makefile.am | 24 -
vivified/ui/main.c | 73 -----
vivified/ui/vivi_command_line.c | 118 ---------
vivified/ui/vivi_command_line.xml | 38 --
vivified/ui/vivi_movie_list.c | 457 ------------------------------------
vivified/ui/vivi_movie_list.h | 66 -----
vivified/ui/vivi_movies.c | 40 ---
vivified/ui/vivi_movies.xml | 38 --
vivified/ui/vivi_player.c | 36 --
vivified/ui/vivi_player.xml | 16 -
vivified/ui/vivi_vivi_docklet.c | 150 -----------
vivified/ui/vivi_vivi_docklet.h | 62 ----
vivified/ui/vivi_widget.c | 245 -------------------
vivified/ui/vivi_widget.h | 62 ----
vivified/ui/vivi_window.c | 220 -----------------
vivified/ui/vivi_window.h | 64 -----
66 files changed, 173 insertions(+), 5523 deletions(-)
New commits:
commit 6f1a047f4079308343990b962a8b6a4cd26a4415
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Nov 5 18:39:02 2008 +0100
remove the HTTP test code
It's unused and causes compiling problems. Feel free to revive it if you
want it.
diff --git a/test/Makefile.am b/test/Makefile.am
index 886f980..1c7f0f6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2,14 +2,6 @@ SUBDIRS = custom image sound trace various gnash
noinst_PROGRAMS = swfdec-test
-if WITH_GTK
-swfdec_gtk_test_sources = \
- swfdec_test_http_request.c \
- swfdec_test_http_server.c
-else
-swfdec_gtk_test_sources =
-endif
-
swfdec_test_sources = \
swfdec_test.c \
swfdec_test_buffer.c \
@@ -39,8 +31,6 @@ noinst_HEADERS = \
swfdec_test_buffer.h \
swfdec_test_function.h \
swfdec_test_function_list.h \
- swfdec_test_http_request.h \
- swfdec_test_http_server.h \
swfdec_test_image.h \
swfdec_test_initialize.h \
swfdec_test_plugin.h \
diff --git a/test/swfdec_test_function.c b/test/swfdec_test_function.c
index 6d686b1..8f79529 100644
--- a/test/swfdec_test_function.c
+++ b/test/swfdec_test_function.c
@@ -25,10 +25,6 @@
#include "swfdec_test_function_list.h"
/* needed by the function list */
-#ifdef HAVE_GTK
-#include "swfdec_test_http_request.h"
-#include "swfdec_test_http_server.h"
-#endif
#include "swfdec_test_buffer.h"
#include "swfdec_test_image.h"
#include "swfdec_test_socket.h"
diff --git a/test/swfdec_test_http_request.c b/test/swfdec_test_http_request.c
deleted file mode 100644
index 9beddf3..0000000
--- a/test/swfdec_test_http_request.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- * 2008 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 <string.h>
-
-#include "swfdec_test_http_request.h"
-#include "swfdec_test_http_server.h"
-#include "swfdec_test_buffer.h"
-#include "swfdec_test_function.h"
-#include "swfdec_test_utils.h"
-
-SwfdecAsObject *
-swfdec_test_http_request_new (SwfdecAsContext *context,
- SwfdecTestHTTPServer *server, SoupMessage *message)
-{
- SwfdecAsValue val;
- SwfdecAsObject *ret;
-
- g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), NULL);
- g_return_val_if_fail (SWFDEC_IS_TEST_HTTP_SERVER (server), NULL);
- g_return_val_if_fail (SOUP_IS_MESSAGE (message), NULL);
-
- if (!swfdec_as_context_use_mem (context, sizeof (SwfdecTestHTTPRequest)))
- return NULL;
-
- ret = g_object_new (SWFDEC_TYPE_TEST_HTTP_REQUEST, NULL);
- swfdec_as_object_add (ret, context, sizeof (SwfdecTestHTTPRequest));
- swfdec_as_object_get_variable (context->global,
- swfdec_as_context_get_string (context, "HTTPRequest"), &val);
-
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
- swfdec_as_object_set_constructor (ret, SWFDEC_AS_VALUE_GET_OBJECT (&val));
-
- soup_message_headers_set_encoding (message->response_headers,
- SOUP_ENCODING_CHUNKED);
- soup_message_set_flags (message, SOUP_MESSAGE_OVERWRITE_CHUNKS);
- soup_message_set_status (message, SOUP_STATUS_OK);
-
- SWFDEC_TEST_HTTP_REQUEST (ret)->server = server;
- SWFDEC_TEST_HTTP_REQUEST (ret)->message = message;
-
- return ret;
-}
-
-/*** SWFDEC_TEST_HTTP_REQUEST ***/
-
-G_DEFINE_TYPE (SwfdecTestHTTPRequest, swfdec_test_http_request, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_test_http_request_dispose (GObject *object)
-{
- SwfdecTestHTTPRequest *request = SWFDEC_TEST_HTTP_REQUEST (object);
-
- g_object_unref (request->message);
- request->message = NULL;
-
- G_OBJECT_CLASS (swfdec_test_http_request_parent_class)->dispose (object);
-}
-
-static void
-swfdec_test_http_request_mark (SwfdecAsObject *object)
-{
- SwfdecTestHTTPRequest *request = SWFDEC_TEST_HTTP_REQUEST (object);
-
- swfdec_as_object_mark (SWFDEC_AS_OBJECT (request->server));
- swfdec_as_object_mark (SWFDEC_AS_OBJECT (request->headers));
-
- SWFDEC_AS_OBJECT_CLASS (swfdec_test_http_request_parent_class)->mark (object);
-}
-
-static void
-swfdec_test_http_request_class_init (SwfdecTestHTTPRequestClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- SwfdecAsObjectClass *asobject_class = SWFDEC_AS_OBJECT_CLASS (klass);
-
- object_class->dispose = swfdec_test_http_request_dispose;
- asobject_class->mark = swfdec_test_http_request_mark;
-}
-
-static void
-swfdec_test_http_request_init (SwfdecTestHTTPRequest *this)
-{
-}
-
-/*** AS CODE ***/
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_toString", swfdec_test_http_request_toString)
-void
-swfdec_test_http_request_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- GString *string;
- SoupURI *uri;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- string = g_string_new (request->message->method);
- string = g_string_append (string, " ");
-
- uri = soup_message_get_uri (request->message);
- string = g_string_append (string, soup_uri_to_string (uri, FALSE));
-
- SWFDEC_AS_VALUE_SET_STRING (retval,
- swfdec_as_context_give_string (cx, g_string_free (string, FALSE)));
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_server", swfdec_test_http_request_get_server)
-void
-swfdec_test_http_request_get_server (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- SWFDEC_AS_VALUE_SET_OBJECT (retval, SWFDEC_AS_OBJECT (request->server));
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_url", swfdec_test_http_request_get_url)
-void
-swfdec_test_http_request_get_url (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- SoupURI *uri;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- uri = soup_message_get_uri (request->message);
-
- SWFDEC_AS_VALUE_SET_STRING (retval,
- swfdec_as_context_give_string (cx, soup_uri_to_string (uri, FALSE)));
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_path", swfdec_test_http_request_get_path)
-void
-swfdec_test_http_request_get_path (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- SoupURI *uri;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- uri = soup_message_get_uri (request->message);
-
- SWFDEC_AS_VALUE_SET_STRING (retval,
- swfdec_as_context_give_string (cx, soup_uri_to_string (uri, TRUE)));
-}
-
-static void
-swfdec_test_http_request_foreach_set_headers (const char *name,
- const char *value, gpointer user_data)
-{
- SwfdecTestHTTPRequest *request = user_data;
- SwfdecAsContext *cx;
- SwfdecAsValue val;
-
- g_return_if_fail (SWFDEC_IS_AS_OBJECT (request->headers));
-
- cx = request->headers->context;
-
- SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_get_string (cx, value));
- swfdec_as_object_set_variable (request->headers,
- swfdec_as_context_get_string (cx, name), &val);
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_headers", swfdec_test_http_request_get_headers)
-void
-swfdec_test_http_request_get_headers (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- if (!request->headers) {
- request->headers = swfdec_as_object_new_empty (cx);
- soup_message_headers_foreach (request->message->request_headers,
- swfdec_test_http_request_foreach_set_headers, request);
- }
-
- SWFDEC_AS_VALUE_SET_OBJECT (retval, request->headers);
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_contentType", swfdec_test_http_request_get_contentType)
-void
-swfdec_test_http_request_get_contentType (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- const char *value;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- value = soup_message_headers_get (request->message->response_headers,
- "Content-Type");
-
- if (value != NULL) {
- SWFDEC_AS_VALUE_SET_STRING (retval,
- swfdec_as_context_get_string (cx, value));
- } else {
- SWFDEC_AS_VALUE_SET_NULL (retval);
- }
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_set_contentType", swfdec_test_http_request_set_contentType)
-void
-swfdec_test_http_request_set_contentType (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- SwfdecAsValue val;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "v", &val);
-
- if (request->state > SWFDEC_TEST_HTTP_REQUEST_STATE_WAITING) {
- swfdec_test_throw (cx, "Headers have already been sent");
- return;
- }
-
- if (SWFDEC_AS_VALUE_IS_NULL (&val) || SWFDEC_AS_VALUE_IS_UNDEFINED (&val)) {
- soup_message_headers_remove (request->message->response_headers,
- "Content-Type");
- } else {
- soup_message_headers_replace (request->message->response_headers,
- "Content-Type", swfdec_as_value_to_string (cx, &val));
- }
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_get_statusCode", swfdec_test_http_request_get_statusCode)
-void
-swfdec_test_http_request_get_statusCode (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- swfdec_as_value_set_integer (cx, retval, request->message->status_code);
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_set_statusCode", swfdec_test_http_request_set_statusCode)
-void
-swfdec_test_http_request_set_statusCode (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- int status_code;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "i", &status_code);
-
- if (status_code < 0)
- return;
-
- if (request->state > SWFDEC_TEST_HTTP_REQUEST_STATE_WAITING) {
- swfdec_test_throw (cx, "Headers have already been sent");
- return;
- }
-
- soup_message_set_status (request->message, status_code);
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_send", swfdec_test_http_request_send)
-void
-swfdec_test_http_request_send (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
- SwfdecAsValue val;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "v", &val);
-
- if (request->state > SWFDEC_TEST_HTTP_REQUEST_STATE_SENDING) {
- swfdec_test_throw (cx, "Reply has already been sent");
- return;
- }
-
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val) &&
- SWFDEC_IS_TEST_BUFFER (SWFDEC_AS_VALUE_GET_OBJECT (&val))) {
- SwfdecTestBuffer *buffer =
- SWFDEC_TEST_BUFFER (SWFDEC_AS_VALUE_GET_OBJECT (&val));
- soup_message_body_append (request->message->response_body,
- SOUP_MEMORY_COPY, buffer->buffer->data, buffer->buffer->length);
- } else {
- const char *data = swfdec_as_value_to_string (cx, &val);
- soup_message_body_append (request->message->response_body,
- SOUP_MEMORY_COPY, data, strlen (data));
- }
-
- soup_server_unpause_message (request->server->server, request->message);
-
- swfdec_test_http_server_run (request->server);
-
- request->state = SWFDEC_TEST_HTTP_REQUEST_STATE_SENDING;
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPRequest_close", swfdec_test_http_request_close)
-void
-swfdec_test_http_request_close (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPRequest *request;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &request, "");
-
- if (request->state == SWFDEC_TEST_HTTP_REQUEST_STATE_SENT) {
- swfdec_test_throw (cx, "Reply has already been sent");
- return;
- }
-
- soup_message_body_complete (request->message->response_body);
- soup_server_unpause_message (request->server->server, request->message);
-
- swfdec_test_http_server_run (request->server);
-
- request->state = SWFDEC_TEST_HTTP_REQUEST_STATE_SENT;
-}
diff --git a/test/swfdec_test_http_request.h b/test/swfdec_test_http_request.h
deleted file mode 100644
index 892f079..0000000
--- a/test/swfdec_test_http_request.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- * 2008 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_TEST_HTTP_REQUEST_H_
-#define _SWFDEC_TEST_HTTP_REQUEST_H_
-
-#include <swfdec/swfdec.h>
-#include <libsoup/soup.h>
-
-#include "swfdec_test_http_server.h"
-
-G_BEGIN_DECLS
-
-
-typedef struct _SwfdecTestHTTPRequest SwfdecTestHTTPRequest;
-typedef struct _SwfdecTestHTTPRequestClass SwfdecTestHTTPRequestClass;
-
-typedef enum {
- SWFDEC_TEST_HTTP_REQUEST_STATE_WAITING,
- SWFDEC_TEST_HTTP_REQUEST_STATE_SENDING,
- SWFDEC_TEST_HTTP_REQUEST_STATE_SENT
-} SwfdecTestHTTPRequestState;
-
-#define SWFDEC_TYPE_TEST_HTTP_REQUEST (swfdec_test_http_request_get_type())
-#define SWFDEC_IS_TEST_HTTP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_TEST_HTTP_REQUEST))
-#define SWFDEC_IS_TEST_HTTP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_TEST_HTTP_REQUEST))
-#define SWFDEC_TEST_HTTP_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_TEST_HTTP_REQUEST, SwfdecTestHTTPRequest))
-#define SWFDEC_TEST_HTTP_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_TEST_HTTP_REQUEST, SwfdecTestHTTPRequestClass))
-#define SWFDEC_TEST_HTTP_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_TEST_HTTP_REQUEST, SwfdecTestHTTPRequestClass))
-
-struct _SwfdecTestHTTPRequest
-{
- SwfdecAsObject as_object;
-
- SwfdecTestHTTPServer * server;
- SoupMessage * message;
-
- SwfdecTestHTTPRequestState state;
- SwfdecAsObject * headers;
-};
-
-struct _SwfdecTestHTTPRequestClass
-{
- SwfdecAsObjectClass as_object_class;
-};
-
-GType swfdec_test_http_request_get_type (void);
-
-SwfdecAsObject *swfdec_test_http_request_new (SwfdecAsContext * context,
- SwfdecTestHTTPServer * server,
- SoupMessage * message);
-
-G_END_DECLS
-#endif
diff --git a/test/swfdec_test_http_server.c b/test/swfdec_test_http_server.c
deleted file mode 100644
index 4148e94..0000000
--- a/test/swfdec_test_http_server.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- * 2008 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 <libsoup/soup.h>
-
-#include "swfdec_test_http_server.h"
-#include "swfdec_test_http_request.h"
-#include "swfdec_test_function.h"
-#include "swfdec_test_utils.h"
-
-static void
-swfdec_test_http_server_callback (SoupServer *soup_server,
- SoupMessage *message, const char *path, GHashTable *query,
- SoupClientContext *client, gpointer userdata)
-{
- SwfdecTestHTTPServer *server = userdata;
-
- g_return_if_fail (server->server == soup_server);
-
- soup_server_pause_message (server->server, message);
-
- g_queue_push_head (server->messages, g_object_ref (message));
-}
-
-void
-swfdec_test_http_server_run (SwfdecTestHTTPServer *server)
-{
- while (g_main_context_iteration (server->context, FALSE));
-}
-
-static gboolean
-swfdec_test_http_server_start (SwfdecTestHTTPServer *server)
-{
- SoupAddress *address;
-
- g_return_val_if_fail (SWFDEC_IS_TEST_HTTP_SERVER (server), FALSE);
- g_return_val_if_fail (server->server == NULL, FALSE);
-
- address = soup_address_new ("localhost", server->port);
- if (soup_address_resolve_sync (address, NULL) != SOUP_STATUS_OK)
- return FALSE;
-
- server->context = g_main_context_new ();
-
- server->server = soup_server_new (SOUP_SERVER_PORT, server->port,
- SOUP_SERVER_INTERFACE, address, SOUP_SERVER_ASYNC_CONTEXT,
- server->context, NULL);
- if (!server->server) {
- g_main_context_unref (server->context);
- server->context = NULL;
- return FALSE;
- }
-
- soup_server_add_handler (server->server, NULL,
- swfdec_test_http_server_callback, server, NULL);
-
- soup_server_run_async (server->server);
-
- return TRUE;
-}
-
-SwfdecAsObject *
-swfdec_test_http_server_new (SwfdecAsContext *context, guint port)
-{
- SwfdecAsValue val;
- SwfdecAsObject *ret;
-
- if (!swfdec_as_context_use_mem (context, sizeof (SwfdecTestHTTPServer)))
- return NULL;
-
- ret = g_object_new (SWFDEC_TYPE_TEST_HTTP_SERVER, NULL);
- swfdec_as_object_add (ret, context, sizeof (SwfdecTestHTTPServer));
- swfdec_as_object_get_variable (context->global,
- swfdec_as_context_get_string (context, "HTTPServer"), &val);
-
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
- swfdec_as_object_set_constructor (ret, SWFDEC_AS_VALUE_GET_OBJECT (&val));
-
- SWFDEC_TEST_HTTP_SERVER (ret)->port = port;
-
- if (!swfdec_test_http_server_start (SWFDEC_TEST_HTTP_SERVER (ret))) {
- swfdec_test_throw (context, "Failed to start web server for port %i",
- port);
- return NULL;
- }
-
- return ret;
-}
-
-/*** SWFDEC_TEST_HTTP_SERVER ***/
-
-G_DEFINE_TYPE (SwfdecTestHTTPServer, swfdec_test_http_server, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-swfdec_test_http_server_dispose (GObject *object)
-{
- SwfdecTestHTTPServer *server = SWFDEC_TEST_HTTP_SERVER (object);
-
- while (!g_queue_is_empty (server->messages)) {
- g_object_unref (g_queue_pop_tail (server->messages));
- }
- g_queue_free (server->messages);
- server->messages = NULL;
-
- if (server->server) {
- soup_server_quit (server->server);
- g_object_unref (server->server);
- server->server = NULL;
- }
-
- if (server->context) {
- g_main_context_unref (server->context);
- server->context = NULL;
- }
-
- G_OBJECT_CLASS (swfdec_test_http_server_parent_class)->dispose (object);
-}
-
-static void
-swfdec_test_http_server_class_init (SwfdecTestHTTPServerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = swfdec_test_http_server_dispose;
-}
-
-static void
-swfdec_test_http_server_init (SwfdecTestHTTPServer *server)
-{
- server->messages = g_queue_new ();
-}
-
-/*** AS CODE ***/
-
-SWFDEC_TEST_FUNCTION ("HTTPServer_get_port", swfdec_test_http_server_get_port)
-void
-swfdec_test_http_server_get_port (SwfdecAsContext *cx, SwfdecAsObject *object,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPServer *server;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_REQUEST, &server, "");
-
- swfdec_as_value_set_integer (cx, retval, server->port);
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPServer_getRequest", swfdec_test_http_server_get_request)
-void
-swfdec_test_http_server_get_request (SwfdecAsContext *cx,
- SwfdecAsObject *object, guint argc, SwfdecAsValue *argv,
- SwfdecAsValue *retval)
-{
- SwfdecTestHTTPServer *server;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_SERVER, &server, "");
-
- if (!server->server) {
- swfdec_test_throw (cx, "Webserver not running");
- return;
- }
-
- if (g_queue_is_empty (server->messages))
- swfdec_test_http_server_run (server);
-
- if (g_queue_is_empty (server->messages)) {
- SWFDEC_AS_VALUE_SET_NULL (retval);
- } else {
- SwfdecAsObject *request;
-
- request = swfdec_test_http_request_new (cx, server,
- g_queue_pop_tail (server->messages));
-
- SWFDEC_AS_VALUE_SET_OBJECT (retval, request);
- }
-}
-
-SWFDEC_TEST_FUNCTION ("HTTPServer", swfdec_test_http_server_create, swfdec_test_http_server_get_type)
-void
-swfdec_test_http_server_create (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
- SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestHTTPServer *server;
- int port;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_HTTP_SERVER, &server, "i", &port);
-
- if (port <= 0)
- return;
-
- server->port = port;
-
- if (!swfdec_test_http_server_start (server))
- swfdec_test_throw (cx, "Failed to start web server for port %i", port);
-}
diff --git a/test/swfdec_test_http_server.h b/test/swfdec_test_http_server.h
deleted file mode 100644
index ad6907d..0000000
--- a/test/swfdec_test_http_server.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Swfdec
- * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
- * 2008 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_TEST_HTTP_SERVER_H_
-#define _SWFDEC_TEST_HTTP_SERVER_H_
-
-#include <swfdec/swfdec.h>
-#include <libsoup/soup.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _SwfdecTestHTTPServer SwfdecTestHTTPServer;
-typedef struct _SwfdecTestHTTPServerClass SwfdecTestHTTPServerClass;
-
-#define SWFDEC_TYPE_TEST_HTTP_SERVER (swfdec_test_http_server_get_type())
-#define SWFDEC_IS_TEST_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_TEST_HTTP_SERVER))
-#define SWFDEC_IS_TEST_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_TEST_HTTP_SERVER))
-#define SWFDEC_TEST_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_TEST_HTTP_SERVER, SwfdecTestHTTPServer))
-#define SWFDEC_TEST_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_TEST_HTTP_SERVER, SwfdecTestHTTPServerClass))
-#define SWFDEC_TEST_HTTP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_TEST_HTTP_SERVER, SwfdecTestHTTPServerClass))
-
-struct _SwfdecTestHTTPServer
-{
- SwfdecAsObject as_object;
-
- GMainContext * context;
- SoupServer * server;
- guint port;
-
- GQueue * messages; // SoupMessage **
-};
-
-struct _SwfdecTestHTTPServerClass
-{
- SwfdecAsObjectClass as_object_class;
-};
-
-GType swfdec_test_http_server_get_type (void);
-
-SwfdecAsObject *swfdec_test_http_server_new (SwfdecAsContext * context,
- guint port);
-void swfdec_test_http_server_run (SwfdecTestHTTPServer * server);
-
-G_END_DECLS
-#endif
diff --git a/test/swfdec_test_initialize.as b/test/swfdec_test_initialize.as
index 7c76f1c..9ddc663 100644
--- a/test/swfdec_test_initialize.as
+++ b/test/swfdec_test_initialize.as
@@ -30,23 +30,6 @@ Image.prototype = {};
Image.prototype.compare = Native.Image_compare;
Image.prototype.save = Native.Image_save;
-HTTPServer = Native.HTTPServer;
-HTTPServer.prototype = {};
-HTTPServer.prototype.getRequest = Native.HTTPServer_getRequest;
-HTTPServer.prototype.addProperty ("port", Native.HTTPServer_get_port, null);
-
-HTTPRequest = new Object ();
-HTTPRequest.prototype = {};
-HTTPRequest.prototype.addProperty ("server", Native.HTTPRequest_get_server, null);
-HTTPRequest.prototype.addProperty ("url", Native.HTTPRequest_get_url, null);
-HTTPRequest.prototype.addProperty ("path", Native.HTTPRequest_get_path, null);
-HTTPRequest.prototype.addProperty ("headers", Native.HTTPRequest_get_headers, null);
-HTTPRequest.prototype.addProperty ("contentType", Native.HTTPRequest_get_contentType, Native.HTTPRequest_set_contentType);
-HTTPRequest.prototype.addProperty ("statusCode", Native.HTTPRequest_get_statusCode, Native.HTTPRequest_set_statusCode);
-HTTPRequest.prototype.toString = Native.HTTPRequest_toString;
-HTTPRequest.prototype.send = Native.HTTPRequest_send;
-HTTPRequest.prototype.close = Native.HTTPRequest_close;
-
Socket = function () {};
Socket.prototype = {};
Socket.prototype.close = Native.Socket_close;
diff --git a/test/swfdec_test_initialize.h b/test/swfdec_test_initialize.h
index 1971338..1de9890 100644
--- a/test/swfdec_test_initialize.h
+++ b/test/swfdec_test_initialize.h
@@ -2,7 +2,7 @@
/* compiled from swfdec_test_initialize.as */
static const unsigned char swfdec_test_initialize[] = {
- 0x88, 0x8D, 0x03, 0x4D, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x4E, 0x61, 0x74, 0x69,
+ 0x88, 0x08, 0x02, 0x35, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x4E, 0x61, 0x74, 0x69,
0x76, 0x65, 0x00, 0x6C, 0x6F, 0x61, 0x64, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5F, 0x6C,
0x6F, 0x61, 0x64, 0x00, 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79, 0x70, 0x65, 0x00, 0x64, 0x69,
0x66, 0x66, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5F, 0x64, 0x69, 0x66, 0x66, 0x00, 0x66,
@@ -12,136 +12,82 @@ static const unsigned char swfdec_test_initialize[] = {
0x6F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x00, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x00, 0x63, 0x6F,
0x6D, 0x70, 0x61, 0x72, 0x65, 0x00, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x63, 0x6F, 0x6D, 0x70,
0x61, 0x72, 0x65, 0x00, 0x73, 0x61, 0x76, 0x65, 0x00, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x5F, 0x73,
- 0x61, 0x76, 0x65, 0x00, 0x48, 0x54, 0x54, 0x50, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x67,
- 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x00, 0x48, 0x54, 0x54, 0x50, 0x53, 0x65,
- 0x72, 0x76, 0x65, 0x72, 0x5F, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x00,
- 0x70, 0x6F, 0x72, 0x74, 0x00, 0x48, 0x54, 0x54, 0x50, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5F,
- 0x67, 0x65, 0x74, 0x5F, 0x70, 0x6F, 0x72, 0x74, 0x00, 0x61, 0x64, 0x64, 0x50, 0x72, 0x6F, 0x70,
- 0x65, 0x72, 0x74, 0x79, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x00, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x48,
- 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x73,
- 0x65, 0x72, 0x76, 0x65, 0x72, 0x00, 0x75, 0x72, 0x6C, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x75, 0x72, 0x6C, 0x00, 0x70, 0x61,
- 0x74, 0x68, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x67,
- 0x65, 0x74, 0x5F, 0x70, 0x61, 0x74, 0x68, 0x00, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x00,
- 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F,
- 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x00, 0x63, 0x6F, 0x6E, 0x74, 0x65, 0x6E, 0x74, 0x54,
- 0x79, 0x70, 0x65, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F,
- 0x67, 0x65, 0x74, 0x5F, 0x63, 0x6F, 0x6E, 0x74, 0x65, 0x6E, 0x74, 0x54, 0x79, 0x70, 0x65, 0x00,
- 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x73, 0x65, 0x74, 0x5F,
- 0x63, 0x6F, 0x6E, 0x74, 0x65, 0x6E, 0x74, 0x54, 0x79, 0x70, 0x65, 0x00, 0x73, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x43, 0x6F, 0x64, 0x65, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6F, 0x64,
- 0x65, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x73, 0x65,
- 0x74, 0x5F, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6F, 0x64, 0x65, 0x00, 0x48, 0x54, 0x54,
- 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x74, 0x6F, 0x53, 0x74, 0x72, 0x69, 0x6E,
- 0x67, 0x00, 0x73, 0x65, 0x6E, 0x64, 0x00, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x5F, 0x73, 0x65, 0x6E, 0x64, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x00, 0x48, 0x54,
- 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x00,
- 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x63, 0x6C,
- 0x6F, 0x73, 0x65, 0x00, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74,
- 0x5F, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x73, 0x65,
- 0x6E, 0x64, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74,
- 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x54, 0x65, 0x73, 0x74,
- 0x00, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x61, 0x64,
- 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65,
- 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65,
- 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x54, 0x65, 0x73,
- 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x6D, 0x6F,
- 0x75, 0x73, 0x65, 0x5F, 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74,
- 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x72,
- 0x65, 0x6E, 0x64, 0x65, 0x72, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x6E, 0x64, 0x65,
- 0x72, 0x00, 0x72, 0x65, 0x73, 0x65, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x73,
- 0x65, 0x74, 0x00, 0x72, 0x61, 0x74, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74,
- 0x5F, 0x72, 0x61, 0x74, 0x65, 0x00, 0x71, 0x75, 0x69, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F,
- 0x67, 0x65, 0x74, 0x5F, 0x71, 0x75, 0x69, 0x74, 0x00, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x54,
- 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x6C, 0x61,
- 0x75, 0x6E, 0x63, 0x68, 0x65, 0x64, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F,
- 0x6C, 0x61, 0x75, 0x6E, 0x63, 0x68, 0x65, 0x64, 0x00, 0x70, 0x72, 0x69, 0x6E, 0x74, 0x00, 0x73,
- 0x00, 0x49, 0x4E, 0x46, 0x4F, 0x3A, 0x20, 0x00, 0x45, 0x52, 0x52, 0x4F, 0x52, 0x3A, 0x20, 0x00,
- 0x96, 0x04, 0x00, 0x08, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x00, 0x4E, 0x1D, 0x96,
- 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x04, 0x00, 0x08, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x03, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x05, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x06, 0x4E,
+ 0x61, 0x76, 0x65, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65,
+ 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x00, 0x65, 0x72,
+ 0x72, 0x6F, 0x72, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x65, 0x72, 0x72, 0x6F, 0x72,
+ 0x00, 0x73, 0x65, 0x6E, 0x64, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x73, 0x65, 0x6E,
+ 0x64, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F,
+ 0x67, 0x65, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x61, 0x64, 0x64, 0x50, 0x72,
+ 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x00, 0x54, 0x65, 0x73, 0x74, 0x00, 0x61, 0x64, 0x76, 0x61,
+ 0x6E, 0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65,
+ 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74,
+ 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65, 0x00, 0x6D, 0x6F, 0x75, 0x73,
+ 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75,
+ 0x73, 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x72,
+ 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73,
+ 0x65, 0x5F, 0x72, 0x65, 0x6C, 0x65, 0x61, 0x73, 0x65, 0x00, 0x72, 0x65, 0x6E, 0x64, 0x65, 0x72,
+ 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x6E, 0x64, 0x65, 0x72, 0x00, 0x72, 0x65, 0x73,
+ 0x65, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x72, 0x65, 0x73, 0x65, 0x74, 0x00, 0x72, 0x61,
+ 0x74, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x72, 0x61, 0x74, 0x65,
+ 0x00, 0x71, 0x75, 0x69, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x71,
+ 0x75, 0x69, 0x74, 0x00, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67,
+ 0x65, 0x74, 0x5F, 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x6C, 0x61, 0x75, 0x6E, 0x63, 0x68, 0x65,
+ 0x64, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x6C, 0x61, 0x75, 0x6E, 0x63,
+ 0x68, 0x65, 0x64, 0x00, 0x70, 0x72, 0x69, 0x6E, 0x74, 0x00, 0x73, 0x00, 0x49, 0x4E, 0x46, 0x4F,
+ 0x3A, 0x20, 0x00, 0x45, 0x52, 0x52, 0x4F, 0x52, 0x3A, 0x20, 0x00, 0x96, 0x04, 0x00, 0x08, 0x00,
+ 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x00, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C,
+ 0x96, 0x04, 0x00, 0x08, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x03, 0x4E, 0x4F, 0x96,
+ 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43,
0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00,
- 0x08, 0x07, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08,
- 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x09, 0x08, 0x01, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x0A, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x0B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C,
- 0x4E, 0x4F, 0x96, 0x04, 0x00, 0x08, 0x0D, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x4E,
- 0x1D, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00,
- 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
- 0x04, 0x00, 0x08, 0x0E, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x4E, 0x4F, 0x96, 0x02,
- 0x00, 0x08, 0x0D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x10, 0x08,
- 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x11, 0x4E, 0x4F, 0x96, 0x04, 0x00, 0x08, 0x12, 0x08, 0x01,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x12, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x12, 0x1C, 0x96, 0x07,
- 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x12, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x13, 0x08, 0x01, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x14, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x16, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x15, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x09, 0x00, 0x08,
- 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x19, 0x40, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x18, 0x1C,
- 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x03, 0x00, 0x02,
- 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x1B, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x1A, 0x07, 0x03,
- 0x00, 0x00, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08,
- 0x17, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x1D, 0x4E,
- 0x96, 0x09, 0x00, 0x08, 0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x1F, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x1E, 0x07, 0x03, 0x00, 0x00,
- 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52,
- 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x21, 0x4E, 0x96, 0x09,
- 0x00, 0x08, 0x20, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04,
- 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x24, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x23, 0x4E,
- 0x96, 0x09, 0x00, 0x08, 0x22, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x01, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x27, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x26, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x25, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x18, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08,
- 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x0B, 0x08, 0x01, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x28, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x29, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2A,
- 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04,
- 0x00, 0x08, 0x2B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2C, 0x4E, 0x4F, 0x96, 0x02, 0x00,
- 0x08, 0x2D, 0x9B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x2D,
+ 0x08, 0x05, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x06, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08,
+ 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x07, 0x08, 0x01, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x08, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x09, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0A,
+ 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x00, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04,
+ 0x00, 0x08, 0x0B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0C, 0x4E, 0x4F, 0x96, 0x04, 0x00,
+ 0x08, 0x0D, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08,
+ 0x0D, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02,
+ 0x00, 0x08, 0x0D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x0E, 0x08,
+ 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x0F, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x0D, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x10, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x11, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x12, 0x9B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x12, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x12, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E,
+ 0x96, 0x04, 0x00, 0x08, 0x13, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x14, 0x4E, 0x4F, 0x96,
+ 0x02, 0x00, 0x08, 0x12, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x15,
+ 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x16, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x12, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x17, 0x08, 0x01, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x18, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x1A, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x19, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x12, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x1B, 0x52, 0x17, 0x96, 0x04, 0x00, 0x08,
+ 0x1C, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x1C, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x1C,
0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00,
- 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x2B, 0x08, 0x01,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2E, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x2F, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x30, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
- 0x04, 0x00, 0x08, 0x29, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x31, 0x4E, 0x4F, 0x96, 0x03,
- 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x33, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x32,
- 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02,
- 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x04, 0x00, 0x08, 0x34, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x34, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07,
- 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x35, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x36, 0x4E,
- 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00,
- 0x08, 0x37, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x38, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08,
- 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x39, 0x08, 0x01, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x3A, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3C,
- 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04,
- 0x00, 0x08, 0x3D, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3E, 0x4E, 0x4F, 0x96, 0x02, 0x00,
- 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3F, 0x08, 0x01,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x40, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x42, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x41, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08,
- 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96,
- 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x44, 0x4E, 0x96, 0x09, 0x00, 0x08,
- 0x43, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
- 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x46, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x45, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00,
- 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x48, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x47, 0x07,
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00,
- 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x49, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73,
- 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x4A, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96,
- 0x04, 0x00, 0x08, 0x4B, 0x08, 0x4A, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00,
- 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x49, 0x52, 0x17, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x2F,
- 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x4A, 0x1C,
- 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x4C, 0x08, 0x4A, 0x1C, 0x47, 0x96,
- 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x49, 0x52,
- 0x17, 0x1D, 0x00
+ 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x1D, 0x08, 0x01,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x1E, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x1F, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x20, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
+ 0x04, 0x00, 0x08, 0x21, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x22, 0x4E, 0x4F, 0x96, 0x02,
+ 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x23, 0x08,
+ 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x24, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x1C, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x25, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x26, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E,
+ 0x96, 0x04, 0x00, 0x08, 0x27, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x28, 0x4E, 0x4F, 0x96,
+ 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2A, 0x4E, 0x96, 0x09, 0x00, 0x08,
+ 0x29, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
+ 0x02, 0x00, 0x08, 0x1B, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x2C, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x2B, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x1B, 0x52, 0x17, 0x96, 0x03, 0x00,
+ 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2E, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x2D, 0x07,
+ 0x03, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00,
+ 0x08, 0x1B, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x30,
+ 0x4E, 0x96, 0x09, 0x00, 0x08, 0x2F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x1C, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x1B, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x31,
+ 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x32, 0x1C,
+ 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x33, 0x08, 0x32, 0x1C, 0x47, 0x96,
+ 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x31, 0x52,
+ 0x17, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x15, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27,
+ 0x00, 0x96, 0x02, 0x00, 0x08, 0x32, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00,
+ 0x08, 0x34, 0x08, 0x32, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x31, 0x52, 0x17, 0x1D, 0x00
};
commit 84ad061ce74fffacd6d39cee31db66d5b3daea22
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Nov 5 18:36:27 2008 +0100
get rid of no-longer working part of vivified
they were always breaking the compilation and noone used them.
Feel free to revive them if you want them.
diff --git a/configure.ac b/configure.ac
index d0fe495..beec59c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -323,9 +323,6 @@ vivified/code/Makefile
vivified/code/test/Makefile
vivified/code/test/compiler/Makefile
vivified/code/test/decompiler/Makefile
-vivified/core/Makefile
-vivified/dock/Makefile
-vivified/ui/Makefile
)
AC_OUTPUT
diff --git a/vivified/Makefile.am b/vivified/Makefile.am
index 94d8f7e..8e14e74 100644
--- a/vivified/Makefile.am
+++ b/vivified/Makefile.am
@@ -1 +1 @@
-SUBDIRS = code core dock ui
+SUBDIRS = code
diff --git a/vivified/core/.gitignore b/vivified/core/.gitignore
deleted file mode 100644
index 4bc848f..0000000
--- a/vivified/core/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-*.loT
-
-vivi_function_list.h
-vivi_marshal.h
-vivi_marshal.c
diff --git a/vivified/core/Makefile.am b/vivified/core/Makefile.am
deleted file mode 100644
index 5e274f1..0000000
--- a/vivified/core/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-noinst_LTLIBRARIES = libvivified-core.la
-
-libvivified_core_la_CFLAGS = $(GLOBAL_CFLAGS) $(SWFDEC_GTK_CFLAGS) $(VIVI_CFLAGS)
-libvivified_core_la_LDFLAGS = $(SWFDEC_GTK_LIBS) $(VIVI_LIBS)
-
-libvivified_core_la_SOURCES = \
- $(libvivified_core_sources) \
- vivi_marshal.c
-
-libvivified_core_sources = \
- vivi_application.c \
- vivi_application_as.c \
- vivi_application.c \
- vivi_breakpoint.c \
- vivi_debugger.c \
- vivi_function.c \
- vivi_initialize.as \
- vivi_initialize.s \
- vivi_ming.c \
- vivi_player_as.c \
- vivi_wrap.c \
- vivi_wrap_as.c
-
-vivi_initialize.lo: vivi_initialize.s vivi_initialize.as
- $(LTCCASCOMPILE) -c -o $@ vivi_initialize.s
-
-noinst_HEADERS = \
- vivi_application.h \
- vivi_breakpoint.h \
- vivi_debugger.h \
- vivi_function.h \
- vivi_function_list.h \
- vivi_marshal.h \
- vivi_ming.h \
- vivi_wrap.h \
- vivified-core.h
-
-BUILT_SOURCES = \
- vivi_function_list.h \
- vivi_marshal.h \
- vivi_marshal.c
-
-CLEANFILES = \
- $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- vivi_marshal.list
-
-vivi_function_list.h: $(libvivified_core_source)
- (cd $(srcdir) \
- && grep -he "^VIVI_FUNCTION" $(libvivified_core_sources) \
- ) >> xgen-vfl \
- && (cmp -s xgen-vfl vivi_function_list.h || cp xgen-vfl vivi_function_list.h) \
- && rm -f xgen-vfl
-
-vivi_marshal.h: vivi_marshal.list Makefile
- $(GLIB_GENMARSHAL) --prefix=vivi_marshal $(srcdir)/vivi_marshal.list --header >> xgen-vmh \
- && (cmp -s xgen-vmh vivi_marshal.h || cp xgen-vmh vivi_marshal.h) \
- && rm -f xgen-vmh
-
-vivi_marshal.c: vivi_marshal.list vivi_marshal.h Makefile
- (echo "#include \"vivi_marshal.h\""; \
- $(GLIB_GENMARSHAL) --prefix=vivi_marshal $(srcdir)/vivi_marshal.list --body;) >> xgen-vmc \
- && cp xgen-vmc vivi_marshal.c \
- && rm -f xgen-vmc
-
diff --git a/vivified/core/vivi_application.c b/vivified/core/vivi_application.c
deleted file mode 100644
index 623e293..0000000
--- a/vivified/core/vivi_application.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/* Vivified
- * 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/swfdec-gtk.h>
-#include "vivi_application.h"
-#include "vivi_debugger.h"
-#include "vivi_function.h"
-#include "vivi_ming.h"
-
-enum {
- MESSAGE,
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_FILENAME,
- PROP_VARIABLES,
- PROP_PLAYER,
- PROP_INTERRUPTED,
- PROP_QUIT
-};
-
-G_DEFINE_TYPE (ViviApplication, vivi_application, SWFDEC_TYPE_AS_CONTEXT)
-static guint signals[LAST_SIGNAL] = { 0, };
-
-static void
-vivi_application_get_property (GObject *object, guint param_id, GValue *value,
- GParamSpec * pspec)
-{
- ViviApplication *app = VIVI_APPLICATION (object);
-
- switch (param_id) {
- case PROP_FILENAME:
- g_value_set_string (value, app->filename);
- break;
- case PROP_VARIABLES:
- g_value_set_string (value, app->variables);
- break;
- case PROP_PLAYER:
- g_value_set_object (value, app->player);
- break;
- case PROP_INTERRUPTED:
- g_value_set_boolean (value, app->loop != NULL);
- break;
- case PROP_QUIT:
- g_value_set_boolean (value, app->playback_state == VIVI_APPLICATION_EXITING);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_application_set_property (GObject *object, guint param_id, const GValue *value,
- GParamSpec *pspec)
-{
- ViviApplication *app = VIVI_APPLICATION (object);
-
- switch (param_id) {
- case PROP_FILENAME:
- vivi_application_set_filename (app, g_value_get_string (value));
- break;
- case PROP_VARIABLES:
- vivi_application_set_variables (app, g_value_get_string (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_application_dispose (GObject *object)
-{
- ViviApplication *app = VIVI_APPLICATION (object);
-
- if (app->playback_state != VIVI_APPLICATION_EXITING)
- vivi_application_quit (app);
-
- g_object_unref (app->player);
- g_hash_table_destroy (app->wraps);
-
- G_OBJECT_CLASS (vivi_application_parent_class)->dispose (object);
-}
-
-static void
-vivi_application_class_init (ViviApplicationClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = vivi_application_dispose;
- object_class->get_property = vivi_application_get_property;
- object_class->set_property = vivi_application_set_property;
-
- g_object_class_install_property (object_class, PROP_FILENAME,
- g_param_spec_string ("filename", "filename", "name of file to play",
- NULL, G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_FILENAME,
- g_param_spec_string ("variables", "variables", "variables to pass to the file",
- NULL, G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_PLAYER,
- g_param_spec_object ("player", "player", "Flash player in use",
- SWFDEC_TYPE_PLAYER, G_PARAM_READABLE));
- g_object_class_install_property (object_class, PROP_INTERRUPTED,
- g_param_spec_boolean ("interrupted", "interrupted", "TRUE if handling a breakpoint",
- FALSE, G_PARAM_READABLE));
- g_object_class_install_property (object_class, PROP_QUIT,
- g_param_spec_boolean ("quit", "quit", "TRUE if application has been quit (no breakpoints will happen)",
- FALSE, G_PARAM_READABLE));
-
- signals[MESSAGE] = g_signal_new ("message", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT_POINTER, /* FIXME */
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER);
-}
-
-static void
-vivi_application_init (ViviApplication *app)
-{
- app->debugger = g_object_new (VIVI_TYPE_DEBUGGER, NULL);
- app->debugger->app = app;
- app->player = swfdec_gtk_player_new (SWFDEC_AS_DEBUGGER (app->debugger));
- /* FIXME: to get rid of dead movie clips, we GC all the time */
- g_object_set (app->player, "memory-until-gc", (gulong) 0, NULL);
-
- app->wraps = g_hash_table_new (g_direct_hash, g_direct_equal);
-}
-
-ViviApplication *
-vivi_application_new (void)
-{
- ViviApplication *app;
-
- app = g_object_new (VIVI_TYPE_APPLICATION, NULL);
- swfdec_as_context_startup (SWFDEC_AS_CONTEXT (app));
- vivi_function_init_context (app);
- return app;
-}
-
-void
-vivi_application_reset (ViviApplication *app)
-{
- gboolean audio;
-
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- if (app->loop != NULL)
- g_main_loop_quit (app->loop);
- audio = swfdec_gtk_player_get_audio_enabled (SWFDEC_GTK_PLAYER (app->player));
- g_object_unref (app->player);
- app->player = swfdec_gtk_player_new (SWFDEC_AS_DEBUGGER (app->debugger));
- swfdec_gtk_player_set_audio_enabled (SWFDEC_GTK_PLAYER (app->player), audio);
- app->player_inited = FALSE;
- g_object_notify (G_OBJECT (app), "player");
-}
-
-void
-vivi_application_set_filename (ViviApplication *app, const char *filename)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
- g_return_if_fail (filename != NULL);
-
- g_free (app->filename);
- app->filename = g_strdup (filename);
- vivi_application_reset (app);
- g_object_notify (G_OBJECT (app), "filename");
-}
-
-const char *
-vivi_application_get_filename (ViviApplication *app)
-{
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), NULL);
-
- return app->filename;
-}
-
-void
-vivi_application_set_variables (ViviApplication *app, const char *variables)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- g_free (app->variables);
- app->variables = g_strdup (variables);
- g_object_notify (G_OBJECT (app), "variables");
-}
-
-const char *
-vivi_application_get_variables (ViviApplication *app)
-{
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), NULL);
-
- return app->variables;
-}
-
-SwfdecPlayer *
-vivi_application_get_player (ViviApplication *app)
-{
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), NULL);
-
- return app->player;
-}
-
-gboolean
-vivi_application_get_interrupted (ViviApplication *app)
-{
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), FALSE);
-
- return app->loop != NULL;
-}
-
-gboolean
-vivi_application_is_quit (ViviApplication *app)
-{
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), FALSE);
-
- return app->playback_state == VIVI_APPLICATION_EXITING;
-}
-
-static gboolean
-vivi_application_step_forward (gpointer appp)
-{
- ViviApplication *app = appp;
- guint next_event;
-
- app->step_source = 0;
- if (app->loop != NULL ||
- app->playback_state != VIVI_APPLICATION_STEPPING)
- return FALSE;
-
- app->playback_count--;
- if (app->playback_count == 0)
- app->playback_state = VIVI_APPLICATION_STOPPED;
- next_event = swfdec_player_get_next_event (app->player);
- swfdec_player_advance (app->player, next_event);
-
- vivi_application_check (app);
- return FALSE;
-}
-
-void
-vivi_application_check (ViviApplication *app)
-{
- gboolean is_breakpoint;
-
- /* if we're inside some script code, don't do anything */
- if (swfdec_as_context_get_frame (SWFDEC_AS_CONTEXT (app)))
- return;
-
- is_breakpoint = app->loop != NULL;
- swfdec_as_context_maybe_gc (SWFDEC_AS_CONTEXT (app));
-
- switch (app->playback_state) {
- case VIVI_APPLICATION_EXITING:
- case VIVI_APPLICATION_STOPPED:
- case VIVI_APPLICATION_PLAYING:
- break;
- case VIVI_APPLICATION_STEPPING:
- if (!is_breakpoint && app->step_source == 0) {
- app->step_source = g_idle_add_full (-100, vivi_application_step_forward, app, NULL);
- }
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- /* only play when not in breakpoints and only when really playing */
- swfdec_gtk_player_set_playing (SWFDEC_GTK_PLAYER (app->player), !is_breakpoint &&
- app->playback_state == VIVI_APPLICATION_PLAYING);
-
- /* leave breakpoint unless stopped */
- if (is_breakpoint && app->playback_state != VIVI_APPLICATION_STOPPED)
- g_main_loop_quit (app->loop);
-
- /* init player if playing */
- if ((app->playback_state == VIVI_APPLICATION_PLAYING ||
- app->playback_state == VIVI_APPLICATION_STEPPING) &&
- !app->player_inited) {
- if (app->filename == NULL) {
- vivi_application_error (app, "no file set to play.");
- app->playback_state = VIVI_APPLICATION_STOPPED;
- vivi_application_check (app);
- } else {
- SwfdecURL *url;
-
- app->player_inited = TRUE;
- swfdec_player_set_variables (app->player, app->variables);
- url = swfdec_url_new_from_input (app->filename);
- swfdec_player_set_url (app->player, url);
- swfdec_url_free (url);
- }
- }
-}
-
-void
-vivi_application_execute (ViviApplication *app, const char *command)
-{
- SwfdecAsValue val;
- SwfdecAsObject *object;
- SwfdecScript *script;
- char *error = NULL;
-
- g_return_if_fail (VIVI_IS_APPLICATION (app));
- g_return_if_fail (command != NULL);
-
- vivi_application_input (app, "%s", command);
- script = vivi_ming_compile (command, &error);
- if (script == NULL) {
- vivi_application_error (app, "%s", error);
- g_free (error);
- return;
- }
- object = SWFDEC_AS_CONTEXT (app)->global;
- swfdec_as_object_get_variable (object,
- swfdec_as_context_get_string (SWFDEC_AS_CONTEXT (app), "Commands"),
- &val);
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
- object = SWFDEC_AS_VALUE_GET_OBJECT (&val);
- swfdec_as_object_run (object, script);
- swfdec_script_unref (script);
- vivi_application_check (app);
-}
-
-void
-vivi_application_send_message (ViviApplication *app,
- ViviMessageType type, const char *format, ...)
-{
- va_list args;
- char *msg;
-
- g_return_if_fail (VIVI_IS_APPLICATION (app));
- g_return_if_fail (format != NULL);
-
- va_start (args, format);
- msg = g_strdup_vprintf (format, args);
- va_end (args);
- g_signal_emit (app, signals[MESSAGE], 0, (guint) type, msg);
- g_free (msg);
-}
-
-void
-vivi_application_play (ViviApplication *app)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- if (app->playback_state == VIVI_APPLICATION_EXITING)
- return;
- app->playback_state = VIVI_APPLICATION_PLAYING;
- app->playback_count = 1;
- vivi_application_check (app);
-}
-
-void
-vivi_application_stop (ViviApplication *app)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- if (app->playback_state == VIVI_APPLICATION_EXITING)
- return;
- app->playback_state = VIVI_APPLICATION_STOPPED;
- app->playback_count = 0;
- vivi_application_check (app);
-}
-
-void
-vivi_application_step (ViviApplication *app, guint n_times)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- if (app->playback_state == VIVI_APPLICATION_EXITING)
- return;
- app->playback_state = VIVI_APPLICATION_STEPPING;
- app->playback_count = n_times;
- vivi_application_check (app);
-}
-
-void
-vivi_application_quit (ViviApplication *app)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
-
- if (app->playback_state == VIVI_APPLICATION_EXITING)
- return;
- app->playback_state = VIVI_APPLICATION_EXITING;
- app->playback_count = 1;
- if (app->step_source) {
- if (!g_source_remove (app->step_source)) {
- g_assert_not_reached ();
- }
- app->step_source = 0;
- }
- g_object_notify (G_OBJECT (app), "quit");
- vivi_application_check (app);
-}
-
diff --git a/vivified/core/vivi_application.h b/vivified/core/vivi_application.h
deleted file mode 100644
index 0ebe0fd..0000000
--- a/vivified/core/vivi_application.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Vivified
- * 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 _VIVI_APPLICATION_H_
-#define _VIVI_APPLICATION_H_
-
-#include <swfdec/swfdec.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviApplication ViviApplication;
-typedef struct _ViviApplicationClass ViviApplicationClass;
-/* forward declarations */
-typedef struct _ViviDebugger ViviDebugger;
-
-typedef enum {
- VIVI_APPLICATION_STOPPED,
- VIVI_APPLICATION_PLAYING,
- VIVI_APPLICATION_STEPPING,
- VIVI_APPLICATION_EXITING,
-} ViviApplicationPlayback;
-
-typedef enum {
- VIVI_MESSAGE_INPUT,
- VIVI_MESSAGE_OUTPUT,
- VIVI_MESSAGE_ERROR
-} ViviMessageType;
-
-#define VIVI_TYPE_APPLICATION (vivi_application_get_type())
-#define VIVI_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_APPLICATION))
-#define VIVI_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_APPLICATION))
-#define VIVI_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_APPLICATION, ViviApplication))
-#define VIVI_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_APPLICATION, ViviApplicationClass))
-#define VIVI_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_APPLICATION, ViviApplicationClass))
-
-struct _ViviApplication
-{
- SwfdecAsContext context;
-
- char * filename; /* name of the file we play back or NULL if none set yet */
- char * variables; /* variables to pass to player or NULL if none set */
- SwfdecPlayer * player; /* the current player */
- ViviDebugger * debugger; /* the debugger used in player */
- gboolean player_inited; /* if the player is inited already */
- ViviApplicationPlayback playback_state; /* (running, stepping or stopped) */
- guint playback_count; /* how often to just restart this on breakpoints */
- GMainLoop * loop; /* the breakpoint main loop */
- guint step_source; /* source for stepping forward */
-
- GHashTable * wraps; /* all wrapped objects from @player */
-};
-
-struct _ViviApplicationClass
-{
- SwfdecAsContextClass context_class;
-};
-
-GType vivi_application_get_type (void);
-
-ViviApplication * vivi_application_new (void);
-
-void vivi_application_check (ViviApplication * app);
-
-void vivi_application_send_message (ViviApplication * app,
- ViviMessageType type,
- const char * format,
- ...) G_GNUC_PRINTF (3, 4);
-#define vivi_application_input(manager, ...) \
- vivi_application_send_message (manager, VIVI_MESSAGE_INPUT, __VA_ARGS__)
-#define vivi_application_output(manager, ...) \
- vivi_application_send_message (manager, VIVI_MESSAGE_OUTPUT, __VA_ARGS__)
-#define vivi_application_error(manager, ...) \
- vivi_application_send_message (manager, VIVI_MESSAGE_ERROR, __VA_ARGS__)
-
-void vivi_application_set_filename (ViviApplication * app,
- const char * filename);
-const char * vivi_application_get_filename (ViviApplication * app);
-void vivi_application_set_variables (ViviApplication * app,
- const char * filename);
-const char * vivi_application_get_variables (ViviApplication * app);
-SwfdecPlayer * vivi_application_get_player (ViviApplication * app);
-gboolean vivi_application_get_interrupted(ViviApplication * app);
-gboolean vivi_application_is_quit (ViviApplication * app);
-
-void vivi_application_reset (ViviApplication * app);
-void vivi_application_play (ViviApplication * app);
-void vivi_application_stop (ViviApplication * app);
-void vivi_application_step (ViviApplication * app,
- guint n_times);
-void vivi_application_quit (ViviApplication * app);
-
-void vivi_application_execute (ViviApplication * app,
- const char * command);
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_application_as.c b/vivified/core/vivi_application_as.c
deleted file mode 100644
index 2f9ec6e..0000000
--- a/vivified/core/vivi_application_as.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Vivified
- * 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 "vivi_application.h"
-#include "vivi_function.h"
-
-VIVI_FUNCTION ("reset", vivi_application_as_reset)
-void
-vivi_application_as_reset (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- vivi_application_reset (app);
-}
-
-VIVI_FUNCTION ("run", vivi_application_as_run)
-void
-vivi_application_as_run (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- vivi_application_play (app);
-}
-
-VIVI_FUNCTION ("stop", vivi_application_as_stop)
-void
-vivi_application_as_stop (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- vivi_application_stop (app);
-}
-
-VIVI_FUNCTION ("step", vivi_application_as_step)
-void
-vivi_application_as_step (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- int steps;
-
- if (argc > 0) {
- steps = swfdec_as_value_to_integer (cx, &argv[0]);
- if (steps <= 1)
- steps = 1;
- } else {
- steps = 1;
- }
- vivi_application_step (app, steps);
-}
-
-VIVI_FUNCTION ("print", vivi_application_as_print)
-void
-vivi_application_as_print (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s;
-
- if (argc == 0)
- return;
-
- s = swfdec_as_value_to_string (cx, &argv[0]);
- vivi_application_output (app, "%s", s);
-}
-
-VIVI_FUNCTION ("error", vivi_application_as_error)
-void
-vivi_application_as_error (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s;
-
- if (argc == 0)
- return;
-
- s = swfdec_as_value_to_string (cx, &argv[0]);
- vivi_application_error (app, "%s", s);
-}
-
-VIVI_FUNCTION ("quit", vivi_application_as_quit)
-void
-vivi_application_as_quit (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- vivi_application_quit (app);
-}
-
diff --git a/vivified/core/vivi_breakpoint.c b/vivified/core/vivi_breakpoint.c
deleted file mode 100644
index 627c3b7..0000000
--- a/vivified/core/vivi_breakpoint.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Vivified
- * Copyright (C) 2007-2008 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 "vivi_breakpoint.h"
-#include "vivi_application.h"
-#include "vivi_function.h"
-#include "vivi_wrap.h"
-
-G_DEFINE_TYPE (ViviBreakpoint, vivi_breakpoint, SWFDEC_TYPE_AS_RELAY)
-
-static gboolean
-vivi_breakpoint_step (ViviDebugger *debugger, ViviBreakpoint *breakpoint)
-{
- SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint);
- SwfdecAsValue retval;
-
- swfdec_as_object_call (obj, swfdec_as_context_get_string (swfdec_gc_object_get_context (obj), "onCommand"), 0, NULL, &retval);
- return swfdec_as_value_to_boolean (swfdec_gc_object_get_context (obj), &retval);
-}
-
-static gboolean
-vivi_breakpoint_enter_frame (ViviDebugger *debugger, SwfdecAsFrame *frame, ViviBreakpoint *breakpoint)
-{
- SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint);
- SwfdecAsValue val;
- SwfdecAsValue retval;
-
- SWFDEC_AS_VALUE_SET_OBJECT (&val, vivi_wrap_object (VIVI_APPLICATION (swfdec_gc_object_get_context (obj)), SWFDEC_AS_OBJECT (frame)));
- swfdec_as_object_call (obj, swfdec_as_context_get_string (swfdec_gc_object_get_context (obj), "onEnterFrame"), 1, &val, &retval);
- return swfdec_as_value_to_boolean (swfdec_gc_object_get_context (obj), &retval);
-}
-
-static gboolean
-vivi_breakpoint_leave_frame (ViviDebugger *debugger, SwfdecAsFrame *frame, const SwfdecAsValue *ret, ViviBreakpoint *breakpoint)
-{
- SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint);
- SwfdecAsValue vals[2];
- SwfdecAsValue retval;
-
- SWFDEC_AS_VALUE_SET_OBJECT (&vals[0], vivi_wrap_object (VIVI_APPLICATION (swfdec_gc_object_get_context (obj)), SWFDEC_AS_OBJECT (frame)));
- vivi_wrap_value (VIVI_APPLICATION (swfdec_gc_object_get_context (obj)), &vals[1], ret);
- swfdec_as_object_call (obj, swfdec_as_context_get_string (swfdec_gc_object_get_context (obj), "onLeaveFrame"), 2, vals, &retval);
- return swfdec_as_value_to_boolean (swfdec_gc_object_get_context (obj), &retval);
-}
-
-static gboolean
-vivi_breakpoint_set_variable (ViviDebugger *debugger, SwfdecAsObject *object,
- const char *variable, const SwfdecAsValue *value, ViviBreakpoint *breakpoint)
-{
- SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint);
- SwfdecAsValue vals[3];
- SwfdecAsValue retval;
-
- SWFDEC_AS_VALUE_SET_OBJECT (&vals[0], vivi_wrap_object (VIVI_APPLICATION (swfdec_gc_object_get_context (obj)), object));
- SWFDEC_AS_VALUE_SET_STRING (&vals[1], swfdec_as_context_get_string (swfdec_gc_object_get_context (obj), variable));
- vivi_wrap_value (VIVI_APPLICATION (swfdec_gc_object_get_context (obj)), &vals[2], value);
- swfdec_as_object_call (obj, swfdec_as_context_get_string (swfdec_gc_object_get_context (obj), "onSetVariable"), 3, vals, &retval);
- return swfdec_as_value_to_boolean (swfdec_gc_object_get_context (obj), &retval);
-}
-
-static const struct {
- const char * event;
- const char * signal;
- GCallback handler;
-} events[] = {
- { NULL, NULL, NULL }, /* invalid */
- { "onCommand", "step", G_CALLBACK (vivi_breakpoint_step) },
- { "onEnterFrame", "enter-frame", G_CALLBACK (vivi_breakpoint_enter_frame) },
- { "onLeaveFrame", "leave-frame", G_CALLBACK (vivi_breakpoint_leave_frame) },
- { "onSetVariable", "set-variable", G_CALLBACK (vivi_breakpoint_set_variable) }
-};
-
-static void
-vivi_breakpoint_add (ViviBreakpoint *breakpoint, guint i)
-{
- ViviDebugger *debugger = VIVI_APPLICATION (swfdec_gc_object_get_context (breakpoint))->debugger;
-
- g_assert (i != 0);
- if (breakpoint->active) {
- breakpoint->handlers[i] = g_signal_connect (debugger, events[i].signal,
- events[i].handler, breakpoint);
- } else {
- breakpoint->handlers[i] = 1;
- }
-}
-
-static void
-vivi_breakpoint_remove (ViviBreakpoint *breakpoint, guint i)
-{
- ViviDebugger *debugger = VIVI_APPLICATION (swfdec_gc_object_get_context (breakpoint))->debugger;
-
- g_assert (i != 0);
- if (breakpoint->active)
- g_signal_handler_disconnect (debugger, breakpoint->handlers[i]);
- breakpoint->handlers[i] = 0;
-}
-
-static void
-vivi_breakpoint_dispose (GObject *object)
-{
- ViviBreakpoint *breakpoint = VIVI_BREAKPOINT (object);
-
- vivi_breakpoint_set_active (breakpoint, FALSE);
-
- G_OBJECT_CLASS (vivi_breakpoint_parent_class)->dispose (object);
-}
-
-static void
-vivi_breakpoint_class_init (ViviBreakpointClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = vivi_breakpoint_dispose;
-}
-
-static void
-vivi_breakpoint_init (ViviBreakpoint *breakpoint)
-{
- breakpoint->active = TRUE;
-}
-
-void
-vivi_breakpoint_set_active (ViviBreakpoint *breakpoint, gboolean active)
-{
- guint i;
-
- g_return_if_fail (VIVI_IS_BREAKPOINT (breakpoint));
-
- g_print ("active = %d", active);
- if (breakpoint->active == active)
- return;
- breakpoint->active = !breakpoint->active;
- for (i = 1; i < G_N_ELEMENTS (events); i++) {
- if (breakpoint->handlers[i] == 0)
- continue;
- /* FIXME: this is hacky */
- breakpoint->active = !breakpoint->active;
- vivi_breakpoint_remove (breakpoint, i);
- breakpoint->active = !breakpoint->active;
- vivi_breakpoint_add (breakpoint, i);
- }
-}
-
-/*** AS CODE ***/
-
-VIVI_FUNCTION ("breakpoint_active_get", vivi_breakpoint_as_get_active)
-void
-vivi_breakpoint_as_get_active (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- if (!VIVI_IS_BREAKPOINT (this))
- return;
-
- SWFDEC_AS_VALUE_SET_BOOLEAN (retval, VIVI_BREAKPOINT (this)->active);
-}
-
-VIVI_FUNCTION ("breakpoint_active_set", vivi_breakpoint_as_set_active)
-void
-vivi_breakpoint_as_set_active (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- if (!VIVI_IS_BREAKPOINT (this) ||
- argc == 0)
- return;
- vivi_breakpoint_set_active (VIVI_BREAKPOINT (this), swfdec_as_value_to_boolean (cx, &argv[0]));
-}
-
diff --git a/vivified/core/vivi_breakpoint.h b/vivified/core/vivi_breakpoint.h
deleted file mode 100644
index 3b25274..0000000
--- a/vivified/core/vivi_breakpoint.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Vivified
- * Copyright (C) 2007-2008 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 _VIVI_BREAKPOINT_H_
-#define _VIVI_BREAKPOINT_H_
-
-#include <swfdec/swfdec.h>
-#include <vivified/core/vivi_application.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviBreakpoint ViviBreakpoint;
-typedef struct _ViviBreakpointClass ViviBreakpointClass;
-
-#define VIVI_TYPE_BREAKPOINT (vivi_breakpoint_get_type())
-#define VIVI_IS_BREAKPOINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_BREAKPOINT))
-#define VIVI_IS_BREAKPOINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_BREAKPOINT))
-#define VIVI_BREAKPOINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_BREAKPOINT, ViviBreakpoint))
-#define VIVI_BREAKPOINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_BREAKPOINT, ViviBreakpointClass))
-#define VIVI_BREAKPOINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_BREAKPOINT, ViviBreakpointClass))
-
-struct _ViviBreakpoint
-{
- SwfdecAsRelay relay;
-
- gboolean active; /* only active breakpoints receive events */
- gulong handlers[5]; /* handlers for every signal of the debugger or 0 */
-};
-
-struct _ViviBreakpointClass
-{
- SwfdecAsRelayClass relay_class;
-};
-
-GType vivi_breakpoint_get_type (void);
-
-void vivi_breakpoint_set_active (ViviBreakpoint * breakpoint,
- gboolean active);
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_debugger.c b/vivified/core/vivi_debugger.c
deleted file mode 100644
index 508b27e..0000000
--- a/vivified/core/vivi_debugger.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* Vivified
- * 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 "vivi_debugger.h"
-#include "vivi_application.h"
-#include "vivi_marshal.h"
-/* FIXME: oops */
-#include "swfdec/swfdec_player_internal.h"
-
-enum {
- ADD,
- REMOVE,
- STEP,
- ENTER_FRAME,
- LEAVE_FRAME,
- SET_VARIABLE,
- LAST_SIGNAL
-};
-
-G_DEFINE_TYPE (ViviDebugger, vivi_debugger, SWFDEC_TYPE_AS_DEBUGGER)
-static guint signals[LAST_SIGNAL] = { 0, };
-
-static gboolean
-vivi_accumulate_or (GSignalInvocationHint *ihint, GValue *return_accu,
- const GValue *handler_return, gpointer data)
-{
- if (g_value_get_boolean (handler_return))
- g_value_set_boolean (return_accu, TRUE);
- return TRUE;
-}
-
-static void
-vivi_debugger_dispose (GObject *object)
-{
- //ViviDebugger *debugger = VIVI_DEBUGGER (object);
-
- G_OBJECT_CLASS (vivi_debugger_parent_class)->dispose (object);
-}
-
-static void
-vivi_debugger_break (ViviDebugger *debugger)
-{
- ViviApplication *app = debugger->app;
- SwfdecPlayer *player = app->player;
-
- g_assert (app);
- if (app->playback_state == VIVI_APPLICATION_EXITING)
- return;
- if (app->playback_state == VIVI_APPLICATION_PLAYING) {
- app->playback_count--;
- if (app->playback_count > 0)
- return;
- }
- swfdec_player_unlock_soft (player);
-
- app->playback_state = 0;
- app->playback_count = 0;
- app->loop = g_main_loop_new (NULL, FALSE);
- g_object_notify (G_OBJECT (app), "interrupted");
- vivi_application_check (app);
-
- g_main_loop_run (app->loop);
-
- g_main_loop_unref (app->loop);
- app->loop = NULL;
- g_object_notify (G_OBJECT (app), "interrupted");
- vivi_application_check (app);
- swfdec_player_lock_soft (player);
-}
-
-static void
-vivi_debugger_add (SwfdecAsDebugger *debugger, SwfdecAsContext *context,
- SwfdecAsObject *object)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[ADD], 0, object, &retval);
-
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_remove (SwfdecAsDebugger *debugger, SwfdecAsContext *context,
- SwfdecAsObject *object)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[REMOVE], 0, object, &retval);
-
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_step (SwfdecAsDebugger *debugger, SwfdecAsContext *context)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[STEP], 0, &retval);
-
- if (!retval) {
- ViviApplication *app = VIVI_DEBUGGER (debugger)->app;
-
- if (app->playback_state == VIVI_APPLICATION_STEPPING) {
- app->playback_count--;
- if (app->playback_count == 0)
- retval = TRUE;
- }
- }
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_enter_frame (SwfdecAsDebugger *debugger, SwfdecAsContext *context, SwfdecAsFrame *frame)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[ENTER_FRAME], 0, frame, &retval);
-
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_leave_frame (SwfdecAsDebugger *debugger, SwfdecAsContext *context,
- SwfdecAsFrame *frame, const SwfdecAsValue *ret)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[LEAVE_FRAME], 0, frame, ret, &retval);
-
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_set_variable (SwfdecAsDebugger *debugger, SwfdecAsContext *context,
- SwfdecAsObject *object, const char *variable, const SwfdecAsValue *value)
-{
- gboolean retval = FALSE;
-
- g_signal_emit (debugger, signals[SET_VARIABLE], 0, object, variable, value, &retval);
-
- if (retval)
- vivi_debugger_break (VIVI_DEBUGGER (debugger));
-}
-
-static void
-vivi_debugger_class_init (ViviDebuggerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- SwfdecAsDebuggerClass *debugger_class = SWFDEC_AS_DEBUGGER_CLASS (klass);
-
- object_class->dispose = vivi_debugger_dispose;
-
- signals[ADD] = g_signal_new ("add", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN, 1, SWFDEC_TYPE_AS_OBJECT);
- signals[REMOVE] = g_signal_new ("remove", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN, 1, SWFDEC_TYPE_AS_OBJECT);
- signals[STEP] = g_signal_new ("step", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__VOID,
- G_TYPE_BOOLEAN, 0);
- signals[ENTER_FRAME] = g_signal_new ("enter-frame", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN, 1, G_TYPE_POINTER);
- signals[LEAVE_FRAME] = g_signal_new ("leave-frame", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__OBJECT_POINTER,
- G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_POINTER);
- signals[SET_VARIABLE] = g_signal_new ("set-variable", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, vivi_accumulate_or, NULL, vivi_marshal_BOOLEAN__OBJECT_STRING_POINTER,
- G_TYPE_BOOLEAN, 3, SWFDEC_TYPE_AS_OBJECT, G_TYPE_STRING, G_TYPE_POINTER);
-
- debugger_class->add = vivi_debugger_add;
- debugger_class->remove = vivi_debugger_remove;
- debugger_class->step = vivi_debugger_step;
- debugger_class->enter_frame = vivi_debugger_enter_frame;
- debugger_class->leave_frame = vivi_debugger_leave_frame;
- debugger_class->set_variable = vivi_debugger_set_variable;
-}
-
-static void
-vivi_debugger_init (ViviDebugger *debugger)
-{
-}
-
diff --git a/vivified/core/vivi_debugger.h b/vivified/core/vivi_debugger.h
deleted file mode 100644
index 80a6765..0000000
--- a/vivified/core/vivi_debugger.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Vivified
- * 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 _VIVI_DEBUGGER_H_
-#define _VIVI_DEBUGGER_H_
-
-#include <swfdec/swfdec.h>
-#include <vivified/core/vivi_application.h>
-
-G_BEGIN_DECLS
-
-
-//typedef struct _ViviDebugger ViviDebugger;
-typedef struct _ViviDebuggerClass ViviDebuggerClass;
-
-#define VIVI_TYPE_DEBUGGER (vivi_debugger_get_type())
-#define VIVI_IS_DEBUGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_DEBUGGER))
-#define VIVI_IS_DEBUGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_DEBUGGER))
-#define VIVI_DEBUGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_DEBUGGER, ViviDebugger))
-#define VIVI_DEBUGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_DEBUGGER, ViviDebuggerClass))
-#define VIVI_DEBUGGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_DEBUGGER, ViviDebuggerClass))
-
-struct _ViviDebugger
-{
- SwfdecAsDebugger debugger;
-
- ViviApplication * app; /* the appliction we're playing for */
-};
-
-struct _ViviDebuggerClass
-{
- SwfdecAsDebuggerClass debugger_class;
-};
-
-GType vivi_debugger_get_type (void);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_function.c b/vivified/core/vivi_function.c
deleted file mode 100644
index 0c7c73d..0000000
--- a/vivified/core/vivi_function.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Vivified
- * 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 "vivi_function.h"
-#include "vivi_breakpoint.h"
-#include "vivi_function_list.h"
-
-/* include vivi_function_list with special macro definition, so we get a nice
- * way to initialize it */
-#undef VIVI_FUNCTION
-#define VIVI_FUNCTION(name, fun) \
- { name, fun },
-static const struct {
- const char * name;
- SwfdecAsNative fun;
-} functions[] = {
-#include "vivi_function_list.h"
- { NULL, NULL }
-};
-#undef VIVI_FUNCTION
-
-/* defined in vivi_initialize.s */
-extern const char vivi_initialize[];
-
-static void
-vivi_function_not_reached (ViviApplication *app, guint type, char *message, gpointer unused)
-{
- if (type == VIVI_MESSAGE_ERROR)
- g_error ("%s", message);
-}
-
-void
-vivi_function_init_context (ViviApplication *app)
-{
- SwfdecAsContext *cx = SWFDEC_AS_CONTEXT (app);
- SwfdecAsObject *obj;
- SwfdecAsValue val;
- guint i;
-
- obj = swfdec_as_object_new (cx, NULL);
- SWFDEC_AS_VALUE_SET_OBJECT (&val, obj);
- swfdec_as_object_set_variable (cx->global,
- swfdec_as_context_get_string (cx, "Native"), &val);
-
- for (i = 0; functions[i].name; i++) {
- swfdec_as_object_add_function (obj,
- swfdec_as_context_get_string (cx, functions[i].name),
- functions[i].fun);
- }
-
- g_signal_connect (app, "message", G_CALLBACK (vivi_function_not_reached), NULL);
- vivi_application_execute (app, vivi_initialize);
- g_signal_handlers_disconnect_by_func (app, G_CALLBACK (vivi_function_not_reached), NULL);
-}
-
diff --git a/vivified/core/vivi_function.h b/vivified/core/vivi_function.h
deleted file mode 100644
index f1d497c..0000000
--- a/vivified/core/vivi_function.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Vivified
- * 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
- */
-
-#include <swfdec/swfdec.h>
-#include <vivified/core/vivi_application.h>
-
-#ifndef _VIVI_FUNCTION_H_
-#define _VIVI_FUNCTION_H_
-
-G_BEGIN_DECLS
-
-
-#define VIVI_FUNCTION(name, fun) \
- void fun (SwfdecAsContext *cx, SwfdecAsObject *this, guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval);
-
-void vivi_function_init_context (ViviApplication * app);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_initialize.as b/vivified/core/vivi_initialize.as
deleted file mode 100644
index bbab5b6..0000000
--- a/vivified/core/vivi_initialize.as
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Vivified
- * 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
- */
-
-/*** general objects ***/
-
-Wrap = function () {};
-Wrap.prototype = {};
-Wrap.prototype.get = Native.wrap_get;
-Wrap.prototype.toString = Native.wrap_toString;
-
-Frame = function () extends Wrap {};
-Frame.prototype = new Wrap ();
-Frame.prototype.addProperty ("code", Native.frame_code_get, null);
-Frame.prototype.addProperty ("name", Native.frame_name_get, null);
-Frame.prototype.addProperty ("next", Native.frame_next_get, null);
-Frame.prototype.addProperty ("this", Native.frame_this_get, null);
-
-/*** breakpoints ***/
-
-Breakpoint = function () extends Native.Breakpoint {
- super ();
- Breakpoint.list.push (this);
-};
-Breakpoint.list = new Array ();
-Breakpoint.prototype.addProperty ("active", Native.breakpoint_active_get, Native.breakpoint_active_set);
-Breakpoint.prototype.toString = function () {
- return "user-defined breakpoint";
-};
-
-/*** information about the player ***/
-
-Player = {};
-Player.addProperty ("filename", Native.player_filename_get, Native.player_filename_set);
-Player.addProperty ("frame", Native.player_frame_get, null);
-Player.addProperty ("global", Native.player_global_get, null);
-Player.addProperty ("sound", Native.player_sound_get, Native.player_sound_set);
-Player.addProperty ("variables", Native.player_variables_get, Native.player_variables_set);
-
-/*** commands available for debugging ***/
-
-Commands = new Object ();
-Commands.print = Native.print;
-Commands.error = Native.error;
-Commands.r = Native.run;
-Commands.run = Native.run;
-Commands.halt = Native.stop;
-Commands.stop = Native.stop;
-Commands.s = Native.step;
-Commands.step = Native.step;
-Commands.reset = Native.reset;
-Commands.restart = function () {
- Commands.reset ();
- Commands.run ();
-};
-Commands.quit = Native.quit;
-/* can't use "break" as a function name, it's a keyword in JS */
-Commands.add = function (name) {
- if (name == undefined) {
- Commands.error ("add command requires a function name");
- return undefined;
- }
- var ret = new Breakpoint ();
- ret.onEnterFrame = function (frame) {
- if (frame.name != name)
- return false;
-
- Commands.print ("Breakpoint: function " + name + " called");
- Commands.print (" " + frame);
- return true;
- };
- ret.toString = function () {
- return "function call " + name;
- };
- return ret;
-};
-Commands.list = function () {
- var a = Breakpoint.list;
- var i;
- for (i = 0; i < a.length; i++) {
- Commands.print (i + ": " + a[i]);
- }
-};
-Commands.del = function (id) {
- var a = Breakpoint.list;
- if (id == undefined) {
- while (a[0])
- Commands.del (0);
- }
- var b = a[id];
- a.splice (id, 1);
- b.active = false;
-};
-Commands.delete = Commands.del;
-Commands.where = function () {
- var frame = Player.frame;
- if (frame == undefined) {
- Commands.print ("---");
- return;
- }
- var i = 0;
- while (frame) {
- Commands.print (i++ + ": " + frame);
- frame = frame.next;
- }
-};
-Commands.backtrace = Commands.where;
-Commands.bt = Commands.where;
-Commands.watch = function () {
- var object;
- var name;
- if (arguments.length == 1) {
- name = arguments[0];
- } else if (arguments.length == 2) {
- object = arguments[0];
- name = arguments[1];
- } else {
- Commands.error ("usage: watch [object] name");
- return;
- }
- var ret = new Breakpoint ();
- ret.onSetVariable = function (o, variable, value) {
- if (object && o != object)
- return false;
- if (variable != name)
- return;
-
- if (object) {
- Commands.print ("Breakpoint: variable " + name + " on " + object + " set to: " + value);
- } else {
- Commands.print ("Breakpoint: variable " + name + " set to: " + value);
- }
- Commands.print (" " + Player.frame);
- return true;
- };
- ret.toString = function () {
- var s = "watch " + name;
- if (object)
- s += " on " + object;
- return s;
- };
- return ret;
-};
diff --git a/vivified/core/vivi_initialize.s b/vivified/core/vivi_initialize.s
deleted file mode 100644
index eec00c6..0000000
--- a/vivified/core/vivi_initialize.s
+++ /dev/null
@@ -1,7 +0,0 @@
-.section ".rodata"
-.global vivi_initialize
- .type vivi_initialize, at object
- .size vivi_initialize, .-vivi_initialize
-vivi_initialize:
-.incbin "vivi_initialize.as"
-.byte 0
diff --git a/vivified/core/vivi_marshal.list b/vivified/core/vivi_marshal.list
deleted file mode 100644
index e28004f..0000000
--- a/vivified/core/vivi_marshal.list
+++ /dev/null
@@ -1,4 +0,0 @@
-BOOLEAN:OBJECT
-BOOLEAN:OBJECT,POINTER
-BOOLEAN:OBJECT,STRING,POINTER
-BOOLEAN:VOID
diff --git a/vivified/core/vivi_ming.c b/vivified/core/vivi_ming.c
deleted file mode 100644
index ed0102d..0000000
--- a/vivified/core/vivi_ming.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Vivified
- * 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 "vivi_ming.h"
-#include <string.h>
-
-static GString *ming_errors = NULL;
-
-static void
-vivi_ming_error (const char *format, ...)
-{
- va_list varargs;
- char *s;
-
- if (ming_errors) {
- g_string_append_c (ming_errors, '\n');
- } else {
- ming_errors = g_string_new ("");
- }
- va_start (varargs, format);
- g_string_append_vprintf (ming_errors, format, varargs);
- s = g_strdup_vprintf (format, varargs);
- va_end (varargs);
-}
-
-static char *
-vivi_ming_get_error (void)
-{
- char *ret;
-
- if (ming_errors == NULL)
- return g_strdup ("Unknown error");
-
- ret = g_string_free (ming_errors, FALSE);
- ming_errors = NULL;
- return ret;
-}
-
-static void
-vivi_ming_clear_error (void)
-{
- char *ret;
-
- if (ming_errors != NULL) {
- ret = vivi_ming_get_error ();
- g_free (ret);
- }
-}
-
-static void
-vivi_ming_init (void)
-{
- static gboolean ming_inited = FALSE;
-
- if (ming_inited)
- return;
-
- ming_inited = TRUE;
-
- Ming_init ();
- Ming_useSWFVersion (8);
- Ming_setErrorFunction (vivi_ming_error);
- Ming_setWarnFunction (vivi_ming_error);
-}
-
-SwfdecScript *
-vivi_ming_compile (const char *code, char **error)
-{
- byte *data;
- SWFAction action;
- int len;
- SwfdecBuffer *buffer;
- SwfdecScript *script;
-
- vivi_ming_init ();
-
- action = newSWFAction (code);
- data = SWFAction_getByteCode (action, &len);
- if (data == NULL || len <= 1) {
- if (error)
- *error = vivi_ming_get_error ();
- script = NULL;
- } else {
- buffer = swfdec_buffer_new (len);
- memcpy (buffer->data, data, len);
- script = swfdec_script_new (buffer, "compiled script", 8);
- }
- vivi_ming_clear_error ();
- return script;
-}
-
diff --git a/vivified/core/vivi_ming.h b/vivified/core/vivi_ming.h
deleted file mode 100644
index f33eb5a..0000000
--- a/vivified/core/vivi_ming.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Vivified
- * 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
- */
-
-#include <swfdec/swfdec.h>
-#include <ming.h>
-
-#ifndef _VIVI_MING_H_
-#define _VIVI_MING_H_
-
-G_BEGIN_DECLS
-
-
-SwfdecScript * vivi_ming_compile (const char * code,
- char ** error);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_player_as.c b/vivified/core/vivi_player_as.c
deleted file mode 100644
index f2d79e8..0000000
--- a/vivified/core/vivi_player_as.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Vivified
- * 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 "vivi_wrap.h"
-#include "vivi_application.h"
-#include "vivi_function.h"
-#include <swfdec-gtk/swfdec-gtk.h>
-
-VIVI_FUNCTION ("player_frame_get", vivi_player_as_frame_get)
-void
-vivi_player_as_frame_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- SwfdecAsObject *obj;
-
- obj = SWFDEC_AS_OBJECT (swfdec_as_context_get_frame (SWFDEC_AS_CONTEXT (app->player)));
- if (obj)
- SWFDEC_AS_VALUE_SET_OBJECT (retval, vivi_wrap_object (app, obj));
-}
-
-VIVI_FUNCTION ("player_filename_get", vivi_player_as_filename_get)
-void
-vivi_player_as_filename_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s = vivi_application_get_filename (app);
-
- if (s)
- SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_get_string (cx, s));
-}
-
-VIVI_FUNCTION ("player_filename_set", vivi_player_as_filename_set)
-void
-vivi_player_as_filename_set (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s;
-
- if (argc == 0)
- return;
- s = swfdec_as_value_to_string (cx, &argv[0]);
-
- vivi_application_set_filename (app, s);
-}
-
-VIVI_FUNCTION ("player_variables_get", vivi_player_as_variables_get)
-void
-vivi_player_as_variables_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s = vivi_application_get_variables (app);
-
- if (s)
- SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_get_string (cx, s));
-}
-
-VIVI_FUNCTION ("player_variables_set", vivi_player_as_variables_set)
-void
-vivi_player_as_variables_set (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- const char *s;
-
- if (argc == 0)
- return;
- s = swfdec_as_value_to_string (cx, &argv[0]);
-
- vivi_application_set_variables (app, s);
-}
-
-VIVI_FUNCTION ("player_global_get", vivi_player_as_global_get)
-void
-vivi_player_as_global_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- if (SWFDEC_AS_CONTEXT (app->player)->global) {
- SWFDEC_AS_VALUE_SET_OBJECT (retval, vivi_wrap_object (app,
- SWFDEC_AS_CONTEXT (app->player)->global));
- }
-}
-
-VIVI_FUNCTION ("player_sound_get", vivi_player_as_sound_get)
-void
-vivi_player_as_sound_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- SWFDEC_AS_VALUE_SET_BOOLEAN (retval,
- swfdec_gtk_player_get_audio_enabled (SWFDEC_GTK_PLAYER (app->player)));
-}
-
-VIVI_FUNCTION ("player_sound_set", vivi_player_as_sound_set)
-void
-vivi_player_as_sound_set (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
-
- if (argc == 0)
- return;
- swfdec_gtk_player_set_audio_enabled (SWFDEC_GTK_PLAYER (app->player),
- swfdec_as_value_to_boolean (cx, &argv[0]));
-}
-
diff --git a/vivified/core/vivi_wrap.c b/vivified/core/vivi_wrap.c
deleted file mode 100644
index 141f2e5..0000000
--- a/vivified/core/vivi_wrap.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Vivified
- * 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 "vivi_wrap.h"
-#include "vivi_application.h"
-
-G_DEFINE_TYPE (ViviWrap, vivi_wrap, SWFDEC_TYPE_AS_OBJECT)
-
-static void
-vivi_wrap_dispose (GObject *object)
-{
- ViviWrap *wrap = VIVI_WRAP (object);
-
- if (wrap->wrap) {
- g_hash_table_remove (VIVI_APPLICATION (swfdec_gc_object_get_context (wrap))->wraps, wrap->wrap);
- wrap->wrap = NULL;
- }
-
- G_OBJECT_CLASS (vivi_wrap_parent_class)->dispose (object);
-}
-
-static void
-vivi_wrap_class_init (ViviWrapClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = vivi_wrap_dispose;
-}
-
-static void
-vivi_wrap_init (ViviWrap *wrap)
-{
-}
-
-SwfdecAsObject *
-vivi_wrap_object (ViviApplication *app, SwfdecAsObject *object)
-{
- SwfdecAsContext *cx;
- SwfdecAsObject *wrap;
- SwfdecAsValue val;
-
- wrap = g_hash_table_lookup (app->wraps, object);
- if (wrap)
- return wrap;
-
- cx = SWFDEC_AS_CONTEXT (app);
- wrap = g_object_new (VIVI_TYPE_WRAP, "context", cx, NULL);
- swfdec_as_object_get_variable (cx->global, swfdec_as_context_get_string (cx, "Wrap"), &val);
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
- swfdec_as_object_set_constructor (wrap, SWFDEC_AS_VALUE_GET_OBJECT (&val));
- VIVI_WRAP (wrap)->wrap = object;
- g_hash_table_insert (app->wraps, object, wrap);
- return wrap;
-}
-
-void
-vivi_wrap_value (ViviApplication *app, SwfdecAsValue *dest, const SwfdecAsValue *src)
-{
- g_return_if_fail (VIVI_IS_APPLICATION (app));
- g_return_if_fail (dest != NULL);
- g_return_if_fail (SWFDEC_IS_AS_VALUE (src));
-
- switch (src->type) {
- case SWFDEC_AS_TYPE_UNDEFINED:
- case SWFDEC_AS_TYPE_BOOLEAN:
- case SWFDEC_AS_TYPE_NUMBER:
- case SWFDEC_AS_TYPE_NULL:
- *dest = *src;
- break;
- case SWFDEC_AS_TYPE_STRING:
- SWFDEC_AS_VALUE_SET_STRING (dest,
- swfdec_as_context_get_string (SWFDEC_AS_CONTEXT (app),
- SWFDEC_AS_VALUE_GET_STRING (src)));
- break;
- case SWFDEC_AS_TYPE_OBJECT:
- SWFDEC_AS_VALUE_SET_OBJECT (dest,
- vivi_wrap_object (app, SWFDEC_AS_VALUE_GET_OBJECT (src)));
- break;
- case SWFDEC_AS_TYPE_MOVIE:
- case SWFDEC_AS_TYPE_INT:
- default:
- g_assert_not_reached ();
- break;
- }
-}
-
diff --git a/vivified/core/vivi_wrap.h b/vivified/core/vivi_wrap.h
deleted file mode 100644
index 9f0aec0..0000000
--- a/vivified/core/vivi_wrap.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Vivified
- * 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 _VIVI_WRAP_H_
-#define _VIVI_WRAP_H_
-
-#include <swfdec/swfdec.h>
-#include <vivified/core/vivi_application.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviWrap ViviWrap;
-typedef struct _ViviWrapClass ViviWrapClass;
-
-#define VIVI_TYPE_WRAP (vivi_wrap_get_type())
-#define VIVI_IS_WRAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_WRAP))
-#define VIVI_IS_WRAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_WRAP))
-#define VIVI_WRAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_WRAP, ViviWrap))
-#define VIVI_WRAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_WRAP, ViviWrapClass))
-#define VIVI_WRAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_WRAP, ViviWrapClass))
-
-struct _ViviWrap
-{
- SwfdecAsObject object;
-
- SwfdecAsObject * wrap; /* the object we wrap */
-};
-
-struct _ViviWrapClass
-{
- SwfdecAsObjectClass object_class;
-};
-
-GType vivi_wrap_get_type (void);
-
-SwfdecAsObject * vivi_wrap_object (ViviApplication * app,
- SwfdecAsObject * object);
-void vivi_wrap_value (ViviApplication * app,
- SwfdecAsValue * dest,
- const SwfdecAsValue * src);
-
-G_END_DECLS
-#endif
diff --git a/vivified/core/vivi_wrap_as.c b/vivified/core/vivi_wrap_as.c
deleted file mode 100644
index 52deceb..0000000
--- a/vivified/core/vivi_wrap_as.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Vivified
- * 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 "vivi_wrap.h"
-#include "vivi_application.h"
-#include "vivi_function.h"
-
-VIVI_FUNCTION ("wrap_toString", vivi_wrap_toString)
-void
-vivi_wrap_toString (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviWrap *wrap;
-
- if (!VIVI_IS_WRAP (this))
- return;
-
- wrap = VIVI_WRAP (this);
- if (wrap->wrap == NULL)
- return;
-
- SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_get_string (cx, "Here be debugging output"));
-}
-
-VIVI_FUNCTION ("wrap_get", vivi_wrap_get)
-void
-vivi_wrap_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- ViviApplication *app = VIVI_APPLICATION (cx);
- ViviWrap *wrap;
- SwfdecAsValue val;
- const char *name;
-
- if (!VIVI_IS_WRAP (this) || argc == 0)
- return;
- wrap = VIVI_WRAP (this);
- if (wrap->wrap == NULL)
- return;
-
- name = swfdec_as_value_to_string (cx, &argv[0]);
- swfdec_as_object_get_variable (wrap->wrap,
- swfdec_as_context_get_string (SWFDEC_AS_CONTEXT (app->player), name),
- &val);
- vivi_wrap_value (app, retval, &val);
-}
-
-/*** FRAME specific code ***/
-
-VIVI_FUNCTION ("frame_name_get", vivi_wrap_name_get)
-void
-vivi_wrap_name_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-#if 0
- ViviWrap *wrap;
- char *s;
-
- if (!VIVI_IS_WRAP (this))
- return;
-
- wrap = VIVI_WRAP (this);
-
- /* FIXME: improve */
- s = swfdec_as_object_get_debug (wrap->wrap);
- SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_give_string (cx, s));
-#endif
-}
-
-VIVI_FUNCTION ("frame_code_get", vivi_wrap_code_get)
-void
-vivi_wrap_code_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-#if 0
- ViviWrap *wrap;
- SwfdecScript *script;
-
- if (!VIVI_IS_WRAP (this))
- return;
-
- wrap = VIVI_WRAP (this);
- if (!SWFDEC_IS_AS_FRAME (wrap->wrap))
- return;
-
- script = swfdec_as_frame_get_script (SWFDEC_AS_FRAME (wrap->wrap));
- /* FIXME: wrap scripts */
- if (script)
- SWFDEC_AS_VALUE_SET_BOOLEAN (retval, TRUE);
-#endif
-}
-
-VIVI_FUNCTION ("frame_next_get", vivi_wrap_next_get)
-void
-vivi_wrap_next_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-#if 0
- ViviWrap *wrap;
- SwfdecAsObject *obj;
-
- if (!VIVI_IS_WRAP (this))
- return;
-
- wrap = VIVI_WRAP (this);
- if (!SWFDEC_IS_AS_FRAME (wrap->wrap))
- return;
-
- obj = SWFDEC_AS_OBJECT (swfdec_as_frame_get_next (SWFDEC_AS_FRAME (wrap->wrap)));
- if (obj)
- SWFDEC_AS_VALUE_SET_OBJECT (retval, vivi_wrap_object (VIVI_APPLICATION (cx), obj));
-#endif
-}
-
-VIVI_FUNCTION ("frame_this_get", vivi_wrap_this_get)
-void
-vivi_wrap_this_get (SwfdecAsContext *cx, SwfdecAsObject *this,
- guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
-#if 0
- ViviWrap *wrap;
- SwfdecAsObject *obj;
-
- if (!VIVI_IS_WRAP (this))
- return;
-
- wrap = VIVI_WRAP (this);
- if (!SWFDEC_IS_AS_FRAME (wrap->wrap))
- return;
-
- obj = SWFDEC_AS_OBJECT (swfdec_as_frame_get_this (SWFDEC_AS_FRAME (wrap->wrap)));
- if (obj)
- SWFDEC_AS_VALUE_SET_OBJECT (retval, vivi_wrap_object (VIVI_APPLICATION (cx), obj));
-#endif
-}
-
-
diff --git a/vivified/core/vivified-core.h b/vivified/core/vivified-core.h
deleted file mode 100644
index 34a3fca..0000000
--- a/vivified/core/vivified-core.h
+++ /dev/null
@@ -1,25 +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 __VIVIFIED_CORE_H__
-#define __VIVIFIED_CORE_H__
-
-#include <vivified/core/vivi_application.h>
-
-#endif
diff --git a/vivified/dock/.gitignore b/vivified/dock/.gitignore
deleted file mode 100644
index b580c89..0000000
--- a/vivified/dock/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-*.loT
diff --git a/vivified/dock/Makefile.am b/vivified/dock/Makefile.am
deleted file mode 100644
index 590e5cf..0000000
--- a/vivified/dock/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-noinst_LTLIBRARIES = libvivified-dock.la
-
-libvivified_dock_la_CFLAGS = $(GLOBAL_CFLAGS) $(GTK_CFLAGS)
-libvivified_dock_la_LDFLAGS = $(GTK_LIBS)
-
-libvivified_dock_la_SOURCES = \
- vivi_docker.c \
- vivi_docklet.c \
- vivi_vdock.c
-
-noinst_HEADERS = \
- vivi_docker.h \
- vivi_docklet.h \
- vivi_vdock.h \
- vivified-dock.h
diff --git a/vivified/dock/vivi_docker.c b/vivified/dock/vivi_docker.c
deleted file mode 100644
index 90a0de9..0000000
--- a/vivified/dock/vivi_docker.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Vivified
- * 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 "vivi_docker.h"
-
-enum {
- REQUEST_CLOSE,
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL] = { 0, };
-
-G_DEFINE_TYPE (ViviDocker, vivi_docker, GTK_TYPE_EXPANDER)
-
-static void
-vivi_docker_dispose (GObject *object)
-{
- //ViviDocker *docker = VIVI_DOCKER (object);
-
- G_OBJECT_CLASS (vivi_docker_parent_class)->dispose (object);
-}
-
-static void
-vivi_docker_class_init (ViviDockerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = vivi_docker_dispose;
-
- signals[REQUEST_CLOSE] = 0;
-}
-
-static void
-vivi_docker_init (ViviDocker *docker)
-{
-}
-
-static void
-vivi_docker_docklet_notify_title (ViviDocklet *docklet, GParamSpec *pspec, GtkLabel *label)
-{
- gtk_label_set_text (label, vivi_docklet_get_title (docklet));
-}
-
-static void
-vivi_docker_set_docklet (ViviDocker *docker, ViviDocklet *docklet)
-{
- GtkWidget *box, *widget;
-
- g_return_if_fail (VIVI_IS_DOCKER (docker));
- g_return_if_fail (VIVI_IS_DOCKLET (docklet));
-
- box = gtk_hbox_new (FALSE, 3);
- gtk_widget_show (box);
- widget = gtk_label_new (vivi_docklet_get_title (docklet));
- gtk_widget_show (widget);
- g_signal_connect (docklet, "notify::title", G_CALLBACK (vivi_docker_docklet_notify_title), widget);
- gtk_box_pack_start (GTK_BOX (box), widget, TRUE, TRUE, 0);
- gtk_expander_set_label_widget (GTK_EXPANDER (docker), box);
- gtk_container_add (GTK_CONTAINER (docker), GTK_WIDGET (docklet));
-}
-
-GtkWidget *
-vivi_docker_new (ViviDocklet *docklet)
-{
- GtkWidget *widget;
-
- g_return_val_if_fail (VIVI_IS_DOCKLET (docklet), NULL);
-
- widget = g_object_new (VIVI_TYPE_DOCKER, "expanded", TRUE, NULL);
- vivi_docker_set_docklet (VIVI_DOCKER (widget), docklet);
- return widget;
-}
-
-
diff --git a/vivified/dock/vivi_docker.h b/vivified/dock/vivi_docker.h
deleted file mode 100644
index 3baaf8d..0000000
--- a/vivified/dock/vivi_docker.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Vivified
- * 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 _VIVI_DOCKER_H_
-#define _VIVI_DOCKER_H_
-
-#include <gtk/gtk.h>
-#include <vivified/dock/vivi_docklet.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviDocker ViviDocker;
-typedef struct _ViviDockerClass ViviDockerClass;
-
-#define VIVI_TYPE_DOCKER (vivi_docker_get_type())
-#define VIVI_IS_DOCKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_DOCKER))
-#define VIVI_IS_DOCKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_DOCKER))
-#define VIVI_DOCKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_DOCKER, ViviDocker))
-#define VIVI_DOCKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_DOCKER, ViviDockerClass))
-#define VIVI_DOCKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_DOCKER, ViviDockerClass))
-
-struct _ViviDocker {
- GtkExpander bin;
-};
-
-struct _ViviDockerClass
-{
- GtkExpanderClass bin_class;
-
- void (* request_close) (ViviDocker * docker);
-};
-
-GType vivi_docker_get_type (void);
-
-GtkWidget * vivi_docker_new (ViviDocklet * docklet);
-
-G_END_DECLS
-#endif
diff --git a/vivified/dock/vivi_docklet.c b/vivified/dock/vivi_docklet.c
deleted file mode 100644
index f6bc015..0000000
--- a/vivified/dock/vivi_docklet.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Vivified
- * 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 "vivi_docklet.h"
-
-enum {
- PROP_0,
- PROP_TITLE,
- PROP_ICON
-};
-
-G_DEFINE_ABSTRACT_TYPE (ViviDocklet, vivi_docklet, GTK_TYPE_BIN)
-
-static void
-vivi_docklet_get_property (GObject *object, guint param_id, GValue *value,
- GParamSpec * pspec)
-{
- ViviDocklet *docklet = VIVI_DOCKLET (object);
-
- switch (param_id) {
- case PROP_TITLE:
- g_value_set_string (value, docklet->title);
- break;
- case PROP_ICON:
- g_value_set_string (value, docklet->icon);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_docklet_set_property (GObject *object, guint param_id, const GValue *value,
- GParamSpec *pspec)
-{
- ViviDocklet *docklet = VIVI_DOCKLET (object);
-
- switch (param_id) {
- case PROP_TITLE:
- vivi_docklet_set_title (docklet, g_value_get_string (value));
- break;
- case PROP_ICON:
- vivi_docklet_set_title (docklet, g_value_get_string (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_docklet_dispose (GObject *object)
-{
- ViviDocklet *docklet = VIVI_DOCKLET (object);
-
- g_free (docklet->title);
- g_free (docklet->icon);
-
- G_OBJECT_CLASS (vivi_docklet_parent_class)->dispose (object);
-}
-
-static void
-vivi_docklet_size_request (GtkWidget *widget, GtkRequisition *req)
-{
- GtkWidget *child = GTK_BIN (widget)->child;
-
- if (child) {
- gtk_widget_size_request (child, req);
- } else {
- req->width = req->height = 0;
- }
-}
-
-static void
-vivi_docklet_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- GtkWidget *child = GTK_BIN (widget)->child;
-
- GTK_WIDGET_CLASS (vivi_docklet_parent_class)->size_allocate (widget, allocation);
-
- if (child && GTK_WIDGET_VISIBLE (child)) {
- gtk_widget_size_allocate (child, allocation);
- }
-}
-
-static void
-vivi_docklet_class_init (ViviDockletClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
- object_class->dispose = vivi_docklet_dispose;
- object_class->get_property = vivi_docklet_get_property;
- object_class->set_property = vivi_docklet_set_property;
-
- g_object_class_install_property (object_class, PROP_TITLE,
- g_param_spec_string ("title", "title", "title of this docklet",
- "Unnamed", G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_ICON,
- g_param_spec_string ("icon", "icon", "name of the icon to display",
- GTK_STOCK_MISSING_IMAGE, G_PARAM_READWRITE));
-
- widget_class->size_request = vivi_docklet_size_request;
- widget_class->size_allocate = vivi_docklet_size_allocate;
-}
-
-static void
-vivi_docklet_init (ViviDocklet *docklet)
-{
- docklet->title = g_strdup ("Unnamed");
- docklet->icon = g_strdup (GTK_STOCK_MISSING_IMAGE);
-}
-
-void
-vivi_docklet_set_title (ViviDocklet *docklet, const char *title)
-{
- g_return_if_fail (VIVI_IS_DOCKLET (docklet));
- g_return_if_fail (title != NULL);
-
- g_free (docklet->title);
- docklet->title = g_strdup (title);
- g_object_notify (G_OBJECT (docklet), "title");
-}
-
-const char *
-vivi_docklet_get_title (ViviDocklet *docklet)
-{
- g_return_val_if_fail (VIVI_IS_DOCKLET (docklet), NULL);
-
- return docklet->title;
-}
-
-void
-vivi_docklet_set_icon (ViviDocklet *docklet, const char *icon)
-{
- g_return_if_fail (VIVI_IS_DOCKLET (docklet));
- g_return_if_fail (icon != NULL);
-
- g_free (docklet->icon);
- docklet->icon = g_strdup (icon);
- g_object_notify (G_OBJECT (docklet), "icon");
-}
-
-const char *
-vivi_docklet_get_icon (ViviDocklet *docklet)
-{
- g_return_val_if_fail (VIVI_IS_DOCKLET (docklet), NULL);
-
- return docklet->icon;
-}
-
diff --git a/vivified/dock/vivi_docklet.h b/vivified/dock/vivi_docklet.h
deleted file mode 100644
index 1088252..0000000
--- a/vivified/dock/vivi_docklet.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Vivified
- * 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 _VIVI_DOCKLET_H_
-#define _VIVI_DOCKLET_H_
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviDocklet ViviDocklet;
-typedef struct _ViviDockletClass ViviDockletClass;
-
-#define VIVI_TYPE_DOCKLET (vivi_docklet_get_type())
-#define VIVI_IS_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_DOCKLET))
-#define VIVI_IS_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_DOCKLET))
-#define VIVI_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_DOCKLET, ViviDocklet))
-#define VIVI_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_DOCKLET, ViviDockletClass))
-#define VIVI_DOCKLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_DOCKLET, ViviDockletClass))
-
-struct _ViviDocklet {
- GtkBin bin;
-
- char * title; /* title to be used */
- char * icon; /* name of icon for docklet or "gtk-missing-image" */
-};
-
-struct _ViviDockletClass
-{
- GtkBinClass bin_class;
-};
-
-GType vivi_docklet_get_type (void);
-
-void vivi_docklet_set_title (ViviDocklet * docklet,
- const char * titlename);
-const char * vivi_docklet_get_title (ViviDocklet * docklet);
-void vivi_docklet_set_icon (ViviDocklet * docklet,
- const char * titlename);
-const char * vivi_docklet_get_icon (ViviDocklet * docklet);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/dock/vivi_vdock.c b/vivified/dock/vivi_vdock.c
deleted file mode 100644
index a7a4b34..0000000
--- a/vivified/dock/vivi_vdock.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Vivified
- * 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 "vivi_vdock.h"
-#include "vivi_docker.h"
-#include "vivi_docklet.h"
-
-G_DEFINE_TYPE (ViviVDock, vivi_vdock, GTK_TYPE_BIN)
-
-static void
-vivi_vdock_destroy (GtkObject *object)
-{
- ViviVDock *vdock = VIVI_VDOCK (object);
-
- GTK_OBJECT_CLASS (vivi_vdock_parent_class)->destroy (object);
-
- g_list_free (vdock->docklets);
- vdock->docklets = NULL;
-}
-
-static void
-vivi_vdock_size_request (GtkWidget *widget, GtkRequisition *req)
-{
- GtkWidget *child = GTK_BIN (widget)->child;
-
- if (child) {
- gtk_widget_size_request (child, req);
- } else {
- req->width = req->height = 0;
- }
-}
-
-static void
-vivi_vdock_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
- GtkWidget *child = GTK_BIN (widget)->child;
-
- GTK_WIDGET_CLASS (vivi_vdock_parent_class)->size_allocate (widget, allocation);
-
- if (child && GTK_WIDGET_VISIBLE (child)) {
- gtk_widget_size_allocate (child, allocation);
- }
-}
-
-void
-vivi_vdock_add (ViviVDock *vdock, GtkWidget *widget)
-{
- GtkWidget *docker;
-
- g_return_if_fail (VIVI_IS_VDOCK (vdock));
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- docker = vivi_docker_new (VIVI_DOCKLET (widget));
- gtk_widget_show (docker);
-
- g_object_ref (widget);
- if (vdock->docklets == NULL) {
- gtk_container_add (GTK_CONTAINER (vdock), docker);
- } else {
- /* docklet is in docker, so we need to use parent */
- GtkWidget *last = gtk_widget_get_parent (vdock->docklets->data);
- GtkWidget *parent = gtk_widget_get_parent (last);
- GtkWidget *paned;
-
- g_object_ref (last);
- gtk_container_remove (GTK_CONTAINER (parent), last);
- paned = gtk_vpaned_new ();
- gtk_paned_pack1 (GTK_PANED (paned), last, TRUE, FALSE);
- gtk_paned_pack2 (GTK_PANED (paned), docker, TRUE, FALSE);
- g_object_unref (last);
- gtk_widget_show (paned);
- if (parent == (GtkWidget *) vdock) {
- gtk_container_add (GTK_CONTAINER (vdock), paned);
- } else {
- gtk_paned_pack2 (GTK_PANED (parent), paned, TRUE, FALSE);
- }
- }
- vdock->docklets = g_list_prepend (vdock->docklets, widget);
-}
-
-void
-vivi_vdock_remove (ViviVDock *vdock, GtkWidget *widget)
-{
- GtkWidget *docker, *parent;
-
- g_return_if_fail (g_list_find (vdock->docklets, widget));
-
- docker = gtk_widget_get_parent (widget);
- parent = gtk_widget_get_parent (docker);
- if (parent == (GtkWidget *) vdock) {
- gtk_container_remove (GTK_CONTAINER (vdock), docker);
- } else {
- GtkWidget *other;
- GtkWidget *paned_parent;
- g_assert (GTK_IS_PANED (parent));
- paned_parent = gtk_widget_get_parent (parent);
- other = gtk_paned_get_child1 (GTK_PANED (parent));
- if (other == docker)
- other = gtk_paned_get_child2 (GTK_PANED (parent));
- g_object_ref (other);
- gtk_container_remove (GTK_CONTAINER (parent), docker);
- gtk_container_remove (GTK_CONTAINER (parent), other);
- if (paned_parent == (GtkWidget *) vdock) {
- gtk_container_remove (GTK_CONTAINER (vdock), parent);
- gtk_container_add (GTK_CONTAINER (vdock), other);
- } else {
- gtk_container_remove (GTK_CONTAINER (paned_parent), parent);
- gtk_paned_pack1 (GTK_PANED (parent), other, TRUE, FALSE);
- }
- g_object_unref (other);
- }
- vdock->docklets = g_list_remove (vdock->docklets, widget);
- g_object_unref (widget);
-}
-
-static void
-vivi_vdock_class_init (ViviVDockClass *klass)
-{
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
- object_class->destroy = vivi_vdock_destroy;
-
- widget_class->size_request = vivi_vdock_size_request;
- widget_class->size_allocate = vivi_vdock_size_allocate;
-}
-
-static void
-vivi_vdock_init (ViviVDock *vdock)
-{
-}
-
-GtkWidget *
-vivi_vdock_new (void)
-{
- return g_object_new (VIVI_TYPE_VDOCK, NULL);
-}
-
-
diff --git a/vivified/dock/vivi_vdock.h b/vivified/dock/vivi_vdock.h
deleted file mode 100644
index 7b0f61f..0000000
--- a/vivified/dock/vivi_vdock.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Vivified
- * 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 _VIVI_VDOCK_H_
-#define _VIVI_VDOCK_H_
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviVDock ViviVDock;
-typedef struct _ViviVDockClass ViviVDockClass;
-
-#define VIVI_TYPE_VDOCK (vivi_vdock_get_type())
-#define VIVI_IS_VDOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_VDOCK))
-#define VIVI_IS_VDOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_VDOCK))
-#define VIVI_VDOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_VDOCK, ViviVDock))
-#define VIVI_VDOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_VDOCK, ViviVDockClass))
-#define VIVI_VDOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_VDOCK, ViviVDockClass))
-
-struct _ViviVDock {
- GtkBin bin;
-
- GList * docklets; /* all the docklets that got added to us */
-};
-
-struct _ViviVDockClass
-{
- GtkBinClass bin_class;
-};
-
-GType vivi_vdock_get_type (void);
-
-GtkWidget * vivi_vdock_new (void);
-
-void vivi_vdock_add (ViviVDock * vdock,
- GtkWidget * widget);
-void vivi_vdock_remove (ViviVDock * vdock,
- GtkWidget * widget);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/dock/vivified-dock.h b/vivified/dock/vivified-dock.h
deleted file mode 100644
index 244aad8..0000000
--- a/vivified/dock/vivified-dock.h
+++ /dev/null
@@ -1,26 +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 __VIVIFIED_DOCK_H__
-#define __VIVIFIED_DOCK_H__
-
-#include <vivified/dock/vivi_docklet.h>
-#include <vivified/dock/vivi_vdock.h>
-
-#endif
diff --git a/vivified/ui/.gitignore b/vivified/ui/.gitignore
deleted file mode 100644
index 1adfd14..0000000
--- a/vivified/ui/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-*~
-CVS
-.cvsignore
-.deps
-.libs
-
-Makefile
-Makefile.in
-*.o
-*.la
-*.lo
-*.loT
-
-vivified
diff --git a/vivified/ui/Makefile.am b/vivified/ui/Makefile.am
deleted file mode 100644
index 0b63193..0000000
--- a/vivified/ui/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-noinst_PROGRAMS = vivified
-
-vivified_CFLAGS = $(GLOBAL_CFLAGS) $(SWFDEC_GTK_CFLAGS) $(VIVI_CFLAGS)
-vivified_LDFLAGS = $(VIVI_LIBS) $(SWFDEC_GTK_LIBS)
-vivified_LDADD = \
- $(top_builddir)/vivified/core/libvivified-core.la \
- $(top_builddir)/vivified/dock/libvivified-dock.la
-
-vivified_SOURCES = \
- vivi_command_line.c \
- vivi_movie_list.c \
- vivi_movies.c \
- vivi_player.c \
- vivi_vivi_docklet.c \
- vivi_widget.c \
- vivi_window.c \
- main.c
-
-noinst_HEADERS = \
- vivi_movie_list.h \
- vivi_vivi_docklet.h \
- vivi_widget.h \
- vivi_window.h
-
diff --git a/vivified/ui/main.c b/vivified/ui/main.c
deleted file mode 100644
index 38568ec..0000000
--- a/vivified/ui/main.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Vivified
- * 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 <gtk/gtk.h>
-#include <swfdec-gtk/swfdec-gtk.h>
-#include "vivified/core/vivified-core.h"
-#include "vivified/dock/vivified-dock.h"
-#include "vivi_window.h"
-
-static gboolean
-delete_event (GtkWidget *widget, GdkEvent *event, ViviApplication *app)
-{
- if (!vivi_application_is_quit (app)) {
- vivi_application_quit (app);
- return TRUE;
- }
- return FALSE;
-}
-
-static void
-setup (const char *filename, const char *variables)
-{
- GtkWidget *window;
- ViviApplication *app;
-
- app = vivi_application_new ();
- vivi_application_set_filename (app, filename);
- vivi_application_set_variables (app, variables);
-
- window = vivi_window_new (app);
-
- g_signal_connect_swapped (app, "notify::quit", G_CALLBACK (gtk_widget_destroy), window);
- g_signal_connect (window, "delete-event", G_CALLBACK (delete_event), app);
- g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), app);
-
- gtk_widget_show_all (window);
-}
-
-int
-main (int argc, char **argv)
-{
- gtk_init (&argc, &argv);
-
- if (argc < 2) {
- g_print ("usage: %s FILE [VARIABLES]\n", argv[0]);
- return 0;
- }
-
- setup (argv[1], argc > 2 ? argv[2] : NULL);
- gtk_main ();
-
- return 0;
-}
diff --git a/vivified/ui/vivi_command_line.c b/vivified/ui/vivi_command_line.c
deleted file mode 100644
index 4377830..0000000
--- a/vivified/ui/vivi_command_line.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Vivified
- * 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 "vivi_vivi_docklet.h"
-
-static void
-vivi_command_line_execute (ViviApplication *app, const char *command)
-{
- char *run;
-
- if (!strpbrk (command, ";\"',()[]{}")) {
- /* special mode: interpret as space-delimited list:
- * first argument is function name, following arguemnts are function arguments
- */
- char **args = g_strsplit (command, " ", -1);
- GString *str = g_string_new (args[0]);
- guint i;
-
- g_string_append (str, " (");
- for (i = 1; args[i] != NULL; i++) {
- if (i > 1)
- g_string_append (str, ", ");
- g_string_append_c (str, '"');
- g_string_append (str, args[i]);
- g_string_append_c (str, '"');
- }
- g_string_append (str, ");");
- run = g_string_free (str, FALSE);
- } else {
- run = (char *) command;
- }
-
-
- vivi_application_execute (app, run);
- if (command != run)
- g_free (run);
-}
-
-void
-vivi_command_line_activate (GtkEntry *entry, ViviApplication *app);
-void
-vivi_command_line_activate (GtkEntry *entry, ViviApplication *app)
-{
- const char *text = gtk_entry_get_text (entry);
-
- if (text[0] == '\0')
- return;
-
- vivi_command_line_execute (app, text);
- gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
-}
-
-static void
-vivi_command_line_append_message (ViviApplication *app, guint type, const char *message, GtkTextView *view)
-{
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (view);
- GtkTextIter iter;
- GtkTextMark *mark;
- const char *tag_names[] = { "input", "output", "error" };
-
- gtk_text_buffer_get_end_iter (buffer, &iter);
- mark = gtk_text_buffer_get_mark (buffer, "end");
- if (mark == NULL)
- mark = gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE);
- if (gtk_text_buffer_get_char_count (buffer) > 0)
- gtk_text_buffer_insert (buffer, &iter, "\n", 1);
- gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, message, -1, tag_names[type], NULL);
- gtk_text_view_scroll_to_mark (view, mark, 0.0, TRUE, 0.0, 0.0);
-}
-
-void
-vivi_command_line_application_unset (ViviViviDocklet *docklet, ViviApplication *app);
-void
-vivi_command_line_application_unset (ViviViviDocklet *docklet, ViviApplication *app)
-{
- GtkWidget *view = vivi_vivi_docklet_find_widget_by_type (docklet, GTK_TYPE_TEXT_VIEW);
-
- g_signal_handlers_disconnect_by_func (app, vivi_command_line_append_message, view);
-}
-
-void
-vivi_command_line_application_set (ViviViviDocklet *docklet, ViviApplication *app);
-void
-vivi_command_line_application_set (ViviViviDocklet *docklet, ViviApplication *app)
-{
- GtkWidget *view = vivi_vivi_docklet_find_widget_by_type (docklet, GTK_TYPE_TEXT_VIEW);
-
- gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
- "error", "foreground", "red", "left-margin", 15, NULL);
- gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
- "input", "foreground", "dark grey", NULL);
- gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)),
- "output", "left-margin", 15, NULL);
-
- g_signal_connect (app, "message", G_CALLBACK (vivi_command_line_append_message), view);
-}
-
diff --git a/vivified/ui/vivi_command_line.xml b/vivified/ui/vivi_command_line.xml
deleted file mode 100644
index 5a4b2fb..0000000
--- a/vivified/ui/vivi_command_line.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<interface>
- <object class="ViviViviDocklet" id="command-line">
- <property name="title">Command Line</property>
- <signal name="application-set" handler="vivi_command_line_application_set" />
- <signal name="application-unset" handler="vivi_command_line_application_unset" />
- <child>
- <object class="GtkVBox" id="box">
- <child>
- <object class="GtkScrolledWindow" id="scroll">
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">automatic</property>
- <child>
- <object class="GtkTextView" id="text">
- <property name="editable">false</property>
- <property name="wrap-mode">word-char</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="pack-type">start</property>
- <property name="expand">true</property>
- <property name="fill">true</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry">
- <signal name="activate" handler="vivi_command_line_activate" />
- </object>
- <packing>
- <property name="pack-type">end</property>
- <property name="expand">false</property>
- <property name="fill">true</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/vivified/ui/vivi_movie_list.c b/vivified/ui/vivi_movie_list.c
deleted file mode 100644
index 4b6cbf5..0000000
--- a/vivified/ui/vivi_movie_list.c
+++ /dev/null
@@ -1,457 +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, to_string 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 <gtk/gtk.h>
-#include <swfdec/swfdec_movie.h>
-#include <swfdec/swfdec_player_internal.h>
-#include "vivi_movie_list.h"
-
-/*** GTK_TREE_MODEL ***/
-
-#if 0
-# define REPORT g_print ("%s\n", G_STRFUNC)
-#else
-# define REPORT
-#endif
-static GtkTreeModelFlags
-vivi_movie_list_get_flags (GtkTreeModel *tree_model)
-{
- REPORT;
- return 0;
-}
-
-static gint
-vivi_movie_list_get_n_columns (GtkTreeModel *tree_model)
-{
- REPORT;
- return VIVI_MOVIE_LIST_N_COLUMNS;
-}
-
-static GType
-vivi_movie_list_get_column_type (GtkTreeModel *tree_model, gint index_)
-{
- REPORT;
- switch (index_) {
- case VIVI_MOVIE_LIST_COLUMN_MOVIE:
- return G_TYPE_POINTER;
- case VIVI_MOVIE_LIST_COLUMN_NAME:
- return G_TYPE_STRING;
- case VIVI_MOVIE_LIST_COLUMN_DEPTH:
- return G_TYPE_INT;
- case VIVI_MOVIE_LIST_COLUMN_TYPE:
- return G_TYPE_STRING;
- default:
- break;
- }
- g_assert_not_reached ();
- return G_TYPE_NONE;
-}
-
-static gboolean
-vivi_movie_list_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath *path)
-{
- ViviMovieList *movies = VIVI_MOVIE_LIST (tree_model);
- GNode *node;
- guint i, depth;
- int *indices;
-
- REPORT;
- depth = gtk_tree_path_get_depth (path);
- indices = gtk_tree_path_get_indices (path);
- if (indices == NULL)
- return FALSE;
- node = movies->root;
- for (i = 0; i < depth; i++) {
- node = g_node_nth_child (node, indices[i]);
- if (node == NULL)
- return FALSE;
- }
- iter->user_data = node;
- iter->stamp = movies->stamp;
- return TRUE;
-}
-
-static GtkTreePath *
-vivi_movie_list_node_to_path (GNode *node)
-{
- GtkTreePath *path;
-
- path = gtk_tree_path_new ();
- while (node->parent != NULL) {
- gtk_tree_path_prepend_index (path, g_node_child_position (node->parent, node));
- node = node->parent;
- }
- return path;
-}
-
-static GtkTreePath *
-vivi_movie_list_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
- REPORT;
- return vivi_movie_list_node_to_path (iter->user_data);
-}
-
-static void
-vivi_movie_list_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter,
- gint column, GValue *value)
-{
- SwfdecMovie *movie = ((GNode *) iter->user_data)->data;
-
- REPORT;
- switch (column) {
- case VIVI_MOVIE_LIST_COLUMN_MOVIE:
- g_value_init (value, G_TYPE_POINTER);
- g_value_set_pointer (value, movie);
- return;
- case VIVI_MOVIE_LIST_COLUMN_NAME:
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, movie->name);
- return;
- case VIVI_MOVIE_LIST_COLUMN_DEPTH:
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, movie->depth);
- return;
- case VIVI_MOVIE_LIST_COLUMN_TYPE:
- g_value_init (value, G_TYPE_STRING);
- /* big hack: we skip the "Swfdec" here */
- g_value_set_string (value, G_OBJECT_TYPE_NAME (movie) + 6);
- return;
- default:
- break;
- }
- g_assert_not_reached ();
-}
-
-static gboolean
-vivi_movie_list_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
- GNode *node;
-
- REPORT;
- node = iter->user_data;
- node = node->next;
- if (node == NULL)
- return FALSE;
- iter->user_data = node;
- return TRUE;
-}
-
-static gboolean
-vivi_movie_list_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent)
-{
- GNode *node;
-
- REPORT;
- if (parent) {
- node = parent->user_data;
- } else {
- node = VIVI_MOVIE_LIST (tree_model)->root;
- }
- if (node->children == NULL)
- return FALSE;
- iter->user_data = node->children;
- return TRUE;
-}
-
-static gboolean
-vivi_movie_list_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
- GtkTreeIter unused;
-
- REPORT;
- return vivi_movie_list_iter_children (tree_model, &unused, iter);
-}
-
-static gint
-vivi_movie_list_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
-{
- GNode *node;
-
- REPORT;
- if (iter) {
- node = iter->user_data;
- } else {
- node = VIVI_MOVIE_LIST (tree_model)->root;
- }
- return g_node_n_children (node);
-}
-
-static gboolean
-vivi_movie_list_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter,
- GtkTreeIter *parent, gint n)
-{
- GNode *node;
-
- REPORT;
- if (parent) {
- node = parent->user_data;
- } else {
- node = VIVI_MOVIE_LIST (tree_model)->root;
- }
- node = g_node_nth_child (node, n);
- if (node == NULL)
- return FALSE;
- iter->user_data = node;
- return TRUE;
-}
-
-static gboolean
-vivi_movie_list_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *child)
-{
- GNode *node;
-
- REPORT;
- node = child->user_data;
- node = node->parent;
- if (node->parent == NULL)
- return FALSE;
- iter->user_data = node;
- return TRUE;
-}
-
-static void
-vivi_movie_list_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = vivi_movie_list_get_flags;
- iface->get_n_columns = vivi_movie_list_get_n_columns;
- iface->get_column_type = vivi_movie_list_get_column_type;
- iface->get_iter = vivi_movie_list_get_iter;
- iface->get_path = vivi_movie_list_get_path;
- iface->get_value = vivi_movie_list_get_value;
- iface->iter_next = vivi_movie_list_iter_next;
- iface->iter_children = vivi_movie_list_iter_children;
- iface->iter_has_child = vivi_movie_list_iter_has_child;
- iface->iter_n_children = vivi_movie_list_iter_n_children;
- iface->iter_nth_child = vivi_movie_list_iter_nth_child;
- iface->iter_parent = vivi_movie_list_iter_parent;
-}
-
-/*** VIVI_MOVIE_LIST ***/
-
-G_DEFINE_TYPE_WITH_CODE (ViviMovieList, vivi_movie_list, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, vivi_movie_list_tree_model_init))
-
-static int
-vivi_movie_list_get_index (GNode *parent, GNode *new)
-{
- GNode *walk;
- int i = 0;
-
- for (walk = parent->children; walk; walk = walk->next) {
- if (walk == new)
- continue;
- if (swfdec_movie_compare_depths (walk->data, new->data) < 0) {
- i++;
- continue;
- }
- break;
- }
- return i;
-}
-
-static void
-vivi_movie_list_movie_notify (SwfdecMovie *movie, GParamSpec *pspec, ViviMovieList *movies)
-{
- GtkTreeIter iter;
- GtkTreePath *path;
- GNode *node;
-
- node = g_hash_table_lookup (movies->nodes, movie);
- if (g_str_equal (pspec->name, "depth")) {
- guint old, new;
- GNode *parent;
-
- parent = node->parent;
- old = g_node_child_position (parent, node);
- new = vivi_movie_list_get_index (parent, node);
- if (old != new) {
- /* reorder */
- guint min = MIN (old, new);
- guint max = MAX (old, new);
- guint i;
- guint count = g_node_n_children (parent);
- int *positions = g_new (int, count);
- for (i = 0; i < min; i++) {
- positions[i] = i;
- }
- if (old < new) {
- for (i = min; i < max; i++) {
- positions[i] = i + 1;
- }
- } else {
- for (i = min + 1; i <= max; i++) {
- positions[i] = i - 1;
- }
- }
- positions[new] = old;
- for (i = max + 1; i < count; i++) {
- positions[i] = i;
- }
- g_node_unlink (node);
- g_node_insert (parent, new, node);
- iter.stamp = movies->stamp;
- iter.user_data = parent;
- path = vivi_movie_list_node_to_path (parent);
- gtk_tree_model_rows_reordered (GTK_TREE_MODEL (movies), path, &iter, positions);
- gtk_tree_path_free (path);
- g_free (positions);
- }
- }
- iter.stamp = movies->stamp;
- iter.user_data = node;
- path = vivi_movie_list_node_to_path (node);
- gtk_tree_model_row_changed (GTK_TREE_MODEL (movies), path, &iter);
- gtk_tree_path_free (path);
-}
-
-static gboolean
-vivi_movie_list_added (ViviDebugger *debugger, SwfdecAsObject *object, ViviMovieList *movies)
-{
- SwfdecMovie *movie;
- GtkTreePath *path;
- GtkTreeIter iter;
- GNode *node, *new;
- int pos;
-
- if (!SWFDEC_IS_MOVIE (object))
- return FALSE;
- movie = SWFDEC_MOVIE (object);
- g_signal_connect (movie, "notify", G_CALLBACK (vivi_movie_list_movie_notify), movies);
- if (movie->parent) {
- node = g_hash_table_lookup (movies->nodes, movie->parent);
- g_assert (node);
- } else {
- node = movies->root;
- }
- new = g_node_new (movie);
- g_hash_table_insert (movies->nodes, movie, new);
- pos = vivi_movie_list_get_index (node, new);
- g_node_insert (node, pos, new);
- movies->stamp++;
- iter.stamp = movies->stamp;
- iter.user_data = new;
- path = vivi_movie_list_node_to_path (new);
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (movies), path, &iter);
- gtk_tree_path_free (path);
- return FALSE;
-}
-
-static void
-vivi_movie_list_remove_node (ViviMovieList *movies, GNode *node)
-{
- GNode *walk;
-
- for (walk = node->children; walk; walk = walk->next) {
- vivi_movie_list_remove_node (movies, walk);
- }
- g_hash_table_remove (movies->nodes, node->data);
- g_signal_handlers_disconnect_by_func (node->data, vivi_movie_list_movie_notify, movies);
-}
-
-static gboolean
-vivi_movie_list_removed (ViviDebugger *debugger, SwfdecAsObject *object, ViviMovieList *movies)
-{
- GNode *node;
- GtkTreePath *path;
-
- if (!SWFDEC_IS_MOVIE (object))
- return FALSE;
- node = g_hash_table_lookup (movies->nodes, object);
- /* happens when parent was already removed */
- if (node == NULL)
- return FALSE;
- vivi_movie_list_remove_node (movies, node);
- path = vivi_movie_list_node_to_path (node);
- g_node_destroy (node);
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (movies), path);
- gtk_tree_path_free (path);
- return FALSE;
-}
-
-static void
-vivi_movie_list_reset (ViviApplication *app, GParamSpec *pspec, ViviMovieList *movies)
-{
- GNode *walk;
-
- for (walk = movies->root->children; walk; walk = walk->next) {
- vivi_movie_list_removed (NULL, walk->data, movies);
- }
-}
-
-static void
-vivi_movie_list_dispose (GObject *object)
-{
- ViviMovieList *movies = VIVI_MOVIE_LIST (object);
- ViviDebugger *debugger;
- GNode *walk;
-
- debugger = movies->app->debugger;
- g_signal_handlers_disconnect_by_func (movies->app, vivi_movie_list_reset, movies);
- g_signal_handlers_disconnect_by_func (debugger, vivi_movie_list_removed, movies);
- g_signal_handlers_disconnect_by_func (debugger, vivi_movie_list_added, movies);
- g_object_unref (movies->app);
- for (walk = movies->root->children; walk; walk = walk->next) {
- vivi_movie_list_remove_node (movies, walk);
- }
- g_node_destroy (movies->root);
-#ifndef G_DISABLE_ASSERT
- if (g_hash_table_size (movies->nodes) != 0) {
- g_error ("%u items left in hash table", g_hash_table_size (movies->nodes));
- }
-#endif
- g_hash_table_destroy (movies->nodes);
-
- G_OBJECT_CLASS (vivi_movie_list_parent_class)->dispose (object);
-}
-
-static void
-vivi_movie_list_class_init (ViviMovieListClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
-
- object_class->dispose = vivi_movie_list_dispose;
-}
-
-static void
-vivi_movie_list_init (ViviMovieList *movies)
-{
- movies->root = g_node_new (NULL);
- movies->nodes = g_hash_table_new (g_direct_hash, g_direct_equal);
-}
-
-GtkTreeModel *
-vivi_movie_list_new (ViviApplication *app)
-{
- ViviMovieList *movies;
- ViviDebugger *debugger;
-
- movies = g_object_new (VIVI_TYPE_MOVIE_LIST, NULL);
- g_object_ref (app);
- movies->app = app;
- debugger = app->debugger;
- g_signal_connect (app, "notify::player", G_CALLBACK (vivi_movie_list_reset), movies);
- g_signal_connect (debugger, "add", G_CALLBACK (vivi_movie_list_added), movies);
- g_signal_connect (debugger, "remove", G_CALLBACK (vivi_movie_list_removed), movies);
- return GTK_TREE_MODEL (movies);
-}
-
diff --git a/vivified/ui/vivi_movie_list.h b/vivified/ui/vivi_movie_list.h
deleted file mode 100644
index a030549..0000000
--- a/vivified/ui/vivi_movie_list.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Vivi
- * 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
- */
-
-#include <vivified/core/vivified-core.h>
-
-#ifndef _VIVI_MOVIE_LIST_H_
-#define _VIVI_MOVIE_LIST_H_
-
-G_BEGIN_DECLS
-
-enum {
- VIVI_MOVIE_LIST_COLUMN_MOVIE,
- VIVI_MOVIE_LIST_COLUMN_NAME,
- VIVI_MOVIE_LIST_COLUMN_DEPTH,
- VIVI_MOVIE_LIST_COLUMN_TYPE,
- /* add more */
- VIVI_MOVIE_LIST_N_COLUMNS
-};
-
-typedef struct _ViviMovieList ViviMovieList;
-typedef struct _ViviMovieListClass ViviMovieListClass;
-
-#define VIVI_TYPE_MOVIE_LIST (vivi_movie_list_get_type())
-#define VIVI_IS_MOVIE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_MOVIE_LIST))
-#define VIVI_IS_MOVIE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_MOVIE_LIST))
-#define VIVI_MOVIE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_MOVIE_LIST, ViviMovieList))
-#define VIVI_MOVIE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_MOVIE_LIST, ViviMovieListClass))
-
-struct _ViviMovieList
-{
- GObject object;
-
- ViviApplication * app; /* the application we watch */
- GNode * root; /* the root node containing all the movies */
- int stamp; /* to validate tree iters */
- GHashTable * nodes; /* movies => node fast lookup table */
-};
-
-struct _ViviMovieListClass
-{
- GObjectClass object_class;
-};
-
-GType vivi_movie_list_get_type (void);
-
-GtkTreeModel * vivi_movie_list_new (ViviApplication * app);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/ui/vivi_movies.c b/vivified/ui/vivi_movies.c
deleted file mode 100644
index cc88466..0000000
--- a/vivified/ui/vivi_movies.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Vivified
- * 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/swfdec-gtk.h>
-#include "vivi_vivi_docklet.h"
-#include "vivi_movie_list.h"
-
-void
-vivi_movies_application_set (ViviViviDocklet *docklet, ViviApplication *app);
-void
-vivi_movies_application_set (ViviViviDocklet *docklet, ViviApplication *app)
-{
- GtkWidget *view = vivi_vivi_docklet_find_widget_by_type (docklet, GTK_TYPE_TREE_VIEW);
- GtkTreeModel *model;
-
- model = vivi_movie_list_new (app);
- gtk_tree_view_set_model (GTK_TREE_VIEW (view), model);
- g_object_unref (model);
-}
-
diff --git a/vivified/ui/vivi_movies.xml b/vivified/ui/vivi_movies.xml
deleted file mode 100644
index 47f1bdf..0000000
--- a/vivified/ui/vivi_movies.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<interface>
- <object class="ViviViviDocklet" id="movies">
- <property name="title">Movies</property>
- <signal name="application-set" handler="vivi_movies_application_set" />
- <child>
- <object class="GtkScrolledWindow" id="1">
- <property name="hscrollbar-policy">automatic</property>
- <property name="vscrollbar-policy">automatic</property>
- <child>
- <object class="GtkTreeView" id="x">
- <child>
- <object class="GtkTreeViewColumn" id="x">
- <property name="title">Movie</property>
- <child>
- <object class="GtkCellRendererText" id="x"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="x">
- <property name="title">Depth</property>
- <child>
- <object class="GtkCellRendererText" id="x"/>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/vivified/ui/vivi_player.c b/vivified/ui/vivi_player.c
deleted file mode 100644
index f456e07..0000000
--- a/vivified/ui/vivi_player.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Vivified
- * 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/swfdec-gtk.h>
-#include "vivi_vivi_docklet.h"
-#include "vivi_widget.h"
-
-void
-vivi_player_application_set (ViviViviDocklet *docklet, ViviApplication *app);
-void
-vivi_player_application_set (ViviViviDocklet *docklet, ViviApplication *app)
-{
- ViviWidget *widget = VIVI_WIDGET (vivi_vivi_docklet_find_widget_by_type (docklet, VIVI_TYPE_WIDGET));
-
- vivi_widget_set_application (widget, app);
-}
diff --git a/vivified/ui/vivi_player.xml b/vivified/ui/vivi_player.xml
deleted file mode 100644
index 1c63819..0000000
--- a/vivified/ui/vivi_player.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<interface>
- <object class="ViviViviDocklet" id="player">
- <property name="title">Player</property>
- <signal name="application-set" handler="vivi_player_application_set" />
- <child>
- <object class="GtkAlignment" id="1">
- <property name="xscale">0.0</property>
- <property name="yscale">0.0</property>
- <child>
- <object class="ViviWidget" id="2">
- </object>
- </child>
- </object>
- </child>
- </object>
-</interface>
diff --git a/vivified/ui/vivi_vivi_docklet.c b/vivified/ui/vivi_vivi_docklet.c
deleted file mode 100644
index cea4f64..0000000
--- a/vivified/ui/vivi_vivi_docklet.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Vivified
- * 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 "vivi_vivi_docklet.h"
-
-enum {
- PROP_0,
- PROP_APP
-};
-
-enum {
- APPLICATION_SET,
- APPLICATION_UNSET,
- LAST_SIGNAL
-};
-
-G_DEFINE_TYPE (ViviViviDocklet, vivi_vivi_docklet, VIVI_TYPE_DOCKLET)
-guint signals[LAST_SIGNAL];
-
-static void
-vivi_vivi_docklet_get_property (GObject *object, guint param_id, GValue *value,
- GParamSpec * pspec)
-{
- ViviViviDocklet *docklet = VIVI_VIVI_DOCKLET (object);
-
- switch (param_id) {
- case PROP_APP:
- g_value_set_object (value, docklet->app);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_vivi_docklet_set_property (GObject *object, guint param_id, const GValue *value,
- GParamSpec *pspec)
-{
- ViviViviDocklet *docklet = VIVI_VIVI_DOCKLET (object);
-
- switch (param_id) {
- case PROP_APP:
- if (docklet->app) {
- g_signal_emit (docklet, signals[APPLICATION_UNSET], 0, docklet->app);
- g_object_unref (docklet->app);
- }
- docklet->app = g_value_dup_object (value);
- if (docklet->app) {
- g_signal_emit (docklet, signals[APPLICATION_SET], 0, docklet->app);
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_vivi_docklet_dispose (GObject *object)
-{
- ViviViviDocklet *docklet = VIVI_VIVI_DOCKLET (object);
-
- if (docklet->app) {
- g_signal_emit (docklet, signals[APPLICATION_UNSET], 0, docklet->app);
- g_object_unref (docklet->app);
- docklet->app = NULL;
- }
-
- G_OBJECT_CLASS (vivi_vivi_docklet_parent_class)->dispose (object);
-}
-
-static void
-vivi_vivi_docklet_class_init (ViviViviDockletClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = vivi_vivi_docklet_dispose;
- object_class->get_property = vivi_vivi_docklet_get_property;
- object_class->set_property = vivi_vivi_docklet_set_property;
-
- g_object_class_install_property (object_class, PROP_APP,
- g_param_spec_object ("application", "application", "application used by this docklet",
- VIVI_TYPE_APPLICATION, G_PARAM_READWRITE));
-
- signals[APPLICATION_SET] = g_signal_new ("application-set", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ViviViviDockletClass, application_set),
- NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, VIVI_TYPE_APPLICATION);
- signals[APPLICATION_UNSET] = g_signal_new ("application-unset", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ViviViviDockletClass, application_unset),
- NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, VIVI_TYPE_APPLICATION);
-}
-
-static void
-vivi_vivi_docklet_init (ViviViviDocklet *docklet)
-{
-}
-
-typedef struct {
- GtkWidget * result;
- GType desired_type;
-} FindData;
-
-static void
-find_widget (GtkWidget *widget, gpointer datap)
-{
- FindData *data = datap;
-
- if (G_TYPE_CHECK_INSTANCE_TYPE (widget, data->desired_type)) {
- data->result = widget;
- return;
- }
- if (GTK_IS_CONTAINER (widget))
- gtk_container_foreach (GTK_CONTAINER (widget), find_widget, data);
-}
-
-GtkWidget *
-vivi_vivi_docklet_find_widget_by_type (ViviViviDocklet *docklet, GType type)
-{
- FindData data = { NULL, };
-
- g_return_val_if_fail (VIVI_IS_VIVI_DOCKLET (docklet), NULL);
- g_return_val_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET), NULL);
-
- data.desired_type = type;
- gtk_container_foreach (GTK_CONTAINER (docklet), find_widget, &data);
- return data.result;
-}
diff --git a/vivified/ui/vivi_vivi_docklet.h b/vivified/ui/vivi_vivi_docklet.h
deleted file mode 100644
index 8142ae1..0000000
--- a/vivified/ui/vivi_vivi_docklet.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Vivified
- * 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 _VIVI_VIVI_DOCKLET_H_
-#define _VIVI_VIVI_DOCKLET_H_
-
-#include <vivified/core/vivified-core.h>
-#include <vivified/dock/vivified-dock.h>
-
-G_BEGIN_DECLS
-
-
-typedef struct _ViviViviDocklet ViviViviDocklet;
-typedef struct _ViviViviDockletClass ViviViviDockletClass;
-
-#define VIVI_TYPE_VIVI_DOCKLET (vivi_vivi_docklet_get_type())
-#define VIVI_IS_VIVI_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_VIVI_DOCKLET))
-#define VIVI_IS_VIVI_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_VIVI_DOCKLET))
-#define VIVI_VIVI_DOCKLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_VIVI_DOCKLET, ViviViviDocklet))
-#define VIVI_VIVI_DOCKLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_VIVI_DOCKLET, ViviViviDockletClass))
-#define VIVI_VIVI_DOCKLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIVI_TYPE_VIVI_DOCKLET, ViviViviDockletClass))
-
-struct _ViviViviDocklet {
- ViviDocklet docklet;
-
- ViviApplication * app; /* the application we connect to */
-};
-
-struct _ViviViviDockletClass
-{
- ViviDockletClass docklet_class;
-
- void (* application_set) (ViviViviDocklet * docklet,
- ViviApplication * app);
- void (* application_unset) (ViviViviDocklet * docklet,
- ViviApplication * app);
-};
-
-GType vivi_vivi_docklet_get_type (void);
-
-GtkWidget * vivi_vivi_docklet_find_widget_by_type
- (ViviViviDocklet * docklet,
- GType type);
-
-G_END_DECLS
-#endif
diff --git a/vivified/ui/vivi_widget.c b/vivified/ui/vivi_widget.c
deleted file mode 100644
index 6114e2c..0000000
--- a/vivified/ui/vivi_widget.c
+++ /dev/null
@@ -1,245 +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 "vivi_widget.h"
-
-enum {
- PROP_0,
- PROP_APP
-};
-
-G_DEFINE_TYPE (ViviWidget, vivi_widget, SWFDEC_TYPE_GTK_WIDGET)
-
-static void
-vivi_widget_get_property (GObject *object, guint param_id, GValue *value,
- GParamSpec * pspec)
-{
- ViviWidget *widget = VIVI_WIDGET (object);
-
- switch (param_id) {
- case PROP_APP:
- g_value_set_object (value, widget->app);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_widget_set_property (GObject *object, guint param_id, const GValue *value,
- GParamSpec *pspec)
-{
- ViviWidget *widget = VIVI_WIDGET (object);
-
- switch (param_id) {
- case PROP_APP:
- vivi_widget_set_application (widget, VIVI_APPLICATION (g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static gboolean
-vivi_widget_motion_notify (GtkWidget *gtkwidget, GdkEventMotion *event)
-{
- return FALSE;
-}
-
-static gboolean
-vivi_widget_leave_notify (GtkWidget *gtkwidget, GdkEventCrossing *event)
-{
- return FALSE;
-}
-
-#define RADIUS 10
-static void
-vivi_widget_invalidate_click_area (ViviWidget *widget)
-{
- GtkWidget *gtkwidget = GTK_WIDGET (widget);
- GdkRectangle rect = { widget->x - RADIUS, widget->y - RADIUS, 2 * RADIUS, 2 * RADIUS };
-
- gdk_window_invalidate_rect (gtkwidget->window, &rect, FALSE);
-}
-
-static gboolean
-vivi_widget_button_press (GtkWidget *gtkwidget, GdkEventButton *event)
-{
- SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
- ViviWidget *debug = VIVI_WIDGET (gtkwidget);
-
- if (event->window != gtkwidget->window)
- return FALSE;
-
- if (event->button == 1 && swfdec_gtk_widget_get_interactive (widget)) {
- SwfdecPlayer *player = swfdec_gtk_widget_get_player (widget);
- // cast to int to get rid of unhandled enum warnings...
- switch ((int)event->type) {
- case GDK_BUTTON_PRESS:
- vivi_widget_invalidate_click_area (debug);
- debug->x = event->x;
- debug->y = event->y;
- swfdec_player_mouse_move (player, debug->x, debug->y);
- vivi_widget_invalidate_click_area (debug);
- break;
- case GDK_2BUTTON_PRESS:
- debug->button = 1 - debug->button;
- debug->x = event->x;
- debug->y = event->y;
- if (debug->button)
- swfdec_player_mouse_press (player, debug->x, debug->y, 1);
- else
- swfdec_player_mouse_release (player, debug->x, debug->y, 1);
- vivi_widget_invalidate_click_area (debug);
- break;
- default:
- break;
- }
- }
- return FALSE;
-}
-
-static gboolean
-vivi_widget_button_release (GtkWidget *gtkwidget, GdkEventButton *event)
-{
- return FALSE;
-}
-
-static gboolean
-vivi_widget_expose (GtkWidget *gtkwidget, GdkEventExpose *event)
-{
- ViviWidget *debug = VIVI_WIDGET (gtkwidget);
- cairo_t *cr;
-
- if (event->window != gtkwidget->window)
- return FALSE;
-
- if (GTK_WIDGET_CLASS (vivi_widget_parent_class)->expose_event (gtkwidget, event))
- return TRUE;
-
- cr = gdk_cairo_create (gtkwidget->window);
-
- cairo_arc (cr, debug->x, debug->y, RADIUS - 1.5, 0.0, 2 * G_PI);
- if (debug->button) {
- cairo_set_source_rgba (cr, 0.25, 0.25, 0.25, 0.5);
- cairo_fill_preserve (cr);
- }
- cairo_set_line_width (cr, 3);
- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
- cairo_stroke_preserve (cr);
- cairo_set_line_width (cr, 1);
- cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
- cairo_stroke (cr);
- cairo_destroy (cr);
-
- return FALSE;
-}
-
-static void
-vivi_widget_dispose (GObject *object)
-{
- ViviWidget *widget = VIVI_WIDGET (object);
-
- vivi_widget_set_application (widget, NULL);
-
- G_OBJECT_CLASS (vivi_widget_parent_class)->dispose (object);
-}
-
-static void
-vivi_widget_class_init (ViviWidgetClass * g_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (g_class);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (g_class);
-
- object_class->dispose = vivi_widget_dispose;
- object_class->get_property = vivi_widget_get_property;
- object_class->set_property = vivi_widget_set_property;
-
- g_object_class_install_property (object_class, PROP_APP,
- g_param_spec_object ("application", "application", "application that is playing",
- VIVI_TYPE_APPLICATION, G_PARAM_READWRITE));
-
- widget_class->expose_event = vivi_widget_expose;
- widget_class->button_press_event = vivi_widget_button_press;
- widget_class->button_release_event = vivi_widget_button_release;
- widget_class->motion_notify_event = vivi_widget_motion_notify;
- widget_class->leave_notify_event = vivi_widget_leave_notify;
-}
-
-static void
-vivi_widget_init (ViviWidget *widget)
-{
-}
-
-GtkWidget *
-vivi_widget_new (ViviApplication *app)
-{
- ViviWidget *widget;
-
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), NULL);
-
- widget = g_object_new (VIVI_TYPE_WIDGET, "player", vivi_application_get_player (app), NULL);
-
- return GTK_WIDGET (widget);
-}
-
-static void
-vivi_widget_app_notify (ViviApplication *app, GParamSpec *pspec, ViviWidget *widget)
-{
- if (g_str_equal (pspec->name, "interrupted")) {
- swfdec_gtk_widget_set_interactive (SWFDEC_GTK_WIDGET (widget),
- !vivi_application_get_interrupted (widget->app));
- } else if (g_str_equal (pspec->name, "player")) {
- swfdec_gtk_widget_set_player (SWFDEC_GTK_WIDGET (widget),
- vivi_application_get_player (widget->app));
- }
-}
-
-void
-vivi_widget_set_application (ViviWidget *widget, ViviApplication *app)
-{
- g_return_if_fail (VIVI_IS_WIDGET (widget));
- g_return_if_fail (app == NULL || VIVI_IS_APPLICATION (app));
-
- if (widget->app) {
- g_signal_handlers_disconnect_by_func (widget->app, vivi_widget_app_notify, widget);
- g_object_unref (widget->app);
- }
- widget->app = app;
- if (app) {
- g_object_ref (app);
- g_signal_connect (app, "notify", G_CALLBACK (vivi_widget_app_notify), widget);
- swfdec_gtk_widget_set_interactive (SWFDEC_GTK_WIDGET (widget),
- !vivi_application_get_interrupted (app));
- swfdec_gtk_widget_set_player (SWFDEC_GTK_WIDGET (widget),
- vivi_application_get_player (app));
- } else {
- swfdec_gtk_widget_set_interactive (SWFDEC_GTK_WIDGET (widget), TRUE);
- swfdec_gtk_widget_set_player (SWFDEC_GTK_WIDGET (widget), NULL);
- }
- g_object_notify (G_OBJECT (widget), "application");
-}
-
diff --git a/vivified/ui/vivi_widget.h b/vivified/ui/vivi_widget.h
deleted file mode 100644
index f7d4727..0000000
--- a/vivified/ui/vivi_widget.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Vivi
- * 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 _VIVI_WIDGET_H_
-#define _VIVI_WIDGET_H_
-
-#include <swfdec-gtk/swfdec-gtk.h>
-#include <vivified/core/vivified-core.h>
-
-G_BEGIN_DECLS
-
-typedef struct _ViviWidget ViviWidget;
-typedef struct _ViviWidgetClass ViviWidgetClass;
-
-#define VIVI_TYPE_WIDGET (vivi_widget_get_type())
-#define VIVI_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_WIDGET))
-#define VIVI_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_WIDGET))
-#define VIVI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_WIDGET, ViviWidget))
-#define VIVI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_WIDGET, ViviWidgetClass))
-
-struct _ViviWidget
-{
- SwfdecGtkWidget widget;
-
- ViviApplication * app;
-
- int x;
- int y;
- int button;
-};
-
-struct _ViviWidgetClass
-{
- SwfdecGtkWidgetClass widget_class;
-};
-
-GType vivi_widget_get_type (void);
-
-GtkWidget * vivi_widget_new (ViviApplication * app);
-
-void vivi_widget_set_application (ViviWidget * widget,
- ViviApplication * app);
-
-
-G_END_DECLS
-#endif
diff --git a/vivified/ui/vivi_window.c b/vivified/ui/vivi_window.c
deleted file mode 100644
index 9d8b6ac..0000000
--- a/vivified/ui/vivi_window.c
+++ /dev/null
@@ -1,220 +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 "vivi_window.h"
-
-enum {
- PROP_0,
- PROP_APP,
- PROP_MOVIE
-};
-
-G_DEFINE_TYPE (ViviWindow, vivi_window, GTK_TYPE_WINDOW)
-
-static void
-vivi_window_app_notify (ViviApplication *app, GParamSpec *pspec, ViviWindow *window)
-{
- if (g_str_equal (pspec->name, "player")) {
- vivi_window_set_movie (window, NULL);
- } else if (g_str_equal (pspec->name, "filename")) {
- const char *filename = vivi_application_get_filename (app);
-
- if (filename == NULL)
- filename = "Vivified";
- gtk_window_set_title (GTK_WINDOW (window), filename);
- }
-}
-
-static void
-vivi_window_set_application (ViviWindow *window, ViviApplication *app)
-{
- g_return_if_fail (VIVI_IS_WINDOW (window));
- g_return_if_fail (app == NULL || VIVI_IS_APPLICATION (app));
-
- vivi_window_set_movie (window, NULL);
- if (window->app) {
- g_signal_handlers_disconnect_by_func (window->app, vivi_window_app_notify, window);
- g_object_unref (window->app);
- }
- window->app = app;
- if (app) {
- g_object_ref (app);
- g_signal_connect (app, "notify", G_CALLBACK (vivi_window_app_notify), window);
- }
- g_object_notify (G_OBJECT (window), "application");
-}
-
-static void
-vivi_window_get_property (GObject *object, guint param_id, GValue *value,
- GParamSpec * pspec)
-{
- ViviWindow *window = VIVI_WINDOW (object);
-
- switch (param_id) {
- case PROP_APP:
- g_value_set_object (value, window->app);
- break;
- case PROP_MOVIE:
- g_value_set_object (value, window->movie);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_window_set_property (GObject *object, guint param_id, const GValue *value,
- GParamSpec *pspec)
-{
- ViviWindow *window = VIVI_WINDOW (object);
-
- switch (param_id) {
- case PROP_APP:
- vivi_window_set_application (window, VIVI_APPLICATION (g_value_get_object (value)));
- break;
- case PROP_MOVIE:
- vivi_window_set_movie (window, SWFDEC_MOVIE (g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-vivi_window_dispose (GObject *object)
-{
- ViviWindow *window = VIVI_WINDOW (object);
-
- vivi_window_set_application (window, NULL);
- vivi_window_set_movie (window, NULL);
-
- G_OBJECT_CLASS (vivi_window_parent_class)->dispose (object);
-}
-
-static void
-vivi_window_class_init (ViviWindowClass * g_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (g_class);
-
- object_class->dispose = vivi_window_dispose;
- object_class->get_property = vivi_window_get_property;
- object_class->set_property = vivi_window_set_property;
-
- g_object_class_install_property (object_class, PROP_APP,
- g_param_spec_object ("application", "application", "application that is playing",
- VIVI_TYPE_APPLICATION, G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_MOVIE,
- g_param_spec_object ("movie", "movie", "selected movie",
- SWFDEC_TYPE_MOVIE, G_PARAM_READWRITE));
-}
-
-static void
-vivi_window_init (ViviWindow *window)
-{
-}
-
-static void
-try_grab_focus (GtkWidget *widget, gpointer unused)
-{
- if (GTK_IS_ENTRY (widget))
- gtk_widget_grab_focus (widget);
- else if (GTK_IS_CONTAINER (widget))
- gtk_container_foreach (GTK_CONTAINER (widget), try_grab_focus, NULL);
-}
-
-GtkWidget *
-vivi_window_new (ViviApplication *app)
-{
- GtkWidget *window, *box, *paned, *widget;
- GtkBuilder *builder;
- GError *error = NULL;
-
- g_return_val_if_fail (VIVI_IS_APPLICATION (app), NULL);
-
- window = g_object_new (VIVI_TYPE_WINDOW, "application", app,
- "type", GTK_WINDOW_TOPLEVEL, "default-width", 600, "default-height", 450,
- NULL);
-
- builder = gtk_builder_new ();
- if (!gtk_builder_add_from_file (builder, "vivi_player.xml", &error) ||
- !gtk_builder_add_from_file (builder, "vivi_command_line.xml", &error) ||
- !gtk_builder_add_from_file (builder, "vivi_movies.xml", &error))
- g_error ("%s", error->message);
- gtk_builder_connect_signals (builder, app);
-
- gtk_window_set_default_size (GTK_WINDOW (window), 600, 450);
- paned = gtk_hpaned_new ();
- gtk_paned_set_position (GTK_PANED (paned), 200);
- gtk_container_add (GTK_CONTAINER (window), paned);
-
- box = vivi_vdock_new ();
- gtk_paned_add2 (GTK_PANED (paned), box);
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "player"));
- g_object_set (widget, "application", app, NULL);
- vivi_vdock_add (VIVI_VDOCK (box), widget);
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "command-line"));
- g_object_set (widget, "application", app, NULL);
- vivi_vdock_add (VIVI_VDOCK (box), widget);
- gtk_container_foreach (GTK_CONTAINER (widget), try_grab_focus, NULL);
-
- box = vivi_vdock_new ();
- gtk_paned_add1 (GTK_PANED (paned), box);
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "movies"));
- g_object_set (widget, "application", app, NULL);
- vivi_vdock_add (VIVI_VDOCK (box), widget);
-
- g_object_unref (builder);
-
- return window;
-}
-
-ViviApplication *
-vivi_window_get_application (ViviWindow *window)
-{
- g_return_val_if_fail (VIVI_IS_WINDOW (window), NULL);
-
- return window->app;
-}
-
-void
-vivi_window_set_movie (ViviWindow *window, SwfdecMovie *movie)
-{
- g_return_if_fail (VIVI_IS_WINDOW (window));
- g_return_if_fail (movie == NULL || SWFDEC_IS_MOVIE (movie));
-
- if (window->movie == movie)
- return;
-
- if (window->movie) {
- g_object_unref (window->movie);
- }
- window->movie = movie;
- if (window->movie) {
- g_object_ref (movie);
- }
- g_object_notify (G_OBJECT (window), "movie");
-}
-
diff --git a/vivified/ui/vivi_window.h b/vivified/ui/vivi_window.h
deleted file mode 100644
index 7edcd5a..0000000
--- a/vivified/ui/vivi_window.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Vivi
- * 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 _VIVI_WINDOW_H_
-#define _VIVI_WINDOW_H_
-
-#include <vivified/dock/vivified-dock.h>
-#include <vivified/core/vivified-core.h>
-/* FIXME */
-#include <swfdec/swfdec_movie.h>
-
-G_BEGIN_DECLS
-
-typedef struct _ViviWindow ViviWindow;
-typedef struct _ViviWindowClass ViviWindowClass;
-
-#define VIVI_TYPE_WINDOW (vivi_window_get_type())
-#define VIVI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIVI_TYPE_WINDOW))
-#define VIVI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIVI_TYPE_WINDOW))
-#define VIVI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIVI_TYPE_WINDOW, ViviWindow))
-#define VIVI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIVI_TYPE_WINDOW, ViviWindowClass))
-
-struct _ViviWindow
-{
- GtkWindow window;
-
- ViviApplication * app; /* application we are displaying */
-
- SwfdecMovie * movie; /* the currently active movie or NULL if none */
-};
-
-struct _ViviWindowClass
-{
- GtkWindowClass window_class;
-};
-
-GType vivi_window_get_type (void);
-
-GtkWidget * vivi_window_new (ViviApplication * app);
-
-ViviApplication * vivi_window_get_application (ViviWindow * window);
-void vivi_window_set_movie (ViviWindow * window,
- SwfdecMovie * movie);
-SwfdecMovie * vivi_window_get_movie (ViviWindow * window);
-
-
-G_END_DECLS
-#endif
commit 44db5884945b83a485d3405cb1f3195dd2344c2b
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Nov 5 18:30:36 2008 +0100
make XMLSockets stored in the player, not in object qdata
diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c
index b139fe3..4b204dc 100644
--- a/swfdec/swfdec_player.c
+++ b/swfdec/swfdec_player.c
@@ -1059,6 +1059,7 @@ swfdec_player_dispose (GObject *object)
G_OBJECT_CLASS (swfdec_player_parent_class)->dispose (object);
/* must happen after disposing context, some objects unroot themselves */
swfdec_function_list_clear (&priv->rooted);
+ g_assert (priv->xml_sockets == NULL); /* xml sockets do remove themselves */
swfdec_player_remove_all_external_actions (player, player);
#ifndef G_DISABLE_ASSERT
@@ -2080,6 +2081,7 @@ swfdec_player_mark (SwfdecAsContext *context)
g_list_foreach (priv->roots, (GFunc) swfdec_gc_object_mark, NULL);
g_list_foreach (priv->intervals, (GFunc) swfdec_gc_object_mark, NULL);
g_slist_foreach (priv->sandboxes, (GFunc) swfdec_gc_object_mark, NULL);
+ g_slist_foreach (priv->xml_sockets, (GFunc) swfdec_gc_object_mark, NULL);
swfdec_function_list_execute (&priv->rooted, player);
swfdec_gc_object_mark (priv->resource);
diff --git a/swfdec/swfdec_player_internal.h b/swfdec/swfdec_player_internal.h
index 0d0cda8..5a8cdaf 100644
--- a/swfdec/swfdec_player_internal.h
+++ b/swfdec/swfdec_player_internal.h
@@ -105,6 +105,7 @@ struct _SwfdecPlayerPrivate
guint interval_id; /* id returned from setInterval call */
GList * intervals; /* all currently running intervals */
GHashTable * registered_classes; /* name => SwfdecAsObject constructor */
+ GSList * xml_sockets; /* all XMLSockets currently in use */
/* rendering */
GArray * invalidations; /* fine-grained areas in need of redraw */
diff --git a/swfdec/swfdec_xml_socket.c b/swfdec/swfdec_xml_socket.c
index d2dc998..06cb7a2 100644
--- a/swfdec/swfdec_xml_socket.c
+++ b/swfdec/swfdec_xml_socket.c
@@ -32,24 +32,18 @@
#include "swfdec_movie.h"
#include "swfdec_player_internal.h"
-static GQuark xml_socket_quark = 0;
-
static void
swfdec_xml_socket_ensure_closed (SwfdecXmlSocket *xml)
{
+ SwfdecPlayer *player = SWFDEC_PLAYER (swfdec_gc_object_get_context (xml));
+
if (xml->socket == NULL)
return;
swfdec_stream_set_target (SWFDEC_STREAM (xml->socket), NULL);
g_object_unref (xml->socket);
xml->socket = NULL;
-
- swfdec_player_unroot (SWFDEC_PLAYER (swfdec_gc_object_get_context (xml)), xml);
- if (xml->target_owner) {
- g_object_steal_qdata (G_OBJECT (xml->target), xml_socket_quark);
- xml->target_owner = FALSE;
- }
- xml->target = NULL;
+ player->priv->xml_sockets = g_slist_remove (player->priv->xml_sockets, xml);
}
/*** SWFDEC_STREAM_TARGET ***/
@@ -208,34 +202,23 @@ swfdec_xml_socket_init (SwfdecXmlSocket *xml)
xml->queue = swfdec_buffer_queue_new ();
}
-static void
-swfdec_xml_socket_target_gone (gpointer xmlp)
-{
- SwfdecXmlSocket *xml = xmlp;
-
- xml->target_owner = FALSE;
-}
-
static SwfdecXmlSocket *
swfdec_xml_socket_create (SwfdecAsObject *target, SwfdecSandbox *sandbox, const char *hostname, guint port)
{
- SwfdecAsContext *cx = swfdec_gc_object_get_context (target);
+ SwfdecPlayer *player = SWFDEC_PLAYER (swfdec_gc_object_get_context (target));
SwfdecXmlSocket *xml;
SwfdecSocket *sock;
SWFDEC_FIXME ("implement security checks please");
- sock = swfdec_player_create_socket (SWFDEC_PLAYER (cx), hostname, port);
+ sock = swfdec_player_create_socket (player, hostname, port);
if (sock == NULL)
return NULL;
- xml = g_object_new (SWFDEC_TYPE_XML_SOCKET, "context", cx, NULL);
- swfdec_player_root (SWFDEC_PLAYER (cx), xml, (GFunc) swfdec_gc_object_mark);
+ xml = g_object_new (SWFDEC_TYPE_XML_SOCKET, "context", player, NULL);
+ /* we prepend here, so send etc find the newest socket */
+ player->priv->xml_sockets = g_slist_prepend (player->priv->xml_sockets, xml);
- if (xml_socket_quark == 0)
- xml_socket_quark = g_quark_from_static_string ("swfdec-xml-socket");
- g_object_set_qdata_full (G_OBJECT (target), xml_socket_quark, xml, swfdec_xml_socket_target_gone);
xml->target = target;
- xml->target_owner = TRUE;
xml->socket = sock;
xml->sandbox = sandbox;
swfdec_stream_set_target (SWFDEC_STREAM (sock), SWFDEC_STREAM_TARGET (xml));
@@ -249,27 +232,29 @@ static SwfdecXmlSocket *
swfdec_xml_socket_get (SwfdecAsObject *object)
{
SwfdecXmlSocket *xml;
+ SwfdecPlayer *player;
+ GSList *walk;
if (object == NULL) {
SWFDEC_WARNING ("no object to get xml socket from");
return NULL;
}
- if (xml_socket_quark == 0) {
- SWFDEC_WARNING ("no sockets have been created yet");
- return NULL;
- }
-
- xml = g_object_get_qdata (G_OBJECT (object), xml_socket_quark);
- if (xml == NULL) {
- SWFDEC_WARNING ("no xml socket on object");
- return NULL;
- }
- if (xml->socket == NULL) {
- SWFDEC_WARNING ("xml socket not open");
- return NULL;
+
+ player = SWFDEC_PLAYER (swfdec_gc_object_get_context (object));
+ for (walk = player->priv->xml_sockets; walk; walk = walk->next) {
+ xml = walk->data;
+
+ if (xml->target == object) {
+ if (xml->socket == NULL) {
+ SWFDEC_WARNING ("xml socket not open");
+ return NULL;
+ }
+ return xml;
+ }
}
- return xml;
+ SWFDEC_WARNING ("no xml socket on object");
+ return NULL;
}
@@ -299,6 +284,7 @@ swfdec_xml_socket_send (SwfdecAsContext *cx, SwfdecAsObject *object,
const char *send;
gsize len;
+ SWFDEC_AS_CHECK (0, NULL, "s", &send);
if (argc < 1)
return;
@@ -310,7 +296,6 @@ swfdec_xml_socket_send (SwfdecAsContext *cx, SwfdecAsObject *object,
return;
}
- send = swfdec_as_value_to_string (cx, &argv[0]);
len = strlen (send) + 1;
buf = swfdec_buffer_new (len);
memcpy (buf->data, send, len);
diff --git a/swfdec/swfdec_xml_socket.h b/swfdec/swfdec_xml_socket.h
index 66bff6e..cb1afbc 100644
--- a/swfdec/swfdec_xml_socket.h
+++ b/swfdec/swfdec_xml_socket.h
@@ -45,7 +45,6 @@ struct _SwfdecXmlSocket {
gboolean open; /* the socket has been opened already */
SwfdecBufferQueue * queue; /* everything that belongs to the same string */
SwfdecAsObject * target; /* target object we call out to */
- gboolean target_owner; /* TRUE if we own the target */
};
struct _SwfdecXmlSocketClass {
commit 1db8bbafea72e48fc941387d134f6b4048f19d26
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Nov 5 17:41:54 2008 +0100
get the SwfdecAsObject type out of the checks
diff --git a/swfdec/swfdec_load_object_as.c b/swfdec/swfdec_load_object_as.c
index 1f41642..a2431be 100644
--- a/swfdec/swfdec_load_object_as.c
+++ b/swfdec/swfdec_load_object_as.c
@@ -82,7 +82,9 @@ swfdec_load_object_as_load (SwfdecAsContext *cx, SwfdecAsObject *object, guint a
const char *url;
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, FALSE);
- SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_OBJECT, &object, "s", &url);
+ SWFDEC_AS_CHECK (0, NULL, "s", &url);
+ if (object == NULL)
+ return;
SWFDEC_AS_VALUE_SET_COMPOSITE (&val, object);
swfdec_load_object_create (SWFDEC_PLAYER (cx), &val, url, NULL, 0, NULL, NULL,
@@ -199,7 +201,9 @@ swfdec_load_object_as_send (SwfdecAsContext *cx, SwfdecAsObject *object,
SwfdecBuffer *buffer;
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, FALSE);
- SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_OBJECT, &object, "s|ss", &url, &target, &method);
+ SWFDEC_AS_CHECK (0, NULL, "s|ss", &url, &target, &method);
+ if (object == NULL)
+ return;
SWFDEC_AS_VALUE_SET_COMPOSITE (&val, object);
data = swfdec_as_value_to_string (cx, &val);
@@ -234,8 +238,10 @@ swfdec_load_object_as_sendAndLoad (SwfdecAsContext *cx, SwfdecAsObject *object,
SwfdecAsValue val;
SwfdecBuffer *buffer;
- SWFDEC_AS_CHECK (SWFDEC_TYPE_AS_OBJECT, &object, "so|s", &url, &target,
+ SWFDEC_AS_CHECK (0, NULL, "so|s", &url, &target,
&method);
+ if (object == NULL)
+ return;
SWFDEC_AS_VALUE_SET_COMPOSITE (&val, object);
data = swfdec_as_value_to_string (cx, &val);
commit 7839d98eac5fd008782c29deb54e40dce64c2917
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Nov 5 16:45:28 2008 +0100
make Socket a relay
and make it work dfferently - it's unused anyway
diff --git a/test/swfdec_test_initialize.as b/test/swfdec_test_initialize.as
index 753732c..7c76f1c 100644
--- a/test/swfdec_test_initialize.as
+++ b/test/swfdec_test_initialize.as
@@ -51,14 +51,12 @@ Socket = function () {};
Socket.prototype = {};
Socket.prototype.close = Native.Socket_close;
Socket.prototype.error = Native.Socket_error;
-Socket.prototype.receive = Native.Socket_receive;
Socket.prototype.send = Native.Socket_send;
Socket.prototype.addProperty ("closed", Native.Socket_get_closed, null);
Test = Native.Test;
Test.prototype = {};
Test.prototype.advance = Native.Test_advance;
-Test.prototype.getSocket = Native.Test_getSocket;
Test.prototype.mouse_move = Native.Test_mouse_move;
Test.prototype.mouse_press = Native.Test_mouse_press;
Test.prototype.mouse_release = Native.Test_mouse_release;
diff --git a/test/swfdec_test_initialize.h b/test/swfdec_test_initialize.h
index d481927..1971338 100644
--- a/test/swfdec_test_initialize.h
+++ b/test/swfdec_test_initialize.h
@@ -2,7 +2,7 @@
/* compiled from swfdec_test_initialize.as */
static const unsigned char swfdec_test_initialize[] = {
- 0x88, 0xBD, 0x03, 0x51, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x4E, 0x61, 0x74, 0x69,
+ 0x88, 0x8D, 0x03, 0x4D, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x4E, 0x61, 0x74, 0x69,
0x76, 0x65, 0x00, 0x6C, 0x6F, 0x61, 0x64, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5F, 0x6C,
0x6F, 0x61, 0x64, 0x00, 0x70, 0x72, 0x6F, 0x74, 0x6F, 0x74, 0x79, 0x70, 0x65, 0x00, 0x64, 0x69,
0x66, 0x66, 0x00, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5F, 0x64, 0x69, 0x66, 0x66, 0x00, 0x66,
@@ -40,14 +40,11 @@ static const unsigned char swfdec_test_initialize[] = {
0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x00,
0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x63, 0x6C,
0x6F, 0x73, 0x65, 0x00, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74,
- 0x5F, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x00, 0x53,
- 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x00, 0x53, 0x6F,
- 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x73, 0x65, 0x6E, 0x64, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64,
- 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73,
- 0x65, 0x64, 0x00, 0x54, 0x65, 0x73, 0x74, 0x00, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00,
- 0x54, 0x65, 0x73, 0x74, 0x5F, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x67, 0x65, 0x74,
- 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x67, 0x65, 0x74, 0x53,
- 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65,
+ 0x5F, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74, 0x5F, 0x73, 0x65,
+ 0x6E, 0x64, 0x00, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x53, 0x6F, 0x63, 0x6B, 0x65, 0x74,
+ 0x5F, 0x67, 0x65, 0x74, 0x5F, 0x63, 0x6C, 0x6F, 0x73, 0x65, 0x64, 0x00, 0x54, 0x65, 0x73, 0x74,
+ 0x00, 0x61, 0x64, 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x61, 0x64,
+ 0x76, 0x61, 0x6E, 0x63, 0x65, 0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65,
0x00, 0x54, 0x65, 0x73, 0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x6D, 0x6F, 0x76, 0x65,
0x00, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x54, 0x65, 0x73,
0x74, 0x5F, 0x6D, 0x6F, 0x75, 0x73, 0x65, 0x5F, 0x70, 0x72, 0x65, 0x73, 0x73, 0x00, 0x6D, 0x6F,
@@ -107,48 +104,44 @@ static const unsigned char swfdec_test_initialize[] = {
0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x29, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2A,
0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x18, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04,
0x00, 0x08, 0x2B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2C, 0x4E, 0x4F, 0x96, 0x02, 0x00,
- 0x08, 0x2D, 0x8E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x96, 0x02,
- 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F,
- 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08,
- 0x2B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2E, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x2F, 0x08, 0x01, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x30, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x31, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x32, 0x4E,
- 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00,
- 0x08, 0x29, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x33, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02,
- 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x35, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x34, 0x07, 0x03,
- 0x00, 0x00, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08,
- 0x17, 0x52, 0x17, 0x96, 0x04, 0x00, 0x08, 0x36, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x36,
- 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00,
- 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E,
- 0x96, 0x04, 0x00, 0x08, 0x37, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x38, 0x4E, 0x4F, 0x96,
- 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x39,
- 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3A, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3B, 0x08, 0x01, 0x1C, 0x96, 0x02,
- 0x00, 0x08, 0x3C, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04,
- 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3D, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3E, 0x4E, 0x4F,
- 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08,
- 0x3F, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x40, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x36,
- 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x41, 0x08, 0x01, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x42, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08,
- 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x43, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x44, 0x4E,
- 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x46, 0x4E, 0x96, 0x09,
- 0x00, 0x08, 0x45, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04,
- 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96,
- 0x02, 0x00, 0x08, 0x48, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x47, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08,
- 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96,
- 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x4A, 0x4E, 0x96, 0x09, 0x00, 0x08,
- 0x49, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x36, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
+ 0x08, 0x2D, 0x9B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x2D,
+ 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00,
+ 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x2B, 0x08, 0x01,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x2E, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02,
+ 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x2F, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x30, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
+ 0x04, 0x00, 0x08, 0x29, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x31, 0x4E, 0x4F, 0x96, 0x03,
+ 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x33, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x32,
+ 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x2D, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02,
+ 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x04, 0x00, 0x08, 0x34, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x34, 0x4E, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x07, 0x00, 0x08, 0x04, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x43, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08,
+ 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x35, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x36, 0x4E,
+ 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00,
+ 0x08, 0x37, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x38, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08,
+ 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x39, 0x08, 0x01, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x3A, 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00,
+ 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3B, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3C,
+ 0x4E, 0x4F, 0x96, 0x02, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04,
+ 0x00, 0x08, 0x3D, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x3E, 0x4E, 0x4F, 0x96, 0x02, 0x00,
+ 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x04, 0x00, 0x08, 0x3F, 0x08, 0x01,
+ 0x1C, 0x96, 0x02, 0x00, 0x08, 0x40, 0x4E, 0x4F, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96,
+ 0x02, 0x00, 0x08, 0x42, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x41, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08,
+ 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96,
+ 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x44, 0x4E, 0x96, 0x09, 0x00, 0x08,
+ 0x43, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96,
0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00, 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00,
- 0x08, 0x4C, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x4B, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x36, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00,
- 0x08, 0x4D, 0x8E, 0x0B, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, 0x27, 0x00,
- 0x96, 0x02, 0x00, 0x08, 0x4E, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08,
- 0x4F, 0x08, 0x4E, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C,
- 0x96, 0x02, 0x00, 0x08, 0x4D, 0x52, 0x17, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x2F, 0x8E, 0x0B, 0x00,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x4E,
- 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x50, 0x08, 0x4E, 0x1C, 0x47,
- 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x4D,
- 0x52, 0x17, 0x1D, 0x00
+ 0x08, 0x46, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x45, 0x07, 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C,
+ 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00, 0x08, 0x17, 0x52, 0x17, 0x96, 0x03, 0x00,
+ 0x02, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x48, 0x4E, 0x96, 0x09, 0x00, 0x08, 0x47, 0x07,
+ 0x03, 0x00, 0x00, 0x00, 0x08, 0x34, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x04, 0x4E, 0x96, 0x02, 0x00,
+ 0x08, 0x17, 0x52, 0x17, 0x96, 0x02, 0x00, 0x08, 0x49, 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73,
+ 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x4A, 0x1C, 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96,
+ 0x04, 0x00, 0x08, 0x4B, 0x08, 0x4A, 0x1C, 0x47, 0x96, 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00,
+ 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x49, 0x52, 0x17, 0x1D, 0x96, 0x02, 0x00, 0x08, 0x2F,
+ 0x9B, 0x07, 0x00, 0x00, 0x01, 0x00, 0x73, 0x00, 0x27, 0x00, 0x96, 0x02, 0x00, 0x08, 0x4A, 0x1C,
+ 0x12, 0x9D, 0x02, 0x00, 0x1B, 0x00, 0x96, 0x04, 0x00, 0x08, 0x4C, 0x08, 0x4A, 0x1C, 0x47, 0x96,
+ 0x07, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01, 0x1C, 0x96, 0x02, 0x00, 0x08, 0x49, 0x52,
+ 0x17, 0x1D, 0x00
};
diff --git a/test/swfdec_test_socket.c b/test/swfdec_test_socket.c
index bd2f5a5..8683c87 100644
--- a/test/swfdec_test_socket.c
+++ b/test/swfdec_test_socket.c
@@ -46,23 +46,27 @@ swfdec_test_throw (SwfdecAsContext *cx, const char *message, ...)
/*** SWFDEC_TEST_SOCKET ***/
-G_DEFINE_TYPE (SwfdecTestSocket, swfdec_test_socket, SWFDEC_TYPE_AS_OBJECT)
+G_DEFINE_TYPE (SwfdecTestSocket, swfdec_test_socket, SWFDEC_TYPE_AS_RELAY)
static void
swfdec_test_socket_do_close (SwfdecTestSocket *sock, gboolean success)
{
+ SwfdecAsContext *cx;
+ SwfdecAsValue val;
+
if (sock->plugin == NULL)
return;
+ cx = swfdec_gc_object_get_context (sock);
sock->plugin->finish (sock->plugin, success ? 0 : 1);
sock->plugin = NULL;
- if (sock->test->pending_sockets &&
- sock->test->pending_sockets->data == sock) {
- sock->test->pending_sockets = sock->test->pending_sockets->prev;
- }
- sock->test->sockets = g_list_remove (sock->test->sockets, sock);
+ sock->test->sockets = g_slist_remove (sock->test->sockets, sock);
sock->test = NULL;
+
+ SWFDEC_AS_VALUE_SET_BOOLEAN (&val, success);
+ swfdec_as_relay_call (SWFDEC_AS_RELAY (sock), swfdec_as_context_get_string (cx, "onClose"),
+ 1, &val, NULL);
}
static void
@@ -71,8 +75,6 @@ swfdec_test_socket_dispose (GObject *object)
SwfdecTestSocket *sock = SWFDEC_TEST_SOCKET (object);
swfdec_test_socket_do_close (sock, FALSE);
- swfdec_buffer_queue_unref (sock->receive_queue);
- sock->receive_queue = NULL;
G_OBJECT_CLASS (swfdec_test_socket_parent_class)->dispose (object);
}
@@ -88,7 +90,6 @@ swfdec_test_socket_class_init (SwfdecTestSocketClass *klass)
static void
swfdec_test_socket_init (SwfdecTestSocket *sock)
{
- sock->receive_queue = swfdec_buffer_queue_new ();
}
/*** AS CODE ***/
@@ -112,37 +113,6 @@ swfdec_test_socket_send (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc
swfdec_buffer_unref (buffer);
}
-SWFDEC_TEST_FUNCTION ("Socket_receive", swfdec_test_socket_receive)
-void
-swfdec_test_socket_receive (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
- SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestSocket *sock;
- SwfdecBuffer *buffer;
- gsize len = 0, depth;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_SOCKET, &sock, "|i", &len);
-
- depth = swfdec_buffer_queue_get_depth (sock->receive_queue);
- if (len > 0) {
- if (depth < len) {
- swfdec_test_throw (cx, "only %zu bytes available", depth);
- return;
- } else {
- buffer = swfdec_buffer_queue_pull (sock->receive_queue, len);
- }
- } else {
- if (depth == 0) {
- SWFDEC_AS_VALUE_SET_NULL (retval);
- return;
- } else {
- buffer = swfdec_buffer_queue_pull (sock->receive_queue, depth);
- }
- }
- SWFDEC_AS_VALUE_SET_OBJECT (retval, swfdec_as_relay_get_as_object (
- SWFDEC_AS_RELAY (swfdec_test_buffer_new (cx, buffer))));
-}
-
SWFDEC_TEST_FUNCTION ("Socket_error", swfdec_test_socket_error)
void
swfdec_test_socket_error (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
@@ -184,10 +154,14 @@ swfdec_test_socket_plugin_send (SwfdecTestPluginSocket *plugin, unsigned char *d
unsigned long length)
{
SwfdecTestSocket *sock = plugin->data;
- SwfdecBuffer *buffer;
+ SwfdecAsContext *cx = swfdec_gc_object_get_context (sock);
+ SwfdecTestBuffer *buffer;
+ SwfdecAsValue val;
- buffer = swfdec_buffer_new_for_data (g_memdup (data, length), length);
- swfdec_buffer_queue_push (sock->receive_queue, buffer);
+ buffer = swfdec_test_buffer_new (cx, swfdec_buffer_new_for_data (g_memdup (data, length), length));
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, swfdec_as_relay_get_as_object (SWFDEC_AS_RELAY (buffer)));
+ swfdec_as_relay_call (SWFDEC_AS_RELAY (sock), swfdec_as_context_get_string (cx, "onData"),
+ 1, &val, NULL);
}
static void
@@ -196,12 +170,13 @@ swfdec_test_socket_plugin_close (SwfdecTestPluginSocket *plugin)
swfdec_test_socket_do_close (plugin->data, TRUE);
}
-SwfdecAsObject *
+SwfdecTestSocket *
swfdec_test_socket_new (SwfdecTestTest *test, SwfdecTestPluginSocket *plugin)
{
- SwfdecAsValue val;
+ SwfdecAsObject *object;
+ SwfdecTestSocket *new;
SwfdecAsContext *cx;
- SwfdecAsObject *new;
+ SwfdecAsValue val;
g_return_val_if_fail (SWFDEC_IS_TEST_TEST (test), NULL);
g_return_val_if_fail (plugin != NULL, NULL);
@@ -209,24 +184,24 @@ swfdec_test_socket_new (SwfdecTestTest *test, SwfdecTestPluginSocket *plugin)
cx = swfdec_gc_object_get_context (test);
new = g_object_new (SWFDEC_TYPE_TEST_SOCKET, "context", cx, NULL);
- swfdec_as_object_get_variable (cx->global,
- swfdec_as_context_get_string (cx, "Socket"), &val);
- if (SWFDEC_AS_VALUE_IS_OBJECT (&val))
- swfdec_as_object_set_constructor (new, SWFDEC_AS_VALUE_GET_OBJECT (&val));
+ object = swfdec_as_object_new (cx, NULL);
+ swfdec_as_object_set_relay (object, SWFDEC_AS_RELAY (new));
+ swfdec_as_object_set_constructor_by_name (object,
+ swfdec_as_context_get_string (cx, "Socket"), NULL);
plugin->send = swfdec_test_socket_plugin_send;
plugin->close = swfdec_test_socket_plugin_close;
plugin->data = new;
- SWFDEC_TEST_SOCKET (new)->test = test;
- SWFDEC_TEST_SOCKET (new)->plugin = plugin;
- test->sockets = g_list_append (test->sockets, new);
+ new->test = test;
+ new->plugin = plugin;
+ test->sockets = g_slist_prepend (test->sockets, new);
SWFDEC_AS_VALUE_SET_STRING (&val,
swfdec_as_context_get_string (cx, plugin->host));
- swfdec_as_object_set_variable (new,
+ swfdec_as_object_set_variable (object,
swfdec_as_context_get_string (cx, "host"), &val);
swfdec_as_value_set_integer (cx, &val, plugin->port);
- swfdec_as_object_set_variable (new,
+ swfdec_as_object_set_variable (object,
swfdec_as_context_get_string (cx, "port"), &val);
return new;
diff --git a/test/swfdec_test_socket.h b/test/swfdec_test_socket.h
index f3a7625..46285cf 100644
--- a/test/swfdec_test_socket.h
+++ b/test/swfdec_test_socket.h
@@ -39,23 +39,22 @@ typedef struct _SwfdecTestSocketClass SwfdecTestSocketClass;
struct _SwfdecTestSocket
{
- SwfdecAsObject as_object;
+ SwfdecAsRelay relay;
SwfdecTestPluginSocket * plugin; /* the socket we manage or NULL if closed */
SwfdecTestTest * test; /* the test that spawned us */
- SwfdecBufferQueue * receive_queue; /* queue with received data */
};
struct _SwfdecTestSocketClass
{
- SwfdecAsObjectClass as_object_class;
+ SwfdecAsRelayClass relay_class;
};
-GType swfdec_test_socket_get_type (void);
+GType swfdec_test_socket_get_type (void);
-SwfdecAsObject *swfdec_test_socket_new (SwfdecTestTest * test,
- SwfdecTestPluginSocket * sock);
-void swfdec_test_socket_close (SwfdecTestSocket * sock);
+SwfdecTestSocket * swfdec_test_socket_new (SwfdecTestTest * test,
+ SwfdecTestPluginSocket * sock);
+void swfdec_test_socket_close (SwfdecTestSocket * sock);
G_END_DECLS
#endif
diff --git a/test/swfdec_test_test.c b/test/swfdec_test_test.c
index 5e49d36..75972fc 100644
--- a/test/swfdec_test_test.c
+++ b/test/swfdec_test_test.c
@@ -88,8 +88,14 @@ swfdec_test_test_request_socket (SwfdecTestPlugin *plugin,
SwfdecTestPluginSocket *psock)
{
SwfdecTestTest *test = SWFDEC_TEST_TEST_FROM_PLUGIN (plugin);
-
- swfdec_test_socket_new (test, psock);
+ SwfdecAsContext *cx = swfdec_gc_object_get_context (test);
+ SwfdecTestSocket *sock;
+ SwfdecAsValue val;
+
+ sock = swfdec_test_socket_new (test, psock);
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, swfdec_as_relay_get_as_object (SWFDEC_AS_RELAY (sock)));
+ swfdec_as_relay_call (SWFDEC_AS_RELAY (test), swfdec_as_context_get_string (cx, "onSocket"),
+ 1, &val, NULL);
}
static void
@@ -143,7 +149,6 @@ swfdec_test_test_unload_plugin (SwfdecTestTest *test)
/* unload all objects generated by the plugin first */
while (test->sockets)
swfdec_test_socket_close (test->sockets->data);
- test->pending_sockets = NULL;
test->plugin.finish (&test->plugin);
g_free (test->plugin.filename);
@@ -185,11 +190,24 @@ swfdec_test_test_dispose (GObject *object)
}
static void
+swfdec_test_test_mark (SwfdecGcObject *object)
+{
+ SwfdecTestTest *test = SWFDEC_TEST_TEST (object);
+
+ g_slist_foreach (test->sockets, (GFunc) swfdec_gc_object_mark, NULL);
+
+ SWFDEC_GC_OBJECT_CLASS (swfdec_test_test_parent_class)->mark (object);
+}
+
+static void
swfdec_test_test_class_init (SwfdecTestTestClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ SwfdecGcObjectClass *gc_class = SWFDEC_GC_OBJECT_CLASS (klass);
object_class->dispose = swfdec_test_test_dispose;
+
+ gc_class->mark = swfdec_test_test_mark;
}
static void
@@ -375,32 +393,6 @@ swfdec_test_test_get_launched (SwfdecAsContext *cx, SwfdecAsObject *object,
SWFDEC_AS_VALUE_SET_OBJECT (retval, swfdec_as_relay_get_as_object (SWFDEC_AS_RELAY (buf)));
}
-SWFDEC_TEST_FUNCTION ("Socket_getSocket", swfdec_test_test_getSocket)
-void
-swfdec_test_test_getSocket (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
- SwfdecAsValue *argv, SwfdecAsValue *retval)
-{
- SwfdecTestTest *test;
-
- SWFDEC_AS_CHECK (SWFDEC_TYPE_TEST_TEST, &test, "");
-
- if (test->pending_sockets == NULL) {
- if (test->sockets == NULL) {
- SWFDEC_AS_VALUE_SET_NULL (retval);
- } else {
- test->pending_sockets = test->sockets;
- SWFDEC_AS_VALUE_SET_OBJECT (retval, test->pending_sockets->data);
- }
- } else {
- if (test->pending_sockets->next == NULL) {
- SWFDEC_AS_VALUE_SET_NULL (retval);
- } else {
- test->pending_sockets = test->pending_sockets->next;
- SWFDEC_AS_VALUE_SET_OBJECT (retval, test->pending_sockets->data);
- }
- }
-}
-
SWFDEC_TEST_FUNCTION ("Test_get_trace", swfdec_test_test_get_trace)
void
swfdec_test_test_get_trace (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,
diff --git a/test/swfdec_test_test.h b/test/swfdec_test_test.h
index bc82863..ba3d18b 100644
--- a/test/swfdec_test_test.h
+++ b/test/swfdec_test_test.h
@@ -51,8 +51,7 @@ struct _SwfdecTestTest
SwfdecBufferQueue * trace; /* all captured trace output */
SwfdecBufferQueue * launched; /* all launched urls */
- GList * sockets; /* list of all sockets */
- GList * pending_sockets;/* last socket handed out or NULL if none given out */
+ GSList * sockets; /* list of all sockets */
};
struct _SwfdecTestTestClass
More information about the Swfdec-commits
mailing list