1 #ifndef __LIVEBOX_HELPER_H
2 #define __LIVEBOX_HELPER_H
8 struct livebox_buffer; /* Defined by provider */
12 * Return values of livebox programming interfaces.
14 extern const int DONE; /*!< Operation is successfully done */
15 extern const int NEED_TO_SCHEDULE; /*!< Need to call the livebox_need_to_update and livebox_update_content */
16 extern const int OUTPUT_UPDATED; /*!< Contents is updated */
17 extern const int NEED_TO_CREATE; /*!< Need to create a new instance */
18 extern const int NEED_TO_DESTROY; /*!< Need to destroy this instance */
20 extern const int LB_SYS_EVENT_FONT_CHANGED; /*!< System font is changed */
21 extern const int LB_SYS_EVENT_LANG_CHANGED; /*!< System language is changed */
22 extern const int LB_SYS_EVENT_PAUSED;
23 extern const int LB_SYS_EVENT_RESUMED;
25 #define LB_DESC_TYPE_TEXT "text"
26 #define LB_DESC_TYPE_IMAGE "image"
27 #define LB_DESC_TYPE_SIGNAL "signal"
28 #define LB_DESC_TYPE_INFO "info"
29 #define LB_DESC_TYPE_DRAG "drag"
30 #define LB_DESC_TYPE_SCRIPT "script"
34 * Extra event informatino for livebox_content_event interface function
42 } pointer; /*!< Down/Up state and mouse position */
49 } part; /*!< Geometry of event received part */
56 * \brief Update a description file.
61 extern struct livebox_desc *livebox_desc_open(const char *filename, int for_pd);
64 * \brief Complete the description file updating
68 extern int livebox_desc_close(struct livebox_desc *handle);
71 * \brief Set the category information of current description data
77 extern int livebox_desc_set_category(struct livebox_desc *handle, const char *id, const char *category);
80 * \brief Set the content size
87 extern int livebox_desc_set_size(struct livebox_desc *handle, const char *id, int w, int h);
90 * \breif Set the target id of given block
91 * Only available for the script block
97 extern int livebox_desc_set_id(struct livebox_desc *handle, int idx, const char *id);
100 * \brief Add a new block
102 * \param[in] id ID of source script object
103 * \param[in] type image|text|script|signal|...
104 * \param[in] part target part to update with given content(data)
105 * \param[in] data content for specified part
106 * \param[in] group script group name
107 * \return idx Index of current description block
109 extern int livebox_desc_add_block(struct livebox_desc *handle, const char *id, const char *type, const char *part, const char *data, const char *group);
112 * \brief Delete a added block
114 * \param[in] idx Index of added block
117 extern int livebox_desc_del_block(struct livebox_desc *handle, int idx);
120 * \brief Replace '\n' with '<br>'
121 * \param[in] str Source string
122 * \return char* allocated string
124 extern char *livebox_util_nl2br(const char *str);
128 * Interfaces for direct buffer management (Available only for the PD area)
132 #ifndef __PROVIDER_BUFFER_H
135 * This enumeration value should be sync'd with provider
138 BUFFER_EVENT_ENTER, /*!< */
139 BUFFER_EVENT_LEAVE, /*!< */
140 BUFFER_EVENT_DOWN, /*!< */
141 BUFFER_EVENT_MOVE, /*!< */
142 BUFFER_EVENT_UP, /*!< */
148 * \param[in] filename
155 extern struct livebox_buffer *livebox_acquire_buffer(const char *filename, int is_pd, int width, int height, int (*handler)(struct livebox_buffer *, enum buffer_event, double, double, double, void *), void *data);
158 * \param[in] filename
161 extern unsigned long livebox_pixmap_id(struct livebox_buffer *handle);
168 extern int livebox_release_buffer(struct livebox_buffer *handle);
173 * \return void* buffer
175 extern void *livebox_ref_buffer(struct livebox_buffer *handle);
182 extern int livebox_unref_buffer(void *buffer);
189 extern int livebox_sync_buffer(struct livebox_buffer *handle);