WEditor-0.2.1.1: Generic text-editor logic for use with fixed-width fonts.

Safe HaskellSafe
LanguageHaskell2010

WEditor.Base.Viewer

Description

Generic editor-viewport functionality.

Synopsis

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.

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 # 
Instance details

Defined in WEditor.Base.Viewer

Show ViewAction Source # 
Instance details

Defined in WEditor.Base.Viewer

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.