module Bindings.GObject.Closures where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
import Bindings.GLib
import Bindings.GObject.TypeInformation
foreign import ccall "inline_G_CLOSURE_NEEDS_MARSHAL" c'G_CLOSURE_NEEDS_MARSHAL
:: Ptr C'GClosure -> CInt
foreign import ccall "inline_G_CLOSURE_N_NOTIFIERS" c'G_CLOSURE_N_NOTIFIERS
:: Ptr C'GClosure -> C'guint
foreign import ccall "inline_G_CCLOSURE_SWAP_DATA" c'G_CCLOSURE_SWAP_DATA
:: Ptr C'GClosure -> C'guint
foreign import ccall "inline_G_CALLBACK" c'G_CALLBACK
:: FunPtr a -> C'GCallback
data C'GClosure = C'GClosure{
} deriving (Eq,Show)
instance Storable C'GClosure where
sizeOf _ = 16
alignment = sizeOf
peek p = do
return $ C'GClosure
poke p (C'GClosure) = do
return ()
type C'GCallback = FunPtr (IO ())
foreign import ccall "wrapper" mk'GCallback
:: (IO ()) -> IO C'GCallback
foreign import ccall "dynamic" mK'GCallback
:: C'GCallback -> (IO ())
type C'GClosureNotify = FunPtr (C'gpointer -> Ptr C'GClosure -> IO ())
foreign import ccall "wrapper" mk'GClosureNotify
:: (C'gpointer -> Ptr C'GClosure -> IO ()) -> IO C'GClosureNotify
foreign import ccall "dynamic" mK'GClosureNotify
:: C'GClosureNotify -> (C'gpointer -> Ptr C'GClosure -> IO ())
data C'GCClosure = C'GCClosure{
c'GCClosure'closure :: C'GClosure
,
c'GCClosure'callback :: C'gpointer
} deriving (Eq,Show)
instance Storable C'GCClosure where
sizeOf _ = 20
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 16
return $ C'GCClosure v0 v1
poke p (C'GCClosure v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 16 v1
return ()
type C'GClosureMarshal = FunPtr (Ptr C'GClosure -> Ptr C'GValue -> C'guint -> Ptr C'GValue -> C'gpointer -> C'gpointer -> IO ())
foreign import ccall "wrapper" mk'GClosureMarshal
:: (Ptr C'GClosure -> Ptr C'GValue -> C'guint -> Ptr C'GValue -> C'gpointer -> C'gpointer -> IO ()) -> IO C'GClosureMarshal
foreign import ccall "dynamic" mK'GClosureMarshal
:: C'GClosureMarshal -> (Ptr C'GClosure -> Ptr C'GValue -> C'guint -> Ptr C'GValue -> C'gpointer -> C'gpointer -> IO ())
foreign import ccall "g_cclosure_new" c'g_cclosure_new
:: C'GCallback -> C'gpointer -> C'GClosureNotify -> IO (Ptr C'GClosure)
foreign import ccall "&g_cclosure_new" p'g_cclosure_new
:: FunPtr (C'GCallback -> C'gpointer -> C'GClosureNotify -> IO (Ptr C'GClosure))
foreign import ccall "g_cclosure_new_swap" c'g_cclosure_new_swap
:: C'GCallback -> C'gpointer -> C'GClosureNotify -> IO (Ptr C'GClosure)
foreign import ccall "&g_cclosure_new_swap" p'g_cclosure_new_swap
:: FunPtr (C'GCallback -> C'gpointer -> C'GClosureNotify -> IO (Ptr C'GClosure))
foreign import ccall "g_closure_ref" c'g_closure_ref
:: Ptr C'GClosure -> IO (Ptr C'GClosure)
foreign import ccall "&g_closure_ref" p'g_closure_ref
:: FunPtr (Ptr C'GClosure -> IO (Ptr C'GClosure))
foreign import ccall "g_closure_sink" c'g_closure_sink
:: Ptr C'GClosure -> IO ()
foreign import ccall "&g_closure_sink" p'g_closure_sink
:: FunPtr (Ptr C'GClosure -> IO ())
foreign import ccall "g_closure_unref" c'g_closure_unref
:: Ptr C'GClosure -> IO ()
foreign import ccall "&g_closure_unref" p'g_closure_unref
:: FunPtr (Ptr C'GClosure -> IO ())
foreign import ccall "g_closure_new_simple" c'g_closure_new_simple
:: C'guint -> C'gpointer -> IO (Ptr C'GClosure)
foreign import ccall "&g_closure_new_simple" p'g_closure_new_simple
:: FunPtr (C'guint -> C'gpointer -> IO (Ptr C'GClosure))
foreign import ccall "g_closure_add_finalize_notifier" c'g_closure_add_finalize_notifier
:: Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ()
foreign import ccall "&g_closure_add_finalize_notifier" p'g_closure_add_finalize_notifier
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ())
foreign import ccall "g_closure_remove_finalize_notifier" c'g_closure_remove_finalize_notifier
:: Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ()
foreign import ccall "&g_closure_remove_finalize_notifier" p'g_closure_remove_finalize_notifier
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ())
foreign import ccall "g_closure_add_invalidate_notifier" c'g_closure_add_invalidate_notifier
:: Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ()
foreign import ccall "&g_closure_add_invalidate_notifier" p'g_closure_add_invalidate_notifier
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ())
foreign import ccall "g_closure_remove_invalidate_notifier" c'g_closure_remove_invalidate_notifier
:: Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ()
foreign import ccall "&g_closure_remove_invalidate_notifier" p'g_closure_remove_invalidate_notifier
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> IO ())
foreign import ccall "g_closure_add_marshal_guards" c'g_closure_add_marshal_guards
:: Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> C'gpointer -> C'GClosureNotify -> IO ()
foreign import ccall "&g_closure_add_marshal_guards" p'g_closure_add_marshal_guards
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureNotify -> C'gpointer -> C'GClosureNotify -> IO ())
foreign import ccall "g_closure_set_marshal" c'g_closure_set_marshal
:: Ptr C'GClosure -> C'GClosureMarshal -> IO ()
foreign import ccall "&g_closure_set_marshal" p'g_closure_set_marshal
:: FunPtr (Ptr C'GClosure -> C'GClosureMarshal -> IO ())
foreign import ccall "g_closure_set_meta_marshal" c'g_closure_set_meta_marshal
:: Ptr C'GClosure -> C'gpointer -> C'GClosureMarshal -> IO ()
foreign import ccall "&g_closure_set_meta_marshal" p'g_closure_set_meta_marshal
:: FunPtr (Ptr C'GClosure -> C'gpointer -> C'GClosureMarshal -> IO ())
foreign import ccall "g_closure_invalidate" c'g_closure_invalidate
:: Ptr C'GClosure -> IO ()
foreign import ccall "&g_closure_invalidate" p'g_closure_invalidate
:: FunPtr (Ptr C'GClosure -> IO ())
foreign import ccall "g_closure_invoke" c'g_closure_invoke
:: Ptr C'GClosure -> Ptr C'GValue -> C'guint -> Ptr C'GValue -> C'gpointer -> IO ()
foreign import ccall "&g_closure_invoke" p'g_closure_invoke
:: FunPtr (Ptr C'GClosure -> Ptr C'GValue -> C'guint -> Ptr C'GValue -> C'gpointer -> IO ())