From 2820f8af38867c6c38136ef449f31218532179f6 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 3 Mar 2008 14:20:22 +0200 Subject: [PATCH] Make track break and text to generic path functions --- src/path.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/path.c b/src/path.c index 8876587..04b39a1 100644 --- a/src/path.c +++ b/src/path.c @@ -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) { -- 2.39.5