[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10480: Class renaming, minor fixes,
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10480: Class renaming, minor fixes, C++ification and build fix for some testing |
Date: |
Fri, 26 Dec 2008 02:32:38 -0700 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10480
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2008-12-26 02:32:38 -0700
message:
Class renaming, minor fixes, C++ification and build fix for some testing
configurations.
renamed:
libcore/asobj/Boolean.cpp => libcore/asobj/Boolean_as.cpp
libcore/asobj/Boolean.h => libcore/asobj/Boolean_as.h
libcore/asobj/LocalConnection.cpp => libcore/asobj/LocalConnection_as.cpp
libcore/asobj/LocalConnection.h => libcore/asobj/LocalConnection_as.h
libcore/asobj/Sound.cpp => libcore/asobj/Sound_as.cpp
libcore/asobj/Sound.h => libcore/asobj/Sound_as.h
modified:
libcore/as_value.cpp
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
testsuite/libnet.all/test_cache.cpp
testsuite/libnet.all/test_diskstream.cpp
testsuite/libnet.all/test_http.cpp
libcore/asobj/Boolean_as.cpp
libcore/asobj/Boolean_as.h
libcore/asobj/LocalConnection_as.cpp
libcore/asobj/LocalConnection_as.h
libcore/asobj/Sound_as.cpp
libcore/asobj/Sound_as.h
------------------------------------------------------------
revno: 10479.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-12-25 15:05:32 +0100
message:
Rename and tidy up Boolean.
renamed:
libcore/asobj/Boolean.cpp => libcore/asobj/Boolean_as.cpp
libcore/asobj/Boolean.h => libcore/asobj/Boolean_as.h
modified:
libcore/as_value.cpp
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/Boolean_as.cpp
libcore/asobj/Boolean_as.h
------------------------------------------------------------
revno: 10479.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-12-25 19:27:37 +0100
message:
Rename LocalConnection.
renamed:
libcore/asobj/LocalConnection.cpp => libcore/asobj/LocalConnection_as.cpp
libcore/asobj/LocalConnection.h => libcore/asobj/LocalConnection_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/LocalConnection_as.cpp
libcore/asobj/LocalConnection_as.h
------------------------------------------------------------
revno: 10479.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-12-25 20:02:32 +0100
message:
Rename Sound to Sound_as and clean up its header.
renamed:
libcore/asobj/Sound.cpp => libcore/asobj/Sound_as.cpp
libcore/asobj/Sound.h => libcore/asobj/Sound_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Global.cpp
libcore/asobj/Makefile.am
libcore/asobj/Sound_as.cpp
libcore/asobj/Sound_as.h
------------------------------------------------------------
revno: 10479.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Fri 2008-12-26 09:08:51 +0100
message:
Fix build when dejagnu.h isn't available.
modified:
testsuite/libnet.all/test_cache.cpp
testsuite/libnet.all/test_diskstream.cpp
testsuite/libnet.all/test_http.cpp
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp 2008-12-14 12:48:17 +0000
+++ b/libcore/as_value.cpp 2008-12-25 14:05:32 +0000
@@ -26,9 +26,9 @@
#include "as_environment.h" // for MOVIECLIP values
#include "VM.h" // for MOVIECLIP values
#include "movie_root.h" // for MOVIECLIP values
-#include "String_as.h" // for automatic as_value::STRING => String as object
-#include "Number_as.h" // for automatic as_value::NUMBER => Number as object
-#include "Boolean.h" // for automatic as_value::BOOLEAN => Boolean as object
+#include "String_as.h" // for automatic as_value::STRING => String
+#include "Number_as.h" // for automatic as_value::NUMBER => Number
+#include "Boolean_as.h" // for automatic as_value::BOOLEAN => Boolean
#include "action.h" // for call_method0
#include "utility.h" // for typeName() and utility::isFinite
#include "namedStrings.h"
=== renamed file 'libcore/asobj/Boolean.cpp' => 'libcore/asobj/Boolean_as.cpp'
--- a/libcore/asobj/Boolean.cpp 2008-09-01 18:11:06 +0000
+++ b/libcore/asobj/Boolean_as.cpp 2008-12-25 14:05:32 +0000
@@ -20,7 +20,7 @@
#include "gnashconfig.h"
#endif
-#include "Boolean.h"
+#include "Boolean_as.h"
#include "as_object.h" // for inheritance
#include "log.h"
#include "fn_call.h"
@@ -32,124 +32,40 @@
namespace gnash {
-as_value boolean_tostring(const fn_call& fn);
-as_value boolean_valueof(const fn_call& fn);
-as_value boolean_ctor(const fn_call& fn);
-
-static void
-attachBooleanInterface(as_object& o)
-{
- o.init_member("toString", new builtin_function(boolean_tostring));
- o.init_member("valueOf", new builtin_function(boolean_valueof));
-}
-
-static as_object*
-getBooleanInterface()
-{
- static boost::intrusive_ptr<as_object> o;
- if ( ! o )
- {
- o = new as_object(getObjectInterface());
- VM::get().addStatic(o.get());
-
- attachBooleanInterface(*o);
- }
- return o.get();
-}
-
-class boolean_as_object: public as_object
+namespace {
+ as_value boolean_tostring(const fn_call& fn);
+ as_value boolean_valueof(const fn_call& fn);
+ as_value boolean_ctor(const fn_call& fn);
+ void attachBooleanInterface(as_object& o);
+ boost::intrusive_ptr<builtin_function> getBooleanConstructor();
+ as_object* getBooleanInterface();
+}
+
+class Boolean_as: public as_object
{
public:
- boolean_as_object()
+ Boolean_as()
:
as_object(getBooleanInterface())
{}
- boolean_as_object(bool _val)
+ Boolean_as(bool val)
:
as_object(getBooleanInterface())
{
- val = _val;
+ _val = val;
}
- // override from as_object ?
- //std::string get_text_value() const { return "Boolean"; }
-
- // override from as_object ?
- //double get_numeric_value() const { return 0; }
-
- bool val;
+ bool value() const { return _val; }
+
+private:
+
+ bool _val;
};
-
-as_value boolean_tostring(const fn_call& fn)
-{
- boost::intrusive_ptr<boolean_as_object> boolobj =
ensureType<boolean_as_object>(fn.this_ptr);
-
-
- if (boolobj->val)
- return as_value("true");
- else
- return as_value("false");
-}
-
-
-as_value boolean_valueof(const fn_call& fn)
-{
- boost::intrusive_ptr<boolean_as_object> boolobj =
ensureType<boolean_as_object>(fn.this_ptr);
-
- return as_value(boolobj->val);
-}
-
-as_value
-boolean_ctor(const fn_call& fn)
-{
- if (fn.nargs > 0)
- {
- bool val = fn.arg(0).to_bool();
- if ( ! fn.isInstantiation() )
- {
- return as_value(val);
- }
- else
- {
- return as_value(new boolean_as_object(val));
- }
- }
-
- if ( ! fn.isInstantiation() )
- {
- return as_value();
- }
- else
- {
- return as_value(new boolean_as_object(false));
- }
-
-}
-
-static boost::intrusive_ptr<builtin_function>
-getBooleanConstructor()
-{
- // This is going to be the global Boolean "class"/"function"
- static boost::intrusive_ptr<builtin_function> cl;
-
- if ( cl == NULL )
- {
- cl=new builtin_function(&boolean_ctor, getBooleanInterface());
- VM::get().addStatic(cl.get());
-
- // replicate all interface to class, to be able to access
- // all methods as static functions
- //attachBooleanInterface(*cl);
- }
-
- return cl;
-}
-
// extern (used by Global.cpp)
void boolean_class_init(as_object& global)
{
@@ -172,5 +88,86 @@
return cl->constructInstance(env, args);
}
-} // end of gnash namespace
+
+namespace {
+
+boost::intrusive_ptr<builtin_function>
+getBooleanConstructor()
+{
+ // This is going to be the global Boolean "class"/"function"
+ static boost::intrusive_ptr<builtin_function> cl;
+
+ if ( cl == NULL )
+ {
+ cl=new builtin_function(&boolean_ctor, getBooleanInterface());
+ VM::get().addStatic(cl.get());
+
+ // replicate all interface to class, to be able to access
+ // all methods as static functions
+ //attachBooleanInterface(*cl);
+ }
+
+ return cl;
+}
+
+void
+attachBooleanInterface(as_object& o)
+{
+ o.init_member("toString", new builtin_function(boolean_tostring));
+ o.init_member("valueOf", new builtin_function(boolean_valueof));
+}
+
+as_object*
+getBooleanInterface()
+{
+ static boost::intrusive_ptr<as_object> o;
+ if ( ! o )
+ {
+ o = new as_object(getObjectInterface());
+ VM::get().addStatic(o.get());
+
+ attachBooleanInterface(*o);
+ }
+ return o.get();
+}
+
+
+as_value
+boolean_tostring(const fn_call& fn)
+{
+ boost::intrusive_ptr<Boolean_as> obj =
ensureType<Boolean_as>(fn.this_ptr);
+
+ if (obj->value()) return as_value("true");
+
+ return as_value("false");
+}
+
+
+as_value
+boolean_valueof(const fn_call& fn)
+{
+ boost::intrusive_ptr<Boolean_as> obj =
ensureType<Boolean_as>(fn.this_ptr);
+
+ return as_value(obj->value());
+}
+
+as_value
+boolean_ctor(const fn_call& fn)
+{
+ if (fn.nargs > 0)
+ {
+ bool val = fn.arg(0).to_bool();
+ if ( ! fn.isInstantiation() ) return as_value(val);
+
+ return as_value(new Boolean_as(val));
+ }
+
+ if (!fn.isInstantiation()) return as_value();
+
+ return as_value(new Boolean_as(false));
+
+}
+
+} // anonymous namespace
+} // gnash namespace
=== renamed file 'libcore/asobj/Boolean.h' => 'libcore/asobj/Boolean_as.h'
--- a/libcore/asobj/Boolean.h 2008-03-26 21:34:20 +0000
+++ b/libcore/asobj/Boolean_as.h 2008-12-25 14:05:32 +0000
@@ -16,13 +16,11 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-#ifndef __GNASH_ASOBJ_BOOLEAN_H__
-#define __GNASH_ASOBJ_BOOLEAN_H__
+#ifndef GNASH_ASOBJ_BOOLEAN_H
+#define GNASH_ASOBJ_BOOLEAN_H
#include "smart_ptr.h"
-#include <memory> // for auto_ptr
-
namespace gnash {
class as_object;
@@ -35,6 +33,5 @@
} // end of gnash namespace
-// __GNASH_ASOBJ_BOOLEAN_H__
#endif
=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp 2008-12-22 14:57:10 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp 2008-12-25 19:02:32 +0000
@@ -24,7 +24,7 @@
#include "array.h"
#include "AsBroadcaster.h"
#include "Accessibility_as.h"
-#include "Boolean.h"
+#include "Boolean_as.h"
#include "Camera.h"
#include "Color_as.h"
#include "ContextMenu.h"
@@ -35,7 +35,7 @@
#include "String_as.h"
#include "Key_as.h"
#include "LoadVars_as.h"
-#include "LocalConnection.h"
+#include "LocalConnection_as.h"
#include "Microphone.h"
#include "Number_as.h"
#include "Object.h"
@@ -47,7 +47,7 @@
#include "NetStream_as.h"
#include "Selection_as.h"
#include "SharedObject_as.h"
-#include "Sound.h"
+#include "Sound_as.h"
#include "Stage_as.h"
#include "System_as.h"
#include "TextSnapshot_as.h"
@@ -296,7 +296,7 @@
{ Button::init, NSV::CLASS_BUTTON, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
{ color_class_init, NSV::CLASS_COLOR, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
{ selection_class_init, NSV::CLASS_SELECTION, NSV::CLASS_OBJECT,
NS_UNKNOWN, 5 },
- { sound_class_init, NSV::CLASS_SOUND, NSV::CLASS_OBJECT,
NSV::NS_FLASH_MEDIA, 5 },
+ { Sound_as::init, NSV::CLASS_SOUND, NSV::CLASS_OBJECT,
NSV::NS_FLASH_MEDIA, 5 },
{ xmlsocket_class_init, NSV::CLASS_X_M_L_SOCKET, NSV::CLASS_OBJECT,
NSV::NS_FLASH_NET, 5 },
{ date_class_init, NSV::CLASS_DATE, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
{ XML_as::init, NSV::CLASS_X_M_L, 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 },
+ { LocalConnection_as::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-22 14:57:10 +0000
+++ b/libcore/asobj/Global.cpp 2008-12-25 19:02:32 +0000
@@ -28,7 +28,7 @@
#include "as_function.h" // for function_class_init
#include "array.h"
#include "AsBroadcaster.h"
-#include "Boolean.h"
+#include "Boolean_as.h"
#include "Camera.h"
#include "Color_as.h"
#include "ContextMenu.h"
@@ -39,8 +39,6 @@
#include "String_as.h"
#include "Key_as.h"
#include "Selection_as.h"
-//#include "LoadVars_as.h"
-//#include "LocalConnection.h"
#include "Microphone.h"
#include "Number_as.h"
#include "Object.h"
@@ -53,7 +51,6 @@
#include "NetConnection_as.h"
#include "NetStream_as.h"
#include "SharedObject_as.h"
-#include "Sound.h"
#include "Stage_as.h"
#include "System_as.h"
#include "TextFormat_as.h"
=== renamed file 'libcore/asobj/LocalConnection.cpp' =>
'libcore/asobj/LocalConnection_as.cpp'
--- a/libcore/asobj/LocalConnection.cpp 2008-12-18 12:36:38 +0000
+++ b/libcore/asobj/LocalConnection_as.cpp 2008-12-25 18:27:37 +0000
@@ -31,7 +31,7 @@
#include "URLAccessManager.h"
#include "URL.h"
#include "log.h"
-#include "LocalConnection.h"
+#include "LocalConnection_as.h"
#include "network.h"
#include "fn_call.h"
#include "builtin_function.h"
@@ -90,11 +90,11 @@
as_object* getLocalConnectionInterface();
}
-// \class LocalConnection
+// \class LocalConnection_as
/// \brief Open a connection between two SWF movies so they can send
/// each other Flash Objects to be executed.
///
-LocalConnection::LocalConnection()
+LocalConnection_as::LocalConnection_as()
:
as_object(getLocalConnectionInterface()),
_connected(false),
@@ -103,13 +103,13 @@
log_debug("The domain for this host is: %s", _domain);
}
-LocalConnection::~LocalConnection()
+LocalConnection_as::~LocalConnection_as()
{
}
/// \brief Closes (disconnects) the LocalConnection object.
void
-LocalConnection::close()
+LocalConnection_as::close()
{
_connected = false;
#ifndef NETWORK_CONN
@@ -124,7 +124,7 @@
/// send() command to signify which local connection to send the
/// object to.
void
-LocalConnection::connect(const std::string& name)
+LocalConnection_as::connect(const std::string& name)
{
assert(!name.empty());
@@ -158,7 +158,7 @@
/// "www". As of v7, the behaviour is to return the full host
/// name. Gnash supports both behaviours based on the version.
std::string
-LocalConnection::getDomain()
+LocalConnection_as::getDomain()
{
URL url(_vm.getRoot().getOriginalURL());
@@ -199,7 +199,7 @@
}
void
-localconnection_class_init(as_object& glob)
+LocalConnection_as::init(as_object& glob)
{
builtin_function* ctor=getLocalConnectionConstructor();
@@ -218,7 +218,7 @@
as_value
localconnection_new(const fn_call& /* fn */)
{
- LocalConnection *obj = new LocalConnection;
+ LocalConnection_as *obj = new LocalConnection_as;
return as_value(obj);
}
@@ -228,8 +228,8 @@
localconnection_close(const fn_call& fn)
{
- boost::intrusive_ptr<LocalConnection> ptr =
- ensureType<LocalConnection>(fn.this_ptr);
+ boost::intrusive_ptr<LocalConnection_as> ptr =
+ ensureType<LocalConnection_as>(fn.this_ptr);
ptr->close();
return as_value();
@@ -239,8 +239,8 @@
as_value
localconnection_connect(const fn_call& fn)
{
- boost::intrusive_ptr<LocalConnection> ptr =
- ensureType<LocalConnection>(fn.this_ptr);
+ boost::intrusive_ptr<LocalConnection_as> ptr =
+ ensureType<LocalConnection_as>(fn.this_ptr);
// If already connected, don't try again until close() is called.
if (ptr->connected()) return false;
@@ -277,8 +277,8 @@
as_value
localconnection_domain(const fn_call& fn)
{
- boost::intrusive_ptr<LocalConnection> ptr =
- ensureType<LocalConnection>(fn.this_ptr);
+ boost::intrusive_ptr<LocalConnection_as> ptr =
+ ensureType<LocalConnection_as>(fn.this_ptr);
return as_value(ptr->domain());
}
@@ -289,8 +289,8 @@
as_value
localconnection_send(const fn_call& fn)
{
- boost::intrusive_ptr<LocalConnection> ptr =
- ensureType<LocalConnection>(fn.this_ptr);
+ boost::intrusive_ptr<LocalConnection_as> ptr =
+ ensureType<LocalConnection_as>(fn.this_ptr);
// At least 2 args (connection name, function) required.
if (fn.nargs < 2) {
=== renamed file 'libcore/asobj/LocalConnection.h' =>
'libcore/asobj/LocalConnection_as.h'
--- a/libcore/asobj/LocalConnection.h 2008-12-18 12:36:38 +0000
+++ b/libcore/asobj/LocalConnection_as.h 2008-12-25 18:27:37 +0000
@@ -28,13 +28,13 @@
namespace gnash {
-class LocalConnection : public as_object, amf::LcShm
+class LocalConnection_as : public as_object, amf::LcShm
{
public:
- LocalConnection();
- ~LocalConnection();
+ LocalConnection_as();
+ ~LocalConnection_as();
void close();
@@ -50,6 +50,8 @@
bool connected() { return _connected; };
+ static void init(as_object& glob);
+
private:
/// Work out the domain.
@@ -61,14 +63,12 @@
bool _connected;
std::string _name;
- // The immutable domain of this LocalConnection, based on the
+ // The immutable domain of this LocalConnection_as, based on the
// originating SWF's domain.
const std::string _domain;
};
-void localconnection_class_init(as_object& glob);
-
} // end of gnash namespace
#endif
=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am 2008-12-22 14:57:10 +0000
+++ b/libcore/asobj/Makefile.am 2008-12-25 19:02:32 +0000
@@ -44,7 +44,7 @@
libgnashasobjs_la_SOURCES = \
AsBroadcaster.cpp \
Accessibility_as.cpp \
- Boolean.cpp \
+ Boolean_as.cpp \
Camera.cpp \
ClassHierarchy.cpp \
Color_as.cpp \
@@ -55,7 +55,7 @@
Global.cpp \
Key_as.cpp \
LoadVars_as.cpp \
- LocalConnection.cpp\
+ LocalConnection_as.cpp\
Math_as.cpp \
Microphone.cpp \
Mouse_as.cpp \
@@ -66,7 +66,7 @@
PlayHead.cpp \
Selection_as.cpp \
SharedObject_as.cpp\
- Sound.cpp \
+ Sound_as.cpp \
Stage_as.cpp \
System_as.cpp \
TextFormat_as.cpp \
@@ -109,7 +109,7 @@
noinst_HEADERS = \
AsBroadcaster.h \
Accessibility_as.h \
- Boolean.h \
+ Boolean_as.h \
Camera.h \
ClassHierarchy.h \
Color_as.h \
@@ -121,7 +121,7 @@
Global.h\
Key_as.h \
LoadVars_as.h \
- LocalConnection.h\
+ LocalConnection_as.h\
Microphone.h \
Mouse_as.h \
MovieClipLoader.h \
@@ -133,7 +133,7 @@
prophelper.h \
Selection_as.h \
SharedObject_as.h \
- Sound.h \
+ Sound_as.h \
Stage_as.h \
System_as.h \
TextFormat_as.h \
=== renamed file 'libcore/asobj/Sound.cpp' => 'libcore/asobj/Sound_as.cpp'
--- a/libcore/asobj/Sound.cpp 2008-12-11 17:21:57 +0000
+++ b/libcore/asobj/Sound_as.cpp 2008-12-25 19:02:32 +0000
@@ -1,4 +1,4 @@
-// Sound.cpp: ActionScript Sound output stub class, for Gnash.
+// Sound_as.cpp: ActionScript Sound output stub class, for Gnash.
//
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
//
@@ -21,9 +21,11 @@
#include "gnashconfig.h"
#endif
-#include "Sound.h"
+#include "Sound_as.h"
#include "log.h"
#include "sound_handler.h"
+#include "AudioDecoder.h"
+#include "MediaParser.h"
#include "MediaHandler.h"
#include "sound_definition.h" // for sound_sample
#include "movie_definition.h"
@@ -37,8 +39,6 @@
#include "ExportableResource.h"
#include "StreamProvider.h"
-
-#include "Sound.h"
#include <string>
// Define the macro below to get some more DEBUG
@@ -66,7 +66,7 @@
static as_value checkPolicyFile_getset(const fn_call& fn);
static as_object* getSoundInterface();
-Sound::Sound()
+Sound_as::Sound_as()
:
as_object(getSoundInterface()),
_attachedCharacter(0),
@@ -86,7 +86,7 @@
{
}
-Sound::~Sound()
+Sound_as::~Sound_as()
{
//GNASH_REPORT_FUNCTION;
@@ -99,46 +99,46 @@
}
void
-Sound::attachCharacter(character* attachTo)
+Sound_as::attachCharacter(character* attachTo)
{
_attachedCharacter.reset(new CharacterProxy(attachTo));
}
void
-Sound::attachSound(int si, const std::string& name)
+Sound_as::attachSound(int si, const std::string& name)
{
soundId = si;
soundName = name;
}
long
-Sound::getBytesLoaded()
+Sound_as::getBytesLoaded()
{
if ( _mediaParser ) return _mediaParser->getBytesLoaded();
return -1;
}
long
-Sound::getBytesTotal()
+Sound_as::getBytesTotal()
{
if ( _mediaParser ) return _mediaParser->getBytesTotal();
return -1;
}
void
-Sound::getPan()
+Sound_as::getPan()
{
LOG_ONCE(log_unimpl(__FUNCTION__));
}
void
-Sound::getTransform()
+Sound_as::getTransform()
{
LOG_ONCE(log_unimpl(__FUNCTION__));
}
bool
-Sound::getVolume(int& volume)
+Sound_as::getVolume(int& volume)
{
// TODO: check what takes precedence in case we
// have both an attached character *and*
@@ -185,7 +185,7 @@
}
void
-Sound::loadSound(const std::string& file, bool streaming)
+Sound_as::loadSound(const std::string& file, bool streaming)
{
if ( ! _mediaHandler || ! _soundHandler )
{
@@ -245,7 +245,7 @@
}
sound::InputStream*
-Sound::attachAuxStreamerIfNeeded()
+Sound_as::attachAuxStreamerIfNeeded()
{
media::AudioInfo* audioInfo = _mediaParser->getAudioInfo();
if (!audioInfo) return 0;
@@ -261,19 +261,19 @@
}
void
-Sound::setPan()
-{
- LOG_ONCE(log_unimpl(__FUNCTION__));
-}
-
-void
-Sound::setTransform()
-{
- LOG_ONCE(log_unimpl(__FUNCTION__));
-}
-
-void
-Sound::setVolume(int volume)
+Sound_as::setPan()
+{
+ LOG_ONCE(log_unimpl(__FUNCTION__));
+}
+
+void
+Sound_as::setTransform()
+{
+ LOG_ONCE(log_unimpl(__FUNCTION__));
+}
+
+void
+Sound_as::setVolume(int volume)
{
// TODO: check what takes precedence in case we
// have both an attached character *and*
@@ -315,7 +315,7 @@
}
void
-Sound::start(int offset, int loops)
+Sound_as::start(int offset, int loops)
{
if ( ! _soundHandler )
{
@@ -375,7 +375,7 @@
}
void
-Sound::stop(int si)
+Sound_as::stop(int si)
{
if ( ! _soundHandler )
{
@@ -406,7 +406,7 @@
}
unsigned int
-Sound::getDuration()
+Sound_as::getDuration()
{
if ( ! _soundHandler )
{
@@ -435,7 +435,7 @@
}
unsigned int
-Sound::getPosition()
+Sound_as::getPosition()
{
if ( ! _soundHandler )
{
@@ -464,7 +464,7 @@
unsigned int
-Sound::getAudio(boost::int16_t* samples, unsigned int nSamples, bool& atEOF)
+Sound_as::getAudio(boost::int16_t* samples, unsigned int nSamples, bool& atEOF)
{
boost::uint8_t* stream = reinterpret_cast<boost::uint8_t*>(samples);
int len = nSamples*2;
@@ -550,10 +550,10 @@
// audio callback is running in sound handler thread
unsigned int
-Sound::getAudioWrapper(void* owner, boost::int16_t* samples,
+Sound_as::getAudioWrapper(void* owner, boost::int16_t* samples,
unsigned int nSamples, bool& atEOF)
{
- Sound* so = static_cast<Sound*>(owner);
+ Sound_as* so = static_cast<Sound_as*>(owner);
return so->getAudio(samples, nSamples, atEOF);
}
@@ -567,7 +567,7 @@
as_value
sound_new(const fn_call& fn)
{
- Sound* sound_obj = new Sound();
+ Sound_as* sound_obj = new Sound_as();
if ( fn.nargs )
{
@@ -607,7 +607,7 @@
IF_VERBOSE_ACTION (
log_action(_("-- start sound"));
)
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
int loop = 0;
int secondOffset = 0;
@@ -632,7 +632,7 @@
IF_VERBOSE_ACTION (
log_action(_("-- stop sound "));
)
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
int si = -1;
@@ -685,7 +685,7 @@
return as_value();
}
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
const std::string& name = fn.arg(0).to_string();
if (name.empty()) {
@@ -741,7 +741,7 @@
as_value
sound_getbytesloaded(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
long loaded = so->getBytesLoaded();
if (loaded < 0) return as_value();
return as_value(loaded);
@@ -750,7 +750,7 @@
as_value
sound_getbytestotal(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
long total = so->getBytesTotal();
if (total < 0) return as_value();
return as_value(total);
@@ -802,7 +802,7 @@
sound_getvolume(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
if ( fn.nargs )
{
@@ -820,7 +820,7 @@
as_value
sound_loadsound(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
if (!fn.nargs)
{
@@ -877,7 +877,7 @@
return as_value();
}
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
int volume = (int) fn.arg(0).to_number();
so->setVolume(volume);
@@ -887,7 +887,7 @@
as_value
sound_duration(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
return as_value(so->getDuration());
}
@@ -914,7 +914,7 @@
as_value
sound_position(const fn_call& fn)
{
- boost::intrusive_ptr<Sound> so = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> so = ensureType<Sound_as>(fn.this_ptr);
return as_value(so->getPosition());
}
@@ -994,7 +994,8 @@
}
// extern (used by Global.cpp)
-void sound_class_init(as_object& global)
+void
+Sound_as::init(as_object& global)
{
// This is going to be the global Sound "class"/"function"
@@ -1014,10 +1015,10 @@
/*private*/
void
-Sound::startProbeTimer()
+Sound_as::startProbeTimer()
{
boost::intrusive_ptr<builtin_function> cb =
- new builtin_function(&Sound::probeAudioWrapper);
+ new builtin_function(&Sound_as::probeAudioWrapper);
std::auto_ptr<Timer> timer(new Timer);
// 2 times each second (83 would be 12 times each second)
@@ -1028,18 +1029,18 @@
/*private static*/
as_value
-Sound::probeAudioWrapper(const fn_call& fn)
+Sound_as::probeAudioWrapper(const fn_call& fn)
{
//GNASH_REPORT_FUNCTION;
- boost::intrusive_ptr<Sound> ptr = ensureType<Sound>(fn.this_ptr);
+ boost::intrusive_ptr<Sound_as> ptr = ensureType<Sound_as>(fn.this_ptr);
ptr->probeAudio();
return as_value();
}
/*private*/
void
-Sound::stopProbeTimer()
+Sound_as::stopProbeTimer()
{
#ifdef GNASH_DEBUG_SOUND_AS
log_debug("stopProbeTimer called");
@@ -1056,7 +1057,7 @@
/*private*/
void
-Sound::probeAudio()
+Sound_as::probeAudio()
{
if ( isAttached() )
{
@@ -1119,7 +1120,7 @@
#ifdef GNASH_USE_GC
void
-Sound::markReachableResources() const
+Sound_as::markReachableResources() const
{
if ( _attachedCharacter ) _attachedCharacter->setReachable();
markAsObjectReachable();
@@ -1127,7 +1128,7 @@
#endif // GNASH_USE_GC
void
-Sound::markSoundCompleted(bool completed)
+Sound_as::markSoundCompleted(bool completed)
{
boost::mutex::scoped_lock lock(_soundCompletedMutex);
_soundCompleted=completed;
=== renamed file 'libcore/asobj/Sound.h' => 'libcore/asobj/Sound_as.h'
--- a/libcore/asobj/Sound.h 2008-12-05 07:35:49 +0000
+++ b/libcore/asobj/Sound_as.h 2008-12-25 19:02:32 +0000
@@ -23,18 +23,12 @@
#include "gnashconfig.h"
#endif
-#ifndef __STDC_CONSTANT_MACROS
-#define __STDC_CONSTANT_MACROS
-#endif
-
#include "smart_ptr.h" // GNASH_USE_GC
#include "impl.h"
#include "as_object.h" // for inheritance
-#include "MediaParser.h" // is this really needed for scoped_ptr ?
-#include "AudioDecoder.h" // is this really needed for scoped_ptr ?
-
#include <boost/scoped_ptr.hpp>
+#include <boost/scoped_array.hpp>
#include <boost/thread/mutex.hpp>
// Forward declarations
@@ -46,6 +40,8 @@
}
namespace media {
class MediaHandler;
+ class MediaParser;
+ class AudioDecoder;
}
}
@@ -54,9 +50,16 @@
// Forward declarations
class fn_call;
-class Sound : public as_object {
+class Sound_as : public as_object
+{
+
public:
- Sound();
+
+ Sound_as();
+
+ ~Sound_as();
+
+ static void init(as_object& global);
/// Make this sound control the given character
//
@@ -65,7 +68,6 @@
///
void attachCharacter(character* attachedChar);
- ~Sound();
void attachSound(int si, const std::string& name);
/// Get number of bytes loaded from the external sound (if any)
@@ -189,8 +191,6 @@
}
};
-void sound_class_init(as_object& global);
-
} // end of gnash namespace
#endif
=== modified file 'testsuite/libnet.all/test_cache.cpp'
--- a/testsuite/libnet.all/test_cache.cpp 2008-11-17 17:05:30 +0000
+++ b/testsuite/libnet.all/test_cache.cpp 2008-12-26 08:08:51 +0000
@@ -392,7 +392,7 @@
#else // no DejaGnu support
int
-main(int /*argc*/, char /* *argv[]*/)
+main(int /*argc*/, char**)
{
// nop
return 0;
=== modified file 'testsuite/libnet.all/test_diskstream.cpp'
--- a/testsuite/libnet.all/test_diskstream.cpp 2008-12-01 01:21:07 +0000
+++ b/testsuite/libnet.all/test_diskstream.cpp 2008-12-26 08:08:51 +0000
@@ -275,7 +275,7 @@
#else
int
-main(int /*argc*/, char /* *argv[]*/)
+main(int /*argc*/, char**)
{
// nop
return 0;
=== modified file 'testsuite/libnet.all/test_http.cpp'
--- a/testsuite/libnet.all/test_http.cpp 2008-12-18 00:16:27 +0000
+++ b/testsuite/libnet.all/test_http.cpp 2008-12-26 08:08:51 +0000
@@ -658,7 +658,7 @@
#else // no DejaGnu support
int
-main(int /*argc*/, char /* *argv[]*/)
+main(int /*argc*/, char**)
{
// nop
return 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10480: Class renaming, minor fixes, C++ification and build fix for some testing,
Benjamin Wolsey <=