summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/menu/menusupport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Modules/menu/menusupport.py')
-rw-r--r--Mac/Modules/menu/menusupport.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Mac/Modules/menu/menusupport.py b/Mac/Modules/menu/menusupport.py
index c3fb3be..95e52f0 100644
--- a/Mac/Modules/menu/menusupport.py
+++ b/Mac/Modules/menu/menusupport.py
@@ -5,6 +5,9 @@
import string
+import addpack
+addpack.addpack('D:python:Tools:bgen:bgen')
+
# Declarations that change for each manager
MACHEADERFILE = 'Menus.h' # The Apple header file
MODNAME = 'Menu' # The name of the module
@@ -15,6 +18,7 @@ MODPREFIX = MODNAME # The prefix for module-wide routines
OBJECTTYPE = OBJECTNAME + 'Handle' # 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
+EXTRAFILE = string.lower(MODPREFIX) + 'edit.py' # A similar file but hand-made
OUTPUTFILE = MODNAME + "module.c" # The file generated by this program
from macsupport import *
@@ -24,6 +28,8 @@ from macsupport import *
MenuHandle = OpaqueByValueType(OBJECTTYPE, OBJECTPREFIX)
includestuff = includestuff + """
+#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
+#include <Desk.h> /* Defines OpenDeskAcc in old headers */
#include <%s>""" % MACHEADERFILE + """
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
@@ -45,6 +51,7 @@ Method = OSErrMethodGenerator
functions = []
methods = []
execfile(INPUTFILE)
+execfile(EXTRAFILE)
# add the populated lists to the generator groups
for f in functions: module.add(f)