Change the sequence of last updated pixmap
[apps/native/widget/widget.git] / dynamicbox / include / internal / dynamicbox.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 /**
18  * Export by dynamicbox_service
19  */
20 #include <dynamicbox_buffer.h>
21 #include <dynamicbox_script.h>
22
23 #ifndef __DYNAMICBOX_UILITY_INTERNAL_H
24 #define __DYNAMICBOX_UILITY_INTERNAL_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /**
31  * @file dynamicbox_internal.h
32  * @brief This file declares API of libdynamicbox library
33  * @since_tizen 2.3
34  */
35
36 /**
37  * @addtogroup CAPI_DYNAMICBOX_UTILITY_MODULE
38  * @{
39  */
40
41 /**
42  * @internal
43  * @brief Definition for COLOR BLOCK.
44  * @since_tizen 2.3
45  */
46 #define DBOX_DESC_TYPE_COLOR "color"
47
48 /**
49  * @internal
50  * @brief Definition for TEXT BLOCK.
51  * @since_tizen 2.3
52  */
53 #define DBOX_DESC_TYPE_TEXT "text"
54
55 /**
56  * @internal
57  * @brief Definition for IMAGE BLOCK.
58  * @since_tizen 2.3
59  */
60 #define DBOX_DESC_TYPE_IMAGE "image"
61
62 /**
63  * @internal
64  * @brief Definition for SIGNAL BLOCK.
65  * @since_tizen 2.3
66  */
67 #define DBOX_DESC_TYPE_SIGNAL "signal"
68
69 /**
70  * @internal
71  * @brief Definition for INFO BLOCK.
72  * @since_tizen 2.3
73  */
74 #define DBOX_DESC_TYPE_INFO "info"
75
76 /**
77  * @internal
78  * @brief Definition for DRAG BLOCK.
79  * @since_tizen 2.3
80  */
81 #define DBOX_DESC_TYPE_DRAG "drag"
82
83 /**
84  * @internal
85  * @brief Definition for SCRIPT SCRIPT.
86  * @since_tizen 2.3
87  */
88 #define DBOX_DESC_TYPE_SCRIPT "script"
89
90 /**
91  * @internal
92  * @brief Definition for ACCESSIBILITY INFORMATION BLOCK.
93  * @since_tizen 2.3
94  */
95 #define DBOX_DESC_TYPE_ACCESS "access"
96
97 /**
98  * @internal
99  * @brief Definition for accessibility operation.
100  * @since_tizen 2.3
101  */
102 #define DBOX_DESC_TYPE_ACCESS_OPERATION "access,operation"
103
104 /**
105  * @internal
106  * @brief Definition for set highlight on specified part.
107  * @since_tizen 2.3
108  */
109 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_SET "set,hl"
110
111 /**
112  * @internal
113  * @brief Definition for remove highlight from specified part.
114  * @since_tizen 2.3
115  */
116 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_UNSET "unset,hl"
117
118 /**
119  * @internal
120  * @brief Definition for move the highlight to next part.
121  * @since_tizen 2.3
122  */
123 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_NEXT "next,hl"
124
125 /**
126  * @internal
127  * @brief Definition for move the highlight to previous part.
128  * @since_tizen 2.3
129  */
130 #define DBOX_DESC_DATA_ACCESS_OPERATION_HL_PREV "prev,hl"
131
132 /**
133  * @internal
134  * @brief Definition for reset the chain of accessibility highlight list.
135  * @since_tizen 2.3
136  */
137 #define DBOX_DESC_DATA_ACCESS_OPERATION_RESET "reset,focus"
138
139 /**
140  * @internal
141  * @brief Definition for specify the highlight move option.
142  * @details If the highlight list reaches to the last object, move back to the first object.
143  * @since_tizen 2.3
144  */
145 #define DBOX_DESC_OPTION_ACCESS_HL_LOOP "cycle"
146
147 /**
148  * @internal
149  * @brief Definition for specify the highlight move option.
150  * @details If the highlight list reaches to the last object(or the first object),
151  * the "prev,hl", "next,hl" will be failed.
152  * @since_tizen 2.3
153  */
154 #define DBOX_DESC_OPTION_ACCESS_HL_NOLOOP "no,cycle"
155
156 /**
157  * @internal
158  * @brief Dynamic Box description data handle.
159  * @since_tizen 2.3
160  */
161 typedef struct dynamicbox_desc *dynamicbox_desc_h;
162
163 /**
164  * @internal
165  * @brief Flush Callback for snapshot window
166  * @since_tizen 2.3
167  */
168 typedef void (*dynamicbox_flush_cb)(void *snapshot_window, const char *id, int status, void *data);
169
170 /**
171  * @internal
172  * @brief Updates a description file.
173  * @since_tizen 2.3
174  * @remarks Must be used only by Inhouse Dynamic Box.
175  * @param[in] id Dynamic Box Instance Id
176  * @param[in] gbar 1 for Glance Bar or 0
177  * @privlevel public
178  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
179  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
180  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
181  * @return Handle of desc instance
182  * @retval @c NULL Failed to create a desc instance, dynamicbox_last_status() will returns reason of failure
183  * @pre Should be loaded by data-provider-slave.
184  * @post Should be destroyed(flushed) using dynamicbox_desc_close() API.
185  * @see dynamicbox_desc_close()
186  */
187 extern dynamicbox_desc_h dynamicbox_desc_open(const char *id, int gbar);
188
189 /**
190  * @internal
191  * @brief Completes the description file update.
192  * @details Only if this API is called, the description data will be applied to the content of Dynamic Box (or GBar).
193  * @since_tizen 2.3
194  * @remarks Must be used only by Inhouse Dynamic Box.
195  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
196  * @privlevel public
197  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
198  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
199  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
200  * @return int type
201  * @retval #DBOX_STATUS_ERROR_NONE If the flushing description data is successfully done
202  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER If the given handle is not valid
203  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
204  * @pre Handle must be created by dynamicbox_desc_open()
205  * @post Handle must not be used after return from this function.
206  * @see dynamicbox_desc_open()
207  */
208 extern int dynamicbox_desc_close(dynamicbox_desc_h handle);
209
210 /**
211  * @internal
212  * @brief Sets the category information of current description data.
213  * @details Creates a new description block for updating category information of layout object.
214  * @since_tizen 2.3
215  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
216  * @param[in] id Id string of target object
217  * @param[in] category Category string that will be used by layout object
218  * @return int type
219  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
220  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Memory is not enough to add this block
221  * @retval index Index(>=0) of added block, which can be used by dynamicbox_desc_set_id()
222  * @pre Must be called after create a handle using dynamicbox_desc_open()
223  * @see dynamicbox_desc_set_id()
224  */
225 extern int dynamicbox_desc_set_category(dynamicbox_desc_h handle, const char *id, const char *category);
226
227 /**
228  * @internal
229  * @brief Sets the content size.
230  * @details Sets the content size of layout.
231  * @since_tizen 2.3
232  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
233  * @param[in] id Id string of target object
234  * @param[in] w Width in pixel
235  * @param[in] h Height in pixel
236  * @return int type
237  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
238  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new block
239  * @retval index Index(>=0) of added block Successfully added
240  * @see dynamicbox_desc_open()
241  * @see dynamicbox_desc_set_id()
242  */
243 extern int dynamicbox_desc_set_size(dynamicbox_desc_h handle, const char *id, int w, int h);
244
245 /**
246  * @internal
247  * @brief Sets the target id of the given block.
248  * @details Only available for the script block.
249  * @since_tizen 2.3
250  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
251  * @param[in] idx Index of target block
252  * @param[in] id Id String which will be used by other dynamicbox_desc_XXX functions
253  * @return int type
254  * @retval #DBOX_STATUS_ERROR_NONE Id is successfully updated for given idx of desc block
255  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
256  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
257  * @pre Desc block should be exists which has given index "idx".
258  * @post Specified Id string("id") can be used by other dynamicbox_desc_XXXX functions.
259  * @see dynamicbox_desc_open()
260  * @see dynamicbox_desc_set_id()
261  */
262 extern int dynamicbox_desc_set_id(dynamicbox_desc_h handle, int idx, const char *id);
263
264 /**
265  * @internal
266  * @brief Adds a new block.
267  * @since_tizen 2.3
268  * @param[in] handle Handle which is created by the dynamicbox_desc_open() function
269  * @param[in] id ID of source script object
270  * @param[in] type Type (image|text|script|signal|.. etc)
271  * @param[in] part Target part to update with given content(data)
272  * @param[in] data Content for specified part
273  * @param[in] option Option for the block. (script: group, image: option, ...)
274  * @return Index of current description block
275  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
276  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory to add a new desc block
277  * @retval index Index(>=0) of added desc block
278  * @pre Handle must be created using dynamicbox_desc_open.
279  * @see dynamicbox_desc_set_id()
280  * @see dynamicbox_desc_del_block()
281  */
282 extern int dynamicbox_desc_add_block(dynamicbox_desc_h handle, const char *id, const char *type, const char *part, const char *data, const char *option);
283
284 /**
285  * @internal
286  * @brief Deletes an added block.
287  * @since_tizen 2.3
288  * @details If you discard the added desc block, use this API and the index of the created desc block.
289  * @param[in] handle Handle which is created by dynamicbox_desc_open() function
290  * @param[in] idx Index of added block, returned from dynamicbox_desc_add_block(), dynamicbox_desc_set_size(), dynamicbox_desc_set_category(), etc
291  * @return int type
292  * @retval #DBOX_STATUS_ERROR_NONE Successfully deleted
293  * @retval #DBOX_STATUS_ERROR_NOT_EXIST Given index of desc block is not exists
294  * @pre Index must be exists.
295  * @see dynamicbox_desc_add_block()
296  * @see dynamicbox_desc_open()
297  */
298 extern int dynamicbox_desc_del_block(dynamicbox_desc_h handle, int idx);
299
300 /**
301  * @internal
302  * @brief Structure for a Dynamic Box buffer defined by a provider.
303  * @since_tizen 2.3
304  */
305 typedef struct dynamicbox_buffer *dynamicbox_buffer_h;
306
307 /**
308  * @internal
309  * @brief Return values of dynamicbox programming interfaces: Using network.
310  * @since_tizen 2.3
311  */
312 extern const int DBOX_USE_NET;
313
314 /**
315  * @internal
316  * @brief Notifies the updated content to the provider.
317  * @details Forcedly notifies the updated contents.
318  *    This function can be used from async callback function to notify the updated content.
319  * @since_tizen 2.3
320  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
321  * @param[in] gbar 1 for updating content of Glance Bar or 0(for content of Dynamic Box)
322  * @return int type
323  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Not enough memory
324  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
325  * @retval #DBOX_STATUS_ERROR_IO_ERROR I/O failed, Cannot access given resource file(id)
326  * @retval #DBOX_STATUS_ERROR_NONE Successfully notified
327  * @pre This API only can be used after loaded into the data-provider-slave process.
328  */
329 extern int dynamicbox_content_is_updated(const char *id, int gbar);
330
331 /**
332  * @internal
333  * @brief Acquires a buffer for GBar or DBox, currently only the GBar is supported.
334  * @since_tizen 2.3
335  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
336  * @param[in] gbar 1 for Glance Bar or 0 for Dynamic Box
337  * @param[in] width Width in pixel
338  * @param[in] height Height in pixel
339  * @param[in] pixels Size of a pixel in bytes
340  * @param[in] handler Event handling callback
341  * @param[in] data User data for event handling callback
342  * @privlevel public
343  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
344  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
345  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
346  * @return Buffer handle
347  * @retval @c NULL Failed to acquire buffer, dynamicbox_last_status() will returns reason of failure.
348  * @retval handler Handle object
349  * @pre Given instance must be specify its type as buffer. or this API will be fail.
350  * @post Allocated buffer object must be released via dynamicbox_release_buffer().
351  * @see dynamicbox_release_buffer()
352  */
353 extern dynamicbox_buffer_h dynamicbox_create_buffer(const char *id, int gbar, int auto_align, int (*handler)(dynamicbox_buffer_h, dynamicbox_buffer_event_data_t, void *), void *data);
354
355 /**
356  * @internal
357  * @brief Acquire a buffer for GBar or DBox.
358  * @since_tizen 2.3
359  * @param[in] handle Buffer handle
360  * @param[in] idx Index of a buffer, DBOX_PRIMARY_BUFFER is used for accessing primary buffer
361  * @param[in] width Width of a buffer
362  * @param[in] height Height of a buffer
363  * @param[in] pixels Pixel size in byte
364  * @privlevel public
365  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
366  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
367  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
368  * @return int status
369  * @retval #DBOX_STATUS_ERROR_NONE Successfully allocated
370  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
371  * @retval #DBOX_STATUS_ERROR_FAULT Unrecoverable error occurred
372  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
373  * @pre dynamicbox_create_buffer() must be called
374  * @see dynamicbox_create_buffer()
375  * @see dynamicbox_release_buffer()
376  */
377 extern int dynamicbox_acquire_buffer(dynamicbox_buffer_h handle, int idx, int width, int height, int pixels);
378
379 /**
380  * @internal
381  * @brief Acquires the Id of Resource (window system).
382  * @details Only if the provider uses Resource for providing render buffer.
383  * @since_tizen 2.3
384  * @remarks Pixmap Id can be destroyed if you call the dynamicbox_release_buffer(). Then this Resource Id is not guaranteed to use.
385  * @param[in] handle Buffer handle
386  * @param[in] idx Index of a buffer, #c DBOX_PRIMARY_BUFFER is used for accessing the primary buffer
387  * @return unsigned int Resource Id
388  * @retval >0 Resource Id
389  * @retval 0 Failed to get Resource Id
390  * @pre The system must be set to use the Resource Id method for content sharing.
391  * @see dynamicbox_acquire_buffer()
392  */
393 extern unsigned int dynamicbox_resource_id(dynamicbox_buffer_h handle, int idx);
394
395 /**
396  * @internal
397  * @brief Releases the buffer of dynamicbox.
398  * @since_tizen 2.3
399  * @param[in] handle Buffer handle
400  * @param[in] idx Index of a buffer, #c DBOX_PRIMARY_BUFFER is used for accessing the primary buffer
401  * @privlevel public
402  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
403  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
404  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
405  * @return int status
406  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
407  * @retval #DBOX_STATUS_ERROR_NONE Successfully released
408  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
409  * @pre Handle must be created using dynamicbox_acquire_buffer().
410  * @see dynamicbox_acquire_buffer()
411  */
412 extern int dynamicbox_release_buffer(dynamicbox_buffer_h handle, int idx);
413
414 /**
415  * @internal
416  * @brief Destroy a buffer of dynamicbox
417  * @since_tizen 2.3
418  * @param[in] handle buffer handle
419  * @privlevel public
420  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
421  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
422  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
423  * @return int status
424  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMTER Invalid argument
425  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
426  * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed
427  * @see dynamicbox_create_buffer()
428  */
429 extern int dynamicbox_destroy_buffer(dynamicbox_buffer_h handle);
430
431 /**
432  * @internal
433  * @brief Gets the address of buffer for S/W rendering.
434  * @details If you try to use this, after dynamicbox_create_hw_buffer(), you will get @c NULL.
435  *          This API only be used for primary buffer. you cannot access the extra buffer
436  * @since_tizen 2.3
437  * @param[in] handle Buffer handle
438  * @privlevel public
439  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
440  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
441  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
442  * @return void* address of the render buffer
443  * @retval @c NULL If it falis to get buffer address, dynamicbox_last_status() will returns reason of failure.
444  * @retval address If it succeed to get the buffer address
445  * @see dynamicbox_unref_buffer()
446  */
447 extern void *dynamicbox_ref_buffer(dynamicbox_buffer_h handle);
448
449 /**
450  * @internal
451  * @brief Releases the S/W render buffer.
452  * @since_tizen 2.3
453  * @param[in] buffer Address of render buffer
454  * @privlevel public
455  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
456  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
457  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
458  * @return int type
459  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
460  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
461  * @retval #DBOX_STATUS_ERROR_NONE Successfully unreference
462  * @pre dynamicbox_ref_buffer() must be called.
463  * @see dynamicbox_ref_buffer()
464  */
465 extern int dynamicbox_unref_buffer(void *buffer);
466
467 /**
468  * @internal
469  * @brief Synchronizes the updated buffer.
470  * @details This is only needed for non-H/W accelerated buffer.
471  *          This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
472  * @since_tizen 2.3
473  * @param[in] handle Buffer handle
474  * @privlevel public
475  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
476  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
477  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
478  * @return int type
479  * @retval #DBOX_STATUS_ERROR_NONE Successfully sync'd
480  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
481  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
482  * @see dynamicbox_acquire_buffer()
483  */
484 extern int dynamicbox_sync_buffer(dynamicbox_buffer_h handle);
485
486 /**
487  * @internal
488  * @brief Checks whether the dynamicbox supports H/W acceleration or not.
489  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
490  * @since_tizen 2.3
491  * @param[in] handle Buffer handle
492  * @return int type
493  * @retval 1 If the buffer handle support the H/W acceleration buffer
494  * @retval 0 If it doesn not supported
495  * @see dynamicbox_acquire_buffer()
496  */
497 extern int dynamicbox_support_hw_buffer(dynamicbox_buffer_h handle);
498
499 /**
500  * @internal
501  * @brief Creates the H/W accelerated buffer.
502  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
503  * @since_tizen 2.3
504  * @param[in] handle Buffer handle
505  * @privlevel public
506  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
507  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
508  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
509  * @return int type
510  * @retval #DBOX_STATUS_ERROR_ALREADY H/W buffer is already created
511  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
512  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
513  * @retval #DBOX_STATUS_ERROR_NONE Successfully created
514  * @pre Must be checked whether the H/W buffer is supported or not.
515  * @post Must be destroyed if it is not necessary.
516  * @see dynamicbox_support_hw_buffer()
517  */
518 extern int dynamicbox_create_hw_buffer(dynamicbox_buffer_h handle);
519
520 /**
521  * @internal
522  * @brief Destroys the H/W accelerated buffer.
523  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
524  * @since_tizen 2.3
525  * @param[in] handle Buffer handle
526  * @privlevel public
527  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
528  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
529  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
530  * @return int type
531  * @retval #DBOX_STATUS_ERROR_NONE Successfully destroyed
532  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
533  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
534  * @pre Must be created h/w buffer using dynamicbox_create_hw_buffer.
535  * @see dynamicbox_create_hw_buffer()
536  */
537 extern int dynamicbox_destroy_hw_buffer(dynamicbox_buffer_h handle);
538
539 /**
540  * @internal
541  * @brief Gets the address of the accelerated H/W buffer.
542  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
543  * @since_tizen 2.3
544  * @param[in] handle Buffer handle
545  * @privlevel public
546  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
547  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
548  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
549  * @return void* type
550  * @retval @c NULL Failed to get H/W accelerated buffer address, dynamicbox_last_status() will returns reason of failure.
551  * @retval addr H/W accelerated buffer address
552  * @see dynamicbox_create_hw_buffer()
553  */
554 extern void *dynamicbox_buffer_hw_buffer(dynamicbox_buffer_h handle);
555
556 /**
557  * @internal
558  * @brief Get the stride information from the buffer info
559  *        This API is only supported for primary buffer (#c DBOX_PRIMARY_BUFFER)
560  * @since_tizen 2.3
561  * @param[in] handle Buffer handle
562  * @return int stride size
563  * @retval positive_value length of stride
564  * @return #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameter
565  * @return #DBOX_STATUS_ERROR_FAULT Unrecoverable error
566  * @see dynamicbox_create_hw_buffer()
567  */
568 extern int dynamicbox_buffer_stride(dynamicbox_buffer_h handle);
569
570 /**
571  * @internal
572  * @brief Pre-processes for rendering content.
573  * @details This is only needed for accessing H/W accelerated buffer.
574  * @since_tizen 2.3
575  * @param[in] handle Buffer handle
576  * @privlevel public
577  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
578  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
579  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
580  * @return int type
581  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid handle
582  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
583  * @retval #DBOX_STATUS_ERROR_NONE Successfully done
584  * @post dynamicbox_buffer_post_render must be called after the rendering (accessing buffer) is completed.
585  * @see dynamicbox_support_hw_buffer()
586  * @see dynamicbox_buffer_post_render()
587  */
588 extern int dynamicbox_buffer_pre_render(dynamicbox_buffer_h handle);
589
590 /**
591  * @internal
592  * @brief Post-processes for rendering content.
593  * @since_tizen 2.3
594  * @param[in] handle Buffer handle
595  * @privlevel public
596  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
597  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
598  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
599  * @return If succes returns 0 or return less than 0
600  * @retval #DBOX_STATUS_ERROR_NONE If succeed
601  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
602  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid argument
603  * @pre dynamicbox_buffer_pre_render must be called.
604  * @see dynamicbox_support_hw_buffer()
605  * @see dynamicbox_buffer_pre_render()
606  */
607 extern int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle);
608
609 /**
610  * @internal
611  * @brief Sends a request to the viewer (homescreen) to close the GBar.
612  * @details Even though you call this function. the homescreen can ignore it.
613  * @since_tizen 2.3
614  * @param[in] dboxid Dynamic Box Package Id
615  * @param[in] id Instance Id which is passed to you via the first parameter of every dynamicbox_XXXX interface functions
616  * @param[in] reason #DBOX_STATUS_ERROR_NONE(0)
617  * @privlevel public
618  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
619  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
620  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
621  * @return int type
622  * @retval #DBOX_STATUS_ERROR_PERMISSION_DENIED Permission denied
623  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid parameters
624  * @retval #DBOX_STATUS_ERROR_OUT_OF_MEMORY Out of memory
625  * @retval #DBOX_STATUS_ERROR_FAULT Failed to send a request
626  * @retval #DBOX_STATUS_ERROR_NONE Successfully requested
627  */
628 extern int dynamicbox_request_close_glance_bar(const char *dboxid, const char *id, int reason);
629
630 /**
631  * @internal
632  * @brief Create a snapshot window
633  * @details
634  *         If you want create a snapshot image of contents, create this snapshot window
635  *         But it will not renders object asynchronously,
636  *         So you have to render the objects immediately, the delayed rendering object will not be on the canvas
637  *         After flush it to a file.
638  * @since_tizen 2.3
639  * @param[in] id
640  * @param[in] size_type
641  * @return void* window
642  * @retval @c NULL failed to create a snapshot window, dynamicbox_last_status() will returns reason of failure.
643  * @retval Object window object (ex, elementary window)
644  * @see dynamicbox_snapshot_window_flush()
645  */
646 extern void *dynamicbox_snapshot_window_add(const char *id, int size_type);
647
648 /**
649  * @internal
650  * @brief Flush to a file for snapshot window
651  * @since_tizen 2.3
652  * @param[in] snapshot_win Snapshot window
653  * @param[in] timeout After this, the image file will be created
654  * @param[in] flush_cb Right after flush an image file, this callback will be called
655  * @param[in] data Callback data for flush_cb
656  * @return int status
657  * @retval #DBOX_STATUS_ERROR_NONE Successfully flushed (flush timer added)
658  * @retval #DBOX_STATUS_ERROR_INVALID_PARAMETER Invalid paramter
659  * @retval #DBOX_STATUS_ERROR_FAULT Failed to create a flush timer
660  * @see dynamicbox_snapshot_window_add()
661  */
662 extern int dynamicbox_snapshot_window_flush(void *snapshot_win, double timeout, dynamicbox_flush_cb flush_cb, void *data);
663
664 /**
665  * @internal
666  * @brief Sending the updated event to the viewer
667  * @since_tizen 2.3
668  * @param[in] handle Dynamicbox Buffer Handle
669  * @param[in] idx Index of a buffer
670  * @privlevel public
671  * @privilege %http://developer.samsung.com/tizen/privilege/dynamicbox.provider
672  * @feature http://developer.samsung.com/tizen/feature/samsung_extension
673  * @feature http://developer.samsung.com/tizen/feature/in_house/shell.appwidget
674  * @return int status
675  * @retval #DBOX_STATUS_ERROR_NONE Successfully sent
676  */
677 extern int dynamicbox_send_updated_by_idx(dynamicbox_buffer_h handle, int idx);
678
679 /**
680  * @}
681  */
682
683 #ifdef __cplusplus
684 }
685 #endif
686
687 #endif
688 /* End of a file */