[GRASS-SVN] r63464 - in grass/trunk: include/defs lib/cairodriver lib/display lib/driver lib/htmldriver lib/pngdriver lib/psdriver

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 10 01:21:11 PST 2014


Author: martinl
Date: 2014-12-10 01:21:11 -0800 (Wed, 10 Dec 2014)
New Revision: 63464

Modified:
   grass/trunk/include/defs/display.h
   grass/trunk/lib/cairodriver/cairodriver.h
   grass/trunk/lib/cairodriver/driver.c
   grass/trunk/lib/cairodriver/graph.c
   grass/trunk/lib/display/setup.c
   grass/trunk/lib/driver/driver.h
   grass/trunk/lib/driver/graph.c
   grass/trunk/lib/htmldriver/driver.c
   grass/trunk/lib/pngdriver/driver.c
   grass/trunk/lib/pngdriver/graph_set.c
   grass/trunk/lib/pngdriver/pngdriver.h
   grass/trunk/lib/psdriver/driver.c
   grass/trunk/lib/psdriver/graph_set.c
   grass/trunk/lib/psdriver/psdriver.h
Log:
displaylib: add D_get_file (#2509)


Modified: grass/trunk/include/defs/display.h
===================================================================
--- grass/trunk/include/defs/display.h	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/include/defs/display.h	2014-12-10 09:21:11 UTC (rev 63464)
@@ -166,4 +166,6 @@
 void D_set_clip_window_to_map_window(void);
 void D_set_clip_window_to_screen_window(void);
 
+const char *D_get_file(void);
+
 #endif /* GRASS_DISPLAYDEFS_H */

Modified: grass/trunk/lib/cairodriver/cairodriver.h
===================================================================
--- grass/trunk/lib/cairodriver/cairodriver.h	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/cairodriver/cairodriver.h	2014-12-10 09:21:11 UTC (rev 63464)
@@ -84,6 +84,7 @@
 
 extern void Cairo_Client_Close(void);
 extern int Cairo_Graph_set(void);
+extern const char *Cairo_Graph_get_file(void);
 extern void Cairo_Graph_close(void);
 extern void Cairo_Box(double, double, double, double);
 extern void Cairo_Set_window(double, double, double, double);

Modified: grass/trunk/lib/cairodriver/driver.c
===================================================================
--- grass/trunk/lib/cairodriver/driver.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/cairodriver/driver.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -3,7 +3,7 @@
 
   \brief GRASS cairo display driver - driver initialization
 
-  (C) 2007-2008, 2011 by Lars Ahlzen and the GRASS Development Team
+  (C) 2007-2014 by Lars Ahlzen and 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.
@@ -31,6 +31,7 @@
     drv.Box = Cairo_Box;
     drv.Erase = Cairo_Erase;
     drv.Graph_set = Cairo_Graph_set;
+    drv.Graph_get_file = Cairo_Graph_get_file;
     drv.Graph_close = Cairo_Graph_close;
     drv.Line_width = Cairo_Line_width;
     drv.Set_window = Cairo_Set_window;
@@ -51,7 +52,7 @@
     drv.Set_font = Cairo_set_font;
     drv.Font_list = Cairo_font_list;
     drv.Font_info = Cairo_font_info;
-
+      
     initialized = 1;
 
     return &drv;

Modified: grass/trunk/lib/cairodriver/graph.c
===================================================================
--- grass/trunk/lib/cairodriver/graph.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/cairodriver/graph.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -279,6 +279,16 @@
 }
 
 /*!
+  \brief Get render file
+
+  \return file name
+*/
+const char *Cairo_Graph_get_file(void)
+{
+    return ca.file_name;
+}
+ 
+/*!
   \brief Close driver
 */
 void Cairo_Graph_close(void)

Modified: grass/trunk/lib/display/setup.c
===================================================================
--- grass/trunk/lib/display/setup.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/display/setup.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -17,6 +17,8 @@
 #include <grass/raster.h>
 #include <grass/display.h>
 
+#include "driver.h"
+
 /*!
   \brief Graphics frame setup
 
@@ -130,3 +132,13 @@
 
     D_set_clip_window_to_map_window();
 }
+
+/*!
+  \brief Get driver output file
+
+  \return file name or NULL if not defined
+*/
+const char *D_get_file(void)
+{
+    return COM_Graph_get_file();
+}

