[cairo-commit] roadster/src Makefile.am, 1.20, 1.21 animator.c, 1.7, 1.8 db.c, 1.29, 1.30 downloader.c, 1.1, 1.2 downloader.h, 1.1, 1.2 locationselection.c, 1.1, NONE locationselection.h, 1.1, NONE main.c, 1.28, 1.29 mainwindow.c, 1.44, 1.45 map_draw_gdk.c, 1.21, 1.22 map_tile.c, 1.1, 1.2 search_road.c, 1.25, 1.26 track.c, 1.8, NONE track.h, 1.1, NONE

Ian McIntosh commit at pdx.freedesktop.org
Fri Sep 30 16:55:34 PDT 2005


Committed by: ian

Update of /cvs/cairo/roadster/src
In directory gabe:/tmp/cvs-serv2459/src

Modified Files:
	Makefile.am animator.c db.c downloader.c downloader.h main.c 
	mainwindow.c map_draw_gdk.c map_tile.c search_road.c 
Removed Files:
	locationselection.c locationselection.h track.c track.h 
Log Message:
	* src/locationselection.c:
	* src/locationselection.h:
	* src/track.c:
	* src/track.h: Removed these unused files.
	* src/map_draw_gdk.c:
	* src/mainwindow.c: Commented out track code.
	* src/animator.c:
	* src/downloader.c: Removed unused init() functions.
	* src/main.c: Removed calls to *_init() for above.


Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/roadster/src/Makefile.am,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- Makefile.am	30 Sep 2005 23:24:58 -0000	1.20
+++ Makefile.am	30 Sep 2005 23:55:31 -0000	1.21
@@ -46,7 +46,6 @@
 	scenemanager.c\
 	point.c\
 	pointstring.c\
-	track.c\
 	glyph.c\
 	road.c\
 	animator.c\

Index: animator.c
===================================================================
RCS file: /cvs/cairo/roadster/src/animator.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- animator.c	25 Sep 2005 19:02:37 -0000	1.7
+++ animator.c	30 Sep 2005 23:55:31 -0000	1.8
@@ -29,11 +29,6 @@
 
 #include "animator.h"
 
-void animator_init()
-{
-
-}
-
 animator_t* animator_new(EAnimationType eAnimationType, gdouble fAnimationTimeInSeconds)
 {
 	g_assert(fAnimationTimeInSeconds > 0.0);

Index: db.c
===================================================================
RCS file: /cvs/cairo/roadster/src/db.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- db.c	26 Sep 2005 13:57:13 -0000	1.29
+++ db.c	30 Sep 2005 23:55:31 -0000	1.30
@@ -89,8 +89,8 @@
 		"--skip-bdb",
 
 		// query cache options
-                "--query-cache-type=1",		// enable query cache (for map tiles)
-                pszSetQueryCacheSize,
+		"--query-cache-type=1",		// enable query cache (for map tiles)
+		pszSetQueryCacheSize,
 
 		// fulltext index options
 		"--ft-min-word-len=1",		// don't miss any words, even 1-letter words (esp. numbers like "3")
@@ -653,4 +653,15 @@
 		" Name VARCHAR(60) NOT NULL,"
 		" IconName VARCHAR(60) NOT NULL,"
 		" PRIMARY KEY (ID));", NULL);
+
+//     // Remote File Cache
+//     db_query("CREATE TABLE IF NOT EXISTS RemoteFileCache("
+//         " ID INT3 UNSIGNED NOT NULL AUTO_INCREMENT,"        // NOTE: 3 bytes.
+//         " RemoteFilePath VARCHAR(255) NOT NULL,"            // the full URI (eg. "http://site/path/file.png"
+//         " LocalFileName VARCHAR(255) NOT NULL,"             // just the 'name' part.  the path should be prepended
+//         " LocalFileSize INT4 NOT NULL,"
+//         " PRIMARY KEY (ID),"
+//         " INDEX (RemoteFilePath),"
+//         " INDEX (LocalFileName))",
+//         NULL);
 }

Index: downloader.c
===================================================================
RCS file: /cvs/cairo/roadster/src/downloader.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- downloader.c	30 Sep 2005 23:24:58 -0000	1.1
+++ downloader.c	30 Sep 2005 23:55:31 -0000	1.2
@@ -56,11 +56,6 @@
 //
 // functions
 //
