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.
22 #include "indicator.h"
23 #include "indicator_ui.h"
25 #include "indicator_icon_util.h"
27 #define ICON_PRIORITY INDICATOR_PRIORITY_FIXED5
28 #define MODULE_NAME "home"
30 static int register_home_module(void *data);
31 static int unregister_home_module(void);
33 Indicator_Icon_Object home = {
34 .type = INDICATOR_IMG_ICON,
36 .priority = ICON_PRIORITY,
37 .always_top = EINA_FALSE,
40 .obj_exist = EINA_FALSE,
42 .exist_in_view = EINA_FALSE,
43 .init = register_home_module,
44 .fini = unregister_home_module,
47 static const char *icon_path[] = {
49 "Home/B03_Home_press.png",
53 static void change_home_icon_cb(keynode_t *node, void *data)
58 retif(data == NULL, , "Invalid parameter!");
60 ret = vconf_get_int(VCONF_INDICATOR_HOME_PRESSED, &status);
64 INFO("change_home_icon_cb : Home Button Pressed!");
65 home.img_obj.data = icon_path[1];
66 indicator_util_icon_show(&home);
68 INFO("change_home_icon_cb : Home Button Released!");
69 home.img_obj.data = icon_path[0];
70 indicator_util_icon_show(&home);
74 static int register_home_module(void *data)
78 retif(data == NULL, FAIL, "Invalid parameter!");
80 ret = vconf_notify_key_changed(VCONF_INDICATOR_HOME_PRESSED,
81 change_home_icon_cb, data);
83 ERR("Failed to register callback!");
87 home.img_obj.data = icon_path[0];
88 indicator_util_icon_show(&home);
92 static int unregister_home_module(void)
96 ret = vconf_ignore_key_changed(VCONF_INDICATOR_HOME_PRESSED,
99 ERR("Failed to unregister callback!");
101 indicator_util_icon_hide(&home);