Modified: grass/trunk/lib/driver/driver.h
===================================================================
--- grass/trunk/lib/driver/driver.h	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/driver/driver.h	2014-12-10 09:21:11 UTC (rev 63464)
@@ -22,11 +22,12 @@
 struct driver
 {
     char *name;
-    
+
     void (*Box)(double, double, double, double);
     void (*Erase)(void);
     int (*Graph_set)(void);
     void (*Graph_close)(void);
+    const char * (*Graph_get_file)(void);
     void (*Line_width)(double);
     void (*Set_window)(double, double, double, double);
     void (*Begin_raster)(int, int[2][2], double[2][2]);
@@ -82,6 +83,7 @@
 /* graph.c */
 extern int COM_Graph_set(void);
 extern void COM_Graph_close(void);
+extern const char *COM_Graph_get_file(void);
 
 /* line_width.c */
 extern void COM_Line_width(double);

Modified: grass/trunk/lib/driver/graph.c
===================================================================
--- grass/trunk/lib/driver/graph.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/driver/graph.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "driver.h"
 #include "driverlib.h"
 
@@ -13,3 +14,11 @@
     if (driver->Graph_close)
 	(*driver->Graph_close) ();
 }
+
+const char *COM_Graph_get_file(void)
+{
+    if (driver->Graph_get_file)
+        return (*driver->Graph_get_file) ();
+
+    return NULL;
+}

Modified: grass/trunk/lib/htmldriver/driver.c
===================================================================
--- grass/trunk/lib/htmldriver/driver.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/htmldriver/driver.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -30,6 +30,7 @@
     drv.Erase = NULL;
     drv.Graph_set = HTML_Graph_set;
     drv.Graph_close = HTML_Graph_close;
+    drv.Graph_get_file = NULL;
     drv.Line_width = NULL;
     drv.Set_window = NULL;
     drv.Begin_raster = NULL;

Modified: grass/trunk/lib/pngdriver/driver.c
===================================================================
--- grass/trunk/lib/pngdriver/driver.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/pngdriver/driver.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -3,7 +3,7 @@
 
   \brief GRASS png display driver - driver initialization
 
-  (C) 2007 by Glynn Clements and the GRASS Development Team
+  (C) 2007-2014 by Glynn Clements and 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.
@@ -31,6 +31,7 @@
     drv.Erase = PNG_Erase;
     drv.Graph_set = PNG_Graph_set;
     drv.Graph_close = PNG_Graph_close;
+    drv.Graph_get_file = PNG_Graph_get_file;
     drv.Line_width = PNG_Line_width;
     drv.Set_window = PNG_Set_window;
     drv.Begin_raster = PNG_begin_raster;

Modified: grass/trunk/lib/pngdriver/graph_set.c
===================================================================
--- grass/trunk/lib/pngdriver/graph_set.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/pngdriver/graph_set.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -171,3 +171,13 @@
 
     return 0;
 }
+
+/*!
+  \brief Get render file
+
+  \return file name
+*/
+const char *PNG_Graph_get_file(void)
+{
+    return png.file_name;
+}

Modified: grass/trunk/lib/pngdriver/pngdriver.h
===================================================================
--- grass/trunk/lib/pngdriver/pngdriver.h	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/pngdriver/pngdriver.h	2014-12-10 09:21:11 UTC (rev 63464)
@@ -76,6 +76,7 @@
 extern void PNG_Erase(void);
 extern void PNG_Graph_close(void);
 extern int PNG_Graph_set(void);
+extern const char *PNG_Graph_get_file(void);
 extern void PNG_Line_width(double);
 extern void PNG_begin_raster(int, int[2][2], double[2][2]);
 extern int PNG_raster(int, int, const unsigned char *,

Modified: grass/trunk/lib/psdriver/driver.c
===================================================================
--- grass/trunk/lib/psdriver/driver.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/psdriver/driver.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -32,6 +32,7 @@
     drv.Erase = PS_Erase;
     drv.Graph_set = PS_Graph_set;
     drv.Graph_close = PS_Graph_close;
+    drv.Graph_get_file = PS_Graph_get_file;
     drv.Line_width = PS_Line_width;
     drv.Set_window = PS_Set_window;
     drv.Begin_raster = PS_begin_raster;

Modified: grass/trunk/lib/psdriver/graph_set.c
===================================================================
--- grass/trunk/lib/psdriver/graph_set.c	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/psdriver/graph_set.c	2014-12-10 09:21:11 UTC (rev 63464)
@@ -220,6 +220,16 @@
     return 0;
 }
 
+/*!
+  \brief Get render file
+
+  \return file name
+*/
+const char *PS_Graph_get_file(void)
+{
+    return file_name;
+}
+
 void output(const char *fmt, ...)
 {
     va_list va;

Modified: grass/trunk/lib/psdriver/psdriver.h
===================================================================
--- grass/trunk/lib/psdriver/psdriver.h	2014-12-10 08:31:23 UTC (rev 63463)
+++ grass/trunk/lib/psdriver/psdriver.h	2014-12-10 09:21:11 UTC (rev 63464)
@@ -31,6 +31,7 @@
 extern void PS_Erase(void);
 extern void PS_Graph_close(void);
 extern int PS_Graph_set(void);
+extern const char *PS_Graph_get_file(void);
 extern void PS_Line_width(double);
 extern void PS_Set_window(double, double, double, double);
 extern void PS_Color(int, int, int);



More information about the grass-commit mailing list