Copyright | (c) Antoine Latter 2008 |
---|---|
License | BSD3 |
Maintainer | Antoine Latter <aslatter@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Defines types inteneded to be equivalent to the schema used by the XCB project in their XML protocol description.
- type XHeader = GenXHeader Type
- type XDecl = GenXDecl Type
- type StructElem = GenStructElem Type
- type XEnumElem = EnumElem Type
- type BitCase = GenBitCase Type
- type XidUnionElem = GenXidUnionElem Type
- type XReply = GenXReply Type
- type XExpression = Expression Type
- data GenXHeader typ = XHeader {}
- data GenXDecl typ
- = XStruct Name (Maybe Alignment) [GenStructElem typ]
- | XTypeDef Name typ
- | XEvent Name Int (Maybe Alignment) [GenStructElem typ] (Maybe Bool)
- | XRequest Name Int (Maybe Alignment) [GenStructElem typ] (Maybe (GenXReply typ))
- | XidType Name
- | XidUnion Name [GenXidUnionElem typ]
- | XEnum Name [EnumElem typ]
- | XUnion Name (Maybe Alignment) [GenStructElem typ]
- | XImport Name
- | XError Name Int (Maybe Alignment) [GenStructElem typ]
- | XEventStruct Name [AllowedEvent]
- data GenStructElem typ
- = Pad Int
- | List Name typ (Maybe (Expression typ)) (Maybe (EnumVals typ))
- | SField Name typ (Maybe (EnumVals typ)) (Maybe (MaskVals typ))
- | ExprField Name typ (Expression typ)
- | ValueParam typ Name (Maybe MaskPadding) ListName
- | Switch Name (Expression typ) (Maybe Alignment) [GenBitCase typ]
- | Doc (Maybe String) (Map Name String) [(String, String)]
- | Fd String
- data GenBitCase typ = BitCase (Maybe Name) (Expression typ) (Maybe Alignment) [GenStructElem typ]
- data GenXReply typ = GenXReply (Maybe Alignment) [GenStructElem typ]
- data GenXidUnionElem typ = XidUnionElem typ
- data EnumElem typ = EnumElem Name (Maybe (Expression typ))
- data Expression typ
- data Binop
- data Unop = Complement
- data Type
- type EnumVals typ = typ
- type MaskVals typ = typ
- type Name = String
- type Ref = String
- type MaskName = Name
- type ListName = Name
- type MaskPadding = Int
- data Alignment = Alignment Int Int
- data AllowedEvent = AllowedEvent Name Bool Int Int
Documentation
type XHeader = GenXHeader Type Source #
type StructElem = GenStructElem Type Source #
type BitCase = GenBitCase Type Source #
type XidUnionElem = GenXidUnionElem Type Source #
type XExpression = Expression Type Source #
data GenXHeader typ Source #
This is what a single XML file maps to. It contains some meta-data then declarations.
XHeader | |
|
Functor GenXHeader Source # | |
Show typ => Show (GenXHeader typ) Source # | |
Pretty a => Pretty (GenXHeader a) Source # | |
The different types of declarations which can be made in one of the XML files.
XStruct Name (Maybe Alignment) [GenStructElem typ] | |
XTypeDef Name typ | |
XEvent Name Int (Maybe Alignment) [GenStructElem typ] (Maybe Bool) | The boolean indicates if the event includes a sequence number. |
XRequest Name Int (Maybe Alignment) [GenStructElem typ] (Maybe (GenXReply typ)) | |
XidType Name | |
XidUnion Name [GenXidUnionElem typ] | |
XEnum Name [EnumElem typ] | |
XUnion Name (Maybe Alignment) [GenStructElem typ] | |
XImport Name | |
XError Name Int (Maybe Alignment) [GenStructElem typ] | |
XEventStruct Name [AllowedEvent] |
data GenStructElem typ Source #
Pad Int | |
List Name typ (Maybe (Expression typ)) (Maybe (EnumVals typ)) | |
SField Name typ (Maybe (EnumVals typ)) (Maybe (MaskVals typ)) | |
ExprField Name typ (Expression typ) | |
ValueParam typ Name (Maybe MaskPadding) ListName | |
Switch Name (Expression typ) (Maybe Alignment) [GenBitCase typ] | |
Doc (Maybe String) (Map Name String) [(String, String)] | |
Fd String |
Functor GenStructElem Source # | |
Show typ => Show (GenStructElem typ) Source # | |
Pretty a => Pretty (GenStructElem a) Source # | |
data GenBitCase typ Source #
BitCase (Maybe Name) (Expression typ) (Maybe Alignment) [GenStructElem typ] |
Functor GenBitCase Source # | |
Show typ => Show (GenBitCase typ) Source # | |
Pretty a => Pretty (GenBitCase a) Source # | |
GenXReply (Maybe Alignment) [GenStructElem typ] |
data GenXidUnionElem typ Source #
XidUnionElem typ |
Functor GenXidUnionElem Source # | |
Show typ => Show (GenXidUnionElem typ) Source # | |
Pretty a => Pretty (GenXidUnionElem a) Source # | |
EnumElem Name (Maybe (Expression typ)) |
data Expression typ Source #
Declarations may contain expressions from this small language
Value Int | A literal value |
Bit Int | A log-base-2 literal value |
FieldRef Name | A reference to a field in the same declaration |
EnumRef typ Name | A reference to a member of an enum. |
PopCount (Expression typ) | Calculate the number of set bits in the argument |
SumOf Name | Note sure. The argument should be a reference to a list |
Op Binop (Expression typ) (Expression typ) | A binary opeation |
Unop Unop (Expression typ) | A unary operation |
ParamRef Name | I think this is the name of an argument passed to the request. See fffbd04d63 in xcb-proto. |
Functor Expression Source # | |
Show typ => Show (Expression typ) Source # | |
Pretty a => Pretty (Expression a) Source # | |
Supported Binary operations.
Types may include a reference to the containing module.
type MaskPadding = Int Source #