diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-03-24 11:19:31 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-04-13 14:16:17 -0400 |
commit | f8964fcf2e4681ab77e0cf37c96e9994d25b19fd (patch) | |
tree | 4a70ed38cc391e045f5e333ee94fdddf7f4cc851 /src/lib/elput/elput.c | |
parent | c23a61a49caebca1244fad484cae403bf7a0a0fd (diff) |
elput: Initial checkin of elput library
The elput library is an efl abstraction for the libinput library which
can be used by various other subsystems (ecore_fb, ecore_drm, etc) to
handle interfacing with libinput without having to duplicate the code
in each subsystem.
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput/elput.c')
-rw-r--r-- | src/lib/elput/elput.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c new file mode 100644 index 0000000000..1b5613fc3a --- /dev/null +++ b/src/lib/elput/elput.c | |||
@@ -0,0 +1,55 @@ | |||
1 | #include "elput_private.h" | ||
2 | |||
3 | /* local variables */ | ||
4 | static int _elput_init_count = 0; | ||
5 | |||
6 | /* external variables */ | ||
7 | int _elput_log_dom = -1; | ||
8 | |||
9 | EAPI int | ||
10 | elput_init(void) | ||
11 | { | ||
12 | if (++_elput_init_count != 1) return _elput_init_count; | ||
13 | |||
14 | if (!eina_init()) goto eina_err; | ||
15 | if (!ecore_init()) goto ecore_err; | ||
16 | if (!ecore_event_init()) goto ecore_event_err; | ||
17 | if (!eeze_init()) goto eeze_err; | ||
18 | |||
19 | _elput_log_dom = eina_log_domain_register("elput", ELPUT_DEFAULT_LOG_COLOR); | ||
20 | if (!_elput_log_dom) | ||
21 | { | ||
22 | EINA_LOG_ERR("Could not create logging domain for Elput"); | ||
23 | goto log_err; | ||
24 | } | ||
25 | |||
26 | return _elput_init_count; | ||
27 | |||
28 | log_err: | ||
29 | eeze_shutdown(); | ||
30 | eeze_err: | ||
31 | ecore_event_shutdown(); | ||
32 | ecore_event_err: | ||
33 | ecore_shutdown(); | ||
34 | ecore_err: | ||
35 | eina_shutdown(); | ||
36 | eina_err: | ||
37 | return --_elput_init_count; | ||
38 | } | ||
39 | |||
40 | EAPI int | ||
41 | elput_shutdown(void) | ||
42 | { | ||
43 | if (_elput_init_count < 1) return 0; | ||
44 | if (--_elput_init_count != 0) return _elput_init_count; | ||
45 | |||
46 | eina_log_domain_unregister(_elput_log_dom); | ||
47 | _elput_log_dom = -1; | ||
48 | |||
49 | eeze_shutdown(); | ||
50 | ecore_event_shutdown(); | ||
51 | ecore_shutdown(); | ||
52 | eina_shutdown(); | ||
53 | |||
54 | return _elput_init_count; | ||
55 | } | ||