3 Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
5 This file is part of org.tizen.efl-calendar
6 Written by Taeho Kang <taeho84.kang@samsung.com>
8 PROPRIETARY/CONFIDENTIAL
10 This software is the confidential and proprietary information of
11 SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
12 disclose such Confidential Information and shall use it only in
13 accordance with the terms of the license agreement you entered
14 into with SAMSUNG ELECTRONICS.
16 SAMSUNG make no representations or warranties about the suitability
17 of the software, either express or implied, including but not limited
18 to the implied warranties of merchantability, fitness for a particular
19 purpose, or non-infringement. SAMSUNG shall not be liable for any
20 damages suffered by licensee as a result of using, modifying or
21 distributing this software or its derivatives.
28 #include "external-ug.h"
30 static void __cal_ug_destroy_callback(struct ui_gadget *ug, void *priv)
32 c_retm_if(!ug, "ug is null");
37 static void __cal_ug_layout_callback(struct ui_gadget *ug, enum ug_mode mode, void *priv)
39 c_retm_if(!ug, "ug is null");
40 c_retm_if(mode != UG_MODE_FULLVIEW, "mode is invaild");
42 Evas_Object *base = ug_get_layout(ug);
44 ERR("ug_get_layout() returned null");
50 case UG_MODE_FULLVIEW:
51 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
52 elm_win_resize_object_add(ug_get_window(), base);
53 evas_object_show(base);
60 static void __cal_ug_result_callback(struct ui_gadget *ug, bundle *res, void *priv)
62 c_retm_if(!ug, "ug is null");
65 void cal_launch_ug(bundle *bd, char *ug_name, struct ug_cbs *cbs)
69 c_retm_if(!bd, "bd is null");
70 c_retm_if(!ug_name, "ug_name is null");
76 uc.destroy_cb = __cal_ug_destroy_callback;
77 uc.layout_cb = __cal_ug_layout_callback;
78 uc.result_cb = __cal_ug_result_callback;
81 if (NULL == cbs->destroy_cb)
82 uc.destroy_cb = __cal_ug_destroy_callback;
84 uc.destroy_cb = cbs->destroy_cb;
86 if (NULL == cbs->layout_cb)
87 uc.layout_cb = __cal_ug_layout_callback;
89 uc.layout_cb = cbs->layout_cb;
91 if (NULL == cbs->result_cb)
92 uc.result_cb = __cal_ug_result_callback;
94 uc.result_cb = cbs->result_cb;
96 if (NULL == cbs->priv)
102 ug = ug_create(NULL, ug_name, UG_MODE_FULLVIEW, bd, &uc);
104 ERR("ug create error");
107 void cal_launch_ug_with_var(char *ug_name, struct ug_cbs *cbs,...)
111 c_retm_if(!ug_name, "ug_name is null");
115 bundle *bd = bundle_create();
116 c_retm_if(!bd, "bd is null");
121 key = va_arg(ap, char *);
122 val = va_arg(ap, char *);
129 bundle_add(bd, key, val);
134 cal_launch_ug(bd, ug_name, cbs);