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