[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp server/...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp server/... |
Date: |
Thu, 29 May 2008 12:44:30 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/05/29 12:44:30
Modified files:
. : ChangeLog
server/asobj : Global.cpp Mouse.cpp Object.cpp Sound.cpp
Stage.cpp gstring.h string.cpp xmlsocket.cpp
Log message:
* server/asobj/{string.cpp,gstring.h}: get VM from object. Make
init_string_instance take const std::string&, as that's what
is usually passed to it.
* server/asobj/Mouse.cpp, server/asobj/System.cpp,
server/asobj/Stage.cpp, server/asobj/Sound.cpp,
server/asobj/Object.cpp, server/asobj/Global.cpp: get VM from
object.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6758&r2=1.6759
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.130&r2=1.131
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Mouse.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Sound.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Stage.cpp?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/gstring.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xmlsocket.cpp?cvsroot=gnash&r1=1.48&r2=1.49
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6758
retrieving revision 1.6759
diff -u -b -r1.6758 -r1.6759
--- ChangeLog 29 May 2008 12:26:42 -0000 1.6758
+++ ChangeLog 29 May 2008 12:44:28 -0000 1.6759
@@ -1,3 +1,13 @@
+2008-05-29 Benjamin Wolsey <address@hidden>
+
+ * server/asobj/{string.cpp,gstring.h}: get VM from object. Make
+ init_string_instance take const std::string&, as that's what
+ is usually passed to it.
+ * server/asobj/Mouse.cpp, server/asobj/System.cpp,
+ server/asobj/Stage.cpp, server/asobj/Sound.cpp,
+ server/asobj/Object.cpp, server/asobj/Global.cpp: get VM from
+ object.
+
2008-05-29 Sandro Santilli <address@hidden>
* libbase/curl_adapter.cpp: avoid the _perform on cookies
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -b -r1.130 -r1.131
--- server/asobj/Global.cpp 25 May 2008 10:05:22 -0000 1.130
+++ server/asobj/Global.cpp 29 May 2008 12:44:29 -0000 1.131
@@ -586,6 +586,8 @@
as_value
as_global_asnative(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> ptr = ensureType<as_object>(fn.this_ptr);
+
as_value ret;
if (fn.nargs < 2)
@@ -617,7 +619,7 @@
const unsigned int x = static_cast<unsigned int>(sx);
const unsigned int y = static_cast<unsigned int>(sy);
- VM& vm = VM::get();
+ VM& vm = ptr->getVM();
as_function* fun = vm.getNative(x, y);
if ( ! fun ) {
log_debug(_("No ASnative(%d, %d) registered with the VM"), x, y);
Index: server/asobj/Mouse.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Mouse.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/asobj/Mouse.cpp 21 May 2008 13:24:06 -0000 1.22
+++ server/asobj/Mouse.cpp 29 May 2008 12:44:29 -0000 1.23
@@ -62,11 +62,10 @@
mouse_hide(const fn_call& fn)
{
boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
- UNUSED(obj);
int success = 0;
- movie_root& m = VM::get().getRoot();
+ movie_root& m = obj->getVM().getRoot();
if (m.interfaceHandle)
{
@@ -86,11 +85,10 @@
mouse_show(const fn_call& fn)
{
boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
- UNUSED(obj);
int success = 0;
- movie_root& m = VM::get().getRoot();
+ movie_root& m = obj->getVM().getRoot();
if (m.interfaceHandle)
{
Index: server/asobj/Object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Object.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- server/asobj/Object.cpp 25 May 2008 10:05:22 -0000 1.53
+++ server/asobj/Object.cpp 29 May 2008 12:44:29 -0000 1.54
@@ -168,7 +168,7 @@
// This is going to be the global Object "class"/"function"
static boost::intrusive_ptr<builtin_function> cl=NULL;
- VM& vm = VM::get();
+ VM& vm = global.getVM();
if ( cl == NULL )
{
@@ -263,7 +263,6 @@
object_registerClass(const fn_call& fn)
{
assert(fn.this_ptr);
- //as_object* obj = fn.this_ptr;
if ( fn.nargs != 2 )
{
@@ -311,6 +310,7 @@
// TODO: check to *which* definition should we ask the export
// this code uses the *relative* root of current environment's
target
+ // and don't use VM::get() if this code is ever reactivated.
#if 0
movie_definition* def = VM::get().getRoot().get_movie_definition();
#else
@@ -325,7 +325,7 @@
assert(relRoot);
movie_definition* def = relRoot->get_movie_definition();
#endif
- boost::intrusive_ptr<resource> exp_res =
def->get_exported_resource(symbolid.c_str());
+ boost::intrusive_ptr<resource> exp_res =
def->get_exported_resource(symbolid);
if ( ! exp_res )
{
IF_VERBOSE_ASCODING_ERRORS(
@@ -364,6 +364,8 @@
as_value
object_hasOwnProperty(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+
//assert(fn.result->is_undefined());
if ( fn.nargs < 1 )
{
@@ -382,12 +384,14 @@
return as_value(false);
}
//log_debug("%p.hasOwnProperty", fn.this_ptr);
- return
as_value(fn.this_ptr->hasOwnProperty(VM::get().getStringTable().find(propname)));
+ return
as_value(fn.this_ptr->hasOwnProperty(obj->getVM().getStringTable().find(propname)));
}
as_value
object_isPropertyEnumerable(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+
//assert(fn.result->is_undefined());
if ( fn.nargs < 1 )
{
@@ -406,7 +410,7 @@
return as_value();
}
- Property* prop =
fn.this_ptr->getOwnProperty(VM::get().getStringTable().find(propname));
+ Property* prop =
fn.this_ptr->getOwnProperty(obj->getVM().getStringTable().find(propname));
if ( ! prop )
{
return as_value(false);
Index: server/asobj/Sound.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Sound.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/asobj/Sound.cpp 21 Apr 2008 11:27:44 -0000 1.31
+++ server/asobj/Sound.cpp 29 May 2008 12:44:29 -0000 1.32
@@ -295,7 +295,7 @@
const std::string& name = fn.arg(0).to_string();
// check the import.
- movie_definition* def =
VM::get().getRoot().get_movie_definition();
+ movie_definition* def =
so->getVM().getRoot().get_movie_definition();
assert(def);
boost::intrusive_ptr<resource> res =
def->get_exported_resource(name);
if (res == NULL)
@@ -349,7 +349,7 @@
}
// check the import.
- movie_definition* def = VM::get().getRoot().get_movie_definition();
+ movie_definition* def = so->getVM().getRoot().get_movie_definition();
assert(def);
boost::intrusive_ptr<resource> res = def->get_exported_resource(name);
if (res == NULL)
Index: server/asobj/Stage.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Stage.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/asobj/Stage.cpp 6 May 2008 08:59:42 -0000 1.47
+++ server/asobj/Stage.cpp 29 May 2008 12:44:29 -0000 1.48
@@ -139,7 +139,10 @@
as_value
stage_scalemode_getset(const fn_call& fn)
{
- const movie_root& m = VM::get().getRoot();
+
+ boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
+
+ movie_root& m = obj->getVM().getRoot();
if ( fn.nargs == 0 ) // getter
{
@@ -158,8 +161,6 @@
else if ( noCaseCompare(str, "exactFit") ) mode =
movie_root::exactFit;
else if ( noCaseCompare(str, "noBorder") ) mode =
movie_root::noBorder;
- movie_root& m = VM::get().getRoot();
-
if ( m.getStageScaleMode() == mode ) return as_value(); // nothing to
do
m.setStageScaleMode(mode);
@@ -170,6 +171,7 @@
as_value
stage_width_getset(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
if ( fn.nargs > 0 ) // setter
{
@@ -180,13 +182,14 @@
}
// getter
- movie_root& m = VM::get().getRoot();
+ movie_root& m = obj->getVM().getRoot();
return as_value(m.getStageWidth());
}
as_value
stage_height_getset(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
if ( fn.nargs > 0 ) // setter
{
@@ -197,7 +200,7 @@
}
// getter
- movie_root& m = VM::get().getRoot();
+ movie_root& m = obj->getVM().getRoot();
return as_value(m.getStageHeight());
}
@@ -205,7 +208,9 @@
as_value
stage_align_getset(const fn_call& fn)
{
- movie_root& m = VM::get().getRoot();
+ boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
+
+ movie_root& m = obj->getVM().getRoot();
if ( fn.nargs == 0 ) // getter
{
@@ -264,8 +269,9 @@
as_value
stage_displaystate_getset(const fn_call& fn)
{
+ boost::intrusive_ptr<as_object> obj=ensureType<as_object>(fn.this_ptr);
- movie_root& m = VM::get().getRoot();
+ movie_root& m = obj->getVM().getRoot();
if ( fn.nargs == 0 ) // getter
{
Index: server/asobj/gstring.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/gstring.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/asobj/gstring.h 26 Mar 2008 21:34:23 -0000 1.9
+++ server/asobj/gstring.h 29 May 2008 12:44:29 -0000 1.10
@@ -38,7 +38,7 @@
/// In the second case, not finding a proper constructor might result in
/// returning the NULL object.
///
-boost::intrusive_ptr<as_object> init_string_instance(const char* val);
+boost::intrusive_ptr<as_object> init_string_instance(const std::string& val);
}
Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- server/asobj/string.cpp 25 May 2008 10:05:23 -0000 1.70
+++ server/asobj/string.cpp 29 May 2008 12:44:29 -0000 1.71
@@ -510,8 +510,9 @@
static as_value
string_from_char_code(const fn_call& fn)
{
+ boost::intrusive_ptr<string_as_object> obj =
ensureType<string_as_object>(fn.this_ptr);
- int version = VM::get().getSWFVersion();
+ const int version = obj->getVM().getSWFVersion();
if (version == 5)
{
@@ -553,7 +554,7 @@
{
boost::intrusive_ptr<string_as_object> obj =
ensureType<string_as_object>(fn.this_ptr);
- int version = VM::get().getSWFVersion();
+ int version = obj->getVM().getSWFVersion();
const std::wstring& wstr = utf8::decodeCanonicalString(obj->str(),
version);
@@ -588,7 +589,7 @@
{
boost::intrusive_ptr<string_as_object> obj =
ensureType<string_as_object>(fn.this_ptr);
- int version = VM::get().getSWFVersion();
+ const int version = obj->getVM().getSWFVersion();
const std::wstring& wstr = utf8::decodeCanonicalString(obj->str(),
version);
@@ -613,7 +614,7 @@
boost::intrusive_ptr<string_as_object> obj =
ensureType<string_as_object>(fn.this_ptr);
std::string subject = obj->str();
- VM& vm = VM::get();
+ VM& vm = obj->getVM();
boost::to_upper(subject, vm.getLocale());
@@ -626,7 +627,7 @@
boost::intrusive_ptr<string_as_object> obj =
ensureType<string_as_object>(fn.this_ptr);
std::string subject = obj->str();
- VM& vm = VM::get();
+ VM& vm = obj->getVM();
boost::to_lower(subject, vm.getLocale());
@@ -697,7 +698,7 @@
}
boost::intrusive_ptr<as_object>
-init_string_instance(const char* val)
+init_string_instance(const std::string& val)
{
// TODO: get the environment passed in !!
as_environment env;
Index: server/asobj/xmlsocket.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xmlsocket.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/asobj/xmlsocket.cpp 25 May 2008 10:05:23 -0000 1.48
+++ server/asobj/xmlsocket.cpp 29 May 2008 12:44:29 -0000 1.49
@@ -445,7 +445,7 @@
bool success = ptr->obj.connect(host.c_str(), port);
- VM& vm = VM::get();
+ VM& vm = ptr->getVM();
string_table& st = vm.getStringTable();
// Actually, if first-stage connection was successful, we