haskell-gi-base-0.24.0: Foundation for libraries generated by haskell-gi
Safe HaskellNone
LanguageHaskell2010

Data.GI.Base.GParamSpec

Description

Management of GParamSpecs.

Synopsis

Memory management

wrapGParamSpecPtr :: Ptr GParamSpec -> IO GParamSpec Source #

Take ownership of a ParamSpec passed in Ptr.

newGParamSpecFromPtr :: Ptr GParamSpec -> IO GParamSpec Source #

Construct a Haskell wrapper for the given GParamSpec, without assuming ownership.

unrefGParamSpec :: GParamSpec -> IO () Source #

Remove a reference to the given GParamSpec.

disownGParamSpec :: GParamSpec -> IO (Ptr GParamSpec) Source #

Disown a GParamSpec, i.e. do not longer unref the associated foreign GParamSpec when the Haskell GParamSpec gets garbage collected.

GParamSpec building

data PropertyInfo o a Source #

Information on a property encoding a Haskell value. Note that from the C side this property will appear as an opaque pointer. Use the specialized constructors below for creating properties meaningful from the C side.

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.

Constructors

PropertyInfo 

Fields

  • name :: Text

    Identifier for the property.

  • nick :: Text

    Identifier for display to the user.

  • blurb :: Text

    Description of the property.

  • setter :: o -> a -> IO ()

    Handler invoked when the property is being set.

  • getter :: o -> IO a

    Handler that returns the current value of the property.

  • flags :: Maybe [GParamFlag]

    Set of flags, or Nothing for the default set of flags.

gParamSpecValue :: forall o a. GObject o => PropertyInfo o a -> IO GParamSpec Source #

Create a GParamSpec for a Haskell value.

data CStringPropertyInfo o Source #

Information on a property of type Text 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.

Constructors

CStringPropertyInfo 

Fields

gParamSpecCString :: GObject o => CStringPropertyInfo o -> IO GParamSpec Source #

Create a GParamSpec for a string param.

data CIntPropertyInfo o Source #

Information on a property of type CInt 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.

Constructors

CIntPropertyInfo 

Fields

gParamSpecCInt :: GObject o => CIntPropertyInfo o -> IO GParamSpec Source #

Create a GParamSpec for an integer param.

Get/Set

data PropGetSetter o Source #

Low-level getter and setter for the property.

Constructors

PropGetSetter 

Fields

getGParamSpecGetterSetter :: forall o. Ptr GParamSpec -> IO (Maybe (PropGetSetter o)) Source #

Attempt to get the Haskell setter and getter for the given GParamSpec. This will only be possible if the GParamSpec was created with one of the functions above, if this is not the case the function will return Nothing.