[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ./ChangeLog backend/gnash.cpp backend/gtk...
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash ./ChangeLog backend/gnash.cpp backend/gtk... |
Date: |
Mon, 10 Apr 2006 20:21:39 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: Rob Savoye <address@hidden> 06/04/10 20:21:39
Modified files:
. : ChangeLog
backend : gnash.cpp gtksup.cpp
plugin : plugin.cpp
server : Makefile.am Movie.cpp Movie.h Sprite.cpp
Sprite.h action.cpp gnash.h impl.h
xmlsocket.cpp
Log message:
Cleanup undefined variables.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.207&tr2=1.208&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/gnash.cpp.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/gtksup.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.cpp.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Makefile.am.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.cpp.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.h.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Sprite.cpp.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Sprite.h.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/action.cpp.diff?tr1=1.59&tr2=1.60&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/gnash.h.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/impl.h.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xmlsocket.cpp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.207 gnash/ChangeLog:1.208
--- gnash/ChangeLog:1.207 Mon Apr 10 01:18:11 2006
+++ gnash/ChangeLog Mon Apr 10 20:21:39 2006
@@ -1,3 +1,8 @@
+2006-04-10 Rob Savoye <address@hidden>
+
+ * server/action.cpp: It the url for getUrl() startes with a
+ "http:", then remotely tell firefox to load the page.
+
2006-04-09 Rob Savoye <address@hidden>
* plugin/klash/klash_part.cpp: Use the new options to set the
Index: gnash/backend/gnash.cpp
diff -u gnash/backend/gnash.cpp:1.23 gnash/backend/gnash.cpp:1.24
--- gnash/backend/gnash.cpp:1.23 Thu Apr 6 15:09:30 2006
+++ gnash/backend/gnash.cpp Mon Apr 10 20:21:39 2006
@@ -79,16 +79,6 @@
static void version_and_copyright();
static int runThread(void *nothing);
-bool gofast = false; // FIXME: this flag gets set based on
- // an XML message written using
- // SendCommand(""). This way a movie
- // can optimize it's own performance
- // when needed,
-bool nodelay = false; // FIXME: this flag gets set based on
- // an XML message written using
- // SendCommand(""). This way a movie
- // can optimize it's own performance
- // when needed,
int xml_fd; // FIXME: this is the file descriptor
// from XMLSocket::connect(). This
// needs to be propogated up through
@@ -120,6 +110,12 @@
extern int width;
extern int height;
+#ifndef HAVE_GTK2
+extern int windowid;
+#else
+extern GdkNativeWindow windowid;
+#endif
+
// Define is you just want a hard coded OpenGL graphic
//#define TEST_GRAPHIC
@@ -243,11 +239,6 @@
bool sdl_abort = true;
int delay = 31;
float tex_lod_bias;
-#ifndef HAVE_GTK2
- int windowid = 0;
-#else
- GdkNativeWindow windowid = 0;
-#endif
// -1.0 tends to look good.
tex_lod_bias = -1.2f;
@@ -657,7 +648,7 @@
// printf("xml_fd is %d, gofast is %d, s_start_waiting is %d,
s_event_thread is %d\n",
// xml_fd, gofast, s_start_waiting, s_event_thread);
#ifdef HAVE_LIBXML
- if (s_event_thread && s_start_waiting && (xml_fd > 0) &&
!gofast) {
+ if (s_event_thread && s_start_waiting && (xml_fd > 0)) {
// if (s_event_thread &&
(xml_fd > 0)) {
// printf("SDL_WaitEvent!\n");
ret = SDL_WaitEvent(&event);
@@ -671,10 +662,10 @@
}
#else
// If we have no libxml, obey what the gofast variable is set
to
- if (gofast)
+// if (gofast)
ret = SDL_PollEvent(&event) ? true : false;
- else
- ret = SDL_WaitEvent(&event);
+// else
+// ret = SDL_WaitEvent(&event);
#endif
// printf("EVENT Type is %d\n", event.type);
@@ -935,9 +926,9 @@
if (s_measure_performance == false) {
// Don't hog the CPU.
// if (!nodelay)
- if (!gofast) {
+// if (!gofast) {
SDL_Delay(delay);
- }
+// }
} else {
// Log the frame rate every second or so.
if (last_ticks - last_logged_fps > 1000) {
Index: gnash/backend/gtksup.cpp
diff -u gnash/backend/gtksup.cpp:1.2 gnash/backend/gtksup.cpp:1.3
--- gnash/backend/gtksup.cpp:1.2 Thu Apr 6 15:09:30 2006
+++ gnash/backend/gtksup.cpp Mon Apr 10 20:21:39 2006
@@ -77,7 +77,7 @@
gint
popup_handler(GtkWidget *widget, GdkEvent *event)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
GtkMenu *menu;
GdkEventButton *event_button;
@@ -99,7 +99,7 @@
void
menuitem_restart_callback(GtkMenuItem *menuitem, gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = RESTART_MOVIE;
}
@@ -107,7 +107,7 @@
void
menuitem_quit_callback(GtkMenuItem *menuitem, gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = QUIT_MOVIE;
delete_event(GTK_WIDGET(menuitem), NULL, data);
}
@@ -116,7 +116,7 @@
void
menuitem_play_callback(GtkMenuItem *menuitem, gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = PLAY_MOVIE;
}
@@ -125,7 +125,7 @@
menuitem_pause_callback(GtkMenuItem * menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = PAUSE_MOVIE;
}
@@ -134,7 +134,7 @@
menuitem_stop_callback(GtkMenuItem *menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = STOP_MOVIE;
}
@@ -143,7 +143,7 @@
menuitem_step_forward_callback(GtkMenuItem *menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = STEP_FORWARD;
}
@@ -152,7 +152,7 @@
menuitem_step_backward_callback(GtkMenuItem *menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = STEP_BACKWARD;
}
@@ -161,7 +161,7 @@
menuitem_jump_forward_callback(GtkMenuItem *menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = JUMP_FORWARD;
}
@@ -170,7 +170,7 @@
menuitem_jump_backward_callback(GtkMenuItem *menuitem,
gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
movie_menu_state = JUMP_BACKWARD;
}
@@ -242,7 +242,7 @@
gboolean
delete_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
// Only use gtk_main_quit() if gtk_main() is used. For now, we're using
// a gtk_main_iteration() to do it in a polling fashion instead.
// gtk_main_quit();
@@ -254,7 +254,7 @@
gboolean
realize_event(GtkWidget *widget, GdkEvent *event, gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
#ifdef TEST_GRAPHIC
GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
@@ -312,7 +312,7 @@
GdkEventExpose *const event,
const gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
GdkGLDrawable *const gldrawable = gtk_widget_get_gl_drawable(widget);
g_assert(gldrawable);
@@ -352,7 +352,7 @@
GdkEventConfigure *const event,
const gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
GdkGLContext *glcontext = gtk_widget_get_gl_context (widget);
GdkGLDrawable *gldrawable = gtk_widget_get_gl_drawable (widget);
@@ -386,7 +386,7 @@
GdkEventKey *const event,
const gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
switch (event->keyval) {
case XK_Home:
@@ -475,7 +475,7 @@
GdkEventButton *const event,
const gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
int mask = 1 << (event->button - 1);
mouse_buttons |= mask;
@@ -491,7 +491,7 @@
GdkEventButton * const event,
const gpointer data)
{
- GNASH_REPORT_FUNCTION;
+// GNASH_REPORT_FUNCTION;
int mask = 1 << (event->button - 1);
mouse_buttons &= ~mask;
Index: gnash/plugin/plugin.cpp
diff -u gnash/plugin/plugin.cpp:1.25 gnash/plugin/plugin.cpp:1.26
--- gnash/plugin/plugin.cpp:1.25 Wed Apr 5 05:40:17 2006
+++ gnash/plugin/plugin.cpp Mon Apr 10 20:21:39 2006
@@ -93,7 +93,7 @@
using namespace std;
using namespace gnash;
-extern bool processing;
+bool processing;
extern NPNetscapeFuncs NPNFuncs;
Index: gnash/server/Makefile.am
diff -u gnash/server/Makefile.am:1.25 gnash/server/Makefile.am:1.26
--- gnash/server/Makefile.am:1.25 Thu Mar 30 19:12:53 2006
+++ gnash/server/Makefile.am Mon Apr 10 20:21:39 2006
@@ -58,6 +58,11 @@
$(SDL_CFLAGS) \
$(SDL_MIXER_CFLAGS) \
$(OPENGL_CFLAGS) \
+ $(GTK2_CFLAGS) \
+ $(PANGO_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(CAIRO_CFLAGS) \
+ $(ATK_CFLAGS) \
$(DMALLOC_CFLAGS) \
$(LIBXML_CFLAGS)
Index: gnash/server/Movie.cpp
diff -u gnash/server/Movie.cpp:1.12 gnash/server/Movie.cpp:1.13
--- gnash/server/Movie.cpp:1.12 Wed Mar 29 05:42:41 2006
+++ gnash/server/Movie.cpp Mon Apr 10 20:21:39 2006
@@ -40,6 +40,8 @@
#endif
#include <iostream>
+#include <string>
+
#include "Movie.h"
#include "tu_file.h"
#include "zlib_adapter.h"
@@ -56,765 +58,774 @@
namespace gnash
{
- // Forward declarations
+// Forward declarations
+
+// @@ should be found somewhere else I guess..
+//movie_interface* create_instance();
+
+//
+// progress callback stuff (from Vitaly)
+//
+progress_callback s_progress_function = NULL;
+
+// Host calls this to register a function for progress bar handling
+// during loading movies.
+void
+register_progress_callback(progress_callback progress_handle)
+{
+ s_progress_function = progress_handle;
+}
- // @@ should be found somewhere else I guess..
- //movie_interface* create_instance();
+//
+// some utility stuff
+//
- //
- // progress callback stuff (from Vitaly)
- //
- progress_callback s_progress_function = NULL;
-
- // Host calls this to register a function for progress bar handling
- // during loading movies.
- void
- register_progress_callback(progress_callback progress_handle)
- {
- s_progress_function = progress_handle;
- }
-
- //
- // some utility stuff
- //
-
- void dump_tag_bytes(stream* in)
- // Log the contents of the current tag, in hex.
- {
- static const int ROW_BYTES = 16;
- char row_buf[ROW_BYTES];
- int row_count = 0;
-
- while(in->get_position() < in->get_tag_end_position())
- {
- int c = in->read_u8();
- log_msg("%02X", c);
-
- if (c < 32) c = '.';
- if (c > 127) c = '.';
- row_buf[row_count] = c;
+void dump_tag_bytes(stream* in)
+ // Log the contents of the current tag, in hex.
+{
+ static const int ROW_BYTES = 16;
+ char row_buf[ROW_BYTES];
+ int row_count = 0;
+
+ while(in->get_position() < in->get_tag_end_position())
+ {
+ int c = in->read_u8();
+ log_msg("%02X", c);
+
+ if (c < 32) c = '.';
+ if (c > 127) c = '.';
+ row_buf[row_count] = c;
- row_count++;
- if (row_count >= ROW_BYTES)
- {
- log_msg(" ");
- for (int i = 0; i < ROW_BYTES; i++)
- {
- log_msg("%c", row_buf[i]);
- }
-
- log_msg("\n");
- row_count = 0;
- }
- else
- {
- log_msg(" ");
- }
- }
-
- if (row_count > 0)
- {
- log_msg("\n");
- }
- }
-
-
-
-
- //
- // movie_def_impl
- //
-
- movie_def_impl::~movie_def_impl()
- {
- // Release our playlist data.
- {for (int i = 0, n = m_playlist.size(); i < n; i++)
- {
- for (int j = 0, m = m_playlist[i].size(); j < m; j++)
- {
- delete m_playlist[i][j];
- }
- }}
-
- // Release init action data.
- {for (int i = 0, n = m_init_action_list.size(); i < n; i++)
- {
- for (int j = 0, m = m_init_action_list[i].size(); j < m;
j++)
- {
- delete m_init_action_list[i][j];
- }
- }}
-
- assert(m_jpeg_in == NULL); // It's supposed to be cleaned up in
read()
- }
-
- bool movie_def_impl::in_import_table(int character_id)
- {
- for (int i = 0, n = m_imports.size(); i < n; i++)
- {
- if (m_imports[i].m_character_id == character_id)
- {
- return true;
- }
- }
- return false;
- }
-
- void movie_def_impl::visit_imported_movies(import_visitor* visitor)
- {
- stringi_hash<bool> visited; // ugh!
-
- for (int i = 0, n = m_imports.size(); i < n; i++)
- {
- import_info& inf = m_imports[i];
- if (visited.find(inf.m_source_url) == visited.end())
- {
- // Call back the visitor.
- visitor->visit(inf.m_source_url.c_str());
- visited[inf.m_source_url] = true;
- }
- }
- }
-
- void movie_def_impl::resolve_import(const char* source_url,
movie_definition* source_movie)
- {
- // @@ should be safe, but how can we verify
- // it? Compare a member function pointer, or
- // something?
- movie_def_impl* def_impl =
static_cast<movie_def_impl*>(source_movie);
- movie_definition* def = static_cast<movie_definition*>(def_impl);
-
- // Iterate in reverse, since we remove stuff along the way.
- for (int i = m_imports.size() - 1; i >= 0; i--)
- {
- const import_info& inf = m_imports[i];
- if (inf.m_source_url == source_url)
- {
- // Do the import.
- smart_ptr<resource> res =
def->get_exported_resource(inf.m_symbol);
- bool imported = true;
-
- if (res == NULL)
- {
- log_error("import error: resource '%s' is
not exported from movie '%s'\n",
- inf.m_symbol.c_str(), source_url);
- }
- else if (font* f = res->cast_to_font())
- {
- // Add this shared font to our fonts.
- add_font(inf.m_character_id, f);
- imported = true;
- }
- else if (character_def* ch =
res->cast_to_character_def())
- {
- // Add this character to our characters.
- add_character(inf.m_character_id, ch);
- imported = true;
- }
- else
- {
- log_error("import error: resource '%s' from
movie '%s' has unknown type\n",
- inf.m_symbol.c_str(), source_url);
- }
-
- if (imported)
- {
- m_imports.erase(m_imports.begin() + i);
-
- // Hold a ref, to keep this source
movie_definition alive.
-
m_import_source_movies.push_back(source_movie);
- }
- }
- }
- }
-
- void movie_def_impl::add_character(int character_id, character_def* c)
- {
- assert(c);
- m_characters.add(character_id, c);
- }
+ row_count++;
+ if (row_count >= ROW_BYTES)
+ {
+ log_msg(" ");
+ for (int i = 0; i < ROW_BYTES; i++)
+ {
+ log_msg("%c", row_buf[i]);
+ }
+
+ log_msg("\n");
+ row_count = 0;
+ }
+ else
+ {
+ log_msg(" ");
+ }
+ }
+
+ if (row_count > 0)
+ {
+ log_msg("\n");
+ }
+}
+
+
+
- character_def* movie_def_impl::get_character_def(int character_id)
- {
+//
+// movie_def_impl
+//
+
+movie_def_impl::~movie_def_impl()
+{
+ // Release our playlist data.
+ {for (int i = 0, n = m_playlist.size(); i < n; i++)
+ {
+ for (int j = 0, m = m_playlist[i].size(); j < m; j++)
+ {
+ delete m_playlist[i][j];
+ }
+ }}
+
+ // Release init action data.
+ {for (int i = 0, n = m_init_action_list.size(); i < n; i++)
+ {
+ for (int j = 0, m = m_init_action_list[i].size(); j < m; j++)
+ {
+ delete m_init_action_list[i][j];
+ }
+ }}
+
+ assert(m_jpeg_in == NULL); // It's supposed to be cleaned up in read()
+}
+
+bool movie_def_impl::in_import_table(int character_id)
+{
+ for (int i = 0, n = m_imports.size(); i < n; i++)
+ {
+ if (m_imports[i].m_character_id == character_id)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+void movie_def_impl::visit_imported_movies(import_visitor* visitor)
+{
+ stringi_hash<bool> visited; // ugh!
+
+ for (int i = 0, n = m_imports.size(); i < n; i++)
+ {
+ import_info& inf = m_imports[i];
+ if (visited.find(inf.m_source_url) == visited.end())
+ {
+ // Call back the visitor.
+ visitor->visit(inf.m_source_url.c_str());
+ visited[inf.m_source_url] = true;
+ }
+ }
+}
+
+void movie_def_impl::resolve_import(const char* source_url, movie_definition*
source_movie)
+{
+ // @@ should be safe, but how can we verify
+ // it? Compare a member function pointer, or
+ // something?
+ movie_def_impl* def_impl = static_cast<movie_def_impl*>(source_movie);
+ movie_definition* def = static_cast<movie_definition*>(def_impl);
+
+ // Iterate in reverse, since we remove stuff along the way.
+ for (int i = m_imports.size() - 1; i >= 0; i--)
+ {
+ const import_info& inf = m_imports[i];
+ if (inf.m_source_url == source_url)
+ {
+ // Do the import.
+ smart_ptr<resource> res =
def->get_exported_resource(inf.m_symbol);
+ bool imported = true;
+
+ if (res == NULL)
+ {
+ log_error("import error: resource '%s' is not
exported from movie '%s'\n",
+ inf.m_symbol.c_str(), source_url);
+ }
+ else if (font* f = res->cast_to_font())
+ {
+ // Add this shared font to our fonts.
+ add_font(inf.m_character_id, f);
+ imported = true;
+ }
+ else if (character_def* ch = res->cast_to_character_def())
+ {
+ // Add this character to our characters.
+ add_character(inf.m_character_id, ch);
+ imported = true;
+ }
+ else
+ {
+ log_error("import error: resource '%s' from movie
'%s' has unknown type\n",
+ inf.m_symbol.c_str(), source_url);
+ }
+
+ if (imported)
+ {
+ m_imports.erase(m_imports.begin() + i);
+
+ // Hold a ref, to keep this source
movie_definition alive.
+ m_import_source_movies.push_back(source_movie);
+ }
+ }
+ }
+}
+
+void movie_def_impl::add_character(int character_id, character_def* c)
+{
+ assert(c);
+ m_characters.add(character_id, c);
+}
+
+character_def* movie_def_impl::get_character_def(int character_id)
+{
#ifndef NDEBUG
- // make sure character_id is resolved
- if (in_import_table(character_id))
- {
- log_error("get_character_def(): character_id %d is still
waiting to be imported\n",
- character_id);
- }
+ // make sure character_id is resolved
+ if (in_import_table(character_id))
+ {
+ log_error("get_character_def(): character_id %d is still waiting
to be imported\n",
+ character_id);
+ }
#endif // not NDEBUG
- smart_ptr<character_def> ch;
- m_characters.get(character_id, &ch);
- assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
- }
-
- void movie_def_impl::add_font(int font_id, font* f)
- {
- assert(f);
- m_fonts.add(font_id, f);
- }
+ smart_ptr<character_def> ch;
+ m_characters.get(character_id, &ch);
+ assert(ch == NULL || ch->get_ref_count() > 1);
+ return ch.get_ptr();
+}
+
+void movie_def_impl::add_font(int font_id, font* f)
+{
+ assert(f);
+ m_fonts.add(font_id, f);
+}
- font* movie_def_impl::get_font(int font_id)
- {
+font* movie_def_impl::get_font(int font_id)
+{
#ifndef NDEBUG
- // make sure font_id is resolved
- if (in_import_table(font_id))
- {
- log_error("get_font(): font_id %d is still waiting to be
imported\n",
- font_id);
- }
+ // make sure font_id is resolved
+ if (in_import_table(font_id))
+ {
+ log_error("get_font(): font_id %d is still waiting to be
imported\n",
+ font_id);
+ }
#endif // not NDEBUG
- smart_ptr<font> f;
- m_fonts.get(font_id, &f);
- assert(f == NULL || f->get_ref_count() > 1);
- return f.get_ptr();
- }
-
- bitmap_character_def* movie_def_impl::get_bitmap_character(int
character_id)
- {
- smart_ptr<bitmap_character_def> ch;
- m_bitmap_characters.get(character_id, &ch);
- assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
- }
-
- void movie_def_impl::add_bitmap_character(int character_id,
bitmap_character_def* ch)
- {
- assert(ch);
- m_bitmap_characters.add(character_id, ch);
-
- add_bitmap_info(ch->get_bitmap_info());
- }
-
- sound_sample* movie_def_impl::get_sound_sample(int character_id)
- {
- smart_ptr<sound_sample> ch;
- m_sound_samples.get(character_id, &ch);
- assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
- }
-
- void movie_def_impl::add_sound_sample(int character_id, sound_sample* sam)
- {
- assert(sam);
- m_sound_samples.add(character_id, sam);
- }
-
-
- // Read a .SWF movie.
- void movie_def_impl::read(tu_file* in)
- {
- Uint32 file_start_pos = in->get_position();
- Uint32 header = in->read_le32();
- m_file_length = in->read_le32();
- Uint32 file_end_pos = file_start_pos + m_file_length;
-
- m_version = (header >> 24) & 255;
- if ((header & 0x0FFFFFF) != 0x00535746
- && (header & 0x0FFFFFF) != 0x00535743)
- {
- // ERROR
- log_error("gnash::movie_def_impl::read() -- file does not
start with a SWF header!\n");
- return;
- }
- bool compressed = (header & 255) == 'C';
-
- IF_VERBOSE_PARSE(log_msg("version = %d, file_length = %d\n",
m_version, m_file_length));
-
- tu_file* original_in = NULL;
- if (compressed)
- {
+ smart_ptr<font> f;
+ m_fonts.get(font_id, &f);
+ assert(f == NULL || f->get_ref_count() > 1);
+ return f.get_ptr();
+}
+
+bitmap_character_def* movie_def_impl::get_bitmap_character(int character_id)
+{
+ smart_ptr<bitmap_character_def> ch;
+ m_bitmap_characters.get(character_id, &ch);
+ assert(ch == NULL || ch->get_ref_count() > 1);
+ return ch.get_ptr();
+}
+
+void movie_def_impl::add_bitmap_character(int character_id,
bitmap_character_def* ch)
+{
+ assert(ch);
+ m_bitmap_characters.add(character_id, ch);
+
+ add_bitmap_info(ch->get_bitmap_info());
+}
+
+sound_sample* movie_def_impl::get_sound_sample(int character_id)
+{
+ smart_ptr<sound_sample> ch;
+ m_sound_samples.get(character_id, &ch);
+ assert(ch == NULL || ch->get_ref_count() > 1);
+ return ch.get_ptr();
+}
+
+void movie_def_impl::add_sound_sample(int character_id, sound_sample* sam)
+{
+ assert(sam);
+ m_sound_samples.add(character_id, sam);
+}
+
+
+// Read a .SWF movie.
+void movie_def_impl::read(tu_file* in)
+{
+ Uint32 file_start_pos = in->get_position();
+ Uint32 header = in->read_le32();
+ m_file_length = in->read_le32();
+ Uint32 file_end_pos = file_start_pos + m_file_length;
+
+ m_version = (header >> 24) & 255;
+ if ((header & 0x0FFFFFF) != 0x00535746
+ && (header & 0x0FFFFFF) != 0x00535743)
+ {
+ // ERROR
+ log_error("gnash::movie_def_impl::read() -- file does not start
with a SWF header!\n");
+ return;
+ }
+ bool compressed = (header & 255) == 'C';
+
+ IF_VERBOSE_PARSE(log_msg("version = %d, file_length = %d\n", m_version,
m_file_length));
+
+ tu_file* original_in = NULL;
+ if (compressed)
+ {
#if TU_CONFIG_LINK_TO_ZLIB == 0
- log_error("movie_def_impl::read(): unable to read zipped
SWF data; TU_CONFIG_LINK_TO_ZLIB is 0\n");
- return;
+ log_error("movie_def_impl::read(): unable to read zipped SWF data;
TU_CONFIG_LINK_TO_ZLIB is 0\n");
+ return;
#endif
- IF_VERBOSE_PARSE(log_msg("file is compressed.\n"));
- original_in = in;
+ IF_VERBOSE_PARSE(log_msg("file is compressed.\n"));
+ original_in = in;
- // Uncompress the input as we read it.
- in = zlib_adapter::make_inflater(original_in);
+ // Uncompress the input as we read it.
+ in = zlib_adapter::make_inflater(original_in);
- // Subtract the size of the 8-byte header, since
- // it's not included in the compressed
- // stream length.
- file_end_pos = m_file_length - 8;
- }
-
- stream str(in);
-
- m_frame_size.read(&str);
- m_frame_rate = str.read_u16() / 256.0f;
- m_frame_count = str.read_u16();
-
- m_playlist.resize(m_frame_count);
- m_init_action_list.resize(m_frame_count);
-
- IF_VERBOSE_PARSE(m_frame_size.print());
- IF_VERBOSE_PARSE(log_msg("frame rate = %f, frames = %d\n",
m_frame_rate, m_frame_count));
-
- while ((Uint32) str.get_position() < file_end_pos)
- {
- int tag_type = str.open_tag();
-
- if (s_progress_function != NULL)
- {
- s_progress_function((Uint32) str.get_position(),
file_end_pos);
- }
-
- loader_function lf = NULL;
- //IF_VERBOSE_PARSE(log_msg("tag_type = %d\n", tag_type));
- if (tag_type == 1)
- {
- // show frame tag -- advance to the next frame.
- IF_VERBOSE_PARSE(log_msg(" show_frame\n"));
- m_loading_frame++;
- }
- else if (s_tag_loaders.get(tag_type, &lf))
- {
- // call the tag loader. The tag loader should add
- // characters or tags to the movie data structure.
- (*lf)(&str, tag_type, this);
-
- } else {
- // no tag loader for this tag type.
- IF_VERBOSE_PARSE(log_msg("*** no tag loader for
type %d\n", tag_type));
- IF_VERBOSE_PARSE(dump_tag_bytes(&str));
- }
-
- str.close_tag();
-
- if (tag_type == 0)
- {
- if ((unsigned int) str.get_position() !=
file_end_pos)
- {
- // Safety break, so we don't read past the
end of the
- // movie.
- log_msg("warning: hit stream-end tag, but
not at the "
- "end of the file yet; stopping for
safety\n");
- break;
- }
- }
- }
-
- if (m_jpeg_in)
- {
- delete m_jpeg_in;
- m_jpeg_in = NULL;
- }
-
- if (original_in)
- {
- // Done with the zlib_adapter.
- delete in;
- }
- }
-
-
- /* movie_def_impl */
- void movie_def_impl::get_owned_fonts(std::vector<font*>* fonts)
- // Fill up *fonts with fonts that we own.
- {
- assert(fonts);
- fonts->resize(0);
-
- std::vector<int> font_ids;
-
- for (hash<int, smart_ptr<font> >::iterator it = m_fonts.begin();
- it != m_fonts.end();
- ++it)
- {
- font* f = it->second.get_ptr();
- if (f->get_owning_movie() == this)
- {
- // Sort by character id, so the ordering is
- // consistent for cache read/write.
- int id = it->first;
-
- // Insert in correct place.
- unsigned int insert;
- for (insert = 0; insert < font_ids.size(); insert++)
- {
- if (font_ids[insert] > id)
- {
- // We want to insert here.
- break;
- }
- }
- fonts->insert(fonts->begin() + insert, f);
- font_ids.insert(font_ids.begin() + insert, id);
- }
- }
- }
-
-
- /* movie_def_impl */
- void movie_def_impl::generate_font_bitmaps()
- // Generate bitmaps for our fonts, if necessary.
- {
- // Collect list of fonts.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::generate_font_bitmaps(fonts, this);
- }
+ // Subtract the size of the 8-byte header, since
+ // it's not included in the compressed
+ // stream length.
+ file_end_pos = m_file_length - 8;
+ }
+
+ stream str(in);
+
+ m_frame_size.read(&str);
+ m_frame_rate = str.read_u16() / 256.0f;
+ m_frame_count = str.read_u16();
+
+ m_playlist.resize(m_frame_count);
+ m_init_action_list.resize(m_frame_count);
+
+ IF_VERBOSE_PARSE(m_frame_size.print());
+ IF_VERBOSE_PARSE(log_msg("frame rate = %f, frames = %d\n", m_frame_rate,
m_frame_count));
+
+ while ((Uint32) str.get_position() < file_end_pos)
+ {
+ int tag_type = str.open_tag();
+
+ if (s_progress_function != NULL)
+ {
+ s_progress_function((Uint32) str.get_position(),
file_end_pos);
+ }
+
+ loader_function lf = NULL;
+ //IF_VERBOSE_PARSE(log_msg("tag_type = %d\n", tag_type));
+ if (tag_type == 1)
+ {
+ // show frame tag -- advance to the next frame.
+ IF_VERBOSE_PARSE(log_msg(" show_frame\n"));
+ m_loading_frame++;
+ }
+ else if (s_tag_loaders.get(tag_type, &lf))
+ {
+ // call the tag loader. The tag loader should add
+ // characters or tags to the movie data structure.
+ (*lf)(&str, tag_type, this);
+
+ } else {
+ // no tag loader for this tag type.
+ IF_VERBOSE_PARSE(log_msg("*** no tag loader for type
%d\n", tag_type));
+ IF_VERBOSE_PARSE(dump_tag_bytes(&str));
+ }
+
+ str.close_tag();
+
+ if (tag_type == 0)
+ {
+ if ((unsigned int) str.get_position() != file_end_pos)
+ {
+ // Safety break, so we don't read past the end of
the
+ // movie.
+ log_msg("warning: hit stream-end tag, but not at
the "
+ "end of the file yet; stopping for
safety\n");
+ break;
+ }
+ }
+ }
+
+ if (m_jpeg_in)
+ {
+ delete m_jpeg_in;
+ m_jpeg_in = NULL;
+ }
+
+ if (original_in)
+ {
+ // Done with the zlib_adapter.
+ delete in;
+ }
+}
- // Increment this when the cache data format changes.
+/* movie_def_impl */
+void movie_def_impl::get_owned_fonts(std::vector<font*>* fonts)
+ // Fill up *fonts with fonts that we own.
+{
+ assert(fonts);
+ fonts->resize(0);
+
+ std::vector<int> font_ids;
+
+ for (hash<int, smart_ptr<font> >::iterator it = m_fonts.begin();
+ it != m_fonts.end();
+ ++it)
+ {
+ font* f = it->second.get_ptr();
+ if (f->get_owning_movie() == this)
+ {
+ // Sort by character id, so the ordering is
+ // consistent for cache read/write.
+ int id = it->first;
+
+ // Insert in correct place.
+ unsigned int insert;
+ for (insert = 0; insert < font_ids.size(); insert++)
+ {
+ if (font_ids[insert] > id)
+ {
+ // We want to insert here.
+ break;
+ }
+ }
+ fonts->insert(fonts->begin() + insert, f);
+ font_ids.insert(font_ids.begin() + insert, id);
+ }
+ }
+}
+
+
+/* movie_def_impl */
+void movie_def_impl::generate_font_bitmaps()
+ // Generate bitmaps for our fonts, if necessary.
+{
+ // Collect list of fonts.
+ std::vector<font*> fonts;
+ get_owned_fonts(&fonts);
+ fontlib::generate_font_bitmaps(fonts, this);
+}
+
+
+// Increment this when the cache data format changes.
#define CACHE_FILE_VERSION 4
- /* movie_def_impl */
- void movie_def_impl::output_cached_data(tu_file* out, const cache_options&
options)
- // Dump our cached data into the given stream.
- {
- // Write a little header.
- char header[5];
- strcpy(header, "gscX");
- header[3] = CACHE_FILE_VERSION;
- compiler_assert(CACHE_FILE_VERSION < 256);
-
- out->write_bytes(header, 4);
-
- // Write font data.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::output_cached_data(out, fonts, this, options);
-
- // Write character data.
- {for (hash<int, smart_ptr<character_def> >::iterator it =
m_characters.begin();
- it != m_characters.end();
- ++it)
- {
- out->write_le16(it->first);
- it->second->output_cached_data(out, options);
- }}
-
- out->write_le16((Sint16) -1); // end of characters marker
- }
-
-
- /* movie_def_impl */
- void movie_def_impl::input_cached_data(tu_file* in)
- // Read in cached data and use it to prime our loaded characters.
- {
- // Read the header & check version.
- unsigned char header[4];
- in->read_bytes(header, 4);
- if (header[0] != 'g' || header[1] != 's' || header[2] != 'c')
- {
- log_error("cache file does not have the correct format;
skipping\n");
- return;
- }
- else if (header[3] != CACHE_FILE_VERSION)
- {
- log_error(
- "cached data is version %d, but we require version %d;
skipping\n",
- int(header[3]), CACHE_FILE_VERSION);
- return;
- }
-
- // Read the cached font data.
- std::vector<font*> fonts;
- get_owned_fonts(&fonts);
- fontlib::input_cached_data(in, fonts, this);
-
- // Read the cached character data.
- for (;;)
- {
- if (in->get_error() != TU_FILE_NO_ERROR)
- {
- log_error("error reading cache file (characters);
skipping\n");
- return;
- }
- if (in->get_eof())
- {
- log_error("unexpected eof reading cache file
(characters); skipping\n");
- return;
- }
-
- Sint16 id = in->read_le16();
- if (id == (Sint16) -1) { break; } // done
-
- smart_ptr<character_def> ch;
- m_characters.get(id, &ch);
- if (ch != NULL)
- {
- ch->input_cached_data(in);
- }
- else
- {
- log_error("sync error in cache file (reading
characters)! "
- "Skipping rest of cache data.\n");
- return;
- }
- }
- }
-
- movie_interface* movie_def_impl::create_instance()
- // Create a playable movie instance from a def.
- {
- movie_root* m = new movie_root(this);
- assert(m);
-
- sprite_instance* root_movie = new sprite_instance(this, m,
- NULL, -1);
- assert(root_movie);
-
- root_movie->set_name("_root");
- m->set_root_movie(root_movie);
-
- // @@ somewhere in here I *might* add _url variable
- // (or is it a member?)
-
- m->add_ref();
- return m;
- }
-
-
- //
- // movie_root
- //
-
-
- movie_root::movie_root(movie_def_impl* def)
- :
- m_def(def),
- m_movie(NULL),
- m_viewport_x0(0),
- m_viewport_y0(0),
- m_viewport_width(1),
- m_viewport_height(1),
- m_pixel_scale(1.0f),
- m_background_color(0, 0, 0, 255),
- m_timer(0.0f),
- m_mouse_x(0),
- m_mouse_y(0),
- m_mouse_buttons(0),
- m_userdata(NULL),
- m_on_event_load_called(false),
- m_on_event_xmlsocket_ondata_called(false),
- m_on_event_xmlsocket_onxml_called(false),
- m_on_event_load_progress_called(false)
- {
- assert(m_def != NULL);
-
- set_display_viewport(0, 0, (int) m_def->get_width_pixels(), (int)
m_def->get_height_pixels());
- }
-
- movie_root::~movie_root()
- {
- assert(m_def != NULL);
- m_movie = NULL;
- m_def = NULL;
- }
+/* movie_def_impl */
+void movie_def_impl::output_cached_data(tu_file* out, const cache_options&
options)
+ // Dump our cached data into the given stream.
+{
+ // Write a little header.
+ char header[5];
+ strcpy(header, "gscX");
+ header[3] = CACHE_FILE_VERSION;
+ compiler_assert(CACHE_FILE_VERSION < 256);
+
+ out->write_bytes(header, 4);
+
+ // Write font data.
+ std::vector<font*> fonts;
+ get_owned_fonts(&fonts);
+ fontlib::output_cached_data(out, fonts, this, options);
+
+ // Write character data.
+ {for (hash<int, smart_ptr<character_def> >::iterator it =
m_characters.begin();
+ it != m_characters.end();
+ ++it)
+ {
+ out->write_le16(it->first);
+ it->second->output_cached_data(out, options);
+ }}
+
+ out->write_le16((Sint16) -1); // end of characters marker
+}
+
+
+/* movie_def_impl */
+void movie_def_impl::input_cached_data(tu_file* in)
+ // Read in cached data and use it to prime our loaded characters.
+{
+ // Read the header & check version.
+ unsigned char header[4];
+ in->read_bytes(header, 4);
+ if (header[0] != 'g' || header[1] != 's' || header[2] != 'c')
+ {
+ log_error("cache file does not have the correct format;
skipping\n");
+ return;
+ }
+ else if (header[3] != CACHE_FILE_VERSION)
+ {
+ log_error(
+ "cached data is version %d, but we require version %d;
skipping\n",
+ int(header[3]), CACHE_FILE_VERSION);
+ return;
+ }
+
+ // Read the cached font data.
+ std::vector<font*> fonts;
+ get_owned_fonts(&fonts);
+ fontlib::input_cached_data(in, fonts, this);
+
+ // Read the cached character data.
+ for (;;)
+ {
+ if (in->get_error() != TU_FILE_NO_ERROR)
+ {
+ log_error("error reading cache file (characters);
skipping\n");
+ return;
+ }
+ if (in->get_eof())
+ {
+ log_error("unexpected eof reading cache file (characters);
skipping\n");
+ return;
+ }
+
+ Sint16 id = in->read_le16();
+ if (id == (Sint16) -1) { break; } // done
+
+ smart_ptr<character_def> ch;
+ m_characters.get(id, &ch);
+ if (ch != NULL)
+ {
+ ch->input_cached_data(in);
+ }
+ else
+ {
+ log_error("sync error in cache file (reading characters)!
"
+ "Skipping rest of cache data.\n");
+ return;
+ }
+ }
+}
+
+movie_interface* movie_def_impl::create_instance()
+ // Create a playable movie instance from a def.
+{
+ movie_root* m = new movie_root(this);
+ assert(m);
+
+ sprite_instance* root_movie = new sprite_instance(this, m,
+ NULL, -1);
+ assert(root_movie);
+
+ root_movie->set_name("_root");
+ m->set_root_movie(root_movie);
+
+ // @@ somewhere in here I *might* add _url variable
+ // (or is it a member?)
+
+ m->add_ref();
+ return m;
+}
+
+
+//
+// movie_root
+//
+
+
+movie_root::movie_root(movie_def_impl* def)
+ :
+ m_def(def),
+ m_movie(NULL),
+ m_viewport_x0(0),
+ m_viewport_y0(0),
+ m_viewport_width(1),
+ m_viewport_height(1),
+ m_pixel_scale(1.0f),
+ m_background_color(0, 0, 0, 255),
+ m_timer(0.0f),
+ m_mouse_x(0),
+ m_mouse_y(0),
+ m_mouse_buttons(0),
+ m_userdata(NULL),
+ m_on_event_load_called(false),
+ m_on_event_xmlsocket_ondata_called(false),
+ m_on_event_xmlsocket_onxml_called(false),
+ m_on_event_load_progress_called(false)
+{
+ assert(m_def != NULL);
+
+ set_display_viewport(0, 0, (int) m_def->get_width_pixels(), (int)
m_def->get_height_pixels());
+}
+
+movie_root::~movie_root()
+{
+ assert(m_def != NULL);
+ m_movie = NULL;
+ m_def = NULL;
+}
- void movie_root::set_root_movie(movie* root_movie)
- {
- m_movie = root_movie;
- assert(m_movie != NULL);
- }
-
- void movie_root::set_display_viewport(int x0, int y0, int w, int h)
- {
- m_viewport_x0 = x0;
- m_viewport_y0 = y0;
- m_viewport_width = w;
- m_viewport_height = h;
-
- // Recompute pixel scale.
- float scale_x = m_viewport_width /
TWIPS_TO_PIXELS(m_def->m_frame_size.width());
- float scale_y = m_viewport_height /
TWIPS_TO_PIXELS(m_def->m_frame_size.height());
- m_pixel_scale = fmax(scale_x, scale_y);
- }
+void movie_root::set_root_movie(movie* root_movie)
+{
+ m_movie = root_movie;
+ assert(m_movie != NULL);
+}
+
+void movie_root::set_display_viewport(int x0, int y0, int w, int h)
+{
+ m_viewport_x0 = x0;
+ m_viewport_y0 = y0;
+ m_viewport_width = w;
+ m_viewport_height = h;
+
+ // Recompute pixel scale.
+ float scale_x = m_viewport_width /
TWIPS_TO_PIXELS(m_def->m_frame_size.width());
+ float scale_y = m_viewport_height /
TWIPS_TO_PIXELS(m_def->m_frame_size.height());
+ m_pixel_scale = fmax(scale_x, scale_y);
+}
- void movie_root::notify_mouse_state(int x, int y, int buttons)
- {
+void movie_root::notify_mouse_state(int x, int y, int buttons)
+{
// GNASH_REPORT_FUNCTION;
// dbglogfile << "X is: " << x << " Y is: " << y << " Button is: "
// << buttons << endl;
- m_mouse_x = x;
- m_mouse_y = y;
- m_mouse_buttons = buttons;
- }
+ m_mouse_x = x;
+ m_mouse_y = y;
+ m_mouse_buttons = buttons;
+}
- void movie_root::get_mouse_state(int* x, int* y, int* buttons)
- {
+void movie_root::get_mouse_state(int* x, int* y, int* buttons)
+{
// GNASH_REPORT_FUNCTION;
- assert(x);
- assert(y);
- assert(buttons);
+ assert(x);
+ assert(y);
+ assert(buttons);
// dbglogfile << "X is: " << m_mouse_x << " Y is: " << m_mouse_y
// << " Button is: "
// << m_mouse_buttons << endl;
- *x = m_mouse_x;
- *y = m_mouse_y;
- *buttons = m_mouse_buttons;
- }
-
+ *x = m_mouse_x;
+ *y = m_mouse_y;
+ *buttons = m_mouse_buttons;
+}
+void movie_root::get_url(const char *url)
+{
+ GNASH_REPORT_FUNCTION;
+
+ string command = "mozilla -remote \"openurl";
+ command += url;
+ command += ")\"";
+ dbglogfile << "Launching URL... " << command << endl;
+ system(command.c_str());
+}
- int movie_root::add_interval_timer(void *timer)
- {
- Timer *ptr = static_cast<Timer *>(timer);
+int movie_root::add_interval_timer(void *timer)
+{
+ Timer *ptr = static_cast<Timer *>(timer);
- m_interval_timers.push_back(ptr);
- return m_interval_timers.size();
- }
+ m_interval_timers.push_back(ptr);
+ return m_interval_timers.size();
+}
- void movie_root::clear_interval_timer(int x)
- {
- m_interval_timers.erase(m_interval_timers.begin() + x-1);
- //m_interval_timers[x]->clearInterval();
- }
+void movie_root::clear_interval_timer(int x)
+{
+ m_interval_timers.erase(m_interval_timers.begin() + x-1);
+ //m_interval_timers[x]->clearInterval();
+}
- void movie_root::do_something(void *timer)
- {
- log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
- }
+void movie_root::do_something(void *timer)
+{
+ log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
+}
- void movie_root::advance(float delta_time)
- {
+void movie_root::advance(float delta_time)
+{
// GNASH_REPORT_FUNCTION;
- if (m_on_event_load_called == false)
- {
- // Must do loading events. For child sprites this is
- // done by the dlist, but root movies don't get added
- // to a dlist, so we do it here.
- m_on_event_load_called = true;
- m_movie->on_event_load();
- }
+ if (m_on_event_load_called == false)
+ {
+ // Must do loading events. For child sprites this is
+ // done by the dlist, but root movies don't get added
+ // to a dlist, so we do it here.
+ m_on_event_load_called = true;
+ m_movie->on_event_load();
+ }
#if 0
- // Must check the socket connection for data
- if (m_on_event_xmlsocket_ondata_called == true) {
- m_movie->on_event_xmlsocket_ondata();
- }
+ // Must check the socket connection for data
+ if (m_on_event_xmlsocket_ondata_called == true) {
+ m_movie->on_event_xmlsocket_ondata();
+ }
- if (m_on_event_xmlsocket_onxml_called == true) {
- m_movie->on_event_xmlsocket_onxml();
- }
+ if (m_on_event_xmlsocket_onxml_called == true) {
+ m_movie->on_event_xmlsocket_onxml();
+ }
- // Must check the progress of the MovieClip being loaded
- if (m_on_event_load_progress_called == true) {
- m_movie->on_event_load_progress();
- }
+ // Must check the progress of the MovieClip being loaded
+ if (m_on_event_load_progress_called == true) {
+ m_movie->on_event_load_progress();
+ }
#endif
- if (m_interval_timers.size() > 0) {
- for (unsigned int i=0; i<m_interval_timers.size(); i++) {
- if (m_interval_timers[i]->expired()) {
- // printf("FIXME: Interval Timer Expired!\n");
- //m_movie->on_event_interval_timer();
- m_movie->do_something(m_interval_timers[i]);
- //
clear_interval_timer(m_interval_timers[i]->getIntervalID()); // FIXME: we
shouldn't really disable the timer here
- }
- }
- }
+ if (m_interval_timers.size() > 0) {
+ for (unsigned int i=0; i<m_interval_timers.size(); i++) {
+ if (m_interval_timers[i]->expired()) {
+ // printf("FIXME: Interval Timer Expired!\n");
+ //m_movie->on_event_interval_timer();
+ m_movie->do_something(m_interval_timers[i]);
+ //
clear_interval_timer(m_interval_timers[i]->getIntervalID()); // FIXME: we
shouldn't really disable the timer here
+ }
+ }
+ }
- m_timer += delta_time;
- // @@ TODO handle multi-frame catch-up stuff
- // here, and make it optional. Make
- // movie::advance() a fixed framerate w/ no
- // dt.
-
- // Handle the mouse.
- m_mouse_button_state.m_topmost_entity =
- m_movie->get_topmost_mouse_entity(PIXELS_TO_TWIPS(m_mouse_x),
PIXELS_TO_TWIPS(m_mouse_y));
- m_mouse_button_state.m_mouse_button_state_current =
(m_mouse_buttons & 1);
- generate_mouse_button_events(&m_mouse_button_state);
+ m_timer += delta_time;
+ // @@ TODO handle multi-frame catch-up stuff
+ // here, and make it optional. Make
+ // movie::advance() a fixed framerate w/ no
+ // dt.
+
+ // Handle the mouse.
+ m_mouse_button_state.m_topmost_entity =
+ m_movie->get_topmost_mouse_entity(PIXELS_TO_TWIPS(m_mouse_x),
PIXELS_TO_TWIPS(m_mouse_y));
+ m_mouse_button_state.m_mouse_button_state_current = (m_mouse_buttons & 1);
+ generate_mouse_button_events(&m_mouse_button_state);
- m_movie->advance(delta_time);
- }
+ m_movie->advance(delta_time);
+}
- void movie_root::display()
- {
+void movie_root::display()
+{
// GNASH_REPORT_FUNCTION;
- if (m_movie->get_visible() == false)
- {
- // Don't display.
- return;
- }
-
- gnash::render::begin_display(
- m_background_color,
- m_viewport_x0, m_viewport_y0,
- m_viewport_width, m_viewport_height,
- m_def->m_frame_size.m_x_min, m_def->m_frame_size.m_x_max,
- m_def->m_frame_size.m_y_min, m_def->m_frame_size.m_y_max);
-
- m_movie->display();
-
- gnash::render::end_display();
- }
-
- bool movie_root::goto_labeled_frame(const char* label)
- {
- int target_frame = -1;
- if (m_def->get_labeled_frame(label, &target_frame))
- {
- goto_frame(target_frame);
- return true;
- }
- else
- {
- IF_VERBOSE_ACTION(
- log_error("error: movie_impl::goto_labeled_frame('%s')
unknown label\n", label));
- return false;
- }
- }
-
-
- const char* movie_root::call_method(const char* method_name,
- const char* method_arg_fmt, ...)
- {
- assert(m_movie != NULL);
-
- va_list args;
- va_start(args, method_arg_fmt);
- const char* result = m_movie->call_method_args(method_name,
method_arg_fmt, args);
- va_end(args);
-
- return result;
- }
-
- const char* movie_root::call_method_args(const char* method_name,
- const char* method_arg_fmt, va_list args)
- {
- assert(m_movie != NULL);
- return m_movie->call_method_args(method_name, method_arg_fmt, args);
- }
+ if (m_movie->get_visible() == false)
+ {
+ // Don't display.
+ return;
+ }
+
+ gnash::render::begin_display(
+ m_background_color,
+ m_viewport_x0, m_viewport_y0,
+ m_viewport_width, m_viewport_height,
+ m_def->m_frame_size.m_x_min, m_def->m_frame_size.m_x_max,
+ m_def->m_frame_size.m_y_min, m_def->m_frame_size.m_y_max);
+
+ m_movie->display();
+
+ gnash::render::end_display();
+}
+
+bool movie_root::goto_labeled_frame(const char* label)
+{
+ int target_frame = -1;
+ if (m_def->get_labeled_frame(label, &target_frame))
+ {
+ goto_frame(target_frame);
+ return true;
+ }
+ else
+ {
+ IF_VERBOSE_ACTION(
+ log_error("error: movie_impl::goto_labeled_frame('%s') unknown
label\n", label));
+ return false;
+ }
+}
+
+
+const char* movie_root::call_method(const char* method_name,
+ const char* method_arg_fmt, ...)
+{
+ assert(m_movie != NULL);
+
+ va_list args;
+ va_start(args, method_arg_fmt);
+ const char* result = m_movie->call_method_args(method_name,
method_arg_fmt, args);
+ va_end(args);
+
+ return result;
+}
+
+const char* movie_root::call_method_args(const char* method_name,
+ const char* method_arg_fmt, va_list
args)
+{
+ assert(m_movie != NULL);
+ return m_movie->call_method_args(method_name, method_arg_fmt, args);
+}
void
movieclip_init(as_object* global)
{
#if 0
- // This is going to be the global MovieClip "class"/"function"
- static function_as_object *func=new function_as_object();
+ // This is going to be the global MovieClip "class"/"function"
+ static function_as_object *func=new function_as_object();
- // We make the 'prototype' element be a reference to
- // the __proto__ element
- as_object* proto = func->m_prototype;
- proto->add_ref();
+ // We make the 'prototype' element be a reference to
+ // the __proto__ element
+ as_object* proto = func->m_prototype;
+ proto->add_ref();
- proto->set_member("constructor", func); //as_value(func));
- proto->set_member_flags("constructor", 1);
+ proto->set_member("constructor", func); //as_value(func));
+ proto->set_member_flags("constructor", 1);
- func->set_member("prototype", as_value(proto));
+ func->set_member("prototype", as_value(proto));
- // Register _global.Function
- global->set_member("Function", func);
+ // Register _global.Function
+ global->set_member("Function", func);
#endif
}
Index: gnash/server/Movie.h
diff -u gnash/server/Movie.h:1.9 gnash/server/Movie.h:1.10
--- gnash/server/Movie.h:1.9 Thu Mar 9 19:29:06 2006
+++ gnash/server/Movie.h Mon Apr 10 20:21:39 2006
@@ -546,6 +546,7 @@
return m_def->get_file_bytes();
}
+ virtual void get_url(const char *url);
virtual int add_interval_timer(void *timer);
virtual void clear_interval_timer(int x);
virtual void do_something(void *timer);
Index: gnash/server/Sprite.cpp
diff -u gnash/server/Sprite.cpp:1.20 gnash/server/Sprite.cpp:1.21
--- gnash/server/Sprite.cpp:1.20 Wed Apr 5 04:15:33 2006
+++ gnash/server/Sprite.cpp Mon Apr 10 20:21:39 2006
@@ -48,8 +48,11 @@
#ifdef HAVE_PTHREADS
#include <pthread.h>
#endif
+
#include <vector>
+#include <string>
+#include "log.h"
#include "action.h"
#include "gnash.h"
#include "Sprite.h"
@@ -57,6 +60,8 @@
#include "Function.h"
#include "text.h"
+using namespace std;
+
namespace gnash {
// Execute the actions in the action list, in the given
Index: gnash/server/Sprite.h
diff -u gnash/server/Sprite.h:1.12 gnash/server/Sprite.h:1.13
--- gnash/server/Sprite.h:1.12 Wed Mar 29 05:42:41 2006
+++ gnash/server/Sprite.h Mon Apr 10 20:21:39 2006
@@ -347,16 +347,14 @@
}
}
- // sprite instance of add_interval_handler()
+ // sprite instance of add_interval_handler()
virtual int add_interval_timer(void *timer)
{
- // log_msg("FIXME: %s:\n", __FUNCTION__);
return m_root->add_interval_timer(timer);
}
virtual void clear_interval_timer(int x)
{
- // log_msg("FIXME: %s:\n", __FUNCTION__);
m_root->clear_interval_timer(x);
}
Index: gnash/server/action.cpp
diff -u gnash/server/action.cpp:1.59 gnash/server/action.cpp:1.60
--- gnash/server/action.cpp:1.59 Mon Apr 10 17:48:59 2006
+++ gnash/server/action.cpp Mon Apr 10 20:21:39 2006
@@ -55,6 +55,14 @@
#include "Video.h"
#include "swf.h"
+#ifndef HAVE_GTK2
+int windowid = 0;
+#else
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <gtk/gtk.h>
+GdkNativeWindow windowid = 0;
+#endif
#ifdef _WIN32
#define snprintf _snprintf
@@ -2992,14 +3000,26 @@
// If the url starts with an "http:", then we
// want to load it into a web browser.
if (strncmp(url, "http:", 5) == 0) {
-
- string command = "firefox -remote \"openurl(";
- command += url;
- command += ")\"";
- dbglogfile << "Launching URL... " << command
<< endl;
- system(command.c_str());
+// if (windowid) {
+// Atom mAtom = 486;
+// Display *mDisplay = XOpenDisplay(NULL);
+// XLockDisplay(mDisplay);
+// XChangeProperty (mDisplay, windowid,
mAtom,
+// XA_STRING, 8,
PropModeReplace,
+// (unsigned char *)url,
+// url_len);
+
+// XUnlockDisplay(mDisplay);
+// XCloseDisplay(mDisplay);
+// } else {
+ string command = "firefox -remote
\"openurl(";
+ command += url;
+ command += ")\"";
+ dbglogfile << "Launching URL... " <<
command << endl;
// movie *target = env->get_target();
// target->get_url(url);
+ system(command.c_str());
+// }
break;
}
Index: gnash/server/gnash.h
diff -u gnash/server/gnash.h:1.14 gnash/server/gnash.h:1.15
--- gnash/server/gnash.h:1.14 Thu Mar 9 19:29:06 2006
+++ gnash/server/gnash.h Mon Apr 10 20:21:39 2006
@@ -349,6 +349,7 @@
/// Attach NULL to disable the callback.
virtual void attach_display_callback(const char* path_to_object,
void (*callback)(void* user_ptr), void* user_ptr) = 0;
+ virtual void get_url(const char *url) = 0;
virtual int add_interval_timer(void *timer) = 0;
virtual void clear_interval_timer(int x) = 0;
Index: gnash/server/impl.h
diff -u gnash/server/impl.h:1.18 gnash/server/impl.h:1.19
--- gnash/server/impl.h:1.18 Wed Mar 29 05:42:41 2006
+++ gnash/server/impl.h Mon Apr 10 20:21:39 2006
@@ -55,539 +55,544 @@
#include <stdarg.h>
namespace gnash {
- struct action_buffer;
- struct bitmap_character_def;
- struct bitmap_info;
- struct character;
- struct character_def;
- struct display_info;
- struct execute_tag;
- struct font;
- struct movie_root;
- struct sound_sample : public resource //virtual public ref_counted
- {
- virtual sound_sample* cast_to_sound_sample() { return this; }
- };
- struct stream;
- struct swf_event;
+struct action_buffer;
+struct bitmap_character_def;
+struct bitmap_info;
+struct character;
+struct character_def;
+struct display_info;
+struct execute_tag;
+struct font;
+struct movie_root;
+struct sound_sample : public resource //virtual public ref_counted
+{
+ virtual sound_sample* cast_to_sound_sample() { return this; }
+};
+struct stream;
+struct swf_event;
- void save_extern_movie(movie_interface* m);
+void save_extern_movie(movie_interface* m);
//v for extern movies
- movie_interface* create_library_movie_inst(movie_definition* md);
+movie_interface *create_library_movie_inst(movie_definition* md);
- movie_interface* get_current_root();
- void set_current_root(movie_interface* m);
- const char* get_workdir();
- void set_workdir(const char* dir);
- void delete_unused_root();
+movie_interface *get_current_root();
+void set_current_root(movie_interface* m);
+const char* get_workdir();
+void set_workdir(const char* dir);
+void delete_unused_root();
+
+/// @@@ another one ???
+struct movie : public movie_interface
+{
+ virtual void set_extern_movie(movie_interface* m) { }
+ virtual movie_interface *get_extern_movie() { return NULL; }
+
+ virtual movie_definition *get_movie_definition() { return NULL; }
+ virtual movie_root *get_root() { return NULL; }
+ virtual movie_interface *get_root_interface() { return NULL; }
+ virtual movie *get_root_movie() { return NULL; }
+
+ virtual float get_pixel_scale() const { return 1.0f; }
+ virtual character *get_character(int id) { return NULL; }
+
+ virtual matrix get_world_matrix() const { return matrix::identity; }
+ virtual cxform get_world_cxform() const { return cxform::identity; }
+
+ //
+ // display-list management.
+ //
- /// @@@ another one ???
- struct movie : public movie_interface
+ virtual execute_tag *find_previous_replace_or_add_tag(int current_frame,
int depth, int id)
{
- virtual void set_extern_movie(movie_interface* m) { }
- virtual movie_interface* get_extern_movie() { return
NULL; }
+ return NULL;
+ }
- virtual movie_definition* get_movie_definition() { return
NULL; }
- virtual movie_root* get_root() { return NULL; }
- virtual movie_interface* get_root_interface() { return
NULL; }
- virtual movie* get_root_movie() { return NULL;
}
-
- virtual float get_pixel_scale() const {
return 1.0f; }
- virtual character* get_character(int id) { return
NULL; }
-
- virtual matrix get_world_matrix() const {
return matrix::identity; }
- virtual cxform get_world_cxform() const {
return cxform::identity; }
-
- //
- // display-list management.
- //
-
- virtual execute_tag* find_previous_replace_or_add_tag(int
current_frame, int depth, int id)
- {
- return NULL;
- }
-
- virtual character* add_display_object(
- Uint16 character_id,
- const char* name,
- const std::vector<swf_event*>& event_handlers,
- Uint16 depth,
- bool replace_if_depth_is_occupied,
- const cxform& color_transform,
- const matrix& mat,
- float ratio,
- Uint16 clip_depth)
- {
- return NULL;
- }
-
- virtual void move_display_object(
- Uint16 depth,
- bool use_cxform,
- const cxform& color_transform,
- bool use_matrix,
- const matrix& mat,
- float ratio,
- Uint16 clip_depth)
- {
- }
-
- virtual void replace_display_object(
- Uint16 character_id,
- const char* name,
- Uint16 depth,
- bool use_cxform,
- const cxform& color_transform,
- bool use_matrix,
- const matrix& mat,
- float ratio,
- Uint16 clip_depth)
- {
- }
+ virtual character* add_display_object(
+ Uint16 character_id,
+ const char* name,
+ const std::vector<swf_event*>& event_handlers,
+ Uint16 depth,
+ bool replace_if_depth_is_occupied,
+ const cxform& color_transform,
+ const matrix& mat,
+ float ratio,
+ Uint16 clip_depth)
+ {
+ return NULL;
+ }
- virtual void replace_display_object(
- character* ch,
- const char* name,
- Uint16 depth,
- bool use_cxform,
- const cxform& color_transform,
- bool use_matrix,
- const matrix& mat,
- float ratio,
- Uint16 clip_depth)
- {
- }
+ virtual void move_display_object(
+ Uint16 depth,
+ bool use_cxform,
+ const cxform& color_transform,
+ bool use_matrix,
+ const matrix& mat,
+ float ratio,
+ Uint16 clip_depth)
+ {
+ }
- virtual void remove_display_object(Uint16 depth, int id)
{}
+ virtual void replace_display_object(
+ Uint16 character_id,
+ const char* name,
+ Uint16 depth,
+ bool use_cxform,
+ const cxform& color_transform,
+ bool use_matrix,
+ const matrix& mat,
+ float ratio,
+ Uint16 clip_depth)
+ {
+ }
- virtual void set_background_color(const rgba& color) {}
- virtual void set_background_alpha(float alpha) {}
- virtual float get_background_alpha() const { return 1.0f; }
- virtual void set_display_viewport(int x0, int y0, int width,
int height) {}
+ virtual void replace_display_object(
+ character* ch,
+ const char* name,
+ Uint16 depth,
+ bool use_cxform,
+ const cxform& color_transform,
+ bool use_matrix,
+ const matrix& mat,
+ float ratio,
+ Uint16 clip_depth)
+ {
+ }
- virtual void add_action_buffer(action_buffer* a) {
assert(0); }
+ virtual void remove_display_object(Uint16 depth, int id) {}
- virtual void goto_frame(int target_frame_number) {
assert(0); }
- virtual bool goto_labeled_frame(const char* label) {
assert(0); return false; }
+ virtual void set_background_color(const rgba& color) {}
+ virtual void set_background_alpha(float alpha) {}
+ virtual float get_background_alpha() const { return 1.0f; }
+ virtual void set_display_viewport(int x0, int y0, int width, int
height) {}
- virtual void set_play_state(play_state s) {}
- virtual play_state get_play_state() const { assert(0);
return STOP; }
+ virtual void add_action_buffer(action_buffer* a) { assert(0); }
- /// The host app uses this to tell the movie where the
- /// user's mouse pointer is.
- virtual void notify_mouse_state(int x, int y, int buttons)
- {
- GNASH_REPORT_FUNCTION;
- }
+ virtual void goto_frame(int target_frame_number) { assert(0); }
+ virtual bool goto_labeled_frame(const char* label) { assert(0);
return false; }
- /// Use this to retrieve the last state of the mouse, as set via
- /// notify_mouse_state().
- virtual void get_mouse_state(int* x, int* y, int* buttons)
- {
- assert(0);
- }
+ virtual void set_play_state(play_state s) {}
+ virtual play_state get_play_state() const { assert(0); return STOP; }
- struct drag_state
- {
- movie* m_character;
- bool m_lock_center;
- bool m_bound;
- float m_bound_x0;
- float m_bound_y0;
- float m_bound_x1;
- float m_bound_y1;
-
- drag_state()
- :
- m_character(0), m_lock_center(0), m_bound(0),
- m_bound_x0(0), m_bound_y0(0), m_bound_x1(1),
m_bound_y1(1)
- {
- }
- };
- virtual void get_drag_state(drag_state* st) { assert(0); *st
= drag_state(); }
- virtual void set_drag_state(const drag_state& st) {
assert(0); }
- virtual void stop_drag() { assert(0); }
+ /// The host app uses this to tell the movie where the
+ /// user's mouse pointer is.
+ virtual void notify_mouse_state(int x, int y, int buttons)
+ {
+ GNASH_REPORT_FUNCTION;
+ }
+ /// Use this to retrieve the last state of the mouse, as set via
+ /// notify_mouse_state().
+ virtual void get_mouse_state(int* x, int* y, int* buttons)
+ {
+ assert(0);
+ }
- // External
- virtual void set_variable(const char* path_to_var, const
char* new_value)
- {
- assert(0);
- }
+ struct drag_state
+ {
+ movie* m_character;
+ bool m_lock_center;
+ bool m_bound;
+ float m_bound_x0;
+ float m_bound_y0;
+ float m_bound_x1;
+ float m_bound_y1;
+
+ drag_state()
+ :
+ m_character(0), m_lock_center(0), m_bound(0),
+ m_bound_x0(0), m_bound_y0(0), m_bound_x1(1), m_bound_y1(1)
+ {
+ }
+ };
+ virtual void get_drag_state(drag_state* st) { assert(0); *st =
drag_state(); }
+ virtual void set_drag_state(const drag_state& st) { assert(0); }
+ virtual void stop_drag() { assert(0); }
- // External
- virtual void set_variable(const char* path_to_var, const
wchar_t* new_value)
- {
- assert(0);
- }
- // External
- virtual const char* get_variable(const char* path_to_var)
const
- {
- assert(0);
- return "";
- }
+ // External
+ virtual void set_variable(const char* path_to_var, const char*
new_value)
+ {
+ assert(0);
+ }
- virtual void * get_userdata() { assert(0); return NULL; }
- virtual void set_userdata(void *) { assert(0); }
+ // External
+ virtual void set_variable(const char* path_to_var, const wchar_t*
new_value)
+ {
+ assert(0);
+ }
- // External
- virtual bool has_looped() const { return true; }
+ // External
+ virtual const char* get_variable(const char* path_to_var) const
+ {
+ assert(0);
+ return "";
+ }
+ virtual void * get_userdata() { assert(0); return NULL; }
+ virtual void set_userdata(void *) { assert(0); }
- //
- // Mouse/Button interface.
- //
+ // External
+ virtual bool has_looped() const { return true; }
- virtual movie* get_topmost_mouse_entity(float x, float y) {
return NULL; }
- virtual bool get_track_as_menu() const { return false; }
- virtual void on_button_event(event_id id) { on_event(id); }
+ //
+ // Mouse/Button interface.
+ //
- //
- // ActionScript.
- //
+ virtual movie* get_topmost_mouse_entity(float x, float y) { return NULL; }
+ virtual bool get_track_as_menu() const { return false; }
+ virtual void on_button_event(event_id id) { on_event(id); }
- virtual movie* get_relative_target(const tu_string& name)
- {
- assert(0);
- return NULL;
- }
+ //
+ // ActionScript.
+ //
- // ActionScript event handler. Returns true if a handler was
called.
- virtual bool on_event(event_id id) { return false; }
- int add_interval_timer(void *timer)
- {
- log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
- return -1; // ???
- }
+ virtual movie* get_relative_target(const tu_string& name)
+ {
+ assert(0);
+ return NULL;
+ }
+
+ // ActionScript event handler. Returns true if a handler was called.
+ virtual bool on_event(event_id id) { return false; }
+
+ virtual void get_url(const char *url) {
+ GNASH_REPORT_FUNCTION;
+ }
+
+
+ int add_interval_timer(void *timer)
+ {
+ log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
+ return -1; // ???
+ }
- void clear_interval_timer(int x)
- {
- log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
- }
+ void clear_interval_timer(int x)
+ {
+ log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
+ }
- virtual void do_something(void *timer)
- {
- log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
- }
+ virtual void do_something(void *timer)
+ {
+ log_msg("FIXME: %s: unimplemented\n", __FUNCTION__);
+ }
- /// Special event handler; sprites also execute their frame1
actions on this event.
- virtual void on_event_load() { on_event(event_id::LOAD); }
+ /// Special event handler; sprites also execute their frame1 actions on
this event.
+ virtual void on_event_load() { on_event(event_id::LOAD); }
#if 0
- // tulrich: @@ is there a good reason these are in the
- // vtable? I.e. can the caller just call
- // on_event(event_id::SOCK_DATA) instead of
- // on_event_xmlsocket_ondata()?
- virtual void on_event_xmlsocket_ondata() {
on_event(event_id::SOCK_DATA); }
- virtual void on_event_xmlsocket_onxml() {
on_event(event_id::SOCK_XML); }
- virtual void on_event_interval_timer() {
on_event(event_id::TIMER); }
- virtual void on_event_load_progress() {
on_event(event_id::LOAD_PROGRESS); }
+ // tulrich: @@ is there a good reason these are in the
+ // vtable? I.e. can the caller just call
+ // on_event(event_id::SOCK_DATA) instead of
+ // on_event_xmlsocket_ondata()?
+ virtual void on_event_xmlsocket_ondata() {
on_event(event_id::SOCK_DATA); }
+ virtual void on_event_xmlsocket_onxml() {
on_event(event_id::SOCK_XML); }
+ virtual void on_event_interval_timer() { on_event(event_id::TIMER); }
+ virtual void on_event_load_progress() {
on_event(event_id::LOAD_PROGRESS); }
#endif
- // as_object_interface stuff
- virtual void set_member(const tu_stringi& name, const
as_value& val) { assert(0); }
- virtual bool get_member(const tu_stringi& name, as_value*
val) { assert(0); return false; }
+ // as_object_interface stuff
+ virtual void set_member(const tu_stringi& name, const as_value& val)
{ assert(0); }
+ virtual bool get_member(const tu_stringi& name, as_value* val) {
assert(0); return false; }
- virtual void call_frame_actions(const as_value& frame_spec)
{ assert(0); }
+ virtual void call_frame_actions(const as_value& frame_spec) {
assert(0); }
- virtual float get_timer() const { return 0.0f; }
- virtual movie* to_movie() { return this; }
+ virtual float get_timer() const { return 0.0f; }
+ virtual movie* to_movie() { return this; }
- virtual void clone_display_object(const tu_string& name,
const tu_string& newname, Uint16 depth) { assert(0); }
- virtual void remove_display_object(const tu_string& name) {
assert(0); }
+ virtual void clone_display_object(const tu_string& name, const
tu_string& newname, Uint16 depth) { assert(0); }
+ virtual void remove_display_object(const tu_string& name) {
assert(0); }
- // Forward vararg call to version taking va_list.
- virtual const char* call_method(const char* method_name,
const char* method_arg_fmt, ...)
- {
- va_list args;
- va_start(args, method_arg_fmt);
- const char* result = call_method_args(method_name,
method_arg_fmt, args);
- va_end(args);
+ // Forward vararg call to version taking va_list.
+ virtual const char* call_method(const char* method_name, const
char* method_arg_fmt, ...)
+ {
+ va_list args;
+ va_start(args, method_arg_fmt);
+ const char* result = call_method_args(method_name, method_arg_fmt,
args);
+ va_end(args);
- return result;
- }
+ return result;
+ }
- /// Override this if you implement call_method.
- virtual const char* call_method_args(const char*
method_name, const char* method_arg_fmt, va_list args)
- {
- assert(0);
- return NULL;
- }
+ /// Override this if you implement call_method.
+ virtual const char* call_method_args(const char* method_name, const
char* method_arg_fmt, va_list args)
+ {
+ assert(0);
+ return NULL;
+ }
- virtual void execute_frame_tags(int frame, bool state_only =
false) {}
-
- // External.
- virtual void attach_display_callback(const char*
path_to_object, void (*callback)(void*), void* user_ptr)
- {
- assert(0);
- }
-
- virtual void set_display_callback(void (*callback)(void*),
void* user_ptr)
- // Override me to provide this functionality.
- {
- }
- };
+ virtual void execute_frame_tags(int frame, bool state_only = false)
{}
+ // External.
+ virtual void attach_display_callback(const char* path_to_object,
void (*callback)(void*), void* user_ptr)
+ {
+ assert(0);
+ }
- // Information about how to display a character.
- struct display_info
+ virtual void set_display_callback(void (*callback)(void*), void*
user_ptr)
+ // Override me to provide this functionality.
{
- movie* m_parent;
- int m_depth;
- cxform m_color_transform;
- matrix m_matrix;
- float m_ratio;
- Uint16 m_clip_depth;
-
- display_info()
- :
- m_parent(NULL),
- m_depth(0),
- m_ratio(0.0f),
- m_clip_depth(0)
- {
- }
+ }
+};
- void concatenate(const display_info& di)
- // Concatenate the transforms from di into our
- // transforms.
- {
- m_depth = di.m_depth;
- m_color_transform.concatenate(di.m_color_transform);
- m_matrix.concatenate(di.m_matrix);
- m_ratio = di.m_ratio;
- m_clip_depth = di.m_clip_depth;
- }
- };
+// Information about how to display a character.
+struct display_info
+{
+ movie* m_parent;
+ int m_depth;
+ cxform m_color_transform;
+ matrix m_matrix;
+ float m_ratio;
+ Uint16 m_clip_depth;
+
+ display_info()
+ :
+ m_parent(NULL),
+ m_depth(0),
+ m_ratio(0.0f),
+ m_clip_depth(0)
+ {
+ }
- /// Character is a live, stateful instance of a character_def.
- //
- /// It represents a single active element in a movie.
- ///
- struct character : public movie
- {
- int m_id;
- movie* m_parent;
- tu_string m_name;
- int m_depth;
- cxform m_color_transform;
- matrix m_matrix;
- float m_ratio;
- Uint16 m_clip_depth;
- bool m_visible;
- bool m_enabled;
- hash<event_id, as_value> m_event_handlers;
- void (*m_display_callback)(void*);
- void* m_display_callback_user_ptr;
-
- character(movie* parent, int id)
- :
- m_id(id),
- m_parent(parent),
- m_depth(-1),
- m_ratio(0.0f),
- m_clip_depth(0),
- m_visible(true),
- m_enabled(true),
- m_display_callback(NULL),
- m_display_callback_user_ptr(NULL)
+ void concatenate(const display_info& di)
+ // Concatenate the transforms from di into our
+ // transforms.
+ {
+ m_depth = di.m_depth;
+ m_color_transform.concatenate(di.m_color_transform);
+ m_matrix.concatenate(di.m_matrix);
+ m_ratio = di.m_ratio;
+ m_clip_depth = di.m_clip_depth;
+ }
+};
+
+
+/// Character is a live, stateful instance of a character_def.
+//
+/// It represents a single active element in a movie.
+///
+struct character : public movie
+{
+ int m_id;
+ movie* m_parent;
+ tu_string m_name;
+ int m_depth;
+ cxform m_color_transform;
+ matrix m_matrix;
+ float m_ratio;
+ Uint16 m_clip_depth;
+ bool m_visible;
+ bool m_enabled;
+ hash<event_id, as_value> m_event_handlers;
+ void (*m_display_callback)(void*);
+ void* m_display_callback_user_ptr;
+
+ character(movie* parent, int id)
+ :
+ m_id(id),
+ m_parent(parent),
+ m_depth(-1),
+ m_ratio(0.0f),
+ m_clip_depth(0),
+ m_visible(true),
+ m_enabled(true),
+ m_display_callback(NULL),
+ m_display_callback_user_ptr(NULL)
+ {
+ assert((parent == NULL && m_id == -1)
+ || (parent != NULL && m_id >= 0));
+ }
+
+ // Accessors for basic display info.
+ int get_id() const { return m_id; }
+ movie* get_parent() const { return m_parent; }
+ void set_parent(movie* parent) { m_parent = parent; } // for extern
movie
+ int get_depth() const { return m_depth; }
+ void set_depth(int d) { m_depth = d; }
+ const matrix& get_matrix() const { return m_matrix; }
+ void set_matrix(const matrix& m)
+ {
+ assert(m.is_valid());
+ m_matrix = m;
+ }
+ const cxform& get_cxform() const { return m_color_transform; }
+ void set_cxform(const cxform& cx) { m_color_transform = cx; }
+ void concatenate_cxform(const cxform& cx) {
m_color_transform.concatenate(cx); }
+ void concatenate_matrix(const matrix& m) { m_matrix.concatenate(m); }
+ float get_ratio() const { return m_ratio; }
+ void set_ratio(float f) { m_ratio = f; }
+ Uint16 get_clip_depth() const { return m_clip_depth; }
+ void set_clip_depth(Uint16 d) { m_clip_depth = d; }
+
+ void set_name(const char* name) { m_name = name; }
+ const tu_string& get_name() const { return m_name; }
+
+ // For edit_text support (Flash 5). More correct way
+ // is to do "text_character.text = whatever", via
+ // set_member().
+ virtual const char* get_text_name() const { return ""; }
+ virtual void set_text_value(const char* new_text) { assert(0); }
+
+ virtual matrix get_world_matrix() const
+ // Get our concatenated matrix (all our ancestor transforms, times our
matrix). Maps
+ // from our local space into "world" space (i.e. root movie space).
+ {
+ matrix m;
+ if (m_parent)
{
- assert((parent == NULL && m_id == -1)
- || (parent != NULL && m_id >= 0));
- }
-
- // Accessors for basic display info.
- int get_id() const { return m_id; }
- movie* get_parent() const { return m_parent; }
- void set_parent(movie* parent) { m_parent = parent; } //
for extern movie
- int get_depth() const { return m_depth; }
- void set_depth(int d) { m_depth = d; }
- const matrix& get_matrix() const { return m_matrix; }
- void set_matrix(const matrix& m)
- {
- assert(m.is_valid());
- m_matrix = m;
+ m = m_parent->get_world_matrix();
}
- const cxform& get_cxform() const { return m_color_transform; }
- void set_cxform(const cxform& cx) { m_color_transform = cx; }
- void concatenate_cxform(const cxform& cx) {
m_color_transform.concatenate(cx); }
- void concatenate_matrix(const matrix& m) {
m_matrix.concatenate(m); }
- float get_ratio() const { return m_ratio; }
- void set_ratio(float f) { m_ratio = f; }
- Uint16 get_clip_depth() const { return m_clip_depth; }
- void set_clip_depth(Uint16 d) { m_clip_depth = d; }
-
- void set_name(const char* name) { m_name = name; }
- const tu_string& get_name() const { return m_name; }
-
- // For edit_text support (Flash 5). More correct way
- // is to do "text_character.text = whatever", via
- // set_member().
- virtual const char* get_text_name() const { return ""; }
- virtual void set_text_value(const char* new_text) {
assert(0); }
-
- virtual matrix get_world_matrix() const
- // Get our concatenated matrix (all our ancestor transforms,
times our matrix). Maps
- // from our local space into "world" space (i.e. root movie
space).
- {
- matrix m;
- if (m_parent)
- {
- m = m_parent->get_world_matrix();
- }
- m.concatenate(get_matrix());
+ m.concatenate(get_matrix());
- return m;
- }
+ return m;
+ }
- virtual cxform get_world_cxform() const
- // Get our concatenated color transform (all our ancestor
transforms,
- // times our cxform). Maps from our local space into normal
color space.
+ virtual cxform get_world_cxform() const
+ // Get our concatenated color transform (all our ancestor transforms,
+ // times our cxform). Maps from our local space into normal color
space.
+ {
+ cxform m;
+ if (m_parent)
{
- cxform m;
- if (m_parent)
- {
- m = m_parent->get_world_cxform();
- }
- m.concatenate(get_cxform());
-
- return m;
+ m = m_parent->get_world_cxform();
}
+ m.concatenate(get_cxform());
- // Event handler accessors.
- bool get_event_handler(event_id id, as_value* result)
- {
- return m_event_handlers.get(id, result);
- }
- void set_event_handler(event_id id, const as_value& method)
- {
- m_event_handlers[id] = method;
- }
+ return m;
+ }
- // Movie interfaces. By default do nothing. sprite_instance
and some others override these.
- virtual void display() {}
- virtual float get_height() { return 0; }
- virtual float get_width() { return 0; }
-
- virtual movie* get_root_movie() { return
m_parent->get_root_movie(); }
- virtual int get_current_frame() const { assert(0); return
0; }
- virtual bool has_looped() const { assert(0); return false; }
- virtual void restart() { /*assert(0);*/ }
- virtual void advance(float delta_time) {
+ // Event handler accessors.
+ bool get_event_handler(event_id id, as_value* result)
+ {
+ return m_event_handlers.get(id, result);
+ }
+ void set_event_handler(event_id id, const as_value& method)
+ {
+ m_event_handlers[id] = method;
+ }
+
+ // Movie interfaces. By default do nothing. sprite_instance and some
others override these.
+ virtual void display() {}
+ virtual float get_height() { return 0; }
+ virtual float get_width() { return 0; }
+
+ virtual movie* get_root_movie() { return m_parent->get_root_movie(); }
+ virtual int get_current_frame() const { assert(0); return 0; }
+ virtual bool has_looped() const { assert(0); return false; }
+ virtual void restart() { /*assert(0);*/ }
+ virtual void advance(float delta_time) {
// printf("%s:\n", __PRETTY_FUNCTION__); // FIXME:
- } // for buttons and sprites
- virtual void goto_frame(int target_frame) {}
- virtual bool get_accept_anim_moves() const { return true; }
+ } // for buttons and sprites
+ virtual void goto_frame(int target_frame) {}
+ virtual bool get_accept_anim_moves() const { return true; }
- virtual void get_drag_state(drag_state* st) {
assert(m_parent); m_parent->get_drag_state(st); }
+ virtual void get_drag_state(drag_state* st) { assert(m_parent);
m_parent->get_drag_state(st); }
- virtual void set_visible(bool visible) { m_visible =
visible; }
- virtual bool get_visible() const { return m_visible; }
+ virtual void set_visible(bool visible) { m_visible = visible; }
+ virtual bool get_visible() const { return m_visible; }
- virtual void set_display_callback(void (*callback)(void*),
void* user_ptr)
- {
- m_display_callback = callback;
- m_display_callback_user_ptr = user_ptr;
- }
+ virtual void set_display_callback(void (*callback)(void*), void*
user_ptr)
+ {
+ m_display_callback = callback;
+ m_display_callback_user_ptr = user_ptr;
+ }
- virtual void do_display_callback()
- {
+ virtual void do_display_callback()
+ {
// GNASH_REPORT_FUNCTION;
- if (m_display_callback)
- {
-
(*m_display_callback)(m_display_callback_user_ptr);
- }
+ if (m_display_callback)
+ {
+ (*m_display_callback)(m_display_callback_user_ptr);
}
+ }
- virtual void get_mouse_state(int* x, int* y, int* buttons) {
get_parent()->get_mouse_state(x, y, buttons); }
+ virtual void get_mouse_state(int* x, int* y, int* buttons) {
get_parent()->get_mouse_state(x, y, buttons); }
- // Utility.
- void do_mouse_drag();
- };
+ // Utility.
+ void do_mouse_drag();
+};
- /// For characters that don't store unusual state in their instances.
- struct generic_character : public character
- {
- character_def* m_def;
+/// For characters that don't store unusual state in their instances.
+struct generic_character : public character
+{
+ character_def* m_def;
- generic_character(character_def* def, movie* parent, int id)
- :
- character(parent, id),
- m_def(def)
- {
- assert(m_def);
- }
+ generic_character(character_def* def, movie* parent, int id)
+ :
+ character(parent, id),
+ m_def(def)
+ {
+ assert(m_def);
+ }
- virtual void display()
- {
+ virtual void display()
+ {
// GNASH_REPORT_FUNCTION;
- m_def->display(this); // pass in transform info
- do_display_callback();
- }
+ m_def->display(this); // pass in transform info
+ do_display_callback();
+ }
+
+ // @@ tulrich: these are used for finding bounds; TODO
+ // need to do this using enclose_transformed_rect(),
+ // not by scaling the local height/width!
- // @@ tulrich: these are used for finding bounds; TODO
- // need to do this using enclose_transformed_rect(),
- // not by scaling the local height/width!
+ virtual float get_height()
+ {
+ matrix m = get_world_matrix();
+ float h = m_def->get_height_local() * m.m_[1][1];
+ return h;
+ }
- virtual float get_height()
- {
- matrix m = get_world_matrix();
- float h = m_def->get_height_local() * m.m_[1][1];
- return h;
- }
+ virtual float get_width()
+ {
+ matrix m = get_world_matrix();
+ float w = m_def->get_width_local() * m.m_[0][0];
+ return w;
+ }
- virtual float get_width()
- {
- matrix m = get_world_matrix();
- float w = m_def->get_width_local() * m.m_[0][0];
- return w;
- }
+ // new, from Vitaly.
+ virtual movie* get_topmost_mouse_entity(float x, float y)
+ {
+ assert(get_visible()); // caller should check this.
- // new, from Vitaly.
- virtual movie* get_topmost_mouse_entity(float x, float y)
- {
- assert(get_visible()); // caller should check this.
+ matrix m = get_matrix();
+ point p;
+ m.transform_by_inverse(&p, point(x, y));
- matrix m = get_matrix();
- point p;
- m.transform_by_inverse(&p, point(x, y));
-
- if (m_def->point_test_local(p.m_x, p.m_y))
- {
- // The mouse is inside the shape.
- return this;
- }
- return NULL;
+ if (m_def->point_test_local(p.m_x, p.m_y))
+ {
+ // The mouse is inside the shape.
+ return this;
}
- };
+ return NULL;
+ }
+};
- /// What's this ? An interface ?
- struct bitmap_character_def : public character_def
- {
- virtual gnash::bitmap_info* get_bitmap_info() = 0;
- };
+/// What's this ? An interface ?
+struct bitmap_character_def : public character_def
+{
+ virtual gnash::bitmap_info* get_bitmap_info() = 0;
+};
#if 1
- /// Bitmap character
- struct bitmap_character : public bitmap_character_def
+/// Bitmap character
+struct bitmap_character : public bitmap_character_def
+{
+ bitmap_character(bitmap_info* bi)
+ :
+ m_bitmap_info(bi)
{
- bitmap_character(bitmap_info* bi)
- :
- m_bitmap_info(bi)
- {
- }
+ }
// bitmap_character(image::rgb* image)
// {
@@ -605,113 +610,113 @@
// m_bitmap_info =
gnash::render::create_bitmap_info_rgba(image);
// }
- gnash::bitmap_info* get_bitmap_info()
- {
- return m_bitmap_info.get_ptr();
- }
+ gnash::bitmap_info* get_bitmap_info()
+ {
+ return m_bitmap_info.get_ptr();
+ }
- private:
- smart_ptr<gnash::bitmap_info> m_bitmap_info;
- };
+private:
+ smart_ptr<gnash::bitmap_info> m_bitmap_info;
+};
#endif
- /// Execute tags include things that control the operation of the
movie.
- //
- /// Essentially, these are the events associated with a frame.
- ///
- struct execute_tag
- {
- virtual ~execute_tag() {}
- virtual void execute(movie* m) {}
- virtual void execute_state(movie* m) {}
- virtual void execute_state_reverse(movie* m, int frame) {
execute_state(m); }
- virtual bool is_remove_tag() const { return false; }
- virtual bool is_action_tag() const { return false; }
- virtual uint32 get_depth_id_of_replace_or_add_tag() const {
return static_cast<uint32>(-1); }
- };
-
-
- //
- // Loader callbacks.
- //
+/// Execute tags include things that control the operation of the movie.
+//
+/// Essentially, these are the events associated with a frame.
+///
+struct execute_tag
+{
+ virtual ~execute_tag() {}
+ virtual void execute(movie* m) {}
+ virtual void execute_state(movie* m) {}
+ virtual void execute_state_reverse(movie* m, int frame) {
execute_state(m); }
+ virtual bool is_remove_tag() const { return false; }
+ virtual bool is_action_tag() const { return false; }
+ virtual uint32 get_depth_id_of_replace_or_add_tag() const { return
static_cast<uint32>(-1); }
+};
+
+
+//
+// Loader callbacks.
+//
- // Register a loader function for a certain tag type. Most
- // standard tags are handled within gnash. Host apps might want
- // to call this in order to handle special tag types.
+// Register a loader function for a certain tag type. Most
+// standard tags are handled within gnash. Host apps might want
+// to call this in order to handle special tag types.
- /// Signature of an SWF tag loader
- typedef void (*loader_function)(stream* input, int tag_type,
movie_definition* m);
+/// Signature of an SWF tag loader
+typedef void (*loader_function)(stream* input, int tag_type, movie_definition*
m);
- /// Register a tag loader for the given tag
- void register_tag_loader(int tag_type, loader_function lf);
+/// Register a tag loader for the given tag
+void register_tag_loader(int tag_type, loader_function lf);
- /// These are the registered tag loaders
- extern hash<int, loader_function> s_tag_loaders;
+/// These are the registered tag loaders
+extern hash<int, loader_function> s_tag_loaders;
- // Tag loader functions.
- void null_loader(stream* in, int tag_type, movie_definition* m);
- void set_background_color_loader(stream* in, int tag_type,
movie_definition* m);
- void jpeg_tables_loader(stream* in, int tag_type, movie_definition*
m);
- void define_bits_jpeg_loader(stream* in, int tag_type,
movie_definition* m);
- void define_bits_jpeg2_loader(stream* in, int tag_type,
movie_definition* m);
- void define_bits_jpeg3_loader(stream* in, int tag_type,
movie_definition* m);
- void fixme_loader(stream* in, int tag_type, movie_definition* m);
- void define_shape_loader(stream* in, int tag_type, movie_definition*
m);
- void define_shape_morph_loader(stream* in, int tag_type,
movie_definition* m);
- void define_font_loader(stream* in, int tag_type, movie_definition*
m);
- void define_font_info_loader(stream* in, int tag_type,
movie_definition* m);
- void define_text_loader(stream* in, int tag_type, movie_definition*
m);
- void define_edit_text_loader(stream* in, int tag_type,
movie_definition* m);
- void place_object_2_loader(stream* in, int tag_type,
movie_definition* m);
- void define_bits_lossless_2_loader(stream* in, int tag_type,
movie_definition* m);
- void sprite_loader(stream* in, int tag_type, movie_definition* m);
- void end_loader(stream* in, int tag_type, movie_definition* m);
- void remove_object_2_loader(stream* in, int tag_type,
movie_definition* m);
- void do_action_loader(stream* in, int tag_type, movie_definition* m);
- void button_character_loader(stream* in, int tag_type,
movie_definition* m);
- void frame_label_loader(stream* in, int tag_type, movie_definition*
m);
- void export_loader(stream* in, int tag_type, movie_definition* m);
- void import_loader(stream* in, int tag_type, movie_definition* m);
- void define_sound_loader(stream* in, int tag_type, movie_definition*
m);
- void start_sound_loader(stream* in, int tag_type, movie_definition*
m);
- void button_sound_loader(stream* in, int tag_type, movie_definition*
m);
- void do_init_action_loader(stream* in, int tag_type,
movie_definition* m);
- // sound_stream_loader(); // head, head2, block
-
-
- //
- // swf_event
- //
-
- /// For embedding event handlers in place_object_2
- struct swf_event
- {
- // NOTE: DO NOT USE THESE AS VALUE TYPES IN AN
- // std::vector<>! They cannot be moved! The private
- // operator=(const swf_event&) should help guard
- // against that.
-
- event_id m_event;
- action_buffer m_action_buffer;
- as_value m_method;
+// Tag loader functions.
+void null_loader(stream* in, int tag_type, movie_definition* m);
+void set_background_color_loader(stream* in, int tag_type, movie_definition*
m);
+void jpeg_tables_loader(stream* in, int tag_type, movie_definition* m);
+void define_bits_jpeg_loader(stream* in, int tag_type, movie_definition* m);
+void define_bits_jpeg2_loader(stream* in, int tag_type, movie_definition* m);
+void define_bits_jpeg3_loader(stream* in, int tag_type, movie_definition* m);
+void fixme_loader(stream* in, int tag_type, movie_definition* m);
+void define_shape_loader(stream* in, int tag_type, movie_definition* m);
+void define_shape_morph_loader(stream* in, int tag_type, movie_definition*
m);
+void define_font_loader(stream* in, int tag_type, movie_definition* m);
+void define_font_info_loader(stream* in, int tag_type, movie_definition* m);
+void define_text_loader(stream* in, int tag_type, movie_definition* m);
+void define_edit_text_loader(stream* in, int tag_type, movie_definition* m);
+void place_object_2_loader(stream* in, int tag_type, movie_definition* m);
+void define_bits_lossless_2_loader(stream* in, int tag_type,
movie_definition* m);
+void sprite_loader(stream* in, int tag_type, movie_definition* m);
+void end_loader(stream* in, int tag_type, movie_definition* m);
+void remove_object_2_loader(stream* in, int tag_type, movie_definition* m);
+void do_action_loader(stream* in, int tag_type, movie_definition* m);
+void button_character_loader(stream* in, int tag_type, movie_definition* m);
+void frame_label_loader(stream* in, int tag_type, movie_definition* m);
+void export_loader(stream* in, int tag_type, movie_definition* m);
+void import_loader(stream* in, int tag_type, movie_definition* m);
+void define_sound_loader(stream* in, int tag_type, movie_definition* m);
+void start_sound_loader(stream* in, int tag_type, movie_definition* m);
+void button_sound_loader(stream* in, int tag_type, movie_definition* m);
+void do_init_action_loader(stream* in, int tag_type, movie_definition* m);
+// sound_stream_loader(); // head, head2, block
+
+
+//
+// swf_event
+//
+
+/// For embedding event handlers in place_object_2
+struct swf_event
+{
+ // NOTE: DO NOT USE THESE AS VALUE TYPES IN AN
+ // std::vector<>! They cannot be moved! The private
+ // operator=(const swf_event&) should help guard
+ // against that.
+
+ event_id m_event;
+ action_buffer m_action_buffer;
+ as_value m_method;
- swf_event()
- {
- }
+ swf_event()
+ {
+ }
- void attach_to(character* ch) const
- {
- ch->set_event_handler(m_event, m_method);
- }
+ void attach_to(character* ch) const
+ {
+ ch->set_event_handler(m_event, m_method);
+ }
- void read(stream* in, Uint32 flags);
+ void read(stream* in, Uint32 flags);
- private:
- // DON'T USE THESE
- swf_event(const swf_event& s) { assert(0); }
- void operator=(const swf_event& s) { assert(0); }
- };
+private:
+ // DON'T USE THESE
+ swf_event(const swf_event& s) { assert(0); }
+ void operator=(const swf_event& s) { assert(0); }
+};
} // end namespace gnash
Index: gnash/server/xmlsocket.cpp
diff -u gnash/server/xmlsocket.cpp:1.11 gnash/server/xmlsocket.cpp:1.12
--- gnash/server/xmlsocket.cpp:1.11 Wed Apr 5 00:55:02 2006
+++ gnash/server/xmlsocket.cpp Mon Apr 10 20:21:39 2006
@@ -80,16 +80,6 @@
int xml_fd = 0; // FIXME: This file descriptor is used by
// XML::checkSocket() when called from the main
// processing loop.
-extern bool gofast; // FIXME: this flag gets set based on
- // an XML message written using
- // SendCommand(""). This way a movie
- // can optimize it's own performance
- // when needed,
-extern bool nodelay; // FIXME: this flag gets set based on
- // an XML message written using
- // SendCommand(""). This way a movie
- // can optimize it's own performance
- // when needed,
namespace gnash {
const int SOCKET_DATA = 1;
@@ -407,28 +397,7 @@
bool
XMLSocket::send(tu_string str)
{
- //log_msg("%s: \n", __FUNCTION__);
-
-
- if (strstr(str.c_str(), "gofast")) {
- gofast = true;
- printf("GOFAST!\n");
- return true;
- }
- if (strstr(str.c_str(), "goslow")) {
- printf("GOSLOW!\n");
- gofast = false;
- return true;
- }
- if (strstr(str.c_str(), "nodelay")) {
- if (nodelay) {
- nodelay = false;
- } else {
- nodelay = true;
- }
- printf("DELAY is set to %d!\n", nodelay);
- return true;
- }
+ //GNASH_REPORT_FUNCTION;
str += '\0';
int ret = write(_sockfd, str.c_str(), str.size());