{-# LINE 2 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
module Graphics.UI.Gtk.Display.InfoBar (
InfoBar,
InfoBarClass,
castToInfoBar,
toInfoBar,
infoBarNew,
infoBarAddActionWidget,
infoBarAddButton,
infoBarSetResponseSensitive,
infoBarSetDefaultResponse,
infoBarEmitResponse,
infoBarGetActionArea,
infoBarGetContentArea,
infoBarMessageType,
infoBarResponse,
infoBarClose,
) 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.Windows.MessageDialog (MessageType)
import Graphics.UI.Gtk.Types
{-# LINE 106 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 107 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
{-# LINE 109 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
infoBarNew :: IO InfoBar
infoBarNew :: IO InfoBar
infoBarNew =
(ForeignPtr InfoBar -> InfoBar, FinalizerPtr InfoBar)
-> IO (Ptr InfoBar) -> IO InfoBar
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr InfoBar -> InfoBar, FinalizerPtr InfoBar)
forall {a}. (ForeignPtr InfoBar -> InfoBar, FinalizerPtr a)
mkInfoBar (IO (Ptr InfoBar) -> IO InfoBar) -> IO (Ptr InfoBar) -> IO InfoBar
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr InfoBar) -> IO (Ptr Widget) -> IO (Ptr InfoBar)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr InfoBar
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr InfoBar) (IO (Ptr Widget) -> IO (Ptr InfoBar))
-> IO (Ptr Widget) -> IO (Ptr InfoBar)
forall a b. (a -> b) -> a -> b
$
IO (Ptr Widget)
gtk_info_bar_new
{-# LINE 128 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
infoBarAddActionWidget :: (InfoBarClass self, WidgetClass child) => self
-> child
-> Int
-> IO ()
infoBarAddActionWidget :: forall self child.
(InfoBarClass self, WidgetClass child) =>
self -> child -> Int -> IO ()
infoBarAddActionWidget self
self child
child Int
responseId =
(\(InfoBar ForeignPtr InfoBar
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO ()) -> IO ())
-> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr InfoBar -> Ptr Widget -> CInt -> IO ()
gtk_info_bar_add_action_widget Ptr InfoBar
argPtr1 Ptr Widget
argPtr2 CInt
arg3)
{-# LINE 144 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
(child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
responseId)
infoBarAddButton :: (InfoBarClass self, GlibString string) => self
-> string
-> Int
-> IO Button
infoBarAddButton :: forall self string.
(InfoBarClass self, GlibString string) =>
self -> string -> Int -> IO Button
infoBarAddButton self
self string
buttonText Int
responseId =
(ForeignPtr Button -> Button, FinalizerPtr Button)
-> IO (Ptr Button) -> IO Button
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Button -> Button, FinalizerPtr Button)
forall {a}. (ForeignPtr Button -> Button, FinalizerPtr a)
mkButton (IO (Ptr Button) -> IO Button) -> IO (Ptr Button) -> IO Button
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Button)) -> IO (Ptr Button)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
buttonText ((CString -> IO (Ptr Button)) -> IO (Ptr Button))
-> (CString -> IO (Ptr Button)) -> IO (Ptr Button)
forall a b. (a -> b) -> a -> b
$ \CString
buttonTextPtr ->
(Ptr Widget -> Ptr Button) -> IO (Ptr Widget) -> IO (Ptr Button)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Button
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Button) (IO (Ptr Widget) -> IO (Ptr Button))
-> IO (Ptr Widget) -> IO (Ptr Button)
forall a b. (a -> b) -> a -> b
$
(\(InfoBar ForeignPtr InfoBar
arg1) CString
arg2 CInt
arg3 -> ForeignPtr InfoBar
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> CString -> CInt -> IO (Ptr Widget)
gtk_info_bar_add_button Ptr InfoBar
argPtr1 CString
arg2 CInt
arg3)
{-# LINE 165 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
CString
buttonTextPtr
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
responseId)
infoBarSetResponseSensitive :: InfoBarClass self => self
-> Int
-> Bool
-> IO ()
infoBarSetResponseSensitive :: forall self. InfoBarClass self => self -> Int -> Bool -> IO ()
infoBarSetResponseSensitive self
self Int
responseId Bool
setting =
(\(InfoBar ForeignPtr InfoBar
arg1) CInt
arg2 CInt
arg3 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO ()) -> IO ())
-> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> CInt -> CInt -> IO ()
gtk_info_bar_set_response_sensitive Ptr InfoBar
argPtr1 CInt
arg2 CInt
arg3)
{-# LINE 181 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
responseId)
(Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
setting)
infoBarSetDefaultResponse :: InfoBarClass self => self
-> Int
-> IO ()
infoBarSetDefaultResponse :: forall self. InfoBarClass self => self -> Int -> IO ()
infoBarSetDefaultResponse self
self Int
responseId =
(\(InfoBar ForeignPtr InfoBar
arg1) CInt
arg2 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO ()) -> IO ())
-> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> CInt -> IO ()
gtk_info_bar_set_default_response Ptr InfoBar
argPtr1 CInt
arg2)
{-# LINE 196 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
responseId)
infoBarEmitResponse :: InfoBarClass self => self
-> Int
-> IO ()
infoBarEmitResponse :: forall self. InfoBarClass self => self -> Int -> IO ()
infoBarEmitResponse self
self Int
responseId =
(\(InfoBar ForeignPtr InfoBar
arg1) CInt
arg2 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO ()) -> IO ())
-> (Ptr InfoBar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> CInt -> IO ()
gtk_info_bar_response Ptr InfoBar
argPtr1 CInt
arg2)
{-# LINE 208 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
responseId)
infoBarGetActionArea :: InfoBarClass self => self
-> IO Widget
infoBarGetActionArea :: forall self. InfoBarClass self => self -> IO Widget
infoBarGetActionArea self
self =
(ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$
(\(InfoBar ForeignPtr InfoBar
arg1) -> ForeignPtr InfoBar
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> IO (Ptr Widget)
gtk_info_bar_get_action_area Ptr InfoBar
argPtr1)
{-# LINE 220 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
infoBarGetContentArea :: InfoBarClass self => self
-> IO Widget
infoBarGetContentArea :: forall self. InfoBarClass self => self -> IO Widget
infoBarGetContentArea self
self =
(ForeignPtr Widget -> Widget, FinalizerPtr Widget)
-> IO (Ptr Widget) -> IO Widget
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
forall a b. (a -> b) -> a -> b
$
(\(InfoBar ForeignPtr InfoBar
arg1) -> ForeignPtr InfoBar
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr InfoBar
arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr InfoBar
argPtr1 ->Ptr InfoBar -> IO (Ptr Widget)
gtk_info_bar_get_content_area Ptr InfoBar
argPtr1)
{-# LINE 231 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
(toInfoBar self)
infoBarMessageType :: InfoBarClass self => Attr self MessageType
infoBarMessageType :: forall self. InfoBarClass self => Attr self MessageType
infoBarMessageType = String -> GType -> Attr self MessageType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> GType -> Attr gobj enum
newAttrFromEnumProperty String
"message-type"
GType
gtk_message_type_get_type
{-# LINE 249 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
infoBarClose :: InfoBarClass self => Signal self (IO ())
infoBarClose :: forall self. InfoBarClass self => Signal self (IO ())
infoBarClose = (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
"close")
infoBarResponse :: InfoBarClass self => Signal self (Int -> IO ())
infoBarResponse :: forall self. InfoBarClass self => Signal self (Int -> IO ())
infoBarResponse = (Bool -> self -> (Int -> IO ()) -> IO (ConnectId self))
-> Signal self (Int -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> (Int -> IO ()) -> IO (ConnectId self)
forall obj.
GObjectClass obj =>
String -> Bool -> obj -> (Int -> IO ()) -> IO (ConnectId obj)
connect_INT__NONE String
"response")
foreign import ccall safe "gtk_info_bar_new"
gtk_info_bar_new :: (IO (Ptr Widget))
foreign import ccall safe "gtk_info_bar_add_action_widget"
gtk_info_bar_add_action_widget :: ((Ptr InfoBar) -> ((Ptr Widget) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_info_bar_add_button"
gtk_info_bar_add_button :: ((Ptr InfoBar) -> ((Ptr CChar) -> (CInt -> (IO (Ptr Widget)))))
foreign import ccall safe "gtk_info_bar_set_response_sensitive"
gtk_info_bar_set_response_sensitive :: ((Ptr InfoBar) -> (CInt -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_info_bar_set_default_response"
gtk_info_bar_set_default_response :: ((Ptr InfoBar) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_info_bar_response"
gtk_info_bar_response :: ((Ptr InfoBar) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_info_bar_get_action_area"
gtk_info_bar_get_action_area :: ((Ptr InfoBar) -> (IO (Ptr Widget)))
foreign import ccall safe "gtk_info_bar_get_content_area"
gtk_info_bar_get_content_area :: ((Ptr InfoBar) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_message_type_get_type"
gtk_message_type_get_type :: CUInt