Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from morphis/morphis/common-rework

Morphis/common rework
  • Loading branch information...
commit a0d2be2653c1fbdb5bed063bc00a135997baf68e 2 parents b94bc94 + 032cd9e
@stskeeps stskeeps authored
View
10 .gitignore
@@ -24,3 +24,13 @@ ltmain.sh
ylwrap
compile
stamp-h1
+
+aclocal-copy
+arm-*-linux-gnueabi-libtool
+
+tests/test_egl
+tests/test_glesv2
+tests/test_lights
+tests/test_offscreen_rendering
+tests/test_sensors
+tests/test_ui
View
4 configure.ac
@@ -85,9 +85,9 @@ AC_ARG_ENABLE(alinker,
exit -1
fi
],
- [alinker="gingerbread"]
+ [alinker="gb"]
)
-AM_CONDITIONAL([WANT_GB], [test x$alinker = xbg])
+AM_CONDITIONAL([WANT_GB], [test x$alinker = xgb])
AM_CONDITIONAL([WANT_ICS], [test x$alinker = xics])
AM_CONDITIONAL([WANT_JB], [test x$alinker = xjb])
View
2  egl/fbdev_window.h
@@ -2,7 +2,7 @@
#define FBDEV_WINDOW_H
#include "nativewindowbase.h"
#include <linux/fb.h>
-#include <hardware/gralloc.h>
+#include <android/hardware/gralloc.h>
#define FRAMEBUFFER_PARTITIONS 2
class FbDevNativeWindowBuffer : public BaseNativeWindowBuffer
View
2  egl/native_handle.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <cutils/native_handle.h>
+#include <android/cutils/native_handle.h>
native_handle_t* native_handle_create(int numFds, int numInts)
{
View
4 egl/nativewindowbase.cpp
@@ -1,5 +1,5 @@
-#include <system/window.h>
-#include <hardware/gralloc.h>
+#include <android/system/window.h>
+#include <android/hardware/gralloc.h>
#include "support.h"
#include <stdarg.h>
View
2  egl/nativewindowbase.h
@@ -1,7 +1,7 @@
#ifndef NATIVEWINDOWBASE_H
#define NATIVEWINDOWBASE_H
-#include <system/window.h>
+#include <android/system/window.h>
#include <EGL/egl.h>
#define NO_ERROR 0L
View
2  egl/offscreen_window.cpp
@@ -22,7 +22,7 @@
#include <sys/mman.h> //mmap, munmap
#include <errno.h>
-#include <hardware/gralloc.h>
+#include <android/hardware/gralloc.h>
#include "nativewindowbase.h"
#include "offscreen_window.h"
View
2  egl/offscreen_window.h
@@ -2,7 +2,7 @@
#define OFFSCREEN_WINDOW_H
#include <linux/fb.h>
-#include <hardware/gralloc.h>
+#include <android/hardware/gralloc.h>
#include "nativewindowbase.h"
View
22 include/Makefile.am
@@ -39,19 +39,19 @@ vginclude_HEADERS = \
VG/vgplatform.h \
VG/vgu.h
-cutilsincludedir = $(includedir)/cutils
+cutilsincludedir = $(includedir)/android/cutils
cutilsinclude_HEADERS = \
- cutils/native_handle.h
+ android/cutils/native_handle.h
-systemincludedir = $(includedir)/system
+systemincludedir = $(includedir)/android/system
systeminclude_HEADERS = \
- system/window.h \
- system/graphics.h
+ android/system/window.h \
+ android/system/graphics.h
-hardwareincludedir = $(includedir)/hardware
+hardwareincludedir = $(includedir)/android/hardware
hardwareinclude_HEADERS = \
- hardware/fb.h \
- hardware/gralloc.h \
- hardware/hardware.h \
- hardware/sensors.h \
- hardware/lights.h
+ android/hardware/fb.h \
+ android/hardware/gralloc.h \
+ android/hardware/hardware.h \
+ android/hardware/sensors.h \
+ android/hardware/lights.h
View
0  include/cutils/native_handle.h → include/android/cutils/native_handle.h
File renamed without changes
View
5 include/hardware/fb.h → include/android/hardware/fb.h
@@ -22,9 +22,8 @@
#include <sys/cdefs.h>
#include <sys/types.h>
-#include <cutils/native_handle.h>
-
-#include <hardware/hardware.h>
+#include <android/cutils/native_handle.h>
+#include <android/hardware/hardware.h>
__BEGIN_DECLS
View
10 include/hardware/gralloc.h → include/android/hardware/gralloc.h
@@ -18,17 +18,17 @@
#ifndef ANDROID_GRALLOC_INTERFACE_H
#define ANDROID_GRALLOC_INTERFACE_H
-#include <system/window.h>
-#include <hardware/hardware.h>
+#include <android/system/window.h>
+#include <android/hardware/hardware.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
-#include <cutils/native_handle.h>
+#include <android/cutils/native_handle.h>
-#include <hardware/hardware.h>
-#include <hardware/fb.h>
+#include <android/hardware/hardware.h>
+#include <android/hardware/fb.h>
__BEGIN_DECLS
View
4 include/hardware/hardware.h → include/android/hardware/hardware.h
@@ -20,8 +20,8 @@
#include <stdint.h>
#include <sys/cdefs.h>
-#include <cutils/native_handle.h>
-#include <system/graphics.h>
+#include <android/cutils/native_handle.h>
+#include <android/system/graphics.h>
__BEGIN_DECLS
View
2  include/hardware/lights.h → include/android/hardware/lights.h
@@ -21,7 +21,7 @@
#include <sys/cdefs.h>
#include <sys/types.h>
-#include <hardware/hardware.h>
+#include <android/hardware/hardware.h>
__BEGIN_DECLS
View
4 include/hardware/sensors.h → include/android/hardware/sensors.h
@@ -21,8 +21,8 @@
#include <sys/cdefs.h>
#include <sys/types.h>
-#include <hardware/hardware.h>
-#include <cutils/native_handle.h>
+#include <android/hardware/hardware.h>
+#include <android/cutils/native_handle.h>
__BEGIN_DECLS
View
0  include/system/graphics.h → include/android/system/graphics.h
File renamed without changes
View
4 include/system/window.h → include/android/system/window.h
@@ -22,8 +22,8 @@
#include <string.h>
#include <sys/cdefs.h>
-#include <system/graphics.h>
-#include <cutils/native_handle.h>
+#include <android/system/graphics.h>
+#include <android/cutils/native_handle.h>
__BEGIN_DECLS
View
128 include/hybris/internal/binding.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
+ * 2012 Canonical Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HYBRIS_BINDING_H_
+#define HYBRIS_BINDING_H_
+
+void *android_dlopen(const char *filename, int flag);
+void *android_dlsym(void *name, const char *symbol);
+
+#define HYBRIS_DLSYSM(name, fptr, sym) \
+ if (!name##_handle) \
+ hybris_##name##_initialize(); \
+ if (*(fptr) == NULL) \
+ { \
+ *(fptr) = (void *) android_dlsym(name##_handle, sym); \
+ }
+
+#define HYBRIS_LIBRARY_INITIALIZE(name, path) \
+ void *name##_handle; \
+ void hybris_##name##_initialize() \
+ { \
+ name##_handle = android_dlopen(path, RTLD_LAZY); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION0(name, return_type, symbol) \
+ return_type symbol() \
+ { \
+ static return_type (*f)() = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION1(name, return_type, symbol, arg1) \
+ return_type symbol(arg1 _1) \
+ { \
+ static return_type (*f)(arg1) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION2(name, return_type, symbol, arg1, arg2) \
+ return_type symbol(arg1 _1, arg2 _2) \
+ { \
+ static return_type (*f)(arg1, arg2) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION3(name, return_type, symbol, arg1, arg2, arg3) \
+ return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
+ { \
+ static return_type (*f)(arg1, arg2, arg3) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2, _3); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION4(name, return_type, symbol, arg1, arg2, arg3, arg4) \
+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
+ { \
+ static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2, _3, _4); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION5(name, return_type, symbol, arg1, arg2, arg3, arg4, arg5) \
+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5) \
+ { \
+ static return_type (*f)(arg1, arg2, arg3, arg4, arg5) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2, _3, _4, _5); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION6(name, return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
+ { \
+ static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2, _3, _4, _5, _6); \
+ }
+
+#define HYBRIS_IMPLEMENT_FUNCTION7(name, return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
+ { \
+ static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ return f(_1, _2, _3, _4, _5, _6, _7); \
+ }
+
+#define HYBRIS_IMPLEMENT_VOID_FUNCTION1(name, symbol, arg1) \
+ void symbol(arg1 _1) \
+ { \
+ static void (*f)(arg1) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ f(_1); \
+ }
+
+#define HYBRIS_IMPLEMENT_VOID_FUNCTION2(name, symbol, arg1, arg2) \
+ void symbol(arg1 _1, arg2 _2) \
+ { \
+ static void (*f)(arg1, arg2) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ f(_1, _2); \
+ }
+
+#define HYBRIS_IMPLEMENT_VOID_FUNCTION3(name, symbol, arg1, arg2, arg3) \
+ void symbol(arg1 _1, arg2 _2, arg3 _3) \
+ { \
+ static void (*f)(arg1, arg2, arg3) = NULL; \
+ HYBRIS_DLSYSM(name, &f, #symbol); \
+ f(_1, _2, _3); \
+ }
+
+
+#endif
View
2  tests/test_lights.c
@@ -18,7 +18,7 @@
#include <memory.h>
#include <assert.h>
#include <stdio.h>
-#include <hardware/lights.h>
+#include <android/hardware/lights.h>
int main(int argc, char **argv)
{
View
2  tests/test_sensors.c
@@ -17,7 +17,7 @@
#include <assert.h>
#include <stdio.h>
-#include <hardware/sensors.h>
+#include <android/hardware/sensors.h>
int main(int argc, char **argv)
{
Please sign in to comment.
Something went wrong with that request. Please try again.