Commits

Jack Jansen committed 46b33cf

Upgraded to Waste 1.2f

  • Participants
  • Parent commits 675328b
  • Branches legacy-trunk

Comments (0)

Files changed (3)

File Mac/Modules/waste/wastemodule.c

 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
+	SInt32 _rv;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	_rv = WEGetObjectRefCon(_self->ob_itself);
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long refCon;
+	SInt32 refCon;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &refCon))
 		return NULL;
 	{"WEGetObjectOwner", (PyCFunction)WEOObj_WEGetObjectOwner, 1,
 	 "() -> (WEReference _rv)"},
 	{"WEGetObjectRefCon", (PyCFunction)WEOObj_WEGetObjectRefCon, 1,
-	 "() -> (long _rv)"},
+	 "() -> (SInt32 _rv)"},
 	{"WESetObjectRefCon", (PyCFunction)WEOObj_WESetObjectRefCon, 1,
-	 "(long refCon) -> None"},
+	 "(SInt32 refCon) -> None"},
 	{NULL, NULL, 0}
 };
 
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	short _rv;
-	long offset;
+	SInt16 _rv;
+	SInt32 offset;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 		return NULL;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
+	SInt32 _rv;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	_rv = WEGetTextLength(_self->ob_itself);
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
+	SInt32 _rv;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	_rv = WECountLines(_self->ob_itself);
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
-	long startLine;
-	long endLine;
+	SInt32 _rv;
+	SInt32 startLine;
+	SInt32 endLine;
 	if (!PyArg_ParseTuple(_args, "ll",
 	                      &startLine,
 	                      &endLine))
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long selStart;
-	long selEnd;
+	SInt32 selStart;
+	SInt32 selEnd;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	WEGetSelection(&selStart,
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
-	long offset;
+	SInt32 _rv;
+	SInt32 offset;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 		return NULL;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long lineNo;
-	long lineStart;
-	long lineEnd;
+	SInt32 lineNo;
+	SInt32 lineStart;
+	SInt32 lineEnd;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &lineNo))
 		return NULL;
 	return _res;
 }
 
+static PyObject *wasteObj_WEGetClickCount(_self, _args)
+	wasteObject *_self;
+	PyObject *_args;
+{
+	PyObject *_res = NULL;
+	UInt16 _rv;
+	if (!PyArg_ParseTuple(_args, ""))
+		return NULL;
+	_rv = WEGetClickCount(_self->ob_itself);
+	_res = Py_BuildValue("h",
+	                     _rv);
+	return _res;
+}
+
 static PyObject *wasteObj_WESetSelection(_self, _args)
 	wasteObject *_self;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long selStart;
-	long selEnd;
+	SInt32 selStart;
+	SInt32 selEnd;
 	if (!PyArg_ParseTuple(_args, "ll",
 	                      &selStart,
 	                      &selEnd))
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long offset;
+	SInt32 offset;
 	WERunInfo runInfo;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
+	SInt32 _rv;
 	LongPt thePoint;
-	char edge;
+	WEEdge edge;
 	if (!PyArg_ParseTuple(_args, "O&",
 	                      LongPt_Convert, &thePoint))
 		return NULL;
 	_rv = WEGetOffset(&thePoint,
 	                  &edge,
 	                  _self->ob_itself);
