summaryrefslogtreecommitdiff
path: root/include/provider_buffer.h
blob: 6b4a33c5549cff43bee42ecad4c65998e55a2131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/*
 * Copyright 2013  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://floralicense.org/license/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __PROVIDER_BUFFER_H
#define __PROVIDER_BUFFER_H

#ifdef __cplusplus
extern "C" {
#endif

/*!
 * \NOTE
 * This enumeration value has to be sync'd with the liblivebox interface. (only for inhouse livebox)
 */
enum target_type {
	TYPE_LB, /*!< */
	TYPE_PD, /*!< */
	TYPE_ERROR, /*!< */
};

/*!
 * \NOTE
 * This enumeration value should be sync'd with liblivebox interface. (only for inhouse livebox)
 */
enum buffer_event {
	BUFFER_EVENT_ENTER, /*!< */
	BUFFER_EVENT_LEAVE, /*!< */
	BUFFER_EVENT_DOWN, /*!< */
	BUFFER_EVENT_MOVE, /*!< */
	BUFFER_EVENT_UP, /*!< */

	BUFFER_EVENT_KEY_DOWN, /*!< */
	BUFFER_EVENT_KEY_UP, /*!< */
};

struct livebox_buffer;

/*!
 * \brief
 * \param[in] type
 * \param[in] pkgname
 * \param[in] id
 * \param[in] width
 * \param[in] height
 * \param[in] pixel_size
 * \param[in] handler
 * \param[in] data
 */
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);

/*!
 * \brief
 * \param[in] info
 * \param[in] w
 * \param[in] h
 * \return int
 */
extern int provider_buffer_resize(struct livebox_buffer *info, int w, int h);

/*!
 * \brief
 * \param[in] info
 * \return address
 */
extern void *provider_buffer_ref(struct livebox_buffer *info);

/*!
 * \brief
 * \param[in] ptr
 * \return int
 */
extern int provider_buffer_unref(void *ptr);

/*!
 * \brief
 * \param[in] info
 * \return int
 */
extern int provider_buffer_release(struct livebox_buffer *info);

/*!
 *\brief
 \param[in] info
 \return int
 */
extern int provider_buffer_sync(struct livebox_buffer *info);

/*!
 * \brief Get the buffer type
 * \param[in] info
 * \return target type PD or LB
 */
extern enum target_type provider_buffer_type(struct livebox_buffer *info);

/*!
 * \brief Get the package name
 * \param[in] info
 * \return pkgname
 */
extern const char *provider_buffer_pkgname(struct livebox_buffer *info);

/*!
 * \brief
 * \param[in] info
 * \return id
 */
extern const char *provider_buffer_id(struct livebox_buffer *info);

/*!
 * \brief Give the URI of buffer information.
 * \param[in] info
 * \return uri
 */
extern const char *provider_buffer_uri(struct livebox_buffer *info);

/*!
 * \brief
 * \param[in] info
 * \param[out] w
 * \param[out] h
 * \param[out] pixel_size
 * \return int
 */
extern int provider_buffer_get_size(struct livebox_buffer *info, int *w, int *h, int *pixel_size);

/*!
 * \brief Getting the PIXMAP id of mapped on this livebox_buffer
 * \param[in] info
 * \return 0 if fails or pixmap ID
 */
extern unsigned long provider_buffer_pixmap_id(struct livebox_buffer *info);

/*!
 * \brief
 * \param[in] disp Display information for handling the XPixmap type.
 * \return int
 */
extern int provider_buffer_init(void *disp);

/*!
 * \brief
 * \return int
 */
extern int provider_buffer_fini(void);

/*!
 * \param[in] info
 * \return int
 */
extern int provider_buffer_pixmap_is_support_hw(struct livebox_buffer *info);

/*!
 * \param[in] info
 * \return int
 */
extern int provider_buffer_pixmap_create_hw(struct livebox_buffer *info);

/*!
 * \param[in] info
 * \return int
 */
extern int provider_buffer_pixmap_destroy_hw(struct livebox_buffer *info);

/*!
 * \brief Get the H/W system mapped buffer address(GEM buffer) if a buffer support it.
 * \param[in] info
 * \return void * H/W system mapped buffer address
 */
extern void *provider_buffer_pixmap_hw_addr(struct livebox_buffer *info);

/*!
 * \brief Prepare the render buffer to write or read something on it.
 * \param[in] info
 * \return int
 */
extern int provider_buffer_pre_render(struct livebox_buffer *info);

/*!
 * \brief Finish the render buffer acessing.
 * \param[in] info 
 * \return int
 */
extern int provider_buffer_post_render(struct livebox_buffer *info);

/*!
 */
extern void *provider_buffer_user_data(struct livebox_buffer *handle);

/*!
 */
extern int provider_buffer_set_user_data(struct livebox_buffer *handle, void *data);

#ifdef __cplusplus
}
#endif

#endif
/* End of a file */