-void downloader_init(void)
-{
-	// nothing
-}
-
 downloader_t* downloader_new(gint nMaxConcurrentActive)
 {
 	downloader_t* pNew = g_new0(downloader_t, 1);

Index: downloader.h
===================================================================
RCS file: /cvs/cairo/roadster/src/downloader.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- downloader.h	30 Sep 2005 23:24:58 -0000	1.1
+++ downloader.h	30 Sep 2005 23:55:31 -0000	1.2
@@ -38,9 +38,7 @@
 } downloader_t;
 
 // public API
-void downloader_init(void);
 downloader_t* downloader_new(gint nMaxConcurrentActive);
-
 void downloader_add_uri(downloader_t* pDownloader, const gchar* pszRemoteFilePath, DownloaderCallbackFileResult pCallbackFileResult);
 
 #endif

--- locationselection.c DELETED ---

--- locationselection.h DELETED ---

Index: main.c
===================================================================
RCS file: /cvs/cairo/roadster/src/main.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- main.c	30 Sep 2005 23:24:58 -0000	1.28
+++ main.c	30 Sep 2005 23:55:31 -0000	1.29
@@ -32,13 +32,11 @@
 #include "map.h"
 #include "gpsclient.h"
 #include "scenemanager.h"
-#include "animator.h"
 #include "road.h"
 #include "locationset.h"
 #include "location.h"
 #include "search.h"
 #include "search.h"
-#include "downloader.h"
 
 static gboolean main_init(void);
 static void main_deinit(void);
@@ -135,11 +133,11 @@
 		g_warning("gnome_vfs_init failed\n");
 		return FALSE;
 	}
-
 	gchar* pszApplicationDir = g_strdup_printf("%s/.roadster", g_get_home_dir());
 	gnome_vfs_make_directory(pszApplicationDir, 0700);
 	g_free(pszApplicationDir);
 #endif
+
 	g_print("initializing points\n");
 	point_init();
 	g_print("initializing pointstrings\n");
@@ -148,8 +146,6 @@
 	g_print("initializing roads\n");
 	road_init();
 
-	g_print("initializing tracks\n");
-	track_init();
 	g_print("initializing map styles\n");
 	map_style_init();
 	g_print("initializing map\n");
@@ -161,9 +157,6 @@
 	g_print("initializing gpsclient\n");
 	gpsclient_init();
 
-	g_print("initializing animator\n");
-	animator_init();
-
 	//
 	// Database
 	//
@@ -196,8 +189,6 @@
 	location_init();
 
 	g_print("initialization complete\n");
-
-	downloader_init();
 	return TRUE;
 }
 

Index: mainwindow.c
===================================================================
RCS file: /cvs/cairo/roadster/src/mainwindow.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- mainwindow.c	30 Sep 2005 05:09:51 -0000	1.44
+++ mainwindow.c	30 Sep 2005 23:55:31 -0000	1.45
@@ -1445,13 +1445,13 @@
 	const gpsdata_t* pData = gpsclient_getdata();
 	if(pData->eStatus == GPS_STATUS_LIVE) {
 
-		if(g_MainWindow.nCurrentGPSPath == 0) {
-			// create a new track for GPS trail
-			g_MainWindow.nCurrentGPSPath = track_new();
-			map_add_track(g_MainWindow.pMap, g_MainWindow.nCurrentGPSPath);
-		}
-
-		track_add_point(g_MainWindow.nCurrentGPSPath, &pData->ptPosition);
+//         if(g_MainWindow.nCurrentGPSPath == 0) {
+//             // create a new track for GPS trail
+//             g_MainWindow.nCurrentGPSPath = track_new();
+//             map_add_track(g_MainWindow.pMap, g_MainWindow.nCurrentGPSPath);
+//         }
+//
+//         track_add_point(g_MainWindow.nCurrentGPSPath, &pData->ptPosition);
 
 		// Show position?
 		if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_MainWindow.GPS.pShowPositionCheckButton))) {

Index: map_draw_gdk.c
===================================================================
RCS file: /cvs/cairo/roadster/src/map_draw_gdk.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- map_draw_gdk.c	30 Sep 2005 05:09:51 -0000	1.21
+++ map_draw_gdk.c	30 Sep 2005 23:55:31 -0000	1.22
@@ -39,7 +39,6 @@
 #include "road.h"
 #include "point.h"
 #include "map_style.h"
-#include "track.h"
 #include "locationset.h"
 #include "location.h"
 #include "scenemanager.h"
@@ -50,10 +49,11 @@
 
 static void map_draw_gdk_layer_fill(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics, maplayerstyle_t* pLayerStyle);
 
-static void map_draw_gdk_tracks(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics);
 static void map_draw_gdk_locations(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics);
 static void map_draw_gdk_locationset(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics, locationset_t* pLocationSet, GPtrArray* pLocationsArray);
 
+//static void map_draw_gdk_tracks(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics);
+
 //#define ENABLE_MAP_GRAYSCALE_HACK 	// just a little test.  black and white might be good for something
 
 void map_draw_gdk_set_color(GdkGC* pGC, color_t* pColor)
@@ -112,7 +112,7 @@
 				//map_draw_gdk_locations(pMap, pPixmap, pRenderMetrics);
 			}
 		}
