Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | ** pymactoolbox.h - global routines exported by the toolbox modules |
| 3 | */ |
| 4 | |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
| 8 | |
Jack Jansen | 9f66b4a | 2001-05-19 12:32:39 +0000 | [diff] [blame] | 9 | #ifdef WITHOUT_FRAMEWORKS |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 10 | #include <Memory.h> |
| 11 | #include <Dialogs.h> |
| 12 | #include <Menus.h> |
| 13 | #include <Controls.h> |
| 14 | #include <Components.h> |
| 15 | #include <Lists.h> |
| 16 | #include <Movies.h> |
| 17 | #include <Errors.h> |
Jack Jansen | 9f66b4a | 2001-05-19 12:32:39 +0000 | [diff] [blame] | 18 | #else |
| 19 | #include <Carbon/Carbon.h> |
| 20 | #include <QuickTime/QuickTime.h> |
| 21 | #endif |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 22 | |
Jack Jansen | f57a4a2 | 2001-05-17 22:11:44 +0000 | [diff] [blame] | 23 | #ifdef USE_TOOLBOX_OBJECT_GLUE |
| 24 | /* |
| 25 | ** These macros are used in the module init code. If we use toolbox object glue |
| 26 | ** it sets the function pointer to point to the real function. |
| 27 | */ |
Jack Jansen | 0268ac8 | 2001-05-22 22:34:56 +0000 | [diff] [blame] | 28 | #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) { \ |
Jack Jansen | f57a4a2 | 2001-05-17 22:11:44 +0000 | [diff] [blame] | 29 | extern PyObject *(*PyMacGluePtr_##rtn)(object); \ |
| 30 | PyMacGluePtr_##rtn = _##rtn; \ |
| 31 | } |
Jack Jansen | 0268ac8 | 2001-05-22 22:34:56 +0000 | [diff] [blame] | 32 | #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) { \ |
| 33 | extern int (*PyMacGluePtr_##rtn)(PyObject *, object *); \ |
Jack Jansen | f57a4a2 | 2001-05-17 22:11:44 +0000 | [diff] [blame] | 34 | PyMacGluePtr_##rtn = _##rtn; \ |
| 35 | } |
| 36 | #else |
| 37 | /* |
| 38 | ** If we don't use toolbox object glue the init macros are empty. Moreover, we define |
| 39 | ** _xxx_New to be the same as xxx_New, and the code in mactoolboxglue isn't included. |
| 40 | */ |
Jack Jansen | 0268ac8 | 2001-05-22 22:34:56 +0000 | [diff] [blame] | 41 | #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) |
| 42 | #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) |
Jack Jansen | f57a4a2 | 2001-05-17 22:11:44 +0000 | [diff] [blame] | 43 | #endif /* USE_TOOLBOX_OBJECT_GLUE */ |
| 44 | |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 45 | /* AE exports */ |
| 46 | extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */ |
| 47 | extern int AEDesc_Convert(PyObject *, AppleEvent *); |
| 48 | |
| 49 | /* Cm exports */ |
| 50 | extern PyObject *CmpObj_New(Component); |
| 51 | extern int CmpObj_Convert(PyObject *, Component *); |
| 52 | extern PyObject *CmpInstObj_New(ComponentInstance); |
| 53 | extern int CmpInstObj_Convert(PyObject *, ComponentInstance *); |
| 54 | |
| 55 | /* Ctl exports */ |
| 56 | extern PyObject *CtlObj_New(ControlHandle); |
| 57 | extern int CtlObj_Convert(PyObject *, ControlHandle *); |
| 58 | |
| 59 | /* Dlg exports */ |
| 60 | extern PyObject *DlgObj_New(DialogPtr); |
| 61 | extern int DlgObj_Convert(PyObject *, DialogPtr *); |
Jack Jansen | add58f9 | 2001-02-09 15:59:18 +0000 | [diff] [blame] | 62 | extern PyObject *DlgObj_WhichDialog(DialogPtr); |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 63 | |
| 64 | /* Drag exports */ |
| 65 | extern PyObject *DragObj_New(DragReference); |
| 66 | extern int DragObj_Convert(PyObject *, DragReference *); |
| 67 | |
| 68 | /* List exports */ |
| 69 | extern PyObject *ListObj_New(ListHandle); |
| 70 | extern int ListObj_Convert(PyObject *, ListHandle *); |
| 71 | |
| 72 | /* Menu exports */ |
| 73 | extern PyObject *MenuObj_New(MenuHandle); |
| 74 | extern int MenuObj_Convert(PyObject *, MenuHandle *); |
| 75 | |
| 76 | /* Qd exports */ |
| 77 | extern PyObject *GrafObj_New(GrafPtr); |
| 78 | extern int GrafObj_Convert(PyObject *, GrafPtr *); |
| 79 | extern PyObject *BMObj_New(BitMapPtr); |
| 80 | extern int BMObj_Convert(PyObject *, BitMapPtr *); |
| 81 | extern PyObject *QdRGB_New(RGBColor *); |
| 82 | extern int QdRGB_Convert(PyObject *, RGBColor *); |
| 83 | |
Jack Jansen | 50bf148 | 2000-12-12 22:13:03 +0000 | [diff] [blame] | 84 | /* Qdoffs exports */ |
| 85 | extern PyObject *GWorldObj_New(GWorldPtr); |
| 86 | extern int GWorldObj_Convert(PyObject *, GWorldPtr *); |
| 87 | |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 88 | /* Qt exports */ |
| 89 | extern PyObject *TrackObj_New(Track); |
| 90 | extern int TrackObj_Convert(PyObject *, Track *); |
| 91 | extern PyObject *MovieObj_New(Movie); |
| 92 | extern int MovieObj_Convert(PyObject *, Movie *); |
| 93 | extern PyObject *MovieCtlObj_New(MovieController); |
Jack Jansen | f57a4a2 | 2001-05-17 22:11:44 +0000 | [diff] [blame] | 94 | extern int MovieCtlObj_Convert(PyObject *, MovieController *); |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 95 | extern PyObject *TimeBaseObj_New(TimeBase); |
| 96 | extern int TimeBaseObj_Convert(PyObject *, TimeBase *); |
| 97 | extern PyObject *UserDataObj_New(UserData); |
| 98 | extern int UserDataObj_Convert(PyObject *, UserData *); |
| 99 | extern PyObject *MediaObj_New(Media); |
| 100 | extern int MediaObj_Convert(PyObject *, Media *); |
| 101 | |
| 102 | /* Res exports */ |
| 103 | extern PyObject *ResObj_New(Handle); |
| 104 | extern int ResObj_Convert(PyObject *, Handle *); |
| 105 | extern PyObject *OptResObj_New(Handle); |
| 106 | extern int OptResObj_Convert(PyObject *, Handle *); |
| 107 | |
| 108 | /* TE exports */ |
| 109 | extern PyObject *TEObj_New(TEHandle); |
| 110 | extern int TEObj_Convert(PyObject *, TEHandle *); |
| 111 | |
| 112 | /* Win exports */ |
| 113 | extern PyObject *WinObj_New(WindowPtr); |
| 114 | extern int WinObj_Convert(PyObject *, WindowPtr *); |
| 115 | extern PyObject *WinObj_WhichWindow(WindowPtr); |
Jack Jansen | 9d8b96c | 2000-07-14 22:16:45 +0000 | [diff] [blame] | 116 | |
| 117 | |
| 118 | #ifdef __cplusplus |
| 119 | } |
| 120 | #endif |