Imported Upstream version 0.1.0+git20131207+e452e83
[deb_libhybris.git] / hybris / ui / ui.c
1 /*
2 * Copyright (C) 2013 Simon Busch <morphis@gravedo.de>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <dlfcn.h>
18 #include <stddef.h>
19
20 #include <hybris/internal/binding.h>
21 #include <hybris/ui/ui_compatibility_layer.h>
22
23 #define COMPAT_LIBRARY_PATH "/system/lib/libui_compat_layer.so"
24
25 HYBRIS_LIBRARY_INITIALIZE(ui, COMPAT_LIBRARY_PATH);
26
27 HYBRIS_IMPLEMENT_FUNCTION0(ui, struct graphic_buffer*, graphic_buffer_new);
28 HYBRIS_IMPLEMENT_FUNCTION4(ui, struct graphic_buffer*,
29 graphic_buffer_new_sized, uint32_t, uint32_t, int32_t, uint32_t);
30 HYBRIS_IMPLEMENT_FUNCTION7(ui, struct graphic_buffer*, graphic_buffer_new_existing,
31 uint32_t, uint32_t, int32_t, uint32_t, uint32_t, void*, bool);
32 HYBRIS_IMPLEMENT_VOID_FUNCTION1(ui, graphic_buffer_free, struct graphic_buffer*);
33 HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_width,
34 struct graphic_buffer*);
35 HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_height,
36 struct graphic_buffer*);
37 HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_stride,
38 struct graphic_buffer*);
39 HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_get_usage,
40 struct graphic_buffer*);
41 HYBRIS_IMPLEMENT_FUNCTION1(ui, int32_t, graphic_buffer_get_pixel_format,
42 struct graphic_buffer*);
43 HYBRIS_IMPLEMENT_FUNCTION5(ui, uint32_t, graphic_buffer_reallocate,
44 struct graphic_buffer*, uint32_t, uint32_t, int32_t, uint32_t);
45 HYBRIS_IMPLEMENT_FUNCTION3(ui, uint32_t, graphic_buffer_lock,
46 struct graphic_buffer*, uint32_t, void**);
47 HYBRIS_IMPLEMENT_FUNCTION1(ui, uint32_t, graphic_buffer_unlock,
48 struct graphic_buffer*);
49 HYBRIS_IMPLEMENT_FUNCTION1(ui, void*, graphic_buffer_get_native_buffer,
50 struct graphic_buffer*);
51 HYBRIS_IMPLEMENT_VOID_FUNCTION2(ui, graphic_buffer_set_index,
52 struct graphic_buffer*, int);
53 HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_get_index,
54 struct graphic_buffer*);
55 HYBRIS_IMPLEMENT_FUNCTION1(ui, int, graphic_buffer_init_check,
56 struct graphic_buffer*);