{-# LINE 2 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
module Graphics.UI.Gtk.Selectors.FileChooserButton (
FileChooserButton,
FileChooserButtonClass,
castToFileChooserButton, gTypeFileChooserButton,
toFileChooserButton,
fileChooserButtonNew,
fileChooserButtonNewWithBackend,
fileChooserButtonNewWithDialog,
fileChooserButtonGetTitle,
fileChooserButtonSetTitle,
fileChooserButtonGetWidthChars,
fileChooserButtonSetWidthChars,
fileChooserButtonDialog,
fileChooserButtonTitle,
fileChooserButtonWidthChars,
fileChooserButtonFileSet
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 92 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 93 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
import Graphics.UI.Gtk.Selectors.FileChooser (FileChooserAction)
{-# LINE 98 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
instance FileChooserClass FileChooserButton
fileChooserButtonNew :: GlibString string
=> string
-> FileChooserAction
-> IO FileChooserButton
fileChooserButtonNew :: forall string.
GlibString string =>
string -> FileChooserAction -> IO FileChooserButton
fileChooserButtonNew string
title FileChooserAction
action =
(ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
forall {a}.
(ForeignPtr FileChooserButton -> FileChooserButton, FinalizerPtr a)
mkFileChooserButton (IO (Ptr FileChooserButton) -> IO FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FileChooserButton)
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FileChooserButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FileChooserButton) (IO (Ptr Widget) -> IO (Ptr FileChooserButton))
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
title ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
titlePtr ->
CString -> CInt -> IO (Ptr Widget)
gtk_file_chooser_button_new
{-# LINE 118 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
titlePtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (FileChooserAction -> Int) -> FileChooserAction -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileChooserAction -> Int
forall a. Enum a => a -> Int
fromEnum) FileChooserAction
action)
fileChooserButtonNewWithBackend :: GlibString string
=> string
-> FileChooserAction
-> string
-> IO FileChooserButton
fileChooserButtonNewWithBackend :: forall string.
GlibString string =>
string -> FileChooserAction -> string -> IO FileChooserButton
fileChooserButtonNewWithBackend string
title FileChooserAction
action string
backend =
(ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
forall {a}.
(ForeignPtr FileChooserButton -> FileChooserButton, FinalizerPtr a)
mkFileChooserButton (IO (Ptr FileChooserButton) -> IO FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FileChooserButton)
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FileChooserButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FileChooserButton) (IO (Ptr Widget) -> IO (Ptr FileChooserButton))
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString 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 ->
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
title ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
titlePtr ->
CString -> CInt -> CString -> IO (Ptr Widget)
gtk_file_chooser_button_new_with_backend
{-# LINE 137 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
titlePtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (FileChooserAction -> Int) -> FileChooserAction -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileChooserAction -> Int
forall a. Enum a => a -> Int
fromEnum) FileChooserAction
action)
CString
backendPtr
fileChooserButtonNewWithDialog :: FileChooserDialogClass dialog =>
dialog
-> IO FileChooserButton
fileChooserButtonNewWithDialog :: forall dialog.
FileChooserDialogClass dialog =>
dialog -> IO FileChooserButton
fileChooserButtonNewWithDialog dialog
dialog =
(ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr FileChooserButton -> FileChooserButton,
FinalizerPtr FileChooserButton)
forall {a}.
(ForeignPtr FileChooserButton -> FileChooserButton, FinalizerPtr a)
mkFileChooserButton (IO (Ptr FileChooserButton) -> IO FileChooserButton)
-> IO (Ptr FileChooserButton) -> IO FileChooserButton
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr FileChooserButton)
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr FileChooserButton
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr FileChooserButton) (IO (Ptr Widget) -> IO (Ptr FileChooserButton))
-> IO (Ptr Widget) -> IO (Ptr FileChooserButton)
forall a b. (a -> b) -> a -> b
$
(\(Widget ForeignPtr Widget
arg1) -> ForeignPtr Widget
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg1 ((Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Widget -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr1 ->Ptr Widget -> IO (Ptr Widget)
gtk_file_chooser_button_new_with_dialog Ptr Widget
argPtr1)
{-# LINE 153 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
(toWidget dialog)
fileChooserButtonGetTitle :: (FileChooserButtonClass self, GlibString string) => self
-> IO string
fileChooserButtonGetTitle :: forall self string.
(FileChooserButtonClass self, GlibString string) =>
self -> IO string
fileChooserButtonGetTitle self
self =
(\(FileChooserButton ForeignPtr FileChooserButton
arg1) -> ForeignPtr FileChooserButton
-> (Ptr FileChooserButton -> IO CString) -> IO CString
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileChooserButton
arg1 ((Ptr FileChooserButton -> IO CString) -> IO CString)
-> (Ptr FileChooserButton -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ \Ptr FileChooserButton
argPtr1 ->Ptr FileChooserButton -> IO CString
gtk_file_chooser_button_get_title Ptr FileChooserButton
argPtr1)
{-# LINE 164 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
(toFileChooserButton self)
IO CString -> (CString -> IO string) -> IO string
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= CString -> IO string
forall s. GlibString s => CString -> IO s
peekUTFString
fileChooserButtonSetTitle :: (FileChooserButtonClass self, GlibString string) => self
-> string
-> IO ()
fileChooserButtonSetTitle :: forall self string.
(FileChooserButtonClass self, GlibString string) =>
self -> string -> IO ()
fileChooserButtonSetTitle self
self string
title =
string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
title ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
titlePtr ->
(\(FileChooserButton ForeignPtr FileChooserButton
arg1) CString
arg2 -> ForeignPtr FileChooserButton
-> (Ptr FileChooserButton -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileChooserButton
arg1 ((Ptr FileChooserButton -> IO ()) -> IO ())
-> (Ptr FileChooserButton -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FileChooserButton
argPtr1 ->Ptr FileChooserButton -> CString -> IO ()
gtk_file_chooser_button_set_title Ptr FileChooserButton
argPtr1 CString
arg2)
{-# LINE 175 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
(toFileChooserButton self)
CString
titlePtr
fileChooserButtonGetWidthChars :: FileChooserButtonClass self => self
-> IO Int
fileChooserButtonGetWidthChars :: forall self. FileChooserButtonClass self => self -> IO Int
fileChooserButtonGetWidthChars self
self =
(CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$
(\(FileChooserButton ForeignPtr FileChooserButton
arg1) -> ForeignPtr FileChooserButton
-> (Ptr FileChooserButton -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileChooserButton
arg1 ((Ptr FileChooserButton -> IO CInt) -> IO CInt)
-> (Ptr FileChooserButton -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr FileChooserButton
argPtr1 ->Ptr FileChooserButton -> IO CInt
gtk_file_chooser_button_get_width_chars Ptr FileChooserButton
argPtr1)
{-# LINE 187 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
(toFileChooserButton self)
fileChooserButtonSetWidthChars :: FileChooserButtonClass self => self
-> Int
-> IO ()
fileChooserButtonSetWidthChars :: forall self. FileChooserButtonClass self => self -> Int -> IO ()
fileChooserButtonSetWidthChars self
self Int
nChars =
(\(FileChooserButton ForeignPtr FileChooserButton
arg1) CInt
arg2 -> ForeignPtr FileChooserButton
-> (Ptr FileChooserButton -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileChooserButton
arg1 ((Ptr FileChooserButton -> IO ()) -> IO ())
-> (Ptr FileChooserButton -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FileChooserButton
argPtr1 ->Ptr FileChooserButton -> CInt -> IO ()
gtk_file_chooser_button_set_width_chars Ptr FileChooserButton
argPtr1 CInt
arg2)
{-# LINE 196 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
(toFileChooserButton self)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
nChars)
fileChooserButtonDialog :: (FileChooserButtonClass self, FileChooserDialogClass fileChooserDialog) => WriteAttr self fileChooserDialog
fileChooserButtonDialog :: forall self fileChooserDialog.
(FileChooserButtonClass self,
FileChooserDialogClass fileChooserDialog) =>
WriteAttr self fileChooserDialog
fileChooserButtonDialog = String -> GType -> WriteAttr self fileChooserDialog
forall gobj gobj'.
(GObjectClass gobj, GObjectClass gobj') =>
String -> GType -> WriteAttr gobj gobj'
writeAttrFromObjectProperty String
"dialog"
GType
gtk_file_chooser_dialog_get_type
{-# LINE 207 "./Graphics/UI/Gtk/Selectors/FileChooserButton.chs" #-}
fileChooserButtonTitle :: (FileChooserButtonClass self, GlibString string) => Attr self string
fileChooserButtonTitle :: forall self string.
(FileChooserButtonClass self, GlibString string) =>
Attr self string
fileChooserButtonTitle = (self -> IO string)
-> (self -> string -> IO ()) -> ReadWriteAttr self string string
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
self -> IO string
forall self string.
(FileChooserButtonClass self, GlibString string) =>
self -> IO string
fileChooserButtonGetTitle
self -> string -> IO ()
forall self string.
(FileChooserButtonClass self, GlibString string) =>
self -> string -> IO ()
fileChooserButtonSetTitle
fileChooserButtonWidthChars :: FileChooserButtonClass self => Attr self Int
fileChooserButtonWidthChars :: forall self. FileChooserButtonClass self => Attr self Int
fileChooserButtonWidthChars = (self -> IO Int)
-> (self -> Int -> IO ()) -> ReadWriteAttr self Int Int
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
self -> IO Int
forall self. FileChooserButtonClass self => self -> IO Int
fileChooserButtonGetWidthChars
self -> Int -> IO ()
forall self. FileChooserButtonClass self => self -> Int -> IO ()
fileChooserButtonSetWidthChars
fileChooserButtonFileSet :: FileChooserButtonClass self => Signal self (IO ())
fileChooserButtonFileSet :: forall self. FileChooserButtonClass self => Signal self (IO ())
fileChooserButtonFileSet = (Bool -> self -> IO () -> IO (ConnectId self))
-> Signal self (IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE String
"file-set")
foreign import ccall safe "gtk_file_chooser_button_new"
gtk_file_chooser_button_new :: ((Ptr CChar) -> (CInt -> (IO (Ptr Widget))))
foreign import ccall safe "gtk_file_chooser_button_new_with_backend"
gtk_file_chooser_button_new_with_backend :: ((Ptr CChar) -> (CInt -> ((Ptr CChar) -> (IO (Ptr Widget)))))
foreign import ccall safe "gtk_file_chooser_button_new_with_dialog"
gtk_file_chooser_button_new_with_dialog :: ((Ptr Widget) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_file_chooser_button_get_title"
gtk_file_chooser_button_get_title :: ((Ptr FileChooserButton) -> (IO (Ptr CChar)))
foreign import ccall safe "gtk_file_chooser_button_set_title"
gtk_file_chooser_button_set_title :: ((Ptr FileChooserButton) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_file_chooser_button_get_width_chars"
gtk_file_chooser_button_get_width_chars :: ((Ptr FileChooserButton) -> (IO CInt))
foreign import ccall safe "gtk_file_chooser_button_set_width_chars"
gtk_file_chooser_button_set_width_chars :: ((Ptr FileChooserButton) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_file_chooser_dialog_get_type"
gtk_file_chooser_dialog_get_type :: CUInt