d-bus-0.1.3.2: Permissively licensed D-Bus client library

Safe HaskellNone
LanguageHaskell2010

DBus.Types

Synopsis

Documentation

objectPath :: Text -> ObjectPath Source

Parse an object path. Contrary to the standard, empty path parts are ignored

data DBusSimpleType Source

Types that are not composite. These can be the keys of a Dict

Instances

Eq DBusSimpleType 
Data DBusSimpleType 
Read DBusSimpleType 
Show DBusSimpleType 
Typeable * DBusSimpleType 
SingI DBusSimpleType TypeSignature 
SingI DBusSimpleType TypeObjectPath 
SingI DBusSimpleType TypeString 
SingI DBusSimpleType TypeUnixFD 
SingI DBusSimpleType TypeDouble 
SingI DBusSimpleType TypeUInt64 
SingI DBusSimpleType TypeInt64 
SingI DBusSimpleType TypeUInt32 
SingI DBusSimpleType TypeInt32 
SingI DBusSimpleType TypeUInt16 
SingI DBusSimpleType TypeInt16 
SingI DBusSimpleType TypeBoolean 
SingI DBusSimpleType TypeByte 
SEq DBusSimpleType (KProxy DBusSimpleType) 
PEq DBusSimpleType (KProxy DBusSimpleType) 
SDecide DBusSimpleType (KProxy DBusSimpleType) 
SingKind DBusSimpleType (KProxy DBusSimpleType) 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) TypeDictEntrySym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) TypeDictSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) Let1627472196TSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) Let1627472186TSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType DBusType -> *) DBusSimpleTypeSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType DBusType -> *) Let1627472175TSym0 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) TypeDictEntrySym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) TypeDictSym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) Let1627472196TSym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) Let1627472186TSym1 
data Sing DBusSimpleType where 
type (:==) DBusSimpleType a0 b0 = Equals_1627467044 a0 b0 
type Apply DBusType DBusSimpleType DBusSimpleTypeSym0 l0 = DBusSimpleTypeSym1 l0 
type Apply DBusType DBusSimpleType Let1627472175TSym0 l0 = Let1627472175TSym1 l0 
type DemoteRep DBusSimpleType (KProxy DBusSimpleType) = DBusSimpleType 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType TypeDictEntrySym0 l0 = TypeDictEntrySym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType TypeDictSym0 l0 = TypeDictSym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType Let1627472196TSym0 l0 = Let1627472196TSym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType Let1627472186TSym0 l0 = Let1627472186TSym1 l0 

data DBusType Source

Instances

Eq DBusType 
Data DBusType 
Read DBusType 
Show DBusType 
Typeable * DBusType 
SingI DBusType TypeUnit 
SingI DBusType TypeVariant 
SEq DBusType (KProxy DBusType) 
PEq DBusType (KProxy DBusType) 
SDecide DBusType (KProxy DBusType) 
SingI [DBusType] n0 => SingI DBusType (TypeStruct n) 
SingI DBusType n0 => SingI DBusType (TypeArray n) 
SingI DBusSimpleType n0 => SingI DBusType (DBusSimpleType n) 
SingKind DBusType (KProxy DBusType) 
(SingI DBusSimpleType n0, SingI DBusType n1) => SingI DBusType (TypeDictEntry n n) 
(SingI DBusSimpleType n0, SingI DBusType n1) => SingI DBusType (TypeDict n n) 
Typeable ([DBusType] -> *) SignalDescription 
SuppressUnusedWarnings (TyFun [DBusType] DBusType -> *) TypeStructSym0 
SuppressUnusedWarnings (TyFun DBusType [DBusType] -> *) FlattenRepTypeSym0 
SuppressUnusedWarnings (TyFun DBusType DBusType -> *) TypeArraySym0 
SuppressUnusedWarnings (TyFun DBusType DBusType -> *) Let1627472180TSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) TypeDictEntrySym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) TypeDictSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) Let1627472196TSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType (TyFun DBusType DBusType -> *) -> *) Let1627472186TSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType DBusType -> *) DBusSimpleTypeSym0 
SuppressUnusedWarnings (TyFun DBusSimpleType DBusType -> *) Let1627472175TSym0 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) TypeDictEntrySym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) TypeDictSym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) Let1627472196TSym1 
SuppressUnusedWarnings (DBusSimpleType -> TyFun DBusType DBusType -> *) Let1627472186TSym1 
data Sing DBusType where 
type (:==) DBusType a0 b0 = Equals_1627467051 a0 b0 
type Apply DBusType DBusType TypeArraySym0 l0 = TypeArraySym1 l0 
type Apply DBusType DBusType Let1627472180TSym0 l0 = Let1627472180TSym1 l0 
type Apply DBusType DBusSimpleType DBusSimpleTypeSym0 l0 = DBusSimpleTypeSym1 l0 
type Apply DBusType DBusSimpleType Let1627472175TSym0 l0 = Let1627472175TSym1 l0 
type Apply DBusType DBusType (TypeDictEntrySym1 l1) l0 = TypeDictEntrySym2 l1 l0 
type Apply DBusType DBusType (TypeDictSym1 l1) l0 = TypeDictSym2 l1 l0 
type Apply DBusType DBusType (Let1627472196TSym1 l1) l0 = Let1627472196TSym2 l1 l0 
type Apply DBusType DBusType (Let1627472186TSym1 l1) l0 = Let1627472186TSym2 l1 l0 
type DemoteRep DBusType (KProxy DBusType) = DBusType 
type Apply DBusType [DBusType] TypeStructSym0 l0 = TypeStructSym1 l0 
type Apply [DBusType] DBusType FlattenRepTypeSym0 l0 = FlattenRepTypeSym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType TypeDictEntrySym0 l0 = TypeDictEntrySym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType TypeDictSym0 l0 = TypeDictSym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType Let1627472196TSym0 l0 = Let1627472196TSym1 l0 
type Apply (TyFun DBusType DBusType -> *) DBusSimpleType Let1627472186TSym0 l0 = Let1627472186TSym1 l0 

