Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Mac/Modules/qdoffs/_Qdoffsmodule.c

    r2 r391  
    55
    66
    7 #ifndef __LP64__
     7#include <Carbon/Carbon.h>
     8#if !defined(__LP64__) && !defined(MAC_OS_X_VERSION_10_7)
    89
    910#include "pymactoolbox.h"
     
    1112/* Macro to test whether a weak-loaded CFM function exists */
    1213#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL )  {\
    13         PyErr_SetString(PyExc_NotImplementedError, \
    14         "Not available in this shared library/OS version"); \
    15         return NULL; \
     14    PyErr_SetString(PyExc_NotImplementedError, \
     15    "Not available in this shared library/OS version"); \
     16    return NULL; \
    1617    }} while(0)
    1718
    1819
    19 #include <Carbon/Carbon.h>
    2020
    2121#ifdef USE_TOOLBOX_OBJECT_GLUE
     
    3939
    4040typedef struct GWorldObject {
    41         PyObject_HEAD
    42         GWorldPtr ob_itself;
     41    PyObject_HEAD
     42    GWorldPtr ob_itself;
    4343} GWorldObject;
    4444
    4545PyObject *GWorldObj_New(GWorldPtr itself)
    4646{
    47         GWorldObject *it;
    48         if (itself == NULL) return PyMac_Error(resNotFound);
    49         it = PyObject_NEW(GWorldObject, &GWorld_Type);
    50         if (it == NULL) return NULL;
    51         it->ob_itself = itself;
    52         return (PyObject *)it;
     47    GWorldObject *it;
     48    if (itself == NULL) return PyMac_Error(resNotFound);
     49    it = PyObject_NEW(GWorldObject, &GWorld_Type);
     50    if (it == NULL) return NULL;
     51    it->ob_itself = itself;
     52    return (PyObject *)it;
    5353}
    5454
    5555int GWorldObj_Convert(PyObject *v, GWorldPtr *p_itself)
    5656{
    57         if (!GWorldObj_Check(v))
    58         {
    59                 PyErr_SetString(PyExc_TypeError, "GWorld required");
    60                 return 0;
    61         }
    62         *p_itself = ((GWorldObject *)v)->ob_itself;
    63         return 1;
     57    if (!GWorldObj_Check(v))
     58    {
     59        PyErr_SetString(PyExc_TypeError, "GWorld required");
     60        return 0;
     61    }
     62    *p_itself = ((GWorldObject *)v)->ob_itself;
     63    return 1;
    6464}
    6565
    6666static void GWorldObj_dealloc(GWorldObject *self)
    6767{
    68         DisposeGWorld(self->ob_itself);
    69         self->ob_type->tp_free((PyObject *)self);
     68    DisposeGWorld(self->ob_itself);
     69    self->ob_type->tp_free((PyObject *)self);
    7070}
    7171
    7272static PyObject *GWorldObj_GetGWorldDevice(GWorldObject *_self, PyObject *_args)
    7373{
    74         PyObject *_res = NULL;
    75         GDHandle _rv;
     74    PyObject *_res = NULL;
     75    GDHandle _rv;
    7676#ifndef GetGWorldDevice
    77         PyMac_PRECHECK(GetGWorldDevice);
    78 #endif
    79         if (!PyArg_ParseTuple(_args, ""))
    80                 return NULL;
    81         _rv = GetGWorldDevice(_self->ob_itself);
    82         _res = Py_BuildValue("O&",
    83                              ResObj_New, _rv);
    84         return _res;
     77    PyMac_PRECHECK(GetGWorldDevice);
     78#endif
     79    if (!PyArg_ParseTuple(_args, ""))
     80        return NULL;
     81    _rv = GetGWorldDevice(_self->ob_itself);
     82    _res = Py_BuildValue("O&",
     83                         ResObj_New, _rv);
     84    return _res;
    8585}
    8686
    8787static PyObject *GWorldObj_GetGWorldPixMap(GWorldObject *_self, PyObject *_args)
    8888{
    89         PyObject *_res = NULL;
    90         PixMapHandle _rv;
     89    PyObject *_res = NULL;
     90    PixMapHandle _rv;
    9191#ifndef GetGWorldPixMap
    92         PyMac_PRECHECK(GetGWorldPixMap);
    93 #endif
    94         if (!PyArg_ParseTuple(_args, ""))
    95                 return NULL;
    96         _rv = GetGWorldPixMap(_self->ob_itself);
    97         _res = Py_BuildValue("O&",
    98                              ResObj_New, _rv);
    99         return _res;
     92    PyMac_PRECHECK(GetGWorldPixMap);
     93#endif
     94    if (!PyArg_ParseTuple(_args, ""))
     95        return NULL;
     96    _rv = GetGWorldPixMap(_self->ob_itself);
     97    _res = Py_BuildValue("O&",
     98                         ResObj_New, _rv);
     99    return _res;
    100100}
    101101
    102102static PyObject *GWorldObj_as_GrafPtr(GWorldObject *_self, PyObject *_args)
    103103{
    104         PyObject *_res = NULL;
    105         GrafPtr _rv;
     104    PyObject *_res = NULL;
     105    GrafPtr _rv;
    106106#ifndef as_GrafPtr
    107         PyMac_PRECHECK(as_GrafPtr);
    108 #endif
    109         if (!PyArg_ParseTuple(_args, ""))
    110                 return NULL;
    111         _rv = as_GrafPtr(_self->ob_itself);
    112         _res = Py_BuildValue("O&",
    113                              GrafObj_New, _rv);
    114         return _res;
     107    PyMac_PRECHECK(as_GrafPtr);
     108#endif
     109    if (!PyArg_ParseTuple(_args, ""))
     110        return NULL;
     111    _rv = as_GrafPtr(_self->ob_itself);
     112    _res = Py_BuildValue("O&",
     113                         GrafObj_New, _rv);
     114    return _res;
    115115}
    116116
    117117static PyMethodDef GWorldObj_methods[] = {
    118         {"GetGWorldDevice", (PyCFunction)GWorldObj_GetGWorldDevice, 1,
    119         PyDoc_STR("() -> (GDHandle _rv)")},
    120         {"GetGWorldPixMap", (PyCFunction)GWorldObj_GetGWorldPixMap, 1,
    121         PyDoc_STR("() -> (PixMapHandle _rv)")},
    122         {"as_GrafPtr", (PyCFunction)GWorldObj_as_GrafPtr, 1,
    123         PyDoc_STR("() -> (GrafPtr _rv)")},
    124         {NULL, NULL, 0}
     118    {"GetGWorldDevice", (PyCFunction)GWorldObj_GetGWorldDevice, 1,
     119    PyDoc_STR("() -> (GDHandle _rv)")},
     120    {"GetGWorldPixMap", (PyCFunction)GWorldObj_GetGWorldPixMap, 1,
     121    PyDoc_STR("() -> (PixMapHandle _rv)")},
     122    {"as_GrafPtr", (PyCFunction)GWorldObj_as_GrafPtr, 1,
     123    PyDoc_STR("() -> (GrafPtr _rv)")},
     124    {NULL, NULL, 0}
    125125};
    126126
     
    139139static PyObject *GWorldObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_kwds)
    140140{
    141         PyObject *_self;
    142         GWorldPtr itself;
    143         char *kw[] = {"itself", 0};
    144 
    145         if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, GWorldObj_Convert, &itself)) return NULL;
    146         if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
    147         ((GWorldObject *)_self)->ob_itself = itself;
    148         return _self;
     141    PyObject *_self;
     142    GWorldPtr itself;
     143    char *kw[] = {"itself", 0};
     144
     145    if (!PyArg_ParseTupleAndKeywords(_args, _kwds, "O&", kw, GWorldObj_Convert, &itself)) return NULL;
     146    if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;
     147    ((GWorldObject *)_self)->ob_itself = itself;
     148    return _self;
    149149}
    150150
     
    153153
    154154PyTypeObject GWorld_Type = {
    155         PyObject_HEAD_INIT(NULL)
    156         0, /*ob_size*/
    157         "_Qdoffs.GWorld", /*tp_name*/
    158         sizeof(GWorldObject), /*tp_basicsize*/
    159         0, /*tp_itemsize*/
    160         /* methods */
    161         (destructor) GWorldObj_dealloc, /*tp_dealloc*/
    162         0, /*tp_print*/
    163         (getattrfunc)0, /*tp_getattr*/
    164         (setattrfunc)0, /*tp_setattr*/
    165         (cmpfunc) GWorldObj_compare, /*tp_compare*/
    166         (reprfunc) GWorldObj_repr, /*tp_repr*/
    167         (PyNumberMethods *)0, /* tp_as_number */
    168         (PySequenceMethods *)0, /* tp_as_sequence */
    169         (PyMappingMethods *)0, /* tp_as_mapping */
    170         (hashfunc) GWorldObj_hash, /*tp_hash*/
    171         0, /*tp_call*/
    172         0, /*tp_str*/
    173         PyObject_GenericGetAttr, /*tp_getattro*/
    174         PyObject_GenericSetAttr, /*tp_setattro */
    175         0, /*tp_as_buffer*/
    176         Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
    177         0, /*tp_doc*/
    178         0, /*tp_traverse*/
    179         0, /*tp_clear*/
    180         0, /*tp_richcompare*/
    181         0, /*tp_weaklistoffset*/
    182         0, /*tp_iter*/
    183         0, /*tp_iternext*/
    184         GWorldObj_methods, /* tp_methods */
    185         0, /*tp_members*/
    186         GWorldObj_getsetlist, /*tp_getset*/
    187         0, /*tp_base*/
    188         0, /*tp_dict*/
    189         0, /*tp_descr_get*/
    190         0, /*tp_descr_set*/
    191         0, /*tp_dictoffset*/
    192         GWorldObj_tp_init, /* tp_init */
    193         GWorldObj_tp_alloc, /* tp_alloc */
    194         GWorldObj_tp_new, /* tp_new */
    195         GWorldObj_tp_free, /* tp_free */
     155    PyObject_HEAD_INIT(NULL)
     156    0, /*ob_size*/
     157    "_Qdoffs.GWorld", /*tp_name*/
     158    sizeof(GWorldObject), /*tp_basicsize*/
     159    0, /*tp_itemsize*/
     160    /* methods */
     161    (destructor) GWorldObj_dealloc, /*tp_dealloc*/
     162    0, /*tp_print*/
     163    (getattrfunc)0, /*tp_getattr*/
     164    (setattrfunc)0, /*tp_setattr*/
     165    (cmpfunc) GWorldObj_compare, /*tp_compare*/
     166    (reprfunc) GWorldObj_repr, /*tp_repr*/
     167    (PyNumberMethods *)0, /* tp_as_number */
     168    (PySequenceMethods *)0, /* tp_as_sequence */
     169    (PyMappingMethods *)0, /* tp_as_mapping */
     170    (hashfunc) GWorldObj_hash, /*tp_hash*/
     171    0, /*tp_call*/
     172    0, /*tp_str*/
     173    PyObject_GenericGetAttr, /*tp_getattro*/
     174    PyObject_GenericSetAttr, /*tp_setattro */
     175    0, /*tp_as_buffer*/
     176    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
     177    0, /*tp_doc*/
     178    0, /*tp_traverse*/
     179    0, /*tp_clear*/
     180    0, /*tp_richcompare*/
     181    0, /*tp_weaklistoffset*/
     182    0, /*tp_iter*/
     183    0, /*tp_iternext*/
     184    GWorldObj_methods, /* tp_methods */
     185    0, /*tp_members*/
     186    GWorldObj_getsetlist, /*tp_getset*/
     187    0, /*tp_base*/
     188    0, /*tp_dict*/
     189    0, /*tp_descr_get*/
     190    0, /*tp_descr_set*/
     191    0, /*tp_dictoffset*/
     192    GWorldObj_tp_init, /* tp_init */
     193    GWorldObj_tp_alloc, /* tp_alloc */
     194    GWorldObj_tp_new, /* tp_new */
     195    GWorldObj_tp_free, /* tp_free */
    196196};
    197197
     
    201201static PyObject *Qdoffs_NewGWorld(PyObject *_self, PyObject *_args)
    202202{
    203         PyObject *_res = NULL;
    204         QDErr _err;
    205         GWorldPtr offscreenGWorld;
    206         short PixelDepth;
    207         Rect boundsRect;
    208         CTabHandle cTable;
    209         GDHandle aGDevice;
    210         GWorldFlags flags;
     203    PyObject *_res = NULL;
     204    QDErr _err;
     205    GWorldPtr offscreenGWorld;
     206    short PixelDepth;
     207    Rect boundsRect;
     208    CTabHandle cTable;
     209    GDHandle aGDevice;
     210    GWorldFlags flags;
    211211#ifndef NewGWorld
    212         PyMac_PRECHECK(NewGWorld);
    213 #endif
    214         if (!PyArg_ParseTuple(_args, "hO&O&O&l",
    215                               &PixelDepth,
    216                               PyMac_GetRect, &boundsRect,
    217                               OptResObj_Convert, &cTable,
    218                               OptResObj_Convert, &aGDevice,
    219                               &flags))
    220                 return NULL;
    221         _err = NewGWorld(&offscreenGWorld,
    222                          PixelDepth,
    223                          &boundsRect,
    224                          cTable,
    225                          aGDevice,
    226                          flags);
    227         if (_err != noErr) return PyMac_Error(_err);
    228         _res = Py_BuildValue("O&",
    229                              GWorldObj_New, offscreenGWorld);
    230         return _res;
     212    PyMac_PRECHECK(NewGWorld);
     213#endif
     214    if (!PyArg_ParseTuple(_args, "hO&O&O&l",
     215                          &PixelDepth,
     216                          PyMac_GetRect, &boundsRect,
     217                          OptResObj_Convert, &cTable,
     218                          OptResObj_Convert, &aGDevice,
     219                          &flags))
     220        return NULL;
     221    _err = NewGWorld(&offscreenGWorld,
     222                     PixelDepth,
     223                     &boundsRect,
     224                     cTable,
     225                     aGDevice,
     226                     flags);
     227    if (_err != noErr) return PyMac_Error(_err);
     228    _res = Py_BuildValue("O&",
     229                         GWorldObj_New, offscreenGWorld);
     230    return _res;
    231231}
    232232
    233233static PyObject *Qdoffs_LockPixels(PyObject *_self, PyObject *_args)
    234234{
    235         PyObject *_res = NULL;
    236         Boolean _rv;
    237         PixMapHandle pm;
     235    PyObject *_res = NULL;
     236    Boolean _rv;
     237    PixMapHandle pm;
    238238#ifndef LockPixels
    239         PyMac_PRECHECK(LockPixels);
    240 #endif
    241         if (!PyArg_ParseTuple(_args, "O&",
    242                               ResObj_Convert, &pm))
    243                 return NULL;
    244         _rv = LockPixels(pm);
    245         _res = Py_BuildValue("b",
    246                              _rv);
    247         return _res;
     239    PyMac_PRECHECK(LockPixels);
     240#endif
     241    if (!PyArg_ParseTuple(_args, "O&",
     242                          ResObj_Convert, &pm))
     243        return NULL;
     244    _rv = LockPixels(pm);
     245    _res = Py_BuildValue("b",
     246                         _rv);
     247    return _res;
    248248}
    249249
    250250static PyObject *Qdoffs_UnlockPixels(PyObject *_self, PyObject *_args)
    251251{
    252         PyObject *_res = NULL;
    253         PixMapHandle pm;
     252    PyObject *_res = NULL;
     253    PixMapHandle pm;
    254254#ifndef UnlockPixels
    255         PyMac_PRECHECK(UnlockPixels);
    256 #endif
    257         if (!PyArg_ParseTuple(_args, "O&",
    258                               ResObj_Convert, &pm))
    259                 return NULL;
    260         UnlockPixels(pm);
    261         Py_INCREF(Py_None);
    262         _res = Py_None;
    263         return _res;
     255    PyMac_PRECHECK(UnlockPixels);
     256#endif
     257    if (!PyArg_ParseTuple(_args, "O&",
     258                          ResObj_Convert, &pm))
     259        return NULL;
     260    UnlockPixels(pm);
     261    Py_INCREF(Py_None);
     262    _res = Py_None;
     263    return _res;
    264264}
    265265
    266266static PyObject *Qdoffs_UpdateGWorld(PyObject *_self, PyObject *_args)
    267267{
    268         PyObject *_res = NULL;
    269         GWorldFlags _rv;
    270         GWorldPtr offscreenGWorld;
    271         short pixelDepth;
    272         Rect boundsRect;
    273         CTabHandle cTable;
    274         GDHandle aGDevice;
    275         GWorldFlags flags;
     268    PyObject *_res = NULL;
     269    GWorldFlags _rv;
     270    GWorldPtr offscreenGWorld;
     271    short pixelDepth;
     272    Rect boundsRect;
     273    CTabHandle cTable;
     274    GDHandle aGDevice;
     275    GWorldFlags flags;
    276276#ifndef UpdateGWorld
    277         PyMac_PRECHECK(UpdateGWorld);
    278 #endif
    279         if (!PyArg_ParseTuple(_args, "hO&O&O&l",
    280                               &pixelDepth,
    281                               PyMac_GetRect, &boundsRect,
    282                               OptResObj_Convert, &cTable,
    283                               OptResObj_Convert, &aGDevice,
    284                               &flags))
    285                 return NULL;
    286         _rv = UpdateGWorld(&offscreenGWorld,
    287                            pixelDepth,
    288                            &boundsRect,
    289                            cTable,
    290                            aGDevice,
    291                            flags);
    292         _res = Py_BuildValue("lO&",
    293                              _rv,
    294                              GWorldObj_New, offscreenGWorld);
    295         return _res;
     277    PyMac_PRECHECK(UpdateGWorld);
     278#endif
     279    if (!PyArg_ParseTuple(_args, "hO&O&O&l",
     280                          &pixelDepth,
     281                          PyMac_GetRect, &boundsRect,
     282                          OptResObj_Convert, &cTable,
     283                          OptResObj_Convert, &aGDevice,
     284                          &flags))
     285        return NULL;
     286    _rv = UpdateGWorld(&offscreenGWorld,
     287                       pixelDepth,
     288                       &boundsRect,
     289                       cTable,
     290                       aGDevice,
     291                       flags);
     292    _res = Py_BuildValue("lO&",
     293                         _rv,
     294                         GWorldObj_New, offscreenGWorld);
     295    return _res;
    296296}
    297297
    298298static PyObject *Qdoffs_GetGWorld(PyObject *_self, PyObject *_args)
    299299{
    300         PyObject *_res = NULL;
    301         CGrafPtr port;
    302         GDHandle gdh;
     300    PyObject *_res = NULL;
     301    CGrafPtr port;
     302    GDHandle gdh;
    303303#ifndef GetGWorld
    304         PyMac_PRECHECK(GetGWorld);
    305 #endif
    306         if (!PyArg_ParseTuple(_args, ""))
    307                 return NULL;
    308         GetGWorld(&port,
    309                   &gdh);
    310         _res = Py_BuildValue("O&O&",
    311                              GrafObj_New, port,
    312                              ResObj_New, gdh);
    313         return _res;
     304    PyMac_PRECHECK(GetGWorld);
     305#endif
     306    if (!PyArg_ParseTuple(_args, ""))
     307        return NULL;
     308    GetGWorld(&port,
     309              &gdh);
     310    _res = Py_BuildValue("O&O&",
     311                         GrafObj_New, port,
     312                         ResObj_New, gdh);
     313    return _res;
    314314}
    315315
    316316static PyObject *Qdoffs_SetGWorld(PyObject *_self, PyObject *_args)
    317317{
    318         PyObject *_res = NULL;
    319         CGrafPtr port;
    320         GDHandle gdh;
     318    PyObject *_res = NULL;
     319    CGrafPtr port;
     320    GDHandle gdh;
    321321#ifndef SetGWorld
    322         PyMac_PRECHECK(SetGWorld);
    323 #endif
    324         if (!PyArg_ParseTuple(_args, "O&O&",
    325                               GrafObj_Convert, &port,
    326                               OptResObj_Convert, &gdh))
    327                 return NULL;
    328         SetGWorld(port,
    329                   gdh);
    330         Py_INCREF(Py_None);
    331         _res = Py_None;
    332         return _res;
     322    PyMac_PRECHECK(SetGWorld);
     323#endif
     324    if (!PyArg_ParseTuple(_args, "O&O&",
     325                          GrafObj_Convert, &port,
     326                          OptResObj_Convert, &gdh))
     327        return NULL;
     328    SetGWorld(port,
     329              gdh);
     330    Py_INCREF(Py_None);
     331    _res = Py_None;
     332    return _res;
    333333}
    334334
    335335static PyObject *Qdoffs_CTabChanged(PyObject *_self, PyObject *_args)
    336336{
    337         PyObject *_res = NULL;
    338         CTabHandle ctab;
     337    PyObject *_res = NULL;
     338    CTabHandle ctab;
    339339#ifndef CTabChanged
    340         PyMac_PRECHECK(CTabChanged);
    341 #endif
    342         if (!PyArg_ParseTuple(_args, "O&",
    343                               OptResObj_Convert, &ctab))
    344                 return NULL;
    345         CTabChanged(ctab);
    346         Py_INCREF(Py_None);
    347         _res = Py_None;
    348         return _res;
     340    PyMac_PRECHECK(CTabChanged);
     341#endif
     342    if (!PyArg_ParseTuple(_args, "O&",
     343                          OptResObj_Convert, &ctab))
     344        return NULL;
     345    CTabChanged(ctab);
     346    Py_INCREF(Py_None);
     347    _res = Py_None;
     348    return _res;
    349349}
    350350
    351351static PyObject *Qdoffs_PixPatChanged(PyObject *_self, PyObject *_args)
    352352{
    353         PyObject *_res = NULL;
    354         PixPatHandle ppat;
     353    PyObject *_res = NULL;
     354    PixPatHandle ppat;
    355355#ifndef PixPatChanged
    356         PyMac_PRECHECK(PixPatChanged);
    357 #endif
    358         if (!PyArg_ParseTuple(_args, "O&",
    359                               ResObj_Convert, &ppat))
    360                 return NULL;
    361         PixPatChanged(ppat);
    362         Py_INCREF(Py_None);
    363         _res = Py_None;
    364         return _res;
     356    PyMac_PRECHECK(PixPatChanged);
     357#endif
     358    if (!PyArg_ParseTuple(_args, "O&",
     359                          ResObj_Convert, &ppat))
     360        return NULL;
     361    PixPatChanged(ppat);
     362    Py_INCREF(Py_None);
     363    _res = Py_None;
     364    return _res;
    365365}
    366366
    367367static PyObject *Qdoffs_PortChanged(PyObject *_self, PyObject *_args)
    368368{
    369         PyObject *_res = NULL;
    370         GrafPtr port;
     369    PyObject *_res = NULL;
     370    GrafPtr port;
    371371#ifndef PortChanged
    372         PyMac_PRECHECK(PortChanged);
    373 #endif
    374         if (!PyArg_ParseTuple(_args, "O&",
    375                               GrafObj_Convert, &port))
    376                 return NULL;
    377         PortChanged(port);
    378         Py_INCREF(Py_None);
    379         _res = Py_None;
    380         return _res;
     372    PyMac_PRECHECK(PortChanged);
     373#endif
     374    if (!PyArg_ParseTuple(_args, "O&",
     375                          GrafObj_Convert, &port))
     376        return NULL;
     377    PortChanged(port);
     378    Py_INCREF(Py_None);
     379    _res = Py_None;
     380    return _res;
    381381}
    382382
    383383static PyObject *Qdoffs_GDeviceChanged(PyObject *_self, PyObject *_args)
    384384{
    385         PyObject *_res = NULL;
    386         GDHandle gdh;
     385    PyObject *_res = NULL;
     386    GDHandle gdh;
    387387#ifndef GDeviceChanged
    388         PyMac_PRECHECK(GDeviceChanged);
    389 #endif
    390         if (!PyArg_ParseTuple(_args, "O&",
    391                               OptResObj_Convert, &gdh))
    392                 return NULL;
    393         GDeviceChanged(gdh);
    394         Py_INCREF(Py_None);
    395         _res = Py_None;
    396         return _res;
     388    PyMac_PRECHECK(GDeviceChanged);
     389#endif
     390    if (!PyArg_ParseTuple(_args, "O&",
     391                          OptResObj_Convert, &gdh))
     392        return NULL;
     393    GDeviceChanged(gdh);
     394    Py_INCREF(Py_None);
     395    _res = Py_None;
     396    return _res;
    397397}
    398398
    399399static PyObject *Qdoffs_AllowPurgePixels(PyObject *_self, PyObject *_args)
    400400{
    401         PyObject *_res = NULL;
    402         PixMapHandle pm;
     401    PyObject *_res = NULL;
     402    PixMapHandle pm;
    403403#ifndef AllowPurgePixels
    404         PyMac_PRECHECK(AllowPurgePixels);
    405 #endif
    406         if (!PyArg_ParseTuple(_args, "O&",
    407                               ResObj_Convert, &pm))
    408                 return NULL;
    409         AllowPurgePixels(pm);
    410         Py_INCREF(Py_None);
    411         _res = Py_None;
    412         return _res;
     404    PyMac_PRECHECK(AllowPurgePixels);
     405#endif
     406    if (!PyArg_ParseTuple(_args, "O&",
     407                          ResObj_Convert, &pm))
     408        return NULL;
     409    AllowPurgePixels(pm);
     410    Py_INCREF(Py_None);
     411    _res = Py_None;
     412    return _res;
    413413}
    414414
    415415static PyObject *Qdoffs_NoPurgePixels(PyObject *_self, PyObject *_args)
    416416{
    417         PyObject *_res = NULL;
    418         PixMapHandle pm;
     417    PyObject *_res = NULL;
     418    PixMapHandle pm;
    419419#ifndef NoPurgePixels
    420         PyMac_PRECHECK(NoPurgePixels);
    421 #endif
    422         if (!PyArg_ParseTuple(_args, "O&",
    423                               ResObj_Convert, &pm))
    424                 return NULL;
    425         NoPurgePixels(pm);
    426         Py_INCREF(Py_None);
    427         _res = Py_None;
    428         return _res;
     420    PyMac_PRECHECK(NoPurgePixels);
     421#endif
     422    if (!PyArg_ParseTuple(_args, "O&",
     423                          ResObj_Convert, &pm))
     424        return NULL;
     425    NoPurgePixels(pm);
     426    Py_INCREF(Py_None);
     427    _res = Py_None;
     428    return _res;
    429429}
    430430
    431431static PyObject *Qdoffs_GetPixelsState(PyObject *_self, PyObject *_args)
    432432{
    433         PyObject *_res = NULL;
    434         GWorldFlags _rv;
    435         PixMapHandle pm;
     433    PyObject *_res = NULL;
     434    GWorldFlags _rv;
     435    PixMapHandle pm;
    436436#ifndef GetPixelsState
    437         PyMac_PRECHECK(GetPixelsState);
    438 #endif
    439         if (!PyArg_ParseTuple(_args, "O&",
    440                               ResObj_Convert, &pm))
    441                 return NULL;
    442         _rv = GetPixelsState(pm);
    443         _res = Py_BuildValue("l",
    444                              _rv);
    445         return _res;
     437    PyMac_PRECHECK(GetPixelsState);
     438#endif
     439    if (!PyArg_ParseTuple(_args, "O&",
     440                          ResObj_Convert, &pm))
     441        return NULL;
     442    _rv = GetPixelsState(pm);
     443    _res = Py_BuildValue("l",
     444                         _rv);
     445    return _res;
    446446}
    447447
    448448static PyObject *Qdoffs_SetPixelsState(PyObject *_self, PyObject *_args)
    449449{
    450         PyObject *_res = NULL;
    451         PixMapHandle pm;
    452         GWorldFlags state;
     450    PyObject *_res = NULL;
     451    PixMapHandle pm;
     452    GWorldFlags state;
    453453#ifndef SetPixelsState
    454         PyMac_PRECHECK(SetPixelsState);
    455 #endif
    456         if (!PyArg_ParseTuple(_args, "O&l",
    457                               ResObj_Convert, &pm,
    458                               &state))
    459                 return NULL;
    460         SetPixelsState(pm,
    461                        state);
    462         Py_INCREF(Py_None);
    463         _res = Py_None;
    464         return _res;
     454    PyMac_PRECHECK(SetPixelsState);
     455#endif
     456    if (!PyArg_ParseTuple(_args, "O&l",
     457                          ResObj_Convert, &pm,
     458                          &state))
     459        return NULL;
     460    SetPixelsState(pm,
     461                   state);
     462    Py_INCREF(Py_None);
     463    _res = Py_None;
     464    return _res;
    465465}
    466466
    467467static PyObject *Qdoffs_GetPixRowBytes(PyObject *_self, PyObject *_args)
    468468{
    469         PyObject *_res = NULL;
    470         long _rv;
    471         PixMapHandle pm;
     469    PyObject *_res = NULL;
     470    long _rv;
     471    PixMapHandle pm;
    472472#ifndef GetPixRowBytes
    473         PyMac_PRECHECK(GetPixRowBytes);
    474 #endif
    475         if (!PyArg_ParseTuple(_args, "O&",
    476                               ResObj_Convert, &pm))
    477                 return NULL;
    478         _rv = GetPixRowBytes(pm);
    479         _res = Py_BuildValue("l",
    480                              _rv);
    481         return _res;
     473    PyMac_PRECHECK(GetPixRowBytes);
     474#endif
     475    if (!PyArg_ParseTuple(_args, "O&",
     476                          ResObj_Convert, &pm))
     477        return NULL;
     478    _rv = GetPixRowBytes(pm);
     479    _res = Py_BuildValue("l",
     480                         _rv);
     481    return _res;
    482482}
    483483
    484484static PyObject *Qdoffs_NewScreenBuffer(PyObject *_self, PyObject *_args)
    485485{
    486         PyObject *_res = NULL;
    487         QDErr _err;
    488         Rect globalRect;
    489         Boolean purgeable;
    490         GDHandle gdh;
    491         PixMapHandle offscreenPixMap;
     486    PyObject *_res = NULL;
     487    QDErr _err;
     488    Rect globalRect;
     489    Boolean purgeable;
     490    GDHandle gdh;
     491    PixMapHandle offscreenPixMap;
    492492#ifndef NewScreenBuffer
    493         PyMac_PRECHECK(NewScreenBuffer);
    494 #endif
    495         if (!PyArg_ParseTuple(_args, "O&b",
    496                               PyMac_GetRect, &globalRect,
    497                               &purgeable))
    498                 return NULL;
    499         _err = NewScreenBuffer(&globalRect,
    500                                purgeable,
    501                                &gdh,
    502                                &offscreenPixMap);
    503         if (_err != noErr) return PyMac_Error(_err);
    504         _res = Py_BuildValue("O&O&",
    505                              ResObj_New, gdh,
    506                              ResObj_New, offscreenPixMap);
    507         return _res;
     493    PyMac_PRECHECK(NewScreenBuffer);
     494#endif
     495    if (!PyArg_ParseTuple(_args, "O&b",
     496                          PyMac_GetRect, &globalRect,
     497                          &purgeable))
     498        return NULL;
     499    _err = NewScreenBuffer(&globalRect,
     500                           purgeable,
     501                           &gdh,
     502                           &offscreenPixMap);
     503    if (_err != noErr) return PyMac_Error(_err);
     504    _res = Py_BuildValue("O&O&",
     505                         ResObj_New, gdh,
     506                         ResObj_New, offscreenPixMap);
     507    return _res;
    508508}
    509509
    510510static PyObject *Qdoffs_DisposeScreenBuffer(PyObject *_self, PyObject *_args)
    511511{
    512         PyObject *_res = NULL;
    513         PixMapHandle offscreenPixMap;
     512    PyObject *_res = NULL;
     513    PixMapHandle offscreenPixMap;
    514514#ifndef DisposeScreenBuffer
    515         PyMac_PRECHECK(DisposeScreenBuffer);
    516 #endif
    517         if (!PyArg_ParseTuple(_args, "O&",
    518                               ResObj_Convert, &offscreenPixMap))
    519                 return NULL;
    520         DisposeScreenBuffer(offscreenPixMap);
    521         Py_INCREF(Py_None);
    522         _res = Py_None;
    523         return _res;
     515    PyMac_PRECHECK(DisposeScreenBuffer);
     516#endif
     517    if (!PyArg_ParseTuple(_args, "O&",
     518                          ResObj_Convert, &offscreenPixMap))
     519        return NULL;
     520    DisposeScreenBuffer(offscreenPixMap);
     521    Py_INCREF(Py_None);
     522    _res = Py_None;
     523    return _res;
    524524}
    525525
    526526static PyObject *Qdoffs_QDDone(PyObject *_self, PyObject *_args)
    527527{
    528         PyObject *_res = NULL;
    529         Boolean _rv;
    530         GrafPtr port;
     528    PyObject *_res = NULL;
     529    Boolean _rv;
     530    GrafPtr port;
    531531#ifndef QDDone
    532         PyMac_PRECHECK(QDDone);
    533 #endif
    534         if (!PyArg_ParseTuple(_args, "O&",
    535                               GrafObj_Convert, &port))
    536                 return NULL;
    537         _rv = QDDone(port);
    538         _res = Py_BuildValue("b",
    539                              _rv);
    540         return _res;
     532    PyMac_PRECHECK(QDDone);
     533#endif
     534    if (!PyArg_ParseTuple(_args, "O&",
     535                          GrafObj_Convert, &port))
     536        return NULL;
     537    _rv = QDDone(port);
     538    _res = Py_BuildValue("b",
     539                         _rv);
     540    return _res;
    541541}
    542542
    543543static PyObject *Qdoffs_OffscreenVersion(PyObject *_self, PyObject *_args)
    544544{
    545         PyObject *_res = NULL;
    546         long _rv;
     545    PyObject *_res = NULL;
     546    long _rv;
    547547#ifndef OffscreenVersion
    548         PyMac_PRECHECK(OffscreenVersion);
    549 #endif
    550         if (!PyArg_ParseTuple(_args, ""))
    551                 return NULL;
    552         _rv = OffscreenVersion();
    553         _res = Py_BuildValue("l",
    554                              _rv);
    555         return _res;
     548    PyMac_PRECHECK(OffscreenVersion);
     549#endif
     550    if (!PyArg_ParseTuple(_args, ""))
     551        return NULL;
     552    _rv = OffscreenVersion();
     553    _res = Py_BuildValue("l",
     554                         _rv);
     555    return _res;
    556556}
    557557
    558558static PyObject *Qdoffs_NewTempScreenBuffer(PyObject *_self, PyObject *_args)
    559559{
    560         PyObject *_res = NULL;
    561         QDErr _err;
    562         Rect globalRect;
    563         Boolean purgeable;
    564         GDHandle gdh;
    565         PixMapHandle offscreenPixMap;
     560    PyObject *_res = NULL;
     561    QDErr _err;
     562    Rect globalRect;
     563    Boolean purgeable;
     564    GDHandle gdh;
     565    PixMapHandle offscreenPixMap;
    566566#ifndef NewTempScreenBuffer
    567         PyMac_PRECHECK(NewTempScreenBuffer);
    568 #endif
    569         if (!PyArg_ParseTuple(_args, "O&b",
    570                               PyMac_GetRect, &globalRect,
    571                               &purgeable))
    572                 return NULL;
    573         _err = NewTempScreenBuffer(&globalRect,
    574                                    purgeable,
    575                                    &gdh,
    576                                    &offscreenPixMap);
    577         if (_err != noErr) return PyMac_Error(_err);
    578         _res = Py_BuildValue("O&O&",
    579                              ResObj_New, gdh,
    580                              ResObj_New, offscreenPixMap);
    581         return _res;
     567    PyMac_PRECHECK(NewTempScreenBuffer);
     568#endif
     569    if (!PyArg_ParseTuple(_args, "O&b",
     570                          PyMac_GetRect, &globalRect,
     571                          &purgeable))
     572        return NULL;
     573    _err = NewTempScreenBuffer(&globalRect,
     574                               purgeable,
     575                               &gdh,
     576                               &offscreenPixMap);
     577    if (_err != noErr) return PyMac_Error(_err);
     578    _res = Py_BuildValue("O&O&",
     579                         ResObj_New, gdh,
     580                         ResObj_New, offscreenPixMap);
     581    return _res;
    582582}
    583583
    584584static PyObject *Qdoffs_PixMap32Bit(PyObject *_self, PyObject *_args)
    585585{
    586         PyObject *_res = NULL;
    587         Boolean _rv;
    588         PixMapHandle pmHandle;
     586    PyObject *_res = NULL;
     587    Boolean _rv;
     588    PixMapHandle pmHandle;
    589589#ifndef PixMap32Bit
    590         PyMac_PRECHECK(PixMap32Bit);
    591 #endif
    592         if (!PyArg_ParseTuple(_args, "O&",
    593                               ResObj_Convert, &pmHandle))
    594                 return NULL;
    595         _rv = PixMap32Bit(pmHandle);
    596         _res = Py_BuildValue("b",
    597                              _rv);
    598         return _res;
     590    PyMac_PRECHECK(PixMap32Bit);
     591#endif
     592    if (!PyArg_ParseTuple(_args, "O&",
     593                          ResObj_Convert, &pmHandle))
     594        return NULL;
     595    _rv = PixMap32Bit(pmHandle);
     596    _res = Py_BuildValue("b",
     597                         _rv);
     598    return _res;
    599599}
    600600
    601601static PyObject *Qdoffs_GetPixMapBytes(PyObject *_self, PyObject *_args)
    602602{
    603         PyObject *_res = NULL;
    604 
    605         PixMapHandle pm;
    606         int from, length;
    607         char *cp;
    608 
    609         if ( !PyArg_ParseTuple(_args, "O&ii", ResObj_Convert, &pm, &from, &length) )
    610                 return NULL;
    611         cp = GetPixBaseAddr(pm)+from;
    612         _res = PyString_FromStringAndSize(cp, length);
    613         return _res;
     603    PyObject *_res = NULL;
     604
     605    PixMapHandle pm;
     606    int from, length;
     607    char *cp;
     608
     609    if ( !PyArg_ParseTuple(_args, "O&ii", ResObj_Convert, &pm, &from, &length) )
     610        return NULL;
     611    cp = GetPixBaseAddr(pm)+from;
     612    _res = PyString_FromStringAndSize(cp, length);
     613    return _res;
    614614
    615615}
     
    617617static PyObject *Qdoffs_PutPixMapBytes(PyObject *_self, PyObject *_args)
    618618{
    619         PyObject *_res = NULL;
    620 
    621         PixMapHandle pm;
    622         int from, length;
    623         char *cp, *icp;
    624 
    625         if ( !PyArg_ParseTuple(_args, "O&is#", ResObj_Convert, &pm, &from, &icp, &length) )
    626                 return NULL;
    627         cp = GetPixBaseAddr(pm)+from;
    628         memcpy(cp, icp, length);
    629         Py_INCREF(Py_None);
    630         _res = Py_None;
    631         return _res;
     619    PyObject *_res = NULL;
     620
     621    PixMapHandle pm;
     622    int from, length;
     623    char *cp, *icp;
     624
     625    if ( !PyArg_ParseTuple(_args, "O&is#", ResObj_Convert, &pm, &from, &icp, &length) )
     626        return NULL;
     627    cp = GetPixBaseAddr(pm)+from;
     628    memcpy(cp, icp, length);
     629    Py_INCREF(Py_None);
     630    _res = Py_None;
     631    return _res;
    632632
    633633}
     
    635635
    636636static PyMethodDef Qdoffs_methods[] = {
    637 #ifndef __LP64__
    638         {"NewGWorld", (PyCFunction)Qdoffs_NewGWorld, 1,
    639         PyDoc_STR("(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)")},
    640         {"LockPixels", (PyCFunction)Qdoffs_LockPixels, 1,
    641         PyDoc_STR("(PixMapHandle pm) -> (Boolean _rv)")},
    642         {"UnlockPixels", (PyCFunction)Qdoffs_UnlockPixels, 1,
    643         PyDoc_STR("(PixMapHandle pm) -> None")},
    644         {"UpdateGWorld", (PyCFunction)Qdoffs_UpdateGWorld, 1,
    645         PyDoc_STR("(short pixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldFlags _rv, GWorldPtr offscreenGWorld)")},
    646         {"GetGWorld", (PyCFunction)Qdoffs_GetGWorld, 1,
    647         PyDoc_STR("() -> (CGrafPtr port, GDHandle gdh)")},
    648         {"SetGWorld", (PyCFunction)Qdoffs_SetGWorld, 1,
    649         PyDoc_STR("(CGrafPtr port, GDHandle gdh) -> None")},
    650         {"CTabChanged", (PyCFunction)Qdoffs_CTabChanged, 1,
    651         PyDoc_STR("(CTabHandle ctab) -> None")},
    652         {"PixPatChanged", (PyCFunction)Qdoffs_PixPatChanged, 1,
    653         PyDoc_STR("(PixPatHandle ppat) -> None")},
    654         {"PortChanged", (PyCFunction)Qdoffs_PortChanged, 1,
    655         PyDoc_STR("(GrafPtr port) -> None")},
    656         {"GDeviceChanged", (PyCFunction)Qdoffs_GDeviceChanged, 1,
    657         PyDoc_STR("(GDHandle gdh) -> None")},
    658         {"AllowPurgePixels", (PyCFunction)Qdoffs_AllowPurgePixels, 1,
    659         PyDoc_STR("(PixMapHandle pm) -> None")},
    660         {"NoPurgePixels", (PyCFunction)Qdoffs_NoPurgePixels, 1,
    661         PyDoc_STR("(PixMapHandle pm) -> None")},
    662         {"GetPixelsState", (PyCFunction)Qdoffs_GetPixelsState, 1,
    663         PyDoc_STR("(PixMapHandle pm) -> (GWorldFlags _rv)")},
    664         {"SetPixelsState", (PyCFunction)Qdoffs_SetPixelsState, 1,
    665         PyDoc_STR("(PixMapHandle pm, GWorldFlags state) -> None")},
    666         {"GetPixRowBytes", (PyCFunction)Qdoffs_GetPixRowBytes, 1,
    667         PyDoc_STR("(PixMapHandle pm) -> (long _rv)")},
    668         {"NewScreenBuffer", (PyCFunction)Qdoffs_NewScreenBuffer, 1,
    669         PyDoc_STR("(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)")},
    670         {"DisposeScreenBuffer", (PyCFunction)Qdoffs_DisposeScreenBuffer, 1,
    671         PyDoc_STR("(PixMapHandle offscreenPixMap) -> None")},
    672         {"QDDone", (PyCFunction)Qdoffs_QDDone, 1,
    673         PyDoc_STR("(GrafPtr port) -> (Boolean _rv)")},
    674         {"OffscreenVersion", (PyCFunction)Qdoffs_OffscreenVersion, 1,
    675         PyDoc_STR("() -> (long _rv)")},
    676         {"NewTempScreenBuffer", (PyCFunction)Qdoffs_NewTempScreenBuffer, 1,
    677         PyDoc_STR("(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)")},
    678         {"PixMap32Bit", (PyCFunction)Qdoffs_PixMap32Bit, 1,
    679         PyDoc_STR("(PixMapHandle pmHandle) -> (Boolean _rv)")},
    680         {"GetPixMapBytes", (PyCFunction)Qdoffs_GetPixMapBytes, 1,
    681         PyDoc_STR("(pixmap, int start, int size) -> string. Return bytes from the pixmap")},
    682         {"PutPixMapBytes", (PyCFunction)Qdoffs_PutPixMapBytes, 1,
    683         PyDoc_STR("(pixmap, int start, string data). Store bytes into the pixmap")},
     637#if !defined(__LP64__) && !defined(MAC_OS_X_VERSION_10_7)
     638    {"NewGWorld", (PyCFunction)Qdoffs_NewGWorld, 1,
     639    PyDoc_STR("(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)")},
     640    {"LockPixels", (PyCFunction)Qdoffs_LockPixels, 1,
     641    PyDoc_STR("(PixMapHandle pm) -> (Boolean _rv)")},
     642    {"UnlockPixels", (PyCFunction)Qdoffs_UnlockPixels, 1,
     643    PyDoc_STR("(PixMapHandle pm) -> None")},
     644    {"UpdateGWorld", (PyCFunction)Qdoffs_UpdateGWorld, 1,
     645    PyDoc_STR("(short pixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldFlags _rv, GWorldPtr offscreenGWorld)")},
     646    {"GetGWorld", (PyCFunction)Qdoffs_GetGWorld, 1,
     647    PyDoc_STR("() -> (CGrafPtr port, GDHandle gdh)")},
     648    {"SetGWorld", (PyCFunction)Qdoffs_SetGWorld, 1,
     649    PyDoc_STR("(CGrafPtr port, GDHandle gdh) -> None")},
     650    {"CTabChanged", (PyCFunction)Qdoffs_CTabChanged, 1,
     651    PyDoc_STR("(CTabHandle ctab) -> None")},
     652    {"PixPatChanged", (PyCFunction)Qdoffs_PixPatChanged, 1,
     653    PyDoc_STR("(PixPatHandle ppat) -> None")},
     654    {"PortChanged", (PyCFunction)Qdoffs_PortChanged, 1,
     655    PyDoc_STR("(GrafPtr port) -> None")},
     656    {"GDeviceChanged", (PyCFunction)Qdoffs_GDeviceChanged, 1,
     657    PyDoc_STR("(GDHandle gdh) -> None")},
     658    {"AllowPurgePixels", (PyCFunction)Qdoffs_AllowPurgePixels, 1,
     659    PyDoc_STR("(PixMapHandle pm) -> None")},
     660    {"NoPurgePixels", (PyCFunction)Qdoffs_NoPurgePixels, 1,
     661    PyDoc_STR("(PixMapHandle pm) -> None")},
     662    {"GetPixelsState", (PyCFunction)Qdoffs_GetPixelsState, 1,
     663    PyDoc_STR("(PixMapHandle pm) -> (GWorldFlags _rv)")},
     664    {"SetPixelsState", (PyCFunction)Qdoffs_SetPixelsState, 1,
     665    PyDoc_STR("(PixMapHandle pm, GWorldFlags state) -> None")},
     666    {"GetPixRowBytes", (PyCFunction)Qdoffs_GetPixRowBytes, 1,
     667    PyDoc_STR("(PixMapHandle pm) -> (long _rv)")},
     668    {"NewScreenBuffer", (PyCFunction)Qdoffs_NewScreenBuffer, 1,
     669    PyDoc_STR("(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)")},
     670    {"DisposeScreenBuffer", (PyCFunction)Qdoffs_DisposeScreenBuffer, 1,
     671    PyDoc_STR("(PixMapHandle offscreenPixMap) -> None")},
     672    {"QDDone", (PyCFunction)Qdoffs_QDDone, 1,
     673    PyDoc_STR("(GrafPtr port) -> (Boolean _rv)")},
     674    {"OffscreenVersion", (PyCFunction)Qdoffs_OffscreenVersion, 1,
     675    PyDoc_STR("() -> (long _rv)")},
     676    {"NewTempScreenBuffer", (PyCFunction)Qdoffs_NewTempScreenBuffer, 1,
     677    PyDoc_STR("(Rect globalRect, Boolean purgeable) -> (GDHandle gdh, PixMapHandle offscreenPixMap)")},
     678    {"PixMap32Bit", (PyCFunction)Qdoffs_PixMap32Bit, 1,
     679    PyDoc_STR("(PixMapHandle pmHandle) -> (Boolean _rv)")},
     680    {"GetPixMapBytes", (PyCFunction)Qdoffs_GetPixMapBytes, 1,
     681    PyDoc_STR("(pixmap, int start, int size) -> string. Return bytes from the pixmap")},
     682    {"PutPixMapBytes", (PyCFunction)Qdoffs_PutPixMapBytes, 1,
     683    PyDoc_STR("(pixmap, int start, string data). Store bytes into the pixmap")},
    684684#endif /* __LP64__ */
    685         {NULL, NULL, 0}
     685    {NULL, NULL, 0}
    686686};
    687687
     
    691691void init_Qdoffs(void)
    692692{
    693         PyObject *m;
    694 #ifndef __LP64__
    695         PyObject *d;
    696 
    697 
    698 
    699                 PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New);
    700                 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
     693    PyObject *m;
     694#if !defined(__LP64__) && !defined(MAC_OS_X_VERSION_10_7)
     695    PyObject *d;
     696
     697
     698
     699        PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New);
     700        PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
    701701
    702702#endif /* __LP64__ */
    703703
    704         m = Py_InitModule("_Qdoffs", Qdoffs_methods);
    705 #ifndef __LP64__
    706         d = PyModule_GetDict(m);
    707         Qdoffs_Error = PyMac_GetOSErrException();
    708         if (Qdoffs_Error == NULL ||
    709             PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0)
    710                 return;
    711         GWorld_Type.ob_type = &PyType_Type;
    712         if (PyType_Ready(&GWorld_Type) < 0) return;
    713         Py_INCREF(&GWorld_Type);
    714         PyModule_AddObject(m, "GWorld", (PyObject *)&GWorld_Type);
    715         /* Backward-compatible name */
    716         Py_INCREF(&GWorld_Type);
    717         PyModule_AddObject(m, "GWorldType", (PyObject *)&GWorld_Type);
     704    m = Py_InitModule("_Qdoffs", Qdoffs_methods);
     705#if !defined(__LP64__) && !defined(MAC_OS_X_VERSION_10_7)
     706    d = PyModule_GetDict(m);
     707    Qdoffs_Error = PyMac_GetOSErrException();
     708    if (Qdoffs_Error == NULL ||
     709        PyDict_SetItemString(d, "Error", Qdoffs_Error) != 0)
     710        return;
     711    GWorld_Type.ob_type = &PyType_Type;
     712    if (PyType_Ready(&GWorld_Type) < 0) return;
     713    Py_INCREF(&GWorld_Type);
     714    PyModule_AddObject(m, "GWorld", (PyObject *)&GWorld_Type);
     715    /* Backward-compatible name */
     716    Py_INCREF(&GWorld_Type);
     717    PyModule_AddObject(m, "GWorldType", (PyObject *)&GWorld_Type);
    718718#endif /* __LP64__ */
    719719}
Note: See TracChangeset for help on using the changeset viewer.