{-# LINE 2 "./Graphics/UI/Gtk/Layout/Overlay.chs" #-}
-- -*-haskell-*-
-- GTK3 Widget Overlay
--
-- Author : Vincent Hanquez
--
-- Created: 15 May 2014
--
-- Copyright (C) 2014 Vincent Hanquez
-- Copyright (C) 1999-2005 Axel Simon
--
-- 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)
--
-- A simple container that can display overlayed widgets
--
module Graphics.UI.Gtk.Layout.Overlay (
-- * Detail
--
-- | The Overlay widget is a Bin widget where widgets can be added as overlay of the bin widget.

-- * Class Hierarchy
-- |
-- @
-- | 'GObject'
-- | +----'Object'
-- | +----'Widget'
-- | +----'Container'
-- | +----'Bin'
-- | +----Overlay
-- @

-- * Types
  Overlay,
  OverlayClass,
  castToOverlay, gTypeOverlay,
  toOverlay,

-- * Constructors
  overlayNew,
  overlayAdd
  ) where

import Control.Monad (liftM)

import System.Glib.FFI
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 61 "./Graphics/UI/Gtk/Layout/Overlay.chs" #-}


{-# LINE 63 "./Graphics/UI/Gtk/Layout/Overlay.chs" #-}

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

-- | Create a new 'Overlay'
--
overlayNew :: IO Overlay
overlayNew =
  makeNewObject mkOverlay $
  liftM (castPtr :: Ptr Widget -> Ptr Overlay) $
  gtk_overlay_new
{-# LINE 74 "./Graphics/UI/Gtk/Layout/Overlay.chs" #-}

overlayAdd :: (OverlayClass self, WidgetClass widget) => self
  -> widget -- ^ @widget@ - a widget to be placed as overlay
  -> IO ()
overlayAdd self widget =
  (\(Overlay arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_overlay_add_overlay argPtr1 argPtr2)
{-# LINE 80 "./Graphics/UI/Gtk/Layout/Overlay.chs" #-}
    (toOverlay self)
    (toWidget widget)

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

foreign import ccall unsafe "gtk_overlay_add_overlay"
  gtk_overlay_add_overlay :: ((Ptr Overlay) -> ((Ptr Widget) -> (IO ())))