changeset 17523:55680de6a897

make fltk the default graphics toolkit * graphics.h.in (figure::properties): Use gtk_manager::default_toolkit to set initial value. * graphics.cc (gtk_manager::gtk_manager): Move here from graphics.h.in. Set dtk to "fltk" if HAVE_FLTK, otherwise set it to "gnuplot".
author John W. Eaton <jwe@octave.org>
date Thu, 26 Sep 2013 13:55:43 -0400
parents b66f068e4468
children 534247e14b03 578805a293e5
files NEWS libinterp/corefcn/graphics.cc libinterp/corefcn/graphics.in.h
diffstat 3 files changed, 22 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,16 @@
 Summary of important user-visible changes for version 3.8:
 ---------------------------------------------------------
 
+ ** Octave now uses OpenGL graphics by default with FLTK widgets.  If
+    OpenGL libraries or FLTK widgets are not available when Octave is
+    built, gnuplot is used.  You may also choose to use gnuplot for
+    graphics by executing the command
+
+      graphics_toolkit ("gnuplot")
+
+    Adding this command to your ~/.octaverc file will set the default
+    for each session.
+
  ** Octave now supports nested functions with scoping rules that are
     compatible with Matlab.  A nested function is one declared and defined
     within the body of another function.  The nested function is only
--- a/libinterp/corefcn/graphics.cc
+++ b/libinterp/corefcn/graphics.cc
@@ -9501,6 +9501,16 @@
 
 gtk_manager *gtk_manager::instance = 0;
 
+gtk_manager::gtk_manager (void)
+  : dtk (), available_toolkits (), loaded_toolkits ()
+{
+#if defined (HAVE_FLTK)
+  dtk = "fltk";
+#else
+  dtk = "gnuplot";
+#endif
+}
+
 void
 gtk_manager::create_instance (void)
 {
--- a/libinterp/corefcn/graphics.in.h
+++ b/libinterp/corefcn/graphics.in.h
@@ -2361,10 +2361,7 @@
 
 private:
 
-  // FIXME: default toolkit should be configurable.
-
-  gtk_manager (void)
-    : dtk ("gnuplot"), available_toolkits (), loaded_toolkits () { }
+  gtk_manager (void);
 
   ~gtk_manager (void) { }
 
@@ -3458,7 +3455,7 @@
       radio_property xvisualmode , "{auto}|manual"
       // Octave-specific properties
       bool_property __enhanced__ h , "on"
-      string_property __graphics_toolkit__ s , "gnuplot"
+      string_property __graphics_toolkit__ s , gtk_manager::default_toolkit ()
       any_property __guidata__ h , Matrix ()
       any_property __plot_stream__ h , Matrix ()
     END_PROPERTIES