Author: gcasa
Date: Sun Sep 28 03:12:31 2014
New Revision: 38098

URL: http://svn.gna.org/viewcvs/gnustep?rev=38098&view=rev
Log:
Linker error and new function.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Printing/GSWIN32/GNUmakefile.preamble
    libs/gui/trunk/Printing/GSWIN32/GSWIN32PrintOperation.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38098&r1=38097&r2=38098&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Sun Sep 28 03:12:31 2014
@@ -1,3 +1,11 @@
+2014-09-27 12:19-EDT Gregory John Casamento <[email protected]>
+
+       * Printing/GSWIN32/GSWIN32PrinterOperation.m: Addition of function
+       to output to printer directly.
+       * Printing/GSWIN32/GNUmakefile: Change to correct linker issue
+       winspool was not being linked in the proper place so it was
+       causing unresolved references.
+       
 2014-09-16 12:19-EDT Gregory John Casamento <[email protected]>
 
        * Source/GSPrinting.m: Reorder printing backend load order.

Modified: libs/gui/trunk/Printing/GSWIN32/GNUmakefile.preamble
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Printing/GSWIN32/GNUmakefile.preamble?rev=38098&r1=38097&r2=38098&view=diff
==============================================================================
--- libs/gui/trunk/Printing/GSWIN32/GNUmakefile.preamble        (original)
+++ libs/gui/trunk/Printing/GSWIN32/GNUmakefile.preamble        Sun Sep 28 
03:12:31 2014
@@ -18,7 +18,7 @@
        -I../../Source/$(GNUSTEP_TARGET_DIR)
 
 # Additional LDFLAGS to pass to the linker
-ADDITIONAL_LDFLAGS += -lwinspool
+ADDITIONAL_LDFLAGS += 
 
 # Additional library directories the linker should search
 ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR)
@@ -32,7 +32,7 @@
 # Libraries
 ADDITIONAL_LIBRARY_LIBS +=
 # ObjC stuff
-ADDITIONAL_OBJC_LIBS += 
+ADDITIONAL_OBJC_LIBS += -lwinspool 
 #-lgnustep-gui $(SYSTEM_LIBS)
 # Tools
 ADDITIONAL_TOOL_LIBS +=

Modified: libs/gui/trunk/Printing/GSWIN32/GSWIN32PrintOperation.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Printing/GSWIN32/GSWIN32PrintOperation.m?rev=38098&r1=38097&r2=38098&view=diff
==============================================================================
--- libs/gui/trunk/Printing/GSWIN32/GSWIN32PrintOperation.m     (original)
+++ libs/gui/trunk/Printing/GSWIN32/GSWIN32PrintOperation.m     Sun Sep 28 
03:12:31 2014
@@ -51,6 +51,75 @@
 #import "GSGuiPrivate.h"
 #import "GSWIN32PrintOperation.h"
 
+BOOL RawDataToPrinter(LPSTR szPrinterName, LPBYTE lpData, DWORD dwCount)
+{
+  HANDLE     hPrinter;
+  DOC_INFO_1 DocInfo;
+  DWORD      dwJob;
+  DWORD      dwBytesWritten;
+  
+  // Need a handle to the printer.
+  if( ! OpenPrinter( szPrinterName, &hPrinter, NULL ) )
+    {
+      return FALSE;
+    }
+
+  // Fill in the structure with info about this "document."
+  DocInfo.pDocName = "My Document";
+  DocInfo.pOutputFile = NULL;
+  DocInfo.pDatatype = "RAW";
+
+  // Inform the spooler the document is beginning.
+  if( (dwJob = StartDocPrinter( hPrinter, 1, (LPSTR)&DocInfo )) == 0 )
+    {
+      ClosePrinter( hPrinter );
+      return FALSE;
+    }
+
+  // Start a page.
+  if( ! StartPagePrinter( hPrinter ) )
+    {
+      EndDocPrinter( hPrinter );
+      ClosePrinter( hPrinter );
+      return FALSE;
+    }
+
+  // Send the data to the printer.
+  if( ! WritePrinter( hPrinter, lpData, dwCount, &dwBytesWritten ) )
+    {
+      EndPagePrinter( hPrinter );
+      EndDocPrinter( hPrinter );
+      ClosePrinter( hPrinter );
+      return FALSE;
+    }
+
+  // End the page.
+  if( ! EndPagePrinter( hPrinter ) )
+    {
+      EndDocPrinter( hPrinter );
+      ClosePrinter( hPrinter );
+      return FALSE;
+    }
+
+  // Inform the spooler that the document is ending.
+  if( ! EndDocPrinter( hPrinter ) )
+    {
+      ClosePrinter( hPrinter );
+      return FALSE;
+    }
+
+  // Tidy up the printer handle.
+  ClosePrinter( hPrinter );
+
+  // Check to see if correct number of bytes were written.
+  if( dwBytesWritten != dwCount )
+    {
+      return FALSE;
+    }
+
+  return TRUE;
+}
+
 //A subclass of GSPrintOperation, NOT NSPrintOperation.
 @implementation GSWIN32PrintOperation
 //
@@ -60,7 +129,6 @@
 {
   return NSAllocateObject(self, 0, zone);
 }
-
 
 - (id)initWithView:(NSView *)aView
          printInfo:(NSPrintInfo *)aPrintInfo


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to