[rkward-cvs] SF.net SVN: rkward: [1602] trunk/rkward/rkward/plugins/x11device

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Mar 16 13:28:12 UTC 2007


Revision: 1602
          http://svn.sourceforge.net/rkward/?rev=1602&view=rev
Author:   tfry
Date:     2007-03-16 06:28:12 -0700 (Fri, 16 Mar 2007)

Log Message:
-----------
Make the new export plugin the standard one

Added Paths:
-----------
    trunk/rkward/rkward/plugins/x11device/export.php
    trunk/rkward/rkward/plugins/x11device/export.rkh
    trunk/rkward/rkward/plugins/x11device/export.xml

Removed Paths:
-------------
    trunk/rkward/rkward/plugins/x11device/export_new.php
    trunk/rkward/rkward/plugins/x11device/export_new.rkh
    trunk/rkward/rkward/plugins/x11device/export_new.xml

Copied: trunk/rkward/rkward/plugins/x11device/export.php (from rev 1601, trunk/rkward/rkward/plugins/x11device/export_new.php)
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export.php	                        (rev 0)
+++ trunk/rkward/rkward/plugins/x11device/export.php	2007-03-16 13:28:12 UTC (rev 1602)
@@ -0,0 +1,82 @@
+<?php
+function preprocess () {
+}
+
+function calculate () {
+	$type = getRK_val ("format");
+	$file = getRK_val ("file");
+
+	if ($type == "gs" ) {
+		$gstype = getRK_val ("gsformat");
+		if ($gstype == "other") $gstype = getRK_val ("gs_specifiedformat");
+	} else {
+		$jpegpng = (($type == "jpeg") | ($type == "png"));
+
+		// Does the filename end with .ps/.eps or .pdf or .png or .jpeg/.jpg?
+		// If not, add the appropriate extension.
+		if (getRK_val ("autoextension")) {
+			if ($type == "jpeg") {
+				if (!( ereg("\.jpeg$",$file)|ereg("\.jpg$",$file) )) $file .= ".jpg";
+			} elseif ($type == "postscript") {
+				if (!( ereg("\.ps$",$file)|ereg("\.eps$",$file) )) $file .= ".eps";
+			} else {
+				$ext = "." . $type;
+				if (!ereg($ext."$",$file)) $file .= $ext;
+			}
+		}
+	}
+	$options = "";
+
+	// set $resolution appropriately:
+	if ($jpegpng || ($type == "gs")) {
+		$autores = getRK_val ("autores");
+		if ($autores) {
+			if ($jpegpng) $resolution = 96;
+			else $resolution = 72;
+		}	else $resolution = getRK_val ("resolution");
+	}
+
+	$autoW = getRK_val ("autowidth");	$autoH = getRK_val ("autoheight");
+
+	// jpeg()/png() need at least one of width/height. For jpeg()/png() the width/height parameter (in pixels)
+	// is calculated using width/height (in inches) times the resolution. For postscript()/pdf() $resolution is set to 1.
+	if ($jpegpng && $autoW && $autoH) $options .= ", width=par(\"din\")[1]*" . $resolution;
+	elseif ($jpegpng) {
+		if(!$autoW) $options .= ", width=" . round(getRK_val ("width")*$resolution);
+		if(!$autoH) $options .= ", height=" . round(getRK_val ("height")*$resolution);
+	}	else {
+		if(!$autoW) $options .= ", width=" . getRK_val ("width");
+		if(!$autoH) $options .= ", height=" . getRK_val ("height");
+	}
+
+	// pointsize, resolution and quality parameters:
+	if (!getRK_val ("autopointsize")) $options .= ", pointsize=" . getRK_val ("pointsize");
+	if (($jpegpng && !$autores)	|| ($type == "gs"))  $options .= ", res=" . $resolution;
+	if (($type == "jpeg") && (!getRK_val ("autoquality"))) $options .= ", quality=" . getRK_val ("quality");
+
+	// For ps/pdf: page, pagecentre, horizontal, family, encoding and title parameters:
+	if (!$jpegpng) {
+		$paper = getRK_val ("paper");
+		if (!empty ($paper)) $options .= ", paper=" . "\"" . $paper . "\"";
+		$pagecentre = getRK_val ("pagecentre");
+		if (!$pagecentre) $options .= ", pagecentre=FALSE";
+		$pshoriz = getRK_val ("ps_horiz");
+		if (!$pshoriz) $options .= ", horizontal=FALSE";
+		$family = getRK_val ("family");
+		if (!empty($family)) $options .= ", family=" . "\"" . $family . "\"";
+		$enc = getRK_val ("encoding");
+		if (!empty($enc)) $options .= ", encoding=" . "\"" . $enc . "\"";
+		if (!getRK_val("autotitle")) $options .= ", title=" . "\"" . getRK_val("title") . "\"";
+	}
+?>
+dev.set (<? getRK ("devnum"); ?>)
+<? if ($type == "gs") {?>
+dev2bitmap ("<? echo($file); ?>", type="<? echo ($gstype); ?>"<? echo ($options); ?>);
+<? } else {?>
+dev.print (device=<? echo ($type); ?>, file="<? echo ($file); ?>"<? echo ($options); ?>);
+<? }
+}
+
+function printout () {
+}
+?>
\ No newline at end of file

