]> err.no Git - mapper/commitdiff
Make track break and text to generic path functions
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 3 Mar 2008 12:20:22 +0000 (14:20 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 3 Mar 2008 12:20:22 +0000 (14:20 +0200)
src/path.c

index 8876587918a341336c63376fc8e60fcbe8866da2..04b39a1313cc73e5a4feab840b0615a7b9e21c92 100644 (file)
@@ -40,6 +40,47 @@ if (path->whead + wsize != path->wcap) {
 }
 }
 
+gboolean 
+path_insert_break(Path *path)
+{
+if (!path)
+       return FALSE;
+
+if (!path->tail)
+       return FALSE;
+
+if (path->tail->unity) {
+       guint x1, y1;
+
+       /* To mark a "waypoint" in a track, we'll add a (0, 0) point and then
+        * another instance of the most recent track point. */
+       MACRO_PATH_INCREMENT_TAIL(*path);
+       *path->tail=_point_null;
+       MACRO_PATH_INCREMENT_TAIL(*path);
+       *path->tail=path->tail[-2];
+
+#if 0
+       /* Instead of calling map_render_paths(), we'll just draw the waypoint ourselves. */
+       x1 = unit2bufx(path->tail->unitx);
+       y1 = unit2bufy(path->tail->unity);
+       map_render_waypoint(x1, y1, _gc[COLORABLE_TRACK_BREAK]);
+#endif
+}
+return FALSE;
+}
+
+/**
+ * Add a text description at current point
+ * 
+ */
+void 
+path_insert_mark_text(Path *path, gchar *text)
+{
+MACRO_PATH_INCREMENT_WTAIL(*path);
+path->wtail->point = path->tail;
+path->wtail->desc = text;
+}
+
 GtkListStore *
 path_generate_store(Path *path)
 {