Remove last trailing comma
[apps/livebox/data-provider-master.git] / include / buffer_handler.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://floralicense.org/license/
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
17 struct buffer_info;
18 struct inst_info;
19
20 enum buffer_type { /*!< Must have to be sync with libprovider, liblivebox-viewer */
21         BUFFER_TYPE_FILE,
22         BUFFER_TYPE_SHM,
23         BUFFER_TYPE_PIXMAP,
24         BUFFER_TYPE_ERROR
25 };
26
27 /*!
28  * \brief
29  * \param[in] type
30  * \param[in] w
31  * \param[in] h
32  * \param[in] pixel_size
33  * \return buffer_info
34  */
35 extern struct buffer_info *buffer_handler_create(struct inst_info *inst, enum buffer_type type, int w, int h, int pixel_size);
36
37 /*!
38  * \brief
39  * \param[in] info
40  * \return int
41  */
42 extern int buffer_handler_destroy(struct buffer_info *info);
43
44 /*!
45  * \brief
46  * \param[in] info
47  * \return int
48  */
49 extern int buffer_handler_load(struct buffer_info *info);
50
51 /*!
52  * \brief
53  * \param[in] info
54  * \return int
55  */
56 extern int buffer_handler_unload(struct buffer_info *info);
57
58 /*!
59  * \brief
60  * \param[in] info
61  * \return int
62  */
63 extern int buffer_handler_is_loaded(const struct buffer_info *info);
64
65 /*!
66  * \brief Reallocate buffer
67  * \param[in] info
68  * \param[in] w
69  * \param[in] h
70  * \return int
71  */
72 extern int buffer_handler_resize(struct buffer_info *info, int w, int h);
73
74 /*!
75  * \brief Only update the size information
76  * \param[in] info
77  * \param[in] w
78  * \param[in] h
79  * \return void
80  */
81 extern void buffer_handler_update_size(struct buffer_info *info, int w, int h);
82
83 /*!
84  * \brief
85  * \param[in] info
86  * \return const char *
87  */
88 extern const char *buffer_handler_id(const struct buffer_info *info);
89
90 /*!
91  * \param[in] info
92  * \return buffer_type
93  */
94 extern enum buffer_type buffer_handler_type(const struct buffer_info *info);
95
96 /*!
97  * \brief This API is not supported for Pixmap.
98  * \param[in] info
99  * \return void*
100  */
101 extern void *buffer_handler_fb(struct buffer_info *info);
102
103 /*!
104  * \brief
105  * \param[in] info
106  * \param[out] w
107  * \param[out] h
108  * \return int
109  */
110 extern int buffer_handler_get_size(struct buffer_info *info, int *w, int *h);
111
112 /*!
113  * \brief This API only can be used for file type buffer
114  * \param[in] info
115  * \return void
116  */
117 extern void buffer_handler_flush(struct buffer_info *info);
118
119 /*!
120  * \brief
121  * \param[in] info
122  * \return 0 if fails. Return value should be casted to Pixmap type
123  */
124 extern int buffer_handler_pixmap(const struct buffer_info *info);
125
126 /*!
127  * \brief
128  * \param[in] info
129  * \return buffer
130  */
131 extern void *buffer_handler_pixmap_acquire_buffer(struct buffer_info *info);
132
133 /*!
134  * \brief
135  * \param[in] info
136  * \return int
137  */
138 extern int buffer_handler_pixmap_release_buffer(void *canvas);
139
140 /*!
141  * \brief
142  * \return int
143  */
144 extern int buffer_handler_init(void);
145
146 /*!
147  * \brief
148  * \return int
149  */
150 extern int buffer_handler_fini(void);
151
152 extern void *buffer_handler_pixmap_ref(struct buffer_info *info);
153
154 extern int buffer_handler_pixmap_unref(void *buffer_ptr);
155
156 extern void *buffer_handler_pixmap_find(int pixmap);
157
158 extern void *buffer_handler_pixmap_buffer(struct buffer_info *info);
159
160 extern struct inst_info *buffer_handler_instance(struct buffer_info *info);
161
162 /* End of a file */