apply FSL(Flora Software License)
[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
18 #include <app.h>
19 #include <vconf.h>
20 #include <vconf-keys.h>
21 #include "draglock.h"
22 #include "draglock-bg.h"
23
24 #define DEFAULT_BG_PATH "/opt/share/settings/Wallpapers/Home_default.jpg"
25
26 Evas_Object *draglock_bg_get_image(Evas_Object *parent) {
27         Evas_Object *bg;
28         char *file = NULL;
29
30         Eina_Bool eina_ret = EINA_FALSE;
31         int ret = 0;
32
33         if (parent == NULL) {
34                 return NULL;
35         }
36
37         if ((file = vconf_get_str(VCONFKEY_IDLE_LOCK_BGSET)) != NULL) {
38
39         } else if ((file = vconf_get_str(VCONFKEY_BGSET)) != NULL) {
40
41         }
42
43         DRAGLOCK_DBG("file path : %s", file);
44
45         bg = elm_image_add(parent);
46
47         if (file != NULL) {
48                 eina_ret = elm_image_file_set(bg, file, NULL);
49                 if (eina_ret == EINA_FALSE) {
50                         elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
51                 }
52                 free(file);
53         } else {
54                 elm_image_file_set(bg, DEFAULT_BG_PATH, NULL);
55         }
56
57         return bg;
58 }