Idris2Doc : Control.NCurses

Control.NCurses

(source)

Reexports

importpublic NCurses.Core.Color as Color
importpublic NCurses.Core.Input as Input
importpublic NCurses.Core.SpecialKey as SpecialKey
importpublic Control.NCurses.State

Definitions

0NextIn : Window->Type
Totality: total
Visibility: public export
dataNCurses : Type->CursesState->CursesState->Type
Totality: total
Visibility: export
Constructors:
Pure : a->NCursesass
Bind : NCursesas1s2-> (a->NCursesbs2s3) ->NCursesbs1s3
Init : IsInactives=>NCurses () sinitState
DeInit : IsActives=>NCurses () sInactive
AddWindow : {auto{conArg:1262} : IsActives} -> (name : String) ->Position->Size->Maybe (Exists (\c=> (Borderc, HasColorcs))) ->NCurses () s (addWindowsname)
SetWindow : IsActives=> (name : String) -> {auto{conArg:1293} : HasWindownames} ->NCurses () s (setWindowsname)
UnsetWindow : IsActives=> {auto{conArg:1305} : HasWindowDefaultWindows} ->NCurses () s (setWindowsDefaultWindow)
InWindow : IsActives=> (w : String) -> {auto{conArg:1318} : HasWindowws} -> (IsActive (setWindowsw) =>HasWindoww (setWindowsw) =>InWindoww (setWindowsw) =>NCurses () (setWindowsw) (setWindowsw)) ->NCurses () ss
AddColor : {auto{conArg:1348} : IsActives} -> (name : String) ->Color->Color->NCurses () s (addColorsname)
ModAttr : IsActives=>AttrCmds->NCurses () ss
Clear : IsActives=>NCurses () ss
Erase : IsActives=>NCurses () ss
Refresh : IsActives=>NCurses () ss
RefreshAll : IsActives=>NCurses () ss
Output : IsActives=>OutputCmds->NCurses () ss
GetCursPos : IsActives=>NCursesPositionss
  Get the position of the cursor within the current window.
SetEcho : {auto{conArg:1413} : IsActives} -> (on : Bool) ->NCurses () s (setEchoson)
SetCBreak : {auto{conArg:1423} : IsActives} -> (on : Bool) ->NCurses () s (setCBreakson)
SetNoDelay : {auto{conArg:1433} : IsActives} -> (on : Bool) ->NCurses () s (setNoDelayson)
SetCursor : IsActives=>CursorVisibility->NCurses () ss
SetKeypad : {auto{conArg:1454} : IsActives} -> (on : Bool) ->NCurses () s (setKeypadson)
GetWinPos : IsActives=>NCursesPositionss
  Get the position of the current window.
SetWinPos : IsActives=>Position->NCurses () ss
  Set the position of the current window.
GetWinSize : IsActives=>Bool->NCursesSizess
  Get the size of the current window. If `internal` is @True@, then
will subtract the space taken up by any border a window has.
SetWinSize : IsActives=>Size->NCurses () ss
  Set thte size of the current window.
GetCh : {auto{conArg:1498} : IsActives} ->NCurses (NextIn (currentWindows)) ss
NIO : IOa->NCursesass

Hints:
IndexedApplicativeCursesStateNCurses
IndexedFunctorCursesStateCursesStateNCurses
IndexedMonadCursesStateNCurses
liftIO : IOa->NCursesass
  Lift an arbitrary IO operation into NCurses.
It's ill-advised to use stdout operations
like `putStr` from `IO` while NCurses is
active -- NCurses offers its own `putStr`
and the standard terminal output will
behave undesirably for the most part.

Totality: total
Visibility: export
init : IsInactives=>NCurses () sinitState
  Initialize an NCurses session. While this session is active,
normal terminal output will not behave the way you expect.

Totality: total
Visibility: export
deinit : IsActives=>NCurses () sInactive
  End an NCurses session.

Totality: total
Visibility: export
addWindow : {auto{conArg:1882} : IsActives} -> (name : String) ->Position->Size->Maybe (Exists (\c=> (Borderc, HasColorcs))) ->NCurses () s (addWindowsname)
  Add a window to the NCurses session.
You get a default window encompassing the whole terminal screen, but
adding windows gives finer control over clearing of parts of the screen,
printing with coordinates relative to the smaller windows, etc.

See the @border@ function for a convenient initializer of the @Border@ type.

Totality: total
Visibility: export
border : IsActives=> (color : String) ->HasColorcolors=>BorderChar->BorderChar->BorderChar->BorderChar->BorderChar->BorderChar->BorderChar->BorderChar->Maybe (Exists (\c=> (Borderc, HasColorcs)))
  Create a border for a window given the colors available in the current
state.

Totality: total
Visibility: public export
defaultBorder : IsActives=> (color : String) ->HasColorcolors=>Maybe (Exists (\c=> (Borderc, HasColorcs)))
Totality: total
Visibility: public export
setWindow : IsActives=> (name : String) -> {auto{conArg:2004} : HasWindownames} ->NCurses () s (setWindowsname)
  Set the current window. This is the window that future commands
