mirror of
https://github.com/python/cpython.git
synced 2025-09-19 07:00:59 +00:00
Converted the Carbon modules to use PEP252-style objects, with
descriptors in stead of manual getattr hooks to get at attributes of the objects. For Qd I have in stead gotten rid of most of the attribute access in favor of the carbon-style accessor methods (with the exception of visRgn, to be done later), and of the Carbon.Qd.qd global object, for which accessor functions are also available. For List I have fixed the fact that various methods were incorrectly generated as functions. CF is untouched: PEP252 doesn't allow "poor-mans-inheritance" with basechain, so it will have to wait for PEP253 support.
This commit is contained in:
parent
818855939a
commit
dbd5701d73
48 changed files with 2447 additions and 2507 deletions
|
@ -20,6 +20,9 @@
|
||||||
}} while(0)
|
}} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef PyDoc_STR
|
||||||
|
#define PyDoc_STR(x) (x)
|
||||||
|
#endif
|
||||||
#ifdef WITHOUT_FRAMEWORKS
|
#ifdef WITHOUT_FRAMEWORKS
|
||||||
#include <AppleEvents.h>
|
#include <AppleEvents.h>
|
||||||
#include <AEObjects.h>
|
#include <AEObjects.h>
|
||||||
|
@ -35,7 +38,13 @@ extern int _AEDesc_Convert(PyObject *, AEDesc *);
|
||||||
#define AEDesc_Convert _AEDesc_Convert
|
#define AEDesc_Convert _AEDesc_Convert
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static pascal OSErr GenericEventHandler(); /* Forward */
|
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
|
||||||
|
typedef long refcontype;
|
||||||
|
#else
|
||||||
|
typedef unsigned long refcontype;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static pascal OSErr GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon); /* Forward */
|
||||||
|
|
||||||
AEEventHandlerUPP upp_GenericEventHandler;
|
AEEventHandlerUPP upp_GenericEventHandler;
|
||||||
|
|
||||||
|
@ -820,25 +829,17 @@ static PyMethodDef AEDesc_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain AEDesc_chain = { AEDesc_methods, NULL };
|
static PyObject *AEDesc_get_type(AEDescObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return PyMac_BuildOSType(self->ob_itself.descriptorType);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *AEDesc_getattr(AEDescObject *self, char *name)
|
#define AEDesc_set_type NULL
|
||||||
|
|
||||||
|
static PyObject *AEDesc_get_data(AEDescObject *self, void *closure)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(name, "type") == 0)
|
|
||||||
return PyMac_BuildOSType(self->ob_itself.descriptorType);
|
|
||||||
if (strcmp(name, "data") == 0) {
|
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
#if !TARGET_API_MAC_CARBON
|
|
||||||
char state;
|
|
||||||
state = HGetState(self->ob_itself.dataHandle);
|
|
||||||
HLock(self->ob_itself.dataHandle);
|
|
||||||
res = PyString_FromStringAndSize(
|
|
||||||
*self->ob_itself.dataHandle,
|
|
||||||
GetHandleSize(self->ob_itself.dataHandle));
|
|
||||||
HUnlock(self->ob_itself.dataHandle);
|
|
||||||
HSetState(self->ob_itself.dataHandle, state);
|
|
||||||
#else
|
|
||||||
Size size;
|
Size size;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
|
@ -850,16 +851,18 @@ static PyObject *AEDesc_getattr(AEDescObject *self, char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( (err=AEGetDescData(&self->ob_itself, ptr, size)) < 0 )
|
if ( (err=AEGetDescData(&self->ob_itself, ptr, size)) < 0 )
|
||||||
return PyMac_Error(err);
|
return PyMac_Error(err);
|
||||||
#endif
|
|
||||||
return res;
|
return res;
|
||||||
}
|
|
||||||
if (strcmp(name, "__members__") == 0)
|
|
||||||
return Py_BuildValue("[ss]", "data", "type");
|
|
||||||
|
|
||||||
return Py_FindMethodInChain(&AEDesc_chain, (PyObject *)self, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define AEDesc_setattr NULL
|
#define AEDesc_set_data NULL
|
||||||
|
|
||||||
|
static PyGetSetDef AEDesc_getsetlist[] = {
|
||||||
|
{"type", (getter)AEDesc_get_type, (setter)AEDesc_set_type, "Type of this AEDesc"},
|
||||||
|
{"data", (getter)AEDesc_get_data, (setter)AEDesc_set_data, "The raw data in this AEDesc"},
|
||||||
|
{NULL, NULL, NULL, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define AEDesc_compare NULL
|
#define AEDesc_compare NULL
|
||||||
|
|
||||||
|
@ -876,14 +879,31 @@ PyTypeObject AEDesc_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) AEDesc_dealloc, /*tp_dealloc*/
|
(destructor) AEDesc_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) AEDesc_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) AEDesc_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) AEDesc_compare, /*tp_compare*/
|
(cmpfunc) AEDesc_compare, /*tp_compare*/
|
||||||
(reprfunc) AEDesc_repr, /*tp_repr*/
|
(reprfunc) AEDesc_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) AEDesc_hash, /*tp_hash*/
|
(hashfunc) AEDesc_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
AEDesc_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
AEDesc_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type AEDesc --------------------- */
|
/* --------------------- End object type AEDesc --------------------- */
|
||||||
|
@ -1350,12 +1370,6 @@ static PyMethodDef AE_methods[] = {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
|
|
||||||
typedef long refcontype;
|
|
||||||
#else
|
|
||||||
typedef unsigned long refcontype;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static pascal OSErr
|
static pascal OSErr
|
||||||
GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
|
GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,6 +82,9 @@ AEMethod = OSErrWeakLinkMethodGenerator
|
||||||
|
|
||||||
|
|
||||||
includestuff = includestuff + """
|
includestuff = includestuff + """
|
||||||
|
#ifndef PyDoc_STR
|
||||||
|
#define PyDoc_STR(x) (x)
|
||||||
|
#endif
|
||||||
#ifdef WITHOUT_FRAMEWORKS
|
#ifdef WITHOUT_FRAMEWORKS
|
||||||
#include <AppleEvents.h>
|
#include <AppleEvents.h>
|
||||||
#include <AEObjects.h>
|
#include <AEObjects.h>
|
||||||
|
@ -97,7 +100,13 @@ extern int _AEDesc_Convert(PyObject *, AEDesc *);
|
||||||
#define AEDesc_Convert _AEDesc_Convert
|
#define AEDesc_Convert _AEDesc_Convert
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static pascal OSErr GenericEventHandler(); /* Forward */
|
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
|
||||||
|
typedef long refcontype;
|
||||||
|
#else
|
||||||
|
typedef unsigned long refcontype;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static pascal OSErr GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon); /* Forward */
|
||||||
|
|
||||||
AEEventHandlerUPP upp_GenericEventHandler;
|
AEEventHandlerUPP upp_GenericEventHandler;
|
||||||
|
|
||||||
|
@ -118,12 +127,6 @@ AEIdleUPP upp_AEIdleProc;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
finalstuff = finalstuff + """
|
finalstuff = finalstuff + """
|
||||||
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
|
|
||||||
typedef long refcontype;
|
|
||||||
#else
|
|
||||||
typedef unsigned long refcontype;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static pascal OSErr
|
static pascal OSErr
|
||||||
GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
|
GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
|
||||||
{
|
{
|
||||||
|
@ -171,31 +174,16 @@ initstuff = initstuff + """
|
||||||
|
|
||||||
module = MacModule('_AE', 'AE', includestuff, finalstuff, initstuff)
|
module = MacModule('_AE', 'AE', includestuff, finalstuff, initstuff)
|
||||||
|
|
||||||
class AEDescDefinition(GlobalObjectDefinition):
|
class AEDescDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
|
getsetlist = [(
|
||||||
def __init__(self, name, prefix = None, itselftype = None):
|
'type',
|
||||||
GlobalObjectDefinition.__init__(self, name, prefix or name, itselftype or name)
|
'return PyMac_BuildOSType(self->ob_itself.descriptorType);',
|
||||||
self.argref = "*"
|
None,
|
||||||
|
'Type of this AEDesc'
|
||||||
def outputFreeIt(self, name):
|
), (
|
||||||
Output("AEDisposeDesc(&%s);", name)
|
'data',
|
||||||
|
"""
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("""
|
|
||||||
if (strcmp(name, "type") == 0)
|
|
||||||
return PyMac_BuildOSType(self->ob_itself.descriptorType);
|
|
||||||
if (strcmp(name, "data") == 0) {
|
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
#if !TARGET_API_MAC_CARBON
|
|
||||||
char state;
|
|
||||||
state = HGetState(self->ob_itself.dataHandle);
|
|
||||||
HLock(self->ob_itself.dataHandle);
|
|
||||||
res = PyString_FromStringAndSize(
|
|
||||||
*self->ob_itself.dataHandle,
|
|
||||||
GetHandleSize(self->ob_itself.dataHandle));
|
|
||||||
HUnlock(self->ob_itself.dataHandle);
|
|
||||||
HSetState(self->ob_itself.dataHandle, state);
|
|
||||||
#else
|
|
||||||
Size size;
|
Size size;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
OSErr err;
|
OSErr err;
|
||||||
|
@ -207,13 +195,18 @@ if (strcmp(name, "data") == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( (err=AEGetDescData(&self->ob_itself, ptr, size)) < 0 )
|
if ( (err=AEGetDescData(&self->ob_itself, ptr, size)) < 0 )
|
||||||
return PyMac_Error(err);
|
return PyMac_Error(err);
|
||||||
#endif
|
|
||||||
return res;
|
return res;
|
||||||
}
|
""",
|
||||||
if (strcmp(name, "__members__") == 0)
|
None,
|
||||||
return Py_BuildValue("[ss]", "data", "type");
|
'The raw data in this AEDesc'
|
||||||
""")
|
)]
|
||||||
|
|
||||||
|
def __init__(self, name, prefix = None, itselftype = None):
|
||||||
|
GlobalObjectDefinition.__init__(self, name, prefix or name, itselftype or name)
|
||||||
|
self.argref = "*"
|
||||||
|
|
||||||
|
def outputFreeIt(self, name):
|
||||||
|
Output("AEDisposeDesc(&%s);", name)
|
||||||
|
|
||||||
aedescobject = AEDescDefinition('AEDesc')
|
aedescobject = AEDescDefinition('AEDesc')
|
||||||
module.addobject(aedescobject)
|
module.addobject(aedescobject)
|
||||||
|
|
|
@ -95,14 +95,7 @@ static PyMethodDef AliasObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain AliasObj_chain = { AliasObj_methods, NULL };
|
#define AliasObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *AliasObj_getattr(AliasObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&AliasObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define AliasObj_setattr NULL
|
|
||||||
|
|
||||||
#define AliasObj_compare NULL
|
#define AliasObj_compare NULL
|
||||||
|
|
||||||
|
@ -119,14 +112,31 @@ PyTypeObject Alias_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) AliasObj_dealloc, /*tp_dealloc*/
|
(destructor) AliasObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) AliasObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) AliasObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) AliasObj_compare, /*tp_compare*/
|
(cmpfunc) AliasObj_compare, /*tp_compare*/
|
||||||
(reprfunc) AliasObj_repr, /*tp_repr*/
|
(reprfunc) AliasObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) AliasObj_hash, /*tp_hash*/
|
(hashfunc) AliasObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
AliasObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
AliasObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Alias ---------------------- */
|
/* --------------------- End object type Alias ---------------------- */
|
||||||
|
|
|
@ -72,7 +72,7 @@ execfile(string.lower(MODPREFIX) + 'typetest.py')
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
|
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
|
||||||
|
|
||||||
class AliasDefinition(GlobalObjectDefinition):
|
class AliasDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
|
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
|
|
|
@ -113,14 +113,7 @@ static PyMethodDef ThemeDrawingStateObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain ThemeDrawingStateObj_chain = { ThemeDrawingStateObj_methods, NULL };
|
#define ThemeDrawingStateObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *ThemeDrawingStateObj_getattr(ThemeDrawingStateObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&ThemeDrawingStateObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ThemeDrawingStateObj_setattr NULL
|
|
||||||
|
|
||||||
#define ThemeDrawingStateObj_compare NULL
|
#define ThemeDrawingStateObj_compare NULL
|
||||||
|
|
||||||
|
@ -137,14 +130,31 @@ PyTypeObject ThemeDrawingState_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) ThemeDrawingStateObj_dealloc, /*tp_dealloc*/
|
(destructor) ThemeDrawingStateObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) ThemeDrawingStateObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) ThemeDrawingStateObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) ThemeDrawingStateObj_compare, /*tp_compare*/
|
(cmpfunc) ThemeDrawingStateObj_compare, /*tp_compare*/
|
||||||
(reprfunc) ThemeDrawingStateObj_repr, /*tp_repr*/
|
(reprfunc) ThemeDrawingStateObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) ThemeDrawingStateObj_hash, /*tp_hash*/
|
(hashfunc) ThemeDrawingStateObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
ThemeDrawingStateObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
ThemeDrawingStateObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------- End object type ThemeDrawingState ---------------- */
|
/* --------------- End object type ThemeDrawingState ---------------- */
|
||||||
|
|
|
@ -94,7 +94,7 @@ int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
pass
|
pass
|
||||||
## def outputCheckNewArg(self):
|
## def outputCheckNewArg(self):
|
||||||
## Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
## Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
|
|
|
@ -215,7 +215,7 @@ module = MacModule('_CarbonEvt', 'CarbonEvents', includestuff, finalstuff, inits
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EventHandlerRefObjectDefinition(GlobalObjectDefinition):
|
class EventHandlerRefObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
Output("%s ob_itself;", self.itselftype)
|
Output("%s ob_itself;", self.itselftype)
|
||||||
Output("PyObject *ob_callback;")
|
Output("PyObject *ob_callback;")
|
||||||
|
@ -228,11 +228,14 @@ class EventHandlerRefObjectDefinition(GlobalObjectDefinition):
|
||||||
Output("Py_DECREF(self->ob_callback);")
|
Output("Py_DECREF(self->ob_callback);")
|
||||||
OutRbrace()
|
OutRbrace()
|
||||||
|
|
||||||
|
class MyGlobalObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
|
pass
|
||||||
|
|
||||||
for typ in RefObjectTypes:
|
for typ in RefObjectTypes:
|
||||||
if typ == 'EventHandlerRef':
|
if typ == 'EventHandlerRef':
|
||||||
EventHandlerRefobject = EventHandlerRefObjectDefinition('EventHandlerRef')
|
EventHandlerRefobject = EventHandlerRefObjectDefinition('EventHandlerRef')
|
||||||
else:
|
else:
|
||||||
execstr = typ + 'object = GlobalObjectDefinition(typ)'
|
execstr = typ + 'object = MyGlobalObjectDefinition(typ)'
|
||||||
exec execstr
|
exec execstr
|
||||||
module.addobject(eval(typ + 'object'))
|
module.addobject(eval(typ + 'object'))
|
||||||
|
|
||||||
|
|
|
@ -408,14 +408,7 @@ static PyMethodDef EventRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventRef_chain = { EventRef_methods, NULL };
|
#define EventRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventRef_getattr(EventRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventRef_compare NULL
|
#define EventRef_compare NULL
|
||||||
|
|
||||||
|
@ -432,14 +425,31 @@ PyTypeObject EventRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventRef_dealloc, /*tp_dealloc*/
|
(destructor) EventRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventRef_compare, /*tp_compare*/
|
(cmpfunc) EventRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventRef_repr, /*tp_repr*/
|
(reprfunc) EventRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventRef_hash, /*tp_hash*/
|
(hashfunc) EventRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type EventRef -------------------- */
|
/* -------------------- End object type EventRef -------------------- */
|
||||||
|
@ -591,14 +601,7 @@ static PyMethodDef EventQueueRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventQueueRef_chain = { EventQueueRef_methods, NULL };
|
#define EventQueueRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventQueueRef_getattr(EventQueueRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventQueueRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventQueueRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventQueueRef_compare NULL
|
#define EventQueueRef_compare NULL
|
||||||
|
|
||||||
|
@ -615,14 +618,31 @@ PyTypeObject EventQueueRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventQueueRef_dealloc, /*tp_dealloc*/
|
(destructor) EventQueueRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventQueueRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventQueueRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventQueueRef_compare, /*tp_compare*/
|
(cmpfunc) EventQueueRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventQueueRef_repr, /*tp_repr*/
|
(reprfunc) EventQueueRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventQueueRef_hash, /*tp_hash*/
|
(hashfunc) EventQueueRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventQueueRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventQueueRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- End object type EventQueueRef ------------------ */
|
/* ----------------- End object type EventQueueRef ------------------ */
|
||||||
|
@ -683,14 +703,7 @@ static PyMethodDef EventLoopRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventLoopRef_chain = { EventLoopRef_methods, NULL };
|
#define EventLoopRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventLoopRef_getattr(EventLoopRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventLoopRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventLoopRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventLoopRef_compare NULL
|
#define EventLoopRef_compare NULL
|
||||||
|
|
||||||
|
@ -707,14 +720,31 @@ PyTypeObject EventLoopRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventLoopRef_dealloc, /*tp_dealloc*/
|
(destructor) EventLoopRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventLoopRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventLoopRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventLoopRef_compare, /*tp_compare*/
|
(cmpfunc) EventLoopRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventLoopRef_repr, /*tp_repr*/
|
(reprfunc) EventLoopRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventLoopRef_hash, /*tp_hash*/
|
(hashfunc) EventLoopRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventLoopRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventLoopRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------ End object type EventLoopRef ------------------ */
|
/* ------------------ End object type EventLoopRef ------------------ */
|
||||||
|
@ -793,14 +823,7 @@ static PyMethodDef EventLoopTimerRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventLoopTimerRef_chain = { EventLoopTimerRef_methods, NULL };
|
#define EventLoopTimerRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventLoopTimerRef_getattr(EventLoopTimerRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventLoopTimerRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventLoopTimerRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventLoopTimerRef_compare NULL
|
#define EventLoopTimerRef_compare NULL
|
||||||
|
|
||||||
|
@ -817,14 +840,31 @@ PyTypeObject EventLoopTimerRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventLoopTimerRef_dealloc, /*tp_dealloc*/
|
(destructor) EventLoopTimerRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventLoopTimerRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventLoopTimerRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventLoopTimerRef_compare, /*tp_compare*/
|
(cmpfunc) EventLoopTimerRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventLoopTimerRef_repr, /*tp_repr*/
|
(reprfunc) EventLoopTimerRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventLoopTimerRef_hash, /*tp_hash*/
|
(hashfunc) EventLoopTimerRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventLoopTimerRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventLoopTimerRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------- End object type EventLoopTimerRef ---------------- */
|
/* --------------- End object type EventLoopTimerRef ---------------- */
|
||||||
|
@ -948,14 +988,7 @@ static PyMethodDef EventHandlerRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventHandlerRef_chain = { EventHandlerRef_methods, NULL };
|
#define EventHandlerRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventHandlerRef_getattr(EventHandlerRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventHandlerRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventHandlerRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventHandlerRef_compare NULL
|
#define EventHandlerRef_compare NULL
|
||||||
|
|
||||||
|
@ -972,14 +1005,31 @@ PyTypeObject EventHandlerRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventHandlerRef_dealloc, /*tp_dealloc*/
|
(destructor) EventHandlerRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventHandlerRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventHandlerRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventHandlerRef_compare, /*tp_compare*/
|
(cmpfunc) EventHandlerRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventHandlerRef_repr, /*tp_repr*/
|
(reprfunc) EventHandlerRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventHandlerRef_hash, /*tp_hash*/
|
(hashfunc) EventHandlerRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventHandlerRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventHandlerRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------- End object type EventHandlerRef ----------------- */
|
/* ---------------- End object type EventHandlerRef ----------------- */
|
||||||
|
@ -1043,14 +1093,7 @@ static PyMethodDef EventHandlerCallRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventHandlerCallRef_chain = { EventHandlerCallRef_methods, NULL };
|
#define EventHandlerCallRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventHandlerCallRef_getattr(EventHandlerCallRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventHandlerCallRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventHandlerCallRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventHandlerCallRef_compare NULL
|
#define EventHandlerCallRef_compare NULL
|
||||||
|
|
||||||
|
@ -1067,14 +1110,31 @@ PyTypeObject EventHandlerCallRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventHandlerCallRef_dealloc, /*tp_dealloc*/
|
(destructor) EventHandlerCallRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventHandlerCallRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventHandlerCallRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventHandlerCallRef_compare, /*tp_compare*/
|
(cmpfunc) EventHandlerCallRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventHandlerCallRef_repr, /*tp_repr*/
|
(reprfunc) EventHandlerCallRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventHandlerCallRef_hash, /*tp_hash*/
|
(hashfunc) EventHandlerCallRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventHandlerCallRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventHandlerCallRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------- End object type EventHandlerCallRef --------------- */
|
/* -------------- End object type EventHandlerCallRef --------------- */
|
||||||
|
@ -1160,14 +1220,7 @@ static PyMethodDef EventTargetRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventTargetRef_chain = { EventTargetRef_methods, NULL };
|
#define EventTargetRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventTargetRef_getattr(EventTargetRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventTargetRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventTargetRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventTargetRef_compare NULL
|
#define EventTargetRef_compare NULL
|
||||||
|
|
||||||
|
@ -1184,14 +1237,31 @@ PyTypeObject EventTargetRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventTargetRef_dealloc, /*tp_dealloc*/
|
(destructor) EventTargetRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventTargetRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventTargetRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventTargetRef_compare, /*tp_compare*/
|
(cmpfunc) EventTargetRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventTargetRef_repr, /*tp_repr*/
|
(reprfunc) EventTargetRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventTargetRef_hash, /*tp_hash*/
|
(hashfunc) EventTargetRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventTargetRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventTargetRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- End object type EventTargetRef ----------------- */
|
/* ----------------- End object type EventTargetRef ----------------- */
|
||||||
|
@ -1252,14 +1322,7 @@ static PyMethodDef EventHotKeyRef_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain EventHotKeyRef_chain = { EventHotKeyRef_methods, NULL };
|
#define EventHotKeyRef_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *EventHotKeyRef_getattr(EventHotKeyRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&EventHotKeyRef_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EventHotKeyRef_setattr NULL
|
|
||||||
|
|
||||||
#define EventHotKeyRef_compare NULL
|
#define EventHotKeyRef_compare NULL
|
||||||
|
|
||||||
|
@ -1276,14 +1339,31 @@ PyTypeObject EventHotKeyRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) EventHotKeyRef_dealloc, /*tp_dealloc*/
|
(destructor) EventHotKeyRef_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) EventHotKeyRef_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) EventHotKeyRef_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) EventHotKeyRef_compare, /*tp_compare*/
|
(cmpfunc) EventHotKeyRef_compare, /*tp_compare*/
|
||||||
(reprfunc) EventHotKeyRef_repr, /*tp_repr*/
|
(reprfunc) EventHotKeyRef_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) EventHotKeyRef_hash, /*tp_hash*/
|
(hashfunc) EventHotKeyRef_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
EventHotKeyRef_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
EventHotKeyRef_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------- End object type EventHotKeyRef ----------------- */
|
/* ----------------- End object type EventHotKeyRef ----------------- */
|
||||||
|
|
|
@ -1266,14 +1266,7 @@ static PyMethodDef CGContextRefObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain CGContextRefObj_chain = { CGContextRefObj_methods, NULL };
|
#define CGContextRefObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *CGContextRefObj_getattr(CGContextRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&CGContextRefObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CGContextRefObj_setattr NULL
|
|
||||||
|
|
||||||
#define CGContextRefObj_compare NULL
|
#define CGContextRefObj_compare NULL
|
||||||
|
|
||||||
|
@ -1290,14 +1283,31 @@ PyTypeObject CGContextRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) CGContextRefObj_dealloc, /*tp_dealloc*/
|
(destructor) CGContextRefObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) CGContextRefObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) CGContextRefObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) CGContextRefObj_compare, /*tp_compare*/
|
(cmpfunc) CGContextRefObj_compare, /*tp_compare*/
|
||||||
(reprfunc) CGContextRefObj_repr, /*tp_repr*/
|
(reprfunc) CGContextRefObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) CGContextRefObj_hash, /*tp_hash*/
|
(hashfunc) CGContextRefObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
CGContextRefObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
CGContextRefObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------ End object type CGContextRef ------------------ */
|
/* ------------------ End object type CGContextRef ------------------ */
|
||||||
|
|
|
@ -250,7 +250,7 @@ CGPathDrawingMode = int
|
||||||
CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")
|
CGContextRef = OpaqueByValueType("CGContextRef", "CGContextRefObj")
|
||||||
|
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
ObjectDefinition.outputStructMembers(self)
|
ObjectDefinition.outputStructMembers(self)
|
||||||
def outputCleanupStructMembers(self):
|
def outputCleanupStructMembers(self):
|
||||||
|
|
|
@ -305,14 +305,7 @@ static PyMethodDef CmpInstObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain CmpInstObj_chain = { CmpInstObj_methods, NULL };
|
#define CmpInstObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *CmpInstObj_getattr(ComponentInstanceObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&CmpInstObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CmpInstObj_setattr NULL
|
|
||||||
|
|
||||||
#define CmpInstObj_compare NULL
|
#define CmpInstObj_compare NULL
|
||||||
|
|
||||||
|
@ -329,14 +322,31 @@ PyTypeObject ComponentInstance_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) CmpInstObj_dealloc, /*tp_dealloc*/
|
(destructor) CmpInstObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) CmpInstObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) CmpInstObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) CmpInstObj_compare, /*tp_compare*/
|
(cmpfunc) CmpInstObj_compare, /*tp_compare*/
|
||||||
(reprfunc) CmpInstObj_repr, /*tp_repr*/
|
(reprfunc) CmpInstObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) CmpInstObj_hash, /*tp_hash*/
|
(hashfunc) CmpInstObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
CmpInstObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
CmpInstObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------- End object type ComponentInstance ---------------- */
|
/* --------------- End object type ComponentInstance ---------------- */
|
||||||
|
@ -701,14 +711,7 @@ static PyMethodDef CmpObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain CmpObj_chain = { CmpObj_methods, NULL };
|
#define CmpObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *CmpObj_getattr(ComponentObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&CmpObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CmpObj_setattr NULL
|
|
||||||
|
|
||||||
#define CmpObj_compare NULL
|
#define CmpObj_compare NULL
|
||||||
|
|
||||||
|
@ -725,14 +728,31 @@ PyTypeObject Component_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) CmpObj_dealloc, /*tp_dealloc*/
|
(destructor) CmpObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) CmpObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) CmpObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) CmpObj_compare, /*tp_compare*/
|
(cmpfunc) CmpObj_compare, /*tp_compare*/
|
||||||
(reprfunc) CmpObj_repr, /*tp_repr*/
|
(reprfunc) CmpObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) CmpObj_hash, /*tp_hash*/
|
(hashfunc) CmpObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
CmpObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
CmpObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------- End object type Component -------------------- */
|
/* ------------------- End object type Component -------------------- */
|
||||||
|
|
|
@ -79,14 +79,14 @@ ComponentResult = Type("ComponentResult", "l")
|
||||||
|
|
||||||
ComponentResourceHandle = OpaqueByValueType("ComponentResourceHandle", "ResObj")
|
ComponentResourceHandle = OpaqueByValueType("ComponentResourceHandle", "ResObj")
|
||||||
|
|
||||||
class MyCIObjectDefinition(GlobalObjectDefinition):
|
class MyCIObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Cm_Error,"NULL ComponentInstance");
|
PyErr_SetString(Cm_Error,"NULL ComponentInstance");
|
||||||
return NULL;
|
return NULL;
|
||||||
}""")
|
}""")
|
||||||
|
|
||||||
class MyCObjectDefinition(GlobalObjectDefinition):
|
class MyCObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
/* XXXX Or should we return None? */
|
/* XXXX Or should we return None? */
|
||||||
|
|
|
@ -4543,14 +4543,7 @@ static PyMethodDef CtlObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain CtlObj_chain = { CtlObj_methods, NULL };
|
#define CtlObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *CtlObj_getattr(ControlObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&CtlObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CtlObj_setattr NULL
|
|
||||||
|
|
||||||
static int CtlObj_compare(ControlObject *self, ControlObject *other)
|
static int CtlObj_compare(ControlObject *self, ControlObject *other)
|
||||||
{
|
{
|
||||||
|
@ -4587,14 +4580,31 @@ PyTypeObject Control_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) CtlObj_dealloc, /*tp_dealloc*/
|
(destructor) CtlObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) CtlObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) CtlObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) CtlObj_compare, /*tp_compare*/
|
(cmpfunc) CtlObj_compare, /*tp_compare*/
|
||||||
(reprfunc) CtlObj_repr, /*tp_repr*/
|
(reprfunc) CtlObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) CtlObj_hash, /*tp_hash*/
|
(hashfunc) CtlObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
CtlObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
CtlObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type Control --------------------- */
|
/* -------------------- End object type Control --------------------- */
|
||||||
|
|
|
@ -490,7 +490,7 @@ PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle, CtlObj_New);
|
||||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert);
|
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(ObjectIdentityMixin, GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, ObjectIdentityMixin, GlobalObjectDefinition):
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
GlobalObjectDefinition.outputStructMembers(self)
|
GlobalObjectDefinition.outputStructMembers(self)
|
||||||
Output("PyObject *ob_callbackdict;")
|
Output("PyObject *ob_callbackdict;")
|
||||||
|
|
|
@ -964,14 +964,7 @@ static PyMethodDef DlgObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain DlgObj_chain = { DlgObj_methods, NULL };
|
#define DlgObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *DlgObj_getattr(DialogObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&DlgObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DlgObj_setattr NULL
|
|
||||||
|
|
||||||
static int DlgObj_compare(DialogObject *self, DialogObject *other)
|
static int DlgObj_compare(DialogObject *self, DialogObject *other)
|
||||||
{
|
{
|
||||||
|
@ -996,14 +989,31 @@ PyTypeObject Dialog_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) DlgObj_dealloc, /*tp_dealloc*/
|
(destructor) DlgObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) DlgObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) DlgObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) DlgObj_compare, /*tp_compare*/
|
(cmpfunc) DlgObj_compare, /*tp_compare*/
|
||||||
(reprfunc) DlgObj_repr, /*tp_repr*/
|
(reprfunc) DlgObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) DlgObj_hash, /*tp_hash*/
|
(hashfunc) DlgObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
DlgObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
DlgObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Dialog --------------------- */
|
/* --------------------- End object type Dialog --------------------- */
|
||||||
|
|
|
@ -201,7 +201,7 @@ initstuff = initstuff + """
|
||||||
|
|
||||||
|
|
||||||
# Define a class which specializes our object definition
|
# Define a class which specializes our object definition
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def __init__(self, name, prefix = None, itselftype = None):
|
def __init__(self, name, prefix = None, itselftype = None):
|
||||||
GlobalObjectDefinition.__init__(self, name, prefix, itselftype)
|
GlobalObjectDefinition.__init__(self, name, prefix, itselftype)
|
||||||
## This won't work in Carbon, so we disable it for all MacPythons:-(
|
## This won't work in Carbon, so we disable it for all MacPythons:-(
|
||||||
|
|
|
@ -740,14 +740,7 @@ static PyMethodDef DragObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain DragObj_chain = { DragObj_methods, NULL };
|
#define DragObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *DragObj_getattr(DragObjObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&DragObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DragObj_setattr NULL
|
|
||||||
|
|
||||||
#define DragObj_compare NULL
|
#define DragObj_compare NULL
|
||||||
|
|
||||||
|
@ -764,14 +757,31 @@ PyTypeObject DragObj_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) DragObj_dealloc, /*tp_dealloc*/
|
(destructor) DragObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) DragObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) DragObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) DragObj_compare, /*tp_compare*/
|
(cmpfunc) DragObj_compare, /*tp_compare*/
|
||||||
(reprfunc) DragObj_repr, /*tp_repr*/
|
(reprfunc) DragObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) DragObj_hash, /*tp_hash*/
|
(hashfunc) DragObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
DragObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
DragObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type DragObj --------------------- */
|
/* -------------------- End object type DragObj --------------------- */
|
||||||
|
|
|
@ -183,7 +183,7 @@ dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing);
|
||||||
#endif
|
#endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Drag_Error,"Cannot create null Drag");
|
PyErr_SetString(Drag_Error,"Cannot create null Drag");
|
||||||
|
|
|
@ -43,25 +43,10 @@ includestuff = includestuff + """
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
|
||||||
def outputCheckNewArg(self):
|
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
|
||||||
def outputCheckConvertArg(self):
|
|
||||||
OutLbrace("if (DlgObj_Check(v))")
|
|
||||||
Output("*p_itself = ((WindowObject *)v)->ob_itself;")
|
|
||||||
Output("return 1;")
|
|
||||||
OutRbrace()
|
|
||||||
Out("""
|
|
||||||
if (v == Py_None) { *p_itself = NULL; return 1; }
|
|
||||||
if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
|
|
||||||
""")
|
|
||||||
|
|
||||||
# From here on it's basically all boiler plate...
|
# From here on it's basically all boiler plate...
|
||||||
|
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
|
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
|
||||||
##object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
|
|
||||||
##module.addobject(object)
|
|
||||||
|
|
||||||
# Create the generator classes used to populate the lists
|
# Create the generator classes used to populate the lists
|
||||||
Function = OSErrWeakLinkFunctionGenerator
|
Function = OSErrWeakLinkFunctionGenerator
|
||||||
|
@ -69,7 +54,6 @@ Function = OSErrWeakLinkFunctionGenerator
|
||||||
|
|
||||||
# Create and populate the lists
|
# Create and populate the lists
|
||||||
functions = []
|
functions = []
|
||||||
##methods = []
|
|
||||||
execfile(INPUTFILE)
|
execfile(INPUTFILE)
|
||||||
|
|
||||||
# Move TickCount here, for convenience
|
# Move TickCount here, for convenience
|
||||||
|
@ -80,7 +64,6 @@ functions.append(f)
|
||||||
# add the populated lists to the generator groups
|
# add the populated lists to the generator groups
|
||||||
# (in a different wordl the scan program would generate this)
|
# (in a different wordl the scan program would generate this)
|
||||||
for f in functions: module.add(f)
|
for f in functions: module.add(f)
|
||||||
##for f in methods: object.add(f)
|
|
||||||
|
|
||||||
WaitNextEvent_body = """
|
WaitNextEvent_body = """
|
||||||
Boolean _rv;
|
Boolean _rv;
|
||||||
|
|
|
@ -46,7 +46,7 @@ includestuff = includestuff + """
|
||||||
#endif
|
#endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
def outputCheckConvertArg(self):
|
def outputCheckConvertArg(self):
|
||||||
|
|
|
@ -31,11 +31,11 @@ initstuff = """
|
||||||
|
|
||||||
module = MacModule('_IBCarbon', 'IBCarbon', includestuff, finalstuff, initstuff)
|
module = MacModule('_IBCarbon', 'IBCarbon', includestuff, finalstuff, initstuff)
|
||||||
|
|
||||||
class CFReleaserObject(GlobalObjectDefinition):
|
class CFReleaserObject(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, name):
|
def outputFreeIt(self, name):
|
||||||
Output("CFRelease(%s);" % name)
|
Output("CFRelease(%s);" % name)
|
||||||
|
|
||||||
class CFNibDesc(GlobalObjectDefinition):
|
class CFNibDesc(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, name):
|
def outputFreeIt(self, name):
|
||||||
Output("DisposeNibReference(%s);" % name)
|
Output("DisposeNibReference(%s);" % name)
|
||||||
|
|
||||||
|
|
|
@ -140,14 +140,7 @@ static PyMethodDef IBNibRefObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain IBNibRefObj_chain = { IBNibRefObj_methods, NULL };
|
#define IBNibRefObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *IBNibRefObj_getattr(IBNibRefObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&IBNibRefObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define IBNibRefObj_setattr NULL
|
|
||||||
|
|
||||||
#define IBNibRefObj_compare NULL
|
#define IBNibRefObj_compare NULL
|
||||||
|
|
||||||
|
@ -164,14 +157,31 @@ PyTypeObject IBNibRef_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) IBNibRefObj_dealloc, /*tp_dealloc*/
|
(destructor) IBNibRefObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) IBNibRefObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) IBNibRefObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) IBNibRefObj_compare, /*tp_compare*/
|
(cmpfunc) IBNibRefObj_compare, /*tp_compare*/
|
||||||
(reprfunc) IBNibRefObj_repr, /*tp_repr*/
|
(reprfunc) IBNibRefObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) IBNibRefObj_hash, /*tp_hash*/
|
(hashfunc) IBNibRefObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
IBNibRefObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
IBNibRefObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type IBNibRef -------------------- */
|
/* -------------------- End object type IBNibRef -------------------- */
|
||||||
|
|
|
@ -54,7 +54,7 @@ includestuff = includestuff + """
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
def outputCheckConvertArg(self):
|
def outputCheckConvertArg(self):
|
||||||
|
|
|
@ -542,6 +542,138 @@ static PyObject *ListObj_LGetCellDataLocation(ListObject *_self, PyObject *_args
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListPort(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
CGrafPtr _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListPort(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
GrafObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListVerticalScrollBar(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
ControlHandle _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListVerticalScrollBar(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
CtlObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListHorizontalScrollBar(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
ControlHandle _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListHorizontalScrollBar(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
CtlObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListActive(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
Boolean _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListActive(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("b",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListClickTime(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
SInt32 _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListClickTime(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("l",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListRefCon(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
SInt32 _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListRefCon(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("l",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListDefinition(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
Handle _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListDefinition(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
ResObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListUserHandle(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
Handle _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListUserHandle(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
ResObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListDataHandle(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
DataHandle _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListDataHandle(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("O&",
|
||||||
|
ResObj_New, _rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListFlags(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
OptionBits _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListFlags(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("l",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_GetListSelectionFlags(ListObject *_self, PyObject *_args)
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
OptionBits _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = GetListSelectionFlags(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("l",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *ListObj_as_Resource(ListObject *_self, PyObject *_args)
|
static PyObject *ListObj_as_Resource(ListObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
|
@ -601,48 +733,73 @@ static PyMethodDef ListObj_methods[] = {
|
||||||
PyDoc_STR("(Point theCell) -> None")},
|
PyDoc_STR("(Point theCell) -> None")},
|
||||||
{"LGetCellDataLocation", (PyCFunction)ListObj_LGetCellDataLocation, 1,
|
{"LGetCellDataLocation", (PyCFunction)ListObj_LGetCellDataLocation, 1,
|
||||||
PyDoc_STR("(Point theCell) -> (short offset, short len)")},
|
PyDoc_STR("(Point theCell) -> (short offset, short len)")},
|
||||||
|
{"GetListPort", (PyCFunction)ListObj_GetListPort, 1,
|
||||||
|
PyDoc_STR("() -> (CGrafPtr _rv)")},
|
||||||
|
{"GetListVerticalScrollBar", (PyCFunction)ListObj_GetListVerticalScrollBar, 1,
|
||||||
|
PyDoc_STR("() -> (ControlHandle _rv)")},
|
||||||
|
{"GetListHorizontalScrollBar", (PyCFunction)ListObj_GetListHorizontalScrollBar, 1,
|
||||||
|
PyDoc_STR("() -> (ControlHandle _rv)")},
|
||||||
|
{"GetListActive", (PyCFunction)ListObj_GetListActive, 1,
|
||||||
|
PyDoc_STR("() -> (Boolean _rv)")},
|
||||||
|
{"GetListClickTime", (PyCFunction)ListObj_GetListClickTime, 1,
|
||||||
|
PyDoc_STR("() -> (SInt32 _rv)")},
|
||||||
|
{"GetListRefCon", (PyCFunction)ListObj_GetListRefCon, 1,
|
||||||
|
PyDoc_STR("() -> (SInt32 _rv)")},
|
||||||
|
{"GetListDefinition", (PyCFunction)ListObj_GetListDefinition, 1,
|
||||||
|
PyDoc_STR("() -> (Handle _rv)")},
|
||||||
|
{"GetListUserHandle", (PyCFunction)ListObj_GetListUserHandle, 1,
|
||||||
|
PyDoc_STR("() -> (Handle _rv)")},
|
||||||
|
{"GetListDataHandle", (PyCFunction)ListObj_GetListDataHandle, 1,
|
||||||
|
PyDoc_STR("() -> (DataHandle _rv)")},
|
||||||
|
{"GetListFlags", (PyCFunction)ListObj_GetListFlags, 1,
|
||||||
|
PyDoc_STR("() -> (OptionBits _rv)")},
|
||||||
|
{"GetListSelectionFlags", (PyCFunction)ListObj_GetListSelectionFlags, 1,
|
||||||
|
PyDoc_STR("() -> (OptionBits _rv)")},
|
||||||
{"as_Resource", (PyCFunction)ListObj_as_Resource, 1,
|
{"as_Resource", (PyCFunction)ListObj_as_Resource, 1,
|
||||||
PyDoc_STR("() -> (Handle _rv)")},
|
PyDoc_STR("() -> (Handle _rv)")},
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain ListObj_chain = { ListObj_methods, NULL };
|
static PyObject *ListObj_get_listFlags(ListObject *self, void *closure)
|
||||||
|
|
||||||
static PyObject *ListObj_getattr(ListObject *self, char *name)
|
|
||||||
{
|
{
|
||||||
{
|
|
||||||
if ( strcmp(name, "listFlags") == 0 )
|
|
||||||
return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff);
|
return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff);
|
||||||
if ( strcmp(name, "selFlags") == 0 )
|
|
||||||
return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff);
|
|
||||||
if ( strcmp(name, "cellSize") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize);
|
|
||||||
}
|
|
||||||
return Py_FindMethodInChain(&ListObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int ListObj_set_listFlags(ListObject *self, PyObject *v, void *closure)
|
||||||
ListObj_setattr(ListObject *self, char *name, PyObject *value)
|
|
||||||
{
|
{
|
||||||
long intval;
|
if (!PyArg_Parse(v, "B", &(*self->ob_itself)->listFlags)) return -1;
|
||||||
int err = 0;
|
return 0;
|
||||||
|
|
||||||
if ( value == NULL ) {
|
|
||||||
PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (strcmp(name, "listFlags") == 0 )
|
|
||||||
err = PyArg_Parse(value, "B", &(*self->ob_itself)->listFlags);
|
|
||||||
else if (strcmp(name, "selFlags") == 0 )
|
|
||||||
err = PyArg_Parse(value, "B", &(*self->ob_itself)->selFlags);
|
|
||||||
else if (strcmp(name, "cellSize") == 0 )
|
|
||||||
err = PyArg_Parse(value, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize);
|
|
||||||
else
|
|
||||||
PyErr_SetString(PyExc_AttributeError, "No such attribute");
|
|
||||||
if (err) return 0;
|
|
||||||
else return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_get_selFlags(ListObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ListObj_set_selFlags(ListObject *self, PyObject *v, void *closure)
|
||||||
|
{
|
||||||
|
if (!PyArg_Parse(v, "B", &(*self->ob_itself)->selFlags)) return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *ListObj_get_cellSize(ListObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ListObj_set_cellSize(ListObject *self, PyObject *v, void *closure)
|
||||||
|
{
|
||||||
|
if (!PyArg_Parse(v, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize)) return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyGetSetDef ListObj_getsetlist[] = {
|
||||||
|
{"listFlags", (getter)ListObj_get_listFlags, (setter)ListObj_set_listFlags, NULL},
|
||||||
|
{"selFlags", (getter)ListObj_get_selFlags, (setter)ListObj_set_selFlags, NULL},
|
||||||
|
{"cellSize", (getter)ListObj_get_cellSize, (setter)ListObj_set_cellSize, NULL},
|
||||||
|
{NULL, NULL, NULL, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define ListObj_compare NULL
|
#define ListObj_compare NULL
|
||||||
|
|
||||||
|
@ -659,14 +816,31 @@ PyTypeObject List_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) ListObj_dealloc, /*tp_dealloc*/
|
(destructor) ListObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) ListObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) ListObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) ListObj_compare, /*tp_compare*/
|
(cmpfunc) ListObj_compare, /*tp_compare*/
|
||||||
(reprfunc) ListObj_repr, /*tp_repr*/
|
(reprfunc) ListObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) ListObj_hash, /*tp_hash*/
|
(hashfunc) ListObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
ListObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
ListObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------------- End object type List ---------------------- */
|
/* ---------------------- End object type List ---------------------- */
|
||||||
|
@ -783,160 +957,6 @@ static PyObject *List_LNew(PyObject *_self, PyObject *_args)
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *List_GetListPort(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
CGrafPtr _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListPort(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
GrafObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListVerticalScrollBar(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
ControlHandle _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListVerticalScrollBar(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
CtlObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListHorizontalScrollBar(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
ControlHandle _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListHorizontalScrollBar(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
CtlObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListActive(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
Boolean _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListActive(list);
|
|
||||||
_res = Py_BuildValue("b",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListClickTime(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
SInt32 _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListClickTime(list);
|
|
||||||
_res = Py_BuildValue("l",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListRefCon(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
SInt32 _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListRefCon(list);
|
|
||||||
_res = Py_BuildValue("l",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListDefinition(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
Handle _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListDefinition(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
ResObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListUserHandle(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
Handle _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListUserHandle(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
ResObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListDataHandle(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
DataHandle _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListDataHandle(list);
|
|
||||||
_res = Py_BuildValue("O&",
|
|
||||||
ResObj_New, _rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListFlags(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OptionBits _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListFlags(list);
|
|
||||||
_res = Py_BuildValue("l",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_GetListSelectionFlags(PyObject *_self, PyObject *_args)
|
|
||||||
{
|
|
||||||
PyObject *_res = NULL;
|
|
||||||
OptionBits _rv;
|
|
||||||
ListHandle list;
|
|
||||||
if (!PyArg_ParseTuple(_args, "O&",
|
|
||||||
ListObj_Convert, &list))
|
|
||||||
return NULL;
|
|
||||||
_rv = GetListSelectionFlags(list);
|
|
||||||
_res = Py_BuildValue("l",
|
|
||||||
_rv);
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *List_SetListViewBounds(PyObject *_self, PyObject *_args)
|
static PyObject *List_SetListViewBounds(PyObject *_self, PyObject *_args)
|
||||||
{
|
{
|
||||||
PyObject *_res = NULL;
|
PyObject *_res = NULL;
|
||||||
|
@ -1085,28 +1105,6 @@ static PyMethodDef List_methods[] = {
|
||||||
PyDoc_STR("(Rect rView, Rect dataBounds, Point cellSize, ListDefSpec theSpec, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle outList)")},
|
PyDoc_STR("(Rect rView, Rect dataBounds, Point cellSize, ListDefSpec theSpec, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle outList)")},
|
||||||
{"LNew", (PyCFunction)List_LNew, 1,
|
{"LNew", (PyCFunction)List_LNew, 1,
|
||||||
PyDoc_STR("(Rect rView, Rect dataBounds, Point cSize, short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle _rv)")},
|
PyDoc_STR("(Rect rView, Rect dataBounds, Point cSize, short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle _rv)")},
|
||||||
{"GetListPort", (PyCFunction)List_GetListPort, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (CGrafPtr _rv)")},
|
|
||||||
{"GetListVerticalScrollBar", (PyCFunction)List_GetListVerticalScrollBar, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (ControlHandle _rv)")},
|
|
||||||
{"GetListHorizontalScrollBar", (PyCFunction)List_GetListHorizontalScrollBar, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (ControlHandle _rv)")},
|
|
||||||
{"GetListActive", (PyCFunction)List_GetListActive, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (Boolean _rv)")},
|
|
||||||
{"GetListClickTime", (PyCFunction)List_GetListClickTime, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (SInt32 _rv)")},
|
|
||||||
{"GetListRefCon", (PyCFunction)List_GetListRefCon, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (SInt32 _rv)")},
|
|
||||||
{"GetListDefinition", (PyCFunction)List_GetListDefinition, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (Handle _rv)")},
|
|
||||||
{"GetListUserHandle", (PyCFunction)List_GetListUserHandle, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (Handle _rv)")},
|
|
||||||
{"GetListDataHandle", (PyCFunction)List_GetListDataHandle, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (DataHandle _rv)")},
|
|
||||||
{"GetListFlags", (PyCFunction)List_GetListFlags, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (OptionBits _rv)")},
|
|
||||||
{"GetListSelectionFlags", (PyCFunction)List_GetListSelectionFlags, 1,
|
|
||||||
PyDoc_STR("(ListHandle list) -> (OptionBits _rv)")},
|
|
||||||
{"SetListViewBounds", (PyCFunction)List_SetListViewBounds, 1,
|
{"SetListViewBounds", (PyCFunction)List_SetListViewBounds, 1,
|
||||||
PyDoc_STR("(ListHandle list, Rect view) -> None")},
|
PyDoc_STR("(ListHandle list, Rect view) -> None")},
|
||||||
{"SetListPort", (PyCFunction)List_SetListPort, 1,
|
{"SetListPort", (PyCFunction)List_SetListPort, 1,
|
||||||
|
|
|
@ -31,7 +31,7 @@ class MyScanner(Scanner):
|
||||||
if arglist:
|
if arglist:
|
||||||
t, n, m = arglist[-1]
|
t, n, m = arglist[-1]
|
||||||
# This is non-functional today
|
# This is non-functional today
|
||||||
if t == OBJECT and m == "InMode":
|
if t in ('ListHandle', 'ListRef') and m == "InMode":
|
||||||
classname = "Method"
|
classname = "Method"
|
||||||
listname = "methods"
|
listname = "methods"
|
||||||
return classname, listname
|
return classname, listname
|
||||||
|
|
|
@ -137,41 +137,23 @@ class ListMethodGenerator(MethodGenerator):
|
||||||
FunctionGenerator.parseArgumentList(self, args)
|
FunctionGenerator.parseArgumentList(self, args)
|
||||||
self.argumentList.append(self.itself)
|
self.argumentList.append(self.itself)
|
||||||
|
|
||||||
getattrHookCode = """{
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
if ( strcmp(name, "listFlags") == 0 )
|
getsetlist = [(
|
||||||
return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff);
|
'listFlags',
|
||||||
if ( strcmp(name, "selFlags") == 0 )
|
'return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff);',
|
||||||
return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff);
|
'if (!PyArg_Parse(v, "B", &(*self->ob_itself)->listFlags)) return -1;',
|
||||||
if ( strcmp(name, "cellSize") == 0 )
|
None,
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize);
|
), (
|
||||||
}"""
|
'selFlags',
|
||||||
|
'return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff);',
|
||||||
setattrCode = """
|
'if (!PyArg_Parse(v, "B", &(*self->ob_itself)->selFlags)) return -1;',
|
||||||
static int
|
None,
|
||||||
ListObj_setattr(ListObject *self, char *name, PyObject *value)
|
), (
|
||||||
{
|
'cellSize',
|
||||||
long intval;
|
'return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize);',
|
||||||
int err = 0;
|
'if (!PyArg_Parse(v, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize)) return -1;',
|
||||||
|
None
|
||||||
if ( value == NULL ) {
|
)]
|
||||||
PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (strcmp(name, "listFlags") == 0 )
|
|
||||||
err = PyArg_Parse(value, "B", &(*self->ob_itself)->listFlags);
|
|
||||||
else if (strcmp(name, "selFlags") == 0 )
|
|
||||||
err = PyArg_Parse(value, "B", &(*self->ob_itself)->selFlags);
|
|
||||||
else if (strcmp(name, "cellSize") == 0 )
|
|
||||||
err = PyArg_Parse(value, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize);
|
|
||||||
else
|
|
||||||
PyErr_SetString(PyExc_AttributeError, "No such attribute");
|
|
||||||
if (err) return 0;
|
|
||||||
else return -1;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
|
||||||
|
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
ObjectDefinition.outputStructMembers(self)
|
ObjectDefinition.outputStructMembers(self)
|
||||||
|
@ -201,12 +183,6 @@ class MyObjectDefinition(GlobalObjectDefinition):
|
||||||
Output("SetListRefCon(self->ob_itself, (long)0);")
|
Output("SetListRefCon(self->ob_itself, (long)0);")
|
||||||
Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname)
|
Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname)
|
||||||
|
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output(getattrHookCode)
|
|
||||||
|
|
||||||
def outputSetattr(self):
|
|
||||||
Output(setattrCode)
|
|
||||||
|
|
||||||
# From here on it's basically all boiler plate...
|
# From here on it's basically all boiler plate...
|
||||||
|
|
||||||
finalstuff = finalstuff + """
|
finalstuff = finalstuff + """
|
||||||
|
|
|
@ -3000,14 +3000,7 @@ static PyMethodDef MenuObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain MenuObj_chain = { MenuObj_methods, NULL };
|
#define MenuObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *MenuObj_getattr(MenuObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&MenuObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MenuObj_setattr NULL
|
|
||||||
|
|
||||||
#define MenuObj_compare NULL
|
#define MenuObj_compare NULL
|
||||||
|
|
||||||
|
@ -3024,14 +3017,31 @@ PyTypeObject Menu_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) MenuObj_dealloc, /*tp_dealloc*/
|
(destructor) MenuObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) MenuObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) MenuObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) MenuObj_compare, /*tp_compare*/
|
(cmpfunc) MenuObj_compare, /*tp_compare*/
|
||||||
(reprfunc) MenuObj_repr, /*tp_repr*/
|
(reprfunc) MenuObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) MenuObj_hash, /*tp_hash*/
|
(hashfunc) MenuObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
MenuObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
MenuObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------------- End object type Menu ---------------------- */
|
/* ---------------------- End object type Menu ---------------------- */
|
||||||
|
|
|
@ -98,7 +98,7 @@ initstuff = initstuff + """
|
||||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
|
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(MenuHandle, MenuObj_Convert);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
|
|
|
@ -1295,14 +1295,7 @@ static PyMethodDef TXNObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain TXNObj_chain = { TXNObj_methods, NULL };
|
#define TXNObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *TXNObj_getattr(TXNObjectObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&TXNObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TXNObj_setattr NULL
|
|
||||||
|
|
||||||
#define TXNObj_compare NULL
|
#define TXNObj_compare NULL
|
||||||
|
|
||||||
|
@ -1319,14 +1312,31 @@ PyTypeObject TXNObject_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) TXNObj_dealloc, /*tp_dealloc*/
|
(destructor) TXNObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) TXNObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) TXNObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) TXNObj_compare, /*tp_compare*/
|
(cmpfunc) TXNObj_compare, /*tp_compare*/
|
||||||
(reprfunc) TXNObj_repr, /*tp_repr*/
|
(reprfunc) TXNObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) TXNObj_hash, /*tp_hash*/
|
(hashfunc) TXNObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
TXNObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
TXNObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------- End object type TXNObject -------------------- */
|
/* ------------------- End object type TXNObject -------------------- */
|
||||||
|
@ -1411,14 +1421,7 @@ static PyMethodDef TXNFontMenuObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain TXNFontMenuObj_chain = { TXNFontMenuObj_methods, NULL };
|
#define TXNFontMenuObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *TXNFontMenuObj_getattr(TXNFontMenuObjectObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&TXNFontMenuObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TXNFontMenuObj_setattr NULL
|
|
||||||
|
|
||||||
#define TXNFontMenuObj_compare NULL
|
#define TXNFontMenuObj_compare NULL
|
||||||
|
|
||||||
|
@ -1435,14 +1438,31 @@ PyTypeObject TXNFontMenuObject_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) TXNFontMenuObj_dealloc, /*tp_dealloc*/
|
(destructor) TXNFontMenuObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) TXNFontMenuObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) TXNFontMenuObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) TXNFontMenuObj_compare, /*tp_compare*/
|
(cmpfunc) TXNFontMenuObj_compare, /*tp_compare*/
|
||||||
(reprfunc) TXNFontMenuObj_repr, /*tp_repr*/
|
(reprfunc) TXNFontMenuObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) TXNFontMenuObj_hash, /*tp_hash*/
|
(hashfunc) TXNFontMenuObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
TXNFontMenuObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
TXNFontMenuObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------- End object type TXNFontMenuObject ---------------- */
|
/* --------------- End object type TXNFontMenuObject ---------------- */
|
||||||
|
|
|
@ -136,11 +136,11 @@ execfile("mltetypetest.py")
|
||||||
|
|
||||||
# Our (opaque) objects
|
# Our (opaque) objects
|
||||||
|
|
||||||
class TXNObjDefinition(GlobalObjectDefinition):
|
class TXNObjDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
|
|
||||||
class TXNFontMenuObjDefinition(GlobalObjectDefinition):
|
class TXNFontMenuObjDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -53,6 +53,12 @@ class MyScanner(Scanner):
|
||||||
listname = "functions"
|
listname = "functions"
|
||||||
if arglist:
|
if arglist:
|
||||||
t, n, m = arglist[0]
|
t, n, m = arglist[0]
|
||||||
|
if t in ('GrafPtr', 'CGrafPtr') and m == 'InMode':
|
||||||
|
classname = "Method"
|
||||||
|
listname = "gr_methods"
|
||||||
|
elif t == 'BitMapPtr' and m == 'InMode':
|
||||||
|
classname = "Method"
|
||||||
|
listname = "bm_methods"
|
||||||
## elif t == "PolyHandle" and m == "InMode":
|
## elif t == "PolyHandle" and m == "InMode":
|
||||||
## classname = "Method"
|
## classname = "Method"
|
||||||
## listname = "p_methods"
|
## listname = "p_methods"
|
||||||
|
|
|
@ -211,15 +211,7 @@ PyObject *BMObj_NewCopied(BitMapPtr itself)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
variablestuff = """
|
variablestuff = ""
|
||||||
{
|
|
||||||
PyObject *o;
|
|
||||||
|
|
||||||
o = QDGA_New();
|
|
||||||
if (o == NULL || PyDict_SetItemString(d, "qd", o) != 0)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
initstuff = initstuff + """
|
initstuff = initstuff + """
|
||||||
PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr, BMObj_New);
|
PyMac_INIT_TOOLBOX_OBJECT_NEW(BitMapPtr, BMObj_New);
|
||||||
|
@ -244,7 +236,22 @@ initstuff = initstuff + """
|
||||||
## def outputFreeIt(self, itselfname):
|
## def outputFreeIt(self, itselfname):
|
||||||
## Output("KillPoly(%s);", itselfname)
|
## Output("KillPoly(%s);", itselfname)
|
||||||
|
|
||||||
class MyGRObjectDefinition(GlobalObjectDefinition):
|
class MyGRObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
|
getsetlist = [
|
||||||
|
('visRgn',
|
||||||
|
"""RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */
|
||||||
|
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortVisibleRegion(self->ob_itself, h));
|
||||||
|
""",
|
||||||
|
None,
|
||||||
|
"Convenience attribute: return a copy of the visible region"
|
||||||
|
), (
|
||||||
|
'clipRgn',
|
||||||
|
"""RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */
|
||||||
|
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortClipRegion(self->ob_itself, h));
|
||||||
|
""",
|
||||||
|
None,
|
||||||
|
"Convenience attribute: return a copy of the clipping region"
|
||||||
|
)]
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
def outputCheckConvertArg(self):
|
def outputCheckConvertArg(self):
|
||||||
|
@ -269,157 +276,35 @@ class MyGRObjectDefinition(GlobalObjectDefinition):
|
||||||
Output("return 1;")
|
Output("return 1;")
|
||||||
OutRbrace()
|
OutRbrace()
|
||||||
Output("#endif")
|
Output("#endif")
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("#if !ACCESSOR_CALLS_ARE_FUNCTIONS")
|
|
||||||
Output("""
|
|
||||||
{ CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
|
|
||||||
|
|
||||||
if ( strcmp(name, "data") == 0 )
|
class MyBMObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(GrafPort));
|
getsetlist = [
|
||||||
|
(
|
||||||
if ( (itself_color->portVersion&0xc000) == 0xc000 ) {
|
'baseAddr',
|
||||||
/* Color-only attributes */
|
'return PyInt_FromLong((long)self->ob_itself->baseAddr);',
|
||||||
|
None,
|
||||||
if ( strcmp(name, "portBits") == 0 )
|
None
|
||||||
/* XXXX Do we need HLock() stuff here?? */
|
), (
|
||||||
return BMObj_New((BitMapPtr)*itself_color->portPixMap);
|
'rowBytes',
|
||||||
if ( strcmp(name, "grafVars") == 0 )
|
'return PyInt_FromLong((long)self->ob_itself->rowBytes);',
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->visRgn);
|
None,
|
||||||
if ( strcmp(name, "chExtra") == 0 )
|
None
|
||||||
return Py_BuildValue("h", itself_color->chExtra);
|
), (
|
||||||
if ( strcmp(name, "pnLocHFrac") == 0 )
|
'bounds',
|
||||||
return Py_BuildValue("h", itself_color->pnLocHFrac);
|
'return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->bounds);',
|
||||||
if ( strcmp(name, "bkPixPat") == 0 )
|
None,
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->bkPixPat);
|
None
|
||||||
if ( strcmp(name, "rgbFgColor") == 0 )
|
), (
|
||||||
return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbFgColor);
|
'bitmap_data',
|
||||||
if ( strcmp(name, "rgbBkColor") == 0 )
|
'return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(BitMap));',
|
||||||
return Py_BuildValue("O&", QdRGB_New, &itself_color->rgbBkColor);
|
None,
|
||||||
if ( strcmp(name, "pnPixPat") == 0 )
|
None
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->pnPixPat);
|
), (
|
||||||
if ( strcmp(name, "fillPixPat") == 0 )
|
'pixmap_data',
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)itself_color->fillPixPat);
|
'return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(PixMap));',
|
||||||
} else {
|
None,
|
||||||
/* Mono-only attributes */
|
None
|
||||||
if ( strcmp(name, "portBits") == 0 )
|
)]
|
||||||
return BMObj_New(&self->ob_itself->portBits);
|
|
||||||
if ( strcmp(name, "bkPat") == 0 )
|
|
||||||
return Py_BuildValue("s#", (char *)&self->ob_itself->bkPat, sizeof(Pattern));
|
|
||||||
if ( strcmp(name, "fillPat") == 0 )
|
|
||||||
return Py_BuildValue("s#", (char *)&self->ob_itself->fillPat, sizeof(Pattern));
|
|
||||||
if ( strcmp(name, "pnPat") == 0 )
|
|
||||||
return Py_BuildValue("s#", (char *)&self->ob_itself->pnPat, sizeof(Pattern));
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
** Accessible for both color/mono windows.
|
|
||||||
** portVersion is really color-only, but we put it here
|
|
||||||
** for convenience
|
|
||||||
*/
|
|
||||||
if ( strcmp(name, "portVersion") == 0 )
|
|
||||||
return Py_BuildValue("h", itself_color->portVersion);
|
|
||||||
if ( strcmp(name, "device") == 0 )
|
|
||||||
return PyInt_FromLong((long)self->ob_itself->device);
|
|
||||||
if ( strcmp(name, "portRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->portRect);
|
|
||||||
if ( strcmp(name, "visRgn") == 0 )
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->visRgn);
|
|
||||||
if ( strcmp(name, "clipRgn") == 0 )
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)self->ob_itself->clipRgn);
|
|
||||||
if ( strcmp(name, "pnLoc") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnLoc);
|
|
||||||
if ( strcmp(name, "pnSize") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, self->ob_itself->pnSize);
|
|
||||||
if ( strcmp(name, "pnMode") == 0 )
|
|
||||||
return Py_BuildValue("h", self->ob_itself->pnMode);
|
|
||||||
if ( strcmp(name, "pnVis") == 0 )
|
|
||||||
return Py_BuildValue("h", self->ob_itself->pnVis);
|
|
||||||
if ( strcmp(name, "txFont") == 0 )
|
|
||||||
return Py_BuildValue("h", self->ob_itself->txFont);
|
|
||||||
if ( strcmp(name, "txFace") == 0 )
|
|
||||||
return Py_BuildValue("h", (short)self->ob_itself->txFace);
|
|
||||||
if ( strcmp(name, "txMode") == 0 )
|
|
||||||
return Py_BuildValue("h", self->ob_itself->txMode);
|
|
||||||
if ( strcmp(name, "txSize") == 0 )
|
|
||||||
return Py_BuildValue("h", self->ob_itself->txSize);
|
|
||||||
if ( strcmp(name, "spExtra") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildFixed, self->ob_itself->spExtra);
|
|
||||||
/* XXXX Add more, as needed */
|
|
||||||
/* This one is so we can compare grafports: */
|
|
||||||
if ( strcmp(name, "_id") == 0 )
|
|
||||||
return Py_BuildValue("l", (long)self->ob_itself);
|
|
||||||
}""")
|
|
||||||
Output("#else")
|
|
||||||
Output("""
|
|
||||||
{ CGrafPtr itself_color = (CGrafPtr)self->ob_itself;
|
|
||||||
if ( strcmp(name, "portBits") == 0 )
|
|
||||||
return BMObj_New((BitMapPtr)GetPortBitMapForCopyBits(itself_color));
|
|
||||||
if ( strcmp(name, "chExtra") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortChExtra(itself_color));
|
|
||||||
if ( strcmp(name, "pnLocHFrac") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortFracHPenLocation(itself_color));
|
|
||||||
if ( strcmp(name, "bkPixPat") == 0 ) {
|
|
||||||
PixPatHandle h=0;
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortBackPixPat(itself_color, h));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "rgbFgColor") == 0 ) {
|
|
||||||
RGBColor c;
|
|
||||||
return Py_BuildValue("O&", QdRGB_New, GetPortForeColor(itself_color, &c));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "rgbBkColor") == 0 ) {
|
|
||||||
RGBColor c;
|
|
||||||
return Py_BuildValue("O&", QdRGB_New, GetPortBackColor(itself_color, &c));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "pnPixPat") == 0 ) {
|
|
||||||
PixPatHandle h=NewPixPat(); /* XXXX wrong dispose routine */
|
|
||||||
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortPenPixPat(itself_color, h));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "fillPixPat") == 0 ) {
|
|
||||||
PixPatHandle h=NewPixPat(); /* XXXX wrong dispose routine */
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortFillPixPat(itself_color, h));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "portRect") == 0 ) {
|
|
||||||
Rect r;
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect, GetPortBounds(itself_color, &r));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "visRgn") == 0 ) {
|
|
||||||
RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortVisibleRegion(itself_color, h));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "clipRgn") == 0 ) {
|
|
||||||
RgnHandle h=NewRgn(); /* XXXX wrong dispose routine */
|
|
||||||
return Py_BuildValue("O&", ResObj_New, (Handle)GetPortClipRegion(itself_color, h));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "pnLoc") == 0 ) {
|
|
||||||
Point p;
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, *GetPortPenLocation(itself_color, &p));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "pnSize") == 0 ) {
|
|
||||||
Point p;
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint, *GetPortPenSize(itself_color, &p));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "pnMode") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortPenMode(itself_color));
|
|
||||||
if ( strcmp(name, "pnVis") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortPenVisibility(itself_color));
|
|
||||||
if ( strcmp(name, "txFont") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortTextFont(itself_color));
|
|
||||||
if ( strcmp(name, "txFace") == 0 )
|
|
||||||
return Py_BuildValue("h", (short)GetPortTextFace(itself_color));
|
|
||||||
if ( strcmp(name, "txMode") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortTextMode(itself_color));
|
|
||||||
if ( strcmp(name, "txSize") == 0 )
|
|
||||||
return Py_BuildValue("h", GetPortTextSize(itself_color));
|
|
||||||
if ( strcmp(name, "spExtra") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildFixed, GetPortSpExtra(itself_color));
|
|
||||||
/* XXXX Add more, as needed */
|
|
||||||
/* This one is so we can compare grafports: */
|
|
||||||
if ( strcmp(name, "_id") == 0 )
|
|
||||||
return Py_BuildValue("l", (long)self->ob_itself);
|
|
||||||
}""")
|
|
||||||
Output("#endif")
|
|
||||||
|
|
||||||
class MyBMObjectDefinition(GlobalObjectDefinition):
|
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
|
@ -435,103 +320,6 @@ class MyBMObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputCleanupStructMembers(self):
|
def outputCleanupStructMembers(self):
|
||||||
Output("Py_XDECREF(self->referred_object);")
|
Output("Py_XDECREF(self->referred_object);")
|
||||||
Output("if (self->referred_bitmap) free(self->referred_bitmap);")
|
Output("if (self->referred_bitmap) free(self->referred_bitmap);")
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("""if ( strcmp(name, "baseAddr") == 0 )
|
|
||||||
return PyInt_FromLong((long)self->ob_itself->baseAddr);
|
|
||||||
if ( strcmp(name, "rowBytes") == 0 )
|
|
||||||
return PyInt_FromLong((long)self->ob_itself->rowBytes);
|
|
||||||
if ( strcmp(name, "bounds") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect, &self->ob_itself->bounds);
|
|
||||||
/* XXXX Add more, as needed */
|
|
||||||
if ( strcmp(name, "bitmap_data") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(BitMap));
|
|
||||||
if ( strcmp(name, "pixmap_data") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)self->ob_itself, sizeof(PixMap));
|
|
||||||
""")
|
|
||||||
|
|
||||||
# This object is instanciated once, and will access qd globals.
|
|
||||||
class QDGlobalsAccessObjectDefinition(ObjectDefinition):
|
|
||||||
def outputStructMembers(self):
|
|
||||||
pass
|
|
||||||
def outputNew(self):
|
|
||||||
Output()
|
|
||||||
Output("%sPyObject *%s_New(void)", self.static, self.prefix)
|
|
||||||
OutLbrace()
|
|
||||||
Output("%s *it;", self.objecttype)
|
|
||||||
Output("it = PyObject_NEW(%s, &%s);", self.objecttype, self.typename)
|
|
||||||
Output("if (it == NULL) return NULL;")
|
|
||||||
Output("return (PyObject *)it;")
|
|
||||||
OutRbrace()
|
|
||||||
def outputConvert(self):
|
|
||||||
pass
|
|
||||||
def outputCleanupStructMembers(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("#if !ACCESSOR_CALLS_ARE_FUNCTIONS")
|
|
||||||
Output("""
|
|
||||||
if ( strcmp(name, "arrow") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.arrow, sizeof(qd.arrow));
|
|
||||||
if ( strcmp(name, "black") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.black, sizeof(qd.black));
|
|
||||||
if ( strcmp(name, "white") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.white, sizeof(qd.white));
|
|
||||||
if ( strcmp(name, "gray") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.gray, sizeof(qd.gray));
|
|
||||||
if ( strcmp(name, "ltGray") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.ltGray, sizeof(qd.ltGray));
|
|
||||||
if ( strcmp(name, "dkGray") == 0 )
|
|
||||||
return PyString_FromStringAndSize((char *)&qd.dkGray, sizeof(qd.dkGray));
|
|
||||||
if ( strcmp(name, "screenBits") == 0 )
|
|
||||||
return BMObj_New(&qd.screenBits);
|
|
||||||
if ( strcmp(name, "thePort") == 0 )
|
|
||||||
return GrafObj_New(qd.thePort);
|
|
||||||
if ( strcmp(name, "randSeed") == 0 )
|
|
||||||
return Py_BuildValue("l", &qd.randSeed);
|
|
||||||
""")
|
|
||||||
Output("#else")
|
|
||||||
Output("""
|
|
||||||
if ( strcmp(name, "arrow") == 0 ) {
|
|
||||||
Cursor rv;
|
|
||||||
GetQDGlobalsArrow(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "black") == 0 ) {
|
|
||||||
Pattern rv;
|
|
||||||
GetQDGlobalsBlack(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "white") == 0 ) {
|
|
||||||
Pattern rv;
|
|
||||||
GetQDGlobalsWhite(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "gray") == 0 ) {
|
|
||||||
Pattern rv;
|
|
||||||
GetQDGlobalsGray(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "ltGray") == 0 ) {
|
|
||||||
Pattern rv;
|
|
||||||
GetQDGlobalsLightGray(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "dkGray") == 0 ) {
|
|
||||||
Pattern rv;
|
|
||||||
GetQDGlobalsDarkGray(&rv);
|
|
||||||
return PyString_FromStringAndSize((char *)&rv, sizeof(rv));
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "screenBits") == 0 ) {
|
|
||||||
BitMap rv;
|
|
||||||
GetQDGlobalsScreenBits(&rv);
|
|
||||||
return BMObj_NewCopied(&rv);
|
|
||||||
}
|
|
||||||
if ( strcmp(name, "thePort") == 0 )
|
|
||||||
return GrafObj_New(GetQDGlobalsThePort());
|
|
||||||
if ( strcmp(name, "randSeed") == 0 )
|
|
||||||
return Py_BuildValue("l", GetQDGlobalsRandomSeed());
|
|
||||||
""")
|
|
||||||
Output("#endif")
|
|
||||||
|
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, variablestuff)
|
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff, variablestuff)
|
||||||
|
@ -543,8 +331,6 @@ gr_object = MyGRObjectDefinition("GrafPort", "GrafObj", "GrafPtr")
|
||||||
module.addobject(gr_object)
|
module.addobject(gr_object)
|
||||||
bm_object = MyBMObjectDefinition("BitMap", "BMObj", "BitMapPtr")
|
bm_object = MyBMObjectDefinition("BitMap", "BMObj", "BitMapPtr")
|
||||||
module.addobject(bm_object)
|
module.addobject(bm_object)
|
||||||
qd_object = QDGlobalsAccessObjectDefinition("QDGlobalsAccess", "QDGA", "XXXX")
|
|
||||||
module.addobject(qd_object)
|
|
||||||
|
|
||||||
|
|
||||||
# Create the generator classes used to populate the lists
|
# Create the generator classes used to populate the lists
|
||||||
|
@ -553,15 +339,17 @@ Method = OSErrWeakLinkMethodGenerator
|
||||||
|
|
||||||
# Create and populate the lists
|
# Create and populate the lists
|
||||||
functions = []
|
functions = []
|
||||||
methods = []
|
gr_methods = []
|
||||||
|
bm_methods = []
|
||||||
|
#methods = []
|
||||||
execfile(INPUTFILE)
|
execfile(INPUTFILE)
|
||||||
execfile(EXTRAFILE)
|
execfile(EXTRAFILE)
|
||||||
|
|
||||||
# add the populated lists to the generator groups
|
# add the populated lists to the generator groups
|
||||||
# (in a different wordl the scan program would generate this)
|
# (in a different wordl the scan program would generate this)
|
||||||
for f in functions: module.add(f)
|
for f in functions: module.add(f)
|
||||||
##for f in r_methods: r_object.add(f)
|
for f in gr_methods: gr_object.add(f)
|
||||||
##for f in po_methods: po_object.add(f)
|
for f in bm_methods: bm_object.add(f)
|
||||||
|
|
||||||
# Manual generator: get data out of a bitmap
|
# Manual generator: get data out of a bitmap
|
||||||
getdata_body = """
|
getdata_body = """
|
||||||
|
|
|
@ -131,14 +131,7 @@ static PyMethodDef GWorldObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain GWorldObj_chain = { GWorldObj_methods, NULL };
|
#define GWorldObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *GWorldObj_getattr(GWorldObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&GWorldObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define GWorldObj_setattr NULL
|
|
||||||
|
|
||||||
#define GWorldObj_compare NULL
|
#define GWorldObj_compare NULL
|
||||||
|
|
||||||
|
@ -155,14 +148,31 @@ PyTypeObject GWorld_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) GWorldObj_dealloc, /*tp_dealloc*/
|
(destructor) GWorldObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) GWorldObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) GWorldObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) GWorldObj_compare, /*tp_compare*/
|
(cmpfunc) GWorldObj_compare, /*tp_compare*/
|
||||||
(reprfunc) GWorldObj_repr, /*tp_repr*/
|
(reprfunc) GWorldObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) GWorldObj_hash, /*tp_hash*/
|
(hashfunc) GWorldObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
GWorldObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
GWorldObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type GWorld --------------------- */
|
/* --------------------- End object type GWorld --------------------- */
|
||||||
|
|
|
@ -57,7 +57,7 @@ initstuff = initstuff + """
|
||||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
|
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
## def outputInitStructMembers(self):
|
## def outputInitStructMembers(self):
|
||||||
|
|
|
@ -1090,14 +1090,7 @@ static PyMethodDef MovieCtlObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain MovieCtlObj_chain = { MovieCtlObj_methods, NULL };
|
#define MovieCtlObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *MovieCtlObj_getattr(MovieControllerObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&MovieCtlObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MovieCtlObj_setattr NULL
|
|
||||||
|
|
||||||
#define MovieCtlObj_compare NULL
|
#define MovieCtlObj_compare NULL
|
||||||
|
|
||||||
|
@ -1114,14 +1107,31 @@ PyTypeObject MovieController_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
|
(destructor) MovieCtlObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) MovieCtlObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) MovieCtlObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) MovieCtlObj_compare, /*tp_compare*/
|
(cmpfunc) MovieCtlObj_compare, /*tp_compare*/
|
||||||
(reprfunc) MovieCtlObj_repr, /*tp_repr*/
|
(reprfunc) MovieCtlObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) MovieCtlObj_hash, /*tp_hash*/
|
(hashfunc) MovieCtlObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
MovieCtlObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
MovieCtlObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------- End object type MovieController ----------------- */
|
/* ---------------- End object type MovieController ----------------- */
|
||||||
|
@ -1541,14 +1551,7 @@ static PyMethodDef TimeBaseObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain TimeBaseObj_chain = { TimeBaseObj_methods, NULL };
|
#define TimeBaseObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *TimeBaseObj_getattr(TimeBaseObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&TimeBaseObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TimeBaseObj_setattr NULL
|
|
||||||
|
|
||||||
#define TimeBaseObj_compare NULL
|
#define TimeBaseObj_compare NULL
|
||||||
|
|
||||||
|
@ -1565,14 +1568,31 @@ PyTypeObject TimeBase_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
|
(destructor) TimeBaseObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) TimeBaseObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) TimeBaseObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) TimeBaseObj_compare, /*tp_compare*/
|
(cmpfunc) TimeBaseObj_compare, /*tp_compare*/
|
||||||
(reprfunc) TimeBaseObj_repr, /*tp_repr*/
|
(reprfunc) TimeBaseObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) TimeBaseObj_hash, /*tp_hash*/
|
(hashfunc) TimeBaseObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
TimeBaseObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
TimeBaseObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type TimeBase -------------------- */
|
/* -------------------- End object type TimeBase -------------------- */
|
||||||
|
@ -1845,14 +1865,7 @@ static PyMethodDef UserDataObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain UserDataObj_chain = { UserDataObj_methods, NULL };
|
#define UserDataObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *UserDataObj_getattr(UserDataObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&UserDataObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define UserDataObj_setattr NULL
|
|
||||||
|
|
||||||
#define UserDataObj_compare NULL
|
#define UserDataObj_compare NULL
|
||||||
|
|
||||||
|
@ -1869,14 +1882,31 @@ PyTypeObject UserData_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) UserDataObj_dealloc, /*tp_dealloc*/
|
(destructor) UserDataObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) UserDataObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) UserDataObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) UserDataObj_compare, /*tp_compare*/
|
(cmpfunc) UserDataObj_compare, /*tp_compare*/
|
||||||
(reprfunc) UserDataObj_repr, /*tp_repr*/
|
(reprfunc) UserDataObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) UserDataObj_hash, /*tp_hash*/
|
(hashfunc) UserDataObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
UserDataObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
UserDataObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type UserData -------------------- */
|
/* -------------------- End object type UserData -------------------- */
|
||||||
|
@ -3020,14 +3050,7 @@ static PyMethodDef MediaObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain MediaObj_chain = { MediaObj_methods, NULL };
|
#define MediaObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *MediaObj_getattr(MediaObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&MediaObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MediaObj_setattr NULL
|
|
||||||
|
|
||||||
#define MediaObj_compare NULL
|
#define MediaObj_compare NULL
|
||||||
|
|
||||||
|
@ -3044,14 +3067,31 @@ PyTypeObject Media_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) MediaObj_dealloc, /*tp_dealloc*/
|
(destructor) MediaObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) MediaObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) MediaObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) MediaObj_compare, /*tp_compare*/
|
(cmpfunc) MediaObj_compare, /*tp_compare*/
|
||||||
(reprfunc) MediaObj_repr, /*tp_repr*/
|
(reprfunc) MediaObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) MediaObj_hash, /*tp_hash*/
|
(hashfunc) MediaObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
MediaObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
MediaObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Media ---------------------- */
|
/* --------------------- End object type Media ---------------------- */
|
||||||
|
@ -4301,14 +4341,7 @@ static PyMethodDef TrackObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain TrackObj_chain = { TrackObj_methods, NULL };
|
#define TrackObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *TrackObj_getattr(TrackObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&TrackObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TrackObj_setattr NULL
|
|
||||||
|
|
||||||
#define TrackObj_compare NULL
|
#define TrackObj_compare NULL
|
||||||
|
|
||||||
|
@ -4325,14 +4358,31 @@ PyTypeObject Track_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) TrackObj_dealloc, /*tp_dealloc*/
|
(destructor) TrackObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) TrackObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) TrackObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) TrackObj_compare, /*tp_compare*/
|
(cmpfunc) TrackObj_compare, /*tp_compare*/
|
||||||
(reprfunc) TrackObj_repr, /*tp_repr*/
|
(reprfunc) TrackObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) TrackObj_hash, /*tp_hash*/
|
(hashfunc) TrackObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
TrackObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
TrackObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Track ---------------------- */
|
/* --------------------- End object type Track ---------------------- */
|
||||||
|
@ -6722,14 +6772,7 @@ static PyMethodDef MovieObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain MovieObj_chain = { MovieObj_methods, NULL };
|
#define MovieObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *MovieObj_getattr(MovieObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&MovieObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MovieObj_setattr NULL
|
|
||||||
|
|
||||||
#define MovieObj_compare NULL
|
#define MovieObj_compare NULL
|
||||||
|
|
||||||
|
@ -6746,14 +6789,31 @@ PyTypeObject Movie_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) MovieObj_dealloc, /*tp_dealloc*/
|
(destructor) MovieObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) MovieObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) MovieObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) MovieObj_compare, /*tp_compare*/
|
(cmpfunc) MovieObj_compare, /*tp_compare*/
|
||||||
(reprfunc) MovieObj_repr, /*tp_repr*/
|
(reprfunc) MovieObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) MovieObj_hash, /*tp_hash*/
|
(hashfunc) MovieObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
MovieObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
MovieObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Movie ---------------------- */
|
/* --------------------- End object type Movie ---------------------- */
|
||||||
|
|
|
@ -181,7 +181,7 @@ QTFloatSingle = Type("QTFloatSingle", "f")
|
||||||
dummyshortptr = FakeType('(short *)0')
|
dummyshortptr = FakeType('(short *)0')
|
||||||
dummyStringPtr = FakeType('(StringPtr)0')
|
dummyStringPtr = FakeType('(StringPtr)0')
|
||||||
|
|
||||||
class MovieObjectDefinition(GlobalObjectDefinition):
|
class MovieObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null Movie");
|
PyErr_SetString(Qt_Error,"Cannot create null Movie");
|
||||||
|
@ -190,7 +190,7 @@ class MovieObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("DisposeMovie(%s);", itselfname)
|
Output("DisposeMovie(%s);", itselfname)
|
||||||
|
|
||||||
class TrackObjectDefinition(GlobalObjectDefinition):
|
class TrackObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null Track");
|
PyErr_SetString(Qt_Error,"Cannot create null Track");
|
||||||
|
@ -199,7 +199,7 @@ class TrackObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("DisposeMovieTrack(%s);", itselfname)
|
Output("DisposeMovieTrack(%s);", itselfname)
|
||||||
|
|
||||||
class MediaObjectDefinition(GlobalObjectDefinition):
|
class MediaObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null Media");
|
PyErr_SetString(Qt_Error,"Cannot create null Media");
|
||||||
|
@ -208,7 +208,7 @@ class MediaObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("DisposeTrackMedia(%s);", itselfname)
|
Output("DisposeTrackMedia(%s);", itselfname)
|
||||||
|
|
||||||
class UserDataObjectDefinition(GlobalObjectDefinition):
|
class UserDataObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null UserData");
|
PyErr_SetString(Qt_Error,"Cannot create null UserData");
|
||||||
|
@ -217,7 +217,7 @@ class UserDataObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("DisposeUserData(%s);", itselfname)
|
Output("DisposeUserData(%s);", itselfname)
|
||||||
|
|
||||||
class TimeBaseObjectDefinition(GlobalObjectDefinition):
|
class TimeBaseObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
|
PyErr_SetString(Qt_Error,"Cannot create null TimeBase");
|
||||||
|
@ -226,7 +226,7 @@ class TimeBaseObjectDefinition(GlobalObjectDefinition):
|
||||||
## def outputFreeIt(self, itselfname):
|
## def outputFreeIt(self, itselfname):
|
||||||
## Output("DisposeTimeBase(%s);", itselfname)
|
## Output("DisposeTimeBase(%s);", itselfname)
|
||||||
|
|
||||||
class MovieCtlObjectDefinition(GlobalObjectDefinition):
|
class MovieCtlObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(Qt_Error,"Cannot create null MovieController");
|
PyErr_SetString(Qt_Error,"Cannot create null MovieController");
|
||||||
|
|
|
@ -551,16 +551,12 @@ static PyMethodDef ResObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain ResObj_chain = { ResObj_methods, NULL };
|
static PyObject *ResObj_get_data(ResourceObject *self, void *closure)
|
||||||
|
|
||||||
static PyObject *ResObj_getattr(ResourceObject *self, char *name)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(name, "size") == 0)
|
|
||||||
return PyInt_FromLong(GetHandleSize(self->ob_itself));
|
|
||||||
if (strcmp(name, "data") == 0) {
|
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
char state;
|
char state;
|
||||||
|
|
||||||
state = HGetState(self->ob_itself);
|
state = HGetState(self->ob_itself);
|
||||||
HLock(self->ob_itself);
|
HLock(self->ob_itself);
|
||||||
res = PyString_FromStringAndSize(
|
res = PyString_FromStringAndSize(
|
||||||
|
@ -569,25 +565,21 @@ static PyObject *ResObj_getattr(ResourceObject *self, char *name)
|
||||||
HUnlock(self->ob_itself);
|
HUnlock(self->ob_itself);
|
||||||
HSetState(self->ob_itself, state);
|
HSetState(self->ob_itself, state);
|
||||||
return res;
|
return res;
|
||||||
}
|
|
||||||
if (strcmp(name, "__members__") == 0)
|
|
||||||
return Py_BuildValue("[ss]", "data", "size");
|
|
||||||
|
|
||||||
return Py_FindMethodInChain(&ResObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int ResObj_set_data(ResourceObject *self, PyObject *v, void *closure)
|
||||||
ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
char *data;
|
char *data;
|
||||||
long size;
|
long size;
|
||||||
|
|
||||||
if (strcmp(name, "data") != 0 || value == NULL )
|
if ( v == NULL )
|
||||||
return -1;
|
return -1;
|
||||||
if ( !PyString_Check(value) )
|
if ( !PyString_Check(v) )
|
||||||
return -1;
|
return -1;
|
||||||
size = PyString_Size(value);
|
size = PyString_Size(v);
|
||||||
data = PyString_AsString(value);
|
data = PyString_AsString(v);
|
||||||
/* XXXX Do I need the GetState/SetState calls? */
|
/* XXXX Do I need the GetState/SetState calls? */
|
||||||
SetHandleSize(self->ob_itself, size);
|
SetHandleSize(self->ob_itself, size);
|
||||||
if ( MemError())
|
if ( MemError())
|
||||||
|
@ -597,8 +589,23 @@ ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
|
||||||
HUnlock(self->ob_itself);
|
HUnlock(self->ob_itself);
|
||||||
/* XXXX Should I do the Changed call immedeately? */
|
/* XXXX Should I do the Changed call immedeately? */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *ResObj_get_size(ResourceObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return PyInt_FromLong(GetHandleSize(self->ob_itself));
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ResObj_set_size NULL
|
||||||
|
|
||||||
|
static PyGetSetDef ResObj_getsetlist[] = {
|
||||||
|
{"data", (getter)ResObj_get_data, (setter)ResObj_set_data, "The resource data"},
|
||||||
|
{"size", (getter)ResObj_get_size, (setter)ResObj_set_size, "The length of the resource data"},
|
||||||
|
{NULL, NULL, NULL, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define ResObj_compare NULL
|
#define ResObj_compare NULL
|
||||||
|
|
||||||
|
@ -615,14 +622,31 @@ PyTypeObject Resource_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) ResObj_dealloc, /*tp_dealloc*/
|
(destructor) ResObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) ResObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) ResObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) ResObj_compare, /*tp_compare*/
|
(cmpfunc) ResObj_compare, /*tp_compare*/
|
||||||
(reprfunc) ResObj_repr, /*tp_repr*/
|
(reprfunc) ResObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) ResObj_hash, /*tp_hash*/
|
(hashfunc) ResObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
ResObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
ResObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------- End object type Resource -------------------- */
|
/* -------------------- End object type Resource -------------------- */
|
||||||
|
|
|
@ -100,12 +100,13 @@ initstuff = initstuff + """
|
||||||
|
|
||||||
module = MacModule('_Res', 'Res', includestuff, finalstuff, initstuff)
|
module = MacModule('_Res', 'Res', includestuff, finalstuff, initstuff)
|
||||||
|
|
||||||
getattrHookCode = """
|
class ResDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
if (strcmp(name, "size") == 0)
|
getsetlist = [
|
||||||
return PyInt_FromLong(GetHandleSize(self->ob_itself));
|
('data',
|
||||||
if (strcmp(name, "data") == 0) {
|
"""
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
char state;
|
char state;
|
||||||
|
|
||||||
state = HGetState(self->ob_itself);
|
state = HGetState(self->ob_itself);
|
||||||
HLock(self->ob_itself);
|
HLock(self->ob_itself);
|
||||||
res = PyString_FromStringAndSize(
|
res = PyString_FromStringAndSize(
|
||||||
|
@ -114,24 +115,17 @@ if (strcmp(name, "data") == 0) {
|
||||||
HUnlock(self->ob_itself);
|
HUnlock(self->ob_itself);
|
||||||
HSetState(self->ob_itself, state);
|
HSetState(self->ob_itself, state);
|
||||||
return res;
|
return res;
|
||||||
}
|
""",
|
||||||
if (strcmp(name, "__members__") == 0)
|
"""
|
||||||
return Py_BuildValue("[ss]", "data", "size");
|
|
||||||
"""
|
|
||||||
|
|
||||||
setattrCode = """
|
|
||||||
static int
|
|
||||||
ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
|
|
||||||
{
|
|
||||||
char *data;
|
char *data;
|
||||||
long size;
|
long size;
|
||||||
|
|
||||||
if (strcmp(name, "data") != 0 || value == NULL )
|
if ( v == NULL )
|
||||||
return -1;
|
return -1;
|
||||||
if ( !PyString_Check(value) )
|
if ( !PyString_Check(v) )
|
||||||
return -1;
|
return -1;
|
||||||
size = PyString_Size(value);
|
size = PyString_Size(v);
|
||||||
data = PyString_AsString(value);
|
data = PyString_AsString(v);
|
||||||
/* XXXX Do I need the GetState/SetState calls? */
|
/* XXXX Do I need the GetState/SetState calls? */
|
||||||
SetHandleSize(self->ob_itself, size);
|
SetHandleSize(self->ob_itself, size);
|
||||||
if ( MemError())
|
if ( MemError())
|
||||||
|
@ -141,10 +135,14 @@ ResObj_setattr(ResourceObject *self, char *name, PyObject *value)
|
||||||
HUnlock(self->ob_itself);
|
HUnlock(self->ob_itself);
|
||||||
/* XXXX Should I do the Changed call immedeately? */
|
/* XXXX Should I do the Changed call immedeately? */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
""",
|
||||||
"""
|
'The resource data'
|
||||||
|
), (
|
||||||
class ResDefinition(GlobalObjectDefinition):
|
'size',
|
||||||
|
'return PyInt_FromLong(GetHandleSize(self->ob_itself));',
|
||||||
|
None,
|
||||||
|
'The length of the resource data'
|
||||||
|
)]
|
||||||
|
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
|
@ -163,12 +161,6 @@ class ResDefinition(GlobalObjectDefinition):
|
||||||
Output("PyErr_Clear();")
|
Output("PyErr_Clear();")
|
||||||
OutRbrace()
|
OutRbrace()
|
||||||
|
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output(getattrHookCode)
|
|
||||||
|
|
||||||
def outputSetattr(self):
|
|
||||||
Output(setattrCode)
|
|
||||||
|
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
GlobalObjectDefinition.outputStructMembers(self)
|
GlobalObjectDefinition.outputStructMembers(self)
|
||||||
Output("void (*ob_freeit)(%s ptr);", self.itselftype)
|
Output("void (*ob_freeit)(%s ptr);", self.itselftype)
|
||||||
|
|
|
@ -55,7 +55,7 @@ ScrapFlavorFlags = Type('ScrapFlavorFlags', 'l')
|
||||||
#ScrapFlavorInfo = OpaqueType('ScrapFlavorInfo', 'ScrapFlavorInfo')
|
#ScrapFlavorInfo = OpaqueType('ScrapFlavorInfo', 'ScrapFlavorInfo')
|
||||||
putscrapbuffer = FixedInputBufferType('void *')
|
putscrapbuffer = FixedInputBufferType('void *')
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
|
|
|
@ -300,14 +300,8 @@ static PyMethodDef SndCh_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyMethodChain SndCh_chain = { SndCh_methods, NULL };
|
#define SndCh_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *SndCh_getattr(SndChannelObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&SndCh_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SndCh_setattr NULL
|
|
||||||
|
|
||||||
#define SndCh_compare NULL
|
#define SndCh_compare NULL
|
||||||
|
|
||||||
|
@ -324,14 +318,31 @@ static PyTypeObject SndChannel_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) SndCh_dealloc, /*tp_dealloc*/
|
(destructor) SndCh_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) SndCh_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) SndCh_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) SndCh_compare, /*tp_compare*/
|
(cmpfunc) SndCh_compare, /*tp_compare*/
|
||||||
(reprfunc) SndCh_repr, /*tp_repr*/
|
(reprfunc) SndCh_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) SndCh_hash, /*tp_hash*/
|
(hashfunc) SndCh_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
SndCh_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
SndCh_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------- End object type SndChannel ------------------- */
|
/* ------------------- End object type SndChannel ------------------- */
|
||||||
|
@ -391,52 +402,66 @@ static PyMethodDef SPBObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyMethodChain SPBObj_chain = { SPBObj_methods, NULL };
|
static PyObject *SPBObj_get_inRefNum(SPBObject *self, void *closure)
|
||||||
|
|
||||||
static PyObject *SPBObj_getattr(SPBObject *self, char *name)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(name, "inRefNum") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.inRefNum);
|
return Py_BuildValue("l", self->ob_spb.inRefNum);
|
||||||
else if (strcmp(name, "count") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.count);
|
|
||||||
else if (strcmp(name, "milliseconds") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.milliseconds);
|
|
||||||
else if (strcmp(name, "error") == 0)
|
|
||||||
return Py_BuildValue("h", self->ob_spb.error);
|
|
||||||
return Py_FindMethodInChain(&SPBObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SPBObj_setattr(SPBObject *self, char *name, PyObject *value)
|
static int SPBObj_set_inRefNum(SPBObject *self, PyObject *v, void *closure)
|
||||||
{
|
{
|
||||||
|
return -1 + PyArg_Parse(v, "l", &self->ob_spb.inRefNum);
|
||||||
int rv = 0;
|
return 0;
|
||||||
|
|
||||||
if (strcmp(name, "inRefNum") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.inRefNum);
|
|
||||||
else if (strcmp(name, "count") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.count);
|
|
||||||
else if (strcmp(name, "milliseconds") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.milliseconds);
|
|
||||||
else if (strcmp(name, "buffer") == 0)
|
|
||||||
rv = PyArg_Parse(value, "w#", &self->ob_spb.bufferPtr, &self->ob_spb.bufferLength);
|
|
||||||
else if (strcmp(name, "completionRoutine") == 0) {
|
|
||||||
self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
|
|
||||||
self->ob_completion = value;
|
|
||||||
Py_INCREF(value);
|
|
||||||
rv = 1;
|
|
||||||
#if !TARGET_API_MAC_CARBON
|
|
||||||
} else if (strcmp(name, "interruptRoutine") == 0) {
|
|
||||||
self->ob_spb.completionRoutine = NewSIInterruptUPP(SPB_interrupt);
|
|
||||||
self->ob_interrupt = value;
|
|
||||||
Py_INCREF(value);
|
|
||||||
rv = 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if ( rv ) return 0;
|
|
||||||
else return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *SPBObj_get_count(SPBObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("l", self->ob_spb.count);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int SPBObj_set_count(SPBObject *self, PyObject *v, void *closure)
|
||||||
|
{
|
||||||
|
return -1 + PyArg_Parse(v, "l", &self->ob_spb.count);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *SPBObj_get_milliseconds(SPBObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("l", self->ob_spb.milliseconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int SPBObj_set_milliseconds(SPBObject *self, PyObject *v, void *closure)
|
||||||
|
{
|
||||||
|
return -1 + PyArg_Parse(v, "l", &self->ob_spb.milliseconds);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *SPBObj_get_error(SPBObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", self->ob_spb.error);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SPBObj_set_error NULL
|
||||||
|
|
||||||
|
#define SPBObj_get_completionRoutine NULL
|
||||||
|
|
||||||
|
static int SPBObj_set_completionRoutine(SPBObject *self, PyObject *v, void *closure)
|
||||||
|
{
|
||||||
|
self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
|
||||||
|
self->ob_completion = v;
|
||||||
|
Py_INCREF(v);
|
||||||
|
return 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyGetSetDef SPBObj_getsetlist[] = {
|
||||||
|
{"inRefNum", (getter)SPBObj_get_inRefNum, (setter)SPBObj_set_inRefNum, NULL},
|
||||||
|
{"count", (getter)SPBObj_get_count, (setter)SPBObj_set_count, NULL},
|
||||||
|
{"milliseconds", (getter)SPBObj_get_milliseconds, (setter)SPBObj_set_milliseconds, NULL},
|
||||||
|
{"error", (getter)SPBObj_get_error, (setter)SPBObj_set_error, NULL},
|
||||||
|
{"completionRoutine", (getter)SPBObj_get_completionRoutine, (setter)SPBObj_set_completionRoutine, NULL},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define SPBObj_compare NULL
|
#define SPBObj_compare NULL
|
||||||
|
|
||||||
#define SPBObj_repr NULL
|
#define SPBObj_repr NULL
|
||||||
|
@ -452,14 +477,31 @@ static PyTypeObject SPB_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) SPBObj_dealloc, /*tp_dealloc*/
|
(destructor) SPBObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) SPBObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) SPBObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) SPBObj_compare, /*tp_compare*/
|
(cmpfunc) SPBObj_compare, /*tp_compare*/
|
||||||
(reprfunc) SPBObj_repr, /*tp_repr*/
|
(reprfunc) SPBObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) SPBObj_hash, /*tp_hash*/
|
(hashfunc) SPBObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
SPBObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
SPBObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------------- End object type SPB ----------------------- */
|
/* ---------------------- End object type SPB ----------------------- */
|
||||||
|
|
|
@ -211,7 +211,7 @@ SPB_interrupt(SPBPtr my_spb)
|
||||||
|
|
||||||
# create the module and object definition and link them
|
# create the module and object definition and link them
|
||||||
|
|
||||||
class SndObjectDefinition(ObjectDefinition):
|
class SndObjectDefinition(PEP252Mixin, ObjectDefinition):
|
||||||
|
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
ObjectDefinition.outputStructMembers(self)
|
ObjectDefinition.outputStructMembers(self)
|
||||||
|
@ -237,7 +237,37 @@ class SndObjectDefinition(ObjectDefinition):
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
class SpbObjectDefinition(ObjectDefinition):
|
class SpbObjectDefinition(PEP252Mixin, ObjectDefinition):
|
||||||
|
getsetlist = [
|
||||||
|
(
|
||||||
|
'inRefNum',
|
||||||
|
'return Py_BuildValue("l", self->ob_spb.inRefNum);',
|
||||||
|
'return -1 + PyArg_Parse(v, "l", &self->ob_spb.inRefNum);',
|
||||||
|
None,
|
||||||
|
), (
|
||||||
|
'count',
|
||||||
|
'return Py_BuildValue("l", self->ob_spb.count);',
|
||||||
|
'return -1 + PyArg_Parse(v, "l", &self->ob_spb.count);',
|
||||||
|
None
|
||||||
|
), (
|
||||||
|
'milliseconds',
|
||||||
|
'return Py_BuildValue("l", self->ob_spb.milliseconds);',
|
||||||
|
'return -1 + PyArg_Parse(v, "l", &self->ob_spb.milliseconds);',
|
||||||
|
None,
|
||||||
|
), (
|
||||||
|
'error',
|
||||||
|
'return Py_BuildValue("h", self->ob_spb.error);',
|
||||||
|
None,
|
||||||
|
None
|
||||||
|
), (
|
||||||
|
'completionRoutine',
|
||||||
|
None,
|
||||||
|
"""self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
|
||||||
|
self->ob_completion = v;
|
||||||
|
Py_INCREF(v);
|
||||||
|
return 0;""",
|
||||||
|
None,
|
||||||
|
)]
|
||||||
|
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
Output("/* Members used to implement callbacks: */")
|
Output("/* Members used to implement callbacks: */")
|
||||||
|
@ -287,54 +317,6 @@ class SpbObjectDefinition(ObjectDefinition):
|
||||||
Output("return 1;")
|
Output("return 1;")
|
||||||
OutRbrace()
|
OutRbrace()
|
||||||
|
|
||||||
def outputSetattr(self):
|
|
||||||
Output()
|
|
||||||
Output("static int %s_setattr(%s *self, char *name, PyObject *value)",
|
|
||||||
self.prefix, self.objecttype)
|
|
||||||
OutLbrace()
|
|
||||||
self.outputSetattrBody()
|
|
||||||
OutRbrace()
|
|
||||||
|
|
||||||
def outputSetattrBody(self):
|
|
||||||
Output("""
|
|
||||||
int rv = 0;
|
|
||||||
|
|
||||||
if (strcmp(name, "inRefNum") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.inRefNum);
|
|
||||||
else if (strcmp(name, "count") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.count);
|
|
||||||
else if (strcmp(name, "milliseconds") == 0)
|
|
||||||
rv = PyArg_Parse(value, "l", &self->ob_spb.milliseconds);
|
|
||||||
else if (strcmp(name, "buffer") == 0)
|
|
||||||
rv = PyArg_Parse(value, "w#", &self->ob_spb.bufferPtr, &self->ob_spb.bufferLength);
|
|
||||||
else if (strcmp(name, "completionRoutine") == 0) {
|
|
||||||
self->ob_spb.completionRoutine = NewSICompletionUPP(SPB_completion);
|
|
||||||
self->ob_completion = value;
|
|
||||||
Py_INCREF(value);
|
|
||||||
rv = 1;
|
|
||||||
#if !TARGET_API_MAC_CARBON
|
|
||||||
} else if (strcmp(name, "interruptRoutine") == 0) {
|
|
||||||
self->ob_spb.completionRoutine = NewSIInterruptUPP(SPB_interrupt);
|
|
||||||
self->ob_interrupt = value;
|
|
||||||
Py_INCREF(value);
|
|
||||||
rv = 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if ( rv ) return 0;
|
|
||||||
else return -1;""")
|
|
||||||
|
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("""
|
|
||||||
if (strcmp(name, "inRefNum") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.inRefNum);
|
|
||||||
else if (strcmp(name, "count") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.count);
|
|
||||||
else if (strcmp(name, "milliseconds") == 0)
|
|
||||||
return Py_BuildValue("l", self->ob_spb.milliseconds);
|
|
||||||
else if (strcmp(name, "error") == 0)
|
|
||||||
return Py_BuildValue("h", self->ob_spb.error);""")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sndobject = SndObjectDefinition('SndChannel', 'SndCh', 'SndChannelPtr')
|
sndobject = SndObjectDefinition('SndChannel', 'SndCh', 'SndChannelPtr')
|
||||||
spbobject = SpbObjectDefinition('SPB', 'SPBObj', 'SPBPtr')
|
spbobject = SpbObjectDefinition('SPB', 'SPBObj', 'SPBPtr')
|
||||||
|
|
|
@ -850,52 +850,137 @@ static PyMethodDef TEObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain TEObj_chain = { TEObj_methods, NULL };
|
static PyObject *TEObj_get_destRect(TEObject *self, void *closure)
|
||||||
|
|
||||||
static PyObject *TEObj_getattr(TEObject *self, char *name)
|
|
||||||
{
|
{
|
||||||
|
return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->destRect);
|
||||||
if( strcmp(name, "destRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->destRect);
|
|
||||||
if( strcmp(name, "viewRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->viewRect);
|
|
||||||
if( strcmp(name, "selRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->selRect);
|
|
||||||
if( strcmp(name, "lineHeight") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->lineHeight);
|
|
||||||
if( strcmp(name, "fontAscent") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
|
|
||||||
if( strcmp(name, "selPoint") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint,
|
|
||||||
(*self->ob_itself)->selPoint);
|
|
||||||
if( strcmp(name, "selStart") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->selStart);
|
|
||||||
if( strcmp(name, "selEnd") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->selEnd);
|
|
||||||
if( strcmp(name, "active") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->active);
|
|
||||||
if( strcmp(name, "just") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->just);
|
|
||||||
if( strcmp(name, "teLength") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->teLength);
|
|
||||||
if( strcmp(name, "txFont") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txFont);
|
|
||||||
if( strcmp(name, "txFace") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txFace);
|
|
||||||
if( strcmp(name, "txMode") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txMode);
|
|
||||||
if( strcmp(name, "txSize") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txSize);
|
|
||||||
if( strcmp(name, "nLines") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->nLines);
|
|
||||||
|
|
||||||
return Py_FindMethodInChain(&TEObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TEObj_setattr NULL
|
#define TEObj_set_destRect NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_viewRect(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->viewRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_viewRect NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_selRect(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->selRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_selRect NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_lineHeight(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->lineHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_lineHeight NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_fontAscent(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_fontAscent NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_selPoint(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->selPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_selPoint NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_selStart(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->selStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_selStart NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_selEnd(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->selEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_selEnd NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_active(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->active);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_active NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_just(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->just);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_just NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_teLength(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->teLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_teLength NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_txFont(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->txFont);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_txFont NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_txFace(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->txFace);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_txFace NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_txMode(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->txMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_txMode NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_txSize(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->txSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_txSize NULL
|
||||||
|
|
||||||
|
static PyObject *TEObj_get_nLines(TEObject *self, void *closure)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("h", (*self->ob_itself)->nLines);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define TEObj_set_nLines NULL
|
||||||
|
|
||||||
|
static PyGetSetDef TEObj_getsetlist[] = {
|
||||||
|
{"destRect", (getter)TEObj_get_destRect, (setter)TEObj_set_destRect, "Destination rectangle"},
|
||||||
|
{"viewRect", (getter)TEObj_get_viewRect, (setter)TEObj_set_viewRect, "Viewing rectangle"},
|
||||||
|
{"selRect", (getter)TEObj_get_selRect, (setter)TEObj_set_selRect, "Selection rectangle"},
|
||||||
|
{"lineHeight", (getter)TEObj_get_lineHeight, (setter)TEObj_set_lineHeight, "Height of a line"},
|
||||||
|
{"fontAscent", (getter)TEObj_get_fontAscent, (setter)TEObj_set_fontAscent, "Ascent of a line"},
|
||||||
|
{"selPoint", (getter)TEObj_get_selPoint, (setter)TEObj_set_selPoint, "Selection Point"},
|
||||||
|
{"selStart", (getter)TEObj_get_selStart, (setter)TEObj_set_selStart, "Start of selection"},
|
||||||
|
{"selEnd", (getter)TEObj_get_selEnd, (setter)TEObj_set_selEnd, "End of selection"},
|
||||||
|
{"active", (getter)TEObj_get_active, (setter)TEObj_set_active, "TBD"},
|
||||||
|
{"just", (getter)TEObj_get_just, (setter)TEObj_set_just, "Justification"},
|
||||||
|
{"teLength", (getter)TEObj_get_teLength, (setter)TEObj_set_teLength, "TBD"},
|
||||||
|
{"txFont", (getter)TEObj_get_txFont, (setter)TEObj_set_txFont, "Current font"},
|
||||||
|
{"txFace", (getter)TEObj_get_txFace, (setter)TEObj_set_txFace, "Current font variant"},
|
||||||
|
{"txMode", (getter)TEObj_get_txMode, (setter)TEObj_set_txMode, "Current text-drawing mode"},
|
||||||
|
{"txSize", (getter)TEObj_get_txSize, (setter)TEObj_set_txSize, "Current font size"},
|
||||||
|
{"nLines", (getter)TEObj_get_nLines, (setter)TEObj_set_nLines, "TBD"},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define TEObj_compare NULL
|
#define TEObj_compare NULL
|
||||||
|
|
||||||
|
@ -912,14 +997,31 @@ PyTypeObject TE_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) TEObj_dealloc, /*tp_dealloc*/
|
(destructor) TEObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) TEObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) TEObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) TEObj_compare, /*tp_compare*/
|
(cmpfunc) TEObj_compare, /*tp_compare*/
|
||||||
(reprfunc) TEObj_repr, /*tp_repr*/
|
(reprfunc) TEObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) TEObj_hash, /*tp_hash*/
|
(hashfunc) TEObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
TEObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
TEObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ----------------------- End object type TE ----------------------- */
|
/* ----------------------- End object type TE ----------------------- */
|
||||||
|
|
|
@ -93,7 +93,91 @@ class TEMethodGenerator(OSErrWeakLinkMethodGenerator):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
|
# Attributes that can be set.
|
||||||
|
getsetlist = [
|
||||||
|
(
|
||||||
|
'destRect',
|
||||||
|
'return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->destRect);',
|
||||||
|
None,
|
||||||
|
'Destination rectangle'
|
||||||
|
), (
|
||||||
|
'viewRect',
|
||||||
|
'return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->viewRect);',
|
||||||
|
None,
|
||||||
|
'Viewing rectangle'
|
||||||
|
), (
|
||||||
|
'selRect',
|
||||||
|
'return Py_BuildValue("O&", PyMac_BuildRect, &(*self->ob_itself)->selRect);',
|
||||||
|
None,
|
||||||
|
'Selection rectangle'
|
||||||
|
), (
|
||||||
|
'lineHeight',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->lineHeight);',
|
||||||
|
None,
|
||||||
|
'Height of a line'
|
||||||
|
), (
|
||||||
|
'fontAscent',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->fontAscent);',
|
||||||
|
None,
|
||||||
|
'Ascent of a line'
|
||||||
|
), (
|
||||||
|
"selPoint",
|
||||||
|
'return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->selPoint);',
|
||||||
|
None,
|
||||||
|
'Selection Point'
|
||||||
|
), (
|
||||||
|
'selStart',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->selStart);',
|
||||||
|
None,
|
||||||
|
'Start of selection'
|
||||||
|
), (
|
||||||
|
'selEnd',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->selEnd);',
|
||||||
|
None,
|
||||||
|
'End of selection'
|
||||||
|
), (
|
||||||
|
'active',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->active);',
|
||||||
|
None,
|
||||||
|
'TBD'
|
||||||
|
), (
|
||||||
|
'just',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->just);',
|
||||||
|
None,
|
||||||
|
'Justification'
|
||||||
|
), (
|
||||||
|
'teLength',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->teLength);',
|
||||||
|
None,
|
||||||
|
'TBD'
|
||||||
|
), (
|
||||||
|
'txFont',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->txFont);',
|
||||||
|
None,
|
||||||
|
'Current font'
|
||||||
|
), (
|
||||||
|
'txFace',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->txFace);',
|
||||||
|
None,
|
||||||
|
'Current font variant'
|
||||||
|
), (
|
||||||
|
'txMode',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->txMode);',
|
||||||
|
None,
|
||||||
|
'Current text-drawing mode'
|
||||||
|
), (
|
||||||
|
'txSize',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->txSize);',
|
||||||
|
None,
|
||||||
|
'Current font size'
|
||||||
|
), (
|
||||||
|
'nLines',
|
||||||
|
'return Py_BuildValue("h", (*self->ob_itself)->nLines);',
|
||||||
|
None,
|
||||||
|
'TBD'
|
||||||
|
)]
|
||||||
|
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(TE_Error,"Cannot create null TE");
|
PyErr_SetString(TE_Error,"Cannot create null TE");
|
||||||
|
@ -102,45 +186,6 @@ class MyObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("TEDispose(%s);", itselfname)
|
Output("TEDispose(%s);", itselfname)
|
||||||
|
|
||||||
def outputGetattrHook(self):
|
|
||||||
Output("""
|
|
||||||
if( strcmp(name, "destRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->destRect);
|
|
||||||
if( strcmp(name, "viewRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->viewRect);
|
|
||||||
if( strcmp(name, "selRect") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildRect,
|
|
||||||
&(*self->ob_itself)->selRect);
|
|
||||||
if( strcmp(name, "lineHeight") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->lineHeight);
|
|
||||||
if( strcmp(name, "fontAscent") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->fontAscent);
|
|
||||||
if( strcmp(name, "selPoint") == 0 )
|
|
||||||
return Py_BuildValue("O&", PyMac_BuildPoint,
|
|
||||||
(*self->ob_itself)->selPoint);
|
|
||||||
if( strcmp(name, "selStart") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->selStart);
|
|
||||||
if( strcmp(name, "selEnd") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->selEnd);
|
|
||||||
if( strcmp(name, "active") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->active);
|
|
||||||
if( strcmp(name, "just") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->just);
|
|
||||||
if( strcmp(name, "teLength") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->teLength);
|
|
||||||
if( strcmp(name, "txFont") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txFont);
|
|
||||||
if( strcmp(name, "txFace") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txFace);
|
|
||||||
if( strcmp(name, "txMode") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txMode);
|
|
||||||
if( strcmp(name, "txSize") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->txSize);
|
|
||||||
if( strcmp(name, "nLines") == 0 )
|
|
||||||
return Py_BuildValue("h", (*self->ob_itself)->nLines);
|
|
||||||
""")
|
|
||||||
|
|
||||||
# From here on it's basically all boiler plate...
|
# From here on it's basically all boiler plate...
|
||||||
|
|
||||||
|
|
|
@ -384,14 +384,7 @@ static PyMethodDef WEOObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain WEOObj_chain = { WEOObj_methods, NULL };
|
#define WEOObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *WEOObj_getattr(WEOObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&WEOObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WEOObj_setattr NULL
|
|
||||||
|
|
||||||
#define WEOObj_compare NULL
|
#define WEOObj_compare NULL
|
||||||
|
|
||||||
|
@ -408,14 +401,31 @@ PyTypeObject WEO_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) WEOObj_dealloc, /*tp_dealloc*/
|
(destructor) WEOObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) WEOObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) WEOObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) WEOObj_compare, /*tp_compare*/
|
(cmpfunc) WEOObj_compare, /*tp_compare*/
|
||||||
(reprfunc) WEOObj_repr, /*tp_repr*/
|
(reprfunc) WEOObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) WEOObj_hash, /*tp_hash*/
|
(hashfunc) WEOObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
WEOObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
WEOObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------------- End object type WEO ----------------------- */
|
/* ---------------------- End object type WEO ----------------------- */
|
||||||
|
@ -2096,14 +2106,7 @@ static PyMethodDef wasteObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain wasteObj_chain = { wasteObj_methods, NULL };
|
#define wasteObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *wasteObj_getattr(wasteObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&wasteObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define wasteObj_setattr NULL
|
|
||||||
|
|
||||||
#define wasteObj_compare NULL
|
#define wasteObj_compare NULL
|
||||||
|
|
||||||
|
@ -2120,14 +2123,31 @@ PyTypeObject waste_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) wasteObj_dealloc, /*tp_dealloc*/
|
(destructor) wasteObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) wasteObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) wasteObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) wasteObj_compare, /*tp_compare*/
|
(cmpfunc) wasteObj_compare, /*tp_compare*/
|
||||||
(reprfunc) wasteObj_repr, /*tp_repr*/
|
(reprfunc) wasteObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) wasteObj_hash, /*tp_hash*/
|
(hashfunc) wasteObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
wasteObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
wasteObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type waste ---------------------- */
|
/* --------------------- End object type waste ---------------------- */
|
||||||
|
|
|
@ -277,7 +277,7 @@ class WEMethodGenerator(OSErrMethodGenerator):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class WEObjectDefinition(GlobalObjectDefinition):
|
class WEObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
PyErr_SetString(waste_Error,"Cannot create null WE");
|
PyErr_SetString(waste_Error,"Cannot create null WE");
|
||||||
|
@ -289,7 +289,7 @@ class WEObjectDefinition(GlobalObjectDefinition):
|
||||||
def outputFreeIt(self, itselfname):
|
def outputFreeIt(self, itselfname):
|
||||||
Output("WEDispose(%s);", itselfname)
|
Output("WEDispose(%s);", itselfname)
|
||||||
|
|
||||||
class WEOObjectDefinition(GlobalObjectDefinition):
|
class WEOObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("""if (itself == NULL) {
|
Output("""if (itself == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
|
@ -2926,14 +2926,7 @@ static PyMethodDef WinObj_methods[] = {
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMethodChain WinObj_chain = { WinObj_methods, NULL };
|
#define WinObj_getsetlist NULL
|
||||||
|
|
||||||
static PyObject *WinObj_getattr(WindowObject *self, char *name)
|
|
||||||
{
|
|
||||||
return Py_FindMethodInChain(&WinObj_chain, (PyObject *)self, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WinObj_setattr NULL
|
|
||||||
|
|
||||||
static int WinObj_compare(WindowObject *self, WindowObject *other)
|
static int WinObj_compare(WindowObject *self, WindowObject *other)
|
||||||
{
|
{
|
||||||
|
@ -2963,14 +2956,31 @@ PyTypeObject Window_Type = {
|
||||||
/* methods */
|
/* methods */
|
||||||
(destructor) WinObj_dealloc, /*tp_dealloc*/
|
(destructor) WinObj_dealloc, /*tp_dealloc*/
|
||||||
0, /*tp_print*/
|
0, /*tp_print*/
|
||||||
(getattrfunc) WinObj_getattr, /*tp_getattr*/
|
(getattrfunc)0, /*tp_getattr*/
|
||||||
(setattrfunc) WinObj_setattr, /*tp_setattr*/
|
(setattrfunc)0, /*tp_setattr*/
|
||||||
(cmpfunc) WinObj_compare, /*tp_compare*/
|
(cmpfunc) WinObj_compare, /*tp_compare*/
|
||||||
(reprfunc) WinObj_repr, /*tp_repr*/
|
(reprfunc) WinObj_repr, /*tp_repr*/
|
||||||
(PyNumberMethods *)0, /* tp_as_number */
|
(PyNumberMethods *)0, /* tp_as_number */
|
||||||
(PySequenceMethods *)0, /* tp_as_sequence */
|
(PySequenceMethods *)0, /* tp_as_sequence */
|
||||||
(PyMappingMethods *)0, /* tp_as_mapping */
|
(PyMappingMethods *)0, /* tp_as_mapping */
|
||||||
(hashfunc) WinObj_hash, /*tp_hash*/
|
(hashfunc) WinObj_hash, /*tp_hash*/
|
||||||
|
0, /*tp_call*/
|
||||||
|
0, /*tp_str*/
|
||||||
|
PyObject_GenericGetAttr, /*tp_getattro*/
|
||||||
|
PyObject_GenericSetAttr, /*tp_setattro */
|
||||||
|
0, /*outputHook_tp_as_buffer*/
|
||||||
|
0, /*outputHook_tp_flags*/
|
||||||
|
0, /*outputHook_tp_doc*/
|
||||||
|
0, /*outputHook_tp_traverse*/
|
||||||
|
0, /*outputHook_tp_clear*/
|
||||||
|
0, /*outputHook_tp_richcompare*/
|
||||||
|
0, /*outputHook_tp_weaklistoffset*/
|
||||||
|
0, /*outputHook_tp_iter*/
|
||||||
|
0, /*outputHook_tp_iternext*/
|
||||||
|
WinObj_methods, /* tp_methods */
|
||||||
|
0, /*outputHook_tp_members*/
|
||||||
|
WinObj_getsetlist, /*tp_getset*/
|
||||||
|
0, /*outputHook_tp_base*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------- End object type Window --------------------- */
|
/* --------------------- End object type Window --------------------- */
|
||||||
|
|
|
@ -128,7 +128,7 @@ initstuff = initstuff + """
|
||||||
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
|
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class MyObjectDefinition(GlobalObjectDefinition):
|
class MyObjectDefinition(PEP252Mixin, GlobalObjectDefinition):
|
||||||
def outputCheckNewArg(self):
|
def outputCheckNewArg(self):
|
||||||
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
Output("if (itself == NULL) return PyMac_Error(resNotFound);")
|
||||||
def outputStructMembers(self):
|
def outputStructMembers(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue