annotate Mac/Modules/app/appsupport.py @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents c3a096bfbd6b
children ac192f89c109
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 # This script generates a Python interface for an Apple Macintosh Manager.
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 # It uses the "bgen" package to generate C code.
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3 # The function specifications are generated by scanning the mamager's header file,
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 # using the "scantools" package (customized for this particular manager).
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 import string
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 # Declarations that change for each manager
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
9 MACHEADERFILE = 'Appearance.h' # The Apple header file
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
10 MODNAME = '_App' # The name of the module
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
11 OBJECTNAME = 'ThemeDrawingState' # The basic name of the objects used here
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
12 KIND = '' # Usually 'Ptr' or 'Handle'
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 # The following is *usually* unchanged but may still require tuning
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
15 MODPREFIX = 'App' # The prefix for module-wide routines
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
16 OBJECTTYPE = OBJECTNAME + KIND # The C type used to represent them
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
17 OBJECTPREFIX = OBJECTNAME + 'Obj' # The prefix for object methods
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 INPUTFILE = string.lower(MODPREFIX) + 'gen.py' # The file generated by the scanner
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
19 OUTPUTFILE = MODNAME + "module.c" # The file generated by this program
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21 from macsupport import *
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 # Create the type objects
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 #MenuRef = OpaqueByValueType("MenuRef", "MenuObj")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27 #WindowPeek = OpaqueByValueType("WindowPeek", OBJECTPREFIX)
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29 RgnHandle = FakeType("(RgnHandle)0")
21617
ccea8782b847 - Added DrawThemeTextBox()
Just van Rossum <just@letterror.com>
parents: 21442
diff changeset
30 NULL = FakeType("NULL")
ccea8782b847 - Added DrawThemeTextBox()
Just van Rossum <just@letterror.com>
parents: 21442
diff changeset
31
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 # XXXX Should be next, but this will break a lot of code...
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33 # RgnHandle = OpaqueByValueType("RgnHandle", "OptResObj")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
34
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
35 #KeyMap = ArrayOutputBufferType("KeyMap")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
36 #MacOSEventKind = Type("MacOSEventKind", "h") # Old-style
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
37 #MacOSEventMask = Type("MacOSEventMask", "h") # Old-style
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
38 #EventMask = Type("EventMask", "h")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
39 #EventKind = Type("EventKind", "h")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
40 ThemeBrush = Type("ThemeBrush", "h")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
41 ThemeColor = Type("ThemeColor", "h")
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
42 ThemeTextColor = Type("ThemeTextColor", "h")
13398
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
43 ThemeMenuBarState = Type("ThemeMenuBarState", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
44 ThemeMenuState = Type("ThemeMenuState", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
45 ThemeMenuType = Type("ThemeMenuType", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
46 ThemeMenuItemType = Type("ThemeMenuItemType", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
47 ThemeFontID = Type("ThemeFontID", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
48 ThemeTabStyle = Type("ThemeTabStyle", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
49 ThemeTabDirection = Type("ThemeTabDirection", "H")
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
50 ThemeDrawState = Type("ThemeDrawState", "l")
11540
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
51 ThemeCursor = Type("ThemeCursor", "l")
13398
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
52 ThemeCheckBoxStyle = Type("ThemeCheckBoxStyle", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
53 ThemeScrollBarArrowStyle = Type("ThemeScrollBarArrowStyle", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
54 ThemeScrollBarThumbStyle = Type("ThemeScrollBarThumbStyle", "H")
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55 CTabHandle = OpaqueByValueType("CTabHandle", "ResObj")
11540
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
56 ThemeTrackEnableState = Type("ThemeTrackEnableState", "b")
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
57 ThemeTrackPressState = Type("ThemeTrackPressState", "b")
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
58 ThemeThumbDirection = Type("ThemeThumbDirection", "b")
13398
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
59 ThemeTrackAttributes = Type("ThemeTrackAttributes", "H")
11540
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
60 ControlPartCode = Type("ControlPartCode", "h")
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
61 ThemeWindowAttributes = Type("ThemeWindowAttributes", "l")
13398
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
62 ThemeWindowType = Type("ThemeWindowType", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
63 ThemeTitleBarWidget = Type("ThemeTitleBarWidget", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
64 ThemeArrowOrientation = Type("ThemeArrowOrientation", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
65 ThemePopupArrowSize = Type("ThemePopupArrowSize", "H")
e8ce1bb056ae Changed all (hopefully) uses of unsigned 16 bit value to use H format specifier, now that h is signed-only.
Jack Jansen <jack.jansen@cwi.nl>
parents: 11550
diff changeset
66 ThemeGrowDirection = Type("ThemeGrowDirection", "H")
11540
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
67 ThemeSoundKind = OSTypeType("ThemeSoundKind")
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
68 ThemeDragSoundKind = OSTypeType("ThemeDragSoundKind")
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
69 ThemeBackgroundKind = Type("ThemeBackgroundKind", "l")
15499
8be889e8115b Adapted to Universal Headers 3.3.2. More to follow.
Jack Jansen <jack.jansen@cwi.nl>
parents: 13606
diff changeset
70 ThemeMetric = Type("ThemeMetric", "l")
11540
50f7d345f157 New appearance mgr support. This appears (no pun intended) to have some problems that I'll fix tonight, so don't check it out.
Jack Jansen <jack.jansen@cwi.nl>
parents: 10353
diff changeset
71 RGBColor = OpaqueType("RGBColor", "QdRGB")
21442
d7d25ec02d41 Adapted for Universal Headers 3.4
Jack Jansen <jack.jansen@cwi.nl>
parents: 19441
diff changeset
72 TruncCode = Type("TruncCode", "h")
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73
21657
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
74
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
75 ThemeButtonKind = UInt16
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
76 ThemeButtonDrawInfo_ptr = OpaqueType("ThemeButtonDrawInfo", "ThemeButtonDrawInfo")
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
77 ThemeEraseUPP = FakeType("NULL")
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
78 ThemeButtonDrawUPP = FakeType("NULL")
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
79
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
80
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81 includestuff = includestuff + """
17924
474e3de00b05 Lots more Carbon/Carbon.h includes, new UPP routine names, function prototypes. Most toolbox modules now compile, link and import in MacOSX-MachO python.
Jack Jansen <jack.jansen@cwi.nl>
parents: 15499
diff changeset
82 #include <Carbon/Carbon.h>
21657
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
83
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
84
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
85 int ThemeButtonDrawInfo_Convert(PyObject *v, ThemeButtonDrawInfo *p_itself)
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
86 {
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
87 return PyArg_Parse(v, "(iHH)", &p_itself->state, &p_itself->value, &p_itself->adornment);
21657
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
88 }
34eddca1fda7 Added support for DrawThemeButton() and friends.
Just van Rossum <just@letterror.com>
parents: 21654
diff changeset
89
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
90 """
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91
26524
7aba859cee54 Added PEP253 support to most Carbon modules. This isn't complete yet:
Jack Jansen <jack.jansen@cwi.nl>
parents: 26464
diff changeset
92 class MyObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
93 pass
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
94 ## def outputCheckNewArg(self):
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
95 ## Output("if (itself == NULL) return PyMac_Error(resNotFound);")
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
96 ## def outputCheckConvertArg(self):
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
97 ## OutLbrace("if (DlgObj_Check(v))")
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
98 ## Output("*p_itself = ((WindowObject *)v)->ob_itself;")
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
99 ## Output("return 1;")
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
100 ## OutRbrace()
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
101 ## Out("""
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
102 ## if (v == Py_None) { *p_itself = NULL; return 1; }
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
103 ## if (PyInt_Check(v)) { *p_itself = (WindowPtr)PyInt_AsLong(v); return 1; }
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 30973
diff changeset
104 ## """)
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
105
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
106 # From here on it's basically all boiler plate...
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
107
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 # Create the generator groups and link them
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109 module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff)
21653
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
110 object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
111 module.addobject(object)
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
112
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
113 ThemeDrawingState = OpaqueByValueType("ThemeDrawingState", "ThemeDrawingStateObj")
22505
a32c7b3f1f11 Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21657
diff changeset
114 Method = WeakLinkMethodGenerator
21653
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
115
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 # Create the generator classes used to populate the lists
22505
a32c7b3f1f11 Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21657
diff changeset
118 Function = OSErrWeakLinkFunctionGenerator
a32c7b3f1f11 Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.
Jack Jansen <jack.jansen@cwi.nl>
parents: 21657
diff changeset
119 ##Method = OSErrWeakLinkMethodGenerator
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 # Create and populate the lists
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 functions = []
21653
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
123 methods = []
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 execfile(INPUTFILE)
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 # add the populated lists to the generator groups
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127 # (in a different wordl the scan program would generate this)
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
128 for f in functions: module.add(f)
21653
68834a69746a Q&D support for ThemeDrawingState objects.
Just van Rossum <just@letterror.com>
parents: 21617
diff changeset
129 for f in methods: object.add(f)
10353
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
130
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
131 # generate output (open the output file as late as possible)
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
132 SetOutputFileName(OUTPUTFILE)
6b5790ce2536 Interface to the appearance manager.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
133 module.generate()