2.0 alpha
[apps/core/preloaded/calendar.git] / common / external-ug.c
index de30741..367ce1a 100755 (executable)
   */
 
 
-
-
-
-
-
 #include "cld.h"
 #include "external-ug.h"
 
-static void __cal_ug_destroy_callback(struct ui_gadget *ug, void *priv)
+static void __cal_ug_destroy_callback(ui_gadget_h ug, void *priv)
 {
        c_retm_if(!ug, "ug is null");
 
        ug_destroy(ug);
 }
 
-static void __cal_ug_layout_callback(struct ui_gadget *ug, enum ug_mode mode, void *priv)
+static void __cal_ug_layout_callback(ui_gadget_h ug, enum ug_mode mode, void *priv)
 {
        c_retm_if(!ug, "ug is null");
        c_retm_if(mode != UG_MODE_FULLVIEW, "mode is invaild");
@@ -54,19 +49,19 @@ static void __cal_ug_layout_callback(struct ui_gadget *ug, enum ug_mode mode, vo
        }
 }
 
-static void __cal_ug_result_callback(struct ui_gadget *ug, bundle *res, void *priv)
+static void __cal_ug_result_callback(ui_gadget_h ug, service_h res, void *priv)
 {
        c_retm_if(!ug, "ug is null");
 }
 
-void cal_launch_ug(bundle *bd, char *ug_name, struct ug_cbs *cbs)
+void cal_launch_ug(service_h bd, char *ug_name, struct ug_cbs *cbs)
 {
        CAL_FN_START;
 
        c_retm_if(!bd, "bd is null");
        c_retm_if(!ug_name, "ug_name is null");
 
-       struct ui_gadget *ug;
+       ui_gadget_h ug;
        struct ug_cbs uc;
 
        if (NULL == cbs) {
@@ -109,8 +104,9 @@ void cal_launch_ug_with_var(char *ug_name, struct ug_cbs *cbs,...)
 
        char *key = NULL;
        char *val = NULL;
-       bundle *bd = bundle_create();
-       c_retm_if(!bd, "bd is null");
+       service_h bd;
+       int r = service_create(&bd);
+       c_ret_if(r != SERVICE_ERROR_NONE);
 
        va_list ap;
        va_start(ap, cbs);
@@ -122,15 +118,14 @@ void cal_launch_ug_with_var(char *ug_name, struct ug_cbs *cbs,...)
                        break;
                }
 
-
-               bundle_add(bd, key, val);
+               service_add_extra_data(bd, key, val);
        }
 
        va_end(ap);
 
        cal_launch_ug(bd, ug_name, cbs);
 
-       bundle_free(bd);
+       service_destroy(bd);
 }