Mercurial > octave
annotate scripts/plot/util/private/__opengl_print__.m @ 24221:ac080874d3b9
Fix unintended addition in previous "fix"
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Thu, 09 Nov 2017 10:05:25 +0100 |
parents | 2b7532f237d7 |
children | 194eb4bd202b |
rev | line source |
---|---|
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
1 ## Copyright (C) 2010-2017 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 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
8 ## (at your option) any later version. |
10727
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 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## GNU General Public License for more details. |
10727
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 -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
20 ## @deftypefn {} {} __opengl_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 |
19640
3b0b4d55002d
rename __fltk_print__.m to __opengl_print__.m
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
24 function opts = __opengl_print__ (opts) |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10793
diff
changeset
|
25 |
11009 | 26 dos_shell = (ispc () && ! isunix ()); |
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 | 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 | 38 gl2ps_device = {}; |
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); |
20444
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
51 [ndir, name, ext] = fileparts (opts.name); |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
52 if (isempty (ext)) |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
53 ext = "tex"; |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
54 else |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
55 ext = ext(2:end); # remove leading '.' |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
56 endif |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
57 if (any (strcmpi (ext, {suffix, "tex"}))) |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
58 name = fullfile (ndir, name); |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
59 if (any (strcmpi (ext, {"eps", "ps", "pdf"}))) |
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
60 suffix = ext; # If user provides eps/ps/pdf suffix, use it. |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
61 endif |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
62 else |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
63 error ("print:invalid-suffix", |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
64 "invalid suffix '%s' for device '%s'.", |
20444
ab2c5e84954a
Allow relative paths when printing with -dpdflatex (bug #45601).
Rik <rik@octave.org>
parents:
19853
diff
changeset
|
65 ext, lower (opts.devopt)); |
10861 | 66 endif |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
67 gl2ps_device = {sprintf("%snotxt", lower (suffix))}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
68 gl2ps_device{2} = "tex"; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
69 if (dos_shell) |
17176
abf384f5d243
maint: Remove unneeded input validation from internal fcns in private/ directories.
Rik <rik@octave.org>
parents:
17174
diff
changeset
|
70 ## 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
|
71 pipeline = {sprintf("cat > %s-inc.%s", name, suffix)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
72 pipeline{2} = sprintf ("cat > %s.tex", name); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
73 else |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
74 pipeline = {sprintf("cat > %s-inc.%s", name, suffix)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
75 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
|
76 endif |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
77 case "tikz" |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
78 ## format GL2PS_PGF |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
79 gl2ps_device = {"pgf"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
80 pipeline = {sprintf("cat > %s", opts.name)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
81 case "svg" |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
82 ## format GL2PS_SVG |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
83 gl2ps_device = {"svg"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
84 pipeline = {sprintf("cat > %s", opts.name)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
85 case fig2dev_devices |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
86 cmd_pstoedit = opts.pstoedit_cmd (opts, "fig"); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
87 cmd_fig2dev = opts.fig2dev_cmd (opts, opts.devopt); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
88 if (strcmp (opts.devopt, "pstex")) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
89 [~, ~, ext] = fileparts (opts.name); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
90 if (any (strcmpi (ext, {".ps", ".tex", "."}))) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
91 opts.name = opts.name(1:end-numel(ext)); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
92 endif |
20778
8513c84a13cb
Use parser string concatenation rather than strcat() for performance in m-files.
Rik <rik@octave.org>
parents:
20444
diff
changeset
|
93 opts.name = [opts.name ".ps"]; |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
94 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
|
95 gl2ps_device = {"eps"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
96 pipeline = {cmd}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
97 cmd_fig2dev = opts.fig2dev_cmd (opts, "pstex_t"); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
98 gl2ps_device{2} = "eps"; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
99 pipeline{2} = sprintf ("%s | %s > %s", cmd_pstoedit, |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
100 cmd_fig2dev, strrep(opts.name, ".ps", ".tex")); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
101 else |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
102 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
|
103 gl2ps_device = {"eps"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
104 pipeline = {cmd}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
105 endif |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
106 case "aifm" |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
107 cmd = opts.pstoedit_cmd (opts, "ps2ai"); |
11009 | 108 gl2ps_device = {"eps"}; |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
109 pipeline = {sprintf("%s > %s", cmd, opts.name)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
110 case {"dxf", "emf", "fig", "hpgl"} |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
111 cmd = opts.pstoedit_cmd (opts); |
11009 | 112 gl2ps_device = {"eps"}; |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
113 pipeline = {sprintf("%s > %s", cmd, opts.name)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
114 case {"corel", "gif"} |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
115 error ("print:unsupporteddevice", |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
116 "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
|
117 upper (opts.devopt)); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
118 case opts.ghostscript.device |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
119 opts.ghostscript.source = "-"; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
120 opts.ghostscript.output = opts.name; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
121 if (opts.send_to_printer) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
122 opts.unlink(strcmp (opts.unlink, opts.ghostscript.output)) = []; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
123 opts.ghostscript.output = "-"; |
11009 | 124 endif |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
125 [cmd_gs, cmd_cleanup] = __ghostscript__ (opts.ghostscript); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
126 if (opts.send_to_printer || isempty (opts.name)) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
127 cmd_lpr = opts.lpr_cmd (opts); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
128 cmd = sprintf ("%s | %s", cmd_gs, cmd_lpr); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
129 else |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
130 cmd = sprintf ("%s", cmd_gs); |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
131 endif |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
132 if (! isempty (cmd_cleanup)) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
133 gl2ps_device = {"eps"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
134 if (dos_shell) |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
135 pipeline = {sprintf("%s & %s", cmd, cmd_cleanup)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
136 else |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
137 pipeline = {sprintf("%s ; %s", cmd, cmd_cleanup)}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
138 endif |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
139 else |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
140 gl2ps_device = {"eps"}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
141 pipeline = {cmd}; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
142 endif |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
143 otherwise |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
144 error (sprintf ("print:no%soutput", opts.devopt), |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
17146
diff
changeset
|
145 "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
|
146 upper (opts.devopt)); |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
147 endswitch |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
148 |
11009 | 149 opts.pipeline = pipeline; |
150 | |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14552
diff
changeset
|
151 for n = 1:numel (pipeline) |
11009 | 152 if (opts.debug) |
19640
3b0b4d55002d
rename __fltk_print__.m to __opengl_print__.m
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
153 fprintf ("opengl-pipeline: '%s'\n", pipeline{n}); |
11009 | 154 endif |
19707
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
155 |
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
156 if (strcmp (get (opts.figure, "visible"), "on")) |
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
157 ## Use toolkits "print_figure" method |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19707
diff
changeset
|
158 drawnow (gl2ps_device{n}, ['|' pipeline{n}]); |
19707
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
159 else |
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
160 ## Use OpenGL offscreen rendering with OSMesa |
19853
6645488466c7
__opengl_print__.m: Fix typo introduced in 9fc020886ae9.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
161 __osmesa_print__ (opts.figure, ['|' pipeline{n}], gl2ps_device{n}); |
19707
59ad278cfb98
__opengl_print__.m: Use OSMesa for offscreen rendering (Bug #33180)
Andreas Weber <andy.weber.aw@gmail.com>
parents:
19697
diff
changeset
|
162 endif |
11009 | 163 endfor |
164 | |
12199
3fc07861449b
Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
165 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
|
166 opts.latex_standalone (opts); |
3fc07861449b
Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
167 endif |
3fc07861449b
Fix {eps,ps,pdf}latexstandalone printing for fltk, bug 32262.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
168 |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
169 endfunction |