From 276051d778cfd977c73efb77af05df78480f452e Mon Sep 17 00:00:00 2001 From: Jinkun Jang Date: Sat, 16 Mar 2013 01:11:53 +0900 Subject: [PATCH] merge with master --- include/location_bounds.h | 28 ++++++++++----------- include/location_preference.h | 28 ++++++++++----------- include/locations.h | 29 +++++++++++----------- include/locations_private.h | 40 ++++++++++++++++++------------ packaging/capi-location-manager.spec | 4 +-- src/location_bounds.c | 28 ++++++++++----------- src/location_preference.c | 28 ++++++++++----------- src/locations.c | 47 +++++++++++++++++++++--------------- test/location_test.c | 28 ++++++++++----------- 9 files changed, 140 insertions(+), 120 deletions(-) diff --git a/include/location_bounds.h b/include/location_bounds.h index 64f846e..5889a99 100644 --- a/include/location_bounds.h +++ b/include/location_bounds.h @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ #ifndef __TIZEN_LOCATION_BOUNDS_H__ #define __TIZEN_LOCATION_BOUNDS_H__ diff --git a/include/location_preference.h b/include/location_preference.h index 3cbaa11..a698cf2 100644 --- a/include/location_preference.h +++ b/include/location_preference.h @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ #ifndef __TIZEN_LOCATION_LOCATION_PREFERENCE_H__ #define __TIZEN_LOCATION_LOCATION_PREFERENCE_H__ diff --git a/include/locations.h b/include/locations.h index e1121fa..4c3f9e7 100644 --- a/include/locations.h +++ b/include/locations.h @@ -1,24 +1,25 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ #ifndef __TIZEN_LOCATION_LOCATIONS_H__ #define __TIZEN_LOCATION_LOCATIONS_H__ #include #include +#include #include #ifdef __cplusplus diff --git a/include/locations_private.h b/include/locations_private.h index 6c78ffc..5dd0063 100755 --- a/include/locations_private.h +++ b/include/locations_private.h @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ #ifndef __TIZEN_LOCATION_LOCATIONS_PRIVATE_H__ #define __TIZEN_LOCATION_LOCATIONS_PRIVATE_H__ @@ -63,7 +63,16 @@ typedef enum { _LOCATIONS_EVENT_TYPE_SATELLITE, _LOCATIONS_EVENT_TYPE_FOREACH_BOUNDS, _LOCATIONS_EVENT_TYPE_NUM -}_location_event_e; +} _location_event_e; + +typedef enum { + _LOCATION_SIGNAL_SERVICE_ENABLED, + _LOCATION_SIGNAL_SERVICE_DISABLED, + _LOCATION_SIGNAL_SERVICE_UPDATED, + _LOCATION_SIGNAL_ZONE_IN, + _LOCATION_SIGNAL_ZONE_OUT, + _LOCATION_SIGNAL_NUM +} _location_signal_e; typedef struct _location_manager_s { LocationObject* object; @@ -72,6 +81,7 @@ typedef struct _location_manager_s { location_method_e method; bool is_continue_foreach_bounds; GList *bounds_list; + gulong sig_id[_LOCATION_SIGNAL_NUM]; } location_manager_s; typedef struct _location_bounds_s { diff --git a/packaging/capi-location-manager.spec b/packaging/capi-location-manager.spec index bfb0ac1..22b657f 100755 --- a/packaging/capi-location-manager.spec +++ b/packaging/capi-location-manager.spec @@ -1,10 +1,10 @@ #sbs-git:slp/api/location-manager capi-location-manager 0.1.0 d1ee09a32e8bc0e9ed48ece37c641a7393c086c5 Name: capi-location-manager Summary: A Location Manager library in Tizen Native API -Version: 0.1.7 +Version: 0.1.9 Release: 1 Group: System/Libraries -License: Apache Licensc, Version 2.0 +License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(dlog) diff --git a/src/location_bounds.c b/src/location_bounds.c index 9626964..d60283c 100755 --- a/src/location_bounds.c +++ b/src/location_bounds.c @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 #include diff --git a/src/location_preference.c b/src/location_preference.c index f313af3..2905fc5 100755 --- a/src/location_preference.c +++ b/src/location_preference.c @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 #include diff --git a/src/locations.c b/src/locations.c index 33e58b8..fb05e36 100755 --- a/src/locations.c +++ b/src/locations.c @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 #include @@ -402,6 +402,10 @@ int location_manager_create(location_method_e method, location_manager_h * manag handle->method = method; handle->is_continue_foreach_bounds = TRUE; handle->bounds_list = NULL; + + handle->sig_id[_LOCATION_SIGNAL_SERVICE_ENABLED] = g_signal_connect(handle->object, "service-enabled", G_CALLBACK(__cb_service_enabled), handle); + handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED] = g_signal_connect(handle->object, "service-disabled", G_CALLBACK(__cb_service_disabled), handle); + *manager = (location_manager_h) handle; return LOCATIONS_ERROR_NONE; } @@ -411,6 +415,9 @@ int location_manager_destroy(location_manager_h manager) LOCATIONS_NULL_ARG_CHECK(manager); location_manager_s *handle = (location_manager_s *) manager; + g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_SERVICE_ENABLED]); + g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_SERVICE_DISABLED]); + int ret = location_free(handle->object); if (ret != LOCATIONS_ERROR_NONE) { return __convert_error_code(ret); @@ -424,11 +431,9 @@ int location_manager_start(location_manager_h manager) LOCATIONS_NULL_ARG_CHECK(manager); location_manager_s *handle = (location_manager_s *) manager; - g_signal_connect(handle->object, "service-enabled", G_CALLBACK(__cb_service_enabled), handle); - g_signal_connect(handle->object, "service-disabled", G_CALLBACK(__cb_service_disabled), handle); - g_signal_connect(handle->object, "service-updated", G_CALLBACK(__cb_service_updated), handle); - g_signal_connect(handle->object, "zone-in", G_CALLBACK(__cb_zone_in), handle); - g_signal_connect(handle->object, "zone-out", G_CALLBACK(__cb_zone_out), handle); + handle->sig_id[_LOCATION_SIGNAL_SERVICE_UPDATED] = g_signal_connect(handle->object, "service-updated", G_CALLBACK(__cb_service_updated), handle); + handle->sig_id[_LOCATION_SIGNAL_ZONE_IN] = g_signal_connect(handle->object, "zone-in", G_CALLBACK(__cb_zone_in), handle); + handle->sig_id[_LOCATION_SIGNAL_ZONE_OUT] = g_signal_connect(handle->object, "zone-out", G_CALLBACK(__cb_zone_out), handle); int ret = location_start(handle->object); if (ret != LOCATION_ERROR_NONE) { @@ -442,6 +447,10 @@ int location_manager_stop(location_manager_h manager) LOCATIONS_NULL_ARG_CHECK(manager); location_manager_s *handle = (location_manager_s *) manager; + g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_SERVICE_UPDATED]); + g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ZONE_IN]); + g_signal_handler_disconnect(handle->object, handle->sig_id[_LOCATION_SIGNAL_ZONE_OUT]); + int ret = location_stop(handle->object); if (ret != LOCATION_ERROR_NONE) { return __convert_error_code(ret); diff --git a/test/location_test.c b/test/location_test.c index 841e1a5..5efd4e5 100644 --- a/test/location_test.c +++ b/test/location_test.c @@ -1,18 +1,18 @@ /* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* 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. -*/ + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 #include -- 2.7.4