1/*!
2 * @header method-imp.h
3 * @abstract wrapper for IMP
4 *
5 * This module implements a wrapper for IMPs, that is the functions implementing
6 * Objective-C methods. The module also provides wrappers for the two Cocoa
7 * methods that return IMP's.
8 *
9 * The IMP interface has one odd feature: the selector argument should not
10 * be provided when calling it from Python. The reason for this is pragmatic:
11 * 1) Doesn't seem to usefull to pass a SEL
12 * 2) Makes the implementation easier
13 *
14 * Actually calling into Objective-C is done by code that is shared with the
15 * normal method calling mechanism.
16 *
17 * TODO:
18 * - Implement calling support in the special method wrappers
19 * - Implement support for assigning an IMP to another class
20 * - Implement support for using an IMP in inheritance
21 */
22#ifndef PyObjC_METHOD_IMP_H
23#define PyObjC_METHOD_IMP_H
24
25extern PyTypeObject PyObjCIMP_Type;
26
27#define PyObjCIMP_Check(obj) PyObject_TypeCheck(obj, &PyObjCIMP_Type)
28
29extern PyObject* PyObjCIMP_New(
30		IMP imp,
31		SEL sel,
32		PyObjC_CallFunc callfunc,
33		PyObjCMethodSignature* signature,
34		int flags);
35extern IMP PyObjCIMP_GetIMP(PyObject* self);
36extern PyObjC_CallFunc PyObjCIMP_GetCallFunc(PyObject* self);
37extern PyObjCMethodSignature* PyObjCIMP_GetSignature(PyObject* self);
38extern int PyObjCIMP_GetFlags(PyObject* self);
39extern SEL PyObjCIMP_GetSelector(PyObject* self);
40
41extern int PyObjCIMP_SetUpMethodWrappers(void);
42
43#endif /* PyObjC_METHOD_IMP_H */
44