author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 11 Oct 2010 14:10:17 -0700 | |
changeset 491 | 27c0e5ff3255 |
parent 470 | d4809db37847 |
permissions | -rw-r--r-- |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
1 |
/** |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies). All |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
3 |
* rights reserved. This component and the accompanying materials are made |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
4 |
* available under the terms of the License "Eclipse Public License v1.0" which |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
5 |
* accompanies this distribution, and is available at the URL |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
6 |
* "http://www.eclipse.org/legal/epl-v10.html". |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
7 |
* |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
8 |
* Initial Contributors: Nokia Corporation - initial contribution. |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
9 |
* |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
10 |
* Contributors: |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
11 |
* |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
12 |
* Description: |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
13 |
* |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
14 |
*/ |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
15 |
var ORIENTATIONS = { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
16 |
DisplayRightUp : "DisplayRightUp", |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
17 |
DisplayLeftUp : "DisplayLeftUp", |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
18 |
DisplayUp : "DisplayUp", |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
19 |
DisplayDown : "DisplayDown", |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
20 |
DisplayUpwards : "DisplayUpwards", |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
21 |
DisplayDownwards : "DisplayDownwards" |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
22 |
}; |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
23 |
|
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
24 |
var MODES = { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
25 |
portrait : "portrait", |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
26 |
landscape : "landscape" |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
27 |
}; |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
28 |
|
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
29 |
function EmulatorState(x, y, z, orientation) { |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
30 |
this.XAxis = x; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
31 |
this.YAxis = y; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
32 |
this.ZAxis = z; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
33 |
this.portrait = orientation; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
34 |
} |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
35 |
|
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
36 |
function Emulator() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
37 |
this.child = false; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
38 |
this.accelerationCallback = false; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
39 |
this.iconFile = 'preview/images/default-Icon.png'; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
40 |
this.loaded = false; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
41 |
this.FORCE = 62; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
42 |
this.state = new EmulatorState(0, this.FORCE, 0, true); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
43 |
this.orientation = ORIENTATIONS.DisplayUp; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
44 |
this.modeForced = false; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
45 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
46 |
this.plist = { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
47 |
DisplayName : '', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
48 |
Identifier : '', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
49 |
MainHTML : '', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
50 |
AllowNetworkAccess : "false", |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
51 |
Version : '', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
52 |
MiniViewEnabled : "false", |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
53 |
is_browserReady : false |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
54 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
55 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
56 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
57 |
Emulator.prototype.setAccelerationCallback = function(acceleration) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
58 |
this.accelerationCallback = acceleration; |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
59 |
this.accelerationCallback(this.state.XAxis, this.state.YAxis, |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
60 |
this.state.ZAxis, this.orientation); |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
61 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
62 |
|
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
63 |
Emulator.prototype.orientationFromAcceleration= function(x, y, z) { |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
64 |
var orientation = NOKIA.emulator.orientation; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
65 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
66 |
var xangle = Math.asin(x) * 180 / Math.PI; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
67 |
if (xangle > 55) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
68 |
orientation = ORIENTATIONS.DisplayRightUp; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
69 |
} else if (xangle < -55) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
70 |
orientation = ORIENTATIONS.DisplayLeftUp; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
71 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
72 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
73 |
var yangle = Math.asin(y) * 180 / Math.PI; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
74 |
if (yangle > 55) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
75 |
orientation = ORIENTATIONS.DisplayUp; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
76 |
} else if (yangle < -55) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
77 |
orientation = ORIENTATIONS.DisplayDown; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
78 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
79 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
80 |
var zangle = Math.asin(z) * 180 / Math.PI; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
81 |
if (zangle > 75) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
82 |
orientation = ORIENTATIONS.DisplayUpwards; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
83 |
} else if (zangle < -75) { |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
84 |
orientation = ORIENTATIONS.DisplayDownwards; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
85 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
86 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
87 |
return orientation; |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
88 |
}; |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
89 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
90 |
Emulator.prototype.accelerationChanged = function(x, y, z) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
91 |
this.state.XAxis = x * this.FORCE; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
92 |
this.state.YAxis = y * this.FORCE; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
93 |
this.state.ZAxis = z * this.FORCE; |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
94 |
|
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
95 |
var orientation = this.orientationFromAcceleration(x, y, z); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
96 |
|
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
97 |
if (orientation != this.orientation) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
98 |
this.orientation = orientation; |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
99 |
NOKIA.helper |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
100 |
.setPreference(EmulatorPreferences.ORIENTATION, orientation); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
101 |
NOKIA.emulator.render(); |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
102 |
} |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
103 |
|
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
104 |
if (this.accelerationCallback) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
105 |
this.accelerationCallback(this.state.XAxis, this.state.YAxis, |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
106 |
this.state.ZAxis, this.orientation); |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
107 |
} |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
108 |
}; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
109 |
|
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
110 |
Emulator.prototype.setAccelerationValues = function(x, y, z) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
111 |
window.setTimeout(function() { |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
112 |
NOKIA.rotationSupport.setAngles(x * 90, y * 90, z * 90); |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
113 |
accelerationCallback(Math.sin(-x * Math.PI / 2), Math.cos(-x * Math.PI / 2), 0); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
114 |
}, 5); |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
115 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
116 |
|
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
117 |
Emulator.prototype.showOrientationAngles = function(orientation) { |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
118 |
var x = 0; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
119 |
var y = 0; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
120 |
var z = 0; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
121 |
switch (orientation) { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
122 |
case ORIENTATIONS.DisplayUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
123 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
124 |
case ORIENTATIONS.DisplayDown: |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
125 |
x = 2; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
126 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
127 |
case ORIENTATIONS.DisplayRightUp: |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
128 |
x = -1; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
129 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
130 |
case ORIENTATIONS.DisplayLeftUp: |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
131 |
x = 1; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
132 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
133 |
case ORIENTATIONS.DisplayUpwards: |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
134 |
x = NOKIA.mode == MODES.portrait ? 0 : -1; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
135 |
z = 1; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
136 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
137 |
case ORIENTATIONS.DisplayDownwards: |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
138 |
x = NOKIA.mode == MODES.portrait ? 0 : -1; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
139 |
z = -1; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
140 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
141 |
} |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
142 |
this.setAccelerationValues(x, y, z); |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
143 |
this.orientation = orientation; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
144 |
NOKIA.helper.setPreference(EmulatorPreferences.ORIENTATION, orientation); |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
145 |
window.setTimeout(function() { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
146 |
NOKIA.emulator.render(); |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
147 |
}, 50); |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
148 |
}; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
149 |
|
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
150 |
Emulator.prototype.load = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
151 |
if (this.loaded) |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
152 |
return false; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
153 |
NOKIA.layout._console_minimized = (NOKIA.helper |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
154 |
.getPreference('__SYM_NOKIA_CONSOLE_OPEN') != "true"); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
155 |
// load the saved device Info |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
156 |
var device = NOKIA.helper.getPreference('__SYM_NOKIA_EMULATOR_DEVICE'); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
157 |
NOKIA.currentDevice = device || NOKIA.currentDevice; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
158 |
|
407
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
159 |
// load the saved device mode |
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
160 |
var mode = NOKIA.helper.getPreference('__SYM_NOKIA_EMULATOR_DEVICE_MODE'); |
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
161 |
if (mode != null) |
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
162 |
NOKIA.mode = mode; |
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
163 |
|
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
164 |
var orientation = NOKIA.helper |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
165 |
.getPreference(EmulatorPreferences.ORIENTATION); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
166 |
if (orientation != null) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
167 |
this.orientation = orientation; |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
168 |
this.showOrientationAngles(orientation); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
169 |
} |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
170 |
|
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
171 |
// SAVE the device DATA |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
172 |
NOKIA.helper.setPreference('__SYM_NOKIA_EMULATOR_DEVICE', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
173 |
NOKIA.currentDevice); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
174 |
NOKIA.helper.setPreference('__SYM_NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
175 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
176 |
this.loaded = true; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
177 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
178 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
179 |
Emulator.prototype.render = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
180 |
this.load(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
181 |
// Selecting Resoltion |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
182 |
var resOptions = $("#resOptions")[0]; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
183 |
for ( var i = 0; i < NOKIA.resolution.length; i++) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
184 |
if (NOKIA.resolution[i] == NOKIA.currentDevice) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
185 |
resOptions.options[i].selected = true; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
186 |
break; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
187 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
188 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
189 |
|
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
190 |
var deg = 0; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
191 |
switch (NOKIA.emulator.orientation) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
192 |
case ORIENTATIONS.DisplayUp: |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
193 |
deg = 0; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
194 |
break; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
195 |
case ORIENTATIONS.DisplayDown: |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
196 |
deg = 180; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
197 |
break; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
198 |
case ORIENTATIONS.DisplayRightUp: |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
199 |
deg = -90; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
200 |
break; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
201 |
case ORIENTATIONS.DisplayLeftUp: |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
202 |
deg = 90; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
203 |
break; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
204 |
default: |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
205 |
if (NOKIA.mode == 'portrait') { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
206 |
deg = 0; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
207 |
} else { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
208 |
deg = -90; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
209 |
} |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
210 |
break; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
211 |
} |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
212 |
if (this.orientationSupports() && !this.modeForced) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
213 |
if (deg == 0) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
214 |
NOKIA.mode = 'portrait'; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
215 |
} else if (deg == -90) { |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
216 |
NOKIA.mode = 'landscape'; |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
217 |
} |
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
218 |
} |
407
c7c8bde493b1
Orientation controls were updated
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
403
diff
changeset
|
219 |
NOKIA.helper.setPreference('__SYM_NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode); |
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
220 |
|
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
221 |
if (!NOKIA.emulator.orientationSupports()) |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
222 |
NOKIA.mode = NOKIA.deviceList[NOKIA.currentDevice]['default']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
223 |
|
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
224 |
this.setStyle(); |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
225 |
|
403
ba20dd5983c7
Acceleration and orientation sensors support
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
402
diff
changeset
|
226 |
var or = (NOKIA.mode == 'portrait') ? deg : (deg + 90); |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
227 |
var val = "rotate(" + or + "deg)"; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
228 |
$("#DeviceDisplayLayout").css("-moz-transform", val); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
229 |
$("#DeviceDisplayLayout").css("-webkit-transform", val); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
230 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
231 |
|
491
27c0e5ff3255
Bug 3809 - Simulator does not properly simulate setDisplay* methods
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
470
diff
changeset
|
232 |
Emulator.prototype.setMode = function(mode, fixed) { |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
233 |
NOKIA.mode = mode; |
491
27c0e5ff3255
Bug 3809 - Simulator does not properly simulate setDisplay* methods
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
470
diff
changeset
|
234 |
NOKIA.emulator.modeForced = fixed ? true : false; // Note - fixed may be undefined |
402
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
235 |
// SAVE the device DATA |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
236 |
NOKIA.helper.setPreference('__SYM_NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
237 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
238 |
NOKIA.emulator.render(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
239 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
240 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
241 |
Emulator.prototype.orientationSupports = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
242 |
return NOKIA.deviceList[NOKIA.currentDevice]['orientation']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
243 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
244 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
245 |
Emulator.prototype.setStyle = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
246 |
if (!NOKIA.helper.checkDependencies()) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
247 |
setTimeout(NOKIA.emulator.setStyle, 1000); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
248 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
249 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
250 |
var deviceProperties = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
251 |
var style = deviceProperties['style']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
252 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
253 |
// Apply Style and propertis to Device layers |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
254 |
$("#DeviceDisplayLayout").css(style['layout']); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
255 |
$('#DisplayArea').css(style['display']); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
256 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
257 |
NOKIA.emulator.setWidgetStyle(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
258 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
259 |
$('#SoftKeysArea').css( { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
260 |
'width' : style['menu']['width'] + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
261 |
'height' : style['menu']['height'] + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
262 |
'float' : style['menu']['float'] |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
263 |
}); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
264 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
265 |
$('#SoftKeysArea > ul > li').css('width', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
266 |
parseInt(style['menu']['width'] / 2) - 10); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
267 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
268 |
NOKIA.emulator.setMenuItemsStyle(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
269 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
270 |
$('#SoftKeys').css(style['softkeys']); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
271 |
// $('#SoftKeys > a > img').css(style['softkeysImg']); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
272 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
273 |
NOKIA.menu.createSFKArea(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
274 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
275 |
$("#DeviceDisplayLayout").show(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
276 |
$("#InspectorTab").show(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
277 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
278 |
if (/chrome/.test(navigator.userAgent.toLowerCase())) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
279 |
$("#InspectorBtn").show(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
280 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
281 |
if (/mac/.test(navigator.userAgent.toLowerCase())) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
282 |
$("#MacShortcut").show(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
283 |
} else { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
284 |
$("#UniversalShortcut").show(); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
285 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
286 |
}, |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
287 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
288 |
Emulator.prototype.setWidgetStyle = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
289 |
var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
290 |
var height; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
291 |
if (NOKIA.menu.softkeys_visibility || NOKIA.menu.is_softkeys_visible) |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
292 |
height = parseInt(style['widget']['height'] - style['menu']['height']); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
293 |
else |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
294 |
height = style['widget']['height']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
295 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
296 |
$('#WidgetArea').css( { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
297 |
'width' : style['widget']['width'] + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
298 |
'height' : height + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
299 |
'float' : style['widget']['float'] |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
300 |
}); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
301 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
302 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
303 |
Emulator.prototype.setMenuItemsStyle = function() { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
304 |
var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style']; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
305 |
var count = 1; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
306 |
try { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
307 |
if (NOKIA.emulator.child.menu) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
308 |
count = parseInt(NOKIA.helper |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
309 |
.getElementsLengthInObject(NOKIA.emulator.child.menu.items)) + 1; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
310 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
311 |
} catch (e) { |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
312 |
count = 1; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
313 |
} |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
314 |
var height = parseInt(count * style['menu']['optionKeysheight']) + 10; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
315 |
var top = parseInt(style['widget']['height'] - height); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
316 |
|
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
317 |
$('#MenuItemsArea').css( |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
318 |
{ |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
319 |
'width' : style['widget']['width'] + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
320 |
'height' : height + 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
321 |
'marginTop' : '-2px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
322 |
'top' : (style['widget']['height'] - height |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
323 |
- style['menu']['height'] + 2) |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
324 |
+ 'px', |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
325 |
'position' : 'relative' |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
326 |
}); |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
327 |
}; |
f943a50b6689
Acceleration and orientation - initial cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
328 |
|
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
329 |
Emulator.prototype.turn = function(direction) { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
330 |
var newOrientation = ORIENTATIONS.DisplayUp; |
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
331 |
if (this.orientation == ORIENTATIONS.DisplayUpwards || this.orientation == ORIENTATIONS.DisplayDownwards) { |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
332 |
if (NOKIA.mode == MODES.portrait) { |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
333 |
this.orientation = ORIENTATIONS.DisplayUp; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
334 |
} else { |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
335 |
this.orientation = ORIENTATIONS.DisplayRightUp; |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
336 |
} |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
337 |
} |
412
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
338 |
if (direction > 0) { // Clockwise |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
339 |
switch (this.orientation) { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
340 |
case ORIENTATIONS.DisplayUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
341 |
newOrientation = ORIENTATIONS.DisplayLeftUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
342 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
343 |
case ORIENTATIONS.DisplayLeftUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
344 |
newOrientation = ORIENTATIONS.DisplayDown; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
345 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
346 |
case ORIENTATIONS.DisplayDown: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
347 |
newOrientation = ORIENTATIONS.DisplayRightUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
348 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
349 |
case ORIENTATIONS.DisplayRightUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
350 |
newOrientation = ORIENTATIONS.DisplayUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
351 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
352 |
} |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
353 |
} else { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
354 |
switch (this.orientation) { |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
355 |
case ORIENTATIONS.DisplayUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
356 |
newOrientation = ORIENTATIONS.DisplayRightUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
357 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
358 |
case ORIENTATIONS.DisplayLeftUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
359 |
newOrientation = ORIENTATIONS.DisplayUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
360 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
361 |
case ORIENTATIONS.DisplayDown: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
362 |
newOrientation = ORIENTATIONS.DisplayLeftUp; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
363 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
364 |
case ORIENTATIONS.DisplayRightUp: |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
365 |
newOrientation = ORIENTATIONS.DisplayDown; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
366 |
break; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
367 |
} |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
368 |
} |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
369 |
this.orientation = newOrientation; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
370 |
this.showOrientationAngles(newOrientation); |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
371 |
this.render(); |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
372 |
}; |
72448215f517
Bug 2785 - Orientation and Resolution Controls Placements
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
407
diff
changeset
|
373 |
|
423
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
374 |
function accelerationCallback(x, y, z) { |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
375 |
NOKIA.emulator.accelerationChanged(x, y, z); |
742a5cb59f9a
Bug 3156 - Orientation controls don't send events to the "phone"
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
412
diff
changeset
|
376 |
} |