[Python-ogre-commit] SF.net SVN: python-ogre: [376] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2007-09-17 01:26:59
|
Revision: 376
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=376&view=rev
Author: andy_miller
Date: 2007-09-16 18:27:01 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Added access to CEGUI.Window.setUserData and getUserData
Further NXOgre updates
Fix for correct QuickGui compiling and support for latest SVN
Modified Paths:
--------------
trunk/python-ogre/code_generators/cegui/generate_code.py
trunk/python-ogre/code_generators/cegui/hand_made_wrappers.py
trunk/python-ogre/code_generators/nxogre/generate_code.py
trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h
trunk/python-ogre/code_generators/ogrenewt/hand_made_wrappers.py
trunk/python-ogre/code_generators/quickgui/generate_code.py
trunk/python-ogre/environment.py
Modified: trunk/python-ogre/code_generators/cegui/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/cegui/generate_code.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/cegui/generate_code.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -145,6 +145,10 @@
print "Excluding Iterator", cls.name
CEGUI_ns.class_('OgreCEGUIResourceProvider').exclude() # it's _ogrePrivate..
+ ## Replaced these with 'useful' functions in the handwrappers - take and return python objects
+ CEGUI_ns.class_( "Window" ).member_functions("setUserData").exclude()
+ CEGUI_ns.class_( "Window" ).member_functions("getUserData").exclude()
+
global_ns.namespace( 'Ogre' ).class_('SceneManager').include(already_exposed=True)
global_ns.namespace( 'Ogre' ).class_('RenderWindow').include(already_exposed=True)
Modified: trunk/python-ogre/code_generators/cegui/hand_made_wrappers.py
===================================================================
--- trunk/python-ogre/code_generators/cegui/hand_made_wrappers.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/cegui/hand_made_wrappers.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -353,7 +353,31 @@
bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());
"""
+WRAPPER_DEFINITION_Window=\
+"""
+void
+Window_setUserData ( ::CEGUI::Window & me, PyObject * data ) {
+ me.setUserData ( data );
+ }
+
+PyObject *
+Window_getUserData ( ::CEGUI::Window & me) {
+ void * data = me.getUserData ( );
+ Py_INCREF( (PyObject *) data ); // I'm passing a reference to this object so better inc the ref :)
+ return (PyObject *) data;
+ }
+"""
+
+WRAPPER_REGISTRATION_Window =[
+ 'def ("setUserData", &::Window_setUserData );',
+ 'def ("getUserData", &::Window_getUserData);'
+ ]
+
+def apply_reg ( class_, code ):
+ for c in code:
+ class_.add_registration_code ( c )
+
def apply( mb ):
# # mb.add_declaration_code( WRAPPER_DEFINITION_General )
# # mb.add_registration_code( WRAPPER_REGISTRATION_General )
@@ -365,3 +389,7 @@
rt = mb.class_( 'String' )
rt.add_declaration_code( WRAPPER_DEFINITION_String )
rt.add_registration_code( WRAPPER_REGISTRATION_String )
+
+ rt = mb.class_( 'Window' )
+ rt.add_declaration_code( WRAPPER_DEFINITION_Window )
+ apply_reg( rt, WRAPPER_REGISTRATION_Window )
Modified: trunk/python-ogre/code_generators/nxogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/nxogre/generate_code.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/nxogre/generate_code.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -102,6 +102,17 @@
,'::NxOgre::List<NxOgre::RemoteDebuggerConnection::Camera>::destroyAndEraseAll'
,'::NxOgre::List<NxOgre::RemoteDebuggerConnection::Camera>::dumpToConsole'
+
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::dumpToConsole'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::count'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::empty'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::insert'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::lock'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::isLocked'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::has'
+# ,'::NxOgre::Container<std::string, NxOgre::Joint*>::getFirst'
+
+
,'::NxOgre::UserAllocator::realloc'
# # # # not yet implemented in source
,'::NxOgre::WheelSet::attachNewWheel'
@@ -155,7 +166,13 @@
for e in excludes:
print "excluding ", e
main_ns.member_functions(e).exclude()
-
+
+ ## this is probably excessive :)
+ names = ['_begin','_end', '_atEnd', '_next']
+ for f in main_ns.member_functions():
+ if f.name in names:
+ print "excuding MF:", f.name, f
+ f.exclude()
### Free Functions
excludes = []
for e in excludes:
@@ -170,7 +187,7 @@
,'::NxOgre::Serialiser::SerialiserBase'
,'::NxOgre::UserAllocator'
,'::NxOgre::State'
-
+
# not yet implemented in source
]
for e in excludes:
@@ -180,15 +197,17 @@
## I have a challenge that Py++ doesn't recognise these classes by full name (perhaps because they are structs?)
## so I have to look through and match on a class by class basis
excludeName = ['Container<NxOgre::Scene::Renderables, float>'
- ,'Container<std::string,NxOgre::Actor*>'
+ ,'Container<std::string, NxOgre::Actor*>'
,'List<NxOgre::CharacterHitReport*>'
,'List<NxOgre::RemoteDebuggerConnection::Camera>'
,'List<NxOgre::Blueprints::ActorBlueprint*>'
+ ,'Container<std::string, NxOgre::Joint*>'
]
for c in main_ns.classes():
# print c.decl_string
-# print c.name
+ print ("Checking:",c.name)
if c.name in excludeName:
+ print ("SPECIAL excluding ", c.name)
c.exclude()
# a temporary fix for container based classes -- still an issue with them though...
# AND this is an overkill -- not all classes need these removed...
Modified: trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h
===================================================================
--- trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h 2007-09-17 01:27:01 UTC (rev 376)
@@ -96,8 +96,6 @@
typedef NxOgre::Container<NxOgre::NxString, NxOgre::FluidDrain*> FluidDrains;
typedef NxOgre::Container<NxOgre::NxString, NxOgre::FluidEmitter*> FluidEmitters;
typedef NxOgre::Container<NxOgre::NxString, NxOgre::SoftBody*> SoftBodies;
-// typedef std::map<NxOgre::TI, NxOgre::Containee > Type;
-// typedef std::list<NxOgre::TT> Type;
typedef std::pair<NxOgre::NxString,NxOgre::NxString> Parameter;
typedef std::vector<Parameter> Parameters;
typedef Ogre::String NxString;
@@ -109,7 +107,7 @@
typedef NxOgre::Container<NxOgre::NxString, NxOgre::Cloth*> Cloths;
typedef NxOgre::Container<NxOgre::NxErrorIndex, NxOgre::ErrorReporter*> ErrorReporterList;
typedef NxOgre::Container<NxOgre::NxString, NxOgre::Helper*> Helpers;
-typedef NxOgre::Container<NxOgre::NxString, NxOgre::Joint*> Joints;
+typedef NxOgre::Container<NxOgre::NxString, NxOgre::Joint*> JointsClass;
typedef NxOgre::Container<NxOgre::NxString, NxOgre::Material*> MaterialList;
// typedef NxOgre::Container<NxOgre::NxMaterialIndex, NxOgre::Material*> MaterialListByIndex;
// typedef NxOgre::Container<NxOgre::NxString, NxOgre::NxMaterialIndex> MaterialPair;
@@ -127,3 +125,7 @@
typedef std::vector<std::pair<Ogre::Vector3, unsigned>, std::allocator<std::pair<Ogre::Vector3, unsigned> > > VectorPairVector3;
typedef std::set<Ogre::Entity*,std::less<Ogre::Entity*>,std::allocator<Ogre::Entity*> > SetEntity;
typedef NxOgre::Material NxOgreMaterial;
+typedef std::map<unsigned, NxOgre::Container<unsigned, NxOgre::Joint*>::Containee, std::less<unsigned>, std::allocator<std::pair<unsigned const, NxOgre::Container<unsigned, NxOgre::Joint*>::Containee> > >\
+ MapContainerJointContainee;
+typedef std::map<unsigned short, NxOgre::Container<unsigned short, NxOgre::DominanceGroup*>::Containee, std::less<unsigned short>, std::allocator<std::pair<unsigned short const, NxOgre::Container<unsigned short, NxOgre::DominanceGroup*>::Containee> > >\
+ MapContainerDominanceGroupContainee;
\ No newline at end of file
Modified: trunk/python-ogre/code_generators/ogrenewt/hand_made_wrappers.py
===================================================================
--- trunk/python-ogre/code_generators/ogrenewt/hand_made_wrappers.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/ogrenewt/hand_made_wrappers.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -449,6 +449,7 @@
cs = mb.namespace( 'BasicJoints' ).class_("Slider" )
cs.add_declaration_code( WRAPPER_DEFINITION_Slider )
apply_reg (cs, WRAPPER_REGISTRATION_Slider )
+
cs = mb.namespace( 'BasicJoints' ).class_("Universal" )
cs.add_declaration_code( WRAPPER_DEFINITION_Universal )
apply_reg (cs, WRAPPER_REGISTRATION_Universal )
Modified: trunk/python-ogre/code_generators/quickgui/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/quickgui/generate_code.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/code_generators/quickgui/generate_code.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -77,7 +77,7 @@
excludes=[\
'::QuickGUI::QuadContainer::_populateRenderObjectList'
,'::QuickGUI::QuadContainer::_updateRenderQueue'
- ,'::QuickGUI::GUIManager::getDefaultFont'
+ ##,'::QuickGUI::GUIManager::getDefaultFont'
]
for e in excludes:
print "excluding function", e
Modified: trunk/python-ogre/environment.py
===================================================================
--- trunk/python-ogre/environment.py 2007-09-12 13:40:08 UTC (rev 375)
+++ trunk/python-ogre/environment.py 2007-09-17 01:27:01 UTC (rev 376)
@@ -152,6 +152,7 @@
moduleName='OGRE'
cflags = ""
moduleParentLocation = "renderer"
+ parent = "ogre/renderer"
dependsOn = ['boost']
myLibraryPaths = []
myLibraries = ['OgreMain']
@@ -384,7 +385,8 @@
class quickgui:
version="0.9.6"
parent="ogre/gui"
- CCFLAGS = ' /D "WIN32" /D "NDEBUG", /D "WINDOWS"' ###/D "OGRE_PLATFORM_WIN32"' # /D "FT2_BUILD_LIBRARY"
+ ## note the defined for _QuickGUIExport forces non dll usage
+ CCFLAGS = ' /D WIN32 /D NDEBUG /D WINDOWS /D _QuickGUIExport="" '
cflags=""
include_dirs = [ Config.PATH_Boost,
Config.PATH_INCLUDE_Ogre,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|