haskell-gi-base 0.26.4 → 0.26.5
raw patch · 8 files changed
+79/−16 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.GI.Base.GObject: gobjectInstallGBooleanProperty :: DerivedGObject o => GObjectClass -> GBooleanPropertyInfo o -> IO ()
+ Data.GI.Base.GParamSpec: GBooleanPropertyInfo :: Text -> Text -> Text -> Bool -> Maybe [GParamFlag] -> (o -> Bool -> IO ()) -> (o -> IO Bool) -> GBooleanPropertyInfo o
+ Data.GI.Base.GParamSpec: [$sel:blurb:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> Text
+ Data.GI.Base.GParamSpec: [$sel:defaultValue:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> Bool
+ Data.GI.Base.GParamSpec: [$sel:flags:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> Maybe [GParamFlag]
+ Data.GI.Base.GParamSpec: [$sel:getter:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> o -> IO Bool
+ Data.GI.Base.GParamSpec: [$sel:name:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> Text
+ Data.GI.Base.GParamSpec: [$sel:nick:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> Text
+ Data.GI.Base.GParamSpec: [$sel:setter:GBooleanPropertyInfo] :: GBooleanPropertyInfo o -> o -> Bool -> IO ()
+ Data.GI.Base.GParamSpec: data GBooleanPropertyInfo o
+ Data.GI.Base.GParamSpec: gParamSpecGBoolean :: GObject o => GBooleanPropertyInfo o -> IO GParamSpec
Files
- Data/GI/Base/BasicTypes.hsc +8/−8
- Data/GI/Base/GObject.hsc +11/−1
- Data/GI/Base/GParamSpec.hsc +45/−0
- Data/GI/Base/GType.hsc +6/−4
- Data/GI/Base/GVariant.hsc +1/−1
- Data/GI/Base/ShortPrelude.hs +6/−0
- Data/GI/Base/Signals.hs +1/−1
- haskell-gi-base.cabal +1/−1
Data/GI/Base/BasicTypes.hsc view
@@ -170,10 +170,10 @@ instance Exception UnexpectedNullPointerReturn --- | A <https://developer.gnome.org/glib/stable/glib-GVariant.html GVariant>. See "Data.GI.Base.GVariant" for further methods.+-- | A <https://docs.gtk.org/glib/struct.Variant.html GVariant>. See "Data.GI.Base.GVariant" for further methods. newtype GVariant = GVariant (ManagedPtr GVariant) --- | A <https://developer.gnome.org/gobject/stable/gobject-GParamSpec.html GParamSpec>. See "Data.GI.Base.GParamSpec" for further methods.+-- | A <https://docs.gtk.org/gobject/class.ParamSpec.html GParamSpec>. See "Data.GI.Base.GParamSpec" for further methods. newtype GParamSpec = GParamSpec (ManagedPtr GParamSpec) -- | A convenient synonym for @Nothing :: Maybe GParamSpec@.@@ -183,22 +183,22 @@ -- | An enum usable as a flag for a function. class Enum a => IsGFlag a --- | A <https://developer.gnome.org/glib/stable/glib-Arrays.html GArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is mapped to a list on the Haskell side.+-- | A <https://docs.gtk.org/glib/struct.Array.html GArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is mapped to a list on the Haskell side. data GArray a = GArray (Ptr (GArray a)) --- | A <https://developer.gnome.org/glib/stable/glib-Pointer-Arrays.html GPtrArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is mapped to a list on the Haskell side.+-- | A <https://docs.gtk.org/glib/struct.PtrArray.html GPtrArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is mapped to a list on the Haskell side. data GPtrArray a = GPtrArray (Ptr (GPtrArray a)) --- | A <https://developer.gnome.org/glib/stable/glib-Byte-Arrays.html GByteArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is packed to a 'Data.ByteString.ByteString' on the Haskell side.+-- | A <https://docs.gtk.org/glib/struct.ByteArray.html GByteArray>. Marshalling for this type is done in "Data.GI.Base.BasicConversions", it is packed to a 'Data.ByteString.ByteString' on the Haskell side. data GByteArray = GByteArray (Ptr GByteArray) --- | A <https://developer.gnome.org/glib/stable/glib-Hash-Tables.html GHashTable>. It is mapped to a 'Data.Map.Map' on the Haskell side.+-- | A <https://docs.gtk.org/glib/struct.HashTable.html GHashTable>. It is mapped to a 'Data.Map.Map' on the Haskell side. data GHashTable a b = GHashTable (Ptr (GHashTable a b)) --- | A <https://developer.gnome.org/glib/stable/glib-Doubly-Linked-Lists.html GList>, mapped to a list on the Haskell side. Marshalling is done in "Data.GI.Base.BasicConversions".+-- | A <https://docs.gtk.org/glib/struct.List.html GList>, mapped to a list on the Haskell side. Marshalling is done in "Data.GI.Base.BasicConversions". data GList a = GList (Ptr (GList a)) --- | A <https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html GSList>, mapped to a list on the Haskell side. Marshalling is done in "Data.GI.Base.BasicConversions".+-- | A <https://docs.gtk.org/glib/struct.SList.html GSList>, mapped to a list on the Haskell side. Marshalling is done in "Data.GI.Base.BasicConversions". data GSList a = GSList (Ptr (GSList a)) -- | Some APIs, such as `GHashTable`, pass around scalar types
Data/GI/Base/GObject.hsc view
@@ -35,6 +35,7 @@ , gobjectInstallProperty , gobjectInstallCIntProperty , gobjectInstallCStringProperty+ , gobjectInstallGBooleanProperty ) where import Data.Maybe (catMaybes)@@ -69,7 +70,8 @@ import Data.GI.Base.GParamSpec (PropertyInfo(..), gParamSpecValue, CIntPropertyInfo(..), CStringPropertyInfo(..),- gParamSpecCInt, gParamSpecCString,+ GBooleanPropertyInfo(..),+ gParamSpecCInt, gParamSpecCString, gParamSpecGBoolean, getGParamSpecGetterSetter, PropGetSetter(..)) import Data.GI.Base.GQuark (GQuark(..), gQuarkFromString)@@ -409,5 +411,13 @@ GObjectClass -> CStringPropertyInfo o -> IO () gobjectInstallCStringProperty klass propInfo = do pspec <- gParamSpecCString propInfo+ withManagedPtr pspec $ \pspecPtr ->+ g_object_class_install_property klass 1 pspecPtr++-- | Add a `${type gboolean}`-valued property to the given object class.+gobjectInstallGBooleanProperty :: DerivedGObject o =>+ GObjectClass -> GBooleanPropertyInfo o -> IO ()+gobjectInstallGBooleanProperty klass propInfo = do+ pspec <- gParamSpecGBoolean propInfo withManagedPtr pspec $ \pspecPtr -> g_object_class_install_property klass 1 pspecPtr
Data/GI/Base/GParamSpec.hsc view
@@ -20,6 +20,8 @@ , gParamSpecCString , CIntPropertyInfo(..) , gParamSpecCInt+ , GBooleanPropertyInfo(..)+ , gParamSpecGBoolean , GParamFlag(..) -- * Get\/Set@@ -33,6 +35,7 @@ castStablePtrToPtr, castPtrToStablePtr) import Control.Monad (void) import Data.Coerce (coerce)+import Data.Int import Data.Maybe (fromMaybe) import Data.Text (Text) @@ -316,6 +319,48 @@ withTextCString value $ \cdefault -> g_param_spec_string cname cnick cblurb cdefault (maybe defaultFlags gflagsToWord flags)+ quark <- pspecQuark+ gParamSpecSetQData pspecPtr quark (wrapGetSet getter setter gvalueSet_)+ wrapGParamSpecPtr pspecPtr++-- | Information on a property of type `type gboolean` to be registered. A+-- property name consists of segments consisting of ASCII letters and+-- digits, separated by either the \'-\' or \'_\' character. The first+-- character of a property name must be a letter. Names which violate+-- these rules lead to undefined behaviour.+--+-- When creating and looking up a property, either separator can be+-- used, but they cannot be mixed. Using \'-\' is considerably more+-- efficient and in fact required when using property names as detail+-- strings for signals.+--+-- Beyond the name, properties have two more descriptive strings+-- associated with them, the @nick@, which should be suitable for use+-- as a label for the property in a property editor, and the @blurb@,+-- which should be a somewhat longer description, suitable for e.g. a+-- tooltip. The @nick@ and @blurb@ should ideally be localized.+data GBooleanPropertyInfo o = GBooleanPropertyInfo+ { name :: Text+ , nick :: Text+ , blurb :: Text+ , defaultValue :: Bool+ , flags :: Maybe [GParamFlag]+ , setter :: o -> Bool -> IO ()+ , getter :: o -> IO (Bool)+ }++foreign import ccall g_param_spec_boolean ::+ CString -> CString -> CString -> #{type gboolean} -> CInt -> IO (Ptr GParamSpec)++-- | Create a `GParamSpec` for a bool param.+gParamSpecGBoolean :: GObject o => GBooleanPropertyInfo o -> IO GParamSpec+gParamSpecGBoolean (GBooleanPropertyInfo {..}) =+ withTextCString name $ \cname ->+ withTextCString nick $ \cnick ->+ withTextCString blurb $ \cblurb -> do+ pspecPtr <- g_param_spec_boolean cname cnick cblurb+ ((fromIntegral . fromEnum) defaultValue)+ (maybe defaultFlags gflagsToWord flags) quark <- pspecQuark gParamSpecSetQData pspecPtr quark (wrapGetSet getter setter gvalueSet_) wrapGParamSpecPtr pspecPtr
Data/GI/Base/GType.hsc view
@@ -107,10 +107,6 @@ gtypeVariant :: GType gtypeVariant = GType #const G_TYPE_VARIANT --- | The `GType` corresponding to 'Data.GI.Base.GError.GError'.-gtypeError :: GType-gtypeError = GType #const G_TYPE_ERROR- -- | The `GType` corresponding to 'Data.GI.Base.BasicTypes.GParamSpec'. gtypeParam :: GType gtypeParam = GType #const G_TYPE_PARAM@@ -140,3 +136,9 @@ -- | The `GType` for boxed `StablePtr`s. gtypeStablePtr :: GType gtypeStablePtr = GType haskell_gi_StablePtr_get_type++foreign import ccall "g_error_get_type" g_error_get_type :: CGType++-- | The `GType` corresponding to 'Data.GI.Base.GError.GError'.+gtypeError :: GType+gtypeError = GType g_error_get_type
Data/GI/Base/GVariant.hsc view
@@ -238,7 +238,7 @@ -- | Get the expected type of a 'GVariant', in 'GVariant' -- notation. See--- <https://developer.gnome.org/glib/stable/glib-GVariantType.html>+-- <https://docs.gtk.org/glib/struct.VariantType.html> -- for the meaning of the resulting format string. gvariantGetTypeString :: GVariant -> IO Text gvariantGetTypeString variant =
Data/GI/Base/ShortPrelude.hs view
@@ -1,3 +1,6 @@+#if MIN_VERSION_base(4,20,0)+{-# LANGUAGE ExplicitNamespaces #-}+#endif -- | The Haskell Prelude exports a number of symbols that can easily -- collide with functions appearing in bindings. The generated code -- requires just a small subset of the functions in the Prelude,@@ -57,6 +60,9 @@ , when , fromIntegral , realToFrac+#if MIN_VERSION_base(4,20,0)+ , type (~)+#endif ) where import Control.Monad (when, (>=>))
Data/GI/Base/Signals.hs view
@@ -18,7 +18,7 @@ -- | Routines for connecting `GObject`s to signals. There are two -- basic variants, 'on' and 'after', which correspond to--- <https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-connect g_signal_connect> and <https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-connect-after g_signal_connect_after>, respectively.+-- <https://docs.gtk.org/gobject/func.signal_connect.html g_signal_connect> and <https://docs.gtk.org/gobject/func.signal_connect_after.html g_signal_connect_after>, respectively. -- -- Basic usage is --
haskell-gi-base.cabal view
@@ -1,5 +1,5 @@ name: haskell-gi-base-version: 0.26.4+version: 0.26.5 synopsis: Foundation for libraries generated by haskell-gi description: Foundation for libraries generated by haskell-gi homepage: https://github.com/haskell-gi/haskell-gi