annotate scripts/plot/util/private/__fltk_print__.m @ 19630:0e1f5a750d00

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:24:46 -0500
parents c3af040956df 446c46af4b42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17572
diff changeset
1 ## Copyright (C) 2010-2013 Shai Ayal
10727
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
2 ##
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
3 ## This file is part of Octave.
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
4 ##
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
8 ## your option) any later version.
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
9 ##
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
13 ## General Public License for more details.
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
14 ##
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
18
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 10727
diff changeset
20 ## @deftypefn {Function File} {} __fltk_print__ (@var{@dots{}})
10727
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
21 ## Undocumented internal function.
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
22 ## @end deftypefn
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
23
10954
ee9d74048827 Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents: 10913
diff changeset
24 function opts = __fltk_print__ (opts)
10834
05ba991794d4 Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
25
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
26 dos_shell = (ispc () && ! isunix ());
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
27
17146
bbda4d952eb5 Fix pop-up of invisible figures during printing.
Rik <rik@octave.org>
parents: 15467
diff changeset
28 set (0, "currentfigure", opts.figure);
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11588
diff changeset
29 drawnow ("expose");
10913
dd6b90f44ae5 Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10864
diff changeset
30
10854
d5a7db05d591 Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10834
diff changeset
31 if (! isempty (opts.fig2dev_binary))
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
32 ## fig2dev is prefered for conversion to emf
10854
d5a7db05d591 Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10834
diff changeset
33 fig2dev_devices = {"pstex", "mf", "emf"};
d5a7db05d591 Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10834
diff changeset
34 else
d5a7db05d591 Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10834
diff changeset
35 fig2dev_devices = {"pstex", "mf"};
10834
05ba991794d4 Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
36 endif
10727
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
37
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
38 gl2ps_device = {};
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
39 pipeline = {};
11120
a44f979a35ce style fixes for some .m files
John W. Eaton <jwe@octave.org>
parents: 11009
diff changeset
40 switch (lower (opts.devopt))
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
41 case {"eps", "eps2", "epsc", "epsc2"}
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
42 ## format GL2PS_EPS
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
43 gl2ps_device = {"eps"};
17176
abf384f5d243 maint: Remove unneeded input validation from internal fcns in private/ directories.
Rik <rik@octave.org>
parents: 17174
diff changeset
44 ## FIXME: use epstool to tighten bbox and provide preview.
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
45 pipeline = {opts.epstool_cmd(opts, "-", opts.name)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
46 case {"epslatex", "pslatex", "pdflatex", "epslatexstandalone", ...
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
47 "pslatexstandalone", "pdflatexstandalone"}
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
48 ## format GL2PS_TEX
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
49 n = find (opts.devopt == "l", 1);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
50 suffix = opts.devopt(1:n-1);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
51 dot = find (opts.name == ".", 1, "last");
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
52 if ((! isempty (dot))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
53 && any (strcmpi (opts.name(dot:end), ...
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
54 {strcat(".", suffix), ".tex", "."})))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
55 name = opts.name(1:dot-1);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
56 if (dot < numel (opts.name)
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
57 && any (strcmpi (opts.name(dot+1:end), {"eps", "ps", "pdf"})))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
58 ## If user provides eps/ps/pdf suffix, use it.
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
59 suffix = opts.name(dot+1:end);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
60 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
61 else
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
62 error ("print:invalid-suffix",
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
63 "invalid suffix '%s' for device '%s'.",
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
64 opts.name(dot:end), lower (opts.devopt));
10861
2f70e7098cbe __print_parse_opts__.m: .
Ben Abbott <bpabbott@mac.com>
parents: 10854
diff changeset
65 endif
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
66 gl2ps_device = {sprintf("%snotxt", lower (suffix))};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
67 gl2ps_device{2} = "tex";
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
68 if (dos_shell)
17176
abf384f5d243 maint: Remove unneeded input validation from internal fcns in private/ directories.
Rik <rik@octave.org>
parents: 17174
diff changeset
69 ## FIXME: this will only work on MinGW with the MSYS shell
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
70 pipeline = {sprintf("cat > %s-inc.%s", name, suffix)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
71 pipeline{2} = sprintf ("cat > %s.tex", name);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
72 else
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
73 pipeline = {sprintf("cat > %s-inc.%s", name, suffix)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
74 pipeline{2} = sprintf ("cat > %s.tex", name);
10913
dd6b90f44ae5 Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents: 10864
diff changeset
75 endif
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
76 case "tikz"
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
77 ## format GL2PS_PGF
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
78 gl2ps_device = {"pgf"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
79 pipeline = {sprintf("cat > %s", opts.name)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
80 case "svg"
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
81 ## format GL2PS_SVG
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
82 gl2ps_device = {"svg"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
83 pipeline = {sprintf("cat > %s", opts.name)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
84 case fig2dev_devices
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
85 cmd_pstoedit = opts.pstoedit_cmd (opts, "fig");
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
86 cmd_fig2dev = opts.fig2dev_cmd (opts, opts.devopt);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
87 if (strcmp (opts.devopt, "pstex"))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
88 [~, ~, ext] = fileparts (opts.name);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
89 if (any (strcmpi (ext, {".ps", ".tex", "."})))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
90 opts.name = opts.name(1:end-numel(ext));
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
91 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
92 opts.name = strcat (opts.name, ".ps");
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
93 cmd = sprintf ("%s | %s > %s", cmd_pstoedit, cmd_fig2dev, opts.name);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
94 gl2ps_device = {"eps"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
95 pipeline = {cmd};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
96 cmd_fig2dev = opts.fig2dev_cmd (opts, "pstex_t");
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
97 gl2ps_device{2} = "eps";
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
98 pipeline{2} = sprintf ("%s | %s > %s", cmd_pstoedit,
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
99 cmd_fig2dev, strrep(opts.name, ".ps", ".tex"));
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
100 else
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
101 cmd = sprintf ("%s | %s > %s", cmd_pstoedit, cmd_fig2dev, opts.name);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
102 gl2ps_device = {"eps"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
103 pipeline = {cmd};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
104 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
105 case "aifm"
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
106 cmd = opts.pstoedit_cmd (opts, "ps2ai");
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
107 gl2ps_device = {"eps"};
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
108 pipeline = {sprintf("%s > %s", cmd, opts.name)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
109 case {"dxf", "emf", "fig", "hpgl"}
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
110 cmd = opts.pstoedit_cmd (opts);
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
111 gl2ps_device = {"eps"};
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
112 pipeline = {sprintf("%s > %s", cmd, opts.name)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
113 case {"corel", "gif"}
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
114 error ("print:unsupporteddevice",
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
115 "print.m: %s output is not available for the FLTK graphics toolkit",
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
116 upper (opts.devopt));
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
117 case opts.ghostscript.device
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
118 opts.ghostscript.source = "-";
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
119 opts.ghostscript.output = opts.name;
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
120 if (opts.send_to_printer)
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
121 opts.unlink(strcmp (opts.unlink, opts.ghostscript.output)) = [];
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
122 opts.ghostscript.output = "-";
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
123 endif
17174
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
124 [cmd_gs, cmd_cleanup] = __ghostscript__ (opts.ghostscript);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
125 if (opts.send_to_printer || isempty (opts.name))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
126 cmd_lpr = opts.lpr_cmd (opts);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
127 cmd = sprintf ("%s | %s", cmd_gs, cmd_lpr);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
128 else
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
129 cmd = sprintf ("%s", cmd_gs);
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
130 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
131 if (! isempty (cmd_cleanup))
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
132 gl2ps_device = {"eps"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
133 if (dos_shell)
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
134 pipeline = {sprintf("%s & %s", cmd, cmd_cleanup)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
135 else
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
136 pipeline = {sprintf("%s ; %s", cmd, cmd_cleanup)};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
137 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
138 else
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
139 gl2ps_device = {"eps"};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
140 pipeline = {cmd};
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
141 endif
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
142 otherwise
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
143 error (sprintf ("print:no%soutput", opts.devopt),
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
144 "print.m: %s output is not available for GL2PS output",
c3c1ebfaa7dc maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents: 17146
diff changeset
145 upper (opts.devopt));
10954
ee9d74048827 Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents: 10913
diff changeset
146 endswitch
10727
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
147
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
148 opts.pipeline = pipeline;
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
149
14389
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
150 ## Tell gl2ps to use different rendering options for 2D plots
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
151 haxes = findall (opts.figure, "type", "axes");
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
152 vw = get (haxes, "view");
14390
1928af0f641b Correct typo from changeset 6b2448555bbd.
Ben Abbott <bpabbott@mac.com>
parents: 14389
diff changeset
153 if (iscell (vw))
14389
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
154 vw = vertcat (vw{:});
14552
86854d032a37 maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents: 14390
diff changeset
155 endif
14389
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
156 is2D = all (abs (vw(:,2)) == 90);
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
157 if (is2D)
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
158 gl2ps_device{end} = [gl2ps_device{end}, "is2D"];
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
159 endif
6b2448555bbd Fix Z-order stacking of axis background for FLTK printing (bug #35559)
Rik <octave@nomad.inbox5.com>
parents: 14174
diff changeset
160
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14552
diff changeset
161 for n = 1:numel (pipeline)
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
162 if (opts.debug)
11589
b0084095098e missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents: 11588
diff changeset
163 fprintf ("fltk-pipeline: '%s'\n", pipeline{n});
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
164 endif
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14552
diff changeset
165 drawnow (gl2ps_device{n}, strcat ('|',pipeline{n}));
11009
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
166 endfor
064aaf82222f Print via a pipeline.
Ben Abbott <bpabbott@mac.com>
parents: 10954
diff changeset
167
12199
3fc07861449b Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents: 11589
diff changeset
168 if (! isempty (strfind (opts.devopt, "standalone")))
3fc07861449b Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents: 11589
diff changeset
169 opts.latex_standalone (opts);
3fc07861449b Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents: 11589
diff changeset
170 endif
3fc07861449b Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents: 11589
diff changeset
171
10727
570f30a48732 split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff changeset
172 endfunction
10834
05ba991794d4 Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
173