[rkward-cvs] SF.net SVN: rkward: [1215] trunk/rkward/rkward/plugins
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Wed Jan 24 21:44:33 UTC 2007
Revision: 1215
http://svn.sourceforge.net/rkward/?rev=1215&view=rev
Author: tfry
Date: 2007-01-24 13:44:33 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
Work on generic x11 export plugin
Modified Paths:
--------------
trunk/rkward/rkward/plugins/under_development.pluginmap
trunk/rkward/rkward/plugins/x11device/export.php
trunk/rkward/rkward/plugins/x11device/export.xml
trunk/rkward/rkward/plugins/x11device.pluginmap
Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap 2007-01-24 19:46:44 UTC (rev 1214)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap 2007-01-24 21:44:33 UTC (rev 1215)
@@ -2,6 +2,7 @@
<document base_prefix="" namespace="rkward">
<components>
+ <component type="standard" id="export_x11_device" file="x11device/export.xml" label="Export..." />
</components>
<hierarchy>
@@ -18,5 +19,11 @@
<menu id="distributions" label="Distributions" index="7">
</menu>
</hierarchy>
+
+ <context id="x11">
+ <menu id="device" label="Device" index="1">
+ <entry component="export_x11_device" />
+ </menu>
+ </context>
</document>
Modified: trunk/rkward/rkward/plugins/x11device/export.php
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export.php 2007-01-24 19:46:44 UTC (rev 1214)
+++ trunk/rkward/rkward/plugins/x11device/export.php 2007-01-24 21:44:33 UTC (rev 1215)
@@ -3,14 +3,23 @@
}
function calculate () {
+ $type = getRK_val ("format");
+ if ($type == "other") {
+ $type = getRK_val ("specifiedformat");
+ }
+
+ $options = "";
+ if (!getRK_val ("autowidth")) $options .= ", width=" . getRK_val ("width");
+ if (!getRK_val ("autoheight")) $options .= ", height=" . getRK_val ("height");
+ $options = ", res=" . getRK_val ("resolution");
+ if (!getRK_val ("autopointsize")) $options = ", pointsize=" . getRK_val ("pointsize");
?>
+dev.set (<? getRK ("devnum"); ?>)
+dev2bitmap ("<? getRK ("file"); ?>", type="<? echo ($type); ?>"<? echo ($options); ?>)
<?
}
-function printout () { ?>
-print ("Device number is <? getRK ("devnum"); ?>")
-print ("In context: <? getRK ("incontext"); ?>")
-<?
+function printout () {
}
function cleanup () {
Modified: trunk/rkward/rkward/plugins/x11device/export.xml
===================================================================
--- trunk/rkward/rkward/plugins/x11device/export.xml 2007-01-24 19:46:44 UTC (rev 1214)
+++ trunk/rkward/rkward/plugins/x11device/export.xml 2007-01-24 21:44:33 UTC (rev 1215)
@@ -2,20 +2,59 @@
<document>
<code file="export.php" />
<logic>
+ <external id="devnum"/>
+
<convert id="formatother" mode="equals" sources="format.string" standard="other" />
<connect client="specifiedformat.enabled" governor="formatother" />
-
- <external id="devnum"/>
- <external id="incontext"/>
+
+ <convert id="userwidth" mode="equals" sources="autowidth.state" standard="0" />
+ <connect client="width.enabled" governor="userwidth"/>
+
+ <convert id="userheight" mode="equals" sources="autoheight.state" standard="0" />
+ <connect client="height.enabled" governor="userheight"/>
+
+ <convert id="userpointsize" mode="equals" sources="autopointsize.state" standard="0" />
+ <connect client="pointsize.enabled" governor="userpointsize"/>
</logic>
<dialog label="Export contents of graphics device">
- <text>This plugin is bogus/unfinished. Do not use!</text>
- <browser size="small" id="file" label="File name" initial="Rplot.pdf" />
- <radio id="format" label="Output format" >
- <option value="pdf" label="PDF" />
- <option value="postscript" label="PostScript" />
- <option value="other" label="Other (specify):" />
- </radio>
- <input label="Ghostscript format id" id="specifiedformat" initial="png16m" size="small"/>
+ <tabbook>
+ <tab id="file_and_type" label="Filename / Type">
+ <text>The export functionality uses ghostscript internally. You need to have ghostscript installed.</text>
+ <browser size="small" id="file" label="File name" initial="Rplot.pdf" />
+ <dropdown id="format" label="Output format" >
+ <option value="pdfwrite" label="PDF" />
+ <option value="postscript" 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 below):" />
+ </dropdown>
+ <input label="Ghostscript format id" id="specifiedformat" initial="png16m" size="medium"/>
+ </tab>
+ <tab id="size_resolution" label="Size / Resolution">
+ <frame id="width_height" label="Size">
+ <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="0"/>
+ </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="0"/>
+ </column>
+ </row>
+ </frame>
+ <frame>
+ <checkbox id="autopointsize" value="1" value_unchecked="0" checked="true" label="Automatic Font size"/>
+ <spinbox id="pointsize" label="Point size" min="0" initial="12" default_precision="0"/>
+ </frame>
+ <frame>
+ <text>Resolution is only meaningful for bitmap formats</text>
+ <spinbox id="resolution" label="Resolution (dpi)" min="0" initial="72" default_precision="0"/>
+ </frame>
+ </tab>
+ </tabbook>
</dialog>
</document>
Modified: trunk/rkward/rkward/plugins/x11device.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/x11device.pluginmap 2007-01-24 19:46:44 UTC (rev 1214)
+++ trunk/rkward/rkward/plugins/x11device.pluginmap 2007-01-24 21:44:33 UTC (rev 1215)
@@ -2,12 +2,10 @@
<document base_prefix="x11device/" namespace="rkward">
<components>
- <component type="standard" id="export_x11_device" file="export.xml" label="Export..." />
</components>
<context id="x11">
<menu id="device" label="Device" index="1">
- <entry component="export_x11_device" />
</menu>
</context>
</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