Files
loop/src/Dodge/Data/SelectionList.hs
T

61 lines
1.3 KiB
Haskell

{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.SelectionList where
import Color
import Control.Lens
import Data.IntMap.Strict (IntMap)
import Dodge.Data.CardinalPoint
import Dodge.Data.ScreenPos
import Picture.Data
data ListDisplayParams = ListDisplayParams
{ _ldpPos :: ScreenPos
, _ldpScale :: Float
, _ldpVerticalGap :: Float
}
data CursorDisplay
= BoundaryCursor [CardinalPoint]
| BackdropCursor
data SectionCursor = SectionCursor
{ _scurPos :: Int
, _scurSize :: Int
, _scurColor :: Color
}
data SelSection a = SelSection
{ _ssItems :: IntMap (SelectionItem a)
, _ssOffset :: Int
, _ssShownItems :: [Picture]
, _ssShownLength :: Int
, _ssIndent :: Int
}
type IMSS a = IntMap (SelSection a)
data SelectionWidth = FixedSelectionWidth Int | UseItemWidth
data SelectionItem a = SelItem
{ _siPictures :: [String]
, _siHeight :: Int
, _siWidth :: Int
, _siIsSelectable :: Bool
, _siColor :: Color
, _siOffX :: Int
, _siPayload :: Maybe a
, _siDisplayMod :: SIDisplayMod
}
data SIDisplayMod
= NoSIDisplayMod
| HighlightSI
makeLenses ''ListDisplayParams
makeLenses ''SelectionItem
makeLenses ''SelSection
makeLenses ''SectionCursor
makePrisms ''CursorDisplay