2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://www.tizenopensource.org/license
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.
17 #include <Elementary.h>
23 #include <livebox-service.h>
31 #define FLICK_COND 100
33 static Evas_Object *create_canvas(Evas_Object *parent)
37 canvas = evas_object_image_filled_add(evas_object_evas_get(parent));
41 evas_object_image_content_hint_set(canvas, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
42 // evas_object_image_colorspace_set(canvas, EVAS_COLORSPACE_ARGB8888);
43 // evas_object_image_alpha_set(canvas, EINA_TRUE);
44 evas_object_move(canvas, 0, 0);
48 static int update_pd_canvas(struct livebox *handle, Evas_Object *image)
52 Evas_Native_Surface surface;
54 switch (livebox_pd_type(handle)) {
56 evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
57 evas_object_image_alpha_set(image, EINA_TRUE);
59 livebox_get_pdsize(handle, &w, &h);
62 data = livebox_acquire_pdfb(handle);
64 evas_object_image_size_set(image, w, h);
65 evas_object_image_data_copy_set(image, data);
66 livebox_release_pdfb(data);
68 evas_object_resize(image, w, h);
69 //evas_object_size_hint_min_set(image, w, h);
70 evas_object_size_hint_max_set(image, w, h);
75 livebox_get_pdsize(handle, &w, &h);
79 DbgPrint("Update: %dx%d\n", w, h);
80 surface.version = EVAS_NATIVE_SURFACE_VERSION;
81 surface.type = EVAS_NATIVE_SURFACE_X11;
82 surface.data.x11.pixmap = livebox_pd_pixmap(handle);
83 surface.data.x11.visual = NULL; //ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
84 evas_object_image_native_surface_set(image, &surface);
86 evas_object_image_size_set(image, w, h);
87 evas_object_resize(image, w, h);
88 evas_object_size_hint_max_set(image, w, h);
89 evas_object_show(image);
99 static int update_canvas(struct livebox *handle, Evas_Object *image)
101 Evas_Native_Surface surface;
102 const char *filename;
107 switch (livebox_lb_type(handle)) {
110 type = livebox_size(handle);
111 livebox_service_get_size(type, &w, &h);
112 if (w <= 0 || h <= 0)
115 DbgPrint("Update: %dx%d\n", w, h);
117 surface.version = EVAS_NATIVE_SURFACE_VERSION;
118 surface.type = EVAS_NATIVE_SURFACE_X11;
119 surface.data.x11.pixmap = livebox_lb_pixmap(handle);
120 surface.data.x11.visual = NULL; //ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
121 evas_object_image_native_surface_set(image, &surface);
123 evas_object_image_size_set(image, w, h);
124 evas_object_resize(image, w, h);
125 evas_object_size_hint_min_set(image, w, h);
126 evas_object_size_hint_max_set(image, w, h);
127 evas_object_show(image);
130 evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
131 evas_object_image_alpha_set(image, EINA_TRUE);
134 type = livebox_size(handle);
135 livebox_service_get_size(type, &w, &h);
136 if (w > 0 && h > 0) {
138 data = livebox_acquire_fb(handle);
140 evas_object_image_size_set(image, w, h);
141 evas_object_image_data_copy_set(image, data);
142 livebox_release_fb(data);
144 evas_object_resize(image, w, h);
145 evas_object_size_hint_min_set(image, w, h);
146 evas_object_size_hint_max_set(image, w, h);
150 filename = livebox_filename(handle);
153 evas_object_image_file_get(image, &old, NULL);
154 if (old && !strcmp(filename, old)) {
155 evas_object_image_reload(image);
157 evas_object_image_file_set(image, filename, NULL);
161 type = livebox_size(handle);
162 livebox_service_get_size(type, &w, &h);
163 if (w > 0 && h > 0) {
164 evas_object_resize(image, w, h);
165 evas_object_size_hint_min_set(image, w, h);
166 evas_object_size_hint_max_set(image, w, h);
178 static inline void prepend_log(struct livebox *handle, const char *buffer)
183 layout = livebox_get_data(handle);
185 ErrPrint("Failed to get layout\n");
189 logger = elm_object_part_content_get(layout, "logger");
191 elm_list_item_prepend(logger, buffer, NULL, NULL, NULL, NULL);
194 static int lb_event_cb(struct livebox *handle, enum livebox_event_type event, void *data)
201 layout = (Evas_Object *)livebox_get_data(handle);
206 case LB_EVENT_LB_UPDATED:
207 DbgPrint("Contents: [%s]\n", livebox_content(handle));
208 image = elm_object_part_content_get(layout, "livebox");
210 update_canvas(handle, image);
212 case LB_EVENT_PD_UPDATED:
213 image = elm_object_part_content_get(layout, "pd");
215 update_pd_canvas(handle, image);
217 case LB_EVENT_DELETED:
218 sc = evas_object_data_del(layout, "sc");
220 scroller_peek_by_obj(sc, layout);
222 evas_object_del(layout);
224 case LB_EVENT_PD_DESTROYED:
225 pd = elm_object_part_content_unset(layout, "pd");
229 sc = evas_object_data_del(layout, "sc");
240 static int lb_fault_cb(enum livebox_fault_type event,
241 const char *pkgname, const char *filename,
242 const char *funcname, void *data)
244 DbgPrint("pkgname: %s\nfilename: %s\n:funcname: %s\n", pkgname, filename, funcname);
248 static void del_cb(struct livebox *handle, int ret, void *data)
250 Evas_Object *layout = data;
253 sc = evas_object_data_del(layout, "sc");
255 DbgPrint("Scroller: %p\n", sc);
256 scroller_peek_by_obj(sc, layout);
259 DbgPrint("Delete a layout object\n");
260 evas_object_del(layout);
263 static void delete_btn_cb(void *handle, Evas_Object *obj, void *event_info)
267 layout = livebox_get_data(handle);
268 DbgPrint("Livebox Get Data %p - %p\n", handle, layout);
269 ret = livebox_del(handle, del_cb, layout);
272 snprintf(buffer, sizeof(buffer), "Delete returns: %d\n", ret);
273 prepend_log(handle, buffer);
277 static void error_popup(Evas_Object *parent, struct livebox *handle, int ret)
279 ErrPrint("Failed to add a box: %d\n", ret);
283 static void resize_cb(struct livebox *handle, int ret, void *data)
286 Evas_Object *log_list;
289 layout = livebox_get_data(handle);
293 log_list = elm_object_part_content_get(layout, "logger");
297 snprintf(buffer, sizeof(buffer) - 1, "Resize: %d", ret);
298 elm_list_item_prepend(log_list, buffer, NULL, NULL, NULL, NULL);
301 static void resize_click_cb(void *handle, Evas_Object *obj, void *event_info)
303 Elm_Object_Item *item;
309 item = elm_list_selected_item_get(obj);
313 label = elm_object_item_part_text_get(item, NULL);
317 sscanf(label, "%dx%d", &w, &h);
318 size_type = livebox_service_size_type(w, h);
320 livebox_resize(handle, size_type, resize_cb, NULL);
323 static void create_resize_controller(struct livebox *handle, Evas_Object *layout)
325 Evas_Object *size_list;
327 int sizes[NR_OF_SIZE_LIST];
333 size_list = elm_list_add(layout);
334 cnt = sizeof(sizes) / sizeof(sizes[0]);
335 livebox_get_supported_sizes(handle, &cnt, sizes);
336 for (i = 0; i < cnt; i++) {
337 livebox_service_get_size(sizes[i], &w, &h);
338 snprintf(buffer, sizeof(buffer) - 1, "%dx%d", w, h);
340 elm_list_item_append(size_list, buffer, NULL, NULL, resize_click_cb, handle);
342 evas_object_show(size_list);
343 elm_list_go(size_list);
344 evas_object_size_hint_weight_set(size_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
345 evas_object_size_hint_align_set(size_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
346 elm_object_part_content_set(layout, "controller", size_list);
349 static void create_logger(struct livebox *handle, Evas_Object *layout)
351 Evas_Object *log_list;
353 log_list = elm_list_add(layout);
357 elm_list_item_prepend(log_list, "Created", NULL, NULL, NULL, NULL);
358 evas_object_show(log_list);
359 elm_list_go(log_list);
361 evas_object_size_hint_weight_set(log_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
362 evas_object_size_hint_align_set(log_list, EVAS_HINT_FILL, EVAS_HINT_FILL);
363 elm_object_part_content_set(layout, "logger", log_list);
371 FLICK_UNKNOWN = 0x00,
377 static void pd_closed_cb(struct livebox *handle, int ret, void *data)
379 evas_object_del(data);
382 static void pd_hide_done_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
387 sc = evas_object_data_get(obj, "sc");
390 elm_object_signal_callback_del(obj, emission, source, pd_hide_done_cb);
391 pd = elm_object_part_content_unset(obj, "pd");
392 livebox_destroy_pd(data, pd_closed_cb, pd);
395 static void pd_mouse_up_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
397 Evas_Event_Mouse_Up *up = event_info;
398 Evas_Coord x, y, w, h;
401 evas_object_geometry_get(obj, &x, &y, &w, &h);
403 rx = (double)(up->canvas.x - x) / (double)w;
404 ry = (double)(up->canvas.y - y) / (double)h;
405 DbgPrint("%dx%d - %dx%d, %lfx%lf\n", x, y, w, h, rx, ry);
406 livebox_content_event(handle, PD_MOUSE_UP, rx, ry);
409 static void pd_mouse_down_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
411 Evas_Event_Mouse_Down *down = event_info;
412 Evas_Coord x, y, w, h;
415 evas_object_geometry_get(obj, &x, &y, &w, &h);
416 rx = (double)(down->canvas.x - x) / (double)w;
417 ry = (double)(down->canvas.y - y) / (double)h;
418 DbgPrint("%dx%d - %dx%d, %lfx%lf\n", x, y, w, h, rx, ry);
419 livebox_content_event(handle, PD_MOUSE_DOWN, rx, ry);
422 static void pd_mouse_move_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
424 Evas_Event_Mouse_Move *move = event_info;
425 Evas_Coord x, y, w, h;
428 evas_object_geometry_get(obj, &x, &y, &w, &h);
429 rx = (double)(move->cur.canvas.x - x) / (double)w;
430 ry = (double)(move->cur.canvas.y - y) / (double)h;
431 DbgPrint("%dx%d - %dx%d, %lfx%lf\n", x, y, w, h, rx, ry);
432 livebox_content_event(handle, PD_MOUSE_MOVE, rx, ry);
435 static void pd_created_cb(struct livebox *handle, int ret, void *data)
438 Evas_Object *pd_image;
441 layout = (Evas_Object *)livebox_get_data(handle);
445 sc = evas_object_data_get(layout, "sc");
447 pd_image = create_canvas(layout);
451 evas_object_event_callback_add(pd_image, EVAS_CALLBACK_MOUSE_UP, pd_mouse_up_cb, handle);
452 evas_object_event_callback_add(pd_image, EVAS_CALLBACK_MOUSE_DOWN, pd_mouse_down_cb, handle);
453 evas_object_event_callback_add(pd_image, EVAS_CALLBACK_MOUSE_MOVE, pd_mouse_move_cb, handle);
455 update_pd_canvas(handle, pd_image);
457 elm_object_signal_callback_add(layout, "hide,done", "pd", pd_hide_done_cb, handle);
458 elm_object_part_content_set(layout, "pd", pd_image);
459 elm_object_signal_emit(layout, "open", "pd");
463 static void lb_mouse_up_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
465 Evas_Event_Mouse_Up *up = event_info;
466 Evas_Coord x, y, w, h;
467 struct event_data *evt;
469 evt = evas_object_data_del(obj, "evt");
473 evas_object_geometry_get(obj, &x, &y, &w, &h);
475 if (livebox_lb_type(handle) == LB_TYPE_PIXMAP || livebox_lb_type(handle) == LB_TYPE_BUFFER) {
477 rx = (double)(up->canvas.x - x) / (double)w;
478 ry = (double)(up->canvas.y - y) / (double)h;
479 livebox_content_event(handle, LB_MOUSE_UP, rx, ry);
482 if (x < up->canvas.x && up->canvas.x < x + w) {
483 if (y < up->canvas.y && up->canvas.y < y + h) {
484 livebox_click(handle, (double)x / (double)w, (double)y / (double)h);
488 if (evt->flick == FLICK_DOWN && (up->canvas.y - evt->y) > (FLICK_COND>>1)) {
491 ret = livebox_create_pd_with_position(handle, 0.5, 0.0, pd_created_cb, NULL);
497 static void lb_mouse_down_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
499 struct event_data *evt;
500 Evas_Event_Mouse_Down *down = event_info;
504 layout = livebox_get_data(handle);
508 sc = evas_object_data_get(layout, "sc");
512 if (scroller_is_scrolling(sc))
515 if (livebox_lb_type(handle) == LB_TYPE_PIXMAP || livebox_lb_type(handle) == LB_TYPE_BUFFER) {
516 Evas_Coord x, y, w, h;
519 evas_object_geometry_get(obj, &x, &y, &w, &h);
520 rx = (double)(down->canvas.x - x) / (double)w;
521 ry = (double)(down->canvas.y - y) / (double)h;
522 livebox_content_event(handle, LB_MOUSE_DOWN, rx, ry);
525 evt = evas_object_data_get(obj, "evt");
529 evt = malloc(sizeof(*evt));
531 ErrPrint("Heap: %s\n", strerror(errno));
536 evas_object_data_set(obj, "evt", evt);
538 evt->x = down->canvas.x;
539 evt->y = down->canvas.y;
540 evt->flick = FLICK_UNKNOWN;
543 static void lb_mouse_move_cb(void *handle, Evas *e, Evas_Object *obj, void *event_info)
545 Evas_Event_Mouse_Move *move = event_info;
546 struct event_data *evt;
548 evt = evas_object_data_get(obj, "evt");
552 if (livebox_lb_type(handle) == LB_TYPE_PIXMAP || livebox_lb_type(handle) == LB_TYPE_BUFFER) {
553 Evas_Coord x, y, w, h;
556 evas_object_geometry_get(obj, &x, &y, &w, &h);
557 rx = (double)(move->cur.canvas.x - x) / (double)w;
558 ry = (double)(move->cur.canvas.y - y) / (double)h;
559 livebox_content_event(handle, LB_MOUSE_MOVE, rx, ry);
562 if ((move->cur.canvas.x - move->prev.canvas.x) > FLICK_COND) {
563 evt->flick = FLICK_UNKNOWN;
565 } else if ((move->cur.canvas.x - move->prev.canvas.x) < -FLICK_COND) {
566 evt->flick = FLICK_UNKNOWN;
570 if ((move->cur.canvas.y - move->prev.canvas.y) > 0) {
571 if (evt->flick != FLICK_DOWN)
572 evt->flick = FLICK_DOWN;
573 } else if ((move->cur.canvas.y - move->prev.canvas.y) < 0) {
574 if (evt->flick != FLICK_UP)
575 evt->flick = FLICK_UP;
579 static int lb_update_begin(struct livebox *handle)
581 DbgPrint("%p\n", handle);
587 layout = (Evas_Object *)livebox_get_data(handle);
589 ErrPrint("Failed to get layout object\n");
593 list = elm_object_part_content_get(layout, "livebox");
595 ErrPrint("Failed to get list\n");
599 snprintf(buffer, sizeof(buffer), "begin");
600 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
605 static int lb_update_end(struct livebox *handle)
607 DbgPrint("%p\n", handle);
613 layout = (Evas_Object *)livebox_get_data(handle);
615 ErrPrint("Failed to get layout object\n");
619 list = elm_object_part_content_get(layout, "livebox");
621 ErrPrint("Failed to get list\n");
625 snprintf(buffer, sizeof(buffer), "end");
626 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
631 static int lb_update_text(struct livebox *handle, const char *id, const char *part, const char *data)
633 DbgPrint("%p\n", handle);
634 DbgPrint("id: [%s], part[%s], data[%s]\n", id, part, data);
640 layout = (Evas_Object *)livebox_get_data(handle);
642 ErrPrint("Failed to get layout object\n");
646 list = elm_object_part_content_get(layout, "livebox");
648 ErrPrint("Failed to get list\n");
652 snprintf(buffer, sizeof(buffer), "%s=%s", part, data);
653 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
658 static int lb_update_image(struct livebox *handle, const char *id, const char *part, const char *data)
660 DbgPrint("%p\n", handle);
661 DbgPrint("id: [%s], part[%s], data[%s]\n", id, part, data);
667 layout = (Evas_Object *)livebox_get_data(handle);
669 ErrPrint("Failed to get layout object\n");
673 list = elm_object_part_content_get(layout, "livebox");
675 ErrPrint("Failed to get list\n");
679 snprintf(buffer, sizeof(buffer), "%s=%s", part, data);
680 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
685 static int lb_update_script(struct livebox *handle, const char *id, const char *part, const char *file, const char *group)
687 DbgPrint("%p\n", handle);
688 DbgPrint("id: [%s], part[%s], file[%s], group[%s]\n", id, part, file, group);
694 layout = (Evas_Object *)livebox_get_data(handle);
696 ErrPrint("Failed to get layout object\n");
700 list = elm_object_part_content_get(layout, "livebox");
702 ErrPrint("Failed to get list\n");
706 snprintf(buffer, sizeof(buffer), "%s=%s, %s", part, file, group);
707 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
712 static int lb_update_signal(struct livebox *handle, const char *id, const char *emission, const char *signal)
714 DbgPrint("%p\n", handle);
715 DbgPrint("id: [%s], emission[%s], signal[%s]\n", id, emission, signal);
721 layout = (Evas_Object *)livebox_get_data(handle);
723 ErrPrint("Failed to get layout object\n");
727 list = elm_object_part_content_get(layout, "livebox");
729 ErrPrint("Failed to get list\n");
733 snprintf(buffer, sizeof(buffer), "%s,%s", emission, signal);
734 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
738 static int lb_update_drag(struct livebox *handle, const char *id, const char *part, double dx, double dy)
740 DbgPrint("%p\n", handle);
741 DbgPrint("id: [%s], part[%s], pos[%lfx%lf]\n", id, part, dx, dy);
747 layout = (Evas_Object *)livebox_get_data(handle);
749 ErrPrint("Failed to get layout object\n");
753 list = elm_object_part_content_get(layout, "livebox");
755 ErrPrint("Failed to get list\n");
759 snprintf(buffer, sizeof(buffer), "%s=%lfx%lf", part, dx, dy);
760 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
764 static int lb_update_info_size(struct livebox *handle, const char *id, int w, int h)
766 DbgPrint("%p\n", handle);
767 DbgPrint("id: [%s], size[%dx%d]\n", id, w, h);
773 layout = (Evas_Object *)livebox_get_data(handle);
775 ErrPrint("Failed to get layout object\n");
779 list = elm_object_part_content_get(layout, "livebox");
781 ErrPrint("Failed to get list\n");
785 snprintf(buffer, sizeof(buffer), "%dx%d", w, h);
786 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
790 static int lb_update_info_category(struct livebox *handle, const char *id, const char *category)
792 DbgPrint("%p\n", handle);
793 DbgPrint("id: [%s], category: [%s]\n", id, category);
799 layout = (Evas_Object *)livebox_get_data(handle);
801 ErrPrint("Failed to get layout object\n");
805 list = elm_object_part_content_get(layout, "livebox");
807 ErrPrint("Failed to get list\n");
811 snprintf(buffer, sizeof(buffer), "%s=%s", id, category);
812 elm_list_item_prepend(list, buffer, NULL, NULL, NULL, NULL);
816 static void livebox_added_cb(struct livebox *handle, int ret, void *data)
825 DbgPrint("%s - %d\n", livebox_pkgname(handle), ret);
828 error_popup(main_get_window(), handle, ret);
832 layout = elm_layout_add(main_get_window());
834 ErrPrint("Failed to add a layout\n");
838 if (elm_layout_file_set(layout, PKGROOT "/res/edje/live-viewer.edj", "layout") == EINA_FALSE) {
839 DbgPrint("Failed to add a layout\n");
840 evas_object_del(layout);
844 if (livebox_lb_type(handle) == LB_TYPE_TEXT) {
846 static struct livebox_script_operators ops = {
847 .update_begin = lb_update_begin,
848 .update_end = lb_update_end,
849 .update_text = lb_update_text,
850 .update_image = lb_update_image,
851 .update_script = lb_update_script,
852 .update_signal = lb_update_signal,
853 .update_drag = lb_update_drag,
854 .update_info_size = lb_update_info_size,
855 .update_info_category = lb_update_info_category,
858 list = elm_list_add(layout);
860 evas_object_del(layout);
864 (void)livebox_set_text_handler(handle, &ops);
865 elm_object_part_content_set(layout, "livebox", list);
868 Evas_Object *lb_image;
869 lb_image = create_canvas(layout);
871 ErrPrint("Failed to create a canvas\n");
872 evas_object_del(layout);
876 evas_object_event_callback_add(lb_image, EVAS_CALLBACK_MOUSE_UP, lb_mouse_up_cb, handle);
877 evas_object_event_callback_add(lb_image, EVAS_CALLBACK_MOUSE_DOWN, lb_mouse_down_cb, handle);
878 evas_object_event_callback_add(lb_image, EVAS_CALLBACK_MOUSE_MOVE, lb_mouse_move_cb, handle);
882 type = livebox_size(handle);
883 if (type != LB_SIZE_TYPE_UNKNOWN) {
884 livebox_service_get_size(type, &w, &h);
885 DbgPrint("%dx%d\n", w, h);
887 evas_object_resize(lb_image, w, h);
888 evas_object_show(lb_image);
890 update_canvas(handle, lb_image);
892 btn = elm_button_add(main_get_window());
894 elm_object_text_set(btn, "Delete");
895 evas_object_smart_callback_add(btn, "clicked", delete_btn_cb, handle);
896 elm_object_part_content_set(layout, "delete,btn", btn);
899 elm_object_part_content_set(layout, "livebox", lb_image);
901 evas_object_resize(layout, 720, 1280);
902 evas_object_show(layout);
904 create_resize_controller(handle, layout);
905 create_logger(handle, layout);
907 livebox_set_data(handle, layout);
908 DbgPrint("Livebox Set Data: %p - %p\n", handle, layout);
909 evas_object_data_set(layout, "sc", data);
911 scroller_append(data, layout);
913 idx = scroller_get_page_index(data, layout);
914 DbgPrint("Scroll to %d\n", idx);
915 scroller_scroll_to(data, idx);
918 int lb_add(Evas_Object *sc, const char *pkgname)
921 struct livebox *handle;
923 evas_object_geometry_get(sc, NULL, NULL, &w, &h);
925 DbgPrint("sc: %dx%d, package: %s\n", w, h, pkgname);
926 livebox_activate(pkgname, NULL, NULL);
928 handle = livebox_add(pkgname, "default", "user,created", "default",
929 DEFAULT_PERIOD, livebox_added_cb, sc);
931 ErrPrint("Failed to add a new livebox\n");
940 livebox_init(ecore_x_display_get());
941 livebox_set_event_handler(lb_event_cb, NULL);
942 livebox_set_fault_handler(lb_fault_cb, NULL);