forked from nemomobile/mce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tklock.h
189 lines (142 loc) · 7.27 KB
/
tklock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/**
* @file tklock.h
* Headers for the touchscreen/keypad lock component
* of the Mode Control Entity
* <p>
* Copyright © 2004-2011 Nokia Corporation and/or its subsidiary(-ies).
* <p>
* @author David Weinehall <[email protected]>
*
* mce is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* mce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with mce. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TKLOCK_H_
#define _TKLOCK_H_
#include <glib.h>
#ifndef MCE_GCONF_LOCK_PATH
/** Path to the GConf settings for the touchscreen/keypad lock */
#define MCE_GCONF_LOCK_PATH "/system/osso/dsm/locks"
#endif /* MCE_GCONF_LOCK_PATH */
/** SysFS interface to enable/disable RX-51 keyboard IRQs */
#define MCE_RX51_KEYBOARD_SYSFS_DISABLE_PATH "/sys/class/i2c-adapter/i2c-1/1-004a/twl4030_keypad/disable_kp"
/** SysFS interface to enable/disable keypad IRQs */
#define MCE_KEYPAD_SYSFS_DISABLE_PATH "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable_kp"
/** SysFS interface to enable/disable the RX-44/RX-48 keyboard IRQs */
#define MCE_RX44_KEYBOARD_SYSFS_DISABLE_PATH "/sys/devices/platform/i2c_omap.2/i2c-0/0-0045/disable_kp"
/**
* Default double tap gesture:
*
* 0 - Gesture disabled
* 1 - Show unlock screen
* 2 - Unlock tklock
*/
#define DEFAULT_DOUBLETAP_GESTURE_POLICY 1
/** Proximity timeout for double tap gesture; in seconds */
#define DEFAULT_POCKET_MODE_PROXIMITY_TIMEOUT 5
/** Proximity timeout for double tap gesture; in seconds */
#define DEFAULT_DOUBLETAP_PROXIMITY_TIMEOUT 0
/**
* SysFS interface to enable/disable
* RM-680/RM-690/RM-696/RM-716 double tap gesture recognition
*/
#define MCE_RM680_DOUBLETAP_SYSFS_PATH "/sys/class/i2c-adapter/i2c-2/2-004b/wait_for_gesture"
/**
* SysFS interface to recalibrate
* RM-680/RM-690/RM-696/RM-716 touchscreen
*/
#define MCE_RM680_TOUCHSCREEN_CALIBRATION_PATH "/sys/class/i2c-adapter/i2c-2/2-004b/calibrate"
/**
* SysFS interface to enable/disable
* RM-680/RM-690/RM-696/RM-716 touchscreen IRQs
*/
#define MCE_RM680_TOUCHSCREEN_SYSFS_DISABLE_PATH "/sys/class/i2c-adapter/i2c-2/2-004b/disable_ts"
/** SysFS interface to enable/disable RX-44/RX-48/RX-51 touchscreen IRQs */
#define MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts"
#define MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH_KERNEL2637 "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable"
/** Touch screen enable delay for calibration **/
#define MCE_TOUCHSCREEN_CALIBRATION_DELAY 100000 /* 100 milliseconds */
/** Default fallback setting for the touchscreen/keypad autolock */
#define DEFAULT_TK_AUTOLOCK FALSE /* FALSE / TRUE */
/** Path to the touchscreen/keypad autolock GConf setting */
#define MCE_GCONF_TK_AUTOLOCK_ENABLED_PATH MCE_GCONF_LOCK_PATH "/touchscreen_keypad_autolock_enabled"
/** Path to the touchscreen/keypad double tap gesture GConf setting */
#define MCE_GCONF_TK_DOUBLE_TAP_GESTURE_PATH MCE_GCONF_LOCK_PATH "/tklock_double_tap_gesture"
/** Path to the automatic tklock dim/blank disable GConf setting */
#define MCE_GCONF_TK_AUTO_BLANK_DISABLE_PATH MCE_GCONF_LOCK_PATH "/tklock_blank_disable"
/** Name of D-Bus callback to provide to Touchscreen/Keypad Lock SystemUI */
#define MCE_TKLOCK_CB_REQ "tklock_callback"
/** Delay before the touchscreen/keypad is unlocked */
#define MCE_TKLOCK_UNLOCK_DELAY 500 /**< 0.5 seconds */
#ifndef MCE_CONF_TKLOCK_GROUP
/** Name of Touchscreen/Keypad lock configuration group */
#define MCE_CONF_TKLOCK_GROUP "TKLock"
#endif /* MCE_CONF_TKLOCK_GROUP */
/** Name of configuration key for touchscreen/keypad immediate blanking */
#define MCE_CONF_BLANK_IMMEDIATELY "BlankImmediately"
/** Name of configuration key for touchscreen/keypad immediate dimming */
#define MCE_CONF_DIM_IMMEDIATELY "DimImmediately"
/** Name of configuration key for touchscreen/keypad dim timeout */
#define MCE_CONF_DIM_DELAY "DimDelay"
/** Name of configuration key for touchscreen immediate disabling */
#define MCE_CONF_TS_OFF_IMMEDIATELY "DisableTSImmediately"
/** Name of configuration key for keypad immediate disabling */
#define MCE_CONF_KP_OFF_IMMEDIATELY "DisableKPImmediately"
/** Name of configuration key for keyboard slide autolock */
#define MCE_CONF_AUTOLOCK_SLIDE_OPEN "AutolockWhenSlideOpen"
/** Name of configuration key for keyboard slide proximity lock */
#define MCE_CONF_PROXIMITY_LOCK_SLIDE_OPEN "ProximityLockWhenSlideOpen"
/** Name of configuration key for keyboard slide unconditional lock on close */
#define MCE_CONF_LOCK_ON_SLIDE_CLOSE "AlwaysLockOnSlideClose"
/** Name of configuration key for lens cover triggered tklock unlocking */
#define MCE_CONF_LENS_COVER_UNLOCK "LensCoverUnlock"
/** Name of configuration key for volume key triggered unlock screen */
#define MCE_CONF_VOLKEY_VISUAL_TRIGGER "TriggerUnlockScreenWithVolumeKeys"
/** Double tap timeout for the touchscreen in milliseconds; 0.5 seconds */
#define DEFAULT_TS_DOUBLE_DELAY 500
/** Default fallback setting for tklock immediate blanking */
#define DEFAULT_BLANK_IMMEDIATELY FALSE /* FALSE / TRUE */
/** Default fallback setting for tklock immediate dimming */
#define DEFAULT_DIM_IMMEDIATELY FALSE /* FALSE / TRUE */
/** Default visual lock blank timeout */
#define DEFAULT_VISUAL_BLANK_DELAY 5 /* 5 seconds */
/** Default visual lock blank timeout */
#define DEFAULT_VISUAL_FORCED_BLANK_DELAY 30 /* 30 seconds */
/** Default delay before the display dims */
#define DEFAULT_DIM_DELAY 3 /* 3 seconds */
/** Default powerkey repeat emulation delay */
#define DEFAULT_POWERKEY_REPEAT_DELAY 1 /* 1 second */
/** Default powerkey repeat count limit */
#define DEFAULT_POWERKEY_REPEAT_LIMIT 10
/** Default fallback setting for touchscreen immediate disabling */
#define DEFAULT_TS_OFF_IMMEDIATELY 2 /* 0 / 1 / _2_ */
/** Default fallback setting for keypad immediate disabling */
#define DEFAULT_KP_OFF_IMMEDIATELY 2 /* 0 / 1 / _2_ */
/** Default fallback setting for autolock with open keyboard slide */
#define DEFAULT_AUTOLOCK_SLIDE_OPEN FALSE /* FALSE */
/** Default fallback setting for proximity lock with open keyboard slide */
#define DEFAULT_PROXIMITY_LOCK_SLIDE_OPEN FALSE /* FALSE */
/** Default fallback setting for unconditional lock on close keyboard slide */
#define DEFAULT_LOCK_ON_SLIDE_CLOSE FALSE /* FALSE */
/** Default fallback setting for lens cover triggered tklock unlocking */
#define DEFAULT_LENS_COVER_UNLOCK TRUE /* TRUE */
/** Default fallback setting for proximity lock when callstate == ringing */
#define DEFAULT_PROXIMITY_LOCK_WHEN_RINGING FALSE /* FALSE */
/** Default fallback setting for volume key triggered unlock screen */
#define DEFAULT_VOLKEY_VISUAL_TRIGGER TRUE /* TRUE */
/** Default fallback setting for auto lock after call end */
#define DEFAULT_AUTORELOCK_AFTER_CALL_END FALSE /* FALSE */
/* when MCE is made modular, this will be handled differently
*/
gboolean mce_tklock_init(void);
void mce_tklock_exit(void);
void mce_tklock_show_tklock_ui(void);
#endif /* _TKLOCK_H_ */