Update of /cvsroot/gtk2hs/gtk2hs/gtk/misc In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/misc Modified Files: Adjustment.chs Arrow.chs Calendar.chs DrawingArea.chs EventBox.chs HandleBox.chs Tooltips.chs Viewport.chs Log Message: Make compile with GHC 6.00. There are two major changes in the FFI which made me separate everything that has to do with Foreign and Foreign.C into a new file called general/FFI.hs. The file UTFCForeign.hs is now obsolete as its string conversion functions are now in FFI.hs. The nullForeignPtr function is also located here. All files now import FFI instead of Foreign and UTFCForeign. The major changes are: newForeignPtr now takes a pointer to a C function as finalizer. Every destructor function is now defined differently depending on whether the new GHC is used or not. In particular there is now a function called free :: Ptr a -> IO () imported from the Foreign library. In addition to that I defined a function foreignFree which can be used as finalizer to a C data structure. It is equivalent to free if GHC version <=5.04 is used. The second change is that ForeignPtr are no longer accepted as arguments to foreign calls. This change is mainly reflected in c2hs, but also in some files which directly called functions. Index: Adjustment.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Adjustment.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Adjustment.chs 24 May 2002 09:43:25 -0000 1.2 +++ Adjustment.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -43,8 +43,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Arrow.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Arrow.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Arrow.chs 24 May 2002 09:43:25 -0000 1.2 +++ Arrow.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -39,8 +39,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Calendar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Calendar.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Calendar.chs 24 May 2002 09:43:25 -0000 1.2 +++ Calendar.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -57,8 +57,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -199,4 +199,4 @@ onPrevYear = connect_NONE__NONE "prev-year" False afterPrevYear = connect_NONE__NONE "prev-year" True - \ No newline at end of file + Index: DrawingArea.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/DrawingArea.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DrawingArea.chs 8 Nov 2002 10:39:21 -0000 1.3 +++ DrawingArea.chs 9 Jul 2003 22:42:45 -0000 1.4 @@ -47,8 +47,8 @@ drawingAreaGetSize) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: EventBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/EventBox.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EventBox.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ EventBox.chs 9 Jul 2003 22:42:45 -0000 1.4 @@ -39,8 +39,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: HandleBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/HandleBox.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- HandleBox.chs 8 Nov 2002 10:39:21 -0000 1.5 +++ HandleBox.chs 9 Jul 2003 22:42:45 -0000 1.6 @@ -64,8 +64,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Tooltips.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Tooltips.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Tooltips.chs 6 Oct 2002 16:14:08 -0000 1.4 +++ Tooltips.chs 9 Jul 2003 22:42:45 -0000 1.5 @@ -58,8 +58,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -108,7 +108,7 @@ tooltipsSetTip :: (TooltipsClass t, WidgetClass w) => t -> w -> String -> String -> IO () tooltipsSetTip t w tipText tipPrivate = - withCString tipPrivate $ \priPtr -> - withCString tipText $ \txtPtr -> + withUTFString tipPrivate $ \priPtr -> + withUTFString tipText $ \txtPtr -> {#call unsafe tooltips_set_tip#} (toTooltips t) (toWidget w) txtPtr priPtr Index: Viewport.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/Viewport.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Viewport.chs 8 Nov 2002 10:39:21 -0000 1.4 +++ Viewport.chs 9 Jul 2003 22:42:45 -0000 1.5 @@ -52,8 +52,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} |