extern PyObject *WinObj_WhichWindow(WindowPtr);
+#include <Devices.h> /* Defines OpenDeskAcc in universal headers */
+#include <Desk.h> /* Defines OpenDeskAcc in old headers */
#include <Menus.h>
#define resNotFound -192 /* Can't include <Errors.h> because of Python's "errors.h" */
return _res;
}
+static PyObject *Menu_OpenDeskAcc(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Str255 name;
+ if (!PyArg_ParseTuple(_args, "O&",
+ PyMac_GetStr255, name))
+ return NULL;
+ OpenDeskAcc(name);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+
static PyMethodDef Menu_methods[] = {
{"InitMenus", (PyCFunction)Menu_InitMenus, 1,
"() -> None"},
"() -> (long _rv)"},
{"DelMCEntries", (PyCFunction)Menu_DelMCEntries, 1,
"(short menuID, short menuItem) -> None"},
+ {"OpenDeskAcc", (PyCFunction)Menu_OpenDeskAcc, 1,
+ "(Str255 name) -> None"},
{NULL, NULL, 0}
};
--- /dev/null
+f = Function(void, 'OpenDeskAcc',
+ (Str255, 'name', InMode),
+)
+functions.append(f)
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
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 *
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" */
functions = []
methods = []
execfile(INPUTFILE)
+execfile(EXTRAFILE)
# add the populated lists to the generator groups
for f in functions: module.add(f)