Hello community, here is the log from the commit of package ghc-vty for openSUSE:Factory checked in at 2020-10-23 15:15:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-vty (Old) and /work/SRC/openSUSE:Factory/.ghc-vty.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-vty" Fri Oct 23 15:15:25 2020 rev:4 rq:842775 version:5.31 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-vty/ghc-vty.changes 2020-08-28 21:41:00.560879113 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-vty.new.3463/ghc-vty.changes 2020-10-23 15:15:28.754167004 +0200 @@ -1,0 +2,20 @@ +Tue Oct 6 08:55:52 UTC 2020 - psim...@suse.com + +- Update vty to version 5.31. + 5.31 + ---- + + New features and API changes: + * Added support for strikethrough mode. This change adds a new + `strikethrough` `Style` value and uses the `smxx` and `rmxx` + Terminfo capabilities to activate and deactivate strikethrough mode, + respectively. If the terminfo does not report those capabilities, + this style is ignored. + * `Output`: added the `setDisplayBounds` field to set the output + dimensions of the output handle; added an implementation of this for + the `TerminfoBased` backend. + + Other changes: + * The C prototype for `vty_c_get_window_size` in `gwinsz.h` was fixed. + +------------------------------------------------------------------- Old: ---- vty-5.30.tar.gz New: ---- vty-5.31.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-vty.spec ++++++ --- /var/tmp/diff_new_pack.vBddsG/_old 2020-10-23 15:15:31.194168181 +0200 +++ /var/tmp/diff_new_pack.vBddsG/_new 2020-10-23 15:15:31.198168183 +0200 @@ -19,7 +19,7 @@ %global pkg_name vty %bcond_with tests Name: ghc-%{pkg_name} -Version: 5.30 +Version: 5.31 Release: 0 Summary: A simple terminal UI library License: BSD-3-Clause ++++++ vty-5.30.tar.gz -> vty-5.31.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/CHANGELOG.md new/vty-5.31/CHANGELOG.md --- old/vty-5.30/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -1,4 +1,20 @@ +5.31 +---- + +New features and API changes: + * Added support for strikethrough mode. This change adds a new + `strikethrough` `Style` value and uses the `smxx` and `rmxx` + Terminfo capabilities to activate and deactivate strikethrough mode, + respectively. If the terminfo does not report those capabilities, + this style is ignored. + * `Output`: added the `setDisplayBounds` field to set the output + dimensions of the output handle; added an implementation of this for + the `TerminfoBased` backend. + +Other changes: + * The C prototype for `vty_c_get_window_size` in `gwinsz.h` was fixed. + 5.30 ---- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/LICENSE new/vty-5.31/LICENSE --- old/vty-5.30/LICENSE 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/LICENSE 2001-09-09 03:46:40.000000000 +0200 @@ -1,3 +1,5 @@ +BSD 3-Clause License + Copyright Stefan O'Rear 2006, Corey O'Connor 2008, Corey O'Connor 2009 All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/cbits/gwinsz.c new/vty-5.31/cbits/gwinsz.c --- old/vty-5.30/cbits/gwinsz.c 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/cbits/gwinsz.c 2001-09-09 03:46:40.000000000 +0200 @@ -1,9 +1,18 @@ #include <sys/ioctl.h> unsigned long vty_c_get_window_size(int fd) { - struct winsize w; - if (ioctl (fd, TIOCGWINSZ, &w) >= 0) - return (w.ws_row << 16) + w.ws_col; - else - return 0x190050; + struct winsize w; + if (ioctl (fd, TIOCGWINSZ, &w) >= 0) + return (w.ws_row << 16) + w.ws_col; + else + return 0x190050; +} + +void vty_c_set_window_size(int fd, unsigned long val) { + struct winsize w; + if (ioctl(fd, TIOCGWINSZ, &w) >= 0) { + w.ws_row = val >> 16; + w.ws_col = val & 0xFFFF; + ioctl(fd, TIOCSWINSZ, &w); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/Attributes.hs new/vty-5.31/src/Graphics/Vty/Attributes.hs --- old/vty-5.30/src/Graphics/Vty/Attributes.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/Attributes.hs 2001-09-09 03:46:40.000000000 +0200 @@ -43,6 +43,7 @@ , withStyle , standout , italic + , strikethrough , underline , reverseVideo , blink @@ -181,7 +182,7 @@ -- if the style attribute should not be applied. type Style = Word8 --- | The 7 possible style attributes: +-- | Valid style attributes include: -- -- * standout -- @@ -197,9 +198,11 @@ -- -- * italic -- +-- * strikethrough (via the smxx/rmxx terminfo capabilities) +-- -- (The invisible, protect, and altcharset display attributes some -- terminals support are not supported via VTY.) -standout, underline, reverseVideo, blink, dim, bold, italic :: Style +standout, underline, reverseVideo, blink, dim, bold, italic, strikethrough :: Style standout = 0x01 underline = 0x02 reverseVideo = 0x04 @@ -207,6 +210,7 @@ dim = 0x10 bold = 0x20 italic = 0x40 +strikethrough = 0x80 defaultStyleMask :: Style defaultStyleMask = 0x00 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/DisplayAttributes.hs new/vty-5.31/src/Graphics/Vty/DisplayAttributes.hs --- old/vty-5.30/src/Graphics/Vty/DisplayAttributes.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/DisplayAttributes.hs 2001-09-09 03:46:40.000000000 +0200 @@ -96,6 +96,8 @@ | RemoveStandout | ApplyItalic | RemoveItalic + | ApplyStrikethrough + | RemoveStrikethrough | ApplyUnderline | RemoveUnderline | ApplyReverseVideo @@ -144,6 +146,7 @@ [ styleDiff standout ApplyStandout RemoveStandout , styleDiff underline ApplyUnderline RemoveUnderline , styleDiff italic ApplyItalic RemoveItalic + , styleDiff strikethrough ApplyStrikethrough RemoveStrikethrough , styleDiff reverseVideo ApplyReverseVideo RemoveReverseVideo , styleDiff blink ApplyBlink RemoveBlink , styleDiff dim ApplyDim RemoveDim diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/Output/Interface.hs new/vty-5.31/src/Graphics/Vty/Output/Interface.hs --- old/vty-5.30/src/Graphics/Vty/Output/Interface.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/Output/Interface.hs 2001-09-09 03:46:40.000000000 +0200 @@ -73,6 +73,8 @@ -- | Return the display to the state before `reserveDisplay` If no -- previous state then set the display state to the initial state. , releaseDisplay :: IO () + -- | Sets the current display bounds (width, height). + , setDisplayBounds :: (Int, Int) -> IO () -- | Returns the current display bounds. , displayBounds :: IO DisplayRegion -- | Output the bytestring to the terminal device. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/Output/Mock.hs new/vty-5.31/src/Graphics/Vty/Output/Mock.hs --- old/vty-5.30/src/Graphics/Vty/Output/Mock.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/Output/Mock.hs 2001-09-09 03:46:40.000000000 +0200 @@ -48,6 +48,7 @@ , releaseDisplay = return () , ringTerminalBell = return () , supportsBell = return False + , setDisplayBounds = const $ return () , displayBounds = return r , outputByteBuffer = \bytes -> do putStrLn $ "mock outputByteBuffer of " ++ show (BS.length bytes) ++ " bytes" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/Output/TerminfoBased.hs new/vty-5.31/src/Graphics/Vty/Output/TerminfoBased.hs --- old/vty-5.30/src/Graphics/Vty/Output/TerminfoBased.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/Output/TerminfoBased.hs 2001-09-09 03:46:40.000000000 +0200 @@ -10,10 +10,12 @@ -- Copyright Corey O'Connor (coreyocon...@gmail.com) module Graphics.Vty.Output.TerminfoBased ( reserveTerminal + , setWindowSize ) where import Control.Monad (when) +import Data.Bits (shiftL) import qualified Data.ByteString as BS import Data.ByteString.Internal (toForeignPtr) import Data.Terminfo.Parse @@ -66,6 +68,8 @@ , exitStandout :: Maybe CapExpression , enterItalic :: Maybe CapExpression , exitItalic :: Maybe CapExpression + , enterStrikethrough :: Maybe CapExpression + , exitStrikethrough :: Maybe CapExpression , enterUnderline :: Maybe CapExpression , exitUnderline :: Maybe CapExpression , enterReverseVideo :: Maybe CapExpression @@ -174,6 +178,8 @@ , releaseDisplay = do maybeSendCap rmcup [] maybeSendCap cnorm [] + , setDisplayBounds = \(w, h) -> + setWindowSize outFd (w, h) , displayBounds = do rawSize <- getWindowSize outFd case rawSize of @@ -231,6 +237,8 @@ <*> probeCap ti "rmso" <*> probeCap ti "sitm" <*> probeCap ti "ritm" + <*> probeCap ti "smxx" + <*> probeCap ti "rmxx" <*> probeCap ti "smul" <*> probeCap ti "rmul" <*> probeCap ti "rev" @@ -244,6 +252,13 @@ (a,b) <- (`divMod` 65536) `fmap` c_getWindowSize fd return (fromIntegral b, fromIntegral a) +foreign import ccall "gwinsz.h vty_c_set_window_size" c_setWindowSize :: Fd -> CLong -> IO () + +setWindowSize :: Fd -> (Int, Int) -> IO () +setWindowSize fd (w, h) = do + let val = (h `shiftL` 16) + w + c_setWindowSize fd $ fromIntegral val + terminfoDisplayContext :: Output -> TerminfoCaps -> DisplayRegion -> IO DisplayContext terminfoDisplayContext tActual terminfoCaps r = return dc where dc = DisplayContext @@ -259,7 +274,11 @@ , writeSetAttr = terminfoWriteSetAttr dc terminfoCaps , writeDefaultAttr = \urlsEnabled -> writeCapExpr (setDefaultAttr terminfoCaps) [] `mappend` - (if urlsEnabled then writeURLEscapes EndLink else mempty) + (if urlsEnabled then writeURLEscapes EndLink else mempty) `mappend` + (case exitStrikethrough $ displayAttrCaps terminfoCaps of + Just cap -> writeCapExpr cap [] + Nothing -> mempty + ) , writeRowEnd = writeCapExpr (clearEol terminfoCaps) [] , inlineHack = return () } @@ -337,6 +356,7 @@ ) (sgrArgsForState state) `mappend` setItalics + `mappend` setStrikethrough `mappend` setColors -- Otherwise the display colors are not changing or changing -- between two non-default points. @@ -364,6 +384,7 @@ ) (sgrArgsForState state) `mappend` setItalics + `mappend` setStrikethrough `mappend` setColors where urlAttrs True = writeURLEscapes (urlDiff diffs) @@ -381,6 +402,11 @@ , Just sitm <- enterItalic (displayAttrCaps terminfoCaps) = writeCapExpr sitm [] | otherwise = mempty + setStrikethrough + | hasStyle (fixedStyle attr) strikethrough + , Just smxx <- enterStrikethrough (displayAttrCaps terminfoCaps) + = writeCapExpr smxx [] + | otherwise = mempty setColors = (case fixedForeColor attr of Just c -> writeCapExpr (setForeColor terminfoCaps) @@ -449,6 +475,7 @@ { applyStandout :: Bool , applyUnderline :: Bool , applyItalic :: Bool + , applyStrikethrough :: Bool , applyReverseVideo :: Bool , applyBlink :: Bool , applyDim :: Bool @@ -485,6 +512,8 @@ -- set state cap then just use the set state cap. ( True, True ) -> SetState $ stateForStyle s where + noEnterExitCap ApplyStrikethrough = isNothing $ enterStrikethrough caps + noEnterExitCap RemoveStrikethrough = isNothing $ exitStrikethrough caps noEnterExitCap ApplyItalic = isNothing $ enterItalic caps noEnterExitCap RemoveItalic = isNothing $ exitItalic caps noEnterExitCap ApplyStandout = isNothing $ enterStandout caps @@ -499,6 +528,8 @@ noEnterExitCap RemoveDim = True noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps noEnterExitCap RemoveBold = True + enterExitCap ApplyStrikethrough = fromJust $ enterStrikethrough caps + enterExitCap RemoveStrikethrough = fromJust $ exitStrikethrough caps enterExitCap ApplyItalic = fromJust $ enterItalic caps enterExitCap RemoveItalic = fromJust $ exitItalic caps enterExitCap ApplyStandout = fromJust $ enterStandout caps @@ -515,6 +546,7 @@ { applyStandout = isStyleSet standout , applyUnderline = isStyleSet underline , applyItalic = isStyleSet italic + , applyStrikethrough = isStyleSet strikethrough , applyReverseVideo = isStyleSet reverseVideo , applyBlink = isStyleSet blink , applyDim = isStyleSet dim @@ -527,6 +559,7 @@ [ applyIfRequired ApplyStandout standout , applyIfRequired ApplyUnderline underline , applyIfRequired ApplyItalic italic + , applyIfRequired ApplyStrikethrough strikethrough , applyIfRequired ApplyReverseVideo reverseVideo , applyIfRequired ApplyBlink blink , applyIfRequired ApplyDim dim diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/src/Graphics/Vty/Output/XTermColor.hs new/vty-5.31/src/Graphics/Vty/Output/XTermColor.hs --- old/vty-5.30/src/Graphics/Vty/Output/XTermColor.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/src/Graphics/Vty/Output/XTermColor.hs 2001-09-09 03:46:40.000000000 +0200 @@ -113,9 +113,6 @@ setUtf8CharSet = "\ESC%G" setDefaultCharSet = "\ESC%@" --- | I think xterm is broken: Reseting the background color as the first --- bytes serialized on a new line does not effect the background color --- xterm uses to clear the line. Which is used *after* the next newline. xtermInlineHack :: Output -> IO () xtermInlineHack t = do let writeReset = foldMap (writeWord8.toEnum.fromEnum) "\ESC[K" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vty-5.30/vty.cabal new/vty-5.31/vty.cabal --- old/vty-5.30/vty.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/vty-5.31/vty.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,5 @@ name: vty -version: 5.30 +version: 5.31 license: BSD3 license-file: LICENSE author: AUTHORS