FLTK logo

[Library] r7471 - in branches/branch-1.3: FL src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r7471 - in branches/branch-1.3: FL src fltk-dev Apr 08, 2010  
 
Author: manolo
Date: 2010-04-08 09:58:28 -0700 (Thu, 08 Apr 2010)
New Revision: 7471
Log:
Added an Fl_Printer destructor that's useful under MSWin when printing is aborted

Modified:
   branches/branch-1.3/FL/Fl_Printer.H
   branches/branch-1.3/src/Fl_GDI_Printer.cxx
   branches/branch-1.3/src/Fl_Quartz_Printer.mm

Modified: branches/branch-1.3/FL/Fl_Printer.H
===================================================================
--- branches/branch-1.3/FL/Fl_Printer.H	2010-04-08 05:22:13 UTC (rev 7470)
+++ branches/branch-1.3/FL/Fl_Printer.H	2010-04-08 16:58:28 UTC (rev 7471)
@@ -113,6 +113,10 @@
 #endif  
   int end_page (void);
   void end_job (void);
+  /** 
+   @brief The destructor.
+   */
+  ~Fl_Printer(void);
 #ifdef FL_DOXYGEN
   /** \name These attributes apply to the Xlib platform only.
    \{

Modified: branches/branch-1.3/src/Fl_GDI_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_GDI_Printer.cxx	2010-04-08 05:22:13 UTC (rev 7470)
+++ branches/branch-1.3/src/Fl_GDI_Printer.cxx	2010-04-08 16:58:28 UTC (rev 7471)
@@ -39,6 +39,10 @@
   type_ = gdi_printer;
 }
 
+Fl_Printer::~Fl_Printer(void) {
+  if (hPr) end_job();
+}
+
 static void WIN_SetupPrinterDeviceContext(HDC prHDC)
 {
   if ( !prHDC ) return;
@@ -81,7 +85,7 @@
       prerr = StartDoc (hPr, &di);
       if (prerr < 1) {
 	abortPrint = TRUE;
-	fl_alert ("StartDoc error %d", prerr);
+	//fl_alert ("StartDoc error %d", prerr);
 	err = 1;
       }
     } else {
@@ -129,6 +133,7 @@
       GlobalFree (pd.hDevNames);
     }
   }
+  hPr = NULL;
 }
 
 void Fl_Printer::absolute_printable_rect(int *x, int *y, int *w, int *h)

Modified: branches/branch-1.3/src/Fl_Quartz_Printer.mm
===================================================================
--- branches/branch-1.3/src/Fl_Quartz_Printer.mm	2010-04-08 05:22:13 UTC (rev 7470)
+++ branches/branch-1.3/src/Fl_Quartz_Printer.mm	2010-04-08 16:58:28 UTC (rev 7471)
@@ -43,6 +43,8 @@
   type_ = quartz_printer;
 }
 
+Fl_Printer::~Fl_Printer(void) {}
+
 int Fl_Printer::start_job (int pagecount, int *frompage, int *topage)
 //printing using a Quartz graphics context
 //returns 0 iff OK

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.