[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10470: Minor renaming, comments and
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10470: Minor renaming, comments and other small changes. |
Date: |
Fri, 19 Dec 2008 16:43:48 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10470
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2008-12-19 16:43:48 +0100
message:
Minor renaming, comments and other small changes.
renamed:
libcore/asobj/Mouse.cpp => libcore/asobj/Mouse_as.cpp
libcore/asobj/Mouse.h => libcore/asobj/Mouse_as.h
libcore/asobj/SharedObject.cpp => libcore/asobj/SharedObject_as.cpp
libcore/asobj/SharedObject.h => libcore/asobj/SharedObject_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/MovieClipLoader.cpp
libcore/vm/VM.cpp
libcore/asobj/Mouse_as.cpp
libcore/asobj/Mouse_as.h
libcore/asobj/SharedObject_as.cpp
libcore/asobj/SharedObject_as.h
------------------------------------------------------------
revno: 10469.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Fri 2008-12-19 09:23:56 +0100
message:
Rename two classes.
renamed:
libcore/asobj/Mouse.cpp => libcore/asobj/Mouse_as.cpp
libcore/asobj/Mouse.h => libcore/asobj/Mouse_as.h
libcore/asobj/SharedObject.cpp => libcore/asobj/SharedObject_as.cpp
libcore/asobj/SharedObject.h => libcore/asobj/SharedObject_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/vm/VM.cpp
libcore/asobj/Mouse_as.cpp
libcore/asobj/Mouse_as.h
libcore/asobj/SharedObject_as.cpp
libcore/asobj/SharedObject_as.h
------------------------------------------------------------
revno: 10469.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Fri 2008-12-19 14:35:37 +0100
message:
Notes and cleanup in MovieCipLoader.
modified:
libcore/asobj/MovieClipLoader.cpp
=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp 2008-12-11 13:07:41 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp 2008-12-19 08:23:56 +0000
@@ -40,13 +40,13 @@
#include "Number_as.h"
#include "Object.h"
#include "Math_as.h"
-#include "Mouse.h"
+#include "Mouse_as.h"
#include "MovieClipLoader.h"
#include "movie_definition.h"
#include "NetConnection_as.h"
#include "NetStream_as.h"
#include "Selection_as.h"
-#include "SharedObject.h"
+#include "SharedObject_as.h"
#include "Sound.h"
#include "Stage_as.h"
#include "System_as.h"
@@ -302,7 +302,7 @@
{ XML_as::init, NSV::CLASS_X_M_L, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
{ XMLNode_as::init, NSV::CLASS_X_M_L_NODE, NSV::CLASS_OBJECT,
NSV::NS_FLASH_XML, 5 },
- { mouse_class_init, NSV::CLASS_MOUSE, NSV::CLASS_OBJECT,
NSV::NS_FLASH_UI, 5 },
+ { Mouse_as::init, NSV::CLASS_MOUSE, NSV::CLASS_OBJECT,
NSV::NS_FLASH_UI, 5 },
{ number_class_init, NSV::CLASS_NUMBER, NSV::CLASS_OBJECT, NS_GLOBAL, 5
},
{ textformat_class_init, NSV::CLASS_TEXT_FORMAT, NSV::CLASS_OBJECT,
NS_GLOBAL, 5 },
{ key_class_init, NSV::CLASS_KEY, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
@@ -313,7 +313,7 @@
{ microphone_class_init, NSV::CLASS_MICROPHONE, NSV::CLASS_OBJECT,
NSV::NS_FLASH_UI, 6 },
{ sharedobject_class_init, NSV::CLASS_SHARED_OBJECT, NSV::CLASS_OBJECT,
NSV::NS_FLASH_NET, 5 },
{ loadvars_class_init, NSV::CLASS_LOAD_VARS, NSV::CLASS_OBJECT,
NS_GLOBAL, 6 },
- { localconnection_class_init, NSV::CLASS_LOCAL_CONNECTION,
NSV::CLASS_OBJECT, NS_GLOBAL, 6 }, // FIXME: not global ?
+ { localconnection_class_init, NSV::CLASS_LOCAL_CONNECTION,
NSV::CLASS_OBJECT, NS_GLOBAL, 6 },
{ customactions_class_init, NSV::CLASS_CUSTOM_ACTIONS,
NSV::CLASS_OBJECT, NSV::NS_ADOBE_UTILS, 6 },
{ netconnection_class_init, NSV::CLASS_NET_CONNECTION,
NSV::CLASS_OBJECT, NSV::NS_FLASH_NET, 6 },
{ netstream_class_init, NSV::CLASS_NET_STREAM, NSV::CLASS_OBJECT,
NSV::NS_FLASH_NET, 6 },
=== modified file 'libcore/asobj/Global.cpp'
--- a/libcore/asobj/Global.cpp 2008-12-09 20:59:39 +0000
+++ b/libcore/asobj/Global.cpp 2008-12-19 08:23:56 +0000
@@ -47,12 +47,12 @@
#include "Math_as.h"
#include "XML_as.h"
#include "XMLSocket_as.h"
-#include "Mouse.h"
+#include "Mouse_as.h"
#include "MovieClipLoader.h"
#include "movie_definition.h"
#include "NetConnection_as.h"
#include "NetStream_as.h"
-#include "SharedObject.h"
+#include "SharedObject_as.h"
#include "Sound.h"
#include "Stage_as.h"
#include "System_as.h"
@@ -694,12 +694,13 @@
registerDateNative(global);
registerColorNative(global);
registerTextFormatNative(global);
- registerMouseNative(global);
registerMathNative(global);
registerSystemNative(global);
registerStageNative(global);
registerSharedObjectNative(global);
+ Mouse_as::registerNative(global);
+
// LoadableObject has natives shared between LoadVars and XML, so
// should be registered first.
LoadableObject::registerNative(global);
=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am 2008-12-05 07:35:49 +0000
+++ b/libcore/asobj/Makefile.am 2008-12-19 08:23:56 +0000
@@ -58,14 +58,14 @@
LocalConnection.cpp\
Math_as.cpp \
Microphone.cpp \
- Mouse.cpp \
+ Mouse_as.cpp \
NetConnection_as.cpp \
NetStream_as.cpp \
Number_as.cpp \
Object.cpp \
PlayHead.cpp \
Selection_as.cpp \
- SharedObject.cpp\
+ SharedObject_as.cpp\
Sound.cpp \
Stage_as.cpp \
System_as.cpp \
@@ -123,7 +123,7 @@
LoadVars_as.h \
LocalConnection.h\
Microphone.h \
- Mouse.h \
+ Mouse_as.h \
MovieClipLoader.h \
NetConnection_as.h \
NetStream_as.h \
@@ -132,7 +132,7 @@
PlayHead.h \
prophelper.h \
Selection_as.h \
- SharedObject.h \
+ SharedObject_as.h \
Sound.h \
Stage_as.h \
System_as.h \
=== renamed file 'libcore/asobj/Mouse.cpp' => 'libcore/asobj/Mouse_as.cpp'
--- a/libcore/asobj/Mouse.cpp 2008-09-04 03:04:47 +0000
+++ b/libcore/asobj/Mouse_as.cpp 2008-12-19 08:23:56 +0000
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-#include "Mouse.h"
+#include "Mouse_as.h"
#include "as_object.h" // for inheritance
#include "log.h"
#include "fn_call.h"
@@ -31,33 +31,58 @@
namespace gnash {
// Forward declarations
-static as_value mouse_hide(const fn_call& fn);
-static as_value mouse_show(const fn_call& fn);
-static void attachMouseInterface(as_object& o);
-
-void registerMouseNative(as_object& o)
-{
- VM& vm = o.getVM();
-
- vm.registerNative(mouse_show, 5, 0);
- vm.registerNative(mouse_hide, 5, 1);
-}
-
-static void
+namespace {
+ as_value mouse_hide(const fn_call& fn);
+ as_value mouse_show(const fn_call& fn);
+
+ void attachMouseInterface(as_object& o);
+}
+
+/// Mouse isn't a proper class in AS
+//
+/// Gnash's Mouse_as just has static methods.
+void
+Mouse_as::registerNative(as_object& o)
+{
+ VM& vm = o.getVM();
+
+ vm.registerNative(mouse_show, 5, 0);
+ vm.registerNative(mouse_hide, 5, 1);
+}
+
+
+// extern (used by Global.cpp)
+void
+Mouse_as::init(as_object& global)
+{
+ // This is going to be the global Mouse "class"/"function"
+ boost::intrusive_ptr<as_object> obj = new as_object(getObjectInterface());
+ attachMouseInterface(*obj);
+
+ // Register _global.Mouse
+ global.init_member("Mouse", obj.get());
+
+}
+
+
+namespace {
+
+void
attachMouseInterface(as_object& o)
{
- VM& vm = o.getVM();
+ VM& vm = o.getVM();
- o.init_member("show", vm.getNative(5, 0));
- o.init_member("hide", vm.getNative(5, 1));
-
- if (vm.getSWFVersion() > 5)
- {
- AsBroadcaster::initialize(o);
- }
+ o.init_member("show", vm.getNative(5, 0));
+ o.init_member("hide", vm.getNative(5, 1));
+
+ if (vm.getSWFVersion() > 5) {
+ AsBroadcaster::initialize(o);
+ }
}
-
+/// Returns whether the mouse was visible before the call.
+//
+/// The return is not a boolean, but rather 1 or 0.
as_value
mouse_hide(const fn_call& fn)
{
@@ -73,7 +98,9 @@
return as_value(success);
}
-
+/// Returns whether the mouse was visible before the call.
+//
+/// The return is not a boolean, but rather 1 or 0.
as_value
mouse_show(const fn_call& fn)
{
@@ -89,19 +116,5 @@
return as_value(success);
}
-
-// extern (used by Global.cpp)
-void
-mouse_class_init(as_object& global)
-{
- // This is going to be the global Mouse "class"/"function"
- boost::intrusive_ptr<as_object> obj = new
as_object(getObjectInterface());
- attachMouseInterface(*obj);
-
- // Register _global.Mouse
- global.init_member("Mouse", obj.get());
-
-}
-
-
+} // anonymous namespace
} // end of gnash namespace
=== renamed file 'libcore/asobj/Mouse.h' => 'libcore/asobj/Mouse_as.h'
--- a/libcore/asobj/Mouse.h 2008-04-16 10:16:32 +0000
+++ b/libcore/asobj/Mouse_as.h 2008-12-19 08:23:56 +0000
@@ -16,23 +16,24 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-#ifndef __GNASH_ASOBJ_MOUSE_H__
-#define __GNASH_ASOBJ_MOUSE_H__
-
-#include <memory> // for auto_ptr
+#ifndef GNASH_ASOBJ_MOUSE_H
+#define GNASH_ASOBJ_MOUSE_H
namespace gnash {
class as_object;
-/// Register native functions with the VM
-void registerMouseNative(as_object& global);
-
-/// Initialize the global Mouse class
-void mouse_class_init(as_object& global);
-
+class Mouse_as
+{
+public:
+ /// Register native functions with the VM
+ static void registerNative(as_object& global);
+
+ /// Initialize the global Mouse class
+ static void init(as_object& global);
+};
+
} // end of gnash namespace
-// __GNASH_ASOBJ_MOUSE_H__
#endif
=== modified file 'libcore/asobj/MovieClipLoader.cpp'
--- a/libcore/asobj/MovieClipLoader.cpp 2008-11-15 19:49:41 +0000
+++ b/libcore/asobj/MovieClipLoader.cpp 2008-12-19 13:35:37 +0000
@@ -27,7 +27,6 @@
#include "as_object.h" // for inheritance
#include "fn_call.h"
#include "as_function.h"
-#include "movie_definition.h"
#include "MovieClip.h"
#include "character.h" // for loadClip (get_parent)
#include "log.h"
@@ -41,10 +40,7 @@
#include "array.h" // for _listeners construction
#include "ExecutableCode.h"
-#include <typeinfo>
#include <string>
-#include <set>
-#include <boost/algorithm/string/case_conv.hpp> // for PROPNAME
//#define GNASH_DEBUG 1
@@ -116,25 +112,16 @@
attachMovieClipLoaderInterface(as_object& o)
{
o.init_member("loadClip", new
builtin_function(moviecliploader_loadclip));
- o.init_member("unloadClip", new
builtin_function(moviecliploader_unloadclip));
- o.init_member("getProgress", new
builtin_function(moviecliploader_getprogress));
+ o.init_member("unloadClip",
+ new builtin_function(moviecliploader_unloadclip));
+ o.init_member("getProgress",
+ new builtin_function(moviecliploader_getprogress));
// NOTE: we want addListener/removeListener/broadcastMessage
// but don't what the _listeners property here...
// TODO: add an argument to AsBroadcaster::initialize skip listeners ?
AsBroadcaster::initialize(o);
o.delProperty(NSV::PROP_uLISTENERS);
-
-#if 0
- // Load the default event handlers. These should really never
- // be called directly, as to be useful they are redefined
- // within the SWF script. These get called if there is a problem
- // Setup the event handlers
- o.set_event_handler(event_id::LOAD_INIT, new
builtin_function(event_test));
- o.set_event_handler(event_id::LOAD_START, new
builtin_function(event_test));
- o.set_event_handler(event_id::LOAD_PROGRESS, new
builtin_function(event_test));
- o.set_event_handler(event_id::LOAD_ERROR, new
builtin_function(event_test));
-#endif
}
@@ -145,7 +132,6 @@
if ( o == NULL )
{
o = new as_object(getObjectInterface());
- //log_debug(_("MovieClipLoader interface @ %p"), o.get());
attachMovieClipLoaderInterface(*o);
}
return o.get();
@@ -162,7 +148,7 @@
/// MovieClip
bool loadClip(const std::string& url, MovieClip& target);
- void unloadClip(void *);
+ void unloadClip();
private:
@@ -185,7 +171,6 @@
MovieClipLoader::~MovieClipLoader()
{
- //GNASH_REPORT_FUNCTION;
}
bool
@@ -194,7 +179,7 @@
movie_root& mr = _vm.getRoot();
- URL url(url_str.c_str(), mr.runInfo().baseURL());
+ URL url(url_str, mr.runInfo().baseURL());
#if GNASH_DEBUG
log_debug(_(" resolved url: %s"), url.str());
@@ -206,34 +191,41 @@
bool ret = target.loadMovie(url);
if ( ! ret )
{
- // TODO: find semantic of last argument
- as_value met("onLoadError");
+
+ // FIXME: docs suggest the string can be either "URLNotFound" or
+ // "LoadNeverCompleted". This is neither of them:
as_value arg1("Failed to load movie or jpeg");
+
+ // FIXME: The last argument is HTTP status, or 0 if no
connection
+ // was attempted (sandbox) or no status information is available
+ // (supposedly the Adobe mozilla plugin).
as_value arg2(0.0);
- callMethod(NSV::PROP_BROADCAST_MESSAGE, met, targetVal, arg1,
arg2);
+ callMethod(NSV::PROP_BROADCAST_MESSAGE, "onLoadError",
targetVal,
+ arg1, arg2);
return false;
}
- MovieClip* newChar = targetVal.to_sprite(); // this is to resolve the
soft ref
+ // this is to resolve the soft ref
+ MovieClip* newChar = targetVal.to_sprite();
if ( ! newChar )
{
// We could assert, but let's try to be nicer...
- log_error("MovieClip::loadMovie destroyed self w/out replacing
?");
+ log_error("MovieClip::loadMovie destroyed self without
replacing?");
return false;
}
// Dispatch onLoadStart
- callMethod(NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadStart"),
targetVal);
+ callMethod(NSV::PROP_BROADCAST_MESSAGE, "onLoadStart", targetVal);
// Dispatch onLoadProgress
size_t bytesLoaded = newChar->get_bytes_loaded();
size_t bytesTotal = newChar->get_bytes_total();
- callMethod(NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadProgress"),
targetVal,
+ callMethod(NSV::PROP_BROADCAST_MESSAGE, "onLoadProgress", targetVal,
bytesLoaded, bytesTotal);
// Dispatch onLoadComplete
- callMethod(NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadComplete"),
targetVal,
+ callMethod(NSV::PROP_BROADCAST_MESSAGE, "onLoadComplete", targetVal,
as_value(0.0)); // TODO: find semantic of last arg
/// This event must be dispatched when actions
@@ -242,16 +234,17 @@
/// Since MovieClip::loadMovie above will invoke stagePlacementCallback
/// and thus queue all actions in first frame, we'll queue the
/// onLoadInit call next, so it happens after the former.
- ///
- //callMethod(NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadInit"),
targetVal);
- std::auto_ptr<ExecutableCode> code ( new DelayedFunctionCall(this,
NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadInit"), targetVal) );
+ std::auto_ptr<ExecutableCode> code(
+ new DelayedFunctionCall(this, NSV::PROP_BROADCAST_MESSAGE,
+ "onLoadInit", targetVal));
+
_vm.getRoot().pushAction(code, movie_root::apDOACTION);
return true;
}
void
-MovieClipLoader::unloadClip(void *)
+MovieClipLoader::unloadClip()
{
GNASH_REPORT_FUNCTION;
}
@@ -259,17 +252,16 @@
static as_value
moviecliploader_loadclip(const fn_call& fn)
{
- as_value val, method;
-
- //log_debug(_("%s: nargs = %d"), __FUNCTION__, fn.nargs);
-
- boost::intrusive_ptr<MovieClipLoader> ptr =
ensureType<MovieClipLoader>(fn.this_ptr);
+
+ boost::intrusive_ptr<MovieClipLoader> ptr =
+ ensureType<MovieClipLoader>(fn.this_ptr);
if ( fn.nargs < 2 )
{
IF_VERBOSE_ASCODING_ERRORS(
std::stringstream ss; fn.dump_args(ss);
- log_aserror(_("MovieClipLoader.loadClip(%s): missing
arguments"), ss.str());
+ log_aserror(_("MovieClipLoader.loadClip(%s): missing
arguments"),
+ ss.str());
);
return as_value(false);
}
@@ -323,10 +315,9 @@
moviecliploader_new(const fn_call& /* fn */)
{
- as_object* mov_obj = new MovieClipLoader;
- //log_debug(_("MovieClipLoader instance @ %p"), mov_obj);
+ as_object* mov_obj = new MovieClipLoader;
- return as_value(mov_obj); // will store in a boost::intrusive_ptr
+ return as_value(mov_obj);
}
// Invoked every time the loading content is written to disk during
@@ -334,9 +325,9 @@
static as_value
moviecliploader_getprogress(const fn_call& fn)
{
- //log_debug(_("%s: nargs = %d"), __FUNCTION__, nargs);
- boost::intrusive_ptr<MovieClipLoader> ptr =
ensureType<MovieClipLoader>(fn.this_ptr);
+ boost::intrusive_ptr<MovieClipLoader> ptr =
+ ensureType<MovieClipLoader>(fn.this_ptr);
if ( ! fn.nargs )
{
@@ -351,8 +342,8 @@
if ( ! target.get() )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("MovieClipLoader.getProgress(%s): first argument
is not an object"),
- fn.arg(0));
+ log_aserror(_("MovieClipLoader.getProgress(%s): first argument
is "
+ "not an object"), fn.arg(0));
);
return as_value();
}
@@ -361,14 +352,14 @@
if ( ! sp )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("MovieClipLoader.getProgress(%s): first argument
is not an sprite"),
- fn.arg(0));
+ log_aserror(_("MovieClipLoader.getProgress(%s): first argument
is "
+ "not an sprite"), fn.arg(0));
);
return as_value();
}
- boost::intrusive_ptr<as_object> mcl_obj ( new as_object() );
+ boost::intrusive_ptr<as_object> mcl_obj = new as_object;
size_t bytesLoaded = sp->get_bytes_loaded();
size_t bytesTotal = sp->get_bytes_total();
@@ -376,9 +367,8 @@
string_table& st = ptr->getVM().getStringTable();
// We want these to be enumerable
- mcl_obj->set_member(st.find(PROPNAME("bytesLoaded")), bytesLoaded);
- mcl_obj->set_member(st.find(PROPNAME("bytesTotal")), bytesTotal);
-
+ mcl_obj->set_member(st.find("bytesLoaded"), bytesLoaded);
+ mcl_obj->set_member(st.find("bytesTotal"), bytesTotal);
return as_value(mcl_obj.get()); // will keep alive
}
@@ -391,10 +381,10 @@
if ( cl == NULL )
{
- cl=new builtin_function(&moviecliploader_new,
getMovieClipLoaderInterface());
+ cl=new builtin_function(&moviecliploader_new,
+ getMovieClipLoaderInterface());
}
- global.init_member("MovieClipLoader", cl.get());
//as_value(moviecliploader_new));
- //log_debug(_("MovieClipLoader class @ %p"), cl.get());
+ global.init_member("MovieClipLoader", cl.get());
}
} // end of gnash namespace
=== renamed file 'libcore/asobj/SharedObject.cpp' =>
'libcore/asobj/SharedObject_as.cpp'
--- a/libcore/asobj/SharedObject.cpp 2008-12-15 12:29:59 +0000
+++ b/libcore/asobj/SharedObject_as.cpp 2008-12-19 08:23:56 +0000
@@ -1,4 +1,4 @@
-// SharedObject.cpp: ActionScript "SharedObject" class, for Gnash.
+// SharedObject_as.cpp: ActionScript "SharedObject" class, for Gnash.
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
@@ -32,7 +32,7 @@
#include "amf.h"
#include "element.h"
#include "sol.h"
-#include "SharedObject.h"
+#include "SharedObject_as.h"
#include "as_object.h" // for inheritance
#include "log.h"
#include "fn_call.h"
@@ -220,13 +220,13 @@
} // anonymous namespace
-class SharedObject: public as_object
+class SharedObject_as: public as_object
{
public:
- ~SharedObject();
+ ~SharedObject_as();
- SharedObject()
+ SharedObject_as()
:
as_object(getSharedObjectInterface()),
_data(0)
@@ -291,7 +291,7 @@
SOL _sol;
};
-SharedObject::~SharedObject()
+SharedObject_as::~SharedObject_as()
{
/// This apparently used to cause problems if the VM no longer exists on
/// destruction. It certainly would. However, it *has* to be done, so if it
@@ -301,7 +301,7 @@
bool
-SharedObject::flush(int space) const
+SharedObject_as::flush(int space) const
{
/// This is called on on destruction of the SharedObject, or (allegedly)
@@ -476,12 +476,12 @@
for (SoLib::const_iterator it = _soLib.begin(), itE = _soLib.end();
it != itE; ++it)
{
- SharedObject* sh = it->second;
+ SharedObject_as* sh = it->second;
sh->setReachable();
}
}
-SharedObject*
+SharedObject_as*
SharedObjectLibrary::getLocal(const std::string& objName,
const std::string& root)
{
@@ -571,7 +571,7 @@
log_debug("SharedObject %s not loaded. Loading it now", key);
// Otherwise create a new one and register to the lib
- SharedObject* obj = new SharedObject();
+ SharedObject_as* obj = new SharedObject_as;
_soLib[key] = obj;
obj->setObjectName(objName);
@@ -592,8 +592,6 @@
return obj;
}
-
-// extern (used by Global.cpp)
void
sharedobject_class_init(as_object& global)
{
@@ -697,8 +695,8 @@
as_value
sharedobject_clear(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
LOG_ONCE(log_unimpl (__FUNCTION__));
@@ -709,8 +707,8 @@
as_value
sharedobject_connect(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
LOG_ONCE(log_unimpl("SharedObject.connect"));
@@ -720,8 +718,8 @@
as_value
sharedobject_close(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
LOG_ONCE(log_unimpl("SharedObject.close"));
@@ -731,8 +729,8 @@
as_value
sharedobject_setFps(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
LOG_ONCE(log_unimpl("SharedObject.setFps"));
@@ -742,8 +740,8 @@
as_value
sharedobject_send(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
LOG_ONCE(log_unimpl("SharedObject.send"));
@@ -756,8 +754,8 @@
GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
IF_VERBOSE_ASCODING_ERRORS(
if (fn.nargs > 1)
@@ -813,7 +811,7 @@
log_debug("SO name:%s, root:%s", objName, root);
- SharedObject* obj = vm.getSharedObjectLibrary().getLocal(objName, root);
+ SharedObject_as* obj = vm.getSharedObjectLibrary().getLocal(objName, root);
as_value ret(obj);
log_debug("SharedObject.getLocal returning %s", ret);
@@ -824,8 +822,8 @@
as_value
sharedobject_getRemote(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
@@ -840,8 +838,8 @@
as_value
sharedobject_deleteAll(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
@@ -855,8 +853,8 @@
as_value
sharedobject_getDiskUsage(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
UNUSED(obj);
@@ -868,23 +866,23 @@
as_value
sharedobject_data(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
return as_value(obj->data());
}
as_value
sharedobject_getsize(const fn_call& fn)
{
- boost::intrusive_ptr<SharedObject> obj =
- ensureType<SharedObject>(fn.this_ptr);
+ boost::intrusive_ptr<SharedObject_as> obj =
+ ensureType<SharedObject_as>(fn.this_ptr);
return as_value(obj->size());
}
as_value
sharedobject_ctor(const fn_call& /* fn */)
{
- boost::intrusive_ptr<as_object> obj = new SharedObject;
+ boost::intrusive_ptr<as_object> obj = new SharedObject_as;
return as_value(obj.get()); // will keep alive
}
=== renamed file 'libcore/asobj/SharedObject.h' =>
'libcore/asobj/SharedObject_as.h'
--- a/libcore/asobj/SharedObject.h 2008-12-18 00:59:49 +0000
+++ b/libcore/asobj/SharedObject_as.h 2008-12-19 08:23:56 +0000
@@ -25,7 +25,7 @@
// Forward declarations
namespace gnash {
class as_object;
- class SharedObject;
+ class SharedObject_as;
class VM;
}
@@ -41,7 +41,7 @@
//
/// May return NULL if name is invalid or can't access the given root
///
- SharedObject* getLocal(const std::string& name, const std::string& root);
+ SharedObject_as* getLocal(const std::string& name, const std::string&
root);
void markReachableResources() const;
@@ -61,7 +61,7 @@
/// Base SOL dir
std::string _solSafeDir;
- typedef std::map<std::string, SharedObject*> SoLib;
+ typedef std::map<std::string, SharedObject_as*> SoLib;
SoLib _soLib;
};
@@ -70,6 +70,7 @@
void sharedobject_class_init(as_object& global);
void registerSharedObjectNative(as_object& o);
+
} // end of gnash namespace
=== modified file 'libcore/vm/VM.cpp'
--- a/libcore/vm/VM.cpp 2008-11-20 15:22:13 +0000
+++ b/libcore/vm/VM.cpp 2008-12-19 08:23:56 +0000
@@ -22,7 +22,7 @@
#endif
#include "VM.h"
-#include "SharedObject.h" // for SharedObjectLibrary
+#include "SharedObject_as.h" // for SharedObjectLibrary
#include "smart_ptr.h" // GNASH_USE_GC
#include "builtin_function.h"
#include "movie_definition.h"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10470: Minor renaming, comments and other small changes.,
Benjamin Wolsey <=