[Python-checkins] CVS: python/dist/src/Mac/Modules/app _Appmodule.c,1.5,1.5.4.1 appscan.py,1.5,1.5.4.1 appsupport.py,1.9,1.9.4.1
Jack Jansen
jackjansen@users.sourceforge.net
Wed, 27 Feb 2002 15:07:49 -0800
Update of /cvsroot/python/python/dist/src/Mac/Modules/app
In directory usw-pr-cvs1:/tmp/cvs-serv32526/app
Modified Files:
Tag: release22-maint
_Appmodule.c appscan.py appsupport.py
Log Message:
Backport of 1.6 thru 1.9 (of _Appmodule.c):
- Added support for DrawThemeButton() and friends.
- Q&D support for ThemeDrawingState objects.
- Added DrawThemeTextBox()
- fixed GetThemeTextDimensions(): it has an in/out Point arg, not just out.
Index: _Appmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/_Appmodule.c,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -C2 -d -r1.5 -r1.5.4.1
*** _Appmodule.c 18 Dec 2001 15:38:45 -0000 1.5
--- _Appmodule.c 27 Feb 2002 23:07:46 -0000 1.5.4.1
***************
*** 28,33 ****
--- 28,148 ----
+
+ int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
+ {
+ return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment);
+ }
+
+
static PyObject *App_Error;
+ /* ----------------- Object type ThemeDrawingState ------------------ */
+
+ PyTypeObject ThemeDrawingState_Type;
+
+ #define ThemeDrawingStateObj_Check(x) ((x)->ob_type == &ThemeDrawingState_Type)
+
+ typedef struct ThemeDrawingStateObject {
+ PyObject_HEAD
+ ThemeDrawingState ob_itself;
+ } ThemeDrawingStateObject;
+
+ PyObject *ThemeDrawingStateObj_New(ThemeDrawingState itself)
+ {
+ ThemeDrawingStateObject *it;
+ it = PyObject_NEW(ThemeDrawingStateObject, &ThemeDrawingState_Type);
+ if (it == NULL) return NULL;
+ it->ob_itself = itself;
+ return (PyObject *)it;
+ }
+ int ThemeDrawingStateObj_Convert(PyObject *v, ThemeDrawingState *p_itself)
+ {
+ if (!ThemeDrawingStateObj_Check(v))
+ {
+ PyErr_SetString(PyExc_TypeError, "ThemeDrawingState required");
+ return 0;
+ }
+ *p_itself = ((ThemeDrawingStateObject *)v)->ob_itself;
+ return 1;
+ }
+
+ static void ThemeDrawingStateObj_dealloc(ThemeDrawingStateObject *self)
+ {
+ /* Cleanup of self->ob_itself goes here */
+ PyMem_DEL(self);
+ }
+
+ static PyObject *ThemeDrawingStateObj_SetThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _rv;
+ Boolean inDisposeNow;
+ if (!PyArg_ParseTuple(_args, "b",
+ &inDisposeNow))
+ return NULL;
+ _rv = SetThemeDrawingState(_self->ob_itself,
+ inDisposeNow);
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+ }
+
+ static PyObject *ThemeDrawingStateObj_DisposeThemeDrawingState(ThemeDrawingStateObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = DisposeThemeDrawingState(_self->ob_itself);
+ _res = Py_BuildValue("l",
+ _rv);
+ return _res;
+ }
+
+ static PyMethodDef ThemeDrawingStateObj_methods[] = {
+ {"SetThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_SetThemeDrawingState, 1,
+ "(Boolean inDisposeNow) -> (OSStatus _rv)"},
+ {"DisposeThemeDrawingState", (PyCFunction)ThemeDrawingStateObj_DisposeThemeDrawingState, 1,
+ "() -> (OSStatus _rv)"},
+ {NULL, NULL, 0}
+ };
+
+ PyMethodChain ThemeDrawingStateObj_chain = { ThemeDrawingStateObj_methods, 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_repr NULL
+
+ #define ThemeDrawingStateObj_hash NULL
+
+ PyTypeObject ThemeDrawingState_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "_App.ThemeDrawingState", /*tp_name*/
+ sizeof(ThemeDrawingStateObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor) ThemeDrawingStateObj_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ (getattrfunc) ThemeDrawingStateObj_getattr, /*tp_getattr*/
+ (setattrfunc) ThemeDrawingStateObj_setattr, /*tp_setattr*/
+ (cmpfunc) ThemeDrawingStateObj_compare, /*tp_compare*/
+ (reprfunc) ThemeDrawingStateObj_repr, /*tp_repr*/
+ (PyNumberMethods *)0, /* tp_as_number */
+ (PySequenceMethods *)0, /* tp_as_sequence */
+ (PyMappingMethods *)0, /* tp_as_mapping */
+ (hashfunc) ThemeDrawingStateObj_hash, /*tp_hash*/
+ };
+
+ /* --------------- End object type ThemeDrawingState ---------------- */
+
+
static PyObject *App_RegisterAppearanceClient(PyObject *_self, PyObject *_args)
{
***************
*** 661,664 ****
--- 776,813 ----
#if TARGET_API_MAC_CARBON
+ static PyObject *App_DrawThemeTextBox(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ CFStringRef inString;
+ ThemeFontID inFontID;
+ ThemeDrawState inState;
+ Boolean inWrapToWidth;
+ Rect inBoundingBox;
+ SInt16 inJust;
+ if (!PyArg_ParseTuple(_args, "O&HlbO&h",
+ CFStringRefObj_Convert, &inString,
+ &inFontID,
+ &inState,
+ &inWrapToWidth,
+ PyMac_GetRect, &inBoundingBox,
+ &inJust))
+ return NULL;
+ _err = DrawThemeTextBox(inString,
+ inFontID,
+ inState,
+ inWrapToWidth,
+ &inBoundingBox,
+ inJust,
+ NULL);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+ #endif
+
+ #if TARGET_API_MAC_CARBON
+
static PyObject *App_TruncateThemeText(PyObject *_self, PyObject *_args)
{
***************
*** 703,711 ****
Point ioBounds;
SInt16 outBaseline;
! if (!PyArg_ParseTuple(_args, "O&Hlb",
CFStringRefObj_Convert, &inString,
&inFontID,
&inState,
! &inWrapToWidth))
return NULL;
_err = GetThemeTextDimensions(inString,
--- 852,861 ----
Point ioBounds;
SInt16 outBaseline;
! if (!PyArg_ParseTuple(_args, "O&HlbO&",
CFStringRefObj_Convert, &inString,
&inFontID,
&inState,
! &inWrapToWidth,
! PyMac_GetPoint, &ioBounds))
return NULL;
_err = GetThemeTextDimensions(inString,
***************
*** 854,857 ****
--- 1004,1104 ----
}
+ static PyObject *App_DrawThemeButton(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect inBounds;
+ UInt16 inKind;
+ ThemeButtonDrawInfo inNewInfo;
+ ThemeButtonDrawInfo inPrevInfo;
+ UInt32 inUserData;
+ if (!PyArg_ParseTuple(_args, "O&HO&O&l",
+ PyMac_GetRect, &inBounds,
+ &inKind,
+ ThemeButtonDrawInfo_Convert, &inNewInfo,
+ ThemeButtonDrawInfo_Convert, &inPrevInfo,
+ &inUserData))
+ return NULL;
+ _err = DrawThemeButton(&inBounds,
+ inKind,
+ &inNewInfo,
+ &inPrevInfo,
+ NULL,
+ NULL,
+ inUserData);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
+ static PyObject *App_GetThemeButtonRegion(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect inBounds;
+ UInt16 inKind;
+ ThemeButtonDrawInfo inNewInfo;
+ if (!PyArg_ParseTuple(_args, "O&HO&",
+ PyMac_GetRect, &inBounds,
+ &inKind,
+ ThemeButtonDrawInfo_Convert, &inNewInfo))
+ return NULL;
+ _err = GetThemeButtonRegion(&inBounds,
+ inKind,
+ &inNewInfo,
+ (RgnHandle)0);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
+ static PyObject *App_GetThemeButtonContentBounds(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect inBounds;
+ UInt16 inKind;
+ ThemeButtonDrawInfo inDrawInfo;
+ Rect outBounds;
+ if (!PyArg_ParseTuple(_args, "O&HO&",
+ PyMac_GetRect, &inBounds,
+ &inKind,
+ ThemeButtonDrawInfo_Convert, &inDrawInfo))
+ return NULL;
+ _err = GetThemeButtonContentBounds(&inBounds,
+ inKind,
+ &inDrawInfo,
+ &outBounds);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("O&",
+ PyMac_BuildRect, &outBounds);
+ return _res;
+ }
+
+ static PyObject *App_GetThemeButtonBackgroundBounds(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect inBounds;
+ UInt16 inKind;
+ ThemeButtonDrawInfo inDrawInfo;
+ Rect outBounds;
+ if (!PyArg_ParseTuple(_args, "O&HO&",
+ PyMac_GetRect, &inBounds,
+ &inKind,
+ ThemeButtonDrawInfo_Convert, &inDrawInfo))
+ return NULL;
+ _err = GetThemeButtonBackgroundBounds(&inBounds,
+ inKind,
+ &inDrawInfo,
+ &outBounds);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("O&",
+ PyMac_BuildRect, &outBounds);
+ return _res;
+ }
+
static PyObject *App_PlayThemeSound(PyObject *_self, PyObject *_args)
{
***************
*** 915,918 ****
--- 1162,1218 ----
}
+ static PyObject *App_DrawThemeChasingArrows(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect bounds;
+ UInt32 index;
+ ThemeDrawState state;
+ UInt32 eraseData;
+ if (!PyArg_ParseTuple(_args, "O&lll",
+ PyMac_GetRect, &bounds,
+ &index,
+ &state,
+ &eraseData))
+ return NULL;
+ _err = DrawThemeChasingArrows(&bounds,
+ index,
+ state,
+ NULL,
+ eraseData);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
+ static PyObject *App_DrawThemePopupArrow(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ Rect bounds;
+ ThemeArrowOrientation orientation;
+ ThemePopupArrowSize size;
+ ThemeDrawState state;
+ UInt32 eraseData;
+ if (!PyArg_ParseTuple(_args, "O&HHll",
+ PyMac_GetRect, &bounds,
+ &orientation,
+ &size,
+ &state,
+ &eraseData))
+ return NULL;
+ _err = DrawThemePopupArrow(&bounds,
+ orientation,
+ size,
+ state,
+ NULL,
+ eraseData);
+ if (_err != noErr) return PyMac_Error(_err);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+ }
+
static PyObject *App_DrawThemeStandaloneGrowBox(PyObject *_self, PyObject *_args)
{
***************
*** 999,1002 ****
--- 1299,1316 ----
}
+ static PyObject *App_GetThemeDrawingState(PyObject *_self, PyObject *_args)
+ {
+ PyObject *_res = NULL;
+ OSStatus _err;
+ ThemeDrawingState outState;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _err = GetThemeDrawingState(&outState);
+ if (_err != noErr) return PyMac_Error(_err);
+ _res = Py_BuildValue("O&",
+ ThemeDrawingStateObj_New, outState);
+ return _res;
+ }
+
static PyObject *App_ApplyThemeBackground(PyObject *_self, PyObject *_args)
{
***************
*** 1205,1208 ****
--- 1519,1527 ----
#if TARGET_API_MAC_CARBON
+ {"DrawThemeTextBox", (PyCFunction)App_DrawThemeTextBox, 1,
+ "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Rect inBoundingBox, SInt16 inJust) -> None"},
+ #endif
+
+ #if TARGET_API_MAC_CARBON
{"TruncateThemeText", (PyCFunction)App_TruncateThemeText, 1,
"(CFMutableStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, SInt16 inPixelWidthLimit, TruncCode inTruncWhere) -> (Boolean outTruncated)"},
***************
*** 1211,1215 ****
#if TARGET_API_MAC_CARBON
{"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
! "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth) -> (Point ioBounds, SInt16 outBaseline)"},
#endif
--- 1530,1534 ----
#if TARGET_API_MAC_CARBON
{"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
! "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)"},
#endif
***************
*** 1226,1229 ****
--- 1545,1556 ----
{"DrawThemeScrollBarDelimiters", (PyCFunction)App_DrawThemeScrollBarDelimiters, 1,
"(ThemeWindowType flavor, Rect inContRect, ThemeDrawState state, ThemeWindowAttributes attributes) -> None"},
+ {"DrawThemeButton", (PyCFunction)App_DrawThemeButton, 1,
+ "(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo, ThemeButtonDrawInfo inPrevInfo, UInt32 inUserData) -> None"},
+ {"GetThemeButtonRegion", (PyCFunction)App_GetThemeButtonRegion, 1,
+ "(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inNewInfo) -> None"},
+ {"GetThemeButtonContentBounds", (PyCFunction)App_GetThemeButtonContentBounds, 1,
+ "(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)"},
+ {"GetThemeButtonBackgroundBounds", (PyCFunction)App_GetThemeButtonBackgroundBounds, 1,
+ "(Rect inBounds, UInt16 inKind, ThemeButtonDrawInfo inDrawInfo) -> (Rect outBounds)"},
{"PlayThemeSound", (PyCFunction)App_PlayThemeSound, 1,
"(ThemeSoundKind kind) -> None"},
***************
*** 1234,1237 ****
--- 1561,1568 ----
{"DrawThemeTickMark", (PyCFunction)App_DrawThemeTickMark, 1,
"(Rect bounds, ThemeDrawState state) -> None"},
+ {"DrawThemeChasingArrows", (PyCFunction)App_DrawThemeChasingArrows, 1,
+ "(Rect bounds, UInt32 index, ThemeDrawState state, UInt32 eraseData) -> None"},
+ {"DrawThemePopupArrow", (PyCFunction)App_DrawThemePopupArrow, 1,
+ "(Rect bounds, ThemeArrowOrientation orientation, ThemePopupArrowSize size, ThemeDrawState state, UInt32 eraseData) -> None"},
{"DrawThemeStandaloneGrowBox", (PyCFunction)App_DrawThemeStandaloneGrowBox, 1,
"(Point origin, ThemeGrowDirection growDirection, Boolean isSmall, ThemeDrawState state) -> None"},
***************
*** 1242,1245 ****
--- 1573,1578 ----
{"NormalizeThemeDrawingState", (PyCFunction)App_NormalizeThemeDrawingState, 1,
"() -> None"},
+ {"GetThemeDrawingState", (PyCFunction)App_GetThemeDrawingState, 1,
+ "() -> (ThemeDrawingState outState)"},
{"ApplyThemeBackground", (PyCFunction)App_ApplyThemeBackground, 1,
"(ThemeBackgroundKind inKind, Rect bounds, ThemeDrawState inState, SInt16 inDepth, Boolean inColorDev) -> None"},
***************
*** 1277,1280 ****
--- 1610,1617 ----
PyDict_SetItemString(d, "Error", App_Error) != 0)
return;
+ ThemeDrawingState_Type.ob_type = &PyType_Type;
+ Py_INCREF(&ThemeDrawingState_Type);
+ if (PyDict_SetItemString(d, "ThemeDrawingStateType", (PyObject *)&ThemeDrawingState_Type) != 0)
+ Py_FatalError("can't initialize ThemeDrawingStateType");
}
Index: appscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/appscan.py,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -C2 -d -r1.5 -r1.5.4.1
*** appscan.py 16 Dec 2001 20:17:56 -0000 1.5
--- appscan.py 27 Feb 2002 23:07:46 -0000 1.5.4.1
***************
*** 10,14 ****
LONG = "Appearance"
SHORT = "app"
! OBJECT = "NOTUSED"
def main():
--- 10,14 ----
LONG = "Appearance"
SHORT = "app"
! OBJECT = "ThemeDrawingState"
def main():
***************
*** 49,53 ****
"appearanceThemeHasNoAccents",
"appearanceBadCursorIndexErr",
- "DrawThemeTextBox", # Funny void* out param
]
--- 49,52 ----
***************
*** 59,62 ****
--- 58,62 ----
'GetThemeTextDimensions',
'TruncateThemeText',
+ 'DrawThemeTextBox',
])]
***************
*** 67,78 ****
"ThemeIteratorUPP",
"ThemeTabTitleDrawUPP",
! "ThemeEraseUPP",
! "ThemeButtonDrawUPP",
"WindowTitleDrawingUPP",
"ProcessSerialNumber_ptr", # Too much work for now.
"ThemeTrackDrawInfo_ptr", # Too much work
! "ThemeButtonDrawInfo_ptr", # ditto
"ThemeWindowMetrics_ptr", # ditto
! "ThemeDrawingState", # This is an opaque pointer, so it should be simple. Later.
"Collection", # No interface to collection mgr yet.
"BytePtr", # Not yet.
--- 67,78 ----
"ThemeIteratorUPP",
"ThemeTabTitleDrawUPP",
! # "ThemeEraseUPP",
! # "ThemeButtonDrawUPP",
"WindowTitleDrawingUPP",
"ProcessSerialNumber_ptr", # Too much work for now.
"ThemeTrackDrawInfo_ptr", # Too much work
! # "ThemeButtonDrawInfo_ptr", # ditto
"ThemeWindowMetrics_ptr", # ditto
! # "ThemeDrawingState", # This is an opaque pointer, so it should be simple. Later.
"Collection", # No interface to collection mgr yet.
"BytePtr", # Not yet.
***************
*** 81,84 ****
--- 81,88 ----
def makerepairinstructions(self):
return [
+ ([("void", 'inContext', "OutMode")],
+ [("NULL", 'inContext', "InMode")]),
+ ([("Point", 'ioBounds', "OutMode")],
+ [("Point", 'ioBounds', "InOutMode")]),
]
Index: appsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/appsupport.py,v
retrieving revision 1.9
retrieving revision 1.9.4.1
diff -C2 -d -r1.9 -r1.9.4.1
*** appsupport.py 16 Dec 2001 20:18:25 -0000 1.9
--- appsupport.py 27 Feb 2002 23:07:46 -0000 1.9.4.1
***************
*** 9,19 ****
MACHEADERFILE = 'Appearance.h' # The Apple header file
MODNAME = '_App' # The name of the module
! OBJECTNAME = 'UNUSED' # The basic name of the objects used here
! KIND = 'Record' # Usually 'Ptr' or 'Handle'
# The following is *usually* unchanged but may still require tuning
MODPREFIX = 'App' # The prefix for module-wide routines
OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them
! OBJECTPREFIX = MODPREFIX + 'Obj' # The prefix for object methods
INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner
OUTPUTFILE = MODNAME + "module.c" # The file generated by this program
--- 9,19 ----
MACHEADERFILE = 'Appearance.h' # The Apple header file
MODNAME = '_App' # The name of the module
! OBJECTNAME = 'ThemeDrawingState' # The basic name of the objects used here
! KIND = '' # Usually 'Ptr' or 'Handle'
# The following is *usually* unchanged but may still require tuning
MODPREFIX = 'App' # The prefix for module-wide routines
OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them
! OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods
INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner
OUTPUTFILE = MODNAME + "module.c" # The file generated by this program
***************
*** 28,31 ****
--- 28,33 ----
RgnHandle = FakeType("(RgnHandle)0")
+ NULL = FakeType("NULL")
+
# XXXX Should be next, but this will break a lot of code...
# RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
***************
*** 72,75 ****
--- 74,84 ----
TruncCode = Type("TruncCode", "h")
+
+ ThemeButtonKind = UInt16
+ ThemeButtonDrawInfo_ptr = OpaqueType("ThemeButtonDrawInfo", "ThemeButtonDrawInfo")
+ ThemeEraseUPP = FakeType("NULL")
+ ThemeButtonDrawUPP = FakeType("NULL")
+
+
includestuff = includestuff + """
#ifdef WITHOUT_FRAMEWORKS
***************
*** 79,85 ****
#endif
"""
! ## class MyObjectDefinition(GlobalObjectDefinition):
## def outputCheckNewArg(self):
## Output("if (itself == NULL) return PyMac_Error(resNotFound);")
--- 88,102 ----
#endif
+
+
+ int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
+ {
+ return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment);
+ }
+
"""
! class MyObjectDefinition(GlobalObjectDefinition):
! pass
## def outputCheckNewArg(self):
## Output("if (itself == NULL) return PyMac_Error(resNotFound);")
***************
*** 98,103 ****
# Create the generator groups and link them
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
! ##object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
! ##module.addobject(object)
# Create the generator classes used to populate the lists
--- 115,124 ----
# Create the generator groups and link them
module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
! object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
! module.addobject(object)
!
! ThemeDrawingState = OpaqueByValueType("ThemeDrawingState", "ThemeDrawingStateObj")
! Method = MethodGenerator
!
# Create the generator classes used to populate the lists
***************
*** 107,111 ****
# Create and populate the lists
functions = []
! ##methods = []
execfile(INPUTFILE)
--- 128,132 ----
# Create and populate the lists
functions = []
! methods = []
execfile(INPUTFILE)
***************
*** 113,117 ****
# (in a different wordl the scan program would generate this)
for f in functions: module.add(f)
! ##for f in methods: object.add(f)
# generate output (open the output file as late as possible)
--- 134,138 ----
# (in a different wordl the scan program would generate this)
for f in functions: module.add(f)
! for f in methods: object.add(f)
# generate output (open the output file as late as possible)