    {-# LINE 2 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Widget Statusbar
    --
    -- Author : Axel Simon, Andy Stewart
    --
    -- Created: 23 May 2001
    --
    -- Copyright (C) 1999-2005 Axel Simon
    -- Copyright (C) 2010 Andy Stewart
    --
    -- This library is free software; you can redistribute it and/or
    -- modify it under the terms of the GNU Lesser General Public
    -- License as published by the Free Software Foundation; either
    -- version 2.1 of the License, or (at your option) any later version.
    --
    -- This library is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -- Lesser General Public License for more details.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Report messages of minor importance to the user
    --
    module Graphics.UI.Gtk.Display.Statusbar (
    -- * Detail
    --
    -- | A 'Statusbar' is usually placed along the bottom of an application's main
    -- 'Window'. It may provide a regular commentary of the application's status
    -- (as is usually the case in a web browser, for example), or may be used to
    -- simply output a message when the status changes, (when an upload is complete
    -- in an FTP client, for example). It may also have a resize grip (a triangular
    -- area in the lower right corner) which can be clicked on to resize the window
    -- containing the statusbar.
    --
    -- Status bars in Gtk+ maintain a stack of messages. The message at the top
    -- of the each bar's stack is the one that will currently be displayed.
    --
    -- Any messages added to a statusbar's stack must specify a /context_id/
    -- that is used to uniquely identify the source of a message. This context_id
    -- can be generated by 'statusbarGetContextId', given a message and the
    -- statusbar that it will be added to. Note that messages are stored in a
    -- stack, and when choosing which message to display, the stack structure is
    -- adhered to, regardless of the context identifier of a message.
    --
    -- Status bars are created using 'statusbarNew'.
    --
    -- Messages are added to the bar's stack with 'statusbarPush'.
    --
    -- The message at the top of the stack can be removed using 'statusbarPop'.
    -- A message can be removed from anywhere in the stack if its message_id was
    -- recorded at the time it was added. This is done using 'statusbarRemove'.

    -- * Class Hierarchy
    -- |
    -- @
    -- | 'GObject'
    -- | +----'Object'
    -- | +----'Widget'
    -- | +----'Container'
    -- | +----'Box'
    -- | +----'HBox'
    -- | +----Statusbar
    -- @

    -- * Types
      Statusbar,
      StatusbarClass,
      castToStatusbar, gTypeStatusbar,
      toStatusbar,
      ContextId,
      MessageId,

    -- * Constructors
      statusbarNew,

    -- * Methods
      statusbarGetContextId,
      statusbarPush,
      statusbarPop,
      statusbarRemove,

      statusbarGetMessageArea,

      statusbarRemoveAll,

    -- * Attributes

    -- * Signals
      textPopped,
      textPushed,

    -- * Deprecated

      ) where

    import Control.Monad (liftM)

    import System.Glib.FFI
    import System.Glib.UTFString

    import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
    import Graphics.UI.Gtk.Types
    {-# LINE 124 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
    import Graphics.UI.Gtk.Signals
    {-# LINE 125 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}

    {-# LINE 127 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}

    --------------------
    -- Constructors

    -- | Creates a new 'Statusbar' ready for messages.
    --
    statusbarNew :: IO Statusbar
    statusbarNew :: IO Statusbar
    statusbarNew =
      (ForeignPtr Statusbar -> Statusbar, FinalizerPtr Statusbar)
    -> IO (Ptr Statusbar) -> IO Statusbar
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Statusbar -> Statusbar, FinalizerPtr Statusbar)
    forall {a}. (ForeignPtr Statusbar -> Statusbar, FinalizerPtr a)
    mkStatusbar (IO (Ptr Statusbar) -> IO Statusbar)
    -> IO (Ptr Statusbar) -> IO Statusbar
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr Statusbar)
    -> IO (Ptr Widget) -> IO (Ptr Statusbar)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr Statusbar
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr Statusbar) (IO (Ptr Widget) -> IO (Ptr Statusbar))
    -> IO (Ptr Widget) -> IO (Ptr Statusbar)
    forall a b. (a -> b) -> a -> b
    $
      IO (Ptr Widget)
    gtk_statusbar_new
    {-# LINE 138 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}

    --------------------
    -- Methods

    type ContextId = (CUInt)
    {-# LINE 143 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}

    -- | Returns a new context identifier, given a description of the actual
    -- context. This id can be used to later remove entries form the Statusbar.
    --
    statusbarGetContextId :: (StatusbarClass self, GlibString string) => self
     -> string -- ^ @contextDescription@ - textual description of what context the
                     -- new message is being used in.
     -> IO ContextId -- ^ returns an id that can be used to later remove entries
                     -- ^ from the Statusbar.
    statusbarGetContextId :: forall self string.
    (StatusbarClass self, GlibString string) =>
    self -> string -> IO ContextId
    statusbarGetContextId self
    self string
    contextDescription =
      string -> (CString -> IO ContextId) -> IO ContextId
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    contextDescription ((CString -> IO ContextId) -> IO ContextId)
    -> (CString -> IO ContextId) -> IO ContextId
    forall a b. (a -> b) -> a -> b
    $ \CString
    contextDescriptionPtr ->
      (\(Statusbar ForeignPtr Statusbar
    arg1) CString
    arg2 -> ForeignPtr Statusbar
    -> (Ptr Statusbar -> IO ContextId) -> IO ContextId
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO ContextId) -> IO ContextId)
    -> (Ptr Statusbar -> IO ContextId) -> IO ContextId
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> CString -> IO ContextId
    gtk_statusbar_get_context_id Ptr Statusbar
    argPtr1 CString
    arg2)
    {-# LINE 155 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)
        CString
    contextDescriptionPtr

    newtype MessageId = MessageId (CUInt)
    {-# LINE 159 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}

    -- | Pushes a new message onto the Statusbar's stack. It will
    -- be displayed as long as it is on top of the stack.
    --
    statusbarPush :: (StatusbarClass self, GlibString string) => self
     -> ContextId -- ^ @contextId@ - the message's context id, as returned by
                     -- 'statusbarGetContextId'.
     -> string -- ^ @text@ - the message to add to the statusbar.
     -> IO MessageId -- ^ returns the message's new message id for use with
                     -- 'statusbarRemove'.
    statusbarPush :: forall self string.
    (StatusbarClass self, GlibString string) =>
    self -> ContextId -> string -> IO MessageId
    statusbarPush self
    self ContextId
    contextId string
    text =
      (ContextId -> MessageId) -> IO ContextId -> IO MessageId
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM ContextId -> MessageId
    MessageId (IO ContextId -> IO MessageId) -> IO ContextId -> IO MessageId
    forall a b. (a -> b) -> a -> b
    $
      string -> (CString -> IO ContextId) -> IO ContextId
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    text ((CString -> IO ContextId) -> IO ContextId)
    -> (CString -> IO ContextId) -> IO ContextId
    forall a b. (a -> b) -> a -> b
    $ \CString
    textPtr ->
      (\(Statusbar ForeignPtr Statusbar
    arg1) ContextId
    arg2 CString
    arg3 -> ForeignPtr Statusbar
    -> (Ptr Statusbar -> IO ContextId) -> IO ContextId
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO ContextId) -> IO ContextId)
    -> (Ptr Statusbar -> IO ContextId) -> IO ContextId
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> ContextId -> CString -> IO ContextId
    gtk_statusbar_push Ptr Statusbar
    argPtr1 ContextId
    arg2 CString
    arg3)
    {-# LINE 173 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)
        ContextId
    contextId
        CString
    textPtr

    -- | Removes the topmost message that has the correct context.
    --
    statusbarPop :: StatusbarClass self => self
     -> ContextId -- ^ @contextId@ - the context identifier used when the
                    -- message was added.
     -> IO ()
    statusbarPop :: forall self. StatusbarClass self => self -> ContextId -> IO ()
    statusbarPop self
    self ContextId
    contextId =
      (\(Statusbar ForeignPtr Statusbar
    arg1) ContextId
    arg2 -> ForeignPtr Statusbar -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO ()) -> IO ())
    -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> ContextId -> IO ()
    gtk_statusbar_pop Ptr Statusbar
    argPtr1 ContextId
    arg2)
    {-# LINE 185 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)
         ContextId
    contextId

    -- | Forces the removal of a message from a statusbar's stack. The exact
    -- @contextId@ and @messageId@ must be specified.
    --
    statusbarRemove :: StatusbarClass self => self
     -> ContextId -- ^ @contextId@ - a context identifier.
     -> MessageId -- ^ @messageId@ - a message identifier, as returned by
                  -- 'statusbarPush'.
     -> IO ()
    statusbarRemove :: forall self.
    StatusbarClass self =>
    self -> ContextId -> MessageId -> IO ()
    statusbarRemove self
    self ContextId
    contextId (MessageId ContextId
    messageId) =
      (\(Statusbar ForeignPtr Statusbar
    arg1) ContextId
    arg2 ContextId
    arg3 -> ForeignPtr Statusbar -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO ()) -> IO ())
    -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> ContextId -> ContextId -> IO ()
    gtk_statusbar_remove Ptr Statusbar
    argPtr1 ContextId
    arg2 ContextId
    arg3)
    {-# LINE 198 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)
        ContextId
    contextId
        ContextId
    messageId
    {-# LINE 221 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
    -- | Retrieves the box containing the label widget.
    statusbarGetMessageArea :: StatusbarClass self => self -> IO Box
    statusbarGetMessageArea :: forall self. StatusbarClass self => self -> IO Box
    statusbarGetMessageArea self
    self =
      (ForeignPtr Box -> Box, FinalizerPtr Box) -> IO (Ptr Box) -> IO Box
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Box -> Box, FinalizerPtr Box)
    forall {a}. (ForeignPtr Box -> Box, FinalizerPtr a)
    mkBox (IO (Ptr Box) -> IO Box) -> IO (Ptr Box) -> IO Box
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr Box) -> IO (Ptr Widget) -> IO (Ptr Box)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr Box
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr Box) (IO (Ptr Widget) -> IO (Ptr Box))
    -> IO (Ptr Widget) -> IO (Ptr Box)
    forall a b. (a -> b) -> a -> b
    $
      (\(Statusbar ForeignPtr Statusbar
    arg1) -> ForeignPtr Statusbar
    -> (Ptr Statusbar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (Ptr Statusbar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> IO (Ptr Widget)
    gtk_statusbar_get_message_area Ptr Statusbar
    argPtr1)
    {-# LINE 227 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)

    -- | Forces the removal of all messages from a statusbar's stack with the exact @contextId@.
    --
    -- * Available since Gtk+ version 2.22
    --
    statusbarRemoveAll :: StatusbarClass self => self
                       -> ContextId -- ^ @contextId@ a context identifier
                       -> IO ()
    statusbarRemoveAll :: forall self. StatusbarClass self => self -> ContextId -> IO ()
    statusbarRemoveAll self
    self ContextId
    contextId =
      (\(Statusbar ForeignPtr Statusbar
    arg1) ContextId
    arg2 -> ForeignPtr Statusbar -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Statusbar
    arg1 ((Ptr Statusbar -> IO ()) -> IO ())
    -> (Ptr Statusbar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Statusbar
    argPtr1 ->Ptr Statusbar -> ContextId -> IO ()
    gtk_statusbar_remove_all Ptr Statusbar
    argPtr1 ContextId
    arg2)
    {-# LINE 241 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
        (toStatusbar self)
        ContextId
    contextId

    --------------------
    -- Attributes
    {-# LINE 260 "./Graphics/UI/Gtk/Display/Statusbar.chs" #-}
    --------------------
    -- Signals

    -- %hash c:4eb7 d:d0ef
    -- | Is emitted whenever a new message gets pushed onto a statusbar's stack.
    --
    textPushed :: (StatusbarClass self, GlibString string) => Signal self (ContextId -> string -> IO ())
    textPushed :: forall self string.
    (StatusbarClass self, GlibString string) =>
    Signal self (ContextId -> string -> IO ())
    textPushed = (Bool
     -> self -> (ContextId -> string -> IO ()) -> IO (ConnectId self))
    -> Signal self (ContextId -> string -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (\Bool
    a self
    self ContextId -> string -> IO ()
    user -> SignalName
    -> Bool -> self -> (Word -> string -> IO ()) -> IO (ConnectId self)
    forall b' obj.
    (GlibString b', GObjectClass obj) =>
    SignalName
    -> Bool -> obj -> (Word -> b' -> IO ()) -> IO (ConnectId obj)
    connect_WORD_GLIBSTRING__NONE SignalName
    "text-pushed" Bool
    a self
    self (\Word
    w string
    s -> ContextId -> string -> IO ()
    user (Word -> ContextId
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word
    w) string
    s))

    -- %hash c:2614 d:c1d2
    -- | Is emitted whenever a new message is popped off a statusbar's stack.
    --
    textPopped :: (StatusbarClass self, GlibString string) => Signal self (ContextId -> string -> IO ())
    textPopped :: forall self string.
    (StatusbarClass self, GlibString string) =>
    Signal self (ContextId -> string -> IO ())
    textPopped = (Bool
     -> self -> (ContextId -> string -> IO ()) -> IO (ConnectId self))
    -> Signal self (ContextId -> string -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (\Bool
    a self
    self ContextId -> string -> IO ()
    user -> SignalName
    -> Bool -> self -> (Word -> string -> IO ()) -> IO (ConnectId self)
    forall b' obj.
    (GlibString b', GObjectClass obj) =>
    SignalName
    -> Bool -> obj -> (Word -> b' -> IO ()) -> IO (ConnectId obj)
    connect_WORD_GLIBSTRING__NONE SignalName
    "text-popped" Bool
    a self
    self (\Word
    w string
    s -> ContextId -> string -> IO ()
    user (Word -> ContextId
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word
    w) string
    s))

    --------------------
    -- Deprecated Signals

    foreign import ccall unsafe "gtk_statusbar_new"
      gtk_statusbar_new :: (IO (Ptr Widget))

    foreign import ccall unsafe "gtk_statusbar_get_context_id"
      gtk_statusbar_get_context_id :: ((Ptr Statusbar) -> ((Ptr CChar) -> (IO CUInt)))

    foreign import ccall safe "gtk_statusbar_push"
      gtk_statusbar_push :: ((Ptr Statusbar) -> (CUInt -> ((Ptr CChar) -> (IO CUInt))))

    foreign import ccall safe "gtk_statusbar_pop"
      gtk_statusbar_pop :: ((Ptr Statusbar) -> (CUInt -> (IO ())))

    foreign import ccall safe "gtk_statusbar_remove"
      gtk_statusbar_remove :: ((Ptr Statusbar) -> (CUInt -> (CUInt -> (IO ()))))

    foreign import ccall unsafe "gtk_statusbar_get_message_area"
      gtk_statusbar_get_message_area :: ((Ptr Statusbar) -> (IO (Ptr Widget)))

    foreign import ccall safe "gtk_statusbar_remove_all"
      gtk_statusbar_remove_all :: ((Ptr Statusbar) -> (CUInt -> (IO ())))