Copied: trunk/rkward/rkward/plugins/x11device/export.rkh (from rev 1601, trunk/rkward/rkward/plugins/x11device/export_new.rkh)
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export.rkh	                        (rev 0)
+++ trunk/rkward/rkward/plugins/x11device/export.rkh	2007-03-16 13:28:12 UTC (rev 1602)
@@ -0,0 +1,54 @@
+<!DOCTYPE rkhelp>
+<document>
+	<summary>
+		Export the current contents of a graphics device to a postscript/pdf/png/jpeg file either using the native functions or using ghostscript.
+	</summary>
+	<usage>
+		Chose an exporting function and a filename to save to. Additional options for size and resolution etc. are also available (see below). Exporting is done using <b>dev.print</b>. For exporting using ghostscript, <b>dev2bitmap</b> is used, which needs Ghostscript. Most of the exporting parameters are directly sent to the exporting function (<b>postscript</b> or <b>pdf</b> or <b>png</b> or <b>jpeg</b>) by dev.print. Note that there are no 'color' options (like background or foreground color) in this plugin. This is because dev.print simply prints the current graphics (mostly on X11) to the spedified file in the chosen format. To set background (or foreground) colors, these will need to be provided when calling the plotting function, mostly using <b>par</b>(). Note that all the parameters to postscript are also valid parameters to dev2bitmap.
+
+		This plugin is only available in the context of a graphics device.
+	</usage>
+	<settings>
+		<caption id="tab_file_and_type"/>
+
+		<caption id="frame_dimensions"/>
+		<setting id="file">The filename to save to. By default the file will be saved in the directory from where RkWard was started, which is the user's home directory when started from K-menu. After checking for a proper file extension, this is the <i>file</i> parameter to dev.print. For exporting via ghostscript provide a suitable extension.</setting>
+    <setting id="autoextension">Check this box to let RKWard detect the file extension automatically. If the filename specified in the 'File name' box already has a relevant extension, then nothing is done, that is, the specified filename is used. Otherwise a relevant extension is appended to the filename above to construct the full filename. This option is disabled for export via ghostscript.</setting>
+		<setting id="format">Choose whether to use postscript or pdf or png or jpeg for exporting the file. This is the <i>device</i> parameter to dev.print. If 'via Ghostscript' is chosen then the output format of the ghostscript device will need to be provided (see below under 'Ghostscript specific options').</setting>
+		<setting id="autowidth">Check this box to let the export function determine the width automatically.</setting>
+		<setting id="autoheight">This is similar to 'Automatic Width', but for height.</setting>
+		<setting id="width">This is the <i>width</i> parameter to the exporting function. This is specified in inches. For JPEG/PNG exports (which require width in pixels), the actual width is evaluated by multiplying the width value provided in inches with the resolution (in dpi, 'dots per inch'). So, width_pixels = width_inches * resolution_dpi. If resolution is set to 'Default Resolution', then a value of 96 is used as the default resolution for exporting to jpeg or png and a value of 72 is used for exporting via ghostscript. Otherwise the provided resolution value is used. None of these matter for exporting to Postscript/PDF where the width parameter is provided in inches.
+
+		<b>jpeg</b> or <b>png</b> functions need at least one of width/height to be provided. We override this restriction by reading in the width (in inches) from <b>par("din")[1]</b> and then setting 'par("din")[1] * resolution' as the width (in pixels) parameter value. Again, none of these are required for exporting to Postscript/PDF.</setting>
+		<setting id="height">This is the <i>height</i> parameter to the exporting function. Similar to 'Width'.</setting>
+
+		<caption id="frame_generic_options"/>
+		<setting id="pointsize">This is the <i>pointsize</i> parameter to dev.print.</setting>
+		<setting id="resolution">Available only for PNG/JPEG, this is the <i>res</i> parameter to dev.print. This value is used in converting from width/height in pixels to inches as described above (under 'Width'). The default resolution (when 'Default Resolution' is checked) is 96.</setting>
+		<setting id="quality">Available only for JPEG, this is the <i>quality</i> parameter to <b>jpeg</b>. Sets the quality for JPEG exporting. The default quality is 75.</setting>
+
+		<caption id="tab_more_options"/>
+		<setting id="paper">Use this to set the papersize for export. Choose 'Default' to not specify any paper option. Other options are explained in R reference for <b>postscript</b>. This is available only for Postscript/PDF exports. This is the <i>paper</i> option to the exporting function.</setting>
+		<setting id="pagecentre">Uncheck this for NOT centering the image on the page. This is the <i>pagecentre</i> parameter.</setting>
+		<setting id="ps_horiz">Available only for Postscript/Ghostscript exporting, this is the <i>horizontal</i> parameter.</setting>
+		<setting id="family">This is the <i>family</i> parameter to <b>postscript</b>. Be sure to chooe a family that is available on the machine. The 'URW' class of font families require ghostscript. When in doubt leave this as 'Default', the default family (Helvectica) will be used. See the R reference on postscript for more details.</setting>
+		<setting id="encoding">This is the <i>encoding</i> parameter to <b>postscript</b>. Be sure to chooe an encoding compatible with the chosen font family. When in doubt leave this as 'Default', the default encoding (ISOLatin1) will be used. See the R reference on postscript for more details.</setting>
+		<setting id="autotitle">Uncheck this box, to specify a custom title to the graphics file. Note that this is not displayed on the plot, but rather it is embeded inside the grpahics file. This is the <i>title</i> parameter to <b>postscript</b>.</setting>
+
+		<caption id="frame_gsoptions"/>
+		<setting id="gsformat">File format to use. Only the most common ones are listed, but many more are supported by ghostscript. Select "Other" and see the option below to use these formats.</setting>
+		<setting id="gs_specifiedformat">Select "Other" in the option above to use this setting. Specify the device identifier as used by ghostscript. Running "ghostscript --help" (or "gs --help") in a terminal should give a list of available devices.</setting>
+	</settings>
+	<related>
+		<ul>
+			<li><link href="rkward://rhelp/dev.print"/></li>
+			<li><link href="rkward://rhelp/postscript"/></li>
+			<li><link href="rkward://rhelp/pdf"/></li>
+			<li><link href="rkward://rhelp/png"/></li>
+			<li><link href="rkward://rhelp/jpeg"/></li>
+			<li><link href="rkward://rhelp/par"/></li>
+			<li><link href="rkward://rhelp/dev2bitmap"/></li>
+		</ul>
+	</related>
+</document>
+

