xfconf- FFI bindings to xfconf

Safe HaskellNone




Generic XfconfValue

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).

Array hack

xfconf code source defines in the directory common/ some hidden functions. Among them, one can find helpers for array manipulation.

array :: GTypeSource

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:

  1. Allocate memory for an array of XfconfValue not containing complex elements such as XfconfStringList, XfconfArray or XfconfNotImplemented
  2. perform the operation (GValue -> IO b) where the GValue is a boxed value wrapping our array of 'GValue*'.
  3. free the memory.