瀏覽代碼

R_() fns used only by display library renamed to R__()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38001 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 年之前
父節點
當前提交
645a6809d3
共有 7 個文件被更改,包括 81 次插入97 次删除
  1. 21 27
      include/display_raster.h
  2. 11 11
      lib/display/draw2.c
  3. 34 44
      lib/display/r_raster.c
  4. 4 4
      lib/display/raster.c
  5. 1 1
      lib/display/raster2.c
  6. 3 3
      lib/display/tran_colr.c
  7. 7 7
      lib/display/window.c

+ 21 - 27
include/display_raster.h

@@ -1,45 +1,39 @@
-#ifndef _GRASS_RASTER_H
-#define _GRASS_RASTER_H
+#ifndef _GRASS_DISPLAY_RASTER_H
+#define _GRASS_DISPLAY_RASTER_H
+
+void R__line_width(double);
+void R__get_text_box(const char *, double *, double *, double *, double *);
+void R__pos_abs(double, double);
+void R__begin(void);
+void R__move(double, double);
+void R__cont(double, double);
+void R__close(void);
+void R__stroke(void);
+void R__fill(void);
+void R__point(double, double);
+void R__RGB_color(int, int, int);
+int R__scaled_raster(int, int,
+		     const unsigned char *,
+		     const unsigned char *,
+		     const unsigned char *, const unsigned char *);
+void R__begin_scaled_raster(int, int[2][2], double[2][2]);
+void R__end_scaled_raster(void);
+void R__standard_color(int);
 
 
 int R_open_driver(void);
 int R_open_driver(void);
 void R_close_driver(void);
 void R_close_driver(void);
 
 
-void R_set_window(double, double, double, double);
 void R_get_window(double *, double *, double *, double *);
 void R_get_window(double *, double *, double *, double *);
 
 
-void R_standard_color(int);
-void R_RGB_color(int, int, int);
-
-void R_line_width(double);
 void R_erase(void);
 void R_erase(void);
 
 
-void R_pos_abs(double, double);
-void R_box_abs(double, double, double, double);
-
-void R_begin(void);
-void R_move(double, double);
-void R_cont(double, double);
-void R_close(void);
-void R_stroke(void);
-void R_fill(void);
-void R_point(double, double);
-
 void R_text_size(double, double);
 void R_text_size(double, double);
 void R_text_rotation(double);
 void R_text_rotation(double);
 void R_text(const char *);
 void R_text(const char *);
-void R_get_text_box(const char *, double *, double *, double *, double *);
 
 
 void R_font(const char *);
 void R_font(const char *);
 void R_encoding(const char *);
 void R_encoding(const char *);
 void R_font_list(char ***, int *);
 void R_font_list(char ***, int *);
 void R_font_info(char ***, int *);
 void R_font_info(char ***, int *);
 
 
-void R_begin_scaled_raster(int, int[2][2], double[2][2]);
-int R_scaled_raster(int, int,
-		    const unsigned char *,
-		    const unsigned char *,
-		    const unsigned char *, const unsigned char *);
-void R_end_scaled_raster(void);
-void R_bitmap(int, int, int, const unsigned char *);
-
 #endif
 #endif

+ 11 - 11
lib/display/draw2.c

@@ -3,8 +3,8 @@
 #include <string.h>
 #include <string.h>
 
 
 #include <grass/gis.h>
 #include <grass/gis.h>
-#include <grass/display_raster.h>
 #include <grass/display.h>
 #include <grass/display.h>
+#include <grass/display_raster.h>
 #include <grass/glocale.h>
 #include <grass/glocale.h>
 #include "path.h"
 #include "path.h"
 #include "clip.h"
 #include "clip.h"
