# HG changeset patch # User Steve Losh # Date 1393553932 18000 # Node ID cb51d5fdb559f82f61292b0a33c4c0da77dfd5be # Parent b200fd82899366c4a2dae73b96ab8ab46988c4d2 clojure-lanterna: Update site. diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/changelog/index.html --- a/clojure-lanterna/changelog/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/changelog/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -1,23 +1,41 @@ -Changelog / clojure-lanterna + + + + Changelog / clojure-lanterna + + + + + +
-

clojure-lanterna

+

clojure-lanterna

+

Changelog

Here's the list of changes in each released version.

v0.9.4

-
  • Relies on Lanterna 2.1.5 to get some bugfixes.
  • -

v0.9.3

-
  • get-key-blocking now accepts optional arguments for timeout and interval.
  • +
      +
    • Relies on Lanterna 2.1.5 to get some bugfixes.
    • +
    +

    v0.9.3

    +
      +
    • get-key-blocking now accepts optional arguments for timeout and interval.
    • Added remove-resize-listener functions for Screens and Terminals.
    • -

    v0.9.2

    -
    • Added an experimental put-sheet function for screens. Don't rely on this +
    +

    v0.9.2

    +
      +
    • Added an experimental put-sheet function for screens. Don't rely on this yet -- it's subject to change.
    • Relies on a stable release of Lanterna once more.
    • -

    v0.9.1

    -
    • Added the clear functions for terminals and screens.
    • +
    +

    v0.9.1

    +
      +
    • Added the clear functions for terminals and screens.
    • Added the get-size functions for terminals and screens.
    • Relies on a snapshot release of Lanterna so may not be stable.
    • -

    v0.9.0

    +
+

v0.9.0

Initial prerelease. The architecture won't change but the API might. Until version 1.0.0 I reserve the right to break things indiscriminately.

@@ -36,5 +54,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(); -
- \ No newline at end of file + +
+ + \ No newline at end of file diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/index.html --- a/clojure-lanterna/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -60,10 +60,11 @@ (def scr (s/get-screen)) -(s/stop scr) +(s/start scr) (s/put-string scr 10 10 "Hello, world!") (s/put-string scr 10 11 "Press any key to exit!") +(s/redraw scr) (s/get-key-blocking scr) (s/stop scr) diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/installation/index.html --- a/clojure-lanterna/installation/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/installation/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -1,8 +1,18 @@ -Installation / clojure-lanterna + + + + Installation / clojure-lanterna + + + + + +
-

clojure-lanterna

+

clojure-lanterna

+

Installation

clojure-lanterna requires Leiningen 2 and Clojure 1.4. It might work with other versions, but I make no guarantees.

It has no other dependencies (aside from Lanterna itself, of course).

@@ -28,5 +38,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(); -
- \ No newline at end of file + +
+ + \ No newline at end of file diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/reference/index.html --- a/clojure-lanterna/reference/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/reference/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -1,22 +1,36 @@ -Reference / clojure-lanterna + + + + Reference / clojure-lanterna + + + + + +
-

clojure-lanterna

+

clojure-lanterna

+

Reference

Here's the deep dive.

If you haven't read the terminal and screen documentation you should read those to wrap your brain around the structure of things first.

Constants

clojure-lanterna uses Clojure keywords where you need to supply constants. It @@ -58,7 +75,8 @@

Colors

Lanterna (and thus clojure-lanterna) supports the 8 common terminal colors, as well as a "default" color:

-
  • :black
  • +
      +
    • :black
    • :white
    • :red
    • :green
    • @@ -67,19 +85,23 @@
    • :magenta
    • :yellow
    • :default
    • -

    Styles

    +
+

Styles

Lanterna (and thus clojure-lanterna) supports 4 common styles:

-
  • :bold
  • +
      +
    • :bold
    • :reverse
    • :underline
    • :blinking
    • -

    Key Codes

    +
+

Key Codes

When you get a key of user input from clojure-lanterna it will be one of two things: a Character like \a or \$ representing what the user typed, or a keyword for special keys like Delete or Page Up.

Note that the Tab key is returned as :tab and not \tab.

Here are the keywords for special keys that may be returned:

-
  • :escape
  • +
      +
    • :escape
    • :backspace
    • :left
    • :right
    • @@ -94,22 +116,28 @@
    • :tab
    • :reverse-tab
    • :enter
    • -

    There are also two other special keywords:

    -
    • :unknown - The user typed something Lanterna couldn't figure out.
    • +
    +

    There are also two other special keywords:

    +
      +
    • :unknown - The user typed something Lanterna couldn't figure out.
    • :cursor-location - I'm not sure about this. I think it's an internal Lanterna thing.
    • -

    Charsets

    +
+

Charsets

Currently there's only one charset clojure-lanterna constant defines. Open an issue as a feature request if you want others -- I'll be happy to add the constants.

-
  • :utf-8
  • -

Consoles

+
    +
  • :utf-8
  • +
+

Consoles

When creating a Terminal or Screen, you can optionally specify a specific kind of Terminal or Screen to create.

If it's not supported (e.g.: trying to create a Swing Terminal on a system without X) then who knows what will happen. Make sure you know what you're doing if you use anything other than :auto.

-
  • :auto - Let Lanterna try to guess the appropriate kind of console to use. +
      +
    • :auto - Let Lanterna try to guess the appropriate kind of console to use. If there's a windowing environment present the Swing console will be used, otherwise an appropriate text console will be used.
    • :swing - Force a Swing-based console.
    • @@ -117,17 +145,20 @@ appropriate kind of console (UNIX or Cygwin) by the OS.
    • :unix - Force a UNIX text-based console.
    • :cygwin - Force a Cygwin text-based console.
    • -

    Palettes

    +
+

Palettes

When creating a Swing Terminal or Screen, you can choose the color palette to use. Text-based Terminals and Screens will use the user's color scheme, of course.

The following palettes are supported:

-
  • :gnome - Gnome Terminal's colors.
  • +
      +
    • :gnome - Gnome Terminal's colors.
    • :windows-xp - The colors of the Windows XP command prompt.
    • :xterm - Xterm's colors.
    • :putty - Putty's colors.
    • :mac-os-x - The colors of Mac OS X's Terminal.app.
    • -

    Font Names

    +
+

Font Names

When giving a font name, it should be a string naming a font family on your system. For example: "Consolas", "Courier New", or "Monaco".

To see a the fonts available on your system you can call @@ -146,7 +177,8 @@

kind is a console constant describing the type of terminal you want. If unspecified it defaults to :auto.

The options map can contain any of the following mappings:

-
  • :cols - Width of the desired terminal in characters (default 80).
  • +
      +
    • :cols - Width of the desired terminal in characters (default 80).
    • :rows - Height of the desired terminal in characters (default 24).
    • :charset - Charset of the desired terminal. This should be a charset constant (default :utf-8).
    • @@ -157,7 +189,8 @@ names. If a sequence is given, the first font that exists on the system will be used (much like a CSS font-family declaration). Will fall back to a monospaced default font if none of the given ones exist. -

    The :rows, :cols, :font, :font-size, :palette and :charset options +

+

The :rows, :cols, :font, :font-size, :palette and :charset options are really just a suggestion!

The text-based terminals will ignore rows, columns, fonts and palettes. They will be determined by the user's terminal window.

@@ -295,10 +328,12 @@

If you want to return immediately instead of blocking when no input is buffered, use get-key instead.

The options map can contain any of the following mappings:

-
  • :interval - The interval between checks, in milliseconds (default 50).
  • +
      +
    • :interval - The interval between checks, in milliseconds (default 50).
    • :timeout - The maximum amount of time blocking will occur before returning nil (default infinity).
    • -

    lanterna.terminal/add-resize-listener

    +
+

lanterna.terminal/add-resize-listener

(add-resize-listener terminal listener-fn)
 
@@ -336,7 +371,8 @@

kind is a console constant describing the type of screen you want. If unspecified it defaults to :auto.

The options map can contain any of the following mappings:

-
  • :cols - Width of the desired screen in characters (default 80).
  • +
      +
    • :cols - Width of the desired screen in characters (default 80).
    • :rows - Height of the desired screen in characters (default 24).
    • :charset - Charset of the desired screen. This should be a charset constant (default :utf-8).
    • @@ -347,7 +383,8 @@ names. If a sequence is given, the first font that exists on the system will be used (much like a CSS font-family declaration). Will fall back to a monospaced default font if none of the given ones exist. -

    The :rows, :cols, and :charset options are really just a suggestion!

    +
+

The :rows, :cols, and :charset options are really just a suggestion!

The text-based screens will ignore rows and columns and will be the size of the user's window.

The Swing screen will start out at this size but can be resized later by the @@ -421,13 +458,15 @@

x and y are the column and row to start the string.

s is the actual string to draw.

The options map can contain any of the following mappings:

-
  • :fg - Foreground color of the text. Must be a color constant +
      +
    • :fg - Foreground color of the text. Must be a color constant (default :default).
    • :bg - Background color of the text. Must be a color constant (default :default).
    • :styles - Styles to apply to the text. Must be a set containing zero or more style constants (default #{}). CURRENTLY BROKEN, SORRY
    • -

    lanterna.screen/clear

    +
+

lanterna.screen/clear

(clear screen)
 
@@ -462,10 +501,12 @@

If you want to return immediately instead of blocking when no input is buffered, use get-key instead.

The options map can contain any of the following mappings:

-
  • :interval - The interval between checks, in milliseconds (default 50).
  • +
      +
    • :interval - The interval between checks, in milliseconds (default 50).
    • :timeout - The maximum amount of time blocking will occur before returning nil (default infinity).
    • -

    lanterna.screen/add-resize-listener

    +
+

lanterna.screen/add-resize-listener

(add-resize-listener screen listener-fn)
 
@@ -499,5 +540,7 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(); -
- \ No newline at end of file + +
+ + \ No newline at end of file diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/screens/index.html --- a/clojure-lanterna/screens/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/screens/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -1,8 +1,18 @@ -Screens / clojure-lanterna + + + + Screens / clojure-lanterna + + + + + +
-

clojure-lanterna

+

clojure-lanterna

+

Screens

The next layer of Lanterna is the screen layer. Think of screens as "double buffering for your console".

Screens act as a buffer. You "draw" to the screen like you would normally draw @@ -16,10 +26,13 @@ before you read this. This document moves very quickly because it assumes you've read the previous one.

-
- \ No newline at end of file + +
+ + \ No newline at end of file diff -r b200fd828993 -r cb51d5fdb559 clojure-lanterna/terminals/index.html --- a/clojure-lanterna/terminals/index.html Tue Aug 13 11:16:09 2013 -0400 +++ b/clojure-lanterna/terminals/index.html Thu Feb 27 21:18:52 2014 -0500 @@ -1,13 +1,24 @@ -Terminals / clojure-lanterna + + + + Terminals / clojure-lanterna + + + + + +
-

clojure-lanterna

+

clojure-lanterna

+

Terminals

The lowest layer of Lanterna (and thus clojure-lanterna) is a Terminal.

You can use terminals to do the stuff you normally think of using a curses library for.

-
- \ No newline at end of file + +
+ + \ No newline at end of file