[Python-checkins] CVS: python/dist/src/Mac/Modules/mlte _Mltemodule.c,1.7,1.8

Jack Jansen jackjansen@users.sourceforge.net
Tue, 18 Dec 2001 07:37:11 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte
In directory usw-pr-cvs1:/tmp/cvs-serv15224/python/Mac/Modules/mlte

Modified Files:
	_Mltemodule.c 
Log Message:
Updated to Universal Headers 3.4

Index: _Mltemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/mlte/_Mltemodule.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** _Mltemodule.c	2001/12/14 23:02:59	1.7
--- _Mltemodule.c	2001/12/18 15:37:09	1.8
***************
*** 6,11 ****
--- 6,15 ----
  
  
+ #ifdef _WIN32
+ #include "pywintoolbox.h"
+ #else
  #include "macglue.h"
  #include "pymactoolbox.h"
+ #endif
  
  /* Macro to test whether a weak-loaded CFM function exists */
***************
*** 242,246 ****
  }
  
! #if 0
  
  static PyObject *TXNObj_TXNTSMCheck(TXNObjectObject *_self, PyObject *_args)
--- 246,250 ----
  }
  
! #if TARGET_API_MAC_OS8
  
  static PyObject *TXNObj_TXNTSMCheck(TXNObjectObject *_self, PyObject *_args)
***************
*** 248,262 ****
  	PyObject *_res = NULL;
  	Boolean _rv;
! 	EventRecord iEvent;
  #ifndef TXNTSMCheck
  	PyMac_PRECHECK(TXNTSMCheck);
  #endif
! 	if (!PyArg_ParseTuple(_args, "O&",
! 	                      PyMac_GetEventRecord, &iEvent))
  		return NULL;
  	_rv = TXNTSMCheck(_self->ob_itself,
! 	                  &iEvent);
! 	_res = Py_BuildValue("b",
! 	                     _rv);
  	return _res;
  }
--- 252,266 ----
  	PyObject *_res = NULL;
  	Boolean _rv;
! 	EventRecord ioEvent;
  #ifndef TXNTSMCheck
  	PyMac_PRECHECK(TXNTSMCheck);
  #endif
! 	if (!PyArg_ParseTuple(_args, ""))
  		return NULL;
  	_rv = TXNTSMCheck(_self->ob_itself,
! 	                  &ioEvent);
! 	_res = Py_BuildValue("bO&",
! 	                     _rv,
! 	                     PyMac_BuildEventRecord, &ioEvent);
  	return _res;
  }
***************
*** 607,612 ****
  	PyObject *_res = NULL;
  	OSStatus _err;
! 	UInt32 iStartOffset;
! 	UInt32 iEndOffset;
  	ItemCount oRunCount;
  #ifndef TXNCountRunsInRange
--- 611,616 ----
  	PyObject *_res = NULL;
  	OSStatus _err;
! 	TXNOffset iStartOffset;
! 	TXNOffset iEndOffset;
  	ItemCount oRunCount;
  #ifndef TXNCountRunsInRange
***************
*** 774,778 ****
  	PyObject *_res = NULL;
  	OSStatus _err;
! 	OSType iType;
  	OSType iResType;
  	TXNPermanentTextEncodingType iPermanentEncoding;
--- 778,782 ----
  	PyObject *_res = NULL;
  	OSStatus _err;
! 	TXNFileType iType;
  	OSType iResType;
  	TXNPermanentTextEncodingType iPermanentEncoding;
***************
*** 868,871 ****
--- 872,892 ----
  }
  
+ static PyObject *TXNObj_TXNSetViewRect(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	Rect iViewRect;
+ #ifndef TXNSetViewRect
+ 	PyMac_PRECHECK(TXNSetViewRect);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, "O&",
+ 	                      PyMac_GetRect, &iViewRect))
+ 		return NULL;
+ 	TXNSetViewRect(_self->ob_itself,
+ 	               &iViewRect);
+ 	Py_INCREF(Py_None);
+ 	_res = Py_None;
+ 	return _res;
+ }
+ 
  static PyObject *TXNObj_TXNAttachObjectToWindow(TXNObjectObject *_self, PyObject *_args)
  {
***************
*** 1030,1033 ****
--- 1051,1159 ----
  }
  