type SDBusType z = Sing z Source

type ArgSym1 t = Arg t Source

data ArgSym0 l Source

Constructors

forall arg . (KindOf (Apply ArgSym0 arg) ~ KindOf (ArgSym1 arg)) => ArgSym0KindInference 

type SParity z = Sing z Source

type Let1627472175T wild_1627472167 = Apply DBusSimpleTypeSym0 wild_1627472167 Source

type Let1627472180T wild_1627472165 = Apply TypeArraySym0 wild_1627472165 Source

type Let1627472186T wild_1627472161 wild_1627472163 = Apply (Apply TypeDictSym0 wild_1627472161) wild_1627472163 Source

type Let1627472196T wild_1627472157 wild_1627472159 = Apply (Apply TypeDictEntrySym0 wild_1627472157) wild_1627472159 Source

type family FlattenRepType a :: [DBusType] Source

Equations

FlattenRepType TypeUnit = `[]` 
FlattenRepType (TypeStruct ts) = ts 
FlattenRepType (DBusSimpleType wild_1627472167) = Apply (Apply (:$) (Let1627472175TSym1 wild_1627472167)) `[]` 
FlattenRepType (TypeArray wild_1627472165) = Apply (Apply (:$) (Let1627472180TSym1 wild_1627472165)) `[]` 
FlattenRepType (TypeDict wild_1627472161 wild_1627472163) = Apply (Apply (:$) (Let1627472186TSym2 wild_1627472161 wild_1627472163)) `[]` 
FlattenRepType (TypeDictEntry wild_1627472157 wild_1627472159) = Apply (Apply (:$) (Let1627472196TSym2 wild_1627472157 wild_1627472159)) `[]` 
FlattenRepType TypeVariant = Apply (Apply (:$) Let1627472204TSym0) `[]` 

data SomeSignal where Source

Constructors

SomeSignal :: SingI a => Signal a -> SomeSignal 

Instances

type family ArgsOf x :: Parity Source

Equations

ArgsOf (IO x) = Null 
ArgsOf (MethodHandlerT IO x) = Null 
ArgsOf (a -> b) = Arg (ArgsOf b) 

type family ArgParity x :: Parity Source

Equations

ArgParity [] = Null 
ArgParity (x : xs) = Arg (ArgParity xs) 

data SomeDBusArguments where Source

Constructors

SDBA :: SingI ts => DBusArguments ts -> SomeDBusArguments 

data DBusStruct :: [DBusType] -> * where Source

Constructors

StructSingleton :: DBusValue a -> DBusStruct `[a]` 
StructCons :: DBusValue a -> DBusStruct as -> DBusStruct (a : as) 

Instances

data SomeDBusStruct where Source

Constructors

SDBS :: SingI ts => DBusStruct ts -> SomeDBusStruct 

data DBusValue :: DBusType -> * where Source

Instances

Eq (DBusValue t) 
SingI DBusType t => Show (DBusValue t) 
SingI DBusType t => Representable (DBusValue t) 
(IsMethod f, SingI DBusType t) => IsMethod (DBusValue t -> f) 
type RepType (DBusValue t) = t 
type ArgTypes (DBusValue t -> f) = (:) DBusType t (ArgTypes f) 
type ResultType (DBusValue t -> f) = ResultType f 

data SomeDBusValue where Source

Constructors

