@@ -147,6 +147,37 @@ PyTypeObject GWorld_Type = {
147147/* --------------------- End object type GWorld --------------------- */
148148
149149
150+ static PyObject * Qdoffs_NewGWorld (_self , _args )
151+ PyObject * _self ;
152+ PyObject * _args ;
153+ {
154+ PyObject * _res = NULL ;
155+ QDErr _err ;
156+ GWorldPtr offscreenGWorld ;
157+ short PixelDepth ;
158+ Rect boundsRect ;
159+ CTabHandle cTable ;
160+ GDHandle aGDevice ;
161+ GWorldFlags flags ;
162+ if (!PyArg_ParseTuple (_args , "hO&O&O&l" ,
163+ & PixelDepth ,
164+ PyMac_GetRect , & boundsRect ,
165+ OptResObj_Convert , & cTable ,
166+ OptResObj_Convert , & aGDevice ,
167+ & flags ))
168+ return NULL ;
169+ _err = NewGWorld (& offscreenGWorld ,
170+ PixelDepth ,
171+ & boundsRect ,
172+ cTable ,
173+ aGDevice ,
174+ flags );
175+ if (_err != noErr ) return PyMac_Error (_err );
176+ _res = Py_BuildValue ("O&" ,
177+ GWorldObj_New , offscreenGWorld );
178+ return _res ;
179+ }
180+
150181static PyObject * Qdoffs_LockPixels (_self , _args )
151182 PyObject * _self ;
152183 PyObject * _args ;
@@ -178,6 +209,37 @@ static PyObject *Qdoffs_UnlockPixels(_self, _args)
178209 return _res ;
179210}
180211
212+ static PyObject * Qdoffs_UpdateGWorld (_self , _args )
213+ PyObject * _self ;
214+ PyObject * _args ;
215+ {
216+ PyObject * _res = NULL ;
217+ GWorldFlags _rv ;
218+ GWorldPtr offscreenGWorld ;
219+ short pixelDepth ;
220+ Rect boundsRect ;
221+ CTabHandle cTable ;
222+ GDHandle aGDevice ;
223+ GWorldFlags flags ;
224+ if (!PyArg_ParseTuple (_args , "hO&O&O&l" ,
225+ & pixelDepth ,
226+ PyMac_GetRect , & boundsRect ,
227+ OptResObj_Convert , & cTable ,
228+ OptResObj_Convert , & aGDevice ,
229+ & flags ))
230+ return NULL ;
231+ _rv = UpdateGWorld (& offscreenGWorld ,
232+ pixelDepth ,
233+ & boundsRect ,
234+ cTable ,
235+ aGDevice ,
236+ flags );
237+ _res = Py_BuildValue ("lO&" ,
238+ _rv ,
239+ GWorldObj_New , offscreenGWorld );
240+ return _res ;
241+ }
242+
181243static PyObject * Qdoffs_GetGWorld (_self , _args )
182244 PyObject * _self ;
183245 PyObject * _args ;
@@ -501,10 +563,14 @@ static PyObject *Qdoffs_PutPixMapBytes(_self, _args)
501563}
502564
503565static PyMethodDef Qdoffs_methods [] = {
566+ {"NewGWorld" , (PyCFunction )Qdoffs_NewGWorld , 1 ,
567+ "(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)" },
504568 {"LockPixels" , (PyCFunction )Qdoffs_LockPixels , 1 ,
505569 "(PixMapHandle pm) -> (Boolean _rv)" },
506570 {"UnlockPixels" , (PyCFunction )Qdoffs_UnlockPixels , 1 ,
507571 "(PixMapHandle pm) -> None" },
572+ {"UpdateGWorld" , (PyCFunction )Qdoffs_UpdateGWorld , 1 ,
573+ "(short pixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldFlags _rv, GWorldPtr offscreenGWorld)" },
508574 {"GetGWorld" , (PyCFunction )Qdoffs_GetGWorld , 1 ,
509575 "() -> (CGrafPtr port, GDHandle gdh)" },
510576 {"SetGWorld" , (PyCFunction )Qdoffs_SetGWorld , 1 ,
0 commit comments