xcb-types-0.7.1: Parses XML files used by the XCB project

Copyright(c) Antoine Latter 2008
LicenseBSD3
MaintainerAntoine Latter <aslatter@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.XCB.Types

Description

Defines types inteneded to be equivalent to the schema used by the XCB project in their XML protocol description.

Synopsis

Documentation

data GenXHeader typ #

This is what a single XML file maps to. It contains some meta-data then declarations.

Constructors

XHeader 

Fields

Instances

Functor GenXHeader # 

Methods

fmap :: (a -> b) -> GenXHeader a -> GenXHeader b #

(<$) :: a -> GenXHeader b -> GenXHeader a #

Show typ => Show (GenXHeader typ) # 

Methods

showsPrec :: Int -> GenXHeader typ -> ShowS #

show :: GenXHeader typ -> String #

showList :: [GenXHeader typ] -> ShowS #

Pretty a => Pretty (GenXHeader a) # 

Methods

toDoc :: GenXHeader a -> Doc #

pretty :: GenXHeader a -> String #

data GenXDecl typ #

The different types of declarations which can be made in one of the XML files.

Constructors

XStruct Name [GenStructElem typ] 
XTypeDef Name typ 
XEvent Name Int [GenStructElem typ] (Maybe Bool)

The boolean indicates if the event includes a sequence number.

XRequest Name Int [GenStructElem typ] (Maybe (GenXReply typ)) 
XidType Name 
XidUnion Name [GenXidUnionElem typ] 
XEnum Name [EnumElem typ] 
XUnion Name [GenStructElem typ] 
XImport Name 
XError Name Int [GenStructElem typ] 

Instances

Functor GenXDecl # 

Methods

fmap :: (a -> b) -> GenXDecl a -> GenXDecl b #

(<$) :: a -> GenXDecl b -> GenXDecl a #

Show typ => Show (GenXDecl typ) # 

Methods

showsPrec :: Int -> GenXDecl typ -> ShowS #

show :: GenXDecl typ -> String #

showList :: [GenXDecl typ] -> ShowS #

Pretty a => Pretty (GenXDecl a) # 

Methods

toDoc :: GenXDecl a -> Doc #

pretty :: GenXDecl a -> String #

data GenBitCase typ #

Constructors

BitCase (Maybe Name) (Expression typ) [GenStructElem typ] 

Instances

Functor GenBitCase # 

Methods

fmap :: (a -> b) -> GenBitCase a -> GenBitCase b #

(<$) :: a -> GenBitCase b -> GenBitCase a #

Show typ => Show (GenBitCase typ) # 

Methods

showsPrec :: Int -> GenBitCase typ -> ShowS #

show :: GenBitCase typ -> String #

showList :: [GenBitCase typ] -> ShowS #

Pretty a => Pretty (GenBitCase a) # 

Methods

toDoc :: GenBitCase a -> Doc #

pretty :: GenBitCase a -> String #

type GenXReply typ = [GenStructElem typ] #

data EnumElem typ #

Constructors

EnumElem Name (Maybe (Expression typ)) 

Instances

Functor EnumElem # 

Methods

fmap :: (a -> b) -> EnumElem a -> EnumElem b #

(<$) :: a -> EnumElem b -> EnumElem a #

Show typ => Show (EnumElem typ) # 

Methods

showsPrec :: Int -> EnumElem typ -> ShowS #

show :: EnumElem typ -> String #

showList :: [EnumElem typ] -> ShowS #

Pretty a => Pretty (EnumElem a) # 

Methods

toDoc :: EnumElem a -> Doc #

pretty :: EnumElem a -> String #

data Expression typ #

Declarations may contain expressions from this small language

Constructors

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

Instances

Functor Expression # 

Methods

fmap :: (a -> b) -> Expression a -> Expression b #

(<$) :: a -> Expression b -> Expression a #

Show typ => Show (Expression typ) # 

Methods

showsPrec :: Int -> Expression typ -> ShowS #

show :: Expression typ -> String #

showList :: [Expression typ] -> ShowS #

Pretty a => Pretty (Expression a) # 

Methods

toDoc :: Expression a -> Doc #

pretty :: Expression a -> String #

data Binop #

Supported Binary operations.

Constructors

Add 
Sub 
Mult 
Div 
And 
RShift 

Instances

Show Binop # 

Methods

showsPrec :: Int -> Binop -> ShowS #

show :: Binop -> String #

showList :: [Binop] -> ShowS #

Pretty Binop # 

Methods

toDoc :: Binop -> Doc #

pretty :: Binop -> String #

data Unop #

Constructors

Complement 

Instances

Show Unop # 

Methods

showsPrec :: Int -> Unop -> ShowS #

show :: Unop -> String #

showList :: [Unop] -> ShowS #

Pretty Unop # 

Methods

toDoc :: Unop -> Doc #

pretty :: Unop -> String #

data Type #

Types may include a reference to the containing module.

Instances

Eq Type # 

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type # 

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Show Type # 

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Pretty Type # 

Methods

toDoc :: Type -> Doc #

pretty :: Type -> String #

type EnumVals typ = typ #

type MaskVals typ = typ #

type Name = String #

type Ref = String #

type MaskName = Name #

type ListName = Name #