Moved desktop widget code to a subdirectory.
authorAki Koskinen <maemo@akikoskinen.info>
Sun, 7 Feb 2010 17:26:43 +0000 (19:26 +0200)
committerAki Koskinen <maemo@akikoskinen.info>
Sun, 7 Feb 2010 17:31:45 +0000 (19:31 +0200)
44 files changed:
.gitignore
AUTHORS [deleted file]
COPYING [deleted file]
ChangeLog [deleted file]
Makefile.am [deleted file]
NEWS [deleted file]
README [deleted file]
antigen.sh [deleted file]
autogen.sh [deleted file]
configure.ac [deleted file]
coordinate-system.c [deleted file]
coordinate-system.h [deleted file]
debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/rules [deleted file]
getmehome/.gitignore [new file with mode: 0644]
getmehome/AUTHORS [new file with mode: 0644]
getmehome/COPYING [new file with mode: 0644]
getmehome/ChangeLog [new file with mode: 0644]
getmehome/Makefile.am [new file with mode: 0644]
getmehome/NEWS [new file with mode: 0644]
getmehome/README [new file with mode: 0644]
getmehome/antigen.sh [new file with mode: 0644]
getmehome/autogen.sh [new file with mode: 0755]
getmehome/configure.ac [new file with mode: 0644]
getmehome/coordinate-system.c [new file with mode: 0644]
getmehome/coordinate-system.h [new file with mode: 0644]
getmehome/debian/changelog [new file with mode: 0644]
getmehome/debian/compat [new file with mode: 0644]
getmehome/debian/control [new file with mode: 0644]
getmehome/debian/copyright [new file with mode: 0644]
getmehome/debian/rules [new file with mode: 0644]
getmehome/lib-timeout-home-widget.c [new file with mode: 0644]
getmehome/lib-timeout-home-widget.h [new file with mode: 0644]
getmehome/location-provider.c [new file with mode: 0644]
getmehome/location-provider.h [new file with mode: 0644]
getmehome/timeout-home-widget.desktop.in [new file with mode: 0644]
lib-timeout-home-widget.c [deleted file]
lib-timeout-home-widget.h [deleted file]
location-provider.c [deleted file]
location-provider.h [deleted file]
timeout-home-widget.desktop.in [deleted file]

index 5a90e3d..8cb892a 100644 (file)
@@ -1,23 +1,4 @@
-.deps
-.libs
-Makefile.in
-aclocal.m4
-autom4te.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
+*.o
 *.la
 *.lo
