[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ./ChangeLog server/MovieClipLoader.cpp se...
From: |
strk |
Subject: |
[Gnash-commit] gnash ./ChangeLog server/MovieClipLoader.cpp se... |
Date: |
Fri, 03 Feb 2006 21:33:39 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: strk <address@hidden> 06/02/03 21:33:39
Modified files:
. : ChangeLog
server : MovieClipLoader.cpp MovieClipLoader.h
Log message:
Updated ChangeLog, indentation of MovieClipLoader class
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.77&tr2=1.78&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/MovieClipLoader.cpp.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/MovieClipLoader.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.77 gnash/ChangeLog:1.78
--- gnash/ChangeLog:1.77 Fri Feb 3 21:10:11 2006
+++ gnash/ChangeLog Fri Feb 3 21:33:39 2006
@@ -51,6 +51,7 @@
* testsuite/actionscript.all/Makefile.am: added support for
user-defined flags to ``makeswf'' invocation
(for -DUSE_XTRACE, mainly)
+ * libbase/: image.h, jpeg.h: Doxygen-compatible comments
2006-02-03 Michael Carlson <address@hidden>
Index: gnash/server/MovieClipLoader.cpp
diff -u gnash/server/MovieClipLoader.cpp:1.4
gnash/server/MovieClipLoader.cpp:1.5
--- gnash/server/MovieClipLoader.cpp:1.4 Fri Feb 3 12:53:38 2006
+++ gnash/server/MovieClipLoader.cpp Fri Feb 3 21:33:39 2006
@@ -187,25 +187,16 @@
void moviecliploader_loadclip(const fn_call& fn)
{
#ifdef HAVE_LIBXML
- //as_value* result = fn.result;
- //as_object_interface* this_ptr = fn.this_ptr;
- //int nargs = fn.nargs;
- //int first_arg = fn.first_arg_bottom_index;
- //as_environment* env = fn.env;
+ as_value val, method;
+ struct stat stats;
+ int fd;
- as_value val, method;
- struct stat stats;
- int fd;
+ log_msg("%s: nargs = %d\n", __FUNCTION__, fn.nargs);
-#if 0
- fn.result->set_bool(true); // FIXME:
- log_msg("%s: FIXME: this function disabled for memory leak testing.\n",
__FUNCTION__);
- return; // FIXME:
-#endif
-
- log_msg("%s: nargs = %d\n", __FUNCTION__, fn.nargs);
+ moviecliploader_as_object* ptr = \
+ dynamic_cast<moviecliploader_as_object*>(fn.this_ptr);
- moviecliploader_as_object* ptr = (moviecliploader_as_object*) (as_object*)
fn.this_ptr;
+ assert(ptr);
tu_string url = fn.arg(0).to_string();
as_object *target = (as_object *)fn.arg(1).to_object();
@@ -345,42 +336,48 @@
#endif
- tu_string suffix = filespec.utf8_substring(filespec.length() - 4,
filespec.length());
- log_msg("File suffix to load is: %s\n", suffix.c_str());
+ tu_string suffix = filespec.utf8_substring(filespec.length() - 4,
+ filespec.length());
+ log_msg("File suffix to load is: %s\n", suffix.c_str());
- if (suffix == ".swf") {
- movie_definition_sub* md = create_library_movie_sub(filespec.c_str());
- if (md == NULL) {
- log_error("can't create movie_definition_sub for %s\n",
filespec.c_str());
- return;
- }
- gnash::movie_interface* extern_movie;
- extern_movie = md->create_instance();
- if (extern_movie == NULL) {
- log_error("can't create extern movie_interface for %s\n",
filespec.c_str());
- return;
- }
+ if (suffix == ".swf")
+ {
+ movie_definition_sub* md = \
+ create_library_movie_sub(filespec.c_str());
+ if (md == NULL) {
+ log_error("can't create movie_definition_sub for %s\n",
+ filespec.c_str());
+ return;
+ }
+ gnash::movie_interface* extern_movie;
+ extern_movie = md->create_instance();
+ if (extern_movie == NULL) {
+ log_error("can't create extern movie_interface "
+ "for %s\n", filespec.c_str());
+ return;
+ }
- save_extern_movie(extern_movie);
-
- character* tar = (character*)target;
- const char* name = tar->get_name();
- Uint16 depth = tar->get_depth();
- bool use_cxform = false;
- cxform color_transform = tar->get_cxform();
- bool use_matrix = false;
- matrix mat = tar->get_matrix();
- float ratio = tar->get_ratio();
- Uint16 clip_depth = tar->get_clip_depth();
+ save_extern_movie(extern_movie);
- movie* parent = tar->get_parent();
- movie* new_movie = static_cast<movie*>(extern_movie)->get_root_movie();
-
- assert(parent != NULL);
-
- ((character*)new_movie)->set_parent(parent);
+ character* tar = (character*)target;
+ const char* name = tar->get_name();
+ Uint16 depth = tar->get_depth();
+ bool use_cxform = false;
+ cxform color_transform = tar->get_cxform();
+ bool use_matrix = false;
+ matrix mat = tar->get_matrix();
+ float ratio = tar->get_ratio();
+ Uint16 clip_depth = tar->get_clip_depth();
+
+ movie* parent = tar->get_parent();
+ movie* new_movie =
static_cast<movie*>(extern_movie)->get_root_movie();
+
+ assert(parent != NULL);
+
+ ((character*)new_movie)->set_parent(parent);
- parent->replace_display_object((character*) new_movie,
+ parent->replace_display_object(
+ (character*) new_movie,
name,
depth,
use_cxform,
@@ -389,13 +386,15 @@
mat,
ratio,
clip_depth);
- }
+ }
- else if (suffix == ".jpg") {
+ else if (suffix == ".jpg")
+ {
- // Just case the filespec suffix claims it's a jpeg, we have to
check,
- // since when grabbing an image from a web server that doesn't
exist,
- // we don't get an error, we get a short HTML page containing a
404.
+ // Just case the filespec suffix claims it's a jpeg,
+ // we have to check, since when grabbing an image from a
+ // web server that doesn't exist, we don't get an error,
+ // we get a short HTML page containing a 404.
if ((fd=open(filespec.c_str(), O_RDONLY)) < 0)
{
log_error("can't open image!\n");
@@ -428,67 +427,71 @@
//log_msg("File is a JPEG!\n");
- bitmap_info* bi = NULL;
- image::rgb* im = image::read_jpeg(filespec.c_str());
- if (im != NULL) {
- bi = render::create_bitmap_info_rgb(im);
- delete im;
- } else {
- log_error("Can't read jpeg: %s\n", filespec.c_str());
- }
-
- //bitmap_character* ch = new bitmap_character(bi);
-
- movie *mov = target->to_movie();
- //movie_definition *def = mov->get_movie_definition();
- //movie_definition_sub *m = (movie_definition_sub *)mov;
- //target->add_bitmap_info(bi);
-
- character* tar = (character*)mov;
- const char* name = tar->get_name();
- Uint16 id = tar->get_id();
- //log_msg("Target name is: %s, ID: %d\n", name, id);
-
- // FIXME: none of this works yet
-
- //movie_definition *md = create_library_movie(filespec.c_str());
- // add image to movie, under character id.
- //m->add_bitmap_character(666, ch);
-
- tu_string swfm = filespec.utf8_substring(0, filespec.length() - 3);
- swfm += "swf";
-
- movie_definition_sub *ms = create_movie_sub(swfm.c_str());
- // The file may not exist.
- if (ms) {
- movie_interface* extern_movie = create_library_movie_inst_sub(ms);
- character * newchar = ms->create_character_instance(tar->get_parent(),
id);
- }
+ bitmap_info* bi = NULL;
+ image::rgb* im = image::read_jpeg(filespec.c_str());
+ if (im != NULL) {
+ bi = render::create_bitmap_info_rgb(im);
+ delete im;
+ } else {
+ log_error("Can't read jpeg: %s\n", filespec.c_str());
+ }
+
+ //bitmap_character* ch = new bitmap_character(bi);
+
+ movie *mov = target->to_movie();
+ //movie_definition *def = mov->get_movie_definition();
+ //movie_definition_sub *m = (movie_definition_sub *)mov;
+ //target->add_bitmap_info(bi);
+
+ character* tar = (character*)mov;
+ const char* name = tar->get_name();
+ Uint16 id = tar->get_id();
+ //log_msg("Target name is: %s, ID: %d\n", name, id);
+
+ // FIXME: none of this works yet
+
+ //movie_definition *md = create_library_movie(filespec.c_str());
+ // add image to movie, under character id.
+ //m->add_bitmap_character(666, ch);
+
+ tu_string swfm = filespec.utf8_substring(0,
+ filespec.length() - 3);
+ swfm += "swf";
+
+ movie_definition_sub *ms = create_movie_sub(swfm.c_str());
+ // The file may not exist.
+ if (ms) {
+ movie_interface* extern_movie = \
+ create_library_movie_inst_sub(ms);
+ character * newchar = \
+ ms->create_character_instance(tar->get_parent(),
+ id);
+ }
- //save_extern_movie(extern_movie);
- //movie* new_movie = static_cast<movie*>(extern_movie)->get_root_movie();
+ //save_extern_movie(extern_movie);
+ //movie* new_movie =
static_cast<movie*>(extern_movie)->get_root_movie();
// #else
// movie_definition_sub *ms;
// ms->add_bitmap_info(bi);
// #endif
- //movie* m = mov->get_root_movie();
- //set_current_root(extern_movie);
- //movie* m = static_cast<movie*>(extern_movie)->get_root_movie();
- mov->on_event(event_id::LOAD);
- //add_display_object();
-
- //Uint16 depth = tar->get_depth();
- bool use_cxform = false;
- //cxform color_transform = tar->get_cxform();
- bool use_matrix = false;
- matrix mat = tar->get_matrix();
- //float ratio = tar->get_ratio();
- //Uint16 clip_depth = tar->get_clip_depth();
- array<swf_event*> dummy_event_handlers;
- movie* parent = tar->get_parent();
+ //movie* m = mov->get_root_movie();
+ //set_current_root(extern_movie);
+ //movie* m =
static_cast<movie*>(extern_movie)->get_root_movie();
+ mov->on_event(event_id::LOAD);
+ //add_display_object();
+
+ //Uint16 depth = tar->get_depth();
+ bool use_cxform = false;
+ //cxform color_transform = tar->get_cxform();
+ bool use_matrix = false;
+ matrix mat = tar->get_matrix();
+ //float ratio = tar->get_ratio();
+ //Uint16 clip_depth = tar->get_clip_depth();
+ array<swf_event*> dummy_event_handlers;
+ movie* parent = tar->get_parent();
- character *newch = new character(parent, id);
+ character *newch = new character(parent, id);
#if 0
parent->clone_display_object(name, "album_image", depth);
@@ -503,7 +506,7 @@
tar->get_clip_depth());
#endif // def HAVE_LIBXML
- parent->replace_display_object(newch,
+ parent->replace_display_object(newch,
name,
tar->get_depth(),
use_cxform,
@@ -512,26 +515,26 @@
tar->get_matrix(),
tar->get_ratio(),
tar->get_clip_depth());
- }
+ }
- struct mcl *mcl_data = ptr->mov_obj.getProgress(target);
+ struct mcl *mcl_data = ptr->mov_obj.getProgress(target);
+
+ // the callback since we're done loading the file
+ // FIXME: these both probably shouldn't be set to the same value
+ mcl_data->bytes_loaded = stats.st_size;
+ mcl_data->bytes_total = stats.st_size;
- // the callback since we're done loading the file
- // FIXME: these both probably shouldn't be set to the same value
- mcl_data->bytes_loaded = stats.st_size;
- mcl_data->bytes_total = stats.st_size;
-
- fn.env->set_member("target_mc", target);
- //env->push(as_value(target));
- //moviecliploader_onload_complete(result, this_ptr, env, 0, 0);
- moviecliploader_onload_complete(fn);
- //env->pop();
+ fn.env->set_member("target_mc", target);
+ //env->push(as_value(target));
+ //moviecliploader_onload_complete(result, this_ptr, env, 0, 0);
+ moviecliploader_onload_complete(fn);
+ //env->pop();
- fn.result->set_bool(true);
+ fn.result->set_bool(true);
- //unlink(filespec.c_str());
+ //unlink(filespec.c_str());
- //xmlNanoHTTPCleanup();
+ //xmlNanoHTTPCleanup();
#endif // HAVE_LIBXML
}
Index: gnash/server/MovieClipLoader.h
diff -u gnash/server/MovieClipLoader.h:1.3 gnash/server/MovieClipLoader.h:1.4
--- gnash/server/MovieClipLoader.h:1.3 Wed Feb 1 18:07:13 2006
+++ gnash/server/MovieClipLoader.h Fri Feb 3 21:33:39 2006
@@ -33,52 +33,46 @@
int bytes_total;
};
-#if 0
- struct MovieClipLoader : public character
- {
- MovieClipLoader(movie* parent, int id) :
- character(parent, id)
- {
- log_msg("%s: \n", __FUNCTION__);
- }
-#else
class MovieClipLoader
{
-#endif
public:
- MovieClipLoader();
- ~MovieClipLoader();
+ MovieClipLoader();
- void load(const tu_string& filespec);
+ ~MovieClipLoader();
+
+ void load(const tu_string& filespec);
- struct mcl *getProgress(as_object *ao);
+ struct mcl *getProgress(as_object *ao);
+
+ /// MovieClip
+ bool loadClip(const tu_string& url, void *);
- bool loadClip(const tu_string& str, void *);
- void unloadClip(void *);
- void addListener(void *);
- void removeListener(void *);
-
- void on_button_event(event_id event);
- // Callbacks
- void onLoadStart(void *);
- void onLoadProgress(void *);
- void onLoadInit(void *);
- void onLoadComplete(void *);
- void onLoadError(void *);
- private:
- bool _started;
- bool _completed;
- tu_string _filespec;
- int _progress;
- bool _error;
- struct mcl _mcl;
- mouse_state _mouse_state;
+ void unloadClip(void *);
+ void addListener(void *);
+ void removeListener(void *);
+
+ void on_button_event(event_id event);
+ // Callbacks
+ void onLoadStart(void *);
+ void onLoadProgress(void *);
+ void onLoadInit(void *);
+ void onLoadComplete(void *);
+ void onLoadError(void *);
+ private:
+ bool _started;
+ bool _completed;
+ tu_string _filespec;
+ int _progress;
+ bool _error;
+ struct mcl _mcl;
+ mouse_state _mouse_state;
};
+ /// MovieClipLoader ActionScript object
struct moviecliploader_as_object : public as_object
{
- MovieClipLoader mov_obj;
+ MovieClipLoader mov_obj;
};
/// Progress object to use as return of MovieClipLoader.getProgress()
- [Gnash-commit] gnash ./ChangeLog server/MovieClipLoader.cpp se...,
strk <=