@@ -518,7 +518,8 @@ static PyObject *Qd_OffsetRect(_self, _args)
518518 Rect r ;
519519 short dh ;
520520 short dv ;
521- if (!PyArg_ParseTuple (_args , "hh" ,
521+ if (!PyArg_ParseTuple (_args , "O&hh" ,
522+ PyMac_GetRect , & r ,
522523 & dh ,
523524 & dv ))
524525 return NULL ;
@@ -538,7 +539,8 @@ static PyObject *Qd_InsetRect(_self, _args)
538539 Rect r ;
539540 short dh ;
540541 short dv ;
541- if (!PyArg_ParseTuple (_args , "hh" ,
542+ if (!PyArg_ParseTuple (_args , "O&hh" ,
543+ PyMac_GetRect , & r ,
542544 & dh ,
543545 & dv ))
544546 return NULL ;
@@ -1654,7 +1656,8 @@ static PyObject *Qd_MapRect(_self, _args)
16541656 Rect r ;
16551657 Rect srcRect ;
16561658 Rect dstRect ;
1657- if (!PyArg_ParseTuple (_args , "O&O&" ,
1659+ if (!PyArg_ParseTuple (_args , "O&O&O&" ,
1660+ PyMac_GetRect , & r ,
16581661 PyMac_GetRect , & srcRect ,
16591662 PyMac_GetRect , & dstRect ))
16601663 return NULL ;
@@ -2208,6 +2211,108 @@ static PyObject *Qd_QDError(_self, _args)
22082211 return _res ;
22092212}
22102213
2214+ static PyObject * Qd_GetPattern (_self , _args )
2215+ PyObject * _self ;
2216+ PyObject * _args ;
2217+ {
2218+ PyObject * _res = NULL ;
2219+ PatHandle _rv ;
2220+ short patternID ;
2221+ if (!PyArg_ParseTuple (_args , "h" ,
2222+ & patternID ))
2223+ return NULL ;
2224+ _rv = GetPattern (patternID );
2225+ _res = Py_BuildValue ("O&" ,
2226+ ResObj_New , _rv );
2227+ return _res ;
2228+ }
2229+
2230+ static PyObject * Qd_GetCursor (_self , _args )
2231+ PyObject * _self ;
2232+ PyObject * _args ;
2233+ {
2234+ PyObject * _res = NULL ;
2235+ CursHandle _rv ;
2236+ short cursorID ;
2237+ if (!PyArg_ParseTuple (_args , "h" ,
2238+ & cursorID ))
2239+ return NULL ;
2240+ _rv = GetCursor (cursorID );
2241+ _res = Py_BuildValue ("O&" ,
2242+ ResObj_New , _rv );
2243+ return _res ;
2244+ }
2245+
2246+ static PyObject * Qd_GetPicture (_self , _args )
2247+ PyObject * _self ;
2248+ PyObject * _args ;
2249+ {
2250+ PyObject * _res = NULL ;
2251+ PicHandle _rv ;
2252+ short pictureID ;
2253+ if (!PyArg_ParseTuple (_args , "h" ,
2254+ & pictureID ))
2255+ return NULL ;
2256+ _rv = GetPicture (pictureID );
2257+ _res = Py_BuildValue ("O&" ,
2258+ ResObj_New , _rv );
2259+ return _res ;
2260+ }
2261+
2262+ static PyObject * Qd_DeltaPoint (_self , _args )
2263+ PyObject * _self ;
2264+ PyObject * _args ;
2265+ {
2266+ PyObject * _res = NULL ;
2267+ long _rv ;
2268+ Point ptA ;
2269+ Point ptB ;
2270+ if (!PyArg_ParseTuple (_args , "O&O&" ,
2271+ PyMac_GetPoint , & ptA ,
2272+ PyMac_GetPoint , & ptB ))
2273+ return NULL ;
2274+ _rv = DeltaPoint (ptA ,
2275+ ptB );
2276+ _res = Py_BuildValue ("l" ,
2277+ _rv );
2278+ return _res ;
2279+ }
2280+
2281+ static PyObject * Qd_ShieldCursor (_self , _args )
2282+ PyObject * _self ;
2283+ PyObject * _args ;
2284+ {
2285+ PyObject * _res = NULL ;
2286+ Rect shieldRect ;
2287+ Point offsetPt ;
2288+ if (!PyArg_ParseTuple (_args , "O&O&" ,
2289+ PyMac_GetRect , & shieldRect ,
2290+ PyMac_GetPoint , & offsetPt ))
2291+ return NULL ;
2292+ ShieldCursor (& shieldRect ,
2293+ offsetPt );
2294+ Py_INCREF (Py_None );
2295+ _res = Py_None ;
2296+ return _res ;
2297+ }
2298+
2299+ static PyObject * Qd_ScreenRes (_self , _args )
2300+ PyObject * _self ;
2301+ PyObject * _args ;
2302+ {
2303+ PyObject * _res = NULL ;
2304+ short scrnHRes ;
2305+ short scrnVRes ;
2306+ if (!PyArg_ParseTuple (_args , "" ))
2307+ return NULL ;
2308+ ScreenRes (& scrnHRes ,
2309+ & scrnVRes );
2310+ _res = Py_BuildValue ("hh" ,
2311+ scrnHRes ,
2312+ scrnVRes );
2313+ return _res ;
2314+ }
2315+
22112316static PyObject * Qd_TextFont (_self , _args )
22122317 PyObject * _self ;
22132318 PyObject * _args ;
@@ -2471,9 +2576,9 @@ static PyMethodDef Qd_methods[] = {
24712576 {"SetRect" , (PyCFunction )Qd_SetRect , 1 ,
24722577 "(short left, short top, short right, short bottom) -> (Rect r)" },
24732578 {"OffsetRect" , (PyCFunction )Qd_OffsetRect , 1 ,
2474- "(short dh, short dv) -> (Rect r)" },
2579+ "(Rect r, short dh, short dv) -> (Rect r)" },
24752580 {"InsetRect" , (PyCFunction )Qd_InsetRect , 1 ,
2476- "(short dh, short dv) -> (Rect r)" },
2581+ "(Rect r, short dh, short dv) -> (Rect r)" },
24772582 {"SectRect" , (PyCFunction )Qd_SectRect , 1 ,
24782583 "(Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect)" },
24792584 {"UnionRect" , (PyCFunction )Qd_UnionRect , 1 ,
@@ -2599,7 +2704,7 @@ static PyMethodDef Qd_methods[] = {
25992704 {"MapPt" , (PyCFunction )Qd_MapPt , 1 ,
26002705 "(Point pt, Rect srcRect, Rect dstRect) -> (Point pt)" },
26012706 {"MapRect" , (PyCFunction )Qd_MapRect , 1 ,
2602- "(Rect srcRect, Rect dstRect) -> (Rect r)" },
2707+ "(Rect r, Rect srcRect, Rect dstRect) -> (Rect r)" },
26032708 {"MapRgn" , (PyCFunction )Qd_MapRgn , 1 ,
26042709 "(RgnHandle rgn, Rect srcRect, Rect dstRect) -> None" },
26052710 {"MapPoly" , (PyCFunction )Qd_MapPoly , 1 ,
@@ -2662,6 +2767,18 @@ static PyMethodDef Qd_methods[] = {
26622767 "(short index, Boolean reserve) -> None" },
26632768 {"QDError" , (PyCFunction )Qd_QDError , 1 ,
26642769 "() -> (short _rv)" },
2770+ {"GetPattern" , (PyCFunction )Qd_GetPattern , 1 ,
2771+ "(short patternID) -> (PatHandle _rv)" },
2772+ {"GetCursor" , (PyCFunction )Qd_GetCursor , 1 ,
2773+ "(short cursorID) -> (CursHandle _rv)" },
2774+ {"GetPicture" , (PyCFunction )Qd_GetPicture , 1 ,
2775+ "(short pictureID) -> (PicHandle _rv)" },
2776+ {"DeltaPoint" , (PyCFunction )Qd_DeltaPoint , 1 ,
2777+ "(Point ptA, Point ptB) -> (long _rv)" },
2778+ {"ShieldCursor" , (PyCFunction )Qd_ShieldCursor , 1 ,
2779+ "(Rect shieldRect, Point offsetPt) -> None" },
2780+ {"ScreenRes" , (PyCFunction )Qd_ScreenRes , 1 ,
2781+ "() -> (short scrnHRes, short scrnVRes)" },
26652782 {"TextFont" , (PyCFunction )Qd_TextFont , 1 ,
26662783 "(short font) -> None" },
26672784 {"TextFace" , (PyCFunction )Qd_TextFace , 1 ,
0 commit comments