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: <ju...@us...> - 2003-07-10 00:45:59
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/scrolling In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/scrolling Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/scrolling/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:45 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -1,3 +1,4 @@ HScrollbar.hs ScrolledWindow.hs VScrollbar.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:59
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/windows In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/windows Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/windows/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:45 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:52 -0000 1.4 @@ -2,3 +2,4 @@ FileSel.hs Plug.hs Window.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:59
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/treeList In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/treeList Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/treeList/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:45 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:52 -0000 1.4 @@ -9,3 +9,4 @@ TreeStore.hs TreeView.hs TreeViewColumn.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:58
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/ornaments In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/ornaments Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/ornaments/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -1,3 +1,4 @@ Frame.hs HSeparator.hs VSeparator.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:58
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/pango In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/pango Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/pango/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -1,3 +1,4 @@ PangoLayout.hs PangoTypes.hs Rendering.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:55
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/menuComboToolbar Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/menuComboToolbar/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -9,3 +9,4 @@ RadioMenuItem.hs TearoffMenuItem.hs Toolbar.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:55
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/misc In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/misc Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/misc/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -6,3 +6,4 @@ HandleBox.hs Tooltips.hs Viewport.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:54
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/layout In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/layout Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:51 -0000 1.4 @@ -7,3 +7,4 @@ Table.hs VBox.hs VPaned.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:54
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/gdk In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/gdk Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -1,6 +1,7 @@ Drawable.hs Events.hs GC.hs +Gdk.hs GdkEnums.hs GdkKeys.hs Keys.hs |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/abstract In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/abstract Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -6,3 +6,4 @@ Range.hs Scale.hs Widget.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/glib In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/glib Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/glib/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -3,3 +3,4 @@ GType.hs GValue.hs GValueTypes.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/entry In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/entry Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -2,3 +2,4 @@ HScale.hs SpinButton.hs VScale.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/embedding In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/embedding Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/embedding/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -1,3 +1,4 @@ Embedding.hs Plug.hs Socket.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/display In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/display Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -3,3 +3,4 @@ Label.hs ProgressBar.hs Statusbar.hs +*.h |
From: <ju...@us...> - 2003-07-10 00:45:53
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/buttons In directory sc8-pr-cvs1:/tmp/cvs-serv9887/gtk/buttons Modified Files: .cvsignore Log Message: - add *.h - add new .hs file to gtk/gdk/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 8 May 2003 11:28:44 -0000 1.3 +++ .cvsignore 10 Jul 2003 00:45:50 -0000 1.4 @@ -2,3 +2,4 @@ CheckButton.hs RadioButton.hs ToggleButton.hs +*.h |
From: <as...@us...> - 2003-07-09 22:43:19
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1:/tmp/cvs-serv25460 Modified Files: ChangeLog configure.in 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: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- ChangeLog 4 Jul 2003 08:27:00 -0000 1.78 +++ ChangeLog 9 Jul 2003 22:42:42 -0000 1.79 @@ -1,3 +1,71 @@ +2003-07-09 Axel Simon <A....@ke...> + + * c2hs/gen/GBMonad.hs, c2hs/gen/GenBind.hs: Applied the patch I + wrote for c2hs 0.11.5 which created code for ForeignPtrs which is + compatible with the new FFI of GHC 6.0. + + * abstract/Box.chs, abstract/Container.chs, abstract/Misc.chs, + abstract/Object.chs, abstract/Paned.chs, abstract/Range.chs, + abstract/Scale.chs, abstract/Scrollbar.hs, abstract/Separator.hs, + abstract/Widget.chs, buttons/Button.chs, buttons/CheckButton.chs, + buttons/RadioButton.chs, buttons/ToggleButton.chs, + display/AccelLabel.chs, display/Image.chs, display/Label.chs, + display/ProgressBar.chs, display/Statusbar.chs, + embedding/Embedding.hsc, embedding/Plug.chs, embedding/Socket.chs, + entry/Entry.chs, entry/HScale.chs, entry/SpinButton.chs, + entry/VScale.chs, gdk/DrawWindow.hs, gdk/Drawable.chs, + gdk/Events.hsc, gdk/GC.chs, gdk/Gdk.chs, gdk/GdkEnums.chs, + gdk/Keys.chs, gdk/Pixbuf.chs, gdk/Region.chs, general/Enums.chs, + general/General.chs, general/Gtk.hs, general/IconFactory.chs, + general/StockItems.hsc, general/Structs.hsc, general/Style.chs, + glib/GList.chs, glib/GObject.chs, glib/GType.chs, glib/GValue.chs, + glib/GValueTypes.chs, layout/Alignment.chs, + layout/AspectFrame.chs, layout/HBox.chs, layout/HPaned.chs, + layout/Layout.chs, layout/Notebook.chs, layout/Table.chs, + layout/VBox.chs, layout/VPaned.chs, + menuComboToolbar/CheckMenuItem.chs, menuComboToolbar/Combo.chs, + menuComboToolbar/ImageMenuItem.chs, menuComboToolbar/Menu.chs, + menuComboToolbar/MenuBar.chs, menuComboToolbar/MenuItem.chs, + menuComboToolbar/MenuShell.chs, menuComboToolbar/OptionMenu.chs, + menuComboToolbar/RadioMenuItem.chs, + menuComboToolbar/TearoffMenuItem.chs, + menuComboToolbar/Toolbar.chs, misc/Adjustment.chs, misc/Arrow.chs, + misc/Calendar.chs, misc/DrawingArea.chs, misc/EventBox.chs, + misc/HandleBox.chs, misc/Tooltips.chs, misc/Viewport.chs, + multiline/TextBuffer.chs, multiline/TextIter.chs, + multiline/TextMark.chs, multiline/TextTag.chs, + multiline/TextTagTable.chs, multiline/TextView.chs, + ornaments/Frame.chs, ornaments/HSeparator.chs, + ornaments/VSeparator.chs, pango/Markup.hs, pango/PangoLayout.chs, + pango/PangoTypes.chs, pango/Rendering.chs, + scrolling/HScrollbar.chs, scrolling/ScrolledWindow.chs, + scrolling/VScrollbar.chs, signals/HookGenerator.hs, + signals/Signal.chs-boot1, signals/Signal.chs-boot2, + treeList/CellRenderer.hs, treeList/CellRendererPixbuf.chs, + treeList/CellRendererText.chs, treeList/CellRendererToggle.chs, + treeList/ListStore.chs, treeList/StoreValue.hsc, + treeList/TreeModel.chs, treeList/TreeModelSort.chs, + treeList/TreeSelection.chs, treeList/TreeStore.chs, + treeList/TreeView.chs, treeList/TreeViewColumn.chs, + typehier/TypeGenerator.hs, windows/Dialog.chs, + windows/FileSel.chs, windows/Window.chs: 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. + 2003-07-04 Axel Simon <A....@ke...> * configure.in mk/config.mk.in mk/library.mk: Turned the Index: configure.in =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/configure.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- configure.in 4 Jul 2003 08:27:00 -0000 1.25 +++ configure.in 9 Jul 2003 22:42:43 -0000 1.26 @@ -89,7 +89,12 @@ WIN32=yes; fi; - +dnl determine a temporary directory for c2hs +TMPDIR="/tmp" +if test "$WIN32" = "yes"; then + TMPDIR="C:\TMP" +fi +AC_SUBST(TMPDIR) dnl Check for libraries. @@ -129,6 +134,13 @@ GTKHS_PROG_CHECK_VERSION($GHC_VERSION, -lt, 5.0.2, [ AC_MSG_ERROR([I need the FFI of GHC 5.02 upwards!])]) +dnl Calculate a version number with 3 digits (i.e. 502 for 5.2) +GHC_VERSION_NUMBER=`echo $GHC_VERSION | $SED "s/[[0-9]*\.\([0-9]]*\).*/0\1/"` +GHC_VERSION_NUMBER=`echo $GHC_VERSION_NUMBER | $SED "s/[[0-9]*\([0-9][0-9]]\)/\1/"` +GHC_VERSION_NUMBER=`echo $GHC_VERSION | $SED "s/\([[0-9]]\).*/\1/"`$GHC_VERSION_NUMBER + +C2HSFLAGS="$C2HSFLAGS -C-D__GLASGOW_HASKELL__=$GHC_VERSION_NUMBER" + dnl Check if the ghc compiler can generate dynamic callbacks with more than dnl 4 words worth of arguments. Hopefully one day the compiler will support dnl this. @@ -265,16 +277,16 @@ dnl use the version in the current search path (--with-c2hs-config=yes). dnl The default is to use the built-in version. AC_ARG_WITH(c2hs, - [ --with-c2hs=C2HS-CONFIG use an external C->Haskell installation (slower!)], + [ --with-c2hs=C2HS use an external C->Haskell installation (slower!)], [ case $withval in yes) { BUILT_IN_C2HS=no; - AC_PATH_PROG(C2HS_CONFIG, c2hs-config, notfound) - if test $C2HS_CONFIG = notfound; then + AC_PATH_PROG(C2HS, c2hs, notfound) + if test $C2HS = notfound; then AC_MSG_ERROR([C->Haskell was not found in current search path. Try compiling with the built-in c2hs by omitting - --with-c2hs-config=... when calling ./configure .]) + --with-c2hs=... when calling ./configure .]) fi } ;; no) { @@ -282,10 +294,10 @@ } ;; *) { BUILT_IN_C2HS=no; - AC_CHECK_FILE($withval,C2HS_CONFIG=$withval, + AC_CHECK_FILE($withval,C2HS=$withval, AC_MSG_ERROR([The specified C->Haskell tool was not found. Try compiling with the built-in c2hs by omitting - --with-c2hs-config=... when calling ./configure .])) + --with-c2hs=... when calling ./configure .])) } ;; esac ],[BUILT_IN_C2HS=yes]) @@ -316,31 +328,13 @@ dnl Find C->Haskell and check its version. dnl Check the version of c2hs AC_CACHE_CHECK([c2hs version], c2hs_version, [ - c2hs_version=`$C2HS_CONFIG --version | $SED "s/[\([0-9.]*\) .*]/\1/"`; + c2hs_version=`$C2HS --version | $SED "s/[[^0-9.]*\([0-9.]*\) .*]/\1/"`; ]) - GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.8.0, - AC_MSG_ERROR([You need C->Haskell version 0.8.0 upwards! + GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.11.6, + AC_MSG_ERROR([You need C->Haskell version 0.11.6 upwards! ** Download from \"http://www.cse.unsw.edu.au/~chak/haskell/c2hs/\". **])) - GTKHS_PROG_CHECK_VERSION($c2hs_version, -lt, 0.10.13, - AC_MSG_WARN([ - ************************************************************* - * You may run into problems with this version of C->Haskell.* - * If c2hs stumbles over VARARG macros edit * - * c2hs/toplevel/C2HSConfig.hs by changing the line * - * cppopts = "" * - * to * - * cppopts = "-x c" * - * and recompile and reinstall c2hs. This problem is fixed * - * in version 0.10.13 and above. * - *************************************************************])) dnl C->Haskell configuration. - C2HS=`$C2HS_CONFIG --c2hs`; fi - -dnl C2HS_CFLAGS="`$C2HS_CONFIG --cflags`" -dnl AC_MSG_RESULT([Notice: C->Haskell induced compile time options: `$C2HS_CONFIG --cflags`]) -dnl LIBS="`$C2HS_CONFIG --libs` $LIBS" -dnl AC_MSG_RESULT([Notice: C->Haskell induced link time options: `$C2HS_CONFIG --libs`]) # Read the version file VERSION=`cat $TOP/VERSION` |
From: <as...@us...> - 2003-07-09 22:43:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/buttons In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/buttons Modified Files: Button.chs CheckButton.chs RadioButton.chs ToggleButton.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: Button.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/Button.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Button.chs 8 Nov 2002 10:39:21 -0000 1.3 +++ Button.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -64,8 +64,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -84,7 +84,7 @@ -- @constructor buttonNewWithLabel@ Create a button with a label in it. -- buttonNewWithLabel :: String -> IO Button -buttonNewWithLabel lbl = withCString lbl (\strPtr -> +buttonNewWithLabel lbl = withUTFString lbl (\strPtr -> makeNewObject mkButton $ liftM castPtr $ {#call unsafe button_new_with_label#} strPtr) @@ -95,14 +95,14 @@ -- shortcut). -- buttonNewWithMnemonic :: String -> IO Button -buttonNewWithMnemonic lbl = withCString lbl (\strPtr -> +buttonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> makeNewObject mkButton $ liftM castPtr $ {#call unsafe button_new_with_mnemonic#} strPtr) -- @constructor buttonNewFromStock@ Create a stock (predefined appearance) button. -- buttonNewFromStock :: String -> IO Button -buttonNewFromStock stockId = withCString stockId (\strPtr -> +buttonNewFromStock stockId = withUTFString stockId (\strPtr -> makeNewObject mkButton $ liftM castPtr $ throwIfNull "buttonNewFromStock: Invalid stock identifier." $ {#call unsafe button_new_from_stock#} strPtr) @@ -150,7 +150,7 @@ -- @method buttonSetLabel@ Set the text of the button. -- buttonSetLabel :: ButtonClass b => b -> String -> IO () -buttonSetLabel b lbl = withCString lbl $ \strPtr -> +buttonSetLabel b lbl = withUTFString lbl $ \strPtr -> {#call button_set_label#} (toButton b) strPtr -- @method buttonGetLabel@ Get the current text on the button. @@ -161,7 +161,7 @@ buttonGetLabel :: ButtonClass b => b -> IO String buttonGetLabel b = do strPtr <- {#call unsafe button_get_label#} (toButton b) - if strPtr==nullPtr then return "" else peekCString strPtr + if strPtr==nullPtr then return "" else peekUTFString strPtr -- @method buttonSetUseStock@ Set if the label is a stock identifier. -- Index: CheckButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/CheckButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CheckButton.chs 24 May 2002 09:43:24 -0000 1.2 +++ CheckButton.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -37,8 +37,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -57,7 +57,7 @@ -- the right of it. -- checkButtonNewWithLabel :: String -> IO CheckButton -checkButtonNewWithLabel lbl = withCString lbl (\strPtr -> +checkButtonNewWithLabel lbl = withUTFString lbl (\strPtr -> makeNewObject mkCheckButton $ liftM castPtr $ {#call unsafe check_button_new_with_label#} strPtr) @@ -68,7 +68,7 @@ -- the label to a underlined character. -- checkButtonNewWithMnemonic :: String -> IO CheckButton -checkButtonNewWithMnemonic lbl = withCString lbl (\strPtr -> +checkButtonNewWithMnemonic lbl = withUTFString lbl (\strPtr -> makeNewObject mkCheckButton $ liftM castPtr $ {#call unsafe check_button_new_with_mnemonic#} strPtr) Index: RadioButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/RadioButton.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- RadioButton.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ RadioButton.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -48,8 +48,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -69,7 +69,7 @@ -- label to the right of the button. -- radioButtonNewWithLabel :: String -> IO RadioButton -radioButtonNewWithLabel lbl = withCString lbl $ \strPtr -> +radioButtonNewWithLabel lbl = withUTFString lbl $ \strPtr -> makeNewObject mkRadioButton $ liftM castPtr $ {#call unsafe radio_button_new_with_label#} nullPtr strPtr @@ -88,7 +88,7 @@ -- label and group. -- radioButtonNewJoinGroupWithLabel :: RadioButton -> String -> IO RadioButton -radioButtonNewJoinGroupWithLabel rb lbl = withCString lbl $ \strPtr -> +radioButtonNewJoinGroupWithLabel rb lbl = withUTFString lbl $ \strPtr -> makeNewObject mkRadioButton $ liftM castPtr $ {#call radio_button_new_with_label_from_widget#} rb strPtr Index: ToggleButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/buttons/ToggleButton.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ToggleButton.chs 24 May 2002 09:43:24 -0000 1.2 +++ ToggleButton.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -46,8 +46,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -66,7 +66,7 @@ -- @method toggleButtonNewWithLabel@ Create a toggleButton with a label in it. -- toggleButtonNewWithLabel :: String -> IO ToggleButton -toggleButtonNewWithLabel lbl = withCString lbl (\strPtr -> +toggleButtonNewWithLabel lbl = withUTFString lbl (\strPtr -> makeNewObject mkToggleButton $ liftM castPtr $ {#call unsafe toggle_button_new_with_label#} strPtr) |
From: <as...@us...> - 2003-07-09 22:43:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/general Modified Files: General.chs IconFactory.chs StockItems.hsc Structs.hsc Style.chs Removed Files: UTFCForeign.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: General.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/General.chs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- General.chs 27 Feb 2003 10:09:17 -0000 1.10 +++ General.chs 9 Jul 2003 22:42:44 -0000 1.11 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry General@ -- @@ -58,8 +59,8 @@ hiding (init) import System (getProgName, getArgs, ExitCode(ExitSuccess, ExitFailure)) import Monad (liftM, mapM) -import Foreign -import UTFCForeign +import FFI + import LocalData(newIORef, readIORef, writeIORef) import Exception (ioError, Exception(ErrorCall)) import Object (makeNewObject) @@ -77,7 +78,7 @@ --getDefaultLanguage :: IO String --getDefaultLanguage = do -- strPtr <- {#call unsafe get_default_language#} --- str <- peekCString strPtr +-- str <- peekUTFString strPtr -- destruct strPtr -- return str @@ -97,7 +98,7 @@ args <- getArgs let allArgs = (prog:args) argc = length allArgs - withMany withCString allArgs $ \addrs -> + withMany withUTFString allArgs $ \addrs -> withArray addrs $ \argv -> withObject argv $ \argvp -> withObject argc $ \argcp -> do @@ -106,8 +107,8 @@ argc' <- peek argcp argv' <- peek argvp _:addrs' <- peekArray argc' argv' -- drop the program name - mapM peekCString addrs' - else ioError (ErrorCall "Cannot initialize GUI.") + mapM peekUTFString addrs' + else error "Cannot initialize GUI." -- @function eventsPending@ Inquire the number of events pending on the event -- queue @@ -179,11 +180,21 @@ {#pointer Function#} -foreign export dynamic mkHandler :: IO {#type gint#} -> IO Function - {#pointer DestroyNotify#} +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall "wrapper" mkHandler :: IO {#type gint#} -> IO Function + +foreign import ccall "wrapper" mkDestructor :: IO () -> IO DestroyNotify + +#else + +foreign export dynamic mkHandler :: IO {#type gint#} -> IO Function + foreign export dynamic mkDestructor :: IO () -> IO DestroyNotify + +#endif type HandlerId = {#type guint#} Index: IconFactory.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/IconFactory.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- IconFactory.chs 8 Nov 2002 10:39:21 -0000 1.4 +++ IconFactory.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry IconFactory@ -- @@ -73,8 +74,7 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI import GObject (makeNewGObject) {#import Hierarchy#} {#import Signal#} @@ -97,7 +97,7 @@ -- default factories by iconFactoryAddDefault. -- iconFactoryAdd :: IconFactory -> String -> IconSet -> IO () -iconFactoryAdd i stockId iconSet = withCString stockId $ \strPtr -> +iconFactoryAdd i stockId iconSet = withUTFString stockId $ \strPtr -> {#call unsafe icon_factory_add#} i strPtr iconSet -- @method iconFactoryAddDefault@ Add all entries of the IconFactory to the @@ -145,9 +145,27 @@ isPtr <- {#call unsafe icon_set_new#} liftM IconSet $ newForeignPtr isPtr (icon_set_unref isPtr) +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe ">k_icon_set_unref" + icon_set_unref' :: FinalizerPtr IconSet + +icon_set_unref :: Ptr IconSet -> FinalizerPtr IconSet +icon_set_unref _ = icon_set_unref' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_icon_set_unref" + icon_set_unref :: Ptr IconSet -> IO () + +#else + foreign import ccall "gtk_icon_set_unref" unsafe icon_set_unref :: Ptr IconSet -> IO () +#endif + + -- @method iconSizeCheck@ Check if a given IconSize is registered. -- -- * Useful if your application expects a theme to install a set with a @@ -162,13 +180,13 @@ -- iconSizeRegister :: Int -> String -> Int -> IO IconSize iconSizeRegister height name width = liftM fromIntegral $ - withCString name $ \strPtr -> {#call unsafe icon_size_register#} + withUTFString name $ \strPtr -> {#call unsafe icon_size_register#} strPtr (fromIntegral width) (fromIntegral height) -- @method iconSizeRegisterAlias@ Register an additional alias for a name. -- iconSizeRegisterAlias :: IconSize -> String -> IO () -iconSizeRegisterAlias target alias = withCString alias $ \strPtr -> +iconSizeRegisterAlias target alias = withUTFString alias $ \strPtr -> {#call unsafe icon_size_register_alias#} strPtr (fromIntegral target) -- @method iconSizeFromName@ Lookup an IconSize by name. @@ -178,7 +196,7 @@ -- iconSizeFromName :: String -> IO IconSize iconSizeFromName name = liftM fromIntegral $ - withCString name {#call unsafe icon_size_from_name#} + withUTFString name {#call unsafe icon_size_from_name#} -- @method iconSizeGetName@ Lookup the name of an IconSize. -- @@ -187,7 +205,7 @@ iconSizeGetName :: IconSize -> IO (Maybe String) iconSizeGetName size = do strPtr <- {#call unsafe icon_size_get_name#} (fromIntegral size) - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- @method iconSourceGetDirection@ Retrieve the @ref data TextDirection@ of -- this IconSource. @@ -208,7 +226,7 @@ iconSourceGetFilename :: IconSource -> IO (Maybe String) iconSourceGetFilename is = do strPtr <- {#call unsafe icon_source_get_filename#} is - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- @method iconSourceGetSize@ Retrieve the @ref type IconSize@ of this -- IconSource. @@ -245,9 +263,27 @@ isPtr <- {#call unsafe icon_source_new#} liftM IconSource $ newForeignPtr isPtr (icon_source_free isPtr) +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe ">k_icon_source_free" + icon_source_free' :: FinalizerPtr IconSource + +icon_source_free :: Ptr IconSource -> FinalizerPtr IconSource +icon_source_free _ = icon_source_free' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_icon_source_free" + icon_source_free :: Ptr IconSource -> IO () + +#else + foreign import ccall "gtk_icon_source_free" unsafe icon_source_free :: Ptr IconSource -> IO () +#endif + + -- @method iconSourceSetDirection@ Mark this @ref data IconSource@ that it -- should only apply to the specified @ref data TextDirection@. -- @@ -266,7 +302,7 @@ -- iconSourceSetFilename :: IconSource -> FilePath -> IO () iconSourceSetFilename is name = - withCString name $ {#call unsafe icon_source_set_filename#} is + withUTFString name $ {#call unsafe icon_source_set_filename#} is -- @method iconSourceSetSize@ Set this @ref data IconSource@ to a specific -- size. Index: StockItems.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/StockItems.hsc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- StockItems.hsc 17 May 2003 22:57:07 -0000 1.8 +++ StockItems.hsc 9 Jul 2003 22:42:44 -0000 1.9 @@ -123,8 +123,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import LocalData(unsafePerformIO) -- to read CStrings lazyly import GList (GSList, fromGSListRev) import Events (Modifier) @@ -161,16 +161,16 @@ <- #{peek GtkStockItem, keyval} siPtr (transDom :: CString) <- #{peek GtkStockItem, translation_domain} siPtr return $ StockItem { - siStockId = unsafePerformIO $ peekCString' stockId, - siLabel = unsafePerformIO $ peekCString' label, + siStockId = unsafePerformIO $ peekUTFString' stockId, + siLabel = unsafePerformIO $ peekUTFString' label, -- &%!?$ c2hs and hsc should agree on types siModifier = fromIntegral modifier, siKeyval = fromIntegral keyval, - siTransDom = unsafePerformIO $ peekCString' transDom } + siTransDom = unsafePerformIO $ peekUTFString' transDom } where - peekCString' :: CString -> IO String - peekCString' strPtr | strPtr==nullPtr = return "" - | otherwise = peekCString strPtr + peekUTFString' :: CString -> IO String + peekUTFString' strPtr | strPtr==nullPtr = return "" + | otherwise = peekUTFString strPtr poke siPtr (StockItem { siStockId = stockId, @@ -178,14 +178,14 @@ siModifier= modifier, siKeyval = keyval, siTransDom= transDom }) = do - stockIdPtr <- newCString stockId + stockIdPtr <- newUTFString stockId #{poke GtkStockItem, stock_id} siPtr stockIdPtr - labelPtr <- newCString label + labelPtr <- newUTFString label #{poke GtkStockItem, label} siPtr labelPtr #{poke GtkStockItem, modifier} siPtr ((fromIntegral modifier)::#{type GdkModifierType}) #{poke GtkStockItem, keyval} siPtr ((fromIntegral keyval)::#{type guint}) - transDomPtr<- newCString transDom + transDomPtr<- newUTFString transDom #{poke GtkStockItem, translation_domain} siPtr transDomPtr @@ -202,21 +202,15 @@ pokeArray aPtr sis stock_add aPtr (fromIntegral items) -foreign import ccall "gtk_stock_add" unsafe - stock_add :: Ptr StockItem -> #{type guint} -> IO () - -- @method stockLookupItem@ Lookup an item in stock. -- stockLookupItem :: StockId -> IO (Maybe StockItem) stockLookupItem stockId = alloca $ \siPtr -> - withCString stockId $ \strPtr -> do + withUTFString stockId $ \strPtr -> do res <- stock_lookup strPtr siPtr if (toBool res) then liftM Just $ peek siPtr else return Nothing -foreign import ccall "gtk_stock_lookup" unsafe - stock_lookup :: CString -> Ptr StockItem -> IO #type gboolean - -- @function stockListIds@ Produce a list of all known stock identifiers. -- -- * Retrieve a list of all known stock identifiers. These can either be @@ -229,16 +223,39 @@ stockListIds = do lPtr <- stock_list_ids sPtrs <- fromGSListRev lPtr - res <- mapM peekCString sPtrs + res <- mapM peekUTFString sPtrs mapM_ g_free sPtrs return res +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe "gtk_stock_add" + stock_add :: Ptr StockItem -> #{type guint} -> IO () + +foreign import ccall unsafe "gtk_stock_lookup" + stock_lookup :: CString -> Ptr StockItem -> IO #type gboolean + +foreign import ccall unsafe "gtk_stock_list_ids" + stock_list_ids :: IO GSList + +foreign import ccall unsafe "g_free" + g_free :: Ptr a -> IO () + +#else + +foreign import ccall "gtk_stock_add" unsafe + stock_add :: Ptr StockItem -> #{type guint} -> IO () + +foreign import ccall "gtk_stock_lookup" unsafe + stock_lookup :: CString -> Ptr StockItem -> IO #type gboolean + foreign import ccall "gtk_stock_list_ids" unsafe stock_list_ids :: IO GSList foreign import ccall "g_free" unsafe g_free :: Ptr a -> IO () +#endif -- @constant stockAdd@ Standard icon and menu entry. -- @constant stockApply@ Standard icon and menu entry. -- @constant stockBold@ Standard icon and menu entry. Index: Structs.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/Structs.hsc,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Structs.hsc 17 May 2003 19:29:38 -0000 1.19 +++ Structs.hsc 9 Jul 2003 22:42:44 -0000 1.20 @@ -33,6 +33,7 @@ Rectangle(..), Color(..), GCValues(..), +#if __GLASGOW_HASKELL__<600 foreground, background, function, @@ -50,6 +51,7 @@ lineStyle, capStyle, joinStyle, +#endif pokeGCValues, newGCValues, widgetGetState, @@ -84,7 +86,6 @@ priorityLow, priorityDefault, priorityHigh, - nullForeignPtr, drawingAreaGetDrawWindow, drawingAreaGetSize, pangoScale, @@ -101,10 +102,9 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign -import LocalData (unsafePerformIO, -- for nullForeignPtr - testBit) +import FFI + +import LocalData (testBit) import Object (makeNewObject) import GObject (makeNewGObject) import Hierarchy @@ -167,12 +167,23 @@ gdkColormapAllocColor cPtr ptr 0 1 return () +#if __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gdk_colormap_get_system" + gdkColormapGetSystem :: IO (Ptr ()) + +foreign import ccall unsafe "gdk_colormap_alloc_color" + gdkColormapAllocColor :: Ptr () -> Ptr Color -> CInt -> CInt -> IO CInt + +#else + foreign import ccall "gdk_colormap_get_system" unsafe gdkColormapGetSystem :: IO (Ptr ()) foreign import ccall "gdk_colormap_alloc_color" unsafe gdkColormapAllocColor :: Ptr () -> Ptr Color -> CInt -> CInt -> IO CInt +#endif -- @entry GC@ @@ -625,11 +636,6 @@ priorityLow = #const G_PRIORITY_LOW --- helper function: nullForeignPtr --- this must be a performance hit -nullForeignPtr :: ForeignPtr a -nullForeignPtr = unsafePerformIO $ newForeignPtr nullPtr (return ()) - -- @entry Widget FileSelection@ -- @method fileSelectionGetButtons@ Extract the buttons of a fileselection. @@ -804,6 +810,6 @@ (domain :: GQuark) <- #{peek GError, domain} ptr (code :: #{type gint}) <- #{peek GError, code} ptr (msgPtr :: CString) <- #{peek GError, message} ptr - msg <- peekCString msgPtr + msg <- peekUTFString msgPtr return $ GError domain code msg poke _ = error "GError::poke: not implemented" Index: Style.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/Style.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Style.chs 16 May 2003 22:25:16 -0000 1.2 +++ Style.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -62,8 +62,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + {#import GObject#} (makeNewGObject) {#import Hierarchy#} import Enums (StateType) --- UTFCForeign.hs DELETED --- |
From: <as...@us...> - 2003-07-09 22:43:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/display In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/display Modified Files: AccelLabel.chs Image.chs Label.chs ProgressBar.chs Statusbar.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: AccelLabel.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/AccelLabel.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AccelLabel.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ AccelLabel.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -40,8 +40,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -53,7 +53,7 @@ -- @constructor accelLabelNew@ Create a new label with an accelerator key. -- accelLabelNew :: String -> IO AccelLabel -accelLabelNew str = withCString str $ \strPtr -> makeNewObject mkAccelLabel $ +accelLabelNew str = withUTFString str $ \strPtr -> makeNewObject mkAccelLabel $ liftM castPtr $ {#call unsafe accel_label_new#} strPtr -- @method accelLabelSetAccelWidget@ Set the key name from the activation Index: Image.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/Image.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Image.chs 6 Oct 2002 16:14:07 -0000 1.4 +++ Image.chs 9 Jul 2003 22:42:43 -0000 1.5 @@ -54,8 +54,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) import GObject (makeNewGObject) {#import Hierarchy#} @@ -71,13 +71,13 @@ -- imageNewFromFile :: FilePath -> IO Image imageNewFromFile path = makeNewObject mkImage $ liftM castPtr $ - withCString path {#call unsafe image_new_from_file#} + withUTFString path {#call unsafe image_new_from_file#} -- @method imageNewFromStock@ Create a set of images by specifying a stock -- object. -- imageNewFromStock :: String -> IconSize -> IO Image -imageNewFromStock stock ic = withCString stock $ \strPtr -> +imageNewFromStock stock ic = withUTFString stock $ \strPtr -> makeNewObject mkImage $ liftM castPtr $ {#call unsafe image_new_from_stock#} strPtr (fromIntegral ic) @@ -94,4 +94,4 @@ -- imageNewFromPixbuf :: Pixbuf -> IO Image imageNewFromPixbuf pbuf = makeNewObject mkImage $ liftM castPtr $ - {#call unsafe image_new_from_pixbuf#} pbuf \ No newline at end of file + {#call unsafe image_new_from_pixbuf#} pbuf Index: Label.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/Label.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Label.chs 8 Nov 2002 10:39:21 -0000 1.4 +++ Label.chs 9 Jul 2003 22:42:43 -0000 1.5 @@ -55,8 +55,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -73,13 +73,13 @@ labelNew str = makeNewObject mkLabel $ liftM castPtr $ case str of Nothing -> {#call label_new#} nullPtr - (Just str) -> withCString str {#call label_new#} + (Just str) -> withUTFString str {#call label_new#} -- @method labelSetText@ set the text the label widget shows -- labelSetText :: LabelClass l => l -> String -> IO () labelSetText l str = - withCString str $ {#call label_set_text#} (toLabel l) + withUTFString str $ {#call label_set_text#} (toLabel l) -- @method labelSetAttributes@ Set the text attributes. -- @@ -90,21 +90,21 @@ -- labelSetMarkup :: LabelClass l => l -> Markup -> IO () labelSetMarkup l str = - withCString str $ {#call label_set_markup#} (toLabel l) + withUTFString str $ {#call label_set_markup#} (toLabel l) -- @method labelSetMarkupWithMnemonic@ set the label to a markup string and -- interpret keyboard accelerators -- labelSetMarkupWithMnemonic :: LabelClass l => l -> Markup -> IO () labelSetMarkupWithMnemonic l str = - withCString str $ {#call label_set_markup_with_mnemonic#} (toLabel l) + withUTFString str $ {#call label_set_markup_with_mnemonic#} (toLabel l) -- @method labelSetPattern@ underline parts of the text, odd indices of the -- list represent underlined parts -- labelSetPattern :: LabelClass l => l -> [Int] -> IO () labelSetPattern l list = - withCString str $ {#call label_set_pattern#} (toLabel l) + withUTFString str $ {#call label_set_pattern#} (toLabel l) where str = concat $ zipWith replicate list (cycle ['_',' ']) @@ -152,7 +152,7 @@ -- @method labelGetText@ get the text stored in the label -- labelGetText :: LabelClass l => l -> IO String -labelGetText l = {#call unsafe label_get_text#} (toLabel l) >>= peekCString +labelGetText l = {#call unsafe label_get_text#} (toLabel l) >>= peekUTFString -- @constructor labelNewWithMnemonic@ Create a new label widget with @@ -164,7 +164,7 @@ -- labelNewWithMnemonic :: String -> IO Label labelNewWithMnemonic str = makeNewObject mkLabel $ liftM castPtr $ - withCString str {#call label_new_with_mnemonic#} + withUTFString str {#call label_new_with_mnemonic#} -- @method labelSelectRegion@ select a region in label -- @@ -191,5 +191,5 @@ -- labelSetTextWithMnemonic :: LabelClass l => l -> String -> IO () labelSetTextWithMnemonic l str = - withCString str $ {#call label_set_text_with_mnemonic#} (toLabel l) + withUTFString str $ {#call label_set_text_with_mnemonic#} (toLabel l) Index: ProgressBar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/ProgressBar.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ProgressBar.chs 24 May 2002 09:43:24 -0000 1.3 +++ ProgressBar.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -47,8 +47,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -78,7 +78,7 @@ -- superimposed on the progress bar. -- progressBarSetText :: ProgressBarClass pb => pb -> String -> IO () -progressBarSetText pb text = withCString text $ +progressBarSetText pb text = withUTFString text $ {#call unsafe progress_bar_set_text#} (toProgressBar pb) -- @method progressBarSetFraction@ Causes the progress bar to `fill in' the @@ -122,7 +122,7 @@ progressBarGetText :: ProgressBarClass pb => pb -> IO (Maybe String) progressBarGetText pb = do strPtr <- {#call unsafe progress_bar_get_text#} (toProgressBar pb) - if strPtr==nullPtr then return Nothing else liftM Just $ peekCString strPtr + if strPtr==nullPtr then return Nothing else liftM Just $ peekUTFString strPtr -- @method progressBarSetOrientation@ Causes the progress bar to switch to a -- different orientation (left-to-right, right-to-left, top-to-bottom, or Index: Statusbar.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/display/Statusbar.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Statusbar.chs 24 May 2002 09:43:24 -0000 1.2 +++ Statusbar.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -63,8 +63,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -86,7 +86,7 @@ -- Statusbar. -- statusbarGetContextId :: StatusbarClass sb => sb -> String -> IO ContextId -statusbarGetContextId sb description = withCString description $ +statusbarGetContextId sb description = withUTFString description $ {#call unsafe statusbar_get_context_id#} (toStatusbar sb) @@ -96,7 +96,7 @@ -- be displayed as long as it is on top of the stack. -- statusbarPush :: StatusbarClass sb => sb -> ContextId -> String -> IO MessageId -statusbarPush sb context msg = withCString msg $ {#call statusbar_push#} +statusbarPush sb context msg = withUTFString msg $ {#call statusbar_push#} (toStatusbar sb) context -- @method statusbarPop@ Pops the topmost message that has the correct |
From: <as...@us...> - 2003-07-09 22:43:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/entry In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/entry Modified Files: Entry.chs HScale.chs SpinButton.chs VScale.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: Entry.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/Entry.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Entry.chs 8 Nov 2002 10:39:21 -0000 1.6 +++ Entry.chs 9 Jul 2003 22:42:43 -0000 1.7 @@ -78,8 +78,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} @@ -89,10 +89,10 @@ -- methods originating in the Editable base class which is not really a base -- class of in the Gtk Hierarchy (it is non-existant). I renamed -{#pointer *Editable foreign#} +{#pointer *Editable foreign newtype#} toEditable :: EntryClass ed => ed -> Editable -toEditable = castForeignPtr.unEntry.toEntry +toEditable = Editable . castForeignPtr . unEntry . toEntry -- @method entrySelectRegion@ Select a span of text. -- @@ -126,7 +126,7 @@ -- entryInsertText :: EntryClass ed => ed -> String -> Int -> IO Int entryInsertText ed str pos = withObject (fromIntegral pos) $ \posPtr -> - withCStringLen str $ \(strPtr,len) -> do + withUTFStringLen str $ \(strPtr,len) -> do {#call editable_insert_text#} (toEditable ed) strPtr (fromIntegral len) posPtr liftM fromIntegral $ peek posPtr @@ -150,7 +150,7 @@ entryGetChars ed start end = do strPtr <- {#call unsafe editable_get_chars#} (toEditable ed) (fromIntegral start) (fromIntegral end) - str <- peekCString strPtr + str <- peekUTFString strPtr {#call unsafe g_free#} (castPtr strPtr) return str @@ -206,24 +206,24 @@ -- @method entrySetText@ Set the text of the @ref type Entry@ widget. -- entrySetText :: EntryClass ec => ec -> String -> IO () -entrySetText ec str = withCString str $ {#call entry_set_text#} (toEntry ec) +entrySetText ec str = withUTFString str $ {#call entry_set_text#} (toEntry ec) -- @method entryGetText@ Get the text of the @ref type Entry@ widget. -- entryGetText :: EntryClass ec => ec -> IO String -entryGetText ec = {#call entry_get_text#} (toEntry ec) >>= peekCString +entryGetText ec = {#call entry_get_text#} (toEntry ec) >>= peekUTFString -- @method entryAppendText@ Append to the text of the @ref type Entry@ widget. -- entryAppendText :: EntryClass ec => ec -> String -> IO () entryAppendText ec str = - withCString str $ {#call entry_append_text#} (toEntry ec) + withUTFString str $ {#call entry_append_text#} (toEntry ec) -- @method entryPrependText@ Prepend the text of the @ref type Entry@ widget. -- entryPrependText :: EntryClass ec => ec -> String -> IO () entryPrependText ec str = - withCString str $ {#call entry_prepend_text#} (toEntry ec) + withUTFString str $ {#call entry_prepend_text#} (toEntry ec) -- @method entrySetVisibility@ Set whether to use password mode (display stars -- instead of the text). Index: HScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/HScale.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- HScale.chs 24 May 2002 09:43:24 -0000 1.2 +++ HScale.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -36,8 +36,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: SpinButton.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/SpinButton.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SpinButton.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ SpinButton.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -61,8 +61,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: VScale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/entry/VScale.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- VScale.chs 24 May 2002 09:43:24 -0000 1.2 +++ VScale.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -36,8 +36,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:43:18
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/gdk In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/gdk Modified Files: Drawable.chs Events.hsc GC.chs Keys.chs Pixbuf.chs Region.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: Drawable.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Drawable.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Drawable.chs 3 Jul 2003 05:19:36 -0000 1.6 +++ Drawable.chs 9 Jul 2003 22:42:44 -0000 1.7 @@ -69,8 +69,8 @@ drawDrawable) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import GObject (makeNewGObject) import Structs (Point) {#import Hierarchy#} @@ -282,7 +282,7 @@ drawLayoutLineWithColors d gc x y text foreground background = let withMB :: Storable a => Maybe a -> (Ptr a -> IO b) -> IO b withMB Nothing f = f nullPtr - withMB (Just x) f = with' x f + withMB (Just x) f = with x f in withMB foreground $ \fPtr -> withMB background $ \bPtr -> {#call unsafe draw_layout_line_with_colors#} (toDrawable d) (toGC gc) @@ -313,7 +313,7 @@ drawLayoutWithColors d gc x y text foreground background = let withMB :: Storable a => Maybe a -> (Ptr a -> IO b) -> IO b withMB Nothing f = f nullPtr - withMB (Just x) f = with' x f + withMB (Just x) f = with x f in withMB foreground $ \fPtr -> withMB background $ \bPtr -> {#call unsafe draw_layout_with_colors#} (toDrawable d) (toGC gc) Index: Events.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Events.hsc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Events.hsc 21 Mar 2003 10:52:24 -0000 1.4 +++ Events.hsc 9 Jul 2003 22:42:44 -0000 1.5 @@ -43,6 +43,7 @@ hasButMiddle, Event(..), -- information in event callbacks from Gdk -- selector functions +#if __GLASGOW_HASKELL__<600 sent, -- True if this is event does not come from user input area, -- Rectangle which is to be exposed, etc. count, -- number of upcoming events @@ -62,7 +63,7 @@ width, height, -- new size of a widget visible, -- state of visibility wMask, wState, -- new (?possible? and) real state of a window - +#endif marshalEvent, -- convert a pointer to an event data structure -- used data structures VisibilityState(..), @@ -76,8 +77,8 @@ ) where -import UTFCForeign -import Foreign + +import FFI import LocalData((.&.)) import GdkEnums (VisibilityState(..), CrossingMode(..), @@ -273,7 +274,7 @@ (modif_ ::#type guint) <- #{peek GdkEventKey, state} ptr (keyval_ ::#type guint) <- #{peek GdkEventKey, keyval} ptr (string_ ::CString) <- #{peek GdkEventKey, string} ptr - str_ <- peekCString string_ + str_ <- peekUTFString string_ (length_ ::#type gint) <- #{peek GdkEventKey, length} ptr return $ Key { release = up, Index: GC.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/GC.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GC.chs 8 Nov 2002 10:39:21 -0000 1.2 +++ GC.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -35,7 +35,7 @@ GCClass, castToGC, gcNew, - GCValues(..), + GCValues(GCValues), newGCValues, Color(..), foreground, @@ -71,14 +71,14 @@ import Monad (liftM, when) import Maybe (fromJust, isJust) import Exception(handle) -import Foreign -import UTFCForeign +import FFI + import GObject (makeNewGObject) {#import Hierarchy#} import Structs import Enums (Function(..), Fill(..), SubwindowMode(..), LineStyle(..), CapStyle(..), JoinStyle(..)) -{#import Region#} (Region) +{#import Region#} (Region(Region)) {# context lib="gtk" prefix="gdk" #} Index: Keys.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Keys.chs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Keys.chs 6 Oct 2002 16:14:08 -0000 1.1 +++ Keys.chs 9 Jul 2003 22:42:44 -0000 1.2 @@ -34,17 +34,17 @@ keyvalFromName ) where -import UTFCForeign -import Foreign + +import FFI import LocalData(unsafePerformIO) {#context lib="libgdk" prefix ="gdk"#} {#fun pure keyval_name as ^ {fromIntegral `Integer'} -> `Maybe String' - maybePeekCString#} + maybePeekUTFString#} where - maybePeekCString = unsafePerformIO . (maybePeek peekCString) --- maybePeekCString = maybePeek peekCString + maybePeekUTFString = unsafePerformIO . (maybePeek peekCString) +-- maybePeekUTFString = maybePeek peekCString {#fun pure keyval_from_name as ^ {`String'} -> `Integer' fromIntegral#} Index: Pixbuf.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Pixbuf.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Pixbuf.chs 19 May 2003 17:53:26 -0000 1.4 +++ Pixbuf.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -83,12 +83,12 @@ pixbufGetFromDrawable ) where -import Foreign +import FFI {#import Hierarchy#} import GObject import Monad -import UTFCForeign -import Structs (GError(..), GQuark, nullForeignPtr, Rectangle(..)) + +import Structs (GError(..), GQuark, Rectangle(..)) import LocalData (unsafePerformIO) import Exception (bracket) import LocalData ((.|.), shiftL) @@ -162,10 +162,10 @@ -- this image was saved. -- pixbufGetOption :: Pixbuf -> String -> IO (Maybe String) -pixbufGetOption pb key = withCString key $ \strPtr -> do +pixbufGetOption pb key = withUTFString key $ \strPtr -> do resPtr <- {#call unsafe pixbuf_get_option#} pb strPtr if (resPtr==nullPtr) then return Nothing else - liftM Just $ peekCString resPtr + liftM Just $ peekUTFString resPtr -- pixbufErrorDomain -- helper function pixbufErrorDomain :: GQuark @@ -181,7 +181,7 @@ -- those in @ref data PixbufError@, an exception is thrown. -- pixbufNewFromFile :: FilePath -> IO (Either (PixbufError,String) Pixbuf) -pixbufNewFromFile fname = withCString fname $ \strPtr -> +pixbufNewFromFile fname = withUTFString fname $ \strPtr -> alloca $ \errPtrPtr -> do pbPtr <- {#call unsafe pixbuf_new_from_file#} strPtr (castPtr errPtrPtr) if pbPtr/=nullPtr then liftM Right $ makeNewGObject mkPixbuf (return pbPtr) @@ -224,13 +224,13 @@ pixbufSave pb fname iType options = let (keys, values) = unzip options in let optLen = length keys in - withCString fname $ \fnPtr -> - withCString iType $ \tyPtr -> + withUTFString fname $ \fnPtr -> + withUTFString iType $ \tyPtr -> allocaArray0 optLen $ \keysPtr -> allocaArray optLen $ \valuesPtr -> alloca $ \errPtrPtr -> do - keyPtrs <- mapM newCString keys - valuePtrs <- mapM newCString values + keyPtrs <- mapM newUTFString keys + valuePtrs <- mapM newUTFString values pokeArray keysPtr keyPtrs pokeArray valuesPtr valuePtrs res <- {#call unsafe pixbuf_savev#} pb fnPtr tyPtr keysPtr valuesPtr @@ -263,7 +263,7 @@ -- pixbufNewFromXPMData :: [String] -> IO Pixbuf pixbufNewFromXPMData s = - bracket (mapM newCString s) (mapM free) $ \strPtrs -> + bracket (mapM newUTFString s) (mapM free) $ \strPtrs -> withArray0 nullPtr strPtrs $ \strsPtr -> makeNewGObject mkPixbuf $ {#call pixbuf_new_from_xpm_data#} strsPtr @@ -488,4 +488,4 @@ (fromIntegral x) (fromIntegral y) 0 0 (fromIntegral width) (fromIntegral height) if pbPtr==nullPtr then return Nothing else liftM Just $ - makeNewGObject mkPixbuf (return pbPtr) \ No newline at end of file + makeNewGObject mkPixbuf (return pbPtr) Index: Region.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/gdk/Region.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Region.chs 3 Nov 2002 20:35:42 -0000 1.2 +++ Region.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry Region@ -- @@ -34,7 +35,7 @@ -- module Region( makeNewRegion, - Region, + Region(Region), regionNew, FillRule(..), regionPolygon, @@ -56,8 +57,7 @@ regionXor) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI import Structs (Point, Rectangle(..)) import GdkEnums (FillRule(..), OverlapType(..)) @@ -69,11 +69,29 @@ -- makeNewRegion :: Ptr Region -> IO Region makeNewRegion rPtr = do - region <- newForeignPtr rPtr (regionDestroy rPtr) + region <- newForeignPtr rPtr (region_destroy rPtr) return (Region region) +#if __GLASGOW_HASKELL__>=600 + +foreign import ccall unsafe "&gdk_region_destroy" + region_destroy' :: FinalizerPtr Region + +region_destroy :: Ptr Region -> FinalizerPtr Region +region_destroy _ = region_destroy' + +#elif __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gdk_region_destroy" + region_destroy :: Ptr Region -> IO () + +#else + foreign import ccall "gdk_region_destroy" unsafe - regionDestroy :: Ptr Region -> IO () + region_destroy :: Ptr Region -> IO () + +#endif + -- @constructor regionNew@ Create an empty region. -- |
Update of /cvsroot/gtk2hs/gtk2hs/gtk/abstract In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/abstract Modified Files: Box.chs Container.chs Misc.chs Object.chs Paned.chs Range.chs Scale.chs Widget.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: Box.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Box.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Box.chs 8 Nov 2002 10:39:21 -0000 1.6 +++ Box.chs 9 Jul 2003 22:42:43 -0000 1.7 @@ -47,8 +47,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Container.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Container.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Container.chs 6 Oct 2002 16:14:07 -0000 1.4 +++ Container.chs 9 Jul 2003 22:42:43 -0000 1.5 @@ -61,8 +61,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import GObject (objectRef, objectUnref) import Object (makeNewObject) {#import Hierarchy#} @@ -162,7 +162,7 @@ -- strPtr <- throwIfNull "containerChildCompositeName: illegal name returned" $ -- {#call unsafe container_child_composite_name#} (toContainer con) -- (toWidget widget) --- str <- peekCString strPtr +-- str <- peekUTFString strPtr -- {#call unsafe g_free#} (castPtr strPtr) -- return str Index: Misc.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Misc.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Misc.chs 24 May 2002 09:43:24 -0000 1.2 +++ Misc.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -37,8 +37,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + {#import Hierarchy#} {#import Signal#} Index: Object.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Object.chs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Object.chs 5 Aug 2002 16:41:34 -0000 1.6 +++ Object.chs 9 Jul 2003 22:42:43 -0000 1.7 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) @entry Object@ -- @@ -44,8 +45,8 @@ objectGetProperty ) where -import Foreign -import UTFCForeign (withCString, CChar) +import FFI + import GObject (objectRef, objectUnref) {#import Signal#} {#import Hierarchy#} @@ -69,9 +70,18 @@ objectSink :: ObjectClass obj => Ptr obj -> IO () objectSink = object_sink.castPtr +#if __GLASGOW_HASKELL__>=504 + +foreign import ccall unsafe "gtk_object_sink" + object_sink :: Ptr Object -> IO () + +#else + foreign import ccall "gtk_object_sink" unsafe object_sink :: Ptr Object -> IO () +#endif + -- This is a convenience function to generate a new widget. It adds the -- finalizer with the method described under objectSink. -- @@ -96,7 +106,7 @@ -- objectSetProperty :: GObjectClass gobj => gobj -> String -> GenericValue -> IO () -objectSetProperty obj prop val = alloca $ \vaPtr -> withCString prop $ +objectSetProperty obj prop val = alloca $ \vaPtr -> withUTFString prop $ \sPtr -> poke vaPtr val >> {#call unsafe g_object_set_property#} (toGObject obj) sPtr vaPtr >> valueUnset vaPtr @@ -107,7 +117,7 @@ -- objectGetProperty :: GObjectClass gobj => gobj -> String -> IO GenericValue -objectGetProperty obj prop = alloca $ \vaPtr -> withCString prop $ \str -> do +objectGetProperty obj prop = alloca $ \vaPtr -> withUTFString prop $ \str -> do {#call unsafe g_object_get_property#} (toGObject obj) str vaPtr res <- peek vaPtr valueUnset vaPtr Index: Paned.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Paned.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Paned.chs 19 Dec 2002 18:13:39 -0000 1.3 +++ Paned.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -43,8 +43,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Range.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Range.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Range.chs 8 Nov 2002 10:39:21 -0000 1.3 +++ Range.chs 9 Jul 2003 22:42:43 -0000 1.4 @@ -44,8 +44,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Scale.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Scale.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Scale.chs 24 May 2002 09:43:24 -0000 1.2 +++ Scale.chs 9 Jul 2003 22:42:43 -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: Widget.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/abstract/Widget.chs,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Widget.chs 8 Mar 2003 17:44:00 -0000 1.11 +++ Widget.chs 9 Jul 2003 22:42:43 -0000 1.12 @@ -152,8 +152,8 @@ ) where import Monad (liftM, unless) -import UTFCForeign -import Foreign + +import FFI import Object (makeNewObject) import GObject (makeNewGObject) {#import Hierarchy#} @@ -239,7 +239,7 @@ --w `onStyleChanged` update@ -- widgetCreateLayout :: WidgetClass obj => obj -> String -> IO PangoLayout -widgetCreateLayout obj txt = withCString txt $ +widgetCreateLayout obj txt = withUTFString txt $ \strPtr -> makeNewGObject mkPangoLayout ({#call unsafe widget_create_pango_layout#} (toWidget obj) strPtr) @@ -296,13 +296,13 @@ -- widgetSetName :: WidgetClass w => w -> String -> IO () widgetSetName w name = - withCString name ({#call widget_set_name#} (toWidget w)) + withUTFString name ({#call widget_set_name#} (toWidget w)) -- @method widgetGetName@ Get the name of a widget. -- widgetGetName :: WidgetClass w => w -> IO String widgetGetName w = {#call unsafe widget_get_name#} (toWidget w) >>= - peekCString + peekUTFString -- @method widgetAddEvents@ Enable event signals. -- |
From: <as...@us...> - 2003-07-09 22:43:17
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/embedding In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/embedding Modified Files: Embedding.hsc Plug.chs Socket.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: Embedding.hsc =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/embedding/Embedding.hsc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Embedding.hsc 21 Jan 2003 15:53:25 -0000 1.1 +++ Embedding.hsc 9 Jul 2003 22:42:43 -0000 1.2 @@ -35,8 +35,8 @@ NativeWindowId ) where -import Foreign -import UTFCForeign +import FFI + import Hierarchy import Exception Index: Plug.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/embedding/Plug.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Plug.chs 21 Jan 2003 15:53:25 -0000 1.2 +++ Plug.chs 9 Jul 2003 22:42:43 -0000 1.3 @@ -42,8 +42,8 @@ import Monad (liftM) import Maybe (fromMaybe) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Socket.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/embedding/Socket.chs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Socket.chs 21 Jan 2003 15:53:25 -0000 1.5 +++ Socket.chs 9 Jul 2003 22:42:43 -0000 1.6 @@ -56,8 +56,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:43:16
|
Update of /cvsroot/gtk2hs/gtk2hs/compat In directory sc8-pr-cvs1:/tmp/cvs-serv25460/compat Modified Files: LocalControl.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: LocalControl.hs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/compat/LocalControl.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LocalControl.hs 21 Jul 2002 16:07:17 -0000 1.1 +++ LocalControl.hs 9 Jul 2003 22:42:43 -0000 1.2 @@ -39,7 +39,10 @@ #endif ) where -#if __GLASGOW_HASKELL__>=504 +#if __GLASGOW_HASKELL__>=600 +import Control.Exception +import Control.Concurrent hiding(throwTo) +#elif __GLASGOW_HASKELL__>=504 import Control.Exception import Control.Concurrent #else |
Update of /cvsroot/gtk2hs/gtk2hs/gtk/layout In directory sc8-pr-cvs1:/tmp/cvs-serv25460/gtk/layout Modified Files: Alignment.chs AspectFrame.chs HBox.chs HPaned.chs Layout.chs Notebook.chs Table.chs VBox.chs VPaned.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: Alignment.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/Alignment.chs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Alignment.chs 24 May 2002 09:43:25 -0000 1.2 +++ Alignment.chs 9 Jul 2003 22:42:44 -0000 1.3 @@ -36,8 +36,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: AspectFrame.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/AspectFrame.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AspectFrame.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ AspectFrame.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -46,8 +46,8 @@ import Monad (liftM) import Maybe (isNothing) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: HBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/HBox.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HBox.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ HBox.chs 9 Jul 2003 22:42:44 -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: HPaned.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/HPaned.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- HPaned.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ HPaned.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: Layout.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/Layout.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Layout.chs 8 Nov 2002 10:39:21 -0000 1.4 +++ Layout.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -46,10 +46,9 @@ import Maybe (fromMaybe) import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) -import Structs (nullForeignPtr) {#import Hierarchy#} {#import Signal#} Index: Notebook.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/Notebook.chs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Notebook.chs 3 Jul 2003 05:19:36 -0000 1.4 +++ Notebook.chs 9 Jul 2003 22:42:44 -0000 1.5 @@ -81,8 +81,8 @@ import Monad (liftM) import Maybe (maybe) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: Table.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/Table.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Table.chs 20 Jun 2002 14:13:05 -0000 1.3 +++ Table.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -45,8 +45,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: VBox.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/VBox.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VBox.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ VBox.chs 9 Jul 2003 22:42:44 -0000 1.4 @@ -38,8 +38,8 @@ ) where import Monad (liftM) -import Foreign -import UTFCForeign +import FFI + import Object (makeNewObject) {#import Hierarchy#} {#import Signal#} Index: VPaned.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/layout/VPaned.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VPaned.chs 5 Aug 2002 16:41:34 -0000 1.3 +++ VPaned.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#} |