Copied: trunk/rkward/rkward/plugins/x11device/export.xml (from rev 1601, trunk/rkward/rkward/plugins/x11device/export_new.xml)
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/x11device/export.xml	2007-03-16 13:28:12 UTC (rev 1602)
@@ -0,0 +1,186 @@
+<!DOCTYPE rkplugin>
+<document>
+	<code file="export.php" />
+	<help file="export.rkh" />
+	<logic>
+		<external id="devnum"/>
+
+		<convert id="isPS" mode="equals" sources="format.string" standard="postscript" />
+		<convert id="isPDF" mode="equals" sources="format.string" standard="pdf" />
+		<convert id="isJPEG" mode="equals" sources="format.string" standard="jpeg" />
+		<convert id="isPNG" mode="equals" sources="format.string" standard="png" />
+		<convert id="isGS" mode="equals" sources="format.string" standard="gs" />
+		<convert id="isPSPDF" mode="or" sources="isPS;isPDF" />
+		<convert id="isJPEGPNG" mode="or" sources="isPNG;isJPEG" />
+		<convert id="isPSPDFGS" mode="or" sources="isPSPDF;isGS" />
+		<convert id="isJPEGPNGGS" mode="or" sources="isJPEGPNG;isGS" />
+		<convert id="isPSGS" mode="or" sources="isPS;isGS" />
+		<convert id="isnotGS" mode="or" sources="isPSPDF;isJPEGPNG" />
+
+		<connect client="autoextension.state" governor="isnotGS"/>
+		<connect client="autoextension.enabled" governor="isnotGS"/>
+
+		<connect client="tab_more_options.enabled" governor="isPSPDFGS" />
+
+		<connect client="autoquality.enabled" governor="isJPEG" />
+		<connect client="ps_horiz.enabled" governor="isPSGS"/>
+
+		<convert id="userwidth0" mode="equals" sources="autowidth.state" standard="0" />
+		<connect client="width.enabled" governor="userwidth0"/>
+
+		<convert id="userheight0" mode="equals" sources="autoheight.state" standard="0" />
+		<connect client="height.enabled" governor="userheight0"/>
+
+		<convert id="userpointsize0" mode="equals" sources="autopointsize.state" standard="0" />
+		<connect client="pointsize.enabled" governor="userpointsize0"/>
+
+		<convert id="userres0" mode="equals" sources="autores.state" standard="0" />
+		<connect client="autores.enabled" governor="isJPEGPNGGS"/>
+		<convert id="userres" mode="and" sources="userres0;autores.enabled" />
+		<connect client="resolution.enabled" governor="userres"/>
+
+		<convert id="userquality0" mode="equals" sources="autoquality.state" standard="0" />
+		<convert id="userquality" mode="and" sources="userquality0;autoquality.enabled" />
+		<connect client="quality.enabled" governor="userquality"/>
+
+		<convert id="usertitle0" mode="equals" sources="autotitle.state" standard="0" />
+		<connect client="title.enabled" governor="usertitle0"/>
+
+		<convert id="formatother" mode="equals" sources="gsformat.string" standard="other" />
+		<connect client="gs_specifiedformat.enabled" governor="formatother" />
+		<connect client="frame_gsoptions.enabled" governor="isGS" />
+	</logic>
+
+	<dialog label="Export contents of graphics device to png/jpeg format">
+		<tabbook>
+			<tab id="tab_file_and_type" label="Filename and Generic options">
+				<row>
+					<column>
+						<browser type="savefile" id="file" label="File name" initial="Rplot" filter="*.ps *.eps *.pdf *.png *.jpg *.jpeg *.bmp" />
+						<checkbox id="autoextension" value="1" value_unchecked="0" checked="true" label="Automatic File extension"/>
+						<frame id="frame_dimensions" label="Dimensions">
+							<row>
+								<column>
+									<checkbox id="autowidth" value="1" value_unchecked="0" checked="true" label="Automatic Width"/>
+									<spinbox id="width" label="Width in inches" min="0" initial="6" default_precision="1"/>
+								</column>
+								<column>
+									<checkbox id="autoheight" value="1" value_unchecked="0" checked="true" label="Automatic Height"/>
+									<spinbox id="height" label="Height in inches" min="0" initial="6" default_precision="1" />
+								</column>
+							</row>
+						</frame>
+					</column>
+					<column>
+						<radio id="format" label="Output format" >
+							<option value="postscript" label="Postscript" checked="true"/>
+							<option value="pdf" label="PDF" />
+							<option value="png" label="PNG" />
+							<option value="jpeg" label="JPEG" />
+							<option value="gs" label="via Ghostscript" />
+						</radio>
+					</column>
+				</row>
+				<row>
+					<frame id="frame_generic_options" label="Generic Export Options">
+						<row>
+							<column>
+								<checkbox id="autopointsize" value="1" value_unchecked="0" checked="true" label="Default pointsize"/>
+								<spinbox id="pointsize" label="Point size" min="0" initial="12"  default_precision="1" />
+							</column>
+							<column>
+								<checkbox id="autores" value="1" value_unchecked="0" checked="true" label="Default Resolution"/>
+								<spinbox id="resolution" label="Resolution (dpi)" type="integer" min="0" initial="96" default_precision="1"/>
+							</column>
+							<column>
+								<checkbox id="autoquality" value="1" value_unchecked="0" checked="true" label="Default Quality"/>
+								<spinbox label="JPEG Quality" id="quality" min="0" max="100" initial="75" default_precision="1"/>
+							</column>
+						</row>
+					</frame>
+				</row>
+			</tab>
+
+			<tab id="tab_more_options" label="Postscript/PDF/Ghostscript Options">
+				<frame id="frame_paperprop" label="Paper properties">
+					<row>
+						<dropdown id="paper" label="Paper Size">
+							<option value="" label="Default" checked="true"/>
+							<option value="a4" label="A4"/>
+							<option value="letter" label="Letter"/>
+							<option value="legal" label="Legal"/>
+							<option value="executive" label="Executive"/>
+							<option value="special" label="Special"/>
+						</dropdown>
+						<column>
+							<checkbox id="pagecentre" value="1" value_unchecked="0" checked="true" label="Pagecentre"/>
+							<checkbox id="ps_horiz" value="1" value_unchecked="0" checked="true" label="Horizontal (ps/gs)"/>
+						</column>
+					</row>
+				</frame>
+				<frame id="font_properties" label="Font properties">
+					<row>
+						<dropdown id="family" label="Font family">
+							<option value="" label="Default" checked="true"/>
+							<option value="AvantGarde" label="AvantGarde"/>
+							<option value="Bookman" label="Bookman"/>
+							<option value="Courier" label="Courier"/>
+							<option value="Helvectica" label="Helvectica"/>
+							<option value="Helvectica-Narrow" label="Helvectica Narrow"/>
+							<option value="mono" label="Mono"/>
+							<option value="NewCenturySchoolbook" label="New Century Schoolbook"/>
+							<option value="Palatino" label="Palatino"/>
+							<option value="sans" label="Sans"/>
+							<option value="serif" label="Serif"/>
+							<option value="symbol" label="Symbol"/>
+							<option value="Times" label="Times"/>
+							<option value="CenturySch" label="CenturySch (URW)"/>
+							<option value="NimbusMon" label="NimbusMon (URW)"/>
+							<option value="NimbusSanCond" label="NimbusSanCond (URW)"/>
+							<option value="URWBookman" label="URWBookman"/>
+							<option value="URWHelvectica" label="URWHelvectica"/>
+							<option value="URWGothic" label="URWGothic"/>
+							<option value="URWPalladio" label="URWPalladio"/>
+							<option value="URWTimes" label="URWTimes"/>
+						</dropdown>
+						<dropdown id="encoding" label="Font Encoding">
+							<option value="" label="Default" checked="true"/>
+							<option value="ISOLatin1.enc" label="ISOLatin1"/>
+							<option value="ISOLatin2.enc" label="ISOLatin2"/>
+							<option value="CP1250.enc" label="CP1250"/>
+							<option value="ISOLatin7.enc" label="ISOLatin7"/>
+							<option value="CP1257.enc" label="CP1257"/>
+							<option value="ISOLatin9.enc" label="ISOLatin9"/>
+							<option value="PDFDoc.enc" label="PDFDoc"/>
+						</dropdown>
+					</row>
+				</frame>
+				<frame id="title_properties" label="Title embeded in file">
+					<row>
+						<column>
+							<checkbox id="autotitle" value="1" value_unchecked="0" checked="true" label="Default Title"/>
+						</column>
+						<column>
+							<input id="title" size="small" initial="R Graphics Output"/>
+						</column>
+					</row>
+				</frame>
+				<frame id="frame_gsoptions" label="Ghostscript  specific options">
+					<row>
+						<dropdown id="gsformat" label="GS Output device" >
+							<option value="pdfwrite" label="PDF" />
+							<option value="pswrite" label="PostScript" />
+							<option value="pngmono" label="PNG (b/w)" />
+							<option value="pnggray" label="PNG (grayscale)" />
+							<option value="png256" label="PNG (256 colors)" />
+							<option value="png16m" label="PNG (16M colors)" />
+							<option value="jpeg" label="JPEG" />
+							<option value="other" label="Other (specify here):" />
+						</dropdown>
+						<input label="Ghostscript device" id="gs_specifiedformat" initial="png16m" size="medium"/>
+					</row>
+				</frame>
+			</tab>
+		</tabbook>
+	</dialog>
+</document>