-	_res = Py_BuildValue("lc",
+	_res = Py_BuildValue("lb",
 	                     _rv,
 	                     edge);
 	return _res;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long offset;
+	SInt32 offset;
+	SInt16 direction;
 	LongPt thePoint;
-	short lineHeight;
-	if (!PyArg_ParseTuple(_args, "l",
-	                      &offset))
+	SInt16 lineHeight;
+	if (!PyArg_ParseTuple(_args, "lh",
+	                      &offset,
+	                      &direction))
 		return NULL;
 	WEGetPoint(offset,
+	           direction,
 	           &thePoint,
 	           &lineHeight,
 	           _self->ob_itself);
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long offset;
-	char edge;
-	long wordStart;
-	long wordEnd;
-	if (!PyArg_ParseTuple(_args, "lc",
+	SInt32 offset;
+	WEEdge edge;
+	SInt32 wordStart;
+	SInt32 wordEnd;
+	if (!PyArg_ParseTuple(_args, "lb",
 	                      &offset,
 	                      &edge))
 		return NULL;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long offset;
-	char edge;
-	long lineStart;
-	long lineEnd;
-	if (!PyArg_ParseTuple(_args, "lc",
+	SInt32 offset;
+	WEEdge edge;
+	SInt32 lineStart;
+	SInt32 lineEnd;
+	if (!PyArg_ParseTuple(_args, "lb",
 	                      &offset,
 	                      &edge))
 		return NULL;
 {
 	PyObject *_res = NULL;
 	OSErr _err;
-	long rangeStart;
-	long rangeEnd;
+	SInt32 rangeStart;
+	SInt32 rangeEnd;
 	Handle hText;
 	StScrpHandle hStyles;
 	WESoupHandle hSoup;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long hOffset;
-	long vOffset;
+	SInt32 hOffset;
+	SInt32 vOffset;
 	if (!PyArg_ParseTuple(_args, "ll",
 	                      &hOffset,
 	                      &vOffset))
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	short key;
+	SInt16 key;
 	EventModifiers modifiers;
 	if (!PyArg_ParseTuple(_args, "hh",
 	                      &key,
 	PyObject *_res = NULL;
 	Point hitPt;
 	EventModifiers modifiers;
-	unsigned long clickTime;
+	UInt32 clickTime;
 	if (!PyArg_ParseTuple(_args, "O&hl",
 	                      PyMac_GetPoint, &hitPt,
 	                      &modifiers,
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	unsigned long maxSleep;
+	UInt32 maxSleep;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	WEIdle(&maxSleep,
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	unsigned long _rv;
+	UInt32 _rv;
 	if (!PyArg_ParseTuple(_args, ""))
 		return NULL;
 	_rv = WEGetModCount(_self->ob_itself);
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	long _rv;
-	long offset;
+	SInt32 _rv;
+	SInt32 offset;
 	WEObjectReference obj;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 {
 	PyObject *_res = NULL;
 	RgnHandle _rv;
-	long rangeStart;
-	long rangeEnd;
+	SInt32 rangeStart;
+	SInt32 rangeEnd;
 	if (!PyArg_ParseTuple(_args, "ll",
 	                      &rangeStart,
 	                      &rangeEnd))
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	short _rv;
-	long offset;
+	SInt16 _rv;
+	SInt32 offset;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 		return NULL;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	short _rv;
-	long offset;
+	SInt16 _rv;
+	SInt32 offset;
 	if (!PyArg_ParseTuple(_args, "l",
 	                      &offset))
 		return NULL;
 	PyObject *_args;
 {
 	PyObject *_res = NULL;
-	short _rv;
-	short feature;
-	short action;
+	SInt16 _rv;
+	SInt16 feature;
+	SInt16 action;
 	if (!PyArg_ParseTuple(_args, "hh",
 	                      &feature,
 	                      &action))
 	{"WEGetText", (PyCFunction)wasteObj_WEGetText, 1,
 	 "() -> (Handle _rv)"},
 	{"WEGetChar", (PyCFunction)wasteObj_WEGetChar, 1,
-	 "(long offset) -> (short _rv)"},
+	 "(SInt32 offset) -> (SInt16 _rv)"},
 	{"WEGetTextLength", (PyCFunction)wasteObj_WEGetTextLength, 1,
-	 "() -> (long _rv)"},
+	 "() -> (SInt32 _rv)"},
 	{"WECountLines", (PyCFunction)wasteObj_WECountLines, 1,
-	 "() -> (long _rv)"},
+	 "() -> (SInt32 _rv)"},
 	{"WEGetHeight", (PyCFunction)wasteObj_WEGetHeight, 1,
-	 "(long startLine, long endLine) -> (long _rv)"},
+	 "(SInt32 startLine, SInt32 endLine) -> (SInt32 _rv)"},
 	{"WEGetSelection", (PyCFunction)wasteObj_WEGetSelection, 1,
-	 "() -> (long selStart, long selEnd)"},
+	 "() -> (SInt32 selStart, SInt32 selEnd)"},
 	{"WEGetDestRect", (PyCFunction)wasteObj_WEGetDestRect, 1,
 	 "() -> (LongRect destRect)"},
 	{"WEGetViewRect", (PyCFunction)wasteObj_WEGetViewRect, 1,
 	{"WEIsActive", (PyCFunction)wasteObj_WEIsActive, 1,
 	 "() -> (Boolean _rv)"},
 	{"WEOffsetToLine", (PyCFunction)wasteObj_WEOffsetToLine, 1,
-	 "(long offset) -> (long _rv)"},
+	 "(SInt32 offset) -> (SInt32 _rv)"},
 	{"WEGetLineRange", (PyCFunction)wasteObj_WEGetLineRange, 1,
-	 "(long lineNo) -> (long lineStart, long lineEnd)"},
+	 "(SInt32 lineNo) -> (SInt32 lineStart, SInt32 lineEnd)"},
+	{"WEGetClickCount", (PyCFunction)wasteObj_WEGetClickCount, 1,
+	 "() -> (UInt16 _rv)"},
 	{"WESetSelection", (PyCFunction)wasteObj_WESetSelection, 1,
-	 "(long selStart, long selEnd) -> None"},
+	 "(SInt32 selStart, SInt32 selEnd) -> None"},
 	{"WESetDestRect", (PyCFunction)wasteObj_WESetDestRect, 1,
 	 "(LongRect destRect) -> None"},
 	{"WESetViewRect", (PyCFunction)wasteObj_WESetViewRect, 1,
 	{"WEContinuousStyle", (PyCFunction)wasteObj_WEContinuousStyle, 1,
 	 "(WEStyleMode mode) -> (Boolean _rv, WEStyleMode mode, TextStyle ts)"},
 	{"WEGetRunInfo", (PyCFunction)wasteObj_WEGetRunInfo, 1,
-	 "(long offset) -> (WERunInfo runInfo)"},
+	 "(SInt32 offset) -> (WERunInfo runInfo)"},
 	{"WEGetOffset", (PyCFunction)wasteObj_WEGetOffset, 1,
-	 "(LongPt thePoint) -> (long _rv, char edge)"},
+	 "(LongPt thePoint) -> (SInt32 _rv, WEEdge edge)"},
 	{"WEGetPoint", (PyCFunction)wasteObj_WEGetPoint, 1,
-	 "(long offset) -> (LongPt thePoint, short lineHeight)"},
+	 "(SInt32 offset, SInt16 direction) -> (LongPt thePoint, SInt16 lineHeight)"},
 	{"WEFindWord", (PyCFunction)wasteObj_WEFindWord, 1,
-	 "(long offset, char edge) -> (long wordStart, long wordEnd)"},
+	 "(SInt32 offset, WEEdge edge) -> (SInt32 wordStart, SInt32 wordEnd)"},
 	{"WEFindLine", (PyCFunction)wasteObj_WEFindLine, 1,
-	 "(long offset, char edge) -> (long lineStart, long lineEnd)"},
+	 "(SInt32 offset, WEEdge edge) -> (SInt32 lineStart, SInt32 lineEnd)"},
 	{"WECopyRange", (PyCFunction)wasteObj_WECopyRange, 1,
-	 "(long rangeStart, long rangeEnd, Handle hText, StScrpHandle hStyles, WESoupHandle hSoup) -> None"},
+	 "(SInt32 rangeStart, SInt32 rangeEnd, Handle hText, StScrpHandle hStyles, WESoupHandle hSoup) -> None"},
 	{"WEGetAlignment", (PyCFunction)wasteObj_WEGetAlignment, 1,
 	 "() -> (WEAlignment _rv)"},
 	{"WESetAlignment", (PyCFunction)wasteObj_WESetAlignment, 1,
 	{"WEUpdate", (PyCFunction)wasteObj_WEUpdate, 1,
 	 "(RgnHandle updateRgn) -> None"},
 	{"WEScroll", (PyCFunction)wasteObj_WEScroll, 1,
-	 "(long hOffset, long vOffset) -> None"},
+	 "(SInt32 hOffset, SInt32 vOffset) -> None"},
 	{"WESelView", (PyCFunction)wasteObj_WESelView, 1,
 	 "() -> None"},
 	{"WEActivate", (PyCFunction)wasteObj_WEActivate, 1,
 	{"WEDeactivate", (PyCFunction)wasteObj_WEDeactivate, 1,
 	 "() -> None"},
 	{"WEKey", (PyCFunction)wasteObj_WEKey, 1,
-	 "(short key, EventModifiers modifiers) -> None"},
+	 "(SInt16 key, EventModifiers modifiers) -> None"},
 	{"WEClick", (PyCFunction)wasteObj_WEClick, 1,
-	 "(Point hitPt, EventModifiers modifiers, unsigned long clickTime) -> None"},
+	 "(Point hitPt, EventModifiers modifiers, UInt32 clickTime) -> None"},
 	{"WEAdjustCursor", (PyCFunction)wasteObj_WEAdjustCursor, 1,
 	 "(Point mouseLoc, RgnHandle mouseRgn) -> (Boolean _rv)"},
 	{"WEIdle", (PyCFunction)wasteObj_WEIdle, 1,
-	 "() -> (unsigned long maxSleep)"},
+	 "() -> (UInt32 maxSleep)"},
 	{"WEInsert", (PyCFunction)wasteObj_WEInsert, 1,
 	 "(Buffer pText, StScrpHandle hStyles, WESoupHandle hSoup) -> None"},
 	{"WEDelete", (PyCFunction)wasteObj_WEDelete, 1,
 	{"WEIsTyping", (PyCFunction)wasteObj_WEIsTyping, 1,
 	 "() -> (Boolean _rv)"},
 	{"WEGetModCount", (PyCFunction)wasteObj_WEGetModCount, 1,
-	 "() -> (unsigned long _rv)"},
+	 "() -> (UInt32 _rv)"},
 	{"WEResetModCount", (PyCFunction)wasteObj_WEResetModCount, 1,
 	 "() -> None"},
 	{"WEInsertObject", (PyCFunction)wasteObj_WEInsertObject, 1,
 	{"WEGetSelectedObject", (PyCFunction)wasteObj_WEGetSelectedObject, 1,
 	 "() -> (WEObjectReference obj)"},
 	{"WEFindNextObject", (PyCFunction)wasteObj_WEFindNextObject, 1,
-	 "(long offset) -> (long _rv, WEObjectReference obj)"},
+	 "(SInt32 offset) -> (SInt32 _rv, WEObjectReference obj)"},
 	{"WEUseSoup", (PyCFunction)wasteObj_WEUseSoup, 1,
 	 "(WESoupHandle hSoup) -> None"},
 	{"WECut", (PyCFunction)wasteObj_WECut, 1,
 	{"WECanPaste", (PyCFunction)wasteObj_WECanPaste, 1,
 	 "() -> (Boolean _rv)"},
 	{"WEGetHiliteRgn", (PyCFunction)wasteObj_WEGetHiliteRgn, 1,
-	 "(long rangeStart, long rangeEnd) -> (RgnHandle _rv)"},
+	 "(SInt32 rangeStart, SInt32 rangeEnd) -> (RgnHandle _rv)"},
 	{"WECharByte", (PyCFunction)wasteObj_WECharByte, 1,
-	 "(long offset) -> (short _rv)"},
+	 "(SInt32 offset) -> (SInt16 _rv)"},
 	{"WECharType", (PyCFunction)wasteObj_WECharType, 1,
-	 "(long offset) -> (short _rv)"},
+	 "(SInt32 offset) -> (SInt16 _rv)"},
 	{"WEStopInlineSession", (PyCFunction)wasteObj_WEStopInlineSession, 1,
 	 "() -> None"},
 	{"WEFeatureFlag", (PyCFunction)wasteObj_WEFeatureFlag, 1,
-	 "(short feature, short action) -> (short _rv)"},
+	 "(SInt16 feature, SInt16 action) -> (SInt16 _rv)"},
 	{NULL, NULL, 0}
 };
 
 	OSErr _err;
 	LongRect destRect;
 	LongRect viewRect;
