[GRASS-SVN] r47179 - in grass/trunk/display: d.barscale
d.colortable d.font d.fontlist d.geodesic d.graph d.grid
d.his d.histogram d.info d.labels d.legend d.linegraph d.path
d.profile d.rast.arrow d.rast.num d.rgb d.rhumbline d.text
d.thematic.area d.vect.chart d.where
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 18 16:43:07 EDT 2011
Author: martinl
Date: 2011-07-18 13:43:07 -0700 (Mon, 18 Jul 2011)
New Revision: 47179
Modified:
grass/trunk/display/d.barscale/main.c
grass/trunk/display/d.colortable/main.c
grass/trunk/display/d.font/main.c
grass/trunk/display/d.fontlist/main.c
grass/trunk/display/d.geodesic/main.c
grass/trunk/display/d.graph/main.c
grass/trunk/display/d.grid/main.c
grass/trunk/display/d.his/main.c
grass/trunk/display/d.histogram/main.c
grass/trunk/display/d.info/main.c
grass/trunk/display/d.labels/main.c
grass/trunk/display/d.legend/main.c
grass/trunk/display/d.linegraph/main.c
grass/trunk/display/d.path/main.c
grass/trunk/display/d.profile/main.c
grass/trunk/display/d.rast.arrow/main.c
grass/trunk/display/d.rast.num/main.c
grass/trunk/display/d.rgb/main.c
grass/trunk/display/d.rhumbline/main.c
grass/trunk/display/d.text/main.c
grass/trunk/display/d.thematic.area/main.c
grass/trunk/display/d.vect.chart/main.c
grass/trunk/display/d.where/main.c
Log:
display modules: sync error message, add D_save_command()
Modified: grass/trunk/display/d.barscale/main.c
===================================================================
--- grass/trunk/display/d.barscale/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.barscale/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -125,8 +125,9 @@
fontsize = atoi(fsize->answer);
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup(0);
/* Parse and select background color */
@@ -140,6 +141,7 @@
/* Draw the scale */
draw_scale(top->answer, fontsize);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.colortable/main.c
===================================================================
--- grass/trunk/display/d.colortable/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.colortable/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -138,7 +138,8 @@
if (Rast_read_fp_range(map_name, "", &fp_range) == -1)
G_fatal_error(_("Range file for <%s> not available"), map_name);
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
D_setup_unity(0);
D_get_src(&t, &b, &l, &r);
@@ -280,7 +281,8 @@
D_polygon_rel(x_box, y_box, 5);
}
}
-
+
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.font/main.c
===================================================================
--- grass/trunk/display/d.font/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.font/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -84,7 +84,8 @@
/* load the font */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
if (flag1->answer) { /* List font names */
print_font_list(stdout, 0);
Modified: grass/trunk/display/d.fontlist/main.c
===================================================================
--- grass/trunk/display/d.fontlist/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.fontlist/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -51,8 +51,9 @@
exit(EXIT_FAILURE);
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
if (flagL->answer)
D_font_info(&list, &count);
else
@@ -60,7 +61,7 @@
for (i = 0; i < count; i++)
fprintf(stdout, "%s\n", list[i]);
-
+
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.geodesic/main.c
===================================================================
--- grass/trunk/display/d.geodesic/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.geodesic/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -93,8 +93,9 @@
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
line_color = D_translate_color(parm.lcolor->answer);
if (!line_color)
line_color = D_translate_color(parm.lcolor->answer =
@@ -113,7 +114,8 @@
text_color = D_translate_color(parm.tcolor->answer);
plot(lon1, lat1, lon2, lat2, line_color, text_color);
-
+
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.graph/main.c
===================================================================
--- grass/trunk/display/d.graph/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.graph/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -98,8 +98,9 @@
/* open graphics window */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
/* Parse and select color */
if (opt2->answer != NULL) {
color = G_str_to_color(opt2->answer, &R, &G, &B);
@@ -129,6 +130,7 @@
set_text_size();
graphics(infile);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.grid/main.c
===================================================================
--- grass/trunk/display/d.grid/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.grid/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -227,9 +227,9 @@
/* Setup driver and check important information */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
/* Parse and select grid color */
colorg = D_parse_color(opt1->answer, FALSE);
/* Parse and select border color */
@@ -264,6 +264,7 @@
plot_border(size, east, north);
}
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.his/main.c
===================================================================
--- grass/trunk/display/d.his/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.his/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -114,8 +114,9 @@
/* Do screen initializing stuff */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
/* Prepare the raster cell drawing functions */
D_setup(0);
D_set_overlay_mode(nulldraw->answer ? 1 : 0);
@@ -237,6 +238,8 @@
G_percent(window.rows, window.rows, 5);
D_cell_draw_end();
+ D_save_command(G_recreate_command());
+
/* Close down connection to display driver */
D_close_driver();
Modified: grass/trunk/display/d.histogram/main.c
===================================================================
--- grass/trunk/display/d.histogram/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.histogram/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -187,8 +187,9 @@
/* set up the graphics driver and initialize its color-table */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup_unity(0); /* 0 = don't clear frame */
D_get_src(&t, &b, &l, &r);
@@ -213,6 +214,7 @@
else
bar(&dist_stats, &pcolors);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.info/main.c
===================================================================
--- grass/trunk/display/d.info/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.info/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -65,9 +65,9 @@
}
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
if (rflag->answer || dflag->answer || fflag->answer)
D_get_window(&t, &b, &l, &r);
@@ -109,6 +109,7 @@
fprintf(stdout, "nsres=%.15g\n", (n-s)/(b-t) );
}
+
D_close_driver();
return EXIT_SUCCESS;
Modified: grass/trunk/display/d.labels/main.c
===================================================================
--- grass/trunk/display/d.labels/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.labels/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -114,14 +114,16 @@
G_fatal_error(_("Unable to open label file <%s>"), label_name);
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup(0);
/* Go draw the raster map */
do_labels(infile, !horiz_flag->answer);
+ D_save_command(G_recreate_command());
D_close_driver();
- exit(0);
+ exit(EXIT_SUCCESS);
}
Modified: grass/trunk/display/d.legend/main.c
===================================================================
--- grass/trunk/display/d.legend/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.legend/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -260,8 +260,9 @@
Rast_set_c_null_value(&null_cell, 1);
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
white = D_translate_color(DEFAULT_FG_COLOR);
black = D_translate_color(DEFAULT_BG_COLOR);
@@ -902,6 +903,8 @@
}
}
+ D_save_command(G_recreate_command());
D_close_driver();
+
exit(EXIT_SUCCESS);
}
Modified: grass/trunk/display/d.linegraph/main.c
===================================================================
--- grass/trunk/display/d.linegraph/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.linegraph/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -255,7 +255,9 @@
/* get coordinates of current screen window, in pixels */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup_unity(0);
D_get_src(&t, &b, &l, &r);
@@ -567,7 +569,9 @@
D_use_color(title_color);
D_polyline_abs(x_line, y_line, 3);
+ D_save_command(G_recreate_command());
D_close_driver();
+
exit(EXIT_SUCCESS);
}
Modified: grass/trunk/display/d.path/main.c
===================================================================
--- grass/trunk/display/d.path/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.path/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -150,8 +150,9 @@
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
color = G_standard_color_rgb(BLACK);
if (G_str_to_color(color_opt->answer, &r, &g, &b)) {
color.r = r;
@@ -191,7 +192,6 @@
coor_path(&Map, &hcolor, bold_f->answer, x1, y1, x2, y2);
-
D_close_driver();
Vect_close(&Map);
Modified: grass/trunk/display/d.profile/main.c
===================================================================
--- grass/trunk/display/d.profile/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.profile/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -260,8 +260,9 @@
/* establish connection with graphics driver */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup2(1, 0, 1.05, -0.05, -0.15, 1.05);
plot_axes();
@@ -313,7 +314,7 @@
D_end();
D_stroke();
-
+
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.rast.arrow/main.c
===================================================================
--- grass/trunk/display/d.rast.arrow/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.rast.arrow/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -221,8 +221,9 @@
/* Setup driver and check important information */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup(0);
/* Read in the map window associated with window */
@@ -500,9 +501,10 @@
if (opt7->answer)
Rast_close(mag_fd);
+ D_save_command(G_recreate_command());
D_close_driver();
- exit(0);
+ exit(EXIT_SUCCESS);
}
/* --- end of main --- */
Modified: grass/trunk/display/d.rast.num/main.c
===================================================================
--- grass/trunk/display/d.rast.num/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.rast.num/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -190,8 +190,9 @@
/* Setup driver and check important information */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup2(0, 0, t, b, l, r);
D_ns = fabs(D_get_u_to_d_yconv());
@@ -241,6 +242,7 @@
Rast_close(layer_fd);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.rgb/main.c
===================================================================
--- grass/trunk/display/d.rgb/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.rgb/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -77,8 +77,9 @@
/* Do screen initializing stuff */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
overlay = !flag_n->answer;
D_setup(0);
@@ -125,7 +126,8 @@
}
G_percent(window.rows, window.rows, 5);
D_cell_draw_end();
-
+
+ D_save_command(G_recreate_command());
D_close_driver();
/* Close the raster maps */
Modified: grass/trunk/display/d.rhumbline/main.c
===================================================================
--- grass/trunk/display/d.rhumbline/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.rhumbline/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -93,8 +93,9 @@
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
line_color = D_translate_color(parm.lcolor->answer);
if (!line_color)
line_color = D_translate_color(parm.lcolor->answer =
@@ -115,6 +116,7 @@
plot(lon1, lat1, lon2, lat2, line_color, text_color);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.text/main.c
===================================================================
--- grass/trunk/display/d.text/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.text/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -288,9 +288,9 @@
bold = flag.b->answer;
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
if (opt.font->answer)
D_font(opt.font->answer);
else if (opt.path->answer)
@@ -357,6 +357,7 @@
D_text_size(5, 5);
D_text_rotation(0.0);
+ D_save_command(G_recreate_command());
D_close_driver();
exit(EXIT_SUCCESS);
Modified: grass/trunk/display/d.thematic.area/main.c
===================================================================
--- grass/trunk/display/d.thematic.area/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.thematic.area/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -363,8 +363,9 @@
if (!nodraw_flag->answer) {
/* Now's let's prepare the actual plotting */
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup(0);
if (verbose)
@@ -407,6 +408,7 @@
} /* end window check if */
+ D_save_command(G_recreate_command());
D_close_driver();
} /* end of nodraw_flag condition */
Modified: grass/trunk/display/d.vect.chart/main.c
===================================================================
--- grass/trunk/display/d.vect.chart/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.vect.chart/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -250,8 +250,9 @@
ctype = CTYPE_BAR;
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
-
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
/* should we plot the maximum reference on bar plots? */
if (max_reference_opt->answer != NULL) {
@@ -272,6 +273,7 @@
sizecol_opt->answer, size, scale,
&ocolor, colors, y_center, max_reference);
+ D_save_command(G_recreate_command());
D_close_driver();
Vect_close(&Map);
Modified: grass/trunk/display/d.where/main.c
===================================================================
--- grass/trunk/display/d.where/main.c 2011-07-18 20:20:29 UTC (rev 47178)
+++ grass/trunk/display/d.where/main.c 2011-07-18 20:43:07 UTC (rev 47179)
@@ -166,9 +166,13 @@
fp = stdin;
if (D_open_driver() != 0)
- G_fatal_error(_("No graphics device selected"));
+ G_fatal_error(_("No graphics device selected. "
+ "Use d.mon to select graphics device."));
+
D_setup(0);
+
where_am_i(coords->answers, fp, have_spheroid, decimal->answer, dcoord->answer);
+
D_close_driver();
exit(EXIT_SUCCESS);
More information about the grass-commit
mailing list