1######################################################################## 2## 3## Copyright (C) 2009-2021 The Octave Project Developers 4## 5## See the file COPYRIGHT.md in the top-level directory of this 6## distribution or <https://octave.org/copyright/>. 7## 8## This file is part of Octave. 9## 10## Octave is free software: you can redistribute it and/or modify it 11## under the terms of the GNU General Public License as published by 12## the Free Software Foundation, either version 3 of the License, or 13## (at your option) any later version. 14## 15## Octave is distributed in the hope that it will be useful, but 16## WITHOUT ANY WARRANTY; without even the implied warranty of 17## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18## GNU General Public License for more details. 19## 20## You should have received a copy of the GNU General Public License 21## along with Octave; see the file COPYING. If not, see 22## <https://www.gnu.org/licenses/>. 23## 24######################################################################## 25 26## -*- texinfo -*- 27## @deftypefn {} {@var{has_feature} =} __gnuplot_has_feature__ (@var{feature}) 28## Undocumented internal function. 29## @end deftypefn 30 31function res = __gnuplot_has_feature__ (feature) 32 persistent features = {"minimum_version", 33 "needs_color_with_postscript", 34 "dashtype", 35 "alphablend_linecolor", 36 "qt_terminal", 37 "wxt_figure_position", 38 "qt_figure_position", 39 "fontspec_5"}; 40 41 persistent has_features; 42 43 if (isempty (has_features)) 44 gnuplot_version = __gnuplot_version__ (); 45 versions = {"4.4", "4.6", "5.0", "4.6", "4.6", "5.0", "5.0", "5.0"}; 46 operators = {">=" , ">=" , ">=" , ">=" , ">=" , ">=" , ">=" , ">=" }; 47 have_features = false (size (features)); 48 for n = 1 : numel (have_features) 49 has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n}); 50 endfor 51 endif 52 53 n = find (strcmpi (feature, features)); 54 if (isempty (n)) 55 res = NaN; 56 else 57 res = has_features(n); 58 endif 59 60endfunction 61