-	unsigned long flags;
+	UInt32 flags;
 	WEReference we;
 	if (!PyArg_ParseTuple(_args, "O&O&l",
 	                      LongRect_Convert, &destRect,
 {
 	PyObject *_res = NULL;
 	LongRect lr;
-	long left;
-	long top;
-	long right;
-	long bottom;
+	SInt32 left;
+	SInt32 top;
+	SInt32 right;
+	SInt32 bottom;
 	if (!PyArg_ParseTuple(_args, "llll",
 	                      &left,
 	                      &top,
 {
 	PyObject *_res = NULL;
 	LongRect lr;
-	long hOffset;
-	long vOffset;
+	SInt32 hOffset;
+	SInt32 vOffset;
 	if (!PyArg_ParseTuple(_args, "ll",
 	                      &hOffset,
 	                      &vOffset))
 
 static PyMethodDef waste_methods[] = {
 	{"WENew", (PyCFunction)waste_WENew, 1,
-	 "(LongRect destRect, LongRect viewRect, unsigned long flags) -> (WEReference we)"},
+	 "(LongRect destRect, LongRect viewRect, UInt32 flags) -> (WEReference we)"},
 	{"WEInstallTSMHandlers", (PyCFunction)waste_WEInstallTSMHandlers, 1,
 	 "() -> None"},
 	{"WERemoveTSMHandlers", (PyCFunction)waste_WERemoveTSMHandlers, 1,
 	{"WEPointToLongPoint", (PyCFunction)waste_WEPointToLongPoint, 1,
 	 "(Point p) -> (LongPt lp)"},
 	{"WESetLongRect", (PyCFunction)waste_WESetLongRect, 1,
-	 "(long left, long top, long right, long bottom) -> (LongRect lr)"},
+	 "(SInt32 left, SInt32 top, SInt32 right, SInt32 bottom) -> (LongRect lr)"},
 	{"WELongRectToRect", (PyCFunction)waste_WELongRectToRect, 1,
 	 "(LongRect lr) -> (Rect r)"},
 	{"WERectToLongRect", (PyCFunction)waste_WERectToLongRect, 1,
 	 "(Rect r) -> (LongRect lr)"},
 	{"WEOffsetLongRect", (PyCFunction)waste_WEOffsetLongRect, 1,
-	 "(long hOffset, long vOffset) -> (LongRect lr)"},
+	 "(SInt32 hOffset, SInt32 vOffset) -> (LongRect lr)"},
 	{"WELongPointInLongRect", (PyCFunction)waste_WELongPointInLongRect, 1,
 	 "(LongPt lp, LongRect lr) -> (Boolean _rv)"},
 	{"STDObjectHandlers", (PyCFunction)waste_STDObjectHandlers, 1,

File Mac/Modules/waste/wastescan.py

 from scantools import Scanner
 from bgenlocations import TOOLBOXDIR
 
-WASTEDIR=":::::Waste 1.2a5:"
+WASTEDIR=":::::Waste 1.2 distribution:"
 
 OBJECT = "TEHandle"
 SHORT = "waste"
 
 class MyScanner(Scanner):
 
-	def initpatterns(self):
-		# Waste doesn't use 'extern':
-		Scanner.initpatterns(self)
-		self.head_pat = "^pascal[ \t]+"
-
 	def destination(self, type, name, arglist):
 		classname = "Function"
 		listname = "functions"
 			"WEDispose",
 			"WESetInfo", # Argument type unknown...
 			"WEGetInfo",
+			"WEVersion", # Unfortunately...
 			]
 
 	def makeblacklisttypes(self):
 
 	def makerepairinstructions(self):
 		return [
-			([("void_ptr", "*", "InMode"), ("long", "*", "InMode")],
+			([("void_ptr", "*", "InMode"), ("SInt32", "*", "InMode")],
 			 [("InBuffer", "*", "*")]),
 
 			# WEContinuousStyle

File Mac/Modules/waste/wastesupport.py

 WEStyleMode = Type("WEStyleMode", "h")
 WEActionKind = Type("WEActionKind", "h")
 WEAlignment = Type("WEAlignment", "b")
+WEEdge = Type("WEEdge", "b")
 WESoupHandle = OpaqueByValueType("WESoupHandle", "ResObj")
 WERunInfo = OpaqueType("WERunInfo", "RunInfo")