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