-		map_draw_gdk_tracks(pMap, pPixmap, pRenderMetrics);
+//		map_draw_gdk_tracks(pMap, pPixmap, pRenderMetrics);
 	}
 
 	// 3. Labels
@@ -315,63 +315,6 @@
 	}
 }
 
-static void map_draw_gdk_tracks(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics)
-{
-	gint i;
-	for(i=0 ; i<pMap->pTracksArray->len ; i++) {
-		gint hTrack = g_array_index(pMap->pTracksArray, gint, i);
-
-		GdkColor clr;
-		clr.red = (gint)(0.5 * 65535.0);
-		clr.green = (gint)(0.5 * 65535.0);
-		clr.blue = (gint)(1.0 * 65535.0);
-		gdk_gc_set_rgb_fg_color(pMap->pTargetWidget->style->fg_gc[GTK_WIDGET_STATE(pMap->pTargetWidget)], &clr);
-
-		pointstring_t* pPointString = track_get_pointstring(hTrack);
-		if(pPointString == NULL) continue;
-
-		if(pPointString->pPointsArray->len >= 2) {
-
-			if(pPointString->pPointsArray->len > MAX_GDK_LINE_SEGMENTS) {
-				//g_warning("not drawing track with > %d segments\n", MAX_GDK_LINE_SEGMENTS);
-				continue;
-			}
-
-			GdkPoint aPoints[MAX_GDK_LINE_SEGMENTS];
-
-			gdouble fMaxLat = MIN_LATITUDE;	// init to the worst possible value so first point will override
-			gdouble fMinLat = MAX_LATITUDE;
-			gdouble fMaxLon = MIN_LONGITUDE;
-			gdouble fMinLon = MAX_LONGITUDE;
-
-			gint iPoint;
-			for(iPoint=0 ; iPoint<pPointString->pPointsArray->len ; iPoint++) {
-				mappoint_t* pPoint = g_ptr_array_index(pPointString->pPointsArray, iPoint);
-
-				// find extents
-				fMaxLat = max(pPoint->fLatitude,fMaxLat);
-				fMinLat = min(pPoint->fLatitude,fMinLat);
-				fMaxLon = max(pPoint->fLongitude,fMaxLon);
-				fMinLon = min(pPoint->fLongitude,fMinLon);
-
-				aPoints[iPoint].x = (gint)SCALE_X(pRenderMetrics, pPoint->fLongitude);
-				aPoints[iPoint].y = (gint)SCALE_Y(pRenderMetrics, pPoint->fLatitude);
-			}
-
-			// rectangle overlap test
-			if(fMaxLat < pRenderMetrics->rWorldBoundingBox.A.fLatitude
-			   || fMaxLon < pRenderMetrics->rWorldBoundingBox.A.fLongitude
-			   || fMinLat > pRenderMetrics->rWorldBoundingBox.B.fLatitude
-			   || fMinLon > pRenderMetrics->rWorldBoundingBox.B.fLongitude)
-			{
-			    continue;	// not visible
-			}
-
-			gdk_draw_lines(pPixmap, pMap->pTargetWidget->style->fg_gc[GTK_WIDGET_STATE(pMap->pTargetWidget)], aPoints, pPointString->pPointsArray->len);
-   		}
-	}
-}
-
 // Draw all locations from sets marked visible
 static void map_draw_gdk_locations(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics)
 {
@@ -424,6 +367,7 @@
 	}
 }
 
+#ifdef ROADSTER_DEAD_CODE
 //             GdkColor clr1;
 //             clr1.red = 255/255.0 * 65535;
 //             clr1.green = 80/255.0 * 65535;
