Commit b99e5213 authored by Jack Jansen's avatar Jack Jansen

- Updated to Waste 2.0.

- Use waste included with CW in stead of separate package.
parent 00638bd4
...@@ -266,6 +266,30 @@ static PyObject *WEOObj_WEGetObjectDataHandle(WEOObject *_self, PyObject *_args) ...@@ -266,6 +266,30 @@ static PyObject *WEOObj_WEGetObjectDataHandle(WEOObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *WEOObj_WEGetObjectOwner(WEOObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WEReference _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = WEGetObjectOwner(_self->ob_itself);
_res = Py_BuildValue("O&",
ExistingwasteObj_New, _rv);
return _res;
}
static PyObject *WEOObj_WEGetObjectOffset(WEOObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 _rv;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_rv = WEGetObjectOffset(_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args) static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
...@@ -278,15 +302,34 @@ static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args) ...@@ -278,15 +302,34 @@ static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *WEOObj_WEGetObjectOwner(WEOObject *_self, PyObject *_args) static PyObject *WEOObj_WESetObjectSize(WEOObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
WEReference _rv; OSErr _err;
Point inObjectSize;
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetPoint, &inObjectSize))
return NULL;
_err = WESetObjectSize(_self->ob_itself,
inObjectSize);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *WEOObj_WEGetObjectFrame(WEOObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
LongRect outObjectFrame;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_rv = WEGetObjectOwner(_self->ob_itself); _err = WEGetObjectFrame(_self->ob_itself,
&outObjectFrame);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
ExistingwasteObj_New, _rv); LongRect_New, &outObjectFrame);
return _res; return _res;
} }
...@@ -305,12 +348,12 @@ static PyObject *WEOObj_WEGetObjectRefCon(WEOObject *_self, PyObject *_args) ...@@ -305,12 +348,12 @@ static PyObject *WEOObj_WEGetObjectRefCon(WEOObject *_self, PyObject *_args)
static PyObject *WEOObj_WESetObjectRefCon(WEOObject *_self, PyObject *_args) static PyObject *WEOObj_WESetObjectRefCon(WEOObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 refCon; SInt32 inRefCon;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&refCon)) &inRefCon))
return NULL; return NULL;
WESetObjectRefCon(_self->ob_itself, WESetObjectRefCon(_self->ob_itself,
refCon); inRefCon);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
return _res; return _res;
...@@ -321,14 +364,20 @@ static PyMethodDef WEOObj_methods[] = { ...@@ -321,14 +364,20 @@ static PyMethodDef WEOObj_methods[] = {
"() -> (FlavorType _rv)"}, "() -> (FlavorType _rv)"},
{"WEGetObjectDataHandle", (PyCFunction)WEOObj_WEGetObjectDataHandle, 1, {"WEGetObjectDataHandle", (PyCFunction)WEOObj_WEGetObjectDataHandle, 1,
"() -> (Handle _rv)"}, "() -> (Handle _rv)"},
{"WEGetObjectSize", (PyCFunction)WEOObj_WEGetObjectSize, 1,
"() -> (Point _rv)"},
{"WEGetObjectOwner", (PyCFunction)WEOObj_WEGetObjectOwner, 1, {"WEGetObjectOwner", (PyCFunction)WEOObj_WEGetObjectOwner, 1,
"() -> (WEReference _rv)"}, "() -> (WEReference _rv)"},
{"WEGetObjectOffset", (PyCFunction)WEOObj_WEGetObjectOffset, 1,
"() -> (SInt32 _rv)"},
{"WEGetObjectSize", (PyCFunction)WEOObj_WEGetObjectSize, 1,
"() -> (Point _rv)"},
{"WESetObjectSize", (PyCFunction)WEOObj_WESetObjectSize, 1,
"(Point inObjectSize) -> None"},
{"WEGetObjectFrame", (PyCFunction)WEOObj_WEGetObjectFrame, 1,
"() -> (LongRect outObjectFrame)"},
{"WEGetObjectRefCon", (PyCFunction)WEOObj_WEGetObjectRefCon, 1, {"WEGetObjectRefCon", (PyCFunction)WEOObj_WEGetObjectRefCon, 1,
"() -> (SInt32 _rv)"}, "() -> (SInt32 _rv)"},
{"WESetObjectRefCon", (PyCFunction)WEOObj_WESetObjectRefCon, 1, {"WESetObjectRefCon", (PyCFunction)WEOObj_WESetObjectRefCon, 1,
"(SInt32 refCon) -> None"}, "(SInt32 inRefCon) -> None"},
{NULL, NULL, 0} {NULL, NULL, 0}
}; };
...@@ -426,11 +475,11 @@ static PyObject *wasteObj_WEGetChar(wasteObject *_self, PyObject *_args) ...@@ -426,11 +475,11 @@ static PyObject *wasteObj_WEGetChar(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 _rv; SInt16 _rv;
SInt32 offset; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inOffset))
return NULL; return NULL;
_rv = WEGetChar(offset, _rv = WEGetChar(inOffset,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("h", _res = Py_BuildValue("h",
_rv); _rv);
...@@ -449,63 +498,45 @@ static PyObject *wasteObj_WEGetTextLength(wasteObject *_self, PyObject *_args) ...@@ -449,63 +498,45 @@ static PyObject *wasteObj_WEGetTextLength(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WEGetHeight(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 _rv;
SInt32 startLine;
SInt32 endLine;
if (!PyArg_ParseTuple(_args, "ll",
&startLine,
&endLine))
return NULL;
_rv = WEGetHeight(startLine,
endLine,
_self->ob_itself);
_res = Py_BuildValue("l",
_rv);
return _res;
}
static PyObject *wasteObj_WEGetSelection(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetSelection(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 selStart; SInt32 outSelStart;
SInt32 selEnd; SInt32 outSelEnd;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
WEGetSelection(&selStart, WEGetSelection(&outSelStart,
&selEnd, &outSelEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", _res = Py_BuildValue("ll",
selStart, outSelStart,
selEnd); outSelEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetDestRect(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetDestRect(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect destRect; LongRect outDestRect;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
WEGetDestRect(&destRect, WEGetDestRect(&outDestRect,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongRect_New, &destRect); LongRect_New, &outDestRect);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetViewRect(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetViewRect(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect viewRect; LongRect outViewRect;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
WEGetViewRect(&viewRect, WEGetViewRect(&outViewRect,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongRect_New, &viewRect); LongRect_New, &outViewRect);
return _res; return _res;
} }
...@@ -521,47 +552,89 @@ static PyObject *wasteObj_WEIsActive(wasteObject *_self, PyObject *_args) ...@@ -521,47 +552,89 @@ static PyObject *wasteObj_WEIsActive(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WEOffsetToLine(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetClickCount(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; UInt16 _rv;
SInt32 offset; if (!PyArg_ParseTuple(_args, ""))
if (!PyArg_ParseTuple(_args, "l",
&offset))
return NULL; return NULL;
_rv = WEOffsetToLine(offset, _rv = WEGetClickCount(_self->ob_itself);
_self->ob_itself); _res = Py_BuildValue("H",
_res = Py_BuildValue("l",
_rv); _rv);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetLineRange(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WESetSelection(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 lineIndex; SInt32 inSelStart;
SInt32 lineStart; SInt32 inSelEnd;
SInt32 lineEnd; if (!PyArg_ParseTuple(_args, "ll",
if (!PyArg_ParseTuple(_args, "l", &inSelStart,
&lineIndex)) &inSelEnd))
return NULL; return NULL;
WEGetLineRange(lineIndex, WESetSelection(inSelStart,
&lineStart, inSelEnd,
&lineEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", Py_INCREF(Py_None);
lineStart, _res = Py_None;
lineEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WECountLines(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WESetDestRect(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
LongRect inDestRect;
if (!PyArg_ParseTuple(_args, "O&",
LongRect_Convert, &inDestRect))
return NULL;
WESetDestRect(&inDestRect,
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WESetViewRect(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
LongRect inViewRect;
if (!PyArg_ParseTuple(_args, "O&",
LongRect_Convert, &inViewRect))
return NULL;
WESetViewRect(&inViewRect,
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEContinuousStyle(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
WEStyleMode ioMode;
TextStyle outTextStyle;
if (!PyArg_ParseTuple(_args, "H",
&ioMode))
return NULL;
_rv = WEContinuousStyle(&ioMode,
&outTextStyle,
_self->ob_itself);
_res = Py_BuildValue("bHO&",
_rv,
ioMode,
TextStyle_New, &outTextStyle);
return _res;
}
static PyObject *wasteObj_WECountRuns(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; SInt32 _rv;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_rv = WECountLines(_self->ob_itself); _rv = WECountRuns(_self->ob_itself);
_res = Py_BuildValue("l", _res = Py_BuildValue("l",
_rv); _rv);
return _res; return _res;
...@@ -571,11 +644,11 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args) ...@@ -571,11 +644,11 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; SInt32 _rv;
SInt32 offset; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inOffset))
return NULL; return NULL;
_rv = WEOffsetToRun(offset, _rv = WEOffsetToRun(inOffset,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("l", _res = Py_BuildValue("l",
_rv); _rv);
...@@ -585,137 +658,175 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args) ...@@ -585,137 +658,175 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEGetRunRange(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetRunRange(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 runIndex; SInt32 inStyleRunIndex;
SInt32 runStart; SInt32 outStyleRunStart;
SInt32 runEnd; SInt32 outStyleRunEnd;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&runIndex)) &inStyleRunIndex))
return NULL; return NULL;
WEGetRunRange(runIndex, WEGetRunRange(inStyleRunIndex,
&runStart, &outStyleRunStart,
&runEnd, &outStyleRunEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", _res = Py_BuildValue("ll",
runStart, outStyleRunStart,
runEnd); outStyleRunEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WECountRuns(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetRunInfo(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "")) WERunInfo outStyleRunInfo;
if (!PyArg_ParseTuple(_args, "l",
&inOffset))
return NULL; return NULL;
_rv = WECountRuns(_self->ob_itself); WEGetRunInfo(inOffset,
_res = Py_BuildValue("l", &outStyleRunInfo,
_self->ob_itself);
_res = Py_BuildValue("O&",
RunInfo_New, &outStyleRunInfo);
return _res;
}
static PyObject *wasteObj_WEGetIndRunInfo(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 inStyleRunIndex;
WERunInfo outStyleRunInfo;
if (!PyArg_ParseTuple(_args, "l",
&inStyleRunIndex))
return NULL;
WEGetIndRunInfo(inStyleRunIndex,
&outStyleRunInfo,
_self->ob_itself);
_res = Py_BuildValue("O&",
RunInfo_New, &outStyleRunInfo);
return _res;
}
static PyObject *wasteObj_WEGetRunDirection(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
Boolean _rv;
SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "l",
&inOffset))
return NULL;
_rv = WEGetRunDirection(inOffset,
_self->ob_itself);
_res = Py_BuildValue("b",
_rv); _rv);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetClickCount(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WECountParaRuns(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt16 _rv; SInt32 _rv;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_rv = WEGetClickCount(_self->ob_itself); _rv = WECountParaRuns(_self->ob_itself);
_res = Py_BuildValue("H", _res = Py_BuildValue("l",
_rv); _rv);
return _res; return _res;
} }
static PyObject *wasteObj_WESetSelection(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEOffsetToParaRun(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 selStart; SInt32 _rv;
SInt32 selEnd; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "ll", if (!PyArg_ParseTuple(_args, "l",
&selStart, &inOffset))
&selEnd))
return NULL; return NULL;
WESetSelection(selStart, _rv = WEOffsetToParaRun(inOffset,
selEnd,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); _res = Py_BuildValue("l",
_res = Py_None; _rv);
return _res; return _res;
} }
static PyObject *wasteObj_WESetDestRect(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetParaRunRange(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect destRect; SInt32 inParagraphRunIndex;
if (!PyArg_ParseTuple(_args, "O&", SInt32 outParagraphRunStart;
LongRect_Convert, &destRect)) SInt32 outParagraphRunEnd;
if (!PyArg_ParseTuple(_args, "l",
&inParagraphRunIndex))
return NULL; return NULL;
WESetDestRect(&destRect, WEGetParaRunRange(inParagraphRunIndex,
&outParagraphRunStart,
&outParagraphRunEnd,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); _res = Py_BuildValue("ll",
_res = Py_None; outParagraphRunStart,
outParagraphRunEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WESetViewRect(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WECountLines(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect viewRect; SInt32 _rv;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, ""))
LongRect_Convert, &viewRect))
return NULL; return NULL;
WESetViewRect(&viewRect, _rv = WECountLines(_self->ob_itself);
_self->ob_itself); _res = Py_BuildValue("l",
Py_INCREF(Py_None); _rv);
_res = Py_None;
return _res; return _res;
} }
static PyObject *wasteObj_WEContinuousStyle(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEOffsetToLine(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; SInt32 _rv;
WEStyleMode mode; SInt32 inOffset;
TextStyle ts; if (!PyArg_ParseTuple(_args, "l",
if (!PyArg_ParseTuple(_args, "H", &inOffset))
&mode))
return NULL; return NULL;
_rv = WEContinuousStyle(&mode, _rv = WEOffsetToLine(inOffset,
&ts,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("bHO&", _res = Py_BuildValue("l",
_rv, _rv);
mode,
TextStyle_New, &ts);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetRunInfo(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetLineRange(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 offset; SInt32 inLineIndex;
WERunInfo runInfo; SInt32 outLineStart;
SInt32 outLineEnd;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inLineIndex))
return NULL; return NULL;
WEGetRunInfo(offset, WEGetLineRange(inLineIndex,
&runInfo, &outLineStart,
&outLineEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("O&", _res = Py_BuildValue("ll",
RunInfo_New, &runInfo); outLineStart,
outLineEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetRunDirection(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetHeight(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; SInt32 _rv;
SInt32 offset; SInt32 inStartLineIndex;
if (!PyArg_ParseTuple(_args, "l", SInt32 inEndLineIndex;
&offset)) if (!PyArg_ParseTuple(_args, "ll",
&inStartLineIndex,
&inEndLineIndex))
return NULL; return NULL;
_rv = WEGetRunDirection(offset, _rv = WEGetHeight(inStartLineIndex,
inEndLineIndex,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("b", _res = Py_BuildValue("l",
_rv); _rv);
return _res; return _res;
} }
...@@ -724,105 +835,169 @@ static PyObject *wasteObj_WEGetOffset(wasteObject *_self, PyObject *_args) ...@@ -724,105 +835,169 @@ static PyObject *wasteObj_WEGetOffset(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; SInt32 _rv;
LongPt thePoint; LongPt inPoint;
WEEdge edge; WEEdge outEdge;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
LongPt_Convert, &thePoint)) LongPt_Convert, &inPoint))
return NULL; return NULL;
_rv = WEGetOffset(&thePoint, _rv = WEGetOffset(&inPoint,
&edge, &outEdge,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("lB", _res = Py_BuildValue("lB",
_rv, _rv,
edge); outEdge);
return _res; return _res;
} }
static PyObject *wasteObj_WEGetPoint(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEGetPoint(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 offset; SInt32 inOffset;
SInt16 direction; SInt16 inDirection;
LongPt thePoint; LongPt outPoint;
SInt16 lineHeight; SInt16 outLineHeight;
if (!PyArg_ParseTuple(_args, "lh", if (!PyArg_ParseTuple(_args, "lh",
&offset, &inOffset,
&direction)) &inDirection))
return NULL; return NULL;
WEGetPoint(offset, WEGetPoint(inOffset,
direction, inDirection,
&thePoint, &outPoint,
&lineHeight, &outLineHeight,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("O&h", _res = Py_BuildValue("O&h",
LongPt_New, &thePoint, LongPt_New, &outPoint,
lineHeight); outLineHeight);
return _res; return _res;
} }
static PyObject *wasteObj_WEFindWord(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEFindWord(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 offset; SInt32 inOffset;
WEEdge edge; WEEdge inEdge;
SInt32 wordStart; SInt32 outWordStart;
SInt32 wordEnd; SInt32 outWordEnd;
if (!PyArg_ParseTuple(_args, "lB", if (!PyArg_ParseTuple(_args, "lB",
&offset, &inOffset,
&edge)) &inEdge))
return NULL; return NULL;
WEFindWord(offset, WEFindWord(inOffset,
edge, inEdge,
&wordStart, &outWordStart,
&wordEnd, &outWordEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", _res = Py_BuildValue("ll",
wordStart, outWordStart,
wordEnd); outWordEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WEFindLine(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEFindLine(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 offset; SInt32 inOffset;
WEEdge edge; WEEdge inEdge;
SInt32 lineStart; SInt32 outLineStart;
SInt32 lineEnd; SInt32 outLineEnd;
if (!PyArg_ParseTuple(_args, "lB", if (!PyArg_ParseTuple(_args, "lB",
&offset, &inOffset,
&edge)) &inEdge))
return NULL; return NULL;
WEFindLine(offset, WEFindLine(inOffset,
edge, inEdge,
&lineStart, &outLineStart,
&lineEnd, &outLineEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", _res = Py_BuildValue("ll",
lineStart, outLineStart,
lineEnd); outLineEnd);
return _res; return _res;
} }
static PyObject *wasteObj_WEFindParagraph(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEFindParagraph(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 offset; SInt32 inOffset;
WEEdge edge; WEEdge inEdge;
SInt32 paragraphStart; SInt32 outParagraphStart;
SInt32 paragraphEnd; SInt32 outParagraphEnd;
if (!PyArg_ParseTuple(_args, "lB", if (!PyArg_ParseTuple(_args, "lB",
&offset, &inOffset,
&edge)) &inEdge))
return NULL; return NULL;
WEFindParagraph(offset, WEFindParagraph(inOffset,
edge, inEdge,
&paragraphStart, &outParagraphStart,
&paragraphEnd, &outParagraphEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("ll", _res = Py_BuildValue("ll",
paragraphStart, outParagraphStart,
paragraphEnd); outParagraphEnd);
return _res;
}
static PyObject *wasteObj_WEFind(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
char* inKey;
SInt32 inKeyLength;
TextEncoding inKeyEncoding;
OptionBits inMatchOptions;
SInt32 inRangeStart;
SInt32 inRangeEnd;
SInt32 outMatchStart;
SInt32 outMatchEnd;
if (!PyArg_ParseTuple(_args, "slllll",
&inKey,
&inKeyLength,
&inKeyEncoding,
&inMatchOptions,
&inRangeStart,
&inRangeEnd))
return NULL;
_err = WEFind(inKey,
inKeyLength,
inKeyEncoding,
inMatchOptions,
inRangeStart,
inRangeEnd,
&outMatchStart,
&outMatchEnd,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("ll",
outMatchStart,
outMatchEnd);
return _res;
}
static PyObject *wasteObj_WEStreamRange(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SInt32 inRangeStart;
SInt32 inRangeEnd;
FlavorType inRequestedType;
OptionBits inStreamOptions;
Handle outData;
if (!PyArg_ParseTuple(_args, "llO&lO&",
&inRangeStart,
&inRangeEnd,
PyMac_GetOSType, &inRequestedType,
&inStreamOptions,
ResObj_Convert, &outData))
return NULL;
_err = WEStreamRange(inRangeStart,
inRangeEnd,
inRequestedType,
inStreamOptions,
outData,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res; return _res;
} }
...@@ -830,23 +1005,60 @@ static PyObject *wasteObj_WECopyRange(wasteObject *_self, PyObject *_args) ...@@ -830,23 +1005,60 @@ static PyObject *wasteObj_WECopyRange(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
SInt32 rangeStart; SInt32 inRangeStart;
SInt32 rangeEnd; SInt32 inRangeEnd;
Handle hText; Handle outText;
StScrpHandle hStyles; StScrpHandle outStyles;
WESoupHandle hSoup; WESoupHandle outSoup;
if (!PyArg_ParseTuple(_args, "llO&O&O&", if (!PyArg_ParseTuple(_args, "llO&O&O&",
&rangeStart, &inRangeStart,
&rangeEnd, &inRangeEnd,
OptResObj_Convert, &hText, OptResObj_Convert, &outText,
OptResObj_Convert, &hStyles, OptResObj_Convert, &outStyles,
OptResObj_Convert, &hSoup)) OptResObj_Convert, &outSoup))
return NULL; return NULL;
_err = WECopyRange(rangeStart, _err = WECopyRange(inRangeStart,
rangeEnd, inRangeEnd,
hText, outText,
hStyles, outStyles,
hSoup, outSoup,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEGetTextRangeAsUnicode(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SInt32 inRangeStart;
SInt32 inRangeEnd;
Handle outUnicodeText;
Handle ioCharFormat;
Handle ioParaFormat;
TextEncodingVariant inUnicodeVariant;
TextEncodingFormat inTransformationFormat;
OptionBits inGetOptions;
if (!PyArg_ParseTuple(_args, "llO&O&O&lll",
&inRangeStart,
&inRangeEnd,
ResObj_Convert, &outUnicodeText,
ResObj_Convert, &ioCharFormat,
ResObj_Convert, &ioParaFormat,
&inUnicodeVariant,
&inTransformationFormat,
&inGetOptions))
return NULL;
_err = WEGetTextRangeAsUnicode(inRangeStart,
inRangeEnd,
outUnicodeText,
ioCharFormat,
ioParaFormat,
inUnicodeVariant,
inTransformationFormat,
inGetOptions,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -869,11 +1081,11 @@ static PyObject *wasteObj_WEGetAlignment(wasteObject *_self, PyObject *_args) ...@@ -869,11 +1081,11 @@ static PyObject *wasteObj_WEGetAlignment(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WESetAlignment(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WESetAlignment(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
WEAlignment alignment; WEAlignment inAlignment;
if (!PyArg_ParseTuple(_args, "B", if (!PyArg_ParseTuple(_args, "B",
&alignment)) &inAlignment))
return NULL; return NULL;
WESetAlignment(alignment, WESetAlignment(inAlignment,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -895,11 +1107,11 @@ static PyObject *wasteObj_WEGetDirection(wasteObject *_self, PyObject *_args) ...@@ -895,11 +1107,11 @@ static PyObject *wasteObj_WEGetDirection(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WESetDirection(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WESetDirection(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
WEDirection direction; WEDirection inDirection;
if (!PyArg_ParseTuple(_args, "h", if (!PyArg_ParseTuple(_args, "h",
&direction)) &inDirection))
return NULL; return NULL;
WESetDirection(direction, WESetDirection(inDirection,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -922,11 +1134,11 @@ static PyObject *wasteObj_WECalText(wasteObject *_self, PyObject *_args) ...@@ -922,11 +1134,11 @@ static PyObject *wasteObj_WECalText(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
RgnHandle updateRgn; RgnHandle inUpdateRgn;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &updateRgn)) ResObj_Convert, &inUpdateRgn))
return NULL; return NULL;
WEUpdate(updateRgn, WEUpdate(inUpdateRgn,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -936,14 +1148,31 @@ static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args) ...@@ -936,14 +1148,31 @@ static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEScroll(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEScroll(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 hOffset; SInt32 inHorizontalOffset;
SInt32 vOffset; SInt32 inVerticalOffset;
if (!PyArg_ParseTuple(_args, "ll",
&inHorizontalOffset,
&inVerticalOffset))
return NULL;
WEScroll(inHorizontalOffset,
inVerticalOffset,
_self->ob_itself);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEPinScroll(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
SInt32 inHorizontalOffset;
SInt32 inVerticalOffset;
if (!PyArg_ParseTuple(_args, "ll", if (!PyArg_ParseTuple(_args, "ll",
&hOffset, &inHorizontalOffset,
&vOffset)) &inVerticalOffset))
return NULL; return NULL;
WEScroll(hOffset, WEPinScroll(inHorizontalOffset,
vOffset, inVerticalOffset,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -986,14 +1215,14 @@ static PyObject *wasteObj_WEDeactivate(wasteObject *_self, PyObject *_args) ...@@ -986,14 +1215,14 @@ static PyObject *wasteObj_WEDeactivate(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 key; CharParameter inKey;
EventModifiers modifiers; EventModifiers inModifiers;
if (!PyArg_ParseTuple(_args, "hH", if (!PyArg_ParseTuple(_args, "hH",
&key, &inKey,
&modifiers)) &inModifiers))
return NULL; return NULL;
WEKey(key, WEKey(inKey,
modifiers, inModifiers,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -1003,17 +1232,17 @@ static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args) ...@@ -1003,17 +1232,17 @@ static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEClick(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEClick(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Point hitPt; Point inHitPoint;
EventModifiers modifiers; EventModifiers inModifiers;
UInt32 clickTime; UInt32 inClickTime;
if (!PyArg_ParseTuple(_args, "O&Hl", if (!PyArg_ParseTuple(_args, "O&Hl",
PyMac_GetPoint, &hitPt, PyMac_GetPoint, &inHitPoint,
&modifiers, &inModifiers,
&clickTime)) &inClickTime))
return NULL; return NULL;
WEClick(hitPt, WEClick(inHitPoint,
modifiers, inModifiers,
clickTime, inClickTime,
_self->ob_itself); _self->ob_itself);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -1024,14 +1253,14 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args) ...@@ -1024,14 +1253,14 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
Point mouseLoc; Point inMouseLoc;
RgnHandle mouseRgn; RgnHandle ioMouseRgn;
if (!PyArg_ParseTuple(_args, "O&O&", if (!PyArg_ParseTuple(_args, "O&O&",
PyMac_GetPoint, &mouseLoc, PyMac_GetPoint, &inMouseLoc,
ResObj_Convert, &mouseRgn)) ResObj_Convert, &ioMouseRgn))
return NULL; return NULL;
_rv = WEAdjustCursor(mouseLoc, _rv = WEAdjustCursor(inMouseLoc,
mouseRgn, ioMouseRgn,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("b", _res = Py_BuildValue("b",
_rv); _rv);
...@@ -1041,13 +1270,13 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args) ...@@ -1041,13 +1270,13 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args)
static PyObject *wasteObj_WEIdle(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEIdle(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
UInt32 maxSleep; UInt32 outMaxSleep;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
WEIdle(&maxSleep, WEIdle(&outMaxSleep,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("l", _res = Py_BuildValue("l",
maxSleep); outMaxSleep);
return _res; return _res;
} }
...@@ -1055,20 +1284,51 @@ static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args) ...@@ -1055,20 +1284,51 @@ static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
char *pText__in__; char *inTextPtr__in__;
long pText__len__; long inTextPtr__len__;
int pText__in_len__; int inTextPtr__in_len__;
StScrpHandle hStyles; StScrpHandle inStyles;
WESoupHandle hSoup; WESoupHandle inSoup;
if (!PyArg_ParseTuple(_args, "s#O&O&", if (!PyArg_ParseTuple(_args, "s#O&O&",
&pText__in__, &pText__in_len__, &inTextPtr__in__, &inTextPtr__in_len__,
OptResObj_Convert, &hStyles, OptResObj_Convert, &inStyles,
OptResObj_Convert, &hSoup)) OptResObj_Convert, &inSoup))
return NULL; return NULL;
pText__len__ = pText__in_len__; inTextPtr__len__ = inTextPtr__in_len__;
_err = WEInsert(pText__in__, pText__len__, _err = WEInsert(inTextPtr__in__, inTextPtr__len__,
hStyles, inStyles,
hSoup, inSoup,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEInsertFormattedText(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
char *inTextPtr__in__;
long inTextPtr__len__;
int inTextPtr__in_len__;
StScrpHandle inStyles;
WESoupHandle inSoup;
Handle inParaFormat;
Handle inRulerScrap;
if (!PyArg_ParseTuple(_args, "s#O&O&O&O&",
&inTextPtr__in__, &inTextPtr__in_len__,
OptResObj_Convert, &inStyles,
OptResObj_Convert, &inSoup,
ResObj_Convert, &inParaFormat,
ResObj_Convert, &inRulerScrap))
return NULL;
inTextPtr__len__ = inTextPtr__in_len__;
_err = WEInsertFormattedText(inTextPtr__in__, inTextPtr__len__,
inStyles,
inSoup,
inParaFormat,
inRulerScrap,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1089,18 +1349,15 @@ static PyObject *wasteObj_WEDelete(wasteObject *_self, PyObject *_args) ...@@ -1089,18 +1349,15 @@ static PyObject *wasteObj_WEDelete(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WESetStyle(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEUseText(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WEStyleMode mode; Handle inText;
TextStyle ts; if (!PyArg_ParseTuple(_args, "O&",
if (!PyArg_ParseTuple(_args, "HO&", ResObj_Convert, &inText))
&mode,
TextStyle_Convert, &ts))
return NULL; return NULL;
_err = WESetStyle(mode, _err = WEUseText(inText,
&ts,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1108,15 +1365,15 @@ static PyObject *wasteObj_WESetStyle(wasteObject *_self, PyObject *_args) ...@@ -1108,15 +1365,15 @@ static PyObject *wasteObj_WESetStyle(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEChangeCase(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
StScrpHandle hStyles; SInt16 inCase;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "h",
ResObj_Convert, &hStyles)) &inCase))
return NULL; return NULL;
_err = WEUseStyleScrap(hStyles, _err = WEChangeCase(inCase,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1124,15 +1381,62 @@ static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args) ...@@ -1124,15 +1381,62 @@ static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WEUseText(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WESetOneAttribute(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
Handle hText; SInt32 inRangeStart;
SInt32 inRangeEnd;
WESelector inAttributeSelector;
char *inAttributeValue__in__;
long inAttributeValue__len__;
int inAttributeValue__in_len__;
if (!PyArg_ParseTuple(_args, "llO&s#",
&inRangeStart,
&inRangeEnd,
PyMac_GetOSType, &inAttributeSelector,
&inAttributeValue__in__, &inAttributeValue__in_len__))
return NULL;
inAttributeValue__len__ = inAttributeValue__in_len__;
_err = WESetOneAttribute(inRangeStart,
inRangeEnd,
inAttributeSelector,
inAttributeValue__in__, inAttributeValue__len__,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WESetStyle(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
WEStyleMode inMode;
TextStyle inTextStyle;
if (!PyArg_ParseTuple(_args, "HO&",
&inMode,
TextStyle_Convert, &inTextStyle))
return NULL;
_err = WESetStyle(inMode,
&inTextStyle,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
StScrpHandle inStyles;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &hText)) ResObj_Convert, &inStyles))
return NULL; return NULL;
_err = WEUseText(hText, _err = WEUseStyleScrap(inStyles,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1153,6 +1457,19 @@ static PyObject *wasteObj_WEUndo(wasteObject *_self, PyObject *_args) ...@@ -1153,6 +1457,19 @@ static PyObject *wasteObj_WEUndo(wasteObject *_self, PyObject *_args)
return _res; return _res;
} }
static PyObject *wasteObj_WERedo(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
if (!PyArg_ParseTuple(_args, ""))
return NULL;
_err = WERedo(_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WEClearUndo(wasteObject *_self, PyObject *_args) static PyObject *wasteObj_WEClearUndo(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
...@@ -1168,14 +1485,29 @@ static PyObject *wasteObj_WEGetUndoInfo(wasteObject *_self, PyObject *_args) ...@@ -1168,14 +1485,29 @@ static PyObject *wasteObj_WEGetUndoInfo(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
WEActionKind _rv; WEActionKind _rv;
Boolean redoFlag; Boolean outRedoFlag;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_rv = WEGetUndoInfo(&redoFlag, _rv = WEGetUndoInfo(&outRedoFlag,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("hb", _res = Py_BuildValue("hb",
_rv, _rv,
redoFlag); outRedoFlag);
return _res;
}
static PyObject *wasteObj_WEGetIndUndoInfo(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
WEActionKind _rv;
SInt32 inUndoLevel;
if (!PyArg_ParseTuple(_args, "l",
&inUndoLevel))
return NULL;
_rv = WEGetIndUndoInfo(inUndoLevel,
_self->ob_itself);
_res = Py_BuildValue("h",
_rv);
return _res; return _res;
} }
...@@ -1208,11 +1540,11 @@ static PyObject *wasteObj_WEEndAction(wasteObject *_self, PyObject *_args) ...@@ -1208,11 +1540,11 @@ static PyObject *wasteObj_WEEndAction(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WEActionKind actionKind; WEActionKind inActionKind;
if (!PyArg_ParseTuple(_args, "h", if (!PyArg_ParseTuple(_args, "h",
&actionKind)) &inActionKind))
return NULL; return NULL;
_err = WEEndAction(actionKind, _err = WEEndAction(inActionKind,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1247,17 +1579,17 @@ static PyObject *wasteObj_WEInsertObject(wasteObject *_self, PyObject *_args) ...@@ -1247,17 +1579,17 @@ static PyObject *wasteObj_WEInsertObject(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
FlavorType objectType; FlavorType inObjectType;
Handle objectDataHandle; Handle inObjectDataHandle;
Point objectSize; Point inObjectSize;
if (!PyArg_ParseTuple(_args, "O&O&O&", if (!PyArg_ParseTuple(_args, "O&O&O&",
PyMac_GetOSType, &objectType, PyMac_GetOSType, &inObjectType,
ResObj_Convert, &objectDataHandle, ResObj_Convert, &inObjectDataHandle,
PyMac_GetPoint, &objectSize)) PyMac_GetPoint, &inObjectSize))
return NULL; return NULL;
_err = WEInsertObject(objectType, _err = WEInsertObject(inObjectType,
objectDataHandle, inObjectDataHandle,
objectSize, inObjectSize,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1269,14 +1601,32 @@ static PyObject *wasteObj_WEGetSelectedObject(wasteObject *_self, PyObject *_arg ...@@ -1269,14 +1601,32 @@ static PyObject *wasteObj_WEGetSelectedObject(wasteObject *_self, PyObject *_arg
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WEObjectReference obj; WEObjectReference outObject;
if (!PyArg_ParseTuple(_args, "")) if (!PyArg_ParseTuple(_args, ""))
return NULL; return NULL;
_err = WEGetSelectedObject(&obj, _err = WEGetSelectedObject(&outObject,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
WEOObj_New, obj); WEOObj_New, outObject);
return _res;
}
static PyObject *wasteObj_WEGetObjectAtOffset(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SInt32 inOffset;
WEObjectReference outObject;
if (!PyArg_ParseTuple(_args, "l",
&inOffset))
return NULL;
_err = WEGetObjectAtOffset(inOffset,
&outObject,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
WEOObj_New, outObject);
return _res; return _res;
} }
...@@ -1284,17 +1634,17 @@ static PyObject *wasteObj_WEFindNextObject(wasteObject *_self, PyObject *_args) ...@@ -1284,17 +1634,17 @@ static PyObject *wasteObj_WEFindNextObject(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt32 _rv; SInt32 _rv;
SInt32 offset; SInt32 inOffset;
WEObjectReference obj; WEObjectReference outObject;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inOffset))
return NULL; return NULL;
_rv = WEFindNextObject(offset, _rv = WEFindNextObject(inOffset,
&obj, &outObject,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("lO&", _res = Py_BuildValue("lO&",
_rv, _rv,
WEOObj_New, obj); WEOObj_New, outObject);
return _res; return _res;
} }
...@@ -1302,11 +1652,11 @@ static PyObject *wasteObj_WEUseSoup(wasteObject *_self, PyObject *_args) ...@@ -1302,11 +1652,11 @@ static PyObject *wasteObj_WEUseSoup(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WESoupHandle hSoup; WESoupHandle inSoup;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
ResObj_Convert, &hSoup)) ResObj_Convert, &inSoup))
return NULL; return NULL;
_err = WEUseSoup(hSoup, _err = WEUseSoup(inSoup,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1369,14 +1719,14 @@ static PyObject *wasteObj_WEGetHiliteRgn(wasteObject *_self, PyObject *_args) ...@@ -1369,14 +1719,14 @@ static PyObject *wasteObj_WEGetHiliteRgn(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
RgnHandle _rv; RgnHandle _rv;
SInt32 rangeStart; SInt32 inRangeStart;
SInt32 rangeEnd; SInt32 inRangeEnd;
if (!PyArg_ParseTuple(_args, "ll", if (!PyArg_ParseTuple(_args, "ll",
&rangeStart, &inRangeStart,
&rangeEnd)) &inRangeEnd))
return NULL; return NULL;
_rv = WEGetHiliteRgn(rangeStart, _rv = WEGetHiliteRgn(inRangeStart,
rangeEnd, inRangeEnd,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
ResObj_New, _rv); ResObj_New, _rv);
...@@ -1387,11 +1737,11 @@ static PyObject *wasteObj_WECharByte(wasteObject *_self, PyObject *_args) ...@@ -1387,11 +1737,11 @@ static PyObject *wasteObj_WECharByte(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 _rv; SInt16 _rv;
SInt32 offset; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inOffset))
return NULL; return NULL;
_rv = WECharByte(offset, _rv = WECharByte(inOffset,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("h", _res = Py_BuildValue("h",
_rv); _rv);
...@@ -1402,11 +1752,11 @@ static PyObject *wasteObj_WECharType(wasteObject *_self, PyObject *_args) ...@@ -1402,11 +1752,11 @@ static PyObject *wasteObj_WECharType(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 _rv; SInt16 _rv;
SInt32 offset; SInt32 inOffset;
if (!PyArg_ParseTuple(_args, "l", if (!PyArg_ParseTuple(_args, "l",
&offset)) &inOffset))
return NULL; return NULL;
_rv = WECharType(offset, _rv = WECharType(inOffset,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("h", _res = Py_BuildValue("h",
_rv); _rv);
...@@ -1428,14 +1778,14 @@ static PyObject *wasteObj_WEFeatureFlag(wasteObject *_self, PyObject *_args) ...@@ -1428,14 +1778,14 @@ static PyObject *wasteObj_WEFeatureFlag(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
SInt16 _rv; SInt16 _rv;
SInt16 feature; SInt16 inFeature;
SInt16 action; SInt16 inAction;
if (!PyArg_ParseTuple(_args, "hh", if (!PyArg_ParseTuple(_args, "hh",
&feature, &inFeature,
&action)) &inAction))
return NULL; return NULL;
_rv = WEFeatureFlag(feature, _rv = WEFeatureFlag(inFeature,
action, inAction,
_self->ob_itself); _self->ob_itself);
_res = Py_BuildValue("h", _res = Py_BuildValue("h",
_rv); _rv);
...@@ -1446,17 +1796,17 @@ static PyObject *wasteObj_WEGetUserInfo(wasteObject *_self, PyObject *_args) ...@@ -1446,17 +1796,17 @@ static PyObject *wasteObj_WEGetUserInfo(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WESelector tag; WESelector inUserTag;
SInt32 userInfo; SInt32 outUserInfo;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetOSType, &tag)) PyMac_GetOSType, &inUserTag))
return NULL; return NULL;
_err = WEGetUserInfo(tag, _err = WEGetUserInfo(inUserTag,
&userInfo, &outUserInfo,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("l", _res = Py_BuildValue("l",
userInfo); outUserInfo);
return _res; return _res;
} }
...@@ -1464,14 +1814,30 @@ static PyObject *wasteObj_WESetUserInfo(wasteObject *_self, PyObject *_args) ...@@ -1464,14 +1814,30 @@ static PyObject *wasteObj_WESetUserInfo(wasteObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
WESelector tag; WESelector inUserTag;
SInt32 userInfo; SInt32 inUserInfo;
if (!PyArg_ParseTuple(_args, "O&l", if (!PyArg_ParseTuple(_args, "O&l",
PyMac_GetOSType, &tag, PyMac_GetOSType, &inUserTag,
&userInfo)) &inUserInfo))
return NULL; return NULL;
_err = WESetUserInfo(tag, _err = WESetUserInfo(inUserTag,
userInfo, inUserInfo,
_self->ob_itself);
if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None);
_res = Py_None;
return _res;
}
static PyObject *wasteObj_WERemoveUserInfo(wasteObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
WESelector inUserTag;
if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetOSType, &inUserTag))
return NULL;
_err = WERemoveUserInfo(inUserTag,
_self->ob_itself); _self->ob_itself);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
...@@ -1549,71 +1915,87 @@ static PyMethodDef wasteObj_methods[] = { ...@@ -1549,71 +1915,87 @@ static PyMethodDef wasteObj_methods[] = {
{"WEGetText", (PyCFunction)wasteObj_WEGetText, 1, {"WEGetText", (PyCFunction)wasteObj_WEGetText, 1,
"() -> (Handle _rv)"}, "() -> (Handle _rv)"},
{"WEGetChar", (PyCFunction)wasteObj_WEGetChar, 1, {"WEGetChar", (PyCFunction)wasteObj_WEGetChar, 1,
"(SInt32 offset) -> (SInt16 _rv)"}, "(SInt32 inOffset) -> (SInt16 _rv)"},
{"WEGetTextLength", (PyCFunction)wasteObj_WEGetTextLength, 1, {"WEGetTextLength", (PyCFunction)wasteObj_WEGetTextLength, 1,
"() -> (SInt32 _rv)"}, "() -> (SInt32 _rv)"},
{"WEGetHeight", (PyCFunction)wasteObj_WEGetHeight, 1,
"(SInt32 startLine, SInt32 endLine) -> (SInt32 _rv)"},
{"WEGetSelection", (PyCFunction)wasteObj_WEGetSelection, 1, {"WEGetSelection", (PyCFunction)wasteObj_WEGetSelection, 1,
"() -> (SInt32 selStart, SInt32 selEnd)"}, "() -> (SInt32 outSelStart, SInt32 outSelEnd)"},
{"WEGetDestRect", (PyCFunction)wasteObj_WEGetDestRect, 1, {"WEGetDestRect", (PyCFunction)wasteObj_WEGetDestRect, 1,
"() -> (LongRect destRect)"}, "() -> (LongRect outDestRect)"},
{"WEGetViewRect", (PyCFunction)wasteObj_WEGetViewRect, 1, {"WEGetViewRect", (PyCFunction)wasteObj_WEGetViewRect, 1,
"() -> (LongRect viewRect)"}, "() -> (LongRect outViewRect)"},
{"WEIsActive", (PyCFunction)wasteObj_WEIsActive, 1, {"WEIsActive", (PyCFunction)wasteObj_WEIsActive, 1,
"() -> (Boolean _rv)"}, "() -> (Boolean _rv)"},
{"WEOffsetToLine", (PyCFunction)wasteObj_WEOffsetToLine, 1,
"(SInt32 offset) -> (SInt32 _rv)"},
{"WEGetLineRange", (PyCFunction)wasteObj_WEGetLineRange, 1,
"(SInt32 lineIndex) -> (SInt32 lineStart, SInt32 lineEnd)"},
{"WECountLines", (PyCFunction)wasteObj_WECountLines, 1,
"() -> (SInt32 _rv)"},
{"WEOffsetToRun", (PyCFunction)wasteObj_WEOffsetToRun, 1,
"(SInt32 offset) -> (SInt32 _rv)"},
{"WEGetRunRange", (PyCFunction)wasteObj_WEGetRunRange, 1,
"(SInt32 runIndex) -> (SInt32 runStart, SInt32 runEnd)"},
{"WECountRuns", (PyCFunction)wasteObj_WECountRuns, 1,
"() -> (SInt32 _rv)"},
{"WEGetClickCount", (PyCFunction)wasteObj_WEGetClickCount, 1, {"WEGetClickCount", (PyCFunction)wasteObj_WEGetClickCount, 1,
"() -> (UInt16 _rv)"}, "() -> (UInt16 _rv)"},
{"WESetSelection", (PyCFunction)wasteObj_WESetSelection, 1, {"WESetSelection", (PyCFunction)wasteObj_WESetSelection, 1,
"(SInt32 selStart, SInt32 selEnd) -> None"}, "(SInt32 inSelStart, SInt32 inSelEnd) -> None"},
{"WESetDestRect", (PyCFunction)wasteObj_WESetDestRect, 1, {"WESetDestRect", (PyCFunction)wasteObj_WESetDestRect, 1,
"(LongRect destRect) -> None"}, "(LongRect inDestRect) -> None"},
{"WESetViewRect", (PyCFunction)wasteObj_WESetViewRect, 1, {"WESetViewRect", (PyCFunction)wasteObj_WESetViewRect, 1,
"(LongRect viewRect) -> None"}, "(LongRect inViewRect) -> None"},
{"WEContinuousStyle", (PyCFunction)wasteObj_WEContinuousStyle, 1, {"WEContinuousStyle", (PyCFunction)wasteObj_WEContinuousStyle, 1,
"(WEStyleMode mode) -> (Boolean _rv, WEStyleMode mode, TextStyle ts)"}, "(WEStyleMode ioMode) -> (Boolean _rv, WEStyleMode ioMode, TextStyle outTextStyle)"},
{"WECountRuns", (PyCFunction)wasteObj_WECountRuns, 1,
"() -> (SInt32 _rv)"},
{"WEOffsetToRun", (PyCFunction)wasteObj_WEOffsetToRun, 1,
"(SInt32 inOffset) -> (SInt32 _rv)"},
{"WEGetRunRange", (PyCFunction)wasteObj_WEGetRunRange, 1,
"(SInt32 inStyleRunIndex) -> (SInt32 outStyleRunStart, SInt32 outStyleRunEnd)"},
{"WEGetRunInfo", (PyCFunction)wasteObj_WEGetRunInfo, 1, {"WEGetRunInfo", (PyCFunction)wasteObj_WEGetRunInfo, 1,
"(SInt32 offset) -> (WERunInfo runInfo)"}, "(SInt32 inOffset) -> (WERunInfo outStyleRunInfo)"},
{"WEGetIndRunInfo", (PyCFunction)wasteObj_WEGetIndRunInfo, 1,
"(SInt32 inStyleRunIndex) -> (WERunInfo outStyleRunInfo)"},
{"WEGetRunDirection", (PyCFunction)wasteObj_WEGetRunDirection, 1, {"WEGetRunDirection", (PyCFunction)wasteObj_WEGetRunDirection, 1,
"(SInt32 offset) -> (Boolean _rv)"}, "(SInt32 inOffset) -> (Boolean _rv)"},
{"WECountParaRuns", (PyCFunction)wasteObj_WECountParaRuns, 1,
"() -> (SInt32 _rv)"},
{"WEOffsetToParaRun", (PyCFunction)wasteObj_WEOffsetToParaRun, 1,
"(SInt32 inOffset) -> (SInt32 _rv)"},
{"WEGetParaRunRange", (PyCFunction)wasteObj_WEGetParaRunRange, 1,
"(SInt32 inParagraphRunIndex) -> (SInt32 outParagraphRunStart, SInt32 outParagraphRunEnd)"},
{"WECountLines", (PyCFunction)wasteObj_WECountLines, 1,
"() -> (SInt32 _rv)"},
{"WEOffsetToLine", (PyCFunction)wasteObj_WEOffsetToLine, 1,
"(SInt32 inOffset) -> (SInt32 _rv)"},
{"WEGetLineRange", (PyCFunction)wasteObj_WEGetLineRange, 1,
"(SInt32 inLineIndex) -> (SInt32 outLineStart, SInt32 outLineEnd)"},
{"WEGetHeight", (PyCFunction)wasteObj_WEGetHeight, 1,
"(SInt32 inStartLineIndex, SInt32 inEndLineIndex) -> (SInt32 _rv)"},
{"WEGetOffset", (PyCFunction)wasteObj_WEGetOffset, 1, {"WEGetOffset", (PyCFunction)wasteObj_WEGetOffset, 1,
"(LongPt thePoint) -> (SInt32 _rv, WEEdge edge)"}, "(LongPt inPoint) -> (SInt32 _rv, WEEdge outEdge)"},
{"WEGetPoint", (PyCFunction)wasteObj_WEGetPoint, 1, {"WEGetPoint", (PyCFunction)wasteObj_WEGetPoint, 1,
"(SInt32 offset, SInt16 direction) -> (LongPt thePoint, SInt16 lineHeight)"}, "(SInt32 inOffset, SInt16 inDirection) -> (LongPt outPoint, SInt16 outLineHeight)"},
{"WEFindWord", (PyCFunction)wasteObj_WEFindWord, 1, {"WEFindWord", (PyCFunction)wasteObj_WEFindWord, 1,
"(SInt32 offset, WEEdge edge) -> (SInt32 wordStart, SInt32 wordEnd)"}, "(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outWordStart, SInt32 outWordEnd)"},
{"WEFindLine", (PyCFunction)wasteObj_WEFindLine, 1, {"WEFindLine", (PyCFunction)wasteObj_WEFindLine, 1,
"(SInt32 offset, WEEdge edge) -> (SInt32 lineStart, SInt32 lineEnd)"}, "(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outLineStart, SInt32 outLineEnd)"},
{"WEFindParagraph", (PyCFunction)wasteObj_WEFindParagraph, 1, {"WEFindParagraph", (PyCFunction)wasteObj_WEFindParagraph, 1,
"(SInt32 offset, WEEdge edge) -> (SInt32 paragraphStart, SInt32 paragraphEnd)"}, "(SInt32 inOffset, WEEdge inEdge) -> (SInt32 outParagraphStart, SInt32 outParagraphEnd)"},
{"WEFind", (PyCFunction)wasteObj_WEFind, 1,
"(char* inKey, SInt32 inKeyLength, TextEncoding inKeyEncoding, OptionBits inMatchOptions, SInt32 inRangeStart, SInt32 inRangeEnd) -> (SInt32 outMatchStart, SInt32 outMatchEnd)"},
{"WEStreamRange", (PyCFunction)wasteObj_WEStreamRange, 1,
"(SInt32 inRangeStart, SInt32 inRangeEnd, FlavorType inRequestedType, OptionBits inStreamOptions, Handle outData) -> None"},
{"WECopyRange", (PyCFunction)wasteObj_WECopyRange, 1, {"WECopyRange", (PyCFunction)wasteObj_WECopyRange, 1,
"(SInt32 rangeStart, SInt32 rangeEnd, Handle hText, StScrpHandle hStyles, WESoupHandle hSoup) -> None"}, "(SInt32 inRangeStart, SInt32 inRangeEnd, Handle outText, StScrpHandle outStyles, WESoupHandle outSoup) -> None"},
{"WEGetTextRangeAsUnicode", (PyCFunction)wasteObj_WEGetTextRangeAsUnicode, 1,
"(SInt32 inRangeStart, SInt32 inRangeEnd, Handle outUnicodeText, Handle ioCharFormat, Handle ioParaFormat, TextEncodingVariant inUnicodeVariant, TextEncodingFormat inTransformationFormat, OptionBits inGetOptions) -> None"},
{"WEGetAlignment", (PyCFunction)wasteObj_WEGetAlignment, 1, {"WEGetAlignment", (PyCFunction)wasteObj_WEGetAlignment, 1,
"() -> (WEAlignment _rv)"}, "() -> (WEAlignment _rv)"},
{"WESetAlignment", (PyCFunction)wasteObj_WESetAlignment, 1, {"WESetAlignment", (PyCFunction)wasteObj_WESetAlignment, 1,
"(WEAlignment alignment) -> None"}, "(WEAlignment inAlignment) -> None"},
{"WEGetDirection", (PyCFunction)wasteObj_WEGetDirection, 1, {"WEGetDirection", (PyCFunction)wasteObj_WEGetDirection, 1,
"() -> (WEDirection _rv)"}, "() -> (WEDirection _rv)"},
{"WESetDirection", (PyCFunction)wasteObj_WESetDirection, 1, {"WESetDirection", (PyCFunction)wasteObj_WESetDirection, 1,
"(WEDirection direction) -> None"}, "(WEDirection inDirection) -> None"},
{"WECalText", (PyCFunction)wasteObj_WECalText, 1, {"WECalText", (PyCFunction)wasteObj_WECalText, 1,
"() -> None"}, "() -> None"},
{"WEUpdate", (PyCFunction)wasteObj_WEUpdate, 1, {"WEUpdate", (PyCFunction)wasteObj_WEUpdate, 1,
"(RgnHandle updateRgn) -> None"}, "(RgnHandle inUpdateRgn) -> None"},
{"WEScroll", (PyCFunction)wasteObj_WEScroll, 1, {"WEScroll", (PyCFunction)wasteObj_WEScroll, 1,
"(SInt32 hOffset, SInt32 vOffset) -> None"}, "(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> None"},
{"WEPinScroll", (PyCFunction)wasteObj_WEPinScroll, 1,
"(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> None"},
{"WESelView", (PyCFunction)wasteObj_WESelView, 1, {"WESelView", (PyCFunction)wasteObj_WESelView, 1,
"() -> None"}, "() -> None"},
{"WEActivate", (PyCFunction)wasteObj_WEActivate, 1, {"WEActivate", (PyCFunction)wasteObj_WEActivate, 1,
...@@ -1621,47 +2003,59 @@ static PyMethodDef wasteObj_methods[] = { ...@@ -1621,47 +2003,59 @@ static PyMethodDef wasteObj_methods[] = {
{"WEDeactivate", (PyCFunction)wasteObj_WEDeactivate, 1, {"WEDeactivate", (PyCFunction)wasteObj_WEDeactivate, 1,
"() -> None"}, "() -> None"},
{"WEKey", (PyCFunction)wasteObj_WEKey, 1, {"WEKey", (PyCFunction)wasteObj_WEKey, 1,
"(SInt16 key, EventModifiers modifiers) -> None"}, "(CharParameter inKey, EventModifiers inModifiers) -> None"},
{"WEClick", (PyCFunction)wasteObj_WEClick, 1, {"WEClick", (PyCFunction)wasteObj_WEClick, 1,
"(Point hitPt, EventModifiers modifiers, UInt32 clickTime) -> None"}, "(Point inHitPoint, EventModifiers inModifiers, UInt32 inClickTime) -> None"},
{"WEAdjustCursor", (PyCFunction)wasteObj_WEAdjustCursor, 1, {"WEAdjustCursor", (PyCFunction)wasteObj_WEAdjustCursor, 1,
"(Point mouseLoc, RgnHandle mouseRgn) -> (Boolean _rv)"}, "(Point inMouseLoc, RgnHandle ioMouseRgn) -> (Boolean _rv)"},
{"WEIdle", (PyCFunction)wasteObj_WEIdle, 1, {"WEIdle", (PyCFunction)wasteObj_WEIdle, 1,
"() -> (UInt32 maxSleep)"}, "() -> (UInt32 outMaxSleep)"},
{"WEInsert", (PyCFunction)wasteObj_WEInsert, 1, {"WEInsert", (PyCFunction)wasteObj_WEInsert, 1,
"(Buffer pText, StScrpHandle hStyles, WESoupHandle hSoup) -> None"}, "(Buffer inTextPtr, StScrpHandle inStyles, WESoupHandle inSoup) -> None"},
{"WEInsertFormattedText", (PyCFunction)wasteObj_WEInsertFormattedText, 1,
"(Buffer inTextPtr, StScrpHandle inStyles, WESoupHandle inSoup, Handle inParaFormat, Handle inRulerScrap) -> None"},
{"WEDelete", (PyCFunction)wasteObj_WEDelete, 1, {"WEDelete", (PyCFunction)wasteObj_WEDelete, 1,
"() -> None"}, "() -> None"},
{"WEUseText", (PyCFunction)wasteObj_WEUseText, 1,
"(Handle inText) -> None"},
{"WEChangeCase", (PyCFunction)wasteObj_WEChangeCase, 1,
"(SInt16 inCase) -> None"},
{"WESetOneAttribute", (PyCFunction)wasteObj_WESetOneAttribute, 1,
"(SInt32 inRangeStart, SInt32 inRangeEnd, WESelector inAttributeSelector, Buffer inAttributeValue) -> None"},
{"WESetStyle", (PyCFunction)wasteObj_WESetStyle, 1, {"WESetStyle", (PyCFunction)wasteObj_WESetStyle, 1,
"(WEStyleMode mode, TextStyle ts) -> None"}, "(WEStyleMode inMode, TextStyle inTextStyle) -> None"},
{"WEUseStyleScrap", (PyCFunction)wasteObj_WEUseStyleScrap, 1, {"WEUseStyleScrap", (PyCFunction)wasteObj_WEUseStyleScrap, 1,
"(StScrpHandle hStyles) -> None"}, "(StScrpHandle inStyles) -> None"},
{"WEUseText", (PyCFunction)wasteObj_WEUseText, 1,
"(Handle hText) -> None"},
{"WEUndo", (PyCFunction)wasteObj_WEUndo, 1, {"WEUndo", (PyCFunction)wasteObj_WEUndo, 1,
"() -> None"}, "() -> None"},
{"WERedo", (PyCFunction)wasteObj_WERedo, 1,
"() -> None"},
{"WEClearUndo", (PyCFunction)wasteObj_WEClearUndo, 1, {"WEClearUndo", (PyCFunction)wasteObj_WEClearUndo, 1,
"() -> None"}, "() -> None"},
{"WEGetUndoInfo", (PyCFunction)wasteObj_WEGetUndoInfo, 1, {"WEGetUndoInfo", (PyCFunction)wasteObj_WEGetUndoInfo, 1,
"() -> (WEActionKind _rv, Boolean redoFlag)"}, "() -> (WEActionKind _rv, Boolean outRedoFlag)"},
{"WEGetIndUndoInfo", (PyCFunction)wasteObj_WEGetIndUndoInfo, 1,
"(SInt32 inUndoLevel) -> (WEActionKind _rv)"},
{"WEIsTyping", (PyCFunction)wasteObj_WEIsTyping, 1, {"WEIsTyping", (PyCFunction)wasteObj_WEIsTyping, 1,
"() -> (Boolean _rv)"}, "() -> (Boolean _rv)"},
{"WEBeginAction", (PyCFunction)wasteObj_WEBeginAction, 1, {"WEBeginAction", (PyCFunction)wasteObj_WEBeginAction, 1,
"() -> None"}, "() -> None"},
{"WEEndAction", (PyCFunction)wasteObj_WEEndAction, 1, {"WEEndAction", (PyCFunction)wasteObj_WEEndAction, 1,
"(WEActionKind actionKind) -> None"}, "(WEActionKind inActionKind) -> None"},
{"WEGetModCount", (PyCFunction)wasteObj_WEGetModCount, 1, {"WEGetModCount", (PyCFunction)wasteObj_WEGetModCount, 1,
"() -> (UInt32 _rv)"}, "() -> (UInt32 _rv)"},
{"WEResetModCount", (PyCFunction)wasteObj_WEResetModCount, 1, {"WEResetModCount", (PyCFunction)wasteObj_WEResetModCount, 1,
"() -> None"}, "() -> None"},
{"WEInsertObject", (PyCFunction)wasteObj_WEInsertObject, 1, {"WEInsertObject", (PyCFunction)wasteObj_WEInsertObject, 1,
"(FlavorType objectType, Handle objectDataHandle, Point objectSize) -> None"}, "(FlavorType inObjectType, Handle inObjectDataHandle, Point inObjectSize) -> None"},
{"WEGetSelectedObject", (PyCFunction)wasteObj_WEGetSelectedObject, 1, {"WEGetSelectedObject", (PyCFunction)wasteObj_WEGetSelectedObject, 1,
"() -> (WEObjectReference obj)"}, "() -> (WEObjectReference outObject)"},
{"WEGetObjectAtOffset", (PyCFunction)wasteObj_WEGetObjectAtOffset, 1,
"(SInt32 inOffset) -> (WEObjectReference outObject)"},
{"WEFindNextObject", (PyCFunction)wasteObj_WEFindNextObject, 1, {"WEFindNextObject", (PyCFunction)wasteObj_WEFindNextObject, 1,
"(SInt32 offset) -> (SInt32 _rv, WEObjectReference obj)"}, "(SInt32 inOffset) -> (SInt32 _rv, WEObjectReference outObject)"},
{"WEUseSoup", (PyCFunction)wasteObj_WEUseSoup, 1, {"WEUseSoup", (PyCFunction)wasteObj_WEUseSoup, 1,
"(WESoupHandle hSoup) -> None"}, "(WESoupHandle inSoup) -> None"},
{"WECut", (PyCFunction)wasteObj_WECut, 1, {"WECut", (PyCFunction)wasteObj_WECut, 1,
"() -> None"}, "() -> None"},
{"WECopy", (PyCFunction)wasteObj_WECopy, 1, {"WECopy", (PyCFunction)wasteObj_WECopy, 1,
...@@ -1671,19 +2065,21 @@ static PyMethodDef wasteObj_methods[] = { ...@@ -1671,19 +2065,21 @@ static PyMethodDef wasteObj_methods[] = {
{"WECanPaste", (PyCFunction)wasteObj_WECanPaste, 1, {"WECanPaste", (PyCFunction)wasteObj_WECanPaste, 1,
"() -> (Boolean _rv)"}, "() -> (Boolean _rv)"},
{"WEGetHiliteRgn", (PyCFunction)wasteObj_WEGetHiliteRgn, 1, {"WEGetHiliteRgn", (PyCFunction)wasteObj_WEGetHiliteRgn, 1,
"(SInt32 rangeStart, SInt32 rangeEnd) -> (RgnHandle _rv)"}, "(SInt32 inRangeStart, SInt32 inRangeEnd) -> (RgnHandle _rv)"},
{"WECharByte", (PyCFunction)wasteObj_WECharByte, 1, {"WECharByte", (PyCFunction)wasteObj_WECharByte, 1,
"(SInt32 offset) -> (SInt16 _rv)"}, "(SInt32 inOffset) -> (SInt16 _rv)"},
{"WECharType", (PyCFunction)wasteObj_WECharType, 1, {"WECharType", (PyCFunction)wasteObj_WECharType, 1,
"(SInt32 offset) -> (SInt16 _rv)"}, "(SInt32 inOffset) -> (SInt16 _rv)"},
{"WEStopInlineSession", (PyCFunction)wasteObj_WEStopInlineSession, 1, {"WEStopInlineSession", (PyCFunction)wasteObj_WEStopInlineSession, 1,
"() -> None"}, "() -> None"},
{"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1, {"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1,
"(SInt16 feature, SInt16 action) -> (SInt16 _rv)"}, "(SInt16 inFeature, SInt16 inAction) -> (SInt16 _rv)"},
{"WEGetUserInfo", (PyCFunction)wasteObj_WEGetUserInfo, 1, {"WEGetUserInfo", (PyCFunction)wasteObj_WEGetUserInfo, 1,
"(WESelector tag) -> (SInt32 userInfo)"}, "(WESelector inUserTag) -> (SInt32 outUserInfo)"},
{"WESetUserInfo", (PyCFunction)wasteObj_WESetUserInfo, 1, {"WESetUserInfo", (PyCFunction)wasteObj_WESetUserInfo, 1,
"(WESelector tag, SInt32 userInfo) -> None"}, "(WESelector inUserTag, SInt32 inUserInfo) -> None"},
{"WERemoveUserInfo", (PyCFunction)wasteObj_WERemoveUserInfo, 1,
"(WESelector inUserTag) -> None"},
{"WEInstallTabHooks", (PyCFunction)wasteObj_WEInstallTabHooks, 1, {"WEInstallTabHooks", (PyCFunction)wasteObj_WEInstallTabHooks, 1,
"() -> None"}, "() -> None"},
{"WERemoveTabHooks", (PyCFunction)wasteObj_WERemoveTabHooks, 1, {"WERemoveTabHooks", (PyCFunction)wasteObj_WERemoveTabHooks, 1,
...@@ -1738,22 +2134,22 @@ static PyObject *waste_WENew(PyObject *_self, PyObject *_args) ...@@ -1738,22 +2134,22 @@ static PyObject *waste_WENew(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
LongRect destRect; LongRect inDestRect;
LongRect viewRect; LongRect inViewRect;
UInt32 flags; OptionBits inOptions;
WEReference we; WEReference outWE;
if (!PyArg_ParseTuple(_args, "O&O&l", if (!PyArg_ParseTuple(_args, "O&O&l",
LongRect_Convert, &destRect, LongRect_Convert, &inDestRect,
LongRect_Convert, &viewRect, LongRect_Convert, &inViewRect,
&flags)) &inOptions))
return NULL; return NULL;
_err = WENew(&destRect, _err = WENew(&inDestRect,
&viewRect, &inViewRect,
flags, inOptions,
&we); &outWE);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
wasteObj_New, we); wasteObj_New, outWE);
return _res; return _res;
} }
...@@ -1761,14 +2157,14 @@ static PyObject *waste_WEUpdateStyleScrap(PyObject *_self, PyObject *_args) ...@@ -1761,14 +2157,14 @@ static PyObject *waste_WEUpdateStyleScrap(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
StScrpHandle hStyles; StScrpHandle ioStyles;
WEFontTableHandle hFontTable; WEFontTableHandle inFontTable;
if (!PyArg_ParseTuple(_args, "O&O&", if (!PyArg_ParseTuple(_args, "O&O&",
ResObj_Convert, &hStyles, ResObj_Convert, &ioStyles,
ResObj_Convert, &hFontTable)) ResObj_Convert, &inFontTable))
return NULL; return NULL;
_err = WEUpdateStyleScrap(hStyles, _err = WEUpdateStyleScrap(ioStyles,
hFontTable); inFontTable);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
Py_INCREF(Py_None); Py_INCREF(Py_None);
_res = Py_None; _res = Py_None;
...@@ -1805,118 +2201,118 @@ static PyObject *waste_WEHandleTSMEvent(PyObject *_self, PyObject *_args) ...@@ -1805,118 +2201,118 @@ static PyObject *waste_WEHandleTSMEvent(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
OSErr _err; OSErr _err;
AppleEvent ae; AppleEvent inAppleEvent;
AppleEvent reply; AppleEvent ioReply;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
AEDesc_Convert, &ae)) AEDesc_Convert, &inAppleEvent))
return NULL; return NULL;
_err = WEHandleTSMEvent(&ae, _err = WEHandleTSMEvent(&inAppleEvent,
&reply); &ioReply);
if (_err != noErr) return PyMac_Error(_err); if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
AEDesc_New, &reply); AEDesc_New, &ioReply);
return _res; return _res;
} }
static PyObject *waste_WELongPointToPoint(PyObject *_self, PyObject *_args) static PyObject *waste_WELongPointToPoint(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongPt lp; LongPt inLongPoint;
Point p; Point outPoint;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
LongPt_Convert, &lp)) LongPt_Convert, &inLongPoint))
return NULL; return NULL;
WELongPointToPoint(&lp, WELongPointToPoint(&inLongPoint,
&p); &outPoint);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
PyMac_BuildPoint, p); PyMac_BuildPoint, outPoint);
return _res; return _res;
} }
static PyObject *waste_WEPointToLongPoint(PyObject *_self, PyObject *_args) static PyObject *waste_WEPointToLongPoint(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Point p; Point inPoint;
LongPt lp; LongPt outLongPoint;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetPoint, &p)) PyMac_GetPoint, &inPoint))
return NULL; return NULL;
WEPointToLongPoint(p, WEPointToLongPoint(inPoint,
&lp); &outLongPoint);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongPt_New, &lp); LongPt_New, &outLongPoint);
return _res; return _res;
} }
static PyObject *waste_WESetLongRect(PyObject *_self, PyObject *_args) static PyObject *waste_WESetLongRect(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect lr; LongRect outLongRect;
SInt32 left; SInt32 inLeft;
SInt32 top; SInt32 inTop;
SInt32 right; SInt32 inRight;
SInt32 bottom; SInt32 inBottom;
if (!PyArg_ParseTuple(_args, "llll", if (!PyArg_ParseTuple(_args, "llll",
&left, &inLeft,
&top, &inTop,
&right, &inRight,
&bottom)) &inBottom))
return NULL; return NULL;
WESetLongRect(&lr, WESetLongRect(&outLongRect,
left, inLeft,
top, inTop,
right, inRight,
bottom); inBottom);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongRect_New, &lr); LongRect_New, &outLongRect);
return _res; return _res;
} }
static PyObject *waste_WELongRectToRect(PyObject *_self, PyObject *_args) static PyObject *waste_WELongRectToRect(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect lr; LongRect inLongRect;
Rect r; Rect outRect;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
LongRect_Convert, &lr)) LongRect_Convert, &inLongRect))
return NULL; return NULL;
WELongRectToRect(&lr, WELongRectToRect(&inLongRect,
&r); &outRect);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
PyMac_BuildRect, &r); PyMac_BuildRect, &outRect);
return _res; return _res;
} }
static PyObject *waste_WERectToLongRect(PyObject *_self, PyObject *_args) static PyObject *waste_WERectToLongRect(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Rect r; Rect inRect;
LongRect lr; LongRect outLongRect;
if (!PyArg_ParseTuple(_args, "O&", if (!PyArg_ParseTuple(_args, "O&",
PyMac_GetRect, &r)) PyMac_GetRect, &inRect))
return NULL; return NULL;
WERectToLongRect(&r, WERectToLongRect(&inRect,
&lr); &outLongRect);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongRect_New, &lr); LongRect_New, &outLongRect);
return _res; return _res;
} }
static PyObject *waste_WEOffsetLongRect(PyObject *_self, PyObject *_args) static PyObject *waste_WEOffsetLongRect(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
LongRect lr; LongRect ioLongRect;
SInt32 hOffset; SInt32 inHorizontalOffset;
SInt32 vOffset; SInt32 inVerticalOffset;
if (!PyArg_ParseTuple(_args, "ll", if (!PyArg_ParseTuple(_args, "ll",
&hOffset, &inHorizontalOffset,
&vOffset)) &inVerticalOffset))
return NULL; return NULL;
WEOffsetLongRect(&lr, WEOffsetLongRect(&ioLongRect,
hOffset, inHorizontalOffset,
vOffset); inVerticalOffset);
_res = Py_BuildValue("O&", _res = Py_BuildValue("O&",
LongRect_New, &lr); LongRect_New, &ioLongRect);
return _res; return _res;
} }
...@@ -1924,14 +2320,14 @@ static PyObject *waste_WELongPointInLongRect(PyObject *_self, PyObject *_args) ...@@ -1924,14 +2320,14 @@ static PyObject *waste_WELongPointInLongRect(PyObject *_self, PyObject *_args)
{ {
PyObject *_res = NULL; PyObject *_res = NULL;
Boolean _rv; Boolean _rv;
LongPt lp; LongPt inLongPoint;
LongRect lr; LongRect inLongRect;
if (!PyArg_ParseTuple(_args, "O&O&", if (!PyArg_ParseTuple(_args, "O&O&",
LongPt_Convert, &lp, LongPt_Convert, &inLongPoint,
LongRect_Convert, &lr)) LongRect_Convert, &inLongRect))
return NULL; return NULL;
_rv = WELongPointInLongRect(&lp, _rv = WELongPointInLongRect(&inLongPoint,
&lr); &inLongRect);
_res = Py_BuildValue("b", _res = Py_BuildValue("b",
_rv); _rv);
return _res; return _res;
...@@ -2020,29 +2416,29 @@ static PyObject *waste_WEInstallObjectHandler(PyObject *_self, PyObject *_args) ...@@ -2020,29 +2416,29 @@ static PyObject *waste_WEInstallObjectHandler(PyObject *_self, PyObject *_args)
static PyMethodDef waste_methods[] = { static PyMethodDef waste_methods[] = {
{"WENew", (PyCFunction)waste_WENew, 1, {"WENew", (PyCFunction)waste_WENew, 1,
"(LongRect destRect, LongRect viewRect, UInt32 flags) -> (WEReference we)"}, "(LongRect inDestRect, LongRect inViewRect, OptionBits inOptions) -> (WEReference outWE)"},
{"WEUpdateStyleScrap", (PyCFunction)waste_WEUpdateStyleScrap, 1, {"WEUpdateStyleScrap", (PyCFunction)waste_WEUpdateStyleScrap, 1,
"(StScrpHandle hStyles, WEFontTableHandle hFontTable) -> None"}, "(StScrpHandle ioStyles, WEFontTableHandle inFontTable) -> None"},
{"WEInstallTSMHandlers", (PyCFunction)waste_WEInstallTSMHandlers, 1, {"WEInstallTSMHandlers", (PyCFunction)waste_WEInstallTSMHandlers, 1,
"() -> None"}, "() -> None"},
{"WERemoveTSMHandlers", (PyCFunction)waste_WERemoveTSMHandlers, 1, {"WERemoveTSMHandlers", (PyCFunction)waste_WERemoveTSMHandlers, 1,
"() -> None"}, "() -> None"},
{"WEHandleTSMEvent", (PyCFunction)waste_WEHandleTSMEvent, 1, {"WEHandleTSMEvent", (PyCFunction)waste_WEHandleTSMEvent, 1,
"(AppleEvent ae) -> (AppleEvent reply)"}, "(AppleEvent inAppleEvent) -> (AppleEvent ioReply)"},
{"WELongPointToPoint", (PyCFunction)waste_WELongPointToPoint, 1, {"WELongPointToPoint", (PyCFunction)waste_WELongPointToPoint, 1,
"(LongPt lp) -> (Point p)"}, "(LongPt inLongPoint) -> (Point outPoint)"},
{"WEPointToLongPoint", (PyCFunction)waste_WEPointToLongPoint, 1, {"WEPointToLongPoint", (PyCFunction)waste_WEPointToLongPoint, 1,
"(Point p) -> (LongPt lp)"}, "(Point inPoint) -> (LongPt outLongPoint)"},
{"WESetLongRect", (PyCFunction)waste_WESetLongRect, 1, {"WESetLongRect", (PyCFunction)waste_WESetLongRect, 1,
"(SInt32 left, SInt32 top, SInt32 right, SInt32 bottom) -> (LongRect lr)"}, "(SInt32 inLeft, SInt32 inTop, SInt32 inRight, SInt32 inBottom) -> (LongRect outLongRect)"},
{"WELongRectToRect", (PyCFunction)waste_WELongRectToRect, 1, {"WELongRectToRect", (PyCFunction)waste_WELongRectToRect, 1,
"(LongRect lr) -> (Rect r)"}, "(LongRect inLongRect) -> (Rect outRect)"},
{"WERectToLongRect", (PyCFunction)waste_WERectToLongRect, 1, {"WERectToLongRect", (PyCFunction)waste_WERectToLongRect, 1,
"(Rect r) -> (LongRect lr)"}, "(Rect inRect) -> (LongRect outLongRect)"},
{"WEOffsetLongRect", (PyCFunction)waste_WEOffsetLongRect, 1, {"WEOffsetLongRect", (PyCFunction)waste_WEOffsetLongRect, 1,
"(SInt32 hOffset, SInt32 vOffset) -> (LongRect lr)"}, "(SInt32 inHorizontalOffset, SInt32 inVerticalOffset) -> (LongRect ioLongRect)"},
{"WELongPointInLongRect", (PyCFunction)waste_WELongPointInLongRect, 1, {"WELongPointInLongRect", (PyCFunction)waste_WELongPointInLongRect, 1,
"(LongPt lp, LongRect lr) -> (Boolean _rv)"}, "(LongPt inLongPoint, LongRect inLongRect) -> (Boolean _rv)"},
{"STDObjectHandlers", (PyCFunction)waste_STDObjectHandlers, 1, {"STDObjectHandlers", (PyCFunction)waste_STDObjectHandlers, 1,
NULL}, NULL},
{"WEInstallObjectHandler", (PyCFunction)waste_WEInstallObjectHandler, 1, {"WEInstallObjectHandler", (PyCFunction)waste_WEInstallObjectHandler, 1,
......
...@@ -4,10 +4,11 @@ import sys ...@@ -4,10 +4,11 @@ import sys
import os import os
BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen') BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen')
sys.path.append(BGENDIR) sys.path.append(BGENDIR)
from scantools import Scanner_PreUH3 from scantools import Scanner
from bgenlocations import MWERKSDIR, TOOLBOXDIR from bgenlocations import MWERKSDIR, TOOLBOXDIR
WASTEDIR=":::::Waste 1.3 Distribution:WASTE C/C++ Headers:" #WASTEDIR=":::::Waste 1.3 Distribution:WASTE C/C++ Headers:"
WASTEDIR=MWERKSDIR + 'MacOS Support:(Third Party Support):Waste 2.0 Distribution:C_C++ Headers:'
OBJECT = "TEHandle" OBJECT = "TEHandle"
SHORT = "waste" SHORT = "waste"
...@@ -26,7 +27,8 @@ def main(): ...@@ -26,7 +27,8 @@ def main():
exec "import " + SHORT + "support" exec "import " + SHORT + "support"
print "=== Done. It's up to you to compile it now! ===" print "=== Done. It's up to you to compile it now! ==="
class MyScanner(Scanner_PreUH3): #class MyScanner(Scanner_PreUH3):
class MyScanner(Scanner):
def destination(self, type, name, arglist): def destination(self, type, name, arglist):
classname = "Function" classname = "Function"
...@@ -52,6 +54,8 @@ class MyScanner(Scanner_PreUH3): ...@@ -52,6 +54,8 @@ class MyScanner(Scanner_PreUH3):
"WESetInfo", # Argument type unknown... "WESetInfo", # Argument type unknown...
"WEGetInfo", "WEGetInfo",
"WEVersion", # Unfortunately... "WEVersion", # Unfortunately...
"WEPut", # XXXX TBD: needs array of flavortypes.
"WEGetOneAttribute", # XXXX TBD: output buffer
] ]
def makeblacklisttypes(self): def makeblacklisttypes(self):
...@@ -60,6 +64,34 @@ class MyScanner(Scanner_PreUH3): ...@@ -60,6 +64,34 @@ class MyScanner(Scanner_PreUH3):
"UniversalProcPtr", "UniversalProcPtr",
"WEFontIDToNameUPP", "WEFontIDToNameUPP",
"WEFontNameToIDUPP", "WEFontNameToIDUPP",
"WEClickLoopUPP",
"WEScrollUPP",
"WETSMPreUpdateUPP",
"WETSMPostUpdateUPP",
"WEPreTrackDragUPP",
"WETranslateDragUPP",
"WEHiliteDropAreaUPP",
"WEDrawTextUPP",
"WEDrawTSMHiliteUPP",
"WEPixelToCharUPP",
"WECharToPixelUPP",
"WELineBreakUPP",
"WEWordBreakUPP",
"WECharByteUPP",
"WECharTypeUPP",
"WEEraseUPP",
"WEFluxUPP",
"WENewObjectUPP",
"WEDisposeObjectUPP",
"WEDrawObjectUPP",
"WEClickObjectUPP",
"WEStreamObjectUPP",
"WEHoverObjectUPP",
"WERuler", # XXXX To be done
"WERuler_ptr", # ditto
"WEParaInfo", # XXXX To be done
"WEPrintSession", # XXXX To be done
"WEPrintOptions_ptr", # XXXX To be done
] ]
def makerepairinstructions(self): def makerepairinstructions(self):
...@@ -68,24 +100,31 @@ class MyScanner(Scanner_PreUH3): ...@@ -68,24 +100,31 @@ class MyScanner(Scanner_PreUH3):
[("InBuffer", "*", "*")]), [("InBuffer", "*", "*")]),
# WEContinuousStyle # WEContinuousStyle
([("WEStyleMode", "mode", "OutMode"), ("TextStyle", "ts", "OutMode")], ([("WEStyleMode", "ioMode", "OutMode"), ("TextStyle", "outTextStyle", "OutMode")],
[("WEStyleMode", "mode", "InOutMode"), ("TextStyle", "ts", "OutMode")]), [("WEStyleMode", "*", "InOutMode"), ("TextStyle", "*", "*")]),
# WECopyRange # WECopyRange
([('Handle', 'hText', 'InMode'), ('StScrpHandle', 'hStyles', 'InMode'), ([('Handle', 'outText', 'InMode'), ('StScrpHandle', 'outStyles', 'InMode'),
('WESoupHandle', 'hSoup', 'InMode')], ('WESoupHandle', 'outSoup', 'InMode')],
[('OptHandle', 'hText', 'InMode'), ('OptStScrpHandle', 'hStyles', 'InMode'), [('OptHandle', '*', '*'), ('OptStScrpHandle', '*', '*'),
('OptSoupHandle', 'hSoup', 'InMode')]), ('OptSoupHandle', '*', '*')]),
# WEInsert # WEInsert
([('StScrpHandle', 'hStyles', 'InMode'), ('WESoupHandle', 'hSoup', 'InMode')], ([('StScrpHandle', 'inStyles', 'InMode'), ('WESoupHandle', 'inSoup', 'InMode')],
[('OptStScrpHandle', 'hStyles', 'InMode'), ('OptSoupHandle', 'hSoup', 'InMode')]), [('OptStScrpHandle', '*', '*'), ('OptSoupHandle', '*', '*')]),
# WEGetObjectOwner # WEGetObjectOwner
("WEGetObjectOwner", ("WEGetObjectOwner",
[('WEReference', '*', 'ReturnMode')], [('WEReference', '*', 'ReturnMode')],
[('ExistingWEReference', '*', 'ReturnMode')]) [('ExistingWEReference', '*', 'ReturnMode')]),
# WEFindParagraph
([("char_ptr", "inKey", "InMode")],
[("stringptr", "*", "*")]),
# WESetOneAttribute
([("void_ptr", "*", "InMode"), ("ByteCount", "*", "InMode")],
[("InBuffer", "*", "*")]),
] ]
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -36,6 +36,7 @@ OptSoupHandle = OpaqueByValueType("WESoupHandle", "OptResObj") ...@@ -36,6 +36,7 @@ OptSoupHandle = OpaqueByValueType("WESoupHandle", "OptResObj")
OptStScrpHandle = OpaqueByValueType("StScrpHandle", "OptResObj") OptStScrpHandle = OpaqueByValueType("StScrpHandle", "OptResObj")
WEStyleMode = Type("WEStyleMode", "H") WEStyleMode = Type("WEStyleMode", "H")
WERulerMode = Type("WERulerMode", "l")
WEActionKind = Type("WEActionKind", "h") WEActionKind = Type("WEActionKind", "h")
WEAlignment = Type("WEAlignment", "B") WEAlignment = Type("WEAlignment", "B")
WEEdge = Type("WEEdge", "B") WEEdge = Type("WEEdge", "B")
...@@ -55,6 +56,9 @@ LongPt_ptr = LongPt ...@@ -55,6 +56,9 @@ LongPt_ptr = LongPt
LongRect = OpaqueType("LongRect", "LongRect") LongRect = OpaqueType("LongRect", "LongRect")
LongRect_ptr = LongRect LongRect_ptr = LongRect
TextEncodingVariant = Type("TextEncodingVariant", "l")
TextEncodingFormat = Type("TextEncodingFormat", "l")
includestuff = includestuff + """ includestuff = includestuff + """
#include <%s>""" % MACHEADERFILE + """ #include <%s>""" % MACHEADERFILE + """
#include <WEObjectHandlers.h> #include <WEObjectHandlers.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment