Safe Haskell | Safe |
---|
Generic editor-viewport functionality.
Synopsis
- class FixedFontViewer v c | v -> c where
- setViewSize :: v -> (Int, Int) -> v
- getViewSize :: v -> (Int, Int)
- getVisible :: v -> [[c]]
- updateView :: v -> ViewAction -> v
- data ViewAction
- = ShiftVertical Int
- | FillView
- type ViewerAction c = forall v. FixedFontViewer v c => v -> v
- viewerFillAction :: ViewerAction c
- viewerResizeAction :: (Int, Int) -> ViewerAction c
- viewerShiftUpAction :: Int -> ViewerAction c
- viewerShiftDownAction :: Int -> ViewerAction c
Documentation
class FixedFontViewer v c | v -> c where #
Generic editor viewport for fixed-width fonts.
v
: Viewer type providing the operations.c
: Character type.
setViewSize :: v -> (Int, Int) -> v #
Set the (width,height)
size of the viewport. Setting either to <=0
disables bounding in that dimension.
getViewSize :: v -> (Int, Int) #
Get the (width,height)
size of the viewport.
getVisible :: v -> [[c]] #
Get the visible lines in the viewport. This does not need to completely fill the viewport area, but it must not exceed it.
updateView :: v -> ViewAction -> v #
Apply a view change.
Instances
FixedFontViewer (EditingDocument c) c # | |
Defined in WEditor.Document setViewSize :: EditingDocument c -> (Int, Int) -> EditingDocument c # getViewSize :: EditingDocument c -> (Int, Int) # getVisible :: EditingDocument c -> [[c]] # updateView :: EditingDocument c -> ViewAction -> EditingDocument c # |
data ViewAction #
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 # | |
Defined in WEditor.Base.Viewer (==) :: ViewAction -> ViewAction -> Bool (/=) :: ViewAction -> ViewAction -> Bool | |
Show ViewAction # | |
Defined in WEditor.Base.Viewer showsPrec :: Int -> ViewAction -> ShowS show :: ViewAction -> String showList :: [ViewAction] -> ShowS |
type ViewerAction c = forall v. FixedFontViewer v c => v -> v #
Any action that updates a FixedFontViewer
.
viewerFillAction :: ViewerAction c #
Action to attempt to fill the viewport.
viewerResizeAction :: (Int, Int) -> ViewerAction c #
Action to resize the viewport.
viewerShiftUpAction :: Int -> ViewerAction c #
Action to shift the view upward.
viewerShiftDownAction :: Int -> ViewerAction c #
Action to shift the view downward.