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 #include "PUI_internal.h"
27 #include "PUI_backend.h"
29 pui_ani_control_buffer *
30 pui_backend_ani_get_buffer(pui_ani_t *ani)
32 pui_ani_control_buffer *buffer = NULL;
34 if (!PUI_MAGIC_CHECK(ani, PUI_MAGIC_ANI_T))
36 PUI_MAGIC_FAIL(ani, PUI_MAGIC_ANI_T, __FUNCTION__);
40 buffer = pui_ani_get_buffer(ani->ani_h);
49 pui_backend_ani_set_buffer(pui_ani_t *ani, pui_ani_control_buffer *buffer)
51 pui_int_error err = PUI_INT_ERROR_NONE;
53 if (!PUI_MAGIC_CHECK(ani, PUI_MAGIC_ANI_T))
55 PUI_MAGIC_FAIL(ani, PUI_MAGIC_ANI_T, __FUNCTION__);
56 return PUI_INT_ERROR_INVALID_BUFFER;
60 return PUI_INT_ERROR_INVALID_BUFFER;
62 err = pui_ani_set_buffer(ani->ani_h, buffer);
68 pui_backend_ani_update(pui_ani_t *ani)
70 pui_int_error err = PUI_INT_ERROR_NONE;
72 if (!PUI_MAGIC_CHECK(ani, PUI_MAGIC_ANI_T))
74 PUI_MAGIC_FAIL(ani, PUI_MAGIC_ANI_T, __FUNCTION__);
75 return PUI_INT_ERROR_INVALID_HANDLE;
78 err = pui_ani_update(ani->ani_h);
84 pui_backend_ani_status_get(pui_ani_t *ani)
86 return pui_ani_status_get(ani);
90 pui_backend_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval)
92 return pui_ani_add_frame_cb(ani, frame_cb, frame_interval);
96 pui_backend_ani_remove_frame_cb(pui_ani_t *ani)
98 pui_ani_remove_frame_cb(ani);
102 pui_backend_ani_status_update(pui_ani_t *ani, pui_ani_status status)
104 pui_ani_status_update(ani, status);
107 pui_backend_ani_func *
108 pui_backend_ani_alloc_ani_func(void)
110 pui_backend_ani_func *ani_func = NULL;
112 ani_func = (pui_backend_ani_func *)calloc(1, sizeof(pui_backend_ani_func));
116 pui_err("Failed to allocate memory !\n");
124 pui_backend_ani_free_ani_func(pui_backend_ani_func *ani_func)
128 pui_err("Invalid ani backend_func pointer !\n");
135 pui_backend_ani_data *
136 pui_backend_ani_get_ani_data(pui_ani_t *ani)
138 return pui_ani_get_ani_data(ani);