Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
WEditor.Base.Viewer
Description
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
- 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 Source #
Generic editor viewport for fixed-width fonts.
v
: Viewer type providing the operations.c
: Character type.
Methods
setViewSize :: v -> (Int, Int) -> v Source #
Set the (width,height)
size of the viewport. Setting either to <=0
disables bounding in that dimension.
getViewSize :: v -> (Int, Int) Source #
Get the (width,height)
size of the viewport.
getVisible :: v -> [[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 :: v -> ViewAction -> v Source #
Apply a view change.
Instances
FixedFontViewer (EditingDocument c) c Source # | |
Defined in WEditor.Document Methods 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.
Constructors
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 | |
Show ViewAction Source # | |
Defined in WEditor.Base.Viewer Methods showsPrec :: Int -> ViewAction -> ShowS # show :: ViewAction -> String # showList :: [ViewAction] -> ShowS # |
type ViewerAction c = forall v. FixedFontViewer v c => v -> v Source #
Any action that updates a FixedFontViewer
.
viewerFillAction :: ViewerAction c Source #
Action to attempt to fill the viewport.
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.