[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/Makefile.am server/as_va...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/Makefile.am server/as_va... |
Date: |
Tue, 17 Jun 2008 09:28:28 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/06/17 09:28:28
Modified files:
. : ChangeLog
server : Makefile.am as_value.cpp as_value.h
Added files:
server : CharacterProxy.cpp CharacterProxy.h
Log message:
* server/: Makefile.am, as_value.{cpp,h}, ChracterProxy.{cpp,h}:
Move CharacterProxy class in its own files (they are useful
for other classes, not only as_value - surely for Sound, possibly
for as_environment too [ target ]).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6953&r2=1.6954
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.145&r2=1.146
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.137&r2=1.138
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.h?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/server/CharacterProxy.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/CharacterProxy.h?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6953
retrieving revision 1.6954
diff -u -b -r1.6953 -r1.6954
--- ChangeLog 17 Jun 2008 09:04:22 -0000 1.6953
+++ ChangeLog 17 Jun 2008 09:28:27 -0000 1.6954
@@ -1,5 +1,12 @@
2008-06-17 Sandro Santilli <address@hidden>
+ * server/: Makefile.am, as_value.{cpp,h}, ChracterProxy.{cpp,h}:
+ Move CharacterProxy class in its own files (they are useful
+ for other classes, not only as_value - surely for Sound, possibly
+ for as_environment too [ target ]).
+
+2008-06-17 Sandro Santilli <address@hidden>
+
* server/impl.cpp: add recognition of FLV files as
top level movie (just to log_unimpl about it).
Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -b -r1.145 -r1.146
--- server/Makefile.am 9 Jun 2008 20:53:51 -0000 1.145
+++ server/Makefile.am 17 Jun 2008 09:28:27 -0000 1.146
@@ -59,6 +59,7 @@
as_value.cpp \
asClass.cpp \
character.cpp \
+ CharacterProxy.cpp \
cxform.cpp \
DynamicShape.cpp \
edit_text_character.cpp \
@@ -128,6 +129,7 @@
builtin_function.h \
button_character_instance.h \
character.h \
+ CharacterProxy.h \
cxform.h \
debugger.h \
DynamicShape.h \
Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- server/as_value.cpp 29 May 2008 12:53:44 -0000 1.137
+++ server/as_value.cpp 17 Jun 2008 09:28:28 -0000 1.138
@@ -1652,48 +1652,6 @@
{
}
-//-------------------------------------
-// as_value::CharacterProxy
-//-------------------------------------
-
-/* static private */
-character*
-as_value::CharacterProxy::find_character_by_target(const std::string& tgtstr)
-{
- if ( tgtstr.empty() ) return NULL;
-
- return VM::get().getRoot().findCharacterByTarget(tgtstr);
-}
-
-void
-as_value::CharacterProxy::checkDangling() const
-{
- if ( _ptr && _ptr->isDestroyed() )
- {
- _tgt = _ptr->getOrigTarget();
-#ifdef GNASH_DEBUG_SOFT_REFERENCES
- log_debug("char %s (%s) was destroyed, stored it's orig target
(%s) for later rebinding", _ptr->getTarget(),
- typeName(*_ptr), _tgt);
-#endif
- _ptr = 0;
- }
-}
-
-std::string
-as_value::CharacterProxy::getTarget() const
-{
- checkDangling(); // set _ptr to NULL and _tgt to original target if
destroyed
- if ( _ptr ) return _ptr->getTarget();
- else return _tgt;
-}
-
-void
-as_value::CharacterProxy::setReachable() const
-{
- checkDangling();
- if ( _ptr ) _ptr->setReachable();
-}
-
as_value&
as_value::newAdd(const as_value& op2)
{
Index: server/as_value.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/as_value.h 6 Jun 2008 10:51:39 -0000 1.95
+++ server/as_value.h 17 Jun 2008 09:28:28 -0000 1.96
@@ -25,6 +25,7 @@
#include "dsodefs.h"
#include "smart_ptr.h"
+#include "CharacterProxy.h"
#include <cmath>
#include <limits>
@@ -581,115 +582,6 @@
private:
- /// A proxy for character pointers.
- //
- /// The proxy will store a pointer to a character until the
- /// character is destroyed, in which case it will only store the
original
- /// target path of it and always use that for rebinding when needed.
- ///
- class CharacterProxy {
-
- mutable character* _ptr;
-
- mutable std::string _tgt;
-
- static character* find_character_by_target(const std::string&
target);
-
- /// If we still have a sprite pointer check if it was destroyed
- /// in which case we drop the pointer and only keep the target.
- void checkDangling() const;
-
- public:
-
- /// Construct a CharacterProxy pointing to the given sprite
- CharacterProxy(character* sp)
- :
- _ptr(sp)
- {
- checkDangling();
- }
-
- /// Construct a copy of the given CharacterProxy
- //
- /// @param sp
- /// The CharacterProxy to make a copy of.
- /// NOTE: if the given proxy is dangling, this proxy
- /// will also be dangling. If you want to
- /// create a non-dangling proxy you can
- /// use the constructor taking a character
- /// as in CharacterProxy newProxy(oldProxy.get())
- ///
- CharacterProxy(const CharacterProxy& sp)
- {
- sp.checkDangling();
- _ptr=sp._ptr;
- if ( ! _ptr ) _tgt=sp._tgt;
- }
-
- /// Make this proxy a copy of the given one
- //
- /// @param sp
- /// The CharacterProxy to make a copy of.
- /// NOTE: if the given proxy is dangling, this proxy
- /// will also be dangling. If you want to
- /// create a non-dangling proxy you can
- /// use the constructor taking a character
- /// as in CharacterProxy newProxy(oldProxy.get())
- ///
- CharacterProxy& operator=(const CharacterProxy& sp)
- {
- sp.checkDangling();
- _ptr=sp._ptr;
- if ( ! _ptr ) _tgt=sp._tgt;
- return *this;
- }
-
- /// Get the pointed sprite, either original or rebound
- //
- /// @return the currently bound sprite, NULL if none
- ///
- character* get(bool skipRebinding=false) const
- {
- if ( skipRebinding ) return _ptr;
-
- checkDangling(); // set _ptr to NULL and _tgt to
original target if destroyed
- if ( _ptr ) return _ptr;
- else return find_character_by_target(_tgt);
- }
-
- /// Get the sprite target, either current (if not dangling) or
bounded-to one.
- std::string getTarget() const;
-
- /// Return true if this sprite is dangling
- //
- /// Dangling means that it doesn't have a pointer to the
original
- /// sprite anymore, not that it doesn't point to anything.
- /// To know if it points to something or not use get(), which
will
- /// return NULL if it doesn't point to anyhing.
- ///
- bool isDangling() const
- {
- checkDangling();
- return !_ptr;
- }
-
- /// \brief
- /// Two sprite_proxies are equal if they point to the
- /// same sprite
- ///
- bool operator==(const CharacterProxy& sp) const
- {
- return get() == sp.get();
- }
-
- /// Set the original sprite (if any) as reachable
- //
- /// NOTE: if this value is dangling, we won't keep anything
- /// alive.
- ///
- void setReachable() const;
- };
-
/// Compare values of the same type
//
/// NOTE: will abort if values are not of the same type!
Index: server/CharacterProxy.cpp
===================================================================
RCS file: server/CharacterProxy.cpp
diff -N server/CharacterProxy.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/CharacterProxy.cpp 17 Jun 2008 09:28:28 -0000 1.1
@@ -0,0 +1,73 @@
+// CharacterProxy.cpp - rebindable character reference, for Gnash
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+
+#include "CharacterProxy.h"
+
+#include "utility.h" // for typeName
+#include "character.h" // for isDestroyed, getOrigTarget, ...
+#include "VM.h" // for VM::getRoot()
+#include "movie_root.h" // for findCharacterByTarget
+
+#include <string>
+
+namespace gnash
+{
+
+/* static private */
+character*
+as_value::CharacterProxy::find_character_by_target(const std::string& tgtstr)
+{
+ if ( tgtstr.empty() ) return NULL;
+
+ return VM::get().getRoot().findCharacterByTarget(tgtstr);
+}
+
+void
+as_value::CharacterProxy::checkDangling() const
+{
+ if ( _ptr && _ptr->isDestroyed() )
+ {
+ _tgt = _ptr->getOrigTarget();
+#ifdef GNASH_DEBUG_SOFT_REFERENCES
+ log_debug("char %s (%s) was destroyed, stored it's orig target
(%s) for later rebinding", _ptr->getTarget(),
+ typeName(*_ptr), _tgt);
+#endif
+ _ptr = 0;
+ }
+}
+
+std::string
+as_value::CharacterProxy::getTarget() const
+{
+ checkDangling(); // set _ptr to NULL and _tgt to original target if
destroyed
+ if ( _ptr ) return _ptr->getTarget();
+ else return _tgt;
+}
+
+void
+as_value::CharacterProxy::setReachable() const
+{
+ checkDangling();
+ if ( _ptr ) _ptr->setReachable();
+}
+
+
+} // namespace gnash
+
Index: server/CharacterProxy.h
===================================================================
RCS file: server/CharacterProxy.h
diff -N server/CharacterProxy.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/CharacterProxy.h 17 Jun 2008 09:28:28 -0000 1.1
@@ -0,0 +1,143 @@
+// CharacterProxy.h - rebindable character reference, for Gnash
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#ifndef GNASH_CHARACTER_PROXY_H
+#define GNASH_CHARACTER_PROXY_H
+
+#include <string>
+
+// Forward declarations
+namespace gnash {
+ class character;
+}
+
+namespace gnash {
+
+/// A proxy for character pointers.
+//
+/// The proxy will store a pointer to a character until the
+/// character is destroyed, in which case it will only store the original
+/// target path of it and always use that for rebinding when needed.
+///
+class CharacterProxy {
+
+ mutable character* _ptr;
+
+ mutable std::string _tgt;
+
+ static character* find_character_by_target(const std::string& target);
+
+ /// If we still have a sprite pointer check if it was destroyed
+ /// in which case we drop the pointer and only keep the target.
+ void checkDangling() const;
+
+public:
+
+ /// Construct a CharacterProxy pointing to the given sprite
+ CharacterProxy(character* sp)
+ :
+ _ptr(sp)
+ {
+ checkDangling();
+ }
+
+ /// Construct a copy of the given CharacterProxy
+ //
+ /// @param sp
+ /// The CharacterProxy to make a copy of.
+ /// NOTE: if the given proxy is dangling, this proxy
+ /// will also be dangling. If you want to
+ /// create a non-dangling proxy you can
+ /// use the constructor taking a character
+ /// as in CharacterProxy newProxy(oldProxy.get())
+ ///
+ CharacterProxy(const CharacterProxy& sp)
+ {
+ sp.checkDangling();
+ _ptr=sp._ptr;
+ if ( ! _ptr ) _tgt=sp._tgt;
+ }
+
+ /// Make this proxy a copy of the given one
+ //
+ /// @param sp
+ /// The CharacterProxy to make a copy of.
+ /// NOTE: if the given proxy is dangling, this proxy
+ /// will also be dangling. If you want to
+ /// create a non-dangling proxy you can
+ /// use the constructor taking a character
+ /// as in CharacterProxy newProxy(oldProxy.get())
+ ///
+ CharacterProxy& operator=(const CharacterProxy& sp)
+ {
+ sp.checkDangling();
+ _ptr=sp._ptr;
+ if ( ! _ptr ) _tgt=sp._tgt;
+ return *this;
+ }
+
+ /// Get the pointed sprite, either original or rebound
+ //
+ /// @return the currently bound sprite, NULL if none
+ ///
+ character* get(bool skipRebinding=false) const
+ {
+ if ( skipRebinding ) return _ptr;
+
+ checkDangling(); // set _ptr to NULL and _tgt to original
target if destroyed
+ if ( _ptr ) return _ptr;
+ else return find_character_by_target(_tgt);
+ }
+
+ /// Get the sprite target, either current (if not dangling) or
bounded-to one.
+ std::string getTarget() const;
+
+ /// Return true if this sprite is dangling
+ //
+ /// Dangling means that it doesn't have a pointer to the original
+ /// sprite anymore, not that it doesn't point to anything.
+ /// To know if it points to something or not use get(), which will
+ /// return NULL if it doesn't point to anyhing.
+ ///
+ bool isDangling() const
+ {
+ checkDangling();
+ return !_ptr;
+ }
+
+ /// \brief
+ /// Two sprite_proxies are equal if they point to the
+ /// same sprite
+ ///
+ bool operator==(const CharacterProxy& sp) const
+ {
+ return get() == sp.get();
+ }
+
+ /// Set the original sprite (if any) as reachable
+ //
+ /// NOTE: if this value is dangling, we won't keep anything
+ /// alive.
+ ///
+ void setReachable() const;
+};
+
+} // end namespace gnash
+
+#endif // GNASH_CHARACTER_PROXY_H
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/Makefile.am server/as_va...,
Sandro Santilli <=