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

Python declarations.reference_t函数代码示例

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

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



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

示例1: ParseEditablePanel

 def ParseEditablePanel(self, mb):
     focusnavgroup = mb.class_('FocusNavGroup')
     buildgroup = mb.class_('BuildGroup')
     excludetypes = [
         pointer_t(const_t(declarated_t(focusnavgroup))),
         pointer_t(declarated_t(focusnavgroup)),
         reference_t(declarated_t(focusnavgroup)),
         pointer_t(const_t(declarated_t(buildgroup))),
         pointer_t(declarated_t(buildgroup)),
         reference_t(declarated_t(buildgroup)),
     ]
     mb.calldefs(calldef_withtypes(excludetypes), allow_empty=True).exclude()
     
     mb.mem_funs( 'GetDialogVariables' ).call_policies = call_policies.return_value_policy(call_policies.return_by_value)
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:14,代码来源:_vguicontrols.py


示例2: __init__

 def __init__( self, function ):
     sealed_fun_controller_t.__init__( self, function )
     
     inst_arg_type = declarations.declarated_t( self.function.parent )
     if self.function.has_const:
         inst_arg_type = declarations.const_t( inst_arg_type )
     inst_arg_type = declarations.reference_t( inst_arg_type )
     
     self.__inst_arg = declarations.argument_t( name=self.register_variable_name( 'inst' )
                                                , decl_type=inst_arg_type )
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:10,代码来源:controllers.py


示例3: wrap_all_osg_referenced_noderive

 def wrap_all_osg_referenced_noderive(self, namespace):
     # Identify all classes derived from osg::Referenced, 
     # and set their boost::python held_type to "osg::ref_ptr<class>"
     osg = self.mb.namespace("osg")
     referenced = osg.class_("Referenced")
     referenced_derived = DerivedClasses(referenced)
     referenced_derived.include_module(namespace)
     copyop = osg.class_("CopyOp")
     # We are interested in constructors that take an argument of type "const osg::CopyOp&""
     copyop_arg_t = declarations.reference_t(declarations.const_t(declarations.declarated_t(copyop)))
     for cls in referenced_derived:
         expose_nonoverridable_ref_ptr_class(cls)
         # These copy constructors consistently cause trouble
         for ctor in cls.constructors(arg_types=[None, copyop_arg_t], allow_empty=True):
             ctor.exclude()
开发者ID:cmbruns,项目名称:osgpyplusplus,代码行数:15,代码来源:wrap_helpers.py


示例4: customize

    def customize( self, mb ):
        mb.global_ns.exclude()

        mb.free_function( 'create_randome_rationals' ).include()

        xxx = mb.class_( 'XXX' )
        xxx.include()
        xxx_ref = declarations.reference_t( declarations.const_t( declarations.declarated_t( xxx ) ) )
        oper = mb.global_ns.free_operator( '<<', arg_types=[None, xxx_ref] )
        oper.include()

        mb.class_( 'YYY' ).include()

        rational = mb.class_('rational<long>')
        rational.include()
        rational.alias = "pyrational"

        #Test query api.
        #artificial declarations come back
        #rational.operator( '=' )
        #rational.operator( name='operator=' )
        #rational.operator( symbol='=' )
        rational.operators( '=' )
        rational.operators( name='operator=' )
        rational.operators( symbol='=' )
        #artificial declarations come back
        #rational.member_operator( '=' )
        #rational.member_operator( name='operator=' )
        #rational.member_operator( symbol='=' )
        rational.member_operators( '=' )
        rational.member_operators( name='operator=' )
        rational.member_operators( symbol='=' )
        mb.global_ns.free_operators( '<<' )
        mb.global_ns.free_operators( name='operator<<' )
        mb.global_ns.free_operators( symbol='<<' )

        r_assign = rational.calldef( 'assign', recursive=False )
        r_assign.call_policies = call_policies.return_self()

        foperators = mb.free_operators( lambda decl: 'rational<long>' in decl.decl_string )
        foperators.include()

        bad_rational = mb.class_('bad_rational' )
        bad_rational.include()
        mb.namespace( 'Geometry' ).include()
        mb.namespace( 'Geometry' ).class_( 'VecOfInts' ).exclude()

        mb.namespace( 'Geometry2' ).include()
