Selaa lähdekoodia

Remove Client_{Open,Close} methods
Remove *_rel methods, remove _abs suffix from *_abs methods



git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32648 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements 17 vuotta sitten
vanhempi
commit
4b2dae391e

+ 1 - 1
lib/cairodriver/Box.c

@@ -2,7 +2,7 @@
 
 /* Box_abs: Draw a (filled) rectangle */
 
-void Cairo_Box_abs(int x1, int y1, int x2, int y2)
+void Cairo_Box(int x1, int y1, int x2, int y2)
 {
     G_debug(3, "Cairo_Box_abs %d %d %d %d\n", x1, y1, x2, y2);
 

+ 0 - 8
lib/cairodriver/Client.c

@@ -1,8 +0,0 @@
-#include "cairodriver.h"
-
-void Cairo_Client_Close(void)
-{
-    G_debug(1, "Cairo_Client_Close");
-    if (auto_write)
-	write_image();
-}

+ 4 - 10
lib/cairodriver/Driver.c

@@ -27,20 +27,14 @@ const struct driver *Cairo_Driver(void)
     if (initialized)
 	return &drv;
 
-    drv.Box_abs = Cairo_Box_abs;
-    drv.Box_rel = NULL;
-    drv.Client_Open = NULL;
-    drv.Client_Close = Cairo_Client_Close;
+    drv.Box = Cairo_Box;
     drv.Erase = Cairo_Erase;
     drv.Graph_set = Cairo_Graph_set;
     drv.Graph_close = Cairo_Graph_close;
     drv.Line_width = Cairo_Line_width;
-    drv.Polydots_abs = NULL;
-    drv.Polydots_rel = NULL;
-    drv.Polyline_abs = Cairo_Polyline_abs;
-    drv.Polyline_rel = NULL;
-    drv.Polygon_abs = Cairo_Polygon_abs;
-    drv.Polygon_rel = NULL;
+    drv.Polydots = NULL;
+    drv.Polyline = Cairo_Polyline;
+    drv.Polygon = Cairo_Polygon;
     drv.Set_window = Cairo_Set_window;
     drv.Begin_scaled_raster = Cairo_begin_scaled_raster;
     drv.Scaled_raster = Cairo_scaled_raster;

+ 4 - 4
lib/cairodriver/Poly.c

@@ -9,16 +9,16 @@ void do_polygon(const int *xarray, const int *yarray, int count)
 	cairo_line_to(cairo, xarray[i], yarray[i]);
 }
 
-void Cairo_Polygon_abs(const int *xarray, const int *yarray, int count)
+void Cairo_Polygon(const int *xarray, const int *yarray, int count)
 {
-    G_debug(3, "Cairo_Polygon_abs (%d points)", count);
+    G_debug(3, "Cairo_Polygon (%d points)", count);
     do_polygon(xarray, yarray, count);
     cairo_fill(cairo);
 }
 
-void Cairo_Polyline_abs(const int *xarray, const int *yarray, int count)
+void Cairo_Polyline(const int *xarray, const int *yarray, int count)
 {
-    G_debug(3, "Cairo_Polyline_abs (%d points)", count);
+    G_debug(3, "Cairo_Polyline (%d points)", count);
     do_polygon(xarray, yarray, count);
     cairo_stroke(cairo);
 }

+ 3 - 3
lib/cairodriver/cairodriver.h

@@ -49,7 +49,7 @@ extern const struct driver *Cairo_Driver(void);
 extern void Cairo_Client_Close(void);
 extern int Cairo_Graph_set(int, char **);
 extern void Cairo_Graph_close(void);
-extern void Cairo_Box_abs(int, int, int, int);
+extern void Cairo_Box(int, int, int, int);
 extern void Cairo_Set_window(int, int, int, int);
 extern void Cairo_draw_line(int, int, int, int);
 extern void Cairo_draw_bitmap(int, int, int, const unsigned char *);
@@ -63,8 +63,8 @@ extern int Cairo_scaled_raster(int, int,
 			       const unsigned char *, const unsigned char *);
 extern void Cairo_end_scaled_raster(void);
 extern void Cairo_Line_width(int);
-extern void Cairo_Polygon_abs(const int *, const int *, int);
-extern void Cairo_Polyline_abs(const int *, const int *, int);
+extern void Cairo_Polygon(const int *, const int *, int);
+extern void Cairo_Polyline(const int *, const int *, int);
 extern void Cairo_Respond(void);
 
 /* read.c */

+ 2 - 7
lib/driver/Box.c

