aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-02-08 15:15:56 -0500
committerChris Michael <cpmichael@osg.samsung.com>2016-02-08 15:15:56 -0500
commit0fe9355bd5855902f1633b1c8edfd0a05f60a2be (patch)
tree101415d4e2b313ca33fd34585a33c7e478f85691
parentevas: check EINA_MEMPOOL env var when creating evas mempool allocators (diff)
downloadefl-0fe9355bd5855902f1633b1c8edfd0a05f60a2be.tar.gz
ecore-libinput: Add start of Ecore_Libinput library
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r--src/lib/ecore_libinput/Ecore_Libinput.h43
-rw-r--r--src/lib/ecore_libinput/ecore_libinput.c45
-rw-r--r--src/lib/ecore_libinput/ecore_libinput_private.h40
3 files changed, 128 insertions, 0 deletions
diff --git a/src/lib/ecore_libinput/Ecore_Libinput.h b/src/lib/ecore_libinput/Ecore_Libinput.h
new file mode 100644
index 0000000000..6170bf8d90
--- /dev/null
+++ b/src/lib/ecore_libinput/Ecore_Libinput.h
@@ -0,0 +1,43 @@
+#ifndef _ECORE_LIBINPUT_H
+# define _ECORE_LIBINPUT_H
+
+# include <Efl_Config.h>
+
+# include <Eina.h>
+
+# ifdef EAPI
+# undef EAPI
+# endif
+
+# ifdef _MSC_VER
+# ifdef BUILDING_DLL
+# define EAPI __declspec(dllexport)
+# else // ifdef BUILDING_DLL
+# define EAPI __declspec(dllimport)
+# endif // ifdef BUILDING_DLL
+# else // ifdef _MSC_VER
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else // if __GNUC__ >= 4
+# define EAPI
+# endif // if __GNUC__ >= 4
+# else // ifdef __GNUC__
+# define EAPI
+# endif // ifdef __GNUC__
+# endif // ifdef _MSC_VER
+
+/* # ifdef __cplusplus */
+/* extern "C" { */
+/* # endif */
+
+EAPI int ecore_libinput_init(void);
+
+/* # ifdef __cplusplus */
+/* } */
+/* # endif */
+
+# undef EAPI
+# define EAPI
+
+#endif
diff --git a/src/lib/ecore_libinput/ecore_libinput.c b/src/lib/ecore_libinput/ecore_libinput.c
new file mode 100644
index 0000000000..6bcc6a376c
--- /dev/null
+++ b/src/lib/ecore_libinput/ecore_libinput.c
@@ -0,0 +1,45 @@
+#include "ecore_libinput_private.h"
+
+static int _ecore_libinput_init_count = 0;
+
+int _ecore_libinput_log_dom = -1;
+
+EAPI int
+ecore_libinput_init(void)
+{
+ if (++_ecore_libinput_init_count != 1) return _ecore_libinput_init_count;
+
+ if (!eina_init()) goto eina_err;
+
+ _ecore_libinput_log_dom =
+ eina_log_domain_register("ecore_libinput", ECORE_LIBINPUT_COLOR_DEFAULT);
+ if (!_ecore_libinput_log_dom)
+ {
+ EINA_LOG_ERR("Could not create logging domain");
+ goto log_err;
+ }
+
+ if (!ecore_event_init())
+ {
+ ERR("Could not init Ecore_Event");
+ goto ecore_event_err;
+ }
+
+ if (!eeze_init())
+ {
+ ERR("Could not init Eeze");
+ goto eeze_err;
+ }
+
+ return _ecore_libinput_init_count;
+
+eeze_err:
+ ecore_event_shutdown();
+ecore_event_err:
+ eina_log_domain_unregister(_ecore_libinput_log_dom);
+ _ecore_libinput_log_dom = -1;
+log_err:
+ eina_shutdown();
+eina_err:
+ return --_ecore_libinput_init_count;
+}
diff --git a/src/lib/ecore_libinput/ecore_libinput_private.h b/src/lib/ecore_libinput/ecore_libinput_private.h
new file mode 100644
index 0000000000..a3457a450d
--- /dev/null
+++ b/src/lib/ecore_libinput/ecore_libinput_private.h
@@ -0,0 +1,40 @@
+#ifndef _ECORE_LIBINPUT_PRIVATE_H
+# define _ECORE_LIBINPUT_PRIVATE_H
+
+# include "Ecore.h"
+# include "ecore_private.h"
+# include "Ecore_Input.h"
+# include "Eeze.h"
+
+# ifndef ECORE_LIBINPUT_COLOR_DEFAULT
+# define ECORE_LIBINPUT_COLOR_DEFAULT EINA_COLOR_CYAN
+# endif
+
+extern int _ecore_libinput_log_dom;
+
+# ifdef ERR
+# undef ERR
+# endif
+# define ERR(...) EINA_LOG_DOM_ERR(_ecore_libinput_log_dom, __VA_ARGS__)
+
+# ifdef DBG
+# undef DBG
+# endif
+# define DBG(...) EINA_LOG_DOM_DBG(_ecore_libinput_log_dom, __VA_ARGS__)
+
+# ifdef INF
+# undef INF
+# endif
+# define INF(...) EINA_LOG_DOM_INFO(_ecore_libinput_log_dom, __VA_ARGS__)
+
+# ifdef WRN
+# undef WRN
+# endif
+# define WRN(...) EINA_LOG_DOM_WARN(_ecore_libinput_log_dom, __VA_ARGS__)
+
+# ifdef CRIT
+# undef CRIT
+# endif
+# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_libinput_log_dom, __VA_ARGS__)
+
+#endif