packages feed

fltkhs 0.5.1.2 → 0.5.1.3

raw patch · 7 files changed

+46/−25 lines, 7 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Fl_Types.WrapType
+ Graphics.UI.FLTK.LowLevel.Fl_Types: ColumnNumber :: Int -> ColumnNumber
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtBoundsFl :: WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtColumnFl :: WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtPixelFl :: WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapNoneFl :: WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: data WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Classes.Eq Graphics.UI.FLTK.LowLevel.Fl_Types.ColumnNumber
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Classes.Eq Graphics.UI.FLTK.LowLevel.Fl_Types.WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Classes.Ord Graphics.UI.FLTK.LowLevel.Fl_Types.ColumnNumber
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Enum.Enum Graphics.UI.FLTK.LowLevel.Fl_Types.WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Fl_Types.ColumnNumber
+ Graphics.UI.FLTK.LowLevel.Fl_Types: instance GHC.Show.Show Graphics.UI.FLTK.LowLevel.Fl_Types.WrapTypeFl
+ Graphics.UI.FLTK.LowLevel.Fl_Types: newtype ColumnNumber
+ Graphics.UI.FLTK.LowLevel.Fl_Types: toPosition :: (Int, Int) -> Position
+ Graphics.UI.FLTK.LowLevel.Hierarchy: data WrapMode a
+ Graphics.UI.FLTK.LowLevel.Hierarchy: wrapMode :: (HasCallStack, Match r ~ FindOp a a (WrapMode ()), Op (WrapMode ()) r a impl) => Ref a -> impl
+ Graphics.UI.FLTK.LowLevel.TextDisplay: instance impl ~ (Graphics.UI.FLTK.LowLevel.Fl_Types.WrapType -> GHC.Types.IO ()) => Graphics.UI.FLTK.LowLevel.Dispatch.Op (Graphics.UI.FLTK.LowLevel.Hierarchy.WrapMode ()) Graphics.UI.FLTK.LowLevel.Hierarchy.TextDisplay orig impl
- Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtColumn :: WrapType
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtColumn :: ColumnNumber -> WrapType
- Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtPixel :: WrapType
+ Graphics.UI.FLTK.LowLevel.Fl_Types: WrapAtPixel :: PixelPosition -> WrapType

Files

