summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/te
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:10:21 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2000-12-12 22:10:21 (GMT)
commit723ad8ae738e02a5b6f6f1d172cf297db1c11b26 (patch)
tree91ee498f2630c951058201fd7ede2bdb42409637 /Mac/Modules/te
parent8ed81303f68fe3be5b4afa77d1ffd03a066ba3dc (diff)
downloadcpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.zip
cpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.tar.gz
cpython-723ad8ae738e02a5b6f6f1d172cf297db1c11b26.tar.bz2
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 789b157..2bb447b 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 87a25da..c9cff60 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):