Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Generic editor-viewport functionality.
Synopsis
- class FixedFontViewer a c | a -> c where
- setViewSize :: a -> (Int, Int) -> a
- getViewSize :: a -> (Int, Int)
- getVisible :: a -> [[c]]
- updateView :: a -> ViewAction -> a
- data ViewAction
- type ViewerAction c = forall a. FixedFontViewer a c => a -> a
- viewerFillAction :: ViewerAction c
- viewerResizeAction :: (Int, Int) -> ViewerAction c
- viewerShiftUpAction :: Int -> ViewerAction c
- viewerShiftDownAction :: Int -> ViewerAction c
Documentation
class FixedFontViewer a c | a -> c where Source #
Generic editor viewport for fixed-width fonts.
setViewSize :: a -> (Int, Int) -> a Source #
Set the (width,height) size of the viewport. A width < 0 must disable line wrapping, and a height < 0 must disable vertical bounding.
getViewSize :: a -> (Int, Int) Source #
Get the (width,height) size of the viewport.
getVisible :: a -> [[c]] Source #
Get the visible lines in the viewport. This does not need to completely fill the viewport area, but it must not exceed it.
updateView :: a -> ViewAction -> a Source #
Apply a view change.
Instances
FixedFontViewer (EditingDocument c) c Source # | |
Defined in WEditor.Document setViewSize :: EditingDocument c -> (Int, Int) -> EditingDocument c Source # getViewSize :: EditingDocument c -> (Int, Int) Source # getVisible :: EditingDocument c -> [[c]] Source # updateView :: EditingDocument c -> ViewAction -> EditingDocument c Source # |
data ViewAction Source #
Actions that modify the view without affecting editing.
ShiftVertical Int | Shift the vertical offset. Negative values shift up. |
FillView | Attempt to fill the entire viewport. |
Instances
Eq ViewAction Source # | |
Defined in WEditor.Base.Viewer (==) :: ViewAction -> ViewAction -> Bool # (/=) :: ViewAction -> ViewAction -> Bool # | |
Show ViewAction Source # | |
Defined in WEditor.Base.Viewer showsPrec :: Int -> ViewAction -> ShowS # show :: ViewAction -> String # showList :: [ViewAction] -> ShowS # |
type ViewerAction c = forall a. FixedFontViewer a c => a -> a Source #
Any action that updates a FixedFontViewer
.
viewerResizeAction :: (Int, Int) -> ViewerAction c Source #
Action to resize the viewport.
viewerShiftUpAction :: Int -> ViewerAction c Source #
Action to shift the view upward.
viewerShiftDownAction :: Int -> ViewerAction c Source #
Action to shift the view downward.