Did I find the right examples for you? yes no

All Samples(12)  |  Call(10)  |  Derive(0)  |  Import(2)

src/p/g/pgi-HEAD/pgi/codegen/ctypes_backend/main.py   pgi(Download)
 
from . import types_basic, types_container, types_interface, types_other
from .utils import registry, typeinfo_to_ctypes
 
 
    def _get_signature(self, args, ret, method, throws):
        if ret:
            restype = typeinfo_to_ctypes(ret.type, return_value=True)
        else:
            restype = None
 
        for arg in args:
            type_ = typeinfo_to_ctypes(arg.type)
            if arg.is_direction_out() and type_ != ctypes.c_void_p:
                type_ = ctypes.POINTER(type_)
    def get_callback(self, func, args, ret, is_signal=False):
        arg_types = [typeinfo_to_ctypes(a.type) for a in args]
        # skip the first arg, we pass the signal's object manually
        if is_signal:
            arg_types.insert(0, ctypes.c_void_p)
        ret_type = typeinfo_to_ctypes(ret.type)

src/p/g/pgi-HEAD/pgi/codegen/ctypes_backend/types_container.py   pgi(Download)
from pgi.clib.gir import GITypeTag, GIArrayType
from pgi.clib import glib
from .utils import BaseType, registry, typeinfo_to_ctypes
 
 
        item_in = self.var()
        item_out = p.pack_in(item_in)
        ctypes_type = typeinfo_to_ctypes(param_type)
 
        if out:
    def unpack(self, name, length):
        param_type = self.type.get_param_type(0)
        ctypes_type = typeinfo_to_ctypes(param_type)
 
        data = self.parse("""
        elif self.type.array_fixed_size != -1:
            param_type = self.type.get_param_type(0)
            ctypes_type = typeinfo_to_ctypes(param_type)
            length = self.type.array_fixed_size
 
    def unpack(self, name):
        param_type = self.type.get_param_type(0)
        ctypes_type = typeinfo_to_ctypes(param_type)
 
        p = self.get_type(param_type)