Author: manolo
Date: 2010-03-17 00:56:50 -0700 (Wed, 17 Mar 2010)
New Revision: 7281
Log:
Some fine tuning after introduction of Fl_Gl_Window-capable 
Fl_Printer::print_widget()

Modified:
   branches/branch-1.3/src/Fl_Device.cxx
   branches/branch-1.3/src/Fl_Gl_Printer.cxx
   branches/branch-1.3/test/cube.cxx
   branches/branch-1.3/test/glpuzzle.cxx

Modified: branches/branch-1.3/src/Fl_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Device.cxx       2010-03-16 22:51:31 UTC (rev 
7280)
+++ branches/branch-1.3/src/Fl_Device.cxx       2010-03-17 07:56:50 UTC (rev 
7281)
@@ -45,13 +45,6 @@
   }
   // if widget is a window, clip all drawings to the window area
   if (is_window) fl_push_clip(0, 0, widget->w(), widget->h() );
-#ifdef __APPLE__
-  CGContextRef save_gc = fl_gc;
-#elif defined(WIN32) // && !defined(__CYGWIN__)
-  HDC save_gc = fl_gc;
-#else
-  _XGC *save_gc = fl_gc;       // FIXME
-#endif
   // we do some trickery to recognize OpenGL windows and draw them via a plugin
   int drawn_by_plugin = 0;
   if (widget->as_gl_window()) {
@@ -59,10 +52,9 @@
     Fl_Device_Plugin *pi = 
(Fl_Device_Plugin*)pm.plugin("opengl.device.fltk.org");
     if (pi) drawn_by_plugin = pi->print(this, widget, 0, 0);
   }
-  if (!drawn_by_plugin)
-    widget->draw(); 
-  
-  fl_gc = save_gc;
+  if (!drawn_by_plugin) {
+    widget->draw();
+  }
   if (is_window) fl_pop_clip();
   // find subwindows of widget and print them
   traverse(widget);

Modified: branches/branch-1.3/src/Fl_Gl_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Gl_Printer.cxx   2010-03-16 22:51:31 UTC (rev 
7280)
+++ branches/branch-1.3/src/Fl_Gl_Printer.cxx   2010-03-17 07:56:50 UTC (rev 
7281)
@@ -91,8 +91,8 @@
 }
 
 /*
- This class will make sure that OpenGL printing is availbale if fltk_gl
- was linked to the programm.
+ This class will make sure that OpenGL printing is available if fltk_gl
+ was linked to the program.
  */
 class Fl_Gl_Device_Plugin : public Fl_Device_Plugin {
 public:

Modified: branches/branch-1.3/test/cube.cxx
===================================================================
--- branches/branch-1.3/test/cube.cxx   2010-03-16 22:51:31 UTC (rev 7280)
+++ branches/branch-1.3/test/cube.cxx   2010-03-17 07:56:50 UTC (rev 7281)
@@ -170,8 +170,6 @@
   if( printer.start_page() ) return;
   printer.scale(0.5,0.5);
   printer.print_widget( win );
-  printer.print_gl_window( cube, cube->x(), cube->y() );
-  printer.print_gl_window( cube2, cube2->x(), cube2->y() );
   printer.end_page();
   printer.end_job();
 }

Modified: branches/branch-1.3/test/glpuzzle.cxx
===================================================================
--- branches/branch-1.3/test/glpuzzle.cxx       2010-03-16 22:51:31 UTC (rev 
7280)
+++ branches/branch-1.3/test/glpuzzle.cxx       2010-03-17 07:56:50 UTC (rev 
7281)
@@ -1420,38 +1420,9 @@
    }
 }
 
-// added to demo printing
-#include <FL/Fl_Sys_Menu_Bar.H>
-#include <FL/Fl_Gl_Printer.H>
-
-void print_cb(Fl_Widget *w, void *data)
-{
-  Fl_Gl_Printer printer;
-  Fl_Window *win = Fl::first_window();
-  if(!win) return;
-  if( printer.start_job(1) ) return;
-  if( printer.start_page() ) return;
-  printer.scale(0.68,0.68);
-  printer.print_gl_window( (Fl_Gl_Window*)win );
-  printer.end_page();
-  printer.end_job();
-}
-// end of printing demo 
-
 int
 main(int argc, char **argv)
 {
-  // added to demo printing
-  static Fl_Menu_Item  items[] = {
-    { "Menu", 0, 0, 0, FL_SUBMENU },
-    { "Print", 0, print_cb, 0, 0 },
-    { 0 },
-    { 0 }
-  };
-  Fl_Sys_Menu_Bar *menubar_;
-  menubar_ = new Fl_Sys_Menu_Bar(0, 0, 1, 25);
-  menubar_->menu(items);
- // end of printing demo 
   long i;
 
   glutInit(&argc, argv);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to