@@ -677,6 +677,7 @@ typedef struct __MCStream *MCStreamRef;
677677typedef struct __MCProperList *MCProperListRef;
678678typedef struct __MCForeignValue *MCForeignValueRef;
679679typedef struct __MCJavaObject *MCJavaObjectRef;
680+ typedef struct __MCObjcObject *MCObjcObjectRef;
680681
681682// Forward declaration
682683typedef struct __MCLocale * MCLocaleRef;
@@ -3415,6 +3416,58 @@ MC_DLLEXPORT bool MCProperListEndsWithList(MCProperListRef list, MCProperListRef
34153416MC_DLLEXPORT bool MCProperListIsListOfType (MCProperListRef list, MCValueTypeCode p_type);
34163417MC_DLLEXPORT bool MCProperListIsHomogeneous (MCProperListRef list, MCValueTypeCode& r_type);
34173418
3419+ // //////////////////////////////////////////////////////////////////////////////
3420+ //
3421+ // OBJC DEFINITIONS
3422+ //
3423+
3424+ /* The ObjcObject type manages the lifetime of the obj-c object it contains.
3425+ * Specifcally, it sends 'release' to the object when the ObjcObject is dropped */
3426+ MC_DLLEXPORT extern MCTypeInfoRef kMCObjcObjectTypeInfo ;
3427+ MC_DLLEXPORT MCTypeInfoRef MCObjcObjectTypeInfo (void ) ATTRIBUTE_PURE;
3428+
3429+ /* The ObjcId type describes an id which is passed into, or out of an obj-c
3430+ * method with no implicit action on its reference count. */
3431+ MC_DLLEXPORT extern MCTypeInfoRef kMCObjcIdTypeInfo ;
3432+ MC_DLLEXPORT MCTypeInfoRef MCObjcIdTypeInfo (void ) ATTRIBUTE_PURE;
3433+
3434+ /* The ObjcRetainedId type describes an id which is passed into, or out of an
3435+ * obj-c method and is expected to already have been retained. (i.e. the
3436+ * caller or callee expects to receive it with +1 ref count). */
3437+ MC_DLLEXPORT extern MCTypeInfoRef kMCObjcRetainedIdTypeInfo ;
3438+ MC_DLLEXPORT MCTypeInfoRef MCObjcRetainedIdTypeInfo (void ) ATTRIBUTE_PURE;
3439+
3440+ /* The ObjcAutoreleasedId type describes an id which has been placed in the
3441+ * innermost autorelease pool before being returned to the caller. */
3442+ MC_DLLEXPORT extern MCTypeInfoRef kMCObjcAutoreleasedIdTypeInfo ;
3443+ MC_DLLEXPORT MCTypeInfoRef MCObjcAutoreleasedIdTypeInfo (void ) ATTRIBUTE_PURE;
3444+
3445+ /* The ObjcObjectCreateWithId function creates an ObjcObject out of a raw id
3446+ * value, retaining it to make sure it owns a reference to it. */
3447+ MC_DLLEXPORT bool MCObjcObjectCreateWithId (void *value, MCObjcObjectRef& r_obj);
3448+
3449+ /* The ObjcObjectCreateWithId function creates an ObjcObject out of a raw id
3450+ * value, taking a +1 reference count from it (i.e. it assumes the value has
3451+ * already been retained before being called). */
3452+ MC_DLLEXPORT bool MCObjcObjectCreateWithRetainedId (void *value, MCObjcObjectRef& r_obj);
3453+
3454+ /* The ObjcObjectCreateWithAutoreleasedId function creates an ObjcObject out of
3455+ * a raw id value which is in the innermost autorelease pool. Currently this
3456+ * means that it retains it. */
3457+ MC_DLLEXPORT bool MCObjcObjectCreateWithAutoreleasedId (void *value, MCObjcObjectRef& r_obj);
3458+
3459+ /* The ObjcObjectGetId function returns the raw id value contained within
3460+ * an ObjcObject. The retain count of the id remains unchanged. */
3461+ MC_DLLEXPORT void *MCObjcObjectGetId (MCObjcObjectRef obj);
3462+
3463+ /* The ObjcObjectGetRetainedId function returns the raw id value contained within
3464+ * an ObjcObject. The id is retained before being returned. */
3465+ MC_DLLEXPORT void *MCObjcObjectGetRetainedId (MCObjcObjectRef obj);
3466+
3467+ /* The ObjcObjectGetAutoreleasedId function returns the raw id value contained within
3468+ * an ObjcObject. The id is autoreleased before being returned. */
3469+ MC_DLLEXPORT void *MCObjcObjectGetAutoreleasedId (MCObjcObjectRef obj);
3470+
34183471// //////////////////////////////////////////////////////////////////////////////
34193472
34203473enum MCPickleFieldType
0 commit comments