[GRASS-SVN] r47083 - grass/trunk/display/d.mon
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jul 9 15:41:05 EDT 2011
Author: martinl
Date: 2011-07-09 12:41:05 -0700 (Sat, 09 Jul 2011)
New Revision: 47083
Modified:
grass/trunk/display/d.mon/main.c
grass/trunk/display/d.mon/proto.h
grass/trunk/display/d.mon/start.c
Log:
d.mon: true color output by default
add flag to disable true colors
Modified: grass/trunk/display/d.mon/main.c
===================================================================
--- grass/trunk/display/d.mon/main.c 2011-07-09 19:39:40 UTC (rev 47082)
+++ grass/trunk/display/d.mon/main.c 2011-07-09 19:41:05 UTC (rev 47083)
@@ -26,7 +26,7 @@
struct Option *start_opt, *select_opt, *stop_opt, *output_opt,
*width_opt, *height_opt, *bgcolor_opt;
struct Flag *list_flag, *selected_flag, *select_flag, *release_flag,
- *cmd_flag;
+ *cmd_flag, *truecolor_flag;
int nopts, ret;
const char *mon;
@@ -109,6 +109,11 @@
release_flag->description = _("Release currently selected monitor and exit");
release_flag->guisection = _("Manage");
+ truecolor_flag = G_define_flag();
+ truecolor_flag->key = 't';
+ truecolor_flag->description = _("Disable true colors");
+ truecolor_flag->guisection = _("Manage");
+
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -159,7 +164,8 @@
if (start_opt->answer)
ret = start_mon(start_opt->answer, output_opt->answer, !select_flag->answer,
- width_opt->answer, height_opt->answer, bgcolor_opt->answer);
+ width_opt->answer, height_opt->answer, bgcolor_opt->answer,
+ !truecolor_flag->answer);
if (stop_opt->answer)
ret = stop_mon(stop_opt->answer);
Modified: grass/trunk/display/d.mon/proto.h
===================================================================
--- grass/trunk/display/d.mon/proto.h 2011-07-09 19:39:40 UTC (rev 47082)
+++ grass/trunk/display/d.mon/proto.h 2011-07-09 19:41:05 UTC (rev 47083)
@@ -1,5 +1,6 @@
/* start */
-int start_mon(const char *, const char *, int, const char *, const char *, const char *);
+int start_mon(const char *, const char *, int, const char *,
+ const char *, const char *, int);
/* select.c */
int select_mon(const char *);
Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c 2011-07-09 19:39:40 UTC (rev 47082)
+++ grass/trunk/display/d.mon/start.c 2011-07-09 19:41:05 UTC (rev 47083)
@@ -45,7 +45,8 @@
}
int start_mon(const char *name, const char *output, int select,
- const char *width, const char *height, const char *bgcolor)
+ const char *width, const char *height, const char *bgcolor,
+ int truecolor)
{
const char *curr_mon;
char *env_name, *env_value, *cmd_value;
@@ -80,6 +81,10 @@
sprintf(buf, "GRASS_BACKGROUNDCOLOR=%s\n", bgcolor);
write(env_fd, buf, strlen(buf));
}
+ if (truecolor) {
+ sprintf(buf, "GRASS_TRUECOLOR=TRUE\n");
+ write(env_fd, buf, strlen(buf));
+ }
close(env_fd);
cmd_value = NULL;
More information about the grass-commit
mailing list