WEditor-0.1.0.0: 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 a c | a -> c where Source #

Generic editor viewport for fixed-width fonts.

Methods

setViewSize :: a -> (Int, Int) -> a Source #

Sets 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 #

Gets the (width,height) size of the viewport.

getVisible :: a -> [[c]] Source #

Gets the visible lines in the viewport. This does not need to completely fill the viewport area, but it must not exceed it.

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.