@@ -446,3 +390,60 @@
 //                         nX-1,nY-1,
 //                         3, 3);
 
+// static void map_draw_gdk_tracks(map_t* pMap, GdkPixmap* pPixmap, rendermetrics_t* pRenderMetrics)
+// {
+//     gint i;
+//     for(i=0 ; i<pMap->pTracksArray->len ; i++) {
+//         gint hTrack = g_array_index(pMap->pTracksArray, gint, i);
+//
+//         GdkColor clr;
+//         clr.red = (gint)(0.5 * 65535.0);
+//         clr.green = (gint)(0.5 * 65535.0);
+//         clr.blue = (gint)(1.0 * 65535.0);
+//         gdk_gc_set_rgb_fg_color(pMap->pTargetWidget->style->fg_gc[GTK_WIDGET_STATE(pMap->pTargetWidget)], &clr);
+//
+//         pointstring_t* pPointString = track_get_pointstring(hTrack);
+//         if(pPointString == NULL) continue;
+//
+//         if(pPointString->pPointsArray->len >= 2) {
+//
+//             if(pPointString->pPointsArray->len > MAX_GDK_LINE_SEGMENTS) {
+//                 //g_warning("not drawing track with > %d segments\n", MAX_GDK_LINE_SEGMENTS);
+//                 continue;
+//             }
+//
+//             GdkPoint aPoints[MAX_GDK_LINE_SEGMENTS];
+//
+//             gdouble fMaxLat = MIN_LATITUDE; // init to the worst possible value so first point will override
+//             gdouble fMinLat = MAX_LATITUDE;
+//             gdouble fMaxLon = MIN_LONGITUDE;
+//             gdouble fMinLon = MAX_LONGITUDE;
+//
+//             gint iPoint;
+//             for(iPoint=0 ; iPoint<pPointString->pPointsArray->len ; iPoint++) {
+//                 mappoint_t* pPoint = g_ptr_array_index(pPointString->pPointsArray, iPoint);
+//
+//                 // find extents
+//                 fMaxLat = max(pPoint->fLatitude,fMaxLat);
+//                 fMinLat = min(pPoint->fLatitude,fMinLat);
+//                 fMaxLon = max(pPoint->fLongitude,fMaxLon);
+//                 fMinLon = min(pPoint->fLongitude,fMinLon);
+//
+//                 aPoints[iPoint].x = (gint)SCALE_X(pRenderMetrics, pPoint->fLongitude);
+//                 aPoints[iPoint].y = (gint)SCALE_Y(pRenderMetrics, pPoint->fLatitude);
+//             }
+//
+//             // rectangle overlap test
+//             if(fMaxLat < pRenderMetrics->rWorldBoundingBox.A.fLatitude
+//                || fMaxLon < pRenderMetrics->rWorldBoundingBox.A.fLongitude
+//                || fMinLat > pRenderMetrics->rWorldBoundingBox.B.fLatitude
+//                || fMinLon > pRenderMetrics->rWorldBoundingBox.B.fLongitude)
+//             {
+//                 continue;   // not visible
+//             }
+//
+//             gdk_draw_lines(pPixmap, pMap->pTargetWidget->style->fg_gc[GTK_WIDGET_STATE(pMap->pTargetWidget)], aPoints, pPointString->pPointsArray->len);
+//         }
+//     }
+// }
+#endif

Index: map_tile.c
===================================================================
RCS file: /cvs/cairo/roadster/src/map_tile.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- map_tile.c	24 Sep 2005 05:25:25 -0000	1.1
+++ map_tile.c	30 Sep 2005 23:55:31 -0000	1.2
@@ -1,5 +1,3 @@
-
-
 void map_tile_load()
 {
 	

Index: search_road.c
===================================================================
RCS file: /cvs/cairo/roadster/src/search_road.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- search_road.c	26 Sep 2005 13:57:14 -0000	1.25
+++ search_road.c	30 Sep 2005 23:55:31 -0000	1.26
@@ -367,7 +367,7 @@
 	g_free(pszQuery);
 }
 
-
+// XXX: doesn't map.c have something like this? :)
 static gfloat point_calc_distance(mappoint_t* pA, mappoint_t* pB)
 {
 	gdouble fRise = pB->fLatitude - pA->fLatitude;

--- track.c DELETED ---

--- track.h DELETED ---



More information about the cairo-commit mailing list