]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | /*\r |
2 | ** pymactoolbox.h - globals defined in mactoolboxglue.c\r | |
3 | */\r | |
4 | #ifndef Py_PYMACTOOLBOX_H\r | |
5 | #define Py_PYMACTOOLBOX_H\r | |
6 | #ifdef __cplusplus\r | |
7 | extern "C" {\r | |
8 | #endif\r | |
9 | \r | |
10 | #include <Carbon/Carbon.h>\r | |
11 | \r | |
12 | #ifndef __LP64__\r | |
13 | #include <QuickTime/QuickTime.h>\r | |
14 | #endif /* !__LP64__ */\r | |
15 | \r | |
16 | /*\r | |
17 | ** Helper routines for error codes and such.\r | |
18 | */\r | |
19 | char *PyMac_StrError(int); /* strerror with mac errors */\r | |
20 | extern PyObject *PyMac_OSErrException; /* Exception for OSErr */\r | |
21 | PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */\r | |
22 | PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */\r | |
23 | PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */\r | |
24 | #ifndef __LP64__ \r | |
25 | extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert\r | |
26 | fsspec->path */\r | |
27 | #endif /* __LP64__ */\r | |
28 | \r | |
29 | /*\r | |
30 | ** These conversion routines are defined in mactoolboxglue.c itself.\r | |
31 | */\r | |
32 | int PyMac_GetOSType(PyObject *, OSType *); /* argument parser for OSType */\r | |
33 | PyObject *PyMac_BuildOSType(OSType); /* Convert OSType to PyObject */\r | |
34 | \r | |
35 | PyObject *PyMac_BuildNumVersion(NumVersion);/* Convert NumVersion to PyObject */\r | |
36 | \r | |
37 | int PyMac_GetStr255(PyObject *, Str255); /* argument parser for Str255 */\r | |
38 | PyObject *PyMac_BuildStr255(Str255); /* Convert Str255 to PyObject */\r | |
39 | PyObject *PyMac_BuildOptStr255(Str255); /* Convert Str255 to PyObject,\r | |
40 | NULL to None */\r | |
41 | \r | |
42 | int PyMac_GetRect(PyObject *, Rect *); /* argument parser for Rect */\r | |
43 | PyObject *PyMac_BuildRect(Rect *); /* Convert Rect to PyObject */\r | |
44 | \r | |
45 | int PyMac_GetPoint(PyObject *, Point *); /* argument parser for Point */\r | |
46 | PyObject *PyMac_BuildPoint(Point); /* Convert Point to PyObject */\r | |
47 | \r | |
48 | int PyMac_GetEventRecord(PyObject *, EventRecord *); /* argument parser for\r | |
49 | EventRecord */\r | |
50 | PyObject *PyMac_BuildEventRecord(EventRecord *); /* Convert EventRecord to\r | |
51 | PyObject */\r | |
52 | \r | |
53 | int PyMac_GetFixed(PyObject *, Fixed *); /* argument parser for Fixed */\r | |
54 | PyObject *PyMac_BuildFixed(Fixed); /* Convert Fixed to PyObject */\r | |
55 | int PyMac_Getwide(PyObject *, wide *); /* argument parser for wide */\r | |
56 | PyObject *PyMac_Buildwide(wide *); /* Convert wide to PyObject */\r | |
57 | \r | |
58 | /*\r | |
59 | ** The rest of the routines are implemented by extension modules. If they are\r | |
60 | ** dynamically loaded mactoolboxglue will contain a stub implementation of the\r | |
61 | ** routine, which imports the module, whereupon the module's init routine will\r | |
62 | ** communicate the routine pointer back to the stub.\r | |
63 | ** If USE_TOOLBOX_OBJECT_GLUE is not defined there is no glue code, and the\r | |
64 | ** extension modules simply declare the routine. This is the case for static\r | |
65 | ** builds (and could be the case for MacPython CFM builds, because CFM extension\r | |
66 | ** modules can reference each other without problems).\r | |
67 | */\r | |
68 | \r | |
69 | #ifdef USE_TOOLBOX_OBJECT_GLUE\r | |
70 | /*\r | |
71 | ** These macros are used in the module init code. If we use toolbox object glue\r | |
72 | ** it sets the function pointer to point to the real function.\r | |
73 | */\r | |
74 | #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn) { \\r | |
75 | extern PyObject *(*PyMacGluePtr_##rtn)(object); \\r | |
76 | PyMacGluePtr_##rtn = _##rtn; \\r | |
77 | }\r | |
78 | #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn) { \\r | |
79 | extern int (*PyMacGluePtr_##rtn)(PyObject *, object *); \\r | |
80 | PyMacGluePtr_##rtn = _##rtn; \\r | |
81 | }\r | |
82 | #else\r | |
83 | /*\r | |
84 | ** If we don't use toolbox object glue the init macros are empty. Moreover, we define\r | |
85 | ** _xxx_New to be the same as xxx_New, and the code in mactoolboxglue isn't included.\r | |
86 | */\r | |
87 | #define PyMac_INIT_TOOLBOX_OBJECT_NEW(object, rtn)\r | |
88 | #define PyMac_INIT_TOOLBOX_OBJECT_CONVERT(object, rtn)\r | |
89 | #endif /* USE_TOOLBOX_OBJECT_GLUE */\r | |
90 | \r | |
91 | /* macfs exports */\r | |
92 | #ifndef __LP64__\r | |
93 | int PyMac_GetFSSpec(PyObject *, FSSpec *); /* argument parser for FSSpec */\r | |
94 | PyObject *PyMac_BuildFSSpec(FSSpec *); /* Convert FSSpec to PyObject */\r | |
95 | #endif /* !__LP64__ */\r | |
96 | \r | |
97 | int PyMac_GetFSRef(PyObject *, FSRef *); /* argument parser for FSRef */\r | |
98 | PyObject *PyMac_BuildFSRef(FSRef *); /* Convert FSRef to PyObject */\r | |
99 | \r | |
100 | /* AE exports */\r | |
101 | extern PyObject *AEDesc_New(AppleEvent *); /* XXXX Why passed by address?? */\r | |
102 | extern PyObject *AEDesc_NewBorrowed(AppleEvent *);\r | |
103 | extern int AEDesc_Convert(PyObject *, AppleEvent *);\r | |
104 | \r | |
105 | /* Cm exports */\r | |
106 | extern PyObject *CmpObj_New(Component);\r | |
107 | extern int CmpObj_Convert(PyObject *, Component *);\r | |
108 | extern PyObject *CmpInstObj_New(ComponentInstance);\r | |
109 | extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);\r | |
110 | \r | |
111 | /* Ctl exports */\r | |
112 | #ifndef __LP64__\r | |
113 | extern PyObject *CtlObj_New(ControlHandle);\r | |
114 | extern int CtlObj_Convert(PyObject *, ControlHandle *);\r | |
115 | #endif /* !__LP64__ */\r | |
116 | \r | |
117 | /* Dlg exports */\r | |
118 | #ifndef __LP64__\r | |
119 | extern PyObject *DlgObj_New(DialogPtr);\r | |
120 | extern int DlgObj_Convert(PyObject *, DialogPtr *);\r | |
121 | extern PyObject *DlgObj_WhichDialog(DialogPtr);\r | |
122 | #endif /* !__LP64__ */\r | |
123 | \r | |
124 | /* Drag exports */\r | |
125 | #ifndef __LP64__\r | |
126 | extern PyObject *DragObj_New(DragReference);\r | |
127 | extern int DragObj_Convert(PyObject *, DragReference *);\r | |
128 | #endif /* !__LP64__ */\r | |
129 | \r | |
130 | /* List exports */\r | |
131 | #ifndef __LP64__\r | |
132 | extern PyObject *ListObj_New(ListHandle);\r | |
133 | extern int ListObj_Convert(PyObject *, ListHandle *);\r | |
134 | #endif /* !__LP64__ */\r | |
135 | \r | |
136 | /* Menu exports */\r | |
137 | #ifndef __LP64__\r | |
138 | extern PyObject *MenuObj_New(MenuHandle);\r | |
139 | extern int MenuObj_Convert(PyObject *, MenuHandle *);\r | |
140 | #endif /* !__LP64__ */\r | |
141 | \r | |
142 | /* Qd exports */\r | |
143 | #ifndef __LP64__\r | |
144 | extern PyObject *GrafObj_New(GrafPtr);\r | |
145 | extern int GrafObj_Convert(PyObject *, GrafPtr *);\r | |
146 | extern PyObject *BMObj_New(BitMapPtr);\r | |
147 | extern int BMObj_Convert(PyObject *, BitMapPtr *);\r | |
148 | extern PyObject *QdRGB_New(RGBColor *);\r | |
149 | extern int QdRGB_Convert(PyObject *, RGBColor *);\r | |
150 | #endif /* !__LP64__ */\r | |
151 | \r | |
152 | /* Qdoffs exports */\r | |
153 | #ifndef __LP64__\r | |
154 | extern PyObject *GWorldObj_New(GWorldPtr);\r | |
155 | extern int GWorldObj_Convert(PyObject *, GWorldPtr *);\r | |
156 | #endif /* !__LP64__ */\r | |
157 | \r | |
158 | /* Qt exports */\r | |
159 | #ifndef __LP64__\r | |
160 | extern PyObject *TrackObj_New(Track);\r | |
161 | extern int TrackObj_Convert(PyObject *, Track *);\r | |
162 | extern PyObject *MovieObj_New(Movie);\r | |
163 | extern int MovieObj_Convert(PyObject *, Movie *);\r | |
164 | extern PyObject *MovieCtlObj_New(MovieController);\r | |
165 | extern int MovieCtlObj_Convert(PyObject *, MovieController *);\r | |
166 | extern PyObject *TimeBaseObj_New(TimeBase);\r | |
167 | extern int TimeBaseObj_Convert(PyObject *, TimeBase *);\r | |
168 | extern PyObject *UserDataObj_New(UserData);\r | |
169 | extern int UserDataObj_Convert(PyObject *, UserData *);\r | |
170 | extern PyObject *MediaObj_New(Media);\r | |
171 | extern int MediaObj_Convert(PyObject *, Media *);\r | |
172 | #endif /* !__LP64__ */\r | |
173 | \r | |
174 | /* Res exports */\r | |
175 | extern PyObject *ResObj_New(Handle);\r | |
176 | extern int ResObj_Convert(PyObject *, Handle *);\r | |
177 | extern PyObject *OptResObj_New(Handle);\r | |
178 | extern int OptResObj_Convert(PyObject *, Handle *);\r | |
179 | \r | |
180 | /* TE exports */\r | |
181 | #ifndef __LP64__\r | |
182 | extern PyObject *TEObj_New(TEHandle);\r | |
183 | extern int TEObj_Convert(PyObject *, TEHandle *);\r | |
184 | #endif /* !__LP64__ */\r | |
185 | \r | |
186 | /* Win exports */\r | |
187 | #ifndef __LP64__\r | |
188 | extern PyObject *WinObj_New(WindowPtr);\r | |
189 | extern int WinObj_Convert(PyObject *, WindowPtr *);\r | |
190 | extern PyObject *WinObj_WhichWindow(WindowPtr);\r | |
191 | #endif /* !__LP64__ */\r | |
192 | \r | |
193 | /* CF exports */\r | |
194 | extern PyObject *CFObj_New(CFTypeRef);\r | |
195 | extern int CFObj_Convert(PyObject *, CFTypeRef *);\r | |
196 | extern PyObject *CFTypeRefObj_New(CFTypeRef);\r | |
197 | extern int CFTypeRefObj_Convert(PyObject *, CFTypeRef *);\r | |
198 | extern PyObject *CFStringRefObj_New(CFStringRef);\r | |
199 | extern int CFStringRefObj_Convert(PyObject *, CFStringRef *);\r | |
200 | extern PyObject *CFMutableStringRefObj_New(CFMutableStringRef);\r | |
201 | extern int CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *);\r | |
202 | extern PyObject *CFArrayRefObj_New(CFArrayRef);\r | |
203 | extern int CFArrayRefObj_Convert(PyObject *, CFArrayRef *);\r | |
204 | extern PyObject *CFMutableArrayRefObj_New(CFMutableArrayRef);\r | |
205 | extern int CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *);\r | |
206 | extern PyObject *CFDictionaryRefObj_New(CFDictionaryRef);\r | |
207 | extern int CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *);\r | |
208 | extern PyObject *CFMutableDictionaryRefObj_New(CFMutableDictionaryRef);\r | |
209 | extern int CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *);\r | |
210 | extern PyObject *CFURLRefObj_New(CFURLRef);\r | |
211 | extern int CFURLRefObj_Convert(PyObject *, CFURLRef *);\r | |
212 | extern int OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *);\r | |
213 | \r | |
214 | #ifdef __cplusplus\r | |
215 | }\r | |
216 | #endif\r | |
217 | #endif\r |