DBV :: SingI t => DBusValue t -> SomeDBusValue 

Instances

fromVariant :: SingI t => DBusValue TypeVariant -> Maybe (DBusValue t) Source

Extract a DBusValue from a Variant iff the type matches or return nothing

class SingI (RepType a) => Representable a where Source

Class of types that can be represented in the D-Bus type system.

The toRep and fromRep functions form a Prism and should follow the "obvious" laws:

  • fromRep (toRep x) == Just x
  • fmap toRep (fromRep x) =<= Just x

(where x =<= y iff x is Nothing or x == y)

All DBusValues represent themselves and instances for the following "canonical" pairs are provided

Haskell type => D-Bus type

  • WordX and IntX => UIntX and IntX respectively (for X in {16, 32, 64})
  • Bool => Boolean
  • Word8 => Byte
  • Double => Double
  • Text => String
  • ObjectPath => ObjectPath
  • DBusType => Signature
  • [a] => Array of a (for Representable a)
  • ByteString => Array of Byte
  • Tuples up to length 20 => Structs of equal length where each of the members is itself Representable
  • Map => Dict where the keys can be represented by a DBusSimpleType

An instance for String is impossible because it conflicts with the instance for lists (use Text instead)

Also note that no Representable instances are provided for Int, Integer and Float.

You can automatically derive an instance for your own Types with makeRepresentable

Associated Types

type RepType a :: DBusType Source

The DBusType that represents this type

Methods

toRep :: a -> DBusValue (RepType a) Source

Conversion from Haskell to D-Bus types

fromRep :: DBusValue (RepType a) -> Maybe a Source

Conversion from D-Bus to Haskell types.

Instances

Representable Bool 
Representable Double 
Representable Int16 
Representable Int32 
Representable Int64 
Representable Word8 
Representable Word16 
Representable Word32 
Representable Word64 
Representable () 
Representable ByteString 
Representable Text 
Representable Signature 
Representable ObjectPath 
Representable Endian 
Representable HeaderField 
Representable HeaderFields 
Representable Flags 
Representable MessageType 
Representable MessageHeader 
(Representable a, SingI DBusType (RepType a)) => Representable [a] 
SingI DBusType t => Representable (DBusValue t) 
(Representable a, Representable b) => Representable (a, b) 
(Ord k, Representable k, (~) DBusType (RepType k) (DBusSimpleType r), SingI DBusSimpleType r, Representable v) => Representable (Map k v) 
(Representable a, Representable b, Representable c) => Representable (a, b, c) 
(Representable a, Representable b, Representable c, Representable d) => Representable (a, b, c, d) 
(Representable a, Representable b, Representable c, Representable d, Representable e) => Representable (a, b, c, d, e) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f) => Representable (a, b, c, d, e, f) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g) => Representable (a, b, c, d, e, f, g) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h) => Representable (a, b, c, d, e, f, g, h) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i) => Representable (a, b, c, d, e, f, g, h, i) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j) => Representable (a, b, c, d, e, f, g, h, i, j) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k) => Representable (a, b, c, d, e, f, g, h, i, j, k) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l) => Representable (a, b, c, d, e, f, g, h, i, j, k, l) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o, Representable p) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o, Representable p, Representable q) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o, Representable p, Representable q, Representable r) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o, Representable p, Representable q, Representable r, Representable s) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) 
(Representable a, Representable b, Representable c, Representable d, Representable e, Representable f, Representable g, Representable h, Representable i, Representable j, Representable k, Representable l, Representable m, Representable n, Representable o, Representable p, Representable q, Representable r, Representable s, Representable t) => Representable (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) 

data MethodWrapper av rv where Source

Constructors

MReturn :: SingI ts => MethodHandlerT IO (DBusArguments ts) -> MethodWrapper [] ts 
MAsk :: SingI t => (DBusValue t -> MethodWrapper avs rv) -> MethodWrapper (t : avs) rv 

data Method where Source

Constructors

Method :: (SingI avs, SingI ts) => MethodWrapper avs ts -> Text -> ArgumentDescription (ArgParity avs) -> ArgumentDescription (ArgParity ts) -> Method 

Instances

data SomeProperty where Source

Constructors

SomeProperty :: forall t. SingI t => Property t -> SomeProperty 

data RemoteProperty a Source

Constructors

RP 

Instances

newtype Object Source

Constructors

Object 

Instances

newtype Objects Source

Constructors

Objects 

Instances

data Match a Source

Constructors

Match a 
MatchAny 

Instances

Show a => Show (Match a) 

checkMatch :: Eq a => Match a -> Match a -> Bool Source

data SomeMethodDescription where Source

Constructors

SMD :: (SingI args, SingI rets) => MethodDescription args rets -> SomeMethodDescription