Deleted: trunk/rkward/rkward/plugins/x11device/export_new.php
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export_new.php	2007-03-16 13:25:22 UTC (rev 1601)
+++ trunk/rkward/rkward/plugins/x11device/export_new.php	2007-03-16 13:28:12 UTC (rev 1602)
@@ -1,82 +0,0 @@
-<?php
-function preprocess () {
-}
-
-function calculate () {
-	$type = getRK_val ("format");
-	$file = getRK_val ("file");
-
-	if ($type == "gs" ) {
-		$gstype = getRK_val ("gsformat");
-		if ($gstype == "other") $gstype = getRK_val ("gs_specifiedformat");
-	} else {
-		$jpegpng = (($type == "jpeg") | ($type == "png"));
-
-		// Does the filename end with .ps/.eps or .pdf or .png or .jpeg/.jpg?
-		// If not, add the appropriate extension.
-		if (getRK_val ("autoextension")) {
-			if ($type == "jpeg") {
-				if (!( ereg("\.jpeg$",$file)|ereg("\.jpg$",$file) )) $file .= ".jpg";
-			} elseif ($type == "postscript") {
-				if (!( ereg("\.ps$",$file)|ereg("\.eps$",$file) )) $file .= ".eps";
-			} else {
-				$ext = "." . $type;
-				if (!ereg($ext."$",$file)) $file .= $ext;
-			}
-		}
-	}
-	$options = "";
-
-	// set $resolution appropriately:
-	if ($jpegpng || ($type == "gs")) {
-		$autores = getRK_val ("autores");
-		if ($autores) {
-			if ($jpegpng) $resolution = 96;
-			else $resolution = 72;
-		}	else $resolution = getRK_val ("resolution");
-	}
-
-	$autoW = getRK_val ("autowidth");	$autoH = getRK_val ("autoheight");
-
-	// jpeg()/png() need at least one of width/height. For jpeg()/png() the width/height parameter (in pixels)
-	// is calculated using width/height (in inches) times the resolution. For postscript()/pdf() $resolution is set to 1.
-	if ($jpegpng && $autoW && $autoH) $options .= ", width=par(\"din\")[1]*" . $resolution;
-	elseif ($jpegpng) {
-		if(!$autoW) $options .= ", width=" . round(getRK_val ("width")*$resolution);
-		if(!$autoH) $options .= ", height=" . round(getRK_val ("height")*$resolution);
-	}	else {
-		if(!$autoW) $options .= ", width=" . getRK_val ("width");
-		if(!$autoH) $options .= ", height=" . getRK_val ("height");
-	}
-
-	// pointsize, resolution and quality parameters:
-	if (!getRK_val ("autopointsize")) $options .= ", pointsize=" . getRK_val ("pointsize");
-	if (($jpegpng && !$autores)	|| ($type == "gs"))  $options .= ", res=" . $resolution;
-	if (($type == "jpeg") && (!getRK_val ("autoquality"))) $options .= ", quality=" . getRK_val ("quality");
-
-	// For ps/pdf: page, pagecentre, horizontal, family, encoding and title parameters:
-	if (!$jpegpng) {
-		$paper = getRK_val ("paper");
-		if (!empty ($paper)) $options .= ", paper=" . "\"" . $paper . "\"";
-		$pagecentre = getRK_val ("pagecentre");
-		if (!$pagecentre) $options .= ", pagecentre=FALSE";
-		$pshoriz = getRK_val ("ps_horiz");
-		if (!$pshoriz) $options .= ", horizontal=FALSE";
-		$family = getRK_val ("family");
-		if (!empty($family)) $options .= ", family=" . "\"" . $family . "\"";
-		$enc = getRK_val ("encoding");
-		if (!empty($enc)) $options .= ", encoding=" . "\"" . $enc . "\"";
-		if (!getRK_val("autotitle")) $options .= ", title=" . "\"" . getRK_val("title") . "\"";
-	}
-?>
-dev.set (<? getRK ("devnum"); ?>)
-<? if ($type == "gs") {?>
-dev2bitmap ("<? echo($file); ?>", type="<? echo ($gstype); ?>"<? echo ($options); ?>);
-<? } else {?>
-dev.print (device=<? echo ($type); ?>, file="<? echo ($file); ?>"<? echo ($options); ?>);
-<? }
-}
-
-function printout () {
-}
-?>
\ No newline at end of file