@@ -186,14 +186,14 @@ void D_set_reduction(double e)
 
 
 void D_line_width(double d)
 void D_line_width(double d)
 {
 {
-    R_line_width(d > 0 ? d : 0);
+    R__line_width(d > 0 ? d : 0);
 }
 }
 
 
 void D_get_text_box(const char *text, double *t, double *b, double *l, double *r)
 void D_get_text_box(const char *text, double *t, double *b, double *l, double *r)
 {
 {
     double T, B, L, R;
     double T, B, L, R;
 
 
-    R_get_text_box(text, &T, &B, &L, &R);
+    R__get_text_box(text, &T, &B, &L, &R);
 
 
     *t = D_d_to_u_row(T);
     *t = D_d_to_u_row(T);
     *b = D_d_to_u_row(B);
     *b = D_d_to_u_row(B);
@@ -219,7 +219,7 @@ void D_pos_abs(double x, double y)
     x = D_u_to_d_col(x);
     x = D_u_to_d_col(x);
     y = D_u_to_d_row(y);
     y = D_u_to_d_row(y);
 
 
-    R_pos_abs(x, y);
+    R__pos_abs(x, y);
 }
 }
 
 
 void D_pos_rel(double x, double y)
 void D_pos_rel(double x, double y)
@@ -266,19 +266,19 @@ static void do_path(int no_pole)
 	p = &eps_path;
 	p = &eps_path;
     }
     }
 
 
-    R_begin();
+    R__begin();
     for (i = 0; i < p->count; i++) {
     for (i = 0; i < p->count; i++) {
 	struct vertex *v = &p->vertices[i];
 	struct vertex *v = &p->vertices[i];
 	switch (v->mode)
 	switch (v->mode)
 	{
 	{
 	case P_MOVE:
 	case P_MOVE:
-	    R_move(v->x, v->y);
+	    R__move(v->x, v->y);
 	    break;
 	    break;
 	case P_CONT:
 	case P_CONT:
-	    R_cont(v->x, v->y);
+	    R__cont(v->x, v->y);
 	    break;
 	    break;
 	case P_CLOSE:
 	case P_CLOSE:
-	    R_close();
+	    R__close();
 	    break;
 	    break;
 	}
 	}
     }
     }
@@ -317,13 +317,13 @@ void D_close(void)
 void D_stroke(void)
 void D_stroke(void)
 {
 {
     do_path(0);
     do_path(0);
-    R_stroke();
+    R__stroke();
 }
 }
 
 
 void D_fill(void)
 void D_fill(void)
 {
 {
     do_path(1);
     do_path(1);
-    R_fill();
+    R__fill();
 }
 }
 
 
 void D_dots(void)
 void D_dots(void)
@@ -352,7 +352,7 @@ void D_dots(void)
 	x = D_u_to_d_col(x);
 	x = D_u_to_d_col(x);
 	y = D_u_to_d_row(y);
 	y = D_u_to_d_row(y);
 
 
-	R_point(x, y);
+	R__point(x, y);
     }
     }
 }
 }
 
 

+ 34 - 44
lib/display/r_raster.c

@@ -1,3 +1,15 @@
+/*!
+  \file display/r_raster.c
+
+  \brief Display Library - Raster graphics subroutines
+
+  (C) 2001-2009 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.
+
+  \author Original author CERL
+*/
 
 
 #include <grass/config.h>
 #include <grass/config.h>
 
 
@@ -22,6 +34,8 @@ extern const struct driver *HTML_Driver(void);
 extern const struct driver *Cairo_Driver(void);
 extern const struct driver *Cairo_Driver(void);
 #endif
 #endif
 
 
