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 #include <dynamicbox_buffer.h>
28 * \param[in] pixel_size
31 extern struct buffer_info *buffer_handler_create(struct inst_info *inst, enum dynamicbox_fb_type type, int w, int h, int pixel_size);
38 extern int buffer_handler_destroy(struct buffer_info *info);
45 extern int buffer_handler_load(struct buffer_info *info);
52 extern int buffer_handler_unload(struct buffer_info *info);
59 extern int buffer_handler_is_loaded(const struct buffer_info *info);
62 * \brief Reallocate buffer
68 extern int buffer_handler_resize(struct buffer_info *info, int w, int h);
71 * \brief Only update the size information
77 extern void buffer_handler_update_size(struct buffer_info *info, int w, int h);
82 * \return const char *
84 extern const char *buffer_handler_id(const struct buffer_info *info);
88 * \return dynamicbox_fb_type
90 extern enum dynamicbox_fb_type buffer_handler_type(const struct buffer_info *info);
93 * \brief This API is not supported for Pixmap.
97 extern void *buffer_handler_fb(struct buffer_info *info);
106 extern int buffer_handler_get_size(struct buffer_info *info, int *w, int *h);
109 * \brief This API only can be used for file type buffer
113 extern void buffer_handler_flush(struct buffer_info *info);
118 * \return 0 if fails. Return value should be casted to Pixmap type
120 extern int buffer_handler_pixmap(const struct buffer_info *info);
127 extern void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info);
134 extern int buffer_handler_pixmap_release_buffer(void *canvas);
141 extern int buffer_handler_stride(struct buffer_info *info);
148 extern int buffer_handler_pixels(struct buffer_info *info);
155 extern int buffer_handler_auto_align(void);
161 extern int buffer_handler_init(void);
173 extern int buffer_handler_fini(void);
187 extern void *buffer_handler_pixmap_ref(struct buffer_info *info);
193 * \param[in] buffer_ptr
200 extern int buffer_handler_pixmap_unref(void *buffer_ptr);
213 extern void *buffer_handler_pixmap_find(int pixmap);
226 extern void *buffer_handler_pixmap_buffer(struct buffer_info *info);
233 * \return struct inst_info *
239 extern struct inst_info *buffer_handler_instance(struct buffer_info *info);
246 * \param[in] resource
247 * \return dynamicbox_fb_t
254 extern dynamicbox_fb_t buffer_handler_raw_open(enum dynamicbox_fb_type type, void *resource);
267 extern int buffer_handler_raw_close(dynamicbox_fb_t buffer);
280 extern void *buffer_handler_raw_data(dynamicbox_fb_t buffer);
293 extern int buffer_handler_raw_size(dynamicbox_fb_t buffer);
306 extern int buffer_handler_lock(struct buffer_info *buffer);
319 extern int buffer_handler_unlock(struct buffer_info *buffer);
333 extern int buffer_handler_set_data(struct buffer_info *buffer, void *data);
347 extern void *buffer_handler_data(struct buffer_info *buffer);