-- 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.14 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 -- | Construct the Text representation of a showable. tshow :: Show a => a -> Text -- | Throw an error with the given Text. terror :: Text -> a -- | 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 maintainers :: Text 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)) module Data.GI.CodeGen.GType data GType :: * gtypeIsA :: GType -> GType -> Bool gtypeIsBoxed :: GType -> Bool -- | 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 -- | Find out the size of a struct, and the map from field names to offsets -- inside the struct. girStructSizeAndOffsets :: Text -> Text -> IO (Int, Map Text Int) -- | Find out the size of a union, and the map from field names to offsets -- inside the union. girUnionSizeAndOffsets :: Text -> Text -> IO (Int, Map Text Int) -- | Load a GType given the namespace where it lives and the type init -- function. girLoadGType :: Text -> Text -> IO GType instance BoxedObject BaseInfo 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 -- | 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 Show GIRXMLNamespace module Data.GI.GIR.Deprecation -- | Deprecation information on a symbol. data DeprecationInfo -- | Encode the given DeprecationInfo for the given symbol as a -- deprecation pragma. deprecatedPragma :: Text -> Maybe DeprecationInfo -> Text -- | Parse the deprecation information for the given element of the GIR -- file. queryDeprecated :: Element -> Maybe DeprecationInfo instance Show DeprecationInfo instance Eq DeprecationInfo -- | Parsing of documentation nodes. module Data.GI.GIR.Documentation -- | Documentation for a given element. data Documentation Documentation :: Text -> Documentation docText :: Documentation -> Text -- | Parse the documentation node for the given element of the GIR file. queryDocumentation :: Element -> Maybe Documentation instance Show Documentation instance Eq Documentation -- | 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 :: (Text, Text) -> 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 -- | A reference to some API in the GIR TInterface :: Text -> Text -> 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 Eq Name instance Ord Name instance Show Name instance Show Transfer instance Eq Transfer instance Ord Transfer instance Ord Alias instance Eq Alias instance Show Alias instance Eq BasicType instance Show BasicType instance Ord BasicType instance Eq Type instance Show Type instance Ord Type -- | 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 text, if present. parseDocumentation :: Parser (Maybe 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 :: Text -> Text -> 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 -- | Deprecation information on a symbol. data DeprecationInfo -- | Documentation for a given element. data Documentation instance Show 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 -- | Like parseType, but allow for none, returned as -- Nothing. parseOptionalType :: Parser (Maybe Type) -- | Parsing of Enums. module Data.GI.GIR.Enum data Enumeration Enumeration :: [(Text, Int64)] -> Maybe Text -> Maybe Text -> Int -> Maybe DeprecationInfo -> Enumeration enumValues :: Enumeration -> [(Text, Int64)] errorDomain :: Enumeration -> Maybe Text enumTypeInit :: Enumeration -> Maybe Text -- | Bytes used for storage of this struct. enumStorageBytes :: Enumeration -> Int enumDeprecated :: Enumeration -> Maybe DeprecationInfo -- | Parse an "enumeration" element from the GIR file. parseEnum :: Parser (Name, Enumeration) instance Show Enumeration -- | 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 Show Flags module Data.GI.GIR.Arg data Arg Arg :: Text -> Type -> Direction -> Bool -> 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 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 Show Direction instance Eq Direction instance Ord Direction instance Show Scope instance Eq Scope instance Ord Scope instance Show Arg instance Eq Arg instance Ord Arg module Data.GI.GIR.Callable data Callable Callable :: Maybe Type -> Bool -> Transfer -> [Arg] -> Bool -> Maybe DeprecationInfo -> Callable returnType :: Callable -> Maybe Type returnMayBeNull :: Callable -> Bool returnTransfer :: Callable -> Transfer args :: Callable -> [Arg] skipReturn :: Callable -> Bool callableDeprecated :: Callable -> Maybe DeprecationInfo parseCallable :: Parser Callable instance Show Callable instance Eq Callable -- | Parsing of callbacks. module Data.GI.GIR.Callback data Callback Callback :: Callable -> Callback parseCallback :: Parser (Name, Callback) instance Show Callback module Data.GI.GIR.Function data Function Function :: Text -> Bool -> Maybe Text -> Callable -> Function fnSymbol :: Function -> Text fnThrows :: Function -> Bool fnMovedTo :: Function -> Maybe Text fnCallable :: Function -> Callable parseFunction :: Parser (Name, Function) instance Show Function module Data.GI.GIR.Method data Method Method :: Name -> Text -> Bool -> MethodType -> Maybe Text -> Callable -> Method methodName :: Method -> Name methodSymbol :: Method -> Text methodThrows :: Method -> Bool 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 Eq MethodType instance Show MethodType instance Eq Method instance Show Method module Data.GI.GIR.Signal data Signal Signal :: Text -> Callable -> Maybe DeprecationInfo -> Signal sigName :: Signal -> Text sigCallable :: Signal -> Callable sigDeprecated :: Signal -> Maybe DeprecationInfo parseSignal :: Parser Signal instance Show Signal instance Eq Signal -- | Parsing of constants in GIR files. module Data.GI.GIR.Constant -- | Info about a constant. data Constant Constant :: Type -> Text -> Maybe DeprecationInfo -> Constant constantType :: Constant -> Type constantValue :: Constant -> Text constantDeprecated :: Constant -> Maybe DeprecationInfo -- | Parse a "constant" element from the GIR file. parseConstant :: Parser (Name, Constant) instance Show Constant -- | Parsing of objectstructunion fields. module Data.GI.GIR.Field data Field Field :: Text -> Bool -> Type -> Maybe Callback -> Int -> [FieldInfoFlag] -> Maybe DeprecationInfo -> Field fieldName :: Field -> Text fieldVisible :: Field -> Bool fieldType :: Field -> Type fieldCallback :: Field -> Maybe Callback fieldOffset :: Field -> Int fieldFlags :: Field -> [FieldInfoFlag] fieldDeprecated :: Field -> Maybe DeprecationInfo data FieldInfoFlag parseFields :: Parser [Field] instance Show FieldInfoFlag instance Show Field -- | Parsing of structs. module Data.GI.GIR.Struct data Struct Struct :: Bool -> Maybe Text -> Int -> Maybe Name -> Bool -> [Field] -> [Method] -> Maybe DeprecationInfo -> Maybe Documentation -> Struct structIsBoxed :: Struct -> Bool structTypeInit :: 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 -> Maybe Documentation parseStruct :: Parser (Name, Struct) instance Show Struct -- | Parsing of unions. module Data.GI.GIR.Union data Union Union :: Bool -> Int -> Maybe Text -> [Field] -> [Method] -> Maybe DeprecationInfo -> Union unionIsBoxed :: Union -> Bool unionSize :: Union -> Int unionTypeInit :: Union -> Maybe Text unionFields :: Union -> [Field] unionMethods :: Union -> [Method] unionDeprecated :: Union -> Maybe DeprecationInfo parseUnion :: Parser (Name, Union) instance Show Union module Data.GI.GIR.Property data Property Property :: Text -> Type -> [PropertyFlag] -> Maybe Bool -> Maybe Bool -> Transfer -> Maybe DeprecationInfo -> Property propName :: Property -> Text propType :: Property -> Type propFlags :: Property -> [PropertyFlag] propReadNullable :: Property -> Maybe Bool propWriteNullable :: Property -> Maybe Bool propTransfer :: Property -> Transfer propDeprecated :: Property -> Maybe DeprecationInfo data PropertyFlag PropertyReadable :: PropertyFlag PropertyWritable :: PropertyFlag PropertyConstruct :: PropertyFlag PropertyConstructOnly :: PropertyFlag parseProperty :: Parser Property instance Show PropertyFlag instance Eq PropertyFlag instance Show Property instance Eq Property module Data.GI.GIR.Interface data Interface Interface :: Maybe Text -> [Name] -> [Property] -> [Signal] -> [Method] -> Maybe DeprecationInfo -> Interface ifTypeInit :: Interface -> Maybe Text ifPrerequisites :: Interface -> [Name] ifProperties :: Interface -> [Property] ifSignals :: Interface -> [Signal] ifMethods :: Interface -> [Method] ifDeprecated :: Interface -> Maybe DeprecationInfo parseInterface :: Parser (Name, Interface) instance Show Interface -- | Parsing of objects. module Data.GI.GIR.Object data Object Object :: Maybe Name -> Text -> Text -> [Name] -> Maybe DeprecationInfo -> Maybe Documentation -> [Method] -> [Property] -> [Signal] -> Object objParent :: Object -> Maybe Name objTypeInit :: Object -> Text objTypeName :: Object -> Text objInterfaces :: Object -> [Name] objDeprecated :: Object -> Maybe DeprecationInfo objDocumentation :: Object -> Maybe Documentation objMethods :: Object -> [Method] objProperties :: Object -> [Property] objSignals :: Object -> [Signal] parseObject :: Parser (Name, Object) instance Show Object -- | Type constructors. 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 -- | A reference to some API in the GIR TInterface :: Text -> Text -> 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 -- | Embed in the IO monad. io :: TypeRep -> TypeRep -- | A Ptr to the type. ptr :: TypeRep -> TypeRep -- | A FunPtr to the type. funptr :: TypeRep -> TypeRep -- | Type constructor applied to the given types. con :: Text -> [TypeRep] -> TypeRep -- | Embed in the Maybe monad. maybeT :: TypeRep -> TypeRep 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 -- | 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 :: Text -> GIRNodeSpec -- | Node of the given type. GIRType :: Text -> GIRNodeSpec -- | Combination of the above. GIRTypedName :: Text -> Text -> GIRNodeSpec -- | 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 data Direction DirectionIn :: Direction DirectionOut :: Direction DirectionInout :: Direction data Scope ScopeTypeInvalid :: Scope ScopeTypeCall :: Scope ScopeTypeAsync :: Scope ScopeTypeNotified :: Scope -- | Encode the given DeprecationInfo for the given symbol as a -- deprecation pragma. deprecatedPragma :: Text -> Maybe DeprecationInfo -> Text -- | Deprecation information on a symbol. data DeprecationInfo 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 -> Maybe DeprecationInfo -> Constant constantType :: Constant -> Type constantValue :: Constant -> Text constantDeprecated :: Constant -> Maybe DeprecationInfo data Arg Arg :: Text -> Type -> Direction -> Bool -> 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 argScope :: Arg -> Scope argClosure :: Arg -> Int argDestroy :: Arg -> Int argCallerAllocates :: Arg -> Bool transfer :: Arg -> Transfer data Callable Callable :: Maybe Type -> Bool -> Transfer -> [Arg] -> Bool -> Maybe DeprecationInfo -> Callable returnType :: Callable -> Maybe Type returnMayBeNull :: Callable -> Bool returnTransfer :: Callable -> Transfer args :: Callable -> [Arg] skipReturn :: Callable -> Bool callableDeprecated :: Callable -> Maybe DeprecationInfo data Function Function :: Text -> Bool -> Maybe Text -> Callable -> Function fnSymbol :: Function -> Text fnThrows :: Function -> Bool fnMovedTo :: Function -> Maybe Text fnCallable :: Function -> Callable data Signal Signal :: Text -> Callable -> Maybe DeprecationInfo -> Signal sigName :: Signal -> Text sigCallable :: Signal -> Callable sigDeprecated :: Signal -> Maybe DeprecationInfo data Property Property :: Text -> Type -> [PropertyFlag] -> Maybe Bool -> Maybe Bool -> Transfer -> Maybe DeprecationInfo -> Property propName :: Property -> Text propType :: Property -> Type propFlags :: Property -> [PropertyFlag] propReadNullable :: Property -> Maybe Bool propWriteNullable :: Property -> Maybe Bool propTransfer :: Property -> Transfer propDeprecated :: Property -> Maybe DeprecationInfo data Field Field :: Text -> Bool -> Type -> Maybe Callback -> Int -> [FieldInfoFlag] -> Maybe DeprecationInfo -> Field fieldName :: Field -> Text fieldVisible :: Field -> Bool fieldType :: Field -> Type fieldCallback :: Field -> Maybe Callback fieldOffset :: Field -> Int fieldFlags :: Field -> [FieldInfoFlag] fieldDeprecated :: Field -> Maybe DeprecationInfo data Struct Struct :: Bool -> Maybe Text -> Int -> Maybe Name -> Bool -> [Field] -> [Method] -> Maybe DeprecationInfo -> Maybe Documentation -> Struct structIsBoxed :: Struct -> Bool structTypeInit :: 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 -> Maybe Documentation data Callback Callback :: Callable -> Callback data Interface Interface :: Maybe Text -> [Name] -> [Property] -> [Signal] -> [Method] -> Maybe DeprecationInfo -> Interface ifTypeInit :: Interface -> Maybe Text ifPrerequisites :: Interface -> [Name] ifProperties :: Interface -> [Property] ifSignals :: Interface -> [Signal] ifMethods :: Interface -> [Method] ifDeprecated :: Interface -> Maybe DeprecationInfo data Method Method :: Name -> Text -> Bool -> MethodType -> Maybe Text -> Callable -> Method methodName :: Method -> Name methodSymbol :: Method -> Text methodThrows :: Method -> Bool methodType :: Method -> MethodType methodMovedTo :: Method -> Maybe Text methodCallable :: Method -> Callable data Object Object :: Maybe Name -> Text -> Text -> [Name] -> Maybe DeprecationInfo -> Maybe Documentation -> [Method] -> [Property] -> [Signal] -> Object objParent :: Object -> Maybe Name objTypeInit :: Object -> Text objTypeName :: Object -> Text objInterfaces :: Object -> [Name] objDeprecated :: Object -> Maybe DeprecationInfo objDocumentation :: Object -> Maybe Documentation objMethods :: Object -> [Method] objProperties :: Object -> [Property] objSignals :: Object -> [Signal] data Enumeration Enumeration :: [(Text, Int64)] -> Maybe Text -> Maybe Text -> Int -> Maybe DeprecationInfo -> Enumeration enumValues :: Enumeration -> [(Text, Int64)] errorDomain :: Enumeration -> Maybe Text enumTypeInit :: Enumeration -> Maybe Text -- | Bytes used for storage of this struct. enumStorageBytes :: Enumeration -> Int enumDeprecated :: Enumeration -> Maybe DeprecationInfo data Flags Flags :: Enumeration -> Flags data Union Union :: Bool -> Int -> Maybe Text -> [Field] -> [Method] -> Maybe DeprecationInfo -> Union unionIsBoxed :: Union -> Bool unionSize :: Union -> Int unionTypeInit :: Union -> Maybe Text unionFields :: Union -> [Field] unionMethods :: Union -> [Method] unionDeprecated :: Union -> Maybe DeprecationInfo instance Show GIRNodeSpec instance Show GIRRule instance Show API instance Show GIRNamespace instance Show GIRInfoParse instance Show GIRInfo module Data.GI.CodeGen.Overrides data Overrides -- | Parse the given config file (as a set of lines) for a given -- introspection namespace, filling in the configuration as needed. In -- case the parsing fails we return a description of the error instead. parseOverridesFile :: [Text] -> 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 Show Overrides instance Show ParserFlag instance Show ParserState instance Monoid Overrides module Data.GI.CodeGen.Config data Config Config :: Maybe Text -> Bool -> Overrides -> Config -- | Name of the module being generated. modName :: Config -> Maybe Text -- | Whether to print extra info. verbose :: Config -> Bool -- | List of loaded overrides for the code generator. overrides :: Config -> Overrides module Data.GI.CodeGen.Code data Code -- | No code NoCode :: Code -- | A single line, indented to current indentation Line :: Text -> Code -- | Indented region Indent :: Code -> Code -- | The basic sequence of code Sequence :: (Seq Code) -> Code -- | A grouped set of lines Group :: Code -> Code -- | Information on a generated module. data ModuleInfo ModuleInfo :: ModuleName -> Code -> Code -> Map Text ModuleInfo -> Deps -> Seq Export -> Set Text -> Set Text -> Set ModuleFlag -> Maybe Text -> BaseVersion -> ModuleInfo -- | Full module name: [GI, Gtk, Label]. moduleName :: ModuleInfo -> ModuleName -- | Generated code for the module. moduleCode :: ModuleInfo -> Code -- | Interface going into the .hs-boot file. bootCode :: ModuleInfo -> Code -- | Indexed by the relative module name. submodules :: ModuleInfo -> Map Text ModuleInfo -- | Set of dependencies for this module. moduleDeps :: ModuleInfo -> Deps -- | Exports for the module. moduleExports :: ModuleInfo -> Seq Export -- | Set of language pragmas for the module. modulePragmas :: ModuleInfo -> Set Text -- | GHC options for compiling the module. moduleGHCOpts :: ModuleInfo -> Set Text -- | Flags for the module. moduleFlags :: ModuleInfo -> Set ModuleFlag -- | Documentation for the module. moduleDoc :: ModuleInfo -> Maybe Text -- | Minimal version of base the module will work on. moduleMinBase :: ModuleInfo -> BaseVersion -- | Flags for module code generation. data ModuleFlag -- | Use the standard prelude, instead of the haskell-gi-base short one. ImplicitPrelude :: ModuleFlag -- | Do not import a Types submodule. NoTypesImport :: ModuleFlag -- | Do not import a Callbacks submodule. NoCallbacksImport :: ModuleFlag -- | Reexport the module (as is) from .Types Reexport :: ModuleFlag type BaseCodeGen excType a = ReaderT CodeGenConfig (StateT ModuleInfo (ExceptT excType IO)) 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 data CGError CGErrorNotImplemented :: Text -> CGError CGErrorBadIntrospectionInfo :: Text -> CGError CGErrorMissingInfo :: Text -> CGError -- | Like evalCodeGen, but discard the resulting output value. genCode :: Config -> Map Name API -> ModuleName -> CodeGen () -> IO 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 -> ModuleName -> CodeGen a -> IO (a, ModuleInfo) -- | Write down the code for a module and its submodules to disk under the -- given base directory. This also writes the submodules, and a -- Types submodule reexporting all interfaces defined in .hs-boot -- files. It returns the list of written modules. writeModuleTree :: Bool -> Maybe FilePath -> ModuleInfo -> IO [Text] -- | Write down the code for a module and its submodules to disk under the -- given base directory. It returns the list of written modules. writeModuleCode :: Bool -> Maybe FilePath -> ModuleInfo -> IO [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 -- |