+ static PyObject *TXNObj_TXNPointToOffset(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	OSStatus _err;
+ 	Point iPoint;
+ 	TXNOffset oOffset;
+ #ifndef TXNPointToOffset
+ 	PyMac_PRECHECK(TXNPointToOffset);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, "O&",
+ 	                      PyMac_GetPoint, &iPoint))
+ 		return NULL;
+ 	_err = TXNPointToOffset(_self->ob_itself,
+ 	                        iPoint,
+ 	                        &oOffset);
+ 	if (_err != noErr) return PyMac_Error(_err);
+ 	_res = Py_BuildValue("l",
+ 	                     oOffset);
+ 	return _res;
+ }
+ 
+ static PyObject *TXNObj_TXNOffsetToPoint(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	OSStatus _err;
+ 	TXNOffset iOffset;
+ 	Point oPoint;
+ #ifndef TXNOffsetToPoint
+ 	PyMac_PRECHECK(TXNOffsetToPoint);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, "l",
+ 	                      &iOffset))
+ 		return NULL;
+ 	_err = TXNOffsetToPoint(_self->ob_itself,
+ 	                        iOffset,
+ 	                        &oPoint);
+ 	if (_err != noErr) return PyMac_Error(_err);
+ 	_res = Py_BuildValue("O&",
+ 	                     PyMac_BuildPoint, oPoint);
+ 	return _res;
+ }
+ 
+ static PyObject *TXNObj_TXNGetLineCount(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	OSStatus _err;
+ 	ItemCount oLineTotal;
+ #ifndef TXNGetLineCount
+ 	PyMac_PRECHECK(TXNGetLineCount);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, ""))
+ 		return NULL;
+ 	_err = TXNGetLineCount(_self->ob_itself,
+ 	                       &oLineTotal);
+ 	if (_err != noErr) return PyMac_Error(_err);
+ 	_res = Py_BuildValue("l",
+ 	                     oLineTotal);
+ 	return _res;
+ }
+ 
+ static PyObject *TXNObj_TXNGetLineMetrics(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	OSStatus _err;
+ 	UInt32 iLineNumber;
+ 	Fixed oLineWidth;
+ 	Fixed oLineHeight;
+ #ifndef TXNGetLineMetrics
+ 	PyMac_PRECHECK(TXNGetLineMetrics);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, "l",
+ 	                      &iLineNumber))
+ 		return NULL;
+ 	_err = TXNGetLineMetrics(_self->ob_itself,
+ 	                         iLineNumber,
+ 	                         &oLineWidth,
+ 	                         &oLineHeight);
+ 	if (_err != noErr) return PyMac_Error(_err);
+ 	_res = Py_BuildValue("O&O&",
+ 	                     PyMac_BuildFixed, oLineWidth,
+ 	                     PyMac_BuildFixed, oLineHeight);
+ 	return _res;
+ }
+ 
+ static PyObject *TXNObj_TXNIsObjectAttachedToSpecificWindow(TXNObjectObject *_self, PyObject *_args)
+ {
+ 	PyObject *_res = NULL;
+ 	OSStatus _err;
+ 	WindowPtr iWindow;
+ 	Boolean oAttached;
+ #ifndef TXNIsObjectAttachedToSpecificWindow
+ 	PyMac_PRECHECK(TXNIsObjectAttachedToSpecificWindow);
+ #endif
+ 	if (!PyArg_ParseTuple(_args, "O&",
+ 	                      WinObj_Convert, &iWindow))
+ 		return NULL;
+ 	_err = TXNIsObjectAttachedToSpecificWindow(_self->ob_itself,
+ 	                                           iWindow,
+ 	                                           &oAttached);
+ 	if (_err != noErr) return PyMac_Error(_err);
+ 	_res = Py_BuildValue("b",
+ 	                     oAttached);
+ 	return _res;
+ }
+ 
  static PyMethodDef TXNObj_methods[] = {
  	{"TXNDeleteObject", (PyCFunction)TXNObj_TXNDeleteObject, 1,
***************
*** 1044,1050 ****
  	 "(EventRecord iEvent) -> None"},
  
! #if 0
  	{"TXNTSMCheck", (PyCFunction)TXNObj_TXNTSMCheck, 1,
! 	 "(EventRecord iEvent) -> (Boolean _rv)"},
  #endif
  	{"TXNSelectAll", (PyCFunction)TXNObj_TXNSelectAll, 1,
--- 1170,1176 ----
  	 "(EventRecord iEvent) -> None"},
  
! #if TARGET_API_MAC_OS8
  	{"TXNTSMCheck", (PyCFunction)TXNObj_TXNTSMCheck, 1,
! 	 "() -> (Boolean _rv, EventRecord ioEvent)"},
  #endif
  	{"TXNSelectAll", (PyCFunction)TXNObj_TXNSelectAll, 1,
***************
*** 1091,1095 ****
  	 "(TXNOffset iStartOffset, TXNOffset iEndOffset) -> None"},
  	{"TXNCountRunsInRange", (PyCFunction)TXNObj_TXNCountRunsInRange, 1,
! 	 "(UInt32 iStartOffset, UInt32 iEndOffset) -> (ItemCount oRunCount)"},
  	{"TXNDataSize", (PyCFunction)TXNObj_TXNDataSize, 1,
  	 "() -> (ByteCount _rv)"},
--- 1217,1221 ----
  	 "(TXNOffset iStartOffset, TXNOffset iEndOffset) -> None"},
  	{"TXNCountRunsInRange", (PyCFunction)TXNObj_TXNCountRunsInRange, 1,
! 	 "(TXNOffset iStartOffset, TXNOffset iEndOffset) -> (ItemCount oRunCount)"},
  	{"TXNDataSize", (PyCFunction)TXNObj_TXNDataSize, 1,
  	 "() -> (ByteCount _rv)"},
