2 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of the ug-memo-efl
5 * Written by Zhibin Zhou <zhibin.zhou@samsung.com>, Canjiang Lu <canjiang.lu@samsung.com>,
6 * Feng Li <feng.li@samsung.com>
8 * PROPRIETARY/CONFIDENTIAL
10 * This software is the confidential and proprietary information of
11 * SAMSUNG ELECTRONICS ("Confidential Information").
12 * You shall not disclose such Confidential Information and shall
13 * use it only in accordance with the terms of the license agreement
14 * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
15 * representations or warranties about the suitability
16 * of the software, either express or implied, including but not
17 * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-
18 * infringement. SAMSUNG shall not be liable for any damages suffered by licensee as
19 * a result of using, modifying or distributing this software or its derivatives.
22 #include <ui-gadget.h>
25 #include <supplement.h>
29 static void _ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv)
31 Evas_Object *base, *win;
32 base = (Evas_Object *)ug_get_layout(ug);
37 win = ug_get_window();
39 case UG_MODE_FULLVIEW:
40 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41 elm_win_resize_object_add(win, base);
43 //ug_disable_effect(ug);
44 evas_object_show(base);
51 static void _ug_result_cb(ui_gadget_t *ug, bundle *result, void *priv)
56 static void _ug_destroy_cb(struct ui_gadget *ug, void *priv)
67 * This is a basic function which designed to invoke any ui gadget.
69 * @param[in] bd a bundle type which will send to ug directly
70 * @param[in] ug_name UG name marco defined in memo_ug.h
73 void ug_launch_common(bundle *bd, char *ug_name)
77 cbs.layout_cb = _ug_layout_cb;
78 cbs.destroy_cb = _ug_destroy_cb;
79 cbs.result_cb = _ug_result_cb;
82 ug_create(NULL, ug_name, UG_MODE_FULLVIEW, bd, &cbs);
87 * ug_launch_common_var
90 * This function supply a variadic version of ug_launch_common_var.
91 * The first and only required variable is the ug_name.
92 * Its type is string, but the caller should use the macro name which defined in memo_ug.h
93 * The other variables are optional, it should appear for key-value pair
94 * The end of optional variables must be NULL.
96 * @param[in] ug_name UG name marco defined in memo_ug.h
97 * @param[in] ... pair of key and value, end with NULL
100 void ug_launch_common_var(char *ug_name, ...)
104 bundle *bd = bundle_create();
107 va_start(ap, ug_name);
109 key = va_arg(ap, char *);
110 val = va_arg(ap, char *);
112 if (key == NULL || val == NULL) {
115 bundle_add(bd, key, val);
119 ug_launch_common(bd, ug_name);