packages feed

haskell-gi 0.26.14 → 0.26.15

raw patch · 4 files changed

+19/−10 lines, 4 files

Files

ChangeLog.md view
@@ -1,3 +1,8 @@+### 0.26.15+++ Fix a code generation mistake when tranferring GClosure arguments of+  unknown type.+ ### 0.26.12  + Add support for the .gir format dialect generated by vala.
haskell-gi.cabal view
@@ -1,5 +1,5 @@ name:                haskell-gi-version:             0.26.14+version:             0.26.15 synopsis:            Generate Haskell bindings for GObject Introspection capable libraries description:         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.
lib/Data/GI/CodeGen/Conversions.hsc view
@@ -219,11 +219,11 @@ hClosureToF :: Transfer -> Maybe Type -> CodeGen e Constructor -- Untyped closures hClosureToF transfer Nothing =-  if transfer == TransferEverything-  then return $ M "B.GClosure.disownGClosure"-  -- We cast the point here because the foreign type for untyped+  -- We cast the pointer here because the foreign type for untyped   -- closures is always represented as Ptr (GClosure ()), while the   -- corresponding Haskell type is the parametric "GClosure a".+  if transfer == TransferEverything+  then return $ M "FP.castPtr <$> B.GClosure.disownGClosure"   else return $ M "unsafeManagedPtrCastPtr" -- Typed closures hClosureToF transfer (Just _) =@@ -931,12 +931,14 @@ -- 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. There is another case this function deals with: 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.+-- isomorphic.+--+-- There is another case this function deals with: 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. isoHaskellType :: Type -> CodeGen e TypeRep isoHaskellType (TGClosure Nothing) =   return $ "GClosure" `con` [con0 "()"]
lib/Data/GI/GIR/Type.hs view
@@ -115,6 +115,8 @@ parseFundamentalType "GLib" "Variant" = return TVariant parseFundamentalType "GObject" "ParamSpec" = return TParamSpec parseFundamentalType "GObject" "Value" = return TGValue+-- Used by vala, see https://github.com/haskell-gi/haskell-gi/issues/453+parseFundamentalType "GLib" "ObjectPath" = return (TBasicType TUTF8) parseFundamentalType "GObject" "Closure" = parseClosure -- A TInterface type (basically, everything that is not of a known type). parseFundamentalType ns n = resolveQualifiedTypeName (Name ns n)