tizen_2.0_build
[apps/home/draglock.git] / src / draglock-bg.c
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  *  http://www.tizenopensource.org/license
9  *
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.
15  */
16
17 #include <app.h>
18 #include <vconf.h>
19 #include <vconf-keys.h>
20 #include "draglock.h"
21 #include "draglock-bg.h"
22
23 #define DEFAULT_BG_PATH "/opt/share/settings/Wallpapers/Home_default.jpg"
24
25 Evas_Object *draglock_bg_get_image(Evas_Object *parent) {
26         Evas_Object *bg;
27         char *file = NULL;
28
29         Eina_Bool eina_ret = EINA_FALSE;
30         int ret = 0;
31
32         if (parent == NULL) {
33                 return NULL;
34         }
35
36         if ((file = vconf_get_str(VCONFKEY_IDLE_LOCK_BGSET)) != NULL) {
37
38         } else if ((file = vconf_get_str(VCONFKEY_BGSET)) != NULL) {
39
40         }
41
42         DRAGLOCK_DBG("file path : %s", file);
43
44         bg = elm_image_add(parent);
45
46         if (file != NULL) {
47                 eina_ret = elm_image_file_set(bg, file, NULL);
48                 if (eina_ret == EINA_FALSE) {
49                         elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
50                 }
51                 free(file);
52         } else {
53                 elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
54         }
55
56         return bg;
57 }