comparison libinterp/dldfcn/__init_fltk__.cc @ 15503:dca1f2bcccf3

don't register fltk toolkit if compiling without FLTK (bug #37541) * __init_fltk__.cc (F__have_fltk__): New function. Use it in PKG_ADD line to decide whether to register fltk toolkit.
author John W. Eaton <jwe@octave.org>
date Thu, 11 Oct 2012 14:16:10 -0400
parents 2fc554ffbc28
children b3762b89c3c0
comparison
equal deleted inserted replaced
15502:312d544de165 15503:dca1f2bcccf3
27 graphics_toolkit ("fltk"); 27 graphics_toolkit ("fltk");
28 plot (randn (1e3, 1)); 28 plot (randn (1e3, 1));
29 29
30 */ 30 */
31 31
32 // PKG_ADD: register_graphics_toolkit ("fltk"); 32 // PKG_ADD: if (__have_fltk__ ()) register_graphics_toolkit ("fltk"); endif
33 33
34 #ifdef HAVE_CONFIG_H 34 #ifdef HAVE_CONFIG_H
35 #include <config.h> 35 #include <config.h>
36 #endif 36 #endif
37 37
2027 return retval; 2027 return retval;
2028 } 2028 }
2029 2029
2030 #endif 2030 #endif
2031 2031
2032 DEFUN_DLD (__have_fltk__, , , "")
2033 {
2034 octave_value retval;
2035
2036 #if defined (HAVE_FLTK)
2037 retval = true;
2038 #else
2039 retval = false;
2040 #endif
2041
2042 return retval;
2043 }
2044
2032 // FIXME -- This function should be abstracted and made potentially 2045 // FIXME -- This function should be abstracted and made potentially
2033 // available to all graphics toolkits. This suggests putting it in 2046 // available to all graphics toolkits. This suggests putting it in
2034 // graphics.cc as is done for drawnow() and having the master 2047 // graphics.cc as is done for drawnow() and having the master
2035 // mouse_wheel_zoom function call fltk_mouse_wheel_zoom. The same 2048 // mouse_wheel_zoom function call fltk_mouse_wheel_zoom. The same
2036 // should be done for gui_mode and fltk_gui_mode. For now (2011.01.30), 2049 // should be done for gui_mode and fltk_gui_mode. For now (2011.01.30),
2124 #else 2137 #else
2125 error ("mouse_wheel_zoom: not available without OpenGL and FLTK libraries"); 2138 error ("mouse_wheel_zoom: not available without OpenGL and FLTK libraries");
2126 return octave_value (); 2139 return octave_value ();
2127 #endif 2140 #endif
2128 } 2141 }
2129