-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Foundation for libraries generated by haskell-gi
--   
--   Foundation for libraries generated by haskell-gi
@package haskell-gi-base
@version 0.21.5


-- | A compatibility layer for <a>CallStack</a>, so that we can have
--   uniform signatures even in old GHC versions (even if the functionality
--   itself does not work there).
module Data.GI.Base.CallStack

-- | Request a CallStack.
--   
--   NOTE: The implicit parameter <tt>?callStack :: CallStack</tt> is an
--   implementation detail and <b>should not</b> be considered part of the
--   <a>CallStack</a> API, we may decide to change the implementation in
--   the future.
type HasCallStack = ?callStack :: CallStack

-- | <a>CallStack</a>s are a lightweight method of obtaining a partial
--   call-stack at any point in the program.
--   
--   A function can request its call-site with the <a>HasCallStack</a>
--   constraint. For example, we can define
--   
--   <pre>
--   putStrLnWithCallStack :: HasCallStack =&gt; String -&gt; IO ()
--   </pre>
--   
--   as a variant of <tt>putStrLn</tt> that will get its call-site and
--   print it, along with the string given as argument. We can access the
--   call-stack inside <tt>putStrLnWithCallStack</tt> with
--   <a>callStack</a>.
--   
--   <pre>
--   putStrLnWithCallStack :: HasCallStack =&gt; String -&gt; IO ()
--   putStrLnWithCallStack msg = do
--     putStrLn msg
--     putStrLn (prettyCallStack callStack)
--   </pre>
--   
--   Thus, if we call <tt>putStrLnWithCallStack</tt> we will get a
--   formatted call-stack alongside our string.
--   
--   <pre>
--   &gt;&gt;&gt; putStrLnWithCallStack "hello"
--   hello
--   CallStack (from HasCallStack):
--     putStrLnWithCallStack, called at &lt;interactive&gt;:2:1 in interactive:Ghci1
--   </pre>
--   
--   GHC solves <a>HasCallStack</a> constraints in three steps:
--   
--   <ol>
--   <li>If there is a <a>CallStack</a> in scope -- i.e. the enclosing
--   function has a <a>HasCallStack</a> constraint -- GHC will append the
--   new call-site to the existing <a>CallStack</a>.</li>
--   <li>If there is no <a>CallStack</a> in scope -- e.g. in the GHCi
--   session above -- and the enclosing definition does not have an
--   explicit type signature, GHC will infer a <a>HasCallStack</a>
--   constraint for the enclosing definition (subject to the monomorphism
--   restriction).</li>
--   <li>If there is no <a>CallStack</a> in scope and the enclosing
--   definition has an explicit type signature, GHC will solve the
--   <a>HasCallStack</a> constraint for the singleton <a>CallStack</a>
--   containing just the current call-site.</li>
--   </ol>
--   
--   <a>CallStack</a>s do not interact with the RTS and do not require
--   compilation with <tt>-prof</tt>. On the other hand, as they are built
--   up explicitly via the <a>HasCallStack</a> constraints, they will
--   generally not contain as much information as the simulated call-stacks
--   maintained by the RTS.
--   
--   A <a>CallStack</a> is a <tt>[(String, SrcLoc)]</tt>. The
--   <tt>String</tt> is the name of function that was called, the
--   <a>SrcLoc</a> is the call-site. The list is ordered with the most
--   recently called function at the head.
--   
--   NOTE: The intrepid user may notice that <a>HasCallStack</a> is just an
--   alias for an implicit parameter <tt>?callStack :: CallStack</tt>. This
--   is an implementation detail and <b>should not</b> be considered part
--   of the <a>CallStack</a> API, we may decide to change the
--   implementation in the future.
data CallStack

-- | Pretty print a <a>CallStack</a>.
prettyCallStack :: CallStack -> String

-- | Return the current <a>CallStack</a>.
--   
--   Does *not* include the call-site of <a>callStack</a>.
callStack :: HasCallStack -> CallStack


-- | Basic <a>GType</a>s.
module Data.GI.Base.GType

-- | A newtype for use on the haskell side.
newtype GType
GType :: CGType -> GType
[gtypeToCGType] :: GType -> CGType

-- | A type identifier in the GLib type system. This is the low-level type
--   associated with the representation in memory, when using this on the
--   Haskell side use <a>GType</a> below.
type CGType = Word64

-- | Get the name assigned to the given <a>GType</a>.
gtypeName :: GType -> IO String

-- | <ul>
--   <li><i>Note: compile-time vs run-time GTypes</i></li>
--   </ul>
--   
--   Notice that there are two types of GType's: the fundamental ones,
--   which are created with G_TYPE_MAKE_FUNDAMENTAL(n) and always have the
--   same runtime representation, and the ones that are registered in the
--   GObject type system at runtime, and whose <a>CGType</a> may change for
--   each program run (and generally does).
--   
--   For the first type it is safe to use hsc to read the numerical values
--   of the CGType at compile type, but for the second type it is essential
--   to call the corresponding _get_type() function at runtime, and not use
--   the value of the corresponding "constant" at compile time via hsc.
--   
--   <a>GType</a> of strings.
gtypeString :: GType

-- | <a>GType</a> of pointers.
gtypePointer :: GType

-- | <a>GType</a> for signed integers (<tt>gint</tt> or <tt>gint32</tt>).
gtypeInt :: GType

-- | <a>GType</a> for unsigned integers (<tt>guint</tt> or
--   <tt>guint32</tt>).
gtypeUInt :: GType

-- | <a>GType</a> for <tt>glong</tt>.
gtypeLong :: GType

-- | <a>GType</a> for <tt>gulong</tt>.
gtypeULong :: GType

-- | <a>GType</a> for signed 64 bit integers.
gtypeInt64 :: GType

-- | <a>GType</a> for unsigned 64 bit integers.
gtypeUInt64 :: GType

-- | <a>GType</a> for floating point values.
gtypeFloat :: GType

-- | <a>GType</a> for gdouble.
gtypeDouble :: GType

-- | <a>GType</a> corresponding to gboolean.
gtypeBoolean :: GType

-- | <a>GType</a> corresponding to a <a>GType</a> itself.
gtypeGType :: GType

-- | <a>GType</a> for a NULL terminated array of strings.
gtypeStrv :: GType

-- | <a>GType</a> corresponding to a <tt>BoxedObject</tt>.
gtypeBoxed :: GType

-- | <a>GType</a> corresponding to a <tt>GObject</tt>.
gtypeObject :: GType

-- | The <a>GType</a> corresponding to a <tt>GVariant</tt>.
gtypeVariant :: GType

-- | <a>GType</a> for a boxed type holding a <tt>GByteArray</tt>.
gtypeByteArray :: GType

-- | An invalid <a>GType</a> used as error return value in some functions
--   which return a <a>GType</a>.
gtypeInvalid :: GType


-- | Basic types used in the bindings.
module Data.GI.Base.BasicTypes

-- | Thin wrapper over <a>ForeignPtr</a>, supporting the extra notion of
--   <tt>disowning</tt>, that is, not running the finalizers associated
--   with the foreign ptr.
data ManagedPtr a
ManagedPtr :: ForeignPtr a -> Maybe CallStack -> IORef (Maybe CallStack) -> ManagedPtr a
[managedForeignPtr] :: ManagedPtr a -> ForeignPtr a

-- | <a>CallStack</a> for the call that created the pointer.
[managedPtrAllocCallStack] :: ManagedPtr a -> Maybe CallStack

-- | When disowned, the <a>CallStack</a> for the disowning call.
[managedPtrIsDisowned] :: ManagedPtr a -> IORef (Maybe CallStack)

-- | A constraint ensuring that the given type is coercible to a
--   ManagedPtr. It will hold for newtypes of the form
--   
--   <pre>
--   newtype Foo = Foo (ManagedPtr Foo)
--   </pre>
--   
--   which is the typical shape of wrapped <a>GObject</a>s.
type ManagedPtrNewtype a = Coercible a (ManagedPtr ())

-- | Wrapped boxed structures, identified by their <a>GType</a>.
class ManagedPtrNewtype a => BoxedObject a
boxedType :: BoxedObject a => a -> IO GType

-- | Enums with an associated <a>GType</a>.
class BoxedEnum a
boxedEnumType :: BoxedEnum a => a -> IO GType

-- | Flags with an associated <a>GType</a>.
class BoxedFlags a
boxedFlagsType :: BoxedFlags a => Proxy a -> IO GType

-- | A wrapped <a>GObject</a>.
class ManagedPtrNewtype a => GObject a

-- | The <a>GType</a> for this object.
gobjectType :: GObject a => a -> IO GType

-- | Pointers to structs/unions without an associated <a>GType</a>.
class ManagedPtrNewtype a => WrappedPtr a

-- | Allocate a zero-initialized block of memory for the given type.
wrappedPtrCalloc :: WrappedPtr a => IO (Ptr a)

-- | Make a copy of the given <a>WrappedPtr</a>.
wrappedPtrCopy :: WrappedPtr a => a -> IO a

-- | A pointer to a function for freeing the given pointer, or
--   <a>Nothing</a> is the memory associated to the pointer does not need
--   to be freed.
wrappedPtrFree :: WrappedPtr a => Maybe (FunPtr (Ptr a -> IO ()))