Deleted: trunk/rkward/rkward/plugins/x11device/export_new.rkh
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export_new.rkh	2007-03-16 13:25:22 UTC (rev 1601)
+++ trunk/rkward/rkward/plugins/x11device/export_new.rkh	2007-03-16 13:28:12 UTC (rev 1602)
@@ -1,54 +0,0 @@
-<!DOCTYPE rkhelp>
-<document>
-	<summary>
-		Export the current contents of a graphics device to a postscript/pdf/png/jpeg file either using the native functions or using ghostscript.
-	</summary>
-	<usage>
-		Chose an exporting function and a filename to save to. Additional options for size and resolution etc. are also available (see below). Exporting is done using <b>dev.print</b>. For exporting using ghostscript, <b>dev2bitmap</b> is used, which needs Ghostscript. Most of the exporting parameters are directly sent to the exporting function (<b>postscript</b> or <b>pdf</b> or <b>png</b> or <b>jpeg</b>) by dev.print. Note that there are no 'color' options (like background or foreground color) in this plugin. This is because dev.print simply prints the current graphics (mostly on X11) to the spedified file in the chosen format. To set background (or foreground) colors, these will need to be provided when calling the plotting function, mostly using <b>par</b>(). Note that all the parameters to postscript are also valid parameters to dev2bitmap.
-
-		This plugin is only available in the context of a graphics device.
-	</usage>
-	<settings>
-		<caption id="tab_file_and_type"/>
-
-		<caption id="frame_dimensions"/>
-		<setting id="file">The filename to save to. By default the file will be saved in the directory from where RkWard was started, which is the user's home directory when started from K-menu. After checking for a proper file extension, this is the <i>file</i> parameter to dev.print. For exporting via ghostscript provide a suitable extension.</setting>
-    <setting id="autoextension">Check this box to let RKWard detect the file extension automatically. If the filename specified in the 'File name' box already has a relevant extension, then nothing is done, that is, the specified filename is used. Otherwise a relevant extension is appended to the filename above to construct the full filename. This option is disabled for export via ghostscript.</setting>
-		<setting id="format">Choose whether to use postscript or pdf or png or jpeg for exporting the file. This is the <i>device</i> parameter to dev.print. If 'via Ghostscript' is chosen then the output format of the ghostscript device will need to be provided (see below under 'Ghostscript specific options').</setting>
-		<setting id="autowidth">Check this box to let the export function determine the width automatically.</setting>
-		<setting id="autoheight">This is similar to 'Automatic Width', but for height.</setting>
-		<setting id="width">This is the <i>width</i> parameter to the exporting function. This is specified in inches. For JPEG/PNG exports (which require width in pixels), the actual width is evaluated by multiplying the width value provided in inches with the resolution (in dpi, 'dots per inch'). So, width_pixels = width_inches * resolution_dpi. If resolution is set to 'Default Resolution', then a value of 96 is used as the default resolution for exporting to jpeg or png and a value of 72 is used for exporting via ghostscript. Otherwise the provided resolution value is used. None of these matter for exporting to Postscript/PDF where the width parameter is provided in inches.
-
-		<b>jpeg</b> or <b>png</b> functions need at least one of width/height to be provided. We override this restriction by reading in the width (in inches) from <b>par("din")[1]</b> and then setting 'par("din")[1] * resolution' as the width (in pixels) parameter value. Again, none of these are required for exporting to Postscript/PDF.</setting>
-		<setting id="height">This is the <i>height</i> parameter to the exporting function. Similar to 'Width'.</setting>
-
-		<caption id="frame_generic_options"/>
-		<setting id="pointsize">This is the <i>pointsize</i> parameter to dev.print.</setting>
-		<setting id="resolution">Available only for PNG/JPEG, this is the <i>res</i> parameter to dev.print. This value is used in converting from width/height in pixels to inches as described above (under 'Width'). The default resolution (when 'Default Resolution' is checked) is 96.</setting>
-		<setting id="quality">Available only for JPEG, this is the <i>quality</i> parameter to <b>jpeg</b>. Sets the quality for JPEG exporting. The default quality is 75.</setting>
-
-		<caption id="tab_more_options"/>
-		<setting id="paper">Use this to set the papersize for export. Choose 'Default' to not specify any paper option. Other options are explained in R reference for <b>postscript</b>. This is available only for Postscript/PDF exports. This is the <i>paper</i> option to the exporting function.</setting>
-		<setting id="pagecentre">Uncheck this for NOT centering the image on the page. This is the <i>pagecentre</i> parameter.</setting>
-		<setting id="ps_horiz">Available only for Postscript/Ghostscript exporting, this is the <i>horizontal</i> parameter.</setting>
-		<setting id="family">This is the <i>family</i> parameter to <b>postscript</b>. Be sure to chooe a family that is available on the machine. The 'URW' class of font families require ghostscript. When in doubt leave this as 'Default', the default family (Helvectica) will be used. See the R reference on postscript for more details.</setting>
-		<setting id="encoding">This is the <i>encoding</i> parameter to <b>postscript</b>. Be sure to chooe an encoding compatible with the chosen font family. When in doubt leave this as 'Default', the default encoding (ISOLatin1) will be used. See the R reference on postscript for more details.</setting>
-		<setting id="autotitle">Uncheck this box, to specify a custom title to the graphics file. Note that this is not displayed on the plot, but rather it is embeded inside the grpahics file. This is the <i>title</i> parameter to <b>postscript</b>.</setting>
-
-		<caption id="frame_gsoptions"/>
-		<setting id="gsformat">File format to use. Only the most common ones are listed, but many more are supported by ghostscript. Select "Other" and see the option below to use these formats.</setting>
-		<setting id="gs_specifiedformat">Select "Other" in the option above to use this setting. Specify the device identifier as used by ghostscript. Running "ghostscript --help" (or "gs --help") in a terminal should give a list of available devices.</setting>
-	</settings>
-	<related>
-		<ul>
-			<li><link href="rkward://rhelp/dev.print"/></li>
-			<li><link href="rkward://rhelp/postscript"/></li>
-			<li><link href="rkward://rhelp/pdf"/></li>
-			<li><link href="rkward://rhelp/png"/></li>
-			<li><link href="rkward://rhelp/jpeg"/></li>
-			<li><link href="rkward://rhelp/par"/></li>
-			<li><link href="rkward://rhelp/dev2bitmap"/></li>
-		</ul>
-	</related>
-</document>
-

