Copyright | (c) Antoine Latter 2008 |
---|---|
License | BSD3 |
Maintainer | Antoine Latter <aslatter@gmail.com> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Defines types inteneded to be equivalent to the schema used by the XCB project in their XML protocol description.
Synopsis
- 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) (Maybe Bool) [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 PadType 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
- | Length typ (Expression typ)
- 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
- data PadType
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 | |
|
Instances
Functor GenXHeader Source # | |
Defined in Data.XCB.Types fmap :: (a -> b) -> GenXHeader a -> GenXHeader b # (<$) :: a -> GenXHeader b -> GenXHeader a # | |
Show typ => Show (GenXHeader typ) Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> GenXHeader typ -> ShowS # show :: GenXHeader typ -> String # showList :: [GenXHeader typ] -> ShowS # | |
Pretty a => Pretty (GenXHeader a) Source # | |
Defined in Data.XCB.Pretty toDoc :: GenXHeader a -> Doc Source # pretty :: GenXHeader a -> String 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) (Maybe Bool) [GenStructElem typ] (Maybe Bool) | bools: #1 if xge is true; #2 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 PadType 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 | |
Length typ (Expression typ) |
Instances
Functor GenStructElem Source # | |
Defined in Data.XCB.Types fmap :: (a -> b) -> GenStructElem a -> GenStructElem b # (<$) :: a -> GenStructElem b -> GenStructElem a # | |
Show typ => Show (GenStructElem typ) Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> GenStructElem typ -> ShowS # show :: GenStructElem typ -> String # showList :: [GenStructElem typ] -> ShowS # | |
Pretty a => Pretty (GenStructElem a) Source # | |
Defined in Data.XCB.Pretty toDoc :: GenStructElem a -> Doc Source # pretty :: GenStructElem a -> String Source # |
data GenBitCase typ Source #
BitCase (Maybe Name) (Expression typ) (Maybe Alignment) [GenStructElem typ] |
Instances
Functor GenBitCase Source # | |
Defined in Data.XCB.Types fmap :: (a -> b) -> GenBitCase a -> GenBitCase b # (<$) :: a -> GenBitCase b -> GenBitCase a # | |
Show typ => Show (GenBitCase typ) Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> GenBitCase typ -> ShowS # show :: GenBitCase typ -> String # showList :: [GenBitCase typ] -> ShowS # | |
Pretty a => Pretty (GenBitCase a) Source # | |
Defined in Data.XCB.Pretty toDoc :: GenBitCase a -> Doc Source # pretty :: GenBitCase a -> String Source # |
GenXReply (Maybe Alignment) [GenStructElem typ] |
data GenXidUnionElem typ Source #
XidUnionElem typ |
Instances
Functor GenXidUnionElem Source # | |
Defined in Data.XCB.Types fmap :: (a -> b) -> GenXidUnionElem a -> GenXidUnionElem b # (<$) :: a -> GenXidUnionElem b -> GenXidUnionElem a # | |
Show typ => Show (GenXidUnionElem typ) Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> GenXidUnionElem typ -> ShowS # show :: GenXidUnionElem typ -> String # showList :: [GenXidUnionElem typ] -> ShowS # | |
Pretty a => Pretty (GenXidUnionElem a) Source # | |
Defined in Data.XCB.Pretty toDoc :: GenXidUnionElem a -> Doc Source # pretty :: GenXidUnionElem a -> String 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. |
Instances
Functor Expression Source # | |
Defined in Data.XCB.Types fmap :: (a -> b) -> Expression a -> Expression b # (<$) :: a -> Expression b -> Expression a # | |
Show typ => Show (Expression typ) Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> Expression typ -> ShowS # show :: Expression typ -> String # showList :: [Expression typ] -> ShowS # | |
Pretty a => Pretty (Expression a) Source # | |
Defined in Data.XCB.Pretty toDoc :: Expression a -> Doc Source # pretty :: Expression a -> String Source # |
Supported Binary operations.
Types may include a reference to the containing module.
type MaskPadding = Int Source #
data AllowedEvent Source #
Instances
Show AllowedEvent Source # | |
Defined in Data.XCB.Types showsPrec :: Int -> AllowedEvent -> ShowS # show :: AllowedEvent -> String # showList :: [AllowedEvent] -> ShowS # | |
Pretty AllowedEvent Source # | |
Defined in Data.XCB.Pretty toDoc :: AllowedEvent -> Doc Source # pretty :: AllowedEvent -> String Source # |