+static void set_window(double, double, double, double);
+
 static void init(void)
 static void init(void)
 {
 {
     const char *fenc = getenv("GRASS_ENCODING");
     const char *fenc = getenv("GRASS_ENCODING");
@@ -36,7 +50,7 @@ static void init(void)
 	R_encoding(fenc);
 	R_encoding(fenc);
 
 
     if (line_width)
     if (line_width)
-	R_line_width(atof(line_width));
+	R__line_width(atof(line_width));
 
 
     if (text_size) {
     if (text_size) {
 	double s = atof(text_size);
 	double s = atof(text_size);
@@ -48,7 +62,7 @@ static void init(void)
     if (frame) {
     if (frame) {
 	double t, b, l, r;
 	double t, b, l, r;
 	sscanf(frame, "%lf,%lf,%lf,%lf", &t, &b, &l, &r);
 	sscanf(frame, "%lf,%lf,%lf,%lf", &t, &b, &l, &r);
-	R_set_window(t, b, l, r);
+	set_window(t, b, l, r);
     }
     }
 }
 }
 
 
@@ -95,7 +109,7 @@ void R_close_driver(void)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_standard_color(int index)
+void R__standard_color(int index)
 {
 {
     COM_Standard_color(index);
     COM_Standard_color(index);
 }
 }
@@ -114,7 +128,7 @@ void R_standard_color(int index)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_RGB_color(int red, int grn, int blu)
+void R__RGB_color(int red, int grn, int blu)
 {
 {
     COM_Color_RGB(red, grn, blu);
     COM_Color_RGB(red, grn, blu);
 }
 }
@@ -128,7 +142,7 @@ void R_RGB_color(int red, int grn, int blu)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_line_width(double width)
+void R__line_width(double width)
 {
 {
     COM_Line_width(width);
     COM_Line_width(width);
 }
 }
@@ -158,31 +172,12 @@ void R_erase(void)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_pos_abs(double x, double y)
+void R__pos_abs(double x, double y)
 {
 {
     COM_Pos_abs(x, y);
     COM_Pos_abs(x, y);
 }
 }
 
 
 /*!
 /*!
- * \brief fill a box
- *
- * A box is drawn in the current color using the coordinates <b>x1,y1</b> and
- * <b>x2,y2</b> as opposite corners of the box. The current location is undefined
- * afterwards
- *
- *  \param x1
- *  \param y1
- *  \param x2
- *  \param y2
- *  \return void
- */
-
-void R_box_abs(double x1, double y1, double x2, double y2)
-{
-    COM_Box_abs(x1, y1, x2, y2);
-}
-
-/*!
  * \brief set text size
  * \brief set text size
  *
  *
  * Sets text pixel width and height to <b>width</b> and <b>height.</b>
  * Sets text pixel width and height to <b>width</b> and <b>height.</b>
@@ -215,7 +210,7 @@ void R_text_rotation(double rotation)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_set_window(double t, double b, double l, double r)
+void set_window(double t, double b, double l, double r)
 {
 {
     COM_Set_window(t, b, l, r);
     COM_Set_window(t, b, l, r);
 }
 }
@@ -269,7 +264,7 @@ void R_text(const char *text)
  *  \return void
  *  \return void
  */
  */
 
 
-void R_get_text_box(const char *text, double *t, double *b, double *l, double *r)
+void R__get_text_box(const char *text, double *t, double *b, double *l, double *r)
 {
 {
     COM_Get_text_box(text, t, b, l, r);
     COM_Get_text_box(text, t, b, l, r);
 }
 }
@@ -303,59 +298,54 @@ void R_font_info(char ***list, int *count)
     COM_Font_info(list, count);
     COM_Font_info(list, count);
 }
 }
 
 
-void R_begin_scaled_raster(int mask, int src[2][2], double dst[2][2])
+void R__begin_scaled_raster(int mask, int src[2][2], double dst[2][2])
 {
 {
     COM_begin_raster(mask, src, dst);
     COM_begin_raster(mask, src, dst);
 }
 }
 
 
-int R_scaled_raster(int n, int row,
-		      const unsigned char *red, const unsigned char *grn,
-		      const unsigned char *blu, const unsigned char *nul)
+int R__scaled_raster(int n, int row,
+		     const unsigned char *red, const unsigned char *grn,
+		     const unsigned char *blu, const unsigned char *nul)
 {
 {
     return COM_raster(n, row, red, grn, blu, nul);
     return COM_raster(n, row, red, grn, blu, nul);
 }
 }
 
 
-void R_end_scaled_raster(void)
+void R__end_scaled_raster(void)
 {
 {
     COM_end_raster();
     COM_end_raster();
 }
 }
 
 
-void R_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
-{
-    COM_Bitmap(ncols, nrows, threshold, buf);
-}
-
-void R_begin(void)
+void R__begin(void)
 {
 {
     COM_Begin();
     COM_Begin();
 }
 }
 
 
-void R_move(double x, double y)
+void R__move(double x, double y)
 {
 {
     COM_Move(x, y);
     COM_Move(x, y);
 }
 }
 
 
-void R_cont(double x, double y)
+void R__cont(double x, double y)
 {
 {
     COM_Cont(x, y);
     COM_Cont(x, y);
 }
 }
 
 
-void R_close(void)
+void R__close(void)
 {
 {
     COM_Close();
     COM_Close();
 }
 }
 
 
-void R_stroke(void)
+void R__stroke(void)
 {
 {
     COM_Stroke();
     COM_Stroke();
 }
 }
 
 
-void R_fill(void)
+void R__fill(void)
 {
 {
     COM_Fill();
     COM_Fill();
 }
 }
 
 
