mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 02:30:47 +00:00
Load prolog.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14863 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3766e95ce1
commit
6b65871481
9 changed files with 47 additions and 12 deletions
|
@ -1384,14 +1384,14 @@ NSGraphicsContext *GSCurrentContext()
|
|||
/* ----------------------------------------------------------------------- */
|
||||
/** Write the string (with printf substitutions) to a PostScript context.
|
||||
Other output contexts will likely ignore this */
|
||||
- (void) DPSPrintf: (char *)fmt : (va_list)args
|
||||
- (void) DPSPrintf: (const char *)fmt : (va_list)args
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
/** Write the encoded data to a PostScript context.
|
||||
Other output contexts will likely ignore this */
|
||||
- (void) DPSWriteData: (char *)buf : (unsigned int)count
|
||||
- (void) DPSWriteData: (const char *)buf : (unsigned int)count
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
|
|
@ -1231,7 +1231,7 @@ scaleRect(NSRect rect, double scale)
|
|||
}
|
||||
else if ([job isEqual: NSPrintSpoolJob])
|
||||
{
|
||||
sucess = [self _deliverSpooledResult];
|
||||
success = [self _deliverSpooledResult];
|
||||
}
|
||||
else if ([job isEqual: NSPrintFaxJob])
|
||||
{
|
||||
|
|
|
@ -66,6 +66,9 @@
|
|||
#include <AppKit/NSColorPanel.h>
|
||||
#include <AppKit/NSAttributedString.h>
|
||||
|
||||
/* From NSView.m */
|
||||
self NSView *viewIsPrinting;
|
||||
|
||||
static const int currentVersion = 2;
|
||||
|
||||
#define HUGE 1e7
|
||||
|
@ -3451,7 +3454,7 @@ afterString in order over charRange. */
|
|||
if (NSLocationInRange (location, drawnRange)
|
||||
|| location == NSMaxRange (drawnRange))
|
||||
{
|
||||
if (_drawInsertionPointNow)
|
||||
if (_drawInsertionPointNow && viewIsPrinting != self)
|
||||
{
|
||||
[self drawInsertionPointInRect: _insertionPointRect
|
||||
color: _caret_color
|
||||
|
|
|
@ -3321,6 +3321,22 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
DPSPrintf(ctxt, "%%%%EOF\n");
|
||||
}
|
||||
|
||||
- (void) _loadPrinterProlog: (NSGraphicsContext *)ctxt
|
||||
{
|
||||
NSString *prolog;
|
||||
prolog = [NSBundle pathForGNUstepResource: @"GSProlog"
|
||||
ofType: @"ps"
|
||||
inDirectory: @"PrinterTypes"];
|
||||
if (prolog == nil)
|
||||
{
|
||||
NSLog(@"Cannot find printer prolog file");
|
||||
return;
|
||||
}
|
||||
prolog = [NSString stringWithContentsOfFile: prolog];
|
||||
DPSPrintf(ctxt, [prolog cString]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Writes header and job information for the PostScript document. This
|
||||
includes at a minimum, PostScript header information. It may also
|
||||
|
@ -3377,7 +3393,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
[self endHeaderComments];
|
||||
|
||||
DPSPrintf(ctxt, "%%%%BeginProlog\n");
|
||||
// Prolog goes here !
|
||||
[self _loadPrinterProlog: ctxt];
|
||||
[self endPrologue];
|
||||
if ([printOp isEPSOperation] == NO)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue