Bug 512520 - remove Maemo geolocation providers. r=staurt
authorDoug Turner <dougt@meer.net>
Tue, 25 Aug 2009 15:08:56 -0700
changeset 31962 83648a3eaea51ceb042776c19dc95af1d4d78062
parent 31961 f73662040c4d2162ec19f35fb1b395013b8695ba
child 31963 2e0802b5c83a4ae49864e51d4ed112f734e2fe3f
push idunknown
push userunknown
push dateunknown
reviewersstaurt
bugs512520
milestone1.9.3a1pre
Bug 512520 - remove Maemo geolocation providers. r=staurt
config/autoconf.mk.in
configure.in
dom/src/geolocation/MaemoLocationProvider.cpp
dom/src/geolocation/MaemoLocationProvider.h
dom/src/geolocation/Makefile.in
layout/build/Makefile.in
toolkit/library/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -630,20 +630,16 @@ MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_
 
 NS_OSSO 	= @NS_OSSO@
 MOZ_PLATFORM_HILDON = @MOZ_PLATFORM_HILDON@
 
 LIBHILDONMIME_CFLAGS	= @LIBHILDONMIME_CFLAGS@
 LIBHILDONMIME_LIBS	= @LIBHILDONMIME_LIBS@
 LIBOSSO_CFLAGS 	= @LIBOSSO_CFLAGS@
 LIBOSSO_LIBS 	= @LIBOSSO_LIBS@
-NS_MAEMO_LOCATION 	= @NS_MAEMO_LOCATION@
-  
-MOZ_LOCATION_CFLAGS 	= @MOZ_LOCATION_CFLAGS@
-MOZ_LOCATION_LIBS 	= @MOZ_LOCATION_LIBS@
 
 MACOS_SDK_DIR	= @MACOS_SDK_DIR@
 NEXT_ROOT	= @NEXT_ROOT@
 GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
 UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
 HAVE_DTRACE= @HAVE_DTRACE@
--- a/configure.in
+++ b/configure.in
@@ -6348,27 +6348,16 @@ if test $NS_OSSO; then
         AC_MSG_ERROR([DBus is required when building for OSSO])
     fi
     AC_DEFINE(NS_OSSO)
     MOZ_GFX_OPTIMIZE_MOBILE=1
 fi
 AC_SUBST(LIBOSSO_CFLAGS)
 AC_SUBST(LIBOSSO_LIBS)
 
-PKG_CHECK_MODULES(MOZ_LOCATION, [liblocation gpsbt],
-                  NS_MAEMO_LOCATION=1,
-                  NS_MAEMO_LOCATION=)
-
-if test $NS_MAEMO_LOCATION; then
-  AC_DEFINE(NS_MAEMO_LOCATION)
-fi
-
-AC_SUBST(MOZ_LOCATION_CFLAGS)
-AC_SUBST(MOZ_LOCATION_LIBS)
-
 dnl ========================================================
 dnl = faststripe theme
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(faststripe,
 [  --enable-faststripe  Use faststripe theme],
     MOZ_THEME_FASTSTRIPE=1,
     MOZ_THEME_FASTSTRIPE= )
 AC_SUBST(MOZ_THEME_FASTSTRIPE)
deleted file mode 100644
--- a/dom/src/geolocation/MaemoLocationProvider.cpp
+++ /dev/null
@@ -1,295 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (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.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Geolocation.
- *
- * The Initial Developer of the Original Code is Mozilla Corporation
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Doug Turner <dougt@meer.net>  (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "MaemoLocationProvider.h"
-#include "nsGeolocation.h"
-#include "nsIClassInfo.h"
-#include "nsDOMClassInfoID.h"
-
-////////////////////////////////////////////////////
-// nsGeoPositionCoords
-////////////////////////////////////////////////////
-
-class nsGeoPositionCoords : public nsIDOMGeoPositionCoords
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMGEOPOSITIONCOORDS
-  
-  nsGeoPositionCoords(double aLat, double aLong,
-                      double aAlt, double aHError,
-                      double aVError, double aHeading,
-                      double aSpeed)
-    : mLat(aLat),
-      mLong(aLong),
-      mAlt(aAlt),
-      mHError(aHError),
-      mVError(aVError),
-      mHeading(aHeading),
-      mSpeed(aSpeed)
-  {
-  }
-  
-  
-  ~nsGeoPositionCoords(){}
-
-private:
-  double mLat, mLong, mAlt, mHError, mVError, mHeading, mSpeed;
-};
-
-NS_INTERFACE_MAP_BEGIN(nsGeoPositionCoords)
-NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMGeoPositionCoords)
-NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPositionCoords)
-NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(GeoPositionCoords)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_ADDREF(nsGeoPositionCoords)
-NS_IMPL_RELEASE(nsGeoPositionCoords)
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetLatitude(double *aLatitude)
-{
-  *aLatitude = mLat;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetLongitude(double *aLongitude)
-{
-  *aLongitude = mLong;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetAltitude(double *aAltitude)
-{
-  *aAltitude = mAlt;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetAccuracy(double *aAccuracy)
-{
-  *aAccuracy = mHError;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetAltitudeAccuracy(double *aAltitudeAccuracy)
-{
-  *aAltitudeAccuracy = mVError;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetHeading(double *aHeading)
-{
-  *aHeading = mHeading;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPositionCoords::GetSpeed(double *aSpeed)
-{
-  *aSpeed = mSpeed;
-  return NS_OK;
-}
-
-////////////////////////////////////////////////////
-// nsGeoPosition
-////////////////////////////////////////////////////
-
-class nsGeoPosition : public nsIDOMGeoPosition
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMGEOPOSITION
-
-    nsGeoPosition(double aLat, double aLong,
-                  double aAlt, double aHError,
-                  double aVError, double aHeading,
-                  double aSpeed, long long aTimestamp)
-      : mLat(aLat),
-        mLong(aLong),
-        mAlt(aAlt),
-        mHError(aHError),
-        mVError(aVError),
-        mHeading(aHeading),
-        mSpeed(aSpeed),
-        mTimestamp(aTimestamp)
-  {
-  }
-
-private:
-  ~nsGeoPosition()
-  {
-  }
-  double mLat, mLong, mAlt, mHError, mVError, mHeading, mSpeed;
-  long long mTimestamp;
-  nsRefPtr<nsGeoPositionCoords> mCoords;
-};
-
-NS_INTERFACE_MAP_BEGIN(nsGeoPosition)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMGeoPosition)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPosition)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(GeoPosition)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_ADDREF(nsGeoPosition)
-NS_IMPL_RELEASE(nsGeoPosition)
-
-NS_IMETHODIMP
-nsGeoPosition::GetCoords(nsIDOMGeoPositionCoords * *aCoords)
-{
-  if (mCoords == nsnull)
-    mCoords = new nsGeoPositionCoords(mLat,
-                                      mLong,
-                                      mAlt,
-                                      mHError,
-                                      mVError,
-                                      mHeading,
-                                      mSpeed);
-  NS_IF_ADDREF(*aCoords = mCoords);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPosition::GetAddress(nsIDOMGeoPositionAddress** aAddress)
-{
-  *aAddress = nsnull;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGeoPosition::GetTimestamp(DOMTimeStamp* aTimestamp)
-{
-  *aTimestamp = mTimestamp;
-  return NS_OK;
-}
-
-
-NS_IMPL_ISUPPORTS1(MaemoLocationProvider, nsIGeolocationProvider)
-
-MaemoLocationProvider::MaemoLocationProvider()
-: mGPSDevice(nsnull),
-  mHasSeenLocation(PR_FALSE),
-  mLastSeenTime(0)
-{
-}
-
-MaemoLocationProvider::~MaemoLocationProvider()
-{
-}
-
-static void location_changed(LocationGPSDevice *device, gpointer userdata)
-{
-  if (!userdata || !device || !device->fix) {
-    return;
-  }
-
-  //  printf ("Latitude: %.5f\nLongitude: %.5f\nAltitude: %.2f\n",
-  //	  device->fix->latitude, device->fix->longitude, device->fix->altitude);
-
-  MaemoLocationProvider* provider = (MaemoLocationProvider*) userdata;
-  nsRefPtr<nsGeoPosition> somewhere = new nsGeoPosition(device->fix->latitude,
-                                                        device->fix->longitude,
-                                                        device->fix->altitude,
-                                                        0,
-                                                        0,
-                                                        0,
-                                                        0,
-                                                        PR_Now());
-  provider->Update(somewhere);
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Startup()
-{
-  if (!mGPSDevice)
-  {
-    mGPSDevice = (LocationGPSDevice*) g_object_new (LOCATION_TYPE_GPS_DEVICE, NULL);
-
-    mCallbackChanged = g_signal_connect(mGPSDevice, 
-                                        "changed",
-                                        G_CALLBACK(location_changed),
-                                        this);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::IsReady(PRBool *_retval NS_OUTPARAM)
-{
-  *_retval = mHasSeenLocation;
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Watch(nsIGeolocationUpdate *callback)
-{
-  if (mCallback)
-    return NS_OK;
-
-  mCallback = callback;
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Shutdown()
-{
-  if (mGPSDevice)
-  {
-    g_signal_handler_disconnect(mGPSDevice, mCallbackChanged);
-
-    g_object_unref(mGPSDevice);
-    mGPSDevice = nsnull;
-
-    mHasSeenLocation = PR_FALSE;
-    
-    mCallback = nsnull;
-  }
-  return NS_OK;
-}
-
-void MaemoLocationProvider::Update(nsIDOMGeoPosition* aPosition)
-{
-  if ((PR_Now() - mLastSeenTime) / PR_USEC_PER_SEC < 5)
-    return;
-
-  mHasSeenLocation = PR_TRUE;
-
-  if (mCallback)
-    mCallback->Update(aPosition);
-
-  mLastSeenTime = PR_Now();
-}
deleted file mode 100644
--- a/dom/src/geolocation/MaemoLocationProvider.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (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.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Geolocation.
- *
- * The Initial Developer of the Original Code is Mozilla Corporation
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Doug Turner <dougt@meer.net>  (Original Author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsIGeolocationProvider.h"
-#include "nsIDOMGeoPosition.h"
-
-#include "nsCOMPtr.h"
-
-#include <glib.h>
-#include <errno.h>
-#include <gpsbt.h>
-#include <gpsmgr.h>
-
-extern "C" {
-  // need to extern these because of:
-  // https://bugs.maemo.org/show_bug.cgi?id=3226
-  #include <location/location-gps-device.h>
-  #include <location/location-gpsd-control.h>
-}
-
-class MaemoLocationProvider : public nsIGeolocationProvider
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIGEOLOCATIONPROVIDER
-
-  MaemoLocationProvider();
-
-  void Update(nsIDOMGeoPosition* aPosition);
-
-private:
-  ~MaemoLocationProvider();
-
-  nsCOMPtr<nsIGeolocationUpdate> mCallback;
-
-  LocationGPSDevice *mGPSDevice;
-
-  gulong mCallbackChanged;
-
-  PRBool mHasSeenLocation;
-  PRTime mLastSeenTime;
-
-};
--- a/dom/src/geolocation/Makefile.in
+++ b/dom/src/geolocation/Makefile.in
@@ -56,21 +56,16 @@ CPPSRCS		= \
 EXTRA_DSO_LDOPTS = \
 		$(MOZ_COMPONENT_LIBS) \
 		$(NULL)
 
 LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/base \
 		$(NULL)
 
-ifdef NS_MAEMO_LOCATION
-CPPSRCS		+= MaemoLocationProvider.cpp
-LOCAL_INCLUDES	+= $(MOZ_LOCATION_CFLAGS)
-endif
-
 ifdef WINCE_WINDOWS_MOBILE
 CPPSRCS         += WinMobileLocationProvider.cpp
 endif
 
 EXTRA_COMPONENTS = \
                  NetworkGeolocationProvider.js \
                  GPSDGeolocationProvider.js \
                  $(NULL)
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -226,18 +226,16 @@ EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) \
 		    $(NULL)
 endif
 
 ifdef MOZ_ENABLE_QT
 EXTRA_DSO_LDOPTS += $(MOZ_QT_LIBS) \
 		    $(NULL)
 endif
 
-EXTRA_DSO_LDOPTS += $(MOZ_LOCATION_LIBS)
-
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(TK_LIBS)
 
 ifdef MOZ_ENABLE_CANVAS3D
 EXTRA_DSO_LDOPTS += -framework OpenGL
 endif
 endif
 
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -233,18 +233,16 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS) -lgthread-2.0
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
 
 ifdef MOZ_TREE_FREETYPE
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
 
-EXTRA_DSO_LDOPTS += $(MOZ_LOCATION_LIBS)
-
 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
 endif
 
 ifeq ($(OS_ARCH),BeOS)
 EXTRA_DSO_LDOPTS += -lbe -ltracker
 endif