    {-# LINE 2 "./System/GIO/Icons/EmblemedIcon.chs" #-}
    -- GIMP Toolkit (GTK) Binding for Haskell: binding to gio -*-haskell-*-
    --
    -- Author : Andy Stewart
    -- Created: 30-Apirl-2010
    --
    -- 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 3 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.
    --
    -- You should have received a copy of the GNU Lesser General Public
    -- License along with this program. If not, see
    -- <http:
    --
    -- GIO, the C library which this Haskell library depends on, is
    -- available under LGPL Version 2. The documentation included with
    -- this library is based on the original GIO documentation.
    --
    -- | Maintainer : gtk2hs-devel@lists.sourceforge.net
    -- Stability : alpha
    -- Portability : portable (depends on GHC)
    module System.GIO.Icons.EmblemedIcon (
    -- * Details
    --
    -- | 'EmblemedIcon' is an implementation of 'Icon' that supports adding an emblem to an icon. Adding
    -- multiple emblems to an icon is ensured via 'emblemedIconAddEmblem'.
    --
    -- Note that 'Emblem'edIcon allows no control over the position of the emblems. See also 'Emblem' for
    -- more information.

    -- * Types
        EmblemedIcon(..),
        EmblemedIconClass,

    -- * Methods
       emblemedIconNew,
       emblemedIconGetIcon,
       emblemedIconGetEmblems,
       emblemedIconAddEmblem,

        ) where

    import Control.Monad
    import System.GIO.Enums
    import System.Glib.FFI
    import System.Glib.Flags
    import System.Glib.GError
    import System.Glib.GList
    import System.Glib.GObject
    import System.Glib.UTFString
    import System.GIO.Types
    {-# LINE 61 "./System/GIO/Icons/EmblemedIcon.chs" #-}

    {-# LINE 63 "./System/GIO/Icons/EmblemedIcon.chs" #-}

    -------------------
    -- Methods
    -- | Creates a new emblemed icon for icon with the emblem emblem.
    emblemedIconNew :: (IconClass icon, EmblemClass emblem) => icon -> emblem -> IO EmblemedIcon
    emblemedIconNew :: forall icon emblem.
    (IconClass icon, EmblemClass emblem) =>
    icon -> emblem -> IO EmblemedIcon
    emblemedIconNew icon
    icon emblem
    emblem =
      (\(Icon ForeignPtr Icon
    arg1) (Emblem ForeignPtr Emblem
    arg2) -> ForeignPtr Icon -> (Ptr Icon -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Icon
    arg1 ((Ptr Icon -> IO (Ptr Icon)) -> IO (Ptr Icon))
    -> (Ptr Icon -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Icon
    argPtr1 ->ForeignPtr Emblem -> (Ptr Emblem -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Emblem
    arg2 ((Ptr Emblem -> IO (Ptr Icon)) -> IO (Ptr Icon))
    -> (Ptr Emblem -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. (a -> b) -> a -> b
    $ \Ptr Emblem
    argPtr2 ->Ptr Icon -> Ptr Emblem -> IO (Ptr Icon)
    g_emblemed_icon_new Ptr Icon
    argPtr1 Ptr Emblem
    argPtr2)
    {-# LINE 71 "./System/GIO/Icons/EmblemedIcon.chs" #-}
        (toIcon icon) (emblem -> Emblem
    forall o. EmblemClass o => o -> Emblem
    toEmblem emblem
    emblem)
      IO (Ptr Icon) -> (Ptr Icon -> IO EmblemedIcon) -> IO EmblemedIcon
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= ((ForeignPtr EmblemedIcon -> EmblemedIcon,
     FinalizerPtr EmblemedIcon)
    -> IO (Ptr EmblemedIcon) -> IO EmblemedIcon
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    constructNewGObject (ForeignPtr EmblemedIcon -> EmblemedIcon,
     FinalizerPtr EmblemedIcon)
    forall {a}.
    (ForeignPtr EmblemedIcon -> EmblemedIcon, FinalizerPtr a)
    mkEmblemedIcon (IO (Ptr EmblemedIcon) -> IO EmblemedIcon)
    -> (Ptr EmblemedIcon -> IO (Ptr EmblemedIcon))
    -> Ptr EmblemedIcon
    -> IO EmblemedIcon
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr EmblemedIcon -> IO (Ptr EmblemedIcon)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return) (Ptr EmblemedIcon -> IO EmblemedIcon)
    -> (Ptr Icon -> Ptr EmblemedIcon) -> Ptr Icon -> IO EmblemedIcon
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr Icon -> Ptr EmblemedIcon
    forall a b. Ptr a -> Ptr b
    castPtr

    -- | Gets the main icon for emblemed.
    emblemedIconGetIcon :: EmblemedIconClass emblemed => emblemed
     -> IO Icon -- ^ returns a 'Icon' that is owned by emblemed
    emblemedIconGetIcon :: forall emblemed. EmblemedIconClass emblemed => emblemed -> IO Icon
    emblemedIconGetIcon emblemed
    emblemed =
        (ForeignPtr Icon -> Icon, FinalizerPtr Icon)
    -> IO (Ptr Icon) -> IO Icon
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewGObject (ForeignPtr Icon -> Icon, FinalizerPtr Icon)
    forall {a}. (ForeignPtr Icon -> Icon, FinalizerPtr a)
    mkIcon (IO (Ptr Icon) -> IO Icon) -> IO (Ptr Icon) -> IO Icon
    forall a b. (a -> b) -> a -> b
    $
        (\(EmblemedIcon ForeignPtr EmblemedIcon
    arg1) -> ForeignPtr EmblemedIcon
    -> (Ptr EmblemedIcon -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr EmblemedIcon
    arg1 ((Ptr EmblemedIcon -> IO (Ptr Icon)) -> IO (Ptr Icon))
    -> (Ptr EmblemedIcon -> IO (Ptr Icon)) -> IO (Ptr Icon)
    forall a b. (a -> b) -> a -> b
    $ \Ptr EmblemedIcon
    argPtr1 ->Ptr EmblemedIcon -> IO (Ptr Icon)
    g_emblemed_icon_get_icon Ptr EmblemedIcon
    argPtr1) (emblemed -> EmblemedIcon
    forall o. EmblemedIconClass o => o -> EmblemedIcon
    toEmblemedIcon emblemed
    emblemed)

    -- | Gets the list of emblems for the icon.
    emblemedIconGetEmblems :: EmblemedIconClass emblemed => emblemed
     -> IO [Emblem] -- ^ returns a list of 'Emblem' s that is owned by emblemed
    emblemedIconGetEmblems :: forall emblemed.
    EmblemedIconClass emblemed =>
    emblemed -> IO [Emblem]
    emblemedIconGetEmblems emblemed
    emblemed = do
      Ptr ()
    glistPtr <- (\(EmblemedIcon ForeignPtr EmblemedIcon
    arg1) -> ForeignPtr EmblemedIcon
    -> (Ptr EmblemedIcon -> IO (Ptr ())) -> IO (Ptr ())
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr EmblemedIcon
    arg1 ((Ptr EmblemedIcon -> IO (Ptr ())) -> IO (Ptr ()))
    -> (Ptr EmblemedIcon -> IO (Ptr ())) -> IO (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ \Ptr EmblemedIcon
    argPtr1 ->Ptr EmblemedIcon -> IO (Ptr ())
    g_emblemed_icon_get_emblems Ptr EmblemedIcon
    argPtr1) (emblemed -> EmblemedIcon
    forall o. EmblemedIconClass o => o -> EmblemedIcon
    toEmblemedIcon emblemed
    emblemed)
      [Ptr Emblem]
    emblemPtrs <- Ptr () -> IO [Ptr Emblem]
    forall a. Ptr () -> IO [Ptr a]
    readGList Ptr ()
    glistPtr
      (Ptr Emblem -> IO Emblem) -> [Ptr Emblem] -> IO [Emblem]
    forall (t :: * -> *) (m :: * -> *) a b.
    (Traversable t, Monad m) =>
    (a -> m b) -> t a -> m (t b)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
    mapM ((ForeignPtr Emblem -> Emblem, FinalizerPtr Emblem)
    -> IO (Ptr Emblem) -> IO Emblem
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewGObject (ForeignPtr Emblem -> Emblem, FinalizerPtr Emblem)
    forall {a}. (ForeignPtr Emblem -> Emblem, FinalizerPtr a)
    mkEmblem (IO (Ptr Emblem) -> IO Emblem)
    -> (Ptr Emblem -> IO (Ptr Emblem)) -> Ptr Emblem -> IO Emblem
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ptr Emblem -> IO (Ptr Emblem)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return) [Ptr Emblem]
    emblemPtrs

    -- | Adds emblem to the 'Emblem'.
    emblemedIconAddEmblem :: EmblemedIconClass emblemed => emblemed
     -> Emblem
     -> IO ()
    emblemedIconAddEmblem :: forall emblemed.
    EmblemedIconClass emblemed =>
    emblemed -> Emblem -> IO ()
    emblemedIconAddEmblem emblemed
    emblemed Emblem
    emblem =
      (\(EmblemedIcon ForeignPtr EmblemedIcon
    arg1) (Emblem ForeignPtr Emblem
    arg2) -> ForeignPtr EmblemedIcon -> (Ptr EmblemedIcon -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr EmblemedIcon
    arg1 ((Ptr EmblemedIcon -> IO ()) -> IO ())
    -> (Ptr EmblemedIcon -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr EmblemedIcon
    argPtr1 ->ForeignPtr Emblem -> (Ptr Emblem -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Emblem
    arg2 ((Ptr Emblem -> IO ()) -> IO ()) -> (Ptr Emblem -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Emblem
    argPtr2 ->Ptr EmblemedIcon -> Ptr Emblem -> IO ()
    g_emblemed_icon_add_emblem Ptr EmblemedIcon
    argPtr1 Ptr Emblem
    argPtr2)
    {-# LINE 95 "./System/GIO/Icons/EmblemedIcon.chs" #-}
        (toEmblemedIcon emblemed)
        Emblem
    emblem

    foreign import ccall safe "g_emblemed_icon_new"
      g_emblemed_icon_new :: ((Ptr Icon) -> ((Ptr Emblem) -> (IO (Ptr Icon))))

    foreign import ccall safe "g_emblemed_icon_get_icon"
      g_emblemed_icon_get_icon :: ((Ptr EmblemedIcon) -> (IO (Ptr Icon)))

    foreign import ccall safe "g_emblemed_icon_get_emblems"
      g_emblemed_icon_get_emblems :: ((Ptr EmblemedIcon) -> (IO (Ptr ())))

    foreign import ccall safe "g_emblemed_icon_add_emblem"
      g_emblemed_icon_add_emblem :: ((Ptr EmblemedIcon) -> ((Ptr Emblem) -> (IO ())))