[GRASS-SVN] r57804 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 22 03:45:39 PDT 2013


Author: martinl
Date: 2013-09-22 03:45:38 -0700 (Sun, 22 Sep 2013)
New Revision: 57804

Modified:
   grass/trunk/lib/gis/parser_html.c
   grass/trunk/lib/gis/parser_standard_options.c
Log:
libgis: update G_usage_html() to include colortable thumbnails


Modified: grass/trunk/lib/gis/parser_html.c
===================================================================
--- grass/trunk/lib/gis/parser_html.c	2013-09-22 09:11:04 UTC (rev 57803)
+++ grass/trunk/lib/gis/parser_html.c	2013-09-22 10:45:38 UTC (rev 57804)
@@ -3,7 +3,7 @@
   
   \brief GIS Library - Argument parsing functions (HTML output)
   
-  (C) 2001-2009, 2011-2012 by the GRASS Development Team
+  (C) 2001-2009, 2011-2013 by the GRASS Development Team
   
   This program is free software under the GNU General Public License
   (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -12,6 +12,7 @@
 */
 
 #include <stdio.h>
+#include <string.h>
 
 #include <grass/gis.h>
 #include <grass/glocale.h>
@@ -234,10 +235,16 @@
 
 	    if (opt->descs) {
 		int i = 0;
-
+                
 		while (opt->opts[i]) {
 		    if (opt->descs[i]) {
 			fprintf(stdout, "<dd><b>");
+                        if (opt->gisprompt && strcmp(opt->gisprompt,
+                                                     "old,colortable,colortable") == 0) {
+                            fprintf(stdout, "<img width=\"80\" height=\"12\" "
+                                    "src=\"colortables/%s.png\" alt=\"%s\">",
+                                    opt->opts[i], opt->opts[i]);
+                        }
 			print_escaped_for_html(stdout, opt->opts[i]);
 			fprintf(stdout, "</b>: ");
 			print_escaped_for_html(stdout, opt->descs[i]);

Modified: grass/trunk/lib/gis/parser_standard_options.c
===================================================================
--- grass/trunk/lib/gis/parser_standard_options.c	2013-09-22 09:11:04 UTC (rev 57803)
+++ grass/trunk/lib/gis/parser_standard_options.c	2013-09-22 10:45:38 UTC (rev 57804)
@@ -624,6 +624,7 @@
 	Opt->options = G_color_rules_options();
 	Opt->description = _("Name of color table");
 	Opt->descriptions = G_color_rules_descriptions();
+        Opt->gisprompt = "old,colortable,colortable";
 	break;
 
     /* Spatio-temporal modules of the temporal GIS framework */



More information about the grass-commit mailing list