Safe HaskellSafe

WEditor.Base.Viewer

Description

Generic editor-viewport functionality.

Synopsis

Documentation

class FixedFontViewer v c | v -> c where #

Generic editor viewport for fixed-width fonts.

  • v: Viewer type providing the operations.
  • c: Character type.

Methods

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

Instances details
FixedFontViewer (EditingDocument c) c # 
Instance details

Defined in WEditor.Document

data ViewAction #

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

Instances details
Eq ViewAction # 
Instance details

Defined in WEditor.Base.Viewer

Methods

(==) :: ViewAction -> ViewAction -> Bool

(/=) :: ViewAction -> ViewAction -> Bool

Show ViewAction # 
Instance details

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 #

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.