• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python function_transformers.output函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyplusplus.function_transformers.output函数的典型用法代码示例。如果您正苦于以下问题:Python output函数的具体用法?Python output怎么用?Python output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了output函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: Parse

    def Parse(self, mb):
        # Exclude everything by default
        mb.decls().exclude()
        
        # Include message functions and rename them
        mb.free_function('SrcPyMsg').include()
        mb.free_function('SrcPyWarning').include()
        mb.free_function('SrcPyDevMsg').include()
        
        mb.free_function('SrcPyMsg').rename('Msg')
        mb.free_function('SrcPyWarning').rename('PrintWarning')
        mb.free_function('SrcPyDevMsg').rename('DevMsg')

        # Include classes for redirecting output (replace stdout and stderr)
        mb.class_('SrcPyStdOut').include()
        mb.class_('SrcPyStdErr').include()
        
        # Debug logging
        mb.free_function('PyCOM_TimestampedLog').include()
        mb.free_function('PyCOM_TimestampedLog').rename('COM_TimestampedLog')
        
        # Tick and per frame method register functions
        mb.free_function('RegisterTickMethod').include()
        mb.free_function('UnregisterTickMethod').include()
        mb.free_function('GetRegisteredTickMethods').include()
        mb.free_function('IsTickMethodRegistered').include()
        
        mb.free_function('RegisterPerFrameMethod').include()
        mb.free_function('UnregisterPerFrameMethod').include()
        mb.free_function('GetRegisteredPerFrameMethods').include()
        mb.free_function('IsPerFrameMethodRegistered').include()
        
        # Color classes
        cls = mb.class_('Color')
        cls.include()
        cls.mem_funs('GetColor').add_transformation( FT.output('_r'), FT.output('_g'), FT.output('_b'), FT.output('_a') )
        cls.mem_opers('=').exclude() # Breaks debug mode and don't really need it
        
        cls = mb.class_('color32_s')
        cls.include()
        cls.rename('color32')
        cls.mem_funs(allow_empty=True).exclude()
        
        if self.settings.branch == 'swarm':
            # Used by GetRenderColor in Swarm branch
            cls = mb.class_('color24')
            cls.include()
        
        # Global Vars Class
        mb.class_('CGlobalVarsBase').include()
        mb.class_('CGlobalVars').include()
        mb.vars('pSaveData').exclude()
        
        # Add converters
        mb.add_registration_code( "bp::to_python_converter<\n\tstring_t,\n\tstring_t_to_python_str>();")
        mb.add_registration_code( "python_str_to_string_t();" )
        mb.add_registration_code( "wchar_t_to_python_str();" )
        mb.add_registration_code( "ptr_wchar_t_to_python_str();" )
        mb.add_registration_code( "python_str_to_wchar_t();" )
        mb.add_registration_code( "#if PY_VERSION_HEX < 0x03000000\n\tpython_unicode_to_ptr_const_wchar_t();\n\t#endif \\ PY_VERSION_HEX" )
开发者ID:detoxhby,项目名称:lambdawars,代码行数:60,代码来源:srcbuiltins.py


示例2: Parse

 def Parse(self, mb):
     # Exclude everything by default
     mb.decls().exclude()
     
     mb.class_('kbutton_t').include()
     if self.settings.branch == 'swarm':
         mb.class_('kbutton_t').mem_funs('GetPerUser').exclude()
     
     # Include input class
     cls = mb.class_('CInput')
     cls.include()
     cls.mem_funs().virtuality = 'not virtual'
     if self.settings.branch == 'swarm':
         #mb.mem_funs('FindKey').exclude() # FIXME
         mb.mem_funs('FindKey').call_policies = call_policies.return_value_policy( call_policies.reference_existing_object ) 
     else:
         mb.mem_funs('FindKey').call_policies = call_policies.return_value_policy( call_policies.manage_new_object )  
     mb.mem_funs('GetUserCmd').call_policies = call_policies.return_value_policy( call_policies.reference_existing_object ) # Can't exclude due being abstract
     
     mb.mem_funs( 'CAM_OrthographicSize' ).add_transformation( FT.output('w'), FT.output('h') )
     
     mb.add_declaration_code( "CInput *wrap_Input()\r\n{\r\n\treturn (CInput *)::input;\r\n}\r\n" )
     mb.add_registration_code( 'bp::def( "input", wrap_Input, bp::return_value_policy<bp::reference_existing_object>() );' )
     
     # ButtonCode.  
     mb.enums('ButtonCode_t').include()
     
     # Remove any protected function 
     mb.calldefs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:29,代码来源:_input.py


示例3: wrap_viewerbase

 def wrap_viewerbase(self):
     vb = self.mb.class_("ViewerBase")
     vb.constructors().exclude()
     vb.noncopyable = True
     vb.no_init = True
     vb.member_function("getWindows").add_transformation(FT.output("windows"))
     vb.member_function("getViews").add_transformation(FT.output("views"))
