{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gtk.Objects.WindowGroup
    ( 

-- * Exported types
    WindowGroup(..)                         ,
    WindowGroupK                            ,
    toWindowGroup                           ,
    noWindowGroup                           ,


 -- * Methods
-- ** windowGroupAddWindow
    windowGroupAddWindow                    ,


-- ** windowGroupGetCurrentDeviceGrab
    windowGroupGetCurrentDeviceGrab         ,


-- ** windowGroupGetCurrentGrab
    windowGroupGetCurrentGrab               ,


-- ** windowGroupListWindows
    windowGroupListWindows                  ,


-- ** windowGroupNew
    windowGroupNew                          ,


-- ** windowGroupRemoveWindow
    windowGroupRemoveWindow                 ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.GObject as GObject
import qualified GI.Gdk as Gdk

newtype WindowGroup = WindowGroup (ForeignPtr WindowGroup)
foreign import ccall "gtk_window_group_get_type"
    c_gtk_window_group_get_type :: IO GType

type instance ParentTypes WindowGroup = WindowGroupParentTypes
type WindowGroupParentTypes = '[GObject.Object]

instance GObject WindowGroup where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_gtk_window_group_get_type
    

class GObject o => WindowGroupK o
instance (GObject o, IsDescendantOf WindowGroup o) => WindowGroupK o

toWindowGroup :: WindowGroupK o => o -> IO WindowGroup
toWindowGroup = unsafeCastTo WindowGroup

noWindowGroup :: Maybe WindowGroup
noWindowGroup = Nothing

type instance AttributeList WindowGroup = WindowGroupAttributeList
type WindowGroupAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList WindowGroup = WindowGroupSignalList
type WindowGroupSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method WindowGroup::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- hInArgs : []
-- returnType : TInterface "Gtk" "WindowGroup"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_new" gtk_window_group_new :: 
    IO (Ptr WindowGroup)


windowGroupNew ::
    (MonadIO m) =>
    m WindowGroup
windowGroupNew  = liftIO $ do
    result <- gtk_window_group_new
    checkUnexpectedReturnNULL "gtk_window_group_new" result
    result' <- (wrapObject WindowGroup) result
    return result'

-- method WindowGroup::add_window
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "window", argType = TInterface "Gtk" "Window", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "window", argType = TInterface "Gtk" "Window", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_add_window" gtk_window_group_add_window :: 
    Ptr WindowGroup ->                      -- _obj : TInterface "Gtk" "WindowGroup"
    Ptr Window ->                           -- window : TInterface "Gtk" "Window"
    IO ()


windowGroupAddWindow ::
    (MonadIO m, WindowGroupK a, WindowK b) =>
    a ->                                    -- _obj
    b ->                                    -- window
    m ()
windowGroupAddWindow _obj window = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let window' = unsafeManagedPtrCastPtr window
    gtk_window_group_add_window _obj' window'
    touchManagedPtr _obj
    touchManagedPtr window
    return ()

-- method WindowGroup::get_current_device_grab
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "device", argType = TInterface "Gdk" "Device", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "device", argType = TInterface "Gdk" "Device", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "Widget"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_get_current_device_grab" gtk_window_group_get_current_device_grab :: 
    Ptr WindowGroup ->                      -- _obj : TInterface "Gtk" "WindowGroup"
    Ptr Gdk.Device ->                       -- device : TInterface "Gdk" "Device"
    IO (Ptr Widget)


windowGroupGetCurrentDeviceGrab ::
    (MonadIO m, WindowGroupK a, Gdk.DeviceK b) =>
    a ->                                    -- _obj
    b ->                                    -- device
    m Widget
windowGroupGetCurrentDeviceGrab _obj device = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let device' = unsafeManagedPtrCastPtr device
    result <- gtk_window_group_get_current_device_grab _obj' device'
    checkUnexpectedReturnNULL "gtk_window_group_get_current_device_grab" result
    result' <- (newObject Widget) result
    touchManagedPtr _obj
    touchManagedPtr device
    return result'

-- method WindowGroup::get_current_grab
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "Widget"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_get_current_grab" gtk_window_group_get_current_grab :: 
    Ptr WindowGroup ->                      -- _obj : TInterface "Gtk" "WindowGroup"
    IO (Ptr Widget)


windowGroupGetCurrentGrab ::
    (MonadIO m, WindowGroupK a) =>
    a ->                                    -- _obj
    m Widget
windowGroupGetCurrentGrab _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_window_group_get_current_grab _obj'
    checkUnexpectedReturnNULL "gtk_window_group_get_current_grab" result
    result' <- (newObject Widget) result
    touchManagedPtr _obj
    return result'

-- method WindowGroup::list_windows
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TGList (TInterface "Gtk" "Window")
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_list_windows" gtk_window_group_list_windows :: 
    Ptr WindowGroup ->                      -- _obj : TInterface "Gtk" "WindowGroup"
    IO (Ptr (GList (Ptr Window)))


windowGroupListWindows ::
    (MonadIO m, WindowGroupK a) =>
    a ->                                    -- _obj
    m [Window]
windowGroupListWindows _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_window_group_list_windows _obj'
    checkUnexpectedReturnNULL "gtk_window_group_list_windows" result
    result' <- unpackGList result
    result'' <- mapM (newObject Window) result'
    g_list_free result
    touchManagedPtr _obj
    return result''

-- method WindowGroup::remove_window
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "window", argType = TInterface "Gtk" "Window", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "WindowGroup", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "window", argType = TInterface "Gtk" "Window", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_window_group_remove_window" gtk_window_group_remove_window :: 
    Ptr WindowGroup ->                      -- _obj : TInterface "Gtk" "WindowGroup"
    Ptr Window ->                           -- window : TInterface "Gtk" "Window"
    IO ()


windowGroupRemoveWindow ::
    (MonadIO m, WindowGroupK a, WindowK b) =>
    a ->                                    -- _obj
    b ->                                    -- window
    m ()
windowGroupRemoveWindow _obj window = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let window' = unsafeManagedPtrCastPtr window
    gtk_window_group_remove_window _obj' window'
    touchManagedPtr _obj
    touchManagedPtr window
    return ()