Skip to content

Commit

Permalink
Remove display_raster.h; merged with display.h
Browse files Browse the repository at this point in the history
Remove unused R__* functions
Rename remaining R_* functions to D_*



git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38015 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
glynnc committed Jun 22, 2009
1 parent 8b394a1 commit e937b11
Show file tree
Hide file tree
Showing 150 changed files with 305 additions and 590 deletions.
9 changes: 4 additions & 5 deletions display/d.barscale/draw_scale.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include "options.h"

#define NUMSCALES 16
Expand Down Expand Up @@ -74,7 +73,7 @@ int draw_scale(int toptext)

/* Establish text size */
size = 14;
R_text_size(size, size);
D_text_size(size, size);

D_setup_unity(0);
D_get_src(&t, &b, &l, &r);
Expand Down Expand Up @@ -117,7 +116,7 @@ int draw_scale(int toptext)

/* actual text width is 81% of size? from d.legend */
D_pos_abs(pl + w / 2 - 7 * .81, pt + 14);
R_text("N");
D_text("N");

return 0;
}
Expand Down Expand Up @@ -248,11 +247,11 @@ int draw_scale(int toptext)
D_pos_abs(x_pos + 25 - draw * 10 + line_len / 2.
- strlen(scales[incr].name) * size * 0.81 / 2,
y_pos);
R_text(scales[incr].name);
D_text(scales[incr].name);
}
else {
D_pos_abs(x_pos + 35 - draw * 10 + line_len, y_pos + 20);
R_text(scales[incr].name);
D_text(scales[incr].name);
}

return (0);
Expand Down
5 changes: 2 additions & 3 deletions display/d.barscale/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include "options.h"
#include <grass/glocale.h>

Expand Down Expand Up @@ -115,7 +114,7 @@ int main(int argc, char **argv)
sscanf(opt3->answers[1], "%lf", &north);


if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

D_setup(0);
Expand All @@ -131,7 +130,7 @@ int main(int argc, char **argv)
/* Draw the scale */
draw_scale(top->answer);

R_close_driver();
D_close_driver();

exit(EXIT_SUCCESS);
}
1 change: 0 additions & 1 deletion display/d.colors/get_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <stdio.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/colors.h>
#include "colors.h"

Expand Down
1 change: 0 additions & 1 deletion display/d.colors/interact.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <unistd.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include "graphics.h"
#include "colors.h"

Expand Down
1 change: 0 additions & 1 deletion display/d.colors/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include "colors.h"

int main(int argc, char **argv)
Expand Down
5 changes: 2 additions & 3 deletions display/d.colortable/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <grass/display.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display_raster.h>
#include <grass/glocale.h>

int main(int argc, char **argv)
Expand Down Expand Up @@ -133,7 +132,7 @@ int main(int argc, char **argv)
G_fatal_error(_("Color file for <%s> not available"), map_name);
if (Rast_read_fp_range(map_name, "", &fp_range) == -1)
G_fatal_error(_("Range file for <%s> not available"), map_name);
if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

D_setup_unity(0);
Expand Down Expand Up @@ -261,7 +260,7 @@ int main(int argc, char **argv)
}
}

R_close_driver();
D_close_driver();

return 0;
}
7 changes: 3 additions & 4 deletions display/d.erase/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/glocale.h>

int main(int argc, char *argv[])
Expand Down Expand Up @@ -47,17 +46,17 @@ int main(int argc, char *argv[])
if (G_parser(argc, argv))
exit(1);

if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

D_setup_unity(0);

D_erase(color->answer);

if (eraseframe->answer)
R_erase();
D__erase();

R_close_driver();
D_close_driver();

exit(0);
}
1 change: 0 additions & 1 deletion display/d.extract/extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <math.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/colors.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Expand Down
1 change: 0 additions & 1 deletion display/d.extract/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/colors.h>
#include <grass/Vect.h>
#include <grass/dbmi.h>
Expand Down
19 changes: 9 additions & 10 deletions display/d.font/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <errno.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/glocale.h>

static char **fonts;
Expand Down Expand Up @@ -82,18 +81,18 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);

/* load the font */
if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

if (flag1->answer) { /* List font names */
print_font_list(stdout, 0);
R_close_driver();
D_close_driver();
exit(EXIT_SUCCESS);
}

if (flag2->answer) { /* List fonts verbosely */
print_font_list(stdout, 1);
R_close_driver();
D_close_driver();
exit(EXIT_SUCCESS);
}

Expand All @@ -108,7 +107,7 @@ int main(int argc, char **argv)
if (!S_ISREG(info.st_mode))
G_fatal_error(_("Font path %s is not a file"), opt2->answer);
else
R_font(opt2->answer);
D_font(opt2->answer);
}
else if (opt1->answer) { /* Font name from fontcap */
int i = 0;
Expand All @@ -117,7 +116,7 @@ int main(int argc, char **argv)
read_freetype_fonts(0);
while (i < num_fonts) {
if (strcmp(opt1->answer, fonts[i]) == 0) {
R_font(opt1->answer);
D_font(opt1->answer);
break;
}
i++;
Expand All @@ -128,10 +127,10 @@ int main(int argc, char **argv)
}

if (opt3->answer) /* Set character encoding */
R_encoding(opt3->answer);
D_encoding(opt3->answer);

/* add this command to the list */
R_close_driver();
D_close_driver();

exit(EXIT_SUCCESS);
}
Expand All @@ -143,9 +142,9 @@ static void read_freetype_fonts(int verbose)
int i;

