diff options
Diffstat (limited to 'libug-setting-location-efl-mypos.c')
-rw-r--r-- | libug-setting-location-efl-mypos.c | 102 |
1 files changed, 64 insertions, 38 deletions
diff --git a/libug-setting-location-efl-mypos.c b/libug-setting-location-efl-mypos.c index f899b69..23d65a3 100644 --- a/libug-setting-location-efl-mypos.c +++ b/libug-setting-location-efl-mypos.c @@ -1,24 +1,17 @@ /* - * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright 2012 Samsung Electronics Co., Ltd * - * This file is part of UG setting location - * Written by Youngae Kang <youngae.kang@samsung.com> - * Minjune Kim <sena06.kim@samsung.com> - * Genie Kim <daejins.kim@samsung.com> + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * PROPRIETARY/CONFIDENTIAL + * http://www.tizenopensource.org/license * - * This software is the confidential and proprietary information of - * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not - * disclose such Confidential Information and shall use it only in - * accordance with the terms of the license agreement you entered - * into with SAMSUNG ELECTRONICS. - * SAMSUNG make no representations or warranties about the suitability - * of the software, either express or implied, including but not limited - * to the implied warranties of merchantability, fitness for a particular - * purpose, or non-infringement. SAMSUNG shall not be liable for any - * damages suffered by licensee as a result of using, modifying or - * istributing this software or its derivatives. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "libug-setting-location-efl.h" @@ -37,7 +30,9 @@ static char *mypos_menu[] = { #define LOCATION_MYPOS_MENU_ALT 2 #define LOCATION_MYPOS_MENU_SPEED 3 -static void _loc_ug_position_updated_cb(double latitude, double longitude, double altitude, time_t timestamp, void *user_data) +static void _loc_ug_position_updated_cb(double latitude, double longitude, + double altitude, time_t timestamp, + void *user_data) { struct ug_data *ugd = (struct ug_data *)user_data; ugd->latitude = latitude; @@ -48,21 +43,24 @@ static void _loc_ug_position_updated_cb(double latitude, double longitude, doubl elm_genlist_item_update(ugd->gi_alt); } -static void _loc_ug_velocity_updated_cb(double speed, double direction, double climb, time_t timestamp, void *user_data) +static void _loc_ug_velocity_updated_cb(double speed, double direction, + double climb, time_t timestamp, + void *user_data) { struct ug_data *ugd = (struct ug_data *)user_data; ugd->speed = speed; elm_genlist_item_update(ugd->gi_speed); } -static void setting_location_mypos_free_itc(Elm_Genlist_Item_Class *itc) +static void setting_location_mypos_free_itc(Elm_Genlist_Item_Class * itc) { if (itc) { elm_genlist_item_class_free(itc); } } -static void setting_location_mypos_back_cb(void *data, Evas_Object * obj, void *event_info) +static void setting_location_mypos_back_cb(void *data, Evas_Object * obj, + void *event_info) { struct ug_data *ugd = (struct ug_data *)data; @@ -75,12 +73,15 @@ static void setting_location_mypos_back_cb(void *data, Evas_Object * obj, void * setting_location_mypos_free_itc(ugd->itc_alt); setting_location_mypos_free_itc(ugd->itc_speed); - elm_genlist_select_mode_set(ugd->genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + elm_genlist_select_mode_set(ugd->genlist, + ELM_OBJECT_SELECT_MODE_DEFAULT); elm_naviframe_item_pop(ugd->naviframe); } -static char *_setting_location_mypos_gl_lat_text_get(void *data, Evas_Object * obj, const char *part) +static char *_setting_location_mypos_gl_lat_text_get(void *data, + Evas_Object * obj, + const char *part) { struct ug_data *ugd = (struct ug_data *)data; @@ -102,7 +103,9 @@ static char *_setting_location_mypos_gl_lat_text_get(void *data, Evas_Object * o return NULL; } -static char *_setting_location_mypos_gl_long_text_get(void *data, Evas_Object * obj, const char *part) +static char *_setting_location_mypos_gl_long_text_get(void *data, + Evas_Object * obj, + const char *part) { struct ug_data *ugd = (struct ug_data *)data; @@ -124,7 +127,9 @@ static char *_setting_location_mypos_gl_long_text_get(void *data, Evas_Object * return NULL; } -static char *_setting_location_mypos_gl_alt_text_get(void *data, Evas_Object * obj, const char *part) +static char *_setting_location_mypos_gl_alt_text_get(void *data, + Evas_Object * obj, + const char *part) { struct ug_data *ugd = (struct ug_data *)data; @@ -142,7 +147,9 @@ static char *_setting_location_mypos_gl_alt_text_get(void *data, Evas_Object * o return NULL; } -static char *_setting_location_mypos_gl_speed_text_get(void *data, Evas_Object * obj, const char *part) +static char *_setting_location_mypos_gl_speed_text_get(void *data, + Evas_Object * obj, + const char *part) { struct ug_data *ugd = (struct ug_data *)data; @@ -176,8 +183,11 @@ Evas_Object *setting_location_mypos_create_gl(Evas_Object * parent, void *data) ugd->itc_sep->func.state_get = NULL; ugd->itc_sep->func.del = NULL; - item = elm_genlist_item_append(genlist, ugd->itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + item = + elm_genlist_item_append(genlist, ugd->itc_sep, NULL, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(item, + ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); ugd->itc_lat = elm_genlist_item_class_new(); ugd->itc_lat->item_style = "dialogue/2text.2"; @@ -186,7 +196,9 @@ Evas_Object *setting_location_mypos_create_gl(Evas_Object * parent, void *data) ugd->itc_lat->func.state_get = NULL; ugd->itc_lat->func.del = NULL; - ugd->gi_lat = elm_genlist_item_append(genlist, ugd->itc_lat, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + ugd->gi_lat = + elm_genlist_item_append(genlist, ugd->itc_lat, (void *)ugd, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); ugd->itc_long = elm_genlist_item_class_new(); ugd->itc_long->item_style = "dialogue/2text.2"; @@ -195,7 +207,9 @@ Evas_Object *setting_location_mypos_create_gl(Evas_Object * parent, void *data) ugd->itc_long->func.state_get = NULL; ugd->itc_long->func.del = NULL; - ugd->gi_long = elm_genlist_item_append(genlist, ugd->itc_long, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + ugd->gi_long = + elm_genlist_item_append(genlist, ugd->itc_long, (void *)ugd, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); ugd->itc_alt = elm_genlist_item_class_new(); ugd->itc_alt->item_style = "dialogue/2text.2"; @@ -204,16 +218,21 @@ Evas_Object *setting_location_mypos_create_gl(Evas_Object * parent, void *data) ugd->itc_alt->func.state_get = NULL; ugd->itc_alt->func.del = NULL; - ugd->gi_alt = elm_genlist_item_append(genlist, ugd->itc_alt, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + ugd->gi_alt = + elm_genlist_item_append(genlist, ugd->itc_alt, (void *)ugd, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); ugd->itc_speed = elm_genlist_item_class_new(); ugd->itc_speed->item_style = "dialogue/2text.2"; - ugd->itc_speed->func.text_get = _setting_location_mypos_gl_speed_text_get; + ugd->itc_speed->func.text_get = + _setting_location_mypos_gl_speed_text_get; ugd->itc_speed->func.content_get = NULL; ugd->itc_speed->func.state_get = NULL; ugd->itc_speed->func.del = NULL; - ugd->gi_speed = elm_genlist_item_append(genlist, ugd->itc_speed, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + ugd->gi_speed = + elm_genlist_item_append(genlist, ugd->itc_speed, (void *)ugd, NULL, + ELM_GENLIST_ITEM_NONE, NULL, NULL); elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_NONE); evas_object_show(genlist); @@ -225,13 +244,18 @@ int setting_location_position_start(void *data) { struct ug_data *ugd = (struct ug_data *)data; - if (location_manager_create(LOCATIONS_METHOD_HYBRID, &ugd->loc) != LOCATIONS_ERROR_NONE) { + if (location_manager_create(LOCATIONS_METHOD_HYBRID, &ugd->loc) != + LOCATIONS_ERROR_NONE) { LOC_LOG("location_manager_create is failed"); return -1; } - location_manager_set_position_updated_cb(ugd->loc, _loc_ug_position_updated_cb, 1, (void *)ugd); - location_manager_set_velocity_updated_cb(ugd->loc, _loc_ug_velocity_updated_cb, (void *)ugd); + location_manager_set_position_updated_cb(ugd->loc, + _loc_ug_position_updated_cb, 1, + (void *)ugd); + location_manager_set_velocity_updated_cb(ugd->loc, + _loc_ug_velocity_updated_cb, + (void *)ugd); if (location_manager_start(ugd->loc) != LOCATIONS_ERROR_NONE) { LOC_LOG("location_manager_start is failed"); @@ -268,11 +292,13 @@ int setting_location_mypos_view(void *data) } l_button = elm_button_add(ugd->naviframe); - evas_object_smart_callback_add(l_button, "clicked", setting_location_mypos_back_cb, ugd); + evas_object_smart_callback_add(l_button, "clicked", + setting_location_mypos_back_cb, ugd); genlist = setting_location_mypos_create_gl(ugd->naviframe, ugd); - elm_naviframe_item_push(ugd->naviframe, _("IDS_ST_BODY_MY_POSITION"), l_button, NULL, genlist, NULL); + elm_naviframe_item_push(ugd->naviframe, _("IDS_ST_BODY_MY_POSITION"), + l_button, NULL, genlist, NULL); elm_object_style_set(l_button, "naviframe/back_btn/default"); |