haskell-gi-0.26.2: Generate Haskell bindings for GObject Introspection capable libraries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.GI.CodeGen.Struct

Description

Marshalling of structs and unions.

Synopsis

Documentation

genStructOrUnionFields :: Name -> [Field] -> CodeGen e () Source #

Generate code for the given list of fields.

genZeroStruct :: Name -> Struct -> CodeGen e () Source #

Specialization for structs of genZeroSU.

genZeroUnion :: Name -> Union -> CodeGen e () Source #

Specialization for unions of genZeroSU.

extractCallbacksInStruct :: (Name, API) -> [(Name, API)] Source #

Extract the callback types embedded in the fields of structs, and at the same time fix the type of the corresponding fields. Returns the list of APIs associated to this struct, not including the struct itself.

fixAPIStructs :: (Name, API) -> (Name, API) Source #

Fix the interface names of callback fields in an APIStruct to correspond to the ones that we are going to generate. If something other than an APIStruct is passed in we don't touch it.

ignoreStruct :: Name -> Struct -> Bool Source #

Whether (not) to generate bindings for the given struct.

genBoxed :: Name -> Text -> CodeGen e () Source #

Allocation and deallocation for types registered as GBoxed in the GLib type system.

genWrappedPtr :: Name -> AllocationInfo -> Int -> CodeGen e () Source #

Generate the typeclass with information for how to allocate/deallocate a given type which is not a GBoxed.