-*.o
-libtool
-ltmain.sh
-missing
-stamp-h1
-*.desktop
 *~
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index 36d7ace..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Maemo Team <xxxx@maemo.org>
diff --git a/COPYING b/COPYING
deleted file mode 100644 (file)
index f083aa1..0000000
--- a/COPYING
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (C) 2009 Nokia Corporation. All rights reserved.
-
-This maemo code example is licensed under a following MIT-style license.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE 
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644 (file)
index bff24a6..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,3 +0,0 @@
-2009-06-24  Maemo Team  <xxxx@maemo.org>
-
-       * Autotoolized and debianized
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644 (file)
index 8b20f18..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# We invent desktoplib_LTLIBRARIES instead of the normal lib_LTLIBRARIES,
-# so we can specify the non-standard installation directory.
-desktoplib_LTLIBRARIES =  lib-timeout-home-widget.la
-desktoplibdir = $(HILDON_DESKTOP_LIB_DIR)
-
-lib_timeout_home_widget_la_SOURCES = lib-timeout-home-widget.c lib-timeout-home-widget.h location-provider.h location-provider.c
-lib_timeout_home_widget_la_LIBADD = $(EXAMPLE_LIBS)
-
-AM_CFLAGS = -Wall $(EXAMPLE_CFLAGS)
-
-# .desktop file
-desktopdir = $(HILDON_HOME_DESKTOP_DIR)
-desktop_DATA = timeout-home-widget.desktop
-
-DISTCLEANFILES = $(desktop_DATA)
diff --git a/NEWS b/NEWS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/README b/README
deleted file mode 100644 (file)
index 1c7902a..0000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-Example Home widget. Provides TimeOut applet for the Home Area of the desktop.
diff --git a/antigen.sh b/antigen.sh
deleted file mode 100644 (file)
index b877a0b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -ex
-if test -f Makefile; then
-  make distclean
-fi
-rm -f *.tar.* *.tgz
-rm -Rf autom4te.cache
-rm -f Makefile.in aclocal.m4 configure depcomp install-sh missing ltmain.sh config.guess config.sub config.h.in mkinstalldirs INSTALL
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755 (executable)
index 27a68ef..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-set -ex
-autoreconf --install --force 
diff --git a/configure.ac b/configure.ac
deleted file mode 100644 (file)
index ebe86df..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-AC_PREREQ(2.61)
-AC_INIT([hildon-timeout-desktop-widget-example], [0.1])
-AC_CONFIG_SRCDIR([lib-timeout-home-widget.c])
-AM_INIT_AUTOMAKE
-AC_CONFIG_HEADER([config.h])
-
-AC_PROG_CC
-AC_HEADER_STDC
-AC_PROG_INSTALL
-AM_PROG_LIBTOOL
-
-PKG_CHECK_MODULES(EXAMPLE, hildon-1 libhildondesktop-1 gtk+-2.0 liblocation)
-AC_SUBST(EXAMPLE_CFLAGS)
-AC_SUBST(EXAMPLE_LIBS)
-
-# Discover where to install the .desktop file:
-HILDON_HOME_DESKTOP_DIR=`pkg-config libhildondesktop-1 --variable=hildonhomedesktopentrydir`
-AC_SUBST(HILDON_HOME_DESKTOP_DIR)
-
-# Discover where to install the status widget's lib file:
-HILDON_DESKTOP_LIB_DIR=`pkg-config libhildondesktop-1 --variable=hildondesktoplibdir`
-AC_SUBST(HILDON_DESKTOP_LIB_DIR) 
-
-
-AC_OUTPUT(Makefile)
-AC_OUTPUT(timeout-home-widget.desktop)
diff --git a/coordinate-system.c b/coordinate-system.c
deleted file mode 100644 (file)
index ed84894..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-#include "coordinate-system.h"
-
-#include <math.h>
-
-
-// Degrees to radians
-double radians(double deg) {
-    return deg * M_PI / 180.0;
-}
-
-// Radians to degrees
-double degrees(double rad) {
-    return rad * 180.0 / M_PI;
-}
-
-
-// Constants
-// Longitude0 and Center meridian of KKJ bands
-const double KKJ_ZONE_INFO[6][2] = { {18.0,  500000.0},
-                                     {21.0, 1500000.0},
-                                     {24.0, 2500000.0},
-                                     {27.0, 3500000.0},
-                                     {30.0, 4500000.0},
-                                     {33.0, 5500000.0} };
-
-
-// Function:  KKJ_Zone_I
-int KKJ_Zone_I(KKJ easting) {
-    int zoneNumber = floor(easting / 1000000.0);
-    if (zoneNumber < 0 || zoneNumber > 5) {
-        zoneNumber = -1;
-    }
-
-    return zoneNumber;
-}
-
-
-// Function:  KKJ_Zone_Lo
-int KKJ_Zone_Lo(double kkjlo) {
-    // determine the zonenumber from KKJ easting
-    // takes KKJ zone which has center meridian
-    // longitude nearest (in math value) to
-    // the given KKJ longitude
-    int zoneNumber = 5;
-    while (zoneNumber >= 0) {
-        if (fabs(kkjlo - KKJ_ZONE_INFO[zoneNumber][0]) <= 1.5) {
-            break;
-        }
-        zoneNumber--;
-    }
-
-    return zoneNumber;
-}
-
-
-// Function:  KKJlalo_to_WGS84lalo
-void KKJlola_to_WGS84lola(double kkjlo, double kkjla, double *outLongitude, double *outLatitude) {
-    double dLa = radians(0.124867E+01 + -0.269982E+00 * kkjla + 0.191330E+00 * kkjlo + 0.356119E-02 * kkjla * kkjla + -0.122312E-02 * kkjla * kkjlo + -0.335514E-03 * kkjlo * kkjlo) / 3600.0;
-    double dLo = radians(-0.286111E+02 + 0.114183E+01 * kkjla + -0.581428E+00 * kkjlo + -0.152421E-01 * kkjla * kkjla + 0.118177E-01 * kkjla * kkjlo + 0.826646E-03 * kkjlo * kkjlo) / 3600.0;
-
-    *outLatitude = degrees(radians(kkjla) + dLa);
-    *outLongitude = degrees(radians(kkjlo) + dLo);
-}
-
-
-// Function:  WGS84lalo_to_KKJlalo
-void WGS84lola_to_KKJlola(double longitude, double latitude, double *outLongitude, double *outLatitude) {
-    double dLa = radians(-0.124766E+01 + 0.269941E+00 * latitude + -0.191342E+00 * longitude + -0.356086E-02 * latitude * latitude + 0.122353E-02 * latitude * longitude + 0.335456E-03 * longitude * longitude) / 3600.0;
-    double dLo = radians(0.286008E+02 + -0.114139E+01 * latitude + 0.581329E+00 * longitude + 0.152376E-01 * latitude * latitude + -0.118166E-01 * latitude * longitude + -0.826201E-03 * longitude * longitude) / 3600.0;
-
-    *outLatitude = degrees(radians(latitude) + dLa);
-    *outLongitude = degrees(radians(longitude) + dLo);
-}
-
-
-// Function:  KKJlalo_to_KKJxy
-void KKJlola_to_KKJxy(double lon, double lat, int zoneNumber, KKJ *outX, KKJ *outY) {
-    // Hayford ellipsoid
-    double a = 6378388.0;
-    double f  = 1.0 / 297.0;
-    double b  = (1.0 - f) * a;
-    double bb = b * b;
-    double c  = (a / b) * a;
-    double ee = (a * a - bb) / bb;
-    double n = (a - b) / (a + b);
-    double nn = n * n;
-
-    double Lo = radians(lon) - radians(KKJ_ZONE_INFO[zoneNumber][0]);
-    double cosLa = cos(radians(lat));
-    double NN = ee * cosLa * cosLa;
-    double LaF = atan(tan(radians(lat)) / cos(Lo * sqrt(1.0 + NN)));
-    double cosLaF = cos(LaF);
-    double t = (tan(Lo) * cosLaF) / sqrt(1.0 + ee * cosLaF * cosLaF);
-    double A = a / (1.0 + n);
-    double A1 = A * (1.0 + nn / 4.0 + nn * nn / 64.0);
-    double A2 = A * 1.5 * n * (1.0 - nn / 8.0);
-    double A3 = A * 0.9375 * nn * (1.0 - nn / 4.0);
-    double A4 = A * 35.0 / 48.0 * nn * n;
-
-    *outY = A1 * LaF - A2 * sin(2.0 * LaF) + A3 * sin(4.0 * LaF) - A4 * sin(6.0 * LaF);
-    *outX = c * log(t + sqrt(1.0 + t * t)) + 500000.0 + zoneNumber * 1000000.0;
-}
-
-// Function:  KKJxy_to_KKJlalo
-void KKJxy_to_KKJlola(KKJ x, KKJ y, double *outLongitude, double *outLatitude) {
-    // Scan iteratively the target area, until find matching
-    // KKJ coordinate value.  Area is defined with Hayford Ellipsoid.
-    int zoneNumber = KKJ_Zone_I(x);
-    double minLo = radians(18.5);
-    double maxLo = radians(32.0);
-    double minLa = radians(59.0);
-    double maxLa = radians(70.5);
-
-    int i = 1;
-    KKJ tmpX, tmpY;
-
-    while (i < 35) {
-        double deltaLo = maxLo - minLo;
-        double deltaLa = maxLa - minLa;
-        *outLongitude = degrees(minLo + 0.5 * deltaLo);
-        *outLatitude = degrees(minLa + 0.5 * deltaLa);
-        KKJlola_to_KKJxy(*outLongitude, *outLatitude, zoneNumber, &tmpX, &tmpY);
-        if (tmpY < y) {
-            minLa = minLa + 0.45 * deltaLa;
-        } else {
-            maxLa = minLa + 0.55 * deltaLa;
-        }
-
-        if (tmpX < x) {
-            minLo = minLo + 0.45 * deltaLo;
-        } else {
-            maxLo = minLo + 0.55 * deltaLo;
-        }
-
-        i++;
-    }
-}
-
-  ////////////////////
- // PUBLIC METHODS //
-////////////////////
-
-void WGS84lola_to_KKJxy(double longitude, double latitude, KKJ *outX, KKJ *outY) {
-    double kkjlo, kkjla;
-
-    WGS84lola_to_KKJlola(longitude, latitude, &kkjlo, &kkjla);
-    int zoneNumber = KKJ_Zone_Lo(kkjlo);
-    KKJlola_to_KKJxy(kkjlo, kkjla, zoneNumber, outX, outY);
- }
-
-void KKJxy_to_WGS84lola(KKJ x, KKJ y, double *outLongitude, double *outLatitude) {
-    double kkjlo, kkjla;
-
-    KKJxy_to_KKJlola(x, y, &kkjlo, &kkjla);
-    KKJlola_to_WGS84lola(kkjlo, kkjla, outLongitude, outLatitude);
-}
diff --git a/coordinate-system.h b/coordinate-system.h
deleted file mode 100644 (file)
index 7c3d100..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef COORDINATE_SYSTEM_H
-#define COORDINATE_SYSTEM_H
-
-// Type for KKJ x/y coordinates
-typedef unsigned int KKJ;
-
-/**
- * Transformes WGS84 longitude/latitude coordinates to KKJ x/y coordinates.
- * @param longitude the input longitude in degrees
- * @param latitude the input latitude in degrees
- * @param outX the result x (easting)
- * @param outY the result y (northing)
- */
-void WGS84lola_to_KKJxy(double longitude, double latitude, KKJ *outX, KKJ *outY);
-
-/**
- * Transformes KKJ x/y coordinates to WGS84 longitude/latitude coordinates.
- * @param x the input x (easting)
- * @param y the input y (northing)
- * @param outLongitude the result longitude in degrees
- * @param outLatitude the result latitude in degrees
- */
-void KKJxy_to_WGS84lola(KKJ x, KKJ y, double *outLongitude, double *outLatitude);
-
-#endif
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 2865792..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-hildon-timeout-home-widget-example (0.1-1) unstable; urgency=low
-
-  * Autotoolized and debianized
-
- -- Maemo Team <xxxx@maemo.org>  Wed, 24 Jun 2009 16:22:18 +0300
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index 3f5f1df..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Source: hildon-timeout-home-widget-example
-Section: user/desktop
-Priority: optional
-Maintainer: Maemo Team <xxxx@maemo.org>
-Build-Depends: debhelper (>= 5), autotools-dev, libhildondesktop1-dev (>= 2.1.16)
-Standards-Version: 3.7.2
-
-Package: hildon-timeout-home-widget-example
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Example home widget
- An example home widget for Maemo.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index cba57fe..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-This package was debianized by Maemo Team <xxxx@maemo.org> on
-Wed, 24 Jun 2009 16:22:18 +0300.
-
-Copyright (C) 2009 Nokia Corporation. All rights reserved.
-
-This maemo code example is licensed under a following MIT-style license.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE 
diff --git a/debian/rules b/debian/rules
deleted file mode 100644 (file)
index 399ccd8..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-
-config.status: configure
-       dh_testdir
-       # Add here commands to configure the package.
-       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
-
-
-build: build-stamp
-
-build-stamp:  config.status
-       dh_testdir
-
-       # Add here commands to compile the package.
-       $(MAKE)
-       #docbook-to-man debian/hildon-timeout-home-widget-example.sgml > hildon-timeout-home-widget-example.1
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp 
-
-       # Add here commands to clean up after the build process.
-       -$(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       cp -f /usr/share/misc/config.guess config.guess
-endif
-
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       # Add here commands to install the package into debian/hildon-timeout-home-widget-example.
-       $(MAKE) DESTDIR=$(CURDIR)/debian/hildon-timeout-home-widget-example install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs ChangeLog
-       dh_installdocs
-       dh_installexamples
-#      dh_install
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip
-       dh_compress
-       dh_fixperms
-#      dh_perl
-#      dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
diff --git a/getmehome/.gitignore b/getmehome/.gitignore
new file mode 100644 (file)
index 0000000..6dac9f2
--- /dev/null
@@ -0,0 +1,21 @@
+.deps
+.libs
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+stamp-h1
+*.desktop
+*~
diff --git a/getmehome/AUTHORS b/getmehome/AUTHORS
new file mode 100644 (file)
index 0000000..36d7ace
--- /dev/null
@@ -0,0 +1 @@
+Maemo Team <xxxx@maemo.org>
diff --git a/getmehome/COPYING b/getmehome/COPYING
new file mode 100644 (file)
index 0000000..f083aa1
--- /dev/null
@@ -0,0 +1,22 @@
+Copyright (C) 2009 Nokia Corporation. All rights reserved.
+
+This maemo code example is licensed under a following MIT-style license.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE 
diff --git a/getmehome/ChangeLog b/getmehome/ChangeLog
new file mode 100644 (file)
index 0000000..bff24a6
--- /dev/null
@@ -0,0 +1,3 @@
+2009-06-24  Maemo Team  <xxxx@maemo.org>
+
+       * Autotoolized and debianized
diff --git a/getmehome/Makefile.am b/getmehome/Makefile.am
new file mode 100644 (file)
index 0000000..8b20f18
--- /dev/null
@@ -0,0 +1,15 @@
+# We invent desktoplib_LTLIBRARIES instead of the normal lib_LTLIBRARIES,
+# so we can specify the non-standard installation directory.
+desktoplib_LTLIBRARIES =  lib-timeout-home-widget.la
+desktoplibdir = $(HILDON_DESKTOP_LIB_DIR)
+
+lib_timeout_home_widget_la_SOURCES = lib-timeout-home-widget.c lib-timeout-home-widget.h location-provider.h location-provider.c
+lib_timeout_home_widget_la_LIBADD = $(EXAMPLE_LIBS)
+
+AM_CFLAGS = -Wall $(EXAMPLE_CFLAGS)
+
+# .desktop file
+desktopdir = $(HILDON_HOME_DESKTOP_DIR)
+desktop_DATA = timeout-home-widget.desktop
+
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/getmehome/NEWS b/getmehome/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/getmehome/README b/getmehome/README
new file mode 100644 (file)
index 0000000..1c7902a
--- /dev/null
@@ -0,0 +1 @@
+Example Home widget. Provides TimeOut applet for the Home Area of the desktop.
diff --git a/getmehome/antigen.sh b/getmehome/antigen.sh
new file mode 100644 (file)
index 0000000..b877a0b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -ex
+if test -f Makefile; then
+  make distclean
+fi
+rm -f *.tar.* *.tgz
+rm -Rf autom4te.cache
+rm -f Makefile.in aclocal.m4 configure depcomp install-sh missing ltmain.sh config.guess config.sub config.h.in mkinstalldirs INSTALL
diff --git a/getmehome/autogen.sh b/getmehome/autogen.sh
new file mode 100755 (executable)
index 0000000..27a68ef
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+set -ex
+autoreconf --install --force 
diff --git a/getmehome/configure.ac b/getmehome/configure.ac
new file mode 100644 (file)
index 0000000..ebe86df
--- /dev/null
@@ -0,0 +1,26 @@
+AC_PREREQ(2.61)
+AC_INIT([hildon-timeout-desktop-widget-example], [0.1])
+AC_CONFIG_SRCDIR([lib-timeout-home-widget.c])
+AM_INIT_AUTOMAKE
+AC_CONFIG_HEADER([config.h])
+
+AC_PROG_CC
+AC_HEADER_STDC
+AC_PROG_INSTALL
+AM_PROG_LIBTOOL
+
+PKG_CHECK_MODULES(EXAMPLE, hildon-1 libhildondesktop-1 gtk+-2.0 liblocation)
+AC_SUBST(EXAMPLE_CFLAGS)
+AC_SUBST(EXAMPLE_LIBS)
+
+# Discover where to install the .desktop file:
+HILDON_HOME_DESKTOP_DIR=`pkg-config libhildondesktop-1 --variable=hildonhomedesktopentrydir`
+AC_SUBST(HILDON_HOME_DESKTOP_DIR)
+
+# Discover where to install the status widget's lib file:
+HILDON_DESKTOP_LIB_DIR=`pkg-config libhildondesktop-1 --variable=hildondesktoplibdir`
+AC_SUBST(HILDON_DESKTOP_LIB_DIR) 
+
+
+AC_OUTPUT(Makefile)
+AC_OUTPUT(timeout-home-widget.desktop)
diff --git a/getmehome/coordinate-system.c b/getmehome/coordinate-system.c
new file mode 100644 (file)
index 0000000..ed84894
--- /dev/null
@@ -0,0 +1,156 @@
+#include "coordinate-system.h"
+
+#include <math.h>
+
+
+// Degrees to radians
+double radians(double deg) {
+    return deg * M_PI / 180.0;
+}
+
+// Radians to degrees
+double degrees(double rad) {
+    return rad * 180.0 / M_PI;
+}
+
+
+// Constants
+// Longitude0 and Center meridian of KKJ bands
+const double KKJ_ZONE_INFO[6][2] = { {18.0,  500000.0},
+                                     {21.0, 1500000.0},
+                                     {24.0, 2500000.0},
+                                     {27.0, 3500000.0},
+                                     {30.0, 4500000.0},
+                                     {33.0, 5500000.0} };
+
+
+// Function:  KKJ_Zone_I
+int KKJ_Zone_I(KKJ easting) {
+    int zoneNumber = floor(easting / 1000000.0);
+    if (zoneNumber < 0 || zoneNumber > 5) {
+        zoneNumber = -1;
+    }
+
+    return zoneNumber;
+}
+
+
+// Function:  KKJ_Zone_Lo
+int KKJ_Zone_Lo(double kkjlo) {
+    // determine the zonenumber from KKJ easting
+    // takes KKJ zone which has center meridian
+    // longitude nearest (in math value) to
+    // the given KKJ longitude
+    int zoneNumber = 5;
+    while (zoneNumber >= 0) {
+        if (fabs(kkjlo - KKJ_ZONE_INFO[zoneNumber][0]) <= 1.5) {
+            break;
+        }
+        zoneNumber--;
+    }
+
+    return zoneNumber;
+}
+
+
+// Function:  KKJlalo_to_WGS84lalo
+void KKJlola_to_WGS84lola(double kkjlo, double kkjla, double *outLongitude, double *outLatitude) {
+    double dLa = radians(0.124867E+01 + -0.269982E+00 * kkjla + 0.191330E+00 * kkjlo + 0.356119E-02 * kkjla * kkjla + -0.122312E-02 * kkjla * kkjlo + -0.335514E-03 * kkjlo * kkjlo) / 3600.0;
+    double dLo = radians(-0.286111E+02 + 0.114183E+01 * kkjla + -0.581428E+00 * kkjlo + -0.152421E-01 * kkjla * kkjla + 0.118177E-01 * kkjla * kkjlo + 0.826646E-03 * kkjlo * kkjlo) / 3600.0;
+
+    *outLatitude = degrees(radians(kkjla) + dLa);
+    *outLongitude = degrees(radians(kkjlo) + dLo);
+}
+
+
+// Function:  WGS84lalo_to_KKJlalo
+void WGS84lola_to_KKJlola(double longitude, double latitude, double *outLongitude, double *outLatitude) {
+    double dLa = radians(-0.124766E+01 + 0.269941E+00 * latitude + -0.191342E+00 * longitude + -0.356086E-02 * latitude * latitude + 0.122353E-02 * latitude * longitude + 0.335456E-03 * longitude * longitude) / 3600.0;
+    double dLo = radians(0.286008E+02 + -0.114139E+01 * latitude + 0.581329E+00 * longitude + 0.152376E-01 * latitude * latitude + -0.118166E-01 * latitude * longitude + -0.826201E-03 * longitude * longitude) / 3600.0;
+
+    *outLatitude = degrees(radians(latitude) + dLa);
+    *outLongitude = degrees(radians(longitude) + dLo);
+}
+
+
+// Function:  KKJlalo_to_KKJxy
+void KKJlola_to_KKJxy(double lon, double lat, int zoneNumber, KKJ *outX, KKJ *outY) {
+    // Hayford ellipsoid
+    double a = 6378388.0;
+    double f  = 1.0 / 297.0;
+    double b  = (1.0 - f) * a;
+    double bb = b * b;
+    double c  = (a / b) * a;
+    double ee = (a * a - bb) / bb;
+    double n = (a - b) / (a + b);
+    double nn = n * n;
+
+    double Lo = radians(lon) - radians(KKJ_ZONE_INFO[zoneNumber][0]);
+    double cosLa = cos(radians(lat));
+    double NN = ee * cosLa * cosLa;
+    double LaF = atan(tan(radians(lat)) / cos(Lo * sqrt(1.0 + NN)));
+    double cosLaF = cos(LaF);
+    double t = (tan(Lo) * cosLaF) / sqrt(1.0 + ee * cosLaF * cosLaF);
+    double A = a / (1.0 + n);
+    double A1 = A * (1.0 + nn / 4.0 + nn * nn / 64.0);
+    double A2 = A * 1.5 * n * (1.0 - nn / 8.0);
+    double A3 = A * 0.9375 * nn * (1.0 - nn / 4.0);
+    double A4 = A * 35.0 / 48.0 * nn * n;
+
+    *outY = A1 * LaF - A2 * sin(2.0 * LaF) + A3 * sin(4.0 * LaF) - A4 * sin(6.0 * LaF);
+    *outX = c * log(t + sqrt(1.0 + t * t)) + 500000.0 + zoneNumber * 1000000.0;
+}
+
+// Function:  KKJxy_to_KKJlalo
+void KKJxy_to_KKJlola(KKJ x, KKJ y, double *outLongitude, double *outLatitude) {
+    // Scan iteratively the target area, until find matching
+    // KKJ coordinate value.  Area is defined with Hayford Ellipsoid.
+    int zoneNumber = KKJ_Zone_I(x);
+    double minLo = radians(18.5);
+    double maxLo = radians(32.0);
+    double minLa = radians(59.0);
+    double maxLa = radians(70.5);
+
+    int i = 1;
+    KKJ tmpX, tmpY;
+
+    while (i < 35) {
+        double deltaLo = maxLo - minLo;
+        double deltaLa = maxLa - minLa;
+        *outLongitude = degrees(minLo + 0.5 * deltaLo);
+        *outLatitude = degrees(minLa + 0.5 * deltaLa);
+        KKJlola_to_KKJxy(*outLongitude, *outLatitude, zoneNumber, &tmpX, &tmpY);
+        if (tmpY < y) {
+            minLa = minLa + 0.45 * deltaLa;
+        } else {
+            maxLa = minLa + 0.55 * deltaLa;
+        }
+
+        if (tmpX < x) {
+            minLo = minLo + 0.45 * deltaLo;
+        } else {
+            maxLo = minLo + 0.55 * deltaLo;
+        }
+
+        i++;
+    }
+}
+
+  ////////////////////
+ // PUBLIC METHODS //
+////////////////////
+
+void WGS84lola_to_KKJxy(double longitude, double latitude, KKJ *outX, KKJ *outY) {
+    double kkjlo, kkjla;
+
+    WGS84lola_to_KKJlola(longitude, latitude, &kkjlo, &kkjla);
+    int zoneNumber = KKJ_Zone_Lo(kkjlo);
+    KKJlola_to_KKJxy(kkjlo, kkjla, zoneNumber, outX, outY);
+ }
+
+void KKJxy_to_WGS84lola(KKJ x, KKJ y, double *outLongitude, double *outLatitude) {
+    double kkjlo, kkjla;
+
+    KKJxy_to_KKJlola(x, y, &kkjlo, &kkjla);
+    KKJlola_to_WGS84lola(kkjlo, kkjla, outLongitude, outLatitude);
+}
diff --git a/getmehome/coordinate-system.h b/getmehome/coordinate-system.h
new file mode 100644 (file)
index 0000000..7c3d100
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef COORDINATE_SYSTEM_H
+#define COORDINATE_SYSTEM_H
+
+// Type for KKJ x/y coordinates
+typedef unsigned int KKJ;
+
+/**
+ * Transformes WGS84 longitude/latitude coordinates to KKJ x/y coordinates.
+ * @param longitude the input longitude in degrees
+ * @param latitude the input latitude in degrees
+ * @param outX the result x (easting)
+ * @param outY the result y (northing)
+ */
+void WGS84lola_to_KKJxy(double longitude, double latitude, KKJ *outX, KKJ *outY);
+
+/**
+ * Transformes KKJ x/y coordinates to WGS84 longitude/latitude coordinates.
+ * @param x the input x (easting)
+ * @param y the input y (northing)
+ * @param outLongitude the result longitude in degrees
+ * @param outLatitude the result latitude in degrees
+ */
+void KKJxy_to_WGS84lola(KKJ x, KKJ y, double *outLongitude, double *outLatitude);
+
+#endif
diff --git a/getmehome/debian/changelog b/getmehome/debian/changelog
new file mode 100644 (file)
index 0000000..2865792
--- /dev/null
@@ -0,0 +1,6 @@
+hildon-timeout-home-widget-example (0.1-1) unstable; urgency=low
+
+  * Autotoolized and debianized
+
+ -- Maemo Team <xxxx@maemo.org>  Wed, 24 Jun 2009 16:22:18 +0300
+
diff --git a/getmehome/debian/compat b/getmehome/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/getmehome/debian/control b/getmehome/debian/control
new file mode 100644 (file)
index 0000000..3f5f1df
--- /dev/null
@@ -0,0 +1,12 @@
+Source: hildon-timeout-home-widget-example
+Section: user/desktop
+Priority: optional
+Maintainer: Maemo Team <xxxx@maemo.org>
+Build-Depends: debhelper (>= 5), autotools-dev, libhildondesktop1-dev (>= 2.1.16)
+Standards-Version: 3.7.2
+
+Package: hildon-timeout-home-widget-example
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Example home widget
+ An example home widget for Maemo.
diff --git a/getmehome/debian/copyright b/getmehome/debian/copyright
new file mode 100644 (file)
index 0000000..cba57fe
--- /dev/null
@@ -0,0 +1,25 @@
+This package was debianized by Maemo Team <xxxx@maemo.org> on
+Wed, 24 Jun 2009 16:22:18 +0300.
+
+Copyright (C) 2009 Nokia Corporation. All rights reserved.
+
+This maemo code example is licensed under a following MIT-style license.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE 
diff --git a/getmehome/debian/rules b/getmehome/debian/rules
new file mode 100644 (file)
index 0000000..399ccd8
--- /dev/null
@@ -0,0 +1,107 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+config.status: configure
+       dh_testdir
+       # Add here commands to configure the package.
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
+
+
+build: build-stamp
+
+build-stamp:  config.status
+       dh_testdir
+
+       # Add here commands to compile the package.
+       $(MAKE)
+       #docbook-to-man debian/hildon-timeout-home-widget-example.sgml > hildon-timeout-home-widget-example.1
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp 
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) distclean
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+       cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+       cp -f /usr/share/misc/config.guess config.guess
+endif
+
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/hildon-timeout-home-widget-example.
+       $(MAKE) DESTDIR=$(CURDIR)/debian/hildon-timeout-home-widget-example install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs ChangeLog
+       dh_installdocs
+       dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 
diff --git a/getmehome/lib-timeout-home-widget.c b/getmehome/lib-timeout-home-widget.c
new file mode 100644 (file)
index 0000000..a548981
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * This file is part of hildon-timeout-home-widget-example
+ *
+ * Copyright (C) 2009 Nokia Corporation. All rights reserved.
+ *
+ * This maemo code example is licensed under a MIT-style license,
+ * that can be found in the file called "COPYING" in the root
+ * directory.
+ *
+ */
+
+#include <gtk/gtk.h>
+#include <hildon/hildon.h>
+
+#include "lib-timeout-home-widget.h"
+
+#include "location-provider.h"
+
+HD_DEFINE_PLUGIN_MODULE (TimeOutPlugin, time_out_plugin, HD_TYPE_HOME_PLUGIN_ITEM)
+
+GtkTextBuffer *debugBuffer = NULL;
+
+static void printDebug(const char *msg)
+{
+    if (debugBuffer != NULL) {
+        gtk_text_buffer_insert_at_cursor(debugBuffer, msg, -1);
+        gtk_text_buffer_insert_at_cursor(debugBuffer, "\n", -1);
+    }
+}
+
+char debugStr[1024];
+#define debug(...) sprintf(debugStr, __VA_ARGS__); printDebug(debugStr)
+
+static void location_listener(double latitude, double longitude)
+{
+    debug("got location: %f, %f", latitude, longitude);
+}
+
+int locationTrackingOn = 0;
+void search_button_clicked(GtkButton *button, gpointer user_data)
+{
+    if (!locationTrackingOn) {
+        // Setup location tracking
+        setup_location_provider();
+        set_location_listener(location_listener);
+        start_location_provider();
+
+        locationTrackingOn = 1;
+        debug("Location tracking started");
+    } else {
+        stop_location_provider();
+        cleanup_location_provider();
+
+        locationTrackingOn = 0;
+        debug("Location tracking stopped");
+    }
+}
+
+static GtkWidget *build_ui(void)
+{
+    GtkVBox *contents = GTK_VBOX(gtk_vbox_new(0, FALSE));
+    GtkLabel *label = GTK_LABEL(gtk_label_new("Get me home"));
+//     HildonPickerButton *action;
+//     action = HILDON_PICKER_BUTTON (hildon_picker_button_new (HILDON_SIZE_FINGER_HEIGHT,
+//                                         HILDON_BUTTON_ARRANGEMENT_VERTICAL));
+//     HildonTouchSelector *action_selector;
+//     action_selector = HILDON_TOUCH_SELECTOR (hildon_touch_selector_new_text ());
+//     hildon_button_set_title (HILDON_BUTTON (action), "Action");
+//     hildon_touch_selector_append_text (action_selector, "Blank Screen");
+//     hildon_touch_selector_append_text (action_selector, "Suspend");
+//     hildon_touch_selector_append_text (action_selector, "Turn Off");
+//     hildon_picker_button_set_selector (action, action_selector);
+//     hildon_picker_button_set_active (action, 0);
+
+    GtkWidget* getmehomeButton = hildon_gtk_button_new(HILDON_SIZE_AUTO);
+    gtk_button_set_label(GTK_BUTTON(getmehomeButton), "Search");
+
+    g_signal_connect(getmehomeButton, "clicked", G_CALLBACK(search_button_clicked), NULL);
+
+//     HildonTimeButton *time;
+//     time = HILDON_TIME_BUTTON (hildon_time_button_new (HILDON_SIZE_FINGER_HEIGHT,
+//                                         HILDON_BUTTON_ARRANGEMENT_VERTICAL));
+//     hildon_time_button_set_time (time, 22, 00);
+
+    GtkHBox *buttons = GTK_HBOX(gtk_hbox_new(0, TRUE));
+    gtk_container_add(GTK_CONTAINER(buttons), GTK_WIDGET(getmehomeButton));
+//     gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (action));
+//     gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (time));
+
+    GtkWidget *debugView = hildon_text_view_new();  // gtk_text_view_new();
+    gtk_widget_set_size_request(GTK_WIDGET(debugView), 400, 200);
+    debugBuffer = hildon_text_view_get_buffer(HILDON_TEXT_VIEW(debugView)); // gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
+    GtkWidget* debugScroller = gtk_scrolled_window_new(NULL, NULL);
+    gtk_container_add(GTK_CONTAINER(debugScroller), GTK_WIDGET(debugView));
+
+    gtk_box_pack_start(GTK_BOX(contents), GTK_WIDGET(label), FALSE, FALSE, 0);
+    gtk_box_pack_end(GTK_BOX(contents), GTK_WIDGET(buttons), FALSE, FALSE, 0);
+    gtk_box_pack_end(GTK_BOX(contents), GTK_WIDGET(debugScroller), FALSE, FALSE, 0);
+    gtk_widget_show_all(GTK_WIDGET(contents));
+
+    return GTK_WIDGET(contents);
+}
+
+static void
+time_out_plugin_init (TimeOutPlugin *desktop_plugin)
+{
+    GtkWidget *contents = build_ui ();
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), contents);
+}
+
+static void
+time_out_plugin_class_init (TimeOutPluginClass *class) {}
+
+static void
+time_out_plugin_class_finalize (TimeOutPluginClass *class) {}
diff --git a/getmehome/lib-timeout-home-widget.h b/getmehome/lib-timeout-home-widget.h
new file mode 100644 (file)
index 0000000..3c657aa
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * This file is part of hildon-timeout-home-widget-example
+ *
+ * Copyright (C) 2009 Nokia Corporation. All rights reserved.
+ *
+ * This maemo code example is licensed under a MIT-style license,
+ * that can be found in the file called "COPYING" in the root
+ * directory.
+ *
+ */
+
+#ifndef TIME_OUT_PLUGIN_H
+#define TIME_OUT_PLUGIN_H
+
+#include <glib-object.h>
+
+#include <libhildondesktop/libhildondesktop.h>
+
+G_BEGIN_DECLS
+
+typedef struct _TimeOutPlugin TimeOutPlugin;
+typedef struct _TimeOutPluginClass TimeOutPluginClass;
+
+#define TIME_OUT_TYPE_HOME_PLUGIN (time_out_home_plugin_get_type ())
+
+#define TIME_OUT_HOME_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePlugin))
+
+#define TIME_OUT_HOME_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePluginClass))
+
+#define TIME_OUT_IS_HOME_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                        TIME_OUT_TYPE_HOME_PLUGIN))
+
+#define TIME_OUT_IS_HOME_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                        TIME_OUT_TYPE_HOME_PLUGIN))
+
+#define TIME_OUT_HOME_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePluginClass))
+
+struct _TimeOutPlugin
+{
+    HDHomePluginItem hitem;
+};
+
+struct _TimeOutPluginClass
+{
+    HDHomePluginItemClass parent_class;
+};
+
+GType time_out_home_plugin_get_type(void);
+
+G_END_DECLS
+
+#endif
diff --git a/getmehome/location-provider.c b/getmehome/location-provider.c
new file mode 100644 (file)
index 0000000..58e3701
--- /dev/null
@@ -0,0 +1,100 @@
+#include "location-provider.h"
+
+#include <location/location-gps-device.h>
+#include <location/location-gpsd-control.h>
+
+void (*listener)(double, double) = NULL;
+
+/*static void on_error(LocationGPSDControl *control, LocationGPSDControlError error, gpointer data)
+{
+       g_debug("location error: %d... quitting", error);
+       g_main_loop_quit((GMainLoop *) data);
+}*/
+
+static void on_changed(LocationGPSDevice *device, gpointer data)
+{
+    if (device == NULL || listener == NULL) {
+        return;
+    }
+
+    if (device->fix) {
+        if (device->fix->fields & LOCATION_GPS_DEVICE_LATLONG_SET) {
+            listener(device->fix->latitude, device->fix->longitude);
+        }
+    }
+}
+
+/*static void on_stop(LocationGPSDControl *control, gpointer data)
+{
+       g_debug("quitting");
+       g_main_loop_quit((GMainLoop *) data);
+}*/
+
+/*static gboolean start_location(gpointer data)
+{
+       location_gpsd_control_start((LocationGPSDControl *) data);
+       return FALSE;
+}*/
+
+LocationGPSDControl *control = NULL;
+LocationGPSDevice *device = NULL;
+
+void setup_location_provider()
+{
+//     GMainLoop *loop;
+
+//     g_type_init();
+
+//     loop = g_main_loop_new(NULL, FALSE);
+
+    if (control != NULL) {
+        return;
+    }
+
+    control = location_gpsd_control_get_default();
+    device = g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
+
+    g_object_set(G_OBJECT(control),
+        "preferred-method", LOCATION_METHOD_USER_SELECTED,
+        "preferred-interval", LOCATION_INTERVAL_DEFAULT,
+        NULL);
+
+//     g_signal_connect(control, "error-verbose", G_CALLBACK(on_error), loop);
+    g_signal_connect(device, "changed", G_CALLBACK(on_changed), control);
+//     g_signal_connect(control, "gpsd-stopped", G_CALLBACK(on_stop), loop);
+
+//     g_idle_add(start_location, control);
+
+//     g_main_loop_run(loop);
+}
+
+void cleanup_location_provider()
+{
+    if (control != NULL) {
+        location_gpsd_control_stop(control);
+
+        g_object_unref(device);
+        g_object_unref(control);
+        device = NULL;
+        control = NULL;
+    }
+}
+
+void start_location_provider()
+{
+    if (control != NULL) {
+        location_gpsd_control_start(control);
+    }
+}
+
+void stop_location_provider()
+{
+    if (control != NULL) {
+        location_gpsd_control_stop(control);
+    }
+}
+
+void set_location_listener(void (*newListener)(double, double))
+{
+    listener = newListener;
+}
diff --git a/getmehome/location-provider.h b/getmehome/location-provider.h
new file mode 100644 (file)
index 0000000..31df5c7
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef LOCATION_PROVIDER_H
+#define LOCATION_PROVIDER_H
+
+void setup_location_provider();
+void cleanup_location_provider();
+
+void start_location_provider();
+void stop_location_provider();
+
+void set_location_listener(void (*newListener)(double, double));
+
+#endif
diff --git a/getmehome/timeout-home-widget.desktop.in b/getmehome/timeout-home-widget.desktop.in
new file mode 100644 (file)
index 0000000..a3faf4c
--- /dev/null
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=TimeOut Widget
+Comment=Execute an action at a given time
+Type=default
+X-Path=lib-timeout-home-widget.so
diff --git a/lib-timeout-home-widget.c b/lib-timeout-home-widget.c
deleted file mode 100644 (file)
index a548981..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * This file is part of hildon-timeout-home-widget-example
- *
- * Copyright (C) 2009 Nokia Corporation. All rights reserved.
- *
- * This maemo code example is licensed under a MIT-style license,
- * that can be found in the file called "COPYING" in the root
- * directory.
- *
- */
-
-#include <gtk/gtk.h>
-#include <hildon/hildon.h>
-
-#include "lib-timeout-home-widget.h"
-
-#include "location-provider.h"
-
-HD_DEFINE_PLUGIN_MODULE (TimeOutPlugin, time_out_plugin, HD_TYPE_HOME_PLUGIN_ITEM)
-
-GtkTextBuffer *debugBuffer = NULL;
-
-static void printDebug(const char *msg)
-{
-    if (debugBuffer != NULL) {
-        gtk_text_buffer_insert_at_cursor(debugBuffer, msg, -1);
-        gtk_text_buffer_insert_at_cursor(debugBuffer, "\n", -1);
-    }
-}
-
-char debugStr[1024];
-#define debug(...) sprintf(debugStr, __VA_ARGS__); printDebug(debugStr)
-
-static void location_listener(double latitude, double longitude)
-{
-    debug("got location: %f, %f", latitude, longitude);
-}
-
-int locationTrackingOn = 0;
-void search_button_clicked(GtkButton *button, gpointer user_data)
-{
-    if (!locationTrackingOn) {
-        // Setup location tracking
-        setup_location_provider();
-        set_location_listener(location_listener);
-        start_location_provider();
-
-        locationTrackingOn = 1;
-        debug("Location tracking started");
-    } else {
-        stop_location_provider();
-        cleanup_location_provider();
-
-        locationTrackingOn = 0;
-        debug("Location tracking stopped");
-    }
-}
-
-static GtkWidget *build_ui(void)
-{
-    GtkVBox *contents = GTK_VBOX(gtk_vbox_new(0, FALSE));
-    GtkLabel *label = GTK_LABEL(gtk_label_new("Get me home"));
-//     HildonPickerButton *action;
-//     action = HILDON_PICKER_BUTTON (hildon_picker_button_new (HILDON_SIZE_FINGER_HEIGHT,
-//                                         HILDON_BUTTON_ARRANGEMENT_VERTICAL));
-//     HildonTouchSelector *action_selector;
-//     action_selector = HILDON_TOUCH_SELECTOR (hildon_touch_selector_new_text ());
-//     hildon_button_set_title (HILDON_BUTTON (action), "Action");
-//     hildon_touch_selector_append_text (action_selector, "Blank Screen");
-//     hildon_touch_selector_append_text (action_selector, "Suspend");
-//     hildon_touch_selector_append_text (action_selector, "Turn Off");
-//     hildon_picker_button_set_selector (action, action_selector);
-//     hildon_picker_button_set_active (action, 0);
-
-    GtkWidget* getmehomeButton = hildon_gtk_button_new(HILDON_SIZE_AUTO);
-    gtk_button_set_label(GTK_BUTTON(getmehomeButton), "Search");
-
-    g_signal_connect(getmehomeButton, "clicked", G_CALLBACK(search_button_clicked), NULL);
-
-//     HildonTimeButton *time;
-//     time = HILDON_TIME_BUTTON (hildon_time_button_new (HILDON_SIZE_FINGER_HEIGHT,
-//                                         HILDON_BUTTON_ARRANGEMENT_VERTICAL));
-//     hildon_time_button_set_time (time, 22, 00);
-
-    GtkHBox *buttons = GTK_HBOX(gtk_hbox_new(0, TRUE));
-    gtk_container_add(GTK_CONTAINER(buttons), GTK_WIDGET(getmehomeButton));
-//     gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (action));
-//     gtk_container_add (GTK_CONTAINER (buttons), GTK_WIDGET (time));
-
-    GtkWidget *debugView = hildon_text_view_new();  // gtk_text_view_new();
-    gtk_widget_set_size_request(GTK_WIDGET(debugView), 400, 200);
-    debugBuffer = hildon_text_view_get_buffer(HILDON_TEXT_VIEW(debugView)); // gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
-    GtkWidget* debugScroller = gtk_scrolled_window_new(NULL, NULL);
-    gtk_container_add(GTK_CONTAINER(debugScroller), GTK_WIDGET(debugView));
-
-    gtk_box_pack_start(GTK_BOX(contents), GTK_WIDGET(label), FALSE, FALSE, 0);
-    gtk_box_pack_end(GTK_BOX(contents), GTK_WIDGET(buttons), FALSE, FALSE, 0);
-    gtk_box_pack_end(GTK_BOX(contents), GTK_WIDGET(debugScroller), FALSE, FALSE, 0);
-    gtk_widget_show_all(GTK_WIDGET(contents));
-
-    return GTK_WIDGET(contents);
-}
-
-static void
-time_out_plugin_init (TimeOutPlugin *desktop_plugin)
-{
-    GtkWidget *contents = build_ui ();
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), contents);
-}
-
-static void
-time_out_plugin_class_init (TimeOutPluginClass *class) {}
-
-static void
-time_out_plugin_class_finalize (TimeOutPluginClass *class) {}
diff --git a/lib-timeout-home-widget.h b/lib-timeout-home-widget.h
deleted file mode 100644 (file)
index 3c657aa..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of hildon-timeout-home-widget-example
- *
- * Copyright (C) 2009 Nokia Corporation. All rights reserved.
- *
- * This maemo code example is licensed under a MIT-style license,
- * that can be found in the file called "COPYING" in the root
- * directory.
- *
- */
-
-#ifndef TIME_OUT_PLUGIN_H
-#define TIME_OUT_PLUGIN_H
-
-#include <glib-object.h>
-
-#include <libhildondesktop/libhildondesktop.h>
-
-G_BEGIN_DECLS
-
-typedef struct _TimeOutPlugin TimeOutPlugin;
-typedef struct _TimeOutPluginClass TimeOutPluginClass;
-
-#define TIME_OUT_TYPE_HOME_PLUGIN (time_out_home_plugin_get_type ())
-
-#define TIME_OUT_HOME_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePlugin))
-
-#define TIME_OUT_HOME_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
-                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePluginClass))
-
-#define TIME_OUT_IS_HOME_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
-                        TIME_OUT_TYPE_HOME_PLUGIN))
-
-#define TIME_OUT_IS_HOME_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
-                        TIME_OUT_TYPE_HOME_PLUGIN))
-
-#define TIME_OUT_HOME_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
-                        TIME_OUT_TYPE_HOME_PLUGIN, TimeOutHomePluginClass))
-
-struct _TimeOutPlugin
-{
-    HDHomePluginItem hitem;
-};
-
-struct _TimeOutPluginClass
-{
-    HDHomePluginItemClass parent_class;
-};
-
-GType time_out_home_plugin_get_type(void);
-
-G_END_DECLS
-
-#endif
diff --git a/location-provider.c b/location-provider.c
deleted file mode 100644 (file)
index 58e3701..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#include "location-provider.h"
-
-#include <location/location-gps-device.h>
-#include <location/location-gpsd-control.h>
-
-void (*listener)(double, double) = NULL;
-
-/*static void on_error(LocationGPSDControl *control, LocationGPSDControlError error, gpointer data)
-{
-       g_debug("location error: %d... quitting", error);
-       g_main_loop_quit((GMainLoop *) data);
-}*/
-
-static void on_changed(LocationGPSDevice *device, gpointer data)
-{
-    if (device == NULL || listener == NULL) {
-        return;
-    }
-
-    if (device->fix) {
-        if (device->fix->fields & LOCATION_GPS_DEVICE_LATLONG_SET) {
-            listener(device->fix->latitude, device->fix->longitude);
-        }
-    }
-}
-
-/*static void on_stop(LocationGPSDControl *control, gpointer data)
-{
-       g_debug("quitting");
-       g_main_loop_quit((GMainLoop *) data);
-}*/
-
-/*static gboolean start_location(gpointer data)
-{
-       location_gpsd_control_start((LocationGPSDControl *) data);
-       return FALSE;
-}*/
-
-LocationGPSDControl *control = NULL;
-LocationGPSDevice *device = NULL;
-
-void setup_location_provider()
-{
-//     GMainLoop *loop;
-
-//     g_type_init();
-
-//     loop = g_main_loop_new(NULL, FALSE);
-
-    if (control != NULL) {
-        return;
-    }
-
-    control = location_gpsd_control_get_default();
-    device = g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
-
-    g_object_set(G_OBJECT(control),
-        "preferred-method", LOCATION_METHOD_USER_SELECTED,
-        "preferred-interval", LOCATION_INTERVAL_DEFAULT,
-        NULL);
-
-//     g_signal_connect(control, "error-verbose", G_CALLBACK(on_error), loop);
-    g_signal_connect(device, "changed", G_CALLBACK(on_changed), control);
-//     g_signal_connect(control, "gpsd-stopped", G_CALLBACK(on_stop), loop);
-
-//     g_idle_add(start_location, control);
-
-//     g_main_loop_run(loop);
-}
-
-void cleanup_location_provider()
-{
-    if (control != NULL) {
-        location_gpsd_control_stop(control);
-
-        g_object_unref(device);
-        g_object_unref(control);
-        device = NULL;
-        control = NULL;
-    }
-}
-
-void start_location_provider()
-{
-    if (control != NULL) {
-        location_gpsd_control_start(control);
-    }
-}
-
-void stop_location_provider()
-{
-    if (control != NULL) {
-        location_gpsd_control_stop(control);
-    }
-}
-
-void set_location_listener(void (*newListener)(double, double))
-{
-    listener = newListener;
-}
diff --git a/location-provider.h b/location-provider.h
deleted file mode 100644 (file)
index 31df5c7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef LOCATION_PROVIDER_H
-#define LOCATION_PROVIDER_H
-
-void setup_location_provider();
-void cleanup_location_provider();
-
-void start_location_provider();
-void stop_location_provider();
-
-void set_location_listener(void (*newListener)(double, double));
-
-#endif
diff --git a/timeout-home-widget.desktop.in b/timeout-home-widget.desktop.in
deleted file mode 100644 (file)
index a3faf4c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[Desktop Entry]
-Name=TimeOut Widget
-Comment=Execute an action at a given time
-Type=default
-X-Path=lib-timeout-home-widget.so