Revision: 869
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=869&view=rev
Author: andy_miller
Date: 2009-02-01 06:49:03 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
Fix for problem with non const shared pointers (my bug !!!)
Modified Paths:
--------------
trunk/python-ogre/code_generators/ogre/generate_code.py
trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py
Modified: trunk/python-ogre/code_generators/ogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/generate_code.py 2009-01-30 13:53:17 UTC (rev 868)
+++ trunk/python-ogre/code_generators/ogre/generate_code.py 2009-02-01 06:49:03 UTC (rev 869)
@@ -77,9 +77,11 @@
for b in cls.bases:
r = b.related_class
if r.decl_string.startswith ( '::Ogre::SharedPtr<' ) :
+# print "MYSMART: Returning True:", cls
return True
else:
if cls.name.startswith ( 'SharedPtr<' ) or cls.name.endswith( 'SharedPtr' ):
+# print "MYSMART: Returning True:", cls
return True
return False
@@ -87,10 +89,10 @@
def value_type( type ):
if my_smart_ptr.is_smart_pointer( type ):
return declarations.internal_type_traits.get_by_name( type, "element_type" )
+
pygccxml.declarations.smart_pointer_traits = my_smart_ptr
-
HACK = True
MAIN_NAMESPACE = 'Ogre'
@@ -888,7 +890,6 @@
In reality the Ogre code probably needs to be patched as all of these should (??) be const. However we'll fix it
with a function transformation wrapper
"""
- return ### AJM
for fun in mb.member_functions( ):
arg_position = 0
for arg in fun.arguments:
@@ -1045,14 +1046,14 @@
global_ns = mb.global_ns
main_ns = global_ns.namespace( MAIN_NAMESPACE )
- for c in main_ns.classes():
- for v in c.variables(allow_empty=True):
- if v.access_type == 'protected':
- print "Protected Variable:", v, v.why_not_exportable(), v.exportable
+# for c in main_ns.classes():
+# for v in c.variables(allow_empty=True):
+# if v.access_type == 'protected':
+# print "Protected Variable:", v, v.why_not_exportable(), v.exportable
v =main_ns.class_('SceneManager').variable('mSceneNodes')
v.set_exportable(True)
v._exportable_reason = None
- print v,v.why_not_exportable(), v.exportable
+# print v,v.why_not_exportable(), v.exportable
# v.access_type = 'public'
# sys.exit()
Modified: trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2009-01-30 13:53:17 UTC (rev 868)
+++ trunk/python-ogre/code_generators/ogre/hand_made_wrappers.py 2009-02-01 06:49:03 UTC (rev 869)
@@ -298,6 +298,18 @@
WRAPPER_DEFINITION_General = \
"""
+bool checkDataStreamPtr(Ogre::DataStreamPtr& stream)
+{
+ std::cout << "CheckDataStreamPtr called\\n";
+ return true;
+}
+
+bool checkDataStreamPtrConst(const Ogre::DataStreamPtr& stream)
+{
+ std::cout << "CheckDataStreamPtrConst called\\n";
+ return true;
+}
+
Ogre::OverlayContainer * General_castElementAsOverlayContainer( Ogre::OverlayElement * e ){
return (Ogre::OverlayContainer*) e;
}
@@ -494,6 +506,12 @@
"""
WRAPPER_REGISTRATION_General = [
+ """bp::def( "checkDataStreamPtr", &checkDataStreamPtr,
+ "",
+ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""",
+ """bp::def( "checkDataStreamPtrConst", &checkDataStreamPtrConst,
+ "",
+ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""",
"""bp::def( "castAsOverlayContainer", &General_castElementAsOverlayContainer,
"Python-Ogre Helper Function: Casts as Overlay Container -- needed for add2D.\\n\\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|