summaryrefslogtreecommitdiff
path: root/Mac/Modules/te
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:10:21 +0000
committerJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:10:21 +0000
commitad2c0a12c4671f9831458c2322a33f7680f5fdbc (patch)
treea491279984861120f8f8d62fc5fa435c7cf59396 /Mac/Modules/te
parent0e2baa55006fbcd1880d2ba85e6298ac969b808c (diff)
downloadcpython-ad2c0a12c4671f9831458c2322a33f7680f5fdbc.tar.gz
More toolbox modules adapted to Universal Headers 3.3.2.
Diffstat (limited to 'Mac/Modules/te')
-rw-r--r--Mac/Modules/te/TEmodule.c47
-rw-r--r--Mac/Modules/te/tescan.py12
2 files changed, 57 insertions, 2 deletions
diff --git a/Mac/Modules/te/TEmodule.c b/Mac/Modules/te/TEmodule.c
index 789b157a44..2bb447bd4e 100644
--- a/Mac/Modules/te/TEmodule.c
+++ b/Mac/Modules/te/TEmodule.c
@@ -1012,6 +1012,41 @@ static PyObject *TE_TEToScrap(_self, _args)
return _res;
}
+#if TARGET_API_MAC_CARBON
+
+static PyObject *TE_TEGetScrapHandle(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Handle _rv;
+ if (!PyArg_ParseTuple(_args, ""))
+ return NULL;
+ _rv = TEGetScrapHandle();
+ _res = Py_BuildValue("O&",
+ ResObj_New, _rv);
+ return _res;
+}
+#endif
+
+#if TARGET_API_MAC_CARBON
+
+static PyObject *TE_TESetScrapHandle(_self, _args)
+ PyObject *_self;
+ PyObject *_args;
+{
+ PyObject *_res = NULL;
+ Handle value;
+ if (!PyArg_ParseTuple(_args, "O&",
+ ResObj_Convert, &value))
+ return NULL;
+ TESetScrapHandle(value);
+ Py_INCREF(Py_None);
+ _res = Py_None;
+ return _res;
+}
+#endif
+
static PyObject *TE_as_TE(_self, _args)
PyObject *_self;
PyObject *_args;
@@ -1045,6 +1080,16 @@ static PyMethodDef TE_methods[] = {
"() -> None"},
{"TEToScrap", (PyCFunction)TE_TEToScrap, 1,
"() -> None"},
+
+#if TARGET_API_MAC_CARBON
+ {"TEGetScrapHandle", (PyCFunction)TE_TEGetScrapHandle, 1,
+ "() -> (Handle _rv)"},
+#endif
+
+#if TARGET_API_MAC_CARBON
+ {"TESetScrapHandle", (PyCFunction)TE_TESetScrapHandle, 1,
+ "(Handle value) -> None"},
+#endif
{"as_TE", (PyCFunction)TE_as_TE, 1,
"(Handle h) -> (TEHandle _rv)"},
{NULL, NULL, 0}
@@ -1066,7 +1111,7 @@ void initTE()
TE_Error = PyMac_GetOSErrException();
if (TE_Error == NULL ||
PyDict_SetItemString(d, "Error", TE_Error) != 0)
- Py_FatalError("can't initialize TE.Error");
+ return;
TE_Type.ob_type = &PyType_Type;
Py_INCREF(&TE_Type);
if (PyDict_SetItemString(d, "TEType", (PyObject *)&TE_Type) != 0)
diff --git a/Mac/Modules/te/tescan.py b/Mac/Modules/te/tescan.py
index 87a25dab7f..c9cff60449 100644
--- a/Mac/Modules/te/tescan.py
+++ b/Mac/Modules/te/tescan.py
@@ -42,11 +42,21 @@ class MyScanner(Scanner):
## "TEGetHiliteRgn",
]
+ def makegreylist(self):
+ return [
+ ('#if TARGET_API_MAC_CARBON', [
+ 'TEGetScrapHandle',
+ 'TESetScrapHandle',
+ ])]
+
def makeblacklisttypes(self):
return [
"TEClickLoopUPP",
"UniversalProcPtr",
- "WordBreakUPP"
+ "WordBreakUPP",
+ "TEDoTextUPP",
+ "TERecalcUPP",
+ "TEFindWordUPP",
]
def makerepairinstructions(self):