blob: 049471d0526f8704ead3f288b4e12d1def3b947a [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
rgindacbbd7482012-06-13 15:06:16 -07005'use strict';
6
rginda8ba33642011-12-14 12:31:31 -08007/**
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 *
rgindab8bc8932012-04-27 12:45:03 -070021 * 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 *
rginda8ba33642011-12-14 12:31:31 -080025 * @param {hterm.Options=} opt_copy Optional instance to copy.
26 * @constructor
27 */
28hterm.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;
rginda87b86462011-12-14 13:48:03 -080035 this.autoCarriageReturn = opt_copy ? opt_copy.autoCarriageReturn : false;
rginda87b86462011-12-14 13:48:03 -080036 this.cursorVisible = opt_copy ? opt_copy.cursorVisible : false;
rginda6d397402012-01-17 10:58:29 -080037 this.cursorBlink = opt_copy ? opt_copy.cursorBlink : false;
rginda8ba33642011-12-14 12:31:31 -080038 this.insertMode = opt_copy ? opt_copy.insertMode : false;
39 this.reverseVideo = opt_copy ? opt_copy.reverseVideo : false;
40};