You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(68) |
Aug
(4) |
Sep
|
Oct
(23) |
Nov
(95) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
|
Mar
|
Apr
(51) |
May
(81) |
Jun
(2) |
Jul
(86) |
Aug
(143) |
Sep
(3) |
Oct
(31) |
Nov
(63) |
Dec
(90) |
2005 |
Jan
(277) |
Feb
(157) |
Mar
(99) |
Apr
(195) |
May
(151) |
Jun
(148) |
Jul
(98) |
Aug
(123) |
Sep
(20) |
Oct
(174) |
Nov
(155) |
Dec
(26) |
2006 |
Jan
(51) |
Feb
(19) |
Mar
(16) |
Apr
(12) |
May
(5) |
Jun
|
Jul
(11) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(174) |
Dec
(56) |
2007 |
Jan
(45) |
Feb
(52) |
Mar
(10) |
Apr
(5) |
May
(47) |
Jun
(16) |
Jul
(80) |
Aug
(29) |
Sep
(14) |
Oct
(59) |
Nov
(46) |
Dec
(16) |
2008 |
Jan
(10) |
Feb
(1) |
Mar
|
Apr
|
May
(49) |
Jun
(26) |
Jul
(8) |
Aug
(4) |
Sep
(25) |
Oct
(53) |
Nov
(9) |
Dec
(1) |
2009 |
Jan
(66) |
Feb
(11) |
Mar
(1) |
Apr
(14) |
May
(8) |
Jun
(1) |
Jul
(2) |
Aug
(2) |
Sep
(9) |
Oct
(23) |
Nov
(35) |
Dec
|
2010 |
Jan
(7) |
Feb
(2) |
Mar
(39) |
Apr
(19) |
May
(161) |
Jun
(19) |
Jul
(32) |
Aug
(65) |
Sep
(113) |
Oct
(120) |
Nov
(2) |
Dec
|
2012 |
Jan
|
Feb
(5) |
Mar
(4) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(12) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/pango In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/pango Modified Files: PangoLayout.chs PangoTypes.chs Rendering.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: PangoLayout.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/pango/PangoLayout.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- PangoLayout.chs 17 May 2003 22:57:07 -0000 1.5 +++ PangoLayout.chs 9 Jul 2003 22:42:45 -0000 1.6 @@ -95,8 +95,7 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI {#import Hierarchy#} import GObject (makeNewGObject) import Markup (Markup) @@ -134,20 +133,20 @@ -- @method layoutSetText@ Set the string in the layout. -- layoutSetText :: PangoLayout -> String -> IO () -layoutSetText pl txt = withCStringLen txt $ \(strPtr,len) -> +layoutSetText pl txt = withUTFStringLen txt $ \(strPtr,len) -> {#call unsafe layout_set_text#} pl strPtr (fromIntegral len) -- @method layoutGetText@ Retrieve the string in the layout. -- layoutGetText :: PangoLayout -> IO String -layoutGetText pl = {#call unsafe layout_get_text#} pl >>= peekCString +layoutGetText pl = {#call unsafe layout_get_text#} pl >>= peekUTFString -- @method layoutSetMarkup@ Set the string in the layout. -- -- * The string may include @ref data Markup@. -- layoutSetMarkup :: PangoLayout -> Markup -> IO () -layoutSetMarkup pl txt = withCStringLen txt $ \(strPtr,len) -> +layoutSetMarkup pl txt = withUTFStringLen txt $ \(strPtr,len) -> {#call unsafe layout_set_markup#} pl strPtr (fromIntegral len) -- @method layoutSetMarkupWithAccel@ Set the string in the layout. @@ -163,7 +162,7 @@ layoutSetMarkupWithAccel :: PangoLayout -> Markup -> IO Char layoutSetMarkupWithAccel pl txt = alloca $ \chrPtr -> - withCStringLen txt $ \(strPtr,len) -> do + withUTFStringLen txt $ \(strPtr,len) -> do {#call unsafe layout_set_markup_with_accel#} pl strPtr (fromIntegral len) (fromIntegral (ord '_')) chrPtr liftM (chr.fromIntegral) $ peek chrPtr Index: PangoTypes.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/pango/PangoTypes.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PangoTypes.chs 16 May 2003 22:25:16 -0000 1.2 +++ PangoTypes.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- GIMP Toolkit (GTK) - pango non-GObject types @entry PangoTypes@ -- -- Author : Axel Simon @@ -31,13 +32,12 @@ module PangoTypes( LayoutIter(LayoutIter), layout_iter_free, - LayoutLine, + LayoutLine(LayoutLine), mkLayoutLine ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI {# context lib="pango" prefix="pango" #} @@ -47,21 +47,65 @@ -- {#pointer *PangoLayoutIter as LayoutIter foreign newtype #} -foreign import ccall "pango_layout_iter_free" unsafe - layout_iter_free :: Ptr LayoutIter -> IO () - -- @data LayoutLine@ A single line in a @ref data PangoLayout@. -- {#pointer *PangoLayoutLine as LayoutLine foreign newtype #} -foreign import ccall "pango_layout_line_ref" unsafe - layout_line_ref :: Ptr LayoutLine -> IO () +mkLayoutLine :: Ptr LayoutLine -> IO LayoutLine +mkLayoutLine llPtr = do + pango_layout_line_ref llPtr + liftM LayoutLine $ newForeignPtr llPtr (pango_layout_line_unref llPtr) + + +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe "&pango_layout_iter_free" + layout_iter_free' :: FinalizerPtr LayoutIter + +layout_iter_free :: Ptr LayoutIter -> FinalizerPtr LayoutIter +layout_iter_free _ = layout_iter_free' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "pango_layout_iter_free" + layout_iter_free :: Ptr LayoutIter -> IO () + +#else + +foreign import ccall "pango_layout_iter_free" unsafe + layout_iter_free :: Ptr LayoutIter -> IO () + +#endif + +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe "&pango_layout_line_unref" + pango_layout_line_unref' :: FinalizerPtr LayoutLine + +pango_layout_line_unref :: Ptr LayoutLine -> FinalizerPtr LayoutLine +pango_layout_line_unref _ = pango_layout_line_unref' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "pango_layout_line_unref" + pango_layout_line_unref :: Ptr LayoutLine -> IO () + +#else foreign import ccall "pango_layout_line_unref" unsafe - layout_line_unref :: Ptr LayoutLine -> IO () + pango_layout_line_unref :: Ptr LayoutLine -> IO () -mkLayoutLine :: Ptr LayoutLine -> IO LayoutLine -mkLayoutLine llPtr = do - layout_line_ref llPtr - liftM LayoutLine $ newForeignPtr llPtr (layout_line_unref llPtr) +#endif + +#if __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "pango_layout_line_ref" + pango_layout_line_ref :: Ptr LayoutLine -> IO () + +#else + +foreign import ccall "pango_layout_line_ref" unsafe + pango_layout_line_ref :: Ptr LayoutLine -> IO () + +#endif Index: Rendering.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/pango/Rendering.chs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Rendering.chs 9 Feb 2003 10:43:01 -0000 1.1 +++ Rendering.chs 9 Jul 2003 22:42:45 -0000 1.2 @@ -36,8 +36,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + {#import Hierarchy#} import GObject (makeNewGObject) |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/windows In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/windows Modified Files: Dialog.chs FileSel.chs Window.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: Dialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/windows/Dialog.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Dialog.chs 10 Jan 2003 07:51:35 -0000 1.4 +++ Dialog.chs 9 Jul 2003 22:42:46 -0000 1.5 @@ -49,8 +49,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -96,7 +96,7 @@ -- * The function returns the Button that resulted from the call. -- dialogAddButton :: DialogClass dc => dc -> String -> ResponseId -> IO Button -dialogAddButton dc button resId = withCString button $ \strPtr -> +dialogAddButton dc button resId = withUTFString button $ \strPtr -> makeNewObject mkButton $ liftM castPtr $ {#call dialog_add_button#} (toDialog dc) strPtr (fromResponse resId) Index: FileSel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/windows/FileSel.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FileSel.chs 5 Aug 2002 16:41:35 -0000 1.4 +++ FileSel.chs 9 Jul 2003 22:42:46 -0000 1.5 @@ -45,8 +45,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + {#import Hierarchy#} import Object (makeNewObject) import Structs (fileSelectionGetButtons) @@ -62,7 +62,7 @@ -- fileSelectionNew :: String -> IO FileSelection fileSelectionNew title = do - withCString title $ \strPtr -> + withUTFString title $ \strPtr -> makeNewObject mkFileSelection $ liftM castPtr $ {#call unsafe file_selection_new#} strPtr @@ -71,7 +71,7 @@ -- fileSelectionSetFilename :: FileSelectionClass fsel => fsel -> String -> IO () fileSelectionSetFilename fsel str = - withCString str $ \strPtr -> + withUTFString str $ \strPtr -> {#call unsafe file_selection_set_filename#} (toFileSelection fsel) strPtr -- @method fileSelectionGetFilename@ Get the filename currently selected by @@ -82,7 +82,7 @@ do strPtr <- {#call unsafe file_selection_get_filename#} (toFileSelection fsel) - peekCString strPtr + peekUTFString strPtr -- @method fileSelectionShowFileopButtons@ Show the file operation buttons -- of the given file selection dialog. @@ -118,5 +118,5 @@ -- fileSelectionComplete :: FileSelectionClass fsel => fsel -> String -> IO () fileSelectionComplete fsel pattern = - withCString pattern $ \patternPtr -> + withUTFString pattern $ \patternPtr -> {#call file_selection_complete#} (toFileSelection fsel) patternPtr Index: Window.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/windows/Window.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Window.chs 5 Aug 2002 16:41:35 -0000 1.5 +++ Window.chs 9 Jul 2003 22:42:46 -0000 1.6 @@ -71,8 +71,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Enums (WindowType(WindowToplevel), WindowPosition(..)) import Object (makeNewObject) {#import Hierarchy#} @@ -93,7 +93,7 @@ -- windowSetTitle :: WindowClass w => w -> String -> IO () windowSetTitle w str = - withCString str ({#call window_set_title#} (toWindow w)) + withUTFString str ({#call window_set_title#} (toWindow w)) -- @method windowSetResizable@ Sets whether the user can resize a window. -- @@ -225,7 +225,7 @@ -- windowSetRole :: WindowClass w => w -> String -> IO () windowSetRole w str = - withCString str ({#call window_set_role#} (toWindow w)) + withUTFString str ({#call window_set_role#} (toWindow w)) -- @method windowStick@ show the window on every workspace -- |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/ornaments In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/ornaments Modified Files: Frame.chs HSeparator.chs VSeparator.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: Frame.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/Frame.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Frame.chs 24 May 2002 09:43:25 -0000 1.2 +++ Frame.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -43,8 +43,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -65,7 +65,7 @@ -- @method frameSetLabel@ Replace the label of the frame. -- frameSetLabel :: FrameClass f => f -> String -> IO () -frameSetLabel f label = withCString label $ \strPtr -> +frameSetLabel f label = withUTFString label $ \strPtr -> {#call frame_set_label#} (toFrame f) strPtr -- @method frameSetLabelWidget@ Replace the label with a (label) widget. @@ -98,7 +98,7 @@ strPtr <- throwIfNull "frameGetLabel: the title of the frame was not a Label widget." $ {#call unsafe frame_get_label#} (toFrame f) - res <- peekCString strPtr + res <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) return res Index: HSeparator.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/HSeparator.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HSeparator.chs 24 May 2002 09:43:25 -0000 1.2 +++ HSeparator.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -40,8 +40,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: VSeparator.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/VSeparator.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- VSeparator.chs 24 May 2002 09:43:25 -0000 1.2 +++ VSeparator.chs 9 Jul 2003 22:42:45 -0000 1.3 @@ -40,8 +40,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} |
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#} |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/multiline In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/multiline Modified Files: TextBuffer.chs TextIter.chs TextMark.chs TextTag.chs TextTagTable.chs TextView.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: TextBuffer.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextBuffer.chs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TextBuffer.chs 8 May 2003 07:25:32 -0000 1.7 +++ TextBuffer.chs 9 Jul 2003 22:42:45 -0000 1.8 @@ -128,13 +128,12 @@ import Monad (liftM) import Maybe (fromMaybe) -import Foreign -import UTFCForeign +import FFI + import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} {#import TextIter#} -import Structs (nullForeignPtr) import TextMark (TextMark, MarkName) import TextTag (TextTag, TagName) @@ -177,13 +176,13 @@ -- @ref type TextIter@. -- textBufferInsert :: TextBuffer -> TextIter -> String -> IO () -textBufferInsert tb iter str = withCStringLen str $ \(cStr, len) -> +textBufferInsert tb iter str = withUTFStringLen str $ \(cStr, len) -> {#call text_buffer_insert#} tb iter cStr (fromIntegral len) -- @method textBufferInsertAtCursor@ Insert text at the cursor. -- textBufferInsertAtCursor :: TextBuffer -> String -> IO () -textBufferInsertAtCursor tb str = withCStringLen str $ \(cStr, len) -> +textBufferInsertAtCursor tb str = withUTFStringLen str $ \(cStr, len) -> {#call text_buffer_insert_at_cursor#} tb cStr (fromIntegral len) -- @method textBufferInsertInteractive@ Insert text at the @ref type TextIter@ @@ -197,7 +196,7 @@ -- textBufferInsertInteractive :: TextBuffer -> TextIter -> String -> Bool -> IO Bool -textBufferInsertInteractive tb iter str def = withCStringLen str $ +textBufferInsertInteractive tb iter str def = withUTFStringLen str $ \(cStr, len) -> liftM toBool $ {#call text_buffer_insert_interactive#} tb iter cStr (fromIntegral len) (fromBool def) @@ -205,7 +204,7 @@ -- a normal user would be able to do so as well. -- textBufferInsertInteractiveAtCursor :: TextBuffer -> String -> Bool -> IO Bool -textBufferInsertInteractiveAtCursor tb str def = withCStringLen str $ +textBufferInsertInteractiveAtCursor tb str def = withUTFStringLen str $ \(cStr, len) -> liftM toBool $ {#call text_buffer_insert_interactive_at_cursor #} tb cStr (fromIntegral len) (fromBool def) @@ -256,7 +255,7 @@ -- @ref type TextBuffer@. -- textBufferSetText :: TextBuffer -> String -> IO () -textBufferSetText tb str = withCStringLen str $ \(cStr, len) -> +textBufferSetText tb str = withUTFStringLen str $ \(cStr, len) -> {#call text_buffer_set_text#} tb cStr (fromIntegral len) -- @method textBufferGetText@ Extract all the text between @ref arg start@ and @@ -272,7 +271,7 @@ -- textBufferGetText :: TextBuffer -> TextIter -> TextIter -> Bool -> IO String textBufferGetText tb start end incl = {#call unsafe text_buffer_get_text#} - tb start end (fromBool incl) >>= peekCString + tb start end (fromBool incl) >>= peekUTFString -- @method textBufferGetSlice@ Extract text and special characters between -- @ref arg start@ and @ref arg end@. @@ -284,7 +283,7 @@ -- textBufferGetSlice :: TextBuffer -> TextIter -> TextIter -> Bool -> IO String textBufferGetSlice tb start end incl = {#call unsafe text_buffer_get_slice#} - tb start end (fromBool incl) >>= peekCString + tb start end (fromBool incl) >>= peekUTFString -- @method textBufferInsertPixbuf@ Insert an image into the -- @ref type TextBuffer@. @@ -308,7 +307,7 @@ textBufferCreateMark tb Nothing iter gravity = makeNewGObject mkTextMark $ {#call unsafe text_buffer_create_mark#} tb nullPtr iter (fromBool gravity) textBufferCreateMark tb (Just name) iter gravity = - makeNewGObject mkTextMark $ withCString name $ \cStr -> + makeNewGObject mkTextMark $ withUTFString name $ \cStr -> {#call unsafe text_buffer_create_mark#} tb cStr iter (fromBool gravity) -- @method textBufferMoveMark@ Move a mark. @@ -323,7 +322,7 @@ -- * The mark should exist (otherwise a nasty warning is generated). -- textBufferMoveMarkByName :: TextBuffer -> MarkName -> TextIter -> IO () -textBufferMoveMarkByName tb name iter = withCString name $ \cStr -> +textBufferMoveMarkByName tb name iter = withUTFString name $ \cStr -> {#call text_buffer_move_mark_by_name#} tb cStr iter -- @method textBufferDeleteMark@ Delete a mark. @@ -338,14 +337,14 @@ -- * The mark should exist (otherwise a nasty warning is generated). -- textBufferDeleteMarkByName :: TextBuffer -> MarkName -> IO () -textBufferDeleteMarkByName tb name = withCString name $ \cStr -> +textBufferDeleteMarkByName tb name = withUTFString name $ \cStr -> {#call text_buffer_delete_mark_by_name#} tb cStr -- @method textBufferGetMark@ Retrieve a @ref type TextMark@ by name. -- textBufferGetMark :: TextBuffer -> MarkName -> IO (Maybe TextMark) textBufferGetMark tb name = do - tm <- withCString name $ \cStr -> + tm <- withUTFString name $ \cStr -> {#call unsafe text_buffer_get_mark#} tb cStr if tm==nullPtr then return Nothing else liftM Just $ makeNewGObject mkTextMark (return tm) @@ -389,14 +388,14 @@ -- textBufferApplyTagByName :: TextBuffer -> TagName -> TextIter -> TextIter -> IO () -textBufferApplyTagByName tb tname start end = withCString tname $ \cStr -> +textBufferApplyTagByName tb tname start end = withUTFString tname $ \cStr -> {#call text_buffer_apply_tag_by_name#} tb cStr start end -- @method textBufferRemoveTagByName@ Remove a tag from a range of text. -- textBufferRemoveTagByName :: TextBuffer -> TagName -> TextIter -> TextIter -> IO () -textBufferRemoveTagByName tb tname start end = withCString tname $ \cStr -> +textBufferRemoveTagByName tb tname start end = withUTFString tname $ \cStr -> {#call text_buffer_remove_tag_by_name#} tb cStr start end -- @method textBufferRemoveAllTags@ Remove all tags within a range. @@ -619,12 +618,12 @@ onInsertText tb user = connect_BOXED_PTR_INT__NONE "insert_text" mkTextIter False tb $ \iter strP strLen -> do - str <- peekCStringLen (strP,strLen) + str <- peekUTFStringLen (strP,strLen) user iter str afterInsertText tb user = connect_BOXED_PTR_INT__NONE "insert_text" mkTextIter True tb $ \iter strP strLen -> do - str <- peekCStringLen (strP,strLen) + str <- peekUTFStringLen (strP,strLen) user iter str -- @signal connectToMarkDeleted@ A @ref data TextMark@ within the buffer was Index: TextIter.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextIter.chs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TextIter.chs 8 Nov 2002 10:39:21 -0000 1.8 +++ TextIter.chs 9 Jul 2003 22:42:45 -0000 1.9 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry TextIter TextBuffer@ -- @@ -127,12 +128,11 @@ import Monad (liftM) import Maybe (fromMaybe) import Char (chr) -import Foreign -import UTFCForeign +import FFI import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} -import Structs (nullForeignPtr, textIterSize) +import Structs (textIterSize) import Enums (TextSearchFlags, Flags(fromFlags)) {# context lib="gtk" prefix="gtk" #} @@ -145,20 +145,34 @@ -- mkTextIter :: Ptr TextIter -> IO TextIter mkTextIter iterPtr = liftM TextIter $ - newForeignPtr iterPtr (textIterFree iterPtr) + newForeignPtr iterPtr (text_iter_free iterPtr) + +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe ">k_text_iter_free" + text_iter_free' :: FinalizerPtr TextIter + +text_iter_free :: Ptr TextIter -> FinalizerPtr TextIter +text_iter_free _ = text_iter_free' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_text_iter_free" + text_iter_free :: Ptr TextIter -> IO () + +#else + +foreign import ccall "gtk_text_iter_free" unsafe + text_iter_free :: Ptr TextIter -> IO () + +#endif -- Allocate memory to be filled with a TextIter. -- makeEmptyTextIter :: IO TextIter makeEmptyTextIter = do iterPtr <- mallocBytes textIterSize - liftM TextIter $ newForeignPtr iterPtr (textIterFree iterPtr) - --- Free a TextIter pointer. --- -foreign import ccall "gtk_text_iter_free" unsafe - textIterFree :: Ptr TextIter -> IO () - + liftM TextIter $ newForeignPtr iterPtr (text_iter_free iterPtr) -- @method textIterGetBuffer@ Return the @ref type TextBuffer@ this iterator -- is associated with. @@ -172,7 +186,7 @@ textIterCopy :: TextIter -> IO TextIter textIterCopy ti = do iterPtr <- {#call unsafe text_iter_copy#} ti - liftM TextIter $ newForeignPtr iterPtr (textIterFree iterPtr) + liftM TextIter $ newForeignPtr iterPtr (text_iter_free iterPtr) -- @method textIterGetOffset@ Extract the offset relative to the beginning of -- the buffer. @@ -215,7 +229,7 @@ textIterGetSlice :: TextIter -> TextIter -> IO String textIterGetSlice end start = do cStr <- {#call text_iter_get_slice#} start end - str <- peekCString cStr + str <- peekUTFString cStr {#call unsafe g_free#} (castPtr cStr) return str @@ -226,7 +240,7 @@ textIterGetText :: TextIter -> TextIter -> IO String textIterGetText start end = do cStr <- {#call text_iter_get_text#} start end - str <- peekCString cStr + str <- peekUTFString cStr {#call unsafe g_free#} (castPtr cStr) return str @@ -237,7 +251,7 @@ textIterGetVisibleSlice :: TextIter -> TextIter -> IO String textIterGetVisibleSlice start end = do cStr <- {#call text_iter_get_visible_slice#} start end - str <- peekCString cStr + str <- peekUTFString cStr {#call unsafe g_free#} (castPtr cStr) return str @@ -248,7 +262,7 @@ textIterGetVisibleText :: TextIter -> TextIter -> IO String textIterGetVisibleText start end = do cStr <- {#call text_iter_get_visible_text#} start end - str <- peekCString cStr + str <- peekUTFString cStr {#call unsafe g_free#} (castPtr cStr) return str @@ -742,7 +756,7 @@ textIterForwardSearch ti str flags limit = do start <- makeEmptyTextIter end <- makeEmptyTextIter - found <- liftM toBool $ withCString str $ \cStr -> + found <- liftM toBool $ withUTFString str $ \cStr -> {#call unsafe text_iter_forward_search#} ti cStr ((fromIntegral.fromFlags) flags) start end (fromMaybe (TextIter nullForeignPtr) limit) @@ -762,7 +776,7 @@ textIterBackwardSearch ti str flags limit = do start <- makeEmptyTextIter end <- makeEmptyTextIter - found <- liftM toBool $ withCString str $ \cStr -> + found <- liftM toBool $ withUTFString str $ \cStr -> {#call unsafe text_iter_backward_search#} ti cStr ((fromIntegral.fromFlags) flags) start end (fromMaybe (TextIter nullForeignPtr) limit) Index: TextMark.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextMark.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextMark.chs 5 Aug 2002 16:41:34 -0000 1.4 +++ TextMark.chs 9 Jul 2003 22:42:45 -0000 1.5 @@ -39,8 +39,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} @@ -77,7 +77,7 @@ textMarkGetName :: TextMarkClass tm => tm -> IO (Maybe String) textMarkGetName tm = do strPtr <- {#call unsafe text_mark_get_name#} (toTextMark tm) - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- @method textMarkGetBuffer@ Extract the @ref type TextBuffer@ of the mark. -- @@ -100,4 +100,4 @@ {#call unsafe text_mark_get_left_gravity#} (toTextMark tm) - \ No newline at end of file + Index: TextTag.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextTag.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextTag.chs 5 Aug 2002 16:41:34 -0000 1.4 +++ TextTag.chs 9 Jul 2003 22:42:45 -0000 1.5 @@ -33,8 +33,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: TextTagTable.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextTagTable.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextTagTable.chs 5 Aug 2002 16:41:34 -0000 1.4 +++ TextTagTable.chs 9 Jul 2003 22:42:45 -0000 1.5 @@ -34,8 +34,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: TextView.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/multiline/TextView.chs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TextView.chs 8 Nov 2002 10:39:21 -0000 1.8 +++ TextView.chs 9 Jul 2003 22:42:45 -0000 1.9 @@ -124,8 +124,8 @@ afterToggleOverwrite) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) import GObject (makeNewGObject) {#import Hierarchy#} |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/treeList In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/treeList Modified Files: CellRendererPixbuf.chs CellRendererText.chs CellRendererToggle.chs ListStore.chs StoreValue.hsc TreeModel.chs TreeModelSort.chs TreeSelection.chs TreeStore.chs TreeView.chs TreeViewColumn.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: CellRendererPixbuf.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/CellRendererPixbuf.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CellRendererPixbuf.chs 8 Nov 2002 10:39:22 -0000 1.6 +++ CellRendererPixbuf.chs 9 Jul 2003 22:42:45 -0000 1.7 @@ -36,8 +36,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: CellRendererText.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/CellRendererText.chs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CellRendererText.chs 16 Dec 2002 22:25:34 -0000 1.9 +++ CellRendererText.chs 9 Jul 2003 22:42:46 -0000 1.10 @@ -50,13 +50,13 @@ import Maybe (fromMaybe) import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} {#import TreeModel#} -import Structs (treeIterSize, nullForeignPtr) +import Structs (treeIterSize) import CellRenderer (Attribute(..)) import StoreValue (GenericValue(..), TMType(..)) @@ -126,18 +126,21 @@ onEdited cr tm user = connect_PTR_STRING__NONE "edited" False cr $ \strPtr string -> do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) - res <- liftM toBool $ gtk_tree_model_get_iter_from_string - (toTreeModel tm) iter strPtr + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) + res <- liftM toBool $ withForeignPtr ((unTreeModel . toTreeModel) tm) $ + \tmPtr -> withForeignPtr (unTreeIter iter) $ \iterPtr -> + gtk_tree_model_get_iter_from_string tmPtr iterPtr strPtr if res then user iter string else putStrLn "edited signal: invalid tree path" afterEdited cr tm user = connect_PTR_STRING__NONE "edited" True cr $ \strPtr string -> do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) - res <- liftM toBool $ gtk_tree_model_get_iter_from_string - (toTreeModel tm) iter strPtr + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) + res <- liftM toBool $ withForeignPtr ((unTreeModel . toTreeModel) tm) $ + \tmPtr -> withForeignPtr (unTreeIter iter) $ \iterPtr -> + gtk_tree_model_get_iter_from_string tmPtr iterPtr strPtr if res then user iter string else putStrLn "edited signal: invalid tree path" +unTreeIter (TreeIter iter) = iter Index: CellRendererToggle.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/CellRendererToggle.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CellRendererToggle.chs 8 Nov 2002 10:39:22 -0000 1.6 +++ CellRendererToggle.chs 9 Jul 2003 22:42:46 -0000 1.7 @@ -40,8 +40,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: ListStore.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/ListStore.chs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ListStore.chs 21 Jan 2003 15:53:26 -0000 1.10 +++ ListStore.chs 9 Jul 2003 22:42:46 -0000 1.11 @@ -46,13 +46,13 @@ import Monad (liftM) import Maybe (fromMaybe) -import Foreign -import UTFCForeign -import GObject (makeNewGObject) +import FFI + +import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} {#import TreeModel#} -import Structs (treeIterSize, nullForeignPtr) +import Structs (treeIterSize) import StoreValue (TMType(..), GenericValue(..)) {#import GValue#} (GValue, valueUnset) import GType (GType) @@ -78,7 +78,7 @@ -- listStoreSetValue :: (ListStoreClass ts) => ts -> TreeIter -> Int -> GenericValue -> IO () -listStoreSetValue ts ti col val = with' val $ \vPtr -> do +listStoreSetValue ts ti col val = with val $ \vPtr -> do {#call unsafe list_store_set_value#} (toListStore ts) ti (fromIntegral col) vPtr valueUnset vPtr @@ -120,7 +120,7 @@ listStoreInsert :: (ListStoreClass ts) => ts -> Int -> IO TreeIter listStoreInsert ts pos = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call list_store_insert#} (toListStore ts) iter (fromIntegral pos) return iter @@ -131,7 +131,7 @@ listStoreInsertBefore :: (ListStoreClass ts) => ts -> TreeIter -> IO TreeIter listStoreInsertBefore ts sibling = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call list_store_insert_before#} (toListStore ts) iter sibling return iter @@ -141,7 +141,7 @@ listStoreInsertAfter :: (ListStoreClass ts) => ts -> TreeIter -> IO TreeIter listStoreInsertAfter ts sibling = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call list_store_insert_after#} (toListStore ts) iter sibling return iter @@ -152,7 +152,7 @@ listStorePrepend :: (ListStoreClass ts) => ts -> IO TreeIter listStorePrepend ts = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call list_store_prepend#} (toListStore ts) iter return iter @@ -163,7 +163,7 @@ listStoreAppend :: (ListStoreClass ts) => ts -> IO TreeIter listStoreAppend ts = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call list_store_append#} (toListStore ts) iter return iter Index: StoreValue.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/StoreValue.hsc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StoreValue.hsc 5 Aug 2002 16:41:35 -0000 1.5 +++ StoreValue.hsc 9 Jul 2003 22:42:46 -0000 1.6 @@ -33,8 +33,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Hierarchy import GValue (GValue, GenericValue(..), valueInit) import GValueTypes Index: TreeModel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeModel.chs,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TreeModel.chs 8 Mar 2003 17:44:05 -0000 1.9 +++ TreeModel.chs 9 Jul 2003 22:42:46 -0000 1.10 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry TreeModel@ -- @@ -41,6 +42,8 @@ treeModelGetValue, TreePath(..), createTreePath, -- internal + tree_path_copy, -- internal + tree_path_free, -- internal treePathNew, treePathNewFromString, treePathToString, @@ -74,11 +77,10 @@ import Monad (liftM, when) import Maybe (fromMaybe) -import Foreign -import UTFCForeign +import FFI {#import Hierarchy#} {#import Signal#} -import Structs (treeIterSize, nullForeignPtr) +import Structs (treeIterSize) import StoreValue (TMType) {#import GValue#} (GValue, GenericValue, valueUnset) @@ -132,8 +134,27 @@ tpPtr' <- tree_path_copy tpPtr liftM TreePath $ newForeignPtr tpPtr' (tree_path_free tpPtr') -foreign import ccall "gtk_tree_path_copy" unsafe - tree_path_copy :: Ptr TreePath -> IO (Ptr TreePath) +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe ">k_tree_path_free" + tree_path_free' :: FinalizerPtr TreePath + +tree_path_free :: Ptr TreePath -> FinalizerPtr TreePath +tree_path_free _ = tree_path_free' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_tree_path_free" + tree_path_free :: Ptr TreePath -> IO () + +#else + +foreign import ccall "gtk_tree_path_free" unsafe + tree_path_free :: Ptr TreePath -> IO () + +#endif + + -- @constructor treePathNew@ Create a new @ref data TreePath@. -- @@ -145,16 +166,13 @@ tpPtr <- {#call unsafe tree_path_new#} liftM TreePath $ newForeignPtr tpPtr (tree_path_free tpPtr) -foreign import ccall "gtk_tree_path_free" unsafe - tree_path_free :: Ptr TreePath -> IO () - -- @constructor treePathNewFromString@ Turn a @literal String@ into a -- @ref data TreePath@. -- treePathNewFromString :: String -> IO TreePath treePathNewFromString path = do tpPtr <- throwIfNull "treePathNewFromString: invalid path given" $ - withCString path {#call unsafe tree_path_new_from_string#} + withUTFString path {#call unsafe tree_path_new_from_string#} liftM TreePath $ newForeignPtr tpPtr (tree_path_free tpPtr) -- @method treePathToString@ Turn a @ref data TreePath@ into a @@ -163,7 +181,7 @@ treePathToString :: TreePath -> IO String treePathToString tp = do strPtr <- {#call tree_path_to_string#} tp - str <- peekCString strPtr + str <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) return str @@ -203,6 +221,19 @@ tpPtr' <- {#call unsafe tree_path_copy#} tp liftM TreePath $ newForeignPtr tpPtr' (tree_path_free tpPtr') +#if __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_tree_path_copy" + tree_path_copy :: Ptr TreePath -> IO (Ptr TreePath) + +#else + +foreign import ccall "gtk_tree_path_copy" unsafe + tree_path_copy :: Ptr TreePath -> IO (Ptr TreePath) + +#endif + + treePathCompare :: TreePath -> TreePath -> IO Ordering treePathCompare tp1 tp2 = do res <- {#call unsafe tree_path_compare#} tp1 tp2 @@ -229,12 +260,39 @@ tiPtr' <- tree_iter_copy tiPtr liftM TreeIter $ newForeignPtr tiPtr' (tree_iter_free tiPtr') -foreign import ccall "gtk_tree_iter_free" unsafe - tree_iter_free :: Ptr TreeIter -> IO () + +#if __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_tree_iter_copy" + tree_iter_copy :: Ptr TreeIter -> IO (Ptr TreeIter) + +#else foreign import ccall "gtk_tree_iter_copy" unsafe tree_iter_copy :: Ptr TreeIter -> IO (Ptr TreeIter) +#endif + +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe ">k_tree_iter_free" + tree_iter_free' :: FinalizerPtr TreeIter + +tree_iter_free :: Ptr TreeIter -> FinalizerPtr TreeIter +tree_iter_free _ = tree_iter_free' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_tree_iter_free" + tree_iter_free :: Ptr TreeIter -> IO () + +#else + +foreign import ccall "gtk_tree_iter_free" unsafe + tree_iter_free :: Ptr TreeIter -> IO () + +#endif + -- @method treeModelGetIter@ Turn a @ref data TreePath@ into a -- @ref data TreeIter@. @@ -244,7 +302,7 @@ treeModelGetIter :: TreeModelClass tm => tm -> TreePath -> IO (Maybe TreeIter) treeModelGetIter tm tp = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call unsafe tree_model_get_iter#} (toTreeModel tm) iter tp return $ if (toBool res) then Just iter else Nothing @@ -257,8 +315,8 @@ IO (Maybe TreeIter) treeModelGetIterFromString tm str = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) - res <- withCString str $ \strPtr -> + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) + res <- withUTFString str $ \strPtr -> {#call unsafe tree_model_get_iter_from_string#} (toTreeModel tm) iter strPtr return $ if (toBool res) then Just iter else Nothing @@ -271,7 +329,7 @@ treeModelGetIterFirst :: TreeModelClass tm => tm -> IO (Maybe TreeIter) treeModelGetIterFirst tm = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call unsafe tree_model_get_iter_first#} (toTreeModel tm) iter return $ if (toBool res) then Just iter else Nothing @@ -296,7 +354,7 @@ IO (Maybe TreeIter) treeModelIterChildren tm parent = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call unsafe tree_model_iter_children#} (toTreeModel tm) iter parent return $ if (toBool res) then Just iter else Nothing @@ -325,7 +383,7 @@ tm -> Maybe TreeIter -> Int -> IO (Maybe TreeIter) treeModelIterNthChild tm parent n = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call unsafe tree_model_iter_nth_child#} (toTreeModel tm) iter (fromMaybe (TreeIter nullForeignPtr) parent) (fromIntegral n) return $ if (toBool res) then Just iter else Nothing @@ -336,7 +394,7 @@ TreeIter -> IO (Maybe TreeIter) treeModelIterParent tm child = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call unsafe tree_model_iter_parent#} (toTreeModel tm) iter child return $ if (toBool res) then Just iter else Nothing Index: TreeModelSort.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeModelSort.chs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TreeModelSort.chs 3 Dec 2002 13:42:35 -0000 1.1 +++ TreeModelSort.chs 9 Jul 2003 22:42:46 -0000 1.2 @@ -35,8 +35,8 @@ ) where import Monad (liftM, when) -import Foreign -import UTFCForeign +import FFI + {#import Hierarchy#} import Signal Index: TreeSelection.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeSelection.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TreeSelection.chs 8 May 2003 07:25:33 -0000 1.6 +++ TreeSelection.chs 9 Jul 2003 22:42:46 -0000 1.7 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry TreeSelection@ -- @@ -60,14 +61,14 @@ import Monad (liftM) import LocalData(newIORef, readIORef, writeIORef) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} import Enums (SelectionMode(..)) {#import TreeModel#} -import Structs (treeIterSize, nullForeignPtr) +import Structs (treeIterSize) import General (mkDestructor) {# context lib="gtk" prefix="gtk" #} @@ -107,15 +108,17 @@ type TreeSelectionCB = TreePath -> IO () {#pointer TreeSelectionFunc#} -foreign export dynamic mkTreeSelectionFunc :: +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkTreeSelectionFunc :: (Ptr () -> Ptr () -> Ptr TreePath -> Ptr () -> IO ())-> IO TreeSelectionFunc -foreign import ccall "gtk_tree_path_free" unsafe - tree_path_free :: Ptr TreePath -> IO () +#else -foreign import ccall "gtk_tree_path_copy" unsafe - tree_path_copy :: Ptr TreePath -> IO (Ptr TreePath) +foreign export dynamic mkTreeSelectionFunc :: + (Ptr () -> Ptr () -> Ptr TreePath -> Ptr () -> IO ())-> IO TreeSelectionFunc +#endif -- @method treeSelectionGetTreeView@ Retrieve the TreeView widget that this -- TreeSelection works on. @@ -131,7 +134,7 @@ IO (Maybe TreeIter) treeSelectionGetSelected ts = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) res <- {#call tree_selection_get_selected#} (toTreeSelection ts) (nullPtr) iter return $ if (toBool res) then Just iter else Nothing @@ -149,7 +152,7 @@ -- a constant member of Selection this does not matter. iterPtr <- mallocBytes treeIterSize copyBytes iterPtr ti treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) fun iter ) {#call tree_selection_selected_foreach#} (toTreeSelection ts) fPtr nullPtr Index: TreeStore.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeStore.chs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TreeStore.chs 21 Jan 2003 15:53:26 -0000 1.8 +++ TreeStore.chs 9 Jul 2003 22:42:46 -0000 1.9 @@ -46,13 +46,13 @@ import Monad (liftM) import Maybe (fromMaybe) -import Foreign -import UTFCForeign +import FFI + import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} {#import TreeModel#} -import Structs (treeIterSize, nullForeignPtr) +import Structs (treeIterSize) import StoreValue (TMType(..), GenericValue(..)) {#import GValue#} (GValue, valueUnset) import GType (GType) @@ -77,7 +77,7 @@ -- treeStoreSetValue :: (TreeStoreClass ts) => ts -> TreeIter -> Int -> GenericValue -> IO () -treeStoreSetValue ts ti col val = with' val $ \vPtr -> do +treeStoreSetValue ts ti col val = with val $ \vPtr -> do {#call unsafe tree_store_set_value#} (toTreeStore ts) ti (fromIntegral col) vPtr valueUnset vPtr @@ -120,7 +120,7 @@ IO TreeIter treeStoreInsert ts parent pos = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call tree_store_insert#} (toTreeStore ts) iter (fromMaybe (TreeIter nullForeignPtr) parent) (fromIntegral pos) return iter @@ -132,7 +132,7 @@ treeStoreInsertBefore :: (TreeStoreClass ts) => ts -> TreeIter -> IO TreeIter treeStoreInsertBefore ts sibling = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call tree_store_insert_before#} (toTreeStore ts) iter (TreeIter nullForeignPtr) sibling return iter @@ -142,7 +142,7 @@ treeStoreInsertAfter :: (TreeStoreClass ts) => ts -> TreeIter -> IO TreeIter treeStoreInsertAfter ts sibling = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call tree_store_insert_after#} (toTreeStore ts) iter (TreeIter nullForeignPtr) sibling return iter @@ -154,7 +154,7 @@ treeStorePrepend :: (TreeStoreClass ts) => ts -> Maybe TreeIter -> IO TreeIter treeStorePrepend ts parent = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call tree_store_prepend#} (toTreeStore ts) iter (fromMaybe (TreeIter nullForeignPtr) parent) return iter @@ -166,7 +166,7 @@ treeStoreAppend :: (TreeStoreClass ts) => ts -> Maybe TreeIter -> IO TreeIter treeStoreAppend ts parent = do iterPtr <- mallocBytes treeIterSize - iter <- liftM TreeIter $ newForeignPtr iterPtr (free iterPtr) + iter <- liftM TreeIter $ newForeignPtr iterPtr (foreignFree iterPtr) {#call tree_store_append#} (toTreeStore ts) iter (fromMaybe (TreeIter nullForeignPtr) parent) return iter Index: TreeView.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeView.chs,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- TreeView.chs 22 May 2003 09:19:18 -0000 1.14 +++ TreeView.chs 9 Jul 2003 22:42:46 -0000 1.15 @@ -146,10 +146,10 @@ import Monad (liftM, mapM) import Maybe (fromMaybe) import LocalData(newIORef, readIORef, writeIORef) -import Foreign -import UTFCForeign +import FFI + import General (mkDestructor) -import Structs (nullForeignPtr, Point, Rectangle) +import Structs (Point, Rectangle) import GObject (makeNewGObject, objectRef, objectUnref) import Object (makeNewObject) import GList (GList, fromGList) @@ -430,10 +430,20 @@ {#pointer TreeViewColumnDropFunc#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkTreeViewColumnDropFunc :: + (Ptr () -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> + Ptr () -> IO {#type gboolean#}) -> IO TreeViewColumnDropFunc + +#else + foreign export dynamic mkTreeViewColumnDropFunc :: (Ptr () -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> Ptr TreeViewColumn -> Ptr () -> IO {#type gboolean#}) -> IO TreeViewColumnDropFunc +#endif + -- @method treeViewScrollToPoint@ Scroll to a coordinate. -- @@ -526,9 +536,6 @@ makeNewObject mkTreeViewColumn (return tvcPtr) return (tp,tvc) -foreign import ccall "gtk_tree_path_free" unsafe - tree_path_free :: Ptr TreePath -> IO () - -- @method treeViewRowActivated@ Emit the activated signal on a cell. -- treeViewRowActivated :: TreeViewClass tv => tv -> TreePath -> @@ -590,10 +597,20 @@ {#pointer TreeViewMappingFunc#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkTreeViewMappingFunc :: + (Ptr TreeView -> Ptr TreePath -> Ptr () -> IO ()) -> + IO TreeViewMappingFunc + +#else + foreign export dynamic mkTreeViewMappingFunc :: (Ptr TreeView -> Ptr TreePath -> Ptr () -> IO ()) -> IO TreeViewMappingFunc +#endif + -- @method treeViewRowExpanded@ Check if row is expanded. -- treeViewRowExpanded :: TreeViewClass tv => tv -> TreePath -> IO Bool @@ -781,7 +798,7 @@ IO () treeViewSetSearchEqualFunc tv pred = do fPtr <- mkTreeViewSearchEqualFunc (\_ col keyPtr itPtr _ -> do - key <- peekCString keyPtr + key <- peekUTFString keyPtr iter <- createTreeIter itPtr liftM fromBool $ pred (fromIntegral col) key iter) dRef <- newIORef nullFunPtr @@ -795,10 +812,19 @@ {#pointer TreeViewSearchEqualFunc#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkTreeViewSearchEqualFunc :: + (Ptr TreeModel -> {#type gint#} -> CString -> Ptr TreeIter -> Ptr () -> + IO {#type gboolean#}) -> IO TreeViewSearchEqualFunc + +#else + foreign export dynamic mkTreeViewSearchEqualFunc :: (Ptr TreeModel -> {#type gint#} -> CString -> Ptr TreeIter -> Ptr () -> IO {#type gboolean#}) -> IO TreeViewSearchEqualFunc +#endif -- @signal connectToColumnsChanged@ The user has dragged a column to another -- position. Index: TreeViewColumn.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/TreeViewColumn.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TreeViewColumn.chs 8 Nov 2002 10:39:22 -0000 1.6 +++ TreeViewColumn.chs 9 Jul 2003 22:42:46 -0000 1.7 @@ -90,8 +90,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -176,7 +176,7 @@ treeViewColumnAddAttribute :: (TreeViewColumnClass tvc, CellRendererClass cr) => tvc -> cr -> String -> Int -> IO () treeViewColumnAddAttribute tvc cr attr col = - withCString attr $ \cstr -> {#call unsafe tree_view_column_add_attribute#} + withUTFString attr $ \cstr -> {#call unsafe tree_view_column_add_attribute#} (toTreeViewColumn tvc) (toCellRenderer cr) cstr (fromIntegral col) -- @method treeViewColumnAddAttributes@ Insert attributes @ref arg attribs@ @@ -334,7 +334,7 @@ -- has not been set. -- treeViewColumnSetTitle :: TreeViewColumnClass tvc => tvc -> String -> IO () -treeViewColumnSetTitle tvc title = withCString title $ +treeViewColumnSetTitle tvc title = withUTFString title $ {#call tree_view_column_set_title#} (toTreeViewColumn tvc) -- @method treeViewColumnGetTitle@ Get the widget's title. @@ -342,7 +342,7 @@ treeViewColumnGetTitle :: TreeViewColumnClass tvc => tvc -> IO (Maybe String) treeViewColumnGetTitle tvc = do strPtr <- {#call unsafe tree_view_column_get_title#} (toTreeViewColumn tvc) - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- @method treeViewColumnSetClickable@ Set if the column should be sensitive -- to mouse clicks. |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/menuComboToolbar Modified Files: CheckMenuItem.chs Combo.chs ImageMenuItem.chs Menu.chs MenuBar.chs MenuItem.chs MenuShell.chs OptionMenu.chs RadioMenuItem.chs TearoffMenuItem.chs Toolbar.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: CheckMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/CheckMenuItem.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CheckMenuItem.chs 8 Nov 2002 10:39:21 -0000 1.4 +++ CheckMenuItem.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -40,8 +40,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -62,7 +62,7 @@ -- with a @ref data Label@ inside. -- checkMenuItemNewWithLabel :: String -> IO CheckMenuItem -checkMenuItemNewWithLabel str = withCString str $ \strPtr -> +checkMenuItemNewWithLabel str = withUTFString str $ \strPtr -> makeNewObject mkCheckMenuItem $ liftM castPtr $ {#call unsafe check_menu_item_new_with_label#} strPtr Index: Combo.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/Combo.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Combo.chs 24 May 2002 09:43:25 -0000 1.2 +++ Combo.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -49,8 +49,8 @@ ) where import Monad (liftM, mapM_) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) import Widget (widgetShow) import Container(containerAdd) @@ -76,7 +76,7 @@ {#call list_clear_items#} list 0 (-1) mapM_ (\str -> do li <- makeNewObject mkWidget $ liftM castPtr $ - withCString str {#call unsafe list_item_new_with_label#} + withUTFString str {#call unsafe list_item_new_with_label#} widgetShow li containerAdd list li) strs Index: ImageMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/ImageMenuItem.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ImageMenuItem.chs 8 Nov 2002 10:39:21 -0000 1.3 +++ ImageMenuItem.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -43,8 +43,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -82,7 +82,7 @@ -- with a stock image. -- imageMenuItemNewFromStock :: String -> IO ImageMenuItem -imageMenuItemNewFromStock str = withCString str $ \strPtr -> +imageMenuItemNewFromStock str = withUTFString str $ \strPtr -> makeNewObject mkImageMenuItem $ liftM castPtr $ {#call unsafe image_menu_item_new_from_stock#} strPtr nullPtr @@ -90,7 +90,7 @@ -- with a label. -- imageMenuItemNewWithLabel :: String -> IO ImageMenuItem -imageMenuItemNewWithLabel str = withCString str $ \strPtr -> +imageMenuItemNewWithLabel str = withUTFString str $ \strPtr -> makeNewObject mkImageMenuItem $ liftM castPtr $ {#call unsafe image_menu_item_new_with_label#} strPtr @@ -98,6 +98,6 @@ -- with a label where underscored indicate the mnemonic. -- imageMenuItemNewWithMnemonic :: String -> IO ImageMenuItem -imageMenuItemNewWithMnemonic str = withCString str $ \strPtr -> +imageMenuItemNewWithMnemonic str = withUTFString str $ \strPtr -> makeNewObject mkImageMenuItem $ liftM castPtr $ {#call unsafe image_menu_item_new_with_mnemonic#} strPtr Index: Menu.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/Menu.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Menu.chs 1 Dec 2002 14:09:51 -0000 1.5 +++ Menu.chs 9 Jul 2003 22:42:44 -0000 1.6 @@ -55,13 +55,12 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} -import Events (Event(..)) -import Structs (nullForeignPtr) +import Events (Event(Button), time, button) {# context lib="gtk" prefix="gtk" #} @@ -85,16 +84,16 @@ -- -- menuPopup :: MenuClass m => m -> Event -> IO () -menuPopup m (Button { time=t, button=b }) = {#call menu_popup#} (toMenu m) - (mkWidget nullForeignPtr) (mkWidget nullForeignPtr) nullFunPtr nullPtr - ((fromIntegral.fromEnum) b) (fromIntegral t) +menuPopup m (Events.Button { time=t, button=b }) = {#call menu_popup#} + (toMenu m) (mkWidget nullForeignPtr) (mkWidget nullForeignPtr) nullFunPtr + nullPtr ((fromIntegral.fromEnum) b) (fromIntegral t) menuPopup _ _ = error "menuPopup: Button event expected." -- @method menuSetTitle@ Set the @ref arg title@ of the menu. It is displayed -- if the menu is shown as a tearoff menu. -- menuSetTitle :: MenuClass m => m -> String -> IO () -menuSetTitle m title = withCString title $ \strPtr -> +menuSetTitle m title = withUTFString title $ \strPtr -> {#call unsafe menu_set_title#} (toMenu m) strPtr -- @method menuPopdown@ Remove a context or tearoff menu from the screen. Index: MenuBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/MenuBar.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MenuBar.chs 19 Dec 2002 18:13:39 -0000 1.3 +++ MenuBar.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -35,8 +35,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: MenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/MenuItem.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MenuItem.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ MenuItem.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -62,8 +62,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -83,7 +83,7 @@ -- inside. -- menuItemNewWithLabel :: String -> IO MenuItem -menuItemNewWithLabel label = withCString label $ \strPtr -> +menuItemNewWithLabel label = withUTFString label $ \strPtr -> makeNewObject mkMenuItem $ liftM castPtr $ {#call unsafe menu_item_new_with_label#} strPtr Index: MenuShell.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/MenuShell.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MenuShell.chs 24 May 2002 09:43:25 -0000 1.2 +++ MenuShell.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -53,8 +53,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: OptionMenu.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/OptionMenu.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OptionMenu.chs 24 May 2002 09:43:25 -0000 1.2 +++ OptionMenu.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -42,8 +42,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: RadioMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/RadioMenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- RadioMenuItem.chs 24 May 2002 09:43:25 -0000 1.2 +++ RadioMenuItem.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -41,8 +41,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -61,7 +61,7 @@ -- label in it. -- radioMenuItemNewWithLabel :: String -> IO RadioMenuItem -radioMenuItemNewWithLabel label = withCString label $ \strPtr -> +radioMenuItemNewWithLabel label = withUTFString label $ \strPtr -> makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new_with_label#} nullPtr strPtr @@ -81,7 +81,7 @@ IO RadioMenuItem radioMenuItemNewJoinGroupWithLabel rmi label = do groupPtr <- {#call unsafe radio_menu_item_get_group#} rmi - withCString label $ \strPtr -> + withUTFString label $ \strPtr -> makeNewObject mkRadioMenuItem $ liftM castPtr $ {#call unsafe radio_menu_item_new_with_label#} groupPtr strPtr Index: TearoffMenuItem.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/TearoffMenuItem.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TearoffMenuItem.chs 24 May 2002 09:43:25 -0000 1.2 +++ TearoffMenuItem.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: Toolbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/Toolbar.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Toolbar.chs 24 Mar 2003 23:56:39 -0000 1.5 +++ Toolbar.chs 9 Jul 2003 22:42:44 -0000 1.6 @@ -88,14 +88,14 @@ import Monad (liftM) import Maybe (fromJust, fromMaybe) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} import Enums (Orientation(..), ToolbarStyle(..)) import Structs (toolbarGetSize', toolbarChildButton, toolbarChildToggleButton, - toolbarChildRadioButton, nullForeignPtr, IconSize, + toolbarChildRadioButton, IconSize, iconSizeInvalid, iconSizeSmallToolbar, iconSizeLargeToolbar) import StockItems(stockLookupItem, siLabel, stockMissingImage) import Image (imageNewFromStock) @@ -114,8 +114,8 @@ -- mkToolText :: Maybe (String,String) -> (CString -> CString -> IO a) -> IO a mkToolText Nothing fun = fun nullPtr nullPtr -mkToolText (Just (text,private)) fun = withCString text $ \txtPtr -> - withCString private $ \prvPtr -> fun txtPtr prvPtr +mkToolText (Just (text,private)) fun = withUTFString text $ \txtPtr -> + withUTFString private $ \prvPtr -> fun txtPtr prvPtr -- @method toolbarInsertNewButton@ Insert a new @ref data Button@ into the -- @ref data Toolbar@. @@ -137,7 +137,7 @@ toolbarInsertNewButton :: ToolbarClass tb => tb -> Int -> String -> Maybe (String,String) -> IO Button toolbarInsertNewButton tb pos stockId tooltips = - withCString stockId $ \stockPtr -> + withUTFString stockId $ \stockPtr -> mkToolText tooltips $ \textPtr privPtr -> makeNewObject mkButton $ liftM castPtr $ {#call unsafe toolbar_insert_stock#} (toToolbar tb) stockPtr textPtr privPtr @@ -180,7 +180,7 @@ size <- toolbarGetSize' (toToolbar tb) image <- imageNewFromStock stockId size makeNewObject mkToggleButton $ liftM castPtr $ - withCString label $ \lblPtr -> mkToolText tooltips $ \textPtr privPtr -> + withUTFString label $ \lblPtr -> mkToolText tooltips $ \textPtr privPtr -> {#call unsafe toolbar_insert_element#} (toToolbar tb) toolbarChildToggleButton (mkWidget nullForeignPtr) lblPtr textPtr privPtr (toWidget image) nullFunPtr nullPtr (fromIntegral pos) @@ -234,7 +234,7 @@ size <- toolbarGetSize' (toToolbar tb) image <- imageNewFromStock stockId size makeNewObject mkRadioButton $ liftM castPtr $ - withCString label $ \lblPtr -> mkToolText tooltips $ \textPtr privPtr -> + withUTFString label $ \lblPtr -> mkToolText tooltips $ \textPtr privPtr -> {#call unsafe toolbar_insert_element#} (toToolbar tb) toolbarChildRadioButton (maybe (mkWidget nullForeignPtr) toWidget rb) lblPtr textPtr privPtr (toWidget image) nullFunPtr nullPtr |
From: <as...@us...> - 2003-07-09 22:42:51
|
Update of /cvsroot/gtk2hs/gtk2hs/mk In directory sc8-pr-cvs1:/tmp/cvs-serv25460/mk Modified Files: common.mk library.mk 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: common.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/common.mk,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- common.mk 17 May 2003 14:53:44 -0000 1.20 +++ common.mk 9 Jul 2003 22:42:46 -0000 1.21 @@ -274,7 +274,7 @@ @echo incl: $(INST_INCLDIR) bin: $(INST_BINDIR) # @echo user install dir: $(INSTALLDIR) @echo subdirs: $(SUBDIRSOK) -# @echo $(ALLSOURCEFILES) > sourcefiles.txt + @echo $(ALLSOURCEFILES) > sourcefiles.txt # @cvs status $(CLEANFILES) 2> /dev/null | $(GREP) File | $(GREP) Unknown # Create a source tar achive. Do this by adding files to the tar file in the Index: library.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/library.mk,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- library.mk 4 Jul 2003 08:27:00 -0000 1.15 +++ library.mk 9 Jul 2003 22:42:46 -0000 1.16 @@ -41,7 +41,7 @@ $(addprefix -Wl$(COMMA),\ $(addprefix --subsystem$(SPACE),$(SUBSYSTEM))) \ $(addprefix -u ,$(EXTRA_SYMBOLS)))]} | \ - $(PKG) --force -f $(LOCALPKGCONF) -a > /dev/null + $(PKG) --force -g -f $(LOCALPKGCONF) -a > /dev/null installcheck : @if $(PKG) -l | $(GREP) $(PACKAGENAME) > /dev/null; then \ |
From: <as...@us...> - 2003-07-09 22:42:50
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/signals In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/signals Modified Files: HookGenerator.hs Signal.chs-boot1 Signal.chs-boot2 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: HookGenerator.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/signals/HookGenerator.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HookGenerator.hs 18 Jan 2003 17:41:14 -0000 1.3 +++ HookGenerator.hs 9 Jul 2003 22:42:45 -0000 1.4 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- HookGenerator.hs -*-haskell-*- -- Takes a type list of possible hooks from the GTK+ distribution and produces -- Haskell functions to connect to these callbacks. @@ -99,8 +100,8 @@ parseArg l (TokType ty: TokComma:rem) = let (args,rem') = parseArg l rem in (ty:args, rem') -parseArg l rem = error ("parse error on line "++show l++": expected type\ - \ followed by comma or EOL, found\n"++ +parseArg l rem = error ("parse error on line "++show l++": expected type"++ + " followed by comma or EOL, found\n "++ concatMap show (take 5 rem)) scan :: String -> [Token] @@ -388,13 +389,13 @@ usage = do - putStr "Program to generate callback hook for Gtk signals. Usage:\n\ - \HookGenerator <signatureFile> <bootPath> <outFile> [--broken]\n\ - \where\n\ - \ <signatureFile> is gtkmarshal.list from the the source Gtk+ tree\n\ - \ <bootPath> the path where Signal.chs-boot? file can be found\n\ - \ <outFile> is the name and path of the output file.\n\ - \ --broken do not ask for callbacks with more than 4 words/n" + putStr $ "Program to generate callback hook for Gtk signals. Usage:\n"++ + "HookGenerator <signatureFile> <bootPath> <outFile> [--broken]\n"++ + "where\n"++ + " <signatureFile> is gtkmarshal.list from the the source Gtk+ tree\n"++ + " <bootPath> the path where Signal.chs-boot? file can be found\n"++ + " <outFile> is the name and path of the output file.\n"++ + " --broken do not ask for callbacks with more than 4 words\n" exitWith $ ExitFailure 1 main = do @@ -434,7 +435,11 @@ indent 1.mkRawtype sig. indent 0. (if fakeSignature bs sig then id else indent 0.ss "foreign". +#if __GLASGOW_HASKELL__>=504 + ss " import ccall \"wrapper\" ").ss "mkHandler_".ident.ss " ::". +#else ss " export dynamic ").ss "mkHandler_".ident.ss " ::". +#endif indent 1.ss "Tag_".ident.ss " -> ". indent 1.ss "IO (FunPtr ".ss "Tag_".ident.sc ')'. (if fakeSignature bs sig then Index: Signal.chs-boot1 =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/signals/Signal.chs-boot1,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Signal.chs-boot1 24 Mar 2002 21:56:20 -0000 1.1.1.1 +++ Signal.chs-boot1 9 Jul 2003 22:42:45 -0000 1.2 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- ******************** automatically generated file - do not edit ************ -- Callback installers for the GIMP Toolkit (GTK) Binding for Haskell Index: Signal.chs-boot2 =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/signals/Signal.chs-boot2,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Signal.chs-boot2 10 Mar 2003 11:56:28 -0000 1.3 +++ Signal.chs-boot2 9 Jul 2003 22:42:45 -0000 1.4 @@ -5,8 +5,7 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI import LocalData import GObject (objectRef, objectUnref) {#import Hierarchy#} @@ -25,7 +24,15 @@ {#pointer GClosureNotify#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkDestructor :: IO () -> IO GClosureNotify + +#else + foreign export dynamic mkDestructor :: IO () -> IO GClosureNotify + +#endif disconnect :: GObjectClass obj => ConnectId obj -> IO () disconnect (ConnectID handler obj) = |
From: <as...@us...> - 2003-07-09 22:42:50
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/scrolling In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/scrolling Modified Files: HScrollbar.chs ScrolledWindow.chs VScrollbar.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: HScrollbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/scrolling/HScrollbar.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HScrollbar.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ HScrollbar.chs 9 Jul 2003 22:42:45 -0000 1.4 @@ -37,8 +37,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: ScrolledWindow.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/scrolling/ScrolledWindow.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ScrolledWindow.chs 8 Nov 2002 10:39:21 -0000 1.5 +++ ScrolledWindow.chs 9 Jul 2003 22:42:45 -0000 1.6 @@ -53,14 +53,13 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} import Enums (PolicyType(..), CornerType(..), ShadowType(..)) import Maybe (fromMaybe) -import Structs (nullForeignPtr) {# context lib="gtk" prefix="gtk" #} Index: VScrollbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/scrolling/VScrollbar.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VScrollbar.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ VScrollbar.chs 9 Jul 2003 22:42:45 -0000 1.4 @@ -37,8 +37,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} |
From: <as...@us...> - 2003-07-09 22:42:50
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/glib In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/glib Modified Files: GList.chs GObject.chs GType.chs GValue.chs GValueTypes.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: GList.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GList.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- GList.chs 24 Mar 2003 23:56:39 -0000 1.6 +++ GList.chs 9 Jul 2003 22:42:44 -0000 1.7 @@ -43,7 +43,7 @@ ) where import Monad (liftM) -import Foreign +import FFI import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -124,4 +124,4 @@ makeList current (x:xs) = do newHead <- {#call unsafe list_prepend#} current ((castPtr.conv) x) makeList newHead xs - makeList current [] = return current \ No newline at end of file + makeList current [] = return current Index: GObject.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GObject.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GObject.chs 3 Nov 2002 20:35:44 -0000 1.5 +++ GObject.chs 9 Jul 2003 22:42:44 -0000 1.6 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry Widget GObject@ -- @@ -38,7 +39,7 @@ ) where -import Foreign +import FFI import LocalData(newIORef, readIORef, writeIORef) import Hierarchy(GObjectClass, toGObject, unGObject) {#import GValue#} @@ -54,8 +55,26 @@ -- decrease the reference counter of an object -- -objectUnref :: GObjectClass obj => Ptr obj -> IO () -objectUnref = {#call object_unref#} . castPtr +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe "&g_object_unref" + object_unref' :: FinalizerPtr a + +objectUnref :: Ptr a -> FinalizerPtr a +objectUnref _ = object_unref' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "g_object_unref" + objectUnref :: Ptr a -> IO () + +#else + +foreign import ccall "g_object_unref" unsafe + objectUnref :: Ptr a -> IO () + +#endif + -- This is a convenience function to generate an object that does not -- derive from Object. It adds objectUnref as finalizer. @@ -72,7 +91,15 @@ {#pointer GWeakNotify#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkDestructor :: IO () -> IO GWeakNotify + +#else + foreign export dynamic mkDestructor :: IO () -> IO GWeakNotify + +#endif -- @method objectWeakref@ attach a callback that will be called after the -- destroy hooks have been called Index: GType.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GType.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GType.chs 3 Nov 2002 20:35:44 -0000 1.3 +++ GType.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -34,8 +34,9 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + +import LocalData (unsafePerformIO) {# context lib="glib" prefix="g" #} @@ -47,7 +48,7 @@ -- * Internally used by Hierarchy. -- typeInstanceIsA :: Ptr () -> GType -> Bool -typeInstanceIsA obj p = - toBool ({#call fun unsafe g_type_check_instance_is_a#} obj p) +typeInstanceIsA obj p = toBool $ + unsafePerformIO ({#call unsafe g_type_check_instance_is_a#} obj p) Index: GValue.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GValue.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GValue.chs 3 Nov 2002 20:35:44 -0000 1.4 +++ GValue.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -37,8 +37,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import GType (GType) import Hierarchy(GObject) Index: GValueTypes.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/GValueTypes.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GValueTypes.chs 3 Nov 2002 20:35:44 -0000 1.4 +++ GValueTypes.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -1,5 +1,5 @@ -- -*-haskell-*- --- GIMP Toolkit (GTK) @entry GValueTypes@ +-- GIMP Toolkit (GTK) GValueTypes -- -- Author : Axel Simon -- @@ -55,8 +55,7 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI import GObject {#import Hierarchy#} import GType (GType) @@ -119,7 +118,7 @@ valueSetString :: GValue -> Maybe String -> IO () valueSetString gv (Just str) = do - strPtr <- newCString str + strPtr <- newUTFString str {#call unsafe value_set_static_string#} gv strPtr valueSetString gv Nothing = @@ -128,14 +127,13 @@ valueGetString :: GValue -> IO (Maybe String) valueGetString gv = do strPtr <- {#call unsafe value_get_string#} gv - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- * for some weird reason the API says that gv is a gpointer, not a GObject +-- valueSetObject :: GValue -> GObject -> IO () -valueSetObject gv obj = g_value_set_object gv obj - -foreign import ccall "g_value_set_object" unsafe - g_value_set_object :: GValue -> GObject -> IO () +valueSetObject gv obj = withForeignPtr (unGObject obj) $ \objPtr -> + {#call unsafe g_value_set_object#} gv (castPtr objPtr) valueGetObject :: GValue -> IO GObject valueGetObject gv = makeNewGObject mkGObject $ |
From: <as...@us...> - 2003-07-09 22:42:50
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/typehier In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/typehier Modified Files: TypeGenerator.hs 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: TypeGenerator.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/typehier/TypeGenerator.hs,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TypeGenerator.hs 19 Jan 2003 19:20:47 -0000 1.7 +++ TypeGenerator.hs 9 Jul 2003 22:42:46 -0000 1.8 @@ -148,13 +148,13 @@ indent 0.ss "--". indent 0.ss "module Hierarchy(". -- indent 1.ss "ObjectTag(..)". - foldl (.) id (map (\(n:_) -> ss ", ".indent 1.ss n.ss ", ".ss n. - ss "Class(..),".indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. + foldl (.) id (map (\(n:_) -> ss ", ". + indent 1.ss n.ss "(".ss n.ss "), ".ss n.ss "Class(..),". + indent 1.ss "mk".ss n.ss ", un".ss n.sc ','. indent 1.ss "castTo".ss n) objs). indent 1.ss ") where". indent 0. - indent 0.ss "import Foreign (ForeignPtr, castForeignPtr, foreignPtrToPtr)". - indent 0.ss "import UTFCForeign (CULong)". + indent 0.ss "import FFI (ForeignPtr, castForeignPtr, foreignPtrToPtr,". ss " CULong)". indent 0.ss "import GType (typeInstanceIsA)". indent 0. indent 0.ss "{#context lib=\"gtk\" prefix=\"gtk\" #}". |
From: <as...@us...> - 2003-07-09 21:12:30
|
Update of /cvsroot/gtk2hs/gtk2hs/c2hs/gen In directory sc8-pr-cvs1:/tmp/cvs-serv9102/gen Modified Files: GBMonad.hs GenBind.hs Log Message: Made c2hs generate code that is compatible with GHC 6.00 (or the "new" FFI). GHC does not accept ForeignPtr as arguments anymore. Each call to a function which takes such an argument is now marshaled as follows: Instead of inserting just the function name, a lambda expression is emitted which strips off the newtype constructor if one was generated by c2hs. The resulting ForeignPtr is then converted to a pointer via withForeignPtr. For this to work, the constructor of the specific data type has to be in scope as well as the withForeignPtr function. Index: GBMonad.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/c2hs/gen/GBMonad.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GBMonad.hs 1 Oct 2002 15:17:07 -0000 1.2 +++ GBMonad.hs 9 Jul 2003 21:12:27 -0000 1.3 @@ -172,7 +172,7 @@ -- for type arguments to parametrised pointer types, ie, it holds for `res' -- in `Int -> IO res', but not in `Int -> Ptr res' -- -type PointerMap = FiniteMap (Bool, Ident) (String, String) +type PointerMap = FiniteMap (Bool, Ident) (CHSPtrType, String) -- map that maintains key information about some of the Haskell objects -- generated by c2hs @@ -296,7 +296,7 @@ -- add an entry to the pointer map -- -ptrMapsTo :: (Bool, Ident) -> (String, String) -> GB () +ptrMapsTo :: (Bool, Ident) -> (CHSPtrType, String) -> GB () (isStar, cName) `ptrMapsTo` hsRepr = transCT (\state -> (state { ptrmap = addToFM (isStar, cName) hsRepr (ptrmap state) @@ -304,7 +304,7 @@ -- query the pointer map -- -queryPtr :: (Bool, Ident) -> GB (Maybe (String, String)) +queryPtr :: (Bool, Ident) -> GB (Maybe (CHSPtrType, String)) queryPtr pcName = do fm <- readCT ptrmap return $ lookupFM fm pcName Index: GenBind.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/c2hs/gen/GenBind.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GenBind.hs 3 Nov 2002 20:35:41 -0000 1.3 +++ GenBind.hs 9 Jul 2003 21:12:27 -0000 1.4 @@ -342,7 +342,7 @@ do traceInfoType decl <- findAndChaseDecl ide False True -- no indirection, but shadows - ty <- extractSimpleType False pos decl + ty <- extractSimpleType pos decl traceInfoDump decl ty return $ "(" ++ showExtType ty ++ ")" where @@ -390,7 +390,6 @@ hsLexeme = ideLexeme `maybe` identToLexeme $ oalias cdecl' = ide `simplifyDecl` cdecl callImport hook isPure isUns ideLexeme hsLexeme cdecl' pos - return hsLexeme where traceEnter = traceGenBind $ "** Call hook for `" ++ identToLexeme ide ++ "':\n" @@ -418,7 +417,7 @@ traceInfoField (decl, offsets) <- accessPath path traceDepth offsets - ty <- extractSimpleType False pos decl + ty <- extractSimpleType pos decl traceValueType ty setGet pos access offsets ty where @@ -616,20 +615,44 @@ -- want to import into Haskell land -- callImport :: CHSHook -> Bool -> Bool -> String -> String -> CDecl -> Position - -> GB () + -> GB String callImport hook isPure isUns ideLexeme hsLexeme cdecl pos = do -- compute the external type from the declaration, get the library, and -- delay the foreign export declaration -- - extType <- extractFunType pos cdecl isPure + (foreignSyn, extType) <- extractFunType pos cdecl isPure lib <- getLibrary delayCode hook (foreignImport lib ideLexeme hsLexeme isUns extType) traceFunType extType + -- if the type contained ForeignPtrs, generate a lambda expression + -- which strips off the constructors + if any isJust foreignSyn + then createLambdaExpr foreignSyn + else return hsLexeme where - traceFunType et = traceGenBind $ + createLambdaExpr :: [Maybe String] -> GB String + createLambdaExpr foreignVec = return $ + "(\\" ++ + unwords (zipWith wrPattern foreignVec [1..])++ " -> "++ + concat (zipWith wrForPtr foreignVec [1..])++hsLexeme++" "++ + unwords (zipWith (\s n -> + (if isJust s then "argPtr" else "arg")++ + show n) + foreignVec [1..])++")" + + wrPattern (Just syn) n = "("++syn++" arg"++show n++")" + wrPattern Nothing n = "arg"++show n + + wrForPtr (Just _) n = "withForeignPtr arg"++show n++" $ \\argPtr"++ + show n++" ->" + wrForPtr Nothing n = "" + + + traceFunType et = traceGenBind $ "Imported function type: " ++ showExtType et ++ "\n" + -- Haskell code for the foreign import declaration needed by a call hook -- -- * appends a configuration dependent library suffix `dlsuffix' @@ -771,7 +794,8 @@ addDftMarshaller :: Position -> [CHSParm] -> CHSParm -> CDecl -> GB ([CHSParm], CHSParm, Bool) addDftMarshaller pos parms parm cdecl = do - (resTy, argTys) <- splitFunTy `liftM` extractFunType pos cdecl True + (foreignVec, fType) <- extractFunType pos cdecl True + let (resTy, argTys) = splitFunTy fType (parm' , isImpure1) <- checkResMarsh parm resTy (parms', isImpure2) <- addDft parms argTys return (parms', parm', isImpure1 || isImpure2) @@ -1014,7 +1038,7 @@ checkType (IOET _ ) = interr "GenBind.setGet: Illegal \ \type!" checkType (UnitET ) = voidFieldErr pos - checkType (DefinedET _ _ ) = return Nothing-- can't check further + checkType (DefinedET _ _ _) = return Nothing-- can't check further checkType (PrimET (CUFieldPT bs)) = return $ Just (False, bs) checkType (PrimET (CSFieldPT bs)) = return $ Just (True , bs) checkType _ = return Nothing @@ -1047,9 +1071,8 @@ _ -> show ptrKind ptrType = ptrCon ++ " (" ++ ptrArg ++ ")" thePtr = (isStar, cNameFull) - case ptrKind of - CHSForeignPtr -> thePtr `ptrMapsTo` (hsName, "Ptr (" ++ ptrArg ++ ")") - _ -> thePtr `ptrMapsTo` (hsName, hsName) + + thePtr `ptrMapsTo` (ptrKind, hsName) return $ if isNewtype then "newtype " ++ hsName ++ " = " ++ hsName ++ " (" ++ ptrType ++ ")" @@ -1135,7 +1158,8 @@ -- declaration; the latter is for functions interpreting the following -- structure; an aliased type is always a pointer type that is contained in -- the pointer map (and got there either from a .chi or from a pointer hook --- in the same module) +-- in the same module); in addition to this, a third field yields whether +-- this synonym contains a Ptr, a StablePtr or a ForeignPtr. -- -- * the representation for pointers does not distinguish between normal, -- function, foreign, and stable pointers; function pointers are identified @@ -1145,7 +1169,7 @@ data ExtType = FunET ExtType ExtType -- function | IOET ExtType -- operation with side effect | PtrET ExtType -- typed pointer - | DefinedET CDecl String -- aliased type + | DefinedET CDecl String CHSPtrType-- aliased type | PrimET CPrimType -- basic C type | UnitET -- void @@ -1153,7 +1177,7 @@ (FunET t1 t2) == (FunET t1' t2') = t1 == t1' && t2 == t2' (IOET t ) == (IOET t' ) = t == t' (PtrET t ) == (PtrET t' ) = t == t' - (DefinedET _ s ) == (DefinedET _ s' ) = s == s' + (DefinedET _ s _) == (DefinedET _ s' _) = s == s' (PrimET t ) == (PrimET t' ) = t == t' UnitET == UnitET = True @@ -1185,7 +1209,7 @@ in "(" ++ ptrCon ++ " " ++ showExtType t ++ ")" -showExtType (DefinedET _ str) = "(" ++ str ++ ")" +showExtType (DefinedET _ str _) = "(" ++ str ++ ")" showExtType (PrimET CPtrPT) = "(Ptr ())" showExtType (PrimET CFunPtrPT) = "(FunPtr ())" showExtType (PrimET CCharPT) = "CChar" @@ -1216,7 +1240,12 @@ -- * the caller has to guarantee that the object does indeed refer to a -- function -- -extractFunType :: Position -> CDecl -> Bool -> GB ExtType +-- * the returned list contains an entry for each function argument which +-- contains (Just s) for each ForeignPtr synonym s. All ForeignPtrs +-- are changed into (Ptr s) in the returned function type +-- +extractFunType :: Position -> CDecl -> Bool + -> GB ([Maybe String], ExtType) extractFunType pos cdecl isPure = do -- remove all declarators except that of the function we are processing; @@ -1227,7 +1256,9 @@ let (args, resultDecl, variadic) = funResultAndArgs cdecl when variadic $ variadicErr pos cpos - preResultType <- extractSimpleType True pos resultDecl + preResultType <- liftM (snd . expandForeignPtrs) $ + extractSimpleType pos resultDecl + -- -- we can now add the `IO' monad if this is no pure function -- @@ -1239,11 +1270,20 @@ -- prototype with `void' as its single argument declares a nullary -- function) -- - argTypes <- mapM (extractSimpleType False pos) args - return $ foldr FunET resultType argTypes + (foreignSyn, argTypes) <- liftM (unzip . map expandForeignPtrs) $ + mapM (extractSimpleType pos) args + + + return (foreignSyn, foldr FunET resultType argTypes) where cpos = posOf cdecl + -- change synonyms for ForeignPtrs into explicit Ptrs + expandForeignPtrs :: ExtType -> (Maybe String, ExtType) + expandForeignPtrs all@(DefinedET cdecl name CHSForeignPtr) = + (Just name, PtrET all) + expandForeignPtrs all = (Nothing, all) + -- compute a non-struct/union type from the given declaration -- -- * the declaration may have at most one declarator @@ -1251,18 +1291,17 @@ -- * C functions are represented as `Ptr (FunEt ...)' or `Addr' if in -- compatibility mode (ie, `--old-ffi=yes') -- -extractSimpleType :: Bool -> Position -> CDecl -> GB ExtType -extractSimpleType isResult pos cdecl = +extractSimpleType :: Position -> CDecl -> GB ExtType +extractSimpleType pos cdecl = do traceEnter - ct <- extractCompType isResult cdecl + ct <- extractCompType cdecl case ct of ExtType et -> return et SUType _ -> illegalStructUnionErr (posOf cdecl) pos where traceEnter = traceGenBind $ - "Entering `extractSimpleType' (" ++ (if isResult then "" else "not ") - ++ "for a result)...\n" + "Entering `extractSimpleType'...\n" -- compute a Haskell type for a type referenced in a C pointer type -- @@ -1270,11 +1309,9 @@ -- -- * struct/union types are mapped to `()' -- --- * NB: this is by definition not a result type --- extractPtrType :: CDecl -> GB ExtType extractPtrType cdecl = do - ct <- extractCompType False cdecl + ct <- extractCompType cdecl case ct of ExtType et -> return et SUType _ -> return UnitET @@ -1289,8 +1326,9 @@ -- -- * typedef'ed types are chased -- --- * the first argument specifies whether the type specifies the result of a --- function (this is only applicable to direct results and not to type +-- * the first argument specifies whether Haskell newtype wrappers should +-- be stripped off the returned type +-- (this is only applicable to direct results and not to type -- parameters for pointers that are a result) -- -- * takes the pointer map into account @@ -1302,8 +1340,8 @@ -- `extractCompType' from looking further "into" the -- definition of that pointer. -- -extractCompType :: Bool -> CDecl -> GB CompType -extractCompType isResult cdecl@(CDecl specs declrs ats) = +extractCompType :: CDecl -> GB CompType +extractCompType cdecl@(CDecl specs declrs ats) = if length declrs > 1 then interr "GenBind.extractCompType: Too many declarators!" else case declrs of @@ -1325,7 +1363,7 @@ case oHsRepr of Just repr -> ptrAlias repr -- got an alias Nothing -> do -- no alias => recurs - ct <- extractCompType False cdecl' + ct <- extractCompType cdecl' returnX $ case ct of ExtType et -> PtrET et SUType _ -> PtrET UnitET @@ -1337,7 +1375,7 @@ -- funType = do traceFunType - et <- extractFunType (posOf cdecl) cdecl False + (_, et) <- extractFunType (posOf cdecl) cdecl False returnX et -- -- handle all types, which are not obviously pointers or functions @@ -1357,13 +1395,12 @@ ide `simplifyDecl` cdecl' sdecl = CDecl specs [(declr, init, size)] at -- propagate `size' down (slightly kludgy) - extractCompType isResult sdecl + extractCompType sdecl Just repr -> ptrAlias repr -- found a pointer hook alias -- -- compute the result for a pointer alias -- - ptrAlias (repr1, repr2) = - returnX $ DefinedET cdecl (if isResult then repr2 else repr1) + ptrAlias (ptrTy, alias) = returnX $ DefinedET cdecl alias ptrTy -- -- wrap an `ExtType' into a `CompType' and convert parametrised pointers -- to `Addr' if needed @@ -1587,7 +1624,7 @@ -- sizeAlignOf cdecl = do - ct <- extractCompType False cdecl + ct <- extractCompType cdecl case ct of ExtType (FunET _ _ ) -> return (bitSize CFunPtrPT, alignment CFunPtrPT) @@ -1596,7 +1633,7 @@ | isFunExtType t -> return (bitSize CFunPtrPT, alignment CFunPtrPT) | otherwise -> return (bitSize CPtrPT, alignment CPtrPT) - ExtType (DefinedET _ _ ) -> return (bitSize CPtrPT, alignment CPtrPT) + ExtType (DefinedET _ _ _ ) -> return (bitSize CPtrPT, alignment CPtrPT) -- FIXME: The defined type could be a function pointer!!! ExtType (PrimET pt ) -> return (bitSize pt, alignment pt) ExtType UnitET -> voidFieldErr (posOf cdecl) |
From: <as...@us...> - 2003-07-04 08:27:03
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv17906 Modified Files: configure.in ChangeLog Log Message: ghc-pkg behaves differently for ghc version 6 Index: configure.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.in,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- configure.in 3 Jul 2003 05:19:36 -0000 1.24 +++ configure.in 4 Jul 2003 08:27:00 -0000 1.25 @@ -158,6 +158,10 @@ AC_MSG_ERROR([ghc-pkg not found. (But ghc exists!?)]); fi +dnl Determine how to list local packages with ghc-pkg. +GHCPKG_LISTLOCAL="-l"; +GTKHS_PROG_CHECK_VERSION($GHC_VERSION, -ge, 6.00.0, [GHCPKG_LISTLOCAL="-L"]) + dnl Optimise Haskell by default and give sufficient space. if test -z "$HCFLAGS"; then HCFLAGS=" -O -H180m " @@ -436,6 +440,7 @@ AC_SUBST(MULTIPLE_CHS) AC_SUBST(FOUR_WORD_CALLBACK) AC_SUBST(NEW_MODULE_SYSTEM) +AC_SUBST(GHCPKG_LISTLOCAL) AC_SUBST(LOCALPKGCONF) AC_SUBST(HCFLAGS) AC_SUBST(C2HS) Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- ChangeLog 3 Jul 2003 05:26:30 -0000 1.77 +++ ChangeLog 4 Jul 2003 08:27:00 -0000 1.78 @@ -1,3 +1,10 @@ +2003-07-04 Axel Simon <A....@ke...> + + * configure.in mk/config.mk.in mk/library.mk: Turned the + --list-packages into a parameter which is determined by + configure. The reason is that ghc 6 has a new semantic for + ghc-pkg's --list-packages option. + 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets @@ -52,6 +59,14 @@ * gtk/treeList/TreeView.chs: Changed the return type of the onTestCollapseRow and onTestExpandRow signals. Patch submitted by Duncan Coutts <du...@co...>. + +2003-05-19 Axel Simon <A....@ke...> + + * configure.in, mk/config.mk.in: Changed SGML_CATALOG_FILES to + XML_CATALOG_FILES. + + * gtk/general/Gtk.hs: removed the hiding clause from Image. Don't + know why it was there in the first place. 2003-05-18 Jens Petersen <pet...@re...> |
From: <as...@us...> - 2003-07-04 08:27:03
|
Update of /cvsroot/gtk2hs/gtk2hs/mk In directory sc8-pr-cvs1:/tmp/cvs-serv17906/mk Modified Files: config.mk.in library.mk Log Message: ghc-pkg behaves differently for ghc version 6 Index: config.mk.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/config.mk.in,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- config.mk.in 19 May 2003 16:36:36 -0000 1.16 +++ config.mk.in 4 Jul 2003 08:27:00 -0000 1.17 @@ -110,6 +110,8 @@ BROKENCB = @FOUR_WORD_CALLBACK@ +LISTLOCAL = @GHCPKG_LISTLOCAL@ + ifeq ($(WIN32),yes) HC_FLAGS += -DWIN32 endif Index: library.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/library.mk,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- library.mk 16 May 2003 05:53:33 -0000 1.14 +++ library.mk 4 Jul 2003 08:27:00 -0000 1.15 @@ -10,7 +10,7 @@ $(subst $(SPACE),\"$(COMMA)\",$(sort $(1))))) noinplace : inplaceinit - @if $(PKG) -f $(LOCALPKGCONF) -l | $(GREP) $(PACKAGENAME) \ + @if $(PKG) -f $(LOCALPKGCONF) $(LISTLOCAL) | $(GREP) $(PACKAGENAME) \ > /dev/null; then \ echo Removing old local entry for \"$(PACKAGENAME)\".; \ $(PKG) -f $(LOCALPKGCONF) -r $(PACKAGENAME) > /dev/null; \ |
From: <ju...@us...> - 2003-07-03 05:26:33
|
Update of /cvsroot/gtk2hs/gtk2hs/mogul In directory sc8-pr-cvs1:/tmp/cvs-serv8226/mogul Modified Files: Makefile Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mogul/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 21 Jul 2002 16:59:05 -0000 1.3 +++ Makefile 3 Jul 2003 05:26:30 -0000 1.4 @@ -4,6 +4,8 @@ PACKAGENAME = mogul +INSTALLDIR = mogul + MAIN = Mogul.hs ifeq ($(strip $(NEW_MODULE_SYS)),yes) |
From: <ju...@us...> - 2003-07-03 05:26:33
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv8226 Modified Files: ChangeLog Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- ChangeLog 3 Jul 2003 05:19:36 -0000 1.76 +++ ChangeLog 3 Jul 2003 05:26:30 -0000 1.77 @@ -1,5 +1,8 @@ 2003-07-03 Jens Petersen <pet...@ha...> + * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets + installed in its own subdir. + * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. |
From: <ju...@us...> - 2003-07-03 05:19:39
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/layout In directory sc8-pr-cvs1:/tmp/cvs-serv7385/gtk/layout Modified Files: Notebook.chs Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. * gtk/general/Gtk.hs: Import and re-export Gdk. * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require ghc-pkg. (build): Configure --with-hc. (preun): Ignore package removal errors. * configure.in: --with-hc no longer requires a full-path, when requested compiler is in path. When looking for HOpenGL pass "-l" to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built with ghc5. * VERSION: Bump version to 0.9.3.50. * Makefile (dist): LN already includes the "-s" option. Index: Notebook.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/Notebook.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Notebook.chs 12 Jul 2002 13:09:23 -0000 1.3 +++ Notebook.chs 3 Jul 2003 05:19:36 -0000 1.4 @@ -68,6 +68,7 @@ notebookGetCurrentPage, notebookGetMenuLabel, notebookGetNthPage, + notebookGetNPages, notebookGetTabLabel, Packing(..), PackType(..), notebookQueryTabLabelPacking, @@ -320,6 +321,12 @@ (toNotebook nb) (fromIntegral pos) if wPtr==nullPtr then return Nothing else liftM Just $ makeNewObject mkWidget $ return wPtr + +-- @method notebookGetNPages@ Get the number of pages in a notebook. +-- +notebookGetNPages :: NotebookClass nb => nb -> IO Int +notebookGetNPages nb = liftM fromIntegral $ + {#call unsafe notebook_get_n_pages#} (toNotebook nb) -- @method notebookGetTabLabel@ Extract the tab label from the given -- @ref arg child@. |
From: <ju...@us...> - 2003-07-03 05:19:39
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1:/tmp/cvs-serv7385/gtk/general Modified Files: Gtk.hs Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. * gtk/general/Gtk.hs: Import and re-export Gdk. * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require ghc-pkg. (build): Configure --with-hc. (preun): Ignore package removal errors. * configure.in: --with-hc no longer requires a full-path, when requested compiler is in path. When looking for HOpenGL pass "-l" to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built with ghc5. * VERSION: Bump version to 0.9.3.50. * Makefile (dist): LN already includes the "-s" option. Index: Gtk.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/Gtk.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Gtk.hs 19 May 2003 16:36:36 -0000 1.17 +++ Gtk.hs 3 Jul 2003 05:19:36 -0000 1.18 @@ -56,6 +56,7 @@ module Region, module GC, module Pixbuf, + module Gdk, -- windows module Dialog, module FileSel, @@ -183,6 +184,7 @@ import Region hiding (makeNewRegion) import GC import Pixbuf +import Gdk -- windows import Dialog import FileSel |
From: <ju...@us...> - 2003-07-03 05:19:39
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/gdk In directory sc8-pr-cvs1:/tmp/cvs-serv7385/gtk/gdk Modified Files: Drawable.chs Added Files: Gdk.chs Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. * gtk/general/Gtk.hs: Import and re-export Gdk. * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require ghc-pkg. (build): Configure --with-hc. (preun): Ignore package removal errors. * configure.in: --with-hc no longer requires a full-path, when requested compiler is in path. When looking for HOpenGL pass "-l" to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built with ghc5. * VERSION: Bump version to 0.9.3.50. * Makefile (dist): LN already includes the "-s" option. --- NEW FILE: Gdk.chs --- -- -*-haskell-*- -- GIMP Toolkit (GTK) @Gdk@ -- -- Author : Jens Petersen <pet...@ha...> -- Created: 2003-06-06 -- -- Version $Revision: 1.1 $ from $Date: 2003/07/03 05:19:36 $ -- -- Copyright (c) 2003 Jens-Ulrik Holger Petersen -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Library General Public -- License as published by the Free Software Foundation; either -- version 2 of the License, or (at your option) any later version. -- -- This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Library General Public License for more details. -- -- @description@ -------------------------------------------------------------- -- -- Gdk general functions. -- -- @documentation@ ------------------------------------------------------------ -- -- -- @todo@ --------------------------------------------------------------------- -- -- * Documentation -- module Gdk(beep) where {#context lib="libgdk" prefix ="gdk"#} beep :: IO () beep = {#call beep#} Index: Drawable.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Drawable.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Drawable.chs 16 May 2003 18:45:23 -0000 1.5 +++ Drawable.chs 3 Jul 2003 05:19:36 -0000 1.6 @@ -180,7 +180,7 @@ -- @ref arg srcWidth@ and @ref arg srcHeight@ specify what part of the -- @ref data Pixbuf@ should be rendered. The latter two values may be -- @literal -1@ in which case the width and height are taken from --- @ref arg src@. The image is placed at @ref arg destX@, @ref arg destY@. +-- @ref arg pb@. The image is placed at @ref arg destX@, @ref arg destY@. -- If you render parts of an image at a time, set @ref arg ditherX@ and -- @ref arg ditherY@ to the origin of the image you are rendering. -- |
From: <ju...@us...> - 2003-07-03 05:19:39
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv7385 Modified Files: ChangeLog Makefile VERSION configure.in gtk2hs.spec.in Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. * gtk/general/Gtk.hs: Import and re-export Gdk. * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require ghc-pkg. (build): Configure --with-hc. (preun): Ignore package removal errors. * configure.in: --with-hc no longer requires a full-path, when requested compiler is in path. When looking for HOpenGL pass "-l" to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built with ghc5. * VERSION: Bump version to 0.9.3.50. * Makefile (dist): LN already includes the "-s" option. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- ChangeLog 23 May 2003 01:01:24 -0000 1.75 +++ ChangeLog 3 Jul 2003 05:19:36 -0000 1.76 @@ -1,3 +1,30 @@ +2003-07-03 Jens Petersen <pet...@ha...> + + * gtk/layout/Notebook.chs (notebookGetNPages): New function. + Export it. + + * gtk/general/Gtk.hs: Import and re-export Gdk. + + * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. + + * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. + + * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. + + * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require + ghc-pkg. + (build): Configure --with-hc. + (preun): Ignore package removal errors. + + * configure.in: --with-hc no longer requires a full-path, when + requested compiler is in path. When looking for HOpenGL pass "-l" + to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built + with ghc5. + + * VERSION: Bump version to 0.9.3.50. + + * Makefile (dist): LN already includes the "-s" option. + 2003-05-23 Jens Petersen <pet...@re...> * gendoc/XMLwrite.hs (makeSymDescr): Move colspecs inside the @@ -23,10 +50,6 @@ onTestCollapseRow and onTestExpandRow signals. Patch submitted by Duncan Coutts <du...@co...>. -2003-05-17 Axel Simon <A....@ke...> - - * gtk/gdk/Pixbuf.chs: Fixed documentation on creating inline pictures. - 2003-05-18 Jens Petersen <pet...@re...> * gtk/pango/PangoLayout.chs (layoutIterGetLineExtents): Keep last @@ -38,6 +61,12 @@ * doc/mogul.xml: Docbook 4.2. 2003-05-17 Axel Simon <A....@ke...> + + * gtk/gdk/Pixbuf.chs: Fixed documentation on creating inline pictures. + +2003-05-17 Axel Simon <A....@ke...> + + 0.9.3 release. * c2hs/base/syntax/Lexer.hs: There is a bug in either c2hs or the compiler when parsing the header files on PowerPC. I added a line Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile 23 May 2003 01:01:25 -0000 1.13 +++ Makefile 3 Jul 2003 05:19:36 -0000 1.14 @@ -94,7 +94,7 @@ dist : $(RM) -r $(TARNAME) $(RM) $(TARNAME).tar $(TARNAME).tar.gz - $(LN) -s . $(TARNAME) + $(LN) . $(TARNAME) $(strip $(TAR) cf $(addsuffix .tar,$(TARNAME)) \ $(addprefix $(TARNAME)/,$(EXTRA_TARFILES))) $(MAKE) -Cc2hs tarsource Index: VERSION =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/VERSION,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- VERSION 21 Mar 2003 10:52:25 -0000 1.4 +++ VERSION 3 Jul 2003 05:19:36 -0000 1.5 @@ -1 +1 @@ -0.9.3 +0.9.3.50 Index: configure.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.in,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- configure.in 19 May 2003 16:36:36 -0000 1.23 +++ configure.in 3 Jul 2003 05:19:36 -0000 1.24 @@ -101,7 +101,7 @@ dnl Select a specific Haskell compiler and/or flags. AC_ARG_WITH(hc, - [ --with-hc=HC use Haskell compiler HC (full path required)], + [ --with-hc=HC use Haskell compiler HC], [HC=$withval]) AC_ARG_WITH(hcflags, @@ -112,7 +112,7 @@ dnl Check for GHC-5.02 or greater. dnl (The next command is not executed, if $HC is already set.) -AC_PATH_PROG(HC, ghc, ghc-not-found) +AC_PATH_PROG(HC, [$HC ghc], ghc-not-found) if test $HC = ghc-not-found; then AC_MSG_ERROR([ Could not find GHC! This is the only supported compiler. @@ -201,7 +201,7 @@ dnl Reset the flag if HOpenGL is not installed FOUNDHOPENGL=yes; -$GHCPKG --list-packages | $GREP OpenGL > /dev/null || FOUNDHOPENGL=no; +$GHCPKG -l | $GREP OpenGL > /dev/null || FOUNDHOPENGL=no; if test x$FOUNDHOPENGL = xno; then ENABLE_OPENGL=no;fi; AC_MSG_RESULT($ENABLE_OPENGL) Index: gtk2hs.spec.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk2hs.spec.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gtk2hs.spec.in 23 May 2003 01:01:25 -0000 1.4 +++ gtk2hs.spec.in 3 Jul 2003 05:19:36 -0000 1.5 @@ -8,15 +8,16 @@ Summary: Haskell binding for the GIMP Toolkit (GTK2), a GUI library Name: gtk2hs Version: @VERSION@ -Release: 1.%(date +%%Y%%m%%d) +Release: 0.%(date +%%Y%%m%%d) Copyright: LGPL Group: Development/Libraries Source: gtk2hs-%{version}.tar.gz URL: http://gtk2hs.sourceforge.net/ BuildRoot: /var/tmp/gtk2hs-%{version}-%{release}-root +Requires: ghc5 = %{_ghc_version} Requires: gtk2 -PreReq: ghc = %{_ghc_version} -BuildRequires: ghc = %{_ghc_version} gtk2-devel %{?_with_c2hs: c2hs >= 0.10.6} +Requires(post,preun): %{_bindir}/ghc-pkg-%{_ghc_version} +BuildRequires: ghc5 = %{_ghc_version} gtk2-devel %{?_with_c2hs: c2hs >= 0.10.6} %description A Gtk2 binding for the functional language Haskell featuring @@ -30,7 +31,7 @@ %setup -q %build -./configure %{?_with_c2hs} --with-hcflags="-O" --with-catalog=%{_datadir}/sgml/docbook/xmlcatalog --with-html=%{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl # --with-fo=%{_datadir}/sgml/docbook/xsl-stylesheets/fo/docbook.xsl +./configure %{?_with_c2hs} --with-hc=ghc-%{_ghc_version} --with-hcflags="-O" --with-catalog=%{_datadir}/sgml/docbook/xmlcatalog --with-html=%{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl # --with-fo=%{_datadir}/sgml/docbook/xsl-stylesheets/fo/docbook.xsl make prefix=%{_prefix} libdir=%{_libdir}/ghc-%{_ghc_version} %install @@ -51,8 +52,8 @@ %preun rm -f %{_libdir}/ghc-%{_ghc_version}/{%{name}/gtk2hs.o,mogul.o} if [ "$1" = 0 ]; then - ghc-pkg-%{_ghc_version} -r mogul - ghc-pkg-%{_ghc_version} -r gtk2 + ghc-pkg-%{_ghc_version} -r mogul || : + ghc-pkg-%{_ghc_version} -r gtk2 || : fi %files |
From: <ju...@us...> - 2003-07-03 05:19:39
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv7385/gtk Modified Files: Makefile Log Message: 2003-07-03 Jens Petersen <pet...@ha...> * mogul/Makefile (INSTALLDIR): Set to mogul, so that mogul gets installed in its own subdir. * gtk/layout/Notebook.chs (notebookGetNPages): New function. Export it. * gtk/general/Gtk.hs: Import and re-export Gdk. * gtk/gdk/Gdk.chs: New module for gdk.h. Currently just provides beep. * gtk/gdk/Drawable.chs (drawPixbuf): Doc fix: s/arg src/arg pb/. * gtk/Makefile: Define Pixbuf-HEADER and Gdk-HEADER. * gtk2hs.spec.in (Requires): Require ghc5. Post and preun require ghc-pkg. (build): Configure --with-hc. (preun): Ignore package removal errors. * configure.in: --with-hc no longer requires a full-path, when requested compiler is in path. When looking for HOpenGL pass "-l" to ghc-pkg, since "--list-packages" confuses ghc-pkg-6.0 built with ghc5. * VERSION: Bump version to 0.9.3.50. * Makefile (dist): LN already includes the "-s" option. Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/Makefile,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Makefile 16 May 2003 18:45:22 -0000 1.20 +++ Makefile 3 Jul 2003 05:19:36 -0000 1.21 @@ -57,6 +57,8 @@ GC-HEADER = gdk/gdkgc.h Keys-HEADER = gdk/gdkkeys.h Drawable-HEADER = gdk/gdkdrawable.h +Pixbuf-HEADER = gdk/gdkpixbuf.h +Gdk-HEADER = gdk/gdk.h # general Gtk modules IconFactory-HEADER = gtk/gtkiconfactory.h Signal-HEADER = gtk/gtksignal.h |
From: <ju...@us...> - 2003-05-23 01:01:28
|
Update of /cvsroot/gtk2hs/gtk2hs/gendoc In directory sc8-pr-cvs1:/tmp/cvs-serv16016/gendoc Modified Files: XMLwrite.hs Log Message: 2003-05-23 Jens Petersen <pet...@re...> * gendoc/XMLwrite.hs (makeSymDescr): Move colspecs inside the tgroup. * doc/Makefile (html%): Make xsltproc write output directly to subdirectory. Create the directory first if necessary. (fo%): Ditto. (clean): Remove reference xml files. * gtk2hs.spec.in (build): Pass docbook catalog and html xsl to configure and build html docs. (post): Give "-g" option to ghc-pkg to have ghci object files generated. (preun): Always remove any old ghci object files. (files): Include gtk and mogul docs in doc dir. * Makefile (EXTRA_TARFILES): Include gtk2hs.spec after all. Index: XMLwrite.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gendoc/XMLwrite.hs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XMLwrite.hs 17 May 2003 19:29:37 -0000 1.9 --- XMLwrite.hs 23 May 2003 01:01:25 -0000 1.10 *************** *** 267,278 **** Attribute "rowsep" "0" ] ( ! Element "colspec" [] []: ! replicate noOfCols ! (Element "colspec" [Attribute "colwidth" "100pt"] [])++[ Element "tgroup" [ Attribute "align" "center", Attribute "cols" (show noOfCols) ! ] [ ! Element "tbody" [ Attribute "valign" "middle" ] ( --- 267,279 ---- Attribute "rowsep" "0" ] ( ! [ Element "tgroup" [ Attribute "align" "center", Attribute "cols" (show noOfCols) ! ] ( ! [Element "colspec" [] []] ++ ! (replicate noOfCols ! (Element "colspec" [Attribute "colwidth" "100pt"] [])) ++ ! [Element "tbody" [ Attribute "valign" "middle" ] ( *************** *** 285,289 **** ):map argsToXML (transpose args) ) ! ] ]):docuToXML (mName,mI) thorough ) --- 286,290 ---- ):map argsToXML (transpose args) ) ! ]) ]):docuToXML (mName,mI) thorough ) |
From: <ju...@us...> - 2003-05-23 01:01:28
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv16016 Modified Files: ChangeLog Makefile gtk2hs.spec.in Log Message: 2003-05-23 Jens Petersen <pet...@re...> * gendoc/XMLwrite.hs (makeSymDescr): Move colspecs inside the tgroup. * doc/Makefile (html%): Make xsltproc write output directly to subdirectory. Create the directory first if necessary. (fo%): Ditto. (clean): Remove reference xml files. * gtk2hs.spec.in (build): Pass docbook catalog and html xsl to configure and build html docs. (post): Give "-g" option to ghc-pkg to have ghci object files generated. (preun): Always remove any old ghci object files. (files): Include gtk and mogul docs in doc dir. * Makefile (EXTRA_TARFILES): Include gtk2hs.spec after all. Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** ChangeLog 22 May 2003 09:19:18 -0000 1.74 --- ChangeLog 23 May 2003 01:01:24 -0000 1.75 *************** *** 1,2 **** --- 1,21 ---- + 2003-05-23 Jens Petersen <pet...@re...> + + * gendoc/XMLwrite.hs (makeSymDescr): Move colspecs inside the + tgroup. + + * doc/Makefile (html%): Make xsltproc write output directly to + subdirectory. Create the directory first if necessary. + (fo%): Ditto. + (clean): Remove reference xml files. + + * gtk2hs.spec.in (build): Pass docbook catalog and html xsl to + configure and build html docs. + (post): Give "-g" option to ghc-pkg to have ghci object files + generated. + (preun): Always remove any old ghci object files. + (files): Include gtk and mogul docs in doc dir. + + * Makefile (EXTRA_TARFILES): Include gtk2hs.spec after all. + 2003-05-22 Axel Simon <A....@ke...> *************** *** 7,11 **** 2003-05-17 Axel Simon <A....@ke...> ! * gtk/gdk/Pixbuf.chs: Fixed dcumentation on creating inline pictures. 2003-05-18 Jens Petersen <pet...@re...> --- 26,30 ---- 2003-05-17 Axel Simon <A....@ke...> ! * gtk/gdk/Pixbuf.chs: Fixed documentation on creating inline pictures. 2003-05-18 Jens Petersen <pet...@re...> Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile 16 May 2003 06:30:07 -0000 1.12 --- Makefile 23 May 2003 01:01:25 -0000 1.13 *************** *** 90,94 **** mk/config.mk.in mk/common.mk mk/application.mk \ mk/library.mk mk/chsDepend.in install-sh \ ! config.sub config.guess gtk2hs.spec.in ) dist : --- 90,94 ---- mk/config.mk.in mk/common.mk mk/application.mk \ mk/library.mk mk/chsDepend.in install-sh \ ! config.sub config.guess gtk2hs.spec.in gtk2hs.spec ) dist : Index: gtk2hs.spec.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk2hs.spec.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtk2hs.spec.in 16 May 2003 05:53:33 -0000 1.3 --- gtk2hs.spec.in 23 May 2003 01:01:25 -0000 1.4 *************** *** 31,37 **** %build ! ./configure %{?_with_c2hs} --with-hcflags="-O" ! make BUILDDOCS=no prefix=%{_prefix} libdir=%{_libdir}/ghc-%{_ghc_version} ! #make -Cdoc htmlGTK %install --- 31,36 ---- %build ! ./configure %{?_with_c2hs} --with-hcflags="-O" --with-catalog=%{_datadir}/sgml/docbook/xmlcatalog --with-html=%{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl # --with-fo=%{_datadir}/sgml/docbook/xsl-stylesheets/fo/docbook.xsl ! make prefix=%{_prefix} libdir=%{_libdir}/ghc-%{_ghc_version} %install *************** *** 47,54 **** # %{_libdir}/ghc-%{_ghc_version}/{%{name}/gtk2.conf,mogul.conf} ! ghc-pkg-%{_ghc_version} -u -i %{_libdir}/ghc-%{_ghc_version}/%{name}/gtk2.conf ! ghc-pkg-%{_ghc_version} -u -i %{_libdir}/ghc-%{_ghc_version}/mogul.conf %preun if [ "$1" = 0 ]; then ghc-pkg-%{_ghc_version} -r mogul --- 46,54 ---- # %{_libdir}/ghc-%{_ghc_version}/{%{name}/gtk2.conf,mogul.conf} ! ghc-pkg-%{_ghc_version} -u -g -i %{_libdir}/ghc-%{_ghc_version}/%{name}/gtk2.conf ! ghc-pkg-%{_ghc_version} -u -g -i %{_libdir}/ghc-%{_ghc_version}/mogul.conf %preun + rm -f %{_libdir}/ghc-%{_ghc_version}/{%{name}/gtk2hs.o,mogul.o} if [ "$1" = 0 ]; then ghc-pkg-%{_ghc_version} -r mogul *************** *** 60,70 **** %doc ChangeLog TODO AUTHORS COPYING.LIB %doc demo/*/*.hs ! #%doc doc/GTK %{_prefix}/lib/* %changelog * Thu May 15 2003 Jens Petersen <pet...@re...> - use new DESTDIR make variable, so no longer need to fix config files in post - remove buildroot before install * Fri Jan 10 2003 Jens Petersen <pet...@ha...> --- 60,77 ---- %doc ChangeLog TODO AUTHORS COPYING.LIB %doc demo/*/*.hs ! %doc doc/GTK ! %doc doc/MOGUL %{_prefix}/lib/* %changelog + * Wed May 21 2003 Jens Petersen <pet...@re...> + - add -g option to ghc-pkg -u so that ghci object gets generated + - delete them when uninstalling + - build and include mogul documentation + * Thu May 15 2003 Jens Petersen <pet...@re...> - use new DESTDIR make variable, so no longer need to fix config files in post - remove buildroot before install + - build and include gtk docs * Fri Jan 10 2003 Jens Petersen <pet...@ha...> |
From: <ju...@us...> - 2003-05-23 01:01:28
|
Update of /cvsroot/gtk2hs/gtk2hs/doc In directory sc8-pr-cvs1:/tmp/cvs-serv16016/doc Modified Files: Makefile Log Message: 2003-05-23 Jens Petersen <pet...@re...> * gendoc/XMLwrite.hs (makeSymDescr): Move colspecs inside the tgroup. * doc/Makefile (html%): Make xsltproc write output directly to subdirectory. Create the directory first if necessary. (fo%): Ditto. (clean): Remove reference xml files. * gtk2hs.spec.in (build): Pass docbook catalog and html xsl to configure and build html docs. (post): Give "-g" option to ghc-pkg to have ghci object files generated. (preun): Always remove any old ghci object files. (files): Include gtk and mogul docs in doc dir. * Makefile (EXTRA_TARFILES): Include gtk2hs.spec after all. Index: Makefile =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/doc/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 16 May 2003 22:25:15 -0000 1.6 --- Makefile 23 May 2003 01:01:25 -0000 1.7 *************** *** 54,67 **** html% : reference%.xml $(strip XML_CATALOG_FILES=$(CATALOGS) $(XSLTPROC) \ ! --param use.id.as.filename 1 $(XSLTHTML) $(INPUT_$*)) ! mkdir $* || exit 0 ! mv *.html $* fo% : reference%.xml $(strip XML_CATALOG_FILES=$(CATALOGS) $(XSLTPROC) \ ! -o $(OUTPUT_$*) $(XSLTFO) $(INPUT_$*)) ! mkdir $* || exit 0 ! mv *.fo $* .PHONY: $(TOP)/$(GENDOC) --- 54,65 ---- html% : reference%.xml + mkdir -p $* $(strip XML_CATALOG_FILES=$(CATALOGS) $(XSLTPROC) \ ! --param use.id.as.filename 1 -o $*/ $(XSLTHTML) $(INPUT_$*)) fo% : reference%.xml + mkdir -p $* $(strip XML_CATALOG_FILES=$(CATALOGS) $(XSLTPROC) \ ! -o $*/ $(XSLTFO) $(INPUT_$*)) .PHONY: $(TOP)/$(GENDOC) *************** *** 74,77 **** --- 72,76 ---- clean : rm -rf MOGUL GTK + rm -f referenceGTK.xml referenceMOGUL.xml tarsource : |