apply to (drawing, setting attributes, reading characters from).

Totality: total
Visibility: export
unsetWindow : IsActives=> {auto{conArg:2024} : HasWindowDefaultWindows} ->NCurses () s (setWindowsDefaultWindow)
  Unset the current window. This results in the full screen (also known
as the default or standard window) being "current."

Totality: total
Visibility: export
inWindow : IsActives=> (name : String) -> {auto{conArg:2048} : HasWindownames} -> (IsActive (setWindowsname) =>HasWindowname (setWindowsname) =>InWindowname (setWindowsname) =>NCurses () (setWindowsname) (setWindowsname)) ->NCurses () ss
  Perform some operations within another window, returning to the current window without
modifying state afterwards.

Totality: total
Visibility: export
hasWindowWithin' : InWindowws->HasWindowws
Totality: total
Visibility: public export
hasWindowWithin : InWindowws=>HasWindowws
Totality: total
Visibility: public export
identifiesCurrentWindow : InWindoww (Active{_:2207}ws{_:2206}{_:2205}) =>IdentifiesWindowwws
Totality: total
Visibility: public export
setWindowHasWindowStill : HasWindowns=> {auto{conArg:2243} : HasWindowws} ->HasWindown (setWindowsw)
  If a given state has a window, setting a new current window on that state does not
change the fact that the state has the original window.

Totality: total
Visibility: public export
setWindowIsActiveStill : IsActives=> {auto{conArg:2407} : HasWindowws} ->IsActive (setWindowsw)
Totality: total
Visibility: public export
setWindowHasColorStill : HasColorcs=> {auto{conArg:2442} : HasWindowws} ->HasColorc (setWindowsw)
Totality: total
Visibility: public export
addWindowHasWindowStill : {auto{conArg:2536} : IsActives} ->HasWindowns=>HasWindown (addWindowsw)
  If a given state has a window, setting a new current window on that state does not
change the fact that the state has the original window.

Totality: total
Visibility: public export
addWindowIsActiveStill : {auto{conArg:2641} : IsActives} ->IsActive (addWindowsw)
Totality: total
Visibility: public export
addWindowHasColorStill : {auto{conArg:2664} : IsActives} ->HasColorcs=>HasColorc (addWindowsw)
Totality: total
Visibility: public export
identifiedWindowExists : ({arg:2755} : IdentifiesWindowwws) ->Exists (\k=>Exists (\d=>lookupWindowwws=MkWindowwkd))
Totality: total
Visibility: public export
inWindowNow : {auto{conArg:2814} : HasWindowws} ->InWindoww (setWindowsw)
Totality: total
Visibility: public export
clear : IsActives=>NCurses () ss
  Clear the current window.

Clearing tells NCurses to redraw the whole terminal on the next
refresh. For a less intensive process that allows NCurses
to determine what parts of the terminal need to be drawn,
use @erase@.

Clearing the standard window will require refreshing all
windows after the next call to refresh the standard window,
It probably makes sense much of the time to refresh immediately
after a call to clear.

Totality: total
Visibility: export
erase : IsActives=>NCurses () ss
  Erase the current window.

Totality: total
Visibility: export
refresh : IsActives=>NCurses () ss
  Refresh the current window.

Totality: total
Visibility: export
refreshAll : IsActives=>NCurses () ss
  Refresh all windows.

Totality: total
Visibility: export
getPos : IsActives=>NCursesPositionss
  Get the position of the cursor within the current window.

Totality: total
Visibility: export
getWindowPos : IsActives=>NCursesPositionss
  Get the position of the current window.

Totality: total
Visibility: export
setWindowPos : IsActives=>Position->NCurses () ss
  Set the position of the current window.

Totality: total
Visibility: export
getWindowSize : IsActives=>Bool->NCursesSizess
  Get the size of the current window.

@ internal If @True@, the size will not include the space
taken up by any internal border the window has
applied to it. If @False@, the size will always
be the space taken up by the window, not the space
available inside the window.

Totality: total
Visibility: export
setWindowSize : IsActives=>Size->NCurses () ss
  Set the size of the current window. If the window has a border,
this size includes the single row & column taken up by the border
on all sides.

Totality: total
Visibility: export
addColor : {auto{conArg:2994} : IsActives} -> (name : String) ->Color->Color->NCurses () s (addColorsname)
  Add a color to the current NCurses session.

Once added, colors can be referenced by name
when constructing Attributes.

Totality: total
Visibility: export
enableAttr : IsActives=>Attributes->NCurses () ss
  Set the given attribute until it is set again.
This has no impact on any other attributes that are set.

In ncurses terminology, "attron"

Totality: total
Visibility: export
disableAttr : IsActives=>Attributes->NCurses () ss
  Unset the given attribute until it is set again.
This has no impact on any other attributes that are set.

In ncurses terminology, "attroff"

Totality: total
Visibility: export
setAttr : IsActives=>Attributes->NCurses () ss
  Set an attribute to be applied until it is cleared or
