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.
21 static void _draglock_util_window_deleted_cb(void *data, Evas_Object *obj,
26 Evas_Object *draglock_util_add_window(const char *name) {
27 Evas_Object *obj_window = NULL;
28 int width = 0, height = 0;
30 obj_window = elm_win_add(NULL, name, ELM_WIN_BASIC);
31 if (obj_window != NULL) {
32 elm_win_title_set(obj_window, name);
33 elm_win_borderless_set(obj_window, EINA_TRUE);
34 evas_object_smart_callback_add(obj_window, "delete,request",
35 _draglock_util_window_deleted_cb, NULL);
36 ecore_x_window_size_get(ecore_x_window_root_first_get(), &width,
38 evas_object_resize(obj_window, width, height);
39 elm_win_indicator_mode_set(obj_window, ELM_WIN_INDICATOR_SHOW);
40 elm_win_alpha_set(obj_window, EINA_TRUE);
46 Evas_Object *draglock_util_add_bg(Evas_Object *window) {
47 Evas_Object *obj_background = NULL;
53 obj_background = elm_bg_add(window);
55 if (obj_background != NULL) {
56 evas_object_size_hint_weight_set(obj_background, EVAS_HINT_EXPAND,
58 elm_object_style_set(obj_background, "transparent");
60 elm_win_resize_object_add(window, obj_background);
62 evas_object_show(obj_background);
65 return obj_background;
68 Evas_Object *draglock_util_add_layout(Evas_Object *parent, const char *file,
70 Evas_Object *layout = NULL;
71 Eina_Bool ret = EINA_FALSE;
74 DRAGLOCK_ERR("parent is NULL");
78 layout = elm_layout_add(parent);
80 DRAGLOCK_ERR("layout is NULL");
84 ret = elm_layout_file_set(layout, file, group);
85 DRAGLOCK_DBG("File:%s, Group:%s", file, group);
86 if (ret != EINA_TRUE) {
87 DRAGLOCK_DBG("File:%s, Group:%s", file, group);
88 evas_object_del(layout);
91 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
93 evas_object_show(layout);