APPLY_RSA
[apps/home/ug-memo-efl.git] / src / memo_ug.c
index ed1b8d1..31fc2ca 100644 (file)
@@ -1,19 +1,20 @@
 /*
-  * Copyright 2012  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://www.tizenopensource.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.
-  */
-
+*
+* Copyright 2012  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://www.tizenopensource.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.
+*
+*/
 #include <ui-gadget.h>
 #include <Ecore_X.h>
 #include <aul.h>
@@ -21,7 +22,7 @@
 #include <memo-db.h>
 #include "memo_ug.h"
 
-static void _ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
+static void _ug_layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
 {
     Evas_Object *base, *win;
     base = (Evas_Object *)ug_get_layout(ug);
@@ -43,12 +44,12 @@ static void _ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
     }
 }
 
-static void _ug_result_cb(ui_gadget_t *ug, bundle *result, void *priv)
+static void _ug_result_cb(ui_gadget_h ug, service_h service, void *priv)
 {
-    bundle_dump(result);
+    service_dump(service);
 }
 
-static void _ug_destroy_cb(struct ui_gadget *ug, void *priv)
+static void _ug_destroy_cb(ui_gadget_h ug, void *priv)
 {
     if (ug != NULL) {
         ug_destroy(ug);
@@ -61,11 +62,11 @@ static void _ug_destroy_cb(struct ui_gadget *ug, void *priv)
  * @description
  *  This is a basic function which designed to invoke any ui gadget.
  *
- * @param[in]   bd         a bundle type which will send to ug directly
+ * @param[in]   service         a service type which will send to ug directly
  * @param[in]   ug_name    UG name marco defined in memo_ug.h
  * @return      void
  */
-void ug_launch_common(bundle *bd, char *ug_name)
+void ug_launch_common(service_h service, char *ug_name)
 {
     ug_cbs_t cbs={0, };
 
@@ -74,8 +75,8 @@ void ug_launch_common(bundle *bd, char *ug_name)
     cbs.result_cb = _ug_result_cb;
     cbs.priv = NULL;
 
-    ug_create(NULL, ug_name, UG_MODE_FULLVIEW, bd, &cbs);
-    bundle_free(bd);
+    ug_create(NULL, ug_name, UG_MODE_FULLVIEW, service, &cbs);
+    service_destroy(service);
 }
 
 /**
@@ -94,23 +95,24 @@ void ug_launch_common(bundle *bd, char *ug_name)
  */
 void ug_launch_common_var(char *ug_name, ...)
 {
-    char *key = NULL;
-    char *val = NULL;
-    bundle *bd = bundle_create();
+       char *key = NULL;
+       char *val = NULL;
+       service_h service = NULL;
+       service_create(&service);
 
-    va_list ap;
-    va_start(ap, ug_name);
-    while (1) {
-        key = va_arg(ap, char *);
-        val = va_arg(ap, char *);
+       va_list ap;
+       va_start(ap, ug_name);
+       while (1) {
+               key = va_arg(ap, char *);
+               val = va_arg(ap, char *);
 
-        if (key == NULL || val == NULL) {
-            break;
-        }
-        bundle_add(bd, key, val);
-    }
-    va_end(ap);
+               if (key == NULL || val == NULL) {
+                       break;
+               }
+               service_add_extra_data(service, key, val);
+       }
+       va_end(ap);
 
-    ug_launch_common(bd, ug_name);
+       ug_launch_common(service, ug_name);
 }