-- GENERATED by C->Haskell Compiler, version 0.16.0 Crystal Seed, 24 Jan 2009 (Haskell)-- Edit the ORIGNAL .chs file instead!{-# LINE 1 "./Algebra/Geometric/Strip.chs" #-}{-# LANGUAGE ForeignFunctionInterface #-}-- Strip.chs-- hgeometric: A geometric library with bindings to GPC.-- Strip.chs is part of hgeometric.-- Copyright 2007, 2009 Marco Túlio Gontijo e Silva-- Copyright 2007, 2009 Rafael Cunha de Almeida-- See LICENSE-- | 'Strip' data type and convertions.moduleAlgebra.Geometric.Strip(-- * Data TypeStrip(StripC,stripSet),-- * ConvertionsafePolygonToStrip,polygonToStrip)whereimportData.Sethiding(map)importControl.MonadimportForeignimportForeign.CimportAlgebra.Geometric.ContourimportAlgebra.Geometric.Polygon{-# LINE 31 "./Algebra/Geometric/Strip.chs" #-}typeCContour=Ptr(Contour){-# LINE 33 "./Algebra/Geometric/Strip.chs" #-}typeCPolygon=Ptr(Polygon){-# LINE 34 "./Algebra/Geometric/Strip.chs" #-}typeCStrip=Ptr(Strip){-# LINE 35 "./Algebra/Geometric/Strip.chs" #-}-- | A 'Strip' is an alternative form of representing a 'Polygon' composed-- by 'Contour's that are not holes. It's a good idea to use it to draw filled-- figures, and to use 'Polygon' to draw the 'Contour's.newtypeStrip=StripC{stripSet::SetContour}derivingShowinstanceStorableStripwheresizeOf_=8{-# LINE 43 "./Algebra/Geometric/Strip.chs" #-}alignment_=alignment(undefined::Int)peekcStrip=(StripC.fromList)`liftM`donumStrips<-fromIntegral`liftM`(\ptr->do{peekByteOffptr0::IOCInt})cStrip(\ptr->do{peekByteOffptr4::IO(CContour)})cStrip>>=peekArraynumStripspokecStrip(StripCstrip)=(\ptrval->do{pokeByteOffptr0(val::CInt)})cStrip(fromIntegral$sizestrip)>>newArray(toListstrip)>>=(\ptrval->do{pokeByteOffptr4(val::(CContour))})cStrip-- | An 'IO' version of 'polygonToStrip', which does not use 'unsafePerformIO'.safePolygonToStrip::Polygon->IOStripsafePolygonToStrippolygon=alloca$\cStrip->alloca$\cPolygon->dopokecPolygonpolygongpc_polygon_to_tristripcPolygoncStripresult<-peekcStripgpc_free_polygoncPolygongpc_free_tristripcStripreturnresult-- | Converts a 'Polygon' to a 'Strip'.polygonToStrip::Polygon->StrippolygonToStrip=unsafePerformIO.safePolygonToStripforeignimportccallunsafe"Algebra/Geometric/Strip.chs.h gpc_polygon_to_tristrip"gpc_polygon_to_tristrip::((CPolygon)->((CStrip)->(IO())))foreignimportccallunsafe"Algebra/Geometric/Strip.chs.h gpc_free_polygon"gpc_free_polygon::((CPolygon)->(IO()))foreignimportccallunsafe"Algebra/Geometric/Strip.chs.h gpc_free_tristrip"gpc_free_tristrip::((CStrip)->(IO()))