2 * Copyright © 2019 Samsung Electronics co., Ltd. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial
14 * portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #ifndef _LIBPUI_BACKEND_H_
27 #define _LIBPUI_BACKEND_H_
29 #include "PUI_common.h"
31 #define PUI_BACKEND_ABI_MAJOR_MASK 0xFFFF0000
32 #define PUI_BACKEND_ABI_MINOR_MASK 0x0000FFFF
34 #define PUI_BACKEND_GET_ABI_MAJOR(m) (((m) & PUI_BACKEND_ABI_MAJOR_MASK) >> 16)
35 #define PUI_BACKEND_GET_ABI_MINOR(m) ((m) & PUI_BACKEND_ABI_MINOR_MASK)
37 #define PUI_BACKEND_SET_ABI_VERSION(major, minor) \
38 ((((major) << 16) & PUI_BACKEND_ABI_MAJOR_MASK) | ((minor) & PUI_BACKEND_ABI_MINOR_MASK))
40 #define PUI_BACKEND_ABI_VERSION_1_0 PUI_BACKEND_SET_ABI_VERSION(1, 0)
41 #define PUI_BACKEND_AB_VERSION_LAST PUI_BACKEND_ABI_VERSION_1_0
43 typedef struct _pui_backend_ani_func pui_backend_ani_func;
44 struct _pui_backend_ani_func
46 pui_error (*ani_start)(pui_ani_t *ani, int repeat);
47 pui_error (*ani_stop)(pui_ani_t *ani, pui_bool force);
49 void (*reserved1)(void);
50 void (*reserved2)(void);
51 void (*reserved3)(void);
52 void (*reserved4)(void);
53 void (*reserved5)(void);
56 typedef void pui_backend_ani_info;
58 struct _pui_backend_ani_data
60 pui_backend_ani_func *ani_func;
61 pui_backend_ani_info *ani_info;
64 struct _pui_backend_module_data
68 pui_int_error (*create_ani_collection)(void);
69 pui_bool (*geometry_get)(int *width, int *height);
70 pui_backend_ani_data *(*ani_create)(pui_id id);
71 void (*ani_destroy)(pui_backend_ani_data *ani_data);
73 void (*reserved1)(void);
74 void (*reserved2)(void);
75 void (*reserved3)(void);
76 void (*reserved4)(void);
77 void (*reserved5)(void);
80 struct _pui_backend_module
82 const char *name; /**< The name of a backend module */
83 const char *vendor; /**< The vendor name of a backend module */
84 unsigned long abi_version; /**< The API version of a backend module */
86 pui_backend_module_data *(*backend_init)(void);
87 void (*backend_deinit)(pui_backend_module_data *backend_data);
94 pui_ani_control_buffer *
95 pui_backend_ani_get_last_buffer(pui_ani_t *ani);
97 pui_ani_control_buffer *
98 pui_backend_ani_get_buffer(pui_ani_t *ani);
101 pui_backend_ani_set_buffer(pui_ani_t *ani, pui_ani_control_buffer *buffer);
104 pui_backend_ani_update(pui_ani_t *ani);
107 pui_backend_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval);
110 pui_backend_ani_remove_frame_cb(pui_ani_t *ani);
113 pui_backend_ani_status_update(pui_ani_t *ani, pui_ani_status status);
115 pui_backend_ani_func *
116 pui_backend_ani_alloc_ani_func(void);
119 pui_backend_ani_free_ani_func(pui_backend_ani_func *func);
121 pui_backend_ani_data *
122 pui_backend_ani_get_ani_data(pui_ani_t *ani);
128 #endif//_LIBPUI_BACKEND_H_