[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash pythonmodule/pyGnash.cpp pythonmodule/gna...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash pythonmodule/pyGnash.cpp pythonmodule/gna... |
Date: |
Sat, 12 Jan 2008 15:05:56 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/01/12 15:05:56
Modified files:
pythonmodule : pyGnash.cpp gnashpython.cpp gnashpython.h
. : ChangeLog
server/asobj : SharedObject.cpp string.cpp
server/vm : ActionExec.cpp
Log message:
* server/asobj/{SharedObject.cpp,string.cpp},
server/vm/ActionExec.cpp:
fix size_t format warnings.
* pythonmodule/gnashpython.{cpp,h}: extend gnash::character
wrapper.
* pythonmodule/pyGnash.cpp: add character bindings.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/pythonmodule/pyGnash.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/pythonmodule/gnashpython.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/pythonmodule/gnashpython.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5386&r2=1.5387
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/SharedObject.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.61&r2=1.62
Patches:
Index: pythonmodule/pyGnash.cpp
===================================================================
RCS file: /sources/gnash/gnash/pythonmodule/pyGnash.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- pythonmodule/pyGnash.cpp 11 Jan 2008 16:50:36 -0000 1.3
+++ pythonmodule/pyGnash.cpp 12 Jan 2008 15:05:54 -0000 1.4
@@ -39,20 +39,27 @@
.def("initVM", &pythonwrapper::GnashPlayer::initVM)
.def("setRenderer", &pythonwrapper::GnashPlayer::setRenderer,
- "Pass a string naming the renderer to use. Valid
renderers are: "
+ "Sets the renderer to use. Pass a string naming the "
+ "desired renderer. Valid renderers are: "
"AGG_RGB555, AGG_RGB565, AGG_RGBA16, AGG_RGB24,
AGG_BGR24, "
"AGG_RGBA32, AGG_BGRA32, AGG_ARGB32, AGG_ABGR32,
OpenGL, "
"Cairo.")
- .def("currentFrame", &pythonwrapper::GnashPlayer::getCurrentFrame)
+ .def("currentFrame", &pythonwrapper::GnashPlayer::getCurrentFrame,
+ "Get the frame of the movie that the player has
reached.")
.def("advanceClock", &pythonwrapper::GnashPlayer::advanceClock)
.def("advance", &pythonwrapper::GnashPlayer::advance)
- .def("restart", &pythonwrapper::GnashPlayer::restart)
- .def("pressKey", &pythonwrapper::GnashPlayer::pressKey)
+ .def("restart", &pythonwrapper::GnashPlayer::restart,
+ "Restart the movie.")
+ .def("pressKey", &pythonwrapper::GnashPlayer::pressKey,
+ "Send a key press event to the player.")
.def("allowRescale", &pythonwrapper::GnashPlayer::allowRescale)
.def("setVerbose", &pythonwrapper::GnashPlayer::setVerbose)
- .def("render", &pythonwrapper::GnashPlayer::render)
+ .def("render", &pythonwrapper::GnashPlayer::render,
+ "Instruct the renderer to draw the current frame. "
+ "Pass 'True' to enforce a full redraw, 'False' to
redraw "
+ "only invalidated bounds.")
.def("movePointer", &pythonwrapper::GnashPlayer::movePointer,
"Move pointer to specified coordinates. Returns true "
"if the move triggered an action requiring a redraw.")
@@ -65,20 +72,36 @@
.def("swfHeight", &pythonwrapper::GnashPlayer::getSWFHeight)
.def("swfURL", &pythonwrapper::GnashPlayer::getSWFURL)
.def("swfBytesTotal", &pythonwrapper::GnashPlayer::getSWFBytesTotal,
- "Length of the loaded movie in bytes as reported in the headers."
+ "Length of the loaded movie in bytes, as reported in "
+ "the headers."
)
.def("swfBytesLoaded", &pythonwrapper::GnashPlayer::getSWFBytesLoaded,
- "The number of bytes of the movie that have been loaded")
+ "The number of bytes of the movie that have been
loaded.")
- .def("getCharacterById", &pythonwrapper::GnashPlayer::getCharacterById,
- return_value_policy<manage_new_object>())
.def("getTopmostMouseEntity",
&pythonwrapper::GnashPlayer::getTopmostMouseEntity,
- return_value_policy<manage_new_object>())
+ return_value_policy<manage_new_object>(),
+ "The active gnash.Character() under the pointer.")
;
- class_<pythonwrapper::GnashCharacter>("Character", "A character from the
movie."
- "This class doesn't
work")
+ class_<pythonwrapper::GnashCharacter>("Character", "Wrapper round a Gnash
character.")
.def("name", &pythonwrapper::GnashCharacter::name)
+ .def("target", &pythonwrapper::GnashCharacter::target)
+ .def("ratio", &pythonwrapper::GnashCharacter::ratio)
+
+ .def("id", &pythonwrapper::GnashCharacter::id)
+ .def("depth", &pythonwrapper::GnashCharacter::depth)
+ .def("textName", &pythonwrapper::GnashCharacter::textName)
+ .def("clipDepth", &pythonwrapper::GnashCharacter::clipDepth)
+ .def("height", &pythonwrapper::GnashCharacter::height)
+ .def("width", &pythonwrapper::GnashCharacter::height)
+ .def("visible", &pythonwrapper::GnashCharacter::visible)
+
+ .def("advance", &pythonwrapper::GnashCharacter::visible)
+
+ .def("getParent", &pythonwrapper::GnashCharacter::getParent,
+ return_value_policy<manage_new_object>(),
+ "The parent gnash.Character() of the present character,
"
+ "NULL if there is no parent.")
;
}
Index: pythonmodule/gnashpython.cpp
===================================================================
RCS file: /sources/gnash/gnash/pythonmodule/gnashpython.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- pythonmodule/gnashpython.cpp 11 Jan 2008 16:50:36 -0000 1.3
+++ pythonmodule/gnashpython.cpp 12 Jan 2008 15:05:54 -0000 1.4
@@ -437,6 +437,20 @@
GnashCharacter::~GnashCharacter()
{
+ _character = NULL;
+ delete _character;
+}
+
+GnashCharacter*
+GnashCharacter::getParent()
+{
+ gnash::character* c = _character->get_parent();
+
+ if (!c) return NULL;
+
+ GnashCharacter* chr(new GnashCharacter(c));
+
+ return chr;
}
} // end pythonwrapper
Index: pythonmodule/gnashpython.h
===================================================================
RCS file: /sources/gnash/gnash/pythonmodule/gnashpython.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- pythonmodule/gnashpython.h 11 Jan 2008 16:50:36 -0000 1.3
+++ pythonmodule/gnashpython.h 12 Jan 2008 15:05:54 -0000 1.4
@@ -142,8 +142,30 @@
GnashCharacter(gnash::character* c);
~GnashCharacter();
- const std::string name() { return _character->getTarget(); }
- const float ratio() { return _character->get_ratio(); }
+ // The only constant aspect of a character?
+ const int id() { return _character->get_id(); }
+
+ std::string name() { return _character->get_name(); }
+
+ const char* textName() { return _character->get_text_name(); }
+
+ std::string target() { return _character->getTarget(); }
+
+ float ratio() { return _character->get_ratio(); }
+
+ int depth() { return _character->get_depth(); }
+
+ int clipDepth() { return _character->get_clip_depth(); }
+
+ float height() { return _character->get_height(); }
+
+ float width() { return _character->get_width(); }
+
+ bool visible() { return _character->get_visible(); }
+
+ void advance() { _character->advance(); }
+
+ GnashCharacter* getParent();
private:
gnash::character* _character;
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5386
retrieving revision 1.5387
diff -u -b -r1.5386 -r1.5387
--- ChangeLog 12 Jan 2008 13:00:26 -0000 1.5386
+++ ChangeLog 12 Jan 2008 15:05:55 -0000 1.5387
@@ -1,3 +1,10 @@
+2008-01-12 Benjamin Wolsey <address@hidden>
+
+ * server/asobj/{SharedObject.cpp,string.cpp}, server/vm/ActionExec.cpp:
+ fix size_t format warnings.
+ * pythonmodule/gnashpython.{cpp,h}: extend gnash::character wrapper.
+ * pythonmodule/pyGnash.cpp: add character bindings.
+
2008-01-12 Udo Giacomozzi <address@hidden>
* libbase/URL.h: add set method for querystring
Index: server/asobj/SharedObject.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/SharedObject.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/asobj/SharedObject.cpp 5 Jan 2008 03:25:19 -0000 1.29
+++ server/asobj/SharedObject.cpp 12 Jan 2008 15:05:55 -0000 1.30
@@ -1,6 +1,6 @@
// SharedObject.cpp: ActionScript "SharedObject" class, for Gnash.
//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 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
@@ -366,7 +366,7 @@
vector<Element *>::iterator it;
vector<Element *> els = sol.getElements();
- log_msg("Read %d AMF objects from %s", els.size(), newspec.c_str());
+ log_msg("Read "SIZET_FMT" AMF objects from %s", els.size(),
newspec.c_str());
string_table& st = obj->getVM().getStringTable();
string_table::key dataKey = obj->getVM().getStringTable().find("data");
Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/asobj/string.cpp 11 Dec 2007 11:38:40 -0000 1.48
+++ server/asobj/string.cpp 12 Jan 2008 15:05:55 -0000 1.49
@@ -1,6 +1,6 @@
// string.cpp: ActionScript "String" class, for Gnash.
//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 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
@@ -16,7 +16,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: string.cpp,v 1.48 2007/12/11 11:38:40 strk Exp $ */
+/* $Id: string.cpp,v 1.49 2008/01/12 15:05:55 bwy Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -256,7 +256,7 @@
size_t retlen = end-start;
- log_msg("start:%d, end:%d, retlen:%d", start, end, retlen);
+ log_msg("start: "SIZET_FMT", end: "SIZET_FMT", retlen: "SIZET_FMT, start,
end, retlen);
return as_value(str.substr(start, retlen));
}
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/vm/ActionExec.cpp 12 Dec 2007 10:23:47 -0000 1.61
+++ server/vm/ActionExec.cpp 12 Jan 2008 15:05:56 -0000 1.62
@@ -1,6 +1,6 @@
// ActionExec.cpp: ActionScript execution, for Gnash.
//
-// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+// 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
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ActionExec.cpp,v 1.61 2007/12/12 10:23:47 zoulunkai Exp $ */
+/* $Id: ActionExec.cpp,v 1.62 2008/01/12 15:05:56 bwy Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -412,7 +412,7 @@
if ( ++branchCount > maxBranchCount )
{
char buf[256];
- snprintf(buf, 255, _("Loop iterations count exceeded
limit of " SIZET_FMT ". Last branch was from pc %d to %d."),
+ snprintf(buf, 255, _("Loop iterations count exceeded
limit of "SIZET_FMT". Last branch was from pc "SIZET_FMT" to "SIZET_FMT"."),
maxBranchCount, oldPc, pc);
throw ActionLimitException(buf);
}
- [Gnash-commit] gnash pythonmodule/pyGnash.cpp pythonmodule/gna...,
Benjamin Wolsey <=