-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate Haskell bindings for GObject Introspection capable libraries -- -- Generate Haskell bindings for GObject Introspection capable libraries. -- This includes most notably Gtk+, but many other libraries in the -- GObject ecosystem provide introspection data too. @package haskell-gi @version 0.22.2 module Data.GI.CodeGen.GType data GType gtypeIsA :: GType -> GType -> Bool gtypeIsBoxed :: GType -> Bool -- | A parser for gtk-doc formatted documentation, see -- https://developer.gnome.org/gtk-doc-manual/ for the spec. module Data.GI.CodeGen.GtkDoc -- | Parse the given gtk-doc formatted documentation. -- --
-- >>> parseGtkDoc "" -- GtkDoc [] ---- --
-- >>> parseGtkDoc "func()" -- GtkDoc [SymbolRef (FunctionRef "func")] ---- --
-- >>> parseGtkDoc "literal" -- GtkDoc [Literal "literal"] ---- --
-- >>> parseGtkDoc "This is a long literal" -- GtkDoc [Literal "This is a long literal"] ---- --
-- >>> parseGtkDoc "Call foo() for free cookies" -- GtkDoc [Literal "Call ",SymbolRef (FunctionRef "foo"),Literal " for free cookies"] ---- --
-- >>> parseGtkDoc "The signal ##%#GtkButton::activate is related to gtk_button_activate()." -- GtkDoc [Literal "The signal ##%",SymbolRef (SignalRef "GtkButton" "activate"),Literal " is related to ",SymbolRef (FunctionRef "gtk_button_activate"),Literal "."] ---- --
-- >>> parseGtkDoc "# A section\n\n## and a subsection ##\n" -- GtkDoc [SectionHeader 1 (GtkDoc [Literal "A section"]),Literal "\n",SectionHeader 2 (GtkDoc [Literal "and a subsection "])] ---- --
-- >>> parseGtkDoc "Compact list:\n- First item\n- Second item" -- GtkDoc [Literal "Compact list:\n",List [ListItem (GtkDoc [Literal "First item"]) [],ListItem (GtkDoc [Literal "Second item"]) []]] ---- --
-- >>> parseGtkDoc "Spaced list:\n\n- First item\n\n- Second item" -- GtkDoc [Literal "Spaced list:\n",List [ListItem (GtkDoc [Literal "First item"]) [],ListItem (GtkDoc [Literal "Second item"]) []]] ---- --
-- >>> parseGtkDoc "List with urls:\n- [test](http://test)\n- "
-- GtkDoc [Literal "List with urls:\n",List [ListItem (GtkDoc [ExternalLink (Link {linkName = "test", linkAddress = "http://test"})]) [],ListItem (GtkDoc [Image (Link {linkName = "", linkAddress = "image.png"})]) []]]
--
parseGtkDoc :: Text -> GtkDoc
-- | A parsed representation of gtk-doc formatted documentation.
newtype GtkDoc
GtkDoc :: [Token] -> GtkDoc
-- | A parsed gtk-doc token.
data Token
Literal :: Text -> Token
Verbatim :: Text -> Token
CodeBlock :: Maybe Language -> Text -> Token
ExternalLink :: Link -> Token
Image :: Link -> Token
List :: [ListItem] -> Token
-- | A section header of the given depth.
SectionHeader :: Int -> GtkDoc -> Token
SymbolRef :: CRef -> Token
-- | The language for an embedded code block.
newtype Language
Language :: Text -> Language
-- | A link to a resource, either offline or a section of the
-- documentation.
data Link
Link :: Text -> Text -> Link
[linkName] :: Link -> Text
[linkAddress] :: Link -> Text
-- | An item in a list, given by a list of lines (not including ending
-- newlines). The list is always non-empty, so we represent it by the
-- first line and then a possibly empty list with the rest of the lines.
data ListItem
ListItem :: GtkDoc -> [GtkDoc] -> ListItem
-- | A reference to some symbol in the API.
data CRef
FunctionRef :: Text -> CRef
ParamRef :: Text -> CRef
ConstantRef :: Text -> CRef
SignalRef :: Text -> Text -> CRef
PropertyRef :: Text -> Text -> CRef
VMethodRef :: Text -> Text -> CRef
StructFieldRef :: Text -> Text -> CRef
TypeRef :: Text -> CRef
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.ListItem
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.ListItem
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.Token
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.Token
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.GtkDoc
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.GtkDoc
instance GHC.Classes.Ord Data.GI.CodeGen.GtkDoc.CRef
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.CRef
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.CRef
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.Language
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.Language
instance GHC.Classes.Eq Data.GI.CodeGen.GtkDoc.Link
instance GHC.Show.Show Data.GI.CodeGen.GtkDoc.Link
module Data.GI.CodeGen.PkgConfig
-- | Get the pkg-config name and associated installed version of a given
-- gobject-introspection namespace. Since the mapping is not one-to-one
-- some guessing is involved, although in most cases the required
-- information is listed in the GIR file.
pkgConfigGetVersion :: Text -> Text -> [Text] -> Bool -> Map Text Text -> IO (Maybe (Text, Text))
-- | Try asking pkg-config for the version of a given module, and return
-- the package name together with its version.
tryPkgConfig :: Text -> IO (Maybe (Text, Text))
-- | Project information to include in generated bindings, should be kept
-- in sync with haskell-gi.cabal
module Data.GI.CodeGen.ProjectInfo
homepage :: Text
authors :: Text
license :: Text
licenseText :: Text -> Text
-- | Under which category in hackage should the generated bindings be
-- listed.
category :: Text
maintainers :: Text
-- | Default list of extensions to turn on when compiling the generated
-- code.
defaultExtensions :: [Text]
-- | Extensions that will be used in some modules, but we do not wish to
-- turn on by default.
otherExtensions :: [Text]
-- | Default options for GHC when compiling generated code.
ghcOptions :: [Text]
-- | Default version of the report to use.
defaultLanguage :: Text
-- | List of dependencies for all bindings. Notice that base is not
-- included here, since not all bindings use the same base version.
-- haskell-gi and haskell-gi-base are not included either, since the
-- versions to use may change depending on whether we are using old style
-- or new style bindings.
standardDeps :: [Text]
module Data.GI.CodeGen.Util
prime :: Text -> Text
parenthesize :: Text -> Text
padTo :: Int -> Text -> Text
withComment :: Text -> Text -> Text
-- | Capitalize the first character of the given string.
ucFirst :: Text -> Text
-- | Make the first character of the given string lowercase.
lcFirst :: Text -> Text
-- | Apply the given modification function to the given symbol. If the
-- symbol is qualified the modification will only apply to the last
-- component.
modifyQualified :: (Text -> Text) -> Text -> Text
-- | Construct the Text representation of a showable.
tshow :: Show a => a -> Text
-- | Throw an error with the given Text.
terror :: Text -> a
-- | Read a file assuming it is UTF-8 encoded. If decoding fails this calls
-- error.
utf8ReadFile :: FilePath -> IO Text
-- | Write the given Text into an UTF-8 encoded file.
utf8WriteFile :: FilePath -> Text -> IO ()
-- | Split a list into sublists delimited by the given element.
splitOn :: Eq a => a -> [a] -> [[a]]
-- | Abstract representation for paths into modules.
module Data.GI.CodeGen.ModulePath
-- | A path to a module.
newtype ModulePath
ModulePath :: [Text] -> ModulePath
[modulePathToList] :: ModulePath -> [Text]
-- | Construct a path into the given GIR namespace. The given Text
-- will be split along ".".
--
-- -- >>> dotModulePath (toModulePath "Foo") -- "Foo" ---- --
-- >>> dotModulePath ("Foo" <> toModulePath "Bar.Baz")
-- "Foo.Bar.Baz"
--
--
--
-- >>> dotModulePath ("Foo" <> toModulePath "bar.baz")
-- "Foo.Bar.Baz"
--
toModulePath :: Text -> ModulePath
-- | Append the given component to the given module path.
--
--
-- >>> dotModulePath ("Foo" /. "Bar")
-- "Foo.Bar"
--
(/.) :: ModulePath -> Text -> ModulePath
-- | Turn a module path into the corresponding dotted string. Note that the
-- implementation ensures that the module names start with a capital
-- letter.
--
--
-- >>> dotModulePath ("Foo" /. "Bar" /. "Baz")
-- "Foo.Bar.Baz"
--
--
--
-- >>> dotModulePath ("foo" /. "bar" /. "baz")
-- "Foo.Bar.Baz"
--
dotModulePath :: ModulePath -> Text
instance GHC.Classes.Ord Data.GI.CodeGen.ModulePath.ModulePath
instance GHC.Show.Show Data.GI.CodeGen.ModulePath.ModulePath
instance GHC.Classes.Eq Data.GI.CodeGen.ModulePath.ModulePath
instance GHC.Base.Monoid Data.GI.CodeGen.ModulePath.ModulePath
instance GHC.Base.Semigroup Data.GI.CodeGen.ModulePath.ModulePath
instance Data.String.IsString Data.GI.CodeGen.ModulePath.ModulePath
-- | A minimal wrapper for libgirepository.
module Data.GI.CodeGen.LibGIRepository
-- | Ensure that the given version of the namespace is loaded. If that is
-- not possible we error out.
girRequire :: Text -> Text -> IO Typelib
-- | A convenience function for setting up the typelib search path from the
-- environment. Note that for efficiency reasons this should only be
-- called once per program run. If the list of paths passed in is empty,
-- the environment variable HASKELL_GI_TYPELIB_SEARCH_PATH will
-- be checked. In either case the system directories will be searched
-- after the passed in directories.
setupTypelibSearchPath :: [FilePath] -> IO ()
-- | Extra info about a field in a struct or union which is not easily
-- determined from the GIR file. (And which we determine by using
-- libgirepository.)
data FieldInfo
FieldInfo :: Int -> FieldInfo
[fieldInfoOffset] :: FieldInfo -> Int
-- | Find out the size of a struct, and the map from field names to offsets
-- inside the struct.
girStructFieldInfo :: Text -> Text -> IO (Int, Map Text FieldInfo)
-- | Find out the size of a union, and the map from field names to offsets
-- inside the union.
girUnionFieldInfo :: Text -> Text -> IO (Int, Map Text FieldInfo)
-- | Load a GType given the namespace where it lives and the type init
-- function.
girLoadGType :: Text -> Text -> IO GType
instance Data.GI.Base.BasicTypes.BoxedObject Data.GI.CodeGen.LibGIRepository.BaseInfo
-- | Information on explicit allocation/deallocation for foreign pointers.
module Data.GI.GIR.Allocation
-- | Allocation/deallocation information for a given foreign pointer.
data AllocationInfo
AllocationInfo :: AllocationOp -> AllocationOp -> AllocationOp -> AllocationInfo
[allocCalloc] :: AllocationInfo -> AllocationOp
[allocCopy] :: AllocationInfo -> AllocationOp
[allocFree] :: AllocationInfo -> AllocationOp
-- | Information about a given allocation operation. It is either
-- disallowed, allowed via the given function, or it is unknown at the
-- current stage how to perform the operation.
data AllocationOp
AllocationOpUnknown :: AllocationOp
AllocationOp :: Text -> AllocationOp
-- | A convenience function, filling in all the allocation info to unknown.
unknownAllocationInfo :: AllocationInfo
instance GHC.Show.Show Data.GI.GIR.Allocation.AllocationInfo
instance GHC.Classes.Eq Data.GI.GIR.Allocation.AllocationOp
instance GHC.Show.Show Data.GI.GIR.Allocation.AllocationOp
-- | Basic types used in GIR parsing.
module Data.GI.GIR.BasicTypes
-- | Name for a symbol in the GIR file.
data Name
Name :: Text -> Text -> Name
[namespace] :: Name -> Text
[name] :: Name -> Text
-- | Transfer mode for an argument or property.
data Transfer
TransferNothing :: Transfer
TransferContainer :: Transfer
TransferEverything :: Transfer
-- | An alias, which is simply (Namespace, name).
newtype Alias
Alias :: Name -> Alias
-- | This type represents the types found in GObject Introspection
-- interfaces: the types of constants, arguments, etc.
data Type
TBasicType :: BasicType -> Type
-- | GError
TError :: Type
-- | GVariant
TVariant :: Type
-- | GParamSpec
TParamSpec :: Type
-- | Zero terminated, Array Fixed Size, Array Length, Element Type
TCArray :: Bool -> Int -> Int -> Type -> Type
-- | GArray
TGArray :: Type -> Type
-- | GPtrArray
TPtrArray :: Type -> Type
-- | GByteArray
TByteArray :: Type
-- | GList
TGList :: Type -> Type
-- | GSList
TGSList :: Type -> Type
-- | GHashTable
TGHash :: Type -> Type -> Type
-- | GClosure containing the given API (if known)
TGClosure :: Maybe Type -> Type
-- | A reference to some API in the GIR
TInterface :: Name -> Type
-- | Basic types. These are generally trivial to marshal, and the GIR
-- assumes that they are defined.
data BasicType
-- | gboolean
TBoolean :: BasicType
-- | gint
TInt :: BasicType
-- | guint
TUInt :: BasicType
-- | glong
TLong :: BasicType
-- | gulong
TULong :: BasicType
-- | gint8
TInt8 :: BasicType
-- | guint8
TUInt8 :: BasicType
-- | gint16
TInt16 :: BasicType
-- | guint16
TUInt16 :: BasicType
-- | gint32
TInt32 :: BasicType
-- | guint32
TUInt32 :: BasicType
-- | gint64
TInt64 :: BasicType
-- | guint64
TUInt64 :: BasicType
-- | gfloat
TFloat :: BasicType
-- | gdouble
TDouble :: BasicType
-- | gunichar
TUniChar :: BasicType
-- | GType
TGType :: BasicType
-- | gchar*, encoded as UTF-8
TUTF8 :: BasicType
-- | gchar*, encoding a filename
TFileName :: BasicType
-- | gpointer
TPtr :: BasicType
-- | gintptr
TIntPtr :: BasicType
-- | guintptr
TUIntPtr :: BasicType
instance GHC.Classes.Ord Data.GI.GIR.BasicTypes.Type
instance GHC.Show.Show Data.GI.GIR.BasicTypes.Type
instance GHC.Classes.Eq Data.GI.GIR.BasicTypes.Type
instance GHC.Classes.Ord Data.GI.GIR.BasicTypes.BasicType
instance GHC.Show.Show Data.GI.GIR.BasicTypes.BasicType
instance GHC.Classes.Eq Data.GI.GIR.BasicTypes.BasicType
instance GHC.Show.Show Data.GI.GIR.BasicTypes.Alias
instance GHC.Classes.Eq Data.GI.GIR.BasicTypes.Alias
instance GHC.Classes.Ord Data.GI.GIR.BasicTypes.Alias
instance GHC.Classes.Ord Data.GI.GIR.BasicTypes.Transfer
instance GHC.Classes.Eq Data.GI.GIR.BasicTypes.Transfer
instance GHC.Show.Show Data.GI.GIR.BasicTypes.Transfer
instance GHC.Show.Show Data.GI.GIR.BasicTypes.Name
instance GHC.Classes.Ord Data.GI.GIR.BasicTypes.Name
instance GHC.Classes.Eq Data.GI.GIR.BasicTypes.Name
-- | An abstraction for representing type constructors. This is a very
-- simplified version of Typeable, which we don't use directly to
-- avoid compatibility headaches.
module Data.GI.CodeGen.Type
-- | This type represents the types found in GObject Introspection
-- interfaces: the types of constants, arguments, etc.
data Type
TBasicType :: BasicType -> Type
-- | GError
TError :: Type
-- | GVariant
TVariant :: Type
-- | GParamSpec
TParamSpec :: Type
-- | Zero terminated, Array Fixed Size, Array Length, Element Type
TCArray :: Bool -> Int -> Int -> Type -> Type
-- | GArray
TGArray :: Type -> Type
-- | GPtrArray
TPtrArray :: Type -> Type
-- | GByteArray
TByteArray :: Type
-- | GList
TGList :: Type -> Type
-- | GSList
TGSList :: Type -> Type
-- | GHashTable
TGHash :: Type -> Type -> Type
-- | GClosure containing the given API (if known)
TGClosure :: Maybe Type -> Type
-- | A reference to some API in the GIR
TInterface :: Name -> Type
-- | Basic types. These are generally trivial to marshal, and the GIR
-- assumes that they are defined.
data BasicType
-- | gboolean
TBoolean :: BasicType
-- | gint
TInt :: BasicType
-- | guint
TUInt :: BasicType
-- | glong
TLong :: BasicType
-- | gulong
TULong :: BasicType
-- | gint8
TInt8 :: BasicType
-- | guint8
TUInt8 :: BasicType
-- | gint16
TInt16 :: BasicType
-- | guint16
TUInt16 :: BasicType
-- | gint32
TInt32 :: BasicType
-- | guint32
TUInt32 :: BasicType
-- | gint64
TInt64 :: BasicType
-- | guint64
TUInt64 :: BasicType
-- | gfloat
TFloat :: BasicType
-- | gdouble
TDouble :: BasicType
-- | gunichar
TUniChar :: BasicType
-- | GType
TGType :: BasicType
-- | gchar*, encoded as UTF-8
TUTF8 :: BasicType
-- | gchar*, encoding a filename
TFileName :: BasicType
-- | gpointer
TPtr :: BasicType
-- | gintptr
TIntPtr :: BasicType
-- | guintptr
TUIntPtr :: BasicType
-- | A fully applied type.
data TypeRep
-- | Type constructor applied to the given types.
con :: Text -> [TypeRep] -> TypeRep
-- | A shorthand for a type constructor taking no arguments.
con0 :: Text -> TypeRep
-- | Give a valid Haskell source representation of the given
-- TypeRep.
typeShow :: TypeRep -> Text
-- | Return a textual representation of the type constructor for the given
-- TypeRep.
typeConName :: TypeRep -> Text
-- | Embed in the IO monad.
io :: TypeRep -> TypeRep
-- | A Ptr to the type.
ptr :: TypeRep -> TypeRep
-- | A FunPtr to the type.
funptr :: TypeRep -> TypeRep
-- | Embed in the Maybe monad.
maybeT :: TypeRep -> TypeRep
instance GHC.Classes.Eq Data.GI.CodeGen.Type.TypeRep
instance GHC.Classes.Eq Data.GI.CodeGen.Type.TypeCon
module Data.GI.GIR.Repository
-- | Try to load the `.gir` file corresponding to the given repository
readGiRepository :: Bool -> Text -> Maybe Text -> [FilePath] -> IO Document
-- | Some helpers for making traversals of GIR documents easier.
module Data.GI.GIR.XMLUtils
-- | Turn a node into an element (if it is indeed an element node).
nodeToElement :: Node -> Maybe Element
-- | Find all children of the given element which are XML Elements
-- themselves.
subelements :: Element -> [Element]
-- | The local name of an element.
localName :: Element -> Text
-- | Lookup an attribute for an element (with no prefix).
lookupAttr :: Name -> Element -> Maybe Text
-- | GIR namespaces we know about.
data GIRXMLNamespace
GLibGIRNS :: GIRXMLNamespace
CGIRNS :: GIRXMLNamespace
CoreGIRNS :: GIRXMLNamespace
-- | Lookup an attribute for an element, given the namespace where it
-- lives.
lookupAttrWithNamespace :: GIRXMLNamespace -> Name -> Element -> Maybe Text
-- | Restrict to those with the given local name.
childElemsWithLocalName :: Text -> Element -> [Element]
-- | Restrict to those with given name.
childElemsWithNSName :: GIRXMLNamespace -> Text -> Element -> [Element]
-- | Find the first child element with the given name.
firstChildWithLocalName :: Text -> Element -> Maybe Element
-- | Get the content of a given element, if it exists.
getElementContent :: Element -> Maybe Text
-- | Construct a Name by only giving the local name.
xmlLocalName :: Text -> Name
-- | Construct a Name specifying a namespace too.
xmlNSName :: GIRXMLNamespace -> Text -> Name
instance GHC.Show.Show Data.GI.GIR.XMLUtils.GIRXMLNamespace
-- | Parsing of documentation nodes.
module Data.GI.GIR.Documentation
-- | Documentation for a given element. The documentation text is typically
-- encoded in the gtk-doc format, see
-- https://developer.gnome.org/gtk-doc-manual/ . This can be
-- parsed with parseGtkDoc.
data Documentation
Documentation :: Maybe Text -> Maybe Text -> Documentation
[rawDocText] :: Documentation -> Maybe Text
[sinceVersion] :: Documentation -> Maybe Text
-- | Parse the documentation node for the given element of the GIR file.
queryDocumentation :: Element -> Documentation
instance GHC.Classes.Ord Data.GI.GIR.Documentation.Documentation
instance GHC.Classes.Eq Data.GI.GIR.Documentation.Documentation
instance GHC.Show.Show Data.GI.GIR.Documentation.Documentation
module Data.GI.GIR.Deprecation
-- | Deprecation information on a symbol.
data DeprecationInfo
DeprecationInfo :: Maybe Text -> Maybe Text -> DeprecationInfo
[deprecatedSinceVersion] :: DeprecationInfo -> Maybe Text
[deprecationMessage] :: DeprecationInfo -> Maybe Text
-- | Parse the deprecation information for the given element of the GIR
-- file.
queryDeprecated :: Element -> Maybe DeprecationInfo
instance GHC.Classes.Eq Data.GI.GIR.Deprecation.DeprecationInfo
instance GHC.Show.Show Data.GI.GIR.Deprecation.DeprecationInfo
-- | The Parser monad.
module Data.GI.GIR.Parser
-- | Monad where parsers live: we carry a context around, and can throw
-- errors that abort the parsing.
type Parser a = ReaderT ParseContext (Except ParseError) a
-- | A message describing a parsing error in human readable form.
type ParseError = Text
-- | Throw a parse error.
parseError :: ParseError -> Parser a
-- | Run the given parser, returning either success or an error.
runParser :: Text -> Map Alias Type -> Element -> Parser a -> Either ParseError a
-- | Get the qualified name for the current element.
parseName :: Parser Name
-- | Parse the deprecation text, if present.
parseDeprecation :: Parser (Maybe DeprecationInfo)
-- | Parse the documentation info for the current node.
parseDocumentation :: Parser Documentation
-- | Parse a signed integral number.
parseIntegral :: Integral a => Text -> Parser a
-- | A boolean value given by a numerical constant.
parseBool :: Text -> Parser Bool
-- | Parse all the introspectable subelements with the given local name.
parseChildrenWithLocalName :: Text -> Parser a -> Parser [a]
-- | Parse all subelements with the given local name.
parseAllChildrenWithLocalName :: Text -> Parser a -> Parser [a]
-- | Parse all introspectable children with the given namespace and local
-- name.
parseChildrenWithNSName :: GIRXMLNamespace -> Text -> Parser a -> Parser [a]
-- | Return the value of an attribute for the given element. If the
-- attribute is not present this throws an error.
getAttr :: Name -> Parser Text
-- | Like getAttr, but allow for specifying the namespace.
getAttrWithNamespace :: GIRXMLNamespace -> Name -> Parser Text
-- | Return the value of an attribute if it is present, and Nothing
-- otherwise.
queryAttr :: Name -> Parser (Maybe Text)
-- | Like queryAttr, but allow for specifying the namespace.
queryAttrWithNamespace :: GIRXMLNamespace -> Name -> Parser (Maybe Text)
-- | Ask for an optional attribute, applying the given parser to it. If the
-- argument does not exist return the default value provided.
optionalAttr :: Name -> a -> (Text -> Parser a) -> Parser a
-- | Return the current namespace.
currentNamespace :: Parser Text
-- | Build a Name out of the (possibly qualified) supplied name. If
-- the supplied name is unqualified we qualify with the current
-- namespace, and otherwise we simply parse it.
qualifyName :: Text -> Parser Name
-- | Check whether there is an alias for the given name, and return the
-- corresponding type in case it exists, and otherwise a TInterface.
resolveQualifiedTypeName :: Name -> Parser Type
-- | Name for a symbol in the GIR file.
data Name
Name :: Text -> Text -> Name
[namespace] :: Name -> Text
[name] :: Name -> Text
data Element
-- | GIR namespaces we know about.
data GIRXMLNamespace
GLibGIRNS :: GIRXMLNamespace
CGIRNS :: GIRXMLNamespace
CoreGIRNS :: GIRXMLNamespace
-- | Deprecation information on a symbol.
data DeprecationInfo
-- | Documentation for a given element. The documentation text is typically
-- encoded in the gtk-doc format, see
-- https://developer.gnome.org/gtk-doc-manual/ . This can be
-- parsed with parseGtkDoc.
data Documentation
instance GHC.Show.Show Data.GI.GIR.Parser.ParseContext
-- | Parsing type information from GIR files.
module Data.GI.GIR.Type
-- | Parse the type of a node (which will be described by a child node
-- named "type" or "array").
parseType :: Parser Type
-- | Find the C name for the current element.
queryCType :: Parser (Maybe Text)
-- | Parse the C type for the current node.
parseCType :: Parser Text
-- | Parse the C-type associated to the element, if found.
queryElementCType :: Parser (Maybe Text)
-- | Like parseType, but allow for none, returned as
-- Nothing.
parseOptionalType :: Parser (Maybe Type)
-- | Parsing of Enums.
module Data.GI.GIR.Enum
data Enumeration
Enumeration :: [EnumerationMember] -> Maybe Text -> Maybe Text -> Documentation -> Text -> Int -> Maybe DeprecationInfo -> Enumeration
[enumMembers] :: Enumeration -> [EnumerationMember]
[enumErrorDomain] :: Enumeration -> Maybe Text
[enumTypeInit] :: Enumeration -> Maybe Text
[enumDocumentation] :: Enumeration -> Documentation
[enumCType] :: Enumeration -> Text
-- | Bytes used for storage of this struct.
[enumStorageBytes] :: Enumeration -> Int
[enumDeprecated] :: Enumeration -> Maybe DeprecationInfo
-- | Member of an enumeration.
data EnumerationMember
EnumerationMember :: Text -> Int64 -> Text -> Documentation -> EnumerationMember
[enumMemberName] :: EnumerationMember -> Text
[enumMemberValue] :: EnumerationMember -> Int64
[enumMemberCId] :: EnumerationMember -> Text
[enumMemberDoc] :: EnumerationMember -> Documentation
-- | Parse an "enumeration" element from the GIR file.
parseEnum :: Parser (Name, Enumeration)
instance GHC.Show.Show Data.GI.GIR.Enum.Enumeration
instance GHC.Show.Show Data.GI.GIR.Enum.EnumerationMember
-- | Parsing of bitfields, a.k.a. flags. They are represented in the same
-- way as enums, so this is a thin wrapper over that code.
module Data.GI.GIR.Flags
data Flags
Flags :: Enumeration -> Flags
parseFlags :: Parser (Name, Flags)
instance GHC.Show.Show Data.GI.GIR.Flags.Flags
-- | Parsing of constants in GIR files.
module Data.GI.GIR.Constant
-- | Info about a constant.
data Constant
Constant :: Type -> Text -> Text -> Documentation -> Maybe DeprecationInfo -> Constant
[constantType] :: Constant -> Type
[constantValue] :: Constant -> Text
[constantCType] :: Constant -> Text
[constantDocumentation] :: Constant -> Documentation
[constantDeprecated] :: Constant -> Maybe DeprecationInfo
-- | Parse a "constant" element from the GIR file.
parseConstant :: Parser (Name, Constant)
instance GHC.Show.Show Data.GI.GIR.Constant.Constant
module Data.GI.GIR.Arg
data Arg
Arg :: Text -> Type -> Direction -> Bool -> Documentation -> Scope -> Int -> Int -> Bool -> Transfer -> Arg
-- | C name for the argument. For a escaped name valid in Haskell
-- code, use escapedArgName.
[argCName] :: Arg -> Text
[argType] :: Arg -> Type
[direction] :: Arg -> Direction
[mayBeNull] :: Arg -> Bool
[argDoc] :: Arg -> Documentation
[argScope] :: Arg -> Scope
[argClosure] :: Arg -> Int
[argDestroy] :: Arg -> Int
[argCallerAllocates] :: Arg -> Bool
[transfer] :: Arg -> Transfer
data Direction
DirectionIn :: Direction
DirectionOut :: Direction
DirectionInout :: Direction
data Scope
ScopeTypeInvalid :: Scope
ScopeTypeCall :: Scope
ScopeTypeAsync :: Scope
ScopeTypeNotified :: Scope
parseArg :: Parser Arg
parseTransfer :: Parser Transfer
instance GHC.Classes.Ord Data.GI.GIR.Arg.Arg
instance GHC.Classes.Eq Data.GI.GIR.Arg.Arg
instance GHC.Show.Show Data.GI.GIR.Arg.Arg
instance GHC.Classes.Ord Data.GI.GIR.Arg.Scope
instance GHC.Classes.Eq Data.GI.GIR.Arg.Scope
instance GHC.Show.Show Data.GI.GIR.Arg.Scope
instance GHC.Classes.Ord Data.GI.GIR.Arg.Direction
instance GHC.Classes.Eq Data.GI.GIR.Arg.Direction
instance GHC.Show.Show Data.GI.GIR.Arg.Direction
module Data.GI.GIR.Property
data Property
Property :: Text -> Type -> [PropertyFlag] -> Maybe Bool -> Maybe Bool -> Transfer -> Documentation -> Maybe DeprecationInfo -> Property
[propName] :: Property -> Text
[propType] :: Property -> Type
[propFlags] :: Property -> [PropertyFlag]
[propReadNullable] :: Property -> Maybe Bool
[propWriteNullable] :: Property -> Maybe Bool
[propTransfer] :: Property -> Transfer
[propDoc] :: Property -> Documentation
[propDeprecated] :: Property -> Maybe DeprecationInfo
data PropertyFlag
PropertyReadable :: PropertyFlag
PropertyWritable :: PropertyFlag
PropertyConstruct :: PropertyFlag
PropertyConstructOnly :: PropertyFlag
parseProperty :: Parser Property
instance GHC.Classes.Eq Data.GI.GIR.Property.Property
instance GHC.Show.Show Data.GI.GIR.Property.Property
instance GHC.Classes.Eq Data.GI.GIR.Property.PropertyFlag
instance GHC.Show.Show Data.GI.GIR.Property.PropertyFlag
module Data.GI.GIR.Callable
data Callable
Callable :: Maybe Type -> Bool -> Transfer -> Documentation -> [Arg] -> Bool -> Bool -> Maybe DeprecationInfo -> Documentation -> Callable
[returnType] :: Callable -> Maybe Type
[returnMayBeNull] :: Callable -> Bool
[returnTransfer] :: Callable -> Transfer
[returnDocumentation] :: Callable -> Documentation
[args] :: Callable -> [Arg]
[skipReturn] :: Callable -> Bool
[callableThrows] :: Callable -> Bool
[callableDeprecated] :: Callable -> Maybe DeprecationInfo
[callableDocumentation] :: Callable -> Documentation
parseCallable :: Parser Callable
instance GHC.Classes.Eq Data.GI.GIR.Callable.Callable
instance GHC.Show.Show Data.GI.GIR.Callable.Callable
module Data.GI.GIR.Signal
data Signal
Signal :: Text -> Callable -> Maybe DeprecationInfo -> Documentation -> Signal
[sigName] :: Signal -> Text
[sigCallable] :: Signal -> Callable
[sigDeprecated] :: Signal -> Maybe DeprecationInfo
[sigDoc] :: Signal -> Documentation
parseSignal :: Parser Signal
instance GHC.Classes.Eq Data.GI.GIR.Signal.Signal
instance GHC.Show.Show Data.GI.GIR.Signal.Signal
module Data.GI.GIR.Method
data Method
Method :: Name -> Text -> MethodType -> Maybe Text -> Callable -> Method
[methodName] :: Method -> Name
[methodSymbol] :: Method -> Text
[methodType] :: Method -> MethodType
[methodMovedTo] :: Method -> Maybe Text
[methodCallable] :: Method -> Callable
data MethodType
-- | Constructs an instance of the parent type
Constructor :: MethodType
-- | A function in the namespace
MemberFunction :: MethodType
-- | A function taking the parent instance as first argument.
OrdinaryMethod :: MethodType
parseMethod :: MethodType -> Parser Method
instance GHC.Show.Show Data.GI.GIR.Method.Method
instance GHC.Classes.Eq Data.GI.GIR.Method.Method
instance GHC.Show.Show Data.GI.GIR.Method.MethodType
instance GHC.Classes.Eq Data.GI.GIR.Method.MethodType
-- | Parsing of objects.
module Data.GI.GIR.Object
data Object
Object :: Maybe Name -> Text -> Text -> Maybe Text -> [Name] -> Maybe DeprecationInfo -> Documentation -> [Method] -> [Property] -> [Signal] -> Object
[objParent] :: Object -> Maybe Name
[objTypeInit] :: Object -> Text
[objTypeName] :: Object -> Text
[objCType] :: Object -> Maybe Text
[objInterfaces] :: Object -> [Name]
[objDeprecated] :: Object -> Maybe DeprecationInfo
[objDocumentation] :: Object -> Documentation
[objMethods] :: Object -> [Method]
[objProperties] :: Object -> [Property]
[objSignals] :: Object -> [Signal]
parseObject :: Parser (Name, Object)
instance GHC.Show.Show Data.GI.GIR.Object.Object
module Data.GI.GIR.Interface
data Interface
Interface :: Maybe Text -> Maybe Text -> Documentation -> [Name] -> [Property] -> [Signal] -> [Method] -> AllocationInfo -> Maybe DeprecationInfo -> Interface
[ifTypeInit] :: Interface -> Maybe Text
[ifCType] :: Interface -> Maybe Text
[ifDocumentation] :: Interface -> Documentation
[ifPrerequisites] :: Interface -> [Name]
[ifProperties] :: Interface -> [Property]
[ifSignals] :: Interface -> [Signal]
[ifMethods] :: Interface -> [Method]
[ifAllocationInfo] :: Interface -> AllocationInfo
[ifDeprecated] :: Interface -> Maybe DeprecationInfo
parseInterface :: Parser (Name, Interface)
instance GHC.Show.Show Data.GI.GIR.Interface.Interface
module Data.GI.GIR.Function
data Function
Function :: Text -> Maybe Text -> Callable -> Function
[fnSymbol] :: Function -> Text
[fnMovedTo] :: Function -> Maybe Text
[fnCallable] :: Function -> Callable
parseFunction :: Parser (Name, Function)
instance GHC.Show.Show Data.GI.GIR.Function.Function
-- | Parsing of callbacks.
module Data.GI.GIR.Callback
data Callback
Callback :: Callable -> Maybe Text -> Documentation -> Callback
[cbCallable] :: Callback -> Callable
[cbCType] :: Callback -> Maybe Text
[cbDocumentation] :: Callback -> Documentation
parseCallback :: Parser (Name, Callback)
instance GHC.Show.Show Data.GI.GIR.Callback.Callback
-- | Parsing of objectstructunion fields.
module Data.GI.GIR.Field
data Field
Field :: Text -> Bool -> Type -> Maybe Bool -> Maybe Callback -> Int -> [FieldInfoFlag] -> Documentation -> Maybe DeprecationInfo -> Field
[fieldName] :: Field -> Text
[fieldVisible] :: Field -> Bool
[fieldType] :: Field -> Type
-- | Nothing if not known.
[fieldIsPointer] :: Field -> Maybe Bool
[fieldCallback] :: Field -> Maybe Callback
[fieldOffset] :: Field -> Int
[fieldFlags] :: Field -> [FieldInfoFlag]
[fieldDocumentation] :: Field -> Documentation
[fieldDeprecated] :: Field -> Maybe DeprecationInfo
data FieldInfoFlag
parseFields :: Parser [Field]
instance GHC.Show.Show Data.GI.GIR.Field.Field
instance GHC.Show.Show Data.GI.GIR.Field.FieldInfoFlag
-- | Parsing of unions.
module Data.GI.GIR.Union
data Union
Union :: Bool -> AllocationInfo -> Documentation -> Int -> Maybe Text -> [Field] -> [Method] -> Maybe Text -> Maybe DeprecationInfo -> Union
[unionIsBoxed] :: Union -> Bool
[unionAllocationInfo] :: Union -> AllocationInfo
[unionDocumentation] :: Union -> Documentation
[unionSize] :: Union -> Int
[unionTypeInit] :: Union -> Maybe Text
[unionFields] :: Union -> [Field]
[unionMethods] :: Union -> [Method]
[unionCType] :: Union -> Maybe Text
[unionDeprecated] :: Union -> Maybe DeprecationInfo
parseUnion :: Parser (Name, Union)
instance GHC.Show.Show Data.GI.GIR.Union.Union
-- | Parsing of structs.
module Data.GI.GIR.Struct
data Struct
Struct :: Bool -> AllocationInfo -> Maybe Text -> Maybe Text -> Int -> Maybe Name -> Bool -> [Field] -> [Method] -> Maybe DeprecationInfo -> Documentation -> Struct
[structIsBoxed] :: Struct -> Bool
[structAllocationInfo] :: Struct -> AllocationInfo
[structTypeInit] :: Struct -> Maybe Text
[structCType] :: Struct -> Maybe Text
[structSize] :: Struct -> Int
[gtypeStructFor] :: Struct -> Maybe Name
[structIsDisguised] :: Struct -> Bool
[structFields] :: Struct -> [Field]
[structMethods] :: Struct -> [Method]
[structDeprecated] :: Struct -> Maybe DeprecationInfo
[structDocumentation] :: Struct -> Documentation
parseStruct :: Parser (Name, Struct)
instance GHC.Show.Show Data.GI.GIR.Struct.Struct
module Data.GI.GIR.Alias
-- | Find all aliases in a given document.
documentListAliases :: Document -> Map Alias Type
module Data.GI.CodeGen.API
data API
APIConst :: Constant -> API
APIFunction :: Function -> API
APICallback :: Callback -> API
APIEnum :: Enumeration -> API
APIFlags :: Flags -> API
APIInterface :: Interface -> API
APIObject :: Object -> API
APIStruct :: Struct -> API
APIUnion :: Union -> API
data GIRInfo
GIRInfo :: [Text] -> Text -> Text -> [(Name, API)] -> Map Text Name -> GIRInfo
[girPCPackages] :: GIRInfo -> [Text]
[girNSName] :: GIRInfo -> Text
[girNSVersion] :: GIRInfo -> Text
[girAPIs] :: GIRInfo -> [(Name, API)]
[girCTypes] :: GIRInfo -> Map Text Name
-- | Load and parse a GIR file, including its dependencies.
loadGIRInfo :: Bool -> Text -> Maybe Text -> [FilePath] -> [GIRRule] -> IO (GIRInfo, [GIRInfo])
-- | Bare minimum loading and parsing of a single repository, without
-- loading or parsing its dependencies, resolving aliases, or fixing up
-- structs or interfaces.
loadRawGIRInfo :: Bool -> Text -> Maybe Text -> [FilePath] -> IO GIRInfo
-- | A rule for modifying the GIR file.
data GIRRule
-- | (Path to element, attrName), newValue.
GIRSetAttr :: (GIRPath, Name) -> Text -> GIRRule
-- | Add a child node at the given selector.
GIRAddNode :: GIRPath -> Name -> GIRRule
-- | Delete any nodes matching the given selector.
GIRDeleteNode :: GIRPath -> GIRRule
-- | Path to a node in the GIR file, starting from the document root of the
-- GIR file. This is a very simplified version of something like XPath.
type GIRPath = [GIRNodeSpec]
-- | Node selector for a path in the GIR file.
data GIRNodeSpec
-- | Node with the given "name" attr.
GIRNamed :: GIRNameTag -> GIRNodeSpec
-- | Node of the given type.
GIRType :: Text -> GIRNodeSpec
-- | Combination of the above.
GIRTypedName :: Text -> GIRNameTag -> GIRNodeSpec
-- | A name tag, which is either a name or a regular expression.
data GIRNameTag
GIRPlainName :: Text -> GIRNameTag
GIRRegex :: Text -> GIRNameTag
-- | Name for a symbol in the GIR file.
data Name
Name :: Text -> Text -> Name
[namespace] :: Name -> Text
[name] :: Name -> Text
-- | Transfer mode for an argument or property.
data Transfer
TransferNothing :: Transfer
TransferContainer :: Transfer
TransferEverything :: Transfer
-- | Allocation/deallocation information for a given foreign pointer.
data AllocationInfo
AllocationInfo :: AllocationOp -> AllocationOp -> AllocationOp -> AllocationInfo
[allocCalloc] :: AllocationInfo -> AllocationOp
[allocCopy] :: AllocationInfo -> AllocationOp
[allocFree] :: AllocationInfo -> AllocationOp
-- | Information about a given allocation operation. It is either
-- disallowed, allowed via the given function, or it is unknown at the
-- current stage how to perform the operation.
data AllocationOp
AllocationOpUnknown :: AllocationOp
AllocationOp :: Text -> AllocationOp
-- | A convenience function, filling in all the allocation info to unknown.
unknownAllocationInfo :: AllocationInfo
data Direction
DirectionIn :: Direction
DirectionOut :: Direction
DirectionInout :: Direction
data Scope
ScopeTypeInvalid :: Scope
ScopeTypeCall :: Scope
ScopeTypeAsync :: Scope
ScopeTypeNotified :: Scope
-- | Deprecation information on a symbol.
data DeprecationInfo
-- | Member of an enumeration.
data EnumerationMember
EnumerationMember :: Text -> Int64 -> Text -> Documentation -> EnumerationMember
[enumMemberName] :: EnumerationMember -> Text
[enumMemberValue] :: EnumerationMember -> Int64
[enumMemberCId] :: EnumerationMember -> Text
[enumMemberDoc] :: EnumerationMember -> Documentation
data PropertyFlag
PropertyReadable :: PropertyFlag
PropertyWritable :: PropertyFlag
PropertyConstruct :: PropertyFlag
PropertyConstructOnly :: PropertyFlag
data MethodType
-- | Constructs an instance of the parent type
Constructor :: MethodType
-- | A function in the namespace
MemberFunction :: MethodType
-- | A function taking the parent instance as first argument.
OrdinaryMethod :: MethodType
-- | Info about a constant.
data Constant
Constant :: Type -> Text -> Text -> Documentation -> Maybe DeprecationInfo -> Constant
[constantType] :: Constant -> Type
[constantValue] :: Constant -> Text
[constantCType] :: Constant -> Text
[constantDocumentation] :: Constant -> Documentation
[constantDeprecated] :: Constant -> Maybe DeprecationInfo
data Arg
Arg :: Text -> Type -> Direction -> Bool -> Documentation -> Scope -> Int -> Int -> Bool -> Transfer -> Arg
-- | C name for the argument. For a escaped name valid in Haskell
-- code, use escapedArgName.
[argCName] :: Arg -> Text
[argType] :: Arg -> Type
[direction] :: Arg -> Direction
[mayBeNull] :: Arg -> Bool
[argDoc] :: Arg -> Documentation
[argScope] :: Arg -> Scope
[argClosure] :: Arg -> Int
[argDestroy] :: Arg -> Int
[argCallerAllocates] :: Arg -> Bool
[transfer] :: Arg -> Transfer
data Callable
Callable :: Maybe Type -> Bool -> Transfer -> Documentation -> [Arg] -> Bool -> Bool -> Maybe DeprecationInfo -> Documentation -> Callable
[returnType] :: Callable -> Maybe Type
[returnMayBeNull] :: Callable -> Bool
[returnTransfer] :: Callable -> Transfer
[returnDocumentation] :: Callable -> Documentation
[args] :: Callable -> [Arg]
[skipReturn] :: Callable -> Bool
[callableThrows] :: Callable -> Bool
[callableDeprecated] :: Callable -> Maybe DeprecationInfo
[callableDocumentation] :: Callable -> Documentation
data Function
Function :: Text -> Maybe Text -> Callable -> Function
[fnSymbol] :: Function -> Text
[fnMovedTo] :: Function -> Maybe Text
[fnCallable] :: Function -> Callable
data Signal
Signal :: Text -> Callable -> Maybe DeprecationInfo -> Documentation -> Signal
[sigName] :: Signal -> Text
[sigCallable] :: Signal -> Callable
[sigDeprecated] :: Signal -> Maybe DeprecationInfo
[sigDoc] :: Signal -> Documentation
data Property
Property :: Text -> Type -> [PropertyFlag] -> Maybe Bool -> Maybe Bool -> Transfer -> Documentation -> Maybe DeprecationInfo -> Property
[propName] :: Property -> Text
[propType] :: Property -> Type
[propFlags] :: Property -> [PropertyFlag]
[propReadNullable] :: Property -> Maybe Bool
[propWriteNullable] :: Property -> Maybe Bool
[propTransfer] :: Property -> Transfer
[propDoc] :: Property -> Documentation
[propDeprecated] :: Property -> Maybe DeprecationInfo
data Field
Field :: Text -> Bool -> Type -> Maybe Bool -> Maybe Callback -> Int -> [FieldInfoFlag] -> Documentation -> Maybe DeprecationInfo -> Field
[fieldName] :: Field -> Text
[fieldVisible] :: Field -> Bool
[fieldType] :: Field -> Type
-- | Nothing if not known.
[fieldIsPointer] :: Field -> Maybe Bool
[fieldCallback] :: Field -> Maybe Callback
[fieldOffset] :: Field -> Int
[fieldFlags] :: Field -> [FieldInfoFlag]
[fieldDocumentation] :: Field -> Documentation
[fieldDeprecated] :: Field -> Maybe DeprecationInfo
data Struct
Struct :: Bool -> AllocationInfo -> Maybe Text -> Maybe Text -> Int -> Maybe Name -> Bool -> [Field] -> [Method] -> Maybe DeprecationInfo -> Documentation -> Struct
[structIsBoxed] :: Struct -> Bool
[structAllocationInfo] :: Struct -> AllocationInfo
[structTypeInit] :: Struct -> Maybe Text
[structCType] :: Struct -> Maybe Text
[structSize] :: Struct -> Int
[gtypeStructFor] :: Struct -> Maybe Name
[structIsDisguised] :: Struct -> Bool
[structFields] :: Struct -> [Field]
[structMethods] :: Struct -> [Method]
[structDeprecated] :: Struct -> Maybe DeprecationInfo
[structDocumentation] :: Struct -> Documentation
data Callback
Callback :: Callable -> Maybe Text -> Documentation -> Callback
[cbCallable] :: Callback -> Callable
[cbCType] :: Callback -> Maybe Text
[cbDocumentation] :: Callback -> Documentation
data Interface
Interface :: Maybe Text -> Maybe Text -> Documentation -> [Name] -> [Property] -> [Signal] -> [Method] -> AllocationInfo -> Maybe DeprecationInfo -> Interface
[ifTypeInit] :: Interface -> Maybe Text
[ifCType] :: Interface -> Maybe Text
[ifDocumentation] :: Interface -> Documentation
[ifPrerequisites] :: Interface -> [Name]
[ifProperties] :: Interface -> [Property]
[ifSignals] :: Interface -> [Signal]
[ifMethods] :: Interface -> [Method]
[ifAllocationInfo] :: Interface -> AllocationInfo
[ifDeprecated] :: Interface -> Maybe DeprecationInfo
data Method
Method :: Name -> Text -> MethodType -> Maybe Text -> Callable -> Method
[methodName] :: Method -> Name
[methodSymbol] :: Method -> Text
[methodType] :: Method -> MethodType
[methodMovedTo] :: Method -> Maybe Text
[methodCallable] :: Method -> Callable
data Object
Object :: Maybe Name -> Text -> Text -> Maybe Text -> [Name] -> Maybe DeprecationInfo -> Documentation -> [Method] -> [Property] -> [Signal] -> Object
[objParent] :: Object -> Maybe Name
[objTypeInit] :: Object -> Text
[objTypeName] :: Object -> Text
[objCType] :: Object -> Maybe Text
[objInterfaces] :: Object -> [Name]
[objDeprecated] :: Object -> Maybe DeprecationInfo
[objDocumentation] :: Object -> Documentation
[objMethods] :: Object -> [Method]
[objProperties] :: Object -> [Property]
[objSignals] :: Object -> [Signal]
data Enumeration
Enumeration :: [EnumerationMember] -> Maybe Text -> Maybe Text -> Documentation -> Text -> Int -> Maybe DeprecationInfo -> Enumeration
[enumMembers] :: Enumeration -> [EnumerationMember]
[enumErrorDomain] :: Enumeration -> Maybe Text
[enumTypeInit] :: Enumeration -> Maybe Text
[enumDocumentation] :: Enumeration -> Documentation
[enumCType] :: Enumeration -> Text
-- | Bytes used for storage of this struct.
[enumStorageBytes] :: Enumeration -> Int
[enumDeprecated] :: Enumeration -> Maybe DeprecationInfo
data Flags
Flags :: Enumeration -> Flags
data Union
Union :: Bool -> AllocationInfo -> Documentation -> Int -> Maybe Text -> [Field] -> [Method] -> Maybe Text -> Maybe DeprecationInfo -> Union
[unionIsBoxed] :: Union -> Bool
[unionAllocationInfo] :: Union -> AllocationInfo
[unionDocumentation] :: Union -> Documentation
[unionSize] :: Union -> Int
[unionTypeInit] :: Union -> Maybe Text
[unionFields] :: Union -> [Field]
[unionMethods] :: Union -> [Method]
[unionCType] :: Union -> Maybe Text
[unionDeprecated] :: Union -> Maybe DeprecationInfo
instance GHC.Show.Show Data.GI.CodeGen.API.GIRInfo
instance GHC.Show.Show Data.GI.CodeGen.API.GIRInfoParse
instance GHC.Show.Show Data.GI.CodeGen.API.GIRNamespace
instance GHC.Show.Show Data.GI.CodeGen.API.API
instance GHC.Show.Show Data.GI.CodeGen.API.GIRRule
instance GHC.Show.Show Data.GI.CodeGen.API.GIRNodeSpec
instance GHC.Show.Show Data.GI.CodeGen.API.GIRNameTag
module Data.GI.CodeGen.Overrides
data Overrides
-- | Parse the given overrides file, filling in the configuration as
-- needed. In case the parsing fails we return a description of the error
-- instead.
parseOverridesFile :: FilePath -> IO (Either Text Overrides)
-- | Load a given API, applying filtering. Load also any necessary
-- dependencies.
filterAPIsAndDeps :: Overrides -> GIRInfo -> [GIRInfo] -> (Map Name API, Map Name API)
instance GHC.Show.Show Data.GI.CodeGen.Overrides.OSType
instance GHC.Show.Show Data.GI.CodeGen.Overrides.ParserState
instance GHC.Show.Show Data.GI.CodeGen.Overrides.Overrides
instance GHC.Base.Monoid Data.GI.CodeGen.Overrides.Overrides
instance GHC.Base.Semigroup Data.GI.CodeGen.Overrides.Overrides
-- | Configuration for the code generator.
module Data.GI.CodeGen.Config
data Config
Config :: Text -> Bool -> Overrides -> Config
-- | Name of the module being generated.
[modName] :: Config -> Text
-- | Whether to print extra info.
[verbose] :: Config -> Bool
-- | List of loaded overrides for the code generator.
[overrides] :: Config -> Overrides
instance GHC.Show.Show Data.GI.CodeGen.Config.Config
-- | Various fixups in the introspection data.
module Data.GI.CodeGen.Fixups
-- | Remove functions and methods annotated with "moved-to".
dropMovedItems :: API -> Maybe API
-- | GObject-introspection does not currently support nullability
-- annotations, so we try to guess the nullability from the nullability
-- annotations of the curresponding get/set methods, which in principle
-- should be reliable.
guessPropertyNullability :: (Name, API) -> (Name, API)
-- | Not every interface that provides signals/properties is marked as
-- requiring GObject, but this is necessarily the case, so fix the
-- introspection data accordingly.
detectGObject :: (Name, API) -> (Name, API)
-- | Some libraries include duplicated flags by mistake, drop those.
dropDuplicatedFields :: (Name, API) -> (Name, API)
module Data.GI.CodeGen.Code
-- | The generated Code is a sequence of CodeTokens.
data Code
-- | Information on a generated module.
data ModuleInfo
-- | Flags for module code generation.
data ModuleFlag
-- | Use the standard prelude, instead of the haskell-gi-base short one.
ImplicitPrelude :: ModuleFlag
-- | The base type for the code generator monad.
type BaseCodeGen excType a = ReaderT CodeGenConfig (StateT (CGState, ModuleInfo) (Except excType)) a
-- | The code generator monad, for generators that cannot throw errors. The
-- fact that they cannot throw errors is encoded in the forall, which
-- disallows any operation on the error, except discarding it or passing
-- it along without inspecting. This last operation is useful in order to
-- allow embedding CodeGen computations inside ExcCodeGen
-- computations, while disallowing the opposite embedding without
-- explicit error handling.
type CodeGen a = forall e. BaseCodeGen e a
-- | Code generators that can throw errors.
type ExcCodeGen a = BaseCodeGen CGError a
-- | Set of errors for the code generator.
data CGError
CGErrorNotImplemented :: Text -> CGError
CGErrorBadIntrospectionInfo :: Text -> CGError
CGErrorMissingInfo :: Text -> CGError
-- | Like evalCodeGen, but discard the resulting output value.
genCode :: Config -> Map Name API -> ModulePath -> CodeGen () -> ModuleInfo
-- | Run a code generator, and return the information for the generated
-- module together with the return value of the generator.
evalCodeGen :: Config -> Map Name API -> ModulePath -> CodeGen a -> (a, ModuleInfo)
-- | Write down the code for a module and its submodules to disk under the
-- given base directory. It returns the list of written modules.
writeModuleTree :: Bool -> Maybe FilePath -> ModuleInfo -> IO [Text]
-- | Return the list of modules writeModuleTree would write, without
-- actually writing anything to disk.
listModuleTree :: ModuleInfo -> [Text]
-- | Return a text representation of the Code.
codeToText :: Code -> Text
-- | Return the transitive set of dependencies, i.e. the union of those of
-- the module and (transitively) its submodules.
transitiveModuleDeps :: ModuleInfo -> Deps
-- | Return the minimal base version supported by the module and all its
-- submodules.
minBaseVersion :: ModuleInfo -> BaseVersion
-- | Minimal version of base supported by a given module.
data BaseVersion
-- | -- >>> lowerName (Name "Gtk" "main_quit") -- "mainQuit" --lowerName :: Name -> Text -- | Turn the given identifier into camelCase, starting with a lowercase -- letter. -- --
-- >>> lowerSymbol "main_quit" -- "mainQuit" --lowerSymbol :: Text -> Text -- | Turn the given Name into CamelCase, starting with a capital -- letter. -- --
-- >>> upperName (Name "Foo" "bar_baz") -- "BarBaz" --upperName :: Name -> Text -- | Save a bit of typing for optional arguments in the case that we want -- to pass Nothing. noName :: Text -> CodeGen () -- | Name for the given argument, making sure it is a valid Haskell -- argument name (and escaping it if not). escapedArgName :: Arg -> Text -- | Return a qualified form of the constraint for the given name (which -- should correspond to a valid TInterface). classConstraint :: Name -> CodeGen Text -- | Same as classConstraint, but applicable directly to a type. The -- type should be a TInterface, otherwise an error will be raised. typeConstraint :: Type -> CodeGen Text -- | Turn a hyphen-separated identifier into camel case. -- --
-- >>> hyphensToCamelCase "one-sample-string" -- "OneSampleString" --hyphensToCamelCase :: Text -> Text -- | Similarly to hyphensToCamelCase, turn a name -- separated_by_underscores into CamelCase. We preserve final and initial -- underscores, and n>1 consecutive underscores are transformed into -- n-1 underscores. -- --
-- >>> underscoresToCamelCase "sample_id" -- "SampleId" ---- --
-- >>> underscoresToCamelCase "_internal_id_" -- "_InternalId_" ---- --
-- >>> underscoresToCamelCase "multiple___underscores" -- "Multiple__Underscores" --underscoresToCamelCase :: Text -> Text -- | Foreign type associated with a callback type. It can be passed in -- qualified. callbackCType :: Text -> Text -- | Haskell type exposing the closure arguments, which are generally -- elided. callbackHTypeWithClosures :: Text -> Text -- | The name of a function which takes a callback without closure -- arguments, and generates a function which does accep the closures, but -- simply ignores them. callbackDropClosures :: Text -> Text -- | The name of the dynamic wrapper for the given callback type. It can be -- passed in qualified. callbackDynamicWrapper :: Text -> Text -- | The name for the foreign wrapper allocator (foreign import -- "wrapper" ...) for the given callback type. It can be passed in -- qualified. callbackWrapperAllocator :: Text -> Text -- | The name of the Haskell to foreign wrapper for the given callback -- type. It can be passed in qualified. callbackHaskellToForeign :: Text -> Text -- | The name of the Haskell to foreign wrapper for the given callback -- type, keeping the closure arguments (we usually elide them). The -- callback type can be passed in qualified. callbackHaskellToForeignWithClosures :: Text -> Text -- | The name for the closure generator for the given callback type. It can -- be passed in qualified. callbackClosureGenerator :: Text -> Text -- | Construct the submodule path where the given API element will live. -- This is the path relative to the root for the corresponding namespace. -- I.e. the GI.Gtk part is not prepended. submoduleLocation :: Name -> API -> ModulePath -- | Return an identifier for the given interface type valid in the current -- module. qualifiedAPI :: Name -> CodeGen Text -- | Construct an identifier for the given symbol in the given API. qualifiedSymbol :: Text -> Name -> CodeGen Text -- | Construct a map from C identifiers to the corresponding Haskell -- elements in the bindings. module Data.GI.CodeGen.CtoHaskellMap -- | Given a set of APIs, build a Map that given a Text -- corresponding to a certain C identifier returns the corresponding -- Haskell element in the bindings. For instance, -- gtk_widget_show will get mapped to show. cToHaskellMap :: [(Name, API)] -> Map CRef Hyperlink -- | Link to an identifier, module, etc. data Hyperlink IdentifierLink :: Text -> Hyperlink ModuleLink :: Text -> Hyperlink ModuleLinkWithAnchor :: Text -> Text -> Hyperlink instance GHC.Classes.Eq Data.GI.CodeGen.CtoHaskellMap.Hyperlink instance GHC.Show.Show Data.GI.CodeGen.CtoHaskellMap.Hyperlink instance Data.String.IsString Data.GI.CodeGen.CtoHaskellMap.Hyperlink module Data.GI.CodeGen.OverloadedLabels genOverloadedLabels :: [(Name, API)] -> CodeGen () module Data.GI.CodeGen.Inheritance -- | List all properties defined for an object, including those defined by -- its ancestors. fullObjectPropertyList :: Name -> Object -> CodeGen [(Name, Property)] -- | List all properties defined for an interface, including those defined -- by its prerequisites. fullInterfacePropertyList :: Name -> Interface -> CodeGen [(Name, Property)] -- | List all signals defined for an object, including those defined by its -- ancestors. fullObjectSignalList :: Name -> Object -> CodeGen [(Name, Signal)] -- | List all signals defined for an interface, including those defined by -- its prerequisites. fullInterfaceSignalList :: Name -> Interface -> CodeGen [(Name, Signal)] -- | List all methods defined for an object, including those defined by its -- ancestors. fullObjectMethodList :: Name -> Object -> CodeGen [(Name, Method)] -- | List all methods defined for an interface, including those defined by -- its prerequisites. fullInterfaceMethodList :: Name -> Interface -> CodeGen [(Name, Method)] -- | Compute the (ordered) list of parents of the current object. instanceTree :: Name -> CodeGen [Name] instance Data.GI.CodeGen.Inheritance.Inheritable Data.GI.GIR.Property.Property instance Data.GI.CodeGen.Inheritance.Inheritable Data.GI.GIR.Signal.Signal instance Data.GI.CodeGen.Inheritance.Inheritable Data.GI.GIR.Method.Method -- | Render an abstract representation of documentation (as produced by -- parseGtkDoc) as Haddock formatted documentation. module Data.GI.CodeGen.Haddock -- | Write the deprecation pragma for the given DeprecationInfo, if -- not Nothing. deprecatedPragma :: Text -> Maybe DeprecationInfo -> CodeGen () -- | Write the given documentation into generated code. writeDocumentation :: RelativeDocPosition -> Documentation -> CodeGen () -- | Where is the documentation located with respect to the relevant -- symbol, useful for determining whether we want to start with -- | or ^. data RelativeDocPosition DocBeforeSymbol :: RelativeDocPosition DocAfterSymbol :: RelativeDocPosition -- | Like writeDocumentation, but allows us to pass explicitly the -- Haddock comment to write. writeHaddock :: RelativeDocPosition -> Text -> CodeGen () -- | Write the documentation for the given argument. writeArgDocumentation :: Arg -> CodeGen () -- | Write the documentation for the given return value. writeReturnDocumentation :: Callable -> Bool -> CodeGen () -- | Add the given text to the documentation for the section being -- generated. addSectionDocumentation :: HaddockSection -> Documentation -> CodeGen () module Data.GI.CodeGen.GObject isGObject :: Type -> CodeGen Bool apiIsGObject :: Name -> API -> CodeGen Bool -- | Check whether the given name descends from GObject. nameIsGObject :: Name -> CodeGen Bool -- | Support for enums and flags. module Data.GI.CodeGen.EnumFlags genEnum :: Name -> Enumeration -> CodeGen () -- | Very similar to enums, but we also declare ourselves as members of the -- IsGFlag typeclass. genFlags :: Name -> Flags -> CodeGen () module Data.GI.CodeGen.Conversions convert :: Text -> BaseCodeGen e Converter -> BaseCodeGen e Text genConversion :: Text -> Converter -> CodeGen Text unpackCArray :: Text -> Type -> Transfer -> ExcCodeGen Converter -- | Given an array, together with its type, return the code for reading -- its length. computeArrayLength :: Text -> Type -> ExcCodeGen Text -- | Whether the callable has closure arguments (i.e. "user_data" style -- arguments). callableHasClosures :: Callable -> Bool hToF :: Type -> Transfer -> ExcCodeGen Converter fToH :: Type -> Transfer -> ExcCodeGen Converter -- | Somewhat like fToH, but with slightly different borrowing -- semantics: in the case of TransferNothing we wrap incoming -- pointers to boxed structs into transient ManagedPtrs (every -- other case behaves as fToH). These are ManagedPtrs for -- which we do not make a copy, and which will be disowned when the -- function exists, instead of making a copy that the GC will collect -- eventually. -- -- This is necessary in order to get the semantics of callbacks and -- signals right: in some cases making a copy of the object does not -- simply increase the refcount, but rather makes a full copy. In this -- cases modification of the original object is not possible, but this is -- sometimes useful, see for example -- -- https://github.com/haskell-gi/haskell-gi/issues/97 -- -- Another situation where making a copy of incoming arguments is -- problematic is when the underlying library is not thread-safe. When -- running under the threaded GHC runtime it can happen that the GC runs -- on a different OS thread than the thread where the object was created, -- and this leads to rather mysterious bugs, see for example -- -- https://github.com/haskell-gi/haskell-gi/issues/96 -- -- This case is particularly nasty, since it affects -- onWidgetDraw, which is very common. transientToH :: Type -> Transfer -> ExcCodeGen Converter -- | This translates GI types to the types used for generated Haskell code. haskellType :: Type -> CodeGen TypeRep -- | Basically like haskellType, but for types which admit a -- "isomorphic" version of the Haskell type distinct from the usual -- Haskell type. Generally the Haskell type we expose is isomorphic to -- the foreign type, but in some cases, such as callbacks with closure -- arguments, this does not hold, as we omit the closure arguments. This -- function returns a type which is actually isomorphic. isoHaskellType :: Type -> CodeGen TypeRep -- | For convenience untyped TGClosure types have a type variable on -- the Haskell side when they are arguments to functions, but we do not -- want this when they appear as arguments to callbacks/signals, or -- return types of properties, as it would force the type synonym/type -- family to depend on the type variable. Note that for types which are -- not untyped TGClosure this is equivalent to -- isoHaskellType. inboundHaskellType :: Type -> CodeGen TypeRep -- | The constraint for setting the given type in properties. haskellTypeConstraint :: Type -> CodeGen Text foreignType :: Type -> CodeGen TypeRep -- | Given a type find the typeclasses the type belongs to, and return the -- representation of the type in the function signature and the list of -- typeclass constraints for the type. argumentType :: Type -> CodeGen (Text, [Text]) elementType :: Type -> Maybe Type elementMap :: Type -> Text -> Maybe Text -- | If the given type maps to a list in Haskell, return the type of the -- elements, and the function that maps over them. elementTypeAndMap :: Type -> Text -> Maybe (Type, Text) -- | Returns whether the given type corresponds to a ManagedPtr -- instance (a thin wrapper over a ForeignPtr). isManaged :: Type -> CodeGen Bool -- | Returns whether the given type should be represented by a Maybe -- type on the Haskell side. This applies to all properties which have a -- C representation in terms of pointers, except for G(S)Lists, for which -- NULL is a valid G(S)List, and raw pointers, which we just pass through -- to the Haskell side. Notice that introspection annotations can -- override this. typeIsNullable :: Type -> CodeGen Bool -- | Returns whether the given type is represented by a pointer on the C -- side. typeIsPtr :: Type -> CodeGen Bool -- | Check whether the given type corresponds to a callback. typeIsCallback :: Type -> CodeGen Bool -- | If the passed in type is nullable, return the conversion function -- between the FFI pointer type (may be a Ptr or a -- FunPtr) and the corresponding Maybe type. maybeNullConvert :: Type -> CodeGen (Maybe Text) -- | An appropriate NULL value for the given type, for types which are -- represented by pointers on the C side. nullPtrForType :: Type -> CodeGen (Maybe Text) -- | Information on how to allocate the given type, if known. typeAllocInfo :: Type -> CodeGen (Maybe TypeAllocInfo) -- | Information on how to allocate a type. data TypeAllocInfo TypeAllocInfo :: Bool -> Int -> TypeAllocInfo [typeAllocInfoIsBoxed] :: TypeAllocInfo -> Bool -- | In bytes. [typeAllocInfoSize] :: TypeAllocInfo -> Int apply :: Constructor -> Converter mapC :: Constructor -> Converter literal :: Constructor -> Converter data Constructor P :: Text -> Constructor M :: Text -> Constructor Id :: Constructor instance GHC.Base.Functor Data.GI.CodeGen.Conversions.FExpr instance GHC.Show.Show next => GHC.Show.Show (Data.GI.CodeGen.Conversions.FExpr next) instance GHC.Show.Show Data.GI.CodeGen.Conversions.Map instance GHC.Show.Show Data.GI.CodeGen.Conversions.Constructor instance GHC.Classes.Eq Data.GI.CodeGen.Conversions.Constructor instance Data.String.IsString Data.GI.CodeGen.Conversions.Constructor instance GHC.Base.Functor f => GHC.Base.Functor (Data.GI.CodeGen.Conversions.Free f) instance GHC.Base.Functor f => GHC.Base.Applicative (Data.GI.CodeGen.Conversions.Free f) instance GHC.Base.Functor f => GHC.Base.Monad (Data.GI.CodeGen.Conversions.Free f) module Data.GI.CodeGen.Transfer -- | Given an input argument to a C callable, and its label in the code, -- return the list of actions relevant to freeing the memory allocated -- for the argument (if appropriate, depending on the ownership transfer -- semantics of the callable). freeInArg :: Arg -> Text -> Text -> ExcCodeGen [Text] -- | Same thing as freeInArg, but called in case the call to C didn't -- succeed. We thus free everything we allocated in preparation for the -- call, including args that would have been transferred to C. freeInArgOnError :: Arg -> Text -> Text -> ExcCodeGen [Text] -- | Free a container and/or the contained elements, depending on the -- transfer mode. freeContainerType :: Transfer -> Type -> Text -> Text -> ExcCodeGen () -- | Marshalling of structs and unions. module Data.GI.CodeGen.Struct genStructOrUnionFields :: Name -> [Field] -> CodeGen () -- | Specialization for structs of genZeroSU. genZeroStruct :: Name -> Struct -> CodeGen () -- | Specialization for unions of genZeroSU. genZeroUnion :: Name -> Union -> CodeGen () -- | 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. extractCallbacksInStruct :: (Name, API) -> [(Name, API)] -- | 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. fixAPIStructs :: (Name, API) -> (Name, API) -- | Whether (not) to generate bindings for the given struct. ignoreStruct :: Name -> Struct -> Bool -- | Generate the typeclass with information for how to allocate/deallocate -- a given type. genWrappedPtr :: Name -> AllocationInfo -> Int -> CodeGen () module Data.GI.CodeGen.Properties genInterfaceProperties :: Name -> Interface -> CodeGen () genObjectProperties :: Name -> Object -> CodeGen () -- | Generate gtk2hs compatible attribute labels (to ease porting). These -- are namespaced labels, for examples widgetSensitive. We take -- the list of methods, since there may be name clashes (an example is -- Auth::is_for_proxy method in libsoup, and the corresponding -- Auth::is-for-proxy property). When there is a clash we give priority -- to the method. genNamespacedPropLabels :: Name -> [Property] -> [Method] -> CodeGen () module Data.GI.CodeGen.Constant genConstant :: Name -> Constant -> CodeGen () module Data.GI.CodeGen.Callable -- | Generate a wrapper for a known C symbol. genCCallableWrapper :: Name -> Text -> Callable -> ExcCodeGen () -- | Generate a wrapper for a dynamic C symbol (i.e. a Haskell function -- that will invoke its first argument, which should be a FunPtr -- of the appropriate type). The caller should have created a type -- synonym with the right type for the foreign symbol. genDynamicCallableWrapper :: Name -> Text -> Callable -> ExcCodeGen Text -- | The foreign symbol to wrap. It is either a foreign symbol wrapped in a -- foreign import, in which case we are given the name of the Haskell -- wrapper, or alternatively the information about a "dynamic" wrapper in -- scope. data ForeignSymbol -- | Haskell symbol in scope. KnownForeignSymbol :: Text -> ForeignSymbol -- | Info about the dynamic wrapper. DynamicForeignSymbol :: DynamicWrapper -> ForeignSymbol -- | Whether to expose closures and the associated destroy notify handlers -- in the Haskell wrapper. data ExposeClosures WithClosures :: ExposeClosures WithoutClosures :: ExposeClosures hOutType :: Callable -> [Arg] -> ExcCodeGen TypeRep -- | Whether to skip the return value in the generated bindings. The C -- convention is that functions throwing an error and returning a -- gboolean set the boolean to TRUE iff there is no error, so the -- information is always implicit in whether we emit an exception or not, -- so the return value can be omitted from the generated bindings without -- loss of information (and omitting it gives rise to a nicer API). See -- https://bugzilla.gnome.org/show_bug.cgi?id=649657 skipRetVal :: Callable -> Bool arrayLengths :: Callable -> [Arg] arrayLengthsMap :: Callable -> [(Arg, Arg)] -- | The Haskell signature for the given callable. It returns a tuple -- ([constraints], [(type, argname)]). callableSignature :: Callable -> ForeignSymbol -> ExcCodeGen Signature -- | Signature for a callable. data Signature Signature :: Callable -> [Text] -> [(Maybe Arg, Text)] -> Text -> Signature [signatureCallable] :: Signature -> Callable [signatureConstraints] :: Signature -> [Text] [signatureArgTypes] :: Signature -> [(Maybe Arg, Text)] [signatureReturnType] :: Signature -> Text -- | caller-allocates arguments are arguments that the caller allocates, -- and the called function modifies. They are marked as out -- argumens in the introspection data, we sometimes treat them as -- inout arguments instead. The semantics are somewhat tricky: -- for memory management purposes they should be treated as "in" -- arguments, but from the point of view of the exposed API they should -- be treated as "out" or "inout". Unfortunately we cannot always just -- assume that they are purely "out", so in many cases the generated API -- is somewhat suboptimal (since the initial values are not important): -- for example for g_io_channel_read_chars the size of the buffer to read -- is determined by the caller-allocates argument. As a compromise, we -- assume that we can allocate anything that is not a TCArray of length -- determined by an argument. fixupCallerAllocates :: Callable -> Callable -- | In arguments for the given callable on the Haskell side, -- together with the omitted arguments. callableHInArgs :: Callable -> ExposeClosures -> ([Arg], [Arg]) -- | Out arguments for the given callable on the Haskell side. callableHOutArgs :: Callable -> [Arg] -- | Given an argument to a function, return whether it should be wrapped -- in a maybe type (useful for nullable types). We do some sanity -- checking to make sure that the argument is actually nullable (a -- relatively common annotation mistake is to mix up (optional) with -- (nullable)). wrapMaybe :: Arg -> CodeGen Bool inArgInterfaces :: [Arg] -> ExcCodeGen ([Text], [Text]) module Data.GI.CodeGen.Signal genSignal :: Signal -> Name -> ExcCodeGen () -- | Generate the code for connecting the given signal. This assumes that -- it lives inside a do block. genSignalConnector :: Signal -> Text -> Text -> CodeGen () genCallback :: Name -> Callback -> CodeGen () -- | Return the name for the signal in Haskell CamelCase conventions. signalHaskellName :: Text -> Text module Data.GI.CodeGen.OverloadedSignals -- | Signal instances for (GObject-derived) objects. genObjectSignals :: Name -> Object -> CodeGen () -- | Signal instances for interfaces. genInterfaceSignals :: Name -> Interface -> CodeGen () -- | Generate the overloaded signal connectors: Clicked, -- ActivateLink, ... genOverloadedSignalConnectors :: [(Name, API)] -> CodeGen () module Data.GI.CodeGen.OverloadedMethods -- | Generate the MethodList instance given the list of methods -- for the given named type. genMethodList :: Name -> [(Name, Method)] -> CodeGen () -- | Generate the MethodInfo type and instance for the given -- method. genMethodInfo :: Name -> Method -> ExcCodeGen () -- | Generate a method info that is not actually callable, but rather gives -- a type error when trying to use it. genUnsupportedMethodInfo :: Name -> Method -> CodeGen () module Data.GI.CodeGen.CodeGen genConstant :: Name -> Constant -> CodeGen () genFunction :: Name -> Function -> CodeGen () genModule :: Map Name API -> CodeGen () -- | Convenience hooks for writing custom Setup.hs files for -- bindings. module Data.GI.CodeGen.CabalHooks -- | The entry point for Setup.hs files in bindings. setupHaskellGIBinding :: Text -> Text -> Bool -> Maybe FilePath -> Maybe FilePath -> IO () -- | Return the list of modules that setupHaskellGIBinding would -- create. configureDryRun :: Text -> Text -> Maybe FilePath -> IO [Text] module Data.GI.CodeGen.Cabal -- | Generate the cabal project. genCabalProject :: (GIRInfo, PkgInfo) -> [(GIRInfo, PkgInfo)] -> [Text] -> BaseVersion -> CodeGen () cabalConfig :: Text setupHs :: Text -- | Determine the pkg-config name and installed version (major.minor only) -- for a given module, or throw an exception if that fails. tryPkgConfig :: GIRInfo -> Bool -> Map Text Text -> IO (Either Text PkgInfo) instance GHC.Show.Show Data.GI.CodeGen.Cabal.PkgInfo