2 * Copyright 2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (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
8 * http://floralicense.org/license/
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.
21 enum buffer_type { /*!< Must have to be sync with libprovider, liblivebox-viewer, liblivebox-edje */
33 * \param[in] pixel_size
36 extern struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buffer_type type, int w, int h, int pixel_size);
43 extern int buffer_handler_destroy(struct buffer_info *info);
50 extern int buffer_handler_load(struct buffer_info *info);
57 extern int buffer_handler_unload(struct buffer_info *info);
64 extern int buffer_handler_is_loaded(const struct buffer_info *info);
67 * \brief Reallocate buffer
73 extern int buffer_handler_resize(struct buffer_info *info, int w, int h);
76 * \brief Only update the size information
82 extern void buffer_handler_update_size(struct buffer_info *info, int w, int h);
87 * \return const char *
89 extern const char *buffer_handler_id(const struct buffer_info *info);
95 extern enum buffer_type buffer_handler_type(const struct buffer_info *info);
98 * \brief This API is not supported for Pixmap.
102 extern void *buffer_handler_fb(struct buffer_info *info);
111 extern int buffer_handler_get_size(struct buffer_info *info, int *w, int *h);
114 * \brief This API only can be used for file type buffer
118 extern void buffer_handler_flush(struct buffer_info *info);
123 * \return 0 if fails. Return value should be casted to Pixmap type
125 extern int buffer_handler_pixmap(const struct buffer_info *info);
132 extern void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info);
139 extern int buffer_handler_pixmap_release_buffer(void *canvas);
145 extern int buffer_handler_init(void);
157 extern int buffer_handler_fini(void);
171 extern void *buffer_handler_pixmap_ref(struct buffer_info *info);
177 * \param[in] buffer_ptr
184 extern int buffer_handler_pixmap_unref(void *buffer_ptr);
197 extern void *buffer_handler_pixmap_find(int pixmap);
210 extern void *buffer_handler_pixmap_buffer(struct buffer_info *info);
217 * \return struct inst_info *
223 extern struct inst_info *buffer_handler_instance(struct buffer_info *info);
230 * \param[in] resource
231 * \return struct buffer *
238 extern struct buffer *buffer_handler_raw_open(enum buffer_type type, void *resource);
251 extern int buffer_handler_raw_close(struct buffer *buffer);
264 extern void *buffer_handler_raw_data(struct buffer *buffer);
277 extern int buffer_handler_raw_size(struct buffer *buffer);
290 extern int buffer_handler_lock(struct buffer_info *buffer);
303 extern int buffer_handler_unlock(struct buffer_info *buffer);
317 extern int buffer_handler_set_data(struct buffer_info *buffer, void *data);
331 extern void *buffer_handler_data(struct buffer_info *buffer);