# pyobjc / pyobjc-core / Doc / type-wrapper.rst

 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16 Ronald Oussoren 091f593 2013-01-22 Ronald Oussoren 848782e 2013-01-16   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 Generated types for C types =========================== .. py:currentmodule:: objc .. _type-struct: Structure types --------------- Structure are generated by :func:objc.createStructType and represent a C structure, such as *NSPoint* or *CGRect*. Structure types are all separate types, directly inheriting from :class:object, and behave like a mutable variant of :func:collections.namedtuple. The rest of this section describes :class:StructureType, which defines the API of the structure types but does not exist as a real type. .. class:: StructureType(\**kwds) A structure type. .. data:: _fields A tuple with the field names for this structure. Every name in *_fields* is present as an attribute of instances of the type. .. versionadded:: 2.5 .. data:: __typestr__ The type encoding for this structure type .. method:: __getitem__(idx) Return the *idx*-th element of the object. This also supports slices. .. method:: __setitem__(idx, value) Set the *idx*-th element of the object. This also supports slice, but the assignment is not allowed to change the number of elements. .. method:: copy() Returns a deep copy of the structure, that is all field values that are instances of a structure types are copied as well. .. method:: __pyobjc_copy__() An alias for :meth:copy, for use by PyObjC. .. method:: _replace(\**kwds) First create a copy of the object, then use the keyword arguments to replace the values of some attributes. .. versionadded:: 2.5 .. method:: _asdict() Returns a dictionary where the keys are the values in :data:_fields and the values are the corresponding attribute values. .. versionadded:: 2.5 .. _type-opaque: Opaque pointer types -------------------- Opaque pointer are created by :func:objc.createOpaquePointerType and represent opaque pointers or handles, such as values of type 'NSZone*'. Opaque pointers do not have further structure or behavior, they just exist as blobs of data that are returned from and passed to Objective-C functions or methods. The rest of this section describes :class:OpaquePointerType, which defines the API of the opaque pointer types but does not exist as a real type. .. class:: OpaquePointerType(cobject=None, c_void_p=None) An opaque pointer type. Values are usually created by the PyObjC bridge, but can be created manually using one of the keyword arguments: * *cobject*: A PyCapsule object with name "objc.__opaque__" that represents an opaque pointer value. * *c_void_p*: An instance of :class:ctypes.c_void_p or :class:int <__builtin__.int> that represents an opaque pointer value. .. versionchanged:: 2.5.1 added the *c_void_p* argument .. data:: __typestr__ The type encoding for the opaque pointer type .. data:: __pointer__ An integer with the raw pointer value .. method:: __c_void_p__() Returns a :class:ctypes.c_void_p instance with the raw pointer value .. versionadded:: 2.5 .. method:: __cobject__() Returns a PyCapsule object with name "objc.__opaque__" representing the raw pointer value. 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.