Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / third_party / google_input_tools / src / chrome / os / inputview / layouts / handwriting_layout.js
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
13 //
14 goog.require('i18n.input.chrome.inputview.layouts.SpaceRow');
15 goog.require('i18n.input.chrome.inputview.layouts.util');
16
17
18 (function() {
19   var util = i18n.input.chrome.inputview.layouts.util;
20   util.setPrefix('handwriting-k-');
21
22   var verticalRows = [];
23   var baseKeySpec = {
24     'widthInWeight': 1,
25     'heightInWeight': 1
26   };
27   for (var i = 0; i < 3; i++) {
28     verticalRows.push(util.createKey(baseKeySpec));
29   }
30   var leftSideColumn = util.createVerticalLayout({
31     'id': 'leftSideColumn',
32     'children': verticalRows
33   });
34
35   verticalRows = [];
36   for (var i = 0; i < 3; i++) {
37     verticalRows.push(util.createKey(baseKeySpec));
38   }
39   var rightSideColumn = util.createVerticalLayout({
40     'id': 'rightSideColumn',
41     'children': verticalRows
42   });
43
44   var spec = {
45     'id': 'canvasView',
46     'widthInWeight': 11.2,
47     'heightInWeight': 4
48   };
49
50   var canvasView = util.createCanvasView(spec);
51   var panelView = util.createHandwritingLayout({
52     'id': 'panelView',
53     'children': [canvasView, leftSideColumn, rightSideColumn]
54   });
55
56   // Keyboard view.
57   var keyboardView = util.createLayoutView({
58     'id': 'keyboardView',
59     'children': [panelView],
60     'widthPercent': 100,
61     'heightPercent': 100
62   });
63
64
65   var keyboardContainer = util.createLinearLayout({
66     'id': 'keyboardContainer',
67     'children': [keyboardView]
68   });
69
70   var data = {
71     'layoutID': 'handwriting',
72     'heightPercentOfWidth': 0.275,
73     'minimumHeight': 350,
74     'fullHeightInWeight': 5.6,
75     'children': [keyboardContainer]
76   };
77
78   google.ime.chrome.inputview.onLayoutLoaded(data);
79
80 }) ();