You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
| 2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
| 2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
| 2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
| 2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: <pg...@us...> - 2015-06-10 19:19:19
|
Revision: 2854
http://sourceforge.net/p/roadmap/code/2854
Author: pgf
Date: 2015-06-10 19:19:17 +0000 (Wed, 10 Jun 2015)
Log Message:
-----------
add compilation warning to empty set_font_size() stubs
Modified Paths:
--------------
trunk/roadmap/src/android/roadmap_canvas.c
trunk/roadmap/src/gtk/roadmap_canvas.c
trunk/roadmap/src/qt/roadmap_canvas.cc
trunk/roadmap/src/win32/roadmap_canvas.c
Modified: trunk/roadmap/src/android/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/android/roadmap_canvas.c 2015-06-10 19:19:12 UTC (rev 2853)
+++ trunk/roadmap/src/android/roadmap_canvas.c 2015-06-10 19:19:17 UTC (rev 2854)
@@ -657,7 +657,9 @@
void roadmap_canvas_set_label_font_name(const char *name) {}
void roadmap_canvas_set_label_font_color(const char *color) {}
-void roadmap_canvas_set_label_font_size(int size) {}
+void roadmap_canvas_set_label_font_size(int size) {
+#warning font size stub should be completed
+}
void roadmap_canvas_set_label_font_spacing(int spacing) {}
void roadmap_canvas_set_label_font_weight(const char *weight) {}
void roadmap_canvas_set_label_font_style(int style) {}
Modified: trunk/roadmap/src/gtk/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk/roadmap_canvas.c 2015-06-10 19:19:12 UTC (rev 2853)
+++ trunk/roadmap/src/gtk/roadmap_canvas.c 2015-06-10 19:19:17 UTC (rev 2854)
@@ -209,7 +209,9 @@
void roadmap_canvas_set_label_font_name(const char *name) {}
void roadmap_canvas_set_label_font_color(const char *color) {}
-void roadmap_canvas_set_label_font_size(int size) {}
+void roadmap_canvas_set_label_font_size(int size) {
+#warning font size stub should be completed
+}
void roadmap_canvas_set_label_font_spacing(int spacing) {}
void roadmap_canvas_set_label_font_weight(const char *weight) {}
void roadmap_canvas_set_label_font_style(int style) {}
Modified: trunk/roadmap/src/qt/roadmap_canvas.cc
===================================================================
--- trunk/roadmap/src/qt/roadmap_canvas.cc 2015-06-10 19:19:12 UTC (rev 2853)
+++ trunk/roadmap/src/qt/roadmap_canvas.cc 2015-06-10 19:19:17 UTC (rev 2854)
@@ -127,7 +127,9 @@
void roadmap_canvas_set_label_font_name(const char *name) {}
void roadmap_canvas_set_label_font_color(const char *color) {}
-void roadmap_canvas_set_label_font_size(int size) {}
+void roadmap_canvas_set_label_font_size(int size) {
+#warning font size stub should be completed
+}
void roadmap_canvas_set_label_font_spacing(int spacing) {}
void roadmap_canvas_set_label_font_weight(const char *weight) {}
void roadmap_canvas_set_label_font_style(int style) {}
Modified: trunk/roadmap/src/win32/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/win32/roadmap_canvas.c 2015-06-10 19:19:12 UTC (rev 2853)
+++ trunk/roadmap/src/win32/roadmap_canvas.c 2015-06-10 19:19:17 UTC (rev 2854)
@@ -210,7 +210,9 @@
void roadmap_canvas_set_label_font_name(const char *name) {}
void roadmap_canvas_set_label_font_color(const char *color) {}
-void roadmap_canvas_set_label_font_size(int size) {}
+void roadmap_canvas_set_label_font_size(int size) {
+#warning font size stub should be completed
+}
void roadmap_canvas_set_label_font_spacing(int spacing) {}
void roadmap_canvas_set_label_font_weight(const char *weight) {}
void roadmap_canvas_set_label_font_style(int style) {}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-10 19:19:14
|
Revision: 2853
http://sourceforge.net/p/roadmap/code/2853
Author: pgf
Date: 2015-06-10 19:19:12 +0000 (Wed, 10 Jun 2015)
Log Message:
-----------
gtk2/roadmap_canvas.c: implement set_label_font_size
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_canvas.c
Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-10 19:19:08 UTC (rev 2852)
+++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-10 19:19:12 UTC (rev 2853)
@@ -43,6 +43,7 @@
#define ROADMAP_CURSOR_SIZE 10
#define ROADMAP_CANVAS_POINT_BLOCK 1024
+#define DEFAULT_FONT_SIZE 15
struct roadmap_canvas_pen {
@@ -57,6 +58,8 @@
char *font_color_name;
GdkColor *font_native_color;
+
+ int size;
};
@@ -113,20 +116,24 @@
(const char *text, int size, int *width,
int *ascent, int *descent, int *can_tilt) {
+ size = CurrentPen->size;
PangoRectangle rectangle;
+ PangoFontDescription *desc;
+ char fontname[50];
if (RoadMapLayout == NULL) {
- PangoFontDescription *desc;
RoadMapLayout = gtk_widget_create_pango_layout
(GTK_WIDGET(RoadMapDrawingArea), text);
RoadMapContext = gtk_widget_get_pango_context(GTK_WIDGET(RoadMapDrawingArea));
pango_layout_set_width (RoadMapLayout, -1);
-
- desc = pango_font_description_from_string ("Sans Bold 15");
- pango_layout_set_font_description (RoadMapLayout, desc);
- pango_font_description_free (desc);
}
+ snprintf(fontname, sizeof(fontname), "Liberation Sans Bold %d",
+ size < 0 ? DEFAULT_FONT_SIZE : size);
+ desc = pango_font_description_from_string (fontname);
+ pango_layout_set_font_description (RoadMapLayout, desc);
+ pango_font_description_free (desc);
+
pango_layout_set_text (RoadMapLayout, text, -1);
pango_layout_get_extents (RoadMapLayout, NULL, &rectangle);
@@ -182,6 +189,8 @@
pen->font_native_color = (GdkColor *) g_malloc (sizeof(GdkColor));
memcpy(pen->font_native_color, pen->native_color, sizeof(GdkColor));
+ pen->size = DEFAULT_FONT_SIZE;
+
RoadMapPenList = pen;
}
@@ -212,6 +221,9 @@
}
void roadmap_canvas_set_label_font_size(int size) {
+ if (!CurrentPen) return;
+ CurrentPen->size = size;
+ roadmap_canvas_select_pen(CurrentPen);
}
void roadmap_canvas_set_linestyle (const char *style) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-10 19:19:11
|
Revision: 2852
http://sourceforge.net/p/roadmap/code/2852
Author: pgf
Date: 2015-06-10 19:19:08 +0000 (Wed, 10 Jun 2015)
Log Message:
-----------
roadmap.screenobjects: clicking gps object now brings up gps console
Modified Paths:
--------------
trunk/roadmap/src/roadmap.screenobjects
Modified: trunk/roadmap/src/roadmap.screenobjects
===================================================================
--- trunk/roadmap/src/roadmap.screenobjects 2015-06-09 23:03:59 UTC (rev 2851)
+++ trunk/roadmap/src/roadmap.screenobjects 2015-06-10 19:19:08 UTC (rev 2852)
@@ -70,7 +70,7 @@
E reception_none %v/%s
E reception_poor %v/%s
E reception_good %v/%s
-A gps
+A gpsconsole
R
# When the Download object is visible, it indicates that RoadMap is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 23:04:00
|
Revision: 2851
http://sourceforge.net/p/roadmap/code/2851
Author: pgf
Date: 2015-06-09 23:03:59 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
gtk2/roadmap_messagebox: don't destroy NULL widgets
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_messagebox.c
Modified: trunk/roadmap/src/gtk2/roadmap_messagebox.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_messagebox.c 2015-06-09 22:05:43 UTC (rev 2850)
+++ trunk/roadmap/src/gtk2/roadmap_messagebox.c 2015-06-09 23:03:59 UTC (rev 2851)
@@ -40,7 +40,8 @@
void roadmap_messagebox_hide (void *handle) {
- gtk_widget_destroy ((GtkWidget *)handle);
+ if (handle)
+ gtk_widget_destroy ((GtkWidget *)handle);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:45
|
Revision: 2850
http://sourceforge.net/p/roadmap/code/2850
Author: pgf
Date: 2015-06-09 22:05:43 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
buildmap_osm: add support to display reservoirs
Modified Paths:
--------------
trunk/roadmap/src/buildmap_osm_common.c
trunk/roadmap/src/buildmap_osm_text.c
Modified: trunk/roadmap/src/buildmap_osm_common.c
===================================================================
--- trunk/roadmap/src/buildmap_osm_common.c 2015-06-09 22:05:40 UTC (rev 2849)
+++ trunk/roadmap/src/buildmap_osm_common.c 2015-06-09 22:05:43 UTC (rev 2850)
@@ -294,6 +294,10 @@
{ 0, NULL, 0 },
};
+layer_info_t landuse_to_layer[] = {
+ { "reservoir", LAKE, AREA },
+};
+
layer_info_t waterway_to_layer[] = {
{ 0, NULL, 0 },
{ "river", RIVER, 0 }, /* 1 */
@@ -645,7 +649,7 @@
{"shop", NULL, NULL },
{"tourism", NULL, NULL },
{"historic", historic_to_layer, NULL },
- {"landuse", NULL, NULL },
+ {"landuse", landuse_to_layer, NULL },
{"military", NULL, NULL },
{"natural", natural_to_layer, NULL },
{"route", NULL, NULL },
Modified: trunk/roadmap/src/buildmap_osm_text.c
===================================================================
--- trunk/roadmap/src/buildmap_osm_text.c 2015-06-09 22:05:40 UTC (rev 2849)
+++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-09 22:05:43 UTC (rev 2850)
@@ -688,11 +688,6 @@
return;
}
- if (strcasecmp(tag, "landuse") == 0) {
- wi.WayIsInteresting = 0;
- return;
- }
-
if (strcasecmp(tag, "oneway") == 0 && strcasecmp(value, "yes") == 0) {
wi.WayIsOneWay = ROADMAP_LINE_DIRECTION_ONEWAY;
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:42
|
Revision: 2849
http://sourceforge.net/p/roadmap/code/2849
Author: pgf
Date: 2015-06-09 22:05:40 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
gtk2/roadmap_canvas.c: implement label font colors
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_canvas.c
Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:37 UTC (rev 2848)
+++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:40 UTC (rev 2849)
@@ -51,6 +51,12 @@
char *name;
GdkLineStyle style;
GdkGC *gc;
+
+ char *color_name;
+ GdkColor *native_color;
+
+ char *font_color_name;
+ GdkColor *font_native_color;
};
@@ -136,6 +142,7 @@
RoadMapPen old_pen = CurrentPen;
CurrentPen = pen;
+ gdk_gc_set_foreground (pen->gc, CurrentPen->native_color);
RoadMapGc = pen->gc;
return old_pen;
}
@@ -167,7 +174,14 @@
pen->gc = gc;
pen->style = GDK_LINE_SOLID;
pen->next = RoadMapPenList;
+ pen->color_name = pen->font_color_name = 0;
+ pen->native_color = (GdkColor *) g_malloc (sizeof(GdkColor));
+ gdk_color_parse ("black", pen->native_color);
+ gdk_color_alloc (gdk_colormap_get_system(), pen->native_color);
+ pen->font_native_color = (GdkColor *) g_malloc (sizeof(GdkColor));
+ memcpy(pen->font_native_color, pen->native_color, sizeof(GdkColor));
+
RoadMapPenList = pen;
}
@@ -179,19 +193,22 @@
void roadmap_canvas_set_foreground (const char *color) {
- static GdkColor *native_color;
+ if (!CurrentPen) return;
- if (native_color == NULL) {
- native_color = (GdkColor *) g_malloc (sizeof(GdkColor));
- }
+ CurrentPen->color_name = strdup (color);
- gdk_color_parse (color, native_color);
- gdk_color_alloc (gdk_colormap_get_system(), native_color);
-
- gdk_gc_set_foreground (RoadMapGc, native_color);
+ gdk_color_parse (color, CurrentPen->native_color);
+ gdk_color_alloc (gdk_colormap_get_system(), CurrentPen->native_color);
}
void roadmap_canvas_set_label_font_color(const char *color) {
+
+ if (!CurrentPen) return;
+
+ CurrentPen->font_color_name = strdup (color);
+
+ gdk_color_parse (color, CurrentPen->font_native_color);
+ gdk_color_alloc (gdk_colormap_get_system(), CurrentPen->font_native_color);
}
void roadmap_canvas_set_label_font_size(int size) {
@@ -284,6 +301,7 @@
else /* TOP */
start->y += text_ascent;
+ gdk_gc_set_foreground (CurrentPen->gc, CurrentPen->font_native_color);
gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
start->x, start->y, RoadMapLayout);
}
@@ -354,6 +372,7 @@
(text_height * angle / 90);
}
#endif
+ gdk_gc_set_foreground (CurrentPen->gc, CurrentPen->font_native_color);
gdk_draw_layout(RoadMapDrawingBuffer, RoadMapGc,
start->x, start->y, RoadMapLayout);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:39
|
Revision: 2848
http://sourceforge.net/p/roadmap/code/2848
Author: pgf
Date: 2015-06-09 22:05:37 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
gtk2/roadmap_canvas.c: use our sin/cos when rotating
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_canvas.c
Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:33 UTC (rev 2847)
+++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:37 UTC (rev 2848)
@@ -242,7 +242,22 @@
RoadMapDrawingArea->allocation.height);
}
+void
+roadmap_pango_matrix_rotate (PangoMatrix *matrix,
+ int degrees, int sine, int cosine)
+{
+ PangoMatrix tmp;
+ tmp.xx = cosine/32768.;
+ tmp.xy = sine/32768.;
+ tmp.yx = -sine/32768.;
+ tmp.yy = cosine/32768.;
+ tmp.x0 = 0;
+ tmp.y0 = 0;
+
+ pango_matrix_concat (matrix, &tmp);
+}
+
void roadmap_canvas_draw_string (RoadMapGuiPoint *position,
int corner, int size, const char *text) {
@@ -295,22 +310,23 @@
angle = -angle;
- fprintf(stderr, "position: x %d y %d\n", position->x, position->y);
- fprintf(stderr, "%s @ %d degrees: width %d ascent %d descent %d\n",
- text, angle, text_width, text_ascent, text_descent);
+ // fprintf(stderr, "position: x %d y %d\n", position->x, position->y);
+ // fprintf(stderr, "%s @ %d degrees: width %d ascent %d descent %d\n",
+ // text, angle, text_width, text_ascent, text_descent);
start->x = position->x;
start->y = position->y - text_height;
roadmap_math_trigonometry (angle, &sine, &cosine);
- fprintf(stderr, "a %d cos(a) %d sin(a) %d", angle, cosine, sine);
+ // fprintf(stderr, "a %d cos(a) %d sin(a) %d", angle, cosine, sine);
// scaling works fine, and obviously so does rotation.
// but i can't get translations to have any affect whatsoever. :-/
pango_matrix_translate (&matrix, 0, (text_ascent + text_descent));
- pango_matrix_rotate(&matrix, (double) (angle));
+ // pango_matrix_rotate(&matrix, angle);
+ roadmap_pango_matrix_rotate(&matrix, angle, sine, cosine);
pango_context_set_matrix(RoadMapContext, &matrix);
pango_layout_context_changed(RoadMapLayout);
@@ -333,7 +349,7 @@
(text_height * angle / 90);
} else {
start->x = start->x - (width/2 * cosine / 32768) -
- (text_height * 140 * angle / 90 / 100);
+ (text_height * 120 * angle / 90 / 100);
start->y = start->y - (width/2 * sine / 32768) +
(text_height * angle / 90);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:36
|
Revision: 2847
http://sourceforge.net/p/roadmap/code/2847
Author: pgf
Date: 2015-06-09 22:05:33 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
gtk2/roadmap_canvas.c: fix label positions
this involves a bunch of trickery to get the rotated labels into
the right position on the screen. if we switched to using a
cairo surface rather than a pixmap to draw the image on, i think
we could position the label just where we want it without the magic.
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_canvas.c
Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:30 UTC (rev 2846)
+++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-09 22:05:33 UTC (rev 2847)
@@ -33,6 +33,7 @@
#include "roadmap.h"
#include "roadmap_types.h"
#include "roadmap_gui.h"
+#include "roadmap_math.h"
#include "roadmap_canvas.h"
#include "roadmap_gtkcanvas.h"
@@ -109,19 +110,24 @@
PangoRectangle rectangle;
if (RoadMapLayout == NULL) {
+ PangoFontDescription *desc;
RoadMapLayout = gtk_widget_create_pango_layout
(GTK_WIDGET(RoadMapDrawingArea), text);
RoadMapContext = gtk_widget_get_pango_context(GTK_WIDGET(RoadMapDrawingArea));
pango_layout_set_width (RoadMapLayout, -1);
+
+ desc = pango_font_description_from_string ("Sans Bold 15");
+ pango_layout_set_font_description (RoadMapLayout, desc);
+ pango_font_description_free (desc);
}
+
pango_layout_set_text (RoadMapLayout, text, -1);
pango_layout_get_extents (RoadMapLayout, NULL, &rectangle);
- *width = 3 * rectangle.width / 2 / PANGO_SCALE;
- *ascent = 3 * PANGO_ASCENT(rectangle) / 2 / PANGO_SCALE;
- *descent = 3 * PANGO_DESCENT(rectangle) / 2 / PANGO_SCALE;
- // if (can_tilt) *can_tilt = 0;
+ *width = rectangle.width / PANGO_SCALE;
+ *ascent = PANGO_ASCENT(rectangle) / PANGO_SCALE;
+ *descent = PANGO_DESCENT(rectangle) / PANGO_SCALE;
if (can_tilt) *can_tilt = 1;
}
@@ -250,6 +256,7 @@
start->x = position->x;
start->y = position->y;
+
if (corner & ROADMAP_CANVAS_RIGHT)
start->x -= text_width;
else if (corner & ROADMAP_CANVAS_CENTER_X)
@@ -266,103 +273,78 @@
start->x, start->y, RoadMapLayout);
}
-#ifdef TRY_DRAWING_LABELS_WITH_GTK_LABEL
-void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *center,
- int size,
- int angle, const char *text)
+
+void
+roadmap_canvas_draw_string_angle(RoadMapGuiPoint *position,
+ int size, int angle, const char *text)
{
- int text_width;
- int text_ascent;
- int text_descent;
- RoadMapGuiPoint start[1];
- GtkWidget *layout;
- GtkWidget *label;
+ int text_width;
+ int text_height;
+ int text_ascent;
+ int text_descent;
+ int width, height;
+ int sine, cosine;
+ RoadMapGuiPoint start[1];
+ PangoMatrix matrix = PANGO_MATRIX_INIT;
+ PangoMatrix init_matrix = PANGO_MATRIX_INIT;
- layout = gtk_layout_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (RoadMapDrawingArea), layout);
- roadmap_canvas_get_text_extents
+ roadmap_canvas_get_text_extents
(text, size, &text_width, &text_ascent, &text_descent, NULL);
- roadmap_log(ROADMAP_WARNING, "%s @ %d: w %d a %d d %d\n",text, angle,
- text_width, text_ascent, text_descent);
+ text_height = (text_ascent + text_descent);
- start->x = center->x;
- start->y = center->y;
- label = gtk_label_new (text);
- gtk_label_set_angle(GTK_LABEL(label),angle);
+ angle = -angle;
- gtk_layout_put (GTK_LAYOUT (layout), label, start->x, start->y);
+ fprintf(stderr, "position: x %d y %d\n", position->x, position->y);
+ fprintf(stderr, "%s @ %d degrees: width %d ascent %d descent %d\n",
+ text, angle, text_width, text_ascent, text_descent);
- //gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
- // start->x, start->y, RoadMapLayout);
-}
-#endif
+ start->x = position->x;
+ start->y = position->y - text_height;
+
-void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *center,
- int size,
- int angle, const char *text)
-{
- int text_width;
- int text_ascent;
- int text_descent;
- RoadMapGuiPoint start[1];
- PangoMatrix matrix = PANGO_MATRIX_INIT;
- PangoMatrix init_matrix = PANGO_MATRIX_INIT;
- // PangoRenderer *renderer;
- // int width, height;
+ roadmap_math_trigonometry (angle, &sine, &cosine);
+ fprintf(stderr, "a %d cos(a) %d sin(a) %d", angle, cosine, sine);
- roadmap_canvas_get_text_extents
- (text, size, &text_width, &text_ascent, &text_descent, NULL);
- start->x = center->x - text_width/2;;
- start->y = center->y - text_descent;
+ // scaling works fine, and obviously so does rotation.
+ // but i can't get translations to have any affect whatsoever. :-/
+ pango_matrix_translate (&matrix, 0, (text_ascent + text_descent));
+ pango_matrix_rotate(&matrix, (double) (angle));
-#if 0
- roadmap_log(ROADMAP_WARNING, "%s @ %d: w %d a %d d %d\n",text, angle,
- text_width, text_ascent, text_descent);
- roadmap_log(ROADMAP_WARNING, "rcdsa: x %d y %d\n",start->x, start->y);
-#endif
+ pango_context_set_matrix(RoadMapContext, &matrix);
+ pango_layout_context_changed(RoadMapLayout);
+ pango_layout_get_size (RoadMapLayout, &width, &height);
+ width /= PANGO_SCALE;
-#ifdef DRAW_HORIZONTAL_LABELS // for reference, while debugging
- // pango_matrix_scale (&matrix, 1.5,1.5);
- pango_context_set_matrix (RoadMapContext, &matrix);
- pango_layout_context_changed (RoadMapLayout);
- gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
- start->x, start->y, RoadMapLayout);
+#if 1
+ /* major hacks ahead. gdk_draw_layout doesn't fully honor
+ * the pango matrix transform. we can't use
+ * pango_renderer_draw_layout() instead, because it
+ * won't render to a GdkPixmap (that i can find).
+ * so we adjust the position of the rotated text in
+ * a few ad-hoc ways, and the result is reasonable.
+ * not great, just reasonable.
+ */
+ if (angle < 0) {
+ start->x = start->x - (width/2 * cosine / 32768);
+ start->y = start->y + (width/2 * sine / 32768) -
+ (text_height * angle / 90);
+ } else {
+ start->x = start->x - (width/2 * cosine / 32768) -
+ (text_height * 140 * angle / 90 / 100);
+ start->y = start->y - (width/2 * sine / 32768) +
+ (text_height * angle / 90);
+ }
#endif
- // i can't get translations to have any affect whatsoever. :-/
- // pango_matrix_translate (&matrix, 100.,100.);
- pango_matrix_scale (&matrix, 1.5, 1.5);
- if (angle > 0) {
- angle = -angle;
- start->x = center->x;
- start->y = center->y - text_descent/2;
- } else if (angle < 0) {
- angle = -angle;
- start->x = center->x - text_width /2;
- if (angle > 70) // heuristic is latin for "hack", right?
- start->x = center->x - text_width / 4;
- start->y = center->y - text_descent/2;
- }
- // renderer = gdk_pango_renderer_get_default (gtk_widget_get_screen (RoadMapDrawingArea));
- // gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), RoadMapDrawingArea->window);
- // gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), RoadMapDrawingArea->style->black_gc);
- pango_matrix_rotate (&matrix, (double)(angle));
- pango_context_set_matrix (RoadMapContext, &matrix);
+ gdk_draw_layout(RoadMapDrawingBuffer, RoadMapGc,
+ start->x, start->y, RoadMapLayout);
- pango_layout_context_changed (RoadMapLayout);
- // pango_layout_get_size (RoadMapLayout, &width, &height);
- // roadmap_log(ROADMAP_WARNING, "plgs: w %d h %d\n",width, height);
- // pango_renderer_draw_layout (renderer, RoadMapLayout,
- // width/2, height/2);
- // start->x, start->y);
- gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
- start->x, start->y, RoadMapLayout);
-
- pango_context_set_matrix (RoadMapContext, &init_matrix);
- pango_layout_context_changed (RoadMapLayout);
+ // reset
+ pango_context_set_matrix(RoadMapContext, &init_matrix);
+ pango_layout_context_changed(RoadMapLayout);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:33
|
Revision: 2846
http://sourceforge.net/p/roadmap/code/2846
Author: pgf
Date: 2015-06-09 22:05:30 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
roadmap_label: request that labels be bottom-centered
this change has no real effect on either of the two gtk2
builds, but it's the right thing to request. haven't tried others.
also save/restore the pen when drawing the debug polyline boxes.
Modified Paths:
--------------
trunk/roadmap/src/roadmap_label.c
Modified: trunk/roadmap/src/roadmap_label.c
===================================================================
--- trunk/roadmap/src/roadmap_label.c 2015-06-09 22:05:27 UTC (rev 2845)
+++ trunk/roadmap/src/roadmap_label.c 2015-06-09 22:05:30 UTC (rev 2846)
@@ -250,7 +250,7 @@
(ROADMAP_TEXT_LABELS, pos, angle, size, text);
} else {
roadmap_screen_text
- (ROADMAP_TEXT_LABELS, pos, ROADMAP_CANVAS_CENTER, size, text);
+ (ROADMAP_TEXT_LABELS, pos, ROADMAP_CANVAS_CENTER_BOTTOM, size, text);
}
}
@@ -585,6 +585,7 @@
#if POLY_OUTLINE
{
int lines = 4;
+ RoadMapPen pen = roadmap_canvas_select_pen (RoadMapLabelPen);
if (!angles) {
cPtr->poly[0].x = cPtr->bbox.minx;
cPtr->poly[0].y = cPtr->bbox.miny;
@@ -596,6 +597,7 @@
cPtr->poly[3].y = cPtr->bbox.miny;
}
roadmap_canvas_draw_multiple_lines(1, &lines, cPtr->poly, 1);
+ pen = roadmap_canvas_select_pen (pen);
}
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-09 22:05:29
|
Revision: 2845
http://sourceforge.net/p/roadmap/code/2845
Author: pgf
Date: 2015-06-09 22:05:27 +0000 (Tue, 09 Jun 2015)
Log Message:
-----------
roadmap_math: publish sine/cosine lookup available externally
Modified Paths:
--------------
trunk/roadmap/src/roadmap_math.c
trunk/roadmap/src/roadmap_math.h
Modified: trunk/roadmap/src/roadmap_math.c
===================================================================
--- trunk/roadmap/src/roadmap_math.c 2015-06-06 17:29:11 UTC (rev 2844)
+++ trunk/roadmap/src/roadmap_math.c 2015-06-09 22:05:27 UTC (rev 2845)
@@ -183,7 +183,7 @@
* @param sine_p
* @param cosine_p
*/
-static void roadmap_math_trigonometry (int angle, int *sine_p, int *cosine_p) {
+void roadmap_math_trigonometry (int angle, int *sine_p, int *cosine_p) {
int i = angle % 90;
int sine;
Modified: trunk/roadmap/src/roadmap_math.h
===================================================================
--- trunk/roadmap/src/roadmap_math.h 2015-06-06 17:29:11 UTC (rev 2844)
+++ trunk/roadmap/src/roadmap_math.h 2015-06-09 22:05:27 UTC (rev 2845)
@@ -193,4 +193,6 @@
int *total_length);
#endif
+void roadmap_math_trigonometry (int angle, int *sine_p, int *cosine_p);
+
#endif // INCLUDED__ROADMAP_MATH__H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:29:20
|
Revision: 2844
http://sourceforge.net/p/roadmap/code/2844
Author: pgf
Date: 2015-06-06 17:29:11 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
buildmap_line: add ifdef to disable navigation-enabling tables
if we're not including navigation in roadmap, there's no point
in including it in the maps. one example map grows by 60% when
including the extra tables.
Modified Paths:
--------------
trunk/roadmap/src/buildmap_line.c
Modified: trunk/roadmap/src/buildmap_line.c
===================================================================
--- trunk/roadmap/src/buildmap_line.c 2015-06-06 17:29:08 UTC (rev 2843)
+++ trunk/roadmap/src/buildmap_line.c 2015-06-06 17:29:11 UTC (rev 2844)
@@ -21,6 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#undef BUILDMAP_NAVIGATION_SUPPORT
+
/**
* @file
* @brief convert a map into a table of lines.
@@ -48,7 +50,9 @@
typedef struct {
RoadMapLine record;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
RoadMapLine2 data2;
+#endif
int tlid;
int sorted;
int layer;
@@ -70,15 +74,18 @@
static int *SortedLine2 = NULL;
static void buildmap_line_register (void);
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
static void buildmap_line_add_bypoint(int, int);
static void buildmap_line_count_linebypoint(int *LineByPoint1Count, int *LineByPoint2Count);
static void buildmap_line_transform_linebypoint(RoadMapLineByPoint1 *, RoadMapLineByPoint2 *);
+#endif
#define MAX_LONG_LINES 150000
static RoadMapLongLine *LongLines;
static int LongLinesCount;
static RoadMapHash *LongLinesHash = NULL;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
/*
* @brief Line By Point stuff
* This structure holds info about a point : it gathers the line
@@ -99,6 +106,7 @@
#define ALLOC_LINES 5 /**< increment allocation of ptr by this amount */
#define ALLOC_POINTS 100 /**< increment allocation of lbp by this amount */
+#endif
/**
@@ -248,17 +256,21 @@
this_line->record.from = from;
this_line->record.to = to;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
this_line->data2.oneway = oneway;
this_line->data2.layer = layer;
+#endif
roadmap_hash_add (LineById, tlid, LineCount);
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
/*
* This adds info, but they will look wrong if you compare them with the
* end result : transformation happens when "sorting".
*/
buildmap_line_add_bypoint(from, LineCount);
buildmap_line_add_bypoint(to, LineCount);
+#endif
return LineCount++;
}
@@ -649,14 +661,18 @@
int *db_layer2;
int *db_index2;
RoadMapLine *db_lines;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
RoadMapLine2 *db_lines2;
+#endif
RoadMapLineBySquare *db_square1;
RoadMapLineBySquare *db_square2;
RoadMapLongLine *db_long_lines;
buildmap_db *root;
buildmap_db *data_table;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
buildmap_db *data2_table;
+#endif
buildmap_db *square1_table;
buildmap_db *layer1_table;
buildmap_db *square2_table;
@@ -664,11 +680,13 @@
buildmap_db *layer2_table;
buildmap_db *index2_table;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
/* Navigation support */
int LineByPoint1Count = 0, LineByPoint2Count = 0;
RoadMapLineByPoint1 *db_line_bypoint1;
RoadMapLineByPoint2 *db_line_bypoint2;
buildmap_db *line_bypoint1_table, *line_bypoint2_table;
+#endif
if (!LineCount) {
buildmap_error (0, "LineCount is 0");
@@ -807,12 +825,14 @@
}
buildmap_db_add_data (data_table, LineCount, sizeof(RoadMapLine));
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
data2_table = buildmap_db_add_section (root, "data2");
if (data2_table == NULL) {
buildmap_error (0, "Can't add a new section");
return 1;
}
buildmap_db_add_data (data2_table, LineCount, sizeof(RoadMapLine2));
+#endif
square1_table = buildmap_db_add_section (root, "bysquare1");
if (square1_table == NULL) {
@@ -860,6 +880,7 @@
}
buildmap_db_add_data (index2_table, LineCrossingCount, sizeof(int));
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
buildmap_line_count_linebypoint(&LineByPoint1Count, &LineByPoint2Count);
line_bypoint1_table = buildmap_db_add_section (root, "bypoint1");
if (line_bypoint1_table == NULL) {
@@ -874,17 +895,22 @@
return 1;
}
buildmap_db_add_data (line_bypoint2_table, LineByPoint2Count, sizeof(int));
+#endif
db_lines = (RoadMapLine *) buildmap_db_get_data (data_table);
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
db_lines2 = (RoadMapLine2 *) buildmap_db_get_data (data2_table);
+#endif
db_square1 = (RoadMapLineBySquare *) buildmap_db_get_data (square1_table);
db_layer1 = (int *) buildmap_db_get_data (layer1_table);
db_square2 = (RoadMapLineBySquare *) buildmap_db_get_data (square2_table);
db_long_lines = (RoadMapLongLine *) buildmap_db_get_data (long_lines_table);
db_layer2 = (int *) buildmap_db_get_data (layer2_table);
db_index2 = (int *) buildmap_db_get_data (index2_table);
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
db_line_bypoint1 = (RoadMapLineByPoint1 *) buildmap_db_get_data (line_bypoint1_table);
db_line_bypoint2 = (RoadMapLineByPoint2 *) buildmap_db_get_data (line_bypoint2_table);
+#endif
square_current = -1;
@@ -898,7 +924,9 @@
one_line = Line[j/BUILDMAP_BLOCK] + (j % BUILDMAP_BLOCK);
db_lines[i] = one_line->record;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
db_lines2[i] = one_line->data2;
+#endif
square = one_line->square_from;
@@ -1006,7 +1034,9 @@
memcpy (db_long_lines, LongLines, LongLinesCount * sizeof (RoadMapLongLine));
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
buildmap_line_transform_linebypoint(db_line_bypoint1, db_line_bypoint2);
+#endif
return 0;
}
@@ -1047,10 +1077,12 @@
roadmap_hash_delete (LineById);
LineById = NULL;
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
free(lbp);
lbp = 0;
max_line_by_point = 0;
nalloc_line_by_point = 0;
+#endif
}
/**
@@ -1071,6 +1103,7 @@
buildmap_db_register (&BuildMapLineModule);
}
+#ifdef BUILDMAP_NAVIGATION_SUPPORT
/**
* @brief Line By Point support : announce that this line starts or ends at this point
* @param point the point
@@ -1204,3 +1237,4 @@
*LineByPoint1Count = max_line_by_point;
*LineByPoint2Count = cnt;
}
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:29:10
|
Revision: 2843
http://sourceforge.net/p/roadmap/code/2843
Author: pgf
Date: 2015-06-06 17:29:08 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
roadmap_screen: draw place sprites "fast", i.e. no anti-aliasing
this gives a noticeable redraw improvement, at least on slow machines.
AGG is beautiful, but expensive.
Modified Paths:
--------------
trunk/roadmap/src/roadmap_screen.c
Modified: trunk/roadmap/src/roadmap_screen.c
===================================================================
--- trunk/roadmap/src/roadmap_screen.c 2015-06-06 17:29:05 UTC (rev 2842)
+++ trunk/roadmap/src/roadmap_screen.c 2015-06-06 17:29:08 UTC (rev 2843)
@@ -1287,12 +1287,15 @@
/* Draw each place that belongs to this square. */
if (roadmap_place_in_square (square, layer, &first_place, &last_place) > 0) {
+ int sprites_were_fast;
layer_pen = roadmap_layer_get_pen (layer, pen_index);
if (layer_pen == NULL) return 0;
layer_sprite = roadmap_layer_sprite(layer);
labels_visible = roadmap_layer_labels_visible(layer);
+ sprites_were_fast = roadmap_sprite_set_fast_draw(1);
+
for (place = first_place; place <= last_place; ++place) {
RoadMapPosition pos;
RoadMapGuiPoint guipoint;
@@ -1318,6 +1321,9 @@
drawn += 1;
}
}
+
+ roadmap_sprite_set_fast_draw(sprites_were_fast);
+
}
roadmap_log_pop ();
@@ -2331,6 +2337,7 @@
roadmap_linefont_text_angle ( center, size, theta, text);
} else {
roadmap_canvas_draw_string_angle ( center, size, theta, text);
+ // roadmap_sprite_draw ("PurpleCross", center, 0);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:29:07
|
Revision: 2842
http://sourceforge.net/p/roadmap/code/2842
Author: pgf
Date: 2015-06-06 17:29:05 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
sprites: improve appearance of Cup and Plate when drawn "fast"
Modified Paths:
--------------
trunk/roadmap/src/sprites
Modified: trunk/roadmap/src/sprites
===================================================================
--- trunk/roadmap/src/sprites 2015-06-06 17:29:02 UTC (rev 2841)
+++ trunk/roadmap/src/sprites 2015-06-06 17:29:05 UTC (rev 2842)
@@ -552,7 +552,7 @@
F white 1
P -5,-2 -3,7 3,7 5,-2
F black 2
-L -5,-2 -3,7 3,7 5,-2 -5,-2
+L -5,-2 -2,7 2,7 5,-2 -5,-2
L -6,7 6,7
S Money
@@ -567,13 +567,14 @@
D 5,2 1
S Plate
-F white 1
-D 1,4 5
F green 2
-C 1,4 6
+D 1,4 6
L -8,-2 -8,9
L -9,-2 -9,1 -8,2 -7,1 -7,-2
L 10,-2 10,9
+L 9,-2 9,4
+F white 1
+D 1,4 5
S FuelPump
F red 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:29:05
|
Revision: 2841
http://sourceforge.net/p/roadmap/code/2841
Author: pgf
Date: 2015-06-06 17:29:02 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
roadmap_sprite: add ability to do un-anti-aliased drawing
with a huge number of POI sprites present, they can take a noticeable
amount of cpu power to draw.
unused, for now.
Modified Paths:
--------------
trunk/roadmap/src/roadmap_sprite.c
trunk/roadmap/src/roadmap_sprite.h
Modified: trunk/roadmap/src/roadmap_sprite.c
===================================================================
--- trunk/roadmap/src/roadmap_sprite.c 2015-06-06 17:28:59 UTC (rev 2840)
+++ trunk/roadmap/src/roadmap_sprite.c 2015-06-06 17:29:02 UTC (rev 2841)
@@ -41,6 +41,8 @@
#include "roadmap_screen.h"
#include "roadmap_label.h"
+static int RoadMapSpriteFastDraw;
+
static RoadMapConfigDescriptor RoadMapConfigSpritePercent =
ROADMAP_CONFIG_ITEM ("General", "Sprite Scale");
static int RoadMapSpritePercent;
@@ -859,7 +861,7 @@
roadmap_canvas_draw_multiple_polygons
(plane->polygons.object_count,
- plane->polygons.obj.objects, RoadMapSpritePoints, 1, 0);
+ plane->polygons.obj.objects, RoadMapSpritePoints, 1, RoadMapSpriteFastDraw);
}
if (textseq != NULL && plane->flags & SPRITE_TEXT_RECTANGLE) {
@@ -870,7 +872,7 @@
(textpoly, location, -roadmap_math_get_orientation(), scale);
roadmap_canvas_draw_multiple_polygons
(textpoly->object_count,
- textpoly->obj.objects, RoadMapSpritePoints, 1, 0);
+ textpoly->obj.objects, RoadMapSpritePoints, 1, RoadMapSpriteFastDraw);
}
if (plane->disks.object_count > 0) {
@@ -881,7 +883,7 @@
(plane->disks.object_count,
RoadMapSpritePoints,
roadmap_sprite_scale_diameters(&(plane->disks), scale),
- 1, 0);
+ 1, RoadMapSpriteFastDraw);
}
if (plane->lines.object_count > 0) {
@@ -890,7 +892,7 @@
roadmap_canvas_draw_multiple_lines
(plane->lines.object_count,
- plane->lines.obj.objects, RoadMapSpritePoints, 0);
+ plane->lines.obj.objects, RoadMapSpritePoints, RoadMapSpriteFastDraw);
}
if (textseq != NULL && plane->flags & SPRITE_TEXT_BOX) {
@@ -901,7 +903,7 @@
(textrect, location, -roadmap_math_get_orientation(), scale);
roadmap_canvas_draw_multiple_lines
(textrect->object_count,
- textrect->obj.objects, RoadMapSpritePoints, 0);
+ textrect->obj.objects, RoadMapSpritePoints, RoadMapSpriteFastDraw);
}
@@ -915,7 +917,7 @@
(plane->circles.object_count,
RoadMapSpritePoints,
roadmap_sprite_scale_diameters(&(plane->circles), scale),
- 0, 0);
+ 0, RoadMapSpriteFastDraw);
}
if (textseq != NULL && plane->flags & SPRITE_TEXT) {
@@ -1035,6 +1037,12 @@
}
+int roadmap_sprite_set_fast_draw(int fastdraw) {
+ int tmp = RoadMapSpriteFastDraw;
+ RoadMapSpriteFastDraw = fastdraw;
+ return tmp;
+}
+
/**
* @brief cleanup
*/
Modified: trunk/roadmap/src/roadmap_sprite.h
===================================================================
--- trunk/roadmap/src/roadmap_sprite.h 2015-06-06 17:28:59 UTC (rev 2840)
+++ trunk/roadmap/src/roadmap_sprite.h 2015-06-06 17:29:02 UTC (rev 2841)
@@ -41,6 +41,9 @@
RoadMapGuiRect *bbox, RoadMapGuiRect *text_bbox, char *text);
void roadmap_sprite_bbox (const char *name, RoadMapGuiRect *bbox);
+
+int roadmap_sprite_set_fast_draw(int fastdraw);
+
void roadmap_sprite_shutdown (void);
#endif // INCLUDE__ROADMAP_CANVAS__H
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:29:01
|
Revision: 2840
http://sourceforge.net/p/roadmap/code/2840
Author: pgf
Date: 2015-06-06 17:28:59 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
gtk2/roadmap_canvas.c: attempt to do angled labels with pango
this really doesn't work well -- i'm clearly doing something wrong.
the rotation works very differently whether the angle is positive (rotates
around left end of string) or negative (rotates around right end, but
with a sliding effect). i also can't get pango translations to work
at all. so this code works, but is ugly/unfinished.
Modified Paths:
--------------
trunk/roadmap/src/gtk2/roadmap_canvas.c
Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c
===================================================================
--- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-06 17:28:56 UTC (rev 2839)
+++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-06-06 17:28:59 UTC (rev 2840)
@@ -36,6 +36,7 @@
#include "roadmap_canvas.h"
#include "roadmap_gtkcanvas.h"
+#include "gtk/gtk.h"
#define ROADMAP_CURSOR_SIZE 10
@@ -61,6 +62,7 @@
static RoadMapPen CurrentPen;
static PangoLayout *RoadMapLayout = NULL;
+static PangoContext *RoadMapContext = NULL;
/* The canvas callbacks: all callbacks are initialized to do-nothing
@@ -109,16 +111,18 @@
if (RoadMapLayout == NULL) {
RoadMapLayout = gtk_widget_create_pango_layout
(GTK_WIDGET(RoadMapDrawingArea), text);
+ RoadMapContext = gtk_widget_get_pango_context(GTK_WIDGET(RoadMapDrawingArea));
pango_layout_set_width (RoadMapLayout, -1);
}
pango_layout_set_text (RoadMapLayout, text, -1);
pango_layout_get_extents (RoadMapLayout, NULL, &rectangle);
- *width = rectangle.width / PANGO_SCALE;
- *ascent = PANGO_ASCENT(rectangle) / PANGO_SCALE;
- *descent = PANGO_DESCENT(rectangle) / PANGO_SCALE;
- if (can_tilt) *can_tilt = 0;
+ *width = 3 * rectangle.width / 2 / PANGO_SCALE;
+ *ascent = 3 * PANGO_ASCENT(rectangle) / 2 / PANGO_SCALE;
+ *descent = 3 * PANGO_DESCENT(rectangle) / 2 / PANGO_SCALE;
+ // if (can_tilt) *can_tilt = 0;
+ if (can_tilt) *can_tilt = 1;
}
@@ -181,7 +185,12 @@
gdk_gc_set_foreground (RoadMapGc, native_color);
}
+void roadmap_canvas_set_label_font_color(const char *color) {
+}
+void roadmap_canvas_set_label_font_size(int size) {
+}
+
void roadmap_canvas_set_linestyle (const char *style) {
if (strcasecmp (style, "dashed") == 0) {
@@ -210,8 +219,6 @@
void roadmap_canvas_set_brush_isbackground(int isbackground) {}
void roadmap_canvas_set_label_font_name(const char *name) {}
-void roadmap_canvas_set_label_font_color(const char *color) {}
-void roadmap_canvas_set_label_font_size(int size) {}
void roadmap_canvas_set_label_font_spacing(int spacing) {}
void roadmap_canvas_set_label_font_weight(const char *weight) {}
void roadmap_canvas_set_label_font_style(int style) {}
@@ -259,16 +266,106 @@
start->x, start->y, RoadMapLayout);
}
-void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *position,
+#ifdef TRY_DRAWING_LABELS_WITH_GTK_LABEL
+void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *center,
int size,
int angle, const char *text)
{
- /* no angle possible */
- roadmap_canvas_draw_string (position,
- ROADMAP_CANVAS_CENTER_X|ROADMAP_CANVAS_BOTTOM, size, text);
+ int text_width;
+ int text_ascent;
+ int text_descent;
+ RoadMapGuiPoint start[1];
+ GtkWidget *layout;
+ GtkWidget *label;
+
+ layout = gtk_layout_new (NULL, NULL);
+ gtk_container_add (GTK_CONTAINER (RoadMapDrawingArea), layout);
+
+ roadmap_canvas_get_text_extents
+ (text, size, &text_width, &text_ascent, &text_descent, NULL);
+ roadmap_log(ROADMAP_WARNING, "%s @ %d: w %d a %d d %d\n",text, angle,
+ text_width, text_ascent, text_descent);
+
+ start->x = center->x;
+ start->y = center->y;
+ label = gtk_label_new (text);
+ gtk_label_set_angle(GTK_LABEL(label),angle);
+
+ gtk_layout_put (GTK_LAYOUT (layout), label, start->x, start->y);
+
+ //gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
+ // start->x, start->y, RoadMapLayout);
}
+#endif
+void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *center,
+ int size,
+ int angle, const char *text)
+{
+ int text_width;
+ int text_ascent;
+ int text_descent;
+ RoadMapGuiPoint start[1];
+ PangoMatrix matrix = PANGO_MATRIX_INIT;
+ PangoMatrix init_matrix = PANGO_MATRIX_INIT;
+ // PangoRenderer *renderer;
+ // int width, height;
+ roadmap_canvas_get_text_extents
+ (text, size, &text_width, &text_ascent, &text_descent, NULL);
+
+ start->x = center->x - text_width/2;;
+ start->y = center->y - text_descent;
+
+#if 0
+ roadmap_log(ROADMAP_WARNING, "%s @ %d: w %d a %d d %d\n",text, angle,
+ text_width, text_ascent, text_descent);
+ roadmap_log(ROADMAP_WARNING, "rcdsa: x %d y %d\n",start->x, start->y);
+#endif
+
+
+#ifdef DRAW_HORIZONTAL_LABELS // for reference, while debugging
+ // pango_matrix_scale (&matrix, 1.5,1.5);
+ pango_context_set_matrix (RoadMapContext, &matrix);
+ pango_layout_context_changed (RoadMapLayout);
+ gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
+ start->x, start->y, RoadMapLayout);
+#endif
+ // i can't get translations to have any affect whatsoever. :-/
+ // pango_matrix_translate (&matrix, 100.,100.);
+ pango_matrix_scale (&matrix, 1.5, 1.5);
+ if (angle > 0) {
+ angle = -angle;
+ start->x = center->x;
+ start->y = center->y - text_descent/2;
+ } else if (angle < 0) {
+ angle = -angle;
+ start->x = center->x - text_width /2;
+ if (angle > 70) // heuristic is latin for "hack", right?
+ start->x = center->x - text_width / 4;
+ start->y = center->y - text_descent/2;
+ }
+ // renderer = gdk_pango_renderer_get_default (gtk_widget_get_screen (RoadMapDrawingArea));
+ // gdk_pango_renderer_set_drawable (GDK_PANGO_RENDERER (renderer), RoadMapDrawingArea->window);
+ // gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (renderer), RoadMapDrawingArea->style->black_gc);
+ pango_matrix_rotate (&matrix, (double)(angle));
+ pango_context_set_matrix (RoadMapContext, &matrix);
+
+ pango_layout_context_changed (RoadMapLayout);
+
+ // pango_layout_get_size (RoadMapLayout, &width, &height);
+ // roadmap_log(ROADMAP_WARNING, "plgs: w %d h %d\n",width, height);
+ // pango_renderer_draw_layout (renderer, RoadMapLayout,
+ // width/2, height/2);
+ // start->x, start->y);
+ gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc,
+ start->x, start->y, RoadMapLayout);
+
+ pango_context_set_matrix (RoadMapContext, &init_matrix);
+ pango_layout_context_changed (RoadMapLayout);
+}
+
+
void roadmap_canvas_draw_multiple_points (int count, RoadMapGuiPoint *points) {
GdkPoint gdkpoints[1024];
@@ -500,13 +597,6 @@
void roadmap_canvas_refresh (void) {
- GdkRectangle update;
-
- update.x = 0;
- update.y = 0;
- update.width = RoadMapDrawingArea->allocation.width;
- update.height = RoadMapDrawingArea->allocation.height;
-
gtk_widget_queue_draw_area
(RoadMapDrawingArea, 0, 0,
RoadMapDrawingArea->allocation.width,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:28:58
|
Revision: 2839
http://sourceforge.net/p/roadmap/code/2839
Author: pgf
Date: 2015-06-06 17:28:56 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
sprites: fix the "Plate" sprite
Modified Paths:
--------------
trunk/roadmap/src/sprites
Modified: trunk/roadmap/src/sprites
===================================================================
--- trunk/roadmap/src/sprites 2015-06-06 17:28:54 UTC (rev 2838)
+++ trunk/roadmap/src/sprites 2015-06-06 17:28:56 UTC (rev 2839)
@@ -568,10 +568,10 @@
S Plate
F white 1
-D 0,0 4
+D 1,4 5
F green 2
C 1,4 6
-L -8,2 -8,9
+L -8,-2 -8,9
L -9,-2 -9,1 -8,2 -7,1 -7,-2
L 10,-2 10,9
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-06 17:28:55
|
Revision: 2838
http://sourceforge.net/p/roadmap/code/2838
Author: pgf
Date: 2015-06-06 17:28:54 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
AGG canvas: add ifdef support for drawing all maps "fast"
Modified Paths:
--------------
trunk/roadmap/src/agg_support/roadmap_canvas.cpp
Modified: trunk/roadmap/src/agg_support/roadmap_canvas.cpp
===================================================================
--- trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-06-04 22:33:05 UTC (rev 2837)
+++ trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-06-06 17:28:54 UTC (rev 2838)
@@ -27,7 +27,9 @@
#define PEN_DEBUG 0
+#define FAST 0
+
#ifdef WIN32_PROFILE
#include <C:\Program Files\Windows CE Tools\Common\Platman\sdk\wce500\include\cecap.h>
#endif
@@ -399,7 +401,7 @@
#endif
raso.round_cap(true);
- if (!fast_draw) {
+ if (!(fast_draw || FAST)) {
raso.line_join(agg::outline_miter_accurate_join);
}
@@ -430,7 +432,7 @@
dbg_time_end(DBG_TIME_CREATE_PATH);
dbg_time_start(DBG_TIME_ADD_PATH);
- if (fast_draw) {
+ if (fast_draw || FAST) {
renderer_pr ren_pr(agg_renb);
agg::rasterizer_outline<renderer_pr> ras_line(ren_pr);
ren_pr.line_color(CurrentPen->color);
@@ -461,7 +463,7 @@
int i;
int count_of_points;
-
+
agg::path_storage path;
for (i = 0; i < count; ++i) {
@@ -490,7 +492,7 @@
ren_solid.color(CurrentPen->color);
agg::render_scanlines( ras, sl, ren_solid);
- } else if (fast_draw) {
+ } else if (fast_draw || FAST) {
renderer_pr ren_pr(agg_renb);
agg::rasterizer_outline<renderer_pr> ras_line(ren_pr);
ren_pr.line_color(CurrentPen->color);
@@ -513,7 +515,7 @@
int fast_draw) {
int i;
-
+
agg::path_storage path;
for (i = 0; i < count; ++i) {
@@ -533,7 +535,7 @@
ren_solid.color(CurrentPen->color);
agg::render_scanlines( ras, sl, ren_solid);
- } else if (fast_draw) {
+ } else if (fast_draw || FAST) {
renderer_pr ren_pr(agg_renb);
agg::rasterizer_outline<renderer_pr> ras_line(ren_pr);
ren_pr.line_color(CurrentPen->color);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:33:08
|
Revision: 2837
http://sourceforge.net/p/roadmap/code/2837
Author: pgf
Date: 2015-06-04 22:33:05 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
buildmap_osm_text: change a strncmp() to strcmp()
Modified Paths:
--------------
trunk/roadmap/src/buildmap_osm_text.c
Modified: trunk/roadmap/src/buildmap_osm_text.c
===================================================================
--- trunk/roadmap/src/buildmap_osm_text.c 2015-06-04 22:33:02 UTC (rev 2836)
+++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-04 22:33:05 UTC (rev 2837)
@@ -709,7 +709,7 @@
if (strcasecmp(tag, "admin_level") == 0) {
wi.WayAdminLevel = atoi(value);
} else if (strcasecmp(tag, "border_type") == 0) {
- wi.WayTerritorial = !strncasecmp(value, "territorial", 11);
+ wi.WayTerritorial = !strcasecmp(value, "territorial");
} else if (strcasecmp(tag, "natural") == 0 &&
strcasecmp(value, "coastline") == 0) {
wi.WayCoast = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:33:05
|
Revision: 2836
http://sourceforge.net/p/roadmap/code/2836
Author: pgf
Date: 2015-06-04 22:33:02 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
roadmap_point: eliminate the double index lookup scheme for points
assume we'll have lots of points often enough to make this worthwhile.
it looks to me like we were doing a whole lot of calloc/free just
to maintain those two buffers anyway.
Modified Paths:
--------------
trunk/roadmap/src/roadmap_point.c
Modified: trunk/roadmap/src/roadmap_point.c
===================================================================
--- trunk/roadmap/src/roadmap_point.c 2015-06-04 22:32:59 UTC (rev 2835)
+++ trunk/roadmap/src/roadmap_point.c 2015-06-04 22:33:02 UTC (rev 2836)
@@ -50,8 +50,7 @@
RoadMapPointBySquare *BySquare; /**< */
int BySquareCount; /**< */
- unsigned short *PointToSquare2; /**< */
- int *PointToSquare4; /**< */
+ int *PointToSquare; /**< */
} RoadMapPointContext;
@@ -94,8 +93,7 @@
roadmap_log (ROADMAP_FATAL, "invalid point/data structure");
}
- context->PointToSquare2 = NULL;
- context->PointToSquare4 = NULL;
+ context->PointToSquare = NULL;
return context;
}
@@ -130,12 +128,9 @@
RoadMapPointActive = NULL;
}
- if (point_context->PointToSquare2 != NULL) {
- free (point_context->PointToSquare2);
+ if (point_context->PointToSquare != NULL) {
+ free (point_context->PointToSquare);
}
- if (point_context->PointToSquare4 != NULL) {
- free (point_context->PointToSquare4);
- }
free (point_context);
}
@@ -156,17 +151,15 @@
int i;
int j;
- unsigned short *point2square2 = RoadMapPointActive->PointToSquare2;
- int *point2square4;
+ int *point2square;
+ point2square = RoadMapPointActive->PointToSquare;
+ if (point2square == NULL) {
- if (point2square2 == NULL) {
+ point2square = calloc (RoadMapPointActive->PointCount, sizeof(int));
+ roadmap_check_allocated(point2square);
- point2square2 =
- calloc (RoadMapPointActive->PointCount, sizeof(unsigned short));
- roadmap_check_allocated(point2square2);
-
- RoadMapPointActive->PointToSquare2 = point2square2;
+ RoadMapPointActive->PointToSquare = point2square;
}
for (i = 0; i < RoadMapPointActive->BySquareCount; i++) {
@@ -177,37 +170,10 @@
square = roadmap_square_from_index (i);
- if ((square & 0xffff) > 0) goto lot_of_squares;
-
for (j = RoadMapPointActive->BySquare[i].first; j < end; j++) {
- point2square2[j] = square;
+ point2square[j] = square;
}
}
-
- return;
-
-lot_of_squares:
-
- free (RoadMapPointActive->PointToSquare2);
- RoadMapPointActive->PointToSquare2 = NULL;
-
- point2square4 = calloc (RoadMapPointActive->PointCount, sizeof(int));
- roadmap_check_allocated(point2square4);
-
- RoadMapPointActive->PointToSquare4 = point2square4;
-
- for (i = 0; i < RoadMapPointActive->BySquareCount; i++) {
-
- int square;
- int end = RoadMapPointActive->BySquare[i].first
- + RoadMapPointActive->BySquare[i].count;
-
- square = roadmap_square_from_index (i);
-
- for (j = RoadMapPointActive->BySquare[i].first; j < end; j++) {
- point2square4[j] = square;
- }
- }
}
/**
@@ -249,10 +215,8 @@
}
#endif
- if (RoadMapPointActive->PointToSquare2 != NULL) {
- point_square = RoadMapPointActive->PointToSquare2[point];
- } else if (RoadMapPointActive->PointToSquare4 != NULL) {
- point_square = RoadMapPointActive->PointToSquare4[point];
+ if (RoadMapPointActive->PointToSquare != NULL) {
+ point_square = RoadMapPointActive->PointToSquare[point];
} else {
point_square = -1;
}
@@ -263,10 +227,8 @@
roadmap_point_retrieve_square ();
- if (RoadMapPointActive->PointToSquare2 != NULL) {
- point_square = RoadMapPointActive->PointToSquare2[point];
- } else if (RoadMapPointActive->PointToSquare4 != NULL) {
- point_square = RoadMapPointActive->PointToSquare4[point];
+ if (RoadMapPointActive->PointToSquare != NULL) {
+ point_square = RoadMapPointActive->PointToSquare[point];
} else {
roadmap_log (ROADMAP_FATAL, "bad PointToSquare pointers");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:33:01
|
Revision: 2835
http://sourceforge.net/p/roadmap/code/2835
Author: pgf
Date: 2015-06-04 22:32:59 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
roadmap_square: turn off sanity checks in high-use utility routine
Modified Paths:
--------------
trunk/roadmap/src/roadmap_square.c
Modified: trunk/roadmap/src/roadmap_square.c
===================================================================
--- trunk/roadmap/src/roadmap_square.c 2015-06-04 22:32:56 UTC (rev 2834)
+++ trunk/roadmap/src/roadmap_square.c 2015-06-04 22:32:59 UTC (rev 2835)
@@ -470,12 +470,14 @@
int roadmap_square_from_index (int index) {
+#ifdef ROADMAP_INDEX_DEBUG
if (RoadMapSquareActive == NULL) return -1;
if (index < 0 ||
index >= RoadMapSquareActive->SquareGlobal->count_squares) {
return -1;
}
+#endif
return RoadMapSquareActive->Square[index].position;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:32:58
|
Revision: 2834
http://sourceforge.net/p/roadmap/code/2834
Author: pgf
Date: 2015-06-04 22:32:56 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
roadmap_line: disable incredibly expensive debug statistics
this routine has been taking 80 or 90 percent of execution time.
grrr.
Modified Paths:
--------------
trunk/roadmap/src/roadmap_line.c
Modified: trunk/roadmap/src/roadmap_line.c
===================================================================
--- trunk/roadmap/src/roadmap_line.c 2015-06-04 22:32:53 UTC (rev 2833)
+++ trunk/roadmap/src/roadmap_line.c 2015-06-04 22:32:56 UTC (rev 2834)
@@ -215,7 +215,7 @@
goto roadmap_line_map_abort;
}
-#if 1
+#if 0
/* Get sizes */
{
int i, j, counters[20], lost;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:32:55
|
Revision: 2833
http://sourceforge.net/p/roadmap/code/2833
Author: pgf
Date: 2015-06-04 22:32:53 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
restrict state boundaries
Modified Paths:
--------------
trunk/roadmap/src/buildmap_osm_text.c
Modified: trunk/roadmap/src/buildmap_osm_text.c
===================================================================
--- trunk/roadmap/src/buildmap_osm_text.c 2015-06-04 22:32:50 UTC (rev 2832)
+++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-04 22:32:53 UTC (rev 2833)
@@ -708,8 +708,7 @@
if (strcasecmp(tag, "admin_level") == 0) {
wi.WayAdminLevel = atoi(value);
- } else if (strcasecmp(tag, "border_type") == 0 ||
- strcasecmp(tag, "boundary_type") == 0) {
+ } else if (strcasecmp(tag, "border_type") == 0) {
wi.WayTerritorial = !strncasecmp(value, "territorial", 11);
} else if (strcasecmp(tag, "natural") == 0 &&
strcasecmp(value, "coastline") == 0) {
@@ -734,6 +733,7 @@
{
int from_point, to_point, line, street;
int fromlon, tolon, fromlat, tolat;
+ RoadMapString rms_dirp, rms_dirs, rms_type, rms_name;
int j;
char compound_name[1024];
char *n;
@@ -748,6 +748,19 @@
if (wi.WayId == 0)
buildmap_fatal(0, "Wasn't in a way (%s)", data);
+ if (wi.nWayNodes < 1) {
+ buildmap_osm_text_reset_way();
+ return;
+ }
+
+ from_point = buildmap_osm_text_point_get(WayNodes[0]);
+ to_point = buildmap_osm_text_point_get(WayNodes[wi.nWayNodes-1]);
+
+ fromlon = buildmap_point_get_longitude(from_point);
+ fromlat = buildmap_point_get_latitude(from_point);
+ tolon = buildmap_point_get_longitude(to_point);
+ tolat = buildmap_point_get_latitude(to_point);
+
if (wi.WayLayer == 0) {
/* if a way is both a coast and a boundary, treat it only as coast */
if (wi.WayCoast) {
@@ -759,6 +772,14 @@
wi.WayIsInteresting = 0;
}
+ /* if we're not (roughly) in north america,
+ * discard state boundaries as well. */
+ if ((wi.WayAdminLevel > 2) &&
+ (fromlon > -32 || fromlat < 17)) {
+ /* east of the azores or south of mexico */
+ wi.WayIsInteresting = 0;
+ }
+
wi.WayLayer = l_boundary;
}
}
@@ -775,24 +796,12 @@
return;
}
- if (wi.nWayNodes < 1) {
- buildmap_osm_text_reset_way();
- return;
- }
+ rms_dirp = str2dict(DictionaryPrefix, "");
+ rms_dirs = str2dict(DictionarySuffix, "");
+ rms_type = str2dict(DictionaryType, "");
+ rms_name = 0;
- RoadMapString rms_dirp = str2dict(DictionaryPrefix, "");
- RoadMapString rms_dirs = str2dict(DictionarySuffix, "");
- RoadMapString rms_type = str2dict(DictionaryType, "");
- RoadMapString rms_name = 0;
- from_point = buildmap_osm_text_point_get(WayNodes[0]);
- to_point = buildmap_osm_text_point_get(WayNodes[wi.nWayNodes-1]);
-
- fromlon = buildmap_point_get_longitude(from_point);
- fromlat = buildmap_point_get_latitude(from_point);
- tolon = buildmap_point_get_longitude(to_point);
- tolat = buildmap_point_get_latitude(to_point);
-
if ((wi.WayFlags & AREA) && (fromlon == tolon) && (fromlat == tolat)) {
static int polyid = 0;
static int cenid = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-04 22:32:52
|
Revision: 2832
http://sourceforge.net/p/roadmap/code/2832
Author: pgf
Date: 2015-06-04 22:32:50 +0000 (Thu, 04 Jun 2015)
Log Message:
-----------
buildmap_osm_text: parse the OSM XML more carefully
our scanf assumed an apostrophe or double quote character would never
appear other than as a string delimiter. but the XML we get always
surrounds strings with double quotes, not single quotes, and
freely returns strings containing single quotes (i.e., apostrophes).
so we now assume all strings will use double quote delimiters.
Modified Paths:
--------------
trunk/roadmap/src/buildmap_osm_text.c
Modified: trunk/roadmap/src/buildmap_osm_text.c
===================================================================
--- trunk/roadmap/src/buildmap_osm_text.c 2015-06-02 15:36:30 UTC (rev 2831)
+++ trunk/roadmap/src/buildmap_osm_text.c 2015-06-04 22:32:50 UTC (rev 2832)
@@ -596,8 +596,18 @@
if (! tagv)
tagv = malloc(512);
+// it turns out that the OSM xml output contains raw apostrophe
+// characters, e.g. "Cortina d'Ampezzo". but i assume that if
+// a placename actually contained a '"', then the XML escape
+// mechanisms would be used, and not single quotes.
+// summary: stop parsing for 'string'.
+#ifdef BEFORE
s = sscanf(data, "tag k=%*['\"]%[^\"']%*['\"] v=%*['\"]%[^\"']%*['\"]",
tagk, tagv);
+#else
+ s = sscanf(data, "tag k=%*[\"]%[^\"]%*[\"] v=%*[\"]%[^\"]%*[\"]/>",
+ tagk, tagv);
+#endif
if (s != 2)
buildmap_fatal(0, "fail to scanf tag k and v (%s)", data);
@@ -1360,11 +1370,6 @@
continue;
} else if (strncasecmp(p, "tag", 3) == 0) {
-
-#if 0
- if (!wi.WayId)
- buildmap_osm_text_node_tag(p, 1);
-#endif
continue;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-02 15:36:33
|
Revision: 2831
http://sourceforge.net/p/roadmap/code/2831
Author: pgf
Date: 2015-06-02 15:36:30 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
roadmap_place: fix bug which allowed places to draw with wrong sprite
Modified Paths:
--------------
trunk/roadmap/src/roadmap_place.c
trunk/roadmap/src/roadmap_screen.c
Modified: trunk/roadmap/src/roadmap_place.c
===================================================================
--- trunk/roadmap/src/roadmap_place.c 2015-06-01 14:06:05 UTC (rev 2830)
+++ trunk/roadmap/src/roadmap_place.c 2015-06-02 15:36:30 UTC (rev 2831)
@@ -211,6 +211,10 @@
return 0; /* This square is empty. */
}
+ if (layer <= 0 || layer > RoadMapPlaceActive->PlaceBySquare[square].count) {
+ return 0;
+ }
+
index = RoadMapPlaceActive->PlaceByLayer
+ RoadMapPlaceActive->PlaceBySquare[square].first;
Modified: trunk/roadmap/src/roadmap_screen.c
===================================================================
--- trunk/roadmap/src/roadmap_screen.c 2015-06-01 14:06:05 UTC (rev 2830)
+++ trunk/roadmap/src/roadmap_screen.c 2015-06-02 15:36:30 UTC (rev 2831)
@@ -1283,16 +1283,16 @@
roadmap_log_push ("roadmap_screen_draw_square_places");
- layer_pen = roadmap_layer_get_pen (layer, pen_index);
- if (layer_pen == NULL) return 0;
- layer_sprite = roadmap_layer_sprite(layer);
- labels_visible = roadmap_layer_labels_visible(layer);
-
fips = roadmap_locator_active ();
/* Draw each place that belongs to this square. */
if (roadmap_place_in_square (square, layer, &first_place, &last_place) > 0) {
+ layer_pen = roadmap_layer_get_pen (layer, pen_index);
+ if (layer_pen == NULL) return 0;
+ layer_sprite = roadmap_layer_sprite(layer);
+ labels_visible = roadmap_layer_labels_visible(layer);
+
for (place = first_place; place <= last_place; ++place) {
RoadMapPosition pos;
RoadMapGuiPoint guipoint;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pg...@us...> - 2015-06-01 14:06:07
|
Revision: 2830
http://sourceforge.net/p/roadmap/code/2830
Author: pgf
Date: 2015-06-01 14:06:05 +0000 (Mon, 01 Jun 2015)
Log Message:
-----------
tune default classes/layers for better user experience
Modified Paths:
--------------
trunk/roadmap/src/default/All
trunk/roadmap/src/sprites
Modified: trunk/roadmap/src/default/All
===================================================================
--- trunk/roadmap/src/default/All 2015-06-01 14:06:01 UTC (rev 2829)
+++ trunk/roadmap/src/default/All 2015-06-01 14:06:05 UTC (rev 2830)
@@ -95,35 +95,42 @@
.Declutter: 600
.Thickness: 1
.Speed: 1
+Peak.Color: brown
+ .Declutter: 1000
Amenity.Color: orange
.Declutter: 160
.Thickness: 1
.Speed: 1
-City.Color: red
- .Declutter: 10001
+
+City.Sprite: SmallBrownDot
+ .LabelDeclutter: 4000
.LabelFontColor: Brown
-Town.Color: red
- .Declutter: 10002
- .LabelFontColor: Brown
-Village.Color: red
- .Declutter: 1300
- .LabelFontColor: Brown
-Hamlet.Color: red
- .Declutter: 10
- .LabelFontColor: Brown
-Suburbs.Color: grey
- .Declutter: 1300
- .LabelFontColor: Brown
-Peak.Color: brown
- .Declutter: 1000
+Town.Declutter: 4000
+ .Sprite: SmallRedDot
+ .LabelDeclutter: 2000
+ .LabelFontColor: Red
+
+Village.Declutter: 2000
+ .Sprite: SmallPurpleDot
+ .LabelDeclutter: 1000
+ .LabelFontColor: Purple
+
+Hamlet.Declutter: 1000
+ .Sprite: SmallOrangeDot
+ .LabelDeclutter: 450
+ .LabelFontColor: Orange
+
+Suburbs.LabelDeclutter: 300
+ .LabelFontColor: Black
+
Food.Sprite: Food
- .Declutter: 1300
+ .Declutter: 450
.LabelDeclutter: 10
.LabelFontSize: 10
Cafe.Sprite: Cafe
- .Declutter: 1300
+ .Declutter: 450
.LabelDeclutter: 10
.LabelFontSize: 10
@@ -133,11 +140,11 @@
.LabelFontSize: 10
Drinks.Sprite: Drinks
- .Declutter: 1300
+ .Declutter: 450
.LabelDeclutter: 10
.LabelFontSize: 10
ATM.Sprite: ATM
- .Declutter: 1300
+ .Declutter: 450
.LabelDeclutter: 10
.LabelFontSize: 10
Modified: trunk/roadmap/src/sprites
===================================================================
--- trunk/roadmap/src/sprites 2015-06-01 14:06:01 UTC (rev 2829)
+++ trunk/roadmap/src/sprites 2015-06-01 14:06:05 UTC (rev 2830)
@@ -89,7 +89,7 @@
A SmallPurpleChevron
S BreadCrumb
-A PurpleDot
+A PurpleCross
S Departure
A DottedSquare
@@ -184,10 +184,26 @@
C 0,0 5
C 0,0 7
+S SmallPurpleDot
+F purple 1
+D 0,0 3
+
S SmallRedDot
F red 1
D 0,0 3
+S SmallOrangeDot
+F orange 1
+D 0,0 3
+
+S SmallBrownDot
+F brown 1
+D 0,0 3
+
+S SmallBlackDot
+F black 1
+D 0,0 3
+
S GreenTrianglePointer
F green 2
P 0,-9 -8,4 8,4 0,-9
@@ -224,13 +240,9 @@
L -4,4 0,-4 4,4
S PurpleCross
-F purple 2
-L -4,0 4,0
-L 0,-4 0,4
-
-S PurpleDot
F purple 1
-D 0,0 3
+L -3,0 3,0
+L 0,-3 0,3
S 5PointStar
F darkred 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|