xcb-types 0.3.0 → 0.4.0
raw patch · 4 files changed
+21/−12 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.XCB.Types: type AltEnumVals = Type
+ Data.XCB.Types: type EnumVals = Type
+ Data.XCB.Types: type MaskVals = Type
- Data.XCB.Types: List :: Name -> Type -> (Maybe Expression) -> StructElem
+ Data.XCB.Types: List :: Name -> Type -> (Maybe Expression) -> (Maybe EnumVals) -> StructElem
- Data.XCB.Types: SField :: Name -> Type -> StructElem
+ Data.XCB.Types: SField :: Name -> Type -> (Maybe EnumVals) -> (Maybe MaskVals) -> StructElem
Files
- Data/XCB/FromXML.hs +5/−2
- Data/XCB/Pretty.hs +8/−6
- Data/XCB/Types.hs +6/−2
- xcb-types.cabal +2/−2
Data/XCB/FromXML.hs view
@@ -303,8 +303,10 @@ structField elem | elem `named` "field" = do typ <- liftM mkType $ elem `attr` "type"+ let enum = liftM mkType $ elem `attr` "enum"+ let mask = liftM mkType $ elem `attr` "mask" name <- elem `attr` "name"- return $ SField name typ+ return $ SField name typ enum mask | elem `named` "pad" = do bytes <- elem `attr` "bytes" >>= readM@@ -313,8 +315,9 @@ | elem `named` "list" = do typ <- liftM mkType $ elem `attr` "type" name <- elem `attr` "name"+ let enum = liftM mkType $ elem `attr` "enum" let expr = firstChild elem >>= expression- return $ List name typ expr+ return $ List name typ expr enum | elem `named` "valueparam" = do mask_typ <- liftM mkType $ elem `attr` "value-mask-type"
Data/XCB/Pretty.hs view
@@ -80,12 +80,14 @@ instance Pretty StructElem where toDoc (Pad n) = braces $ toDoc n <+> text "bytes"- toDoc (List nm typ len)- = text nm <+> text "::" <+> brackets (toDoc typ) <+> toDoc len- toDoc (SField nm typ) = hsep [text nm- ,text "::"- ,toDoc typ- ]+ toDoc (List nm typ len enums)+ = text nm <+> text "::" <+> brackets (toDoc typ <+> toDoc enums) <+> toDoc len+ toDoc (SField nm typ enums mask) = hsep [text nm+ ,text "::"+ ,toDoc typ+ ,toDoc enums+ ,toDoc mask+ ] toDoc (ExprField nm typ expr) = parens (text nm <+> text "::" <+> toDoc typ) <+> toDoc expr
Data/XCB/Types.hs view
@@ -51,11 +51,15 @@ deriving (Show) data StructElem = Pad Int- | List Name Type (Maybe Expression)- | SField Name Type+ | List Name Type (Maybe Expression) (Maybe EnumVals)+ | SField Name Type (Maybe EnumVals) (Maybe MaskVals) | ExprField Name Type Expression | ValueParam Type MaskName (Maybe MaskPadding) ListName deriving (Show)++type AltEnumVals = Type+type EnumVals = Type+type MaskVals = Type type Name = String type XReply = [StructElem]
xcb-types.cabal view
@@ -1,5 +1,5 @@ Name: xcb-types-Version: 0.3.0+Version: 0.4.0 Cabal-Version: >= 1.2 Synopsis: Parses XML files used by the XCB project Description: This package provides types which mirror the structures@@ -17,7 +17,7 @@ to learn XSLT, this package should help. . This version of xcb-types is intended to fully parse the X Protocol- description version 1.3.+ description version 1.4. License: BSD3 License-file: LICENSE