[cairo-commit] roadster/src gpsclient.c, 1.5, 1.6 gui.c, 1.4, 1.5 layers.c, 1.10, 1.11 main.c, 1.10, 1.11 map.c, 1.15, 1.16

Nathan Fredrickson commit at pdx.freedesktop.org
Thu Mar 3 20:06:37 PST 2005


Committed by: nrf

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

Modified Files:
	gpsclient.c gui.c layers.c main.c map.c 
Log Message:
    * src/gui.c: Call gtk_main_quit() to shutdown properly and look for glade file in source dir first.
    * src/main.c: Clean up.
    * src/layers.c: Look for style file in source dir first.
    * src/gpsclient.c
    * src/map.c: Add prototype.


Index: gpsclient.c
===================================================================
RCS file: /cvs/cairo/roadster/src/gpsclient.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gpsclient.c	4 Mar 2005 02:27:29 -0000	1.5
+++ gpsclient.c	4 Mar 2005 04:06:35 -0000	1.6
@@ -31,6 +31,7 @@
 } g_GPSClient = {0};
 
 gboolean gpsclient_callback_data_waiting(GIOChannel *source, GIOCondition condition, gpointer data);
+static void gpsclient_connect(void);
 
 void gpsclient_init()
 {

Index: gui.c
===================================================================
RCS file: /cvs/cairo/roadster/src/gui.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gui.c	28 Feb 2005 03:25:23 -0000	1.4
+++ gui.c	4 Mar 2005 04:06:35 -0000	1.5
@@ -21,17 +21,14 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include <glade/glade.h>
-
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
 
+#include <glade/glade.h>
 #include <gnome.h>
 
 #include "gui.h"
-#include "map.h"
-#include "util.h"
 #include "db.h"
 
 #include "mainwindow.h"
@@ -40,21 +37,20 @@
 #include "datasetwindow.h"
 #include "welcomewindow.h"
 #include "searchwindow.h"
-#include "databasewindow.h"
 
 void gui_init()
 {
 	GladeXML *pGladeXML;
 
 	// Load glade UI definition file and connect to callback functions	
-	pGladeXML = glade_xml_new (PACKAGE_DATA_DIR"/roadster.glade", NULL, NULL);
+	// try source directory first (good for development)
+	pGladeXML = glade_xml_new (PACKAGE_SOURCE_DIR"/data/roadster.glade", NULL, NULL);
 	if(pGladeXML == NULL) {
-		// try source directory if user hasn't done a 'make install' (good for development, too!)
-		pGladeXML = glade_xml_new (PACKAGE_SOURCE_DIR"/data/roadster.glade", NULL, NULL);
+		pGladeXML = glade_xml_new (PACKAGE_DATA_DIR"/roadster.glade", NULL, NULL);
 
 		if(pGladeXML == NULL) {
 			g_message("cannot find file roadster.glade\n");
-			gtk_exit(0);
+			gtk_main_quit();
 		}
 	}
 	glade_xml_signal_autoconnect(pGladeXML);
@@ -66,7 +62,6 @@
 	importwindow_init(pGladeXML);
 	datasetwindow_init(pGladeXML);
 	welcomewindow_init(pGladeXML);
-//	databasewindow_init(pGladeXML);
 }
 
 void gui_run()
@@ -86,6 +81,6 @@
 	mainwindow_hide();
 	gotowindow_hide();
 
-	gtk_exit(0);
+	gtk_main_quit();
 }
 

Index: layers.c
===================================================================
RCS file: /cvs/cairo/roadster/src/layers.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- layers.c	3 Mar 2005 08:28:32 -0000	1.10
+++ layers.c	4 Mar 2005 04:06:35 -0000	1.11
@@ -110,12 +110,12 @@
 	//int i;
 
 	// Load style definition file
-	doc = xmlReadFile(PACKAGE_DATA_DIR"/data/layers.xml", NULL, 0);
-	if(doc == NULL) {
-		// try source directory if user hasn't done a 'make install' (good for development, too!)
-		doc = xmlReadFile(PACKAGE_SOURCE_DIR"/data/layers.xml", NULL, 0);
+	// try source directory first (good for development)
+	doc = xmlReadFile(PACKAGE_SOURCE_DIR"/data/layers.xml", NULL, 0);
+	if (doc == NULL) {
+		doc = xmlReadFile(PACKAGE_DATA_DIR"/data/layers.xml", NULL, 0);
 
-		if(doc == NULL) {
+		if (doc == NULL) {
 			g_message("cannot load file layers.xml\n");
 			gtk_exit(0);
 		}

Index: main.c
===================================================================
RCS file: /cvs/cairo/roadster/src/main.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- main.c	4 Mar 2005 02:27:29 -0000	1.10
+++ main.c	4 Mar 2005 04:06:35 -0000	1.11
@@ -28,59 +28,49 @@
 #include <gnome.h>
 #include "gui.h"
 #include "db.h"
-#include "mainwindow.h"
 #include "map.h"
-#include "import.h"
 #include "gpsclient.h"
-#include "locationset.h"
 #include "scenemanager.h"
-#include "point.h"
-#include "pointstring.h"
-#include "track.h"
 
 static gboolean main_init(void);
 static void main_deinit(void);
 
 int main (int argc, char *argv[])
 {
-	int ret;
 
 	#ifdef ENABLE_NLS
 		bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
 		textdomain(PACKAGE);
 	#endif
 
-//         g_thread_init(NULL);
-//         gdk_threads_init();
+//	g_thread_init(NULL);
+//	gdk_threads_init();
 
 	gnome_init(PACKAGE, VERSION, argc, argv);
 
-	if(!main_init()) {
+	if(!main_init())
 		return 1;
-	}
 
 	gui_run();
-	main_deinit();	// usually doesn't get here
+	main_deinit();
+
 	return 0;
 }
 
 gboolean main_init(void)
 {
 	// Initialize GLib thread system
-	// g_thread_init(NULL);
+	//g_thread_init(NULL);
 
 	if(!gnome_vfs_init()) {	
 		g_warning("gnome_vfs_init failed\n");
 		return FALSE;
 	}
+
 	gchar* pszApplicationDir = g_strdup_printf("%s/.roadster", g_get_home_dir());
-	if(GNOME_VFS_OK != gnome_vfs_make_directory(pszApplicationDir, 0700)) {
-		// no big deal, it probably exists.
-	}
+	gnome_vfs_make_directory(pszApplicationDir, 0700);
+	g_free(pszApplicationDir);
 
-	/*
-	** init our modules
-	*/
 	g_print("initializing points\n");
 	point_init();
 	g_print("initializing pointstrings\n");
@@ -96,7 +86,6 @@
 
 	g_print("initializing scenemanager\n");
 	scenemanager_init();
-	//geometryset_init();
 
 	g_print("initializing locationsets\n");
 	locationset_init();
@@ -120,6 +109,9 @@
 
 static void main_deinit(void)
 {
+	g_print("deinitializating database\n");
 	db_deinit();
 	// others?
+
+	g_print("deinitialization complete\n");
 }

Index: map.c
===================================================================
RCS file: /cvs/cairo/roadster/src/map.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- map.c	4 Mar 2005 02:27:29 -0000	1.15
+++ map.c	4 Mar 2005 04:06:35 -0000	1.16
@@ -53,6 +53,7 @@
 
 static gboolean map_data_load(map_t* pMap, maprect_t* pRect);
 static void map_data_clear(map_t* pMap);
+void map_get_render_metrics(map_t* pMap, rendermetrics_t* pMetrics);
 
 // Each zoomlevel has a scale and an optional name (name isn't used for anything)
 zoomlevel_t g_sZoomLevels[NUM_ZOOMLEVELS+1] = {




More information about the cairo-commit mailing list