mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-08 03:00:40 +00:00
Linker error and new function.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38098 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7eb9c9a99e
commit
a60e46ed54
3 changed files with 79 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2014-09-27 12:19-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
|
* 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 <greg.casamento@gmail.com>
|
2014-09-16 12:19-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Source/GSPrinting.m: Reorder printing backend load order.
|
* Source/GSPrinting.m: Reorder printing backend load order.
|
||||||
|
|
|
@ -18,7 +18,7 @@ ADDITIONAL_INCLUDE_DIRS += -I../../Headers/Additions -I../../Headers \
|
||||||
-I../../Source/$(GNUSTEP_TARGET_DIR)
|
-I../../Source/$(GNUSTEP_TARGET_DIR)
|
||||||
|
|
||||||
# Additional LDFLAGS to pass to the linker
|
# Additional LDFLAGS to pass to the linker
|
||||||
ADDITIONAL_LDFLAGS += -lwinspool
|
ADDITIONAL_LDFLAGS +=
|
||||||
|
|
||||||
# Additional library directories the linker should search
|
# Additional library directories the linker should search
|
||||||
ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR)
|
ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR)
|
||||||
|
@ -32,7 +32,7 @@ ADDITIONAL_GUI_LIBS +=
|
||||||
# Libraries
|
# Libraries
|
||||||
ADDITIONAL_LIBRARY_LIBS +=
|
ADDITIONAL_LIBRARY_LIBS +=
|
||||||
# ObjC stuff
|
# ObjC stuff
|
||||||
ADDITIONAL_OBJC_LIBS +=
|
ADDITIONAL_OBJC_LIBS += -lwinspool
|
||||||
#-lgnustep-gui $(SYSTEM_LIBS)
|
#-lgnustep-gui $(SYSTEM_LIBS)
|
||||||
# Tools
|
# Tools
|
||||||
ADDITIONAL_TOOL_LIBS +=
|
ADDITIONAL_TOOL_LIBS +=
|
||||||
|
|
|
@ -51,6 +51,75 @@
|
||||||
#import "GSGuiPrivate.h"
|
#import "GSGuiPrivate.h"
|
||||||
#import "GSWIN32PrintOperation.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.
|
//A subclass of GSPrintOperation, NOT NSPrintOperation.
|
||||||
@implementation GSWIN32PrintOperation
|
@implementation GSWIN32PrintOperation
|
||||||
//
|
//
|
||||||
|
@ -61,7 +130,6 @@
|
||||||
return NSAllocateObject(self, 0, zone);
|
return NSAllocateObject(self, 0, zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (id)initWithView:(NSView *)aView
|
- (id)initWithView:(NSView *)aView
|
||||||
printInfo:(NSPrintInfo *)aPrintInfo
|
printInfo:(NSPrintInfo *)aPrintInfo
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue