Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b99e5213
Commit
b99e5213
authored
Jan 11, 2002
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Updated to Waste 2.0.
- Use waste included with CW in stead of separate package.
parent
00638bd4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
936 additions
and
497 deletions
+936
-497
Mac/Modules/waste/wastemodule.c
Mac/Modules/waste/wastemodule.c
+880
-484
Mac/Modules/waste/wastescan.py
Mac/Modules/waste/wastescan.py
+52
-13
Mac/Modules/waste/wastesupport.py
Mac/Modules/waste/wastesupport.py
+4
-0
No files found.
Mac/Modules/waste/wastemodule.c
View file @
b99e5213
...
...
@@ -266,6 +266,30 @@ static PyObject *WEOObj_WEGetObjectDataHandle(WEOObject *_self, PyObject *_args)
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
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -278,15 +302,34 @@ static PyObject *WEOObj_WEGetObjectSize(WEOObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
WEOObj_WE
GetObjectOwner
(
WEOObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
WEOObj_WE
SetObjectSize
(
WEOObject
*
_self
,
PyObject
*
_args
)
{
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
,
""
))
return
NULL
;
_rv
=
WEGetObjectOwner
(
_self
->
ob_itself
);
_err
=
WEGetObjectFrame
(
_self
->
ob_itself
,
&
outObjectFrame
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
ExistingwasteObj_New
,
_rv
);
LongRect_New
,
&
outObjectFrame
);
return
_res
;
}
...
...
@@ -305,12 +348,12 @@ static PyObject *WEOObj_WEGetObjectRefCon(WEOObject *_self, PyObject *_args)
static
PyObject
*
WEOObj_WESetObjectRefCon
(
WEOObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
r
efCon
;
SInt32
inR
efCon
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
r
efCon
))
&
inR
efCon
))
return
NULL
;
WESetObjectRefCon
(
_self
->
ob_itself
,
r
efCon
);
inR
efCon
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
...
...
@@ -321,14 +364,20 @@ static PyMethodDef WEOObj_methods[] = {
"() -> (FlavorType _rv)"
},
{
"WEGetObjectDataHandle"
,
(
PyCFunction
)
WEOObj_WEGetObjectDataHandle
,
1
,
"() -> (Handle _rv)"
},
{
"WEGetObjectSize"
,
(
PyCFunction
)
WEOObj_WEGetObjectSize
,
1
,
"() -> (Point _rv)"
},
{
"WEGetObjectOwner"
,
(
PyCFunction
)
WEOObj_WEGetObjectOwner
,
1
,
"() -> (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
,
"() -> (SInt32 _rv)"
},
{
"WESetObjectRefCon"
,
(
PyCFunction
)
WEOObj_WESetObjectRefCon
,
1
,
"(SInt32
r
efCon) -> None"
},
"(SInt32
inR
efCon) -> None"
},
{
NULL
,
NULL
,
0
}
};
...
...
@@ -426,11 +475,11 @@ static PyObject *wasteObj_WEGetChar(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
SInt32
o
ffset
;
SInt32
inO
ffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
o
ffset
))
&
inO
ffset
))
return
NULL
;
_rv
=
WEGetChar
(
o
ffset
,
_rv
=
WEGetChar
(
inO
ffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_rv
);
...
...
@@ -449,63 +498,45 @@ static PyObject *wasteObj_WEGetTextLength(wasteObject *_self, PyObject *_args)
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
)
{
PyObject
*
_res
=
NULL
;
SInt32
s
elStart
;
SInt32
s
elEnd
;
SInt32
outS
elStart
;
SInt32
outS
elEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
WEGetSelection
(
&
s
elStart
,
&
s
elEnd
,
WEGetSelection
(
&
outS
elStart
,
&
outS
elEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
s
elStart
,
s
elEnd
);
outS
elStart
,
outS
elEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WEGetDestRect
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
d
estRect
;
LongRect
outD
estRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
WEGetDestRect
(
&
d
estRect
,
WEGetDestRect
(
&
outD
estRect
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
LongRect_New
,
&
d
estRect
);
LongRect_New
,
&
outD
estRect
);
return
_res
;
}
static
PyObject
*
wasteObj_WEGetViewRect
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
v
iewRect
;
LongRect
outV
iewRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
WEGetViewRect
(
&
v
iewRect
,
WEGetViewRect
(
&
outV
iewRect
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
LongRect_New
,
&
v
iewRect
);
LongRect_New
,
&
outV
iewRect
);
return
_res
;
}
...
...
@@ -521,47 +552,89 @@ static PyObject *wasteObj_WEIsActive(wasteObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
wasteObj_WE
OffsetToLine
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
GetClickCount
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
_rv
;
SInt32
offset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
offset
))
UInt16
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
WEOffsetToLine
(
offset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
=
WEGetClickCount
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"H"
,
_rv
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
GetLineRange
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
SetSelection
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
lineIndex
;
SInt32
lineStart
;
SInt32
lineEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
lineIndex
))
SInt32
inSelStart
;
SInt32
inSelEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
inSelStart
,
&
inSelEnd
))
return
NULL
;
WEGetLineRange
(
lineIndex
,
&
lineStart
,
&
lineEnd
,
WESetSelection
(
inSelStart
,
inSelEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
lineStart
,
lineEnd
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
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
;
SInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
WECount
Line
s
(
_self
->
ob_itself
);
_rv
=
WECount
Run
s
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
...
...
@@ -571,11 +644,11 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt32
_rv
;
SInt32
o
ffset
;
SInt32
inO
ffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
o
ffset
))
&
inO
ffset
))
return
NULL
;
_rv
=
WEOffsetToRun
(
o
ffset
,
_rv
=
WEOffsetToRun
(
inO
ffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
...
...
@@ -585,137 +658,175 @@ static PyObject *wasteObj_WEOffsetToRun(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEGetRunRange
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
r
unIndex
;
SInt32
r
unStart
;
SInt32
r
unEnd
;
SInt32
inStyleR
unIndex
;
SInt32
outStyleR
unStart
;
SInt32
outStyleR
unEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
r
unIndex
))
&
inStyleR
unIndex
))
return
NULL
;
WEGetRunRange
(
r
unIndex
,
&
r
unStart
,
&
r
unEnd
,
WEGetRunRange
(
inStyleR
unIndex
,
&
outStyleR
unStart
,
&
outStyleR
unEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
r
unStart
,
r
unEnd
);
outStyleR
unStart
,
outStyleR
unEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
CountRuns
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
GetRunInfo
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
SInt32
inOffset
;
WERunInfo
outStyleRunInfo
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inOffset
))
return
NULL
;
_rv
=
WECountRuns
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
WEGetRunInfo
(
inOffset
,
&
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
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
GetClickCount
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
CountParaRuns
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt16
_rv
;
SInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
WE
GetClickCount
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"
H
"
,
_rv
=
WE
CountParaRuns
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"
l
"
,
_rv
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
SetSelectio
n
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
OffsetToParaRu
n
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
selStart
;
SInt32
selEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
selStart
,
&
selEnd
))
SInt32
_rv
;
SInt32
inOffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inOffset
))
return
NULL
;
WESetSelection
(
selStart
,
selEnd
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_rv
=
WEOffsetToParaRun
(
inOffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
SetDestRect
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
GetParaRunRange
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
destRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
LongRect_Convert
,
&
destRect
))
SInt32
inParagraphRunIndex
;
SInt32
outParagraphRunStart
;
SInt32
outParagraphRunEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inParagraphRunIndex
))
return
NULL
;
WESetDestRect
(
&
destRect
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
WEGetParaRunRange
(
inParagraphRunIndex
,
&
outParagraphRunStart
,
&
outParagraphRunEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
outParagraphRunStart
,
outParagraphRunEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
SetViewRect
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
CountLines
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
viewRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
LongRect_Convert
,
&
viewRect
))
SInt32
_rv
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
WESetViewRect
(
&
viewRect
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
_rv
=
WECountLines
(
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
static
PyObject
*
wasteObj_WE
ContinuousStyl
e
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
OffsetToLin
e
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
WEStyleMode
mode
;
TextStyle
ts
;
if
(
!
PyArg_ParseTuple
(
_args
,
"H"
,
&
mode
))
SInt32
_rv
;
SInt32
inOffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
inOffset
))
return
NULL
;
_rv
=
WEContinuousStyle
(
&
mode
,
&
ts
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"bHO&"
,
_rv
,
mode
,
TextStyle_New
,
&
ts
);
_rv
=
WEOffsetToLine
(
inOffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
static
PyObject
*
wasteObj_WEGet
RunInfo
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WEGet
LineRange
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
offset
;
WERunInfo
runInfo
;
SInt32
inLineIndex
;
SInt32
outLineStart
;
SInt32
outLineEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
offset
))
&
inLineIndex
))
return
NULL
;
WEGetRunInfo
(
offset
,
&
runInfo
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
RunInfo_New
,
&
runInfo
);
WEGetLineRange
(
inLineIndex
,
&
outLineStart
,
&
outLineEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
outLineStart
,
outLineEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WEGet
RunDirection
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WEGet
Height
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
SInt32
offset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
offset
))
SInt32
_rv
;
SInt32
inStartLineIndex
;
SInt32
inEndLineIndex
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
inStartLineIndex
,
&
inEndLineIndex
))
return
NULL
;
_rv
=
WEGetRunDirection
(
offset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
=
WEGetHeight
(
inStartLineIndex
,
inEndLineIndex
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
_rv
);
return
_res
;
}
...
...
@@ -724,105 +835,169 @@ static PyObject *wasteObj_WEGetOffset(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt32
_rv
;
LongPt
the
Point
;
WEEdge
e
dge
;
LongPt
in
Point
;
WEEdge
outE
dge
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
LongPt_Convert
,
&
the
Point
))
LongPt_Convert
,
&
in
Point
))
return
NULL
;
_rv
=
WEGetOffset
(
&
the
Point
,
&
e
dge
,
_rv
=
WEGetOffset
(
&
in
Point
,
&
outE
dge
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"lB"
,
_rv
,
e
dge
);
outE
dge
);
return
_res
;
}
static
PyObject
*
wasteObj_WEGetPoint
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
o
ffset
;
SInt16
d
irection
;
LongPt
the
Point
;
SInt16
l
ineHeight
;
SInt32
inO
ffset
;
SInt16
inD
irection
;
LongPt
out
Point
;
SInt16
outL
ineHeight
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lh"
,
&
o
ffset
,
&
d
irection
))
&
inO
ffset
,
&
inD
irection
))
return
NULL
;
WEGetPoint
(
o
ffset
,
d
irection
,
&
the
Point
,
&
l
ineHeight
,
WEGetPoint
(
inO
ffset
,
inD
irection
,
&
out
Point
,
&
outL
ineHeight
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&h"
,
LongPt_New
,
&
the
Point
,
l
ineHeight
);
LongPt_New
,
&
out
Point
,
outL
ineHeight
);
return
_res
;
}
static
PyObject
*
wasteObj_WEFindWord
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
o
ffset
;
WEEdge
e
dge
;
SInt32
w
ordStart
;
SInt32
w
ordEnd
;
SInt32
inO
ffset
;
WEEdge
inE
dge
;
SInt32
outW
ordStart
;
SInt32
outW
ordEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lB"
,
&
o
ffset
,
&
e
dge
))
&
inO
ffset
,
&
inE
dge
))
return
NULL
;
WEFindWord
(
o
ffset
,
e
dge
,
&
w
ordStart
,
&
w
ordEnd
,
WEFindWord
(
inO
ffset
,
inE
dge
,
&
outW
ordStart
,
&
outW
ordEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
w
ordStart
,
w
ordEnd
);
outW
ordStart
,
outW
ordEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WEFindLine
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
o
ffset
;
WEEdge
e
dge
;
SInt32
l
ineStart
;
SInt32
l
ineEnd
;
SInt32
inO
ffset
;
WEEdge
inE
dge
;
SInt32
outL
ineStart
;
SInt32
outL
ineEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lB"
,
&
o
ffset
,
&
e
dge
))
&
inO
ffset
,
&
inE
dge
))
return
NULL
;
WEFindLine
(
o
ffset
,
e
dge
,
&
l
ineStart
,
&
l
ineEnd
,
WEFindLine
(
inO
ffset
,
inE
dge
,
&
outL
ineStart
,
&
outL
ineEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
l
ineStart
,
l
ineEnd
);
outL
ineStart
,
outL
ineEnd
);
return
_res
;
}
static
PyObject
*
wasteObj_WEFindParagraph
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
o
ffset
;
WEEdge
e
dge
;
SInt32
p
aragraphStart
;
SInt32
p
aragraphEnd
;
SInt32
inO
ffset
;
WEEdge
inE
dge
;
SInt32
outP
aragraphStart
;
SInt32
outP
aragraphEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"lB"
,
&
o
ffset
,
&
e
dge
))
&
inO
ffset
,
&
inE
dge
))
return
NULL
;
WEFindParagraph
(
o
ffset
,
e
dge
,
&
p
aragraphStart
,
&
p
aragraphEnd
,
WEFindParagraph
(
inO
ffset
,
inE
dge
,
&
outP
aragraphStart
,
&
outP
aragraphEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"ll"
,
paragraphStart
,
paragraphEnd
);
outParagraphStart
,
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
;
}
...
...
@@ -830,23 +1005,23 @@ static PyObject *wasteObj_WECopyRange(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
SInt32
r
angeStart
;
SInt32
r
angeEnd
;
Handle
h
Text
;
StScrpHandle
h
Styles
;
WESoupHandle
h
Soup
;
SInt32
inR
angeStart
;
SInt32
inR
angeEnd
;
Handle
out
Text
;
StScrpHandle
out
Styles
;
WESoupHandle
out
Soup
;
if
(
!
PyArg_ParseTuple
(
_args
,
"llO&O&O&"
,
&
r
angeStart
,
&
r
angeEnd
,
OptResObj_Convert
,
&
h
Text
,
OptResObj_Convert
,
&
h
Styles
,
OptResObj_Convert
,
&
h
Soup
))
return
NULL
;
_err
=
WECopyRange
(
r
angeStart
,
r
angeEnd
,
h
Text
,
h
Styles
,
h
Soup
,
&
inR
angeStart
,
&
inR
angeEnd
,
OptResObj_Convert
,
&
out
Text
,
OptResObj_Convert
,
&
out
Styles
,
OptResObj_Convert
,
&
out
Soup
))
return
NULL
;
_err
=
WECopyRange
(
inR
angeStart
,
inR
angeEnd
,
out
Text
,
out
Styles
,
out
Soup
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -854,6 +1029,43 @@ static PyObject *wasteObj_WECopyRange(wasteObject *_self, PyObject *_args)
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
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WEGetAlignment
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -869,11 +1081,11 @@ static PyObject *wasteObj_WEGetAlignment(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WESetAlignment
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
WEAlignment
a
lignment
;
WEAlignment
inA
lignment
;
if
(
!
PyArg_ParseTuple
(
_args
,
"B"
,
&
a
lignment
))
&
inA
lignment
))
return
NULL
;
WESetAlignment
(
a
lignment
,
WESetAlignment
(
inA
lignment
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -895,11 +1107,11 @@ static PyObject *wasteObj_WEGetDirection(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WESetDirection
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
WEDirection
d
irection
;
WEDirection
inD
irection
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
d
irection
))
&
inD
irection
))
return
NULL
;
WESetDirection
(
d
irection
,
WESetDirection
(
inD
irection
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -922,11 +1134,11 @@ static PyObject *wasteObj_WECalText(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEUpdate
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
RgnHandle
u
pdateRgn
;
RgnHandle
inU
pdateRgn
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
u
pdateRgn
))
ResObj_Convert
,
&
inU
pdateRgn
))
return
NULL
;
WEUpdate
(
u
pdateRgn
,
WEUpdate
(
inU
pdateRgn
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -936,20 +1148,37 @@ static PyObject *wasteObj_WEUpdate(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEScroll
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt32
h
Offset
;
SInt32
v
Offset
;
SInt32
inHorizontal
Offset
;
SInt32
inVertical
Offset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
h
Offset
,
&
v
Offset
))
&
inHorizontal
Offset
,
&
inVertical
Offset
))
return
NULL
;
WEScroll
(
h
Offset
,
v
Offset
,
WEScroll
(
inHorizontal
Offset
,
inVertical
Offset
,
_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"
,
&
inHorizontalOffset
,
&
inVerticalOffset
))
return
NULL
;
WEPinScroll
(
inHorizontalOffset
,
inVerticalOffset
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WESelView
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -986,14 +1215,14 @@ static PyObject *wasteObj_WEDeactivate(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEKey
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
SInt16
k
ey
;
EventModifiers
m
odifiers
;
CharParameter
inK
ey
;
EventModifiers
inM
odifiers
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hH"
,
&
k
ey
,
&
m
odifiers
))
&
inK
ey
,
&
inM
odifiers
))
return
NULL
;
WEKey
(
k
ey
,
m
odifiers
,
WEKey
(
inK
ey
,
inM
odifiers
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -1003,17 +1232,17 @@ static PyObject *wasteObj_WEKey(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEClick
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Point
hitP
t
;
EventModifiers
m
odifiers
;
UInt32
c
lickTime
;
Point
inHitPoin
t
;
EventModifiers
inM
odifiers
;
UInt32
inC
lickTime
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&Hl"
,
PyMac_GetPoint
,
&
hitP
t
,
&
m
odifiers
,
&
c
lickTime
))
PyMac_GetPoint
,
&
inHitPoin
t
,
&
inM
odifiers
,
&
inC
lickTime
))
return
NULL
;
WEClick
(
hitP
t
,
m
odifiers
,
c
lickTime
,
WEClick
(
inHitPoin
t
,
inM
odifiers
,
inC
lickTime
,
_self
->
ob_itself
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -1024,14 +1253,14 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
Point
m
ouseLoc
;
RgnHandle
m
ouseRgn
;
Point
inM
ouseLoc
;
RgnHandle
ioM
ouseRgn
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
PyMac_GetPoint
,
&
m
ouseLoc
,
ResObj_Convert
,
&
m
ouseRgn
))
PyMac_GetPoint
,
&
inM
ouseLoc
,
ResObj_Convert
,
&
ioM
ouseRgn
))
return
NULL
;
_rv
=
WEAdjustCursor
(
m
ouseLoc
,
m
ouseRgn
,
_rv
=
WEAdjustCursor
(
inM
ouseLoc
,
ioM
ouseRgn
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
...
...
@@ -1041,13 +1270,13 @@ static PyObject *wasteObj_WEAdjustCursor(wasteObject *_self, PyObject *_args)
static
PyObject
*
wasteObj_WEIdle
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
UInt32
m
axSleep
;
UInt32
outM
axSleep
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
WEIdle
(
&
m
axSleep
,
WEIdle
(
&
outM
axSleep
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"l"
,
m
axSleep
);
outM
axSleep
);
return
_res
;
}
...
...
@@ -1055,20 +1284,20 @@ static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
char
*
pText
__in__
;
long
pText
__len__
;
int
pText
__in_len__
;
StScrpHandle
h
Styles
;
WESoupHandle
h
Soup
;
char
*
inTextPtr
__in__
;
long
inTextPtr
__len__
;
int
inTextPtr
__in_len__
;
StScrpHandle
in
Styles
;
WESoupHandle
in
Soup
;
if
(
!
PyArg_ParseTuple
(
_args
,
"s#O&O&"
,
&
pText__in__
,
&
pText
__in_len__
,
OptResObj_Convert
,
&
h
Styles
,
OptResObj_Convert
,
&
h
Soup
))
return
NULL
;
pText__len__
=
pText
__in_len__
;
_err
=
WEInsert
(
pText__in__
,
pText
__len__
,
h
Styles
,
h
Soup
,
&
inTextPtr__in__
,
&
inTextPtr
__in_len__
,
OptResObj_Convert
,
&
in
Styles
,
OptResObj_Convert
,
&
in
Soup
))
return
NULL
;
inTextPtr__len__
=
inTextPtr
__in_len__
;
_err
=
WEInsert
(
inTextPtr__in__
,
inTextPtr
__len__
,
in
Styles
,
in
Soup
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1076,6 +1305,37 @@ static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args)
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
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WEDelete
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1089,18 +1349,78 @@ static PyObject *wasteObj_WEDelete(wasteObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
wasteObj_WEUseText
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
Handle
inText
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
inText
))
return
NULL
;
_err
=
WEUseText
(
inText
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WEChangeCase
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
SInt16
inCase
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
inCase
))
return
NULL
;
_err
=
WEChangeCase
(
inCase
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WESetOneAttribute
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
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
m
ode
;
TextStyle
ts
;
WEStyleMode
inM
ode
;
TextStyle
inTextStyle
;
if
(
!
PyArg_ParseTuple
(
_args
,
"HO&"
,
&
m
ode
,
TextStyle_Convert
,
&
ts
))
&
inM
ode
,
TextStyle_Convert
,
&
inTextStyle
))
return
NULL
;
_err
=
WESetStyle
(
m
ode
,
&
ts
,
_err
=
WESetStyle
(
inM
ode
,
&
inTextStyle
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1112,11 +1432,11 @@ static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
StScrpHandle
h
Styles
;
StScrpHandle
in
Styles
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
h
Styles
))
ResObj_Convert
,
&
in
Styles
))
return
NULL
;
_err
=
WEUseStyleScrap
(
h
Styles
,
_err
=
WEUseStyleScrap
(
in
Styles
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1124,29 +1444,26 @@ static PyObject *wasteObj_WEUseStyleScrap(wasteObject *_self, PyObject *_args)
return
_res
;
}
static
PyObject
*
wasteObj_WEU
seText
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WEU
ndo
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
Handle
hText
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
hText
))
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
WEUseText
(
hText
,
_self
->
ob_itself
);
_err
=
WEUndo
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WE
Un
do
(
wasteObject
*
_self
,
PyObject
*
_args
)
static
PyObject
*
wasteObj_WE
Re
do
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
WE
Un
do
(
_self
->
ob_itself
);
_err
=
WE
Re
do
(
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -1168,14 +1485,29 @@ static PyObject *wasteObj_WEGetUndoInfo(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
WEActionKind
_rv
;
Boolean
r
edoFlag
;
Boolean
outR
edoFlag
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_rv
=
WEGetUndoInfo
(
&
r
edoFlag
,
_rv
=
WEGetUndoInfo
(
&
outR
edoFlag
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"hb"
,
_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
;
}
...
...
@@ -1208,11 +1540,11 @@ static PyObject *wasteObj_WEEndAction(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
WEActionKind
a
ctionKind
;
WEActionKind
inA
ctionKind
;
if
(
!
PyArg_ParseTuple
(
_args
,
"h"
,
&
a
ctionKind
))
&
inA
ctionKind
))
return
NULL
;
_err
=
WEEndAction
(
a
ctionKind
,
_err
=
WEEndAction
(
inA
ctionKind
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1247,17 +1579,17 @@ static PyObject *wasteObj_WEInsertObject(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
FlavorType
o
bjectType
;
Handle
o
bjectDataHandle
;
Point
o
bjectSize
;
FlavorType
inO
bjectType
;
Handle
inO
bjectDataHandle
;
Point
inO
bjectSize
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&O&"
,
PyMac_GetOSType
,
&
o
bjectType
,
ResObj_Convert
,
&
o
bjectDataHandle
,
PyMac_GetPoint
,
&
o
bjectSize
))
PyMac_GetOSType
,
&
inO
bjectType
,
ResObj_Convert
,
&
inO
bjectDataHandle
,
PyMac_GetPoint
,
&
inO
bjectSize
))
return
NULL
;
_err
=
WEInsertObject
(
o
bjectType
,
o
bjectDataHandle
,
o
bjectSize
,
_err
=
WEInsertObject
(
inO
bjectType
,
inO
bjectDataHandle
,
inO
bjectSize
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1269,14 +1601,32 @@ static PyObject *wasteObj_WEGetSelectedObject(wasteObject *_self, PyObject *_arg
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
WEObjectReference
o
bj
;
WEObjectReference
o
utObject
;
if
(
!
PyArg_ParseTuple
(
_args
,
""
))
return
NULL
;
_err
=
WEGetSelectedObject
(
&
obj
,
_err
=
WEGetSelectedObject
(
&
outObject
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
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
,
o
bj
);
WEOObj_New
,
o
utObject
);
return
_res
;
}
...
...
@@ -1284,17 +1634,17 @@ static PyObject *wasteObj_WEFindNextObject(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt32
_rv
;
SInt32
o
ffset
;
WEObjectReference
o
bj
;
SInt32
inO
ffset
;
WEObjectReference
o
utObject
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
o
ffset
))
&
inO
ffset
))
return
NULL
;
_rv
=
WEFindNextObject
(
o
ffset
,
&
o
bj
,
_rv
=
WEFindNextObject
(
inO
ffset
,
&
o
utObject
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"lO&"
,
_rv
,
WEOObj_New
,
o
bj
);
WEOObj_New
,
o
utObject
);
return
_res
;
}
...
...
@@ -1302,11 +1652,11 @@ static PyObject *wasteObj_WEUseSoup(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
WESoupHandle
h
Soup
;
WESoupHandle
in
Soup
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
ResObj_Convert
,
&
h
Soup
))
ResObj_Convert
,
&
in
Soup
))
return
NULL
;
_err
=
WEUseSoup
(
h
Soup
,
_err
=
WEUseSoup
(
in
Soup
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1369,14 +1719,14 @@ static PyObject *wasteObj_WEGetHiliteRgn(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
RgnHandle
_rv
;
SInt32
r
angeStart
;
SInt32
r
angeEnd
;
SInt32
inR
angeStart
;
SInt32
inR
angeEnd
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
r
angeStart
,
&
r
angeEnd
))
&
inR
angeStart
,
&
inR
angeEnd
))
return
NULL
;
_rv
=
WEGetHiliteRgn
(
r
angeStart
,
r
angeEnd
,
_rv
=
WEGetHiliteRgn
(
inR
angeStart
,
inR
angeEnd
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"O&"
,
ResObj_New
,
_rv
);
...
...
@@ -1387,11 +1737,11 @@ static PyObject *wasteObj_WECharByte(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
SInt32
o
ffset
;
SInt32
inO
ffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
o
ffset
))
&
inO
ffset
))
return
NULL
;
_rv
=
WECharByte
(
o
ffset
,
_rv
=
WECharByte
(
inO
ffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_rv
);
...
...
@@ -1402,11 +1752,11 @@ static PyObject *wasteObj_WECharType(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
SInt32
o
ffset
;
SInt32
inO
ffset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"l"
,
&
o
ffset
))
&
inO
ffset
))
return
NULL
;
_rv
=
WECharType
(
o
ffset
,
_rv
=
WECharType
(
inO
ffset
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_rv
);
...
...
@@ -1428,14 +1778,14 @@ static PyObject *wasteObj_WEFeatureFlag(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
SInt16
_rv
;
SInt16
f
eature
;
SInt16
a
ction
;
SInt16
inF
eature
;
SInt16
inA
ction
;
if
(
!
PyArg_ParseTuple
(
_args
,
"hh"
,
&
f
eature
,
&
a
ction
))
&
inF
eature
,
&
inA
ction
))
return
NULL
;
_rv
=
WEFeatureFlag
(
f
eature
,
a
ction
,
_rv
=
WEFeatureFlag
(
inF
eature
,
inA
ction
,
_self
->
ob_itself
);
_res
=
Py_BuildValue
(
"h"
,
_rv
);
...
...
@@ -1446,17 +1796,17 @@ static PyObject *wasteObj_WEGetUserInfo(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
WESelector
t
ag
;
SInt32
u
serInfo
;
WESelector
inUserT
ag
;
SInt32
outU
serInfo
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetOSType
,
&
t
ag
))
PyMac_GetOSType
,
&
inUserT
ag
))
return
NULL
;
_err
=
WEGetUserInfo
(
t
ag
,
&
u
serInfo
,
_err
=
WEGetUserInfo
(
inUserT
ag
,
&
outU
serInfo
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"l"
,
u
serInfo
);
outU
serInfo
);
return
_res
;
}
...
...
@@ -1464,14 +1814,14 @@ static PyObject *wasteObj_WESetUserInfo(wasteObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
WESelector
t
ag
;
SInt32
u
serInfo
;
WESelector
inUserT
ag
;
SInt32
inU
serInfo
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&l"
,
PyMac_GetOSType
,
&
t
ag
,
&
u
serInfo
))
PyMac_GetOSType
,
&
inUserT
ag
,
&
inU
serInfo
))
return
NULL
;
_err
=
WESetUserInfo
(
t
ag
,
u
serInfo
,
_err
=
WESetUserInfo
(
inUserT
ag
,
inU
serInfo
,
_self
->
ob_itself
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
...
...
@@ -1479,6 +1829,22 @@ static PyObject *wasteObj_WESetUserInfo(wasteObject *_self, PyObject *_args)
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
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
return
_res
;
}
static
PyObject
*
wasteObj_WEInstallTabHooks
(
wasteObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
...
...
@@ -1549,71 +1915,87 @@ static PyMethodDef wasteObj_methods[] = {
{
"WEGetText"
,
(
PyCFunction
)
wasteObj_WEGetText
,
1
,
"() -> (Handle _rv)"
},
{
"WEGetChar"
,
(
PyCFunction
)
wasteObj_WEGetChar
,
1
,
"(SInt32
o
ffset) -> (SInt16 _rv)"
},
"(SInt32
inO
ffset) -> (SInt16 _rv)"
},
{
"WEGetTextLength"
,
(
PyCFunction
)
wasteObj_WEGetTextLength
,
1
,
"() -> (SInt32 _rv)"
},
{
"WEGetHeight"
,
(
PyCFunction
)
wasteObj_WEGetHeight
,
1
,
"(SInt32 startLine, SInt32 endLine) -> (SInt32 _rv)"
},
{
"WEGetSelection"
,
(
PyCFunction
)
wasteObj_WEGetSelection
,
1
,
"() -> (SInt32
selStart, SInt32 s
elEnd)"
},
"() -> (SInt32
outSelStart, SInt32 outS
elEnd)"
},
{
"WEGetDestRect"
,
(
PyCFunction
)
wasteObj_WEGetDestRect
,
1
,
"() -> (LongRect
d
estRect)"
},
"() -> (LongRect
outD
estRect)"
},
{
"WEGetViewRect"
,
(
PyCFunction
)
wasteObj_WEGetViewRect
,
1
,
"() -> (LongRect
v
iewRect)"
},
"() -> (LongRect
outV
iewRect)"
},
{
"WEIsActive"
,
(
PyCFunction
)
wasteObj_WEIsActive
,
1
,
"() -> (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
,
"() -> (UInt16 _rv)"
},
{
"WESetSelection"
,
(
PyCFunction
)
wasteObj_WESetSelection
,
1
,
"(SInt32
selStart, SInt32 s
elEnd) -> None"
},
"(SInt32
inSelStart, SInt32 inS
elEnd) -> None"
},
{
"WESetDestRect"
,
(
PyCFunction
)
wasteObj_WESetDestRect
,
1
,
"(LongRect
d
estRect) -> None"
},
"(LongRect
inD
estRect) -> None"
},
{
"WESetViewRect"
,
(
PyCFunction
)
wasteObj_WESetViewRect
,
1
,
"(LongRect
v
iewRect) -> None"
},
"(LongRect
inV
iewRect) -> None"
},
{
"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
,
"(SInt32 offset) -> (WERunInfo runInfo)"
},
"(SInt32 inOffset) -> (WERunInfo outStyleRunInfo)"
},
{
"WEGetIndRunInfo"
,
(
PyCFunction
)
wasteObj_WEGetIndRunInfo
,
1
,
"(SInt32 inStyleRunIndex) -> (WERunInfo outStyleRunInfo)"
},
{
"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
,
"(LongPt
thePoint) -> (SInt32 _rv, WEEdge e
dge)"
},
"(LongPt
inPoint) -> (SInt32 _rv, WEEdge outE
dge)"
},
{
"WEGetPoint"
,
(
PyCFunction
)
wasteObj_WEGetPoint
,
1
,
"(SInt32
offset, SInt16 direction) -> (LongPt thePoint, SInt16 l
ineHeight)"
},
"(SInt32
inOffset, SInt16 inDirection) -> (LongPt outPoint, SInt16 outL
ineHeight)"
},
{
"WEFindWord"
,
(
PyCFunction
)
wasteObj_WEFindWord
,
1
,
"(SInt32
offset, WEEdge edge) -> (SInt32 wordStart, SInt32 w
ordEnd)"
},
"(SInt32
inOffset, WEEdge inEdge) -> (SInt32 outWordStart, SInt32 outW
ordEnd)"
},
{
"WEFindLine"
,
(
PyCFunction
)
wasteObj_WEFindLine
,
1
,
"(SInt32
offset, WEEdge edge) -> (SInt32 lineStart, SInt32 l
ineEnd)"
},
"(SInt32
inOffset, WEEdge inEdge) -> (SInt32 outLineStart, SInt32 outL
ineEnd)"
},
{
"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
,
"(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
,
"() -> (WEAlignment _rv)"
},
{
"WESetAlignment"
,
(
PyCFunction
)
wasteObj_WESetAlignment
,
1
,
"(WEAlignment
a
lignment) -> None"
},
"(WEAlignment
inA
lignment) -> None"
},
{
"WEGetDirection"
,
(
PyCFunction
)
wasteObj_WEGetDirection
,
1
,
"() -> (WEDirection _rv)"
},
{
"WESetDirection"
,
(
PyCFunction
)
wasteObj_WESetDirection
,
1
,
"(WEDirection
d
irection) -> None"
},
"(WEDirection
inD
irection) -> None"
},
{
"WECalText"
,
(
PyCFunction
)
wasteObj_WECalText
,
1
,
"() -> None"
},
{
"WEUpdate"
,
(
PyCFunction
)
wasteObj_WEUpdate
,
1
,
"(RgnHandle
u
pdateRgn) -> None"
},
"(RgnHandle
inU
pdateRgn) -> None"
},
{
"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
,
"() -> None"
},
{
"WEActivate"
,
(
PyCFunction
)
wasteObj_WEActivate
,
1
,
...
...
@@ -1621,47 +2003,59 @@ static PyMethodDef wasteObj_methods[] = {
{
"WEDeactivate"
,
(
PyCFunction
)
wasteObj_WEDeactivate
,
1
,
"() -> None"
},
{
"WEKey"
,
(
PyCFunction
)
wasteObj_WEKey
,
1
,
"(
SInt16 key, EventModifiers m
odifiers) -> None"
},
"(
CharParameter inKey, EventModifiers inM
odifiers) -> None"
},
{
"WEClick"
,
(
PyCFunction
)
wasteObj_WEClick
,
1
,
"(Point
hitPt, EventModifiers modifiers, UInt32 c
lickTime) -> None"
},
"(Point
inHitPoint, EventModifiers inModifiers, UInt32 inC
lickTime) -> None"
},
{
"WEAdjustCursor"
,
(
PyCFunction
)
wasteObj_WEAdjustCursor
,
1
,
"(Point
mouseLoc, RgnHandle m
ouseRgn) -> (Boolean _rv)"
},
"(Point
inMouseLoc, RgnHandle ioM
ouseRgn) -> (Boolean _rv)"
},
{
"WEIdle"
,
(
PyCFunction
)
wasteObj_WEIdle
,
1
,
"() -> (UInt32
m
axSleep)"
},
"() -> (UInt32
outM
axSleep)"
},
{
"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
,
"() -> 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
,
"(WEStyleMode
mode, TextStyle ts
) -> None"
},
"(WEStyleMode
inMode, TextStyle inTextStyle
) -> None"
},
{
"WEUseStyleScrap"
,
(
PyCFunction
)
wasteObj_WEUseStyleScrap
,
1
,
"(StScrpHandle hStyles) -> None"
},
{
"WEUseText"
,
(
PyCFunction
)
wasteObj_WEUseText
,
1
,
"(Handle hText) -> None"
},
"(StScrpHandle inStyles) -> None"
},
{
"WEUndo"
,
(
PyCFunction
)
wasteObj_WEUndo
,
1
,
"() -> None"
},
{
"WERedo"
,
(
PyCFunction
)
wasteObj_WERedo
,
1
,
"() -> None"
},
{
"WEClearUndo"
,
(
PyCFunction
)
wasteObj_WEClearUndo
,
1
,
"() -> None"
},
{
"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
,
"() -> (Boolean _rv)"
},
{
"WEBeginAction"
,
(
PyCFunction
)
wasteObj_WEBeginAction
,
1
,
"() -> None"
},
{
"WEEndAction"
,
(
PyCFunction
)
wasteObj_WEEndAction
,
1
,
"(WEActionKind
a
ctionKind) -> None"
},
"(WEActionKind
inA
ctionKind) -> None"
},
{
"WEGetModCount"
,
(
PyCFunction
)
wasteObj_WEGetModCount
,
1
,
"() -> (UInt32 _rv)"
},
{
"WEResetModCount"
,
(
PyCFunction
)
wasteObj_WEResetModCount
,
1
,
"() -> None"
},
{
"WEInsertObject"
,
(
PyCFunction
)
wasteObj_WEInsertObject
,
1
,
"(FlavorType
objectType, Handle objectDataHandle, Point o
bjectSize) -> None"
},
"(FlavorType
inObjectType, Handle inObjectDataHandle, Point inO
bjectSize) -> None"
},
{
"WEGetSelectedObject"
,
(
PyCFunction
)
wasteObj_WEGetSelectedObject
,
1
,
"() -> (WEObjectReference obj)"
},
"() -> (WEObjectReference outObject)"
},
{
"WEGetObjectAtOffset"
,
(
PyCFunction
)
wasteObj_WEGetObjectAtOffset
,
1
,
"(SInt32 inOffset) -> (WEObjectReference outObject)"
},
{
"WEFindNextObject"
,
(
PyCFunction
)
wasteObj_WEFindNextObject
,
1
,
"(SInt32
offset) -> (SInt32 _rv, WEObjectReference obj
)"
},
"(SInt32
inOffset) -> (SInt32 _rv, WEObjectReference outObject
)"
},
{
"WEUseSoup"
,
(
PyCFunction
)
wasteObj_WEUseSoup
,
1
,
"(WESoupHandle
h
Soup) -> None"
},
"(WESoupHandle
in
Soup) -> None"
},
{
"WECut"
,
(
PyCFunction
)
wasteObj_WECut
,
1
,
"() -> None"
},
{
"WECopy"
,
(
PyCFunction
)
wasteObj_WECopy
,
1
,
...
...
@@ -1671,19 +2065,21 @@ static PyMethodDef wasteObj_methods[] = {
{
"WECanPaste"
,
(
PyCFunction
)
wasteObj_WECanPaste
,
1
,
"() -> (Boolean _rv)"
},
{
"WEGetHiliteRgn"
,
(
PyCFunction
)
wasteObj_WEGetHiliteRgn
,
1
,
"(SInt32
rangeStart, SInt32 r
angeEnd) -> (RgnHandle _rv)"
},
"(SInt32
inRangeStart, SInt32 inR
angeEnd) -> (RgnHandle _rv)"
},
{
"WECharByte"
,
(
PyCFunction
)
wasteObj_WECharByte
,
1
,
"(SInt32
o
ffset) -> (SInt16 _rv)"
},
"(SInt32
inO
ffset) -> (SInt16 _rv)"
},
{
"WECharType"
,
(
PyCFunction
)
wasteObj_WECharType
,
1
,
"(SInt32
o
ffset) -> (SInt16 _rv)"
},
"(SInt32
inO
ffset) -> (SInt16 _rv)"
},
{
"WEStopInlineSession"
,
(
PyCFunction
)
wasteObj_WEStopInlineSession
,
1
,
"() -> None"
},
{
"WEFeatureFlag"
,
(
PyCFunction
)
wasteObj_WEFeatureFlag
,
1
,
"(SInt16
feature, SInt16 a
ction) -> (SInt16 _rv)"
},
"(SInt16
inFeature, SInt16 inA
ction) -> (SInt16 _rv)"
},
{
"WEGetUserInfo"
,
(
PyCFunction
)
wasteObj_WEGetUserInfo
,
1
,
"(WESelector
tag) -> (SInt32 u
serInfo)"
},
"(WESelector
inUserTag) -> (SInt32 outU
serInfo)"
},
{
"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
,
"() -> None"
},
{
"WERemoveTabHooks"
,
(
PyCFunction
)
wasteObj_WERemoveTabHooks
,
1
,
...
...
@@ -1738,22 +2134,22 @@ static PyObject *waste_WENew(PyObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
LongRect
d
estRect
;
LongRect
v
iewRect
;
UInt32
flag
s
;
WEReference
we
;
LongRect
inD
estRect
;
LongRect
inV
iewRect
;
OptionBits
inOption
s
;
WEReference
outWE
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&l"
,
LongRect_Convert
,
&
d
estRect
,
LongRect_Convert
,
&
v
iewRect
,
&
flag
s
))
return
NULL
;
_err
=
WENew
(
&
d
estRect
,
&
v
iewRect
,
flag
s
,
&
we
);
LongRect_Convert
,
&
inD
estRect
,
LongRect_Convert
,
&
inV
iewRect
,
&
inOption
s
))
return
NULL
;
_err
=
WENew
(
&
inD
estRect
,
&
inV
iewRect
,
inOption
s
,
&
outWE
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
wasteObj_New
,
we
);
wasteObj_New
,
outWE
);
return
_res
;
}
...
...
@@ -1761,14 +2157,14 @@ static PyObject *waste_WEUpdateStyleScrap(PyObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
StScrpHandle
h
Styles
;
WEFontTableHandle
h
FontTable
;
StScrpHandle
io
Styles
;
WEFontTableHandle
in
FontTable
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
ResObj_Convert
,
&
h
Styles
,
ResObj_Convert
,
&
h
FontTable
))
ResObj_Convert
,
&
io
Styles
,
ResObj_Convert
,
&
in
FontTable
))
return
NULL
;
_err
=
WEUpdateStyleScrap
(
h
Styles
,
h
FontTable
);
_err
=
WEUpdateStyleScrap
(
io
Styles
,
in
FontTable
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
Py_INCREF
(
Py_None
);
_res
=
Py_None
;
...
...
@@ -1805,118 +2201,118 @@ static PyObject *waste_WEHandleTSMEvent(PyObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
OSErr
_err
;
AppleEvent
ae
;
AppleEvent
r
eply
;
AppleEvent
inAppleEvent
;
AppleEvent
ioR
eply
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
AEDesc_Convert
,
&
ae
))
AEDesc_Convert
,
&
inAppleEvent
))
return
NULL
;
_err
=
WEHandleTSMEvent
(
&
ae
,
&
r
eply
);
_err
=
WEHandleTSMEvent
(
&
inAppleEvent
,
&
ioR
eply
);
if
(
_err
!=
noErr
)
return
PyMac_Error
(
_err
);
_res
=
Py_BuildValue
(
"O&"
,
AEDesc_New
,
&
r
eply
);
AEDesc_New
,
&
ioR
eply
);
return
_res
;
}
static
PyObject
*
waste_WELongPointToPoint
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongPt
lp
;
Point
p
;
LongPt
inLongPoint
;
Point
outPoint
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
LongPt_Convert
,
&
lp
))
LongPt_Convert
,
&
inLongPoint
))
return
NULL
;
WELongPointToPoint
(
&
lp
,
&
p
);
WELongPointToPoint
(
&
inLongPoint
,
&
outPoint
);
_res
=
Py_BuildValue
(
"O&"
,
PyMac_BuildPoint
,
p
);
PyMac_BuildPoint
,
outPoint
);
return
_res
;
}
static
PyObject
*
waste_WEPointToLongPoint
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Point
p
;
LongPt
lp
;
Point
inPoint
;
LongPt
outLongPoint
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetPoint
,
&
p
))
PyMac_GetPoint
,
&
inPoint
))
return
NULL
;
WEPointToLongPoint
(
p
,
&
lp
);
WEPointToLongPoint
(
inPoint
,
&
outLongPoint
);
_res
=
Py_BuildValue
(
"O&"
,
LongPt_New
,
&
lp
);
LongPt_New
,
&
outLongPoint
);
return
_res
;
}
static
PyObject
*
waste_WESetLongRect
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
lr
;
SInt32
l
eft
;
SInt32
t
op
;
SInt32
r
ight
;
SInt32
b
ottom
;
LongRect
outLongRect
;
SInt32
inL
eft
;
SInt32
inT
op
;
SInt32
inR
ight
;
SInt32
inB
ottom
;
if
(
!
PyArg_ParseTuple
(
_args
,
"llll"
,
&
l
eft
,
&
t
op
,
&
r
ight
,
&
b
ottom
))
return
NULL
;
WESetLongRect
(
&
lr
,
l
eft
,
t
op
,
r
ight
,
b
ottom
);
&
inL
eft
,
&
inT
op
,
&
inR
ight
,
&
inB
ottom
))
return
NULL
;
WESetLongRect
(
&
outLongRect
,
inL
eft
,
inT
op
,
inR
ight
,
inB
ottom
);
_res
=
Py_BuildValue
(
"O&"
,
LongRect_New
,
&
lr
);
LongRect_New
,
&
outLongRect
);
return
_res
;
}
static
PyObject
*
waste_WELongRectToRect
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
lr
;
Rect
r
;
LongRect
inLongRect
;
Rect
outRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
LongRect_Convert
,
&
lr
))
LongRect_Convert
,
&
inLongRect
))
return
NULL
;
WELongRectToRect
(
&
lr
,
&
r
);
WELongRectToRect
(
&
inLongRect
,
&
outRect
);
_res
=
Py_BuildValue
(
"O&"
,
PyMac_BuildRect
,
&
r
);
PyMac_BuildRect
,
&
outRect
);
return
_res
;
}
static
PyObject
*
waste_WERectToLongRect
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
Rect
r
;
LongRect
lr
;
Rect
inRect
;
LongRect
outLongRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&"
,
PyMac_GetRect
,
&
r
))
PyMac_GetRect
,
&
inRect
))
return
NULL
;
WERectToLongRect
(
&
r
,
&
lr
);
WERectToLongRect
(
&
inRect
,
&
outLongRect
);
_res
=
Py_BuildValue
(
"O&"
,
LongRect_New
,
&
lr
);
LongRect_New
,
&
outLongRect
);
return
_res
;
}
static
PyObject
*
waste_WEOffsetLongRect
(
PyObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
LongRect
lr
;
SInt32
h
Offset
;
SInt32
v
Offset
;
LongRect
ioLongRect
;
SInt32
inHorizontal
Offset
;
SInt32
inVertical
Offset
;
if
(
!
PyArg_ParseTuple
(
_args
,
"ll"
,
&
h
Offset
,
&
v
Offset
))
&
inHorizontal
Offset
,
&
inVertical
Offset
))
return
NULL
;
WEOffsetLongRect
(
&
lr
,
h
Offset
,
v
Offset
);
WEOffsetLongRect
(
&
ioLongRect
,
inHorizontal
Offset
,
inVertical
Offset
);
_res
=
Py_BuildValue
(
"O&"
,
LongRect_New
,
&
lr
);
LongRect_New
,
&
ioLongRect
);
return
_res
;
}
...
...
@@ -1924,14 +2320,14 @@ static PyObject *waste_WELongPointInLongRect(PyObject *_self, PyObject *_args)
{
PyObject
*
_res
=
NULL
;
Boolean
_rv
;
LongPt
lp
;
LongRect
lr
;
LongPt
inLongPoint
;
LongRect
inLongRect
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&O&"
,
LongPt_Convert
,
&
lp
,
LongRect_Convert
,
&
lr
))
LongPt_Convert
,
&
inLongPoint
,
LongRect_Convert
,
&
inLongRect
))
return
NULL
;
_rv
=
WELongPointInLongRect
(
&
lp
,
&
lr
);
_rv
=
WELongPointInLongRect
(
&
inLongPoint
,
&
inLongRect
);
_res
=
Py_BuildValue
(
"b"
,
_rv
);
return
_res
;
...
...
@@ -2020,29 +2416,29 @@ static PyObject *waste_WEInstallObjectHandler(PyObject *_self, PyObject *_args)
static
PyMethodDef
waste_methods
[]
=
{
{
"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
,
"(StScrpHandle
hStyles, WEFontTableHandle h
FontTable) -> None"
},
"(StScrpHandle
ioStyles, WEFontTableHandle in
FontTable) -> None"
},
{
"WEInstallTSMHandlers"
,
(
PyCFunction
)
waste_WEInstallTSMHandlers
,
1
,
"() -> None"
},
{
"WERemoveTSMHandlers"
,
(
PyCFunction
)
waste_WERemoveTSMHandlers
,
1
,
"() -> None"
},
{
"WEHandleTSMEvent"
,
(
PyCFunction
)
waste_WEHandleTSMEvent
,
1
,
"(AppleEvent
ae) -> (AppleEvent r
eply)"
},
"(AppleEvent
inAppleEvent) -> (AppleEvent ioR
eply)"
},
{
"WELongPointToPoint"
,
(
PyCFunction
)
waste_WELongPointToPoint
,
1
,
"(LongPt
lp) -> (Point p
)"
},
"(LongPt
inLongPoint) -> (Point outPoint
)"
},
{
"WEPointToLongPoint"
,
(
PyCFunction
)
waste_WEPointToLongPoint
,
1
,
"(Point
p) -> (LongPt lp
)"
},
"(Point
inPoint) -> (LongPt outLongPoint
)"
},
{
"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
,
"(LongRect
lr) -> (Rect r
)"
},
"(LongRect
inLongRect) -> (Rect outRect
)"
},
{
"WERectToLongRect"
,
(
PyCFunction
)
waste_WERectToLongRect
,
1
,
"(Rect
r) -> (LongRect lr
)"
},
"(Rect
inRect) -> (LongRect outLongRect
)"
},
{
"WEOffsetLongRect"
,
(
PyCFunction
)
waste_WEOffsetLongRect
,
1
,
"(SInt32
hOffset, SInt32 vOffset) -> (LongRect lr
)"
},
"(SInt32
inHorizontalOffset, SInt32 inVerticalOffset) -> (LongRect ioLongRect
)"
},
{
"WELongPointInLongRect"
,
(
PyCFunction
)
waste_WELongPointInLongRect
,
1
,
"(LongPt
lp, LongRect lr
) -> (Boolean _rv)"
},
"(LongPt
inLongPoint, LongRect inLongRect
) -> (Boolean _rv)"
},
{
"STDObjectHandlers"
,
(
PyCFunction
)
waste_STDObjectHandlers
,
1
,
NULL
},
{
"WEInstallObjectHandler"
,
(
PyCFunction
)
waste_WEInstallObjectHandler
,
1
,
...
...
Mac/Modules/waste/wastescan.py
View file @
b99e5213
...
...
@@ -4,10 +4,11 @@ import sys
import
os
BGENDIR
=
os
.
path
.
join
(
sys
.
prefix
,
':Tools:bgen:bgen'
)
sys
.
path
.
append
(
BGENDIR
)
from
scantools
import
Scanner
_PreUH3
from
scantools
import
Scanner
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"
SHORT
=
"waste"
...
...
@@ -26,7 +27,8 @@ def main():
exec
"import "
+
SHORT
+
"support"
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
):
classname
=
"Function"
...
...
@@ -52,6 +54,8 @@ class MyScanner(Scanner_PreUH3):
"WESetInfo"
,
# Argument type unknown...
"WEGetInfo"
,
"WEVersion"
,
# Unfortunately...
"WEPut"
,
# XXXX TBD: needs array of flavortypes.
"WEGetOneAttribute"
,
# XXXX TBD: output buffer
]
def
makeblacklisttypes
(
self
):
...
...
@@ -60,6 +64,34 @@ class MyScanner(Scanner_PreUH3):
"UniversalProcPtr"
,
"WEFontIDToNameUPP"
,
"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
):
...
...
@@ -68,24 +100,31 @@ class MyScanner(Scanner_PreUH3):
[(
"InBuffer"
,
"*"
,
"*"
)]),
# WEContinuousStyle
([(
"WEStyleMode"
,
"
mode"
,
"OutMode"
),
(
"TextStyle"
,
"ts
"
,
"OutMode"
)],
[(
"WEStyleMode"
,
"
mode"
,
"InOutMode"
),
(
"TextStyle"
,
"ts"
,
"OutMode
"
)]),
([(
"WEStyleMode"
,
"
ioMode"
,
"OutMode"
),
(
"TextStyle"
,
"outTextStyle
"
,
"OutMode"
)],
[(
"WEStyleMode"
,
"
*"
,
"InOutMode"
),
(
"TextStyle"
,
"*"
,
"*
"
)]),
# WECopyRange
([(
'Handle'
,
'
hText'
,
'InMode'
),
(
'StScrpHandle'
,
'h
Styles'
,
'InMode'
),
(
'WESoupHandle'
,
'
h
Soup'
,
'InMode'
)],
[(
'OptHandle'
,
'
hText'
,
'InMode'
),
(
'OptStScrpHandle'
,
'hStyles'
,
'InMode
'
),
(
'OptSoupHandle'
,
'
hSoup'
,
'InMode
'
)]),
([(
'Handle'
,
'
outText'
,
'InMode'
),
(
'StScrpHandle'
,
'out
Styles'
,
'InMode'
),
(
'WESoupHandle'
,
'
out
Soup'
,
'InMode'
)],
[(
'OptHandle'
,
'
*'
,
'*'
),
(
'OptStScrpHandle'
,
'*'
,
'*
'
),
(
'OptSoupHandle'
,
'
*'
,
'*
'
)]),
# WEInsert
([(
'StScrpHandle'
,
'
hStyles'
,
'InMode'
),
(
'WESoupHandle'
,
'h
Soup'
,
'InMode'
)],
[(
'OptStScrpHandle'
,
'
hStyles'
,
'InMode'
),
(
'OptSoupHandle'
,
'hSoup'
,
'InMode
'
)]),
([(
'StScrpHandle'
,
'
inStyles'
,
'InMode'
),
(
'WESoupHandle'
,
'in
Soup'
,
'InMode'
)],
[(
'OptStScrpHandle'
,
'
*'
,
'*'
),
(
'OptSoupHandle'
,
'*'
,
'*
'
)]),
# WEGetObjectOwner
(
"WEGetObjectOwner"
,
[(
'WEReference'
,
'*'
,
'ReturnMode'
)],
[(
'ExistingWEReference'
,
'*'
,
'ReturnMode'
)])
[(
'ExistingWEReference'
,
'*'
,
'ReturnMode'
)]),
# WEFindParagraph
([(
"char_ptr"
,
"inKey"
,
"InMode"
)],
[(
"stringptr"
,
"*"
,
"*"
)]),
# WESetOneAttribute
([(
"void_ptr"
,
"*"
,
"InMode"
),
(
"ByteCount"
,
"*"
,
"InMode"
)],
[(
"InBuffer"
,
"*"
,
"*"
)]),
]
if
__name__
==
"__main__"
:
...
...
Mac/Modules/waste/wastesupport.py
View file @
b99e5213
...
...
@@ -36,6 +36,7 @@ OptSoupHandle = OpaqueByValueType("WESoupHandle", "OptResObj")
OptStScrpHandle
=
OpaqueByValueType
(
"StScrpHandle"
,
"OptResObj"
)
WEStyleMode
=
Type
(
"WEStyleMode"
,
"H"
)
WERulerMode
=
Type
(
"WERulerMode"
,
"l"
)
WEActionKind
=
Type
(
"WEActionKind"
,
"h"
)
WEAlignment
=
Type
(
"WEAlignment"
,
"B"
)
WEEdge
=
Type
(
"WEEdge"
,
"B"
)
...
...
@@ -55,6 +56,9 @@ LongPt_ptr = LongPt
LongRect
=
OpaqueType
(
"LongRect"
,
"LongRect"
)
LongRect_ptr
=
LongRect
TextEncodingVariant
=
Type
(
"TextEncodingVariant"
,
"l"
)
TextEncodingFormat
=
Type
(
"TextEncodingFormat"
,
"l"
)
includestuff
=
includestuff
+
"""
#include <%s>"""
%
MACHEADERFILE
+
"""
#include <WEObjectHandlers.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment