rginda | 6d39740 | 2012-01-17 10:58:29 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
rginda | cbbd748 | 2012-06-13 15:06:16 -0700 | [diff] [blame^] | 5 | 'use strict'; |
| 6 | |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 7 | /** |
| 8 | * @fileoverview This file implements the hterm.Options class, |
| 9 | * which stores current operating conditions for the terminal. This object is |
| 10 | * used instead of a series of parameters to allow saving/restoring of cursor |
| 11 | * conditions easily, and to provide an easy place for common configuration |
| 12 | * options. |
| 13 | * |
| 14 | * Original code by Cory Maccarrone. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * Constructor for the hterm.Options class, optionally acting as a copy |
| 19 | * constructor. |
| 20 | * |
rginda | b8bc893 | 2012-04-27 12:45:03 -0700 | [diff] [blame] | 21 | * The defaults are as defined in http://www.vt100.net/docs/vt510-rm/DECSTR |
| 22 | * except that we enable autowrap (wraparound) by defaut since that seems to |
| 23 | * be what xterm does. |
| 24 | * |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 25 | * @param {hterm.Options=} opt_copy Optional instance to copy. |
| 26 | * @constructor |
| 27 | */ |
| 28 | hterm.Options = function(opt_copy) { |
| 29 | // All attributes in this class are public to allow easy access by the |
| 30 | // terminal. |
| 31 | |
| 32 | this.wraparound = opt_copy ? opt_copy.wraparound : true; |
| 33 | this.reverseWraparound = opt_copy ? opt_copy.reverseWraparound : false; |
| 34 | this.originMode = opt_copy ? opt_copy.originMode : false; |
rginda | 87b8646 | 2011-12-14 13:48:03 -0800 | [diff] [blame] | 35 | this.autoCarriageReturn = opt_copy ? opt_copy.autoCarriageReturn : false; |
rginda | 87b8646 | 2011-12-14 13:48:03 -0800 | [diff] [blame] | 36 | this.cursorVisible = opt_copy ? opt_copy.cursorVisible : false; |
rginda | 6d39740 | 2012-01-17 10:58:29 -0800 | [diff] [blame] | 37 | this.cursorBlink = opt_copy ? opt_copy.cursorBlink : false; |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 38 | this.insertMode = opt_copy ? opt_copy.insertMode : false; |
| 39 | this.reverseVideo = opt_copy ? opt_copy.reverseVideo : false; |
| 40 | }; |