开发者ID:cmbruns,项目名称:osgpyplusplus,代码行数:7,代码来源:wrap_module.py


示例4: ParseClient

 def ParseClient(self, mb):
     # Free functions that don't start with 'UTIL_'
     mb.free_functions('ScreenHeight').include()
     mb.free_functions('ScreenWidth').include()
     mb.free_functions('GetVectorInScreenSpace').include()
     mb.free_functions('GetTargetInScreenSpace').include()
     
     # Main view
     mb.free_function('MainViewOrigin').include()
     mb.free_function('MainViewAngles').include()
     mb.free_function('MainViewForward').include()
     mb.free_function('MainViewRight').include()
     mb.free_function('MainViewUp').include()
     mb.free_function('MainWorldToViewMatrix').include()
     
     # Call policies and excludes
     if self.settings.branch == 'swarm':
         mb.free_function('UTIL_GetLocalizedKeyString').exclude()
         mb.free_function('UTIL_MessageText').exclude()
         mb.free_functions('UTIL_EntityFromUserMessageEHandle').call_policies = call_policies.return_value_policy( call_policies.return_by_value )   
     mb.free_functions('UTIL_PlayerByUserId').call_policies = call_policies.return_value_policy( call_policies.return_by_value )   
         
     # Transformations
     mb.free_functions( 'GetVectorInScreenSpace' ).add_transformation( FT.output('iX'), FT.output('iY') )
     mb.free_functions( 'GetTargetInScreenSpace' ).add_transformation( FT.output('iX'), FT.output('iY') )
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:25,代码来源:_utils.py


