{-# LINE 2 "./Graphics/UI/Gtk/Selectors/FileChooserWidget.chs" #-}
module Graphics.UI.Gtk.Selectors.FileChooserWidget (
FileChooserWidget,
FileChooserWidgetClass,
castToFileChooserWidget, gTypeFileChooserWidget,
toFileChooserWidget,
FileChooserAction,
fileChooserWidgetNew,
fileChooserWidgetNewWithBackend,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import Graphics.UI.Gtk.Abstract.Object
import Graphics.UI.Gtk.Types
{-# LINE 74 "./Graphics/UI/Gtk/Selectors/FileChooserWidget.chs" #-}
import Graphics.UI.Gtk.Selectors.FileChooser (FileChooserAction)
{-# LINE 79 "./Graphics/UI/Gtk/Selectors/FileChooserWidget.chs" #-}
instance FileChooserClass FileChooserWidget
fileChooserWidgetNew ::
FileChooserAction
-> IO FileChooserWidget
fileChooserWidgetNew :: FileChooserAction -> IO FileChooserWidget
fileChooserWidgetNew FileChooserAction
action =
(ForeignPtr FileChooserWidget -> FileChooserWidget,
FinalizerPtr FileChooserWidget)
-> IO (Ptr FileChooserWidget) -> IO FileChooserWidget
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FileChooserWidget -> FileChooserWidget,
FinalizerPtr FileChooserWidget)
forall {a}.
(ForeignPtr FileChooserWidget -> FileChooserWidget, FinalizerPtr a)
mkFileChooserWidget (IO (Ptr FileChooserWidget) -> IO FileChooserWidget)
-> IO (Ptr FileChooserWidget) -> IO FileChooserWidget
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FileChooserWidget)
-> IO (Ptr Widget) -> IO (Ptr FileChooserWidget)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FileChooserWidget
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FileChooserWidget) (IO (Ptr Widget) -> IO (Ptr FileChooserWidget))
-> IO (Ptr Widget) -> IO (Ptr FileChooserWidget)
forall a b. (a -> b) -> a -> b
$
CInt -> IO (Ptr Widget)
gtk_file_chooser_widget_new
{-# LINE 99 "./Graphics/UI/Gtk/Selectors/FileChooserWidget.chs" #-}
((fromIntegral . fromEnum) action)
fileChooserWidgetNewWithBackend ::
FileChooserAction
-> String
-> IO FileChooserWidget
fileChooserWidgetNewWithBackend :: FileChooserAction -> String -> IO FileChooserWidget
fileChooserWidgetNewWithBackend FileChooserAction
action String
backend =
(ForeignPtr FileChooserWidget -> FileChooserWidget,
FinalizerPtr FileChooserWidget)
-> IO (Ptr FileChooserWidget) -> IO FileChooserWidget
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FileChooserWidget -> FileChooserWidget,
FinalizerPtr FileChooserWidget)
forall {a}.
(ForeignPtr FileChooserWidget -> FileChooserWidget, FinalizerPtr a)
mkFileChooserWidget (IO (Ptr FileChooserWidget) -> IO FileChooserWidget)
-> IO (Ptr FileChooserWidget) -> IO FileChooserWidget
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FileChooserWidget)
-> IO (Ptr Widget) -> IO (Ptr FileChooserWidget)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FileChooserWidget
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FileChooserWidget) (IO (Ptr Widget) -> IO (Ptr FileChooserWidget))
-> IO (Ptr Widget) -> IO (Ptr FileChooserWidget)
forall a b. (a -> b) -> a -> b
$
String -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. String -> (CString -> IO a) -> IO a
withCString String
backend ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
backendPtr ->
CInt -> CString -> IO (Ptr Widget)
gtk_file_chooser_widget_new_with_backend
{-# LINE 118 "./Graphics/UI/Gtk/Selectors/FileChooserWidget.chs" #-}
((fromIntegral . fromEnum) action)
CString
backendPtr
foreign import ccall unsafe "gtk_file_chooser_widget_new"
gtk_file_chooser_widget_new :: (CInt -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_file_chooser_widget_new_with_backend"
gtk_file_chooser_widget_new_with_backend :: (CInt -> ((Ptr CChar) -> (IO (Ptr Widget))))