-void R_point(double x, double y)
+void R__point(double x, double y)
 {
 {
     COM_Point(x, y);
     COM_Point(x, y);
 }
 }

+ 4 - 4
lib/display/raster.c

@@ -108,7 +108,7 @@ static int draw_cell(int A_row,
 	}
 	}
 
 
     A_row =
     A_row =
-	R_scaled_raster(ncols, A_row, red, grn, blu,
+	R__scaled_raster(ncols, A_row, red, grn, blu,
 			D__overlay_mode ? set : NULL);
 			D__overlay_mode ? set : NULL);
 
 
     return (A_row < src[1][1])
     return (A_row < src[1][1])
@@ -135,7 +135,7 @@ void D_cell_draw_begin(void)
     /* Set up the screen for drawing map */
     /* Set up the screen for drawing map */
     D_get_a(src);
     D_get_a(src);
     D_get_d(dst);
     D_get_d(dst);
-    R_begin_scaled_raster(D__overlay_mode, src, dst);
+    R__begin_scaled_raster(D__overlay_mode, src, dst);
 }
 }
 
 
 int D_draw_raster_RGB(int A_row,
 int D_draw_raster_RGB(int A_row,
@@ -183,7 +183,7 @@ int D_draw_raster_RGB(int A_row,
 	}
 	}
 
 
     A_row =
     A_row =
-	R_scaled_raster(ncols, A_row, r_buf, g_buf, b_buf,
+	R__scaled_raster(ncols, A_row, r_buf, g_buf, b_buf,
 			D__overlay_mode ? n_buf : NULL);
 			D__overlay_mode ? n_buf : NULL);
 
 
     return (A_row < src[1][1])
     return (A_row < src[1][1])
@@ -192,5 +192,5 @@ int D_draw_raster_RGB(int A_row,
 
 
 void D_cell_draw_end(void)
 void D_cell_draw_end(void)
 {
 {
-    R_end_scaled_raster();
+    R__end_scaled_raster();
 }
 }

+ 1 - 1
lib/display/raster2.c

@@ -137,7 +137,7 @@ int D_color_of_type(const void *raster,
     int r, g, b;
     int r, g, b;
 
 
     G_get_raster_color(raster, &r, &g, &b, colors, data_type);
     G_get_raster_color(raster, &r, &g, &b, colors, data_type);
-    R_RGB_color((unsigned char)r, (unsigned char)g, (unsigned char)b);
+    R__RGB_color((unsigned char)r, (unsigned char)g, (unsigned char)b);
 
 
     return 0;
     return 0;
 }
 }

+ 3 - 3
lib/display/tran_colr.c

@@ -144,14 +144,14 @@ int D_use_color(int color)
 	return 0;
 	return 0;
 
 
     if (color < G_num_standard_colors()) {
     if (color < G_num_standard_colors()) {
-	R_standard_color(color);
+	R__standard_color(color);
 	return 1;
 	return 1;
     }
     }
 
 
     if (color < ncolors) {
     if (color < ncolors) {
 	const struct color_rgb *c = &colors[color];
 	const struct color_rgb *c = &colors[color];
 
 
-	R_RGB_color(c->r, c->g, c->b);
+	R__RGB_color(c->r, c->g, c->b);
 	return 1;
 	return 1;
     }
     }
 
 
@@ -211,6 +211,6 @@ int D_color_number_to_RGB(int color, int *r, int *g, int *b)
 
 
 void D_RGB_color(int red, int grn, int blu)
 void D_RGB_color(int red, int grn, int blu)
 {
 {
-    R_RGB_color(red, grn, blu);
+    R__RGB_color(red, grn, blu);
 }
 }
 
 

+ 7 - 7
lib/display/window.c

@@ -21,12 +21,12 @@ void D_erase(const char *color)
     D_use_color(colorindex);
     D_use_color(colorindex);
 
 
     /* Do the plotting */
     /* Do the plotting */
-    R_begin();
-    R_move(l, b);
-    R_cont(r, b);
-    R_cont(r, t);
-    R_cont(l, t);
-    R_close();
-    R_fill();
+    R__begin();
+    R__move(l, b);
+    R__cont(r, b);
+    R__cont(r, t);
+    R__cont(l, t);
+    R__close();
+    R__fill();
 }
 }