Deleted: trunk/rkward/rkward/plugins/x11device/export_new.xml
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export_new.xml	2007-03-16 13:25:22 UTC (rev 1601)
+++ trunk/rkward/rkward/plugins/x11device/export_new.xml	2007-03-16 13:28:12 UTC (rev 1602)
@@ -1,186 +0,0 @@
-<!DOCTYPE rkplugin>
-<document>
-	<code file="export.php" />
-	<help file="export.rkh" />
-	<logic>
-		<external id="devnum"/>
-
-		<convert id="isPS" mode="equals" sources="format.string" standard="postscript" />
-		<convert id="isPDF" mode="equals" sources="format.string" standard="pdf" />
-		<convert id="isJPEG" mode="equals" sources="format.string" standard="jpeg" />
-		<convert id="isPNG" mode="equals" sources="format.string" standard="png" />
-		<convert id="isGS" mode="equals" sources="format.string" standard="gs" />
-		<convert id="isPSPDF" mode="or" sources="isPS;isPDF" />
-		<convert id="isJPEGPNG" mode="or" sources="isPNG;isJPEG" />
-		<convert id="isPSPDFGS" mode="or" sources="isPSPDF;isGS" />
-		<convert id="isJPEGPNGGS" mode="or" sources="isJPEGPNG;isGS" />
-		<convert id="isPSGS" mode="or" sources="isPS;isGS" />
-		<convert id="isnotGS" mode="or" sources="isPSPDF;isJPEGPNG" />
-
-		<connect client="autoextension.state" governor="isnotGS"/>
-		<connect client="autoextension.enabled" governor="isnotGS"/>
-
-		<connect client="tab_more_options.enabled" governor="isPSPDFGS" />
-
-		<connect client="autoquality.enabled" governor="isJPEG" />
-		<connect client="ps_horiz.enabled" governor="isPSGS"/>
-
-		<convert id="userwidth0" mode="equals" sources="autowidth.state" standard="0" />
-		<connect client="width.enabled" governor="userwidth0"/>
-
-		<convert id="userheight0" mode="equals" sources="autoheight.state" standard="0" />
-		<connect client="height.enabled" governor="userheight0"/>
-
-		<convert id="userpointsize0" mode="equals" sources="autopointsize.state" standard="0" />
-		<connect client="pointsize.enabled" governor="userpointsize0"/>
-
-		<convert id="userres0" mode="equals" sources="autores.state" standard="0" />
-		<connect client="autores.enabled" governor="isJPEGPNGGS"/>
-		<convert id="userres" mode="and" sources="userres0;autores.enabled" />
-		<connect client="resolution.enabled" governor="userres"/>
-
-		<convert id="userquality0" mode="equals" sources="autoquality.state" standard="0" />
-		<convert id="userquality" mode="and" sources="userquality0;autoquality.enabled" />
-		<connect client="quality.enabled" governor="userquality"/>
-
-		<convert id="usertitle0" mode="equals" sources="autotitle.state" standard="0" />
-		<connect client="title.enabled" governor="usertitle0"/>
-
-		<convert id="formatother" mode="equals" sources="gsformat.string" standard="other" />
-		<connect client="gs_specifiedformat.enabled" governor="formatother" />
-		<connect client="frame_gsoptions.enabled" governor="isGS" />
-	</logic>
-
-	<dialog label="Export contents of graphics device to png/jpeg format">
-		<tabbook>
-			<tab id="tab_file_and_type" label="Filename and Generic options">
-				<row>
-					<column>
-						<browser type="savefile" id="file" label="File name" initial="Rplot" filter="*.ps *.eps *.pdf *.png *.jpg *.jpeg *.bmp" />
-						<checkbox id="autoextension" value="1" value_unchecked="0" checked="true" label="Automatic File extension"/>
-						<frame id="frame_dimensions" label="Dimensions">
-							<row>
-								<column>
-									<checkbox id="autowidth" value="1" value_unchecked="0" checked="true" label="Automatic Width"/>
-									<spinbox id="width" label="Width in inches" min="0" initial="6" default_precision="1"/>
-								</column>
-								<column>
-									<checkbox id="autoheight" value="1" value_unchecked="0" checked="true" label="Automatic Height"/>
-									<spinbox id="height" label="Height in inches" min="0" initial="6" default_precision="1" />
-								</column>
-							</row>
-						</frame>
-					</column>
-					<column>
-						<radio id="format" label="Output format" >
-							<option value="postscript" label="Postscript" checked="true"/>
-							<option value="pdf" label="PDF" />
-							<option value="png" label="PNG" />
-							<option value="jpeg" label="JPEG" />
-							<option value="gs" label="via Ghostscript" />
-						</radio>
-					</column>
-				</row>
-				<row>
-					<frame id="frame_generic_options" label="Generic Export Options">
-						<row>
-							<column>
-								<checkbox id="autopointsize" value="1" value_unchecked="0" checked="true" label="Default pointsize"/>
-								<spinbox id="pointsize" label="Point size" min="0" initial="12"  default_precision="1" />
-							</column>
-							<column>
-								<checkbox id="autores" value="1" value_unchecked="0" checked="true" label="Default Resolution"/>
-								<spinbox id="resolution" label="Resolution (dpi)" type="integer" min="0" initial="96" default_precision="1"/>
-							</column>
-							<column>
-								<checkbox id="autoquality" value="1" value_unchecked="0" checked="true" label="Default Quality"/>
-								<spinbox label="JPEG Quality" id="quality" min="0" max="100" initial="75" default_precision="1"/>
-							</column>
-						</row>
-					</frame>
-				</row>
-			</tab>
-
-			<tab id="tab_more_options" label="Postscript/PDF/Ghostscript Options">
-				<frame id="frame_paperprop" label="Paper properties">
-					<row>
-						<dropdown id="paper" label="Paper Size">
-							<option value="" label="Default" checked="true"/>
-							<option value="a4" label="A4"/>
-							<option value="letter" label="Letter"/>
-							<option value="legal" label="Legal"/>
-							<option value="executive" label="Executive"/>
-							<option value="special" label="Special"/>
-						</dropdown>
-						<column>
-							<checkbox id="pagecentre" value="1" value_unchecked="0" checked="true" label="Pagecentre"/>
-							<checkbox id="ps_horiz" value="1" value_unchecked="0" checked="true" label="Horizontal (ps/gs)"/>
-						</column>
-					</row>
-				</frame>
-				<frame id="font_properties" label="Font properties">
-					<row>
-						<dropdown id="family" label="Font family">
-							<option value="" label="Default" checked="true"/>
-							<option value="AvantGarde" label="AvantGarde"/>
-							<option value="Bookman" label="Bookman"/>
-							<option value="Courier" label="Courier"/>
-							<option value="Helvectica" label="Helvectica"/>
-							<option value="Helvectica-Narrow" label="Helvectica Narrow"/>
-							<option value="mono" label="Mono"/>
-							<option value="NewCenturySchoolbook" label="New Century Schoolbook"/>
-							<option value="Palatino" label="Palatino"/>
-							<option value="sans" label="Sans"/>
-							<option value="serif" label="Serif"/>
-							<option value="symbol" label="Symbol"/>
-							<option value="Times" label="Times"/>
-							<option value="CenturySch" label="CenturySch (URW)"/>
-							<option value="NimbusMon" label="NimbusMon (URW)"/>
-							<option value="NimbusSanCond" label="NimbusSanCond (URW)"/>
-							<option value="URWBookman" label="URWBookman"/>
-							<option value="URWHelvectica" label="URWHelvectica"/>
-							<option value="URWGothic" label="URWGothic"/>
-							<option value="URWPalladio" label="URWPalladio"/>
-							<option value="URWTimes" label="URWTimes"/>
-						</dropdown>
-						<dropdown id="encoding" label="Font Encoding">
-							<option value="" label="Default" checked="true"/>
-							<option value="ISOLatin1.enc" label="ISOLatin1"/>
-							<option value="ISOLatin2.enc" label="ISOLatin2"/>
-							<option value="CP1250.enc" label="CP1250"/>
-							<option value="ISOLatin7.enc" label="ISOLatin7"/>
-							<option value="CP1257.enc" label="CP1257"/>
-							<option value="ISOLatin9.enc" label="ISOLatin9"/>
-							<option value="PDFDoc.enc" label="PDFDoc"/>
-						</dropdown>
-					</row>
-				</frame>
-				<frame id="title_properties" label="Title embeded in file">
-					<row>
-						<column>
-							<checkbox id="autotitle" value="1" value_unchecked="0" checked="true" label="Default Title"/>
-						</column>
-						<column>
-							<input id="title" size="small" initial="R Graphics Output"/>
-						</column>
-					</row>
-				</frame>
-				<frame id="frame_gsoptions" label="Ghostscript  specific options">
-					<row>
-						<dropdown id="gsformat" label="GS Output device" >
-							<option value="pdfwrite" label="PDF" />
-							<option value="pswrite" label="PostScript" />
-							<option value="pngmono" label="PNG (b/w)" />
-							<option value="pnggray" label="PNG (grayscale)" />
-							<option value="png256" label="PNG (256 colors)" />
-							<option value="png16m" label="PNG (16M colors)" />
-							<option value="jpeg" label="JPEG" />
-							<option value="other" label="Other (specify here):" />
-						</dropdown>
-						<input label="Ghostscript device" id="gs_specifiedformat" initial="png16m" size="medium"/>
-					</row>
-				</frame>
-			</tab>
-		</tabbook>
-	</dialog>
-</document>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list