From: Duncan C. <dun...@us...> - 2004-08-08 19:04:47
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv358/gtk/windows Modified Files: FileChooserDialog.chs Log Message: Axel's patches to get the build to work for gtk-2.2, exclude new module bodies so c2hs doesn't see the new functions, and change the way _stub.o files are found so we don't try to link non-existant ones. Everything should build for gtk-2.0 and gtk-2.2 now. Index: FileChooserDialog.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/windows/FileChooserDialog.chs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FileChooserDialog.chs 23 May 2004 16:17:53 -0000 1.3 +++ FileChooserDialog.chs 8 Aug 2004 19:04:38 -0000 1.4 @@ -1,3 +1,4 @@ +{-# OPTIONS -cpp #-} -- -*-haskell-*- -- GIMP Toolkit (GTK) entry Widget FileChooserDialog -- @@ -27,13 +28,19 @@ -- * Added in GTK+ 2.4 -- +#include<gtk/gtkversion.h> + module FileChooserDialog ( +#if GTK_CHECK_VERSION(2,4,0) FileChooserDialogClass, FileChooserDialog, fileChooserDialogNew, fileChooserDialogNewWithBackend +#endif ) where +#if GTK_CHECK_VERSION(2,4,0) + import Monad (liftM, when) import Maybe (isJust, fromJust) import FFI @@ -53,22 +60,22 @@ instance FileChooserClass FileChooserDialog fileChooserDialogNew - :: Maybe String -> -- Title of the dialog (or default) - Maybe Window -> -- Transient parent of the dialog (or none) - FileChooserAction -> -- Open or save mode for the dialog - [(String, ResponseId)] -> -- buttons and their response codes - IO FileChooserDialog + :: Maybe String -- ^ Title of the dialog (or default) + -> Maybe Window -- ^ Transient parent of the dialog (or none) + -> FileChooserAction -- ^ Open or save mode for the dialog + -> [(String, ResponseId)] -- ^ Buttons and their response codes + -> IO FileChooserDialog fileChooserDialogNew title parent action buttons = internalFileChooserDialogNew title parent action buttons Nothing fileChooserDialogNewWithBackend - :: Maybe String -> -- Title of the dialog (or default) - Maybe Window -> -- Transient parent of the dialog (or none) - FileChooserAction -> -- Open or save mode for the dialog - [(String, ResponseId)] -> -- buttons and their response codes - String -> -- The name of the specific filesystem backend to use - IO FileChooserDialog + :: Maybe String -- ^ Title of the dialog (or default) + -> Maybe Window -- ^ Transient parent of the dialog (or none) + -> FileChooserAction -- ^ Open or save mode for the dialog + -> [(String, ResponseId)] -- ^ Buttons and their response codes + -> String -- ^ The name of the filesystem backend to use + -> IO FileChooserDialog fileChooserDialogNewWithBackend title parent action buttons backend = internalFileChooserDialogNew title parent action buttons (Just backend) @@ -78,12 +85,13 @@ -- bug, see <http://bugzilla.gnome.org/show_bug.cgi?id=141004> -- The solution is to call objectNew and add the buttons manually. -internalFileChooserDialogNew :: Maybe String -> -- Title of the dialog (or default) - Maybe Window -> -- Transient parent of the dialog (or none) - FileChooserAction -> -- Open or save mode for the dialog - [(String, ResponseId)] -> -- buttons and their response codes - Maybe String -> -- The name of the backend to use (optional) - IO FileChooserDialog +internalFileChooserDialogNew :: + Maybe String -> -- Title of the dialog (or default) + Maybe Window -> -- Transient parent of the dialog (or none) + FileChooserAction -> -- Open or save mode for the dialog + [(String, ResponseId)] -> -- Buttons and their response codes + Maybe String -> -- The name of the backend to use (optional) + IO FileChooserDialog internalFileChooserDialogNew title parent action buttons backend = do objType <- {# call unsafe gtk_file_chooser_dialog_get_type #} dialog <-makeNewObject mkFileChooserDialog $ liftM castPtr $ @@ -99,3 +107,5 @@ mapM_ (\(btnName, btnResponse) -> dialogAddButton dialog btnName btnResponse) buttons return dialog + +#endif |