changeset 22503:05c2313904cb

Figure "position" property support for qt and wxt terminal (require gnuplot 5). * __gnuplot_drawnow__.m: Test for wxt_figure_position or qt_figure_position to see if figure positioning code can be used. * __gnuplot_has_feature__.m: Add new features "wxt_figure_position", "qt_figure_position".
author Tatsuro Matsuoka <tmacchant@yahoo.co.jp>
date Fri, 16 Sep 2016 11:53:12 +0900
parents 341bc61c2286
children 2aa9e8893ea9
files scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/private/__gnuplot_has_feature__.m
diffstat 2 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/__gnuplot_drawnow__.m	Fri Sep 16 09:30:05 2016 -0400
+++ b/scripts/plot/util/__gnuplot_drawnow__.m	Fri Sep 16 11:53:12 2016 +0900
@@ -223,8 +223,12 @@
             otherwise
               size_str = "";
           endswitch
-          if (strcmp (term, "x11") || strcmpi (term, "windows"))
-            ## X11/Windows allows the window to be positioned as well.
+          if (strcmp (term, "x11") || strcmp (term, "windows") 
+              || (strcmp (term, "wxt")
+                  && __gnuplot_has_feature__ ("wxt_figure_position")) 
+              || (strcmp (term, "qt")
+                  && __gnuplot_has_feature__ ("qt_figure_position")))
+            ## X11/Windows/qt/wxt (=> ver 5) allows the window to be positioned.
             units = get (0, "units");
             unwind_protect
               set (0, "units", "pixels");
@@ -377,7 +381,7 @@
 endfunction
 
 function ret = output_to_screen (term)
-  ret = any (strcmpi (term,
+  ret = any (strcmp (term,
                      {"aqua", "dumb", "pm", "qt", "windows", "wxt", "x11"}));
 endfunction
 
--- a/scripts/plot/util/private/__gnuplot_has_feature__.m	Fri Sep 16 09:30:05 2016 -0400
+++ b/scripts/plot/util/private/__gnuplot_has_feature__.m	Fri Sep 16 11:53:12 2016 +0900
@@ -30,7 +30,9 @@
                          "linetype",
                          "dashtype",
                          "alphablend_linecolor",
-                         "qt_terminal"};
+                         "qt_terminal",
+                         "wxt_figure_position",
+                         "qt_figure_position"};
 
   persistent has_features;
 
@@ -41,8 +43,8 @@
       ## Don't throw an error if gnuplot isn't installed
       gnuplot_version = "0.0.0";
     end_try_catch
-    versions =  {"4.4", "4.6", "4.6", "5.0", "4.6", "4.6"};
-    operators = {">=" , ">=" , ">=" , ">=" , ">=" , ">=" };
+    versions =  {"4.4", "4.6", "4.6", "5.0", "4.6", "4.6", "5.0", "5.0"};
+    operators = {">=" , ">=" , ">=" , ">=" , ">=" , ">=" , ">=" , ">="};
     have_features = false (size (features));
     for n = 1 : numel (have_features)
       has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});