Safe Haskell | None |
---|
- data XfconfValue
- class XfconfValueClass a where
- toXfconfValue :: a -> IO XfconfValue
- int16 :: GType
- valueGetInt16 :: GValue -> IO Int16
- valueSetInt16 :: GValue -> Int16 -> IO ()
- uint16 :: GType
- valueGetUInt16 :: GValue -> IO Word16
- valueSetUInt16 :: GValue -> Word16 -> IO ()
- array :: GType
- allocaGValueArray :: [XfconfValue] -> (GValue -> IO b) -> IO b
Generic XfconfValue
data XfconfValue Source
class XfconfValueClass a whereSource
toXfconfValue :: a -> IO XfconfValueSource
Additional GValue type
libgobject lacks GObject fundamental types for 16-bit signed and unsigned integers, which may be useful to use in an Xfconf store. GObject types for these primitive types are provided here.
Note that, strangely, the xfconfd backend consider uint16 and int16
as, respectively, simple uint32 and int32. This Haskell FFI binding
hides this fact by converting uint32 and int32 back to uint16 and
int16 when using channelGetUInt16WithDefault
and
channelGetInt16WithDefault
, but other frontends may behave
differently (notably the original C library or the
channelGetProperty
function).
valueGetInt16 :: GValue -> IO Int16Source
valueSetInt16 :: GValue -> Int16 -> IO ()Source
valueGetUInt16 :: GValue -> IO Word16Source
valueSetUInt16 :: GValue -> Word16 -> IO ()Source
Array hack
xfconf code source defines in the directory common/
some hidden
functions. Among them, one can find helpers for array manipulation.
From xfconf-common-private.h:
#define XFCONF_TYPE_G_VALUE_ARRAY (dbus_g_type_get_collection("GPtrArray", G_TYPE_VALUE))
allocaGValueArray :: [XfconfValue] -> (GValue -> IO b) -> IO bSource
The big bro' of allocaGValue
.
This function works in three steps:
- Allocate memory for an array of
XfconfValue
not containing complex elements such asXfconfStringList
,XfconfArray
orXfconfNotImplemented
- perform the operation
(GValue -> IO b)
where theGValue
is a boxed value wrapping our array of 'GValue*'. - free the memory.