{-# Language GeneralizedNewtypeDeriving #-}
module Csound.Typed.Gui.Cabbage.Cabbage(
Cab, CabProp, Col(..), runCab,
button, filebutton, infobutton, checkbox, combobox, csoundoutput, encoder, gentable,
hrange, vrange, form, groupbox, image, keyboard, label, hslider, vslider,
rslider, soundfiler, signaldisplay, textbox, texteditor, xypad,
bounds, channel, text1, text2, value, colour, colour0, colour1, backgroundcolour, textcolour, trackercolour, outlinecolour,
fontcolour, fontcolour0, fontcolour1, latched, identchannel, rotate, alpha, visible, caption, widgetarray, popuptext,
active, svgfile, populate, mode, file, shape, corners, channeltype, align, sliderincr, max, min, textbox', trackerthickness,
linethickness, range, range2, size, pluginid, guirefresh, plant, child, show, middlec, keywidth, scrollbars, fontstyle,
scrubberpos, zoom, displaytype, updaterate, wrap
) where
import Prelude hiding (show, min, max)
import Data.Maybe
import Control.Monad.Trans.Writer.Strict
import Data.Text (Text)
import Csound.Typed.Gui.Cabbage.CabbageLang
type Cab = Cab' ()
type CabProp = CabProp' ()
newtype Cab' a = Cab' { forall a. Cab' a -> Writer [Line] a
unCab' :: Writer [Line] a }
deriving ((forall a b. (a -> b) -> Cab' a -> Cab' b)
-> (forall a b. a -> Cab' b -> Cab' a) -> Functor Cab'
forall a b. a -> Cab' b -> Cab' a
forall a b. (a -> b) -> Cab' a -> Cab' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Cab' a -> Cab' b
fmap :: forall a b. (a -> b) -> Cab' a -> Cab' b
$c<$ :: forall a b. a -> Cab' b -> Cab' a
<$ :: forall a b. a -> Cab' b -> Cab' a
Functor, Functor Cab'
Functor Cab' =>
(forall a. a -> Cab' a)
-> (forall a b. Cab' (a -> b) -> Cab' a -> Cab' b)
-> (forall a b c. (a -> b -> c) -> Cab' a -> Cab' b -> Cab' c)
-> (forall a b. Cab' a -> Cab' b -> Cab' b)
-> (forall a b. Cab' a -> Cab' b -> Cab' a)
-> Applicative Cab'
forall a. a -> Cab' a
forall a b. Cab' a -> Cab' b -> Cab' a
forall a b. Cab' a -> Cab' b -> Cab' b
forall a b. Cab' (a -> b) -> Cab' a -> Cab' b
forall a b c. (a -> b -> c) -> Cab' a -> Cab' b -> Cab' c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
$cpure :: forall a. a -> Cab' a
pure :: forall a. a -> Cab' a
$c<*> :: forall a b. Cab' (a -> b) -> Cab' a -> Cab' b
<*> :: forall a b. Cab' (a -> b) -> Cab' a -> Cab' b
$cliftA2 :: forall a b c. (a -> b -> c) -> Cab' a -> Cab' b -> Cab' c
liftA2 :: forall a b c. (a -> b -> c) -> Cab' a -> Cab' b -> Cab' c
$c*> :: forall a b. Cab' a -> Cab' b -> Cab' b
*> :: forall a b. Cab' a -> Cab' b -> Cab' b
$c<* :: forall a b. Cab' a -> Cab' b -> Cab' a
<* :: forall a b. Cab' a -> Cab' b -> Cab' a
Applicative, Applicative Cab'
Applicative Cab' =>
(forall a b. Cab' a -> (a -> Cab' b) -> Cab' b)
-> (forall a b. Cab' a -> Cab' b -> Cab' b)
-> (forall a. a -> Cab' a)
-> Monad Cab'
forall a. a -> Cab' a
forall a b. Cab' a -> Cab' b -> Cab' b
forall a b. Cab' a -> (a -> Cab' b) -> Cab' b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
$c>>= :: forall a b. Cab' a -> (a -> Cab' b) -> Cab' b
>>= :: forall a b. Cab' a -> (a -> Cab' b) -> Cab' b
$c>> :: forall a b. Cab' a -> Cab' b -> Cab' b
>> :: forall a b. Cab' a -> Cab' b -> Cab' b
$creturn :: forall a. a -> Cab' a
return :: forall a. a -> Cab' a
Monad)
runCab :: Cab -> [Line]
runCab :: Cab -> [Line]
runCab = ((), [Line]) -> [Line]
forall a b. (a, b) -> b
snd (((), [Line]) -> [Line]) -> (Cab -> ((), [Line])) -> Cab -> [Line]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Writer [Line] () -> ((), [Line])
forall w a. Writer w a -> (a, w)
runWriter (Writer [Line] () -> ((), [Line]))
-> (Cab -> Writer [Line] ()) -> Cab -> ((), [Line])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Cab -> Writer [Line] ()
forall a. Cab' a -> Writer [Line] a
unCab'
newtype CabProp' a = CabProp' { forall a. CabProp' a -> Writer [Property] a
unCabProp' :: Writer [Property] a }
deriving ((forall a b. (a -> b) -> CabProp' a -> CabProp' b)
-> (forall a b. a -> CabProp' b -> CabProp' a) -> Functor CabProp'
forall a b. a -> CabProp' b -> CabProp' a
forall a b. (a -> b) -> CabProp' a -> CabProp' b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> CabProp' a -> CabProp' b
fmap :: forall a b. (a -> b) -> CabProp' a -> CabProp' b
$c<$ :: forall a b. a -> CabProp' b -> CabProp' a
<$ :: forall a b. a -> CabProp' b -> CabProp' a
Functor, Functor CabProp'
Functor CabProp' =>
(forall a. a -> CabProp' a)
-> (forall a b. CabProp' (a -> b) -> CabProp' a -> CabProp' b)
-> (forall a b c.
(a -> b -> c) -> CabProp' a -> CabProp' b -> CabProp' c)
-> (forall a b. CabProp' a -> CabProp' b -> CabProp' b)
-> (forall a b. CabProp' a -> CabProp' b -> CabProp' a)
-> Applicative CabProp'
forall a. a -> CabProp' a
forall a b. CabProp' a -> CabProp' b -> CabProp' a
forall a b. CabProp' a -> CabProp' b -> CabProp' b
forall a b. CabProp' (a -> b) -> CabProp' a -> CabProp' b
forall a b c.
(a -> b -> c) -> CabProp' a -> CabProp' b -> CabProp' c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
$cpure :: forall a. a -> CabProp' a
pure :: forall a. a -> CabProp' a
$c<*> :: forall a b. CabProp' (a -> b) -> CabProp' a -> CabProp' b
<*> :: forall a b. CabProp' (a -> b) -> CabProp' a -> CabProp' b
$cliftA2 :: forall a b c.
(a -> b -> c) -> CabProp' a -> CabProp' b -> CabProp' c
liftA2 :: forall a b c.
(a -> b -> c) -> CabProp' a -> CabProp' b -> CabProp' c
$c*> :: forall a b. CabProp' a -> CabProp' b -> CabProp' b
*> :: forall a b. CabProp' a -> CabProp' b -> CabProp' b
$c<* :: forall a b. CabProp' a -> CabProp' b -> CabProp' a
<* :: forall a b. CabProp' a -> CabProp' b -> CabProp' a
Applicative, Applicative CabProp'
Applicative CabProp' =>
(forall a b. CabProp' a -> (a -> CabProp' b) -> CabProp' b)
-> (forall a b. CabProp' a -> CabProp' b -> CabProp' b)
-> (forall a. a -> CabProp' a)
-> Monad CabProp'
forall a. a -> CabProp' a
forall a b. CabProp' a -> CabProp' b -> CabProp' b
forall a b. CabProp' a -> (a -> CabProp' b) -> CabProp' b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
$c>>= :: forall a b. CabProp' a -> (a -> CabProp' b) -> CabProp' b
>>= :: forall a b. CabProp' a -> (a -> CabProp' b) -> CabProp' b
$c>> :: forall a b. CabProp' a -> CabProp' b -> CabProp' b
>> :: forall a b. CabProp' a -> CabProp' b -> CabProp' b
$creturn :: forall a. a -> CabProp' a
return :: forall a. a -> CabProp' a
Monad)
runCabProp :: CabProp -> [Property]
runCabProp :: CabProp -> [Property]
runCabProp = ((), [Property]) -> [Property]
forall a b. (a, b) -> b
snd (((), [Property]) -> [Property])
-> (CabProp -> ((), [Property])) -> CabProp -> [Property]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Writer [Property] () -> ((), [Property])
forall w a. Writer w a -> (a, w)
runWriter (Writer [Property] () -> ((), [Property]))
-> (CabProp -> Writer [Property] ()) -> CabProp -> ((), [Property])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CabProp -> Writer [Property] ()
forall a. CabProp' a -> Writer [Property] a
unCabProp'
widget :: Text -> CabProp -> Cab
widget :: Text -> CabProp -> Cab
widget Text
name CabProp
props = Writer [Line] () -> Cab
forall a. Writer [Line] a -> Cab' a
Cab' (Writer [Line] () -> Cab) -> Writer [Line] () -> Cab
forall a b. (a -> b) -> a -> b
$ [Line] -> Writer [Line] ()
forall (m :: * -> *) w. Monad m => w -> WriterT w m ()
tell [Text -> [Property] -> Line
Line Text
name ([Property] -> Line) -> [Property] -> Line
forall a b. (a -> b) -> a -> b
$ CabProp -> [Property]
runCabProp CabProp
props]
button, filebutton, infobutton, checkbox, combobox, csoundoutput, encoder, gentable,
hrange, vrange, form, groupbox, image, keyboard, label, hslider, vslider,
rslider, soundfiler, signaldisplay, textbox, texteditor, xypad :: CabProp -> Cab
button :: CabProp -> Cab
button = Text -> CabProp -> Cab
widget Text
"button"
filebutton :: CabProp -> Cab
filebutton = Text -> CabProp -> Cab
widget Text
"filebutton"
infobutton :: CabProp -> Cab
infobutton = Text -> CabProp -> Cab
widget Text
"infobutton"
checkbox :: CabProp -> Cab
checkbox = Text -> CabProp -> Cab
widget Text
"checkbox"
combobox :: CabProp -> Cab
combobox = Text -> CabProp -> Cab
widget Text
"combobox"
csoundoutput :: CabProp -> Cab
csoundoutput = Text -> CabProp -> Cab
widget Text
"csoundoutput"
encoder :: CabProp -> Cab
encoder = Text -> CabProp -> Cab
widget Text
"encoder"
gentable :: CabProp -> Cab
gentable = Text -> CabProp -> Cab
widget Text
"gentable"
hrange :: CabProp -> Cab
hrange = Text -> CabProp -> Cab
widget Text
"hrange"
vrange :: CabProp -> Cab
vrange = Text -> CabProp -> Cab
widget Text
"vrange"
form :: CabProp -> Cab
form = Text -> CabProp -> Cab
widget Text
"form"
groupbox :: CabProp -> Cab
groupbox = Text -> CabProp -> Cab
widget Text
"groupbox"
image :: CabProp -> Cab
image = Text -> CabProp -> Cab
widget Text
"image"
keyboard :: CabProp -> Cab
keyboard = Text -> CabProp -> Cab
widget Text
"keyboard"
label :: CabProp -> Cab
label = Text -> CabProp -> Cab
widget Text
"label"
hslider :: CabProp -> Cab
hslider = Text -> CabProp -> Cab
widget Text
"hslider"
vslider :: CabProp -> Cab
vslider = Text -> CabProp -> Cab
widget Text
"vslider"
rslider :: CabProp -> Cab
rslider = Text -> CabProp -> Cab
widget Text
"rslider"
soundfiler :: CabProp -> Cab
soundfiler = Text -> CabProp -> Cab
widget Text
"soundfiler"
signaldisplay :: CabProp -> Cab
signaldisplay = Text -> CabProp -> Cab
widget Text
"signaldisplay"
textbox :: CabProp -> Cab
textbox = Text -> CabProp -> Cab
widget Text
"textbox"
texteditor :: CabProp -> Cab
texteditor = Text -> CabProp -> Cab
widget Text
"texteditor"
xypad :: CabProp -> Cab
xypad = Text -> CabProp -> Cab
widget Text
"xypad"
mkProperty :: Text -> [Arg] -> CabProp
mkProperty :: Text -> [Arg] -> CabProp
mkProperty Text
name [Arg]
args = Writer [Property] () -> CabProp
forall a. Writer [Property] a -> CabProp' a
CabProp' (Writer [Property] () -> CabProp)
-> Writer [Property] () -> CabProp
forall a b. (a -> b) -> a -> b
$ [Property] -> Writer [Property] ()
forall (m :: * -> *) w. Monad m => w -> WriterT w m ()
tell [Text -> [Arg] -> Property
Property Text
name [Arg]
args]
data Col = Hash Text | Rgb Int Int Int
colProp :: Col -> [Arg]
colProp :: Col -> [Arg]
colProp Col
x = case Col
x of
Hash Text
a -> [Text -> Arg
StringArg Text
a]
Rgb Int
r Int
g Int
b -> (Int -> Arg) -> [Int] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Arg
IntArg [Int
r, Int
g, Int
b]
boolProp :: Bool -> Arg
boolProp :: Bool -> Arg
boolProp Bool
x = Int -> Arg
IntArg (Int -> Arg) -> Int -> Arg
forall a b. (a -> b) -> a -> b
$ if Bool
x then Int
1 else Int
0
bounds :: Int -> Int -> Int -> Int -> CabProp
bounds :: Int -> Int -> Int -> Int -> CabProp
bounds Int
x Int
y Int
w Int
h = Text -> [Arg] -> CabProp
mkProperty Text
"bounds" ((Int -> Arg) -> [Int] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Arg
IntArg [Int
x, Int
y, Int
w, Int
h])
channel :: Text -> CabProp
channel :: Text -> CabProp
channel Text
name = Text -> [Arg] -> CabProp
mkProperty Text
"channel" [Text -> Arg
StringArg Text
name]
text1 :: Text -> CabProp
text1 :: Text -> CabProp
text1 Text
name = Text -> [Arg] -> CabProp
mkProperty Text
"text" [Text -> Arg
StringArg Text
name]
text2 :: Text -> Text -> CabProp
text2 :: Text -> Text -> CabProp
text2 Text
name1 Text
name2 = Text -> [Arg] -> CabProp
mkProperty Text
"text" [Text -> Arg
StringArg Text
name1, Text -> Arg
StringArg Text
name2]
value :: Float -> CabProp
value :: Float -> CabProp
value Float
x = Text -> [Arg] -> CabProp
mkProperty Text
"value" [Float -> Arg
FloatArg Float
x]
colour :: Col -> CabProp
colour :: Col -> CabProp
colour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"colour" (Col -> [Arg]
colProp Col
col)
colour0 :: Col -> CabProp
colour0 :: Col -> CabProp
colour0 Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"colour:0" (Col -> [Arg]
colProp Col
col)
colour1 :: Col -> CabProp
colour1 :: Col -> CabProp
colour1 Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"colour:1" (Col -> [Arg]
colProp Col
col)
backgroundcolour :: Col -> CabProp
backgroundcolour :: Col -> CabProp
backgroundcolour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"backgroundcolour" (Col -> [Arg]
colProp Col
col)
textcolour :: Col -> CabProp
textcolour :: Col -> CabProp
textcolour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"textcolour" (Col -> [Arg]
colProp Col
col)
trackercolour :: Col -> CabProp
trackercolour :: Col -> CabProp
trackercolour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"trackercolour" (Col -> [Arg]
colProp Col
col)
outlinecolour :: Col -> CabProp
outlinecolour :: Col -> CabProp
outlinecolour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"outlinecolour" (Col -> [Arg]
colProp Col
col)
fontcolour :: Col -> CabProp
fontcolour :: Col -> CabProp
fontcolour Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"fontcolour" (Col -> [Arg]
colProp Col
col)
fontcolour0 :: Col -> CabProp
fontcolour0 :: Col -> CabProp
fontcolour0 Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"fontcolour:0" (Col -> [Arg]
colProp Col
col)
fontcolour1 :: Col -> CabProp
fontcolour1 :: Col -> CabProp
fontcolour1 Col
col = Text -> [Arg] -> CabProp
mkProperty Text
"fontcolour:1" (Col -> [Arg]
colProp Col
col)
latched :: Bool -> CabProp
latched :: Bool -> CabProp
latched Bool
b = Text -> [Arg] -> CabProp
mkProperty Text
"latched" [Bool -> Arg
boolProp Bool
b]
identchannel :: Text -> CabProp
identchannel :: Text -> CabProp
identchannel Text
s = Text -> [Arg] -> CabProp
mkProperty Text
"identchannel" [Text -> Arg
StringArg Text
s]
rotate :: Float -> Float -> Float -> CabProp
rotate :: Float -> Float -> Float -> CabProp
rotate Float
radians Float
pivotx Float
pivoty = Text -> [Arg] -> CabProp
mkProperty Text
"rotate" ([Arg] -> CabProp) -> [Arg] -> CabProp
forall a b. (a -> b) -> a -> b
$ (Float -> Arg) -> [Float] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Float -> Arg
FloatArg [Float
radians, Float
pivotx, Float
pivoty]
alpha :: Float -> CabProp
alpha :: Float -> CabProp
alpha Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"alpha" [Float -> Arg
FloatArg Float
a]
visible :: Bool -> CabProp
visible :: Bool -> CabProp
visible Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"visible" [Bool -> Arg
boolProp Bool
a]
caption :: Text -> CabProp
caption :: Text -> CabProp
caption Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"caption" [Text -> Arg
StringArg Text
a]
widgetarray :: Text -> Int -> CabProp
widgetarray :: Text -> Int -> CabProp
widgetarray Text
name Int
n = Text -> [Arg] -> CabProp
mkProperty Text
"widgetarray" [Text -> Arg
StringArg Text
name, Int -> Arg
IntArg Int
n]
popuptext :: Text -> CabProp
Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"popuptext" [Text -> Arg
StringArg Text
a]
active :: Bool -> CabProp
active :: Bool -> CabProp
active Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"active" [Bool -> Arg
boolProp Bool
a]
svgfile :: Text -> Text -> CabProp
svgfile :: Text -> Text -> CabProp
svgfile Text
ty Text
fileName = Text -> [Arg] -> CabProp
mkProperty Text
"svgfile" ((Text -> Arg) -> [Text] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> Arg
StringArg [Text
ty, Text
fileName])
populate :: Text -> Text -> CabProp
populate :: Text -> Text -> CabProp
populate Text
filetype Text
dir = Text -> [Arg] -> CabProp
mkProperty Text
"populate" ((Text -> Arg) -> [Text] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Text -> Arg
StringArg [Text
filetype, Text
dir])
mode :: Text -> CabProp
mode :: Text -> CabProp
mode Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"mode" [Text -> Arg
StringArg Text
a]
file :: Text -> CabProp
file :: Text -> CabProp
file Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"file" [Text -> Arg
StringArg Text
a]
shape :: Text -> CabProp
shape :: Text -> CabProp
shape Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"shape" [Text -> Arg
StringArg Text
a]
corners :: Float -> CabProp
corners :: Float -> CabProp
corners Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"corners" [Float -> Arg
FloatArg Float
a]
channeltype :: Text -> CabProp
channeltype :: Text -> CabProp
channeltype Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"channeltype" [Text -> Arg
StringArg Text
a]
align :: Text -> CabProp
align :: Text -> CabProp
align Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"align" [Text -> Arg
StringArg Text
a]
sliderincr :: Float -> CabProp
sliderincr :: Float -> CabProp
sliderincr Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"sliderincr" [Float -> Arg
FloatArg Float
a]
max :: Float -> CabProp
max :: Float -> CabProp
max Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"max" [Float -> Arg
FloatArg Float
a]
min :: Float -> CabProp
min :: Float -> CabProp
min Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"min" [Float -> Arg
FloatArg Float
a]
textbox' :: Bool -> CabProp
textbox' :: Bool -> CabProp
textbox' Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"textbox" [Bool -> Arg
boolProp Bool
a]
trackerthickness :: Float -> CabProp
trackerthickness :: Float -> CabProp
trackerthickness Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"trackerthickness" [Float -> Arg
FloatArg Float
a]
linethickness :: Float -> CabProp
linethickness :: Float -> CabProp
linethickness Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"linethickness" [Float -> Arg
FloatArg Float
a]
range :: Float -> Float -> (Float, Float) -> CabProp
range :: Float -> Float -> (Float, Float) -> CabProp
range Float
minVal Float
maxVal (Float, Float)
val = Float
-> Float -> (Float, Float) -> Maybe Float -> Maybe Float -> CabProp
range2 Float
minVal Float
maxVal (Float, Float)
val Maybe Float
forall a. Maybe a
Nothing Maybe Float
forall a. Maybe a
Nothing
range2 :: Float -> Float -> (Float, Float) -> Maybe Float -> Maybe Float -> CabProp
range2 :: Float
-> Float -> (Float, Float) -> Maybe Float -> Maybe Float -> CabProp
range2 Float
minVal Float
maxVal (Float, Float)
val Maybe Float
mskew Maybe Float
mincr = Text -> [Arg] -> CabProp
mkProperty Text
"range" ([Arg] -> CabProp) -> [Arg] -> CabProp
forall a b. (a -> b) -> a -> b
$ [Maybe Arg] -> [Arg]
forall a. [Maybe a] -> [a]
catMaybes [Arg -> Maybe Arg
forall a. a -> Maybe a
Just (Arg -> Maybe Arg) -> Arg -> Maybe Arg
forall a b. (a -> b) -> a -> b
$ Float -> Arg
FloatArg Float
minVal, Arg -> Maybe Arg
forall a. a -> Maybe a
Just (Arg -> Maybe Arg) -> Arg -> Maybe Arg
forall a b. (a -> b) -> a -> b
$ Float -> Arg
FloatArg Float
maxVal, Arg -> Maybe Arg
forall a. a -> Maybe a
Just (Arg -> Maybe Arg) -> Arg -> Maybe Arg
forall a b. (a -> b) -> a -> b
$ ((Float -> Float -> Arg) -> (Float, Float) -> Arg
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Float -> Float -> Arg
ColonArg) (Float, Float)
val, (Float -> Arg) -> Maybe Float -> Maybe Arg
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Float -> Arg
FloatArg Maybe Float
mskew, (Float -> Arg) -> Maybe Float -> Maybe Arg
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Float -> Arg
FloatArg Maybe Float
mincr]
size :: Int -> Int -> CabProp
size :: Int -> Int -> CabProp
size Int
w Int
h = Text -> [Arg] -> CabProp
mkProperty Text
"size" ((Int -> Arg) -> [Int] -> [Arg]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Arg
IntArg [Int
w, Int
h])
pluginid :: Text -> CabProp
pluginid :: Text -> CabProp
pluginid Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"pluginid" [Text -> Arg
StringArg Text
a]
guirefresh :: Int -> CabProp
guirefresh :: Int -> CabProp
guirefresh Int
a = Text -> [Arg] -> CabProp
mkProperty Text
"guirefresh" [Int -> Arg
IntArg Int
a]
plant :: Text -> CabProp
plant :: Text -> CabProp
plant Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"plant" [Text -> Arg
StringArg Text
a]
child :: Bool -> CabProp
child :: Bool -> CabProp
child Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"child" [Bool -> Arg
boolProp Bool
a]
show :: Bool -> CabProp
show :: Bool -> CabProp
show Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"show" [Bool -> Arg
boolProp Bool
a]
middlec :: Int -> CabProp
middlec :: Int -> CabProp
middlec Int
a = Text -> [Arg] -> CabProp
mkProperty Text
"middlec" [Int -> Arg
IntArg Int
a]
keywidth :: Int -> CabProp
keywidth :: Int -> CabProp
keywidth Int
a = Text -> [Arg] -> CabProp
mkProperty Text
"keywidth" [Int -> Arg
IntArg Int
a]
scrollbars :: Bool -> CabProp
scrollbars :: Bool -> CabProp
scrollbars Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"scrollbars" [Bool -> Arg
boolProp Bool
a]
fontstyle :: Text -> CabProp
fontstyle :: Text -> CabProp
fontstyle Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"fontstyle" [Text -> Arg
StringArg Text
a]
scrubberpos :: Int -> CabProp
scrubberpos :: Int -> CabProp
scrubberpos Int
a = Text -> [Arg] -> CabProp
mkProperty Text
"scrubberpos" [Int -> Arg
IntArg Int
a]
zoom :: Float -> CabProp
zoom :: Float -> CabProp
zoom Float
a = Text -> [Arg] -> CabProp
mkProperty Text
"zoom" [Float -> Arg
FloatArg Float
a]
displaytype :: Text -> CabProp
displaytype :: Text -> CabProp
displaytype Text
a = Text -> [Arg] -> CabProp
mkProperty Text
"displaytype" [Text -> Arg
StringArg Text
a]
updaterate :: Int -> CabProp
updaterate :: Int -> CabProp
updaterate Int
a = Text -> [Arg] -> CabProp
mkProperty Text
"updaterate" [Int -> Arg
IntArg Int
a]
wrap :: Bool -> CabProp
wrap :: Bool -> CabProp
wrap Bool
a = Text -> [Arg] -> CabProp
mkProperty Text
"wrap" [Bool -> Arg
boolProp Bool
a]