@@ -5,8 +5,8 @@ void COM_Box_abs(int x1, int y1, int x2, int y2)
 {
     int x[4], y[4];
 
-    if (driver->Box_abs) {
-	(*driver->Box_abs) (x1, y1, x2, y2);
+    if (driver->Box) {
+	(*driver->Box) (x1, y1, x2, y2);
 	return;
     }
 
@@ -24,10 +24,5 @@ void COM_Box_abs(int x1, int y1, int x2, int y2)
 
 void COM_Box_rel(int x, int y)
 {
-    if (driver->Box_rel) {
-	(*driver->Box_rel) (x, y);
-	return;
-    }
-
     COM_Box_abs(cur_x, cur_y, cur_x + x, cur_y + y);
 }

+ 0 - 14
lib/driver/Client.c

@@ -1,14 +0,0 @@
-#include "driver.h"
-#include "driverlib.h"
-
-void COM_Client_Open(void)
-{
-    if (driver->Client_Open)
-	(*driver->Client_Open) ();
-}
-
-void COM_Client_Close(void)
-{
-    if (driver->Client_Close)
-	(*driver->Client_Close) ();
-}

+ 2 - 7
lib/driver/Polydots.c

@@ -5,8 +5,8 @@ void COM_Polydots_abs(const int *xarray, const int *yarray, int number)
 {
     int i;
 
-    if (driver->Polydots_abs) {
-	(*driver->Polydots_abs) (xarray, yarray, number);
+    if (driver->Polydots) {
+	(*driver->Polydots) (xarray, yarray, number);
 	return;
     }
 
@@ -20,11 +20,6 @@ void COM_Polydots_rel(const int *xarray, const int *yarray, int number)
 {
     int i;
 
-    if (driver->Polydots_rel) {
-	(*driver->Polydots_rel) (xarray, yarray, number);
-	return;
-    }
-
     for (i = 0; i < number; i++) {
 	COM_Move_rel(xarray[i], yarray[i]);
 	COM_Cont_rel(0, 0);

+ 2 - 7
lib/driver/Polygon.c

@@ -121,8 +121,8 @@ static void fill_polygon(const int *xarray, const int *yarray, int count)
 
 void COM_Polygon_abs(const int *xarray, const int *yarray, int number)
 {
-    if (driver->Polygon_abs) {
-	(*driver->Polygon_abs) (xarray, yarray, number);
+    if (driver->Polygon) {
+	(*driver->Polygon) (xarray, yarray, number);
 	return;
     }
 
@@ -135,11 +135,6 @@ void COM_Polygon_rel(const int *xarray, const int *yarray, int number)
     static int nalloc;
     int i;
 
-    if (driver->Polygon_rel) {
-	(*driver->Polygon_rel) (xarray, yarray, number);
-	return;
-    }
-
     if (number > nalloc) {
 	nalloc = number;
 	xa = G_realloc(xa, (size_t) nalloc * sizeof(int));

+ 2 - 7
lib/driver/Polyline.c

@@ -5,8 +5,8 @@ void COM_Polyline_abs(const int *xarray, const int *yarray, int number)
 {
     int i;
 
-    if (driver->Polyline_abs) {
-	(*driver->Polyline_abs) (xarray, yarray, number);
+    if (driver->Polyline) {
+	(*driver->Polyline) (xarray, yarray, number);
 	return;
     }
 
@@ -20,11 +20,6 @@ void COM_Polyline_rel(const int *xarray, const int *yarray, int number)
 {
     int i;
 
-    if (driver->Polyline_rel) {
-	(*driver->Polyline_rel) (xarray, yarray, number);
-	return;
-    }
-
     COM_Move_rel(xarray[0], yarray[0]);
 
     for (i = 1; i < number; i++)

+ 4 - 14
lib/driver/driver.h

@@ -24,20 +24,14 @@ extern struct GFONT_CAP *ftcap;
 
 struct driver
 {
-    void (*Box_abs) (int, int, int, int);
-    void (*Box_rel) (int, int);
-    void (*Client_Open) (void);
-    void (*Client_Close) (void);
+    void (*Box) (int, int, int, int);
     void (*Erase) (void);
     int (*Graph_set) (int, char **);
     void (*Graph_close) (void);
     void (*Line_width) (int);
-    void (*Polydots_abs) (const int *, const int *, int);
-    void (*Polydots_rel) (const int *, const int *, int);
-    void (*Polyline_abs) (const int *, const int *, int);
-    void (*Polyline_rel) (const int *, const int *, int);
-    void (*Polygon_abs) (const int *, const int *, int);
-    void (*Polygon_rel) (const int *, const int *, int);
+    void (*Polydots) (const int *, const int *, int);
+    void (*Polyline) (const int *, const int *, int);
+    void (*Polygon) (const int *, const int *, int);
     void (*Set_window) (int, int, int, int);
     void (*Begin_scaled_raster) (int, int[2][2], int[2][2]);
     int (*Scaled_raster) (int, int,
@@ -69,10 +63,6 @@ extern void COM_Bitmap(int, int, int, const unsigned char *);
 extern void COM_Box_abs(int, int, int, int);
 extern void COM_Box_rel(int, int);
 
-/* Client.c */
-extern void COM_Client_Open(void);
-extern void COM_Client_Close(void);
-
 /* Color.c */
 extern void COM_Color_RGB(unsigned char, unsigned char, unsigned char);
 extern void COM_Standard_color(int);

+ 4 - 10
lib/htmldriver/Driver.c

@@ -25,20 +25,14 @@ const struct driver *HTML_Driver(void)
     if (initialized)
 	return &drv;
 
-    drv.Box_abs = NULL;
-    drv.Box_rel = NULL;
-    drv.Client_Open = NULL;
-    drv.Client_Close = NULL;
+    drv.Box = NULL;
     drv.Erase = NULL;
     drv.Graph_set = HTML_Graph_set;
     drv.Graph_close = HTML_Graph_close;
     drv.Line_width = NULL;
-    drv.Polydots_abs = NULL;
-    drv.Polydots_rel = NULL;
-    drv.Polyline_abs = NULL;
-    drv.Polyline_rel = NULL;
-    drv.Polygon_abs = HTML_Polygon_abs;
-    drv.Polygon_rel = NULL;
+    drv.Polydots = NULL;
+    drv.Polyline = NULL;
+    drv.Polygon = HTML_Polygon;
     drv.Set_window = NULL;
     drv.Begin_scaled_raster = NULL;
     drv.Scaled_raster = NULL;

+ 1 - 1
lib/htmldriver/Polygn_abs.c

@@ -57,7 +57,7 @@ static double find_azimuth(double x1, double y1, double x2, double y2)
 }
 
 
-void HTML_Polygon_abs(const int *px, const int *py, int n)
+void HTML_Polygon(const int *px, const int *py, int n)
 {
     struct MapPoly *new;
     int i;

+ 2 - 2
lib/htmldriver/htmlmap.h

@@ -41,8 +41,8 @@ extern void HTML_Graph_close(void);
 /* Graph_Set.c */
 extern int HTML_Graph_set(int, char **);
 
-/* Polygn_abs.c */
-extern void HTML_Polygon_abs(const int *, const int *, int);
+/* Polygon.c */
+extern void HTML_Polygon(const int *, const int *, int);
 
 /* Text.c */
 extern void HTML_Text(const char *);

+ 1 - 1
lib/pngdriver/Box.c

@@ -1,7 +1,7 @@
 
 #include "pngdriver.h"
 
-void PNG_Box_abs(int x1, int y1, int x2, int y2)
+void PNG_Box(int x1, int y1, int x2, int y2)
 {
     int tmp;
     int x, y;

+ 0 - 8
lib/pngdriver/Client.c

@@ -1,8 +0,0 @@
-
-#include "pngdriver.h"
-
-void PNG_Client_Close(void)
-{
-    if (auto_write)
-	write_image();
-}

+ 4 - 10
lib/pngdriver/Driver.c

@@ -27,20 +27,14 @@ const struct driver *PNG_Driver(void)
     if (initialized)
 	return &drv;
 
-    drv.Box_abs = PNG_Box_abs;
-    drv.Box_rel = NULL;
-    drv.Client_Open = NULL;
-    drv.Client_Close = PNG_Client_Close;
+    drv.Box = PNG_Box;
     drv.Erase = PNG_Erase;
     drv.Graph_set = PNG_Graph_set;
     drv.Graph_close = PNG_Graph_close;
     drv.Line_width = PNG_Line_width;
-    drv.Polydots_abs = NULL;
-    drv.Polydots_rel = NULL;
-    drv.Polyline_abs = NULL;
-    drv.Polyline_rel = NULL;
-    drv.Polygon_abs = NULL;
-    drv.Polygon_rel = NULL;
+    drv.Polydots = NULL;
+    drv.Polyline = NULL;
+    drv.Polygon = NULL;
     drv.Set_window = PNG_Set_window;
     drv.Begin_scaled_raster = PNG_begin_scaled_raster;
     drv.Scaled_raster = PNG_scaled_raster;

+ 0 - 1
lib/pngdriver/Makefile

@@ -11,7 +11,6 @@ LIB_NAME = $(PNGDRIVER_LIBNAME)
 
 LIB_OBJS =	\
 	Box.o			\
-	Client.o		\
 	Color.o			\
 	Color_table.o		\
 	Draw_bitmap.o		\

+ 1 - 1
lib/pngdriver/pngdriver.h

@@ -44,7 +44,7 @@ extern void get_pixel(unsigned int, int *, int *, int *, int *);
 
 extern const struct driver *PNG_Driver(void);
 
-extern void PNG_Box_abs(int, int, int, int);
+extern void PNG_Box(int, int, int, int);
 extern void PNG_Client_Close(void);
 extern void PNG_Erase(void);
 extern void PNG_Graph_close(void);

+ 1 - 1
lib/psdriver/Box.c

@@ -1,7 +1,7 @@
 
 #include "psdriver.h"
 
-void PS_Box_abs(int x1, int y1, int x2, int y2)
+void PS_Box(int x1, int y1, int x2, int y2)
 {
     output("%d %d %d %d BOX\n", x1, y1, x2, y2);
 }

+ 0 - 7
lib/psdriver/Client.c

@@ -1,7 +0,0 @@
-
-#include "psdriver.h"
-
-void PS_Client_Close(void)
-{
-    fflush(outfp);
-}

+ 4 - 10
lib/psdriver/Driver.c

@@ -27,20 +27,14 @@ const struct driver *PS_Driver(void)
     if (initialized)
 	return &drv;
 
-    drv.Box_abs = PS_Box_abs;
-    drv.Box_rel = NULL;
-    drv.Client_Open = NULL;
-    drv.Client_Close = PS_Client_Close;
+    drv.Box = PS_Box;
     drv.Erase = PS_Erase;
     drv.Graph_set = PS_Graph_set;
     drv.Graph_close = PS_Graph_close;
     drv.Line_width = PS_Line_width;
-    drv.Polydots_abs = NULL;
-    drv.Polydots_rel = NULL;
-    drv.Polyline_abs = PS_Polyline_abs;
-    drv.Polyline_rel = NULL;
-    drv.Polygon_abs = PS_Polygon_abs;
-    drv.Polygon_rel = NULL;
+    drv.Polydots = NULL;
+    drv.Polyline = PS_Polyline;
+    drv.Polygon = PS_Polygon;
     drv.Set_window = PS_Set_window;
     drv.Begin_scaled_raster = PS_begin_scaled_raster;
     drv.Scaled_raster = PS_scaled_raster;

+ 1 - 1
lib/psdriver/Polygon.c

@@ -1,7 +1,7 @@
 
 #include "psdriver.h"
 
-void PS_Polygon_abs(const int *xarray, const int *yarray, int number)
+void PS_Polygon(const int *xarray, const int *yarray, int number)
 {
     int i;
 

+ 1 - 1
lib/psdriver/Polyline.c

@@ -1,7 +1,7 @@
 
 #include "psdriver.h"
 
-void PS_Polyline_abs(const int *xarray, const int *yarray, int number)
+void PS_Polyline(const int *xarray, const int *yarray, int number)
 {
     int i;
 

+ 3 - 3
lib/psdriver/psdriver.h

@@ -21,7 +21,7 @@ extern void init_color_table(void);
 
 extern const struct driver *PS_Driver(void);
 
-extern void PS_Box_abs(int, int, int, int);
+extern void PS_Box(int, int, int, int);
 extern void PS_Client_Close(void);
 extern void PS_Erase(void);
 extern void PS_Graph_close(void);
@@ -39,7 +39,7 @@ extern int PS_scaled_raster(int, int, const unsigned char *,
 			    const unsigned char *, const unsigned char *,
 			    const unsigned char *);
 extern void PS_end_scaled_raster(void);
-extern void PS_Polygon_abs(const int *, const int *, int);
-extern void PS_Polyline_abs(const int *, const int *, int);
+extern void PS_Polygon(const int *, const int *, int);
+extern void PS_Polyline(const int *, const int *, int);
 
 #endif /* __PSDRIVER_H__ */

+ 0 - 3
lib/raster/raster.c

@@ -54,8 +54,6 @@ int R_open_driver(void)
 
     init();
 
-    COM_Client_Open();
-
     return 0;
 }
 
@@ -69,7 +67,6 @@ void R_close_driver(void)
     char *cmd = getenv("GRASS_NOTIFY");
 
     COM_Respond();
-    COM_Client_Close();
     COM_Graph_close();
 
     if (cmd)