-- 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.26.9

-- | A compatibility layer for CallStack, 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 ?callStack :: CallStack is an
--   implementation detail and should not be considered part of the
--   CallStack API, we may decide to change the implementation in
--   the future.
type HasCallStack = ?callStack :: CallStack

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

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

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

-- | This is an experimental module that introduces support for
--   dynamic values: these are functions from a record model to
--   some type a which keep track of which selectors of
--   model does the result depend on. For example, for a record of
--   the form
--   
--   
--   data Example = Example {
--       first  :: Int,
--       second :: Bool,
--       third  :: Float
--   }
--   
--   
--   a `DynVal Example String` could be constructed, assuming that you are
--   given a record DynVal representing the full record,
--   using:
--   
--   
--   let format = \f s -> "First is " <> f <> " and second is " <> s
--       formatted = format <$> record.first <*> record.second :: DynVal Example String
--   
--   
--   Here we are showcasing two properties of DynVals: they can be
--   conveniently constructed using OverloadedRecordDot, and they
--   provide an Applicative instance. The resulting
--   formatted DynVal keeps track of the fact that it
--   depends on the first and second record selectors.
module Data.GI.Base.DynVal

-- | A DynVal is a way of extracting values of type a from
--   model, which keeps track of which fields (parameterised by
--   dvKeys) in model are needed for computing the
--   DynVal.
data DynVal model a
DynVal :: DVKey -> (model -> a) -> DynVal model a
data DVKey

-- | Direct access to subfields: for example writing
--   record.field.subfield (using the HasField instance)
--   would lead to DVKeyDirect ["field", "subfield"]
DVKeyDirect :: [Text] -> DVKey

-- | Value derived from a direct key, by acting with the functor or
--   applicative instances.
DVKeyDerived :: Set [Text] -> DVKey

-- | A ModelProxy is a way of obtaining records of type
--   model, which allows for registering for notifications
--   whenever certain keys (typically associated to record fields) get
--   modified, and allows to modify fields of the model.
data ModelProxy model
ModelProxy :: IO model -> (DVKey -> (model -> IO ()) -> IO ()) -> ([Text] -> (model -> Maybe model) -> IO ()) -> ModelProxy model

-- | Keys to fields in the model that this DynVal depends on.
dvKeys :: DynVal model a -> DVKey

-- | Compute the actual value given a model.
dvRead :: DynVal model a -> model -> a

-- | Obtain the current value of the model.
modelProxyCurrentValue :: ModelProxy model -> IO model

-- | Register a handler that will be executed whenever any of the fields in
--   the model pointed to by the keys is modified.
modelProxyRegisterHandler :: ModelProxy model -> DVKey -> (model -> IO ()) -> IO ()

-- | Modify the given keys in the proxy, using the given update function,
--   of type (model -> Maybe model). If this function returns Nothing no
--   modification will be performed, otherwise the modified model will be
--   stored in the ModelProxy, and any listeners will be notified of a
--   change.
modelProxyUpdate :: ModelProxy model -> [Text] -> (model -> Maybe model) -> IO ()
instance GHC.Internal.Base.Applicative (Data.GI.Base.DynVal.DynVal model)
instance GHC.Classes.Eq Data.GI.Base.DynVal.DVKey
instance GHC.Internal.Base.Functor (Data.GI.Base.DynVal.DynVal model)
instance (GHC.Internal.Records.HasField fieldName field a, GHC.Internal.TypeLits.KnownSymbol fieldName) => GHC.Internal.Records.HasField fieldName (Data.GI.Base.DynVal.DynVal model field) (Data.GI.Base.DynVal.DynVal model a)
instance GHC.Internal.Data.String.IsString (Data.GI.Base.DynVal.DynVal model Data.Text.Internal.Text)
instance GHC.Classes.Ord Data.GI.Base.DynVal.DVKey
instance GHC.Internal.Base.Semigroup Data.GI.Base.DynVal.DVKey
instance GHC.Internal.Show.Show Data.GI.Base.DynVal.DVKey

-- | Versions of hsc2hs older than 0.68.6 cannot deal with Haskell code
--   including promoted constructors, so isolate the required types in
--   here.
--   
--   Warning: This module is internal, and might disappear in the
--   future.
module Data.GI.Base.Internal.CTypes

-- | The Haskell type corresponding to a GQuark on the C side.
type GQuark = Word32

-- | The Haskell type corresponding to a gint on the C side.
type C_gint = Int32

-- | The size in bytes of a GValue struct in C.
cgvalueSize :: Int

-- | The offset in bytes inside a GError of its domain
--   field.
gerror_domain_offset :: Int

-- | The offset in bytes inside a GError of its code
--   field.
gerror_code_offset :: Int

-- | The offset in bytes inside a GError of its emssage
--   field.
gerror_message_offset :: Int

-- | Support for creating lenses from overloaded labels of the type
--   #fieldName, or #"fieldName.subfield".
module Data.GI.Base.Internal.PathFieldAccess
type family Components (s :: Symbol) :: [Symbol]