***************
*** 1105,1109 ****
  	 "() -> (ItemCount _rv)"},
  	{"TXNSave", (PyCFunction)TXNObj_TXNSave, 1,
! 	 "(OSType iType, OSType iResType, TXNPermanentTextEncodingType iPermanentEncoding, FSSpec iFileSpecification, SInt16 iDataReference, SInt16 iResourceReference) -> None"},
  	{"TXNRevert", (PyCFunction)TXNObj_TXNRevert, 1,
  	 "() -> None"},
--- 1231,1235 ----
  	 "() -> (ItemCount _rv)"},
  	{"TXNSave", (PyCFunction)TXNObj_TXNSave, 1,
! 	 "(TXNFileType iType, OSType iResType, TXNPermanentTextEncodingType iPermanentEncoding, FSSpec iFileSpecification, SInt16 iDataReference, SInt16 iResourceReference) -> None"},
  	{"TXNRevert", (PyCFunction)TXNObj_TXNRevert, 1,
  	 "() -> None"},
***************
*** 1114,1117 ****
--- 1240,1245 ----
  	{"TXNGetViewRect", (PyCFunction)TXNObj_TXNGetViewRect, 1,
  	 "() -> (Rect oViewRect)"},
+ 	{"TXNSetViewRect", (PyCFunction)TXNObj_TXNSetViewRect, 1,
+ 	 "(Rect iViewRect) -> None"},
  	{"TXNAttachObjectToWindow", (PyCFunction)TXNObj_TXNAttachObjectToWindow, 1,
  	 "(GWorldPtr iWindow, Boolean iIsActualWindow) -> None"},
***************
*** 1128,1131 ****
--- 1256,1269 ----
  	{"TXNPrepareFontMenu", (PyCFunction)TXNObj_TXNPrepareFontMenu, 1,
  	 "(TXNFontMenuObject iTXNFontMenuObject) -> None"},
+ 	{"TXNPointToOffset", (PyCFunction)TXNObj_TXNPointToOffset, 1,
+ 	 "(Point iPoint) -> (TXNOffset oOffset)"},
+ 	{"TXNOffsetToPoint", (PyCFunction)TXNObj_TXNOffsetToPoint, 1,
+ 	 "(TXNOffset iOffset) -> (Point oPoint)"},
+ 	{"TXNGetLineCount", (PyCFunction)TXNObj_TXNGetLineCount, 1,
+ 	 "() -> (ItemCount oLineTotal)"},
+ 	{"TXNGetLineMetrics", (PyCFunction)TXNObj_TXNGetLineMetrics, 1,
+ 	 "(UInt32 iLineNumber) -> (Fixed oLineWidth, Fixed oLineHeight)"},
+ 	{"TXNIsObjectAttachedToSpecificWindow", (PyCFunction)TXNObj_TXNIsObjectAttachedToSpecificWindow, 1,
+ 	 "(WindowPtr iWindow) -> (Boolean oAttached)"},
  	{NULL, NULL, 0}
  };