Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: third_party/google_input_tools/src/chrome/os/inputview/elements/content/point.js

Issue 1576613002: Update Google Input Tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing APIs, remove bade dependencies. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/google_input_tools/src/chrome/os/inputview/elements/content/point.js
diff --git a/third_party/google_input_tools/src/chrome/os/inputview/elements/content/point.js b/third_party/google_input_tools/src/chrome/os/inputview/elements/content/point.js
new file mode 100644
index 0000000000000000000000000000000000000000..2490b8b4642e04a579a1341d8d8cf4ba5f4696c6
--- /dev/null
+++ b/third_party/google_input_tools/src/chrome/os/inputview/elements/content/point.js
@@ -0,0 +1,107 @@
+// Copyright 2016 The ChromeOS IME Authors. All Rights Reserved.
+// limitations under the License.
+// See the License for the specific language governing permissions and
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// distributed under the License is distributed on an "AS-IS" BASIS,
+// Unless required by applicable law or agreed to in writing, software
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// You may obtain a copy of the License at
+// you may not use this file except in compliance with the License.
+// Licensed under the Apache License, Version 2.0 (the "License");
+//
+/**
+ * @fileoverview A single point in a gesture typing stroke.
+ */
+goog.provide('i18n.input.chrome.inputview.elements.content.Point');
+
+goog.scope(function() {
+
+
+
+/**
+ * This class is used for two purposes: (1) Be rendered as a gesture trail in
+ * the UI, and (2) be transmitted to the backend decoder where they are
+ * processed into candidate words.
+ *
+ * @param {number} x The x coordinate.
+ * @param {number} y The y coordinate.
+ * @param {number} identifier The pointer event identifier.
+ * @constructor
+ */
+i18n.input.chrome.inputview.elements.content.Point =
+ function(x, y, identifier) {
+ /**
+ * The left offset relative to the canvas.
+ *
+ * @type {number}
+ */
+ this.x = x;
+
+ /**
+ * The top offset relative to the canvas.
+ *
+ * @type {number}
+ */
+ this.y = y;
+
+ /**
+ * The pointer ID.
+ *
+ * @type {number}
+ */
+ this.pointer = 0;
+
+ /**
+ * The time-to-live value of the point, used to render the trail fading
+ * effect.
+ *
+ * @type {number}
+ */
+ this.ttl = Point.STARTING_TTL;
+
+ /**
+ * The time this point was created, in ms since epoch.
+ *
+ * @type {number}
+ */
+ this.time = Date.now();
+
+ /**
+ * The action type of the point.
+ *
+ * @type {i18n.input.chrome.inputview.elements.content.Point.Action}
+ */
+ this.action = i18n.input.chrome.inputview.elements.content.Point.Action.MOVE;
+
+ /**
+ * The pointer event identifier associated with this point.
+ *
+ * @type {number}
+ */
+ this.identifier = identifier;
+};
+var Point =
+ i18n.input.chrome.inputview.elements.content.Point;
+
+
+/**
+ * Starting time-to-live value.
+ *
+ * @const {number}
+ */
+Point.STARTING_TTL = 255;
+
+
+/**
+ * Enum describing the type of action for a given point.
+ *
+ * @enum {number}
+ */
+Point.Action = {
+ DOWN: 0,
+ UP: 1,
+ MOVE: 2
+};
+}); // goog.scope

Powered by Google App Engine
This is Rietveld 408576698