You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Alexander A. <za...@us...> - 2007-10-30 11:31:16
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19175 Modified Files: transform.c Log Message: Use multiplication when transforming garmin coordinates Index: transform.c =================================================================== RCS file: /cvsroot/navit/navit/src/transform.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** transform.c 28 Oct 2007 11:00:55 -0000 1.6 --- transform.c 30 Oct 2007 11:31:15 -0000 1.7 *************** *** 32,40 **** } void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g) { - double f; - switch (pro) { case projection_mg: --- 32,41 ---- } + static const double gar2geo_units = 360.0/(1<<24); + static const double geo2gar_units = 1/(360.0/(1<<24)); + void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g) { switch (pro) { case projection_mg: *************** *** 43,49 **** break; case projection_garmin: ! f=360.0/(1<<24); ! g->lng=c->x*f; ! g->lat=c->y*f; break; default: --- 44,49 ---- break; case projection_garmin: ! g->lng=c->x*gar2geo_units; ! g->lat=c->y*gar2geo_units; break; default: *************** *** 55,60 **** transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c) { - double f; - switch (pro) { case projection_mg: --- 55,58 ---- *************** *** 63,69 **** break; case projection_garmin: ! f=360.0/(1<<24); ! c->x=g->lng/f; ! c->y=g->lat/f; break; default: --- 61,66 ---- break; case projection_garmin: ! c->x=g->lng*geo2gar_units; ! c->y=g->lat*geo2gar_units; break; default: |
From: Alexander A. <za...@us...> - 2007-10-29 09:52:46
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6750 Modified Files: Makefile.am gar2navit.c gar2navit.h garmin.c Added Files: gentypes.c Log Message: Make built-in garmin types, so you don't have to install garmintypes.txt in the maps direcotry Index: gar2navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/gar2navit.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gar2navit.h 25 Oct 2007 09:23:13 -0000 1.1 --- gar2navit.h 29 Oct 2007 09:52:45 -0000 1.2 *************** *** 29,30 **** --- 29,31 ---- char *g2n_get_descr(struct gar2nav_conv *c, int type, unsigned short id); int g2n_get_routable(struct gar2nav_conv *c, int type, unsigned short id); + struct gar2nav_conv *g2n_default_conv(void); Index: gar2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/gar2navit.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gar2navit.c 29 Oct 2007 07:17:09 -0000 1.4 --- gar2navit.c 29 Oct 2007 09:52:45 -0000 1.5 *************** *** 288,289 **** --- 288,291 ---- } #endif + + #include "g2nbuiltin.h" Index: garmin.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/garmin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** garmin.c 25 Oct 2007 19:00:14 -0000 1.2 --- garmin.c 29 Oct 2007 09:52:45 -0000 1.3 *************** *** 26,29 **** --- 26,32 ---- #include <string.h> #include <math.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> #include "plugin.h" #include "data.h" *************** *** 565,568 **** --- 568,573 ---- struct map_rect_priv *mr; + if (!map) + return NULL; mr = calloc(1, sizeof(*mr)); if (!mr) *************** *** 631,634 **** --- 636,640 ---- struct attr *data; char buf[PATH_MAX]; + struct stat st; data=attr_search(attrs, NULL, attr_data); *************** *** 655,672 **** return NULL; } snprintf(buf, sizeof(buf), "%s.types", m->filename); ! dlog(1, "Looking for types in %s\n", buf); ! m->conv = g2n_conv_load(buf); if (!m->conv) { ! char *cp; ! strcpy(buf, m->filename); ! cp = strrchr(buf ,'/'); ! if (cp) { ! cp ++; ! *cp = '\0'; ! strcat(buf, "garmintypes.txt"); ! dlog(1, "Looking for types in %s\n", buf); ! m->conv = g2n_conv_load(buf); ! } } if (!m->conv) { --- 661,673 ---- return NULL; } + m->conv = NULL; snprintf(buf, sizeof(buf), "%s.types", m->filename); ! if (!stat(buf, &st)) { ! dlog(1, "Loading custom types from %s\n", buf); ! m->conv = g2n_conv_load(buf); ! } if (!m->conv) { ! dlog(1, "Using builtin types\n"); ! m->conv = g2n_default_conv(); } if (!m->conv) { Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 25 Oct 2007 09:23:13 -0000 1.1 --- Makefile.am 29 Oct 2007 09:52:44 -0000 1.2 *************** *** 6,7 **** --- 6,21 ---- libdata_garmin_la_SOURCES = garmin.c garmin.h gar2navit.c gar2navit.h libdata_garmin_la_LIBADD = @LIBGARMIN_LIBS@ + nodist_libdata_garmin_la_SOURCES = g2nbuiltin.h + + gar2navit.l$(OBJEXT): g2nbuiltin.h + + CLEANFILES = g2nbuiltin.h + + noinst_PROGRAMS=gentypes + gentypes_SOURCES=gentypes.c + + g2nbuiltin.h: gentypes garmintypes.txt + ./gentypes garmintypes.txt g2nbuiltin.h + + EXTRA_DIST = garmintypes.txt + --- NEW FILE: gentypes.c --- /* Copyright (C) 2007 Alexander Atanasov <aat...@gm...> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Garmin and MapSource are registered trademarks or trademarks of Garmin Ltd. or one of its subsidiaries. */ /* Street's are routable by: ALL - by all W pedestrian (1<<0) B bycycle (1<<1) M motorcycle (1<<2) C car (1<<3) T truck (1<<4) L largetruck (1<<5) File format is: POINT 0x0100 = town_label_1e5, Megapolis (10M +) 0x0200 = town_label_5e4, Megapolis (5-10M) ... 0x1e00-0x1e3f = district_label, District, Province, State Name ... POLYLINE 0x00 = ALL, street_1_land, Road 0x01 = MCTL, highway_land, Major HWY thick 0x02 = MCTL, street_4_land, Principal HWY-thick 0x03 = MCTL, street_2_land, Principal HWY-medium .... POLYGONE 0x01 = town_poly, City (>200k) 0x02 = town_poly, City (<200k) 0x03 = town_poly, Village */ #include <stdio.h> #include <string.h> #include <malloc.h> #include <unistd.h> #include "item.h" #include "gar2navit.h" #define dlog(x, y...) fprintf(stderr, ## y) /* static int add_def(struct gar2nav_conv *conv, int type, unsigned short minid, unsigned short maxid, unsigned int routable, char *ntype, char *descr) */ static unsigned int get_rtmask(char *p) { char *cp; unsigned int mask = 0; cp = p; while (*cp) { if (!strcasecmp(cp, "none")) return 0; if (!strcasecmp(cp, "all")) { mask = ~0; break; } if (*cp == 'W') mask |= RT_PEDESTRIAN; else if (*cp == 'B') mask |= RT_BYCYCLE; else if (*cp == 'M') mask |= RT_MOTORCYCLE; else if (*cp == 'C') mask |= RT_CAR; else if (*cp == 'T') mask |= RT_TRUCK; else if (*cp == 'L') mask |= RT_LONGTRUCK; cp++; } return mask; } static void print_header(FILE *fp) { fprintf(fp, "// This is autogenerated file -- DO NOT EDIT\n"); fprintf(fp, "struct gar2nav_conv *g2n_default_conv(void)\n" "{\n" "\tstruct gar2nav_conv *conv;\n" "\n" "\tconv = calloc(1, sizeof(*conv));\n" "\tif (!conv)\n" "\t\treturn conv;\n"); } static int load_types_file(char *file, char *out) { char buf[4096]; char descr[4096]; char ntype[4096]; char rtby[4096]; FILE *fp; unsigned int minid, maxid, routable; int rc; int type = -1; FILE *fpout = stdout; fp = fopen(file, "r"); if (!fp) return -1; if (out) { fpout = fopen(out, "w"); if (!fpout) return -1; } print_header(fpout); while (fgets(buf, sizeof(buf), fp)) { if (*buf == '#' || *buf == '\n') continue; routable = 0; if (!strncasecmp(buf, "POINT", 5)) { type = 1; continue; } else if (!strncasecmp(buf, "POI", 3)) { type = 1; continue; } else if (!strncasecmp(buf, "POLYLINE", 8)) { type = 2; continue; } else if (!strncasecmp(buf, "POLYGONE", 8)) { type = 3; continue; } // assume only lines are routable if (type == 2) { rc = sscanf(buf, "0x%04X = %[^\t, ] , %[^\t, ], %[^\n]", &minid, rtby, ntype, descr); if (rc != 4) { dlog(1, "Invalid line rc=%d:[%s]\n",rc, buf); dlog(1, "minid=%04X ntype=[%s] des=[%s]\n", minid, ntype, descr); continue; } routable = get_rtmask(rtby); } else { rc = sscanf(buf, "0x%04X - 0x%04X = %[^\t , ] , %[^\n]", &minid, &maxid, ntype, descr); if (rc != 4) { maxid = 0; rc = sscanf(buf, "0x%04X = %[^\t, ], %[^\n]", &minid, ntype, descr); if (rc != 3) { dlog(1, "Invalid line rc=%d:[%s]\n",rc, buf); dlog(1, "minid=%04X ntype=[%s] des=[%s]\n", minid, ntype, descr); continue; } } } fprintf(fpout, "\tadd_def(conv, %d, %d, %d, %d, \"%s\", \"%s\");\n", type, minid, maxid, routable, ntype, descr); } fprintf(fpout, "\treturn conv;\n"); fprintf(fpout, "}\n"); fclose(fp); if (out) fclose(fpout); return 1; } int main(int argc, char **argv) { if (argc!=3) { fprintf(stderr, "Usage: %s garmintypes.txt outfile.c\n", argv[0]); return -1; } if (load_types_file(argv[1], argv[2]) < 0) unlink(argv[2]); return 0; } |
From: Zaxl <za...@us...> - 2007-10-29 07:17:07
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19291 Modified Files: gar2navit.c Log Message: Fix the rest of the id checks Index: gar2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/gar2navit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gar2navit.c 28 Oct 2007 19:37:17 -0000 1.3 --- gar2navit.c 29 Oct 2007 07:17:09 -0000 1.4 *************** *** 250,254 **** while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && def->maxid)) return def->routable; def = def->next; --- 250,254 ---- while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && id <= def->maxid)) return def->routable; def = def->next; *************** *** 273,277 **** while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && def->maxid)) return def->descr; def = def->next; --- 273,277 ---- while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && id <= def->maxid)) return def->descr; def = def->next; |
From: Zaxl <za...@us...> - 2007-10-28 19:38:02
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31286 Modified Files: gar2navit.c Log Message: Fix id range check Index: gar2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/gar2navit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gar2navit.c 25 Oct 2007 19:00:14 -0000 1.2 --- gar2navit.c 28 Oct 2007 19:37:17 -0000 1.3 *************** *** 221,225 **** while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && def->maxid)) return def->ntype; def = def->next; --- 221,225 ---- while (def) { if ((!def->maxid && def->id == id) || ! (def->id <= id && id <= def->maxid)) return def->ntype; def = def->next; |
From: Martin S. <mar...@us...> - 2007-10-28 11:01:14
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27385/src Modified Files: attr.c attr.h attr_def.h coord.c navigation.c route.c transform.c Log Message: Minor bugfixes Index: attr.c =================================================================== RCS file: /cvsroot/navit/navit/src/attr.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** attr.c 3 Oct 2007 20:15:57 -0000 1.8 --- attr.c 28 Oct 2007 11:00:52 -0000 1.9 *************** *** 13,17 **** static struct attr_name attr_names[]={ ! #define ATTR2(x,y) ATTR(x) #define ATTR(x) { attr_##x, #x }, #include "attr_def.h" --- 13,17 ---- static struct attr_name attr_names[]={ ! #define ATTR2(x,y) ATTR(y) #define ATTR(x) { attr_##x, #x }, #include "attr_def.h" Index: coord.c =================================================================== RCS file: /cvsroot/navit/navit/src/coord.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** coord.c 9 Oct 2007 18:14:27 -0000 1.6 --- coord.c 28 Oct 2007 11:00:53 -0000 1.7 *************** *** 173,182 **** lng-=g.lng*100; g.lng+=lng/60; transform_from_geo(pro, &g, c_ret); } ! if (debug) { ! printf("str='%s' x=%f ns=%c y=%f ew=%c c=%d\n", str, lng, ns, lat, ew, ret); ! printf("rest='%s'\n", str+ret); ! } } else { double lng, lat; --- 173,184 ---- lng-=g.lng*100; g.lng+=lng/60; + if (ns == 's' || ns == 'S') + g.lat=-g.lat; + if (ew == 'w' || ew == 'W') + g.lng=-g.lng; transform_from_geo(pro, &g, c_ret); } ! dbg(3,"str='%s' x=%f ns=%c y=%f ew=%c c=%d\n", str, lng, ns, lat, ew, ret); ! dbg(3,"rest='%s'\n", str+ret); } else { double lng, lat; Index: navigation.c =================================================================== RCS file: /cvsroot/navit/navit/src/navigation.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** navigation.c 9 Oct 2007 16:57:38 -0000 1.24 --- navigation.c 28 Oct 2007 11:00:53 -0000 1.25 *************** *** 630,637 **** printf("not on track\n"); rph=route_path_open(route); ! while((s=route_path_get_segment(rph))) { ! itm=navigation_itm_new(this_, route_path_segment_get_item(s),route_path_segment_get_start(s)); ! itm->time=route_path_segment_get_time(s); ! itm->length=route_path_segment_get_length(s); } if (end_flag) { --- 630,640 ---- printf("not on track\n"); rph=route_path_open(route); ! if (rph) { ! while((s=route_path_get_segment(rph))) { ! itm=navigation_itm_new(this_, route_path_segment_get_item(s),route_path_segment_get_start(s)); ! itm->time=route_path_segment_get_time(s); ! itm->length=route_path_segment_get_length(s); ! } ! route_path_close(rph); } if (end_flag) { *************** *** 644,648 **** } itm=navigation_itm_new(this_, NULL, NULL); - route_path_close(rph); make_maneuvers(this_); } --- 647,650 ---- Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** route.c 9 Oct 2007 19:03:06 -0000 1.18 --- route.c 28 Oct 2007 11:00:53 -0000 1.19 *************** *** 444,448 **** route_path_open(struct route *this) { ! struct route_path_handle *ret=g_new(struct route_path_handle, 1); ret->s=this->path2->path; --- 444,453 ---- route_path_open(struct route *this) { ! struct route_path_handle *ret; ! ! if (! this->path2 || ! this->path2->path) ! return NULL; ! ! ret=g_new(struct route_path_handle, 1); ret->s=this->path2->path; Index: transform.c =================================================================== RCS file: /cvsroot/navit/navit/src/transform.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** transform.c 19 Oct 2007 10:57:45 -0000 1.5 --- transform.c 28 Oct 2007 11:00:55 -0000 1.6 *************** *** 467,471 **** struct coord lp; if (count < 2) ! return 0; if (pos) *pos=0; --- 467,471 ---- struct coord lp; if (count < 2) ! return INT_MAX; if (pos) *pos=0; Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** attr_def.h 26 Oct 2007 13:03:16 -0000 1.10 --- attr_def.h 28 Oct 2007 11:00:53 -0000 1.11 *************** *** 2,9 **** /* common */ ! ATTR2(none,0x00000000) ATTR(any) ! ATTR2(type_item_begin,0x00010000) ATTR(town_streets_item) ATTR(street_name_item) --- 2,9 ---- /* common */ ! ATTR2(0x00000000,none) ATTR(any) ! ATTR2(0x00010000,type_item_begin) ATTR(town_streets_item) ATTR(street_name_item) *************** *** 12,18 **** ATTR(street_number_item) ATTR(item_type) ! ATTR2(type_item_end,0x0001ffff) ! ATTR2(type_int_begin,0x00020000) ATTR(h) ATTR(id) --- 12,18 ---- ATTR(street_number_item) ATTR(item_type) ! ATTR2(0x0001ffff,type_item_end) ! ATTR2(0x00020000,type_int_begin) ATTR(h) ATTR(id) *************** *** 25,31 **** /* boolean */ ATTR(overwrite) ! ATTR2(type_int_end,0x0002ffff) ! ATTR2(type_string_begin,0x00030000) ATTR(type) ATTR(label) --- 25,31 ---- /* boolean */ ATTR(overwrite) ! ATTR2(0x0002ffff,type_int_end) ! ATTR2(0x00030000,type_string_begin) ATTR(type) ATTR(label) *************** *** 59,61 **** ATTR(navigation_long_exact) ATTR(navigation_speech) ! ATTR2(type_string_end,0x0003ffff) --- 59,61 ---- ATTR(navigation_long_exact) ATTR(navigation_speech) ! ATTR2(0x0003ffff,type_string_end) Index: attr.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** attr.h 9 Oct 2007 16:55:22 -0000 1.8 --- attr.h 28 Oct 2007 11:00:52 -0000 1.9 *************** *** 11,15 **** enum attr_type { ! #define ATTR2(x,y) attr_##x=y, #define ATTR(x) attr_##x, #include "attr_def.h" --- 11,15 ---- enum attr_type { ! #define ATTR2(x,y) attr_##y=x, #define ATTR(x) attr_##x, #include "attr_def.h" |
From: KaZeR <ka...@us...> - 2007-10-26 21:49:55
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2763 Modified Files: wmcontrol.c wmcontrol.h Log Message: Fix wmcontrol Index: wmcontrol.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/wmcontrol.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wmcontrol.c 26 Oct 2007 21:46:50 -0000 1.1 --- wmcontrol.c 26 Oct 2007 21:49:58 -0000 1.2 *************** *** 81,87 **** static gboolean envir_utf8; ! int window_switch() { /* {{{ */ int opt; - int action = 0; int ret = EXIT_SUCCESS; int missing_option = 1; --- 81,86 ---- static gboolean envir_utf8; ! int window_switch(const char *windowName) { /* {{{ */ int opt; int ret = EXIT_SUCCESS; int missing_option = 1; *************** *** 93,103 **** setlocale(LC_ALL, ""); ! /* make "--help" and "--version" work. I don't want to use ! * getopt_long for portability reasons */ - options.param_window = "Amarok"; - action = 'a'; - - init_charset(); --- 92,98 ---- setlocale(LC_ALL, ""); ! options.param_window=malloc(strlen(windowName)); ! strncpy(options.param_window,windowName,strlen(windowName)); init_charset(); *************** *** 106,150 **** return EXIT_FAILURE; } ! ! switch (action) { ! case 'l': ! ret = list_windows(disp); ! break; ! case 'd': ! ret = list_desktops(disp); ! break; ! case 's': ! ret = switch_desktop(disp); ! break; ! case 'm': ! ret = wm_info(disp); ! break; ! case 'a': case 'c': case 'R': ! case 't': case 'e': case 'b': case 'N': case 'I': case 'T': ! if (! options.param_window) { ! fputs("No window was specified.\n", stderr); ! return EXIT_FAILURE; ! } ! if (options.match_by_id) { ! ret = action_window_pid(disp, action); ! } ! else { ! ret = action_window_str(disp, action); ! } ! break; ! case 'k': ! ret = showing_desktop(disp); ! break; ! case 'o': ! ret = change_viewport(disp); ! break; ! case 'n': ! ret = change_number_of_desktops(disp); ! break; ! case 'g': ! ret = change_geometry(disp); ! break; } ! XCloseDisplay(disp); return ret; --- 101,109 ---- return EXIT_FAILURE; } ! if (! options.param_window) { ! fputs("No window was specified.\n", stderr); ! return EXIT_FAILURE; } ! ret = action_window_str(disp, 'a'); XCloseDisplay(disp); return ret; *************** *** 774,778 **** if (activate) { ! return action_window(disp, activate, mode); } else { --- 733,737 ---- if (activate) { ! return action_window(disp, activate, mode); } else { Index: wmcontrol.h =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/wmcontrol.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wmcontrol.h 26 Oct 2007 21:46:50 -0000 1.1 --- wmcontrol.h 26 Oct 2007 21:49:58 -0000 1.2 *************** *** 2,7 **** extern "C" { #endif ! int window_switch(); #ifdef __cplusplus } ! #endif \ No newline at end of file --- 2,7 ---- extern "C" { #endif ! int window_switch(const char *windowName); #ifdef __cplusplus } ! #endif |
From: KaZeR <ka...@us...> - 2007-10-26 21:46:48
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1427 Added Files: wmcontrol.c wmcontrol.h Log Message: Added wcontrol for nghost switching --- NEW FILE: wmcontrol.c --- // This is loosely based upon wmctrl 1.07. #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <string.h> #include <locale.h> #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/cursorfont.h> #include <X11/Xmu/WinUtil.h> #include <glib.h> #include "wmcontrol.h" #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ #define _NET_WM_STATE_ADD 1 /* add/set property */ [...1254 lines suppressed...] return(target_win); }/*}}}*/ static Window get_active_window(Display *disp) {/*{{{*/ char *prop; unsigned long size; Window ret = (Window)0; prop = get_property(disp, DefaultRootWindow(disp), XA_WINDOW, "_NET_ACTIVE_WINDOW", &size); if (prop) { ret = *((Window*)prop); g_free(prop); } return(ret); }/*}}}*/ --- NEW FILE: wmcontrol.h --- #ifdef __cplusplus extern "C" { #endif int window_switch(); #ifdef __cplusplus } #endif |
From: KaZeR <ka...@us...> - 2007-10-26 21:35:22
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29123 Modified Files: configure.in Log Message: Fixed a bugged test on cegui libs when it isn't even available Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** configure.in 25 Oct 2007 20:38:54 -0000 1.36 --- configure.in 26 Oct 2007 21:35:22 -0000 1.37 *************** *** 88,91 **** --- 88,92 ---- AC_SUBST(SDL_LIBS) + #FIXME : the following does not seem to be parsed AC_PREPROC_IFELSE( CEGUI/CEGUI.h, *************** *** 100,103 **** --- 101,108 ---- exit 1 ) + + if test x"$sdl" = xyes + then + # For CEGUI, we have to check the presence of some libraries. # The following are mandatory (used by navit) *************** *** 140,143 **** --- 145,149 ---- echo "LIBS : $CEGUI_LIBS" + fi AC_SUBST(CEGUI_CFLAGS) |
From: KaZeR <ka...@us...> - 2007-10-26 16:34:23
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22880/gui/sdl Modified Files: Makefile.am gui_sdl_window.cpp sdl_events.cpp sdl_events.h Log Message: Added a button to switch from navit to nghost Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 3 Oct 2007 13:57:01 -0000 1.7 --- Makefile.am 26 Oct 2007 16:34:25 -0000 1.8 *************** *** 3,6 **** AM_CPPFLAGS = @NAVIT_CFLAGS@ @CEGUI_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"gui_sdl\" modulegui_LTLIBRARIES = libgui_sdl.la ! libgui_sdl_la_SOURCES = gui_sdl_window.cpp sdl_events.cpp gui_sdl.h sdl_events.h libgui_sdl_la_LIBADD = @SDL_LIBS@ @CEGUI_LIBS@ @OPENGL_LIBS@ @GLC_LIBS@ --- 3,6 ---- AM_CPPFLAGS = @NAVIT_CFLAGS@ @CEGUI_CFLAGS@ @GLC_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"gui_sdl\" modulegui_LTLIBRARIES = libgui_sdl.la ! libgui_sdl_la_SOURCES = gui_sdl_window.cpp sdl_events.cpp gui_sdl.h sdl_events.h wmcontrol.c wmcontrol.h libgui_sdl_la_LIBADD = @SDL_LIBS@ @CEGUI_LIBS@ @OPENGL_LIBS@ @GLC_LIBS@ Index: gui_sdl_window.cpp =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/gui_sdl_window.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** gui_sdl_window.cpp 26 Oct 2007 13:03:16 -0000 1.22 --- gui_sdl_window.cpp 26 Oct 2007 16:34:25 -0000 1.23 *************** *** 28,31 **** --- 28,32 ---- #include "sdl_events.h" + #include "wmcontrol.h" #define VM_2D 0 *************** *** 664,667 **** --- 665,669 ---- CEGUI::WindowManager::getSingleton().getWindow("OSD/RoadbookButton")->setText(_("RoadBook")); + CEGUI::WindowManager::getSingleton().getWindow("OSD/nGhostButton")->subscribeEvent(PushButton::EventClicked, Event::Subscriber(Switch_to_nGhost)); // this one is maybe not needed anymore CEGUI::WindowManager::getSingleton().getWindow("OSD/RoadbookButton2")->subscribeEvent(PushButton::EventClicked, Event::Subscriber(RoadBookSwitch)); Index: sdl_events.cpp =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/sdl_events.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** sdl_events.cpp 6 Sep 2007 16:21:57 -0000 1.7 --- sdl_events.cpp 26 Oct 2007 16:34:25 -0000 1.8 *************** *** 14,17 **** --- 14,19 ---- #include "search.h" + // Library for window switching (-> nGhost) + #include "wmcontrol.h" *************** *** 423,426 **** --- 425,439 ---- } + bool Switch_to_nGhost(const CEGUI::EventArgs& event) + { + printf("Switching to nGhost\n"); + if (window_switch("Nanonymous")==EXIT_FAILURE) + { + popen("nghost","r"); + } + + } + + bool RoadBookSwitch(const CEGUI::EventArgs& event) { Index: sdl_events.h =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/sdl_events.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sdl_events.h 4 Jul 2007 22:44:45 -0000 1.2 --- sdl_events.h 26 Oct 2007 16:34:25 -0000 1.3 *************** *** 16,19 **** --- 16,20 ---- bool DestinationEntryChange(const CEGUI::EventArgs& event); bool DialogWindowSwitch(const CEGUI::EventArgs& event); + bool Switch_to_nGhost(const CEGUI::EventArgs& event); bool RoadBookSwitch(const CEGUI::EventArgs& event); bool ButtonGo(const CEGUI::EventArgs& event); |
From: KaZeR <ka...@us...> - 2007-10-26 16:34:23
|
Update of /cvsroot/navit/navit/src/gui/sdl/datafiles/layouts In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22880/gui/sdl/datafiles/layouts Modified Files: TaharezLook.layout Log Message: Added a button to switch from navit to nghost Index: TaharezLook.layout =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/datafiles/layouts/TaharezLook.layout,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaharezLook.layout 5 Sep 2007 14:53:44 -0000 1.2 --- TaharezLook.layout 26 Oct 2007 16:34:26 -0000 1.3 *************** *** 134,137 **** --- 134,143 ---- <Property Name="UnifiedAreaRect" Value="{{0.8,0},{0.41,0},{0.99,0},{0.51,0}}" /> </Window> + <Window Type="TaharezLook/Button" Name="OSD/nGhostButton" > + <Property Name="Text" Value="nGhost" /> + <Property Name="Visible" Value="True" /> + <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> + <Property Name="UnifiedAreaRect" Value="{{0.8,0},{0.51,0},{0.99,0},{0.56,0}}" /> + </Window> <Window Type="TaharezLook/LargeVerticalScrollbar" Name="OSD/Scrollbar1" > *************** *** 142,146 **** <Property Name="UnifiedMaxSize" Value="{{0.03,0},{1,0}}" /> <Property Name="UnifiedMinSize" Value="{{0.01,0},{0.1,0}}" /> ! <Property Name="UnifiedAreaRect" Value="{{0.94,0},{0.53,0},{0.99,0},{0.85,0}}" /> </Window> --- 148,152 ---- <Property Name="UnifiedMaxSize" Value="{{0.03,0},{1,0}}" /> <Property Name="UnifiedMinSize" Value="{{0.01,0},{0.1,0}}" /> ! <Property Name="UnifiedAreaRect" Value="{{0.94,0},{0.58,0},{0.99,0},{0.85,0}}" /> </Window> |
From: KaZeR <ka...@us...> - 2007-10-26 13:03:15
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18594/gui/sdl Modified Files: gui_sdl_window.cpp Log Message: Fixes segfault and add a fullscreen option to navit.xml for sdl gui Index: gui_sdl_window.cpp =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/gui_sdl_window.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gui_sdl_window.cpp 24 Oct 2007 21:49:18 -0000 1.21 --- gui_sdl_window.cpp 26 Oct 2007 13:03:16 -0000 1.22 *************** *** 399,405 **** using namespace CEGUI; ! char button_name [5]; ! sprintf(button_name,"%s",key); ! FrameWindow* wnd = (FrameWindow*)WindowManager::getSingleton().createWindow("TaharezLook/Button", button_name); CEGUI::WindowManager::getSingleton().getWindow("Navit/Keyboard")->addChildWindow(wnd); wnd->setPosition(UVector2(cegui_absdim(x), cegui_absdim( y))); --- 399,405 ---- using namespace CEGUI; ! // char button_name [5]; ! // sprintf(button_name,"%s",key); ! FrameWindow* wnd = (FrameWindow*)WindowManager::getSingleton().createWindow("TaharezLook/Button", key); CEGUI::WindowManager::getSingleton().getWindow("Navit/Keyboard")->addChildWindow(wnd); wnd->setPosition(UVector2(cegui_absdim(x), cegui_absdim( y))); *************** *** 478,482 **** } ! static void init_sdlgui(char * skin_layout) { SDL_Surface * screen; --- 478,482 ---- } ! static void init_sdlgui(char * skin_layout,int fullscreen) { SDL_Surface * screen; *************** *** 522,526 **** exit (1); } ! SDL_ShowCursor (SDL_ENABLE); SDL_EnableUNICODE (1); --- 522,528 ---- exit (1); } ! if(fullscreen){ ! SDL_WM_ToggleFullScreen(screen); ! } SDL_ShowCursor (SDL_ENABLE); SDL_EnableUNICODE (1); *************** *** 757,768 **** this_=g_new0(struct gui_priv, 1); ! struct attr *data=attr_search(attrs, NULL, attr_skin); ! if(data){ ! init_sdlgui(data->u.str); } else { g_warning("Warning, no skin set for <sdl> in navit.xml. Using default one"); ! init_sdlgui("TaharezLook"); } dbg(1,"End SDL init\n"); --- 759,781 ---- this_=g_new0(struct gui_priv, 1); + int fullscreen=0; ! struct attr *fullscreen_setting=attr_search(attrs, NULL, attr_fullscreen); ! if(fullscreen_setting){ ! fullscreen=1; ! printf("fullscreen\n"); ! } else { ! fullscreen=0; ! printf("Normal screen\n"); ! } ! ! struct attr *skin_setting=attr_search(attrs, NULL, attr_skin); ! if(skin_setting){ ! init_sdlgui(skin_setting->u.str,fullscreen); } else { g_warning("Warning, no skin set for <sdl> in navit.xml. Using default one"); ! init_sdlgui("TaharezLook",fullscreen); } + dbg(1,"End SDL init\n"); |
From: KaZeR <ka...@us...> - 2007-10-26 13:03:15
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18594 Modified Files: attr_def.h Log Message: Fixes segfault and add a fullscreen option to navit.xml for sdl gui Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** attr_def.h 9 Oct 2007 18:14:27 -0000 1.9 --- attr_def.h 26 Oct 2007 13:03:16 -0000 1.10 *************** *** 49,52 **** --- 49,53 ---- ATTR(open_hours) ATTR(skin) + ATTR(fullscreen) /* poi */ ATTR(icon) |
From: KaZeR <ka...@us...> - 2007-10-25 20:38:55
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3986 Modified Files: configure.in Log Message: Added a check for cegui libraries Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** configure.in 25 Oct 2007 09:34:15 -0000 1.35 --- configure.in 25 Oct 2007 20:38:54 -0000 1.36 *************** *** 95,99 **** Define to 1 if you have the <CEGUI/CEGUI.h> header file. ) - CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUISILLYImageCodec -lCEGUIExpatParser -lCEGUIFalagardWRBase" CEGUI_CFLAGS="-I /usr/local/include/CEGUI -I /usr/include/CEGUI" cegui=yes, --- 95,98 ---- *************** *** 101,104 **** --- 100,144 ---- exit 1 ) + # For CEGUI, we have to check the presence of some libraries. + # The following are mandatory (used by navit) + # If the user installed NavIt without, issue a warning and disable CEGUI + AC_CHECK_LIB(CEGUIBase, main, + [], + [ + echo "Error! Something is wrong with CEGUIBase." + exit -1 + ]) + AC_CHECK_LIB(CEGUIOpenGLRenderer, OpenGLRendererdoRender, + [], + [ + echo "Error! Something is wrong with CEGUIOpenGLRenderer." + #exit -1 + ]) + AC_CHECK_LIB(CEGUIFalagardWRBase, main, + [], + [ + echo "Error! Something is wrong with CEGUIFalagardWRBase." + exit -1 + ]) + CEGUI_LIBS="-lCEGUIBase -lCEGUIOpenGLRenderer -lCEGUIFalagardWRBase" + + # The following are optionnal, but we need to link against them if cegui was built with them + AC_CHECK_LIB(CEGUISILLYImageCodec, main, + [CEGUI_LIBS="$CEGUI_LIBS -lCEGUISILLYImageCodec"], + [echo "CEGUISILLYImageCodec not found/not working, disabled."] + ) + + AC_CHECK_LIB(CEGUIExpatParser, main, + [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIExpatParser"], + [echo "CEGUIExpatParser not found/not working, disabled."] + ) + + AC_CHECK_LIB(CEGUIDevILImageCodec, main, + [CEGUI_LIBS="$CEGUI_LIBS -lCEGUIDevILImageCodec"], + [echo "CEGUIDevILImageCodec not found/not working, disabled."] + ) + + echo "LIBS : $CEGUI_LIBS" + AC_SUBST(CEGUI_CFLAGS) AC_SUBST(CEGUI_LIBS) *************** *** 306,310 **** if test x"$sdl" = xyes then ! echo "SDL gui : ENABLED" else echo "SDL gui : DISABLED : you are missing a dependency" --- 346,350 ---- if test x"$sdl" = xyes then ! echo "SDL gui : ENABLED, with $CEGUI_LIBS" else echo "SDL gui : DISABLED : you are missing a dependency" |
From: Zaxl <za...@us...> - 2007-10-25 19:01:01
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9513 Modified Files: gar2navit.c garmin.c Log Message: Add GPL header and Garmin trademarks Index: gar2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/gar2navit.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gar2navit.c 25 Oct 2007 09:23:13 -0000 1.1 --- gar2navit.c 25 Oct 2007 19:00:14 -0000 1.2 *************** *** 1,3 **** --- 1,25 ---- /* + Copyright (C) 2007 Alexander Atanasov <aat...@gm...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301 USA + + Garmin and MapSource are registered trademarks or trademarks + of Garmin Ltd. or one of its subsidiaries. + + */ + + /* Street's are routable by: ALL - by all Index: garmin.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/garmin/garmin.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** garmin.c 25 Oct 2007 09:23:14 -0000 1.1 --- garmin.c 25 Oct 2007 19:00:14 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + /* + Copyright (C) 2007 Alexander Atanasov <aat...@gm...> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301 USA + + Garmin and MapSource are registered trademarks or trademarks + of Garmin Ltd. or one of its subsidiaries. + + */ + #include <glib.h> #include <stdlib.h> |
From: KaZeR <ka...@us...> - 2007-10-25 14:51:12
|
Update of /cvsroot/navit/navit/src/graphics/gtk_drawing_area In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15307/graphics/gtk_drawing_area Modified Files: graphics_gtk_drawing_area.c Log Message: Added Liberation as default font, and a new font path Index: graphics_gtk_drawing_area.c =================================================================== RCS file: /cvsroot/navit/navit/src/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** graphics_gtk_drawing_area.c 29 Aug 2007 18:32:14 -0000 1.17 --- graphics_gtk_drawing_area.c 25 Oct 2007 14:51:08 -0000 1.18 *************** *** 61,70 **** } ! static char *fontlist[]={ ! "/usr/X11R6/lib/X11/fonts/msttcorefonts/arial.ttf", ! "/usr/X11R6/lib/X11/fonts/truetype/arial.ttf", ! "/usr/share/fonts/truetype/msttcorefonts/arial.ttf", ! "/usr/share/fonts/ttf/arial.ttf", ! "/usr/share/fonts/corefonts/arial.ttf", NULL, }; --- 61,71 ---- } ! static char *fontpaths[]={ ! "/usr/X11R6/lib/X11/fonts/msttcorefonts", ! "/usr/X11R6/lib/X11/fonts/truetype", ! "/usr/share/fonts/truetype", ! "/usr/share/fonts/truetype/msttcorefonts", ! "/usr/share/fonts/ttf", ! "/usr/share/fonts/corefonts", NULL, }; *************** *** 95,99 **** static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { ! char **filename=fontlist; struct graphics_font_priv *font=g_new(struct graphics_font_priv, 1); --- 96,102 ---- static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { ! char **filename=fontpaths; ! char fontpath [256]; ! struct graphics_font_priv *font=g_new(struct graphics_font_priv, 1); *************** *** 104,110 **** gr->library_init=1; } ! ! while (*filename) { ! if (!FT_New_Face( gr->library, *filename, 0, &font->face )) break; filename++; --- 107,120 ---- gr->library_init=1; } ! while (*filename) { ! // Trying the Liberation font first ! sprintf(fontpath,"%s/LiberationSans-Regular.ttf",*filename); ! dbg(1,("font : %s\n",fontpath)); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! //Fallback to arial.ttf, in the same path ! sprintf(fontpath,"%s/arial.ttf",*filename); ! dbg(1,("font : %s\n",fontpath)); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) break; filename++; |
From: KaZeR <ka...@us...> - 2007-10-25 14:49:16
|
Update of /cvsroot/navit/navit/src/plugins/poi_geodownload In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14405 Modified Files: poi.c Log Message: Removed old hardcoded paths Index: poi.c =================================================================== RCS file: /cvsroot/navit/navit/src/plugins/poi_geodownload/poi.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** poi.c 12 Mar 2007 17:11:37 -0000 1.4 --- poi.c 25 Oct 2007 14:49:17 -0000 1.5 *************** *** 553,603 **** plugin_register_draw(plugin_draw); mdb_init(); - // load_poi("/home/martin/map/work/data/1/GEO00001.MDB", - // "/home/martin/map/work/data/1/_MCDNLDS.BMP",0); - // load_poi("/home/martin/map/work/data/2/GEO00001.MDB", - // "/home/martin/map/work/data/2/_BURKING.BMP",0); - // load_poi("/home/martin/map/work/data/3/GEO00001.MDB", - // "/home/martin/map/work/data/3/_PIZZHUT.BMP",0); - // load_poi("/home/martin/map/work/data/4/GEO00001.MDB", - // "/home/martin/map/work/data/4/_CHICKEN.BMP",0); - // load_poi("/home/martin/map/work/data/5/GEO00001.MDB", - // "/home/martin/map/work/data/5/_WIENERW.BMP",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/bahn.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/bahn.adr/BAHN.BMP",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/cinmus.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/cinmus.adr/_Kinocen.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/fsight.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/fsight.adr/_sehensw.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/erlbns.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/erlbns.adr/_Freizei.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/faehre.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/faehre.adr/_Faehren.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/fenter.adr/GEO00001.MDB", - // "/opt/reiseplaner/travel/prog.mov/fenter.adr/_casino.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/vhotel.adr/Geo00001.mdb", - // "/opt/reiseplaner/travel/prog.mov/vhotel.adr/Vhotel.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/prog.mov/vgast.adr/Geo00001.mdb", - // "/opt/reiseplaner/travel/prog.mov/vgast.adr/Vgast.BMP",0); - // load_poi - // ("/opt/reiseplaner/travel/address/p_ceu.adr/p_ceu.mdb", - // "/opt/reiseplaner/travel/address/p_ceu.adr/p_ceu.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/address/p_eeu.adr/p_eeu.mdb", - // "/opt/reiseplaner/travel/address/p_eeu.adr/P_eeu.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/address/p_heu.adr/p_heu.mdb", - // "/opt/reiseplaner/travel/address/p_heu.adr/p_heu.bmp",0); - // load_poi - // ("/opt/reiseplaner/travel/address/p_ieu.adr/p_ieu.mdb", - // "/opt/reiseplaner/travel/address/p_ieu.adr/P_ieu.bmp",0); - struct dirent *lecture; --- 553,556 ---- |
From: KaZeR <ka...@us...> - 2007-10-25 09:34:14
|
Update of /cvsroot/navit/navit/src/data In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8719/src/data Modified Files: Makefile.am Log Message: Added zaxl patches for libgarmin Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/src/data/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 3 Oct 2007 20:15:57 -0000 1.4 --- Makefile.am 25 Oct 2007 09:34:15 -0000 1.5 *************** *** 1 **** --- 1,5 ---- SUBDIRS=mg textfile garmin_img poi_geodownload binfile + if HAVELIBGARMIN + SUBDIRS+=garmin + endif + |
From: KaZeR <ka...@us...> - 2007-10-25 09:34:14
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8719 Modified Files: configure.in Log Message: Added zaxl patches for libgarmin Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** configure.in 24 Oct 2007 21:22:11 -0000 1.34 --- configure.in 25 Oct 2007 09:34:15 -0000 1.35 *************** *** 143,146 **** --- 143,152 ---- AM_CONDITIONAL(VEHICLE_GPSD, [test "x$gpsd" = "xyes"]) + # check for libgarmin + PKG_CHECK_MODULES(LIBGARMIN, libgarmin, use_libgarmin=yes, use_libgarmin=no) + AC_SUBST(LIBGARMIN_CFLAGS) + AC_SUBST(LIBGARMIN_LIBS) + AM_CONDITIONAL(HAVELIBGARMIN, [test "x$use_libgarmin" = "xyes"]) + AC_ARG_ENABLE(binding-python, [ --disable-binding-python don't create binding python ], MODULE_BINDING_PYTHON=$enableval, MODULE_BINDING_PYTHON=yes) if test "$cross_compiling" = no; then *************** *** 246,250 **** AC_SUBST(VERSION) ! AC_OUTPUT([ Makefile src/Makefile --- 252,256 ---- AC_SUBST(VERSION) ! AC_CONFIG_FILES([ Makefile src/Makefile *************** *** 280,283 **** --- 286,298 ---- po/Makefile ]) + + if test -d src/data/garmin; then + if test "x$use_libgarmin" = "xyes"; then + AC_CONFIG_FILES([src/data/garmin/Makefile]) + fi + fi + AC_OUTPUT + + echo "" echo "" *************** *** 307,310 **** --- 322,331 ---- echo "SPEECHD : DISABLED" fi + if test "x$use_libgarmin" = "xyes" + then + echo "Garmin IMG : ENABLED" + else + echo "Garmin IMG : DISABLED (you don't have libgarmin)" + fi if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ] then |
From: KaZeR <ka...@us...> - 2007-10-25 09:34:13
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8719/src Modified Files: item_def.h Log Message: Added zaxl patches for libgarmin Index: item_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/item_def.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** item_def.h 9 Oct 2007 18:14:27 -0000 1.8 --- item_def.h 25 Oct 2007 09:34:15 -0000 1.9 *************** *** 95,98 **** --- 95,198 ---- ITEM(poi_mcdonalds) ITEM(poi_wienerwald) + ITEM(poi_dining) + ITEM(poi_fastfood) + ITEM(poi_police) + ITEM(poi_auto_club) + ITEM(poi_autoservice) + ITEM(poi_bank) + ITEM(poi_bay) + ITEM(poi_bend) + ITEM(poi_boat_ramp) + ITEM(poi_border_station) + ITEM(poi_bowling) + ITEM(poi_bus_station) + ITEM(poi_bus_stop) + ITEM(poi_bussines_service) + ITEM(poi_car_rent) + ITEM(poi_car_wash) + ITEM(poi_casino) + ITEM(poi_cemetery) + ITEM(poi_church) + ITEM(poi_cinema) + ITEM(poi_civil) + ITEM(poi_communication) + ITEM(poi_concert) + ITEM(poi_cove) + ITEM(poi_crossing) + ITEM(poi_dam) + ITEM(poi_danger_area) + ITEM(poi_dangerous) + ITEM(poi_daymark) + ITEM(poi_diving) + ITEM(poi_drinking_water) + ITEM(poi_emergency) + ITEM(poi_fair) + ITEM(poi_firebrigade) + ITEM(poi_fish) + ITEM(poi_forbiden_area) + ITEM(poi_garmin) + ITEM(poi_golf) + ITEM(poi_goverment_building) + ITEM(poi_height) + ITEM(poi_heliport) + ITEM(poi_hotspring) + ITEM(poi_icesport) + ITEM(poi_information) + ITEM(poi_justice) + ITEM(poi_landmark) + ITEM(poi_levee) + ITEM(poi_library) + ITEM(poi_locale) + ITEM(poi_loudspeaker) + ITEM(poi_mall) + ITEM(poi_manmade_feature) + ITEM(poi_marine) + ITEM(poi_marine_type) + ITEM(poi_mark) + ITEM(poi_military) + ITEM(poi_mine) + ITEM(poi_nondangerous) + ITEM(poi_oil_field) + ITEM(poi_personal_service) + ITEM(poi_pharmacy) + ITEM(poi_post) + ITEM(poi_public_office) + ITEM(poi_repair_service) + ITEM(poi_resort) + ITEM(poi_rest_room) + ITEM(poi_restaurant) + ITEM(poi_restricted_area) + ITEM(poi_restroom) + ITEM(poi_sailing) + ITEM(poi_scenic_area) + ITEM(poi_school) + ITEM(poi_service) + ITEM(poi_shop_apparel) + ITEM(poi_shop_computer) + ITEM(poi_shop_department) + ITEM(poi_shop_furnish) + ITEM(poi_shop_grocery) + ITEM(poi_shop_handg) + ITEM(poi_shop_merchandise) + ITEM(poi_shop_retail) + ITEM(poi_shower) + ITEM(poi_skiing) + ITEM(poi_social_service) + ITEM(poi_sounding) + ITEM(poi_sport) + ITEM(poi_stadium) + ITEM(poi_subdivision) + ITEM(poi_swimming) + ITEM(poi_telephone) + ITEM(poi_theater) + ITEM(poi_tide) + ITEM(poi_tower) + ITEM(poi_trail) + ITEM(poi_truck_stop) + ITEM(poi_tunnel) + ITEM(poi_wine) + ITEM(poi_worship) + ITEM(poi_wrecker) + ITEM(poi_zoo) ITEM2(0x80000000,line) ITEM2(0x80000001,line_unspecified) *************** *** 123,126 **** --- 223,237 ---- ITEM(height_line_2) ITEM(track) + ITEM(height_line_3) + ITEM(depth_line_1) + ITEM(depth_line_2) + ITEM(depth_line_3) + ITEM(powerline) + ITEM(pipeline) + ITEM(time_zone) + ITEM(marine_boundary) + ITEM(marine_hazard) + ITEM(roundabout) + /* Area */ ITEM2(0xc0000000,area) *************** *** 144,145 **** --- 255,262 ---- ITEM(national_park) ITEM(nature_park) + ITEM(flats) + ITEM(scrub) + ITEM(military_zone) + ITEM(marine_poly) + ITEM(plantation) + ITEM(tundra) |
From: Zaxl <za...@us...> - 2007-10-25 09:23:14
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7402 Added Files: Makefile.am gar2navit.c gar2navit.h garmin.c garmin.h garmintypes.txt Log Message: Add garmin driver --- NEW FILE: garmin.h --- #define dlog(x,y ...) logfn(__FILE__,__LINE__,x, ##y) #ifdef HARDDEBUG #define ddlog(x,y ...) logfn(__FILE__,__LINE__,x, ##y) #else #define ddlog(x,y ...) #endif extern int garmin_debug; void logfn(char *file, int line, int level, char *fmt, ...); --- NEW FILE: garmin.c --- #include <glib.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include "plugin.h" #include "data.h" #include "projection.h" #include "map.h" #include "maptype.h" #include "item.h" #include "attr.h" #include "coord.h" #include "transform.h" #include <stdio.h> #include "attr.h" #include "coord.h" #include <libgarmin.h> #include "garmin.h" #include "gar2navit.h" static int map_id; struct map_priv { int id; char *filename; struct gar2nav_conv *conv; struct gar *g; }; struct map_rect_priv { int id; struct coord_rect r; char *label; // FIXME: Register all strings for searches int limit; struct map_priv *mpriv; struct gmap *gmap; struct gobject *cobj; struct gobject *objs; struct item item; unsigned int last_coord; void *last_itterated; struct coord last_c; void *last_oattr; unsigned int last_attr; }; int garmin_debug = 10; void logfn(char *file, int line, int level, char *fmt, ...) { va_list ap; if (level > garmin_debug) return; va_start(ap, fmt); fprintf(stdout, "%s:%d:%d|", file, line, level); vfprintf(stdout, fmt, ap); va_end(ap); } // need a base map and a map struct gscale { char *label; float scale; int bits; }; static struct gscale mapscales[] = { {"7000 km", 70000.0, 8} ,{"5000 km", 50000.0, 8} ,{"3000 km", 30000.0, 9} ,{"2000 km", 20000.0, 9} ,{"1500 km", 15000.0, 10} ,{"1000 km", 10000.0, 10} ,{"700 km", 7000.0, 11} ,{"500 km", 5000.0, 11} ,{"300 km", 3000.0, 13} ,{"200 km", 2000.0, 13} ,{"150 km", 1500.0, 13} ,{"100 km", 1000.0, 14} ,{"70 km", 700.0, 15} ,{"50 km", 500.0, 16} ,{"30 km", 300.0, 16} ,{"20 km", 200.0, 17} ,{"15 km", 150.0, 17} ,{"10 km", 100.0, 18} ,{"7 km", 70.0, 18} ,{"5 km", 50.0, 19} ,{"3 km", 30.0, 19} ,{"2 km", 20.0, 20} ,{"1.5 km", 15.0, 22} ,{"1 km", 10.0, 24} ,{"700 m", 7.0, 24} ,{"500 m", 5.0, 24} ,{"300 m", 3.0, 24} ,{"200 m", 2.0, 24} ,{"150 m", 1.5, 24} ,{"100 m", 1.0, 24} ,{"70 m", 0.7, 24} ,{"50 m", 0.5, 24} ,{"30 m", 0.3, 24} ,{"20 m", 0.2, 24} ,{"15 m", 0.1, 24} ,{"10 m", 0.15, 24} }; static int garmin_object_label(struct gobject *o, struct attr *attr) { struct map_rect_priv *mr = o->priv_data; if (!mr) { dlog(1, "Error object do not have priv_data!!\n"); return 0; } if (mr->label) free(mr->label); mr->label = gar_get_object_lbl(o); #warning FIXME Process label and give only the visible part if (mr->label) { char *cp = mr->label; if (*mr->label == '@' || *mr->label == '^') cp++; attr->u.str = cp; return 1; } return 0; } static int garmin_object_debug(struct gobject *o, struct attr *attr) { struct map_rect_priv *mr = o->priv_data; if (!mr) { dlog(1, "Error object do not have priv_data!!\n"); return 0; } if (mr->label) free(mr->label); mr->label = gar_object_debug_str(o); if (mr->label) { attr->u.str = mr->label; return 1; } return 0; } static struct map_search_priv * gmap_search_new(struct map_priv *map, struct item *item, struct attr *search, int partial) { return NULL; } static void gmap_search_destroy(struct map_search_priv *ms) { } static struct item * gmap_search_get_item(struct map_search_priv *ms) { return NULL; } /* Assumes that only one item will be itterated at time! */ static void coord_rewind(void *priv_data) { struct gobject *g = priv_data; struct map_rect_priv *mr = g->priv_data; mr->last_coord = 0; }; static void attr_rewind(void *priv_data) { struct gobject *g = priv_data; struct map_rect_priv *mr = g->priv_data; mr->last_attr = 0; }; static int point_coord_get(void *priv_data, struct coord *c, int count) { struct gobject *g = priv_data; struct map_rect_priv *mr = g->priv_data; struct gcoord gc; if (!count) return 0; if (g != mr->last_itterated) { mr->last_itterated = g; mr->last_coord = 0; } if (mr->last_coord > 0) return 0; gar_get_object_coord(mr->gmap, g, &gc); c->x = gc.x; c->y = gc.y; mr->last_coord++; // dlog(1,"point: x=%d y=%d\n", c->x, c->y); // dlog(1, "point: x=%f y=%f\n", GARDEG(c->x), GARDEG(c->y)); return 1; } static int poly_coord_get(void *priv_data, struct coord *c, int count) { struct gobject *g = priv_data; struct map_rect_priv *mr = g->priv_data; int ndeltas = 0, total = 0; struct gcoord dc; if (!count) return 0; if (g != mr->last_itterated) { mr->last_itterated = g; mr->last_coord = 0; } ndeltas = gar_get_object_deltas(g); if (mr->last_coord > ndeltas + 1) return 0; while (count --) { if (mr->last_coord == 0) { gar_get_object_coord(mr->gmap, g, &dc); mr->last_c.x = dc.x; mr->last_c.y = dc.y; } else { if (!gar_get_object_dcoord(mr->gmap, g, mr->last_coord - 1, &dc)) { mr->last_coord = ndeltas + 2; return total; } mr->last_c.x += dc.x; mr->last_c.y += dc.y; } c->x = mr->last_c.x; c->y = mr->last_c.y; ddlog(1, "poly: x=%f y=%f\n", GARDEG(c->x), GARDEG(c->y)); // dlog(1,"poly: x=%d y=%d\n", c->x, c->y); c++; total++; total++; mr->last_coord ++; } return total; } // for _any we must return one by one static int point_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr) { struct gobject *g = priv_data; struct map_rect_priv *mr = g->priv_data; int rc; switch (attr_type) { case attr_any: if (g != mr->last_oattr) { mr->last_oattr = g; mr->last_attr = 0; } switch(mr->last_attr) { case 0: mr->last_attr++; attr->type = attr_label; rc = garmin_object_label(g, attr); if (rc) return rc; case 1: mr->last_attr++; attr->type = attr_debug; rc = garmin_object_debug(g, attr); if (rc) return rc; default: return 0; } break; case attr_label: attr->type = attr_label; return garmin_object_label(g, attr); case attr_limit: return 0; default: dlog(1, "Dont know about attribute %d[%04X]=%s yet\n", attr_type,attr_type, attr_to_name(attr_type)); } return 0; } static struct item_methods methods_garmin_point = { coord_rewind, point_coord_get, attr_rewind, point_attr_get, }; static struct item_methods methods_garmin_poly = { coord_rewind, poly_coord_get, attr_rewind, // point_attr_rewind, point_attr_get, // poly_attr_get, }; static struct item * garmin_poi2item(struct map_rect_priv *mr, struct gobject *o, unsigned char otype) { int subtype; subtype = gar_object_subtype(o); mr->item.id_hi = otype << 8 | subtype; if (mr->mpriv->conv) mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POINT, mr->item.id_hi); mr->item.meth = &methods_garmin_point; return &mr->item; } static struct item * garmin_pl2item(struct map_rect_priv *mr, struct gobject *o, unsigned char otype) { mr->item.id_hi = otype; if (mr->mpriv->conv) mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYLINE, otype); mr->item.meth = &methods_garmin_poly; return &mr->item; } static struct item * garmin_pg2item(struct map_rect_priv *mr, struct gobject *o, unsigned char otype) { mr->item.id_hi = otype; if (mr->mpriv->conv) mr->item.type = g2n_get_type(mr->mpriv->conv, G2N_POLYGONE, otype); mr->item.meth = &methods_garmin_poly; return &mr->item; } static struct item * garmin_obj2item(struct map_rect_priv *mr, struct gobject *o) { unsigned char otype; otype = gar_obj_type(o); mr->item.type = type_none; switch (o->type) { case GO_POINT: case GO_POI: return garmin_poi2item(mr, o, otype); case GO_POLYLINE: return garmin_pl2item(mr, o, otype); case GO_POLYGON: return garmin_pg2item(mr, o, otype); default: dlog(1, "Unknown garmin object type:%d\n", o->type); } return NULL; } static struct item * gmap_rect_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo) { struct gobject *o; o = mr->objs = gar_get_object(mr->mpriv->g, (void *)id_lo); if (!o) { dlog(1, "Can not find object\n"); return NULL; } mr->item.id_hi = (int)mr; mr->item.id_lo = (int)o->gptr; mr->item.priv_data = o; mr->item.type = type_none; o->priv_data = mr; if (!garmin_obj2item(mr, o)) return NULL; return &mr->item; } static struct item * gmap_rect_get_item(struct map_rect_priv *mr) { struct gobject *o; if (!mr->objs) return NULL; if (!mr->cobj) return NULL; // mr->cobj = mr->objs; o = mr->cobj; // dlog(1, "gi:o=%p\n", o); mr->cobj = mr->cobj->next; if (o) { mr->item.id_hi = (int)mr; mr->item.id_lo = (int)o->gptr; mr->item.priv_data = o; mr->item.type = type_none; o->priv_data = mr; if (!garmin_obj2item(mr, o)) return NULL; return &mr->item; } return NULL; } #define max(a,b) ((a) > (b) ? (a) : (b)) struct nl2gl_t { int g; int bits; char *descr; }; struct nl2gl_t nl2gl_1[] = { { /* 0 */ .g = 12, .descr = "0-120m", }, { /* 1 */ .g = 11, .descr = "0-120m", }, { /* 2 */ .g = 10, .descr = "0-120m", }, { /* 3 */ .g = 9, .descr = "0-120m", }, { /* 4 */ .g = 8, .descr = "0-120m", }, { /* 5 */ .g = 7, .descr = "0-120m", }, { /* 6 */ .g = 6, .descr = "0-120m", }, { /* 7 */ .g = 5, .descr = "0-120m", }, { /* 8 */ .g = 4, .descr = "0-120m", }, { /* 9 */ .g = 4, .descr = "0-120m", }, { /* 10 */ .g = 3, .descr = "0-120m", }, { /* 11 */ .g = 3, .descr = "0-120m", }, { /* 12 */ .g = 2, .descr = "0-120m", }, { /* 13 */ .g = 2, .descr = "0-120m", }, { /* 14 */ .g = 2, .descr = "0-120m", }, { /* 15 */ .g = 1, .descr = "0-120m", }, { /* 16 */ .g = 1, .descr = "0-120m", }, { /* 17 */ .g = 1, .descr = "0-120m", }, { /* 18 */ .g = 0, .descr = "0-120m", }, }; struct nl2gl_t nl2gl[] = { { /* 0 */ .g = 9, .descr = "0-120m", }, { /* 1 */ .g = 9, .descr = "0-120m", }, { /* 2 */ .g = 8, .descr = "0-120m", }, { /* 3 */ .g = 8, .descr = "0-120m", }, { /* 4 */ .g = 7, .descr = "0-120m", }, { /* 5 */ .g = 7, .descr = "0-120m", }, { /* 6 */ .g = 6, .descr = "0-120m", }, { /* 7 */ .g = 6, .descr = "0-120m", }, { /* 8 */ .g = 5, .descr = "0-120m", }, { /* 9 */ .g = 5, .descr = "0-120m", }, { /* 10 */ .g = 4, .descr = "0-120m", }, { /* 11 */ .g = 4, .descr = "0-120m", }, { /* 12 */ .g = 3, .descr = "0-120m", }, { /* 13 */ .g = 3, .descr = "0-120m", }, { /* 14 */ .g = 2, .descr = "0-120m", }, { /* 15 */ .g = 2, .descr = "0-120m", }, { /* 16 */ .g = 1, .descr = "0-120m", }, { /* 17 */ .g = 1, .descr = "0-120m", }, { /* 18 */ .g = 0, .descr = "0-120m", }, }; static int get_level(struct map_selection *sel) { int l; l = max(sel->order[layer_town], sel->order[layer_street]); l = max(l, sel->order[layer_poly]); return l; } static int garmin_get_selection(struct map_rect_priv *map, struct map_selection *sel) { struct gar_rect r; struct gmap *gm; struct gobject **glast = NULL; int rc; int sl, el; int level = 0; // 18; /* max level for maps, overview maps can have bigger /* levels we do not deal w/ them */ int flags = 0; if (sel && sel->order[layer_town] == 0 && sel->order[layer_poly] == 0 && sel->order[layer_street]) { // Get all roads flags = GO_GET_ROUTABLE; } else if (sel) flags = GO_GET_SORTED; if (sel) { r.lulat = sel->rect.lu.y; r.lulong = sel->rect.lu.x; r.rllat = sel->rect.rl.y; r.rllong = sel->rect.rl.x; level = get_level(sel); // level = nl2gl[level].g; printf("Looking level=%d for %f %f %f %f\n", level, r.lulat, r.lulong, r.rllat, r.rllong); } gm = gar_find_subfiles(map->mpriv->g, sel ? &r : NULL); if (!gm) { dlog(1, "Can not find map data\n"); return -1; } #if 0 sl = (18-(gm->maxlevel - gm->minlevel))/2; el = sl + (gm->maxlevel - gm->minlevel); if (level < sl) level = sl; if (level > el) level = el; level = level - sl; level = (gm->maxlevel - gm->minlevel) - level; dlog(1, "sl=%d el=%d level=%d\n", sl, el, level); #endif sl = (18-gm->zoomlevels)/2; el = sl + gm->zoomlevels; if (level < sl) level = sl; if (level > el) level = el; level = level - sl; level = gm->basebits + level; dlog(1, "sl=%d el=%d level=%d\n", sl, el, level); map->gmap = gm; glast = &map->objs; while (*glast) { if ((*glast)->next) { *glast = (*glast)->next; } else break; } rc = gar_get_objects(gm, level, sel ? &r : NULL, glast, flags); if (rc < 0) { dlog(1, "Error loading objects\n"); return -1; } map->cobj = map->objs; dlog(1, "Loaded %d objects\n", rc); return rc; } // Can not return NULL, navit segfaults static struct map_rect_priv * gmap_rect_new(struct map_priv *map, struct map_selection *sel) { struct map_selection *ms = sel; struct map_rect_priv *mr; mr = calloc(1, sizeof(*mr)); if (!mr) return mr; mr->mpriv = map; if (!sel) { return mr; } else { while (ms) { dlog(1, "order town:%d street=%d poly=%d\n", ms->order[layer_town], ms->order[layer_street], ms->order[layer_poly]); if (garmin_get_selection(mr, ms) < 0) { // free(mr); // return NULL; } ms = ms->next; } } return mr; } static void gmap_rect_destroy(struct map_rect_priv *mr) { dlog(11,"destroy maprect\n"); if (mr->gmap) gar_free_gmap(mr->gmap); if (mr->objs) gar_free_objects(mr->objs); if (mr->label) free(mr->label); free(mr); } static void gmap_destroy(struct map_priv *m) { dlog(1, "garmin_map_destroy\n"); if (m->g) gar_free(m->g); if (m->filename) free(m->filename); free(m); } static struct map_methods map_methods = { projection_garmin, NULL, // "iso8859-1", // update from the map gmap_destroy, // gmap_rect_new, gmap_rect_destroy, gmap_rect_get_item, gmap_rect_get_item_byid, gmap_search_new, gmap_search_destroy, gmap_search_get_item, }; static struct map_priv * gmap_new(struct map_methods *meth, struct attr **attrs) { struct map_priv *m; struct attr *data; char buf[PATH_MAX]; data=attr_search(attrs, NULL, attr_data); if (! data) return NULL; m=g_new(struct map_priv, 1); m->id=++map_id; m->filename = strdup(data->u.str); if (!m->filename) { g_free(m); return NULL; } m->g = gar_init(NULL, logfn); if (!m->g) { g_free(m->filename); g_free(m); return NULL; } // we want the data now, later we can load only what's necessery if (gar_img_load(m->g, m->filename, 1) < 0) { gar_free(m->g); g_free(m->filename); g_free(m); return NULL; } snprintf(buf, sizeof(buf), "%s.types", m->filename); dlog(1, "Looking for types in %s\n", buf); m->conv = g2n_conv_load(buf); if (!m->conv) { char *cp; strcpy(buf, m->filename); cp = strrchr(buf ,'/'); if (cp) { cp ++; *cp = '\0'; strcat(buf, "garmintypes.txt"); dlog(1, "Looking for types in %s\n", buf); m->conv = g2n_conv_load(buf); } } if (!m->conv) { dlog(1, "Failed to load map types\n"); } *meth=map_methods; return m; } void plugin_init(void) { plugin_register_map_type("garmin", gmap_new); } --- NEW FILE: gar2navit.h --- #define RT_PEDESTRIAN (1<<0) #define RT_BYCYCLE (1<<1) #define RT_MOTORCYCLE (1<<2) #define RT_CAR (1<<3) #define RT_TRUCK (1<<4) #define RT_LONGTRUCK (1<<5) struct gar2navit { unsigned short id; unsigned short maxid; enum item_type ntype; int routable; char *descr; struct gar2navit *next; }; #define G2N_POINT 1 #define G2N_POLYLINE 2 #define G2N_POLYGONE 3 struct gar2nav_conv { struct gar2navit *points; struct gar2navit *polylines; struct gar2navit *polygons; }; struct gar2nav_conv *g2n_conv_load(char *file); enum item_type g2n_get_type(struct gar2nav_conv *c, int type, unsigned short id); char *g2n_get_descr(struct gar2nav_conv *c, int type, unsigned short id); int g2n_get_routable(struct gar2nav_conv *c, int type, unsigned short id); --- NEW FILE: Makefile.am --- include $(top_srcdir)/Makefile.inc AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/src -DMODULE=\"data_garmin\" AM_CPPFLAGS+= @LIBGARMIN_CFLAGS@ INCLUDES=-I$(top_srcdir)/src/data/garmin/libgarmin moduledata_LTLIBRARIES = libdata_garmin.la libdata_garmin_la_SOURCES = garmin.c garmin.h gar2navit.c gar2navit.h libdata_garmin_la_LIBADD = @LIBGARMIN_LIBS@ --- NEW FILE: garmintypes.txt --- # # # POINT 0x0000 = label_unkn, Unknown label 0x0100 = town_label_1e5, Megapolis (10M +) 0x0200 = town_label_5e4, Megapolis (5-10M) 0x0300 = town_label_2e4, Big City (2-5M) 0x0400 = town_label_1e4, Big City (1-2M) 0x0500 = town_label_5e3, Big City (0.5-1M) 0x0600 = town_label_2e3, City (200-500k) 0x0700 = town_label_1e3, City (100-200k) 0x0800 = town_label_5e2, City (50-100k) 0x0900 = town_label_2e2, City (20-50k) 0x0a00 = town_label_1e2, City (10-20k) 0x0b00 = town_label_5e1, Small City (5-10k) 0x0c00 = town_label_2e1, Small City (2-5k) 0x0d00 = town_label_1e1, Village (1-2k) 0x0e00 = town_label_5e0, Village (500-1000) 0x0f00 = town_label_2e0, Village (200-500) 0x1000 = town_label_1e0, Village (100-200) 0x1100 = town_label_0e0, Village (0-100) 0x1200 = port_label, Port with services 0x1300 = label_unkn, Unknown label2 0x1400-0x14FF = country_label, Large Country Name 0x1500-0x15FF = country_label, Country Name 0x1c00 = poi_wreck, Unclassified Obstruction 0x1c01 = poi_wreck, Wreck 0x1c02 = poi_dangerous, submerged wreck, dangerous 0x1c03 = poi_nondangerous, submerged wreck, non-dangerous 0x1c04 = poi_wreck, Wreck, cleared by wire drag 0x1c05 = poi_rock, Obstruction, visible at high water 0x1c06 = poi_rock, Obstruction, awash 0x1c07 = poi_rock, Obstruction, submerged 0x1c08 = poi_rock, Obstruction, cleared by wire drag 0x1c09 = poi_rock, Rock, awash 0x1c0a = poi_rock, Rock, submerged at low Water 0x1c0b = poi_sounding, Sounding 0x1d00 = poi_tide, Tide Prediction 0x1e00-0x1e3f = district_label, District, Province, State Name 0x1f00 = district_label_0e0, Region, District Name # Fixme if it has label how to change to highway_exit_with_label ?? 0x2000-0x203F = highway_exit, Exit 0x2100-0x213F = highway_exit, Exit with Services 0x2200-0x223F = highway_exit, Exit with Restroom 0x2300-0x233F = highway_exit, Exit with Convinience Store 0x2400-0x243F = highway_exit, Exit with Weight Station 0x2500-0x253F = highway_exit, Exit with Toolbooth Booth 0x2600-0x263F = highway_exit, Exit with Information 0x2700-0x273F = highway_exit, Exit 0x2800-0x283F = district_label_1e0, Region Name 0x2900 = poi_public_utilities, Services 0x2A00 = poi_dining, Dining(Other) 0x2A01 = poi_dining, Dining(American) 0x2A02 = poi_dining, Dining(Asian) 0x2A03 = poi_dining, Dining(Barbecue) 0x2A04 = poi_dining, Dining(Chinese) 0x2A05 = poi_dining, Dining(Deli/Bakery) 0x2A06 = poi_dining, Dining(International) 0x2A07 = poi_fastfood, Fast Food 0x2A08 = poi_dining, Dining(Italian) 0x2A09 = poi_dining, Dining(Mexican) 0x2A0A = poi_dining, Dining(Pizza) 0x2A0B = poi_dining, Dining(Sea Food) 0x2A0C = poi_dining, Dining(Steak/Grill) 0x2A0D = poi_dining, Dining(Bagel/Donut) 0x2A0E = poi_dining, Dining(Cafe/Diner) 0x2A0F = poi_dining, Dining(French) 0x2A10 = poi_dining, Dining(German) 0x2A11 = poi_dining, Dining(British Isles) 0x2A12 = poi_dining, Dining(Special Foods) 0x2B00 = poi_hotel, Hotel(Other) 0x2B01 = poi_hotel, Hotel/Motel 0x2B02 = poi_hotel, Bed & Breakfast inn 0x2B03 = poi_camp_rv, Camping/RV-Park 0x2B04 = poi_resort, Resort 0x2C00 = poi_attraction, Amusement Park 0x2C01 = poi_attraction, Amusement Park 0x2C02 = poi_museum_history, Museum/History 0x2C03 = poi_library, Libraries 0x2C04 = poi_landmark, Land Mark 0x2C05 = poi_school, School 0x2C06 = poi_park, Park 0x2C07 = poi_zoo, Zoo 0x2C08 = poi_stadium, Sportpark, Stadium,(point) 0x2C09 = poi_fair, Fair, Conference(point) 0x2C0A = poi_wine, Wine restaurant(point) 0x2C0B = poi_worship, Place of Worship 0x2C0C = poi_hotspring, Hot Spring 0x2D00 = poi_theater, Theater 0x2D01 = poi_theater, Theater 0x2D02 = poi_bar, Bar 0x2D03 = poi_cinema, Cinema 0x2D04 = poi_casino, Casino 0x2D05 = poi_golf, Golf 0x2D06 = poi_skiing, Skiing Center 0x2D07 = poi_bowling, Bowling 0x2D08 = poi_icesport, Ice/Sporting 0x2D09 = poi_swimming, Swimming 0x2D0A = poi_sport, Sports(point) 0x2D0B = poi_sailing, Sailing Airport 0x2E00 = poi_shopping, Shoping general 0x2E01 = poi_shop_department, Department Store 0x2E02 = poi_shop_grocery, Grocery 0x2E03 = poi_shop_merchandise, General Merchandiser 0x2E04 = poi_mall, Shopping Center 0x2E05 = poi_pharmacy, Pharmacy 0x2E06 = poi_shopping, Convenience 0x2E07 = poi_shop_apparel, Apparel 0x2E08 = poi_shop_handg, House and Garden 0x2E09 = poi_shop_furnish, Home Furnishing 0x2E0a = poi_shop_retail, Special Retail 0x2E0b = poi_shop_computer, Computer/Software 0x2F00 = poi_service, generic service 0x2F01 = poi_fuel, Fuel/Gas 0x2F02 = poi_car_rent, Car Rental 0x2F03 = poi_autoservice, Car Repair 0x2F04 = poi_airport, Airport 0x2F05 = poi_post, Post Office 0x2F06 = poi_bank, Bank 0x2F07 = poi_car_dealer_parts, Car Dealer(point) 0x2F08 = poi_bus_station, Bus Station 0x2F09 = poi_marina, Marina 0x2F0A = poi_wrecker, Wrecker Service 0x2F0B = poi_car_parking, Parking 0x2F0C = poi_rest_room, Restroom 0x2F0D = poi_auto_club, Automobile Club 0x2F0E = poi_car_wash, Car Wash 0x2F0F = poi_garmin, Garmin Dealer 0x2F10 = poi_personal_service, Personal Service 0x2F11 = poi_bussines_service, Business Service 0x2F12 = poi_communication, Communication 0x2F13 = poi_repair_service, Repair Service 0x2F14 = poi_social_service, Social Service 0x2F15 = poi_public_utilities, Utility 0x2F16 = poi_truck_stop, Truck Stop 0x2F17 = poi_bus_stop, Bus Stop 0x3000 = poi_emergency, generic emergency/government 0x3001 = poi_police, Police Station 0x3002 = poi_hospital, Hospital 0x3003 = poi_public_office, Public Office 0x3004 = poi_justice, Justice 0x3005 = poi_concert, Concert hall(point) 0x3006 = poi_border_station, Border Station(point) 0x3007 = poi_goverment_building, Goverment Building 0x3008 = poi_firebrigade, FireFighters Station 0x4000-0x403F = poi_golf, Golf 0x4100-0x413F = poi_fish, Fish 0x4200-0x423F = poi_wreck, Wreck 0x4300-0x433F = poi_marina, Marina 0x4400-0x443F = poi_fuel, Gas 0x4500-0x453F = poi_restaurant, Restaurant 0x4600-0x463F = poi_bar, Bar 0x4700-0x473F = poi_boat_ramp, Boat Ramp 0x4800-0x483F = poi_camping, Camping 0x4900-0x493F = poi_park, Park 0x4A00-0x4A3F = poi_picnic, Picnic Area 0x4B00-0x4B3F = poi_hospital, Hospital 0x4C00-0x4C3F = poi_information, Information 0x4D00-0x4D3F = poi_car_parking, Parking 0x4E00-0x4E3F = poi_restroom, Restroom 0x4F00-0x4F3F = poi_shower, Shower 0x5000-0x503F = poi_drinking_water, Drinking Water 0x5100-0x513F = poi_telephone, Telephone 0x5200-0x523F = poi_scenic_area, Scenic Area 0x5300-0x533F = poi_skiing, Skiing 0x5400-0x543F = poi_swimming, Swimming 0x5500-0x553F = poi_dam, Dam 0x5600-0x563F = poi_forbiden_area, Forbiden Area 0x5700-0x573F = poi_danger_area, Danger Area 0x5800-0x583F = poi_restricted_area, Restricted Area 0x5900 = poi_airport, Generic Airport 0x5901 = poi_airport, Large Airport 0x5902 = poi_airport, Medium Airport 0x5903 = poi_airport, Small Airport 0x5904 = poi_heliport, Heliport 0x5905-0x593F = poi_airport, Airport 0x5a00 = poi_mark, Kilometer Pole 0x5b00 = poi_mark, Kolokol 0x5c00 = poi_diving, Diving Place 0x5D00-0x5D3F = poi_daymark, Daymark,Green Square 0x5E00-0x5E3F = poi_daymark, Daymark,Red Triangle 0x6000 = poi_loudspeaker, LoudSpeaker 0x6100 = poi_building, House 0x6200 = poi_height, Height with point in feet one decimal place 0x6300 = poi_height, Height without point in feet no decimal place 0x6400 = poi_manmade_feature, Manmade Feature 0x6401 = poi_bridge, Bridge 0x6402 = poi_building, Building 0x6403 = poi_cemetery, Cemetery 0x6404 = poi_church, Church 0x6405 = poi_civil, Civil 0x6406 = poi_crossing, Crossing 0x6407 = poi_dam, Dam 0x6408 = poi_hospital, Hospital 0x6409 = poi_levee, Levee 0x640A = poi_locale, Locale 0x640B = poi_military, Military 0x640C = poi_mine, Mine 0x640D = poi_oil_field, Oil Field 0x640E = poi_park, Park 0x640F = poi_post, Post 0x6410 = poi_school, School 0x6411 = poi_tower, Tower 0x6412 = poi_trail, Trail 0x6413 = poi_tunnel, Tunnel 0x6414 = poi_drinking_water, Drink water 0x6415 = town_ghost, Ghost Town 0x6416 = poi_subdivision, Subdivision 0x6500 = poi_water_feature, Water Feature 0x6501 = poi_water_feature, Arroyo 0x6502 = poi_water_feature, Sand Bar 0x6503 = poi_bay, Bay 0x6504 = poi_bend, Bend 0x6505 = poi_water_feature, Canal 0x6506 = poi_water_feature, Channel 0x6507 = poi_cove, Cove 0x6508 = poi_water_feature, Falls 0x6509 = poi_water_feature, Geyser 0x650A = poi_water_feature, Glacier 0x650B = poi_marine, Harbour 0x650C = poi_island, Island 0x650D = poi_water_feature, Lake 0x650E = poi_water_feature, Rapids 0x650F = poi_water_feature, Reservoir 0x6510 = poi_water_feature, Sea 0x6511 = poi_water_feature, Spring 0x6512 = poi_water_feature, Stream 0x6513 = poi_water_feature, Swamp 0x6600 = poi_land_feature, Land Feature 0x6601 = poi_land_feature, Arch 0x6602 = poi_land_feature, Area 0x6603 = poi_land_feature, Basin 0x6604 = poi_land_feature, Beach 0x6605 = poi_land_feature, Bench 0x6606 = poi_land_feature, Cape 0x6607 = poi_land_feature, Cliff 0x6608 = poi_land_feature, Crater 0x6609 = poi_land_feature, Flat 0x660A = poi_land_feature, Forest 0x660B = poi_land_feature, Gap 0x660C = poi_land_feature, Gut 0x660D = poi_land_feature, Isthmus 0x660E = poi_land_feature, Lava 0x660F = poi_land_feature, Pillar 0x6610 = poi_land_feature, Plain 0x6611 = poi_land_feature, Range 0x6612 = poi_land_feature, Reserve 0x6613 = poi_land_feature, Ridge 0x6614 = poi_land_feature, Rock 0x6615 = poi_land_feature, Slope 0x6616 = poi_land_feature, Summit 0x6617 = poi_land_feature, Valley 0x6618 = poi_land_feature, Woods # This are dublicated to 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00 # fix them if you need them 0x1600 = poi_marine_type, Beakon 0x1601 = poi_marine_type, Fog Horn 0x1602 = poi_marine_type, Radio Beacon 0x1603 = poi_marine_type, Racon 0x1604 = poi_marine_type, Day Beacon, red triangle 0x1605 = poi_marine_type, Day Beacon, green square 0x1606 = poi_marine_type, Day Beacon, white diamond 0x1607 = poi_marine_type, unlit Navaid, white 0x1608 = poi_marine_type, unlit Navaid, red 0x1609 = poi_marine_type, unlit Navaid, green 0x160a = poi_marine_type, unlit Navaid, black 0x160b = poi_marine_type, unlit Navaid, yellow or amber 0x160c = poi_marine_type, unlit Navaid, orange 0x160d = poi_marine_type, unlit Navaid, multi colored 0x160e = poi_marine_type, Navaid, unknown 0x160f = poi_marine_type, lighted Navaid, white 0x1610 = poi_marine_type, lighted Navaid, red 0x1611 = poi_marine_type, lighted Navaid, green 0x1612 = poi_marine_type, lighted Navaid, yellow or amber 0x1613 = poi_marine_type, lighted Navaid, orange 0x1614 = poi_marine_type, lighted Navaid, violet 0x1615 = poi_marine_type, lighted Navaid, blue 0x1616 = poi_marine_type, lighted Navaid, multi colored # # Street's are routable by: # ALL - by all # W pedestrian # B bycycle # M motorcycle # C car # T truck # L largetruck # this is probably, encoded into the map POLYLINE 0x00 = ALL, street_1_land, Road 0x01 = MCTL, highway_land, Major HWY thick 0x02 = MCTL, street_4_land, Principal HWY-thick 0x03 = MCTL, street_2_land, Principal HWY-medium 0x04 = MCTL, street_3_city, Arterial Road-medium 0x05 = MCTL, street_4_city, Arterial Road-thick 0x06 = MCTL, street_2_city, Road-thin 0x07 = MCTL, street_1_city, Alley-thick 0x08 = MCTL, ramp, Ramp 0x09 = MCTL, ramp, Ramp highspeed 0x0a = MCTL, street_0, Unpaved Road-thin 0x0b = MCTL, ramp, Major HWY Connector-thick 0x0c = MCTL, roundabout, Roundabout 0x0d = MCTL, street_unkn, Reservation/Zapovednik? 0x0e = MCTL, street_unkn, Unknown Element 0x0e 0x0f = NONE, street_unkn, Unknown Element 0x0f 0x10 = NONE, street_unkn, Unknown Element 0x10 0x11 = NONE, street_unkn, Unknown Element 0x11 0x12 = NONE, street_unkn, Unknown Element 0x12 0x13 = NONE, street_unkn, Unknown Element 0x13 0x14 = NONE, rail, Railroad 0x15 = NONE, water_line, Shoreline 0x16 = W, street_nopass, Trail 0x18 = NONE, water_line, Stream-thin 0x19 = NONE, time_zone, Time-Zone 0x1a = ALL, ferry, Ferry 0x1b = ALL, ferry, Ferry 0x1c = NONE, border_country, Political Boundary 0x1d = NONE, border_country, County Boundary 0x1e = NONE, border_country, Intl. Boundary 0x1f = NONE, water_line, River 0x20 = NONE, height_line_1, Land Contour (thin) Height in feet 0x21 = NONE, height_line_2, Land Contour (medium) Height in feet 0x22 = NONE, height_line_3, Land Contour (thick) Height in feet 0x23 = NONE, depth_line_1, Depth Contour (thin) Depth in feet 0x24 = NONE, depth_line_2, Depth Contour (medium) Depth in feet 0x25 = NONE, depth_line_3, Depth Contour (thick) Depth in feet 0x26 = NONE, water_line, Intermittent River 0x27 = NONE, street_nopass, Airport Runway 0x28 = NONE, pipeline, Pipeline 0x29 = NONE, powerline, Powerline 0x2a = NONE, marine_boundary, Marine Boundary (no line) 0x2b = NONE, marine_hazard, Marine Hazard (no line) POLYGONE 0x01 = town_poly, City (>200k) 0x02 = town_poly, City (<200k) 0x03 = town_poly, Village 0x04 = military_zone, Military 0x05 = parking_lot_poly, Parking Lot 0x06 = parking_lot_poly, Parking Garage 0x07 = airport_poly, Airport 0x08 = commercial_center, Shopping Center 0x09 = marine_poly, Marina 0x0a = university, University/College 0x0b = hospital_poly, Hospital 0x0c = industry_poly, Industrial 0x0d = area, Reservation 0x0e = airport_poly, Airport Runway 0x13 = area_unspecified, Man made area 0x14 = park_poly, National park 0x15 = park_poly, National park 0x16 = park_poly, National park 0x17 = park_poly, City Park 0x18 = golf_course, Golf 0x19 = sport_poly, Sport 0x1a = cemetery_poly, Cemetery 0x1e = park_poly, State Park 0x1f = park_poly, State Park 0x20 = park_poly, State Park 0x28 = water_poly, Ocean 0x29 = water_poly, Water Reservour 0x32 = water_poly, Sea 0x3b = water_poly, Water Reservour 0x3c = water_poly, Lake (250-600 km2) 0x3d = water_poly, Lake (77-250 km2) 0x3e = water_poly, Lake (25-77 km2) 0x3f = water_poly, Lake (11-25 km2) 0x40 = water_poly, Lake (0.25-11 km2) 0x41 = water_poly, Lake (<0.25 km2) 0x42 = water_poly, Lake (>3.3k km2) 0x43 = water_poly, Lake (1.1-3.3k km2) 0x44 = water_poly, Lake (0.6-1.1k km2) 0x45 = water_poly, Water Reservour 0x46 = water_poly, River (>1km) 0x47 = water_poly, River (200m-1km) 0x48 = water_poly, River (40-200m) 0x49 = water_poly, River (<40m) 0x4a = area, Definition Area 0x4b = area, Background 0x4c = water_poly, Intermittent River/Lake 0x4d = water_poly, Glaciers 0x4e = plantation, Orchard or plantation 0x4f = scrub, Scrub 0x50 = wood, Woods 0x51 = water_poly, Wetland 0x52 = tundra, Tundra 0x53 = flats, Flats --- NEW FILE: gar2navit.c --- /* Street's are routable by: ALL - by all W pedestrian (1<<0) B bycycle (1<<1) M motorcycle (1<<2) C car (1<<3) T truck (1<<4) L largetruck (1<<5) File format is: POINT 0x0100 = town_label_1e5, Megapolis (10M +) 0x0200 = town_label_5e4, Megapolis (5-10M) ... 0x1e00-0x1e3f = district_label, District, Province, State Name ... POLYLINE 0x00 = ALL, street_1_land, Road 0x01 = MCTL, highway_land, Major HWY thick 0x02 = MCTL, street_4_land, Principal HWY-thick 0x03 = MCTL, street_2_land, Principal HWY-medium .... POLYGONE 0x01 = town_poly, City (>200k) 0x02 = town_poly, City (<200k) 0x03 = town_poly, Village */ #include <stdio.h> #include <string.h> #include <malloc.h> #include "item.h" #include "attr.h" #include "garmin.h" #include "gar2navit.h" static int add_def(struct gar2nav_conv *conv, int type, unsigned short minid, unsigned short maxid, unsigned int routable, char *ntype, char *descr) { enum item_type it; struct gar2navit *g2n; dlog(11, "type=%d routable=%u min=%04X max=%04X ntype=%s descr=%s\n", type, routable, minid, maxid, ntype, descr); it = item_from_name(ntype); if (it==type_none) { dlog(1, "Please define: %s\n", ntype); } g2n = calloc(1, sizeof(*g2n)); if (!g2n) return -1; g2n->id = minid; g2n->maxid = maxid; g2n->ntype = it; g2n->descr = strdup(descr); g2n->routable = routable; if (type == 1) { g2n->next = conv->points; conv->points = g2n; } else if (type == 2) { g2n->next = conv->polylines; conv->polylines = g2n; } else if (type == 3) { g2n->next = conv->polygons; conv->polygons = g2n; } return 0; } static unsigned int get_rtmask(char *p) { char *cp; unsigned int mask = 0; cp = p; while (*cp) { if (!strcasecmp(cp, "none")) return 0; if (!strcasecmp(cp, "all")) { mask = ~0; break; } if (*cp == 'W') mask |= RT_PEDESTRIAN; else if (*cp == 'B') mask |= RT_BYCYCLE; else if (*cp == 'M') mask |= RT_MOTORCYCLE; else if (*cp == 'C') mask |= RT_CAR; else if (*cp == 'T') mask |= RT_TRUCK; else if (*cp == 'L') mask |= RT_LONGTRUCK; cp++; } return mask; } static int load_types_file(char *file, struct gar2nav_conv *conv) { char buf[4096]; char descr[4096]; char ntype[4096]; char rtby[4096]; FILE *fp; unsigned int minid, maxid, routable; int rc; int type = -1; fp = fopen(file, "r"); if (!fp) return -1; while (fgets(buf, sizeof(buf), fp)) { if (*buf == '#' || *buf == '\n') continue; routable = 0; if (!strncasecmp(buf, "POINT", 5)) { type = 1; continue; } else if (!strncasecmp(buf, "POI", 3)) { type = 1; continue; } else if (!strncasecmp(buf, "POLYLINE", 8)) { type = 2; continue; } else if (!strncasecmp(buf, "POLYGONE", 8)) { type = 3; continue; } // assume only lines are routable if (type == 2) { rc = sscanf(buf, "0x%04X = %[^\t, ] , %[^\t, ], %[^\n]", &minid, rtby, ntype, descr); if (rc != 4) { dlog(1, "Invalid line rc=%d:[%s]\n",rc, buf); dlog(1, "minid=%04X ntype=[%s] des=[%s]\n", minid, ntype, descr); continue; } routable = get_rtmask(rtby); } else { rc = sscanf(buf, "0x%04X - 0x%04X = %[^\t , ] , %[^\n]", &minid, &maxid, ntype, descr); if (rc != 4) { maxid = 0; rc = sscanf(buf, "0x%04X = %[^\t, ], %[^\n]", &minid, ntype, descr); if (rc != 3) { dlog(1, "Invalid line rc=%d:[%s]\n",rc, buf); dlog(1, "minid=%04X ntype=[%s] des=[%s]\n", minid, ntype, descr); continue; } } } add_def(conv, type, minid, maxid, routable, ntype, descr); } fclose(fp); return 1; } struct gar2nav_conv *g2n_conv_load(char *file) { struct gar2nav_conv *c; int rc; c = calloc(1, sizeof(*c)); if (!c) return c; rc = load_types_file(file, c); if (rc < 0) { dlog(1, "Failed to load: [%s]\n", file); free(c); return NULL; } return c; } enum item_type g2n_get_type(struct gar2nav_conv *c, int type, unsigned short id) { struct gar2navit *def = NULL; if (type == G2N_POINT) def = c->points; else if (type == G2N_POLYLINE) def = c->polylines; else if (type == G2N_POLYGONE) def = c->polygons; else { dlog(1, "Unknown conversion type:%d\n", type); return type_none; } if (!def) { dlog(5, "No conversion data for %d\n", type); return type_none; } while (def) { if ((!def->maxid && def->id == id) || (def->id <= id && def->maxid)) return def->ntype; def = def->next; } dlog(5, "Type[%d]:ID:[%04X] unknown\n", type, id); return type_none; } int g2n_get_routable(struct gar2nav_conv *c, int type, unsigned short id) { struct gar2navit *def = NULL; if (type == G2N_POINT) def = c->points; else if (type == G2N_POLYLINE) def = c->polylines; else if (type == G2N_POLYGONE) def = c->polygons; else { dlog(1, "Unknown conversion type:%d\n", type); return type_none; } if (!def) { dlog(5, "No conversion data for %d\n", type); return type_none; } while (def) { if ((!def->maxid && def->id == id) || (def->id <= id && def->maxid)) return def->routable; def = def->next; } dlog(5, "Type[%d]:ID:[%04X] unknown\n", type, id); return 0; } char *g2n_get_descr(struct gar2nav_conv *c, int type, unsigned short id) { struct gar2navit *def = NULL; if (type == G2N_POINT) def = c->points; else if (type == G2N_POLYLINE) def = c->polylines; else if (type == G2N_POLYGONE) def = c->polygons; else { dlog(1, "Unknown conversion type:%d\n", type); return NULL; } while (def) { if ((!def->maxid && def->id == id) || (def->id <= id && def->maxid)) return def->descr; def = def->next; } dlog(5, "Type[%d]:ID:[%04X] unknown\n", type, id); return NULL; } #if 0 int main(int argc, char **argv) { load_types_file(argv[1], NULL); return 0; } #endif |
From: Zaxl <za...@us...> - 2007-10-25 09:21:12
|
Update of /cvsroot/navit/navit/src/data/garmin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7273/garmin Log Message: Directory /cvsroot/navit/navit/src/data/garmin added to the repository |
From: KaZeR <ka...@us...> - 2007-10-24 21:49:18
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7840 Modified Files: gui_sdl_window.cpp Log Message: Fix deprecated conversion from string constant to char* Index: gui_sdl_window.cpp =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/gui_sdl_window.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** gui_sdl_window.cpp 9 Oct 2007 12:40:55 -0000 1.20 --- gui_sdl_window.cpp 24 Oct 2007 21:49:18 -0000 1.21 *************** *** 396,400 **** } ! void Add_KeyBoard_key(char * key,int x,int y,int w){ using namespace CEGUI; --- 396,400 ---- } ! void Add_KeyBoard_key(CEGUI::String key,int x,int y,int w){ using namespace CEGUI; |
From: KaZeR <ka...@us...> - 2007-10-24 21:22:12
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28582 Modified Files: configure.in Log Message: configure returns false if no guis can be buit Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** configure.in 24 Oct 2007 21:05:31 -0000 1.33 --- configure.in 24 Oct 2007 21:22:11 -0000 1.34 *************** *** 315,317 **** --- 315,318 ---- echo "For more details, see the wiki at http://navit.sf.net/wiki/" echo "" + exit 1 fi |
From: KaZeR <ka...@us...> - 2007-10-24 21:05:29
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22272 Modified Files: configure.in Log Message: Added a summary of installation + warning if no guis can be built Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure.in 17 Oct 2007 12:59:48 -0000 1.32 --- configure.in 24 Oct 2007 21:05:31 -0000 1.33 *************** *** 231,234 **** --- 231,235 ---- fi + AC_SUBST(INTLIBS) AC_SUBST(MOFILES) *************** *** 279,280 **** --- 280,317 ---- po/Makefile ]) + echo "" + echo "" + echo "Summary of your installation :" + if test x"$gtk2_pkgconfig" = xyes + then + echo "GTK gui : ENABLED" + else + echo "GTK gui : DISABLED : you are missing a dependency" + fi + if test x"$sdl" = xyes + then + echo "SDL gui : ENABLED" + else + echo "SDL gui : DISABLED : you are missing a dependency" + fi + if test x"$gpsd" = xyes + then + echo "GPS support : ENABLED" + else + echo "GPS support : DISABLED" + fi + if test x"$speechd" = xyes + then + echo "SPEECHD : ENABLED" + else + echo "SPEECHD : DISABLED" + fi + if [ test x"$gtk2_pkgconfig" != xyes ] && [ test x"$sdl" != xyes ] + then + echo "" + echo "" + echo "*** WARNING! you have no gui that can be built! ***" + echo "Please install the dependency for at least gtk or sdl gui" + echo "For more details, see the wiki at http://navit.sf.net/wiki/" + echo "" + fi |
From: KaZeR <ka...@us...> - 2007-10-24 18:46:47
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14829 Modified Files: navit.c Log Message: Updated error msg to link to the wiki Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** navit.c 9 Oct 2007 18:14:27 -0000 1.33 --- navit.c 24 Oct 2007 18:46:40 -0000 1.34 *************** *** 783,800 **** if (!this_->gui || !this_->gra || gui_set_graphics(this_->gui, this_->gra)) { g_warning("failed to connect graphics to gui\n"); ! g_warning("It can be one of the following : \n"); ! g_warning("- You choosed a gui which doesn't exist or doesn't work"); ! g_warning(" -> Check the <plugin path> section of your navit.xml"); ! g_warning("- You choosed a graphics which doesn't exist or doesn't work"); ! g_warning(" -> Check the <plugin path> section of your navit.xml"); ! g_warning("- The graphics driver is not compatible with the gui"); ! g_warning(" -> Currently you can use :"); ! g_warning(" gtk_drawing_area graphic driver with gtk"); ! g_warning(" opengl graphic driver with sdl"); ! g_warning(" null graphic driver with both (but do you want that? :) )"); ! g_warning(""); ! g_warning(" The most common reason is that something went wrong when you compiled navit, and either :"); ! g_warning(" - the gui or graphics driver you want to use wasn't compiled, maybe because of a missing dependency"); ! g_warning(" - make install didn't install the library where it should have."); navit_destroy(this_); return; --- 783,789 ---- if (!this_->gui || !this_->gra || gui_set_graphics(this_->gui, this_->gra)) { g_warning("failed to connect graphics to gui\n"); ! g_warning(" Please see http://navit.sourceforge.net/wiki/index.php/Failed_to_connect_graphics_to_gui\n"); ! g_warning(" for explanations and solutions\n"); ! navit_destroy(this_); return; |