1 ## Copyright (C) 2009-2012 Ben Abbott
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {@var{has_feature} =} __gnuplot_has_feature__ (@var{feature})
21 ## Undocumented internal function.
24 ## Author: Ben Abbott <bpabbott@mac.com>
25 ## Created: 2009-01-27
27 function res = __gnuplot_has_feature__ (feature)
28 persistent features has_features
29 features = {"x11_figure_position",
31 "transparent_patches",
32 "transparent_surface",
33 "epslatex_implies_eps_filesuffix",
34 "epslatexstandalone_terminal",
35 "screen_coordinates_for_{lrtb}margin",
36 "variable_GPVAL_TERMINALS",
37 "key_has_font_properties"};
39 if (isempty (has_features))
41 gnuplot_version = __gnuplot_version__ ();
43 ## Don't throw an error if gnuplot isn't installed
44 gnuplot_version = "0.0.0";
46 versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4"};
47 operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="};
48 have_features = logical (zeros (size (features)));
49 for n = 1 : numel (have_features)
50 has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});
54 n = find (strcmpi (feature, features));
58 res = has_features(n);