开发者ID:asford,项目名称:pyplusplus,代码行数:48,代码来源:operators_tester.py


示例5: customize

    def customize(self, mb):
        mb.global_ns.exclude()

        xxx = mb.class_("XXX")
        xxx.include()
        xxx_ref = declarations.reference_t(declarations.const_t(declarations.declarated_t(xxx)))
        oper = mb.global_ns.free_operator("<<", arg_types=[None, xxx_ref])
        oper.include()

        mb.class_("YYY").include()

        rational = mb.class_("rational<long>")
        rational.include()
        rational.alias = "pyrational"

        # Test query api.
        # artificial declarations come back
        # rational.operator( '=' )
        # rational.operator( name='operator=' )
        # rational.operator( symbol='=' )
        rational.operators("=")
        rational.operators(name="operator=")
        rational.operators(symbol="=")
        # artificial declarations come back
        # rational.member_operator( '=' )
        # rational.member_operator( name='operator=' )
        # rational.member_operator( symbol='=' )
        rational.member_operators("=")
        rational.member_operators(name="operator=")
        rational.member_operators(symbol="=")
        mb.global_ns.free_operators("<<")
        mb.global_ns.free_operators(name="operator<<")
        mb.global_ns.free_operators(symbol="<<")

        r_assign = rational.calldef("assign", recursive=False)
        r_assign.call_policies = call_policies.return_self()

        foperators = mb.free_operators(lambda decl: "rational<long>" in decl.decl_string)
        foperators.include()

        bad_rational = mb.class_("bad_rational")
        bad_rational.include()
开发者ID:venkatarajasekhar,项目名称:tortuga,代码行数:42,代码来源:operators_tester.py


示例6: wrap_one_call_policy

def wrap_one_call_policy(fn):
    rt = fn.return_type
    if fn.return_type.decl_string == "char const *":
        return # use default for strings
    if fn.return_type.decl_string == "char *":
        return # use default for strings
    elif fn.return_type.decl_string == "void *":
        return # use default for void pointers
    elif fn.return_type.decl_string == "::GLvoid const *":
        return # use default for void pointers
    parent_ref = declarations.reference_t(declarations.declarated_t(fn.parent))
    if declarations.is_reference(rt):
        # Need type without reference for next type checks
        nonref_rt = rt.base
        if declarations.is_arithmetic(nonref_rt) or declarations.is_enum(nonref_rt):
            # returning const& double can cause compile trouble if return_internal_reference is used
            if declarations.is_const(nonref_rt):
                fn.call_policies = return_value_policy(copy_const_reference)
                return
            # int& might need to be copy_non_const_reference...
            else:
                fn.call_policies = return_value_policy(copy_non_const_reference)
                return
        # Const string references should be copied to python strings
        if declarations.is_std_string(nonref_rt) and declarations.is_const(nonref_rt):
            fn.call_policies = return_value_policy(copy_const_reference)
            return
        # Returning reference to this same class looks like return_self() [does this always work?]
        if declarations.is_same(parent_ref, rt):
            fn.call_policies = return_self()
            return
    elif declarations.is_pointer(rt):
        # Clone methods
        if re.search(r'^clone', fn.name):
            fn.call_policies = return_value_policy(reference_existing_object)
            return
    else:
        return
    # Everything else probably returns an internal reference
    fn.call_policies = return_internal_reference()
    return
开发者ID:cmbruns,项目名称:osgpyplusplus,代码行数:41,代码来源:wrap_helpers.py


示例7: _get_setter_type

 def _get_setter_type(self):
     return declarations.free_function_type_t(
             return_type=declarations.void_t()
             , arguments_types=[ declarations.reference_t( self._get_class_inst_type() )
                                 , self._get_exported_var_type() ] )
开发者ID:CTrauma,项目名称:pypp11,代码行数:5,代码来源:member_variable.py


