mirror of https://github.com/python/cpython
Added support for tab hooks
This commit is contained in:
parent
b7e82c1c0c
commit
176f3a9339
|
@ -44,6 +44,7 @@ extern PyObject *WinObj_WhichWindow(WindowPtr);
|
||||||
|
|
||||||
#include <WASTE.h>
|
#include <WASTE.h>
|
||||||
#include <WEObjectHandlers.h>
|
#include <WEObjectHandlers.h>
|
||||||
|
#include <WETabs.h>
|
||||||
|
|
||||||
/* Exported by Qdmodule.c: */
|
/* Exported by Qdmodule.c: */
|
||||||
extern PyObject *QdRGB_New(RGBColor *);
|
extern PyObject *QdRGB_New(RGBColor *);
|
||||||
|
@ -1448,6 +1449,50 @@ static PyObject *wasteObj_WEFeatureFlag(_self, _args)
|
||||||
return _res;
|
return _res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject *wasteObj_WEInstallTabHooks(_self, _args)
|
||||||
|
wasteObject *_self;
|
||||||
|
PyObject *_args;
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
OSErr _err;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_err = WEInstallTabHooks(_self->ob_itself);
|
||||||
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
_res = Py_None;
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *wasteObj_WERemoveTabHooks(_self, _args)
|
||||||
|
wasteObject *_self;
|
||||||
|
PyObject *_args;
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
OSErr _err;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_err = WERemoveTabHooks(_self->ob_itself);
|
||||||
|
if (_err != noErr) return PyMac_Error(_err);
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
_res = Py_None;
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PyObject *wasteObj_WEIsTabHooks(_self, _args)
|
||||||
|
wasteObject *_self;
|
||||||
|
PyObject *_args;
|
||||||
|
{
|
||||||
|
PyObject *_res = NULL;
|
||||||
|
Boolean _rv;
|
||||||
|
if (!PyArg_ParseTuple(_args, ""))
|
||||||
|
return NULL;
|
||||||
|
_rv = WEIsTabHooks(_self->ob_itself);
|
||||||
|
_res = Py_BuildValue("b",
|
||||||
|
_rv);
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
|
||||||
static PyMethodDef wasteObj_methods[] = {
|
static PyMethodDef wasteObj_methods[] = {
|
||||||
{"WEGetText", (PyCFunction)wasteObj_WEGetText, 1,
|
{"WEGetText", (PyCFunction)wasteObj_WEGetText, 1,
|
||||||
"() -> (Handle _rv)"},
|
"() -> (Handle _rv)"},
|
||||||
|
@ -1565,6 +1610,12 @@ static PyMethodDef wasteObj_methods[] = {
|
||||||
"() -> None"},
|
"() -> None"},
|
||||||
{"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1,
|
{"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1,
|
||||||
"(SInt16 feature, SInt16 action) -> (SInt16 _rv)"},
|
"(SInt16 feature, SInt16 action) -> (SInt16 _rv)"},
|
||||||
|
{"WEInstallTabHooks", (PyCFunction)wasteObj_WEInstallTabHooks, 1,
|
||||||
|
"() -> None"},
|
||||||
|
{"WERemoveTabHooks", (PyCFunction)wasteObj_WERemoveTabHooks, 1,
|
||||||
|
"() -> None"},
|
||||||
|
{"WEIsTabHooks", (PyCFunction)wasteObj_WEIsTabHooks, 1,
|
||||||
|
"() -> (Boolean _rv)"},
|
||||||
{NULL, NULL, 0}
|
{NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ LongRect_ptr = LongRect
|
||||||
includestuff = includestuff + """
|
includestuff = includestuff + """
|
||||||
#include <%s>""" % MACHEADERFILE + """
|
#include <%s>""" % MACHEADERFILE + """
|
||||||
#include <WEObjectHandlers.h>
|
#include <WEObjectHandlers.h>
|
||||||
|
#include <WETabs.h>
|
||||||
|
|
||||||
/* Exported by Qdmodule.c: */
|
/* Exported by Qdmodule.c: */
|
||||||
extern PyObject *QdRGB_New(RGBColor *);
|
extern PyObject *QdRGB_New(RGBColor *);
|
||||||
|
@ -389,6 +390,13 @@ inshandler_body = """
|
||||||
stdhand = ManualGenerator("STDObjectHandlers", stdhandlers_body)
|
stdhand = ManualGenerator("STDObjectHandlers", stdhandlers_body)
|
||||||
inshand = ManualGenerator("WEInstallObjectHandler", inshandler_body)
|
inshand = ManualGenerator("WEInstallObjectHandler", inshandler_body)
|
||||||
|
|
||||||
|
f = Method(OSErr, 'WEInstallTabHooks', (WEReference, 'we', InMode))
|
||||||
|
methods.append(f)
|
||||||
|
f = Method(OSErr, 'WERemoveTabHooks', (WEReference, 'we', InMode))
|
||||||
|
methods.append(f)
|
||||||
|
f = Method(Boolean, 'WEIsTabHooks', (WEReference, 'we', InMode))
|
||||||
|
methods.append(f)
|
||||||
|
|
||||||
# add the populated lists to the generator groups
|
# add the populated lists to the generator groups
|
||||||
# (in a different wordl the scan program would generate this)
|
# (in a different wordl the scan program would generate this)
|
||||||
for f in functions: module.add(f)
|
for f in functions: module.add(f)
|
||||||
|
|
Loading…
Reference in New Issue