fltkhs.cabal view
@@ -1,5 +1,5 @@ name : fltkhs-version : 0.5.1.2+version : 0.5.1.3 synopsis : FLTK bindings description:     Low level bindings for the FLTK GUI toolkit. For installation and quick start instruction please scroll all the way down to the README.
src/Fluid/Parser.hs view
@@ -48,31 +48,31 @@ quotedP   :: ParsecT String a Identity BracedStringParts quotedP =-  let charCodeP :: Char -> Char -> ParsecT String a Identity BracedStringParts+  let charCodeP :: Char -> String -> ParsecT String a Identity BracedStringParts       charCodeP c code = (char c) >> return (QuotedCharCode code)   in foldl1 (<|>)             ((map try-                  [charCodeP 'a' '\a'-                  ,charCodeP 'b' '\b'-                  ,charCodeP 'a' '\a'-                  ,charCodeP 'b' '\b'-                  ,charCodeP 'f' '\f'-                  ,charCodeP '\n' '\n'-                  ,charCodeP 'r' '\r'-                  ,charCodeP 't' '\t'-                  ,charCodeP 'v' '\v'+                  [charCodeP 'a' "\\a"+                  ,charCodeP 'b' "\\b"+                  ,charCodeP 'a' "\\a"+                  ,charCodeP 'b' "\\b"+                  ,charCodeP 'f' "\\f"+                  ,charCodeP 'n' "\\n"+                  ,charCodeP 'r' "\\r"+                  ,charCodeP 't' "\\t"+                  ,charCodeP 'v' "\\v"                   ,((char 'x') >> hexP >>= return . QuotedHex)                   ,(octalP >>= return . QuotedOctal)]) ++              [(anyChar >>=                \c ->-                 return (QuotedChar (['\\'] ++ [c])))])+                 return (QuotedChar ("\\" ++ [c])))])  bracedContentsP   :: ParsecT String () Identity [BracedStringParts] bracedContentsP = char '{' >> go (0 :: Int) []   where go nesting accum =           (try $-           do _ <- char '\\'+           do _ <- string "\\\\"               quoted <- quotedP               go nesting (accum ++ [quoted])) <|>           (try $@@ -89,8 +89,8 @@           (try $ (trimAfter $ char '}') >> return accum) <|>           (do bare <-                 manyTill anyChar-                         ((lookAhead $ char '\\') <|> (lookAhead $ char '{') <|>-                          (lookAhead $ char '}'))+                         ((lookAhead $ string "\\\\") <|> (lookAhead $ string "{") <|>+                          (lookAhead $ string "}"))               go nesting (accum ++ [BareString bare]))  unbrokenString
src/Fluid/Types.hs view
@@ -125,7 +125,7 @@  data BracedStringParts   = BareString String-  | QuotedCharCode Char+  | QuotedCharCode String   | QuotedHex Integer   | QuotedOctal Integer   | QuotedChar String
src/Fluid/Utils.hs view
@@ -1,13 +1,14 @@ module Utils (collapseParts, collapseString) where import Types import Numeric+import Debug.Trace  collapseParts :: [BracedStringParts] -> String collapseParts parts = go parts []   where go ((BareString s):_parts) accum =           go _parts (accum ++ s)         go ((QuotedCharCode c):_parts) accum =-          go _parts (accum ++ "\\" ++ [c])+          go _parts (accum ++ c)         go ((QuotedHex h):_parts) accum =           go _parts (accum ++ "0x" ++ (showHex h ""))         go ((QuotedOctal o):_parts) accum =
src/Graphics/UI/FLTK/LowLevel/Fl_Types.chs view
@@ -126,11 +126,11 @@     DragWord = DRAG_WORD,     DragLine = DRAG_LINE   };-  enum WrapType {-    WrapNone = WRAP_NONE,-    WrapAtColumn = WRAP_AT_COLUMN,-    WrapAtPixel = WRAP_AT_PIXEL,-    WrapAtBounds = WRAP_AT_BOUNDS+  enum WrapTypeFl {+    WrapNoneFl = WRAP_NONE,+    WrapAtColumnFl = WRAP_AT_COLUMN,+    WrapAtPixelFl = WRAP_AT_PIXEL,+    WrapAtBoundsFl = WRAP_AT_BOUNDS   };   enum PageFormat {     A0 = 0,@@ -238,7 +238,8 @@ {#enum CursorType {} deriving (Show, Eq) #} {#enum PositionType {} deriving (Show, Eq) #} {#enum DragType {} deriving (Show, Eq) #}-{#enum WrapType {} deriving (Show, Eq) #}+{#enum WrapTypeFl {} deriving (Show, Eq) #}+data WrapType = WrapNone | WrapAtColumn ColumnNumber | WrapAtPixel PixelPosition | WrapAtBounds deriving (Eq, Show) {#enum PageFormat {} deriving (Show, Eq) #} {#enum PageLayout {} deriving (Show, Eq) #} {#enum TableRowSelectMode {} deriving (Show, Eq)  #}@@ -335,6 +336,7 @@ data Intersection = Contained | Partial deriving Show data Size = Size Width Height deriving (Eq, Show) newtype LineNumber = LineNumber Int deriving (Eq,Show,Ord)+newtype ColumnNumber = ColumnNumber Int deriving (Eq, Show, Ord) newtype PixelPosition = PixelPosition Int deriving (Eq,Show,Ord) data KeyType = SpecialKeyType SpecialKey | NormalKeyType Char deriving (Show, Eq) data ShortcutKeySequence = ShortcutKeySequence [EventState] KeyType deriving Show@@ -389,6 +391,9 @@  toSize :: (Int, Int) -> Size toSize (width', height') = Size (Width width') (Height height')++toPosition :: (Int,Int) -> Position+toPosition (xPos', yPos') = Position (X xPos') (Y yPos')  throwStackOnError :: IO a -> IO a throwStackOnError f =
src/Graphics/UI/FLTK/LowLevel/Hierarchy.hs view
@@ -1436,6 +1436,8 @@          setLinenumberFormat,          GetLinenumberFormat,          getLinenumberFormat,+         WrapMode,+         wrapMode,          -- * TextEditor          TextEditor,          SetInsertMode,@@ -3970,7 +3972,8 @@   (GetLinenumberAlign   (SetLinenumberFormat   (GetLinenumberFormat-  ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))+  (WrapMode+  ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  type instance Functions TextDisplay = TextDisplayFuncs @@ -4012,6 +4015,7 @@ MAKE_METHOD(GetLinenumberAlign,getLinenumberAlign) MAKE_METHOD(SetLinenumberFormat,setLinenumberFormat) MAKE_METHOD(GetLinenumberFormat,getLinenumberFormat)+MAKE_METHOD(WrapMode,wrapMode)  data CTextEditor parent type TextEditor = CTextEditor TextDisplay
src/Graphics/UI/FLTK/LowLevel/TextDisplay.chs view
@@ -285,6 +285,16 @@ {# fun linenumber_format as linenumberFormat' { id `Ptr ()' } -> `T.Text' unsafeFromCString #} instance (impl ~ ( IO T.Text)) => Op (GetLinenumberFormat ()) TextDisplay orig impl where    runOp _ _ text_display = withRef text_display $ \text_displayPtr -> linenumberFormat' text_displayPtr+{# fun Fl_Text_Display_wrap_mode as wrapMode' { id `Ptr ()', `CInt', `CInt'} -> `()' #}+instance (impl ~ (WrapType -> IO ())) => Op (WrapMode ()) TextDisplay orig impl where+  runOp _ _ textDisplay wt =+    withRef textDisplay $ \textDisplayPtr ->+      (case wt of+        (WrapAtPixel (PixelPosition p')) -> wrapMode' textDisplayPtr ((fromIntegral . fromEnum) WrapAtPixelFl) (fromIntegral p')+        (WrapAtColumn (ColumnNumber c')) -> wrapMode' textDisplayPtr ((fromIntegral . fromEnum) WrapAtColumnFl) (fromIntegral c')+        WrapAtBounds -> wrapMode' textDisplayPtr ((fromIntegral . fromEnum) WrapAtBoundsFl) (fromIntegral (0 :: Int))+        WrapNone -> wrapMode' textDisplayPtr ((fromIntegral . fromEnum) WrapNoneFl) (fromIntegral (0 :: Int))+      ) {# fun Fl_Text_Display_draw as draw'' { id `Ptr ()' } -> `()' #} instance (impl ~ (  IO ())) => Op (Draw ()) TextDisplay orig impl where   runOp _ _ textDisplay = withRef textDisplay $ \textDisplayPtr -> draw'' textDisplayPtr@@ -329,7 +339,6 @@ --  | --  v -- "Graphics.UI.FLTK.LowLevel.TextDisplay"- -- @  -- $functions@@ -467,6 +476,8 @@ -- wordEnd :: 'Ref' 'TextDisplay' -> 'BufferOffset' -> 'IO' ('BufferOffset') -- -- wordStart :: 'Ref' 'TextDisplay' -> 'BufferOffset' -> 'IO' ('BufferOffset')+--+-- wrapMode :: 'Ref' 'TextDisplay' -> 'WrapType' -> 'IO' () -- -- xToCol :: 'Ref' 'TextDisplay' -> 'Double' -> 'IO' ('Double') -- @