示例5: ParseISurface

 def ParseISurface(self, mb):
     cls = mb.class_('CWrapSurface')
     cls.include()
     cls.rename('ISurface')
     mb.free_function('wrapsurface').include()
     mb.free_function( 'wrapsurface' ).call_policies = call_policies.return_value_policy(call_policies.reference_existing_object) 
     mb.free_function( 'wrapsurface' ).rename('surface')    
     
     mb.enumeration('CursorCode').include()
     mb.enumeration('FontDrawType_t').include()
     if self.settings.branch == 'swarm':
         mb.class_('FontVertex_t').include()
     else:
         mb.class_('Vertex_t').include()
     mb.class_('IntRect').include()
     
     cls.member_functions( 'DrawGetTextPos' ).add_transformation( FT.output('x'), FT.output('y') )
     cls.member_functions( 'DrawGetTextureSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
     cls.member_functions( 'GetScreenSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
     cls.member_functions( 'GetCharABCwide' ).add_transformation( FT.output('a'), FT.output('b'), FT.output('c') )
     cls.member_functions( 'GetWorkspaceBounds' ).add_transformation( FT.output('x'), FT.output('y'), FT.output('wide'), FT.output('tall') )
     cls.member_functions( 'GetAbsoluteWindowBounds' ).add_transformation( FT.output('x'), FT.output('y'), FT.output('wide'), FT.output('tall') )
     cls.member_functions( 'GetProportionalBase' ).add_transformation( FT.output('width'), FT.output('height') )
     cls.member_functions( 'SurfaceGetCursorPos' ).add_transformation( FT.output('x'), FT.output('y') )
     
     cls.member_functions( 'CreateHTMLWindow' ).call_policies = call_policies.return_value_policy(call_policies.reference_existing_object) 
     cls.member_functions( 'DrawGetTextureMatInfoFactory' ).call_policies = call_policies.return_value_policy(call_policies.reference_existing_object) 
     cls.member_functions( 'GetIconImageForFullPath' ).call_policies = call_policies.return_value_policy(call_policies.reference_existing_object) 
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:28,代码来源:_vgui.py


示例6: ScrollBar

    def ScrollBar(self, mb):
        mb.mem_funs( 'GetButton' ).call_policies = call_policies.return_value_policy(call_policies.return_by_value)
        mb.mem_funs( 'GetSlider' ).call_policies = call_policies.return_value_policy(call_policies.return_by_value)
        
        mb.mem_funs( 'GetRange' ).add_transformation( FT.output('min'), FT.output('max') ) 

        # ScrollBarSlider
        mb.mem_funs( 'GetNobPos' ).add_transformation( FT.output('min'), FT.output('max') ) 
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:8,代码来源:_vguicontrols.py


示例7: customize

 def customize( self, mb ):
     mb.class_("Derived2").member_functions("eval_c").exclude()
     mb.class_( 'BB' ).include()
     do_smth = mb.mem_fun( '::override_bug::AA::do_smth' )
     do_smth.add_transformation( FT.output(0), alias='do_smth_a' )
     do_smth = mb.mem_fun( '::override_bug::BB::do_smth' )
     do_smth.add_transformation( FT.output(0), FT.output(1), alias='do_smth_b' )
     mb.class_( 'XX' ).mem_fun( 'do_smth' ).exclude()
开发者ID:CTrauma,项目名称:pypp11,代码行数:8,代码来源:override_bug_tester.py


示例8: wrap_TriviewControl

 def wrap_TriviewControl(self):
     tvc = self.mb.class_('TriviewControl')
     tvc.include()
     # getFocusLocation passes int refs as args for return.
     gfl = tvc.member_function('getFocusLocation')
     gfl.add_transformation( 
             FT.output('cx'), 
             FT.output('cy'), 
             FT.output('cz') )
     fn = tvc.member_function('getTriViewColorDispType')
     fn.add_transformation(FT.output('mytype'))
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:11,代码来源:wrap_v3d_boost.py


示例9: wrap

    def wrap(self):
        mb = self.mb
        
        # Wrap everything in the "osg" namespace
        osgViewer = mb.namespace("osgViewer")
        osgViewer.include()

        mb.free_functions(lambda f: f.name.startswith("osgViewer")).include()

        wrap_call_policies(self.mb)

        # self.wrap_all_osg_referenced_noderive(osgViewer)
        self.wrap_all_osg_referenced(osgViewer)
        
        # Avoid infinite recursion runtime error by making some classes
        # non-overridable
        for cls_name in ["GraphicsWindowEmbedded", "Viewer", ]:
            expose_nonoverridable_ref_ptr_class(osgViewer.class_(cls_name))

        for cls in mb.classes(lambda c: c.name.endswith("Handler")):
            cls.member_functions("handle", allow_empty=True).exclude()
            cls.noncopyable = True
            
        self.wrap_viewerbase()
        self.wrap_view()
        self.wrap_keystone()
        self.wrap_screencapturehandler()
        
        # Handles all remaining W1009 warnings.
        # execution error W1009: The function takes as argument...
        osgViewer.class_("GraphicsWindow").member_function(
                "getWindowRectangle").add_transformation(
                    FT.output("x"),
                    FT.output("y"),
                    FT.output("width"),
                    FT.output("height"))
        osgViewer.class_("GraphicsWindow").member_function(
                "getSwapGroup").add_transformation(
                    FT.output("on"),
                    FT.output("group"),
                    FT.output("barrier"))
        osgViewer.class_("View").member_function(
                "getCameraContainingPosition").exclude()
                # .add_transformation(FT.output("local_x"), FT.output("local_y"))
        osgViewer.class_("DepthPartitionSettings").member_function(
                "getDepthRange").add_transformation(
                    # FT.output("view"),
                    FT.output("zNear"),
                    FT.output("zFar"))

        hide_nonpublic(mb)
        
        self.mb.build_code_creator(module_name='_osgViewer')
        self.mb.split_module(os.path.join(os.path.abspath('.'), 'generated_code'))
        # Create a file to indicate completion of wrapping script
        open(os.path.join(os.path.abspath('.'), 'generated_code', 'generate_module.stamp'), "w").close()
开发者ID:JaneliaSciComp,项目名称:osgpyplusplus,代码行数:56,代码来源:wrap_module.py


示例10: ManualTransformations

def ManualTransformations ( mb ):
    global_ns = mb.global_ns
    main_ns = global_ns # global_ns.namespace(  )
        
    def create_output( size ):
        return [ ft.output( i ) for i in range( size ) ]
  
    x = main_ns.mem_fun('::Opcode::PlanesCollider::PlanesAABBOverlap') 
    x.add_transformation(ft.output('out_clip_mask'))
    x.documentation = docit ("","Point center, Point extents, , udword in_clip_mask", "out_clip_mask")     
     
    x = main_ns.mem_fun('::IceMaths::IndexedTriangle::GetVRefs') 
    x.add_transformation(ft.output('vref0'),ft.output('vref1'),ft.output('vref2'))
    x.documentation = docit ("","ubyte edgenb", "vref0, vref1, vref2")      
 
    x = main_ns.mem_fun('::IceCore::Container::FindNext') 
    x.add_transformation(ft.inout('entry'))
    x.documentation = docit ("","container, entry", "entry, mode")      
    
    x = main_ns.mem_fun('::IceCore::Container::FindPrev') 
    x.add_transformation(ft.inout('entry'))
    x.documentation = docit ("","container, entry", "entry, mode")   
       
    x = main_ns.free_function('::IceCore::Compute3DCoords') 
    x.add_transformation(ft.output('u'),ft.output('v'),ft.output('w'))
    x.documentation = docit ("","i, nbu, nbu_nbv", "u,v,w")      

    x = main_ns.free_function('::IceCore::Compute2DCoords') 
    x.add_transformation(ft.output('u'),ft.output('v'))
    x.documentation = docit ("","i, nbu", "u,v") 
         
    x = main_ns.free_function('::IceCore::Swap') 
    x.add_transformation(ft.inout('x'),ft.inout('y'))
    x.documentation = docit ("","x,y", "x,y")      

    x = main_ns.free_function('::IceCore::SetLeastNBits') 
    x.add_transformation(ft.inout('x'))
    x.documentation = docit ("","x, n", "x") 
         
    x = main_ns.free_function('::IceCore::ZeroLeastSetBit') 
    x.add_transformation(ft.inout('n'))
    x.documentation = docit ("","n", "n")   
    
    x = main_ns.free_function('::IceCore::SpreadBits') 
    x.add_transformation(ft.inout('n'))
    x.documentation = docit ("","n", "n")  
        
    x = main_ns.free_function('::IceCore::ReverseBits') 
    x.add_transformation(ft.inout('n'))
    x.documentation = docit ("","n", "n")      
    
    x = main_ns.mem_fun('::IceMaths::AABB::ComputeOutline') 
    x.add_transformation(ft.inout('num'))
    
    x = main_ns.mem_fun('::IceMaths::AABB::ComputeBoxArea') 
    x.add_transformation(ft.inout('num'))
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:56,代码来源:generate_code.py


示例11: wrap_quaternion

 def wrap_quaternion(self):
     quat = self.mb.class_("Quat")
     have_getRotate = False  # Just wrap one version
     for fn in quat.member_functions("getRotate"):
         if len(fn.arguments) != 2:  # ignore 4-argument versions
             fn.exclude()
         elif have_getRotate:  # only accept the very first 2-argument version
             fn.exclude()
         else:
             # Only expose this one version of getRotate
             fn.add_transformation(FT.output("angle"), FT.output("vec"))
             # avoid ugly alias
             fn.transformations[-1].alias = fn.alias
             have_getRotate = True
开发者ID:cmbruns,项目名称:osgpyplusplus,代码行数:14,代码来源:wrap_module.py


示例12: Parse

 def Parse(self, mb):
     # Exclude everything, then add what we need
     # Otherwise we get very big source code and dll's
     mb.decls().exclude() 
     
     mb.free_function('NavMeshAvailable').include()
     mb.free_function('NavMeshTestHasArea').include()
     mb.free_function('NavMeshGetPathDistance').include()
     mb.free_function('NavMeshGetPositionNearestNavArea').include()
     mb.free_function('CreateNavArea').include()
     mb.free_function('CreateNavAreaByCorners').include()
     mb.free_function('DestroyNavArea').include()
     mb.free_function('RandomNavAreaPosition').include()
     mb.free_function('RandomNavAreaPositionWithin').include()
     mb.free_function('DestroyAllNavAreas').include()
     
     mb.free_function('GetActiveNavMesh').include()
     mb.free_function('GetEditingCursor').include()
     
     mb.free_function('GetNavAreaAt').include()
     mb.free_function('GetNavAreasAtBB').include()
     mb.free_function('SplitAreasAtBB').include()
     mb.free_function('SetAreasBlocked').include()
     mb.free_function('IsAreaBlocked').include()
     mb.free_function('IsBBCoveredByNavAreas').include()
     
     mb.free_function('TryMergeSurrounding').include()
     
     mb.free_function('GetHidingSpotsInRadius').include()
     mb.free_function('CreateHidingSpot').include()
     mb.free_function('CreateHidingSpot').add_transformation( FT.output('navareaid') )
     mb.free_function('DestroyHidingSpot').include()
     mb.free_function('DestroyHidingSpotByID').include()
     
开发者ID:detoxhby,项目名称:lambdawars,代码行数:33,代码来源:_navmesh.py


示例13: wrap_LocationSimple

 def wrap_LocationSimple(self):
     cls = self.mb.class_('LocationSimple')
     cls.include()
     # TODO - use only the float version of getCoord, 
     # ...and push arguments to return value.
     for fn in cls.member_functions('getCoord'):
         arg_t = fn.argument_types[0]
         if (arg_t.decl_string == "int &"):
             # fn.exclude() # don't want the int one
             fn_alias = 'getCoordInt'
         else:
             # want the float one
             fn_alias = 'getCoord'
         fn.add_transformation( 
                               FT.output('xx'), 
                               FT.output('yy'), 
                               FT.output('zz'),
                               alias = fn_alias )
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:18,代码来源:wrap_v3d_boost.py


示例14: wrap_view

 def wrap_view(self):
     cls = self.mb.namespace("osgViewer").class_("View")
     for ctor in cls.constructors():
         ctor.allow_implicit_conversion = False
     cls.constructors(arg_types=[None, None]).exclude()
     cls.member_functions("computeIntersections").exclude()
     # RuntimeWarning: to-Python converter for class osg::ref_ptr<struct View_wrapper> already registered; second conversion method ignored.
     expose_nonoverridable_ref_ptr_class(cls)
     inner = cls.class_("StereoSlaveCallback")
     inner.member_function("updateSlave").exclude() # link error
     # 1>..\..\..\..\src\modules\osgViewer\generated_code\View.pypp.cpp(171) : error C2039: 'StereoSlaveCallback_wrapper' : is not a member of 'View_wrapper'
     expose_nonoverridable_ref_ptr_class(inner)
     # Move output arguments to return value tuple
     if False: # TODO - transformation does not seem to work with protected destructor classes
         gccp = cls.member_function("getCameraContainingPosition")
         gccp.add_transformation(FT.output('local_x'), FT.output('local_y'),)
     # Avoid premature destruction of manipulator
     # WEIRD movie maker crashes when I use (2, 1) here but not (1, 2)
     # BUT also crashes when osg.Camera.setFinalDrawCallback() uses (1, 2) but not (2, 1).
     # Whatever
     cls.member_function("setCameraManipulator").call_policies = with_custodian_and_ward(1, 2) # not crash
开发者ID:cmbruns,项目名称:osgpyplusplus,代码行数:21,代码来源:wrap_module.py


示例15: test

 def test(self):
     mb = module_builder.module_builder_t(
             [ module_builder.create_text_fc( self.CLASS_DEF ) ]
             , gccxml_path=autoconfig.gccxml.executable )
     mb.namespace( name='::tester' ).include()
     x = mb.class_( 'x' )
     x.add_registration_code( '//hello world reg' )
     x.add_declaration_code( '//hello world decl' )
     nested = x.class_( 'x_nested' )
     nested.add_declaration_code( '//hello nested decl' )
     nested.add_registration_code( '//hello nested reg', False )
     mb.calldefs( 'check_overload' ).use_overload_macro = True
     mb.calldefs( 'get_opaque' ).call_policies \
       = module_builder.call_policies.return_value_policy( module_builder.call_policies.return_opaque_pointer )
     mb.class_( 'op_struct' ).exclude()
     mb.mem_fun( 'get_rate' ).call_policies \
         = module_builder.call_policies.return_value_policy( module_builder.call_policies.return_pointee_value )
     mb.mem_fun( 'get_size' ).add_transformation( ft.output(0) )
     mb.build_code_creator('x_class_multi')
     mb.split_module( autoconfig.build_dir
                     , [ mb.class_( '::tester::x' ) ]
                     , on_unused_file_found=lambda fpath: fpath
                     , use_files_sum_repository=True)
开发者ID:ChrisCarlsen,项目名称:tortuga,代码行数:23,代码来源:algorithms_tester.py


示例16: add_transformations

def add_transformations ( mb ):
    ns = mb.global_ns.namespace ('OgreNewt')
    
    def create_output( size ):
        return [ ft.output( i ) for i in range( size ) ]
   
    ns.mem_fun('::OgreNewt::Body::getPositionOrientation').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::Body::getMassMatrix').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::Body::getInvMass').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::Body::getFreezeThreshold').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::ConvexCollision::calculateInertialMatrix').add_transformation( *create_output(2) )
    
    ns.mem_fun('::OgreNewt::CustomJoint::pinAndDirToLocal') \
        .add_transformation(ft.output('localOrient0'), ft.output('localPos0'), ft.output('localOrient1'), ft.output('localPos1') )
    ns.mem_fun('::OgreNewt::CustomJoint::localToGlobal') \
        .add_transformation(ft.output('globalOrient'), ft.output('globalPos') )

    ns.mem_fun('::OgreNewt::Vehicle::Tire::getPositionOrientation').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::ContactCallback::getContactPositionAndNormal').add_transformation( *create_output(2) )
    ns.mem_fun('::OgreNewt::ContactCallback::getContactTangentDirections').add_transformation( *create_output(2) )
   
    ns.free_fun('CollisionRayCast').add_transformation( ft.output('retColID') )
    ns.free_fun('CollisionCollideContinue').add_transformation( ft.output('retTimeOfImpact') )
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:23,代码来源:generate_code.py


