Imported Debian patch 0.1.0+git20131207+e452e83-0ubuntu12
[deb_libhybris.git] / hybris / sf / sf.c
... / ...
CommitLineData
1/*
2 * Copyright (C) 2013 Canonical Ltd
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 * Authored by: Michael Frey <michael.frey@canonical.com>
17 * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
18 */
19
20#include <EGL/egl.h>
21#include <dlfcn.h>
22#include <stddef.h>
23
24#include <hybris/internal/binding.h>
25#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
26
27#define COMPAT_LIBRARY_PATH "/system/lib/libsf_compat_layer.so"
28
29HYBRIS_LIBRARY_INITIALIZE(sf, COMPAT_LIBRARY_PATH);
30
31HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_blank, size_t);
32HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_unblank, size_t);
33HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_width, size_t);
34HYBRIS_IMPLEMENT_FUNCTION1(sf, size_t, sf_get_display_height, size_t);
35HYBRIS_IMPLEMENT_FUNCTION1(sf, struct SfClient*, sf_client_create_full, int);
36HYBRIS_IMPLEMENT_FUNCTION0(sf, struct SfClient*, sf_client_create);
37HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLDisplay, sf_client_get_egl_display,
38 struct SfClient*);
39HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLConfig, sf_client_get_egl_config,
40 struct SfClient*);
41HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_begin_transaction,
42 struct SfClient*);
43HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_client_end_transaction,
44 struct SfClient*);
45HYBRIS_IMPLEMENT_FUNCTION2(sf, struct SfSurface*, sf_surface_create,
46 struct SfClient*, SfSurfaceCreationParameters*);
47HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLSurface, sf_surface_get_egl_surface,
48 struct SfSurface*);
49HYBRIS_IMPLEMENT_FUNCTION1(sf, EGLNativeWindowType,
50 sf_surface_get_egl_native_window, struct SfSurface*);
51HYBRIS_IMPLEMENT_VOID_FUNCTION1(sf, sf_surface_make_current, struct SfSurface*);
52HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_move_to,
53 struct SfSurface*, int, int);
54HYBRIS_IMPLEMENT_VOID_FUNCTION3(sf, sf_surface_set_size,
55 struct SfSurface*, int, int);
56HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_layer,
57 struct SfSurface*, int);
58HYBRIS_IMPLEMENT_VOID_FUNCTION2(sf, sf_surface_set_alpha,
59 struct SfSurface*, float);