-- | A common omission in the introspection data is missing (nullable)
--   annotations for return types, when they clearly are nullable. (A
--   common idiom is "Returns: valid value, or %NULL if something went
--   wrong.")
--   
--   Haskell wrappers will raise this exception if the return value is an
--   unexpected <a>nullPtr</a>.
data UnexpectedNullPointerReturn
UnexpectedNullPointerReturn :: Text -> UnexpectedNullPointerReturn
[nullPtrErrorMsg] :: UnexpectedNullPointerReturn -> Text
class NullToNothing a

-- | Some functions are not marked as having a nullable return type in the
--   introspection data. The result is that they currently do not return a
--   Maybe type. This functions lets you work around this in a way that
--   will not break when the introspection data is fixed.
--   
--   When you want to call a <tt>someHaskellGIFunction</tt> that may return
--   null wrap the call like this.
--   
--   <pre>
--   nullToNothing (someHaskellGIFunction x y)
--   </pre>
--   
--   The result will be a Maybe type even if the introspection data has not
--   been fixed for <tt>someHaskellGIFunction</tt> yet.

-- | <i>Deprecated: This will be removed in future versions of
--   haskell-gi.If you know of wrong introspection data in a binding please
--   report it as an issue athttp:/<i>github.com</i>haskell-gi/haskell-giso
--   that it can be fixed.</i>
nullToNothing :: (NullToNothing a, MonadIO m) => IO a -> m (Maybe (UnMaybe a))

-- | A <a>GVariant</a>. See <a>Data.GI.Base.GVariant</a> for further
--   methods.
newtype GVariant
GVariant :: ManagedPtr GVariant -> GVariant

-- | A <a>GParamSpec</a>. See <a>Data.GI.Base.GParamSpec</a> for further
--   methods.
newtype GParamSpec
GParamSpec :: ManagedPtr GParamSpec -> GParamSpec

-- | A <a>GArray</a>. Marshalling for this type is done in
--   <a>Data.GI.Base.BasicConversions</a>, it is mapped to a list on the
--   Haskell side.
data GArray a
GArray :: Ptr (GArray a) -> GArray a

-- | A <a>GPtrArray</a>. Marshalling for this type is done in
--   <a>Data.GI.Base.BasicConversions</a>, it is mapped to a list on the
--   Haskell side.
data GPtrArray a
GPtrArray :: Ptr (GPtrArray a) -> GPtrArray a

-- | A <a>GByteArray</a>. Marshalling for this type is done in
--   <a>Data.GI.Base.BasicConversions</a>, it is packed to a
--   <a>ByteString</a> on the Haskell side.
data GByteArray
GByteArray :: Ptr GByteArray -> GByteArray

-- | A <a>GHashTable</a>. It is mapped to a <a>Map</a> on the Haskell side.
data GHashTable a b
GHashTable :: Ptr (GHashTable a b) -> GHashTable a b

-- | A <a>GList</a>, mapped to a list on the Haskell side. Marshalling is
--   done in <a>Data.GI.Base.BasicConversions</a>.
data GList a
GList :: Ptr (GList a) -> GList a

-- | Free the given <a>GList</a>.
g_list_free :: Ptr (GList a) -> IO ()

-- | A <a>GSList</a>, mapped to a list on the Haskell side. Marshalling is
--   done in <a>Data.GI.Base.BasicConversions</a>.
data GSList a
GSList :: Ptr (GSList a) -> GSList a

-- | Free the given <a>GSList</a>.
g_slist_free :: Ptr (GSList a) -> IO ()

-- | An enum usable as a flag for a function.
class Enum a => IsGFlag a

-- | Some APIs, such as <a>GHashTable</a>, pass around scalar types wrapped
--   into a pointer. We encode such a type as follows.
newtype PtrWrapped a
PtrWrapped :: Ptr a -> PtrWrapped a
[unwrapPtr] :: PtrWrapped a -> Ptr a

-- | Destroy the memory associated with a given pointer.
type GDestroyNotify a = FunPtr (Ptr a -> IO ())
instance (a Data.Type.Equality.~ Data.GI.Base.BasicTypes.UnMaybe a) => Data.GI.Base.BasicTypes.NullToNothing a
instance Data.GI.Base.BasicTypes.NullToNothing (GHC.Maybe.Maybe a)
instance GHC.Show.Show Data.GI.Base.BasicTypes.UnexpectedNullPointerReturn
instance GHC.Exception.Type.Exception Data.GI.Base.BasicTypes.UnexpectedNullPointerReturn


-- | Machinery for some basic support of <tt>GHashTable</tt>.
--   
--   The GLib <tt>GHashTable</tt> implementation requires two things: we
--   need to "pack" a datatype into a pointer (for datatypes that are
--   represented by pointers this is the trivial operation, for integers it
--   is not, and GLib has some helper macros).
--   
--   We also need to be able to hash and check for equality different
--   datatypes.
module Data.GI.Base.GHashTable

-- | A pointer to a hashing function on the C side.
type GHashFunc a = FunPtr (PtrWrapped a -> IO Word32)

-- | A pointer to an equality checking function on the C side.
type GEqualFunc a = FunPtr (PtrWrapped a -> PtrWrapped a -> IO Int32)

-- | Compute the hash for a <a>Ptr</a>.
gDirectHash :: GHashFunc (Ptr a)

-- | Check whether two pointers are equal.
gDirectEqual :: GEqualFunc (Ptr a)

-- | Pack a <a>Ptr</a> into a <a>PtrWrapped</a> <a>Ptr</a>.
ptrPackPtr :: Ptr a -> PtrWrapped (Ptr a)

-- | Extract a <a>Ptr</a> from a <a>PtrWrapped</a> <a>Ptr</a>.
ptrUnpackPtr :: PtrWrapped (Ptr a) -> Ptr a

-- | Compute the hash for a <a>CString</a>.
gStrHash :: GHashFunc CString

-- | Check whether two <a>CString</a>s are equal.
gStrEqual :: GEqualFunc CString

-- | Pack a <a>CString</a> into a <a>Ptr</a> than can go into a
--   <tt>GHashTable</tt>.
cstringPackPtr :: CString -> PtrWrapped CString

-- | Extract a <a>CString</a> wrapped into a <a>Ptr</a> coming from a
--   <tt>GHashTable</tt>.
cstringUnpackPtr :: PtrWrapped CString -> CString


-- | Helpers for dealing with <tt>GObject</tt>s.
module Data.GI.Base.Overloading

-- | The direct parents of this object: its direct parent type, if any, and
--   the interfaces it implements. The interfaces inherited from parent
--   types can be omitted.
type family ParentTypes a :: [*]

-- | Check that a type is in the list of <tt>GObjectParents</tt> of another
--   <tt>GObject</tt>-derived type.
type family IsDescendantOf (parent :: *) (descendant :: *) :: Constraint

-- | Type error to be generated when an ancestor check fails.
type family UnknownAncestorError (a :: *) (t :: *)

-- | The list of attributes defined for a given type. Each element of the
--   list is a tuple, with the first element of the tuple the name of the
--   attribute, and the second the type encoding the information of the
--   attribute. This type will be an instance of <tt>AttrInfo</tt>.
type family AttributeList a :: [(Symbol, *)]

-- | A constraint on a type, to be fulfilled whenever it has a type
--   instance for <a>AttributeList</a>. This is here for nicer error
--   reporting.
class HasAttributeList a

-- | Return the type encoding the attribute information for a given type
--   and attribute.
type family ResolveAttribute (s :: Symbol) (o :: *) :: *

-- | A constraint imposing that the given object has the given attribute.
type family HasAttribute (attr :: Symbol) (o :: *)

-- | A constraint that enforces that the given type has a given attribute.
class HasAttr (attr :: Symbol) (o :: *)

-- | The list of signals defined for a given type. Each element of the list
--   is a tuple, with the first element of the tuple the name of the
--   signal, and the second the type encoding the information of the
--   signal. This type will be an instance of <tt>SignalInfo</tt>.
type family SignalList a :: [(Symbol, *)]

-- | Return the type encoding the signal information for a given type and
--   signal.
type family ResolveSignal (s :: Symbol) (o :: *) :: *

-- | A constraint enforcing that the signal exists for the given object, or
--   one of its ancestors.
type family HasSignal (s :: Symbol) (o :: *)

-- | Class for types containing the information about an overloaded method
--   of type `o -&gt; s`.
class MethodInfo i o s
overloadedMethod :: MethodInfo i o s => MethodProxy i -> o -> s

-- | Proxy for passing a type to <a>overloadedMethod</a>. We do not use
--   <a>Proxy</a> directly since it clashes with types defined in the
--   autogenerated bindings.
data MethodProxy a
MethodProxy :: MethodProxy a
type family MethodResolutionFailed (method :: Symbol) (o :: *)

-- | Support for overloaded labels in ghc &lt; 8.0. This is like the
--   <a>IsLabel</a> class introduced in ghc 8.0 (for use with the
--   OverloadedLabels extension) with the difference that the <a>Proxy</a>
--   argument is lifted. (Using the unlifted Proxy# type in user code is a
--   bit of a pain, hence the choice.)
class IsLabelProxy (x :: Symbol) a
fromLabelProxy :: IsLabelProxy x a => Proxy x -> a
class IsLabel (x :: Symbol) a
fromLabel :: IsLabel x a => a
instance Data.GI.Base.Overloading.HasAttribute attr o => Data.GI.Base.Overloading.HasAttr attr o
instance forall k (a :: k). (TypeError ...) => Data.GI.Base.Overloading.HasAttributeList a


-- | Assorted utility functions for bindings.
module Data.GI.Base.Utils

-- | When the given value is of "Just a" form, execute the given action,
--   otherwise do nothing.
whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()

-- | Like <a>maybe</a>, but for actions on a monad, and with slightly
--   different argument order.
maybeM :: Monad m => b -> Maybe a -> (a -> m b) -> m b

-- | Check if the pointer is <a>nullPtr</a>, and wrap it on a <a>Maybe</a>
--   accordingly.
maybeFromPtr :: Ptr a -> Maybe (Ptr a)

-- | Given a function and a list of two-tuples, apply the function to every
--   first element of the tuples.
mapFirst :: (a -> c) -> [(a, b)] -> [(c, b)]

-- | Applicative version of <a>mapFirst</a>.
mapFirstA :: Applicative f => (a -> f c) -> [(a, b)] -> f [(c, b)]

-- | Same for the second element.
mapSecond :: (b -> c) -> [(a, b)] -> [(a, c)]

-- | Applicative version of <a>mapSecond</a>.
mapSecondA :: Applicative f => (b -> f c) -> [(a, b)] -> f [(a, c)]

-- | Apply the given conversion action to the given pointer if it is
--   non-NULL, otherwise return <a>Nothing</a>.
convertIfNonNull :: Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)

-- | Apply the given conversion action to the given function pointer if it
--   is non-NULL, otherwise return <a>Nothing</a>.
convertFunPtrIfNonNull :: FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)

-- | Make a zero-filled allocation using the GLib allocator.
callocBytes :: Int -> IO (Ptr a)

-- | Make a zero filled allocation of n bytes for a boxed object. The
--   difference with a normal callocBytes is that the returned memory is
--   allocated using whatever memory allocator g_boxed_copy uses, which in
--   particular may well be different from a plain g_malloc. In particular
--   g_slice_alloc is often used for allocating boxed objects, which are
--   then freed using g_slice_free.
callocBoxedBytes :: forall a. BoxedObject a => Int -> IO (Ptr a)

-- | Make a zero-filled allocation of enough size to hold the given
--   <a>Storable</a> type, using the GLib allocator.
callocMem :: forall a. Storable a => IO (Ptr a)

-- | Allocate the given number of bytes using the GLib allocator.
allocBytes :: Integral a => a -> IO (Ptr b)

-- | Allocate space for the given <a>Storable</a> using the GLib allocator.
allocMem :: forall a. Storable a => IO (Ptr a)

-- | A wrapper for <tt>g_free</tt>.
freeMem :: Ptr a -> IO ()

-- | Pointer to <tt>g_free</tt>.
ptr_to_g_free :: FunPtr (Ptr a -> IO ())

-- | Copy memory into a destination (in the first argument) from a source
--   (in the second argument).
memcpy :: Ptr a -> Ptr b -> Int -> IO ()

-- | Same as freeHaskellFunPtr, but it does nothing when given a nullPtr.
safeFreeFunPtr :: Ptr a -> IO ()

-- | A pointer to <a>safeFreeFunPtr</a>.
safeFreeFunPtrPtr :: FunPtr (Ptr a -> IO ())

-- | If given a pointer to the memory location, free the <a>FunPtr</a> at
--   that location, and then the pointer itself. Useful for freeing the
--   memory associated to callbacks which are called just once, with no
--   destroy notification.
maybeReleaseFunPtr :: Maybe (Ptr (FunPtr a)) -> IO ()

-- | Check that the given pointer is not NULL. If it is, raise a
--   <a>UnexpectedNullPointerReturn</a> exception.
checkUnexpectedReturnNULL :: HasCallStack => Text -> Ptr a -> IO ()

-- | An annotated version of <tt>fromJust</tt>, which raises a
--   <a>UnexpectedNullPointerReturn</a> in case it encounters a
--   <a>Nothing</a>.
checkUnexpectedNothing :: HasCallStack => Text -> IO (Maybe a) -> IO a

-- | Print a string to the debug log in an atomic way (so the output of
--   different threads does not get intermingled).
dbgLog :: Text -> IO ()


-- | We wrap most objects in a "managed pointer", which is basically a
--   <tt>ForeignPtr</tt> of the appropriate type together with a notion of
--   "disowning", which means not running the finalizers passed upon
--   construction of the object upon garbage collection. The routines in
--   this module deal with the memory management of such managed pointers.
module Data.GI.Base.ManagedPtr

-- | Thin wrapper over <a>newForeignPtr</a>.
newManagedPtr :: HasCallStack => Ptr a -> IO () -> IO (ManagedPtr a)

-- | Version of <a>newManagedPtr</a> taking a <a>FinalizerPtr</a> and a
--   corresponding <a>Ptr</a>, as in <a>newForeignPtr</a>.
newManagedPtr' :: HasCallStack => FinalizerPtr a -> Ptr a -> IO (ManagedPtr a)

-- | Thin wrapper over <a>newForeignPtr_</a>.
newManagedPtr_ :: Ptr a -> IO (ManagedPtr a)

-- | Perform an IO action on the <a>Ptr</a> inside a managed pointer.
withManagedPtr :: (HasCallStack, ManagedPtrNewtype a) => a -> (Ptr a -> IO c) -> IO c

-- | Like <a>withManagedPtr</a>, but accepts a <a>Maybe</a> type. If the
--   passed value is <a>Nothing</a> the inner action will be executed with
--   a <a>nullPtr</a> argument.
maybeWithManagedPtr :: (HasCallStack, ManagedPtrNewtype a) => Maybe a -> (Ptr a -> IO c) -> IO c

-- | Perform an IO action taking a list of <a>Ptr</a> on a list of managed
--   pointers.
withManagedPtrList :: (HasCallStack, ManagedPtrNewtype a) => [a] -> ([Ptr a] -> IO c) -> IO c

-- | Perform the IO action with a transient managed pointer. The managed
--   pointer will be valid while calling the action, but will be disowned
--   as soon as the action finished.
withTransient :: (HasCallStack, ManagedPtrNewtype a) => (ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b

-- | Return the <a>Ptr</a> in a given managed pointer. As the name says,
--   this is potentially unsafe: the given <a>Ptr</a> may only be used
--   <i>before</i> a call to <a>touchManagedPtr</a>. This function is of
--   most interest to the autogenerated bindings, for hand-written code
--   <a>withManagedPtr</a> is almost always a better choice.
unsafeManagedPtrGetPtr :: (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)

-- | Same as <a>unsafeManagedPtrGetPtr</a>, but is polymorphic on the
--   return type.
unsafeManagedPtrCastPtr :: forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)

-- | Ensure that the <a>Ptr</a> in the given managed pointer is still alive
--   (i.e. it has not been garbage collected by the runtime) at the point
--   that this is called.
touchManagedPtr :: forall a. ManagedPtrNewtype a => a -> IO ()

-- | Do not run the finalizers upon garbage collection of the
--   <a>ManagedPtr</a>.
disownManagedPtr :: forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)

-- | Cast to the given type, checking that the cast is valid. If it is not,
--   we return <a>Nothing</a>. Usage:
--   
--   <pre>
--   maybeWidget &lt;- castTo Widget label
--   </pre>
castTo :: forall o o'. (GObject o, GObject o') => (ManagedPtr o' -> o') -> o -> IO (Maybe o')

-- | Cast to the given type, assuming that the cast will succeed. This
--   function will call <a>error</a> if the cast is illegal.
unsafeCastTo :: forall o o'. (HasCallStack, GObject o, GObject o') => (ManagedPtr o' -> o') -> o -> IO o'

