-- GENERATED by C->Haskell Compiler, version 0.13.13 (gtk2hs branch) "Bin IO", 27 May 2012 (Haskell)
-- Edit the ORIGINAL .chs file instead!


{-# LINE 1 "./System/GIO/Signals.chs" #-}
{-# OPTIONS_HADDOCK hide #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- -*-haskell-*-
-- -------------------- automatically generated file - do not edit ------------
--  Callback installers for the GIMP Toolkit (GTK) Binding for Haskell
--
--  Author : Axel Simon
--
--  Created: 1 July 2000
--
--  Copyright (C) 2000-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.
--
-- #hide

-- These functions are used to connect signals to widgets. They are auto-
-- matically created through HookGenerator.hs which takes a list of possible
-- function signatures that are included in the GTK sources (gtkmarshal.list).
--
-- The object system in the second version of GTK is based on GObject from
-- GLIB. This base class is rather primitive in that it only implements
-- ref and unref methods (and others that are not interesting to us). If
-- the marshall list mentions OBJECT it refers to an instance of this
-- GObject which is automatically wrapped with a ref and unref call.
-- Structures which are not derived from GObject have to be passed as
-- BOXED which gives the signal connect function a possibility to do the
-- conversion into a proper ForeignPtr type. In special cases the signal
-- connect function use a PTR type which will then be mangled in the
-- user function directly. The latter is needed if a signal delivers a
-- pointer to a string and its length in a separate integer.
--
module System.GIO.Signals (
  module System.Glib.Signals,

  connect_NONE__NONE,
  connect_GLIBSTRING_GLIBSTRING_GLIBSTRING_ENUM__NONE,
  connect_OBJECT_OBJECT_ENUM__NONE,
  connect_ENUM__NONE,
  connect_OBJECT__NONE,
  connect_MOBJECT_MOBJECT_ENUM__NONE,
  
  ) where

import Control.Monad    (liftM)

import System.Glib.FFI
import System.Glib.UTFString   (peekUTFString,maybePeekUTFString,newUTFString)
import qualified System.Glib.UTFString as Glib
import System.Glib.GError      (failOnGError)
import System.Glib.Signals
{-# LINE 59 "./System/GIO/Signals.chs" #-}
import System.Glib.GObject
{-# LINE 60 "./System/GIO/Signals.chs" #-}



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


-- Here are the generators that turn a Haskell function into
-- a C function pointer. The fist Argument is always the widget,
-- the last one is the user g_pointer. Both are ignored.


connect_NONE__NONE :: 
  GObjectClass obj => SignalName ->
  ConnectAfter -> obj ->
  (IO ()) ->
  IO (ConnectId obj)
connect_NONE__NONE :: forall obj.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> IO () -> IO (ConnectId obj)
connect_NONE__NONE SignalName
signal ConnectAfter
after obj
obj IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> IO ()
action
  where action :: Ptr GObject -> IO ()
        action :: Ptr GObject -> IO ()
action Ptr GObject
_ =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          IO ()
user

connect_GLIBSTRING_GLIBSTRING_GLIBSTRING_ENUM__NONE :: 
  (Glib.GlibString a', Glib.GlibString b', Glib.GlibString c', Enum d, GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  (a' -> b' -> c' -> d -> IO ()) ->
  IO (ConnectId obj)
connect_GLIBSTRING_GLIBSTRING_GLIBSTRING_ENUM__NONE :: forall a' b' c' d obj.
(GlibString a', GlibString b', GlibString c', Enum d,
 GObjectClass obj) =>
SignalName
-> ConnectAfter
-> obj
-> (a' -> b' -> c' -> d -> IO ())
-> IO (ConnectId obj)
connect_GLIBSTRING_GLIBSTRING_GLIBSTRING_ENUM__NONE SignalName
signal ConnectAfter
after obj
obj a' -> b' -> c' -> d -> IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> CString -> CString -> CString -> Int -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> CString -> CString -> CString -> Int -> IO ()
action
  where action :: Ptr GObject -> CString -> CString -> CString -> Int -> IO ()
        action :: Ptr GObject -> CString -> CString -> CString -> Int -> IO ()
action Ptr GObject
_ CString
str1 CString
str2 CString
str3 Int
enum4 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          CString -> IO c'
forall s. GlibString s => CString -> IO s
peekUTFString CString
str3 IO c' -> (c' -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \c'
str3' ->
          CString -> IO b'
forall s. GlibString s => CString -> IO s
peekUTFString CString
str2 IO b' -> (b' -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \b'
str2' ->
          CString -> IO a'
forall s. GlibString s => CString -> IO s
peekUTFString CString
str1 IO a' -> (a' -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a'
str1' ->
          a' -> b' -> c' -> d -> IO ()
user a'
str1' b'
str2' c'
str3' (Int -> d
forall a. Enum a => Int -> a
toEnum Int
enum4)

connect_OBJECT_OBJECT_ENUM__NONE :: 
  (GObjectClass a', GObjectClass b', Enum c, GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  (a' -> b' -> c -> IO ()) ->
  IO (ConnectId obj)
connect_OBJECT_OBJECT_ENUM__NONE :: forall a' b' c obj.
(GObjectClass a', GObjectClass b', Enum c, GObjectClass obj) =>
SignalName
-> ConnectAfter
-> obj
-> (a' -> b' -> c -> IO ())
-> IO (ConnectId obj)
connect_OBJECT_OBJECT_ENUM__NONE SignalName
signal ConnectAfter
after obj
obj a' -> b' -> c -> IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
action
  where action :: Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
        action :: Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
action Ptr GObject
_ Ptr GObject
obj1 Ptr GObject
obj2 Int
enum3 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject
GObject, FinalizerPtr GObject
forall a. FinalizerPtr a
objectUnref) (Ptr GObject -> IO (Ptr GObject)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GObject
obj2) IO GObject -> (GObject -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \GObject
obj2' ->
          (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject
GObject, FinalizerPtr GObject
forall a. FinalizerPtr a
objectUnref) (Ptr GObject -> IO (Ptr GObject)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GObject
obj1) IO GObject -> (GObject -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \GObject
obj1' ->
          a' -> b' -> c -> IO ()
user (GObject -> a'
forall o. GObjectClass o => GObject -> o
unsafeCastGObject GObject
obj1') (GObject -> b'
forall o. GObjectClass o => GObject -> o
unsafeCastGObject GObject
obj2') (Int -> c
forall a. Enum a => Int -> a
toEnum Int
enum3)

connect_ENUM__NONE :: 
  (Enum a, GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  (a -> IO ()) ->
  IO (ConnectId obj)
connect_ENUM__NONE :: forall a obj.
(Enum a, GObjectClass obj) =>
SignalName
-> ConnectAfter -> obj -> (a -> IO ()) -> IO (ConnectId obj)
connect_ENUM__NONE SignalName
signal ConnectAfter
after obj
obj a -> IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> Int -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> Int -> IO ()
action
  where action :: Ptr GObject -> Int -> IO ()
        action :: Ptr GObject -> Int -> IO ()
action Ptr GObject
_ Int
enum1 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          a -> IO ()
user (Int -> a
forall a. Enum a => Int -> a
toEnum Int
enum1)

connect_OBJECT__NONE :: 
  (GObjectClass a', GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  (a' -> IO ()) ->
  IO (ConnectId obj)
connect_OBJECT__NONE :: forall a' obj.
(GObjectClass a', GObjectClass obj) =>
SignalName
-> ConnectAfter -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
connect_OBJECT__NONE SignalName
signal ConnectAfter
after obj
obj a' -> IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> Ptr GObject -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> Ptr GObject -> IO ()
action
  where action :: Ptr GObject -> Ptr GObject -> IO ()
        action :: Ptr GObject -> Ptr GObject -> IO ()
action Ptr GObject
_ Ptr GObject
obj1 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          (ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject
GObject, FinalizerPtr GObject
forall a. FinalizerPtr a
objectUnref) (Ptr GObject -> IO (Ptr GObject)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GObject
obj1) IO GObject -> (GObject -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \GObject
obj1' ->
          a' -> IO ()
user (GObject -> a'
forall o. GObjectClass o => GObject -> o
unsafeCastGObject GObject
obj1')

connect_MOBJECT_MOBJECT_ENUM__NONE :: 
  (GObjectClass a', GObjectClass b', Enum c, GObjectClass obj) => SignalName ->
  ConnectAfter -> obj ->
  (Maybe a' -> Maybe b' -> c -> IO ()) ->
  IO (ConnectId obj)
connect_MOBJECT_MOBJECT_ENUM__NONE :: forall a' b' c obj.
(GObjectClass a', GObjectClass b', Enum c, GObjectClass obj) =>
SignalName
-> ConnectAfter
-> obj
-> (Maybe a' -> Maybe b' -> c -> IO ())
-> IO (ConnectId obj)
connect_MOBJECT_MOBJECT_ENUM__NONE SignalName
signal ConnectAfter
after obj
obj Maybe a' -> Maybe b' -> c -> IO ()
user =
  SignalName
-> ConnectAfter
-> obj
-> (Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ())
-> IO (ConnectId obj)
forall obj handler.
GObjectClass obj =>
SignalName -> ConnectAfter -> obj -> handler -> IO (ConnectId obj)
connectGeneric SignalName
signal ConnectAfter
after obj
obj Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
action
  where action :: Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
        action :: Ptr GObject -> Ptr GObject -> Ptr GObject -> Int -> IO ()
action Ptr GObject
_ Ptr GObject
obj1 Ptr GObject
obj2 Int
enum3 =
          IO () -> IO ()
forall a. IO a -> IO a
failOnGError (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
          (IO (Ptr GObject) -> IO GObject)
-> IO (Ptr GObject) -> IO (Maybe GObject)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject
GObject, FinalizerPtr GObject
forall a. FinalizerPtr a
objectUnref)) (Ptr GObject -> IO (Ptr GObject)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GObject
obj2) IO (Maybe GObject) -> (Maybe GObject -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Maybe GObject
obj2' ->
          (IO (Ptr GObject) -> IO GObject)
-> IO (Ptr GObject) -> IO (Maybe GObject)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr GObject -> GObject, FinalizerPtr GObject)
-> IO (Ptr GObject) -> IO GObject
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr GObject -> GObject
GObject, FinalizerPtr GObject
forall a. FinalizerPtr a
objectUnref)) (Ptr GObject -> IO (Ptr GObject)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GObject
obj1) IO (Maybe GObject) -> (Maybe GObject -> IO ()) -> IO ()
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Maybe GObject
obj1' ->
          Maybe a' -> Maybe b' -> c -> IO ()
user ((GObject -> a') -> Maybe GObject -> Maybe a'
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM GObject -> a'
forall o. GObjectClass o => GObject -> o
unsafeCastGObject Maybe GObject
obj1') ((GObject -> b') -> Maybe GObject -> Maybe b'
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM GObject -> b'
forall o. GObjectClass o => GObject -> o
unsafeCastGObject Maybe GObject
obj2') (Int -> c
forall a. Enum a => Int -> a
toEnum Int
enum3)