示例17: create_output

 def create_output( size ):
     return [ ft.output( i ) for i in range( size ) ]
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:2,代码来源:generate_code.py


示例18: ParseMatchmaking

 def ParseMatchmaking(self, mb):
     # The main matchmaking interface
     cls = mb.class_('ISteamMatchmaking')
     cls.include()
     cls.no_init = True
     cls.noncopyable = True
     cls.mem_funs().virtuality = 'not virtual'
     cls.mem_funs('GetLobbyGameServer').add_transformation(FT.output('punGameServerIP'), FT.output('punGameServerPort'), FT.output('psteamIDGameServer'))
     
     mb.free_function('PyGetLobbyDataByIndex').include()
     mb.free_function('PySendLobbyChatMsg').include()
     mb.free_function('PyGetLobbyChatEntry').include()
     
     mb.var('k_uAPICallInvalid').include()
     
     self.AddSteamCallResult('LobbyMatchList', 'LobbyMatchList_t')
     self.AddSteamCallResult('LobbyGameCreated', 'LobbyGameCreated_t')
     self.AddSteamCallResult('LobbyCreated', 'LobbyCreated_t')
     self.AddSteamCallResult('LobbyEnter', 'LobbyEnter_t')
     
     self.AddSteamCallback('LobbyChatUpdate', 'LobbyChatUpdate_t')
     self.AddSteamCallback('LobbyChatMsg', 'LobbyChatMsg_t')
     self.AddSteamCallback('LobbyDataUpdate', 'LobbyDataUpdate_t')
     
     # Servers matchmaking interface
     cls = mb.class_('PySteamMatchmakingServers')
     cls.include()
     cls.rename('SteamMatchmakingServers')
     
     cls = mb.class_('PySteamMatchmakingServerListResponse')
     cls.include()
     cls.rename('SteamMatchmakingServerListResponse')
     cls.mem_fun('PyServerResponded').rename('ServerResponded')
     cls.mem_fun('PyServerFailedToRespond').rename('ServerFailedToRespond')
     cls.mem_fun('PyRefreshComplete').rename('RefreshComplete')
     
     cls = mb.class_('gameserveritem_t')
     cls.include()
     cls.mem_fun('SetName').exclude()
     self.PythonfyVariables(cls)
     cls.var('m_szGameDir').exclude()
     cls.var('m_szMap').exclude()
     cls.var('m_szGameDescription').exclude()
     cls.var('m_szGameTags').exclude()
     
     cls = mb.class_('pygameserveritem_t')
     cls.include()
     self.PythonfyVariables(cls)
     self.AddProperty(cls, 'gamedir', 'GetGameDir')
     self.AddProperty(cls, 'map', 'GetMap')
     self.AddProperty(cls, 'gamedescription', 'GetGameDescription')
     self.AddProperty(cls, 'gametags', 'GetGameTags')
     
     cls = mb.class_('servernetadr_t')
     cls.include()
     cls.rename('servernetadr')
     
     cls = mb.class_('PySteamMatchmakingPingResponse')
     cls.include()
     cls.rename('SteamMatchmakingPingResponse')
     
     cls = mb.class_('PySteamMatchmakingPlayersResponse')
     cls.include()
     cls.rename('SteamMatchmakingPlayersResponse')
     
     cls = mb.class_('PySteamMatchmakingRulesResponse')
     cls.include()
     cls.rename('SteamMatchmakingRulesResponse')
     
     # Enums
     mb.enums('ELobbyType').include()
     mb.enums('ELobbyComparison').include()
     mb.enums('ELobbyDistanceFilter').include()
     mb.enums('EMatchMakingServerResponse').include()
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:74,代码来源:_steam.py