示例8: wrapped_class_type

 def wrapped_class_type( self ):
     wrapped_cls_type = declarations.declarated_t( self.declaration.parent )
     if declarations.is_const( self.declaration.type ):
         wrapped_cls_type = declarations.const_t( wrapped_cls_type )
     return declarations.reference_t( wrapped_cls_type )
开发者ID:CTrauma,项目名称:pypp11,代码行数:5,代码来源:member_variable.py


示例9: inst_arg_type

 def inst_arg_type( self, has_const ):
     inst_arg_type = declarations.declarated_t( self.declaration.parent )
     if has_const:
         inst_arg_type = declarations.const_t(inst_arg_type)
     inst_arg_type = declarations.reference_t(inst_arg_type)
     return inst_arg_type
开发者ID:CTrauma,项目名称:pypp11,代码行数:6,代码来源:member_variable.py


示例10: Parse


#.........这里部分代码省略.........
        cls.vars('m_Delta').rename('delta')
        cls.vars('m_StartOffset').rename('startoffset')
        cls.vars('m_Extents').rename('extents')
        cls.vars('m_IsRay').rename('isray')
        cls.vars('m_IsSwept').rename('isswept')
        
        # //--------------------------------------------------------------------------------------------------------------------------------
        # Trace Filters
        # By default, it's not possible to override TraceFilter methods
        cls = mb.class_('ITraceFilter')
        cls.include()
        cls.calldefs().exclude()
        
        tracefilters = [
            'CTraceFilter',
            'CTraceFilterEntitiesOnly',
            'CTraceFilterWorldOnly',
            'CTraceFilterWorldAndPropsOnly',
            'CTraceFilterHitAll',
            'CTraceFilterSimple',
            'CTraceFilterSkipTwoEntities',
            'CTraceFilterSimpleList',
            'CTraceFilterOnlyNPCsAndPlayer',
            'CTraceFilterNoNPCsOrPlayer',
            'CTraceFilterLOS',
            'CTraceFilterSkipClassname',
            'CTraceFilterSkipTwoClassnames',
            'CTraceFilterSimpleClassnameList',
            'CTraceFilterChain',
            'CPyTraceFilterSimple',
        ]
        for clsname in tracefilters:
            self.SetupTraceFilter(mb, clsname)
        
        mb.class_('CTraceFilterSimple').rename('CTraceFilterSimpleInternal')
        mb.class_('CPyTraceFilterSimple').rename('CTraceFilterSimple')
        
        mb.mem_funs('GetPassEntity').call_policies = call_policies.return_value_policy(call_policies.return_by_value) 
        
        mb.class_('csurface_t').include()
        
        # //--------------------------------------------------------------------------------------------------------------------------------
        # Collision utils
        mb.free_functions('PyIntersectRayWithTriangle').include()
        mb.free_functions('PyIntersectRayWithTriangle').rename('IntersectRayWithTriangle')
        mb.free_functions('ComputeIntersectionBarycentricCoordinates').include()
        mb.free_functions('IntersectRayWithRay').include()
        mb.free_functions('IntersectRayWithSphere').include()
        mb.free_functions('IntersectInfiniteRayWithSphere').include()
        mb.free_functions('IsSphereIntersectingCone').include()
        mb.free_functions('IntersectRayWithPlane').include()
        mb.free_functions('IntersectRayWithAAPlane').include()
        mb.free_functions('IntersectRayWithBox').include()
        mb.class_('BoxTraceInfo_t').include()
        mb.free_functions('IntersectRayWithBox').include()
        mb.free_functions('IntersectRayWithOBB').include()
        mb.free_functions('IsSphereIntersectingSphere').include()
        if self.settings.branch != 'swarm': # IsBoxIntersectingSphere gives a problem
            mb.free_functions('IsBoxIntersectingSphere').include()
        mb.free_functions('IsBoxIntersectingSphereExtents').include()
        mb.free_functions('IsRayIntersectingSphere').include()
        mb.free_functions('IsCircleIntersectingRectangle').include()
        mb.free_functions('IsOBBIntersectingOBB').include()
        mb.free_functions('IsPointInCone').include()
        mb.free_functions('IntersectTriangleWithPlaneBarycentric').include()
        mb.enum('QuadBarycentricRetval_t').include()
        mb.free_functions('PointInQuadToBarycentric').include()
        mb.free_functions('PointInQuadFromBarycentric').include()
        mb.free_functions('TexCoordInQuadFromBarycentric').include()
        mb.free_functions('ComputePointFromBarycentric').include()
        mb.free_functions('IsRayIntersectingOBB').include()
        mb.free_functions('ComputeSeparatingPlane').include()
        mb.free_functions('IsBoxIntersectingTriangle').include()
        #mb.free_functions('CalcClosestPointOnTriangle').include()
        mb.free_functions('OBBHasFullyContainedIntersectionWithQuad').include()
        mb.free_functions('RayHasFullyContainedIntersectionWithQuad').include()
        
        vectorcls = mb.class_('Vector')
        excludetypes = [
            declarated_t(vectorcls),
            reference_t(declarated_t(vectorcls)),
            reference_t(const_t(declarated_t(vectorcls))),
        ]
        vectormatcher =  calldef_withtypes( excludetypes )
        mb.free_functions('IsBoxIntersectingBox', vectormatcher).include() 
        mb.free_functions('IsBoxIntersectingBoxExtents', vectormatcher).include()   
        mb.free_functions('IsBoxIntersectingRay', vectormatcher).include()
        mb.free_functions('IsPointInBox', vectormatcher).include()
        
        # Prediction functions
        mb.free_function('GetSuppressHost').include()
        mb.free_function('GetSuppressHost').call_policies = call_policies.return_value_policy( call_policies.return_by_value )
        
        if self.isserver:
            self.ParseServer(mb)
        else:
            self.ParseClient(mb)
      
        # Finally apply common rules to all includes functions and classes, etc.
        self.ApplyCommonRules(mb)
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:101,代码来源:_utils.py


