forked from nemomobile/mce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mce-hybris.h
107 lines (81 loc) · 2.96 KB
/
mce-hybris.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
/* ------------------------------------------------------------------------- *
* Copyright (C) 2013 Jolla Ltd.
* Contact: Simo Piiroinen <[email protected]>
* License: LGPLv2
* ------------------------------------------------------------------------- */
/* FIXME: This header is included in sourcetrees of both mce and
* mce-plugin-libhybris. For now it must be kept in sync
* manually.
*/
#ifndef MCE_HYBRIS_H_
# define MCE_HYBRIS_H_
# ifndef MCE_HYBRIS_INTERNAL
# define MCE_HYBRIS_INTERNAL 0
# endif
# include <stdbool.h>
# include <stdint.h>
# ifdef __cplusplus
extern "C" {
# elif 0
} /* fool JED indentation ... */
# endif
/* - - - - - - - - - - - - - - - - - - - *
* frame buffer power state
* - - - - - - - - - - - - - - - - - - - */
bool mce_hybris_framebuffer_init(void);
void mce_hybris_framebuffer_quit(void);
bool mce_hybris_framebuffer_set_power(bool on);
/* - - - - - - - - - - - - - - - - - - - *
* display backlight brightness
* - - - - - - - - - - - - - - - - - - - */
bool mce_hybris_backlight_init(void);
void mce_hybris_backlight_quit(void);
bool mce_hybris_backlight_set_brightness(int level);
/* - - - - - - - - - - - - - - - - - - - *
* keypad backlight brightness
* - - - - - - - - - - - - - - - - - - - */
bool mce_hybris_keypad_set_brightness(int level);
void mce_hybris_keypad_quit(void);
bool mce_hybris_keypad_init(void);
/* - - - - - - - - - - - - - - - - - - - *
* indicator led pattern
* - - - - - - - - - - - - - - - - - - - */
bool mce_hybris_indicator_init(void);
void mce_hybris_indicator_quit(void);
bool mce_hybris_indicator_set_pattern(int r, int g, int b, int ms_on, int ms_off);
/* - - - - - - - - - - - - - - - - - - - *
* proximity sensor
* - - - - - - - - - - - - - - - - - - - */
typedef void (*mce_hybris_ps_fn)(int64_t timestamp, float distance);
bool mce_hybris_ps_init(void);
void mce_hybris_ps_quit(void);
bool mce_hybris_ps_set_active(bool active);
bool mce_hybris_ps_set_callback(mce_hybris_ps_fn cb);
/* - - - - - - - - - - - - - - - - - - - *
* ambient light sensor
* - - - - - - - - - - - - - - - - - - - */
typedef void (*mce_hybris_als_fn)(int64_t timestamp, float light);
bool mce_hybris_als_init(void);
void mce_hybris_als_quit(void);
bool mce_hybris_als_set_active(bool active);
bool mce_hybris_als_set_callback(mce_hybris_als_fn cb);
/* - - - - - - - - - - - - - - - - - - - *
* generic
* - - - - - - - - - - - - - - - - - - - */
void mce_hybris_quit(void);
/* - - - - - - - - - - - - - - - - - - - *
* internal to module <--> plugin
* - - - - - - - - - - - - - - - - - - - */
# if MCE_HYBRIS_INTERNAL >= 1
typedef void (*mce_hybris_log_fn)(int lev, const char *file, const char *func,
const char *text);
# endif
# if MCE_HYBRIS_INTERNAL >= 2
void mce_hybris_set_log_hook(mce_hybris_log_fn cb);
void mce_hybris_ps_set_hook(mce_hybris_ps_fn cb);
void mce_hybris_als_set_hook(mce_hybris_als_fn cb);
# endif
# ifdef __cplusplus
};
# endif
#endif /* MCE_HYBRIS_H_ */