From: Wolfgang T. <wth...@us...> - 2005-10-05 03:14:47
|
Update of /cvsroot/hoc/hoc/Bindings/AdditionalCode/Foundation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8803/Bindings/AdditionalCode/Foundation Modified Files: NSGeometry.hs NSRange.hs Log Message: Recognize the pointer typedefs for the usual struct types (NSRangePointer, etc.). This lets ifgen handle the methods of NSAttributedString, for instance. Patch contributed by Matthew Morgan <mat...@gm...> Index: NSGeometry.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Bindings/AdditionalCode/Foundation/NSGeometry.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- NSGeometry.hs 27 Sep 2005 11:55:22 -0000 1.2 +++ NSGeometry.hs 5 Oct 2005 03:14:39 -0000 1.3 @@ -6,6 +6,9 @@ --X NSPoint(..) --X NSSize(..) --X NSRect(..) +--X NSPointPointer +--X NSRectPointer +--X NSSizePointer --X nsMaxX --X nsMaxY --X nsMidX @@ -26,6 +29,10 @@ data NSSize = NSSize Float Float deriving(Read, Show, Eq) data NSRect = NSRect NSPoint NSSize deriving(Read, Show, Eq) +type NSPointPointer = Ptr NSPoint +type NSSizePointer = Ptr NSSize +type NSRectPointer = Ptr NSRect + {- -- They're imported automatically now. nsZeroPoint = NSPoint 0 0 Index: NSRange.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Bindings/AdditionalCode/Foundation/NSRange.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- NSRange.hs 30 Sep 2005 06:09:18 -0000 1.1 +++ NSRange.hs 5 Oct 2005 03:14:39 -0000 1.2 @@ -4,6 +4,7 @@ -- CUT HERE -- above NSRange.Forward --X NSRange(..) +--X NSRangePointer --X nsMaxRange --X nsLocationInRange --X nsNotFound @@ -17,6 +18,8 @@ data NSRange = NSRange CUInt CUInt deriving(Read, Show, Eq) +type NSRangePointer = Ptr NSRange + nsMaxRange (NSRange loc len) = loc + len nsLocationInRange x (NSRange loc len) = x >= loc && x < loc+len nsNotFound = 0x7fffffff :: CUInt |