[GRASS-CVS] hamish: grass6/scripts/d.out.file d.out.file, 1.13, 1.14

grass at intevation.de grass at intevation.de
Thu Nov 22 04:01:59 EST 2007


Author: hamish

Update of /grassrepository/grass6/scripts/d.out.file
In directory doto:/tmp/cvs-serv22301

Modified Files:
	d.out.file 
Log Message:
add support for the Cairo driver


Index: d.out.file
===================================================================
RCS file: /grassrepository/grass6/scripts/d.out.file/d.out.file,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- d.out.file	16 May 2007 04:24:06 -0000	1.13
+++ d.out.file	22 Nov 2007 09:01:56 -0000	1.14
@@ -99,19 +99,24 @@
 #% description: PostScript level (only limits functionality!)
 #% guisection: PostScript
 #% required : no
-#%end
+#% end
 #%flag
-#%key: b
-#%description: Set background color to black (white default)
-#%end
+#% key: b
+#% description: Set background color to black (white default)
+#% end
 #%flag
-#%key: t
-#%description: Set transparent background
+#% key: t
+#% description: Set transparent background
 #% guisection: Images
-#%end
+#% end
 #%flag
-#%key: r
-#%description: Set paper orientation to landscape (for PostScript output)
+#% key: c
+#% description: Use the Cario driver instead of the PNG driver
+#% guisection: Images
+#% end
+#%flag
+#% key: r
+#% description: Set paper orientation to landscape (for PostScript output)
 #% guisection: PostScript
 #%end
 
@@ -151,6 +156,11 @@
    exit 1
 fi
 
+if [ $GIS_FLAG_C -eq 1 ] &&  [ `d.mon -l | grep -c '^cairo'` -eq 0 ] ; then
+   g.message -e "Cairo driver not present in this build of GRASS."
+   exit 1
+fi
+
 
 #### set variables
 res="$GIS_OPT_RESOLUTION"
@@ -215,6 +225,11 @@
 
 
 if [ "$GIS_OPT_FORMAT" = "ps" ] || [ "$GIS_OPT_FORMAT" = "eps" ] ; then
+    if [ $GIS_FLAG_C -eq 1 ] ; then
+	g.message -e "Cairo driver is incompatible with the PostScript driver."
+	exit 1
+    fi
+
     GRAPHICS_DRIVER=PS
     GRASS_PSFILE="$output"
     export GRASS_PSFILE
@@ -244,9 +259,15 @@
     fi
 
 else
-    GRAPHICS_DRIVER=PNG
-    GRASS_PNGFILE="$output"
-    export GRASS_PNGFILE
+    if [ $GIS_FLAG_C -eq 0 ] ; then
+	GRAPHICS_DRIVER=PNG
+	GRASS_PNGFILE="$output"
+	export GRASS_PNGFILE
+    else
+	GRAPHICS_DRIVER=cairo
+	GRASS_CAIROFILE="$output"
+	export GRASS_CAIROFILE
+    fi
 
     #make sure that output is 24 bit color
     GRASS_TRUECOLOR=TRUE
@@ -310,6 +331,6 @@
 
 \rm "$output"
 
-g.message "Done." 
+g.message "Done."
 
 exit $EXITCODE




More information about the grass-commit mailing list