overwritten. All other attributes are cleared at the same time.
See @enabledAttr@ to enable an attribute without clearing other
attributes.

`setAttr Normal` clears all attributes.

In ncurses terminology, "attrset"

Totality: total
Visibility: export
setAttrs : IsActives=>List (Attributes) ->NCurses () ss
  Set all the given attributes, replacing any existing attributes.

In ncurses terminology, "attrset"

Totality: total
Visibility: export
updateAttr : IsActives=>Attributes->ColorAttrs->MaybeNat->NCurses () ss
  Update the attribute (only supports a single attribute for now) and color
at the current position for the given length of characters. This allows
you to change attributes of already printed characters.

Specify a length of @Nothing@ to update the whole line.

Totality: total
Visibility: export
setBackground : IsActives=>ColorAttrs->NCurses () ss
  Set the background color for the current window.

Totality: total
Visibility: export
putCh : IsActives=>Char->NCurses () ss
  Print a character to the terminal.

Totality: total
Visibility: export
putStr : IsActives=>String->NCurses () ss
  Print a string to the terminal _without_ a trailing newline.

Totality: total
Visibility: export
putStrLn : IsActives=>String->NCurses () ss
  Print a string to the terminal _with_ a trailing newline.

Totality: total
Visibility: export
drawVerticalLine : IsActives=>Char->Nat->NCurses () ss
  Draw a vertical line to the current window comprised of the given
character and having the given length.

Totality: total
Visibility: export
drawHorizontalLine : IsActives=>Char->Nat->NCurses () ss
  Draw a horizontal line to the current window comprised of the given
character and having the given length.

Totality: total
Visibility: export
move : IsActives=>Position->NCurses () ss
  Move the cursor to a position relative within the current window.

If the window has a border, this position is _within_ the border.
(0, 0) is the top left (row, column) without a border and with a
border it is 1 row & column inset from there.

Totality: total
Visibility: export
setCBreak : {auto{conArg:3330} : IsActives} -> (on : Bool) ->NCurses () s (setCBreakson)
  cBreak indicates whether characters typed by the user are delivered to the
program (via @getCh@) immediately or not. If not, they are delivered when a
newline is typed (the default behavior for most terminal environments).

This setting affects all windows.

Totality: total
Visibility: export
setEcho : {auto{conArg:3348} : IsActives} -> (on : Bool) ->NCurses () s (setEchoson)
  echo indicates whether characters typed by the user are printed to the screen
by NCurses as well as delivered to @getCh@.

This setting affects all windows.

Totality: total
Visibility: export
setKeypad : {auto{conArg:3366} : IsActives} -> (on : Bool) ->NCurses () s (setKeypadson)
  Turn "keypad" on or off.

This property is set independently for each window. This method only sets the
property for the current window.

Set to true to receive "special keys" as single values rather than composites
of two or more Chars. For example, arrow keys are represented as two input
chars, but you will receive @Key@ values for them instead with the @keypad@
property turned on.

This is on by default.

Totality: total
Visibility: export
setNoDelay : {auto{conArg:3385} : IsActives} -> (on : Bool) ->NCurses () s (setNoDelayson)
  Turn "noDelay" on or off.

This property is set independently for each window. This method only sets the
property for the current window.

This is off by default (i.e. by default @getInput@ waits for user input).

Totality: total
Visibility: export
setCursor : IsActives=>CursorVisibility->NCurses () ss
  Set the way the cursor is displayed to the user.

Totality: total
Visibility: export
getInput : {auto{conArg:3421} : IsActives} ->NCurses (NextIn (currentWindows)) ss
  Get the next keypress or character input.

If `noDelay` is turned on, @getInput@ returns immediately and results in
@Nothing@ if the user has not typed anything. If `noDelay` is turned off,
@getInput@ blocks until the user enters text. This will block until the next
character is pressed by default, but if `cBreak` is turned off, it will block
until the user inputs a newline (much like the default for most terminal input).

If `keypad` is turned on, @getInput@ returns either a @Char@ or a @Key@ depending
on whether the user has input one of the special-keys (like the arrow keys).

Totality: total
Visibility: export
getChar : IsActives=>NoKeypads=>YesDelays=>NCursesCharss
Totality: total
Visibility: export
getChar : IsActives=>NoKeypads=>NoDelays=>NCurses (MaybeChar) ss
Totality: total
Visibility: export
getKeyOrChar : IsActives=>YesKeypads=>YesDelays=>NCurses (EitherCharKey) ss
Totality: total
Visibility: export
getKeyOrChar : IsActives=>YesKeypads=>NoDelays=>NCurses (Maybe (EitherCharKey)) ss
Totality: total
Visibility: export
keys : List (key, value) ->Listkey
Totality: total
Visibility: public export
withNCurses : HasIOio=>NCursesaInactiveInactive->ioa
  Run an NCurses program with guarantees
that it is initialized at the beginning and
deinitialied at the end.

Totality: total
Visibility: export