示例19: ParsePanel

    def ParsePanel(self, mb):
        # List of functions that should be overridable
        mb.mem_funs('SetVisible').virtuality = 'virtual'
        mb.mem_funs('SetParent').virtuality = 'virtual'
        mb.mem_funs('SetEnabled').virtuality = 'virtual'
        
        mb.mem_funs('SetBgColor').virtuality = 'virtual'
        mb.mem_funs('SetFgColor').virtuality = 'virtual'
        mb.mem_funs('SetCursor').virtuality = 'virtual'
        
        mb.mem_funs('InvalidateLayout').virtuality = 'virtual'
        
        mb.mem_funs('SetBorder').virtuality = 'virtual'
        mb.mem_funs('SetPaintBorderEnabled').virtuality = 'virtual'
        mb.mem_funs('SetPaintBackgroundEnabled').virtuality = 'virtual'
        mb.mem_funs('SetPaintEnabled').virtuality = 'virtual'
        mb.mem_funs('SetPaintBackgroundType').virtuality = 'virtual'
        mb.mem_funs('SetScheme').virtuality = 'virtual'
        
        mb.mem_funs('ApplySchemeSettings').virtuality = 'virtual'
        mb.mem_funs('OnCommand').virtuality = 'virtual'
        mb.mem_funs('OnMouseCaptureLost').virtuality = 'virtual'
        mb.mem_funs('OnSetFocus').virtuality = 'virtual'
        mb.mem_funs('OnKillFocus').virtuality = 'virtual'
        mb.mem_funs('OnDelete').virtuality = 'virtual'
        mb.mem_funs('OnThink').virtuality = 'virtual'
        mb.mem_funs('OnChildAdded').virtuality = 'virtual'
        mb.mem_funs('OnSizeChanged').virtuality = 'virtual'
        mb.mem_funs('OnTick').virtuality = 'virtual'
        
        mb.mem_funs('OnCursorMoved').virtuality = 'virtual'
        mb.mem_funs('OnCursorEntered').virtuality = 'virtual'
        mb.mem_funs('OnCursorExited').virtuality = 'virtual'
        mb.mem_funs('OnMousePressed').virtuality = 'virtual'
        mb.mem_funs('OnMouseDoublePressed').virtuality = 'virtual'
        mb.mem_funs('OnMouseReleased').virtuality = 'virtual'
        mb.mem_funs('OnMouseWheeled').virtuality = 'virtual'
        mb.mem_funs('OnMouseTriplePressed').virtuality = 'virtual'
        
        mb.mem_funs('OnKeyCodePressed').virtuality = 'virtual'
        mb.mem_funs('OnKeyCodeTyped').virtuality = 'virtual'
        mb.mem_funs('OnKeyCodeReleased').virtuality = 'virtual'
        mb.mem_funs('OnKeyFocusTicked').virtuality = 'virtual'
        mb.mem_funs('OnMouseFocusTicked').virtuality = 'virtual'
        
        mb.mem_funs('PaintBackground').virtuality = 'virtual'
        mb.mem_funs('Paint').virtuality = 'virtual'
        #mb.mem_funs('PaintBorder').virtuality = 'virtual' # TODO: Don't believe we are ever interested in painting borders in python
        mb.mem_funs('PaintBuildOverlay').virtuality = 'virtual'
        mb.mem_funs('PostChildPaint').virtuality = 'virtual'
        mb.mem_funs('PerformLayout').virtuality = 'virtual'
        
        mb.mem_funs('SetMouseInputEnabled').virtuality = 'virtual'
        mb.mem_funs('SetKeyBoardInputEnabled').virtuality = 'virtual'
        
        mb.mem_funs('SetDragEnabled').virtuality = 'virtual'
        
        mb.mem_funs('OnRequestFocus').virtuality = 'virtual'
        mb.mem_funs('OnScreenSizeChanged').virtuality = 'virtual'

        # Transformations
        mb.mem_funs( 'GetPos' ).add_transformation( FT.output('x'), FT.output('y') )
        mb.class_('Panel').mem_funs( 'GetSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        mb.class_('Panel').mem_funs( 'GetBounds' ).add_transformation( FT.output('x'), FT.output('y'), FT.output('wide'), FT.output('tall') )
        mb.mem_funs( 'GetMinimumSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        mb.mem_funs( 'LocalToScreen' ).add_transformation( FT.inout('x'), FT.inout('y') )
        mb.mem_funs( 'ScreenToLocal' ).add_transformation( FT.inout('x'), FT.inout('y') )
        mb.mem_funs( 'ParentLocalToScreen' ).add_transformation( FT.inout('x'), FT.inout('y') )
        mb.mem_funs( 'GetInset' ).add_transformation( FT.output('left'), FT.output('top'), FT.output('right'), FT.output('bottom') )
        mb.mem_funs( 'GetPaintSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        mb.mem_funs( 'GetClipRect' ).add_transformation( FT.output('x0'), FT.output('y0'), FT.output('x1'), FT.output('y1') )
        mb.mem_funs( 'GetPinOffset' ).add_transformation( FT.output('dx'), FT.output('dy') )
        mb.mem_funs( 'GetResizeOffset' ).add_transformation( FT.output('dx'), FT.output('dy') )
        mb.mem_funs( 'GetCornerTextureSize' ).add_transformation( FT.output('w'), FT.output('h') )    
        
        # Exclude list
        mb.mem_funs('QueryInterface').exclude()
        
        # We don't care about build mode, since we can easily reload modules in python
        # We also don't want the user to be able to call methods like Delete.
        mb.mem_funs('IsBuildModeEditable').exclude()
        mb.mem_funs('SetBuildModeEditable').exclude()
        mb.mem_funs('IsBuildModeDeletable').exclude()
        mb.mem_funs('SetBuildModeDeletable').exclude()
        mb.mem_funs('IsBuildModeActive').exclude()
        #mb.mem_funs('SetAutoDelete').exclude()
        #mb.mem_funs('IsAutoDeleteSet').exclude()
        mb.mem_funs('OnDelete').exclude()
        mb.mem_funs('MarkForDeletion').exclude()
        mb.mem_funs('SetBuildGroup').exclude()
        mb.mem_funs('IsBuildGroupEnabled').exclude()
        mb.mem_funs('CreateControlByName').exclude()
        
        mb.mem_funs('LoadKeyBindings').exclude()
        mb.mem_funs('SaveKeyBindingsToBuffer').exclude()
        mb.mem_funs('LookupBoundKeys').exclude()
        mb.mem_funs('OnKeyTyped').exclude()
        mb.mem_funs('HasHotkey').exclude()

        mb.mem_funs('GetDragData').exclude()
#.........这里部分代码省略.........
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:101,代码来源:_vguicontrols.py


示例20: ParseImageClasses

    def ParseImageClasses(self, mb):
        # IBorder
        cls = mb.class_('IBorder')
        cls.include()
        cls.mem_funs('ApplySchemeSettings').include()    
        cls.mem_funs('Paint').virtuality = 'pure virtual'
        cls.mem_funs('ApplySchemeSettings').virtuality = 'pure virtual'

        # IImage
        cls = mb.class_('IImage')
        cls.include()  
        cls.mem_funs( 'GetContentSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs( 'GetSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs('Paint').virtuality = 'pure virtual'
        
        # Image
        cls = mb.class_('Image')
        cls.include()
        #cls.mem_funs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
        cls.no_init = True
        #cls.calldefs().virtuality = 'not virtual' 
        cls.calldefs('Image').exclude()
        cls.mem_funs( 'Paint' ).exclude()
        cls.add_wrapper_code( 'virtual void Paint() {}' )    # Stub for wrapper class. Otherwise it will complain.
        cls.mem_funs( 'GetSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs( 'GetContentSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        
        # FIXME: Py++ is giving problems on some functions
        cls.mem_funs('SetPos').virtuality = 'not virtual'
        #cls.mem_funs('GetPos').virtuality = 'not virtual'
        #cls.mem_funs('GetSize').virtuality = 'not virtual'
        #cls.mem_funs('GetContentSize').virtuality = 'not virtual'
        cls.mem_funs('SetColor').virtuality = 'not virtual'
        cls.mem_funs('SetBkColor').virtuality = 'not virtual'
        cls.mem_funs('GetColor').virtuality = 'not virtual'
        
        cls.mem_funs('SetSize').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetColor').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetColor').virtuality = 'not virtual' 
        cls.mem_funs('DrawFilledRect').virtuality = 'not virtual' 
        cls.mem_funs('DrawOutlinedRect').virtuality = 'not virtual' 
        cls.mem_funs('DrawLine').virtuality = 'not virtual' 
        cls.mem_funs('DrawPolyLine').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetTextFont').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetTextColor').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetTextPos').virtuality = 'not virtual' 
        cls.mem_funs('DrawPrintText').virtuality = 'not virtual' 
        cls.mem_funs('DrawPrintText').virtuality = 'not virtual' 
        cls.mem_funs('DrawPrintChar').virtuality = 'not virtual' 
        cls.mem_funs('DrawPrintChar').virtuality = 'not virtual' 
        cls.mem_funs('DrawSetTexture').virtuality = 'not virtual' 
        cls.mem_funs('DrawTexturedRect').virtuality = 'not virtual' 
        
        # TextImage
        cls = mb.class_('TextImage')
        cls.include()
        cls.calldefs().virtuality = 'not virtual' 
        cls.mem_funs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
        #cls.calldefs('SetText', calldef_withtypes([pointer_t(const_t(declarated_t(wchar_t())))])).exclude()
        cls.mem_funs( 'GetContentSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs( 'GetDrawWidth' ).add_transformation( FT.output('width') )
        cls.mem_funs( 'SizeText' ).exclude()     # DECLARATION ONLY
        
        cls.mem_funs('GetText').exclude()
        cls.add_wrapper_code(
            'boost::python::object GetText() {\r\n' + \
            '    char buf[1025];\r\n' + \
            '    TextImage::GetText(buf, 1025);\r\n' + \
            '    return boost::python::object(buf);\r\n' + \
            '}'
        )
        cls.add_registration_code(
            'def( \r\n' + \
            '    "GetText"\r\n' + \
            '    , (boost::python::object ( TextImage_wrapper::* )())( &TextImage_wrapper::GetText ) )'
        )
        
        # BitmapImage
        cls = mb.class_('BitmapImage')
        cls.include()
        cls.calldefs().virtuality = 'not virtual' 
        if self.settings.branch == 'source2013':
            cls.mem_fun('SetBitmap').exclude()
        #cls.mem_funs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
        
        cls.calldefs('GetColor', calldef_withtypes([reference_t(declarated_t(int_t()))])).add_transformation(FT.output('r'), FT.output('g'), FT.output('b'), FT.output('a'))
        cls.mem_funs( 'GetSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        
        # CAvatarImage
        cls = mb.class_('CAvatarImage')
        cls.include()
        cls.calldefs().virtuality = 'not virtual' 
        cls.mem_funs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
        cls.rename('AvatarImage')
        cls.mem_funs( 'GetSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs( 'GetContentSize' ).add_transformation( FT.output('wide'), FT.output('tall') )
        cls.mem_funs( 'InitFromRGBA' ).exclude()
        
        mb.enum('EAvatarSize').include()
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:99,代码来源:_vguicontrols.py



注:本文中的pyplusplus.function_transformers.output函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python module_builder.module_builder_t函数代码示例发布时间:2022-05-27
下一篇:
Python pypipegraph.run_pipegraph函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap