Change the LOG_TAG
[platform/framework/web/provider.git] / include / provider_buffer.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (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://www.tizenopensource.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 #ifndef __PROVIDER_BUFFER_H
18 #define __PROVIDER_BUFFER_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /*!
25  * \NOTE
26  * This enumeration value has to be sync'd with the liblivebox interface. (only for inhouse livebox)
27  */
28 enum target_type {
29         TYPE_LB, /*!< */
30         TYPE_PD, /*!< */
31         TYPE_ERROR, /*!< */
32 };
33
34 /*!
35  * \NOTE
36  * This enumeration value should be sync'd with liblivebox interface. (only for inhouse livebox)
37  */
38 enum buffer_event {
39         BUFFER_EVENT_ENTER, /*!< */
40         BUFFER_EVENT_LEAVE, /*!< */
41         BUFFER_EVENT_DOWN, /*!< */
42         BUFFER_EVENT_MOVE, /*!< */
43         BUFFER_EVENT_UP, /*!< */
44 };
45
46 struct livebox_buffer;
47
48 /*!
49  * \brief
50  * \param[in] type
51  * \param[in] pkgname
52  * \param[in] id
53  * \param[in] width
54  * \param[in] height
55  * \param[in] pixel_size
56  * \param[in] handler
57  * \param[in] data
58  */
59 extern struct livebox_buffer *provider_buffer_acquire(enum target_type type, const char *pkgname, const char *id, int width, int height, int pixel_size, int (*handler)(struct livebox_buffer *, enum buffer_event, double, double, double, void *data), void *data);
60
61 /*!
62  * \brief
63  * \param[in] info
64  * \param[in] w
65  * \param[in] h
66  * \return int
67  */
68 extern int provider_buffer_resize(struct livebox_buffer *info, int w, int h);
69
70 /*!
71  * \brief
72  * \param[in] info
73  * \return address
74  */
75 extern void *provider_buffer_ref(struct livebox_buffer *info);
76
77 /*!
78  * \brief
79  * \param[in] ptr
80  * \return int
81  */
82 extern int provider_buffer_unref(void *ptr);
83
84 /*!
85  * \brief
86  * \param[in] info
87  * \return int
88  */
89 extern int provider_buffer_release(struct livebox_buffer *info);
90
91 /*!
92  *\brief
93  \param[in] info
94  \return int
95  */
96 extern int provider_buffer_sync(struct livebox_buffer *info);
97
98 /*!
99  * \brief Get the buffer type
100  * \param[in] info
101  * \return target type PD or LB
102  */
103 extern enum target_type provider_buffer_type(struct livebox_buffer *info);
104
105 /*!
106  * \brief Get the package name
107  * \param[in] info
108  * \return pkgname
109  */
110 extern const char *provider_buffer_pkgname(struct livebox_buffer *info);
111
112 /*!
113  * \brief
114  * \param[in] info
115  * \return id
116  */
117 extern const char *provider_buffer_id(struct livebox_buffer *info);
118
119 /*!
120  * \brief
121  * \param[in] info
122  * \param[out] w
123  * \param[out] h
124  * \param[out] pixel_size
125  * \return int
126  */
127 extern int provider_buffer_get_size(struct livebox_buffer *info, int *w, int *h, int *pixel_size);
128
129 /*!
130  * \brief Getting the PIXMAP id of mapped on this livebox_buffer
131  * \param[in] info
132  * \return 0 if fails or pixmap ID
133  */
134 extern unsigned long provider_buffer_pixmap_id(struct livebox_buffer *info);
135
136 /*!
137  * \brief
138  * \param[in] disp
139  * \return int
140  */
141 extern int provider_buffer_init(void *disp);
142
143 /*!
144  * \brief
145  * \return int
146  */
147 extern int provider_buffer_fini(void);
148
149 /*!
150  */
151 extern int provider_buffer_pixmap_is_support_hw(struct livebox_buffer *info);
152
153 /*!
154  */
155 extern int provider_buffer_pixmap_create_hw(struct livebox_buffer *info);
156
157 /*!
158  */
159 extern int provider_buffer_pixmap_destroy_hw(struct livebox_buffer *info);
160
161 /*!
162  */
163 extern void *provider_buffer_pixmap_hw_addr(struct livebox_buffer *info);
164
165 /*!
166  */
167 extern int provider_buffer_pre_render(struct livebox_buffer *info);
168
169 /*!
170  */
171 extern int provider_buffer_post_render(struct livebox_buffer *info);
172
173 #ifdef __cplusplus
174 }
175 #endif
176
177 #endif
178 /* End of a file */