-- | Create a lens for the given path, and return it together with the path
--   split into components.
class PathFieldAccess (path :: [Symbol]) model val | path model -> val
pathFieldAccess :: PathFieldAccess path model val => Proxy path -> Proxy model -> (Lens' model val, [Text])
instance (Optics.Internal.Generic.GFieldImpl fieldName model model val val, Data.GI.Base.Internal.PathFieldAccess.NonEmpty fieldName ('GHC.Internal.TypeError.Text "Field names cannot be empty"), GHC.Internal.TypeLits.KnownSymbol fieldName) => Data.GI.Base.Internal.PathFieldAccess.PathFieldAccess '[fieldName] model val
instance (Optics.Internal.Generic.GFieldImpl fieldName model model val val, GHC.Internal.TypeLits.KnownSymbol fieldName, Data.GI.Base.Internal.PathFieldAccess.PathFieldAccess rest val inner) => Data.GI.Base.Internal.PathFieldAccess.PathFieldAccess (fieldName : rest) model inner

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

-- | Thin wrapper over ForeignPtr, supporting the extra notion of
--   disowning, 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

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

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

-- | A constraint ensuring that the given type is a newtype over a
--   ManagedPtr.
class Coercible a ManagedPtr () => ManagedPtrNewtype a
toManagedPtr :: ManagedPtrNewtype a => a -> ManagedPtr a

-- | Pointers to chunks of memory which we know how to copy and release.
class ManagedPtrNewtype a => BoxedPtr a

-- | Make a copy of the given BoxedPtr.
boxedPtrCopy :: BoxedPtr a => a -> IO a

-- | A pointer to a function for freeing the given pointer.
boxedPtrFree :: BoxedPtr a => a -> IO ()

-- | A ptr to a memory block which we know how to allocate and fill with
--   zero.
class BoxedPtr a => CallocPtr a

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

-- | 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 nullPtr.
data UnexpectedNullPointerReturn
UnexpectedNullPointerReturn :: Text -> UnexpectedNullPointerReturn
[nullPtrErrorMsg] :: UnexpectedNullPointerReturn -> Text

-- | A wrapped object that has an associated GLib type. This does not
--   necessarily descend from GObject, that constraint is
--   implemented by GObject below.
class HasParentTypes a => TypedObject a

-- | The GType for this object.
glibType :: TypedObject a => IO GType

-- | A wrapped GObject, or any other type that descends from it.
class (ManagedPtrNewtype a, TypedObject a) => GObject a

-- | 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 GType below.
type CGType = Word64

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

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

-- | Chunks of memory whose allocation/deallocation info has been
--   registered with the GLib type system.
class (ManagedPtrNewtype a, TypedObject a) => GBoxed a

-- | Enums with an associated GType.
class TypedObject a => BoxedEnum a

-- | Flags with an associated GType.
class TypedObject a => BoxedFlags a

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

-- | A convenient synonym for Nothing :: Maybe GParamSpec.
noGParamSpec :: Maybe GParamSpec

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

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

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

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

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

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

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

-- | Free the given GSList.
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 GHashTable, 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 pointed to by a given pointer type.
type GDestroyNotify ptr = FunPtr ptr -> IO ()

-- | 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
instance GHC.Classes.Eq Data.GI.Base.BasicTypes.GType
instance GHC.Classes.Eq (Data.GI.Base.BasicTypes.ManagedPtr a)
instance GHC.Internal.Exception.Type.Exception Data.GI.Base.BasicTypes.UnexpectedNullPointerReturn
instance GHC.Types.Coercible a (Data.GI.Base.BasicTypes.ManagedPtr ()) => Data.GI.Base.BasicTypes.ManagedPtrNewtype a
instance GHC.Internal.Show.Show Data.GI.Base.BasicTypes.GType
instance GHC.Internal.Show.Show Data.GI.Base.BasicTypes.UnexpectedNullPointerReturn

-- | Helpers for dealing with overladed properties, signals and methods.
module Data.GI.Base.Overloading

-- | All the types that are ascendants of this type, including interfaces
--   that the type implements.
type family ParentTypes a :: [Type]

-- | A constraint on a type, to be fulfilled whenever it has a type
--   instance for ParentTypes. This leads to nicer errors, thanks to
--   the overlappable instance below.
class HasParentTypes o

-- | Check that a type is in the list of ParentTypes of another
--   type.
type family IsDescendantOf parent descendant

-- | Safe coercions to a parent class. For instance:
--   
--   
--   #show $ label `asA` Gtk.Widget
--   
asA :: (ManagedPtrNewtype a, ManagedPtrNewtype b, HasParentTypes b, IsDescendantOf a b) => b -> (ManagedPtr a -> a) -> a

-- | 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 AttrInfo.
type family AttributeList a :: [(Symbol, Type)]

-- | A constraint on a type, to be fulfilled whenever it has a type
--   instance for AttributeList. This is here for nicer error
--   reporting.
class HasAttributeList (a :: k)

-- | 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 SignalInfo.
type family SignalList a :: [(Symbol, Type)]

-- | 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

-- | Returned when the method is not found, hopefully making the resulting
--   error messages somewhat clearer.
type family MethodResolutionFailed (method :: Symbol) o :: k

-- | A constraint that always fails with a type error, for documentation
--   purposes.
type family UnsupportedMethodError (s :: Symbol) o

-- | This is for debugging purposes, see resolveMethod below.
class OverloadedMethodInfo (i :: k) (o :: k1)
overloadedMethodInfo :: OverloadedMethodInfo i o => Maybe ResolvedSymbolInfo

-- | Class for types containing the information about an overloaded method
--   of type o -> s.
class OverloadedMethod (i :: k) o s
overloadedMethod :: OverloadedMethod i o s => o -> s

-- | A proxy for carrying the types MethodInfoName needs (this is
--   used for resolveMethod, see below).
data MethodProxy info obj
MethodProxy :: MethodProxy info obj

-- | Information about a fully resolved symbol, for debugging purposes.
data ResolvedSymbolInfo
ResolvedSymbolInfo :: Text -> Text -> ResolvedSymbolInfo
[resolvedSymbolName] :: ResolvedSymbolInfo -> Text
[resolvedSymbolURL] :: ResolvedSymbolInfo -> Text

-- | Return the fully qualified method name that a given overloaded method
--   call resolves to (mostly useful for debugging).
--   
--   
--   resolveMethod widget #show
--   
resolveMethod :: OverloadedMethodInfo info obj => obj -> MethodProxy info obj -> Maybe ResolvedSymbolInfo
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
instance (TypeError ...) => Data.GI.Base.Overloading.HasParentTypes a
instance GHC.Internal.Show.Show Data.GI.Base.Overloading.ResolvedSymbolInfo

-- | Basic GTypes.
module Data.GI.Base.GType

-- | 
--   
- Note: compile-time vs run-time GTypes
--   
--   
--   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 CGType 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.
--   
--   GType of strings.
gtypeString :: GType

-- | GType of pointers.
gtypePointer :: GType

-- | GType for signed integers (gint or gint32).
gtypeInt :: GType

-- | GType for unsigned integers (guint or
--   guint32).
gtypeUInt :: GType

-- | GType for glong.
gtypeLong :: GType

-- | GType for gulong.
gtypeULong :: GType

-- | GType for signed 64 bit integers.
gtypeInt64 :: GType

-- | GType for unsigned 64 bit integers.
gtypeUInt64 :: GType

-- | GType for floating point values.
gtypeFloat :: GType

-- | GType for gdouble.
gtypeDouble :: GType

-- | GType corresponding to gboolean.
gtypeBoolean :: GType

-- | The GType corresponding to GError.
gtypeError :: GType

-- | GType corresponding to a GType itself.
gtypeGType :: GType

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

-- | GType corresponding to a boxed object.
gtypeBoxed :: GType

-- | GType corresponding to a GObject.
gtypeObject :: GType

-- | The GType corresponding to a GVariant.
gtypeVariant :: GType

-- | GType for a boxed type holding a GByteArray.
gtypeByteArray :: GType

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

-- | The GType corresponding to GParamSpec.
gtypeParam :: GType

-- | The GType for boxed StablePtrs.
gtypeStablePtr :: GType

-- | The GType for a generic Haskell value.
gtypeHValue :: GType

-- | Utilities for dealing with GArray types.
module Data.GI.Base.GArray

-- | Allocate a GArray with elements of the given size.
allocGArray :: CUInt -> IO (Ptr (GArray 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 maybe, 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 nullPtr, and wrap it on a Maybe
--   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 mapFirst.
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 mapSecond.
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 Nothing.
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 Nothing.
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 :: GBoxed a => Int -> IO (Ptr a)

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

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

-- | Pointer to g_free.
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 safeFreeFunPtr.
safeFreeFunPtrPtr :: FunPtr (Ptr a -> IO ())

-- | Similar to safeFreeFunPtrPtr, but accepts an additional
--   (ignored) argument. The first argument is interpreted as a
--   FunPtr, and released.
safeFreeFunPtrPtr' :: FunPtr (Ptr a -> Ptr b -> IO ())

-- | If given a pointer to the memory location, free the FunPtr 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
--   UnexpectedNullPointerReturn exception.
checkUnexpectedReturnNULL :: HasCallStack => Text -> Ptr a -> IO ()

-- | An annotated version of fromJust, which raises a
--   UnexpectedNullPointerReturn in case it encounters a
--   Nothing.
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
--   ForeignPtr 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 newForeignPtr.
newManagedPtr :: HasCallStack => Ptr a -> IO () -> IO (ManagedPtr a)

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

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

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

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

-- | Perform an IO action taking a list of Ptr 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 finishes.
withTransient :: (HasCallStack, ManagedPtrNewtype a) => Ptr a -> (a -> IO b) -> IO b

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

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

-- | Ensure that the Ptr 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 :: ManagedPtrNewtype a => a -> IO ()

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

-- | Cast from one object type to another, checking that the cast is valid.
--   If it is not, we return Nothing. Usage:
--   
--   
--   maybeWidget <- castTo Widget label
--   
castTo :: (HasCallStack, ManagedPtrNewtype o, TypedObject o, ManagedPtrNewtype o', TypedObject o', GObject o') => (ManagedPtr o' -> o') -> o -> IO (Maybe o')

-- | Cast a typed object to a new type (without any assumption that both
--   types descend from GObject), assuming that the cast will
--   succeed. This function will call error if the cast is illegal.
unsafeCastTo :: (HasCallStack, ManagedPtrNewtype o, TypedObject o, ManagedPtrNewtype o', TypedObject o') => (ManagedPtr o' -> o') -> o -> IO o'

-- | Check whether the given object is an instance of the given type.
checkInstanceType :: (ManagedPtrNewtype o, TypedObject o) => o -> GType -> IO Bool

-- | Construct a Haskell wrapper for a GObject, 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

-- | Perform the given IO action with a wrapped copy of the given ptr to a
--   GObject. Note that this increases the reference count of the wrapped
--   GObject, similarly to newObject.
withNewObject :: (HasCallStack, GObject o) => Ptr o -> (o -> IO b) -> IO b

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

-- | Unref the given GObject and disown it. Use this if you want to
--   manually release the memory associated to a given GObject
--   (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 GObject after calling this function.
releaseObject :: (HasCallStack, GObject a) => a -> IO ()

-- | Decrease the reference count of the given GObject. 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 :: (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a

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

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

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

-- | Free the memory associated with a boxed object. Note that this disowns
--   the associated ManagedPtr via disownManagedPtr.
freeBoxed :: (HasCallStack, GBoxed 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 GBoxed.
disownBoxed :: (HasCallStack, GBoxed a) => a -> IO (Ptr a)

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

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

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

-- | Some helper functions for dealing with GClosures.
module Data.GI.Base.GClosure

-- | The basic type. This corresponds to a wrapped GClosure on the
--   C side, which is a boxed object.
newtype GClosure a
GClosure :: ManagedPtr (GClosure a) -> GClosure a

-- | Create a new GClosure holding the given FunPtr. Note
--   that after calling this the FunPtr will be freed whenever the
--   GClosure is garbage collected, so it is generally not safe to
--   refer to the generated FunPtr after this function returns.
newGClosure :: MonadIO m => FunPtr a -> m (GClosure a)

-- | Take ownership of a passed in Ptr to a GClosure.
wrapGClosurePtr :: Ptr (GClosure a) -> IO (GClosure a)

-- | Construct a Haskell wrapper for the GClosure, without assuming
--   ownership.
newGClosureFromPtr :: Ptr (GClosure a) -> IO (GClosure a)

-- | A convenience alias for Nothing :: Maybe (GClosure a).
noGClosure :: Maybe (GClosure a)

-- | Decrease the reference count of the given GClosure. If the
--   reference count reaches 0 the memory will be released.
unrefGClosure :: (HasCallStack, MonadIO m) => GClosure a -> m ()

-- | Disown (that is, remove from te purview of the Haskell Garbage
--   Collector) the given GClosure.
disownGClosure :: GClosure a -> IO (Ptr (GClosure a))
instance Data.GI.Base.BasicTypes.GBoxed (Data.GI.Base.GClosure.GClosure a)
instance Data.GI.Base.Overloading.HasParentTypes (Data.GI.Base.GClosure.GClosure a)
instance Data.GI.Base.BasicTypes.TypedObject (Data.GI.Base.GClosure.GClosure a)

module Data.GI.Base.BasicConversions
gflagsToWord :: (Num b, IsGFlag a) => [a] -> b
wordToGFlags :: (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]

-- | Given a Haskell list of items, construct a GList with those values.
packGList :: [Ptr a] -> IO (Ptr (GList (Ptr a)))

-- | Given a GSList construct the corresponding Haskell list.
unpackGList :: Ptr (GList (Ptr a)) -> IO [Ptr a]

-- | Given a Haskell list of items, construct a GSList with those values.
packGSList :: [Ptr a] -> IO (Ptr (GSList (Ptr a)))

-- | Given a GSList construct the corresponding Haskell list.
unpackGSList :: Ptr (GSList (Ptr a)) -> IO [Ptr a]
packGArray :: Storable a => [a] -> IO (Ptr (GArray a))
unpackGArray :: 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 :: (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c]
unpackMapZeroTerminatedStorableArray :: (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
--   allocBytes) continuous area of memory.
packBlockArray :: Int -> [Ptr a] -> IO (Ptr a)
unpackBlockArrayWithLength :: Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength :: (Integral a, GBoxed b) => Int -> a -> Ptr b -> IO [Ptr b]
stringToCString :: String -> IO CString
cstringToString :: HasCallStack => CString -> IO String

-- | Convert Text into a CString, 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 :: 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
--   IsGVariant typeclass:
--   
--   
--   str <- fromGVariant variant :: IO (Maybe Text)
--   
--   
--   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:
--   
--   
--   readStringVariant :: GVariant -> IO Text
--   readStringVariant variant =
--     fromGVariant variant >>= \case
--        Nothing  -> error "Variant was not a string"
--        Just str -> return str
--   
--   
--   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
--   GVariant using toGVariant and fromGVariant.
class IsGVariant a

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

-- | Try to decode a GVariant into a target type. If the conversion
--   fails we return Nothing. The type that was expected can be
--   obtained by calling toGVariantFormatString, and the actual type
--   as understood by the GVariant code can be obtained by calling
--   gvariantToTypeString.
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 GVariant types, i.e. those that
--   are not containers.
class Ord a => IsGVariantBasicType a

-- | An alias for Nothing :: Maybe GVariant to save some typing.
noGVariant :: Maybe GVariant

-- | Get the expected type of a GVariant, in GVariant
--   notation. See https://docs.gtk.org/glib/struct.VariantType.html
--   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
--   fromGVariant and toGVariant. For instance, to construct
--   a single element tuple containing a string, you could do
--   
--   
--   toGVariant (GVariantSinglet "Test")
--   
newtype GVariantSinglet a
GVariantSinglet :: a -> GVariantSinglet a

-- | A DictEntry GVariant is isomorphic to a two-tuple. Wrapping the
--   values into a GVariantDictentry allows the IsGVariant
--   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 GVariant too. (Just a string with some specific
--   requirements.) In order to construct/deconstruct a
--   GVariantObjectPath one can use newGVariantObjectPath and
--   gvariantObjectPathToText.
data GVariantObjectPath

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

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

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

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

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

-- | Take ownership of a passed in Ptr (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 GVariant, without
--   assuming ownership.
newGVariantFromPtr :: Ptr GVariant -> IO GVariant

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

-- | Disown a GVariant, 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 Int32) inside a GVariant.
gvariantToHandle :: GVariant -> IO (Maybe Int32)

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | Construct a GVariant of type DictEntry from the given
--   key and value. The key must be a basic
--   GVariant type, i.e. not a container. This is determined by
--   whether it belongs to the IsGVariantBasicType typeclass. On the
--   other hand value is an arbitrary GVariant, 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 key and value, which
--   are returned as a two element tuple in case of success.
gvariantToDictEntry :: (IsGVariant key, IsGVariantBasicType key, IsGVariant value) => GVariant -> IO (Maybe (key, value))

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

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

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

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

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

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

module Data.GI.Base.GValue

-- | Haskell-side representation of a GValue.
newtype GValue
GValue :: ManagedPtr GValue -> GValue

-- | Class for types that can be marshaled back and forth between Haskell
--   values and GValues. These are low-level methods, you might want
--   to use toGValue and fromGValue instead for a higher
--   level interface.
class IsGValue a
gvalueGType_ :: IsGValue a => IO GType
gvalueSet_ :: IsGValue a => Ptr GValue -> a -> IO ()
gvalueGet_ :: IsGValue a => Ptr GValue -> IO a

-- | Create a GValue from the given Haskell value.
toGValue :: (IsGValue a, MonadIO m) => a -> m GValue

-- | Create a Haskell object out of the given GValue.
fromGValue :: (IsGValue a, MonadIO m) => GValue -> m a

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

-- | A pointer to a function freeing GValues.
ptr_to_gvalue_free :: FunPtr (Ptr GValue -> IO ())

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

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

-- | Disown a GValue, i.e. do not unref the underlying object when
--   the Haskell object is garbage collected.
disownGValue :: GValue -> IO (Ptr GValue)

-- | A convenient alias for Nothing :: Maybe GValue.
noGValue :: Maybe GValue

-- | Construct a Haskell wrapper for the given GValue, making a
--   copy.
newGValueFromPtr :: Ptr GValue -> IO GValue

-- | Take ownership of a passed in Ptr.
wrapGValuePtr :: Ptr GValue -> IO GValue

-- | Unset the GValue, freeing all resources associated to it.
unsetGValue :: Ptr GValue -> IO ()

-- | Return the GType contained by a GValue.
gvalueType :: GValue -> IO GType

-- | Pack the given list of GValues contiguously into a C array
packGValueArray :: [GValue] -> IO (Ptr GValue)

-- | Unpack an array of contiguous GValues into a list of GValues.
unpackGValueArrayWithLength :: Integral a => a -> Ptr GValue -> IO [GValue]

-- | Map over the GValues inside a C array.
mapGValueArrayWithLength :: Integral a => a -> (Ptr GValue -> IO c) -> Ptr GValue -> IO ()

-- | A type isomorphic to `Maybe a`, used to indicate to
--   fromGValue/toGValue that we are packing a native Haskell
--   value, without attempting to marshall it to the corresponding C type.
data HValue a

-- | A packed value of type a
HValue :: a -> HValue a

-- | An empty HValue
NoHValue :: HValue a
set_object :: GObject a => Ptr GValue -> Ptr a -> IO ()
get_object :: GObject a => Ptr GValue -> IO (Ptr a)
set_boxed :: Ptr GValue -> Ptr a -> IO ()
get_boxed :: Ptr GValue -> IO (Ptr b)
set_variant :: Ptr GValue -> Ptr GVariant -> IO ()
get_variant :: Ptr GValue -> IO (Ptr GVariant)
set_enum :: Ptr GValue -> CUInt -> IO ()
get_enum :: Ptr GValue -> IO CUInt
set_flags :: Ptr GValue -> CUInt -> IO ()
get_flags :: Ptr GValue -> IO CUInt

-- | Set the value of GValue containing a StablePtr
set_stablePtr :: Ptr GValue -> StablePtr a -> IO ()

-- | Get (a freshly allocated copy of) the value of a GValue
--   containing a StablePtr
get_stablePtr :: Ptr GValue -> IO (StablePtr a)

-- | Like set_stablePtr, but the GValue takes ownership of
--   the StablePtr
take_stablePtr :: Ptr GValue -> StablePtr a -> IO ()

-- | Set the value of GValue containing a GParamSpec
set_param :: Ptr GValue -> Maybe GParamSpec -> IO ()

-- | Get the value of a GValue containing a GParamSpec
get_param :: Ptr GValue -> IO (Maybe GParamSpec)

-- | Set the GValue to the given Haskell value.
set_hvalue :: Typeable a => Ptr GValue -> HValue a -> IO ()

-- | Read the Haskell value of the given type from the GValue. If
--   the GValue contains no value of the expected type,
--   NoHValue will be returned instead, and an error will be printed
--   to stderr.
get_hvalue :: Typeable a => Ptr GValue -> IO (HValue a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.GI.Base.GValue.HValue a)
instance Data.GI.Base.BasicTypes.GBoxed Data.GI.Base.GValue.GValue
instance Data.GI.Base.Overloading.HasParentTypes Data.GI.Base.GValue.GValue
instance Data.GI.Base.GValue.IsGValue GHC.Types.Bool
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Foreign.C.Types.CInt
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Foreign.C.Types.CLong
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Foreign.C.Types.CUInt
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Foreign.C.Types.CULong
instance Data.GI.Base.GValue.IsGValue GHC.Types.Double
instance Data.GI.Base.GValue.IsGValue GHC.Types.Float
instance Data.GI.Base.GValue.IsGValue Data.GI.Base.BasicTypes.GType
instance GHC.Internal.Data.Typeable.Internal.Typeable a => Data.GI.Base.GValue.IsGValue (Data.GI.Base.GValue.HValue a)
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Int.Int32
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Int.Int64
instance Data.GI.Base.GValue.IsGValue (GHC.Internal.Maybe.Maybe GHC.Internal.Base.String)
instance Data.GI.Base.GValue.IsGValue (GHC.Internal.Maybe.Maybe Data.Text.Internal.Text)
instance Data.GI.Base.GValue.IsGValue (GHC.Internal.Maybe.Maybe Data.GI.Base.BasicTypes.GParamSpec)
instance Data.GI.Base.GValue.IsGValue (GHC.Internal.Ptr.Ptr a)
instance Data.GI.Base.GValue.IsGValue (GHC.Internal.Stable.StablePtr a)
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Word.Word32
instance Data.GI.Base.GValue.IsGValue GHC.Internal.Word.Word64
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Data.GI.Base.GValue.HValue a)
instance Data.GI.Base.BasicTypes.TypedObject Data.GI.Base.GValue.GValue

-- | Machinery for some basic support of GHashTable.
--   
--   The GLib GHashTable 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 Ptr.
gDirectHash :: GHashFunc (Ptr a)

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

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

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

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

-- | Check whether two CStrings are equal.
gStrEqual :: GEqualFunc CString

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

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

-- | Pack a Ptr to GValue into a Ptr than can go into
--   a GHashTable.
gvaluePackPtr :: Ptr GValue -> PtrWrapped (Ptr GValue)

-- | Extract a Ptr to GValue wrapped into a Ptr coming
--   from a GHashTable.
gvalueUnpackPtr :: PtrWrapped (Ptr GValue) -> Ptr GValue

-- | 
Basic attributes interface
--   
--   Attributes of an object can be get, set and constructed. For types
--   descending from GObject, properties are encoded in attributes,
--   although attributes are slightly more general (every property of a
--   GObject is an attribute, but we can also have attributes for
--   types not descending from GObject).
--   
--   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 Button lists properties such
--   as image and relief. Parent classes may also
--   introduce properties, so since a Button is an instance of
--   IsActionable, it inherits properties like actionName
--   from Actionable too.
--   
--   As an example consider a button 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
--   
--   
--   value <- getButtonLabel button
--   
--   
--   And for setting:
--   
--   
--   setButtonLabel button label
--   
--   
--   This mechanism quickly becomes rather cumbersome, for example for
--   setting the "window" property in a DOMDOMWindow in WebKit:
--   
--   
--   win <- getDOMDOMWindowWindow dom
--   
--   
--   and perhaps more importantly, one needs to chase down the type which
--   introduces the property:
--   
--   
--   setWidgetSensitive button False
--   
--   
--   There is no setButtonSensitive, since it is the
--   Widget type that introduces the "sensitive" property.
--   
--   
Overloaded attributes
--   
--   A much more convenient overloaded attribute resolution API is provided
--   by this module. Getting the value of an object's attribute is
--   straightforward:
--   
--   
--   value <- get button _label
--   
--   
--   The definition of _label is basically a Proxy encoding
--   the name of the attribute to get:
--   
--   
--   _label = fromLabelProxy (Proxy :: Proxy "label")
--   
--   
--   These proxies can be automatically generated by invoking the code
--   generator with the -l 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 GI/Properties.hs) can be edited as one wishes.
--   
--   In addition, for ghc >= 8.0, one can directly use the overloaded
--   labels provided by GHC itself. Using the OverloadedLabels
--   extension, the code above can also be written as
--   
--   
--   value <- get button #label
--   
--   
--   The syntax for setting or updating an attribute is only slightly more
--   complex. At the simplest level it is just:
--   
--   
--   set button [ _label := value ]
--   
--   
--   or for the WebKit example above
--   
--   
--   set dom [_window := win]
--   
--   
--   However as the list notation would indicate, you can set or update
--   multiple attributes of the same object in one go:
--   
--   
--   set button [ _label := value, _sensitive := False ]
--   
--   
--   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.
--   
--   
--   set spinButton [ _value :~ (+1) ]
--   
--   
--   There are other variants of these operators, see AttrOp below.
--   :=> and :~> are like := and :~ but
--   operate in the IO monad rather than being pure.
--   
--   Attributes can also be set during construction of a GObject
--   using new
--   
--   
--   button <- new Button [_label := "Can't touch this!", _sensitive := False]
--   
--   
--   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 new, but cannot be set
--   afterwards. That these invariants hold is also checked during compile
--   time.
--   
--   
Nullable attributes
--   
--   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 NULL as a valid value for the property. In these
--   cases the get operation may return a Maybe value, with
--   Nothing representing the NULL pointer value (notable
--   exceptions are GList and GSList, for which NULL
--   is represented simply as the empty list). This can be overridden in
--   the introspection data, since sometimes attributes are non-nullable,
--   even if the type would allow for NULL.
--   
--   For convenience, in nullable cases the set operation will by
--   default not take a Maybe value, but rather assume that
--   the caller wants to set a non-NULL value. If setting a
--   NULL value is desired, use clear as follows
--   
--   
--   clear object _propName
--   
module Data.GI.Base.Attributes

-- | Info describing an attribute.
class AttrInfo info where {
    
    -- | The operations that are allowed on the attribute.
    type AttrAllowedOps info :: [AttrOpTag];
    
    -- | Constraint on the type for which we are allowed to create/set/get the
    --   attribute.
    type AttrBaseTypeConstraint info :: Type -> Constraint;
    
    -- | Type returned by <a>attrGet</a>.
    type AttrGetType info;
    
    -- | Constraint on the value being set.
    type AttrSetTypeConstraint info :: Type -> Constraint;
    
    -- | Constraint on the value being set, with allocation allowed (see
    --   <a>:&amp;=</a> below).
    type AttrTransferTypeConstraint info :: Type -> Constraint;
    
    -- | Type resulting from the allocation.
    type AttrTransferType info;
    
    -- | Name of the attribute.
    type AttrLabel info :: Symbol;
    
    -- | Type which introduces the attribute.
    type AttrOrigin info;
    type AttrSetTypeConstraint info = Type ~ AttrGetType info;
    type AttrTransferTypeConstraint info = Type ~ AttrTransferType info;
    type AttrTransferType info = AttrGetType info;
}

-- | Get the value of the given attribute.
attrGet :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> IO (AttrGetType info)
($dmattrGet) :: (AttrInfo info, CheckNotElem 'AttrGet (AttrAllowedOps info) (GetNotProvidedError 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) => o -> b -> IO ()
($dmattrSet) :: (AttrInfo info, CheckNotElem 'AttrSet (AttrAllowedOps info) (SetNotProvidedError info)) => o -> b -> IO ()

-- | Set the value of the given attribute to NULL (for nullable
--   attributes).
attrClear :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> IO ()
($dmattrClear) :: (AttrInfo info, CheckNotElem 'AttrClear (AttrAllowedOps info) (ClearNotProvidedError info)) => o -> IO ()

-- | Build a GValue representing the attribute.
attrConstruct :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => b -> IO (GValueConstruct o)
($dmattrConstruct) :: (AttrInfo info, CheckNotElem 'AttrConstruct (AttrAllowedOps info) (ConstructNotProvidedError info)) => b -> IO (GValueConstruct o)

-- | Allocate memory as necessary to generate a settable type from the
--   transfer type. This is useful for types which needs allocations for
--   marshalling from Haskell to C, this makes the allocation explicit.
attrTransfer :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrTransferTypeConstraint info b) => Proxy o -> b -> IO (AttrTransferType info)
($dmattrTransfer) :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrTransferTypeConstraint info b, b ~ AttrGetType info, b ~ AttrTransferType info) => Proxy o -> b -> IO (AttrTransferType info)

-- | Like attrSet, but it uses the same type as the getter. This is
--   useful for some nullable types, for which the getter returns Maybe
--   a, while the setter takes an a. attrPut will
--   instead accept an Maybe a.
attrPut :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> AttrGetType info -> IO ()
($dmattrPut) :: (AttrInfo info, CheckNotElem 'AttrPut (AttrAllowedOps info) (PutNotProvidedError info)) => o -> AttrGetType info -> IO ()

-- | Return some information about the overloaded attribute, useful for
--   debugging. See resolveAttr for how to access this conveniently.
dbgAttrInfo :: AttrInfo info => Maybe ResolvedSymbolInfo

-- | Possible operations on an attribute.
data AttrOpTag

-- | It is possible to read the value of the attribute with get.
AttrGet :: AttrOpTag

-- | It is possible to write the value of the attribute with set.
AttrSet :: AttrOpTag

-- | It is possible to set the value of the attribute in new.
AttrConstruct :: AttrOpTag

-- | It is possible to clear the value of the (nullable) attribute with
--   clear.
AttrClear :: AttrOpTag

-- | It is possible to set a value of the same type as the one returned by
--   get.
AttrPut :: AttrOpTag

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

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

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

-- | Apply an update function to an attribute
[:~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> IO b) -> AttrOp obj tag

-- | Assign a value to an attribute, allocating any necessary memory for
--   representing the Haskell value as a C value. Note that it is the
--   responsibility of the caller to make sure that the memory is freed
--   when no longer used, otherwise there will be a memory leak. In the
--   majority of cases you probably want to use := instead, which
--   has no potential memory leaks (at the cost of sometimes requiring some
--   explicit Haskell -> C marshalling).
[:&=] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrTransferTypeConstraint info b, AttrSetTypeConstraint info (AttrTransferType info)) => AttrLabelProxy attr -> b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set.
[:!<~] :: forall obj info (attr :: Symbol) (tag1 :: AttrOpTag) b model (tag :: AttrOpTag). (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag1 info obj, AttrSetTypeConstraint info b, ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set. This will only actually set the property
--   whenever the DynVal changes if the new value of the
--   DynVal is different from the actual value of the property. If
--   you want to set the property without checking equality you can use
--   :!<~ instead.
[:<~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b model. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b, AttrOpAllowed 'AttrGet info obj, EqMaybe b (AttrGetType info), ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Given an AttrLabelProxy, bind the given attribute to the corresponding
--   field in the model proxy (if there's one), so that changes in the
--   attribute are reflected back into changes of the model.
[Bind] :: forall obj info (propName :: Symbol) (tag :: AttrOpTag) model outType (components :: [Symbol]) (fieldName :: Symbol). (HasAttributeList obj, GObject obj, info ~ ResolveAttribute propName obj, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrOpAllowed 'AttrPut info obj, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components fieldName, PathFieldAccess components model outType, KnownSymbol fieldName, Eq outType) => AttrLabelProxy propName -> AttrLabelProxy fieldName -> AttrOp obj tag

-- | Connect the given signal to a signal handler.
[On] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag

-- | Like On, but connect after the default signal.
[After] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag
infixr 0 :=
infixr 0 :=>
infixr 0 :~
infixr 0 :~>
infixr 0 :!<~
infixr 0 :<~

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

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

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

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

-- | Constraint on a obj/attr pair so that clear
--   is allowed.
type AttrClearC info obj (attr :: Symbol) = (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 :: Symbol) obj result m. (AttrGetC info obj attr result, MonadIO m) => obj -> AttrLabelProxy attr -> 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 NULL.
clear :: forall info (attr :: Symbol) obj m. (AttrClearC info obj attr, MonadIO m) => obj -> AttrLabelProxy attr -> m ()

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

-- | Return the fully qualified attribute name that a given overloaded
--   attribute resolves to (mostly useful for debugging).
--   
--   
--   resolveAttr #sensitive button
--   
resolveAttr :: forall info (attr :: Symbol) obj. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info) => obj -> AttrLabelProxy attr -> Maybe ResolvedSymbolInfo

-- | Create a binding between the given property of an object and a field
--   in the model.
bindPropToField :: forall o info (prop :: Symbol) (field :: Symbol) model outType (tag :: AttrOpTag) (components :: [Symbol]). (HasAttributeList o, GObject o, info ~ ResolveAttribute prop o, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info o, AttrOpAllowed tag info o, AttrOpAllowed 'AttrPut info o, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components field, PathFieldAccess components model outType, KnownSymbol field, Eq outType) => Proxy tag -> o -> AttrLabelProxy prop -> AttrLabelProxy field -> IO ()
class EqMaybe a b
eqMaybe :: EqMaybe a b => a -> b -> Bool
instance GHC.Internal.Enum.Bounded Data.GI.Base.Attributes.AttrOpTag
instance GHC.Internal.Enum.Enum Data.GI.Base.Attributes.AttrOpTag
instance GHC.Classes.Eq Data.GI.Base.Attributes.AttrOpTag
instance GHC.Classes.Eq a => Data.GI.Base.Attributes.EqMaybe a (GHC.Internal.Maybe.Maybe a)
instance GHC.Classes.Eq a => Data.GI.Base.Attributes.EqMaybe a a
instance (a GHC.Types.~ x) => GHC.Internal.OverloadedLabels.IsLabel x (Data.GI.Base.Attributes.AttrLabelProxy a)
instance GHC.Classes.Ord Data.GI.Base.Attributes.AttrOpTag
instance GHC.Internal.Show.Show Data.GI.Base.Attributes.AttrOpTag

-- | Basic support for GQuarks.
module Data.GI.Base.GQuark

-- | A GQuark, which is simply an integer.
newtype GQuark a
GQuark :: Word32 -> GQuark a

-- | Construct a GQuark from the given string.
gQuarkFromString :: Text -> IO (GQuark a)

-- | Management of GParamSpecs.
module Data.GI.Base.GParamSpec

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

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

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

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

-- | Information on a property encoding a Haskell value. Note that from the
--   C side this property will appear as an opaque pointer. Use the
--   specialized constructors below for creating properties meaningful from
--   the C side.
--   
--   A property name consists of segments consisting of ASCII letters and
--   digits, separated by either the '-' or '_' character. The first
--   character of a property name must be a letter. Names which violate
--   these rules lead to undefined behaviour.
--   
--   When creating and looking up a property, either separator can be used,
--   but they cannot be mixed. Using '-' is considerably more efficient and
--   in fact required when using property names as detail strings for
--   signals.
--   
--   Beyond the name, properties have two more descriptive strings
--   associated with them, the nick, which should be suitable for
--   use as a label for the property in a property editor, and the
--   blurb, which should be a somewhat longer description,
--   suitable for e.g. a tooltip. The nick and blurb
--   should ideally be localized.
data PropertyInfo o a
PropertyInfo :: Text -> Text -> Text -> (o -> a -> IO ()) -> (o -> IO a) -> Maybe [GParamFlag] -> PropertyInfo o a

-- | Identifier for the property.
[name] :: PropertyInfo o a -> Text

-- | Identifier for display to the user.
[nick] :: PropertyInfo o a -> Text

-- | Description of the property.
[blurb] :: PropertyInfo o a -> Text

-- | Handler invoked when the property is being set.
[setter] :: PropertyInfo o a -> o -> a -> IO ()

-- | Handler that returns the current value of the property.
[getter] :: PropertyInfo o a -> o -> IO a

-- | Set of flags, or Nothing for the default set of flags.
[flags] :: PropertyInfo o a -> Maybe [GParamFlag]

-- | Create a GParamSpec for a Haskell value.
gParamSpecValue :: GObject o => PropertyInfo o a -> IO GParamSpec

-- | Information on a property of type Text to be registered. A
--   property name consists of segments consisting of ASCII letters and
--   digits, separated by either the '-' or '_' character. The first
--   character of a property name must be a letter. Names which violate
--   these rules lead to undefined behaviour.
--   
--   When creating and looking up a property, either separator can be used,
--   but they cannot be mixed. Using '-' is considerably more efficient and
--   in fact required when using property names as detail strings for
--   signals.
--   
--   Beyond the name, properties have two more descriptive strings
--   associated with them, the nick, which should be suitable for
--   use as a label for the property in a property editor, and the
--   blurb, which should be a somewhat longer description,
--   suitable for e.g. a tooltip. The nick and blurb
--   should ideally be localized.
data CStringPropertyInfo o
CStringPropertyInfo :: Text -> Text -> Text -> Maybe Text -> Maybe [GParamFlag] -> (o -> Maybe Text -> IO ()) -> (o -> IO (Maybe Text)) -> CStringPropertyInfo o
[name] :: CStringPropertyInfo o -> Text
[nick] :: CStringPropertyInfo o -> Text
[blurb] :: CStringPropertyInfo o -> Text
[defaultValue] :: CStringPropertyInfo o -> Maybe Text
[flags] :: CStringPropertyInfo o -> Maybe [GParamFlag]
[setter] :: CStringPropertyInfo o -> o -> Maybe Text -> IO ()
[getter] :: CStringPropertyInfo o -> o -> IO (Maybe Text)

-- | Create a GParamSpec for a string param.
gParamSpecCString :: GObject o => CStringPropertyInfo o -> IO GParamSpec

-- | Information on a property of type CInt to be registered. A
--   property name consists of segments consisting of ASCII letters and
--   digits, separated by either the '-' or '_' character. The first
--   character of a property name must be a letter. Names which violate
--   these rules lead to undefined behaviour.
--   
--   When creating and looking up a property, either separator can be used,
--   but they cannot be mixed. Using '-' is considerably more efficient and
--   in fact required when using property names as detail strings for
--   signals.
--   
--   Beyond the name, properties have two more descriptive strings
--   associated with them, the nick, which should be suitable for
--   use as a label for the property in a property editor, and the
--   blurb, which should be a somewhat longer description,
--   suitable for e.g. a tooltip. The nick and blurb
--   should ideally be localized.
data CIntPropertyInfo o
CIntPropertyInfo :: Text -> Text -> Text -> CInt -> (o -> CInt -> IO ()) -> (o -> IO CInt) -> Maybe [GParamFlag] -> Maybe CInt -> Maybe CInt -> CIntPropertyInfo o

-- | Identifier for the property.
[name] :: CIntPropertyInfo o -> Text

-- | Identifier for display to the user.
[nick] :: CIntPropertyInfo o -> Text

-- | Description of the property.
[blurb] :: CIntPropertyInfo o -> Text

-- | Default value.
[defaultValue] :: CIntPropertyInfo o -> CInt

-- | Handler invoked when the property is being set.
[setter] :: CIntPropertyInfo o -> o -> CInt -> IO ()

-- | Handler that returns the current value of the property.
[getter] :: CIntPropertyInfo o -> o -> IO CInt

-- | Set of flags, or Nothing for the default set of flags.
[flags] :: CIntPropertyInfo o -> Maybe [GParamFlag]

-- | Minimum value, or Nothing, which would be replaced by
--   MININT.
[minValue] :: CIntPropertyInfo o -> Maybe CInt

-- | Maximum value, or Nothing, which would be replaced by
--   MAXINT.
[maxValue] :: CIntPropertyInfo o -> Maybe CInt

-- | Create a GParamSpec for an integer param.
gParamSpecCInt :: GObject o => CIntPropertyInfo o -> IO GParamSpec

-- | Information on a property of type `type gboolean` to be registered. A
--   property name consists of segments consisting of ASCII letters and
--   digits, separated by either the '-' or '_' character. The first
--   character of a property name must be a letter. Names which violate
--   these rules lead to undefined behaviour.
--   
--   When creating and looking up a property, either separator can be used,
--   but they cannot be mixed. Using '-' is considerably more efficient and
--   in fact required when using property names as detail strings for
--   signals.
--   
--   Beyond the name, properties have two more descriptive strings
--   associated with them, the nick, which should be suitable for
--   use as a label for the property in a property editor, and the
--   blurb, which should be a somewhat longer description,
--   suitable for e.g. a tooltip. The nick and blurb
--   should ideally be localized.
data GBooleanPropertyInfo o
GBooleanPropertyInfo :: Text -> Text -> Text -> Bool -> Maybe [GParamFlag] -> (o -> Bool -> IO ()) -> (o -> IO Bool) -> GBooleanPropertyInfo o
[name] :: GBooleanPropertyInfo o -> Text
[nick] :: GBooleanPropertyInfo o -> Text
[blurb] :: GBooleanPropertyInfo o -> Text
[defaultValue] :: GBooleanPropertyInfo o -> Bool
[flags] :: GBooleanPropertyInfo o -> Maybe [GParamFlag]
[setter] :: GBooleanPropertyInfo o -> o -> Bool -> IO ()
[getter] :: GBooleanPropertyInfo o -> o -> IO Bool

-- | Create a GParamSpec for a bool param.
gParamSpecGBoolean :: GObject o => GBooleanPropertyInfo o -> IO GParamSpec

-- | Flags controlling the behaviour of the the parameters.
data GParamFlag

-- | the parameter is readable
GParamReadable :: GParamFlag

-- | the parameter is writable
GParamWritable :: GParamFlag

-- | the parameter will be set upon object construction
GParamConstruct :: GParamFlag

-- | the parameter can only be set upon object construction
GParamConstructOnly :: GParamFlag

-- | calls to objectSetProperty for this property will not
--   automatically result in a "notify" signal being emitted: the
--   implementation must call objectNotify themselves in case the
--   property actually changes.
GParamExplicitNotify :: GParamFlag

-- | Catch-all for unknown values
AnotherGParamFlag :: Int -> GParamFlag

-- | Low-level getter and setter for the property.
data PropGetSetter o
PropGetSetter :: (Ptr o -> Ptr GValue -> IO ()) -> (Ptr o -> Ptr GValue -> IO ()) -> PropGetSetter o
[propGetter] :: PropGetSetter o -> Ptr o -> Ptr GValue -> IO ()
[propSetter] :: PropGetSetter o -> Ptr o -> Ptr GValue -> IO ()

-- | Attempt to get the Haskell setter and getter for the given
--   GParamSpec. This will only be possible if the GParamSpec
--   was created with one of the functions above, if this is not the case
--   the function will return Nothing.
getGParamSpecGetterSetter :: Ptr GParamSpec -> IO (Maybe (PropGetSetter o))
instance GHC.Internal.Enum.Enum Data.GI.Base.GParamSpec.GParamFlag
instance GHC.Classes.Eq Data.GI.Base.GParamSpec.GParamFlag
instance Data.GI.Base.BasicTypes.IsGFlag Data.GI.Base.GParamSpec.GParamFlag
instance GHC.Classes.Ord Data.GI.Base.GParamSpec.GParamFlag
instance GHC.Internal.Show.Show Data.GI.Base.GParamSpec.GParamFlag

-- | Routines for connecting GObjects to signals. There are two
--   basic variants, on and after, which correspond to
--   g_signal_connect and g_signal_connect_after,
--   respectively.
--   
--   Basic usage is
--   
--   
--   on widget #signalName $ do ...
--   
--   
--   or
--   
--   
--   after widget #signalName $ do ...
--   
--   
--   Note that in the Haskell bindings we represent the signal name in
--   camelCase, so a signal like script-message-received in the
--   original API becomes scriptMessageReceived in the bindings.
--   
--   There are two variants of note. If you want to provide a detail when
--   connecting the signal you can use :::, as follows:
--   
--   
--   on widget (#scriptMessageReceived ::: "handlerName") $ do ...
--   
--   
--   On the other hand, if you want to connect to the "notify"
--   signal for a property of a widget, it is recommended to use instead
--   PropertyNotify, as follows:
--   
--   
--   on widget (PropertyNotify #propertyName) $ do ...
--   
--   
--   which has the advantage that it will be checked at compile time that
--   the widget does indeed have the property "propertyName".
module Data.GI.Base.Signals

-- | Connect a signal to a signal handler.
on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId

-- | Connect a signal to a handler, running the handler after the default
--   one.
after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId

-- | Support for overloaded signal connectors.
data SignalProxy object info

-- | A basic signal name connector.
[SignalProxy] :: forall object info. SignalProxy object info

-- | A signal connector annotated with a detail.
[:::] :: forall object info. SignalProxy object info -> Text -> SignalProxy object info

-- | A signal connector for the notify signal on the given
--   property.
[PropertyNotify] :: forall info1 (propName :: Symbol) object (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object GObjectNotifySignalInfo

-- | A signal connector for the notify signal on the given
--   property, similar to PropertyNotify, but it passes the new
--   value of the property to the callback for convenience.
[PropertySet] :: forall info1 (propName :: Symbol) object b (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, AttrBaseTypeConstraint info1 object, b ~ AttrGetType info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object (GObjectPropertySetSignalInfo b)

-- | Whether to connect a handler to a signal with connectSignal 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 FunPtr.
connectSignalFunPtr :: GObject o => o -> Text -> FunPtr a -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId

-- | Disconnect a previously connected signal.
disconnectSignalHandler :: GObject o => o -> SignalHandlerId -> IO ()

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

-- | Information about an overloaded signal.
class SignalInfo info where {
    
    -- | The type for the signal handler.
    type HaskellCallbackType info;
}

-- | Connect a Haskell function to a signal of the given GObject,
--   specifying whether the handler will be called before or after the
--   default handler. Note that the callback being passed here admits an
--   extra initial parameter with respect to the usual Haskell callback
--   type. This will be passed as an implicit ?self
--   argument to the Haskell callback.
connectSignal :: (SignalInfo info, GObject o) => o -> (o -> HaskellCallbackType info) -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId

-- | Optional extra debug information, for resolveSignal below.
dbgSignalInfo :: SignalInfo info => Maybe ResolvedSymbolInfo

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

-- | Generate an informative type error whenever one tries to use a signal
--   for which code generation has failed.
type family SignalCodeGenError (signalName :: Symbol)

-- | Return the fully qualified signal name that a given overloaded signal
--   resolves to (mostly useful for debugging).
--   
--   
--   resolveSignal #childNotify button
--   
resolveSignal :: (GObject object, SignalInfo info) => object -> SignalProxy object info -> Maybe ResolvedSymbolInfo

-- | Connect the given notify callback for a GObject.
connectGObjectNotify :: GObject o => o -> (o -> GObjectNotifyCallback) -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId
instance (info GHC.Types.~ Data.GI.Base.Overloading.ResolveSignal slot object) => GHC.Internal.OverloadedLabels.IsLabel slot (Data.GI.Base.Signals.SignalProxy object info)
instance Data.GI.Base.Signals.SignalInfo Data.GI.Base.Signals.GObjectNotifySignalInfo
instance Data.GI.Base.Signals.SignalInfo (Data.GI.Base.Signals.GObjectPropertySetSignalInfo b)

-- | This module constains helpers for dealing with GObject-derived
--   types.
module Data.GI.Base.GObject

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

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

-- | Get the value of a given key for the object.
gobjectGetUserData :: (HasCallStack, GObject o) => o -> GQuark a -> IO (Maybe a)

-- | Set the value of the user data for the given GObject to a
--   StablePtr to the given Haskell object. The StablePtr
--   will be freed when the object is destroyed, or the value is replaced.
gobjectSetUserData :: (HasCallStack, GObject o) => o -> GQuark a -> a -> IO ()

-- | A combination of gobjectGetUserData and
--   gobjectSetUserData, for convenience.
gobjectModifyUserData :: (HasCallStack, GObject o) => o -> GQuark a -> (Maybe a -> a) -> IO ()

-- | This typeclass contains the data necessary for defining a new
--   GObject type from Haskell.
class GObject a => DerivedGObject a where {
    
    -- | The parent type
    type GObjectParentType a;
    
    -- | Type of the private data for each instance.
    type GObjectPrivateData a;
}

-- | Name of the type, it should be unique.
objectTypeName :: DerivedGObject a => Text

-- | Code to run when the class is inited. This is a good place to register
--   signals and properties for the type.
objectClassInit :: DerivedGObject a => GObjectClass -> IO ()

-- | Code to run when each instance of the type is constructed. Returns the
--   private data to be associated with the new instance (use
--   gobjectGetPrivateData and gobjectSetPrivateData to
--   manipulate this further).
objectInstanceInit :: DerivedGObject a => GObjectClass -> a -> IO (GObjectPrivateData a)

-- | List of interfaces implemented by the type. Each element is a triplet
--   (gtype, interfaceInit, interfaceFinalize),
--   where gtype :: IO GType is a constructor for the type of the
--   interface, interfaceInit :: Ptr () -> IO () is a function
--   that registers the callbacks in the interface, and
--   interfaceFinalize :: Maybe (Ptr () -> IO ()) is the
--   (optional) finalizer.
objectInterfaces :: DerivedGObject a => [(IO GType, Ptr () -> IO (), Maybe (Ptr () -> IO ()))]

-- | Register the given type into the GObject type system and
--   return the resulting GType, if it has not been registered
--   already. If the type has been registered already the existing
--   GType will be returned instead.
--   
--   Note that for this function to work the type must be an instance of
--   DerivedGObject.
registerGType :: (HasCallStack, DerivedGObject o, GObject (GObjectParentType o), GObject o) => (ManagedPtr o -> o) -> IO GType

-- | Get the private data associated with the given object.
gobjectGetPrivateData :: (HasCallStack, DerivedGObject o) => o -> IO (GObjectPrivateData o)

-- | Set the private data associated with the given object.
gobjectSetPrivateData :: (HasCallStack, DerivedGObject o) => o -> GObjectPrivateData o -> IO ()

-- | Modify the private data for the given object.
gobjectModifyPrivateData :: (HasCallStack, DerivedGObject o) => o -> (GObjectPrivateData o -> GObjectPrivateData o) -> IO ()

-- | Wrapper around GObjectClass on the C-side.
newtype GObjectClass
GObjectClass :: Ptr GObjectClass -> GObjectClass

-- | Find the GType associated to a given GObjectClass.
gtypeFromClass :: GObjectClass -> IO GType

-- | Find the GType for a given GObject.
gtypeFromInstance :: GObject o => o -> IO GType

-- | Add a Haskell object-valued property to the given object class.
gobjectInstallProperty :: DerivedGObject o => GObjectClass -> PropertyInfo o a -> IO ()

-- | Add a CInt-valued property to the given object class.
gobjectInstallCIntProperty :: DerivedGObject o => GObjectClass -> CIntPropertyInfo o -> IO ()

-- | Add a CString-valued property to the given object class.
gobjectInstallCStringProperty :: DerivedGObject o => GObjectClass -> CStringPropertyInfo o -> IO ()

-- | Add a `${type gboolean}`-valued property to the given object class.
gobjectInstallGBooleanProperty :: DerivedGObject o => GObjectClass -> GBooleanPropertyInfo o -> IO ()

-- | Constructible types are those for which new is defined.
--   Often these are GObjects, 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 new.
class Constructible a (tag :: AttrOpTag)

-- | Allocate a new instance of the given type, with the given attributes.
new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a
instance (Data.GI.Base.BasicTypes.GObject a, tag GHC.Types.~ '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 catch and
--   handle functions.
--   
--   To catch just a single specific error use catchGErrorJust /
--   handleGErrorJust. To catch any error in a particular error
--   domain use catchGErrorJustDomain /
--   handleGErrorJustDomain
--   
--   For convenience, generated code also includes specialized variants of
--   catchGErrorJust / handleGErrorJust for each error type.
--   For example, for errors of type PixbufError one could invoke
--   catchPixbufError / handlePixbufError. The definition is
--   simply
--   
--   
--   catchPixbufError :: IO a -> (PixbufError -> GErrorMessage -> IO a) -> IO a
--   catchPixbufError = catchGErrorJustDomain
--   
--   
--   Notice that the type is suitably specialized, so only errors of type
--   PixbufError 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 gerrorDomain, gerrorCode and
--   gerrorMessage below.
newtype GError
GError :: ManagedPtr GError -> GError

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

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

-- | A text message describing the GError.
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
--   GErrorDomain. 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 catchGErrorJustDomain or handleGErrorJustDomain,
--   this is worked out for you automatically.
type GErrorCode = C_gint

-- | 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, catchGErrorJustDomain is probably
--   more appropriate. Example:
--   
--   
--   do image <- catchGErrorJust PixbufErrorCorruptImage
--                 loadImage
--                 (\errorMessage -> do log errorMessage
--                                      return mssingImagePlaceholder)
--   
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.
--   
--   
--   catchGErrorJustDomain
--     loadImage
--     (\err message -> case err of
--         PixbufErrorCorruptImage -> ...
--         PixbufErrorInsufficientMemory -> ...
--         PixbufErrorUnknownType -> ...
--         _ -> ...)
--   
catchGErrorJustDomain :: GErrorClass err => IO a -> (err -> GErrorMessage -> IO a) -> IO a

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

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

-- | Create a new GError.
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 PixbufError:
--   
--   
--   instance GErrorClass PixbufError where
--     gerrorClassDomain _ = "gdk-pixbuf-error-quark"
--   
class Enum err => GErrorClass err
gerrorClassDomain :: GErrorClass err => err -> Text

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

-- | Like propagateGError, 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 Maybe GError is not
--   Nothing, store a copy in the passed in pointer, unless the
--   pointer is nullPtr.
maybePokeGError :: Ptr (Ptr GError) -> Maybe GError -> IO ()
instance GHC.Internal.Exception.Type.Exception Data.GI.Base.GError.GError
instance Data.GI.Base.BasicTypes.GBoxed Data.GI.Base.GError.GError
instance Data.GI.Base.Overloading.HasParentTypes Data.GI.Base.GError.GError
instance GHC.Internal.Show.Show Data.GI.Base.GError.GError
instance Data.GI.Base.BasicTypes.TypedObject 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 Char represents Unicode codespace and its
--   elements are code points as in definitions D9 and D10 of the
--   Unicode Standard.
--   
--   Character literals in Haskell are single-quoted: 'Q',
--   'Я' or 'Ω'. To represent a single quote itself use
--   '\'', and to represent a backslash use '\\'. The
--   full grammar can be found in the section 2.6 of the Haskell 2010
--   Language Report.
--   
--   To specify a character by its code point one can use decimal,
--   hexadecimal or octal notation: '\65', '\x41' and
--   '\o101' are all alternative forms of 'A'. The
--   largest code point is '\x10ffff'.
--   
--   There is a special escape syntax for ASCII control characters:
--   
--   TODO: table
--   
--   Data.Char provides utilities to work with Char.
data Char

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

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

-- | 8-bit unsigned integer type
data Word8

-- | 64-bit unsigned integer type
data Word64

-- | 32-bit unsigned integer type
data Word32

-- | 16-bit unsigned integer type
data Word16

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

-- | Haskell type representing the C double type. (The concrete
--   types of Foreign.C.Types#platform are platform-specific.)
newtype CDouble
CDouble :: Double -> CDouble

-- | Haskell type representing the C float type. (The concrete
--   types of Foreign.C.Types#platform are platform-specific.)
newtype CFloat
CFloat :: Float -> CFloat

-- | Haskell type representing the C unsigned long type. (The
--   concrete types of Foreign.C.Types#platform are
--   platform-specific.)
newtype CULong
CULong :: Word64 -> CULong

-- | Haskell type representing the C long type. (The concrete
--   types of Foreign.C.Types#platform are platform-specific.)
newtype CLong
CLong :: Int64 -> CLong

-- | Haskell type representing the C unsigned int type. (The
--   concrete types of Foreign.C.Types#platform are
--   platform-specific.)
newtype CUInt
CUInt :: Word32 -> CUInt

-- | Haskell type representing the C int type. (The concrete
--   types of Foreign.C.Types#platform are platform-specific.)
newtype CInt
CInt :: Int32 -> CInt

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

-- | A value of type Ptr a represents a pointer to an
--   object, or an array of objects, which may be marshalled to or from
--   Haskell values of type a.
--   
--   The type a will often be an instance of class Storable
--   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 struct.
data Ptr a

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

-- | The constant nullPtr contains a distinguished value of
--   Ptr that is not associated with a valid memory location.
nullPtr :: Ptr a

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

-- | Casts a FunPtr to a Ptr.
--   
--   Note: 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

-- | Casts a Ptr to a FunPtr.
--   
--   Note: 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

-- | The type ForeignPtr 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 ForeignPtrs and vanilla memory
--   references of type Ptr a is that the former may be associated
--   with finalizers. 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
--   ForeignPtr. Typically, the finalizer will, then, invoke
--   routines in the foreign language that free the resources bound by the
--   foreign object.
--   
--   The ForeignPtr is parameterised in the same way as Ptr.
--   The type argument of ForeignPtr should normally be an instance
--   of class Storable.
data ForeignPtr 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 a, the alignment constraint for a, as given by
--   the function alignment is fulfilled.
peek :: Storable a => Ptr a -> IO a

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

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

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

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

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

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

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

-- | Apply an update function to an attribute
[:~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> IO b) -> AttrOp obj tag

-- | Assign a value to an attribute, allocating any necessary memory for
--   representing the Haskell value as a C value. Note that it is the
--   responsibility of the caller to make sure that the memory is freed
--   when no longer used, otherwise there will be a memory leak. In the
--   majority of cases you probably want to use := instead, which
--   has no potential memory leaks (at the cost of sometimes requiring some
--   explicit Haskell -> C marshalling).
[:&=] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrTransferTypeConstraint info b, AttrSetTypeConstraint info (AttrTransferType info)) => AttrLabelProxy attr -> b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set.
[:!<~] :: forall obj info (attr :: Symbol) (tag1 :: AttrOpTag) b model (tag :: AttrOpTag). (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag1 info obj, AttrSetTypeConstraint info b, ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set. This will only actually set the property
--   whenever the DynVal changes if the new value of the
--   DynVal is different from the actual value of the property. If
--   you want to set the property without checking equality you can use
--   :!<~ instead.
[:<~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b model. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b, AttrOpAllowed 'AttrGet info obj, EqMaybe b (AttrGetType info), ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Given an AttrLabelProxy, bind the given attribute to the corresponding
--   field in the model proxy (if there's one), so that changes in the
--   attribute are reflected back into changes of the model.
[Bind] :: forall obj info (propName :: Symbol) (tag :: AttrOpTag) model outType (components :: [Symbol]) (fieldName :: Symbol). (HasAttributeList obj, GObject obj, info ~ ResolveAttribute propName obj, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrOpAllowed 'AttrPut info obj, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components fieldName, PathFieldAccess components model outType, KnownSymbol fieldName, Eq outType) => AttrLabelProxy propName -> AttrLabelProxy fieldName -> AttrOp obj tag

-- | Connect the given signal to a signal handler.
[On] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag

-- | Like On, but connect after the default signal.
[After] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag
infixr 0 :=
infixr 0 :=>
infixr 0 :~
infixr 0 :~>
infixr 0 :!<~
infixr 0 :<~

-- | Info describing an attribute.
class AttrInfo info where {
    
    -- | The operations that are allowed on the attribute.
    type AttrAllowedOps info :: [AttrOpTag];
    
    -- | Constraint on the type for which we are allowed to create/set/get the
    --   attribute.
    type AttrBaseTypeConstraint info :: Type -> Constraint;
    
    -- | Type returned by <a>attrGet</a>.
    type AttrGetType info;
    
    -- | Constraint on the value being set.
    type AttrSetTypeConstraint info :: Type -> Constraint;
    
    -- | Constraint on the value being set, with allocation allowed (see
    --   <a>:&amp;=</a> below).
    type AttrTransferTypeConstraint info :: Type -> Constraint;
    
    -- | Type resulting from the allocation.
    type AttrTransferType info;
    
    -- | Name of the attribute.
    type AttrLabel info :: Symbol;
    
    -- | Type which introduces the attribute.
    type AttrOrigin info;
    type AttrSetTypeConstraint info = Type ~ AttrGetType info;
    type AttrTransferTypeConstraint info = Type ~ AttrTransferType info;
    type AttrTransferType info = AttrGetType info;
}

-- | Get the value of the given attribute.
attrGet :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> IO (AttrGetType info)
($dmattrGet) :: (AttrInfo info, CheckNotElem 'AttrGet (AttrAllowedOps info) (GetNotProvidedError 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) => o -> b -> IO ()
($dmattrSet) :: (AttrInfo info, CheckNotElem 'AttrSet (AttrAllowedOps info) (SetNotProvidedError info)) => o -> b -> IO ()

-- | Set the value of the given attribute to NULL (for nullable
--   attributes).
attrClear :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> IO ()
($dmattrClear) :: (AttrInfo info, CheckNotElem 'AttrClear (AttrAllowedOps info) (ClearNotProvidedError info)) => o -> IO ()

-- | Build a GValue representing the attribute.
attrConstruct :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrSetTypeConstraint info b) => b -> IO (GValueConstruct o)
($dmattrConstruct) :: (AttrInfo info, CheckNotElem 'AttrConstruct (AttrAllowedOps info) (ConstructNotProvidedError info)) => b -> IO (GValueConstruct o)

-- | Allocate memory as necessary to generate a settable type from the
--   transfer type. This is useful for types which needs allocations for
--   marshalling from Haskell to C, this makes the allocation explicit.
attrTransfer :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrTransferTypeConstraint info b) => Proxy o -> b -> IO (AttrTransferType info)
($dmattrTransfer) :: (AttrInfo info, AttrBaseTypeConstraint info o, AttrTransferTypeConstraint info b, b ~ AttrGetType info, b ~ AttrTransferType info) => Proxy o -> b -> IO (AttrTransferType info)

-- | Like attrSet, but it uses the same type as the getter. This is
--   useful for some nullable types, for which the getter returns Maybe
--   a, while the setter takes an a. attrPut will
--   instead accept an Maybe a.
attrPut :: (AttrInfo info, AttrBaseTypeConstraint info o) => o -> AttrGetType info -> IO ()
($dmattrPut) :: (AttrInfo info, CheckNotElem 'AttrPut (AttrAllowedOps info) (PutNotProvidedError info)) => o -> AttrGetType info -> IO ()

-- | Return some information about the overloaded attribute, useful for
--   debugging. See resolveAttr for how to access this conveniently.
dbgAttrInfo :: AttrInfo info => Maybe ResolvedSymbolInfo

-- | Possible operations on an attribute.
data AttrOpTag

-- | It is possible to read the value of the attribute with get.
AttrGet :: AttrOpTag

-- | It is possible to write the value of the attribute with set.
AttrSet :: AttrOpTag

-- | It is possible to set the value of the attribute in new.
AttrConstruct :: AttrOpTag

-- | It is possible to clear the value of the (nullable) attribute with
--   clear.
AttrClear :: AttrOpTag

-- | It is possible to set a value of the same type as the one returned by
--   get.
AttrPut :: AttrOpTag

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

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

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

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

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

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

-- | Return the fully qualified attribute name that a given overloaded
--   attribute resolves to (mostly useful for debugging).
--   
--   
--   resolveAttr #sensitive button
--   
resolveAttr :: forall info (attr :: Symbol) obj. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info) => obj -> AttrLabelProxy attr -> Maybe ResolvedSymbolInfo

-- | Create a binding between the given property of an object and a field
--   in the model.
bindPropToField :: forall o info (prop :: Symbol) (field :: Symbol) model outType (tag :: AttrOpTag) (components :: [Symbol]). (HasAttributeList o, GObject o, info ~ ResolveAttribute prop o, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info o, AttrOpAllowed tag info o, AttrOpAllowed 'AttrPut info o, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components field, PathFieldAccess components model outType, KnownSymbol field, Eq outType) => Proxy tag -> o -> AttrLabelProxy prop -> AttrLabelProxy field -> IO ()
class EqMaybe a b
eqMaybe :: EqMaybe a b => a -> b -> Bool

-- | Name of the attribute.
type family AttrLabel info :: Symbol

-- | Type returned by attrGet.
type family AttrGetType info

-- | Constraint on the type for which we are allowed to create/set/get the
--   attribute.
type family AttrBaseTypeConstraint info :: Type -> Constraint

-- | The operations that are allowed on the attribute.
type family AttrAllowedOps info :: [AttrOpTag]

-- | Constraint on the value being set.
type family AttrSetTypeConstraint info :: Type -> Constraint

-- | Constraint on the value being set, with allocation allowed (see
--   :&= below).
type family AttrTransferTypeConstraint info :: Type -> Constraint

-- | Type resulting from the allocation.
type family AttrTransferType info

-- | Type which introduces the attribute.
type family AttrOrigin info

-- | The basic type. This corresponds to a wrapped GClosure on the
--   C side, which is a boxed object.
data GClosure a

-- | Information about an overloaded signal.
class SignalInfo info where {
    
    -- | The type for the signal handler.
    type HaskellCallbackType info;
}

-- | Connect a Haskell function to a signal of the given GObject,
--   specifying whether the handler will be called before or after the
--   default handler. Note that the callback being passed here admits an
--   extra initial parameter with respect to the usual Haskell callback
--   type. This will be passed as an implicit ?self
--   argument to the Haskell callback.
connectSignal :: (SignalInfo info, GObject o) => o -> (o -> HaskellCallbackType info) -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId

-- | Optional extra debug information, for resolveSignal below.
dbgSignalInfo :: SignalInfo info => Maybe ResolvedSymbolInfo

-- | Whether to connect a handler to a signal with connectSignal 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 FunPtr.
connectSignalFunPtr :: GObject o => o -> Text -> FunPtr a -> SignalConnectMode -> Maybe Text -> IO SignalHandlerId

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

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

-- | The type for the signal handler.
type family HaskellCallbackType info

-- | (Kind) This is the kind of type-level symbols.
data Symbol

-- | Class Enum defines operations on sequentially ordered types.
--   
--   The enumFrom... methods are used in Haskell's translation of
--   arithmetic sequences.
--   
--   Instances of Enum 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 fromEnum from
--   0 through n-1. See Chapter 10 of the Haskell
--   Report for more details.
--   
--   For any type that is an instance of class Bounded as well as
--   Enum, the following should hold:
--   
--   
--   
- The calls succ maxBound and pred
--   minBound should result in a runtime error.
--   
- fromEnum and toEnum should give a runtime error if
--   the result value is not representable in the result type. For example,
--   toEnum 7 :: Bool is an error.
--   
- enumFrom and enumFromThen should be defined with an
--   implicit bound, thus:
--   
--   
--   
--   enumFrom     x   = enumFromTo     x maxBound
--   enumFromThen x y = enumFromThenTo x y bound
--     where
--       bound | fromEnum y >= fromEnum x = maxBound
--             | otherwise                = minBound
--   
class Enum a

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

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

-- | Conversion of values to readable Strings.
--   
--   Derived instances of Show have the following properties, which
--   are compatible with derived instances of Read:
--   
--   
--   
- The result of show 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.
--   
- If the constructor is defined to be an infix operator, then
--   showsPrec will produce infix applications of the
--   constructor.
--   
- the representation will be enclosed in parentheses if the
--   precedence of the top-level constructor in x is less than
--   d (associativity is ignored). Thus, if d is
--   0 then the result is never surrounded in parentheses; if
--   d is 11 it is always surrounded in parentheses,
--   unless it is an atomic expression.
--   
- If the constructor is defined using record syntax, then
--   show will produce the record-syntax form, with the fields given
--   in the same order as the original declaration.
--   
--   
--   For example, given the declarations
--   
--   
--   infixr 5 :^:
--   data Tree a =  Leaf a  |  Tree a :^: Tree a
--   
--   
--   the derived instance of Show is equivalent to
--   
--   
--   instance (Show a) => Show (Tree a) where
--   
--          showsPrec d (Leaf m) = showParen (d > app_prec) $
--               showString "Leaf " . showsPrec (app_prec+1) m
--            where app_prec = 10
--   
--          showsPrec d (u :^: v) = showParen (d > up_prec) $
--               showsPrec (up_prec+1) u .
--               showString " :^: "      .
--               showsPrec (up_prec+1) v
--            where up_prec = 5
--   
--   
--   Note that right-associativity of :^: is ignored. For example,
--   
--   
--   
- show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the
--   string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
--   
class Show a

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

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

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

-- | The Eq class defines equality (==) and inequality
--   (/=). All the basic datatypes exported by the Prelude
--   are instances of Eq, and Eq may be derived for any
--   datatype whose constituents are also instances of Eq.
--   
--   The Haskell Report defines no laws for Eq. However, instances
--   are encouraged to follow these properties:
--   
--   
--   
- Reflexivity x == x = True
--   
- Symmetry x == y = y == x
--   
- Transitivity if x == y && y == z =
--   True, then x == z = True
--   
- Extensionality if x == y = True and
--   f is a function whose return type is an instance of
--   Eq, then f x == f y = True
--   
- Negation x /= y = not (x ==
--   y)
--   
class Eq a
(==) :: Eq a => a -> a -> Bool
(/=) :: Eq a => a -> a -> Bool
infix 4 ==
infix 4 /=

-- | A value of type IO a is a computation which, when
--   performed, does some I/O before returning a value of type a.
--   
--   There is really only one way to "perform" an I/O action: bind it to
--   Main.main 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 IO monad and
--   called at some point, directly or indirectly, from Main.main.
--   
--   IO is a monad, so IO actions can be combined using
--   either the do-notation or the >> and >>=
--   operations from the Monad class.
data IO a

-- | The Monad class defines the basic operations over a
--   monad, a concept from a branch of mathematics known as
--   category theory. From the perspective of a Haskell programmer,
--   however, it is best to think of a monad as an abstract datatype
--   of actions. Haskell's do expressions provide a convenient
--   syntax for writing monadic expressions.
--   
--   Instances of Monad should satisfy the following:
--   
--   
--   
- Left identity return a >>= k = k
--   a
--   
- Right identity m >>= return =
--   m
--   
- Associativity m >>= (\x -> k x
--   >>= h) = (m >>= k) >>=
--   h
--   
--   
--   Furthermore, the Monad and Applicative operations should
--   relate as follows:
--   
--   
--   
- 
pure = return

--   
- 
m1 <*> m2 = m1 >>= (\x1 -> m2
--   >>= (\x2 -> return (x1 x2)))

--   
--   
--   The above laws imply:
--   
--   
--   
- 
fmap f xs = xs >>= return .
--   f

--   
- 
(>>) = (*>)

--   
--   
--   and that pure and (<*>) satisfy the applicative
--   functor laws.
--   
--   The instances of Monad for List, Maybe and
--   IO defined in the Prelude 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.
--   
--   'as >>= bs' can be understood as the do
--   expression
--   
--   
--   do a <- as
--      bs a
--   
--   
--   An alternative name for this function is 'bind', but some people may
--   refer to it as 'flatMap', which results from it being equivialent to
--   
--   
--   \x f -> join (fmap f x) :: Monad m => m a -> (a -> m b) -> m b
--   
--   
--   which can be seen as mapping a value with Monad m => m a ->
--   m (m b) and then 'flattening' m (m b) to m b
--   using join.
(>>=) :: 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.
--   
--   'as >> bs' can be understood as the do
--   expression
--   
--   
--   do as
--      bs
--   
--   
--   or in terms of (>>=) as
--   
--   
--   as >>= const bs
--   
(>>) :: Monad m => m a -> m b -> m b

-- | Inject a value into the monadic type. This function should not
--   be different from its default implementation as pure. The
--   justification for the existence of this function is merely historic.
return :: Monad m => a -> m a
infixl 1 >>=
infixl 1 >>

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

-- | Right to left function composition.
--   
--   
--   (f . g) x = f (g x)
--   
--   
--   
--   f . id = f = id . f
--   
--   
--   
Examples
--   
--   
--   >>> map ((*2) . length) [[], [0, 1, 2], [0]]
--   [0,6,2]
--   
--   
--   
--   >>> foldr (.) id [(+1), (*3), (^3)] 2
--   25
--   
--   
--   
--   >>> let (...) = (.).(.) in ((*2)...(+)) 5 10
--   30
--   
(.) :: (b -> c) -> (a -> b) -> a -> c
infixr 9 .

-- | ($) is the function application operator.
--   
--   Applying ($) to a function f and an argument
--   x gives the same result as applying f to x
--   directly. The definition is akin to this:
--   
--   
--   ($) :: (a -> b) -> a -> b
--   ($) f x = f x
--   
--   
--   This is id specialized from a -> a to
--   (a -> b) -> (a -> b) which by the associativity of
--   (->) is the same as (a -> b) -> a -> b.
--   
--   On the face of it, this may appear pointless! But it's actually one of
--   the most useful and important operators in Haskell.
--   
--   The order of operations is very different between ($) and
--   normal function application. Normal function application has
--   precedence 10 - higher than any operator - and associates to the left.
--   So these two definitions are equivalent:
--   
--   
--   expr = min 5 1 + 5
--   expr = ((min 5) 1) + 5
--   
--   
--   ($) has precedence 0 (the lowest) and associates to the
--   right, so these are equivalent:
--   
--   
--   expr = min 5 $ 1 + 5
--   expr = (min 5) (1 + 5)
--   
--   
--   
Examples
--   
--   A common use cases of ($) is to avoid parentheses in complex
--   expressions.
--   
--   For example, instead of using nested parentheses in the following
--   Haskell function:
--   
--   
--   -- | Sum numbers in a string: strSum "100  5 -7" == 98
--   strSum :: String -> Int
--   strSum s = sum (mapMaybe readMaybe (words s))
--   
--   
--   we can deploy the function application operator:
--   
--   
--   -- | Sum numbers in a string: strSum "100  5 -7" == 98
--   strSum :: String -> Int
--   strSum s = sum $ mapMaybe readMaybe $ words s
--   
--   
--   ($) is also used as a section (a partially applied operator),
--   in order to indicate that we wish to apply some yet-unspecified
--   function to a given value. For example, to apply the argument
--   5 to a list of functions:
--   
--   
--   applyFive :: [Int]
--   applyFive = map ($ 5) [(+1), (2^)]
--   >>> [6, 32]
--   
--   
--   
Technical Remark (Representation Polymorphism)
--   
--   ($) is fully representation-polymorphic. This allows it to
--   also be used with arguments of unlifted and even unboxed kinds, such
--   as unboxed integers:
--   
--   
--   fastMod :: Int -> Int -> Int
--   fastMod (I# x) (I# m) = I# $ remInt# x m
--   
($) :: (a -> b) -> a -> b
infixr 0 $

-- | (++) appends two lists, i.e.,
--   
--   
--   [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
--   [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
--   
--   
--   If the first list is not finite, the result is the first list.
--   
--   
Performance considerations
--   
--   This function takes linear time in the number of elements of the
--   first list. Thus it is better to associate repeated
--   applications of (++) to the right (which is the default
--   behaviour): xs ++ (ys ++ zs) or simply xs ++ ys ++
--   zs, but not (xs ++ ys) ++ zs. For the same reason
--   concat = foldr (++) [] has
--   linear performance, while foldl (++) [] is
--   prone to quadratic slowdown
--   
--   
Examples
--   
--   
--   >>> [1, 2, 3] ++ [4, 5, 6]
--   [1,2,3,4,5,6]
--   
--   
--   
--   >>> [] ++ [1, 2, 3]
--   [1,2,3]
--   
--   
--   
--   >>> [3, 2, 1] ++ []
--   [3,2,1]
--   
(++) :: [a] -> [a] -> [a]
infixr 5 ++

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

-- | Left-to-right composition of Kleisli arrows.
--   
--   '(bs >=> cs) a' can be understood as the
--   do expression
--   
--   
--   do b <- bs a
--      cs b
--   
--   
--   or in terms of (>>=) as
--   
--   
--   bs a >>= cs
--   
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
infixr 1 >=>
data 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 error. It is expected that compilers will
--   recognize this and insert error messages which are more appropriate to
--   the context in which undefined appears.
undefined :: HasCallStack => a

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

-- | <math>. map f xs is the list obtained by
--   applying f to each element of xs, i.e.,
--   
--   
--   map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
--   map f [x1, x2, ...] == [f x1, f x2, ...]
--   
--   
--   this means that map id == id
--   
--   
Examples
--   
--   
--   >>> map (+1) [1, 2, 3]
--   [2,3,4]
--   
--   
--   
--   >>> map id [1, 2, 3]
--   [1,2,3]
--   
--   
--   
--   >>> map (\n -> 3 * n + 1) [1, 2, 3]
--   [4,7,10]
--   
map :: (a -> b) -> [a] -> [b]

-- | Returns the size/length of a finite structure as an Int. The
--   default implementation just counts elements starting with the
--   leftmost. Instances for structures that can compute the element count
--   faster than via element-by-element counting, should provide a
--   specialised implementation.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> length []
--   0
--   
--   
--   
--   >>> length ['a', 'b', 'c']
--   3
--   
--   >>> length [1..]
--   * Hangs forever *
--   
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 mapM_.
--   
--   
Examples
--   
--   mapM is literally a traverse with a type signature
--   restricted to Monad. Its implementation may be more efficient
--   due to additional power of Monad.
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 mapM.
--   
--   mapM_ is just like traverse_, but specialised to monadic
--   actions.
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()

-- | Conditional execution of Applicative expressions. For example,
--   
--   
Examples
--   
--   
--   when debug (putStrLn "Debugging")
--   
--   
--   will output the string Debugging if the Boolean value
--   debug is True, and otherwise do nothing.
--   
--   
--   >>> putStr "pi:" >> when False (print 3.14159)
--   pi:
--   
when :: Applicative f => Bool -> f () -> f ()

-- | General coercion from Integral types.
--   
--   WARNING: This function performs silent truncation if the result type
--   is not at least as big as the argument's type.
fromIntegral :: (Integral a, Num b) => a -> b

-- | General coercion to Fractional types.
--   
--   WARNING: This function goes through the Rational type, which
--   does not have values for NaN for example. This means it does
--   not round-trip.
--   
--   For Double it also behaves differently with or without -O0:
--   
--   
--   Prelude> realToFrac nan -- With -O0
--   -Infinity
--   Prelude> realToFrac nan
--   NaN
--   
realToFrac :: (Real a, Fractional b) => a -> b

-- | Lifted, homogeneous equality. By lifted, we mean that it can be bogus
--   (deferred type error). By homogeneous, the two types a and
--   b must have the same kinds.
class a ~# b => (a :: k) ~ (b :: k)
infix 4 ~

module Data.GI.Base.Properties

-- | Set a property for a type with a IsGValue instance.
setObjectPropertyIsGValueInstance :: (GObject a, IsGValue b) => a -> String -> b -> IO ()
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 :: (GObject a, GObject b) => a -> String -> Maybe b -> IO ()
setObjectPropertyBoxed :: (GObject a, GBoxed 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 ()
setObjectPropertyClosure :: GObject a => a -> String -> Maybe (GClosure 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 ()

-- | Set a property of type GError.
setObjectPropertyGError :: GObject a => a -> String -> Maybe GError -> IO ()

-- | Set a property of type GValue.
setObjectPropertyGValue :: GObject a => a -> String -> Maybe GValue -> IO ()

-- | Set a property of type GParamSpec.
setObjectPropertyParamSpec :: GObject a => a -> String -> Maybe GParamSpec -> IO ()

-- | Get a nullable property for a type with a IsGValue instance.
getObjectPropertyIsGValueInstance :: (GObject a, IsGValue b) => a -> String -> IO b
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 :: (GObject a, GObject b) => a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyBoxed :: (GObject a, GBoxed b) => a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyEnum :: (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
getObjectPropertyFlags :: (GObject a, IsGFlag b, BoxedFlags b) => a -> String -> IO [b]
getObjectPropertyClosure :: GObject a => a -> String -> IO (Maybe (GClosure 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)

-- | Get the value of a property of type GError.
getObjectPropertyGError :: GObject a => a -> String -> IO (Maybe GError)

-- | Get the value of a property of type GValue.
getObjectPropertyGValue :: GObject a => a -> String -> IO (Maybe GValue)

-- | Get a property of type GParamSpec.
getObjectPropertyParamSpec :: GObject a => a -> String -> IO (Maybe GParamSpec)

-- | Construct a property for a type with a IsGValue instance.
constructObjectPropertyIsGValueInstance :: IsGValue b => String -> b -> IO (GValueConstruct o)
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 :: GObject a => String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyBoxed :: GBoxed a => String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyEnum :: (Enum a, BoxedEnum a) => String -> a -> IO (GValueConstruct o)
constructObjectPropertyFlags :: (IsGFlag a, BoxedFlags a) => String -> [a] -> IO (GValueConstruct o)
constructObjectPropertyClosure :: String -> Maybe (GClosure 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)

-- | Construct a property of type GError.
constructObjectPropertyGError :: String -> Maybe GError -> IO (GValueConstruct o)

-- | Construct a property of type GValue.
constructObjectPropertyGValue :: String -> Maybe GValue -> IO (GValueConstruct o)

-- | Construct a property of type GParamSpec.
constructObjectPropertyParamSpec :: String -> Maybe GParamSpec -> IO (GValueConstruct o)

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

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

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

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

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

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

-- | Apply an update function to an attribute
[:~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> b) -> AttrOp obj tag

-- | Apply an IO update function to an attribute
[:~>] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b a. (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 -> (a -> IO b) -> AttrOp obj tag

-- | Assign a value to an attribute, allocating any necessary memory for
--   representing the Haskell value as a C value. Note that it is the
--   responsibility of the caller to make sure that the memory is freed
--   when no longer used, otherwise there will be a memory leak. In the
--   majority of cases you probably want to use := instead, which
--   has no potential memory leaks (at the cost of sometimes requiring some
--   explicit Haskell -> C marshalling).
[:&=] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrTransferTypeConstraint info b, AttrSetTypeConstraint info (AttrTransferType info)) => AttrLabelProxy attr -> b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set.
[:!<~] :: forall obj info (attr :: Symbol) (tag1 :: AttrOpTag) b model (tag :: AttrOpTag). (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag1 info obj, AttrSetTypeConstraint info b, ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Bind a property to the given DynVal, so that the property is
--   changed whenever the DynVal is. This requires the implicit
--   param ?_haskell_gi_modelProxy, of type ModelProxy
--   model to be set. This will only actually set the property
--   whenever the DynVal changes if the new value of the
--   DynVal is different from the actual value of the property. If
--   you want to set the property without checking equality you can use
--   :!<~ instead.
[:<~] :: forall obj info (attr :: Symbol) (tag :: AttrOpTag) b model. (HasAttributeList obj, info ~ ResolveAttribute attr obj, AttrInfo info, AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrSetTypeConstraint info b, AttrOpAllowed 'AttrGet info obj, EqMaybe b (AttrGetType info), ?_haskell_gi_modelProxy :: ModelProxy model) => AttrLabelProxy attr -> DynVal model b -> AttrOp obj tag

-- | Given an AttrLabelProxy, bind the given attribute to the corresponding
--   field in the model proxy (if there's one), so that changes in the
--   attribute are reflected back into changes of the model.
[Bind] :: forall obj info (propName :: Symbol) (tag :: AttrOpTag) model outType (components :: [Symbol]) (fieldName :: Symbol). (HasAttributeList obj, GObject obj, info ~ ResolveAttribute propName obj, AttrInfo info, KnownSymbol (AttrLabel info), AttrBaseTypeConstraint info obj, AttrOpAllowed tag info obj, AttrOpAllowed 'AttrPut info obj, ?_haskell_gi_modelProxy :: ModelProxy model, outType ~ AttrGetType info, AttrSetTypeConstraint info outType, components ~ Components fieldName, PathFieldAccess components model outType, KnownSymbol fieldName, Eq outType) => AttrLabelProxy propName -> AttrLabelProxy fieldName -> AttrOp obj tag

-- | Connect the given signal to a signal handler.
[On] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag

-- | Like On, but connect after the default signal.
[After] :: forall obj info (tag :: AttrOpTag). (GObject obj, SignalInfo info) => SignalProxy obj info -> ((?self :: obj) => HaskellCallbackType info) -> AttrOp obj tag
infixr 0 :=
infixr 0 :=>
infixr 0 :~
infixr 0 :~>
infixr 0 :!<~
infixr 0 :<~

-- | The basic type. This corresponds to a wrapped GClosure on the
--   C side, which is a boxed object.
data GClosure a

-- | Allocate a new instance of the given type, with the given attributes.
new :: (Constructible a tag, MonadIO m) => (ManagedPtr a -> a) -> [AttrOp a tag] -> m a

-- | Haskell-side representation of a GValue.
newtype GValue
GValue :: ManagedPtr GValue -> GValue

-- | Create a Haskell object out of the given GValue.
fromGValue :: (IsGValue a, MonadIO m) => GValue -> m a

-- | Create a GValue from the given Haskell value.
toGValue :: (IsGValue a, MonadIO m) => a -> m GValue

-- | Class for types that can be marshaled back and forth between Haskell
--   values and GValues. These are low-level methods, you might want
--   to use toGValue and fromGValue instead for a higher
--   level interface.
class IsGValue a
gvalueGType_ :: IsGValue a => IO GType
gvalueSet_ :: IsGValue a => Ptr GValue -> a -> IO ()
gvalueGet_ :: IsGValue a => Ptr GValue -> IO a

-- | Connect a signal to a signal handler.
on :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId

-- | Connect a signal to a handler, running the handler after the default
--   one.
after :: forall object info m. (GObject object, MonadIO m, SignalInfo info) => object -> SignalProxy object info -> ((?self :: object) => HaskellCallbackType info) -> m SignalHandlerId

-- | Support for overloaded signal connectors.
data SignalProxy object info

-- | A signal connector annotated with a detail.
[:::] :: forall object info. SignalProxy object info -> Text -> SignalProxy object info

-- | A signal connector for the notify signal on the given
--   property.
[PropertyNotify] :: forall info1 (propName :: Symbol) object (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object GObjectNotifySignalInfo

-- | A signal connector for the notify signal on the given
--   property, similar to PropertyNotify, but it passes the new
--   value of the property to the callback for convenience.
[PropertySet] :: forall info1 (propName :: Symbol) object b (pl :: Symbol). (info1 ~ ResolveAttribute propName object, AttrInfo info1, AttrBaseTypeConstraint info1 object, b ~ AttrGetType info1, pl ~ AttrLabel info1, KnownSymbol pl) => AttrLabelProxy propName -> SignalProxy object (GObjectPropertySetSignalInfo b)

-- | Safe coercions to a parent class. For instance:
--   
--   
--   #show $ label `asA` Gtk.Widget
--   
asA :: (ManagedPtrNewtype a, ManagedPtrNewtype b, HasParentTypes b, IsDescendantOf a b) => b -> (ManagedPtr a -> a) -> a