if (verbose)
R_font_info(&list, &count);
D_font_info(&list, &count);
else
R_font_list(&list, &count);
D_font_list(&list, &count);

if (max_fonts < num_fonts + count) {
max_fonts = num_fonts + count;
Expand Down
10 changes: 5 additions & 5 deletions display/d.fontlist/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/display_raster.h>
#include <grass/display.h>
#include <grass/glocale.h>

int main(int argc, char **argv)
Expand Down Expand Up @@ -49,18 +49,18 @@ int main(int argc, char **argv)
if (G_parser(argc, argv))
exit(EXIT_FAILURE);

if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

if (flagL->answer)
R_font_info(&list, &count);
D_font_info(&list, &count);
else
R_font_list(&list, &count);
D_font_list(&list, &count);

for (i = 0; i < count; i++)
fprintf(stdout, "%s\n", list[i]);

R_close_driver();
D_close_driver();

exit(EXIT_SUCCESS);
}
Expand Down
5 changes: 2 additions & 3 deletions display/d.geodesic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/glocale.h>
#include "local_proto.h"

Expand Down Expand Up @@ -92,7 +91,7 @@ int main(int argc, char *argv[])
G_fatal_error(_("%s - illegal longitude"), parm.coor->answers[3]);


if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

line_color = D_translate_color(parm.lcolor->answer);
Expand All @@ -114,7 +113,7 @@ int main(int argc, char *argv[])

plot(lon1, lat1, lon2, lat2, line_color, text_color);

R_close_driver();
D_close_driver();

exit(EXIT_SUCCESS);
}
5 changes: 2 additions & 3 deletions display/d.geodesic/plot.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <string.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/gis.h>
#include <stdio.h>
#include "local_proto.h"
Expand Down Expand Up @@ -56,7 +55,7 @@ void plot(double lon1, double lat1, double lon2, double lat2,
double t, b, l, r;
char buf[100];

R_text_size(10, 10);
D_text_size(10, 10);

distance = G_geodesic_distance(lon1, lat1, lon2, lat2);
sprintf(buf, "%.0f miles", METERS_TO_MILES(distance));
Expand All @@ -76,6 +75,6 @@ void plot(double lon1, double lat1, double lon2, double lat2,
D_use_color(text_color);

D_pos_abs(text_x, text_y);
R_text(buf);
D_text(buf);
}
}
9 changes: 4 additions & 5 deletions display/d.graph/do_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/symbol.h>
#include <grass/glocale.h>

Expand Down Expand Up @@ -50,7 +49,7 @@ int set_graph_stuff(void)
int set_text_size(void)
{
if (hsize >= 0. && vsize >= 0. && hsize <= 100. && vsize <= 100.) {
R_text_size(hsize * xincr, vsize * yincr);
D_text_size(hsize * xincr, vsize * yincr);
G_debug(3, "text size initialized to [%.1f,%.1f]",
hsize * xincr, vsize * yincr);
}
Expand Down Expand Up @@ -203,7 +202,7 @@ int do_size(const char *str)
if (xper < 0. || yper < 0. || xper > 100. || yper > 100.)
return (-1);

R_text_size(xper * xincr, yper * yincr);
D_text_size(xper * xincr, yper * yincr);
G_debug(3, "text size set to [%.1f,%.1f]",
xper * xincr, yper * yincr);

Expand All @@ -217,7 +216,7 @@ int do_rotate(const char *str)
return (-1);
}

R_text_rotation(rotation);
D_text_rotation(rotation);
G_debug(3, "rotation set to %.1f degrees", rotation);

return (0);
Expand All @@ -232,7 +231,7 @@ int do_text(const char *str)
;
for (; *ptr == ' '; ptr++)
;
R_text(ptr);
D_text(ptr);

return 0;
}
Expand Down
5 changes: 2 additions & 3 deletions display/d.graph/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/display.h>
#include <grass/display_raster.h>
#include <grass/glocale.h>

#include "options.h"
Expand Down Expand Up @@ -96,7 +95,7 @@ int main(int argc, char **argv)
infile = stdin;

/* open graphics window */
if (R_open_driver() != 0)
if (D_open_driver() != 0)
G_fatal_error(_("No graphics device selected"));

/* Parse and select color */
Expand Down Expand Up @@ -128,7 +127,7 @@ int main(int argc, char **argv)
set_text_size();
graphics(infile);

R_close_driver();
D_close_driver();

exit(EXIT_SUCCESS);
}
Loading

0 comments on commit e937b11

Please sign in to comment.