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.
18 #include <ui-gadget.h>
20 #include "_util_log.h"
25 static void button_ug_layout_cb(ui_gadget_h ug,
26 enum ug_mode mode, void *priv)
31 base = ug_get_layout(ug);
32 win = ug_get_window();
35 case UG_MODE_FULLVIEW:
36 evas_object_size_hint_weight_set(base,
37 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
38 elm_win_resize_object_add(win, base);
39 evas_object_show(base);
46 static void button_ug_destroy_cb(ui_gadget_h ug, void *priv)
49 struct appdata *ad = (struct appdata *)priv;
51 retm_if(ug == NULL, "Invalid argument: ug is NULL\n");
56 ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NOTIFICATION);
57 utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_OFF);
61 ui_gadget_h create_button_ug(void *data)
63 ui_gadget_h ug = NULL;
64 struct ug_cbs cbs = {0};
65 struct appdata *ad = (struct appdata *)data;
66 retvm_if(ad == NULL, 0, "Invalid argument:appdata is NULL\n");
68 cbs.layout_cb = button_ug_layout_cb;
69 cbs.destroy_cb = button_ug_destroy_cb;
70 cbs.priv = (void *)data;
72 ecore_x_netwm_window_type_set(elm_win_xwindow_get(ad->win), ECORE_X_WINDOW_TYPE_NORMAL);
73 utilx_set_window_opaque_state(ecore_x_display_get(), elm_win_xwindow_get(ad->win), UTILX_OPAQUE_STATE_ON);
74 ug = ug_create(NULL, "setting-profile-efl", UG_MODE_FULLVIEW, NULL, &cbs);
79 int _open_ug(void *data)
81 struct appdata *ad = (struct appdata *)data;
84 retvm_if(ad == NULL, -1, "Invalid argument: appdata is NULL\n");
85 retvm_if(ad->win == NULL, -1, "Invalid argument: window is NULL\n");
87 UG_INIT_EFL(ad->win, UG_OPT_INDICATOR_ENABLE);
88 elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
89 ug = create_button_ug(ad);
91 retvm_if(ug == NULL, -1, "Failed to Create ug!\n");