Author: manolo
Date: 2010-04-20 09:26:22 -0700 (Tue, 20 Apr 2010)
New Revision: 7543
Log:
Moved gc field to classes where it's necessary.

Modified:
   branches/branch-1.3-Fl_Printer/FL/Fl_Clipboard_Device.H
   branches/branch-1.3-Fl_Printer/FL/Fl_Device.H
   branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H
   branches/branch-1.3-Fl_Printer/FL/Fl_Printer.H
   branches/branch-1.3-Fl_Printer/src/Fl_Printer.cxx
   branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_Clipboard_Device.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_Clipboard_Device.H     2010-04-20 
14:52:52 UTC (rev 7542)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_Clipboard_Device.H     2010-04-20 
16:26:22 UTC (rev 7543)
@@ -42,7 +42,7 @@
   CFMutableDataRef pdfdata_;
 #endif
   /** \brief the clipboard's graphics context, if there's one, NULL otherwise 
*/
-//  void *gc;
+  void *gc;
   void traverse(Fl_Widget *widget);
   void translate(int x, int y);
   void untranslate(void);

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_Device.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_Device.H       2010-04-20 14:52:52 UTC 
(rev 7542)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_Device.H       2010-04-20 16:26:22 UTC 
(rev 7543)
@@ -345,8 +345,6 @@
   /** \brief Constructor that sets the graphics driver to use for the created 
surface. */
   Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = 
graphics_driver; };
 public:
-  /** \brief the surface's graphics context, if there's one, NULL otherwise */
-  void *gc; 
   static const char *device_type;
   virtual void set_current(void);
   /** \brief Sets the graphics driver of this drawing surface. */

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H        2010-04-20 
14:52:52 UTC (rev 7542)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_PSfile_Device.H        2010-04-20 
16:26:22 UTC (rev 7543)
@@ -250,6 +250,9 @@
  \brief To send graphical output to a PostScript file.
  */
 class Fl_PostScript_File_Device : public Fl_Paged_Device {
+#ifdef __APPLE__
+  CGContextRef gc;
+#endif
 protected:
   Fl_PostScript_Graphics_Driver *driver();
 public:
@@ -270,6 +273,9 @@
   void untranslate(void);
   int end_page (void);    
   void end_job(void);
+#ifdef __APPLE__
+  void set_current() { fl_gc = gc; Fl_Paged_Device::set_current(); }
+#endif
   
   static const char *file_chooser_title; 
 };

Modified: branches/branch-1.3-Fl_Printer/FL/Fl_Printer.H
===================================================================
--- branches/branch-1.3-Fl_Printer/FL/Fl_Printer.H      2010-04-20 14:52:52 UTC 
(rev 7542)
+++ branches/branch-1.3-Fl_Printer/FL/Fl_Printer.H      2010-04-20 16:26:22 UTC 
(rev 7543)
@@ -74,6 +74,8 @@
  */
 class Fl_Printer : public Fl_Paged_Device {
 private:
+  /** \brief the printer's graphics context, if there's one, NULL otherwise */
+  void *gc; 
 #ifdef __APPLE__
   float scale_x;
   float scale_y;
@@ -117,19 +119,18 @@
 #include <FL/Fl_PSfile_Device.H>
 
 class Fl_Printer : public Fl_PostScript_File_Device {
-
 public:
-  Fl_Printer(void) { gc = NULL; };
+  Fl_Printer(void) { /*gc = NULL;*/ };
   ~Fl_Printer(void) {};
   int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
 
 #endif // Fl_Printer (platform-dependent)
 
   // Fl_Printer:: common for all platforms
+public:        // just to be sure ...
   void set_current();
   static const char *device_type;
 
-public:        // just to be sure ...
 
   /** \name These attributes apply to the Xlib platform only.
    \{

Modified: branches/branch-1.3-Fl_Printer/src/Fl_Printer.cxx
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_Printer.cxx   2010-04-20 14:52:52 UTC 
(rev 7542)
+++ branches/branch-1.3-Fl_Printer/src/Fl_Printer.cxx   2010-04-20 16:26:22 UTC 
(rev 7543)
@@ -66,8 +66,6 @@
   fl_gc = (CGContextRef)gc;
 #elif defined(WIN32)
   fl_gc = (HDC)gc;
-#else
-  fl_gc = (_XGC*)gc;
 #endif
   this->Fl_Surface_Device::set_current();
 }

Modified: branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm      2010-04-20 14:52:52 UTC 
(rev 7542)
+++ branches/branch-1.3-Fl_Printer/src/Fl_cocoa.mm      2010-04-20 16:26:22 UTC 
(rev 7543)
@@ -2972,10 +2972,11 @@
                             nil];
     [NSApp  orderFrontStandardAboutPanelWithOptions:options];
   }
+//#include <FL/Fl_PSfile_Device.H>
 - (void)printPanel
 {
   Fl_Printer printer;
-  //Fl_PSfile_Device printer;
+  //Fl_PostScript_File_Device printer;
   int w, h;
   Fl_Window *win = Fl::first_window();
   if(!win) return;

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

Reply via email to