[cairo-commit] [cairo-www] src/roadster

Jeff Garrett jgarrett at freedesktop.org
Thu Nov 22 14:19:18 PST 2007


 src/roadster/developer.mdwn |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

New commits:
commit 4880764cfc95c629d37819956d50aa1a52c7a1f8
Author: Jeff Garrett <jeff at jgarrett.org>
Date:   Thu Nov 22 16:26:04 2007 -0600

    Add beginning of roadster developer documentation

diff --git a/src/roadster/developer.mdwn b/src/roadster/developer.mdwn
new file mode 100644
index 0000000..63b4536
--- /dev/null
+++ b/src/roadster/developer.mdwn
@@ -0,0 +1,34 @@
+[[meta title="Roadster Developer Documentation"]]
+
+Here there be monsters.  Only some of the internals are described below.
+
+## Searching
+
+All the search types (location, city, address) are implemented as independent
+functions with signatures of the form:
+
+	GList *search_function(const char *search_text)
+
+They must return a list consisting of a struct search_result for each hit, and NULL
+(an empty GList) if there are no hits.  The individual results look like:
+
+	struct search_result {
+		ESearchResultType type;
+		char *text;
+		glyph_t *glyph;
+		mappoint_t *point;
+		int zoom_level;
+	};
+
+The point and the text as well as the struct must be dynamically allocated,
+and will be freed when the search is done.
+
+In order to add a new search type, implement the search function and then add
+it to the array of search functions in search.c, executed in order:
+
+	static GList *(*search_functions[])(const char *) = {
+		search_city_execute,
+		search_location_execute,
+		search_road_execute,
+		search_coordinate_execute,
+	};


More information about the cairo-commit mailing list