-- | Construct a Haskell wrapper for a <a>GObject</a>, increasing its
--   reference count, or taking ownership of the floating reference if
--   there is one.
newObject :: (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a

-- | Same as <a>newObject</a>, but we steal ownership of the object.
wrapObject :: forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a

-- | Unref the given <a>GObject</a> and disown it. Use this if you want to
--   manually release the memory associated to a given <a>GObject</a>
--   (assuming that no other reference to the underlying C object exists)
--   before the garbage collector does it. It is typically not safe to
--   access the <a>GObject</a> after calling this function.
releaseObject :: (HasCallStack, GObject a) => a -> IO ()

-- | Decrease the reference count of the given <a>GObject</a>. The memory
--   associated with the object may be released if the reference count
--   reaches 0.
unrefObject :: (HasCallStack, GObject a) => a -> IO ()

-- | Disown a GObject, that is, do not unref the associated foreign GObject
--   when the Haskell object gets garbage collected. Returns the pointer to
--   the underlying GObject.
disownObject :: (HasCallStack, GObject a) => a -> IO (Ptr b)

-- | Construct a Haskell wrapper for the given boxed object. We make a copy
--   of the object.
newBoxed :: forall a. (HasCallStack, BoxedObject a) => (ManagedPtr a -> a) -> Ptr a -> IO a

-- | Like <a>newBoxed</a>, but we do not make a copy (we "steal" the passed
--   object, so now it is managed by the Haskell runtime).
wrapBoxed :: forall a. (HasCallStack, BoxedObject a) => (ManagedPtr a -> a) -> Ptr a -> IO a

-- | Make a copy of the given boxed object.
copyBoxed :: forall a. (HasCallStack, BoxedObject a) => a -> IO (Ptr a)

-- | Like <a>copyBoxed</a>, but acting directly on a pointer, instead of a
--   managed pointer.
copyBoxedPtr :: forall a. BoxedObject a => Ptr a -> IO (Ptr a)

-- | Free the memory associated with a boxed object. Note that this disowns
--   the associated <a>ManagedPtr</a> via <a>disownManagedPtr</a>.
freeBoxed :: forall a. (HasCallStack, BoxedObject a) => a -> IO ()

-- | Disown a boxed object, that is, do not free the associated foreign
--   GBoxed when the Haskell object gets garbage collected. Returns the
--   pointer to the underlying <a>BoxedObject</a>.
disownBoxed :: (HasCallStack, BoxedObject a) => a -> IO (Ptr a)

-- | Wrap a pointer, taking ownership of it.
wrapPtr :: (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a

-- | Wrap a pointer, making a copy of the data.
newPtr :: (HasCallStack, WrappedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a

-- | Make a copy of a wrapped pointer using <tt>memcpy</tt> into a freshly
--   allocated memory region of the given size.
copyBytes :: WrappedPtr a => Int -> Ptr a -> IO (Ptr a)

module Data.GI.Base.GParamSpec
noGParamSpec :: Maybe GParamSpec

-- | Take ownership of a ParamSpec passed in <a>Ptr</a>.
wrapGParamSpecPtr :: Ptr GParamSpec -> IO GParamSpec

-- | Construct a Haskell wrapper for the given <a>GParamSpec</a>, without
--   assuming ownership.
newGParamSpecFromPtr :: Ptr GParamSpec -> IO GParamSpec

-- | Remove a reference to the given <a>GParamSpec</a>.
unrefGParamSpec :: GParamSpec -> IO ()

-- | Disown a <a>GParamSpec</a>, i.e. do not longer unref the associated
--   foreign <a>GParamSpec</a> when the Haskell <a>GParamSpec</a> gets
--   garbage collected.
disownGParamSpec :: GParamSpec -> IO (Ptr GParamSpec)

module Data.GI.Base.Closure
newtype Closure
Closure :: ManagedPtr Closure -> Closure
newCClosure :: FunPtr a -> IO Closure
noClosure :: Maybe Closure
instance Data.GI.Base.BasicTypes.BoxedObject Data.GI.Base.Closure.Closure

module Data.GI.Base.BasicConversions
gflagsToWord :: (Num b, IsGFlag a) => [a] -> b
wordToGFlags :: (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
packGList :: [Ptr a] -> IO (Ptr (GList (Ptr a)))
unpackGList :: Ptr (GList (Ptr a)) -> IO [Ptr a]
packGSList :: [Ptr a] -> IO (Ptr (GSList (Ptr a)))
unpackGSList :: Ptr (GSList (Ptr a)) -> IO [Ptr a]
packGArray :: forall a. Storable a => [a] -> IO (Ptr (GArray a))
unpackGArray :: forall a. Storable a => Ptr (GArray a) -> IO [a]
unrefGArray :: Ptr (GArray a) -> IO ()
packGPtrArray :: [Ptr a] -> IO (Ptr (GPtrArray (Ptr a)))
unpackGPtrArray :: Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unrefPtrArray :: Ptr (GPtrArray a) -> IO ()
packGByteArray :: ByteString -> IO (Ptr GByteArray)
unpackGByteArray :: Ptr GByteArray -> IO ByteString
unrefGByteArray :: Ptr GByteArray -> IO ()
packGHashTable :: GHashFunc a -> GEqualFunc a -> Maybe (GDestroyNotify a) -> Maybe (GDestroyNotify b) -> [(PtrWrapped a, PtrWrapped b)] -> IO (Ptr (GHashTable a b))
unpackGHashTable :: Ptr (GHashTable a b) -> IO [(PtrWrapped a, PtrWrapped b)]
unrefGHashTable :: Ptr (GHashTable a b) -> IO ()
packByteString :: ByteString -> IO (Ptr Word8)
packZeroTerminatedByteString :: ByteString -> IO (Ptr Word8)
unpackByteStringWithLength :: Integral a => a -> Ptr Word8 -> IO ByteString
unpackZeroTerminatedByteString :: Ptr Word8 -> IO ByteString
packFileNameArray :: [String] -> IO (Ptr CString)
packZeroTerminatedFileNameArray :: [String] -> IO (Ptr CString)
unpackZeroTerminatedFileNameArray :: HasCallStack => Ptr CString -> IO [String]
unpackFileNameArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [String]
packUTF8CArray :: [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray :: [Text] -> IO (Ptr CString)
unpackUTF8CArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray :: HasCallStack => Ptr CString -> IO [Text]
packStorableArray :: Storable a => [a] -> IO (Ptr a)
packZeroTerminatedStorableArray :: (Num a, Storable a) => [a] -> IO (Ptr a)
unpackStorableArrayWithLength :: (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackZeroTerminatedStorableArray :: (Eq a, Num a, Storable a) => Ptr a -> IO [a]
packMapStorableArray :: forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapZeroTerminatedStorableArray :: forall a b. (Num b, Storable b) => (a -> b) -> [a] -> IO (Ptr b)
unpackMapStorableArrayWithLength :: forall a b c. (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c]
unpackMapZeroTerminatedStorableArray :: forall a b. (Eq a, Num a, Storable a) => (a -> b) -> Ptr a -> IO [b]
packPtrArray :: [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray :: [Ptr a] -> IO (Ptr (Ptr a))
unpackPtrArrayWithLength :: Integral a => a -> Ptr (Ptr b) -> IO [Ptr b]
unpackZeroTerminatedPtrArray :: Ptr (Ptr a) -> IO [Ptr a]

-- | Given a set of pointers to blocks of memory of the specified size,
--   copy the contents of these blocks to a freshly-allocated (with
--   <a>allocBytes</a>) continuous area of memory.
packBlockArray :: Int -> [Ptr a] -> IO (Ptr a)
unpackBlockArrayWithLength :: Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength :: forall a b. (Integral a, BoxedObject b) => Int -> a -> Ptr b -> IO [Ptr b]
stringToCString :: String -> IO CString
cstringToString :: HasCallStack => CString -> IO String

-- | Convert <a>Text</a> into a <a>CString</a>, using the GLib allocator.
textToCString :: Text -> IO CString
withTextCString :: Text -> (CString -> IO a) -> IO a
cstringToText :: HasCallStack => CString -> IO Text
byteStringToCString :: ByteString -> IO CString
cstringToByteString :: HasCallStack => CString -> IO ByteString
mapZeroTerminatedCArray :: (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapCArrayWithLength :: (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO ()
mapGArray :: forall a b. Storable a => (a -> IO b) -> Ptr (GArray a) -> IO ()
mapPtrArray :: (Ptr a -> IO b) -> Ptr (GPtrArray (Ptr a)) -> IO ()
mapGList :: (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGSList :: (Ptr a -> IO b) -> Ptr (GSList (Ptr a)) -> IO ()


-- | This module contains some helper functions for dealing with GVariant
--   values. The simplest way of dealing with them is by using the
--   <a>IsGVariant</a> typeclass:
--   
--   <pre>
--   str &lt;- fromGVariant variant :: IO (Maybe Text)
--   </pre>
--   
--   assuming that the variant is expected to contain a string in UTF8
--   encoding. The code becomes even shorter if the type checker can
--   determine the return type for you:
--   
--   <pre>
--   readStringVariant :: GVariant -&gt; IO Text
--   readStringVariant variant =
--     fromGVariant variant &gt;&gt;= \case
--        Nothing  -&gt; error "Variant was not a string"
--        Just str -&gt; return str
--   </pre>
--   
--   Alternatively, you can use manually the gvariantFrom* and gvariantTo*
--   family of functions.
module Data.GI.Base.GVariant

-- | The typeclass for types that can be automatically marshalled into
--   <a>GVariant</a> using <a>toGVariant</a> and <a>fromGVariant</a>.
class IsGVariant a

-- | Convert a value of the given type into a GVariant.
toGVariant :: IsGVariant a => a -> IO GVariant

-- | Try to decode a <a>GVariant</a> into a target type. If the conversion
--   fails we return <a>Nothing</a>. The type that was expected can be
--   obtained by calling <a>toGVariantFormatString</a>, and the actual type
--   as understood by the <a>GVariant</a> code can be obtained by calling
--   <tt>gvariantToTypeString</tt>.
fromGVariant :: IsGVariant a => GVariant -> IO (Maybe a)

-- | The expected format string for this type (the argument is ignored).
toGVariantFormatString :: IsGVariant a => a -> Text

-- | The typeclass for basic type <a>GVariant</a> types, i.e. those that
--   are not containers.
class Ord a => IsGVariantBasicType a

-- | An alias for <tt>Nothing :: Maybe GVariant</tt> to save some typing.
noGVariant :: Maybe GVariant

-- | Get the expected type of a <a>GVariant</a>, in <a>GVariant</a>
--   notation. See
--   <a>https://developer.gnome.org/glib/stable/glib-GVariantType.html</a>
--   for the meaning of the resulting format string.
gvariantGetTypeString :: GVariant -> IO Text

-- | Haskell has no notion of one element tuples, but GVariants do, so the
--   following allows for marshalling one element tuples properly using
--   <a>fromGVariant</a> and <a>toGVariant</a>. For instance, to construct
--   a single element tuple containing a string, you could do
--   
--   <pre>
--   toGVariant (GVariantSinglet "Test")
--   </pre>
newtype GVariantSinglet a
GVariantSinglet :: a -> GVariantSinglet a

-- | A DictEntry <a>GVariant</a> is isomorphic to a two-tuple. Wrapping the
--   values into a <tt>GVariantDictentry</tt> allows the <a>IsGVariant</a>
--   instance to do the right thing.
data GVariantDictEntry key value
GVariantDictEntry :: key -> value -> GVariantDictEntry key value
newtype GVariantHandle
GVariantHandle :: Int32 -> GVariantHandle

-- | An object representing a DBus object path, which is a particular type
--   of <a>GVariant</a> too. (Just a string with some specific
--   requirements.) In order to construct/deconstruct a
--   <a>GVariantObjectPath</a> one can use <a>newGVariantObjectPath</a> and
--   <a>gvariantObjectPathToText</a>.
data GVariantObjectPath

-- | Try to construct a DBus object path. If the passed string is not a
--   valid object path <a>Nothing</a> will be returned.
newGVariantObjectPath :: Text -> Maybe GVariantObjectPath

-- | Return the <a>Text</a> representation of a <a>GVariantObjectPath</a>.
gvariantObjectPathToText :: GVariantObjectPath -> Text

-- | An object representing a DBus signature, which is a particular type of
--   <a>GVariant</a> too. (Just a string with some specific requirements.)
--   In order to construct/deconstruct a <a>GVariantSignature</a> one can
--   use <a>newGVariantSignature</a> and <a>gvariantSignatureToText</a>.
data GVariantSignature

-- | Try to construct a DBus object path. If the passed string is not a
--   valid DBus signature <a>Nothing</a> will be returned.
newGVariantSignature :: Text -> Maybe GVariantSignature

-- | Return the <a>Text</a> representation of a <a>GVariantSignature</a>.
gvariantSignatureToText :: GVariantSignature -> Text

-- | Take ownership of a passed in <a>Ptr</a> (typically created just for
--   us, so if it is floating we sink it).
wrapGVariantPtr :: Ptr GVariant -> IO GVariant

-- | Construct a Haskell wrapper for the given <a>GVariant</a>, without
--   assuming ownership.
newGVariantFromPtr :: Ptr GVariant -> IO GVariant

-- | Remove a reference to the given <a>GVariant</a>.
unrefGVariant :: GVariant -> IO ()

-- | Disown a <a>GVariant</a>, i.e. do not unref the underlying object when
--   the Haskell object is garbage collected.
disownGVariant :: GVariant -> IO (Ptr GVariant)
gvariantToBool :: GVariant -> IO (Maybe Bool)
gvariantFromBool :: Bool -> IO GVariant
gvariantToWord8 :: GVariant -> IO (Maybe Word8)
gvariantFromWord8 :: Word8 -> IO GVariant
gvariantToInt16 :: GVariant -> IO (Maybe Int16)
gvariantFromInt16 :: Int16 -> IO GVariant
gvariantToWord16 :: GVariant -> IO (Maybe Word16)
gvariantFromWord16 :: Word16 -> IO GVariant
gvariantToInt32 :: GVariant -> IO (Maybe Int32)
gvariantFromInt32 :: Int32 -> IO GVariant
gvariantToWord32 :: GVariant -> IO (Maybe Word32)
gvariantFromWord32 :: Word32 -> IO GVariant
gvariantToInt64 :: GVariant -> IO (Maybe Int64)
gvariantFromInt64 :: Int64 -> IO GVariant
gvariantToWord64 :: GVariant -> IO (Maybe Word64)
gvariantFromWord64 :: Word64 -> IO GVariant

-- | Extract the DBus handle (an <a>Int32</a>) inside a <a>GVariant</a>.
gvariantToHandle :: GVariant -> IO (Maybe Int32)

-- | Convert a DBus handle (an <a>Int32</a>) into a <a>GVariant</a>.
gvariantFromHandle :: Int32 -> IO GVariant
gvariantToDouble :: GVariant -> IO (Maybe Double)
gvariantFromDouble :: Double -> IO GVariant

-- | Decode an UTF-8 encoded string <a>GVariant</a> into <a>Text</a>.
gvariantToText :: GVariant -> IO (Maybe Text)

-- | Encode a <a>Text</a> into an UTF-8 encoded string <a>GVariant</a>.
gvariantFromText :: Text -> IO GVariant

-- | Extract a <a>GVariantObjectPath</a> from a <a>GVariant</a>,
--   represented as its underlying <a>Text</a> representation.
gvariantToObjectPath :: GVariant -> IO (Maybe Text)

-- | Construct a <a>GVariant</a> containing an object path. In order to
--   build a <a>GVariantObjectPath</a> value see
--   <a>newGVariantObjectPath</a>.
gvariantFromObjectPath :: GVariantObjectPath -> IO GVariant

-- | Extract a <a>GVariantSignature</a> from a <a>GVariant</a>, represented
--   as <a>Text</a>.
gvariantToSignature :: GVariant -> IO (Maybe Text)

-- | Construct a <a>GVariant</a> containing an DBus signature. In order to
--   build a <a>GVariantSignature</a> value see
--   <a>newGVariantSignature</a>.
gvariantFromSignature :: GVariantSignature -> IO GVariant

-- | Unbox a <a>GVariant</a> contained inside another <a>GVariant</a>.
gvariantToGVariant :: GVariant -> IO (Maybe GVariant)

-- | Box a <a>GVariant</a> inside another <a>GVariant</a>.
gvariantFromGVariant :: GVariant -> IO GVariant

-- | Extract a zero terminated list of bytes into a <a>ByteString</a>.
gvariantToBytestring :: GVariant -> IO (Maybe ByteString)

-- | Encode a <a>ByteString</a> into a list of bytes <a>GVariant</a>.
gvariantFromBytestring :: ByteString -> IO GVariant

-- | Convert a <a>Maybe</a> value into a corresponding <a>GVariant</a> of
--   maybe type.
gvariantFromMaybe :: forall a. IsGVariant a => Maybe a -> IO GVariant

-- | Try to decode a maybe <a>GVariant</a> into the corresponding
--   <a>Maybe</a> type. If the conversion is successful this returns
--   <tt>Just x</tt>, where <tt>x</tt> itself is of <a>Maybe</a> type. So,
--   in particular, <tt>Just Nothing</tt> indicates a successful call, and
--   means that the GVariant of maybe type was empty.
gvariantToMaybe :: forall a. IsGVariant a => GVariant -> IO (Maybe (Maybe a))

-- | Construct a <a>GVariant</a> of type DictEntry from the given
--   <tt>key</tt> and <tt>value</tt>. The key must be a basic
--   <a>GVariant</a> type, i.e. not a container. This is determined by
--   whether it belongs to the <a>IsGVariantBasicType</a> typeclass. On the
--   other hand <tt>value</tt> is an arbitrary <a>GVariant</a>, and in
--   particular it can be a container type.
gvariantFromDictEntry :: (IsGVariant key, IsGVariantBasicType key, IsGVariant value) => key -> value -> IO GVariant

-- | Unpack a DictEntry variant into <tt>key</tt> and <tt>value</tt>, which
--   are returned as a two element tuple in case of success.
gvariantToDictEntry :: forall key value. (IsGVariant key, IsGVariantBasicType key, IsGVariant value) => GVariant -> IO (Maybe (key, value))

-- | Pack a <tt>Map</tt> into a <a>GVariant</a> for dictionary type, which
--   is just an array of <a>GVariantDictEntry</a>.
gvariantFromMap :: (IsGVariant key, IsGVariantBasicType key, IsGVariant value) => Map key value -> IO GVariant

-- | Unpack a <a>GVariant</a> into a <a>Map</a>. Notice that this assumes
--   that all the elements in the <a>GVariant</a> array of
--   <a>GVariantDictEntry</a> are of the same type, which is not necessary
--   for a generic <a>GVariant</a>, so this is somewhat restrictive. For
--   the general case it is necessary to use <a>gvariantToList</a> plus
--   <a>gvariantToDictEntry</a> directly.
gvariantToMap :: forall key value. (IsGVariant key, IsGVariantBasicType key, IsGVariant value) => GVariant -> IO (Maybe (Map key value))

-- | Given a list of elements construct a <a>GVariant</a> array containing
--   them.
gvariantFromList :: forall a. IsGVariant a => [a] -> IO GVariant

-- | Unpack a <a>GVariant</a> array into its elements.
gvariantToList :: forall a. IsGVariant a => GVariant -> IO (Maybe [a])

-- | Given a list of <a>GVariant</a>, construct a <a>GVariant</a> tuple
--   containing the elements in the list.
gvariantFromTuple :: [GVariant] -> IO GVariant

-- | Extract the children of a <a>GVariant</a> tuple into a list.
gvariantToTuple :: GVariant -> IO (Maybe [GVariant])
instance (GHC.Show.Show key, GHC.Show.Show value) => GHC.Show.Show (Data.GI.Base.GVariant.GVariantDictEntry key value)
instance (GHC.Classes.Eq key, GHC.Classes.Eq value) => GHC.Classes.Eq (Data.GI.Base.GVariant.GVariantDictEntry key value)
instance GHC.Show.Show Data.GI.Base.GVariant.GVariantSignature
instance GHC.Classes.Eq Data.GI.Base.GVariant.GVariantSignature
instance GHC.Classes.Ord Data.GI.Base.GVariant.GVariantSignature
instance GHC.Show.Show Data.GI.Base.GVariant.GVariantObjectPath
instance GHC.Classes.Eq Data.GI.Base.GVariant.GVariantObjectPath
instance GHC.Classes.Ord Data.GI.Base.GVariant.GVariantObjectPath
instance GHC.Show.Show Data.GI.Base.GVariant.GVariantHandle
instance GHC.Classes.Ord Data.GI.Base.GVariant.GVariantHandle
instance GHC.Classes.Eq Data.GI.Base.GVariant.GVariantHandle
instance GHC.Show.Show a => GHC.Show.Show (Data.GI.Base.GVariant.GVariantSinglet a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.GI.Base.GVariant.GVariantSinglet a)
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariantBasicType a, Data.GI.Base.GVariant.IsGVariant b) => Data.GI.Base.GVariant.IsGVariant (Data.GI.Base.GVariant.GVariantDictEntry a b)
instance Data.GI.Base.GVariant.IsGVariant Data.GI.Base.GVariant.GVariantSignature
instance Data.GI.Base.GVariant.IsGVariantBasicType Data.GI.Base.GVariant.GVariantSignature
instance Data.GI.Base.GVariant.IsGVariant Data.GI.Base.GVariant.GVariantObjectPath
instance Data.GI.Base.GVariant.IsGVariantBasicType Data.GI.Base.GVariant.GVariantObjectPath
instance Data.GI.Base.GVariant.IsGVariant Data.GI.Base.GVariant.GVariantHandle
instance Data.GI.Base.GVariant.IsGVariantBasicType Data.GI.Base.GVariant.GVariantHandle
instance Data.GI.Base.GVariant.IsGVariant a => Data.GI.Base.GVariant.IsGVariant (Data.GI.Base.GVariant.GVariantSinglet a)
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Types.Bool
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Word.Word8
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Int.Int16
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Word.Word16
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Int.Int32
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Word.Word32
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Int.Int64
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Word.Word64
instance Data.GI.Base.GVariant.IsGVariantBasicType GHC.Types.Double
instance Data.GI.Base.GVariant.IsGVariantBasicType Data.Text.Internal.Text
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariantBasicType a, Data.GI.Base.GVariant.IsGVariant b) => Data.GI.Base.GVariant.IsGVariant (Data.Map.Internal.Map a b)
instance Data.GI.Base.GVariant.IsGVariant GHC.Types.Bool
instance Data.GI.Base.GVariant.IsGVariant GHC.Word.Word8
instance Data.GI.Base.GVariant.IsGVariant GHC.Int.Int16
instance Data.GI.Base.GVariant.IsGVariant GHC.Word.Word16
instance Data.GI.Base.GVariant.IsGVariant GHC.Int.Int32
instance Data.GI.Base.GVariant.IsGVariant GHC.Word.Word32
instance Data.GI.Base.GVariant.IsGVariant GHC.Int.Int64
instance Data.GI.Base.GVariant.IsGVariant GHC.Word.Word64
instance Data.GI.Base.GVariant.IsGVariant GHC.Types.Double
instance Data.GI.Base.GVariant.IsGVariant Data.Text.Internal.Text
instance Data.GI.Base.GVariant.IsGVariant Data.GI.Base.BasicTypes.GVariant
instance Data.GI.Base.GVariant.IsGVariant Data.ByteString.Internal.ByteString
instance Data.GI.Base.GVariant.IsGVariant a => Data.GI.Base.GVariant.IsGVariant (GHC.Maybe.Maybe a)
instance Data.GI.Base.GVariant.IsGVariant a => Data.GI.Base.GVariant.IsGVariant [a]
instance Data.GI.Base.GVariant.IsGVariant ()
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariant b) => Data.GI.Base.GVariant.IsGVariant (a, b)
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariant b, Data.GI.Base.GVariant.IsGVariant c) => Data.GI.Base.GVariant.IsGVariant (a, b, c)
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariant b, Data.GI.Base.GVariant.IsGVariant c, Data.GI.Base.GVariant.IsGVariant d) => Data.GI.Base.GVariant.IsGVariant (a, b, c, d)
instance (Data.GI.Base.GVariant.IsGVariant a, Data.GI.Base.GVariant.IsGVariant b, Data.GI.Base.GVariant.IsGVariant c, Data.GI.Base.GVariant.IsGVariant d, Data.GI.Base.GVariant.IsGVariant e) => Data.GI.Base.GVariant.IsGVariant (a, b, c, d, e)

module Data.GI.Base.GValue
newtype GValue
GValue :: ManagedPtr GValue -> GValue

-- | A convenience class for marshaling back and forth between Haskell
--   values and <a>GValue</a>s.
class IsGValue a
toGValue :: IsGValue a => a -> IO GValue
fromGValue :: IsGValue a => GValue -> IO a

-- | A type holding a <a>GValue</a> with an associated label. It is
--   parameterized by a phantom type encoding the target type for the
--   <a>GValue</a> (useful when constructing properties).
data GValueConstruct o
GValueConstruct :: String -> GValue -> GValueConstruct o

-- | Build a new, empty, <a>GValue</a> of the given type.
newGValue :: GType -> IO GValue

-- | A convenience function for building a new GValue and setting the
--   initial value.
buildGValue :: GType -> (GValue -> a -> IO ()) -> a -> IO GValue

-- | A convenience alias for <tt><a>Nothing</a> :: <a>Maybe</a>
--   <a>GValue</a></tt>.
noGValue :: Maybe GValue
set_string :: GValue -> Maybe Text -> IO ()
get_string :: GValue -> IO (Maybe Text)
set_pointer :: GValue -> Ptr a -> IO ()
get_pointer :: GValue -> IO (Ptr b)
set_int :: GValue -> CInt -> IO ()
get_int :: GValue -> IO CInt
set_uint :: GValue -> CUInt -> IO ()
get_uint :: GValue -> IO CUInt
set_long :: GValue -> CLong -> IO ()
get_long :: GValue -> IO CLong
set_ulong :: GValue -> CULong -> IO ()
get_ulong :: GValue -> IO CULong
set_int32 :: GValue -> Int32 -> IO ()
get_int32 :: GValue -> IO Int32
set_uint32 :: GValue -> Word32 -> IO ()
get_uint32 :: GValue -> IO Word32
set_int64 :: GValue -> Int64 -> IO ()
get_int64 :: GValue -> IO Int64
set_uint64 :: GValue -> Word64 -> IO ()
get_uint64 :: GValue -> IO Word64
set_float :: GValue -> Float -> IO ()
get_float :: GValue -> IO Float
set_double :: GValue -> Double -> IO ()
get_double :: GValue -> IO Double
set_boolean :: GValue -> Bool -> IO ()
get_boolean :: GValue -> IO Bool
set_gtype :: GValue -> GType -> IO ()
get_gtype :: GValue -> IO GType
set_object :: GObject a => GValue -> Ptr a -> IO ()
get_object :: GObject b => GValue -> IO (Ptr b)
set_boxed :: GValue -> Ptr a -> IO ()
get_boxed :: GValue -> IO (Ptr b)
set_variant :: GValue -> Ptr GVariant -> IO ()
get_variant :: GValue -> IO (Ptr GVariant)
set_enum :: GValue -> CUInt -> IO ()
get_enum :: GValue -> IO CUInt
set_flags :: GValue -> CUInt -> IO ()
get_flags :: GValue -> IO CUInt
instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GHC.Base.String)
instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe Data.Text.Internal.Text)
instance Data.GI.Base.GValue.IsGValue (GHC.Ptr.Ptr a)
instance Data.GI.Base.GValue.IsGValue GHC.Int.Int32
instance Data.GI.Base.GValue.IsGValue GHC.Word.Word32
instance Data.GI.Base.GValue.IsGValue Foreign.C.Types.CInt
instance Data.GI.Base.GValue.IsGValue Foreign.C.Types.CUInt
instance Data.GI.Base.GValue.IsGValue Foreign.C.Types.CLong
instance Data.GI.Base.GValue.IsGValue Foreign.C.Types.CULong
instance Data.GI.Base.GValue.IsGValue GHC.Int.Int64
instance Data.GI.Base.GValue.IsGValue GHC.Word.Word64
instance Data.GI.Base.GValue.IsGValue GHC.Types.Float
instance Data.GI.Base.GValue.IsGValue GHC.Types.Double
instance Data.GI.Base.GValue.IsGValue GHC.Types.Bool
instance Data.GI.Base.GValue.IsGValue Data.GI.Base.GType.GType
instance Data.GI.Base.BasicTypes.BoxedObject Data.GI.Base.GValue.GValue

module Data.GI.Base.Properties
setObjectPropertyString :: GObject a => a -> String -> Maybe Text -> IO ()
setObjectPropertyStringArray :: GObject a => a -> String -> Maybe [Text] -> IO ()
setObjectPropertyPtr :: GObject a => a -> String -> Ptr b -> IO ()
setObjectPropertyInt :: GObject a => a -> String -> CInt -> IO ()
setObjectPropertyUInt :: GObject a => a -> String -> CUInt -> IO ()
setObjectPropertyLong :: GObject a => a -> String -> CLong -> IO ()
setObjectPropertyULong :: GObject a => a -> String -> CULong -> IO ()
setObjectPropertyInt32 :: GObject a => a -> String -> Int32 -> IO ()
setObjectPropertyUInt32 :: GObject a => a -> String -> Word32 -> IO ()
setObjectPropertyInt64 :: GObject a => a -> String -> Int64 -> IO ()
setObjectPropertyUInt64 :: GObject a => a -> String -> Word64 -> IO ()
setObjectPropertyFloat :: GObject a => a -> String -> Float -> IO ()
setObjectPropertyDouble :: GObject a => a -> String -> Double -> IO ()
setObjectPropertyBool :: GObject a => a -> String -> Bool -> IO ()
setObjectPropertyGType :: GObject a => a -> String -> GType -> IO ()
setObjectPropertyObject :: forall a b. (GObject a, GObject b) => a -> String -> Maybe b -> IO ()
setObjectPropertyBoxed :: forall a b. (GObject a, BoxedObject b) => a -> String -> Maybe b -> IO ()
setObjectPropertyEnum :: (GObject a, Enum b, BoxedEnum b) => a -> String -> b -> IO ()
setObjectPropertyFlags :: forall a b. (IsGFlag b, BoxedFlags b, GObject a) => a -> String -> [b] -> IO ()
setObjectPropertyVariant :: GObject a => a -> String -> Maybe GVariant -> IO ()
setObjectPropertyByteArray :: GObject a => a -> String -> Maybe ByteString -> IO ()
setObjectPropertyPtrGList :: GObject a => a -> String -> [Ptr b] -> IO ()
setObjectPropertyHash :: GObject a => a -> String -> b -> IO ()
setObjectPropertyCallback :: GObject a => a -> String -> FunPtr b -> IO ()
getObjectPropertyString :: GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyStringArray :: GObject a => a -> String -> IO (Maybe [Text])
getObjectPropertyPtr :: GObject a => a -> String -> IO (Ptr b)
getObjectPropertyInt :: GObject a => a -> String -> IO CInt
getObjectPropertyUInt :: GObject a => a -> String -> IO CUInt
getObjectPropertyLong :: GObject a => a -> String -> IO CLong
getObjectPropertyULong :: GObject a => a -> String -> IO CULong
getObjectPropertyInt32 :: GObject a => a -> String -> IO Int32
getObjectPropertyUInt32 :: GObject a => a -> String -> IO Word32
getObjectPropertyInt64 :: GObject a => a -> String -> IO Int64
getObjectPropertyUInt64 :: GObject a => a -> String -> IO Word64
getObjectPropertyFloat :: GObject a => a -> String -> IO Float
getObjectPropertyDouble :: GObject a => a -> String -> IO Double
getObjectPropertyBool :: GObject a => a -> String -> IO Bool
getObjectPropertyGType :: GObject a => a -> String -> IO GType
getObjectPropertyObject :: forall a b. (GObject a, GObject b) => a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyBoxed :: forall a b. (GObject a, BoxedObject b) => a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyEnum :: forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
getObjectPropertyFlags :: forall a b. (GObject a, IsGFlag b, BoxedFlags b) => a -> String -> IO [b]
getObjectPropertyVariant :: GObject a => a -> String -> IO (Maybe GVariant)
getObjectPropertyByteArray :: GObject a => a -> String -> IO (Maybe ByteString)
getObjectPropertyPtrGList :: GObject a => a -> String -> IO [Ptr b]
getObjectPropertyHash :: GObject a => a -> String -> IO b
getObjectPropertyCallback :: GObject a => a -> String -> (FunPtr b -> c) -> IO (Maybe c)
constructObjectPropertyString :: String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyStringArray :: String -> Maybe [Text] -> IO (GValueConstruct o)
constructObjectPropertyPtr :: String -> Ptr b -> IO (GValueConstruct o)
constructObjectPropertyInt :: String -> CInt -> IO (GValueConstruct o)
constructObjectPropertyUInt :: String -> CUInt -> IO (GValueConstruct o)
constructObjectPropertyLong :: String -> CLong -> IO (GValueConstruct o)
constructObjectPropertyULong :: String -> CULong -> IO (GValueConstruct o)
constructObjectPropertyInt32 :: String -> Int32 -> IO (GValueConstruct o)
constructObjectPropertyUInt32 :: String -> Word32 -> IO (GValueConstruct o)
constructObjectPropertyInt64 :: String -> Int64 -> IO (GValueConstruct o)
constructObjectPropertyUInt64 :: String -> Word64 -> IO (GValueConstruct o)
constructObjectPropertyFloat :: String -> Float -> IO (GValueConstruct o)
constructObjectPropertyDouble :: String -> Double -> IO (GValueConstruct o)
constructObjectPropertyBool :: String -> Bool -> IO (GValueConstruct o)
constructObjectPropertyGType :: String -> GType -> IO (GValueConstruct o)
constructObjectPropertyObject :: forall a o. GObject a => String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyBoxed :: forall a o. BoxedObject a => String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyEnum :: (Enum a, BoxedEnum a) => String -> a -> IO (GValueConstruct o)
constructObjectPropertyFlags :: forall a o. (IsGFlag a, BoxedFlags a) => String -> [a] -> IO (GValueConstruct o)
constructObjectPropertyVariant :: String -> Maybe GVariant -> IO (GValueConstruct o)
constructObjectPropertyByteArray :: String -> Maybe ByteString -> IO (GValueConstruct o)
constructObjectPropertyPtrGList :: String -> [Ptr a] -> IO (GValueConstruct o)
constructObjectPropertyHash :: String -> b -> IO (GValueConstruct o)
constructObjectPropertyCallback :: String -> FunPtr b -> IO (GValueConstruct o)


-- | <h2>Basic attributes interface</h2>
--   
--   Attributes of an object can be get, set and constructed. For types
--   descending from <a>GObject</a>, properties are encoded in attributes,
--   although attributes are slightly more general (every property of a
--   <a>GObject</a> is an attribute, but we can also have attributes for
--   types not descending from <a>GObject</a>).
--   
--   If you're wondering what the possible attributes of a GObject are,
--   look at the list of properties in the documentation, e.g. the
--   Properties heading of the docs for <a>Button</a> lists properties such
--   as <tt>image</tt> and <tt>relief</tt>. Parent classes may also
--   introduce properties, so since a Button is an instance of
--   <tt>IsActionable</tt>, it inherits properties like <tt>actionName</tt>
--   from <a>Actionable</a> too.
--   
--   As an example consider a <tt>button</tt> widget and a property (of the
--   Button class, or any of its parent classes or implemented interfaces)
--   called "label". The simplest way of getting the value of the button is
--   to do
--   
--   <pre>
--   value &lt;- getButtonLabel button
--   </pre>
--   
--   And for setting:
--   
--   <pre>
--   setButtonLabel button label
--   </pre>
--   
--   This mechanism quickly becomes rather cumbersome, for example for
--   setting the "window" property in a DOMDOMWindow in WebKit:
--   
--   <pre>
--   win &lt;- getDOMDOMWindowWindow dom
--   </pre>
--   
--   and perhaps more importantly, one needs to chase down the type which
--   introduces the property:
--   
--   <pre>
--   setWidgetSensitive button False
--   </pre>
--   
--   There is no <tt>setButtonSensitive</tt>, since it is the
--   <tt>Widget</tt> type that introduces the "sensitive" property.
--   
--   <h2>Overloaded attributes</h2>
--   
--   A much more convenient overloaded attribute resolution API is provided
--   by this module. Getting the value of an object's attribute is
--   straightforward:
--   
--   <pre>
--   value &lt;- get button _label
--   </pre>
--   
--   The definition of <tt>_label</tt> is basically a <a>Proxy</a> encoding
--   the name of the attribute to get:
--   
--   <pre>
--   _label = fromLabelProxy (Proxy :: Proxy "label")
--   </pre>
--   
--   These proxies can be automatically generated by invoking the code
--   generator with the <tt>-l</tt> option. The leading underscore is
--   simply so the autogenerated identifiers do not pollute the namespace,
--   but if this is not a concern the autogenerated names (in the
--   autogenerated <tt>GI/Properties.hs</tt>) can be edited as one wishes.
--   
--   In addition, for ghc &gt;= 8.0, one can directly use the overloaded
--   labels provided by GHC itself. Using the <a>OverloadedLabels</a>
--   extension, the code above can also be written as
--   
--   <pre>
--   value &lt;- get button #label
--   </pre>
--   
--   The syntax for setting or updating an attribute is only slightly more
--   complex. At the simplest level it is just:
--   
--   <pre>
--   set button [ _label := value ]
--   </pre>
--   
--   or for the WebKit example above
--   
--   <pre>
--   set dom [_window := win]
--   </pre>
--   
--   However as the list notation would indicate, you can set or update
--   multiple attributes of the same object in one go:
--   
--   <pre>
--   set button [ _label := value, _sensitive := False ]
--   </pre>
--   
--   You are not limited to setting the value of an attribute, you can also
--   apply an update function to an attribute's value. That is the function
--   receives the current value of the attribute and returns the new value.
--   
--   <pre>
--   set spinButton [ _value :~ (+1) ]
--   </pre>
--   
--   There are other variants of these operators, see <a>AttrOp</a> below.
--   <a>:=&gt;</a> and <a>:~&gt;</a> are like <a>:=</a> and <a>:~</a> but
--   operate in the <a>IO</a> monad rather than being pure.
--   
--   Attributes can also be set during construction of a <a>GObject</a>
--   using <a>new</a>
--   
--   <pre>
--   button &lt;- new Button [_label := "Can't touch this!", _sensitive := False]
--   </pre>
--   
--   In addition for value being set/get having to have the right type,
--   there can be attributes that are read-only, or that can only be set
--   during construction with <a>new</a>, but cannot be <a>set</a>
--   afterwards. That these invariants hold is also checked during compile
--   time.
--   
--   <h2>Nullable atributes</h2>
--   
--   Whenever the attribute is represented as a pointer in the C side, it
--   is often the case that the underlying C representation admits or
--   returns <tt>NULL</tt> as a valid value for the property. In these
--   cases the <a>get</a> operation may return a <a>Maybe</a> value, with
--   <a>Nothing</a> representing the <tt>NULL</tt> pointer value (notable
--   exceptions are <a>GList</a> and <a>GSList</a>, for which <tt>NULL</tt>
--   is represented simply as he empty list). This can be overriden in the
--   introspection data, since sometimes attributes are non-nullable, even
--   if the type would allow for <tt>NULL</tt>.
--   
--   For convenience, in nullable cases the <a>set</a> operation will by
--   default <i>not</i> take a <a>Maybe</a> value, but rather assume that
--   the caller wants to set a non-<tt>NULL</tt> value. If setting a
--   <tt>NULL</tt> value is desired, use <a>clear</a> as follows
--   
--   <pre>
--   clear object _propName
--   </pre>
module Data.GI.Base.Attributes

-- | Info describing an attribute.
class AttrInfo (info :: *) where {
    
    -- | The operations that are allowed on the attribute.
    type family AttrAllowedOps info :: [AttrOpTag];
    
    -- | Constraint on the value being set.
    type family AttrSetTypeConstraint info :: * -> Constraint;
    
    -- | Constraint on the type for which we are allowed to create/set/get the
    --   attribute.
    type family AttrBaseTypeConstraint info :: * -> Constraint;
    
    -- | Type returned by <a>attrGet</a>.
    type family AttrGetType info;
    
    -- | Name of the attribute.
    type family AttrLabel info :: Symbol;
    
    -- | Type which introduces the attribute.
    type family AttrOrigin info;
}

-- | Get the value of the given attribute.
attrGet :: (AttrInfo info, AttrBaseTypeConstraint info o) => Proxy info -> o -> IO (AttrGetType info)

-- | Set the value of the given attribute, after the object having the
--   attribute has already been created.
attrSet :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => Proxy info -> o -> b -> IO ()

-- | Set the value of the given attribute to <tt>NULL</tt> (for nullable
--   attributes).
attrClear :: (AttrInfo info, AttrBaseTypeConstraint info o) => Proxy info -> o -> IO ()

-- | Build a <tt>GValue</tt> representing the attribute.
attrConstruct :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => Proxy info -> b -> IO (GValueConstruct o)

-- | Possible operations on an attribute.
data AttrOpTag
AttrGet :: AttrOpTag
AttrSet :: AttrOpTag
AttrConstruct :: AttrOpTag
AttrClear :: AttrOpTag

-- | Constructors for the different operations allowed on an attribute.
data AttrOp obj (tag :: AttrOpTag)

-- | Assign a value to an attribute
[:=] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> b -> AttrOp obj tag

-- | Assign the result of an IO action to an attribute
[:=>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> IO b -> AttrOp obj tag

-- | Apply an update function to an attribute
[:~] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> IO b) -> AttrOp obj tag
infixr 0 :=
infixr 0 :~
infixr 0 :=>
infixr 0 :~>

-- | Whether a given <a>AttrOpTag</a> is allowed on an attribute, given the
--   info type.
type family AttrOpAllowed (tag :: AttrOpTag) (info :: *) (useType :: *) :: Constraint

-- | Constraints on a <tt>obj</tt>/<tt>attr</tt> pair so <a>get</a> is
--   possible, producing a value of type <tt>result</tt>.
type AttrGetC info obj attr result = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, (AttrBaseTypeConstraint info) obj, AttrOpAllowed  'AttrGet info obj, result ~ AttrGetType info)

-- | Constraint on a <tt>obj</tt>/<tt>attr</tt> pair so that <a>set</a>
--   works on values of type <tt>value</tt>.
type AttrSetC info obj attr value = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed  'AttrSet info obj, (AttrSetTypeConstraint info) value)

-- | Constraint on a <tt>obj</tt>/<tt>value</tt> pair so that <tt>new</tt>
--   works on values of type @<tt>value</tt>.
type AttrConstructC info obj attr value = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed  'AttrConstruct info obj, (AttrSetTypeConstraint info) value)

-- | Constraint on a <tt>obj</tt>/<tt>attr</tt> pair so that <a>clear</a>
--   is allowed.
type AttrClearC info obj attr = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, (AttrBaseTypeConstraint info) obj, AttrOpAllowed  'AttrClear info obj)

-- | Get the value of an attribute for an object.
get :: forall info attr obj result m. (AttrGetC info obj attr result, MonadIO m) => obj -> AttrLabelProxy (attr :: Symbol) -> m result

-- | Set a number of properties for some object.
set :: forall o m. MonadIO m => o -> [AttrOp o  'AttrSet] -> m ()

-- | Set a nullable attribute to <tt>NULL</tt>.
clear :: forall info attr obj m. (AttrClearC info obj attr, MonadIO m) => obj -> AttrLabelProxy (attr :: Symbol) -> m ()

-- | A proxy for attribute labels.
data AttrLabelProxy (a :: Symbol)
AttrLabelProxy :: AttrLabelProxy
instance GHC.Show.Show Data.GI.Base.Attributes.AttrOpTag
instance GHC.Enum.Bounded Data.GI.Base.Attributes.AttrOpTag
instance GHC.Enum.Enum Data.GI.Base.Attributes.AttrOpTag
instance GHC.Classes.Ord Data.GI.Base.Attributes.AttrOpTag
instance GHC.Classes.Eq Data.GI.Base.Attributes.AttrOpTag
instance (a Data.Type.Equality.~ x) => Data.GI.Base.Overloading.IsLabelProxy x (Data.GI.Base.Attributes.AttrLabelProxy a)
instance (a Data.Type.Equality.~ x) => GHC.OverloadedLabels.IsLabel x (Data.GI.Base.Attributes.AttrLabelProxy a)


-- | Routines for connecting <a>GObject</a>s to signals.
module Data.GI.Base.Signals

-- | Same as <a>connectSignal</a>, specifying from the beginning that the
--   handler is to be run before the default handler.
--   
--   <pre>
--   on object signal handler = liftIO $ connectSignal signal object handler SignalConnectBefore
--   </pre>
on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId

-- | Connect a signal to a handler, running the handler after the default
--   one.
--   
--   <pre>
--   after object signal handler = liftIO $ connectSignal signal object handler SignalConnectAfter
--   </pre>
after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId

-- | Support for overloaded signal connectors.
data SignalProxy (object :: *) (info :: *)
[SignalProxy] :: SignalProxy o info
[PropertyNotify] :: (info ~ ResolveAttribute propName o, AttrInfo info, pl ~ AttrLabel info) => AttrLabelProxy propName -> SignalProxy o (GObjectNotifySignalInfo pl)

-- | Whether to connect a handler to a signal with <a>connectSignal</a> so
--   that it runs before/after the default handler for the given signal.
data SignalConnectMode

-- | Run before the default handler.
SignalConnectBefore :: SignalConnectMode

-- | Run after the default handler.
SignalConnectAfter :: SignalConnectMode

-- | Connect a signal to a handler, given as a <a>FunPtr</a>.
connectSignalFunPtr :: GObject o => o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId

-- | Type of a <a>GObject</a> signal handler id.
type SignalHandlerId = CULong

-- | Information about an overloaded signal.
class SignalInfo (info :: *) where {
    type family HaskellCallbackType info;
}

-- | Connect a Haskell function to a signal of the given <a>GObject</a>,
--   specifying whether the handler will be called before or after the
--   default handler.
connectSignal :: (SignalInfo info, GObject o) => SignalProxy o info -> o -> HaskellCallbackType info -> SignalConnectMode -> IO SignalHandlerId

-- | Connection information for a "notify" signal indicating that a
--   specific property changed (see <a>PropertyNotify</a> for the relevant
--   constructor).
data GObjectNotifySignalInfo (propName :: Symbol)
instance GHC.TypeLits.KnownSymbol propName => Data.GI.Base.Signals.SignalInfo (Data.GI.Base.Signals.GObjectNotifySignalInfo propName)
instance (info Data.Type.Equality.~ Data.GI.Base.Overloading.ResolveSignal slot object) => Data.GI.Base.Overloading.IsLabelProxy slot (Data.GI.Base.Signals.SignalProxy object info)
instance (info Data.Type.Equality.~ Data.GI.Base.Overloading.ResolveSignal slot object) => GHC.OverloadedLabels.IsLabel slot (Data.GI.Base.Signals.SignalProxy object info)
instance forall k (a :: k). Data.GI.Base.Signals.NoConstraint a

module Data.GI.Base.GObject

-- | Construct a GObject given the constructor and a list of settable
--   attributes.
constructGObject :: forall o m. (GObject o, MonadIO m) => (ManagedPtr o -> o) -> [AttrOp o  'AttrConstruct] -> m o

-- | Construct the given <a>GObject</a>, given a set of actions
--   constructing desired <a>GValue</a>s to set at construction time.
new' :: (MonadIO m, GObject o) => (ManagedPtr o -> o) -> [IO (GValueConstruct o)] -> m o


-- | <a>Constructible</a> types are those for which <a>new</a> is defined.
--   Often these are <a>GObject</a>s, but it is possible to construct new
--   (zero-initialized) structures and unions too.
module Data.GI.Base.Constructible

-- | Constructible types, i.e. those which can be allocated by <a>new</a>.
class Constructible a (tag :: AttrOpTag)
new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a
instance (Data.GI.Base.BasicTypes.GObject a, tag Data.Type.Equality.~ 'Data.GI.Base.Attributes.AttrConstruct) => Data.GI.Base.Constructible.Constructible a tag


-- | To catch GError exceptions use the catchGError* or handleGError*
--   functions. They work in a similar way to the standard <a>catch</a> and
--   <a>handle</a> functions.
--   
--   To catch just a single specific error use <a>catchGErrorJust</a> /
--   <a>handleGErrorJust</a>. To catch any error in a particular error
--   domain use <a>catchGErrorJustDomain</a> /
--   <a>handleGErrorJustDomain</a>
--   
--   For convenience, generated code also includes specialized variants of
--   <a>catchGErrorJust</a> / <a>handleGErrorJust</a> for each error type.
--   For example, for errors of type <a>PixbufError</a> one could invoke
--   <a>catchPixbufError</a> / <a>handlePixbufError</a>. The definition is
--   simply
--   
--   <pre>
--   catchPixbufError :: IO a -&gt; (PixbufError -&gt; GErrorMessage -&gt; IO a) -&gt; IO a
--   catchPixbufError = catchGErrorJustDomain
--   </pre>
--   
--   Notice that the type is suitably specialized, so only errors of type
--   <a>PixbufError</a> will be caught.
module Data.GI.Base.GError

-- | A GError, consisting of a domain, code and a human readable message.
--   These can be accessed by <a>gerrorDomain</a>, <a>gerrorCode</a> and
--   <a>gerrorMessage</a> below.
newtype GError
GError :: ManagedPtr GError -> GError

-- | Return the domain for the given <a>GError</a>. This is a GQuark, a
--   textual representation can be obtained with <a>quarkToString</a>.
gerrorDomain :: GError -> IO GQuark

-- | The numeric code for the given <a>GError</a>.
gerrorCode :: GError -> IO GErrorCode

-- | A text message describing the <a>GError</a>.
gerrorMessage :: GError -> IO GErrorMessage

-- | A code used to identify the "namespace" of the error. Within each
--   error domain all the error codes are defined in an enumeration. Each
--   gtk/gnome module that uses GErrors has its own error domain. The
--   rationale behind using error domains is so that each module can
--   organise its own error codes without having to coordinate on a global
--   error code list.
type GErrorDomain = GQuark

-- | A code to identify a specific error within a given
--   <a>GErrorDomain</a>. Most of time you will not need to deal with this
--   raw code since there is an enumeration type for each error domain. Of
--   course which enumeration to use depends on the error domain, but if
--   you use <a>catchGErrorJustDomain</a> or <a>handleGErrorJustDomain</a>,
--   this is worked out for you automatically.
type GErrorCode = Int32

-- | A human readable error message.
type GErrorMessage = Text

-- | This will catch just a specific GError exception. If you need to catch
--   a range of related errors, <a>catchGErrorJustDomain</a> is probably
--   more appropriate. Example:
--   
--   <pre>
--   do image &lt;- catchGErrorJust PixbufErrorCorruptImage
--                 loadImage
--                 (\errorMessage -&gt; do log errorMessage
--                                      return mssingImagePlaceholder)
--   </pre>
catchGErrorJust :: GErrorClass err => err -> IO a -> (GErrorMessage -> IO a) -> IO a

-- | Catch all GErrors from a particular error domain. The handler function
--   should just deal with one error enumeration type. If you need to catch
--   errors from more than one error domain, use this function twice with
--   an appropriate handler functions for each.
--   
--   <pre>
--   catchGErrorJustDomain
--     loadImage
--     (\err message -&gt; case err of
--         PixbufErrorCorruptImage -&gt; ...
--         PixbufErrorInsufficientMemory -&gt; ...
--         PixbufErrorUnknownType -&gt; ...
--         _ -&gt; ...)
--   </pre>
catchGErrorJustDomain :: forall err a. GErrorClass err => IO a -> (err -> GErrorMessage -> IO a) -> IO a

-- | A verson of <a>handleGErrorJust</a> with the arguments swapped around.
handleGErrorJust :: GErrorClass err => err -> (GErrorMessage -> IO a) -> IO a -> IO a

-- | A verson of <a>catchGErrorJustDomain</a> with the arguments swapped
--   around.
handleGErrorJustDomain :: GErrorClass err => (err -> GErrorMessage -> IO a) -> IO a -> IO a

-- | Create a new <a>GError</a>.
gerrorNew :: GErrorDomain -> GErrorCode -> GErrorMessage -> IO GError

-- | Each error domain's error enumeration type should be an instance of
--   this class. This class helps to hide the raw error and domain codes
--   from the user.
--   
--   Example for <a>PixbufError</a>:
--   
--   <pre>
--   instance GErrorClass PixbufError where
--     gerrorClassDomain _ = "gdk-pixbuf-error-quark"
--   </pre>
class Enum err => GErrorClass err
gerrorClassDomain :: GErrorClass err => err -> Text

-- | Run the given function catching possible <a>GError</a>s in its
--   execution. If a <a>GError</a> is emitted this throws the corresponding
--   exception.
propagateGError :: (Ptr (Ptr GError) -> IO a) -> IO a

-- | Like <a>propagateGError</a>, but allows to specify a custom handler
--   instead of just throwing the exception.
checkGError :: (Ptr (Ptr GError) -> IO a) -> (GError -> IO a) -> IO a

-- | If the passed in <tt><a>Maybe</a> <a>GError</a></tt> is not
--   <a>Nothing</a>, store a copy in the passed in pointer, unless the
--   pointer is <a>nullPtr</a>.
maybePokeGError :: Ptr (Ptr GError) -> Maybe GError -> IO ()
instance GHC.Show.Show Data.GI.Base.GError.GError
instance GHC.Exception.Type.Exception Data.GI.Base.GError.GError
instance Data.GI.Base.BasicTypes.BoxedObject Data.GI.Base.GError.GError


-- | The Haskell Prelude exports a number of symbols that can easily
--   collide with functions appearing in bindings. The generated code
--   requires just a small subset of the functions in the Prelude, together
--   with some of the functionality in Data.GI.Base, we reexport this
--   explicitly here.
module Data.GI.Base.ShortPrelude

-- | The character type <a>Char</a> is an enumeration whose values
--   represent Unicode (or equivalently ISO/IEC 10646) code points (i.e.
--   characters, see <a>http://www.unicode.org/</a> for details). This set
--   extends the ISO 8859-1 (Latin-1) character set (the first 256
--   characters), which is itself an extension of the ASCII character set
--   (the first 128 characters). A character literal in Haskell has type
--   <a>Char</a>.
--   
--   To convert a <a>Char</a> to or from the corresponding <a>Int</a> value
--   defined by Unicode, use <a>toEnum</a> and <a>fromEnum</a> from the
--   <a>Enum</a> class respectively (or equivalently <tt>ord</tt> and
--   <tt>chr</tt>).
data Char

-- | The <a>toEnum</a> method restricted to the type <a>Char</a>.
chr :: Int -> Char

-- | The <a>fromEnum</a> method restricted to the type <a>Char</a>.
ord :: Char -> Int

-- | A fixed-precision integer type with at least the range <tt>[-2^29 ..
--   2^29-1]</tt>. The exact range for a given implementation can be
--   determined by using <a>minBound</a> and <a>maxBound</a> from the
--   <a>Bounded</a> class.
data Int

-- | 8-bit signed integer type
data Int8

-- | 16-bit signed integer type
data Int16

-- | 32-bit signed integer type
data Int32

-- | 64-bit signed integer type
data Int64

-- | 8-bit unsigned integer type
data Word8

-- | 16-bit unsigned integer type
data Word16

-- | 32-bit unsigned integer type
data Word32

-- | 64-bit unsigned integer type
data Word64

-- | A space-efficient representation of a <a>Word8</a> vector, supporting
--   many efficient operations.
--   
--   A <a>ByteString</a> contains 8-bit bytes, or by using the operations
--   from <a>Data.ByteString.Char8</a> it can be interpreted as containing
--   8-bit characters.
data ByteString

-- | A C string is a reference to an array of C characters terminated by
--   NUL.
type CString = Ptr CChar

-- | Haskell type representing the C <tt>int</tt> type.
newtype CInt
CInt :: Int32 -> CInt

-- | Haskell type representing the C <tt>unsigned int</tt> type.
newtype CUInt
CUInt :: Word32 -> CUInt

-- | Haskell type representing the C <tt>long</tt> type.
newtype CLong
CLong :: Int64 -> CLong

-- | Haskell type representing the C <tt>unsigned long</tt> type.
newtype CULong
CULong :: Word64 -> CULong

-- | Haskell type representing the C <tt>float</tt> type.
newtype CFloat
CFloat :: Float -> CFloat

-- | Haskell type representing the C <tt>double</tt> type.
newtype CDouble
CDouble :: Double -> CDouble
newtype CIntPtr
CIntPtr :: Int64 -> CIntPtr
newtype CUIntPtr
CUIntPtr :: Word64 -> CUIntPtr

-- | A value of type <tt><a>Ptr</a> a</tt> represents a pointer to an
--   object, or an array of objects, which may be marshalled to or from
--   Haskell values of type <tt>a</tt>.
--   
--   The type <tt>a</tt> will often be an instance of class <a>Storable</a>
--   which provides the marshalling operations. However this is not
--   essential, and you can provide your own operations to access the
--   pointer. For example you might write small foreign functions to get or
--   set the fields of a C <tt>struct</tt>.
data Ptr a

-- | A value of type <tt><a>FunPtr</a> a</tt> is a pointer to a function
--   callable from foreign code. The type <tt>a</tt> will normally be a
--   <i>foreign type</i>, a function type with zero or more arguments where
--   
--   <ul>
--   <li>the argument types are <i>marshallable foreign types</i>, i.e.
--   <a>Char</a>, <a>Int</a>, <a>Double</a>, <a>Float</a>, <a>Bool</a>,
--   <a>Int8</a>, <a>Int16</a>, <a>Int32</a>, <a>Int64</a>, <a>Word8</a>,
--   <a>Word16</a>, <a>Word32</a>, <a>Word64</a>, <tt><a>Ptr</a> a</tt>,
--   <tt><a>FunPtr</a> a</tt>, <tt><a>StablePtr</a> a</tt> or a renaming of
--   any of these using <tt>newtype</tt>.</li>
--   <li>the return type is either a marshallable foreign type or has the
--   form <tt><a>IO</a> t</tt> where <tt>t</tt> is a marshallable foreign
--   type or <tt>()</tt>.</li>
--   </ul>
--   
--   A value of type <tt><a>FunPtr</a> a</tt> may be a pointer to a foreign
--   function, either returned by another foreign function or imported with
--   a a static address import like
--   
--   <pre>
--   foreign import ccall "stdlib.h &amp;free"
--     p_free :: FunPtr (Ptr a -&gt; IO ())
--   </pre>
--   
--   or a pointer to a Haskell function created using a <i>wrapper</i> stub
--   declared to produce a <a>FunPtr</a> of the correct type. For example:
--   
--   <pre>
--   type Compare = Int -&gt; Int -&gt; Bool
--   foreign import ccall "wrapper"
--     mkCompare :: Compare -&gt; IO (FunPtr Compare)
--   </pre>
--   
--   Calls to wrapper stubs like <tt>mkCompare</tt> allocate storage, which
--   should be released with <a>freeHaskellFunPtr</a> when no longer
--   required.
--   
--   To convert <a>FunPtr</a> values to corresponding Haskell functions,
--   one can define a <i>dynamic</i> stub for the specific foreign type,
--   e.g.
--   
--   <pre>
--   type IntFunction = CInt -&gt; IO ()
--   foreign import ccall "dynamic"
--     mkFun :: FunPtr IntFunction -&gt; IntFunction
--   </pre>
data FunPtr a

-- | Casts a <a>Ptr</a> to a <a>FunPtr</a>.
--   
--   <i>Note:</i> this is valid only on architectures where data and
--   function pointers range over the same set of addresses, and should
--   only be used for bindings to external libraries whose interface
--   already relies on this assumption.
castPtrToFunPtr :: () => Ptr a -> FunPtr b

-- | Casts a <a>FunPtr</a> to a <a>Ptr</a>.
--   
--   <i>Note:</i> this is valid only on architectures where data and
--   function pointers range over the same set of addresses, and should
--   only be used for bindings to external libraries whose interface
--   already relies on this assumption.
castFunPtrToPtr :: () => FunPtr a -> Ptr b

-- | Advances the given address by the given offset in bytes.
plusPtr :: () => Ptr a -> Int -> Ptr b

-- | The constant <a>nullPtr</a> contains a distinguished value of
--   <a>Ptr</a> that is not associated with a valid memory location.
nullPtr :: () => Ptr a

-- | The type <a>ForeignPtr</a> represents references to objects that are
--   maintained in a foreign language, i.e., that are not part of the data
--   structures usually managed by the Haskell storage manager. The
--   essential difference between <a>ForeignPtr</a>s and vanilla memory
--   references of type <tt>Ptr a</tt> is that the former may be associated
--   with <i>finalizers</i>. A finalizer is a routine that is invoked when
--   the Haskell storage manager detects that - within the Haskell heap and
--   stack - there are no more references left that are pointing to the
--   <a>ForeignPtr</a>. Typically, the finalizer will, then, invoke
--   routines in the foreign language that free the resources bound by the
--   foreign object.
--   
--   The <a>ForeignPtr</a> is parameterised in the same way as <a>Ptr</a>.
--   The type argument of <a>ForeignPtr</a> should normally be an instance
--   of class <a>Storable</a>.
data ForeignPtr a

-- | This function extracts the pointer component of a foreign pointer.
--   This is a potentially dangerous operations, as if the argument to
--   <a>unsafeForeignPtrToPtr</a> is the last usage occurrence of the given
--   foreign pointer, then its finalizer(s) will be run, which potentially
--   invalidates the plain pointer just obtained. Hence,
--   <a>touchForeignPtr</a> must be used wherever it has to be guaranteed
--   that the pointer lives on - i.e., has another usage occurrence.
--   
--   To avoid subtle coding errors, hand written marshalling code should
--   preferably use <a>withForeignPtr</a> rather than combinations of
--   <a>unsafeForeignPtrToPtr</a> and <a>touchForeignPtr</a>. However, the
--   latter routines are occasionally preferred in tool generated
--   marshalling code.
unsafeForeignPtrToPtr :: () => ForeignPtr a -> Ptr a

-- | Computes the storage requirements (in bytes) of the argument. The
--   value of the argument is not used.
sizeOf :: Storable a => a -> Int

-- | Read a value from the given memory location.
--   
--   Note that the peek and poke functions might require properly aligned
--   addresses to function correctly. This is architecture dependent; thus,
--   portable code should ensure that when peeking or poking values of some
--   type <tt>a</tt>, the alignment constraint for <tt>a</tt>, as given by
--   the function <a>alignment</a> is fulfilled.
peek :: Storable a => Ptr a -> IO a

-- | Write the given value to the given memory location. Alignment
--   restrictions might apply; see <a>peek</a>.
poke :: Storable a => Ptr a -> a -> IO ()

-- | An infix synonym for <a>fmap</a>.
--   
--   The name of this operator is an allusion to <tt>$</tt>. Note the
--   similarities between their types:
--   
--   <pre>
--    ($)  ::              (a -&gt; b) -&gt;   a -&gt;   b
--   (&lt;$&gt;) :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
--   </pre>
--   
--   Whereas <tt>$</tt> is function application, <a>&lt;$&gt;</a> is
--   function application lifted over a <a>Functor</a>.
--   
--   <h4><b>Examples</b></h4>
--   
--   Convert from a <tt><tt>Maybe</tt> <tt>Int</tt></tt> to a
--   <tt><tt>Maybe</tt> <tt>String</tt></tt> using <tt>show</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; show &lt;$&gt; Nothing
--   Nothing
--   
--   &gt;&gt;&gt; show &lt;$&gt; Just 3
--   Just "3"
--   </pre>
--   
--   Convert from an <tt><tt>Either</tt> <tt>Int</tt> <tt>Int</tt></tt> to
--   an <tt><tt>Either</tt> <tt>Int</tt></tt> <tt>String</tt> using
--   <tt>show</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; show &lt;$&gt; Left 17
--   Left 17
--   
--   &gt;&gt;&gt; show &lt;$&gt; Right 17
--   Right "17"
--   </pre>
--   
--   Double each element of a list:
--   
--   <pre>
--   &gt;&gt;&gt; (*2) &lt;$&gt; [1,2,3]
--   [2,4,6]
--   </pre>
--   
--   Apply <tt>even</tt> to the second element of a pair:
--   
--   <pre>
--   &gt;&gt;&gt; even &lt;$&gt; (2,2)
--   (2,True)
--   </pre>
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | Like <a>finally</a>, but only performs the final action if there was
--   an exception raised by the computation.
onException :: () => IO a -> IO b -> IO a

-- | Monads in which <a>IO</a> computations may be embedded. Any monad
--   built by applying a sequence of monad transformers to the <a>IO</a>
--   monad will be an instance of this class.
--   
--   Instances should satisfy the following laws, which state that
--   <a>liftIO</a> is a transformer of monads:
--   
--   <ul>
--   <li><pre><a>liftIO</a> . <a>return</a> = <a>return</a></pre></li>
--   <li><pre><a>liftIO</a> (m &gt;&gt;= f) = <a>liftIO</a> m &gt;&gt;=
--   (<a>liftIO</a> . f)</pre></li>
--   </ul>
class Monad m => MonadIO (m :: Type -> Type)

-- | Lift a computation from the <a>IO</a> monad.
liftIO :: MonadIO m => IO a -> m a

-- | Constraint on a <tt>obj</tt>/<tt>attr</tt> pair so that <a>clear</a>
--   is allowed.
type AttrClearC info obj attr = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, (AttrBaseTypeConstraint info) obj, AttrOpAllowed  'AttrClear info obj)

-- | Constraints on a <tt>obj</tt>/<tt>attr</tt> pair so <a>get</a> is
--   possible, producing a value of type <tt>result</tt>.
type AttrGetC info obj attr result = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, (AttrBaseTypeConstraint info) obj, AttrOpAllowed  'AttrGet info obj, result ~ AttrGetType info)

-- | Constructors for the different operations allowed on an attribute.
data AttrOp obj (tag :: AttrOpTag)

-- | Assign a value to an attribute
[:=] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> b -> AttrOp obj tag

-- | Assign the result of an IO action to an attribute
[:=>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> IO b -> AttrOp obj tag

-- | Apply an update function to an attribute
[:~] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> IO b) -> AttrOp obj tag
infixr 0 :=
infixr 0 :~
infixr 0 :=>
infixr 0 :~>

-- | Constraint on a <tt>obj</tt>/<tt>value</tt> pair so that <tt>new</tt>
--   works on values of type @<tt>value</tt>.
type AttrConstructC info obj attr value = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed  'AttrConstruct info obj, (AttrSetTypeConstraint info) value)

-- | Constraint on a <tt>obj</tt>/<tt>attr</tt> pair so that <a>set</a>
--   works on values of type <tt>value</tt>.
type AttrSetC info obj attr value = (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed  'AttrSet info obj, (AttrSetTypeConstraint info) value)

-- | Possible operations on an attribute.
data AttrOpTag
AttrGet :: AttrOpTag
AttrSet :: AttrOpTag
AttrConstruct :: AttrOpTag
AttrClear :: AttrOpTag

-- | Whether a given <a>AttrOpTag</a> is allowed on an attribute, given the
--   info type.
type family AttrOpAllowed (tag :: AttrOpTag) (info :: *) (useType :: *) :: Constraint

-- | Info describing an attribute.
class AttrInfo (info :: *) where {
    
    -- | The operations that are allowed on the attribute.
    type family AttrAllowedOps info :: [AttrOpTag];
    
    -- | Constraint on the value being set.
    type family AttrSetTypeConstraint info :: * -> Constraint;
    
    -- | Constraint on the type for which we are allowed to create/set/get the
    --   attribute.
    type family AttrBaseTypeConstraint info :: * -> Constraint;
    
    -- | Type returned by <a>attrGet</a>.
    type family AttrGetType info;
    
    -- | Name of the attribute.
    type family AttrLabel info :: Symbol;
    
    -- | Type which introduces the attribute.
    type family AttrOrigin info;
}

-- | Get the value of the given attribute.
attrGet :: (AttrInfo info, AttrBaseTypeConstraint info o) => Proxy info -> o -> IO (AttrGetType info)

-- | Set the value of the given attribute, after the object having the
--   attribute has already been created.
attrSet :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => Proxy info -> o -> b -> IO ()

-- | Set the value of the given attribute to <tt>NULL</tt> (for nullable
--   attributes).
attrClear :: (AttrInfo info, AttrBaseTypeConstraint info o) => Proxy info -> o -> IO ()

-- | Build a <tt>GValue</tt> representing the attribute.
attrConstruct :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => Proxy info -> b -> IO (GValueConstruct o)

-- | A proxy for attribute labels.
data AttrLabelProxy (a :: Symbol)
AttrLabelProxy :: AttrLabelProxy

-- | Set a nullable attribute to <tt>NULL</tt>.
clear :: forall info attr obj m. (AttrClearC info obj attr, MonadIO m) => obj -> AttrLabelProxy (attr :: Symbol) -> m ()

-- | Connection information for a "notify" signal indicating that a
--   specific property changed (see <a>PropertyNotify</a> for the relevant
--   constructor).
data GObjectNotifySignalInfo (propName :: Symbol)

-- | Whether to connect a handler to a signal with <a>connectSignal</a> so
--   that it runs before/after the default handler for the given signal.
data SignalConnectMode

-- | Run before the default handler.
SignalConnectBefore :: SignalConnectMode

-- | Run after the default handler.
SignalConnectAfter :: SignalConnectMode

-- | Information about an overloaded signal.
class SignalInfo (info :: *) where {
    type family HaskellCallbackType info;
}

-- | Connect a Haskell function to a signal of the given <a>GObject</a>,
--   specifying whether the handler will be called before or after the
--   default handler.
connectSignal :: (SignalInfo info, GObject o) => SignalProxy o info -> o -> HaskellCallbackType info -> SignalConnectMode -> IO SignalHandlerId

-- | Type of a <a>GObject</a> signal handler id.
type SignalHandlerId = CULong

-- | Connect a signal to a handler, given as a <a>FunPtr</a>.
connectSignalFunPtr :: GObject o => o -> String -> FunPtr a -> SignalConnectMode -> IO SignalHandlerId

-- | (Kind) This is the kind of type-level symbols. Declared here because
--   class IP needs it
data Symbol

-- | Class <a>Enum</a> defines operations on sequentially ordered types.
--   
--   The <tt>enumFrom</tt>... methods are used in Haskell's translation of
--   arithmetic sequences.
--   
--   Instances of <a>Enum</a> may be derived for any enumeration type
--   (types whose constructors have no fields). The nullary constructors
--   are assumed to be numbered left-to-right by <a>fromEnum</a> from
--   <tt>0</tt> through <tt>n-1</tt>. See Chapter 10 of the <i>Haskell
--   Report</i> for more details.
--   
--   For any type that is an instance of class <a>Bounded</a> as well as
--   <a>Enum</a>, the following should hold:
--   
--   <ul>
--   <li>The calls <tt><a>succ</a> <a>maxBound</a></tt> and <tt><a>pred</a>
--   <a>minBound</a></tt> should result in a runtime error.</li>
--   <li><a>fromEnum</a> and <a>toEnum</a> should give a runtime error if
--   the result value is not representable in the result type. For example,
--   <tt><a>toEnum</a> 7 :: <a>Bool</a></tt> is an error.</li>
--   <li><a>enumFrom</a> and <a>enumFromThen</a> should be defined with an
--   implicit bound, thus:</li>
--   </ul>
--   
--   <pre>
--   enumFrom     x   = enumFromTo     x maxBound
--   enumFromThen x y = enumFromThenTo x y bound
--     where
--       bound | fromEnum y &gt;= fromEnum x = maxBound
--             | otherwise                = minBound
--   </pre>
class Enum a

-- | Convert from an <a>Int</a>.
toEnum :: Enum a => Int -> a

-- | Convert to an <a>Int</a>. It is implementation-dependent what
--   <a>fromEnum</a> returns when applied to a value that is too large to
--   fit in an <a>Int</a>.
fromEnum :: Enum a => a -> Int

-- | Conversion of values to readable <a>String</a>s.
--   
--   Derived instances of <a>Show</a> have the following properties, which
--   are compatible with derived instances of <a>Read</a>:
--   
--   <ul>
--   <li>The result of <a>show</a> is a syntactically correct Haskell
--   expression containing only constants, given the fixity declarations in
--   force at the point where the type is declared. It contains only the
--   constructor names defined in the data type, parentheses, and spaces.
--   When labelled constructor fields are used, braces, commas, field
--   names, and equal signs are also used.</li>
--   <li>If the constructor is defined to be an infix operator, then
--   <a>showsPrec</a> will produce infix applications of the
--   constructor.</li>
--   <li>the representation will be enclosed in parentheses if the
--   precedence of the top-level constructor in <tt>x</tt> is less than
--   <tt>d</tt> (associativity is ignored). Thus, if <tt>d</tt> is
--   <tt>0</tt> then the result is never surrounded in parentheses; if
--   <tt>d</tt> is <tt>11</tt> it is always surrounded in parentheses,
--   unless it is an atomic expression.</li>
--   <li>If the constructor is defined using record syntax, then
--   <a>show</a> will produce the record-syntax form, with the fields given
--   in the same order as the original declaration.</li>
--   </ul>
--   
--   For example, given the declarations
--   
--   <pre>
--   infixr 5 :^:
--   data Tree a =  Leaf a  |  Tree a :^: Tree a
--   </pre>
--   
--   the derived instance of <a>Show</a> is equivalent to
--   
--   <pre>
--   instance (Show a) =&gt; Show (Tree a) where
--   
--          showsPrec d (Leaf m) = showParen (d &gt; app_prec) $
--               showString "Leaf " . showsPrec (app_prec+1) m
--            where app_prec = 10
--   
--          showsPrec d (u :^: v) = showParen (d &gt; up_prec) $
--               showsPrec (up_prec+1) u .
--               showString " :^: "      .
--               showsPrec (up_prec+1) v
--            where up_prec = 5
--   </pre>
--   
--   Note that right-associativity of <tt>:^:</tt> is ignored. For example,
--   
--   <ul>
--   <li><tt><a>show</a> (Leaf 1 :^: Leaf 2 :^: Leaf 3)</tt> produces the
--   string <tt>"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"</tt>.</li>
--   </ul>
class Show a

-- | Convert a value to a readable <a>String</a>.
--   
--   <a>showsPrec</a> should satisfy the law
--   
--   <pre>
--   showsPrec d x r ++ s  ==  showsPrec d x (r ++ s)
--   </pre>
--   
--   Derived instances of <a>Read</a> and <a>Show</a> satisfy the
--   following:
--   
--   <ul>
--   <li><tt>(x,"")</tt> is an element of <tt>(<a>readsPrec</a> d
--   (<a>showsPrec</a> d x ""))</tt>.</li>
--   </ul>
--   
--   That is, <a>readsPrec</a> parses the string produced by
--   <a>showsPrec</a>, and delivers the value that <a>showsPrec</a> started
--   with.
showsPrec :: Show a => Int -> a -> ShowS

-- | A specialised variant of <a>showsPrec</a>, using precedence context
--   zero, and returning an ordinary <a>String</a>.
show :: Show a => a -> String

-- | The method <a>showList</a> is provided to allow the programmer to give
--   a specialised way of showing lists of values. For example, this is
--   used by the predefined <a>Show</a> instance of the <a>Char</a> type,
--   where values of type <a>String</a> should be shown in double quotes,
--   rather than between square brackets.
showList :: Show a => [a] -> ShowS

-- | The <a>Eq</a> class defines equality (<a>==</a>) and inequality
--   (<a>/=</a>). All the basic datatypes exported by the <a>Prelude</a>
--   are instances of <a>Eq</a>, and <a>Eq</a> may be derived for any
--   datatype whose constituents are also instances of <a>Eq</a>.
--   
--   The Haskell Report defines no laws for <a>Eq</a>. However, <a>==</a>
--   is customarily expected to implement an equivalence relationship where
--   two values comparing equal are indistinguishable by "public"
--   functions, with a "public" function being one not allowing to see
--   implementation details. For example, for a type representing
--   non-normalised natural numbers modulo 100, a "public" function doesn't
--   make the difference between 1 and 201. It is expected to have the
--   following properties:
--   
--   <ul>
--   <li><i><b>Reflexivity</b></i> <tt>x == x</tt> = <a>True</a></li>
--   <li><i><b>Symmetry</b></i> <tt>x == y</tt> = <tt>y == x</tt></li>
--   <li><i><b>Transitivity</b></i> if <tt>x == y &amp;&amp; y == z</tt> =
--   <a>True</a>, then <tt>x == z</tt> = <a>True</a></li>
--   <li><i><b>Substitutivity</b></i> if <tt>x == y</tt> = <a>True</a> and
--   <tt>f</tt> is a "public" function whose return type is an instance of
--   <a>Eq</a>, then <tt>f x == f y</tt> = <a>True</a></li>
--   <li><i><b>Negation</b></i> <tt>x /= y</tt> = <tt>not (x ==
--   y)</tt></li>
--   </ul>
--   
--   Minimal complete definition: either <a>==</a> or <a>/=</a>.
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
infix 4 ==
infix 4 /=

-- | A value of type <tt><a>IO</a> a</tt> is a computation which, when
--   performed, does some I/O before returning a value of type <tt>a</tt>.
--   
--   There is really only one way to "perform" an I/O action: bind it to
--   <tt>Main.main</tt> in your program. When your program is run, the I/O
--   will be performed. It isn't possible to perform I/O from an arbitrary
--   function, unless that function is itself in the <a>IO</a> monad and
--   called at some point, directly or indirectly, from <tt>Main.main</tt>.
--   
--   <a>IO</a> is a monad, so <a>IO</a> actions can be combined using
--   either the do-notation or the <tt>&gt;&gt;</tt> and <tt>&gt;&gt;=</tt>
--   operations from the <tt>Monad</tt> class.
data IO a

-- | The <a>Monad</a> class defines the basic operations over a
--   <i>monad</i>, a concept from a branch of mathematics known as
--   <i>category theory</i>. From the perspective of a Haskell programmer,
--   however, it is best to think of a monad as an <i>abstract datatype</i>
--   of actions. Haskell's <tt>do</tt> expressions provide a convenient
--   syntax for writing monadic expressions.
--   
--   Instances of <a>Monad</a> should satisfy the following laws:
--   
--   <ul>
--   <li><pre><a>return</a> a <a>&gt;&gt;=</a> k = k a</pre></li>
--   <li><pre>m <a>&gt;&gt;=</a> <a>return</a> = m</pre></li>
--   <li><pre>m <a>&gt;&gt;=</a> (\x -&gt; k x <a>&gt;&gt;=</a> h) = (m
--   <a>&gt;&gt;=</a> k) <a>&gt;&gt;=</a> h</pre></li>
--   </ul>
--   
--   Furthermore, the <a>Monad</a> and <a>Applicative</a> operations should
--   relate as follows:
--   
--   <ul>
--   <li><pre><a>pure</a> = <a>return</a></pre></li>
--   <li><pre>(<a>&lt;*&gt;</a>) = <a>ap</a></pre></li>
--   </ul>
--   
--   The above laws imply:
--   
--   <ul>
--   <li><pre><a>fmap</a> f xs = xs <a>&gt;&gt;=</a> <a>return</a> .
--   f</pre></li>
--   <li><pre>(<a>&gt;&gt;</a>) = (<a>*&gt;</a>)</pre></li>
--   </ul>
--   
--   and that <a>pure</a> and (<a>&lt;*&gt;</a>) satisfy the applicative
--   functor laws.
--   
--   The instances of <a>Monad</a> for lists, <a>Maybe</a> and <a>IO</a>
--   defined in the <a>Prelude</a> satisfy these laws.
class Applicative m => Monad (m :: Type -> Type)

-- | Sequentially compose two actions, passing any value produced by the
--   first as an argument to the second.
(>>=) :: Monad m => m a -> (a -> m b) -> m b

-- | Sequentially compose two actions, discarding any value produced by the
--   first, like sequencing operators (such as the semicolon) in imperative
--   languages.
(>>) :: Monad m => m a -> m b -> m b

-- | Inject a value into the monadic type.
return :: Monad m => a -> m a

-- | Fail with a message. This operation is not part of the mathematical
--   definition of a monad, but is invoked on pattern-match failure in a
--   <tt>do</tt> expression.
--   
--   As part of the MonadFail proposal (MFP), this function is moved to its
--   own class <tt>MonadFail</tt> (see <a>Control.Monad.Fail</a> for more
--   details). The definition here will be removed in a future release.
fail :: Monad m => String -> m a
infixl 1 >>=
infixl 1 >>

-- | The <a>Maybe</a> type encapsulates an optional value. A value of type
--   <tt><a>Maybe</a> a</tt> either contains a value of type <tt>a</tt>
--   (represented as <tt><a>Just</a> a</tt>), or it is empty (represented
--   as <a>Nothing</a>). Using <a>Maybe</a> is a good way to deal with
--   errors or exceptional cases without resorting to drastic measures such
--   as <tt>error</tt>.
--   
--   The <a>Maybe</a> type is also a monad. It is a simple kind of error
--   monad, where all errors are represented by <a>Nothing</a>. A richer
--   error monad can be built using the <a>Either</a> type.
data Maybe a
Nothing :: Maybe a
Just :: a -> Maybe a

-- | Function composition.
(.) :: () => (b -> c) -> (a -> b) -> a -> c
infixr 9 .

-- | Application operator. This operator is redundant, since ordinary
--   application <tt>(f x)</tt> means the same as <tt>(f <a>$</a> x)</tt>.
--   However, <a>$</a> has low, right-associative binding precedence, so it
--   sometimes allows parentheses to be omitted; for example:
--   
--   <pre>
--   f $ g $ h x  =  f (g (h x))
--   </pre>
--   
--   It is also useful in higher-order situations, such as <tt><a>map</a>
--   (<a>$</a> 0) xs</tt>, or <tt><a>zipWith</a> (<a>$</a>) fs xs</tt>.
--   
--   Note that <tt>($)</tt> is levity-polymorphic in its result type, so
--   that foo $ True where foo :: Bool -&gt; Int# is well-typed
($) :: () => (a -> b) -> a -> b
infixr 0 $

-- | Append two lists, i.e.,
--   
--   <pre>
--   [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
--   [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
--   </pre>
--   
--   If the first list is not finite, the result is the first list.
(++) :: () => [a] -> [a] -> [a]
infixr 5 ++

-- | Same as <a>&gt;&gt;=</a>, but with the arguments interchanged.
(=<<) :: Monad m => (a -> m b) -> m a -> m b
infixr 1 =<<

-- | Left-to-right composition of Kleisli arrows.
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
infixr 1 >=>
data Bool
False :: Bool
True :: Bool

-- | Single-precision floating point numbers. It is desirable that this
--   type be at least equal in range and precision to the IEEE
--   single-precision type.
data Float

-- | Double-precision floating point numbers. It is desirable that this
--   type be at least equal in range and precision to the IEEE
--   double-precision type.
data Double

-- | A special case of <a>error</a>. It is expected that compilers will
--   recognize this and insert error messages which are more appropriate to
--   the context in which <a>undefined</a> appears.
undefined :: HasCallStack => a

-- | <a>error</a> stops execution and displays an error message.
error :: HasCallStack => [Char] -> a

-- | <a>map</a> <tt>f xs</tt> is the list obtained by applying <tt>f</tt>
--   to each element of <tt>xs</tt>, i.e.,
--   
--   <pre>
--   map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
--   map f [x1, x2, ...] == [f x1, f x2, ...]
--   </pre>
map :: () => (a -> b) -> [a] -> [b]

-- | Returns the size/length of a finite structure as an <a>Int</a>. The
--   default implementation is optimized for structures that are similar to
--   cons-lists, because there is no general way to do better.
length :: Foldable t => t a -> Int

-- | Map each element of a structure to a monadic action, evaluate these
--   actions from left to right, and collect the results. For a version
--   that ignores the results see <a>mapM_</a>.
mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)

-- | Map each element of a structure to a monadic action, evaluate these
--   actions from left to right, and ignore the results. For a version that
--   doesn't ignore the results see <a>mapM</a>.
--   
--   As of base 4.8.0.0, <a>mapM_</a> is just <a>traverse_</a>, specialized
--   to <a>Monad</a>.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()

-- | Conditional execution of <a>Applicative</a> expressions. For example,
--   
--   <pre>
--   when debug (putStrLn "Debugging")
--   </pre>
--   
--   will output the string <tt>Debugging</tt> if the Boolean value
--   <tt>debug</tt> is <a>True</a>, and otherwise do nothing.
when :: Applicative f => Bool -> f () -> f ()

-- | general coercion from integral types
fromIntegral :: (Integral a, Num b) => a -> b

-- | general coercion to fractional types
realToFrac :: (Real a, Fractional b) => a -> b


-- | <h2>Convenience header for basic GObject-Introspection modules</h2>
--   
--   See the documentation for each individual module for a description and
--   usage help.
module Data.GI.Base

-- | Constructors for the different operations allowed on an attribute.
data AttrOp obj (tag :: AttrOpTag)

-- | Assign a value to an attribute
[:=] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> b -> AttrOp obj tag

-- | Assign the result of an IO action to an attribute
[:=>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b) => AttrLabelProxy (attr :: Symbol) -> IO b -> AttrOp obj tag

-- | Apply an update function to an attribute
[:~] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, tag ~  'AttrSet, AttrOpAllowed  'AttrSet info obj, AttrOpAllowed  'AttrGet info obj, AttrSetTypeConstraint info b, a ~ AttrGetType info) => AttrLabelProxy (attr :: Symbol) -> (a -> IO b) -> AttrOp obj tag
infixr 0 :=
infixr 0 :~
infixr 0 :=>
infixr 0 :~>

-- | Set a number of properties for some object.
set :: forall o m. MonadIO m => o -> [AttrOp o  'AttrSet] -> m ()

-- | Get the value of an attribute for an object.
get :: forall info attr obj result m. (AttrGetC info obj attr result, MonadIO m) => obj -> AttrLabelProxy (attr :: Symbol) -> m result
new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a

-- | Construct the given <a>GObject</a>, given a set of actions
--   constructing desired <a>GValue</a>s to set at construction time.
new' :: (MonadIO m, GObject o) => (ManagedPtr o -> o) -> [IO (GValueConstruct o)] -> m o

-- | A convenience class for marshaling back and forth between Haskell
--   values and <a>GValue</a>s.
class IsGValue a
toGValue :: IsGValue a => a -> IO GValue
fromGValue :: IsGValue a => GValue -> IO a
newtype GValue
GValue :: ManagedPtr GValue -> GValue

-- | Support for overloaded signal connectors.
data SignalProxy (object :: *) (info :: *)
[PropertyNotify] :: (info ~ ResolveAttribute propName o, AttrInfo info, pl ~ AttrLabel info) => AttrLabelProxy propName -> SignalProxy o (GObjectNotifySignalInfo pl)

-- | Same as <a>connectSignal</a>, specifying from the beginning that the
--   handler is to be run before the default handler.
--   
--   <pre>
--   on object signal handler = liftIO $ connectSignal signal object handler SignalConnectBefore
--   </pre>
on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId

-- | Connect a signal to a handler, running the handler after the default
--   one.
--   
--   <pre>
--   after object signal handler = liftIO $ connectSignal signal object handler SignalConnectAfter
--   </pre>
after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> HaskellCallbackType info -> m SignalHandlerId
