{-# 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 icon emblem =
  (\(Icon arg1) (Emblem arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_emblemed_icon_new argPtr1 argPtr2)
{-# LINE 71 "./System/GIO/Icons/EmblemedIcon.chs" #-}
    (toIcon icon) (toEmblem emblem)
  >>= (constructNewGObject mkEmblemedIcon . return) . castPtr

-- | Gets the main icon for emblemed.
emblemedIconGetIcon :: EmblemedIconClass emblemed => emblemed
 -> IO Icon -- ^ returns a 'Icon' that is owned by emblemed
emblemedIconGetIcon emblemed =
    makeNewGObject mkIcon $
    (\(EmblemedIcon arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_emblemed_icon_get_icon argPtr1) (toEmblemedIcon 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 emblemed = do
  glistPtr <- (\(EmblemedIcon arg1) -> withForeignPtr arg1 $ \argPtr1 ->g_emblemed_icon_get_emblems argPtr1) (toEmblemedIcon emblemed)
  emblemPtrs <- readGList glistPtr
  mapM (makeNewGObject mkEmblem . return) emblemPtrs

-- | Adds emblem to the 'Emblem'.
emblemedIconAddEmblem :: EmblemedIconClass emblemed => emblemed
 -> Emblem
 -> IO ()
emblemedIconAddEmblem emblemed emblem =
  (\(EmblemedIcon arg1) (Emblem arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->g_emblemed_icon_add_emblem argPtr1 argPtr2)
{-# LINE 95 "./System/GIO/Icons/EmblemedIcon.chs" #-}
    (toEmblemedIcon emblemed)
    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 ())))