]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport of 1.6 thru 1.9 (of _Appmodule.c):
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 27 Feb 2002 23:07:46 +0000 (23:07 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 27 Feb 2002 23:07:46 +0000 (23:07 +0000)
- 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.

Mac/Modules/app/_Appmodule.c
Mac/Modules/app/appscan.py
Mac/Modules/app/appsupport.py

index ab330a522785f314092b90738deac7f0f7785c45..86441e341cea6bf1f5f7ed209f9086354004ddae 100644 (file)
 #endif
 
 
+
+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)
 {
        PyObject *_res = NULL;
@@ -660,6 +775,40 @@ static PyObject *App_UseThemeFont(PyObject *_self, PyObject *_args)
 
 #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)
 {
        PyObject *_res = NULL;
@@ -702,11 +851,12 @@ static PyObject *App_GetThemeTextDimensions(PyObject *_self, PyObject *_args)
        Boolean inWrapToWidth;
        Point ioBounds;
        SInt16 outBaseline;
-       if (!PyArg_ParseTuple(_args, "O&Hlb",
+       if (!PyArg_ParseTuple(_args, "O&HlbO&",
                              CFStringRefObj_Convert, &inString,
                              &inFontID,
                              &inState,
-                             &inWrapToWidth))
+                             &inWrapToWidth,
+                             PyMac_GetPoint, &ioBounds))
                return NULL;
        _err = GetThemeTextDimensions(inString,
                                      inFontID,
@@ -853,6 +1003,103 @@ static PyObject *App_DrawThemeScrollBarDelimiters(PyObject *_self, PyObject *_ar
        return _res;
 }
 
+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)
 {
        PyObject *_res = NULL;
@@ -914,6 +1161,59 @@ static PyObject *App_DrawThemeTickMark(PyObject *_self, PyObject *_args)
        return _res;
 }
 
+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)
 {
        PyObject *_res = NULL;
@@ -998,6 +1298,20 @@ static PyObject *App_NormalizeThemeDrawingState(PyObject *_self, PyObject *_args
        return _res;
 }
 
+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)
 {
        PyObject *_res = NULL;
@@ -1203,6 +1517,11 @@ static PyMethodDef App_methods[] = {
        {"UseThemeFont", (PyCFunction)App_UseThemeFont, 1,
         "(ThemeFontID inFontID, ScriptCode inScript) -> None"},
 
+#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)"},
@@ -1210,7 +1529,7 @@ static PyMethodDef App_methods[] = {
 
 #if TARGET_API_MAC_CARBON
        {"GetThemeTextDimensions", (PyCFunction)App_GetThemeTextDimensions, 1,
-        "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth) -> (Point ioBounds, SInt16 outBaseline)"},
+        "(CFStringRef inString, ThemeFontID inFontID, ThemeDrawState inState, Boolean inWrapToWidth, Point ioBounds) -> (Point ioBounds, SInt16 outBaseline)"},
 #endif
 
 #if TARGET_API_MAC_CARBON
@@ -1225,6 +1544,14 @@ static PyMethodDef App_methods[] = {
         "(Rect scrollBarBounds, ThemeTrackEnableState enableState, ThemeTrackPressState pressState, Boolean isHoriz, Point ptHit) -> (Boolean _rv, Rect trackBounds, ControlPartCode partcode)"},
        {"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"},
        {"BeginThemeDragSound", (PyCFunction)App_BeginThemeDragSound, 1,
@@ -1233,6 +1560,10 @@ static PyMethodDef App_methods[] = {
         "() -> None"},
        {"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"},
        {"DrawThemeStandaloneNoGrowBox", (PyCFunction)App_DrawThemeStandaloneNoGrowBox, 1,
@@ -1241,6 +1572,8 @@ static PyMethodDef App_methods[] = {
         "(Point origin, ThemeGrowDirection growDirection, Boolean isSmall) -> (Rect bounds)"},
        {"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"},
        {"SetThemeTextColorForWindow", (PyCFunction)App_SetThemeTextColorForWindow, 1,
@@ -1276,6 +1609,10 @@ void init_App(void)
        if (App_Error == NULL ||
            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");
 }
 
 /* ======================== End module _App ========================= */
index 62409c7b8a8a5adaf5568aac00481b57e3b3a9e6..fe6b30d840e61b3d09f6d2fbda11d815a03cd20b 100644 (file)
@@ -9,7 +9,7 @@ from bgenlocations import TOOLBOXDIR
 
 LONG = "Appearance"
 SHORT = "app"
-OBJECT = "NOTUSED"
+OBJECT = "ThemeDrawingState"
 
 def main():
        input = LONG + ".h"
@@ -48,7 +48,6 @@ class MyScanner(Scanner):
                        "appearanceBadTextColorIndexErr",
                        "appearanceThemeHasNoAccents",
                        "appearanceBadCursorIndexErr",
-                       "DrawThemeTextBox",    # Funny void* out param
                        ]
 
        def makegreylist(self):
@@ -58,6 +57,7 @@ class MyScanner(Scanner):
                                'GetThemeTextShadowOutset',
                                'GetThemeTextDimensions',
                                'TruncateThemeText',
+                               'DrawThemeTextBox',
                        ])]
                        
        def makeblacklisttypes(self):
@@ -66,20 +66,24 @@ class MyScanner(Scanner):
                        "MenuItemDrawingUPP",
                        "ThemeIteratorUPP",
                        "ThemeTabTitleDrawUPP",
-                       "ThemeEraseUPP",
-                       "ThemeButtonDrawUPP",
+#                      "ThemeEraseUPP",
+#                      "ThemeButtonDrawUPP",
                        "WindowTitleDrawingUPP",
                        "ProcessSerialNumber_ptr",              # Too much work for now.
                        "ThemeTrackDrawInfo_ptr",       # Too much work
-                       "ThemeButtonDrawInfo_ptr",      # ditto
+#                      "ThemeButtonDrawInfo_ptr",      # ditto
                        "ThemeWindowMetrics_ptr",       # ditto
-                       "ThemeDrawingState",    # This is an opaque pointer, so it should be simple. Later.
+#                      "ThemeDrawingState",    # This is an opaque pointer, so it should be simple. Later.
                        "Collection",           # No interface to collection mgr yet.
                        "BytePtr",              # Not yet.
                        ]
 
        def makerepairinstructions(self):
                return [
+                       ([("void", 'inContext', "OutMode")],
+                        [("NULL", 'inContext', "InMode")]),
+                       ([("Point", 'ioBounds', "OutMode")],
+                        [("Point", 'ioBounds', "InOutMode")]),
                        ]
                        
 if __name__ == "__main__":
index a0eff8e6aa6e5f6c11d2724e70ed60f0d2400bc9..4be504a71015e68acb1efe63cdb4fbacfa155afc 100644 (file)
@@ -8,13 +8,13 @@ import string
 # Declarations that change for each manager
 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'
+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 = MODPREFIX + 'Obj'       # The prefix for object methods
+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
 
@@ -27,6 +27,8 @@ from macsupport import *
 #WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
 
 RgnHandle = FakeType("(RgnHandle)0")
+NULL = FakeType("NULL")
+
 # XXXX Should be next, but this will break a lot of code...
 # RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
 
@@ -71,6 +73,13 @@ CFStringRef = OpaqueByValueType("CFStringRef", "CFStringRefObj")
 CFMutableStringRef = OpaqueByValueType("CFMutableStringRef", "CFMutableStringRefObj")
 TruncCode = Type("TruncCode", "h")
 
+
+ThemeButtonKind = UInt16
+ThemeButtonDrawInfo_ptr = OpaqueType("ThemeButtonDrawInfo", "ThemeButtonDrawInfo")
+ThemeEraseUPP = FakeType("NULL")
+ThemeButtonDrawUPP = FakeType("NULL")
+
+
 includestuff = includestuff + """
 #ifdef WITHOUT_FRAMEWORKS
 #include <Appearance.h>
@@ -78,9 +87,17 @@ includestuff = includestuff + """
 #include <Carbon/Carbon.h>
 #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):
+class MyObjectDefinition(GlobalObjectDefinition):
+       pass
 ##     def outputCheckNewArg(self):
 ##             Output("if (itself == NULL) return PyMac_Error(resNotFound);")
 ##     def outputCheckConvertArg(self):
@@ -97,8 +114,12 @@ includestuff = includestuff + """
 
 # Create the generator groups and link them
 module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
-##object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
-##module.addobject(object)
+object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
+module.addobject(object)
+
+ThemeDrawingState = OpaqueByValueType("ThemeDrawingState", "ThemeDrawingStateObj")
+Method = MethodGenerator
+
 
 # Create the generator classes used to populate the lists
 Function = OSErrFunctionGenerator
@@ -106,13 +127,13 @@ Function = OSErrFunctionGenerator
 
 # Create and populate the lists
 functions = []
-##methods = []
+methods = []
 execfile(INPUTFILE)
 
 # add the populated lists to the generator groups
 # (in a different wordl the scan program would generate this)
 for f in functions: module.add(f)
-##for f in methods: object.add(f)
+for f in methods: object.add(f)
 
 # generate output (open the output file as late as possible)
 SetOutputFileName(OUTPUTFILE)