2001-08-23 11:02:09 -03:00
/* =========================== Module _Qd =========================== */
# include "Python.h"
2008-06-05 09:58:24 -03:00
# ifndef __LP64__
2001-08-23 11:02:09 -03:00
# include "pymactoolbox.h"
/* Macro to test whether a weak-loaded CFM function exists */
# define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
2010-05-09 12:15:40 -03:00
PyErr_SetString ( PyExc_NotImplementedError , \
" Not available in this shared library/OS version " ) ; \
return NULL ; \
2001-08-23 11:02:09 -03:00
} } while ( 0 )
# include <Carbon/Carbon.h>
# ifdef USE_TOOLBOX_OBJECT_GLUE
extern PyObject * _GrafObj_New ( GrafPtr ) ;
extern int _GrafObj_Convert ( PyObject * , GrafPtr * ) ;
extern PyObject * _BMObj_New ( BitMapPtr ) ;
extern int _BMObj_Convert ( PyObject * , BitMapPtr * ) ;
extern PyObject * _QdRGB_New ( RGBColorPtr ) ;
extern int _QdRGB_Convert ( PyObject * , RGBColorPtr ) ;
# define GrafObj_New _GrafObj_New
# define GrafObj_Convert _GrafObj_Convert
# define BMObj_New _BMObj_New
# define BMObj_Convert _BMObj_Convert
# define QdRGB_New _QdRGB_New
# define QdRGB_Convert _QdRGB_Convert
# endif
2002-07-17 13:30:39 -03:00
static PyObject * BMObj_NewCopied ( BitMapPtr ) ;
2001-08-23 11:02:09 -03:00
/*
* * Parse / generate RGB records
*/
PyObject * QdRGB_New ( RGBColorPtr itself )
{
2010-05-09 12:15:40 -03:00
return Py_BuildValue ( " lll " , ( long ) itself - > red , ( long ) itself - > green , ( long ) itself - > blue ) ;
2001-08-23 11:02:09 -03:00
}
2001-09-05 12:44:37 -03:00
int QdRGB_Convert ( PyObject * v , RGBColorPtr p_itself )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
long red , green , blue ;
2005-07-03 17:59:44 -03:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( v , " lll " , & red , & green , & blue ) )
return 0 ;
p_itself - > red = ( unsigned short ) red ;
p_itself - > green = ( unsigned short ) green ;
p_itself - > blue = ( unsigned short ) blue ;
return 1 ;
2001-08-23 11:02:09 -03:00
}
/*
* * Generate FontInfo records
*/
static
PyObject * QdFI_New ( FontInfo * itself )
{
2010-05-09 12:15:40 -03:00
return Py_BuildValue ( " hhhh " , itself - > ascent , itself - > descent ,
itself - > widMax , itself - > leading ) ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_Error ;
/* ---------------------- Object type GrafPort ---------------------- */
PyTypeObject GrafPort_Type ;
2002-12-19 17:24:35 -04:00
# define GrafObj_Check(x) ((x)->ob_type == &GrafPort_Type || PyObject_TypeCheck((x), &GrafPort_Type))
2001-08-23 11:02:09 -03:00
typedef struct GrafPortObject {
2010-05-09 12:15:40 -03:00
PyObject_HEAD
GrafPtr ob_itself ;
2001-08-23 11:02:09 -03:00
} GrafPortObject ;
PyObject * GrafObj_New ( GrafPtr itself )
{
2010-05-09 12:15:40 -03:00
GrafPortObject * it ;
if ( itself = = NULL ) return PyMac_Error ( resNotFound ) ;
it = PyObject_NEW ( GrafPortObject , & GrafPort_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
return ( PyObject * ) it ;
2001-08-23 11:02:09 -03:00
}
2005-07-03 17:59:44 -03:00
2001-09-04 19:19:18 -03:00
int GrafObj_Convert ( PyObject * v , GrafPtr * p_itself )
2001-08-23 11:02:09 -03:00
{
# if 1
2010-05-09 12:15:40 -03:00
{
WindowRef win ;
if ( WinObj_Convert ( v , & win ) & & v ) {
* p_itself = ( GrafPtr ) GetWindowPort ( win ) ;
return 1 ;
}
PyErr_Clear ( ) ;
}
2001-08-23 11:02:09 -03:00
# else
2010-05-09 12:15:40 -03:00
if ( DlgObj_Check ( v ) ) {
DialogRef dlg = ( DialogRef ) ( ( GrafPortObject * ) v ) - > ob_itself ;
* p_itself = ( GrafPtr ) GetWindowPort ( GetDialogWindow ( dlg ) ) ;
return 1 ;
}
if ( WinObj_Check ( v ) ) {
WindowRef win = ( WindowRef ) ( ( GrafPortObject * ) v ) - > ob_itself ;
* p_itself = ( GrafPtr ) GetWindowPort ( win ) ;
return 1 ;
}
# endif
if ( ! GrafObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " GrafPort required " ) ;
return 0 ;
}
* p_itself = ( ( GrafPortObject * ) v ) - > ob_itself ;
return 1 ;
2001-08-23 11:02:09 -03:00
}
static void GrafObj_dealloc ( GrafPortObject * self )
{
2010-05-09 12:15:40 -03:00
/* Cleanup of self->ob_itself goes here */
self - > ob_type - > tp_free ( ( PyObject * ) self ) ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_MacSetPort ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef MacSetPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacSetPort ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
MacSetPort ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2003-12-05 20:00:17 -04:00
static PyObject * GrafObj_QDSwapPort ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
CGrafPtr outOldPort ;
2003-12-05 20:00:17 -04:00
# ifndef QDSwapPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDSwapPort ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = QDSwapPort ( _self - > ob_itself ,
& outOldPort ) ;
_res = Py_BuildValue ( " bO& " ,
_rv ,
GrafObj_New , outOldPort ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsValidPort ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsValidPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsValidPort ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsValidPort ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPixMap ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPixMap
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPixMap ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortPixMap ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortBitMapForCopyBits ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
const BitMap * _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortBitMapForCopyBits
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortBitMapForCopyBits ) ;
2001-08-23 11:02:09 -03:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortBitMapForCopyBits ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
BMObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortBounds ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect rect ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortBounds
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortBounds ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPortBounds ( _self - > ob_itself ,
& rect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & rect ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortForeColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor foreColor ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortForeColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortForeColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPortForeColor ( _self - > ob_itself ,
& foreColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & foreColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortBackColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor backColor ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortBackColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortBackColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPortBackColor ( _self - > ob_itself ,
& backColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & backColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortOpColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor opColor ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortOpColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortOpColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPortOpColor ( _self - > ob_itself ,
& opColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & opColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortHiliteColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor hiliteColor ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortHiliteColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortHiliteColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPortHiliteColor ( _self - > ob_itself ,
& hiliteColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & hiliteColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortTextFont ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortTextFont
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortTextFont ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortTextFont ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortTextFace ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Style _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortTextFace
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortTextFace ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortTextFace ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortTextMode ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortTextMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortTextMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortTextMode ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortTextSize ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortTextSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortTextSize ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortTextSize ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortChExtra ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortChExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortChExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortChExtra ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortFracHPenLocation ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortFracHPenLocation
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortFracHPenLocation ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortFracHPenLocation ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortSpExtra ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Fixed _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortSpExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortSpExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortSpExtra ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPenVisibility ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPenVisibility
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPenVisibility ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortPenVisibility ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortVisibleRegion ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle _rv ;
RgnHandle visRgn ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortVisibleRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortVisibleRegion ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & visRgn ) )
return NULL ;
_rv = GetPortVisibleRegion ( _self - > ob_itself ,
visRgn ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortClipRegion ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle _rv ;
RgnHandle clipRgn ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortClipRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortClipRegion ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & clipRgn ) )
return NULL ;
_rv = GetPortClipRegion ( _self - > ob_itself ,
clipRgn ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortBackPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle _rv ;
PixPatHandle backPattern ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortBackPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortBackPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & backPattern ) )
return NULL ;
_rv = GetPortBackPixPat ( _self - > ob_itself ,
backPattern ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPenPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle _rv ;
PixPatHandle penPattern ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPenPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPenPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & penPattern ) )
return NULL ;
_rv = GetPortPenPixPat ( _self - > ob_itself ,
penPattern ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortFillPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle _rv ;
PixPatHandle fillPattern ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortFillPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortFillPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & fillPattern ) )
return NULL ;
_rv = GetPortFillPixPat ( _self - > ob_itself ,
fillPattern ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPenSize ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point penSize ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPenSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPenSize ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & penSize ) )
return NULL ;
GetPortPenSize ( _self - > ob_itself ,
& penSize ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , penSize ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPenMode ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt32 _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPenMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPenMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetPortPenMode ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_GetPortPenLocation ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point penLocation ;
2002-11-29 19:40:48 -04:00
# ifndef GetPortPenLocation
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPortPenLocation ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & penLocation ) )
return NULL ;
GetPortPenLocation ( _self - > ob_itself ,
& penLocation ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , penLocation ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsPortRegionBeingDefined ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsPortRegionBeingDefined
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortRegionBeingDefined ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortRegionBeingDefined ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsPortPictureBeingDefined ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsPortPictureBeingDefined
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortPictureBeingDefined ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortPictureBeingDefined ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsPortPolyBeingDefined ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsPortPolyBeingDefined
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortPolyBeingDefined ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortPolyBeingDefined ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsPortOffscreen ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsPortOffscreen
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortOffscreen ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortOffscreen ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_IsPortColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef IsPortColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortColor ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2003-12-05 20:00:17 -04:00
static PyObject * GrafObj_IsPortVisibleRegionEmpty ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2003-12-05 20:00:17 -04:00
# ifndef IsPortVisibleRegionEmpty
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortVisibleRegionEmpty ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortVisibleRegionEmpty ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_IsPortClipRegionEmpty ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2003-12-05 20:00:17 -04:00
# ifndef IsPortClipRegionEmpty
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsPortClipRegionEmpty ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = IsPortClipRegionEmpty ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SectRegionWithPortClipRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle ioRegion ;
2003-12-05 20:00:17 -04:00
# ifndef SectRegionWithPortClipRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SectRegionWithPortClipRegion ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & ioRegion ) )
return NULL ;
SectRegionWithPortClipRegion ( _self - > ob_itself ,
ioRegion ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SectRegionWithPortVisibleRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle ioRegion ;
2003-12-05 20:00:17 -04:00
# ifndef SectRegionWithPortVisibleRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SectRegionWithPortVisibleRegion ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & ioRegion ) )
return NULL ;
SectRegionWithPortVisibleRegion ( _self - > ob_itself ,
ioRegion ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SwapPortPicSaveHandle ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
Handle inPicSaveHdl ;
2003-12-05 20:00:17 -04:00
# ifndef SwapPortPicSaveHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SwapPortPicSaveHandle ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & inPicSaveHdl ) )
return NULL ;
_rv = SwapPortPicSaveHandle ( _self - > ob_itself ,
inPicSaveHdl ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SwapPortPolySaveHandle ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
Handle inPolySaveHdl ;
2003-12-05 20:00:17 -04:00
# ifndef SwapPortPolySaveHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SwapPortPolySaveHandle ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & inPolySaveHdl ) )
return NULL ;
_rv = SwapPortPolySaveHandle ( _self - > ob_itself ,
inPolySaveHdl ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SwapPortRegionSaveHandle ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
Handle inRegionSaveHdl ;
2003-12-05 20:00:17 -04:00
# ifndef SwapPortRegionSaveHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SwapPortRegionSaveHandle ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & inRegionSaveHdl ) )
return NULL ;
_rv = SwapPortRegionSaveHandle ( _self - > ob_itself ,
inRegionSaveHdl ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortBounds ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect rect ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortBounds
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortBounds ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & rect ) )
return NULL ;
SetPortBounds ( _self - > ob_itself ,
& rect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortOpColor ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor opColor ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortOpColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortOpColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & opColor ) )
return NULL ;
SetPortOpColor ( _self - > ob_itself ,
& opColor ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2003-12-05 20:00:17 -04:00
static PyObject * GrafObj_SetPortTextFont ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short txFont ;
2003-12-05 20:00:17 -04:00
# ifndef SetPortTextFont
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortTextFont ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& txFont ) )
return NULL ;
SetPortTextFont ( _self - > ob_itself ,
txFont ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SetPortTextSize ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short txSize ;
2003-12-05 20:00:17 -04:00
# ifndef SetPortTextSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortTextSize ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& txSize ) )
return NULL ;
SetPortTextSize ( _self - > ob_itself ,
txSize ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SetPortTextFace ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
StyleParameter face ;
2003-12-05 20:00:17 -04:00
# ifndef SetPortTextFace
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortTextFace ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& face ) )
return NULL ;
SetPortTextFace ( _self - > ob_itself ,
face ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_SetPortTextMode ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short mode ;
2003-12-05 20:00:17 -04:00
# ifndef SetPortTextMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortTextMode ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& mode ) )
return NULL ;
SetPortTextMode ( _self - > ob_itself ,
mode ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2003-12-05 20:00:17 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortVisibleRegion ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle visRgn ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortVisibleRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortVisibleRegion ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & visRgn ) )
return NULL ;
SetPortVisibleRegion ( _self - > ob_itself ,
visRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortClipRegion ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle clipRgn ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortClipRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortClipRegion ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & clipRgn ) )
return NULL ;
SetPortClipRegion ( _self - > ob_itself ,
clipRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortPenPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle penPattern ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortPenPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortPenPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & penPattern ) )
return NULL ;
SetPortPenPixPat ( _self - > ob_itself ,
penPattern ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortFillPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle penPattern ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortFillPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortFillPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & penPattern ) )
return NULL ;
SetPortFillPixPat ( _self - > ob_itself ,
penPattern ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortBackPixPat ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle backPattern ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortBackPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortBackPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & backPattern ) )
return NULL ;
SetPortBackPixPat ( _self - > ob_itself ,
backPattern ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortPenSize ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point penSize ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortPenSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortPenSize ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & penSize ) )
return NULL ;
SetPortPenSize ( _self - > ob_itself ,
penSize ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortPenMode ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt32 penMode ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortPenMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortPenMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& penMode ) )
return NULL ;
SetPortPenMode ( _self - > ob_itself ,
penMode ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_SetPortFracHPenLocation ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short pnLocHFrac ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortFracHPenLocation
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortFracHPenLocation ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& pnLocHFrac ) )
return NULL ;
SetPortFracHPenLocation ( _self - > ob_itself ,
pnLocHFrac ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_DisposePort ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef DisposePort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposePort ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
DisposePort ( _self - > ob_itself ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2003-12-05 20:00:17 -04:00
static PyObject * GrafObj_QDLocalToGlobalPoint ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point point ;
2003-12-05 20:00:17 -04:00
# ifndef QDLocalToGlobalPoint
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDLocalToGlobalPoint ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & point ) )
return NULL ;
QDLocalToGlobalPoint ( _self - > ob_itself ,
& point ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , point ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_QDGlobalToLocalPoint ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point point ;
2003-12-05 20:00:17 -04:00
# ifndef QDGlobalToLocalPoint
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDGlobalToLocalPoint ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & point ) )
return NULL ;
QDGlobalToLocalPoint ( _self - > ob_itself ,
& point ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , point ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_QDLocalToGlobalRect ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect bounds ;
2003-12-05 20:00:17 -04:00
# ifndef QDLocalToGlobalRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDLocalToGlobalRect ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
QDLocalToGlobalRect ( _self - > ob_itself ,
& bounds ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & bounds ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_QDGlobalToLocalRect ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect bounds ;
2003-12-05 20:00:17 -04:00
# ifndef QDGlobalToLocalRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDGlobalToLocalRect ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
QDGlobalToLocalRect ( _self - > ob_itself ,
& bounds ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & bounds ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_QDLocalToGlobalRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle _rv ;
RgnHandle region ;
2003-12-05 20:00:17 -04:00
# ifndef QDLocalToGlobalRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDLocalToGlobalRegion ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & region ) )
return NULL ;
_rv = QDLocalToGlobalRegion ( _self - > ob_itself ,
region ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
static PyObject * GrafObj_QDGlobalToLocalRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle _rv ;
RgnHandle region ;
2003-12-05 20:00:17 -04:00
# ifndef QDGlobalToLocalRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDGlobalToLocalRegion ) ;
2003-12-05 20:00:17 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & region ) )
return NULL ;
_rv = QDGlobalToLocalRegion ( _self - > ob_itself ,
region ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2003-12-05 20:00:17 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_QDIsPortBuffered ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef QDIsPortBuffered
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDIsPortBuffered ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = QDIsPortBuffered ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_QDIsPortBufferDirty ( GrafPortObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-11-29 19:40:48 -04:00
# ifndef QDIsPortBufferDirty
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDIsPortBufferDirty ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = QDIsPortBufferDirty ( _self - > ob_itself ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * GrafObj_QDFlushPortBuffer ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle region ;
2002-11-29 19:40:48 -04:00
# ifndef QDFlushPortBuffer
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDFlushPortBuffer ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
OptResObj_Convert , & region ) )
return NULL ;
QDFlushPortBuffer ( _self - > ob_itself ,
region ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * GrafObj_QDGetDirtyRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
OSStatus _err ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef QDGetDirtyRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDGetDirtyRegion ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
_err = QDGetDirtyRegion ( _self - > ob_itself ,
rgn ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * GrafObj_QDSetDirtyRegion ( GrafPortObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
OSStatus _err ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef QDSetDirtyRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDSetDirtyRegion ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
_err = QDSetDirtyRegion ( _self - > ob_itself ,
rgn ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyMethodDef GrafObj_methods [ ] = {
2010-05-09 12:15:40 -03:00
{ " MacSetPort " , ( PyCFunction ) GrafObj_MacSetPort , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " QDSwapPort " , ( PyCFunction ) GrafObj_QDSwapPort , 1 ,
PyDoc_STR ( " () -> (Boolean _rv, CGrafPtr outOldPort) " ) } ,
{ " IsValidPort " , ( PyCFunction ) GrafObj_IsValidPort , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " GetPortPixMap " , ( PyCFunction ) GrafObj_GetPortPixMap , 1 ,
PyDoc_STR ( " () -> (PixMapHandle _rv) " ) } ,
{ " GetPortBitMapForCopyBits " , ( PyCFunction ) GrafObj_GetPortBitMapForCopyBits , 1 ,
PyDoc_STR ( " () -> (const BitMap * _rv) " ) } ,
{ " GetPortBounds " , ( PyCFunction ) GrafObj_GetPortBounds , 1 ,
PyDoc_STR ( " () -> (Rect rect) " ) } ,
{ " GetPortForeColor " , ( PyCFunction ) GrafObj_GetPortForeColor , 1 ,
PyDoc_STR ( " () -> (RGBColor foreColor) " ) } ,
{ " GetPortBackColor " , ( PyCFunction ) GrafObj_GetPortBackColor , 1 ,
PyDoc_STR ( " () -> (RGBColor backColor) " ) } ,
{ " GetPortOpColor " , ( PyCFunction ) GrafObj_GetPortOpColor , 1 ,
PyDoc_STR ( " () -> (RGBColor opColor) " ) } ,
{ " GetPortHiliteColor " , ( PyCFunction ) GrafObj_GetPortHiliteColor , 1 ,
PyDoc_STR ( " () -> (RGBColor hiliteColor) " ) } ,
{ " GetPortTextFont " , ( PyCFunction ) GrafObj_GetPortTextFont , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortTextFace " , ( PyCFunction ) GrafObj_GetPortTextFace , 1 ,
PyDoc_STR ( " () -> (Style _rv) " ) } ,
{ " GetPortTextMode " , ( PyCFunction ) GrafObj_GetPortTextMode , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortTextSize " , ( PyCFunction ) GrafObj_GetPortTextSize , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortChExtra " , ( PyCFunction ) GrafObj_GetPortChExtra , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortFracHPenLocation " , ( PyCFunction ) GrafObj_GetPortFracHPenLocation , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortSpExtra " , ( PyCFunction ) GrafObj_GetPortSpExtra , 1 ,
PyDoc_STR ( " () -> (Fixed _rv) " ) } ,
{ " GetPortPenVisibility " , ( PyCFunction ) GrafObj_GetPortPenVisibility , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " GetPortVisibleRegion " , ( PyCFunction ) GrafObj_GetPortVisibleRegion , 1 ,
PyDoc_STR ( " (RgnHandle visRgn) -> (RgnHandle _rv) " ) } ,
{ " GetPortClipRegion " , ( PyCFunction ) GrafObj_GetPortClipRegion , 1 ,
PyDoc_STR ( " (RgnHandle clipRgn) -> (RgnHandle _rv) " ) } ,
{ " GetPortBackPixPat " , ( PyCFunction ) GrafObj_GetPortBackPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle backPattern) -> (PixPatHandle _rv) " ) } ,
{ " GetPortPenPixPat " , ( PyCFunction ) GrafObj_GetPortPenPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle penPattern) -> (PixPatHandle _rv) " ) } ,
{ " GetPortFillPixPat " , ( PyCFunction ) GrafObj_GetPortFillPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle fillPattern) -> (PixPatHandle _rv) " ) } ,
{ " GetPortPenSize " , ( PyCFunction ) GrafObj_GetPortPenSize , 1 ,
PyDoc_STR ( " (Point penSize) -> (Point penSize) " ) } ,
{ " GetPortPenMode " , ( PyCFunction ) GrafObj_GetPortPenMode , 1 ,
PyDoc_STR ( " () -> (SInt32 _rv) " ) } ,
{ " GetPortPenLocation " , ( PyCFunction ) GrafObj_GetPortPenLocation , 1 ,
PyDoc_STR ( " (Point penLocation) -> (Point penLocation) " ) } ,
{ " IsPortRegionBeingDefined " , ( PyCFunction ) GrafObj_IsPortRegionBeingDefined , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortPictureBeingDefined " , ( PyCFunction ) GrafObj_IsPortPictureBeingDefined , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortPolyBeingDefined " , ( PyCFunction ) GrafObj_IsPortPolyBeingDefined , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortOffscreen " , ( PyCFunction ) GrafObj_IsPortOffscreen , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortColor " , ( PyCFunction ) GrafObj_IsPortColor , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortVisibleRegionEmpty " , ( PyCFunction ) GrafObj_IsPortVisibleRegionEmpty , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " IsPortClipRegionEmpty " , ( PyCFunction ) GrafObj_IsPortClipRegionEmpty , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " SectRegionWithPortClipRegion " , ( PyCFunction ) GrafObj_SectRegionWithPortClipRegion , 1 ,
PyDoc_STR ( " (RgnHandle ioRegion) -> None " ) } ,
{ " SectRegionWithPortVisibleRegion " , ( PyCFunction ) GrafObj_SectRegionWithPortVisibleRegion , 1 ,
PyDoc_STR ( " (RgnHandle ioRegion) -> None " ) } ,
{ " SwapPortPicSaveHandle " , ( PyCFunction ) GrafObj_SwapPortPicSaveHandle , 1 ,
PyDoc_STR ( " (Handle inPicSaveHdl) -> (Handle _rv) " ) } ,
{ " SwapPortPolySaveHandle " , ( PyCFunction ) GrafObj_SwapPortPolySaveHandle , 1 ,
PyDoc_STR ( " (Handle inPolySaveHdl) -> (Handle _rv) " ) } ,
{ " SwapPortRegionSaveHandle " , ( PyCFunction ) GrafObj_SwapPortRegionSaveHandle , 1 ,
PyDoc_STR ( " (Handle inRegionSaveHdl) -> (Handle _rv) " ) } ,
{ " SetPortBounds " , ( PyCFunction ) GrafObj_SetPortBounds , 1 ,
PyDoc_STR ( " (Rect rect) -> None " ) } ,
{ " SetPortOpColor " , ( PyCFunction ) GrafObj_SetPortOpColor , 1 ,
PyDoc_STR ( " (RGBColor opColor) -> None " ) } ,
{ " SetPortTextFont " , ( PyCFunction ) GrafObj_SetPortTextFont , 1 ,
PyDoc_STR ( " (short txFont) -> None " ) } ,
{ " SetPortTextSize " , ( PyCFunction ) GrafObj_SetPortTextSize , 1 ,
PyDoc_STR ( " (short txSize) -> None " ) } ,
{ " SetPortTextFace " , ( PyCFunction ) GrafObj_SetPortTextFace , 1 ,
PyDoc_STR ( " (StyleParameter face) -> None " ) } ,
{ " SetPortTextMode " , ( PyCFunction ) GrafObj_SetPortTextMode , 1 ,
PyDoc_STR ( " (short mode) -> None " ) } ,
{ " SetPortVisibleRegion " , ( PyCFunction ) GrafObj_SetPortVisibleRegion , 1 ,
PyDoc_STR ( " (RgnHandle visRgn) -> None " ) } ,
{ " SetPortClipRegion " , ( PyCFunction ) GrafObj_SetPortClipRegion , 1 ,
PyDoc_STR ( " (RgnHandle clipRgn) -> None " ) } ,
{ " SetPortPenPixPat " , ( PyCFunction ) GrafObj_SetPortPenPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle penPattern) -> None " ) } ,
{ " SetPortFillPixPat " , ( PyCFunction ) GrafObj_SetPortFillPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle penPattern) -> None " ) } ,
{ " SetPortBackPixPat " , ( PyCFunction ) GrafObj_SetPortBackPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle backPattern) -> None " ) } ,
{ " SetPortPenSize " , ( PyCFunction ) GrafObj_SetPortPenSize , 1 ,
PyDoc_STR ( " (Point penSize) -> None " ) } ,
{ " SetPortPenMode " , ( PyCFunction ) GrafObj_SetPortPenMode , 1 ,
PyDoc_STR ( " (SInt32 penMode) -> None " ) } ,
{ " SetPortFracHPenLocation " , ( PyCFunction ) GrafObj_SetPortFracHPenLocation , 1 ,
PyDoc_STR ( " (short pnLocHFrac) -> None " ) } ,
{ " DisposePort " , ( PyCFunction ) GrafObj_DisposePort , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " QDLocalToGlobalPoint " , ( PyCFunction ) GrafObj_QDLocalToGlobalPoint , 1 ,
PyDoc_STR ( " (Point point) -> (Point point) " ) } ,
{ " QDGlobalToLocalPoint " , ( PyCFunction ) GrafObj_QDGlobalToLocalPoint , 1 ,
PyDoc_STR ( " (Point point) -> (Point point) " ) } ,
{ " QDLocalToGlobalRect " , ( PyCFunction ) GrafObj_QDLocalToGlobalRect , 1 ,
PyDoc_STR ( " () -> (Rect bounds) " ) } ,
{ " QDGlobalToLocalRect " , ( PyCFunction ) GrafObj_QDGlobalToLocalRect , 1 ,
PyDoc_STR ( " () -> (Rect bounds) " ) } ,
{ " QDLocalToGlobalRegion " , ( PyCFunction ) GrafObj_QDLocalToGlobalRegion , 1 ,
PyDoc_STR ( " (RgnHandle region) -> (RgnHandle _rv) " ) } ,
{ " QDGlobalToLocalRegion " , ( PyCFunction ) GrafObj_QDGlobalToLocalRegion , 1 ,
PyDoc_STR ( " (RgnHandle region) -> (RgnHandle _rv) " ) } ,
{ " QDIsPortBuffered " , ( PyCFunction ) GrafObj_QDIsPortBuffered , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " QDIsPortBufferDirty " , ( PyCFunction ) GrafObj_QDIsPortBufferDirty , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " QDFlushPortBuffer " , ( PyCFunction ) GrafObj_QDFlushPortBuffer , 1 ,
PyDoc_STR ( " (RgnHandle region) -> None " ) } ,
{ " QDGetDirtyRegion " , ( PyCFunction ) GrafObj_QDGetDirtyRegion , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " QDSetDirtyRegion " , ( PyCFunction ) GrafObj_QDSetDirtyRegion , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ NULL , NULL , 0 }
2002-11-29 19:40:48 -04:00
} ;
static PyObject * GrafObj_get_visRgn ( GrafPortObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
RgnHandle h = NewRgn ( ) ; /* XXXX wrong dispose routine */
return Py_BuildValue ( " O& " , ResObj_New , ( Handle ) GetPortVisibleRegion ( self - > ob_itself , h ) ) ;
2002-11-29 19:40:48 -04:00
}
# define GrafObj_set_visRgn NULL
static PyObject * GrafObj_get_clipRgn ( GrafPortObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
RgnHandle h = NewRgn ( ) ; /* XXXX wrong dispose routine */
return Py_BuildValue ( " O& " , ResObj_New , ( Handle ) GetPortClipRegion ( self - > ob_itself , h ) ) ;
2002-11-29 19:40:48 -04:00
}
# define GrafObj_set_clipRgn NULL
static PyGetSetDef GrafObj_getsetlist [ ] = {
2010-05-09 12:15:40 -03:00
{ " visRgn " , ( getter ) GrafObj_get_visRgn , ( setter ) GrafObj_set_visRgn , " Convenience attribute: return a copy of the visible region " } ,
{ " clipRgn " , ( getter ) GrafObj_get_clipRgn , ( setter ) GrafObj_set_clipRgn , " Convenience attribute: return a copy of the clipping region " } ,
{ NULL , NULL , NULL , NULL } ,
2002-11-29 19:40:48 -04:00
} ;
# define GrafObj_compare NULL
# define GrafObj_repr NULL
# define GrafObj_hash NULL
2002-12-03 19:40:22 -04:00
# define GrafObj_tp_init 0
# define GrafObj_tp_alloc PyType_GenericAlloc
2005-07-03 17:59:44 -03:00
static PyObject * GrafObj_tp_new ( PyTypeObject * type , PyObject * _args , PyObject * _kwds )
2002-12-03 19:40:22 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _self ;
GrafPtr itself ;
char * kw [ ] = { " itself " , 0 } ;
2002-12-03 19:40:22 -04:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTupleAndKeywords ( _args , _kwds , " O& " , kw , GrafObj_Convert , & itself ) ) return NULL ;
if ( ( _self = type - > tp_alloc ( type , 0 ) ) = = NULL ) return NULL ;
( ( GrafPortObject * ) _self ) - > ob_itself = itself ;
return _self ;
2002-12-03 19:40:22 -04:00
}
# define GrafObj_tp_free PyObject_Del
2002-11-29 19:40:48 -04:00
PyTypeObject GrafPort_Type = {
2010-05-09 12:15:40 -03:00
PyObject_HEAD_INIT ( NULL )
0 , /*ob_size*/
" _Qd.GrafPort " , /*tp_name*/
sizeof ( GrafPortObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) GrafObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) 0 , /*tp_getattr*/
( setattrfunc ) 0 , /*tp_setattr*/
( cmpfunc ) GrafObj_compare , /*tp_compare*/
( reprfunc ) GrafObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) GrafObj_hash , /*tp_hash*/
0 , /*tp_call*/
0 , /*tp_str*/
PyObject_GenericGetAttr , /*tp_getattro*/
PyObject_GenericSetAttr , /*tp_setattro */
0 , /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
0 , /*tp_doc*/
0 , /*tp_traverse*/
0 , /*tp_clear*/
0 , /*tp_richcompare*/
0 , /*tp_weaklistoffset*/
0 , /*tp_iter*/
0 , /*tp_iternext*/
GrafObj_methods , /* tp_methods */
0 , /*tp_members*/
GrafObj_getsetlist , /*tp_getset*/
0 , /*tp_base*/
0 , /*tp_dict*/
0 , /*tp_descr_get*/
0 , /*tp_descr_set*/
0 , /*tp_dictoffset*/
GrafObj_tp_init , /* tp_init */
GrafObj_tp_alloc , /* tp_alloc */
GrafObj_tp_new , /* tp_new */
GrafObj_tp_free , /* tp_free */
2002-11-29 19:40:48 -04:00
} ;
/* -------------------- End object type GrafPort -------------------- */
/* ----------------------- Object type BitMap ----------------------- */
PyTypeObject BitMap_Type ;
2002-12-19 17:24:35 -04:00
# define BMObj_Check(x) ((x)->ob_type == &BitMap_Type || PyObject_TypeCheck((x), &BitMap_Type))
2002-11-29 19:40:48 -04:00
typedef struct BitMapObject {
2010-05-09 12:15:40 -03:00
PyObject_HEAD
BitMapPtr ob_itself ;
PyObject * referred_object ;
BitMap * referred_bitmap ;
2002-11-29 19:40:48 -04:00
} BitMapObject ;
PyObject * BMObj_New ( BitMapPtr itself )
{
2010-05-09 12:15:40 -03:00
BitMapObject * it ;
if ( itself = = NULL ) return PyMac_Error ( resNotFound ) ;
it = PyObject_NEW ( BitMapObject , & BitMap_Type ) ;
if ( it = = NULL ) return NULL ;
it - > ob_itself = itself ;
it - > referred_object = NULL ;
it - > referred_bitmap = NULL ;
return ( PyObject * ) it ;
2002-11-29 19:40:48 -04:00
}
2005-07-03 17:59:44 -03:00
2002-11-29 19:40:48 -04:00
int BMObj_Convert ( PyObject * v , BitMapPtr * p_itself )
{
2010-05-09 12:15:40 -03:00
if ( ! BMObj_Check ( v ) )
{
PyErr_SetString ( PyExc_TypeError , " BitMap required " ) ;
return 0 ;
}
* p_itself = ( ( BitMapObject * ) v ) - > ob_itself ;
return 1 ;
2002-11-29 19:40:48 -04:00
}
static void BMObj_dealloc ( BitMapObject * self )
{
2010-05-09 12:15:40 -03:00
Py_XDECREF ( self - > referred_object ) ;
if ( self - > referred_bitmap ) free ( self - > referred_bitmap ) ;
self - > ob_type - > tp_free ( ( PyObject * ) self ) ;
2002-11-29 19:40:48 -04:00
}
static PyObject * BMObj_getdata ( BitMapObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
2010-05-09 12:15:40 -03:00
int from , length ;
char * cp ;
2002-11-29 19:40:48 -04:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " ii " , & from , & length ) )
return NULL ;
cp = _self - > ob_itself - > baseAddr + from ;
_res = PyString_FromStringAndSize ( cp , length ) ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * BMObj_putdata ( BitMapObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
2010-05-09 12:15:40 -03:00
int from , length ;
char * cp , * icp ;
2002-11-29 19:40:48 -04:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " is# " , & from , & icp , & length ) )
return NULL ;
cp = _self - > ob_itself - > baseAddr + from ;
memcpy ( cp , icp , length ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyMethodDef BMObj_methods [ ] = {
2010-05-09 12:15:40 -03:00
{ " getdata " , ( PyCFunction ) BMObj_getdata , 1 ,
PyDoc_STR ( " (int start, int size) -> string. Return bytes from the bitmap " ) } ,
{ " putdata " , ( PyCFunction ) BMObj_putdata , 1 ,
PyDoc_STR ( " (int start, string data). Store bytes into the bitmap " ) } ,
{ NULL , NULL , 0 }
2002-11-29 19:40:48 -04:00
} ;
static PyObject * BMObj_get_baseAddr ( BitMapObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
return PyInt_FromLong ( ( long ) self - > ob_itself - > baseAddr ) ;
2002-11-29 19:40:48 -04:00
}
# define BMObj_set_baseAddr NULL
static PyObject * BMObj_get_rowBytes ( BitMapObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
return PyInt_FromLong ( ( long ) self - > ob_itself - > rowBytes ) ;
2002-11-29 19:40:48 -04:00
}
# define BMObj_set_rowBytes NULL
static PyObject * BMObj_get_bounds ( BitMapObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
return Py_BuildValue ( " O& " , PyMac_BuildRect , & self - > ob_itself - > bounds ) ;
2002-11-29 19:40:48 -04:00
}
# define BMObj_set_bounds NULL
static PyObject * BMObj_get_bitmap_data ( BitMapObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
return PyString_FromStringAndSize ( ( char * ) self - > ob_itself , sizeof ( BitMap ) ) ;
2002-11-29 19:40:48 -04:00
}
# define BMObj_set_bitmap_data NULL
static PyObject * BMObj_get_pixmap_data ( BitMapObject * self , void * closure )
{
2010-05-09 12:15:40 -03:00
return PyString_FromStringAndSize ( ( char * ) self - > ob_itself , sizeof ( PixMap ) ) ;
2002-11-29 19:40:48 -04:00
}
# define BMObj_set_pixmap_data NULL
static PyGetSetDef BMObj_getsetlist [ ] = {
2010-05-09 12:15:40 -03:00
{ " baseAddr " , ( getter ) BMObj_get_baseAddr , ( setter ) BMObj_set_baseAddr , NULL } ,
{ " rowBytes " , ( getter ) BMObj_get_rowBytes , ( setter ) BMObj_set_rowBytes , NULL } ,
{ " bounds " , ( getter ) BMObj_get_bounds , ( setter ) BMObj_set_bounds , NULL } ,
{ " bitmap_data " , ( getter ) BMObj_get_bitmap_data , ( setter ) BMObj_set_bitmap_data , NULL } ,
{ " pixmap_data " , ( getter ) BMObj_get_pixmap_data , ( setter ) BMObj_set_pixmap_data , NULL } ,
{ NULL , NULL , NULL , NULL } ,
2002-11-29 19:40:48 -04:00
} ;
# define BMObj_compare NULL
# define BMObj_repr NULL
# define BMObj_hash NULL
2002-12-03 19:40:22 -04:00
# define BMObj_tp_init 0
# define BMObj_tp_alloc PyType_GenericAlloc
2005-07-03 17:59:44 -03:00
static PyObject * BMObj_tp_new ( PyTypeObject * type , PyObject * _args , PyObject * _kwds )
2002-12-03 19:40:22 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _self ;
BitMapPtr itself ;
char * kw [ ] = { " itself " , 0 } ;
2002-12-03 19:40:22 -04:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTupleAndKeywords ( _args , _kwds , " O& " , kw , BMObj_Convert , & itself ) ) return NULL ;
if ( ( _self = type - > tp_alloc ( type , 0 ) ) = = NULL ) return NULL ;
( ( BitMapObject * ) _self ) - > ob_itself = itself ;
return _self ;
2002-12-03 19:40:22 -04:00
}
# define BMObj_tp_free PyObject_Del
2002-11-29 19:40:48 -04:00
PyTypeObject BitMap_Type = {
2010-05-09 12:15:40 -03:00
PyObject_HEAD_INIT ( NULL )
0 , /*ob_size*/
" _Qd.BitMap " , /*tp_name*/
sizeof ( BitMapObject ) , /*tp_basicsize*/
0 , /*tp_itemsize*/
/* methods */
( destructor ) BMObj_dealloc , /*tp_dealloc*/
0 , /*tp_print*/
( getattrfunc ) 0 , /*tp_getattr*/
( setattrfunc ) 0 , /*tp_setattr*/
( cmpfunc ) BMObj_compare , /*tp_compare*/
( reprfunc ) BMObj_repr , /*tp_repr*/
( PyNumberMethods * ) 0 , /* tp_as_number */
( PySequenceMethods * ) 0 , /* tp_as_sequence */
( PyMappingMethods * ) 0 , /* tp_as_mapping */
( hashfunc ) BMObj_hash , /*tp_hash*/
0 , /*tp_call*/
0 , /*tp_str*/
PyObject_GenericGetAttr , /*tp_getattro*/
PyObject_GenericSetAttr , /*tp_setattro */
0 , /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE , /* tp_flags */
0 , /*tp_doc*/
0 , /*tp_traverse*/
0 , /*tp_clear*/
0 , /*tp_richcompare*/
0 , /*tp_weaklistoffset*/
0 , /*tp_iter*/
0 , /*tp_iternext*/
BMObj_methods , /* tp_methods */
0 , /*tp_members*/
BMObj_getsetlist , /*tp_getset*/
0 , /*tp_base*/
0 , /*tp_dict*/
0 , /*tp_descr_get*/
0 , /*tp_descr_set*/
0 , /*tp_dictoffset*/
BMObj_tp_init , /* tp_init */
BMObj_tp_alloc , /* tp_alloc */
BMObj_tp_new , /* tp_new */
BMObj_tp_free , /* tp_free */
2002-11-29 19:40:48 -04:00
} ;
/* --------------------- End object type BitMap --------------------- */
static PyObject * Qd_GetPort ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GrafPtr port ;
2002-11-29 19:40:48 -04:00
# ifndef GetPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPort ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPort ( & port ) ;
_res = Py_BuildValue ( " O& " ,
GrafObj_New , port ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GrafDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short device ;
2002-11-29 19:40:48 -04:00
# ifndef GrafDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GrafDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& device ) )
return NULL ;
GrafDevice ( device ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetPortBits ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMapPtr bm ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortBits
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortBits ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
BMObj_Convert , & bm ) )
return NULL ;
SetPortBits ( bm ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PortSize ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short width ;
short height ;
2002-11-29 19:40:48 -04:00
# ifndef PortSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PortSize ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& width ,
& height ) )
return NULL ;
PortSize ( width ,
height ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MovePortTo ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short leftGlobal ;
short topGlobal ;
2002-11-29 19:40:48 -04:00
# ifndef MovePortTo
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MovePortTo ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& leftGlobal ,
& topGlobal ) )
return NULL ;
MovePortTo ( leftGlobal ,
topGlobal ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetOrigin ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
2002-11-29 19:40:48 -04:00
# ifndef SetOrigin
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetOrigin ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
SetOrigin ( h ,
v ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetClip ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef SetClip
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetClip ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
SetClip ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetClip ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef GetClip
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetClip ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
GetClip ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ClipRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef ClipRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ClipRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
ClipRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_BackPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef BackPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( BackPat ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
BackPat ( pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InitCursor ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef InitCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InitCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
InitCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacSetCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Cursor * crsr__in__ ;
int crsr__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef MacSetCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacSetCursor ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & crsr__in__ , & crsr__in_len__ ) )
return NULL ;
if ( crsr__in_len__ ! = sizeof ( Cursor ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Cursor) " ) ;
goto crsr__error__ ;
}
MacSetCursor ( crsr__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
crsr__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_HideCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef HideCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( HideCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
HideCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacShowCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef MacShowCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacShowCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
MacShowCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ObscureCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef ObscureCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ObscureCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ObscureCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_HidePen ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef HidePen
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( HidePen ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
HidePen ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ShowPen ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef ShowPen
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ShowPen ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ShowPen ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetPen ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
2002-11-29 19:40:48 -04:00
# ifndef GetPen
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPen ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPen ( & pt ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetPenState ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PenState pnState__out__ ;
2002-11-29 19:40:48 -04:00
# ifndef GetPenState
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPenState ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetPenState ( & pnState__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & pnState__out__ , ( int ) sizeof ( PenState ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetPenState ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PenState * pnState__in__ ;
int pnState__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef SetPenState
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPenState ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & pnState__in__ , & pnState__in_len__ ) )
return NULL ;
if ( pnState__in_len__ ! = sizeof ( PenState ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(PenState) " ) ;
goto pnState__error__ ;
}
SetPenState ( pnState__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pnState__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PenSize ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short width ;
short height ;
2002-11-29 19:40:48 -04:00
# ifndef PenSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PenSize ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& width ,
& height ) )
return NULL ;
PenSize ( width ,
height ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PenMode ( PyObject * _self , PyObject * _args )
2001-12-18 11:39:38 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short mode ;
2002-11-29 19:40:48 -04:00
# ifndef PenMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PenMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& mode ) )
return NULL ;
PenMode ( mode ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PenPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef PenPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PenPat ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
PenPat ( pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PenNormal ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef PenNormal
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PenNormal ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
PenNormal ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MoveTo ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
2002-11-29 19:40:48 -04:00
# ifndef MoveTo
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MoveTo ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
MoveTo ( h ,
v ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Move ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef Move
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Move ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& dh ,
& dv ) )
return NULL ;
Move ( dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacLineTo ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
2002-11-29 19:40:48 -04:00
# ifndef MacLineTo
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacLineTo ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
MacLineTo ( h ,
v ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Line ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef Line
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Line ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& dh ,
& dv ) )
return NULL ;
Line ( dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ForeColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long color ;
2002-11-29 19:40:48 -04:00
# ifndef ForeColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ForeColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& color ) )
return NULL ;
ForeColor ( color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_BackColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long color ;
2002-11-29 19:40:48 -04:00
# ifndef BackColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( BackColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& color ) )
return NULL ;
BackColor ( color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ColorBit ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short whichBit ;
2002-11-29 19:40:48 -04:00
# ifndef ColorBit
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ColorBit ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& whichBit ) )
return NULL ;
ColorBit ( whichBit ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacSetRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short left ;
short top ;
short right ;
short bottom ;
2002-11-29 19:40:48 -04:00
# ifndef MacSetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacSetRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " hhhh " ,
& left ,
& top ,
& right ,
& bottom ) )
return NULL ;
MacSetRect ( & r ,
left ,
top ,
right ,
bottom ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacOffsetRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef MacOffsetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacOffsetRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& dh ,
& dv ) )
return NULL ;
MacOffsetRect ( & r ,
dh ,
dv ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * Qd_MacInsetRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef MacInsetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacInsetRect ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& dh ,
& dv ) )
return NULL ;
MacInsetRect ( & r ,
dh ,
dv ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * Qd_SectRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Rect src1 ;
Rect src2 ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef SectRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SectRect ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & src1 ,
PyMac_GetRect , & src2 ) )
return NULL ;
_rv = SectRect ( & src1 ,
& src2 ,
& dstRect ) ;
_res = Py_BuildValue ( " bO& " ,
_rv ,
PyMac_BuildRect , & dstRect ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacUnionRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect src1 ;
Rect src2 ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef MacUnionRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacUnionRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & src1 ,
PyMac_GetRect , & src2 ) )
return NULL ;
MacUnionRect ( & src1 ,
& src2 ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & dstRect ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacEqualRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Rect rect1 ;
Rect rect2 ;
2002-11-29 19:40:48 -04:00
# ifndef MacEqualRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacEqualRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & rect1 ,
PyMac_GetRect , & rect2 ) )
return NULL ;
_rv = MacEqualRect ( & rect1 ,
& rect2 ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EmptyRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef EmptyRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EmptyRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
_rv = EmptyRect ( & r ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacFrameRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef MacFrameRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacFrameRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
MacFrameRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PaintRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef PaintRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
PaintRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EraseRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef EraseRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EraseRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
EraseRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacInvertRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef MacInvertRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacInvertRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
MacInvertRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacFillRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef MacFillRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacFillRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
PyMac_GetRect , & r ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
MacFillRect ( & r ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FrameOval ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef FrameOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FrameOval ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
FrameOval ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PaintOval ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef PaintOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintOval ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
PaintOval ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EraseOval ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef EraseOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EraseOval ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
EraseOval ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InvertOval ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef InvertOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertOval ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
InvertOval ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * Qd_FillOval ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef FillOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillOval ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
PyMac_GetRect , & r ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillOval ( & r ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2002-11-29 19:40:48 -04:00
}
static PyObject * Qd_FrameRoundRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
2002-11-29 19:40:48 -04:00
# ifndef FrameRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FrameRoundRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ) )
return NULL ;
FrameRoundRect ( & r ,
ovalWidth ,
ovalHeight ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PaintRoundRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
2002-11-29 19:40:48 -04:00
# ifndef PaintRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintRoundRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ) )
return NULL ;
PaintRoundRect ( & r ,
ovalWidth ,
ovalHeight ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EraseRoundRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
2002-11-29 19:40:48 -04:00
# ifndef EraseRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EraseRoundRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ) )
return NULL ;
EraseRoundRect ( & r ,
ovalWidth ,
ovalHeight ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InvertRoundRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
2002-11-29 19:40:48 -04:00
# ifndef InvertRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertRoundRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ) )
return NULL ;
InvertRoundRect ( & r ,
ovalWidth ,
ovalHeight ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillRoundRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef FillRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillRoundRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhs# " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillRoundRect ( & r ,
ovalWidth ,
ovalHeight ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FrameArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
2002-11-29 19:40:48 -04:00
# ifndef FrameArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FrameArc ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ) )
return NULL ;
FrameArc ( & r ,
startAngle ,
arcAngle ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PaintArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
2002-11-29 19:40:48 -04:00
# ifndef PaintArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintArc ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ) )
return NULL ;
PaintArc ( & r ,
startAngle ,
arcAngle ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EraseArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
2002-11-29 19:40:48 -04:00
# ifndef EraseArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EraseArc ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ) )
return NULL ;
EraseArc ( & r ,
startAngle ,
arcAngle ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InvertArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
2002-11-29 19:40:48 -04:00
# ifndef InvertArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertArc ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ) )
return NULL ;
InvertArc ( & r ,
startAngle ,
arcAngle ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef FillArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillArc ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhs# " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillArc ( & r ,
startAngle ,
arcAngle ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_NewRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef NewRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( NewRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = NewRgn ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_OpenRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef OpenRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OpenRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
OpenRgn ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CloseRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef CloseRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CloseRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & dstRgn ) )
return NULL ;
CloseRgn ( dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_BitMapToRegion ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
OSErr _err ;
RgnHandle region ;
BitMapPtr bMap ;
2002-11-29 19:40:48 -04:00
# ifndef BitMapToRegion
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( BitMapToRegion ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & region ,
BMObj_Convert , & bMap ) )
return NULL ;
_err = BitMapToRegion ( region ,
bMap ) ;
if ( _err ! = noErr ) return PyMac_Error ( _err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RgnToHandle ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle region ;
Handle flattenedRgnDataHdl ;
2002-11-29 19:40:48 -04:00
# ifndef RgnToHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RgnToHandle ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & region ,
ResObj_Convert , & flattenedRgnDataHdl ) )
return NULL ;
RgnToHandle ( region ,
flattenedRgnDataHdl ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposeRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef DisposeRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposeRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
DisposeRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacCopyRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgn ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacCopyRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacCopyRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & srcRgn ,
ResObj_Convert , & dstRgn ) )
return NULL ;
MacCopyRgn ( srcRgn ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetEmptyRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef SetEmptyRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetEmptyRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
SetEmptyRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacSetRectRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
short left ;
short top ;
short right ;
short bottom ;
2002-11-29 19:40:48 -04:00
# ifndef MacSetRectRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacSetRectRgn ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhhh " ,
ResObj_Convert , & rgn ,
& left ,
& top ,
& right ,
& bottom ) )
return NULL ;
MacSetRectRgn ( rgn ,
left ,
top ,
right ,
bottom ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RectRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef RectRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RectRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & rgn ,
PyMac_GetRect , & r ) )
return NULL ;
RectRgn ( rgn ,
& r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacOffsetRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef MacOffsetRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacOffsetRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
ResObj_Convert , & rgn ,
& dh ,
& dv ) )
return NULL ;
MacOffsetRgn ( rgn ,
dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InsetRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef InsetRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InsetRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
ResObj_Convert , & rgn ,
& dh ,
& dv ) )
return NULL ;
InsetRgn ( rgn ,
dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SectRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef SectRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SectRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
SectRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacUnionRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacUnionRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacUnionRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
MacUnionRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DiffRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef DiffRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DiffRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
DiffRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacXorRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacXorRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacXorRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
MacXorRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RectInRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Rect r ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef RectInRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RectInRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & r ,
ResObj_Convert , & rgn ) )
return NULL ;
_rv = RectInRgn ( & r ,
rgn ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacEqualRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
RgnHandle rgnA ;
RgnHandle rgnB ;
2002-11-29 19:40:48 -04:00
# ifndef MacEqualRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacEqualRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & rgnA ,
ResObj_Convert , & rgnB ) )
return NULL ;
_rv = MacEqualRgn ( rgnA ,
rgnB ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EmptyRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef EmptyRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EmptyRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
_rv = EmptyRgn ( rgn ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacFrameRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacFrameRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacFrameRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
MacFrameRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacPaintRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacPaintRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacPaintRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
MacPaintRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EraseRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef EraseRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EraseRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
EraseRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacInvertRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef MacInvertRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacInvertRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
MacInvertRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacFillRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef MacFillRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacFillRgn ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
ResObj_Convert , & rgn ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
MacFillRgn ( rgn ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ScrollRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short dh ;
short dv ;
RgnHandle updateRgn ;
2002-11-29 19:40:48 -04:00
# ifndef ScrollRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ScrollRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhO& " ,
PyMac_GetRect , & r ,
& dh ,
& dv ,
ResObj_Convert , & updateRgn ) )
return NULL ;
ScrollRect ( & r ,
dh ,
dv ,
updateRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CopyBits ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMapPtr srcBits ;
BitMapPtr dstBits ;
Rect srcRect ;
Rect dstRect ;
short mode ;
RgnHandle maskRgn ;
2002-11-29 19:40:48 -04:00
# ifndef CopyBits
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyBits ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O&hO& " ,
BMObj_Convert , & srcBits ,
BMObj_Convert , & dstBits ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ,
& mode ,
OptResObj_Convert , & maskRgn ) )
return NULL ;
CopyBits ( srcBits ,
dstBits ,
& srcRect ,
& dstRect ,
mode ,
maskRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CopyMask ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMapPtr srcBits ;
BitMapPtr maskBits ;
BitMapPtr dstBits ;
Rect srcRect ;
Rect maskRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef CopyMask
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyMask ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O&O&O& " ,
BMObj_Convert , & srcBits ,
BMObj_Convert , & maskBits ,
BMObj_Convert , & dstBits ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & maskRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
CopyMask ( srcBits ,
maskBits ,
dstBits ,
& srcRect ,
& maskRect ,
& dstRect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_OpenPicture ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PicHandle _rv ;
Rect picFrame ;
2002-11-29 19:40:48 -04:00
# ifndef OpenPicture
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OpenPicture ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & picFrame ) )
return NULL ;
_rv = OpenPicture ( & picFrame ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PicComment ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short kind ;
short dataSize ;
Handle dataHandle ;
2002-11-29 19:40:48 -04:00
# ifndef PicComment
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PicComment ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hhO& " ,
& kind ,
& dataSize ,
ResObj_Convert , & dataHandle ) )
return NULL ;
PicComment ( kind ,
dataSize ,
dataHandle ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ClosePicture ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef ClosePicture
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ClosePicture ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ClosePicture ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DrawPicture ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PicHandle myPicture ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef DrawPicture
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DrawPicture ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & myPicture ,
PyMac_GetRect , & dstRect ) )
return NULL ;
DrawPicture ( myPicture ,
& dstRect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_KillPicture ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PicHandle myPicture ;
2002-11-29 19:40:48 -04:00
# ifndef KillPicture
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( KillPicture ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & myPicture ) )
return NULL ;
KillPicture ( myPicture ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_OpenPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef OpenPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OpenPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = OpenPoly ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ClosePoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef ClosePoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ClosePoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ClosePoly ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_KillPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
2002-11-29 19:40:48 -04:00
# ifndef KillPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( KillPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & poly ) )
return NULL ;
KillPoly ( poly ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_OffsetPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
short dh ;
short dv ;
2002-11-29 19:40:48 -04:00
# ifndef OffsetPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OffsetPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
ResObj_Convert , & poly ,
& dh ,
& dv ) )
return NULL ;
OffsetPoly ( poly ,
dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FramePoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
2002-11-29 19:40:48 -04:00
# ifndef FramePoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FramePoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & poly ) )
return NULL ;
FramePoly ( poly ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PaintPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
2002-11-29 19:40:48 -04:00
# ifndef PaintPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & poly ) )
return NULL ;
PaintPoly ( poly ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ErasePoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
2002-11-29 19:40:48 -04:00
# ifndef ErasePoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ErasePoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & poly ) )
return NULL ;
ErasePoly ( poly ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InvertPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
2002-11-29 19:40:48 -04:00
# ifndef InvertPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & poly ) )
return NULL ;
InvertPoly ( poly ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-11-29 19:40:48 -04:00
# ifndef FillPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillPoly ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
ResObj_Convert , & poly ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillPoly ( poly ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2002-11-29 19:40:48 -04:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetPt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
short h ;
short v ;
2002-11-29 19:40:48 -04:00
# ifndef SetPt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
SetPt ( & pt ,
h ,
v ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_LocalToGlobal ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
2002-11-29 19:40:48 -04:00
# ifndef LocalToGlobal
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LocalToGlobal ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & pt ) )
return NULL ;
LocalToGlobal ( & pt ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GlobalToLocal ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
2002-11-29 19:40:48 -04:00
# ifndef GlobalToLocal
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GlobalToLocal ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetPoint , & pt ) )
return NULL ;
GlobalToLocal ( & pt ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Random ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef Random
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Random ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = Random ( ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacGetPixel ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
short h ;
short v ;
2002-11-29 19:40:48 -04:00
# ifndef MacGetPixel
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacGetPixel ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
_rv = MacGetPixel ( h ,
v ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ScalePt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
Rect srcRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef ScalePt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ScalePt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
PyMac_GetPoint , & pt ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
ScalePt ( & pt ,
& srcRect ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MapPt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt ;
Rect srcRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef MapPt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MapPt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
PyMac_GetPoint , & pt ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
MapPt ( & pt ,
& srcRect ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , pt ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MapRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
Rect srcRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef MapRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MapRect ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
PyMac_GetRect , & r ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
MapRect ( & r ,
& srcRect ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MapRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
Rect srcRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef MapRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MapRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & rgn ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
MapRgn ( rgn ,
& srcRect ,
& dstRect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MapPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
Rect srcRect ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef MapPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MapPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & poly ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ) )
return NULL ;
MapPoly ( poly ,
& srcRect ,
& dstRect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_StdBits ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMapPtr srcBits ;
Rect srcRect ;
Rect dstRect ;
short mode ;
RgnHandle maskRgn ;
2002-11-29 19:40:48 -04:00
# ifndef StdBits
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( StdBits ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&O&O&hO& " ,
BMObj_Convert , & srcBits ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & dstRect ,
& mode ,
OptResObj_Convert , & maskRgn ) )
return NULL ;
StdBits ( srcBits ,
& srcRect ,
& dstRect ,
mode ,
maskRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_AddPt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point src ;
Point dst ;
2002-11-29 19:40:48 -04:00
# ifndef AddPt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( AddPt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & src ,
PyMac_GetPoint , & dst ) )
return NULL ;
AddPt ( src ,
& dst ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , dst ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_EqualPt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Point pt1 ;
Point pt2 ;
2002-11-29 19:40:48 -04:00
# ifndef EqualPt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EqualPt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & pt1 ,
PyMac_GetPoint , & pt2 ) )
return NULL ;
_rv = EqualPt ( pt1 ,
pt2 ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacPtInRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Point pt ;
Rect r ;
2002-11-29 19:40:48 -04:00
# ifndef MacPtInRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacPtInRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & pt ,
PyMac_GetRect , & r ) )
return NULL ;
_rv = MacPtInRect ( pt ,
& r ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Pt2Rect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point pt1 ;
Point pt2 ;
Rect dstRect ;
2002-11-29 19:40:48 -04:00
# ifndef Pt2Rect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Pt2Rect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & pt1 ,
PyMac_GetPoint , & pt2 ) )
return NULL ;
Pt2Rect ( pt1 ,
pt2 ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & dstRect ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PtToAngle ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
Point pt ;
short angle ;
2002-11-29 19:40:48 -04:00
# ifndef PtToAngle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PtToAngle ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & r ,
PyMac_GetPoint , & pt ) )
return NULL ;
PtToAngle ( & r ,
pt ,
& angle ) ;
_res = Py_BuildValue ( " h " ,
angle ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SubPt ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Point src ;
Point dst ;
2002-11-29 19:40:48 -04:00
# ifndef SubPt
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SubPt ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & src ,
PyMac_GetPoint , & dst ) )
return NULL ;
SubPt ( src ,
& dst ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildPoint , dst ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PtInRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Point pt ;
RgnHandle rgn ;
2002-11-29 19:40:48 -04:00
# ifndef PtInRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PtInRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & pt ,
ResObj_Convert , & rgn ) )
return NULL ;
_rv = PtInRgn ( pt ,
rgn ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_NewPixMap ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef NewPixMap
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( NewPixMap ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = NewPixMap ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposePixMap ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle pm ;
2002-11-29 19:40:48 -04:00
# ifndef DisposePixMap
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposePixMap ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pm ) )
return NULL ;
DisposePixMap ( pm ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CopyPixMap ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle srcPM ;
PixMapHandle dstPM ;
2002-11-29 19:40:48 -04:00
# ifndef CopyPixMap
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyPixMap ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & srcPM ,
ResObj_Convert , & dstPM ) )
return NULL ;
CopyPixMap ( srcPM ,
dstPM ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_NewPixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef NewPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( NewPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = NewPixPat ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposePixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef DisposePixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposePixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pp ) )
return NULL ;
DisposePixPat ( pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CopyPixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle srcPP ;
PixPatHandle dstPP ;
2002-11-29 19:40:48 -04:00
# ifndef CopyPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & srcPP ,
ResObj_Convert , & dstPP ) )
return NULL ;
CopyPixPat ( srcPP ,
dstPP ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_PenPixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef PenPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PenPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pp ) )
return NULL ;
PenPixPat ( pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_BackPixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef BackPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( BackPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pp ) )
return NULL ;
BackPixPat ( pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetPixPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle _rv ;
short patID ;
2002-11-29 19:40:48 -04:00
# ifndef GetPixPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPixPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& patID ) )
return NULL ;
_rv = GetPixPat ( patID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MakeRGBPat ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixPatHandle pp ;
RGBColor myColor ;
2002-11-29 19:40:48 -04:00
# ifndef MakeRGBPat
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MakeRGBPat ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & pp ,
QdRGB_Convert , & myColor ) )
return NULL ;
MakeRGBPat ( pp ,
& myColor ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & r ,
ResObj_Convert , & pp ) )
return NULL ;
FillCRect ( & r ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCOval ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCOval
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCOval ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & r ,
ResObj_Convert , & pp ) )
return NULL ;
FillCOval ( & r ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCRoundRect ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short ovalWidth ;
short ovalHeight ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCRoundRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCRoundRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhO& " ,
PyMac_GetRect , & r ,
& ovalWidth ,
& ovalHeight ,
ResObj_Convert , & pp ) )
return NULL ;
FillCRoundRect ( & r ,
ovalWidth ,
ovalHeight ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCArc ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short startAngle ;
short arcAngle ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCArc
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCArc ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhO& " ,
PyMac_GetRect , & r ,
& startAngle ,
& arcAngle ,
ResObj_Convert , & pp ) )
return NULL ;
FillCArc ( & r ,
startAngle ,
arcAngle ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCRgn ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & rgn ,
ResObj_Convert , & pp ) )
return NULL ;
FillCRgn ( rgn ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_FillCPoly ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PolyHandle poly ;
PixPatHandle pp ;
2002-11-29 19:40:48 -04:00
# ifndef FillCPoly
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillCPoly ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & poly ,
ResObj_Convert , & pp ) )
return NULL ;
FillCPoly ( poly ,
pp ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RGBForeColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef RGBForeColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RGBForeColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & color ) )
return NULL ;
RGBForeColor ( & color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RGBBackColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef RGBBackColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RGBBackColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & color ) )
return NULL ;
RGBBackColor ( & color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetCPixel ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
RGBColor cPix ;
2002-11-29 19:40:48 -04:00
# ifndef SetCPixel
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetCPixel ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hhO& " ,
& h ,
& v ,
QdRGB_Convert , & cPix ) )
return NULL ;
SetCPixel ( h ,
v ,
& cPix ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetPortPix ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle pm ;
2002-11-29 19:40:48 -04:00
# ifndef SetPortPix
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPortPix ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pm ) )
return NULL ;
SetPortPix ( pm ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetCPixel ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
RGBColor cPix ;
2002-11-29 19:40:48 -04:00
# ifndef GetCPixel
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetCPixel ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
GetCPixel ( h ,
v ,
& cPix ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & cPix ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetForeColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef GetForeColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetForeColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetForeColor ( & color ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & color ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetBackColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef GetBackColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetBackColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetBackColor ( & color ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & color ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_OpColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef OpColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OpColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & color ) )
return NULL ;
OpColor ( & color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_HiliteColor ( PyObject * _self , PyObject * _args )
2001-12-18 11:39:38 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef HiliteColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( HiliteColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & color ) )
return NULL ;
HiliteColor ( & color ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposeCTable ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CTabHandle cTable ;
2002-11-29 19:40:48 -04:00
# ifndef DisposeCTable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposeCTable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & cTable ) )
return NULL ;
DisposeCTable ( cTable ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetCTable ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CTabHandle _rv ;
short ctID ;
2002-11-29 19:40:48 -04:00
# ifndef GetCTable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetCTable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& ctID ) )
return NULL ;
_rv = GetCTable ( ctID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetCCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CCrsrHandle _rv ;
short crsrID ;
2002-11-29 19:40:48 -04:00
# ifndef GetCCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetCCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& crsrID ) )
return NULL ;
_rv = GetCCursor ( crsrID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetCCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CCrsrHandle cCrsr ;
2002-11-29 19:40:48 -04:00
# ifndef SetCCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetCCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & cCrsr ) )
return NULL ;
SetCCursor ( cCrsr ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_AllocCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-11-29 19:40:48 -04:00
# ifndef AllocCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( AllocCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
AllocCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposeCCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CCrsrHandle cCrsr ;
2002-11-29 19:40:48 -04:00
# ifndef DisposeCCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposeCCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & cCrsr ) )
return NULL ;
DisposeCCursor ( cCrsr ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetMaxDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
Rect globalRect ;
2002-11-29 19:40:48 -04:00
# ifndef GetMaxDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetMaxDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & globalRect ) )
return NULL ;
_rv = GetMaxDevice ( & globalRect ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetCTSeed ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetCTSeed
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetCTSeed ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetCTSeed ( ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetDeviceList ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetDeviceList
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetDeviceList ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetDeviceList ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetMainDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetMainDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetMainDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetMainDevice ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetNextDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
GDHandle curDevice ;
2002-11-29 19:40:48 -04:00
# ifndef GetNextDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetNextDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & curDevice ) )
return NULL ;
_rv = GetNextDevice ( curDevice ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_TestDeviceAttribute ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
GDHandle gdh ;
short attribute ;
2002-11-29 19:40:48 -04:00
# ifndef TestDeviceAttribute
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TestDeviceAttribute ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&h " ,
ResObj_Convert , & gdh ,
& attribute ) )
return NULL ;
_rv = TestDeviceAttribute ( gdh ,
attribute ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetDeviceAttribute ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle gdh ;
short attribute ;
Boolean value ;
2002-11-29 19:40:48 -04:00
# ifndef SetDeviceAttribute
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetDeviceAttribute ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hb " ,
ResObj_Convert , & gdh ,
& attribute ,
& value ) )
return NULL ;
SetDeviceAttribute ( gdh ,
attribute ,
value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InitGDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short qdRefNum ;
long mode ;
GDHandle gdh ;
2002-11-29 19:40:48 -04:00
# ifndef InitGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InitGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hlO& " ,
& qdRefNum ,
& mode ,
ResObj_Convert , & gdh ) )
return NULL ;
InitGDevice ( qdRefNum ,
mode ,
gdh ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_NewGDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
short refNum ;
long mode ;
2002-11-29 19:40:48 -04:00
# ifndef NewGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( NewGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hl " ,
& refNum ,
& mode ) )
return NULL ;
_rv = NewGDevice ( refNum ,
mode ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DisposeGDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle gdh ;
2002-11-29 19:40:48 -04:00
# ifndef DisposeGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DisposeGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & gdh ) )
return NULL ;
DisposeGDevice ( gdh ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetGDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle gd ;
2002-11-29 19:40:48 -04:00
# ifndef SetGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & gd ) )
return NULL ;
SetGDevice ( gd ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetGDevice ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-11-29 19:40:48 -04:00
# ifndef GetGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetGDevice ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Color2Index ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long _rv ;
RGBColor myColor ;
2002-11-29 19:40:48 -04:00
# ifndef Color2Index
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Color2Index ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & myColor ) )
return NULL ;
_rv = Color2Index ( & myColor ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_Index2Color ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long index ;
RGBColor aColor ;
2002-11-29 19:40:48 -04:00
# ifndef Index2Color
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( Index2Color ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& index ) )
return NULL ;
Index2Color ( index ,
& aColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & aColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_InvertColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor myColor ;
2002-11-29 19:40:48 -04:00
# ifndef InvertColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
InvertColor ( & myColor ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & myColor ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_RealColor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
RGBColor color ;
2002-11-29 19:40:48 -04:00
# ifndef RealColor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( RealColor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & color ) )
return NULL ;
_rv = RealColor ( & color ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetSubTable ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CTabHandle myColors ;
short iTabRes ;
CTabHandle targetTbl ;
2002-11-29 19:40:48 -04:00
# ifndef GetSubTable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetSubTable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hO& " ,
ResObj_Convert , & myColors ,
& iTabRes ,
ResObj_Convert , & targetTbl ) )
return NULL ;
GetSubTable ( myColors ,
iTabRes ,
targetTbl ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MakeITable ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CTabHandle cTabH ;
ITabHandle iTabH ;
short res ;
2002-11-29 19:40:48 -04:00
# ifndef MakeITable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MakeITable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&h " ,
ResObj_Convert , & cTabH ,
ResObj_Convert , & iTabH ,
& res ) )
return NULL ;
MakeITable ( cTabH ,
iTabH ,
res ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SetClientID ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short id ;
2002-11-29 19:40:48 -04:00
# ifndef SetClientID
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetClientID ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& id ) )
return NULL ;
SetClientID ( id ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ProtectEntry ( PyObject * _self , PyObject * _args )
2001-12-18 11:39:38 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short index ;
Boolean protect ;
2002-11-29 19:40:48 -04:00
# ifndef ProtectEntry
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ProtectEntry ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hb " ,
& index ,
& protect ) )
return NULL ;
ProtectEntry ( index ,
protect ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ReserveEntry ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short index ;
Boolean reserve ;
2002-11-29 19:40:48 -04:00
# ifndef ReserveEntry
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ReserveEntry ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hb " ,
& index ,
& reserve ) )
return NULL ;
ReserveEntry ( index ,
reserve ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_QDError ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
2002-11-29 19:40:48 -04:00
# ifndef QDError
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( QDError ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = QDError ( ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_CopyDeepMask ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMapPtr srcBits ;
BitMapPtr maskBits ;
BitMapPtr dstBits ;
Rect srcRect ;
Rect maskRect ;
Rect dstRect ;
short mode ;
RgnHandle maskRgn ;
2002-11-29 19:40:48 -04:00
# ifndef CopyDeepMask
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyDeepMask ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&O&O&O&O&O&hO& " ,
BMObj_Convert , & srcBits ,
BMObj_Convert , & maskBits ,
BMObj_Convert , & dstBits ,
PyMac_GetRect , & srcRect ,
PyMac_GetRect , & maskRect ,
PyMac_GetRect , & dstRect ,
& mode ,
OptResObj_Convert , & maskRgn ) )
return NULL ;
CopyDeepMask ( srcBits ,
maskBits ,
dstBits ,
& srcRect ,
& maskRect ,
& dstRect ,
mode ,
maskRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetPattern ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PatHandle _rv ;
short patternID ;
2002-11-29 19:40:48 -04:00
# ifndef GetPattern
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPattern ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& patternID ) )
return NULL ;
_rv = GetPattern ( patternID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_MacGetCursor ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CursHandle _rv ;
short cursorID ;
2002-11-29 19:40:48 -04:00
# ifndef MacGetCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacGetCursor ) ;
2002-11-29 19:40:48 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& cursorID ) )
return NULL ;
_rv = MacGetCursor ( cursorID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetPicture ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PicHandle _rv ;
short pictureID ;
2002-11-29 19:40:48 -04:00
# ifndef GetPicture
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPicture ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& pictureID ) )
return NULL ;
_rv = GetPicture ( pictureID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_DeltaPoint ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long _rv ;
Point ptA ;
Point ptB ;
2002-11-29 19:40:48 -04:00
# ifndef DeltaPoint
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DeltaPoint ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & ptA ,
PyMac_GetPoint , & ptB ) )
return NULL ;
_rv = DeltaPoint ( ptA ,
ptB ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ShieldCursor ( PyObject * _self , PyObject * _args )
2001-12-18 11:39:38 -04:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect shieldRect ;
Point offsetPt ;
2002-11-29 19:40:48 -04:00
# ifndef ShieldCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ShieldCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & shieldRect ,
PyMac_GetPoint , & offsetPt ) )
return NULL ;
ShieldCursor ( & shieldRect ,
offsetPt ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_ScreenRes ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short scrnHRes ;
short scrnVRes ;
2002-11-29 19:40:48 -04:00
# ifndef ScreenRes
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ScreenRes ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ScreenRes ( & scrnHRes ,
& scrnVRes ) ;
_res = Py_BuildValue ( " hh " ,
scrnHRes ,
scrnVRes ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_GetIndPattern ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern thePat__out__ ;
short patternListID ;
short index ;
2002-11-29 19:40:48 -04:00
# ifndef GetIndPattern
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetIndPattern ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& patternListID ,
& index ) )
return NULL ;
GetIndPattern ( & thePat__out__ ,
patternListID ,
index ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & thePat__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_SlopeFromAngle ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Fixed _rv ;
short angle ;
2002-11-29 19:40:48 -04:00
# ifndef SlopeFromAngle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SlopeFromAngle ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& angle ) )
return NULL ;
_rv = SlopeFromAngle ( angle ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildFixed , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2002-11-29 19:40:48 -04:00
static PyObject * Qd_AngleFromSlope ( PyObject * _self , PyObject * _args )
2001-08-23 11:02:09 -03:00
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
Fixed slope ;
2002-11-29 19:40:48 -04:00
# ifndef AngleFromSlope
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( AngleFromSlope ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetFixed , & slope ) )
return NULL ;
_rv = AngleFromSlope ( slope ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetPixBounds ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
PixMapHandle pixMap ;
Rect bounds ;
2002-03-24 19:04:18 -04:00
# ifndef GetPixBounds
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPixBounds ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pixMap ) )
return NULL ;
GetPixBounds ( pixMap ,
& bounds ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & bounds ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetPixDepth ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
PixMapHandle pixMap ;
2002-03-24 19:04:18 -04:00
# ifndef GetPixDepth
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPixDepth ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & pixMap ) )
return NULL ;
_rv = GetPixDepth ( pixMap ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsRandomSeed ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long _rv ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsRandomSeed
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsRandomSeed ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetQDGlobalsRandomSeed ( ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsScreenBits ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMap screenBits ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsScreenBits
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsScreenBits ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsScreenBits ( & screenBits ) ;
_res = Py_BuildValue ( " O& " ,
BMObj_NewCopied , & screenBits ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsArrow ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Cursor arrow__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsArrow
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsArrow ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsArrow ( & arrow__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & arrow__out__ , ( int ) sizeof ( Cursor ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsDarkGray ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern dkGray__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsDarkGray
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsDarkGray ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsDarkGray ( & dkGray__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & dkGray__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsLightGray ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern ltGray__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsLightGray
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsLightGray ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsLightGray ( & ltGray__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & ltGray__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsGray ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern gray__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsGray
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsGray ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsGray ( & gray__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & gray__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsBlack ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern black__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsBlack
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsBlack ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsBlack ( & black__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & black__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsWhite ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Pattern white__out__ ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsWhite
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsWhite ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetQDGlobalsWhite ( & white__out__ ) ;
_res = Py_BuildValue ( " s# " ,
( char * ) & white__out__ , ( int ) sizeof ( Pattern ) ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetQDGlobalsThePort ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CGrafPtr _rv ;
2002-03-24 19:04:18 -04:00
# ifndef GetQDGlobalsThePort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetQDGlobalsThePort ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = GetQDGlobalsThePort ( ) ;
_res = Py_BuildValue ( " O& " ,
GrafObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetQDGlobalsRandomSeed ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
long randomSeed ;
2002-03-24 19:04:18 -04:00
# ifndef SetQDGlobalsRandomSeed
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetQDGlobalsRandomSeed ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& randomSeed ) )
return NULL ;
SetQDGlobalsRandomSeed ( randomSeed ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetQDGlobalsArrow ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Cursor * arrow__in__ ;
int arrow__in_len__ ;
2002-03-24 19:04:18 -04:00
# ifndef SetQDGlobalsArrow
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetQDGlobalsArrow ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & arrow__in__ , & arrow__in_len__ ) )
return NULL ;
if ( arrow__in_len__ ! = sizeof ( Cursor ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Cursor) " ) ;
goto arrow__error__ ;
}
SetQDGlobalsArrow ( arrow__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
arrow__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetRegionBounds ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle region ;
Rect bounds ;
2002-03-24 19:04:18 -04:00
# ifndef GetRegionBounds
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetRegionBounds ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & region ) )
return NULL ;
GetRegionBounds ( region ,
& bounds ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & bounds ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_IsRegionRectangular ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
RgnHandle region ;
2002-03-24 19:04:18 -04:00
# ifndef IsRegionRectangular
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( IsRegionRectangular ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & region ) )
return NULL ;
_rv = IsRegionRectangular ( region ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_CreateNewPort ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CGrafPtr _rv ;
2002-03-24 19:04:18 -04:00
# ifndef CreateNewPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CreateNewPort ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = CreateNewPort ( ) ;
_res = Py_BuildValue ( " O& " ,
GrafObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetQDError ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
OSErr err ;
2002-03-24 19:04:18 -04:00
# ifndef SetQDError
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetQDError ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& err ) )
return NULL ;
SetQDError ( err ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2001-12-18 11:39:38 -04:00
static PyObject * Qd_LMGetScrVRes ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt16 _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetScrVRes
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetScrVRes ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetScrVRes ( ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetScrVRes ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt16 value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetScrVRes
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetScrVRes ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& value ) )
return NULL ;
LMSetScrVRes ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetScrHRes ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt16 _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetScrHRes
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetScrHRes ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetScrHRes ( ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetScrHRes ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt16 value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetScrHRes
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetScrHRes ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& value ) )
return NULL ;
LMSetScrHRes ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetMainDevice ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetMainDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetMainDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetMainDevice ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetMainDevice ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetMainDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetMainDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetMainDevice ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetDeviceList ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetDeviceList
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetDeviceList ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetDeviceList ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetDeviceList ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetDeviceList
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetDeviceList ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetDeviceList ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetQDColors ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetQDColors
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetQDColors ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetQDColors ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetQDColors ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetQDColors
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetQDColors ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetQDColors ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetWidthListHand ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetWidthListHand
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetWidthListHand ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetWidthListHand ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetWidthListHand ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetWidthListHand
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetWidthListHand ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetWidthListHand ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetHiliteMode ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
UInt8 _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetHiliteMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetHiliteMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetHiliteMode ( ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetHiliteMode ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
UInt8 value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetHiliteMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetHiliteMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " b " ,
& value ) )
return NULL ;
LMSetHiliteMode ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetWidthTabHandle ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetWidthTabHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetWidthTabHandle ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetWidthTabHandle ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetWidthTabHandle ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetWidthTabHandle
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetWidthTabHandle ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetWidthTabHandle ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetLastSPExtra ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt32 _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetLastSPExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetLastSPExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetLastSPExtra ( ) ;
_res = Py_BuildValue ( " l " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetLastSPExtra ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
SInt32 value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetLastSPExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetLastSPExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " l " ,
& value ) )
return NULL ;
LMSetLastSPExtra ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetLastFOND ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetLastFOND
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetLastFOND ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetLastFOND ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetLastFOND ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Handle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetLastFOND
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetLastFOND ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetLastFOND ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetFractEnable ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
UInt8 _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetFractEnable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetFractEnable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetFractEnable ( ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetFractEnable ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
UInt8 value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetFractEnable
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetFractEnable ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " b " ,
& value ) )
return NULL ;
LMSetFractEnable ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetTheGDevice ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetTheGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetTheGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetTheGDevice ( ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetTheGDevice ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GDHandle value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetTheGDevice
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetTheGDevice ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & value ) )
return NULL ;
LMSetTheGDevice ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetHiliteRGB ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor hiliteRGBValue ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetHiliteRGB
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetHiliteRGB ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
LMGetHiliteRGB ( & hiliteRGBValue ) ;
_res = Py_BuildValue ( " O& " ,
QdRGB_New , & hiliteRGBValue ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetHiliteRGB ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RGBColor hiliteRGBValue ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetHiliteRGB
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetHiliteRGB ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
QdRGB_Convert , & hiliteRGBValue ) )
return NULL ;
LMSetHiliteRGB ( & hiliteRGBValue ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMGetCursorNew ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
2002-03-24 19:04:18 -04:00
# ifndef LMGetCursorNew
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMGetCursorNew ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
_rv = LMGetCursorNew ( ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
static PyObject * Qd_LMSetCursorNew ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean value ;
2002-03-24 19:04:18 -04:00
# ifndef LMSetCursorNew
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LMSetCursorNew ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " b " ,
& value ) )
return NULL ;
LMSetCursorNew ( value ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2001-08-23 11:02:09 -03:00
static PyObject * Qd_TextFont ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short font ;
2002-03-24 19:04:18 -04:00
# ifndef TextFont
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TextFont ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& font ) )
return NULL ;
TextFont ( font ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_TextFace ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
StyleParameter face ;
2002-03-24 19:04:18 -04:00
# ifndef TextFace
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TextFace ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& face ) )
return NULL ;
TextFace ( face ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_TextMode ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short mode ;
2002-03-24 19:04:18 -04:00
# ifndef TextMode
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TextMode ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& mode ) )
return NULL ;
TextMode ( mode ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_TextSize ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short size ;
2002-03-24 19:04:18 -04:00
# ifndef TextSize
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TextSize ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& size ) )
return NULL ;
TextSize ( size ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SpaceExtra ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Fixed extra ;
2002-03-24 19:04:18 -04:00
# ifndef SpaceExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SpaceExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetFixed , & extra ) )
return NULL ;
SpaceExtra ( extra ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_DrawChar ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CharParameter ch ;
2002-03-24 19:04:18 -04:00
# ifndef DrawChar
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DrawChar ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& ch ) )
return NULL ;
DrawChar ( ch ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_DrawString ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Str255 s ;
2002-03-24 19:04:18 -04:00
# ifndef DrawString
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DrawString ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetStr255 , s ) )
return NULL ;
DrawString ( s ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_MacDrawText ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
char * textBuf__in__ ;
int textBuf__in_len__ ;
short firstByte ;
short byteCount ;
2002-03-24 19:04:18 -04:00
# ifndef MacDrawText
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( MacDrawText ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s#hh " ,
& textBuf__in__ , & textBuf__in_len__ ,
& firstByte ,
& byteCount ) )
return NULL ;
/* Fool compiler warnings */
textBuf__in_len__ = textBuf__in_len__ ;
MacDrawText ( textBuf__in__ ,
firstByte ,
byteCount ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_CharWidth ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
CharParameter ch ;
2002-03-24 19:04:18 -04:00
# ifndef CharWidth
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CharWidth ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& ch ) )
return NULL ;
_rv = CharWidth ( ch ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_StringWidth ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
Str255 s ;
2002-03-24 19:04:18 -04:00
# ifndef StringWidth
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( StringWidth ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetStr255 , s ) )
return NULL ;
_rv = StringWidth ( s ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_TextWidth ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
char * textBuf__in__ ;
int textBuf__in_len__ ;
short firstByte ;
short byteCount ;
2002-03-24 19:04:18 -04:00
# ifndef TextWidth
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TextWidth ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s#hh " ,
& textBuf__in__ , & textBuf__in_len__ ,
& firstByte ,
& byteCount ) )
return NULL ;
/* Fool compiler warnings */
textBuf__in_len__ = textBuf__in_len__ ;
_rv = TextWidth ( textBuf__in__ ,
firstByte ,
byteCount ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetFontInfo ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
FontInfo info ;
2002-03-24 19:04:18 -04:00
# ifndef GetFontInfo
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetFontInfo ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
GetFontInfo ( & info ) ;
_res = Py_BuildValue ( " O& " ,
QdFI_New , & info ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_CharExtra ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Fixed extra ;
2002-03-24 19:04:18 -04:00
# ifndef CharExtra
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CharExtra ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetFixed , & extra ) )
return NULL ;
CharExtra ( extra ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2001-12-18 11:39:38 -04:00
static PyObject * Qd_TruncString ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short _rv ;
short width ;
Str255 theString ;
TruncCode truncWhere ;
2002-03-24 19:04:18 -04:00
# ifndef TruncString
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( TruncString ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hO&h " ,
& width ,
PyMac_GetStr255 , theString ,
& truncWhere ) )
return NULL ;
_rv = TruncString ( width ,
theString ,
truncWhere ) ;
_res = Py_BuildValue ( " h " ,
_rv ) ;
return _res ;
2001-12-18 11:39:38 -04:00
}
2001-08-23 11:02:09 -03:00
static PyObject * Qd_SetPort ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
GrafPtr thePort ;
2002-03-24 19:04:18 -04:00
# ifndef SetPort
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetPort ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
GrafObj_Convert , & thePort ) )
return NULL ;
SetPort ( thePort ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetCursor ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
CursHandle _rv ;
short cursorID ;
2002-03-24 19:04:18 -04:00
# ifndef GetCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " h " ,
& cursorID ) )
return NULL ;
_rv = GetCursor ( cursorID ) ;
_res = Py_BuildValue ( " O& " ,
ResObj_New , _rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetCursor ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Cursor * crsr__in__ ;
int crsr__in_len__ ;
2002-03-24 19:04:18 -04:00
# ifndef SetCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetCursor ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s# " ,
( char * * ) & crsr__in__ , & crsr__in_len__ ) )
return NULL ;
if ( crsr__in_len__ ! = sizeof ( Cursor ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Cursor) " ) ;
goto crsr__error__ ;
}
SetCursor ( crsr__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
crsr__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_ShowCursor ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2002-03-24 19:04:18 -04:00
# ifndef ShowCursor
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( ShowCursor ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " " ) )
return NULL ;
ShowCursor ( ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_LineTo ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
short h ;
short v ;
2002-03-24 19:04:18 -04:00
# ifndef LineTo
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( LineTo ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
LineTo ( h ,
v ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short left ;
short top ;
short right ;
short bottom ;
2002-03-24 19:04:18 -04:00
# ifndef SetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " hhhh " ,
& left ,
& top ,
& right ,
& bottom ) )
return NULL ;
SetRect ( & r ,
left ,
top ,
right ,
bottom ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_OffsetRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short dh ;
short dv ;
2002-03-24 19:04:18 -04:00
# ifndef OffsetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OffsetRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& dh ,
& dv ) )
return NULL ;
OffsetRect ( & r ,
dh ,
dv ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_InsetRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
short dh ;
short dv ;
2002-03-24 19:04:18 -04:00
# ifndef InsetRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InsetRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
PyMac_GetRect , & r ,
& dh ,
& dv ) )
return NULL ;
InsetRect ( & r ,
dh ,
dv ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & r ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_UnionRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect src1 ;
Rect src2 ;
Rect dstRect ;
2002-03-24 19:04:18 -04:00
# ifndef UnionRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( UnionRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & src1 ,
PyMac_GetRect , & src2 ) )
return NULL ;
UnionRect ( & src1 ,
& src2 ,
& dstRect ) ;
_res = Py_BuildValue ( " O& " ,
PyMac_BuildRect , & dstRect ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_EqualRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Rect rect1 ;
Rect rect2 ;
2002-03-24 19:04:18 -04:00
# ifndef EqualRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EqualRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetRect , & rect1 ,
PyMac_GetRect , & rect2 ) )
return NULL ;
_rv = EqualRect ( & rect1 ,
& rect2 ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_FrameRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-03-24 19:04:18 -04:00
# ifndef FrameRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FrameRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
FrameRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_InvertRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
2002-03-24 19:04:18 -04:00
# ifndef InvertRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
PyMac_GetRect , & r ) )
return NULL ;
InvertRect ( & r ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_FillRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Rect r ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-03-24 19:04:18 -04:00
# ifndef FillRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillRect ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
PyMac_GetRect , & r ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillRect ( & r ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_CopyRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgn ;
RgnHandle dstRgn ;
2002-03-24 19:04:18 -04:00
# ifndef CopyRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( CopyRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & srcRgn ,
ResObj_Convert , & dstRgn ) )
return NULL ;
CopyRgn ( srcRgn ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_SetRectRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
short left ;
short top ;
short right ;
short bottom ;
2002-03-24 19:04:18 -04:00
# ifndef SetRectRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( SetRectRgn ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&hhhh " ,
ResObj_Convert , & rgn ,
& left ,
& top ,
& right ,
& bottom ) )
return NULL ;
SetRectRgn ( rgn ,
left ,
top ,
right ,
bottom ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_OffsetRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
short dh ;
short dv ;
2002-03-24 19:04:18 -04:00
# ifndef OffsetRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( OffsetRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&hh " ,
ResObj_Convert , & rgn ,
& dh ,
& dv ) )
return NULL ;
OffsetRgn ( rgn ,
dh ,
dv ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_UnionRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-03-24 19:04:18 -04:00
# ifndef UnionRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( UnionRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
UnionRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_XorRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle srcRgnA ;
RgnHandle srcRgnB ;
RgnHandle dstRgn ;
2002-03-24 19:04:18 -04:00
# ifndef XorRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( XorRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O&O& " ,
ResObj_Convert , & srcRgnA ,
ResObj_Convert , & srcRgnB ,
ResObj_Convert , & dstRgn ) )
return NULL ;
XorRgn ( srcRgnA ,
srcRgnB ,
dstRgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_EqualRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
RgnHandle rgnA ;
RgnHandle rgnB ;
2002-03-24 19:04:18 -04:00
# ifndef EqualRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( EqualRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
ResObj_Convert , & rgnA ,
ResObj_Convert , & rgnB ) )
return NULL ;
_rv = EqualRgn ( rgnA ,
rgnB ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_FrameRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-03-24 19:04:18 -04:00
# ifndef FrameRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FrameRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
FrameRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_PaintRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-03-24 19:04:18 -04:00
# ifndef PaintRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PaintRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
PaintRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_InvertRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
2002-03-24 19:04:18 -04:00
# ifndef InvertRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( InvertRgn ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O& " ,
ResObj_Convert , & rgn ) )
return NULL ;
InvertRgn ( rgn ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_FillRgn ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
RgnHandle rgn ;
Pattern * pat__in__ ;
int pat__in_len__ ;
2002-03-24 19:04:18 -04:00
# ifndef FillRgn
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( FillRgn ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " O&s# " ,
ResObj_Convert , & rgn ,
( char * * ) & pat__in__ , & pat__in_len__ ) )
return NULL ;
if ( pat__in_len__ ! = sizeof ( Pattern ) )
{
PyErr_SetString ( PyExc_TypeError , " buffer length should be sizeof(Pattern) " ) ;
goto pat__error__ ;
}
FillRgn ( rgn ,
pat__in__ ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
2001-08-23 11:02:09 -03:00
pat__error__ : ;
2010-05-09 12:15:40 -03:00
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_GetPixel ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
short h ;
short v ;
2002-03-24 19:04:18 -04:00
# ifndef GetPixel
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( GetPixel ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " hh " ,
& h ,
& v ) )
return NULL ;
_rv = GetPixel ( h ,
v ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_PtInRect ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
Boolean _rv ;
Point pt ;
Rect r ;
2002-03-24 19:04:18 -04:00
# ifndef PtInRect
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( PtInRect ) ;
2002-03-24 19:04:18 -04:00
# endif
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O&O& " ,
PyMac_GetPoint , & pt ,
PyMac_GetRect , & r ) )
return NULL ;
_rv = PtInRect ( pt ,
& r ) ;
_res = Py_BuildValue ( " b " ,
_rv ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_DrawText ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
char * textBuf__in__ ;
int textBuf__in_len__ ;
short firstByte ;
short byteCount ;
2002-03-24 19:04:18 -04:00
# ifndef DrawText
2010-05-09 12:15:40 -03:00
PyMac_PRECHECK ( DrawText ) ;
# endif
if ( ! PyArg_ParseTuple ( _args , " s#hh " ,
& textBuf__in__ , & textBuf__in_len__ ,
& firstByte ,
& byteCount ) )
return NULL ;
/* Fool compiler warnings */
textBuf__in_len__ = textBuf__in_len__ ;
DrawText ( textBuf__in__ ,
firstByte ,
byteCount ) ;
Py_INCREF ( Py_None ) ;
_res = Py_None ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_BitMap ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
BitMap * ptr ;
PyObject * source ;
Rect bounds ;
int rowbytes ;
char * data ;
if ( ! PyArg_ParseTuple ( _args , " O!iO& " , & PyString_Type , & source , & rowbytes , PyMac_GetRect ,
& bounds ) )
return NULL ;
data = PyString_AsString ( source ) ;
if ( ( ptr = ( BitMap * ) malloc ( sizeof ( BitMap ) ) ) = = NULL )
return PyErr_NoMemory ( ) ;
ptr - > baseAddr = ( Ptr ) data ;
ptr - > rowBytes = rowbytes ;
ptr - > bounds = bounds ;
if ( ( _res = BMObj_New ( ptr ) ) = = NULL ) {
free ( ptr ) ;
return NULL ;
}
( ( BitMapObject * ) _res ) - > referred_object = source ;
Py_INCREF ( source ) ;
( ( BitMapObject * ) _res ) - > referred_bitmap = ptr ;
return _res ;
2001-08-23 11:02:09 -03:00
}
static PyObject * Qd_RawBitMap ( PyObject * _self , PyObject * _args )
{
2010-05-09 12:15:40 -03:00
PyObject * _res = NULL ;
2001-08-23 11:02:09 -03:00
2010-05-09 12:15:40 -03:00
BitMap * ptr ;
PyObject * source ;
2001-08-23 11:02:09 -03:00
2010-05-09 12:15:40 -03:00
if ( ! PyArg_ParseTuple ( _args , " O! " , & PyString_Type , & source ) )
return NULL ;
if ( PyString_Size ( source ) ! = sizeof ( BitMap ) & & PyString_Size ( source ) ! = sizeof ( PixMap ) ) {
PyErr_Format ( PyExc_TypeError ,
" Argument size was %ld, should be %lu (sizeof BitMap) or %lu (sizeof PixMap) " ,
PyString_Size ( source ) , sizeof ( BitMap ) , sizeof ( PixMap ) ) ;
return NULL ;
}
ptr = ( BitMapPtr ) PyString_AsString ( source ) ;
if ( ( _res = BMObj_New ( ptr ) ) = = NULL ) {
return NULL ;
}
( ( BitMapObject * ) _res ) - > referred_object = source ;
Py_INCREF ( source ) ;
return _res ;
2001-08-23 11:02:09 -03:00
}
2008-06-05 09:58:24 -03:00
# endif /* __LP64__ */
2001-08-23 11:02:09 -03:00
static PyMethodDef Qd_methods [ ] = {
2008-06-05 09:58:24 -03:00
# ifndef __LP64__
2010-05-09 12:15:40 -03:00
{ " GetPort " , ( PyCFunction ) Qd_GetPort , 1 ,
PyDoc_STR ( " () -> (GrafPtr port) " ) } ,
{ " GrafDevice " , ( PyCFunction ) Qd_GrafDevice , 1 ,
PyDoc_STR ( " (short device) -> None " ) } ,
{ " SetPortBits " , ( PyCFunction ) Qd_SetPortBits , 1 ,
PyDoc_STR ( " (BitMapPtr bm) -> None " ) } ,
{ " PortSize " , ( PyCFunction ) Qd_PortSize , 1 ,
PyDoc_STR ( " (short width, short height) -> None " ) } ,
{ " MovePortTo " , ( PyCFunction ) Qd_MovePortTo , 1 ,
PyDoc_STR ( " (short leftGlobal, short topGlobal) -> None " ) } ,
{ " SetOrigin " , ( PyCFunction ) Qd_SetOrigin , 1 ,
PyDoc_STR ( " (short h, short v) -> None " ) } ,
{ " SetClip " , ( PyCFunction ) Qd_SetClip , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " GetClip " , ( PyCFunction ) Qd_GetClip , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " ClipRect " , ( PyCFunction ) Qd_ClipRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " BackPat " , ( PyCFunction ) Qd_BackPat , 1 ,
PyDoc_STR ( " (Pattern pat) -> None " ) } ,
{ " InitCursor " , ( PyCFunction ) Qd_InitCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " MacSetCursor " , ( PyCFunction ) Qd_MacSetCursor , 1 ,
PyDoc_STR ( " (Cursor crsr) -> None " ) } ,
{ " HideCursor " , ( PyCFunction ) Qd_HideCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " MacShowCursor " , ( PyCFunction ) Qd_MacShowCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " ObscureCursor " , ( PyCFunction ) Qd_ObscureCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " HidePen " , ( PyCFunction ) Qd_HidePen , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " ShowPen " , ( PyCFunction ) Qd_ShowPen , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " GetPen " , ( PyCFunction ) Qd_GetPen , 1 ,
PyDoc_STR ( " () -> (Point pt) " ) } ,
{ " GetPenState " , ( PyCFunction ) Qd_GetPenState , 1 ,
PyDoc_STR ( " () -> (PenState pnState) " ) } ,
{ " SetPenState " , ( PyCFunction ) Qd_SetPenState , 1 ,
PyDoc_STR ( " (PenState pnState) -> None " ) } ,
{ " PenSize " , ( PyCFunction ) Qd_PenSize , 1 ,
PyDoc_STR ( " (short width, short height) -> None " ) } ,
{ " PenMode " , ( PyCFunction ) Qd_PenMode , 1 ,
PyDoc_STR ( " (short mode) -> None " ) } ,
{ " PenPat " , ( PyCFunction ) Qd_PenPat , 1 ,
PyDoc_STR ( " (Pattern pat) -> None " ) } ,
{ " PenNormal " , ( PyCFunction ) Qd_PenNormal , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " MoveTo " , ( PyCFunction ) Qd_MoveTo , 1 ,
PyDoc_STR ( " (short h, short v) -> None " ) } ,
{ " Move " , ( PyCFunction ) Qd_Move , 1 ,
PyDoc_STR ( " (short dh, short dv) -> None " ) } ,
{ " MacLineTo " , ( PyCFunction ) Qd_MacLineTo , 1 ,
PyDoc_STR ( " (short h, short v) -> None " ) } ,
{ " Line " , ( PyCFunction ) Qd_Line , 1 ,
PyDoc_STR ( " (short dh, short dv) -> None " ) } ,
{ " ForeColor " , ( PyCFunction ) Qd_ForeColor , 1 ,
PyDoc_STR ( " (long color) -> None " ) } ,
{ " BackColor " , ( PyCFunction ) Qd_BackColor , 1 ,
PyDoc_STR ( " (long color) -> None " ) } ,
{ " ColorBit " , ( PyCFunction ) Qd_ColorBit , 1 ,
PyDoc_STR ( " (short whichBit) -> None " ) } ,
{ " MacSetRect " , ( PyCFunction ) Qd_MacSetRect , 1 ,
PyDoc_STR ( " (short left, short top, short right, short bottom) -> (Rect r) " ) } ,
{ " MacOffsetRect " , ( PyCFunction ) Qd_MacOffsetRect , 1 ,
PyDoc_STR ( " (Rect r, short dh, short dv) -> (Rect r) " ) } ,
{ " MacInsetRect " , ( PyCFunction ) Qd_MacInsetRect , 1 ,
PyDoc_STR ( " (Rect r, short dh, short dv) -> (Rect r) " ) } ,
{ " SectRect " , ( PyCFunction ) Qd_SectRect , 1 ,
PyDoc_STR ( " (Rect src1, Rect src2) -> (Boolean _rv, Rect dstRect) " ) } ,
{ " MacUnionRect " , ( PyCFunction ) Qd_MacUnionRect , 1 ,
PyDoc_STR ( " (Rect src1, Rect src2) -> (Rect dstRect) " ) } ,
{ " MacEqualRect " , ( PyCFunction ) Qd_MacEqualRect , 1 ,
PyDoc_STR ( " (Rect rect1, Rect rect2) -> (Boolean _rv) " ) } ,
{ " EmptyRect " , ( PyCFunction ) Qd_EmptyRect , 1 ,
PyDoc_STR ( " (Rect r) -> (Boolean _rv) " ) } ,
{ " MacFrameRect " , ( PyCFunction ) Qd_MacFrameRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " PaintRect " , ( PyCFunction ) Qd_PaintRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " EraseRect " , ( PyCFunction ) Qd_EraseRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " MacInvertRect " , ( PyCFunction ) Qd_MacInvertRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " MacFillRect " , ( PyCFunction ) Qd_MacFillRect , 1 ,
PyDoc_STR ( " (Rect r, Pattern pat) -> None " ) } ,
{ " FrameOval " , ( PyCFunction ) Qd_FrameOval , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " PaintOval " , ( PyCFunction ) Qd_PaintOval , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " EraseOval " , ( PyCFunction ) Qd_EraseOval , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " InvertOval " , ( PyCFunction ) Qd_InvertOval , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " FillOval " , ( PyCFunction ) Qd_FillOval , 1 ,
PyDoc_STR ( " (Rect r, Pattern pat) -> None " ) } ,
{ " FrameRoundRect " , ( PyCFunction ) Qd_FrameRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight) -> None " ) } ,
{ " PaintRoundRect " , ( PyCFunction ) Qd_PaintRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight) -> None " ) } ,
{ " EraseRoundRect " , ( PyCFunction ) Qd_EraseRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight) -> None " ) } ,
{ " InvertRoundRect " , ( PyCFunction ) Qd_InvertRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight) -> None " ) } ,
{ " FillRoundRect " , ( PyCFunction ) Qd_FillRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight, Pattern pat) -> None " ) } ,
{ " FrameArc " , ( PyCFunction ) Qd_FrameArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle) -> None " ) } ,
{ " PaintArc " , ( PyCFunction ) Qd_PaintArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle) -> None " ) } ,
{ " EraseArc " , ( PyCFunction ) Qd_EraseArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle) -> None " ) } ,
{ " InvertArc " , ( PyCFunction ) Qd_InvertArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle) -> None " ) } ,
{ " FillArc " , ( PyCFunction ) Qd_FillArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle, Pattern pat) -> None " ) } ,
{ " NewRgn " , ( PyCFunction ) Qd_NewRgn , 1 ,
PyDoc_STR ( " () -> (RgnHandle _rv) " ) } ,
{ " OpenRgn " , ( PyCFunction ) Qd_OpenRgn , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " CloseRgn " , ( PyCFunction ) Qd_CloseRgn , 1 ,
PyDoc_STR ( " (RgnHandle dstRgn) -> None " ) } ,
{ " BitMapToRegion " , ( PyCFunction ) Qd_BitMapToRegion , 1 ,
PyDoc_STR ( " (RgnHandle region, BitMapPtr bMap) -> None " ) } ,
{ " RgnToHandle " , ( PyCFunction ) Qd_RgnToHandle , 1 ,
PyDoc_STR ( " (RgnHandle region, Handle flattenedRgnDataHdl) -> None " ) } ,
{ " DisposeRgn " , ( PyCFunction ) Qd_DisposeRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " MacCopyRgn " , ( PyCFunction ) Qd_MacCopyRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgn, RgnHandle dstRgn) -> None " ) } ,
{ " SetEmptyRgn " , ( PyCFunction ) Qd_SetEmptyRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " MacSetRectRgn " , ( PyCFunction ) Qd_MacSetRectRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, short left, short top, short right, short bottom) -> None " ) } ,
{ " RectRgn " , ( PyCFunction ) Qd_RectRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, Rect r) -> None " ) } ,
{ " MacOffsetRgn " , ( PyCFunction ) Qd_MacOffsetRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, short dh, short dv) -> None " ) } ,
{ " InsetRgn " , ( PyCFunction ) Qd_InsetRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, short dh, short dv) -> None " ) } ,
{ " SectRgn " , ( PyCFunction ) Qd_SectRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " MacUnionRgn " , ( PyCFunction ) Qd_MacUnionRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " DiffRgn " , ( PyCFunction ) Qd_DiffRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " MacXorRgn " , ( PyCFunction ) Qd_MacXorRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " RectInRgn " , ( PyCFunction ) Qd_RectInRgn , 1 ,
PyDoc_STR ( " (Rect r, RgnHandle rgn) -> (Boolean _rv) " ) } ,
{ " MacEqualRgn " , ( PyCFunction ) Qd_MacEqualRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv) " ) } ,
{ " EmptyRgn " , ( PyCFunction ) Qd_EmptyRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> (Boolean _rv) " ) } ,
{ " MacFrameRgn " , ( PyCFunction ) Qd_MacFrameRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " MacPaintRgn " , ( PyCFunction ) Qd_MacPaintRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " EraseRgn " , ( PyCFunction ) Qd_EraseRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " MacInvertRgn " , ( PyCFunction ) Qd_MacInvertRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " MacFillRgn " , ( PyCFunction ) Qd_MacFillRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, Pattern pat) -> None " ) } ,
{ " ScrollRect " , ( PyCFunction ) Qd_ScrollRect , 1 ,
PyDoc_STR ( " (Rect r, short dh, short dv, RgnHandle updateRgn) -> None " ) } ,
{ " CopyBits " , ( PyCFunction ) Qd_CopyBits , 1 ,
PyDoc_STR ( " (BitMapPtr srcBits, BitMapPtr dstBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None " ) } ,
{ " CopyMask " , ( PyCFunction ) Qd_CopyMask , 1 ,
PyDoc_STR ( " (BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect) -> None " ) } ,
{ " OpenPicture " , ( PyCFunction ) Qd_OpenPicture , 1 ,
PyDoc_STR ( " (Rect picFrame) -> (PicHandle _rv) " ) } ,
{ " PicComment " , ( PyCFunction ) Qd_PicComment , 1 ,
PyDoc_STR ( " (short kind, short dataSize, Handle dataHandle) -> None " ) } ,
{ " ClosePicture " , ( PyCFunction ) Qd_ClosePicture , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " DrawPicture " , ( PyCFunction ) Qd_DrawPicture , 1 ,
PyDoc_STR ( " (PicHandle myPicture, Rect dstRect) -> None " ) } ,
{ " KillPicture " , ( PyCFunction ) Qd_KillPicture , 1 ,
PyDoc_STR ( " (PicHandle myPicture) -> None " ) } ,
{ " OpenPoly " , ( PyCFunction ) Qd_OpenPoly , 1 ,
PyDoc_STR ( " () -> (PolyHandle _rv) " ) } ,
{ " ClosePoly " , ( PyCFunction ) Qd_ClosePoly , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " KillPoly " , ( PyCFunction ) Qd_KillPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly) -> None " ) } ,
{ " OffsetPoly " , ( PyCFunction ) Qd_OffsetPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly, short dh, short dv) -> None " ) } ,
{ " FramePoly " , ( PyCFunction ) Qd_FramePoly , 1 ,
PyDoc_STR ( " (PolyHandle poly) -> None " ) } ,
{ " PaintPoly " , ( PyCFunction ) Qd_PaintPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly) -> None " ) } ,
{ " ErasePoly " , ( PyCFunction ) Qd_ErasePoly , 1 ,
PyDoc_STR ( " (PolyHandle poly) -> None " ) } ,
{ " InvertPoly " , ( PyCFunction ) Qd_InvertPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly) -> None " ) } ,
{ " FillPoly " , ( PyCFunction ) Qd_FillPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly, Pattern pat) -> None " ) } ,
{ " SetPt " , ( PyCFunction ) Qd_SetPt , 1 ,
PyDoc_STR ( " (short h, short v) -> (Point pt) " ) } ,
{ " LocalToGlobal " , ( PyCFunction ) Qd_LocalToGlobal , 1 ,
PyDoc_STR ( " (Point pt) -> (Point pt) " ) } ,
{ " GlobalToLocal " , ( PyCFunction ) Qd_GlobalToLocal , 1 ,
PyDoc_STR ( " (Point pt) -> (Point pt) " ) } ,
{ " Random " , ( PyCFunction ) Qd_Random , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " MacGetPixel " , ( PyCFunction ) Qd_MacGetPixel , 1 ,
PyDoc_STR ( " (short h, short v) -> (Boolean _rv) " ) } ,
{ " ScalePt " , ( PyCFunction ) Qd_ScalePt , 1 ,
PyDoc_STR ( " (Point pt, Rect srcRect, Rect dstRect) -> (Point pt) " ) } ,
{ " MapPt " , ( PyCFunction ) Qd_MapPt , 1 ,
PyDoc_STR ( " (Point pt, Rect srcRect, Rect dstRect) -> (Point pt) " ) } ,
{ " MapRect " , ( PyCFunction ) Qd_MapRect , 1 ,
PyDoc_STR ( " (Rect r, Rect srcRect, Rect dstRect) -> (Rect r) " ) } ,
{ " MapRgn " , ( PyCFunction ) Qd_MapRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, Rect srcRect, Rect dstRect) -> None " ) } ,
{ " MapPoly " , ( PyCFunction ) Qd_MapPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly, Rect srcRect, Rect dstRect) -> None " ) } ,
{ " StdBits " , ( PyCFunction ) Qd_StdBits , 1 ,
PyDoc_STR ( " (BitMapPtr srcBits, Rect srcRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None " ) } ,
{ " AddPt " , ( PyCFunction ) Qd_AddPt , 1 ,
PyDoc_STR ( " (Point src, Point dst) -> (Point dst) " ) } ,
{ " EqualPt " , ( PyCFunction ) Qd_EqualPt , 1 ,
PyDoc_STR ( " (Point pt1, Point pt2) -> (Boolean _rv) " ) } ,
{ " MacPtInRect " , ( PyCFunction ) Qd_MacPtInRect , 1 ,
PyDoc_STR ( " (Point pt, Rect r) -> (Boolean _rv) " ) } ,
{ " Pt2Rect " , ( PyCFunction ) Qd_Pt2Rect , 1 ,
PyDoc_STR ( " (Point pt1, Point pt2) -> (Rect dstRect) " ) } ,
{ " PtToAngle " , ( PyCFunction ) Qd_PtToAngle , 1 ,
PyDoc_STR ( " (Rect r, Point pt) -> (short angle) " ) } ,
{ " SubPt " , ( PyCFunction ) Qd_SubPt , 1 ,
PyDoc_STR ( " (Point src, Point dst) -> (Point dst) " ) } ,
{ " PtInRgn " , ( PyCFunction ) Qd_PtInRgn , 1 ,
PyDoc_STR ( " (Point pt, RgnHandle rgn) -> (Boolean _rv) " ) } ,
{ " NewPixMap " , ( PyCFunction ) Qd_NewPixMap , 1 ,
PyDoc_STR ( " () -> (PixMapHandle _rv) " ) } ,
{ " DisposePixMap " , ( PyCFunction ) Qd_DisposePixMap , 1 ,
PyDoc_STR ( " (PixMapHandle pm) -> None " ) } ,
{ " CopyPixMap " , ( PyCFunction ) Qd_CopyPixMap , 1 ,
PyDoc_STR ( " (PixMapHandle srcPM, PixMapHandle dstPM) -> None " ) } ,
{ " NewPixPat " , ( PyCFunction ) Qd_NewPixPat , 1 ,
PyDoc_STR ( " () -> (PixPatHandle _rv) " ) } ,
{ " DisposePixPat " , ( PyCFunction ) Qd_DisposePixPat , 1 ,
PyDoc_STR ( " (PixPatHandle pp) -> None " ) } ,
{ " CopyPixPat " , ( PyCFunction ) Qd_CopyPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle srcPP, PixPatHandle dstPP) -> None " ) } ,
{ " PenPixPat " , ( PyCFunction ) Qd_PenPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle pp) -> None " ) } ,
{ " BackPixPat " , ( PyCFunction ) Qd_BackPixPat , 1 ,
PyDoc_STR ( " (PixPatHandle pp) -> None " ) } ,
{ " GetPixPat " , ( PyCFunction ) Qd_GetPixPat , 1 ,
PyDoc_STR ( " (short patID) -> (PixPatHandle _rv) " ) } ,
{ " MakeRGBPat " , ( PyCFunction ) Qd_MakeRGBPat , 1 ,
PyDoc_STR ( " (PixPatHandle pp, RGBColor myColor) -> None " ) } ,
{ " FillCRect " , ( PyCFunction ) Qd_FillCRect , 1 ,
PyDoc_STR ( " (Rect r, PixPatHandle pp) -> None " ) } ,
{ " FillCOval " , ( PyCFunction ) Qd_FillCOval , 1 ,
PyDoc_STR ( " (Rect r, PixPatHandle pp) -> None " ) } ,
{ " FillCRoundRect " , ( PyCFunction ) Qd_FillCRoundRect , 1 ,
PyDoc_STR ( " (Rect r, short ovalWidth, short ovalHeight, PixPatHandle pp) -> None " ) } ,
{ " FillCArc " , ( PyCFunction ) Qd_FillCArc , 1 ,
PyDoc_STR ( " (Rect r, short startAngle, short arcAngle, PixPatHandle pp) -> None " ) } ,
{ " FillCRgn " , ( PyCFunction ) Qd_FillCRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, PixPatHandle pp) -> None " ) } ,
{ " FillCPoly " , ( PyCFunction ) Qd_FillCPoly , 1 ,
PyDoc_STR ( " (PolyHandle poly, PixPatHandle pp) -> None " ) } ,
{ " RGBForeColor " , ( PyCFunction ) Qd_RGBForeColor , 1 ,
PyDoc_STR ( " (RGBColor color) -> None " ) } ,
{ " RGBBackColor " , ( PyCFunction ) Qd_RGBBackColor , 1 ,
PyDoc_STR ( " (RGBColor color) -> None " ) } ,
{ " SetCPixel " , ( PyCFunction ) Qd_SetCPixel , 1 ,
PyDoc_STR ( " (short h, short v, RGBColor cPix) -> None " ) } ,
{ " SetPortPix " , ( PyCFunction ) Qd_SetPortPix , 1 ,
PyDoc_STR ( " (PixMapHandle pm) -> None " ) } ,
{ " GetCPixel " , ( PyCFunction ) Qd_GetCPixel , 1 ,
PyDoc_STR ( " (short h, short v) -> (RGBColor cPix) " ) } ,
{ " GetForeColor " , ( PyCFunction ) Qd_GetForeColor , 1 ,
PyDoc_STR ( " () -> (RGBColor color) " ) } ,
{ " GetBackColor " , ( PyCFunction ) Qd_GetBackColor , 1 ,
PyDoc_STR ( " () -> (RGBColor color) " ) } ,
{ " OpColor " , ( PyCFunction ) Qd_OpColor , 1 ,
PyDoc_STR ( " (RGBColor color) -> None " ) } ,
{ " HiliteColor " , ( PyCFunction ) Qd_HiliteColor , 1 ,
PyDoc_STR ( " (RGBColor color) -> None " ) } ,
{ " DisposeCTable " , ( PyCFunction ) Qd_DisposeCTable , 1 ,
PyDoc_STR ( " (CTabHandle cTable) -> None " ) } ,
{ " GetCTable " , ( PyCFunction ) Qd_GetCTable , 1 ,
PyDoc_STR ( " (short ctID) -> (CTabHandle _rv) " ) } ,
{ " GetCCursor " , ( PyCFunction ) Qd_GetCCursor , 1 ,
PyDoc_STR ( " (short crsrID) -> (CCrsrHandle _rv) " ) } ,
{ " SetCCursor " , ( PyCFunction ) Qd_SetCCursor , 1 ,
PyDoc_STR ( " (CCrsrHandle cCrsr) -> None " ) } ,
{ " AllocCursor " , ( PyCFunction ) Qd_AllocCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " DisposeCCursor " , ( PyCFunction ) Qd_DisposeCCursor , 1 ,
PyDoc_STR ( " (CCrsrHandle cCrsr) -> None " ) } ,
{ " GetMaxDevice " , ( PyCFunction ) Qd_GetMaxDevice , 1 ,
PyDoc_STR ( " (Rect globalRect) -> (GDHandle _rv) " ) } ,
{ " GetCTSeed " , ( PyCFunction ) Qd_GetCTSeed , 1 ,
PyDoc_STR ( " () -> (long _rv) " ) } ,
{ " GetDeviceList " , ( PyCFunction ) Qd_GetDeviceList , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " GetMainDevice " , ( PyCFunction ) Qd_GetMainDevice , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " GetNextDevice " , ( PyCFunction ) Qd_GetNextDevice , 1 ,
PyDoc_STR ( " (GDHandle curDevice) -> (GDHandle _rv) " ) } ,
{ " TestDeviceAttribute " , ( PyCFunction ) Qd_TestDeviceAttribute , 1 ,
PyDoc_STR ( " (GDHandle gdh, short attribute) -> (Boolean _rv) " ) } ,
{ " SetDeviceAttribute " , ( PyCFunction ) Qd_SetDeviceAttribute , 1 ,
PyDoc_STR ( " (GDHandle gdh, short attribute, Boolean value) -> None " ) } ,
{ " InitGDevice " , ( PyCFunction ) Qd_InitGDevice , 1 ,
PyDoc_STR ( " (short qdRefNum, long mode, GDHandle gdh) -> None " ) } ,
{ " NewGDevice " , ( PyCFunction ) Qd_NewGDevice , 1 ,
PyDoc_STR ( " (short refNum, long mode) -> (GDHandle _rv) " ) } ,
{ " DisposeGDevice " , ( PyCFunction ) Qd_DisposeGDevice , 1 ,
PyDoc_STR ( " (GDHandle gdh) -> None " ) } ,
{ " SetGDevice " , ( PyCFunction ) Qd_SetGDevice , 1 ,
PyDoc_STR ( " (GDHandle gd) -> None " ) } ,
{ " GetGDevice " , ( PyCFunction ) Qd_GetGDevice , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " Color2Index " , ( PyCFunction ) Qd_Color2Index , 1 ,
PyDoc_STR ( " (RGBColor myColor) -> (long _rv) " ) } ,
{ " Index2Color " , ( PyCFunction ) Qd_Index2Color , 1 ,
PyDoc_STR ( " (long index) -> (RGBColor aColor) " ) } ,
{ " InvertColor " , ( PyCFunction ) Qd_InvertColor , 1 ,
PyDoc_STR ( " () -> (RGBColor myColor) " ) } ,
{ " RealColor " , ( PyCFunction ) Qd_RealColor , 1 ,
PyDoc_STR ( " (RGBColor color) -> (Boolean _rv) " ) } ,
{ " GetSubTable " , ( PyCFunction ) Qd_GetSubTable , 1 ,
PyDoc_STR ( " (CTabHandle myColors, short iTabRes, CTabHandle targetTbl) -> None " ) } ,
{ " MakeITable " , ( PyCFunction ) Qd_MakeITable , 1 ,
PyDoc_STR ( " (CTabHandle cTabH, ITabHandle iTabH, short res) -> None " ) } ,
{ " SetClientID " , ( PyCFunction ) Qd_SetClientID , 1 ,
PyDoc_STR ( " (short id) -> None " ) } ,
{ " ProtectEntry " , ( PyCFunction ) Qd_ProtectEntry , 1 ,
PyDoc_STR ( " (short index, Boolean protect) -> None " ) } ,
{ " ReserveEntry " , ( PyCFunction ) Qd_ReserveEntry , 1 ,
PyDoc_STR ( " (short index, Boolean reserve) -> None " ) } ,
{ " QDError " , ( PyCFunction ) Qd_QDError , 1 ,
PyDoc_STR ( " () -> (short _rv) " ) } ,
{ " CopyDeepMask " , ( PyCFunction ) Qd_CopyDeepMask , 1 ,
PyDoc_STR ( " (BitMapPtr srcBits, BitMapPtr maskBits, BitMapPtr dstBits, Rect srcRect, Rect maskRect, Rect dstRect, short mode, RgnHandle maskRgn) -> None " ) } ,
{ " GetPattern " , ( PyCFunction ) Qd_GetPattern , 1 ,
PyDoc_STR ( " (short patternID) -> (PatHandle _rv) " ) } ,
{ " MacGetCursor " , ( PyCFunction ) Qd_MacGetCursor , 1 ,
PyDoc_STR ( " (short cursorID) -> (CursHandle _rv) " ) } ,
{ " GetPicture " , ( PyCFunction ) Qd_GetPicture , 1 ,
PyDoc_STR ( " (short pictureID) -> (PicHandle _rv) " ) } ,
{ " DeltaPoint " , ( PyCFunction ) Qd_DeltaPoint , 1 ,
PyDoc_STR ( " (Point ptA, Point ptB) -> (long _rv) " ) } ,
{ " ShieldCursor " , ( PyCFunction ) Qd_ShieldCursor , 1 ,
PyDoc_STR ( " (Rect shieldRect, Point offsetPt) -> None " ) } ,
{ " ScreenRes " , ( PyCFunction ) Qd_ScreenRes , 1 ,
PyDoc_STR ( " () -> (short scrnHRes, short scrnVRes) " ) } ,
{ " GetIndPattern " , ( PyCFunction ) Qd_GetIndPattern , 1 ,
PyDoc_STR ( " (short patternListID, short index) -> (Pattern thePat) " ) } ,
{ " SlopeFromAngle " , ( PyCFunction ) Qd_SlopeFromAngle , 1 ,
PyDoc_STR ( " (short angle) -> (Fixed _rv) " ) } ,
{ " AngleFromSlope " , ( PyCFunction ) Qd_AngleFromSlope , 1 ,
PyDoc_STR ( " (Fixed slope) -> (short _rv) " ) } ,
{ " GetPixBounds " , ( PyCFunction ) Qd_GetPixBounds , 1 ,
PyDoc_STR ( " (PixMapHandle pixMap) -> (Rect bounds) " ) } ,
{ " GetPixDepth " , ( PyCFunction ) Qd_GetPixDepth , 1 ,
PyDoc_STR ( " (PixMapHandle pixMap) -> (short _rv) " ) } ,
{ " GetQDGlobalsRandomSeed " , ( PyCFunction ) Qd_GetQDGlobalsRandomSeed , 1 ,
PyDoc_STR ( " () -> (long _rv) " ) } ,
{ " GetQDGlobalsScreenBits " , ( PyCFunction ) Qd_GetQDGlobalsScreenBits , 1 ,
PyDoc_STR ( " () -> (BitMap screenBits) " ) } ,
{ " GetQDGlobalsArrow " , ( PyCFunction ) Qd_GetQDGlobalsArrow , 1 ,
PyDoc_STR ( " () -> (Cursor arrow) " ) } ,
{ " GetQDGlobalsDarkGray " , ( PyCFunction ) Qd_GetQDGlobalsDarkGray , 1 ,
PyDoc_STR ( " () -> (Pattern dkGray) " ) } ,
{ " GetQDGlobalsLightGray " , ( PyCFunction ) Qd_GetQDGlobalsLightGray , 1 ,
PyDoc_STR ( " () -> (Pattern ltGray) " ) } ,
{ " GetQDGlobalsGray " , ( PyCFunction ) Qd_GetQDGlobalsGray , 1 ,
PyDoc_STR ( " () -> (Pattern gray) " ) } ,
{ " GetQDGlobalsBlack " , ( PyCFunction ) Qd_GetQDGlobalsBlack , 1 ,
PyDoc_STR ( " () -> (Pattern black) " ) } ,
{ " GetQDGlobalsWhite " , ( PyCFunction ) Qd_GetQDGlobalsWhite , 1 ,
PyDoc_STR ( " () -> (Pattern white) " ) } ,
{ " GetQDGlobalsThePort " , ( PyCFunction ) Qd_GetQDGlobalsThePort , 1 ,
PyDoc_STR ( " () -> (CGrafPtr _rv) " ) } ,
{ " SetQDGlobalsRandomSeed " , ( PyCFunction ) Qd_SetQDGlobalsRandomSeed , 1 ,
PyDoc_STR ( " (long randomSeed) -> None " ) } ,
{ " SetQDGlobalsArrow " , ( PyCFunction ) Qd_SetQDGlobalsArrow , 1 ,
PyDoc_STR ( " (Cursor arrow) -> None " ) } ,
{ " GetRegionBounds " , ( PyCFunction ) Qd_GetRegionBounds , 1 ,
PyDoc_STR ( " (RgnHandle region) -> (Rect bounds) " ) } ,
{ " IsRegionRectangular " , ( PyCFunction ) Qd_IsRegionRectangular , 1 ,
PyDoc_STR ( " (RgnHandle region) -> (Boolean _rv) " ) } ,
{ " CreateNewPort " , ( PyCFunction ) Qd_CreateNewPort , 1 ,
PyDoc_STR ( " () -> (CGrafPtr _rv) " ) } ,
{ " SetQDError " , ( PyCFunction ) Qd_SetQDError , 1 ,
PyDoc_STR ( " (OSErr err) -> None " ) } ,
{ " LMGetScrVRes " , ( PyCFunction ) Qd_LMGetScrVRes , 1 ,
PyDoc_STR ( " () -> (SInt16 _rv) " ) } ,
{ " LMSetScrVRes " , ( PyCFunction ) Qd_LMSetScrVRes , 1 ,
PyDoc_STR ( " (SInt16 value) -> None " ) } ,
{ " LMGetScrHRes " , ( PyCFunction ) Qd_LMGetScrHRes , 1 ,
PyDoc_STR ( " () -> (SInt16 _rv) " ) } ,
{ " LMSetScrHRes " , ( PyCFunction ) Qd_LMSetScrHRes , 1 ,
PyDoc_STR ( " (SInt16 value) -> None " ) } ,
{ " LMGetMainDevice " , ( PyCFunction ) Qd_LMGetMainDevice , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " LMSetMainDevice " , ( PyCFunction ) Qd_LMSetMainDevice , 1 ,
PyDoc_STR ( " (GDHandle value) -> None " ) } ,
{ " LMGetDeviceList " , ( PyCFunction ) Qd_LMGetDeviceList , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " LMSetDeviceList " , ( PyCFunction ) Qd_LMSetDeviceList , 1 ,
PyDoc_STR ( " (GDHandle value) -> None " ) } ,
{ " LMGetQDColors " , ( PyCFunction ) Qd_LMGetQDColors , 1 ,
PyDoc_STR ( " () -> (Handle _rv) " ) } ,
{ " LMSetQDColors " , ( PyCFunction ) Qd_LMSetQDColors , 1 ,
PyDoc_STR ( " (Handle value) -> None " ) } ,
{ " LMGetWidthListHand " , ( PyCFunction ) Qd_LMGetWidthListHand , 1 ,
PyDoc_STR ( " () -> (Handle _rv) " ) } ,
{ " LMSetWidthListHand " , ( PyCFunction ) Qd_LMSetWidthListHand , 1 ,
PyDoc_STR ( " (Handle value) -> None " ) } ,
{ " LMGetHiliteMode " , ( PyCFunction ) Qd_LMGetHiliteMode , 1 ,
PyDoc_STR ( " () -> (UInt8 _rv) " ) } ,
{ " LMSetHiliteMode " , ( PyCFunction ) Qd_LMSetHiliteMode , 1 ,
PyDoc_STR ( " (UInt8 value) -> None " ) } ,
{ " LMGetWidthTabHandle " , ( PyCFunction ) Qd_LMGetWidthTabHandle , 1 ,
PyDoc_STR ( " () -> (Handle _rv) " ) } ,
{ " LMSetWidthTabHandle " , ( PyCFunction ) Qd_LMSetWidthTabHandle , 1 ,
PyDoc_STR ( " (Handle value) -> None " ) } ,
{ " LMGetLastSPExtra " , ( PyCFunction ) Qd_LMGetLastSPExtra , 1 ,
PyDoc_STR ( " () -> (SInt32 _rv) " ) } ,
{ " LMSetLastSPExtra " , ( PyCFunction ) Qd_LMSetLastSPExtra , 1 ,
PyDoc_STR ( " (SInt32 value) -> None " ) } ,
{ " LMGetLastFOND " , ( PyCFunction ) Qd_LMGetLastFOND , 1 ,
PyDoc_STR ( " () -> (Handle _rv) " ) } ,
{ " LMSetLastFOND " , ( PyCFunction ) Qd_LMSetLastFOND , 1 ,
PyDoc_STR ( " (Handle value) -> None " ) } ,
{ " LMGetFractEnable " , ( PyCFunction ) Qd_LMGetFractEnable , 1 ,
PyDoc_STR ( " () -> (UInt8 _rv) " ) } ,
{ " LMSetFractEnable " , ( PyCFunction ) Qd_LMSetFractEnable , 1 ,
PyDoc_STR ( " (UInt8 value) -> None " ) } ,
{ " LMGetTheGDevice " , ( PyCFunction ) Qd_LMGetTheGDevice , 1 ,
PyDoc_STR ( " () -> (GDHandle _rv) " ) } ,
{ " LMSetTheGDevice " , ( PyCFunction ) Qd_LMSetTheGDevice , 1 ,
PyDoc_STR ( " (GDHandle value) -> None " ) } ,
{ " LMGetHiliteRGB " , ( PyCFunction ) Qd_LMGetHiliteRGB , 1 ,
PyDoc_STR ( " () -> (RGBColor hiliteRGBValue) " ) } ,
{ " LMSetHiliteRGB " , ( PyCFunction ) Qd_LMSetHiliteRGB , 1 ,
PyDoc_STR ( " (RGBColor hiliteRGBValue) -> None " ) } ,
{ " LMGetCursorNew " , ( PyCFunction ) Qd_LMGetCursorNew , 1 ,
PyDoc_STR ( " () -> (Boolean _rv) " ) } ,
{ " LMSetCursorNew " , ( PyCFunction ) Qd_LMSetCursorNew , 1 ,
PyDoc_STR ( " (Boolean value) -> None " ) } ,
{ " TextFont " , ( PyCFunction ) Qd_TextFont , 1 ,
PyDoc_STR ( " (short font) -> None " ) } ,
{ " TextFace " , ( PyCFunction ) Qd_TextFace , 1 ,
PyDoc_STR ( " (StyleParameter face) -> None " ) } ,
{ " TextMode " , ( PyCFunction ) Qd_TextMode , 1 ,
PyDoc_STR ( " (short mode) -> None " ) } ,
{ " TextSize " , ( PyCFunction ) Qd_TextSize , 1 ,
PyDoc_STR ( " (short size) -> None " ) } ,
{ " SpaceExtra " , ( PyCFunction ) Qd_SpaceExtra , 1 ,
PyDoc_STR ( " (Fixed extra) -> None " ) } ,
{ " DrawChar " , ( PyCFunction ) Qd_DrawChar , 1 ,
PyDoc_STR ( " (CharParameter ch) -> None " ) } ,
{ " DrawString " , ( PyCFunction ) Qd_DrawString , 1 ,
PyDoc_STR ( " (Str255 s) -> None " ) } ,
{ " MacDrawText " , ( PyCFunction ) Qd_MacDrawText , 1 ,
PyDoc_STR ( " (Buffer textBuf, short firstByte, short byteCount) -> None " ) } ,
{ " CharWidth " , ( PyCFunction ) Qd_CharWidth , 1 ,
PyDoc_STR ( " (CharParameter ch) -> (short _rv) " ) } ,
{ " StringWidth " , ( PyCFunction ) Qd_StringWidth , 1 ,
PyDoc_STR ( " (Str255 s) -> (short _rv) " ) } ,
{ " TextWidth " , ( PyCFunction ) Qd_TextWidth , 1 ,
PyDoc_STR ( " (Buffer textBuf, short firstByte, short byteCount) -> (short _rv) " ) } ,
{ " GetFontInfo " , ( PyCFunction ) Qd_GetFontInfo , 1 ,
PyDoc_STR ( " () -> (FontInfo info) " ) } ,
{ " CharExtra " , ( PyCFunction ) Qd_CharExtra , 1 ,
PyDoc_STR ( " (Fixed extra) -> None " ) } ,
{ " TruncString " , ( PyCFunction ) Qd_TruncString , 1 ,
PyDoc_STR ( " (short width, Str255 theString, TruncCode truncWhere) -> (short _rv) " ) } ,
{ " SetPort " , ( PyCFunction ) Qd_SetPort , 1 ,
PyDoc_STR ( " (GrafPtr thePort) -> None " ) } ,
{ " GetCursor " , ( PyCFunction ) Qd_GetCursor , 1 ,
PyDoc_STR ( " (short cursorID) -> (CursHandle _rv) " ) } ,
{ " SetCursor " , ( PyCFunction ) Qd_SetCursor , 1 ,
PyDoc_STR ( " (Cursor crsr) -> None " ) } ,
{ " ShowCursor " , ( PyCFunction ) Qd_ShowCursor , 1 ,
PyDoc_STR ( " () -> None " ) } ,
{ " LineTo " , ( PyCFunction ) Qd_LineTo , 1 ,
PyDoc_STR ( " (short h, short v) -> None " ) } ,
{ " SetRect " , ( PyCFunction ) Qd_SetRect , 1 ,
PyDoc_STR ( " (short left, short top, short right, short bottom) -> (Rect r) " ) } ,
{ " OffsetRect " , ( PyCFunction ) Qd_OffsetRect , 1 ,
PyDoc_STR ( " (Rect r, short dh, short dv) -> (Rect r) " ) } ,
{ " InsetRect " , ( PyCFunction ) Qd_InsetRect , 1 ,
PyDoc_STR ( " (Rect r, short dh, short dv) -> (Rect r) " ) } ,
{ " UnionRect " , ( PyCFunction ) Qd_UnionRect , 1 ,
PyDoc_STR ( " (Rect src1, Rect src2) -> (Rect dstRect) " ) } ,
{ " EqualRect " , ( PyCFunction ) Qd_EqualRect , 1 ,
PyDoc_STR ( " (Rect rect1, Rect rect2) -> (Boolean _rv) " ) } ,
{ " FrameRect " , ( PyCFunction ) Qd_FrameRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " InvertRect " , ( PyCFunction ) Qd_InvertRect , 1 ,
PyDoc_STR ( " (Rect r) -> None " ) } ,
{ " FillRect " , ( PyCFunction ) Qd_FillRect , 1 ,
PyDoc_STR ( " (Rect r, Pattern pat) -> None " ) } ,
{ " CopyRgn " , ( PyCFunction ) Qd_CopyRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgn, RgnHandle dstRgn) -> None " ) } ,
{ " SetRectRgn " , ( PyCFunction ) Qd_SetRectRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, short left, short top, short right, short bottom) -> None " ) } ,
{ " OffsetRgn " , ( PyCFunction ) Qd_OffsetRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, short dh, short dv) -> None " ) } ,
{ " UnionRgn " , ( PyCFunction ) Qd_UnionRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " XorRgn " , ( PyCFunction ) Qd_XorRgn , 1 ,
PyDoc_STR ( " (RgnHandle srcRgnA, RgnHandle srcRgnB, RgnHandle dstRgn) -> None " ) } ,
{ " EqualRgn " , ( PyCFunction ) Qd_EqualRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgnA, RgnHandle rgnB) -> (Boolean _rv) " ) } ,
{ " FrameRgn " , ( PyCFunction ) Qd_FrameRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " PaintRgn " , ( PyCFunction ) Qd_PaintRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " InvertRgn " , ( PyCFunction ) Qd_InvertRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn) -> None " ) } ,
{ " FillRgn " , ( PyCFunction ) Qd_FillRgn , 1 ,
PyDoc_STR ( " (RgnHandle rgn, Pattern pat) -> None " ) } ,
{ " GetPixel " , ( PyCFunction ) Qd_GetPixel , 1 ,
PyDoc_STR ( " (short h, short v) -> (Boolean _rv) " ) } ,
{ " PtInRect " , ( PyCFunction ) Qd_PtInRect , 1 ,
PyDoc_STR ( " (Point pt, Rect r) -> (Boolean _rv) " ) } ,
{ " DrawText " , ( PyCFunction ) Qd_DrawText , 1 ,
PyDoc_STR ( " (Buffer textBuf, short firstByte, short byteCount) -> None " ) } ,
{ " BitMap " , ( PyCFunction ) Qd_BitMap , 1 ,
PyDoc_STR ( " Take (string, int, Rect) argument and create BitMap " ) } ,
{ " RawBitMap " , ( PyCFunction ) Qd_RawBitMap , 1 ,
PyDoc_STR ( " Take string BitMap and turn into BitMap object " ) } ,
2008-06-05 09:58:24 -03:00
# endif /* __LP64__ */
2010-05-09 12:15:40 -03:00
{ NULL , NULL , 0 }
2001-08-23 11:02:09 -03:00
} ;
2008-06-05 09:58:24 -03:00
# ifndef __LP64__
2001-08-23 11:02:09 -03:00
/* Like BMObj_New, but the original bitmap data structure is copied (and
* * released when the object is released )
*/
PyObject * BMObj_NewCopied ( BitMapPtr itself )
{
2010-05-09 12:15:40 -03:00
BitMapObject * it ;
BitMapPtr itself_copy ;
2005-07-03 17:59:44 -03:00
2010-05-09 12:15:40 -03:00
if ( ( itself_copy = ( BitMapPtr ) malloc ( sizeof ( BitMap ) ) ) = = NULL )
return PyErr_NoMemory ( ) ;
* itself_copy = * itself ;
it = ( BitMapObject * ) BMObj_New ( itself_copy ) ;
it - > referred_bitmap = itself_copy ;
return ( PyObject * ) it ;
2001-08-23 11:02:09 -03:00
}
2008-06-05 09:58:24 -03:00
# endif /* __LP64__ */
2001-08-23 11:02:09 -03:00
void init_Qd ( void )
{
2010-05-09 12:15:40 -03:00
PyObject * m ;
2008-06-05 09:58:24 -03:00
# ifndef __LP64__
2010-05-09 12:15:40 -03:00
PyObject * d ;
2001-08-23 11:02:09 -03:00
2010-05-09 12:15:40 -03:00
PyMac_INIT_TOOLBOX_OBJECT_NEW ( BitMapPtr , BMObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( BitMapPtr , BMObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( GrafPtr , GrafObj_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( GrafPtr , GrafObj_Convert ) ;
PyMac_INIT_TOOLBOX_OBJECT_NEW ( RGBColorPtr , QdRGB_New ) ;
PyMac_INIT_TOOLBOX_OBJECT_CONVERT ( RGBColor , QdRGB_Convert ) ;
2001-08-23 11:02:09 -03:00
2008-06-05 09:58:24 -03:00
# endif /* __LP64__ */
2001-08-23 11:02:09 -03:00
2010-05-09 12:15:40 -03:00
m = Py_InitModule ( " _Qd " , Qd_methods ) ;
2008-06-05 09:58:24 -03:00
# ifndef __LP64__
2010-05-09 12:15:40 -03:00
d = PyModule_GetDict ( m ) ;
Qd_Error = PyMac_GetOSErrException ( ) ;
if ( Qd_Error = = NULL | |
PyDict_SetItemString ( d , " Error " , Qd_Error ) ! = 0 )
return ;
GrafPort_Type . ob_type = & PyType_Type ;
if ( PyType_Ready ( & GrafPort_Type ) < 0 ) return ;
Py_INCREF ( & GrafPort_Type ) ;
PyModule_AddObject ( m , " GrafPort " , ( PyObject * ) & GrafPort_Type ) ;
/* Backward-compatible name */
Py_INCREF ( & GrafPort_Type ) ;
PyModule_AddObject ( m , " GrafPortType " , ( PyObject * ) & GrafPort_Type ) ;
BitMap_Type . ob_type = & PyType_Type ;
if ( PyType_Ready ( & BitMap_Type ) < 0 ) return ;
Py_INCREF ( & BitMap_Type ) ;
PyModule_AddObject ( m , " BitMap " , ( PyObject * ) & BitMap_Type ) ;
/* Backward-compatible name */
Py_INCREF ( & BitMap_Type ) ;
PyModule_AddObject ( m , " BitMapType " , ( PyObject * ) & BitMap_Type ) ;
2008-06-05 09:58:24 -03:00
# endif /* __LP64__ */
2001-08-23 11:02:09 -03:00
}
/* ========================= End module _Qd ========================= */