haskell-gi-base-0.24.4: Foundation for libraries generated by haskell-gi

Safe HaskellNone
LanguageHaskell2010

Data.GI.Base.GValue

Contents

Synopsis

Constructing GValues

newtype GValue Source #

Haskell-side representation of a GValue.

Constructors

GValue (ManagedPtr GValue) 
Instances
HasParentTypes GValue Source # 
Instance details
GBoxed GValue Source #

GValues are registered as boxed in the GLib type system.

Instance details
TypedObject GValue Source #

Find the associated GType for GValue.

Instance details
type ParentTypes GValue Source # 
Instance details
type ParentTypes GValue = ([] :: [*])

class IsGValue a where Source #

A convenience class for marshaling back and forth between Haskell values and GValues.

Minimal complete definition

toGValue, fromGValue

Instances
IsGValue Bool Source # 
Instance details
IsGValue Double Source # 
Instance details
IsGValue Float Source # 
Instance details
IsGValue Int32 Source # 
Instance details
IsGValue Int64 Source # 
Instance details
IsGValue Word32 Source # 
Instance details
IsGValue Word64 Source # 
Instance details
IsGValue CInt Source # 
Instance details
IsGValue CUInt Source # 
Instance details
IsGValue CLong Source # 
Instance details
IsGValue CULong Source # 
Instance details
IsGValue GType Source # 
Instance details
IsGValue (Maybe String) Source # 
Instance details
IsGValue (Maybe Text) Source # 
Instance details
IsGValue (StablePtr a) Source # 
Instance details
IsGValue (Ptr a) Source # 
Instance details

data GValueConstruct o Source #

A type holding a GValue with an associated label. It is parameterized by a phantom type encoding the target type for the GValue (useful when constructing properties).

newGValue :: GType -> IO GValue Source #

Build a new, empty, GValue of the given type.

buildGValue :: GType -> (GValue -> a -> IO ()) -> a -> IO GValue Source #

A convenience function for building a new GValue and setting the initial value.

disownGValue :: GValue -> IO (Ptr GValue) Source #

Disown a GValue, i.e. do not unref the underlying object when the Haskell object is garbage collected.

noGValue :: Maybe GValue Source #

A convenience alias for Nothing :: Maybe GValue.

newGValueFromPtr :: Ptr GValue -> IO GValue Source #

Construct a Haskell wrapper for the given GValue, making a copy.

wrapGValuePtr :: Ptr GValue -> IO GValue Source #

Take ownership of a passed in Ptr.

unsetGValue :: Ptr GValue -> IO () Source #

Unset the GValue, freeing all resources associated to it.

gvalueType :: GValue -> IO GType Source #

Return the GType contained by a GValue.

Packing GValues into arrays

packGValueArray :: [GValue] -> IO (Ptr GValue) Source #

Pack the given list of GValues contiguously into a C array

unpackGValueArrayWithLength :: Integral a => a -> Ptr GValue -> IO [GValue] Source #

Unpack an array of contiguous GValues into a list of GValues.

mapGValueArrayWithLength :: Integral a => a -> (Ptr GValue -> IO c) -> Ptr GValue -> IO () Source #

Map over the GValues inside a C array.

Setters and getters

set_object :: GObject a => GValue -> Ptr a -> IO () Source #

set_boxed :: GValue -> Ptr a -> IO () Source #

set_stablePtr :: GValue -> StablePtr a -> IO () Source #

Set the value of GValue containing a StablePtr

get_stablePtr :: GValue -> IO (StablePtr a) Source #

Get the value of a GValue containing a StablePtr

take_stablePtr :: Ptr GValue -> StablePtr a -> IO () Source #

Like set_stablePtr, but the GValue takes ownership of the StablePtr