示例11: ParsePanels

    def ParsePanels(self, mb):
        # Panels
        cls = mb.class_('DeadPanel')
        cls.include()
        cls.mem_funs('NonZero', allow_empty=True).rename('__nonzero__')
        cls.mem_funs('Bool', allow_empty=True).rename('__bool__')
        
        # For each panel sub class we take some default actions
        for cls_name in self.panel_cls_list:
            cls = mb.class_(cls_name)

            # Include everything by default
            cls.include()
            cls.no_init = False
            
            # Be selective about we need to override
            cls.mem_funs().virtuality = 'not virtual' 
            
            #if cls_name not in ['AnimationController', 'Frame', 'ScrollBar', 'CBaseMinimap']:
            #    cls.mem_funs( matchers.access_type_matcher_t( 'protected' ) ).exclude()
            
            # By default exclude any subclass. These classes are likely controlled intern by the panel
            if cls.classes(allow_empty=True):
                cls.classes().exclude()
                
            self.AddVGUIConverter(mb, cls_name, self.novguilib, containsabstract=False)
            
            # # Add custom wrappers for functions who take keyvalues as input
            if self.novguilib:
                # No access to source code, so need to add message stuff for python here.
                cls.add_wrapper_code('virtual void OnMessage(const KeyValues *params, VPANEL fromPanel) {\r\n' +
                                     '    if( Panel_DispatchMessage( m_PyMessageMap, params, fromPanel ) )\r\n' +
                                     '        return;\r\n' +
                                     '    Panel::OnMessage(params, fromPanel);\r\n' +
                                     '}\r\n' + \
                                     '\r\n' + \
                                     'void RegMessageMethod( const char *message, boost::python::object method, int numParams=0, \r\n' + \
                                     '       const char *nameFirstParam="", int typeFirstParam=DATATYPE_VOID, \r\n' + \
                                     '       const char *nameSecondParam="", int typeSecondParam=DATATYPE_VOID ) { \r\n' + \
                                     '       py_message_entry_t entry;\r\n' + \
                                     '       entry.method = method;\r\n' + \
                                     '       entry.numParams = numParams;\r\n' + \
                                     '       entry.firstParamName = nameFirstParam;\r\n' + \
                                     '       entry.firstParamSymbol = KeyValuesSystem()->GetSymbolForString(nameFirstParam);\r\n' + \
                                     '       entry.firstParamType = typeFirstParam;\r\n' + \
                                     '       entry.secondParamName = nameSecondParam;\r\n' + \
                                     '       entry.secondParamSymbol = KeyValuesSystem()->GetSymbolForString(nameSecondParam);\r\n' + \
                                     '       entry.secondParamType = typeSecondParam;\r\n' + \
                                     '\r\n' + \
                                     '       GetPyMessageMap().Insert(message, entry);\r\n' + \
                                     '}\r\n' + \
                                     'virtual Panel *GetPanel() { return this; }\r\n'
                                     )
                cls.add_registration_code('def( "RegMessageMethod", &'+cls_name+'_wrapper::RegMessageMethod\r\n' + \
                                               ', ( bp::arg("message"), bp::arg("method"), bp::arg("numParams")=(int)(0), bp::arg("nameFirstParam")="", bp::arg("typeFirstParam")=int(::vgui::DATATYPE_VOID), bp::arg("nameSecondParam")="", bp::arg("typeSecondParam")=int(::vgui::DATATYPE_VOID) ))' )
                                               
                # Add stubs
                cls.add_wrapper_code('virtual void EnableSBuffer( bool bUseBuffer ) { PyPanel::EnableSBuffer( bUseBuffer ); }')
                cls.add_registration_code('def( "EnableSBuffer", &%(cls_name)s_wrapper::EnableSBuffer, bp::arg("bUseBuffer") )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual bool IsSBufferEnabled() { return PyPanel::IsSBufferEnabled(); }')
                cls.add_registration_code('def( "IsSBufferEnabled", &%(cls_name)s_wrapper::IsSBufferEnabled )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual void FlushSBuffer() { PyPanel::FlushSBuffer(); }')
                cls.add_registration_code('def( "FlushSBuffer", &%(cls_name)s_wrapper::FlushSBuffer )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual void SetFlushedByParent( bool bEnabled ) { PyPanel::SetFlushedByParent( bEnabled ); }')
                cls.add_registration_code('def( "SetFlushedByParent", &%(cls_name)s_wrapper::SetFlushedByParent, bp::arg("bEnabled") )' % {'cls_name' : cls_name})
    
        # Tweak Panels
        # Used by converters + special method added in the wrapper
        # Don't include here
        if not self.novguilib:
            mb.mem_funs('GetPySelf').exclude()
            mb.mem_funs('PyDestroyPanel').exclude()
            
        # Exclude message stuff. Maybe look into wrapping this in a nice way
        mb.mem_funs( 'AddToMap' ).exclude()
        mb.mem_funs( 'ChainToMap' ).exclude()
        mb.mem_funs( 'GetMessageMap' ).exclude()
        mb.mem_funs( 'AddToAnimationMap' ).exclude()
        mb.mem_funs( 'ChainToAnimationMap' ).exclude()
        mb.mem_funs( 'GetAnimMap' ).exclude()
        mb.mem_funs( 'KB_AddToMap' ).exclude()
        mb.mem_funs( 'KB_ChainToMap' ).exclude()
        mb.mem_funs( 'KB_AddBoundKey' ).exclude()
        mb.mem_funs( 'GetKBMap' ).exclude()
        mb.mem_funs( lambda decl: 'GetVar_' in decl.name ).exclude()
        
        mb.classes( lambda decl: 'PanelMessageFunc_' in decl.name ).exclude()
        mb.classes( lambda decl: '_Register' in decl.name ).exclude()
        mb.classes( lambda decl: 'PanelAnimationVar_' in decl.name ).exclude()
        mb.vars( lambda decl: '_register' in decl.name ).exclude()
        mb.vars( lambda decl: 'm_Register' in decl.name ).exclude()
        
        # Don't need the following:
        menu = mb.class_('Menu')
        keybindindcontexthandle = mb.enum('KeyBindingContextHandle_t')
        excludetypes = [
            pointer_t(const_t(declarated_t(menu))),
            pointer_t(declarated_t(menu)),
            reference_t(declarated_t(menu)),
            pointer_t(declarated_t(mb.class_('IPanelAnimationPropertyConverter'))),
#.........这里部分代码省略.........
开发者ID:Axitonium,项目名称:py-source-sdk-2013,代码行数:101,代码来源:_vguicontrols.py


示例12: 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


示例13: __read_reference_type

 def __read_reference_type(self, attrs):
     return declarations.reference_t(attrs[XML_AN_TYPE])
开发者ID:iMichka,项目名称:pygccxml,代码行数:2,代码来源:scanner.py


示例14: ParsePanels


#.........这里部分代码省略.........
            , PaintBackground_function_type(&::vgui::Panel::PaintBackground)
            , default_PaintBackground_function_type(&%(cls_name)s_wrapper::default_PaintBackground) );
    
    }
    { //::vgui::%(cls_name)s::InvalidateLayout
    
        typedef void ( ::vgui::Panel::*InvalidateLayout_function_type )( bool,bool ) ;
        typedef void ( %(cls_name)s_wrapper::*default_InvalidateLayout_function_type )( bool,bool ) ;
        
        %(cls_name)s_exposer.def( 
            "InvalidateLayout"
            , InvalidateLayout_function_type(&::vgui::Panel::InvalidateLayout)
            , default_InvalidateLayout_function_type(&%(cls_name)s_wrapper::default_InvalidateLayout)
            , ( bp::arg("layoutNow")=(bool)(false), bp::arg("reloadScheme")=(bool)(false) ) );
    
    }
    ''' % {'cls_name' : cls_name}, False)
            
            # By default exclude any subclass. These classes are likely controlled intern by the panel
            if cls.classes(allow_empty=True):
                cls.classes().exclude()
                
            self.AddVGUIConverter(mb, cls_name, self.novguilib, containsabstract=False)
            
            # # Add custom wrappers for functions who take keyvalues as input
            if self.novguilib:
                # No access to source code, so need to add message stuff for python here.
                cls.add_wrapper_code('virtual void OnMessage(const KeyValues *params, VPANEL fromPanel) {\r\n' +
                                     '    if( Panel_DispatchMessage( m_PyMessageMap, params, fromPanel ) )\r\n' +
                                     '        return;\r\n' +
                                     '    Panel::OnMessage(params, fromPanel);\r\n' +
                                     '}\r\n' + \
                                     '\r\n' + \
                                     'void RegMessageMethod( const char *message, boost::python::object method, int numParams=0, \r\n' + \
                                     '       const char *nameFirstParam="", int typeFirstParam=DATATYPE_VOID, \r\n' + \
                                     '       const char *nameSecondParam="", int typeSecondParam=DATATYPE_VOID ) { \r\n' + \
                                     '       py_message_entry_t entry;\r\n' + \
                                     '       entry.method = method;\r\n' + \
                                     '       entry.numParams = numParams;\r\n' + \
                                     '       entry.firstParamName = nameFirstParam;\r\n' + \
                                     '       entry.firstParamSymbol = KeyValuesSystem()->GetSymbolForString(nameFirstParam);\r\n' + \
                                     '       entry.firstParamType = typeFirstParam;\r\n' + \
                                     '       entry.secondParamName = nameSecondParam;\r\n' + \
                                     '       entry.secondParamSymbol = KeyValuesSystem()->GetSymbolForString(nameSecondParam);\r\n' + \
                                     '       entry.secondParamType = typeSecondParam;\r\n' + \
                                     '\r\n' + \
                                     '       GetPyMessageMap().Insert(message, entry);\r\n' + \
                                     '}\r\n' + \
                                     'virtual Panel *GetPanel() { return this; }\r\n'
                                     )
                cls.add_registration_code('def( "RegMessageMethod", &'+cls_name+'_wrapper::RegMessageMethod\r\n' + \
                                               ', ( bp::arg("message"), bp::arg("method"), bp::arg("numParams")=(int)(0), bp::arg("nameFirstParam")="", bp::arg("typeFirstParam")=int(::vgui::DATATYPE_VOID), bp::arg("nameSecondParam")="", bp::arg("typeSecondParam")=int(::vgui::DATATYPE_VOID) ))' )
                                               
                # Add stubs
                cls.add_wrapper_code('virtual void EnableSBuffer( bool bUseBuffer ) { PyPanel::EnableSBuffer( bUseBuffer ); }')
                cls.add_registration_code('def( "EnableSBuffer", &%(cls_name)s_wrapper::EnableSBuffer, bp::arg("bUseBuffer") )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual bool IsSBufferEnabled() { return PyPanel::IsSBufferEnabled(); }')
                cls.add_registration_code('def( "IsSBufferEnabled", &%(cls_name)s_wrapper::IsSBufferEnabled )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual void FlushSBuffer() { PyPanel::FlushSBuffer(); }')
                cls.add_registration_code('def( "FlushSBuffer", &%(cls_name)s_wrapper::FlushSBuffer )' % {'cls_name' : cls_name})
                cls.add_wrapper_code('virtual void SetFlushedByParent( bool bEnabled ) { PyPanel::SetFlushedByParent( bEnabled ); }')
                cls.add_registration_code('def( "SetFlushedByParent", &%(cls_name)s_wrapper::SetFlushedByParent, bp::arg("bEnabled") )' % {'cls_name' : cls_name})
    
        # Tweak Panels
        # Used by converters + special method added in the wrapper
        # Don't include here
        if not self.novguilib:
            mb.mem_funs('GetPySelf').exclude()
            mb.mem_funs('PyDestroyPanel').exclude()
            
        # Exclude message stuff. Maybe look into wrapping this in a nice way
        mb.mem_funs( 'AddToMap' ).exclude()
        mb.mem_funs( 'ChainToMap' ).exclude()
        mb.mem_funs( 'GetMessageMap' ).exclude()
        mb.mem_funs( 'AddToAnimationMap' ).exclude()
        mb.mem_funs( 'ChainToAnimationMap' ).exclude()
        mb.mem_funs( 'GetAnimMap' ).exclude()
        mb.mem_funs( 'KB_AddToMap' ).exclude()
        mb.mem_funs( 'KB_ChainToMap' ).exclude()
        mb.mem_funs( 'KB_AddBoundKey' ).exclude()
        mb.mem_funs( 'GetKBMap' ).exclude()
        mb.mem_funs( lambda decl: 'GetVar_' in decl.name ).exclude()
        
        mb.classes( lambda decl: 'PanelMessageFunc_' in decl.name ).exclude()
        mb.classes( lambda decl: '_Register' in decl.name ).exclude()
        mb.classes( lambda decl: 'PanelAnimationVar_' in decl.name ).exclude()
        mb.vars( lambda decl: '_register' in decl.name ).exclude()
        mb.vars( lambda decl: 'm_Register' in decl.name ).exclude()
        
        # Don't need the following:
        menu = mb.class_('Menu')
        keybindindcontexthandle = mb.enum('KeyBindingContextHandle_t')
        excludetypes = [
            pointer_t(const_t(declarated_t(menu))),
            pointer_t(declarated_t(menu)),
            reference_t(declarated_t(menu)),
            pointer_t(declarated_t(mb.class_('IPanelAnimationPropertyConverter'))),
            declarated_t(keybindindcontexthandle),
        ]
        mb.calldefs(calldef_withtypes(excludetypes), allow_empty=True).exclude()
开发者ID:detoxhby,项目名称:lambdawars,代码行数:101,代码来源:_vguicontrols.py


示例15: tt

 def tt( type_ ):
     type_ = declarations.remove_reference( type_ )
     type_ = declarations.remove_const( type_ )
     return declarations.reference_t( type_ )
开发者ID:CTrauma,项目名称:pypp11,代码行数:4,代码来源:protected_tester.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python declarations.remove_alias函数代码示例发布时间:2022-05-25
下一篇:
Python declarations.is_same函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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