From 04a3436aff037383cf17c6fd8cc3d3ca324bd84c Mon Sep 17 00:00:00 2001
From: Adam Fedor
Date: Thu, 8 Nov 2001 18:26:39 +0000
Subject: [PATCH] Simple printint implementation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11341 72102866-910b-0410-8b05-ffd578937521
---
ChangeLog | 32 +
Documentation/gsdoc/GNUmakefile | 19 +-
Documentation/gsdoc/Gui.html | 202 +++---
Documentation/gsdoc/Introduction.html | 14 +-
Documentation/gsdoc/NSActionCell.html | 46 +-
Documentation/gsdoc/NSAffineTransform.html | 40 +-
Documentation/gsdoc/NSApplication.html | 182 +++---
.../gsdoc/NSAttributedStrngAdds.html | 6 +-
Documentation/gsdoc/NSBezierPath.html | 116 ++--
Documentation/gsdoc/NSBitmapImageRep.html | 54 +-
Documentation/gsdoc/NSBox.html | 42 +-
Documentation/gsdoc/NSBrowser.html | 178 +++---
Documentation/gsdoc/NSBrowserCell.html | 26 +-
Documentation/gsdoc/NSBundleAdditions.html | 16 +-
Documentation/gsdoc/NSButton.html | 84 +--
Documentation/gsdoc/NSButtonCell.html | 102 +--
Documentation/gsdoc/NSCachedImageRep.html | 14 +-
Documentation/gsdoc/NSCell.html | 230 +++----
Documentation/gsdoc/NSClipView.html | 62 +-
Documentation/gsdoc/NSCoderAdditions.html | 8 +-
Documentation/gsdoc/NSColor.html | 168 ++---
Documentation/gsdoc/NSColorList.html | 32 +-
Documentation/gsdoc/NSColorPanel.html | 48 +-
Documentation/gsdoc/NSColorPicker.html | 22 +-
Documentation/gsdoc/NSColorWell.html | 24 +-
Documentation/gsdoc/NSComboBox.html | 76 +--
Documentation/gsdoc/NSComboBoxCell.html | 78 +--
Documentation/gsdoc/NSControl.html | 140 ++---
Documentation/gsdoc/NSCursor.html | 46 +-
Documentation/gsdoc/NSCustomImageRep.html | 12 +-
Documentation/gsdoc/NSDPSContext.html | 88 +--
Documentation/gsdoc/NSDocument.html | 106 ++--
Documentation/gsdoc/NSDocumentController.html | 56 +-
Documentation/gsdoc/NSEPSImageRep.html | 16 +-
Documentation/gsdoc/NSEvent.html | 54 +-
Documentation/gsdoc/NSFileWrapper.html | 64 +-
Documentation/gsdoc/NSFont.html | 110 ++--
Documentation/gsdoc/NSFontManager.html | 84 +--
Documentation/gsdoc/NSFontPanel.html | 24 +-
Documentation/gsdoc/NSForm.html | 38 +-
Documentation/gsdoc/NSFormCell.html | 34 +-
Documentation/gsdoc/NSGraphicsContext.html | 22 +-
Documentation/gsdoc/NSHelpManager.html | 20 +-
Documentation/gsdoc/NSImage.html | 116 ++--
Documentation/gsdoc/NSImageCell.html | 18 +-
Documentation/gsdoc/NSImageRep.html | 72 +--
Documentation/gsdoc/NSImageView.html | 26 +-
Documentation/gsdoc/NSInputManager.html | 18 +-
Documentation/gsdoc/NSInputServer.html | 32 +-
Documentation/gsdoc/NSLayoutManager.html | 172 ++---
Documentation/gsdoc/NSMatrix.html | 200 +++---
Documentation/gsdoc/NSMenu.html | 98 +--
Documentation/gsdoc/NSMenuItem.html | 6 +-
Documentation/gsdoc/NSMenuItemCell.html | 56 +-
Documentation/gsdoc/NSMenuView.html | 88 +--
.../NSMutableAttributedStringAdditions.html | 26 +-
.../gsdoc/NSMutableParagraphStyle.html | 32 +-
Documentation/gsdoc/NSOpenPanel.html | 28 +-
Documentation/gsdoc/NSPICTImageRep.html | 14 +-
Documentation/gsdoc/NSPageLayout.gsdoc | 55 +-
Documentation/gsdoc/NSPanel.html | 18 +-
Documentation/gsdoc/NSParagraphStyle.html | 28 +-
Documentation/gsdoc/NSPasteboard.html | 58 +-
Documentation/gsdoc/NSPopUpButton.html | 78 +--
Documentation/gsdoc/NSPopUpButtonCell.html | 96 +--
Documentation/gsdoc/NSPrintInfo.gsdoc | 48 +-
Documentation/gsdoc/NSPrintInfo.html | 74 +--
Documentation/gsdoc/NSPrintOperation.gsdoc | 152 ++++-
Documentation/gsdoc/NSPrintOperation.html | 237 +++++--
Documentation/gsdoc/NSPrintPanel.gsdoc | 4 +-
Documentation/gsdoc/NSPrinter.html | 60 +-
Documentation/gsdoc/NSProgressIndicator.html | 42 +-
Documentation/gsdoc/NSResponder.html | 188 +++---
Documentation/gsdoc/NSRulerMarker.html | 44 +-
Documentation/gsdoc/NSRulerView.html | 90 +--
Documentation/gsdoc/NSSavePanel.html | 52 +-
Documentation/gsdoc/NSScreen.html | 22 +-
Documentation/gsdoc/NSScrollView.html | 110 ++--
Documentation/gsdoc/NSScroller.html | 40 +-
Documentation/gsdoc/NSSecureTextField.html | 6 +-
.../gsdoc/NSSecureTextFieldCell.html | 10 +-
Documentation/gsdoc/NSSlider.html | 66 +-
Documentation/gsdoc/NSSliderCell.html | 72 +--
Documentation/gsdoc/NSSpellChecker.html | 40 +-
Documentation/gsdoc/NSSpellServer.html | 24 +-
Documentation/gsdoc/NSSplitView.html | 20 +-
Documentation/gsdoc/NSStringAdditions.html | 12 +-
Documentation/gsdoc/NSTabView.html | 66 +-
Documentation/gsdoc/NSTabViewItem.html | 36 +-
Documentation/gsdoc/NSTableColumn.html | 46 +-
Documentation/gsdoc/NSTableHeaderCell.html | 8 +-
Documentation/gsdoc/NSTableHeaderView.html | 20 +-
Documentation/gsdoc/NSTableView.html | 196 +++---
Documentation/gsdoc/NSText.html | 152 ++---
Documentation/gsdoc/NSTextAttachment.html | 16 +-
Documentation/gsdoc/NSTextAttachmentCell.html | 10 +-
Documentation/gsdoc/NSTextContainer.html | 40 +-
Documentation/gsdoc/NSTextField.html | 72 +--
Documentation/gsdoc/NSTextFieldCell.html | 20 +-
Documentation/gsdoc/NSTextStorage.html | 32 +-
Documentation/gsdoc/NSTextTab.html | 12 +-
Documentation/gsdoc/NSTextView.html | 244 ++++----
Documentation/gsdoc/NSView.gsdoc | 3 +
Documentation/gsdoc/NSView.html | 331 +++++-----
Documentation/gsdoc/NSWindow.html | 332 +++++-----
Documentation/gsdoc/NSWindowController.html | 48 +-
Documentation/gsdoc/NSWorkspace.html | 62 +-
Headers/gnustep/gui/NSGraphicsContext.h | 21 +-
Headers/gnustep/gui/NSPrintInfo.h | 17 +-
Headers/gnustep/gui/NSPrintOperation.h | 11 +-
Headers/gnustep/gui/NSView.h | 9 +-
Source/NSFont.m | 21 +-
Source/NSGraphicsContext.m | 43 +-
Source/NSPageLayout.m | 4 +-
Source/NSPrintInfo.m | 128 ++--
Source/NSPrintOperation.m | 586 +++++++++++++++++-
Source/NSPrintPanel.m | 23 +-
Source/NSView.m | 306 ++++++++-
Source/externs.m | 15 +
119 files changed, 4892 insertions(+), 3621 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c8f01366d..d33c89762 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,42 @@
+2001-11-08 Adam Fedor
+
+ * Simple printing/pagination implementation
+ * Headers/gnustep/gui/NSGraphicsContext.h: Add some constants
+ * Source/NSFont.m (+useFont:): Same font name in static NSSet
+ (+resetUsedFonts): Implement
+ (+usedFonts): Likewise.
+ * Source/NSGraphicsContext.m (+defaultContextWithInfo:) Depreciated,
+ calls +graphicsContextWithAttributes:.
+ (+graphicsContextWithAttributes:): Creates default context class.
+ (+useFont:): Removed.
+ * Source/NSPrintInfo.m (-setOrienatation:) Set paper size accordingly.
+ (-setPaperName:): Likewise.
+ (-setPaperSize:): Set orientation.
+ (+initPrintInfoDefaults): Rewrite.
+ * Source/NSPrintOperation.m (-_setupPrintInfo): New private.
+ (-_printPaginateWithInfo:knowsRange:): Likewise.
+ (-_rectForPage:info:): Likewise.
+ (-_adjustPagesFirst:last:info:): Likewise.
+ (-_print): Rewrite for pagination, printing.
+ ([NSView -_displayPageInRect:atPlacement:withInfo:]): New private.
+ ([NSView -_endSheet): Likewise.
+ * Source/NSPrintPanel.m: Fix layout settings.
+ * Source/NSView.m (-printJobTitle): Implement.
+ (-locationOfPrintRect:, beginPage:label:bBox:fonts:,
+ beginPageSetupRect:placement:, beginPrologueBBox:..., beginSetup,
+ beginTrailer, endHeaderComments, endPrologue, endSetup, endPage,
+ endTrailer, beginDocument, beginPageInRect:atPlacement:, endDocument):
+ Likewise.
+
2001-11-08 Laurent Julliard
+
* Headers/gnustep/gui/NSGraphics.h
* Source/Functions.m
* Source/NSImageCell.m:
NSDrawFramePhoto added. Needed by the ImageView inspector in Gorm
2001-11-06 Pierre-Yves Rivaille
+
* Source/NSTableView.m [- sizeToFit]: replaced floorf with floor
suggestion from Stephen Brandon
diff --git a/Documentation/gsdoc/GNUmakefile b/Documentation/gsdoc/GNUmakefile
index 5e7d09125..476ad7a15 100644
--- a/Documentation/gsdoc/GNUmakefile
+++ b/Documentation/gsdoc/GNUmakefile
@@ -134,12 +134,27 @@ Gui_GSDOC_FILES = Gui.gsdoc \
NSWindowController.gsdoc \
NSWorkspace.gsdoc
+# These gsdoc files are automatically generated from class source/headers
+Gui_AUTOGSDOC_FILES = \
+NSPageLayout.gsdoc \
+NSPrintInfo.gsdoc \
+NSPrintOperation.gsdoc \
+NSPrintPanel.gsdoc
+
+Gui_AUTOGSDOC_HEADERS = $(addprefix ../../Headers/gnustep/gui/, $(addsuffix .h, $(basename $(Gui_AUTOGSDOC_FILES))))
+
Gui_DOC_INSTALL_DIR = Developer/Gui/Reference
--include Makefile.preamble
+-include GNUmakefile.preamble
-include GNUmakefile.local
include $(GNUSTEP_MAKEFILES)/documentation.make
--include Makefile.postamble
+-include GNUmakefile.postamble
+
+autogen : $(Gui_AUTOGSDOC_FILES)
+
+$(Gui_AUTOGSDOC_FILES) : $(Gui_AUTOGSDOC_HEADERS)
+ autogsdoc -DocumentationDirectory . \
+ -SourceDirectory ../../Source $^
diff --git a/Documentation/gsdoc/Gui.html b/Documentation/gsdoc/Gui.html
index cbe811cb9..942291a62 100644
--- a/Documentation/gsdoc/Gui.html
+++ b/Documentation/gsdoc/Gui.html
@@ -25,113 +25,113 @@
methods and the arguments they take -
There is also documentation on various GUI functions.
-[Up]
-[Next]
+[Up]
+[Next]
Introduction to the AppKit
Authors
@@ -20,12 +20,12 @@
Contents
diff --git a/Documentation/gsdoc/NSActionCell.html b/Documentation/gsdoc/NSActionCell.html
index 9b59b73e7..01dfec63a 100644
--- a/Documentation/gsdoc/NSActionCell.html
+++ b/Documentation/gsdoc/NSActionCell.html
@@ -2,9 +2,9 @@
NSActionCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSActionCell
Authors
@@ -27,26 +27,26 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSAffineTransform.html b/Documentation/gsdoc/NSAffineTransform.html
index e0675dffa..4761e6238 100644
--- a/Documentation/gsdoc/NSAffineTransform.html
+++ b/Documentation/gsdoc/NSAffineTransform.html
@@ -2,9 +2,9 @@
NSAffineTransform
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSAffineTransform
Authors
@@ -27,23 +27,23 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSApplication.html b/Documentation/gsdoc/NSApplication.html
index 37ddc2514..5fd3b1eef 100644
--- a/Documentation/gsdoc/NSApplication.html
+++ b/Documentation/gsdoc/NSApplication.html
@@ -2,9 +2,9 @@
NSApplication
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSApplication
Authors
@@ -27,94 +27,94 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSAttributedStrngAdds.html b/Documentation/gsdoc/NSAttributedStrngAdds.html
index 938a7cc4b..0bd83720b 100644
--- a/Documentation/gsdoc/NSAttributedStrngAdds.html
+++ b/Documentation/gsdoc/NSAttributedStrngAdds.html
@@ -2,9 +2,9 @@
NSAttributedStrngAdds
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSAttributedStrngAdds
Authors
diff --git a/Documentation/gsdoc/NSBezierPath.html b/Documentation/gsdoc/NSBezierPath.html
index 85a2eecbb..b945a1ceb 100644
--- a/Documentation/gsdoc/NSBezierPath.html
+++ b/Documentation/gsdoc/NSBezierPath.html
@@ -2,9 +2,9 @@
NSBezierPath
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBezierPath
Authors
@@ -27,61 +27,61 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSBitmapImageRep.html b/Documentation/gsdoc/NSBitmapImageRep.html
index 7e690eb07..34f0021ea 100644
--- a/Documentation/gsdoc/NSBitmapImageRep.html
+++ b/Documentation/gsdoc/NSBitmapImageRep.html
@@ -2,9 +2,9 @@
NSBitmapImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBitmapImageRep
Authors
@@ -27,30 +27,30 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSBox.html b/Documentation/gsdoc/NSBox.html
index 252a0041a..ca2c764ee 100644
--- a/Documentation/gsdoc/NSBox.html
+++ b/Documentation/gsdoc/NSBox.html
@@ -2,9 +2,9 @@
NSBox
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBox
Authors
@@ -27,24 +27,24 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSBrowser.html b/Documentation/gsdoc/NSBrowser.html
index 93c07bb98..b11d84d22 100644
--- a/Documentation/gsdoc/NSBrowser.html
+++ b/Documentation/gsdoc/NSBrowser.html
@@ -2,9 +2,9 @@
NSBrowser
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBrowser
Authors
@@ -27,92 +27,92 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSBrowserCell.html b/Documentation/gsdoc/NSBrowserCell.html
index 71742fdfe..d7fba4be6 100644
--- a/Documentation/gsdoc/NSBrowserCell.html
+++ b/Documentation/gsdoc/NSBrowserCell.html
@@ -2,9 +2,9 @@
NSBrowserCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBrowserCell
Authors
@@ -27,16 +27,16 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSBundleAdditions.html b/Documentation/gsdoc/NSBundleAdditions.html
index a4702c372..8be1d0ca5 100644
--- a/Documentation/gsdoc/NSBundleAdditions.html
+++ b/Documentation/gsdoc/NSBundleAdditions.html
@@ -2,9 +2,9 @@
NSBundleAdditions
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSBundleAdditions
Authors
@@ -25,11 +25,11 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSButton.html b/Documentation/gsdoc/NSButton.html
index ef2cc5790..a6896b664 100644
--- a/Documentation/gsdoc/NSButton.html
+++ b/Documentation/gsdoc/NSButton.html
@@ -2,9 +2,9 @@
NSButton
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSButton
Authors
@@ -27,45 +27,45 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSButtonCell.html b/Documentation/gsdoc/NSButtonCell.html
index 9ea9aedc4..e3604ee83 100644
--- a/Documentation/gsdoc/NSButtonCell.html
+++ b/Documentation/gsdoc/NSButtonCell.html
@@ -2,9 +2,9 @@
NSButtonCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSButtonCell
Authors
@@ -27,54 +27,54 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSCachedImageRep.html b/Documentation/gsdoc/NSCachedImageRep.html
index 2d01e55f2..551ac011f 100644
--- a/Documentation/gsdoc/NSCachedImageRep.html
+++ b/Documentation/gsdoc/NSCachedImageRep.html
@@ -2,9 +2,9 @@
NSCachedImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSCachedImageRep
Authors
@@ -27,10 +27,10 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSCell.html b/Documentation/gsdoc/NSCell.html
index 15a4e396d..a9b978259 100644
--- a/Documentation/gsdoc/NSCell.html
+++ b/Documentation/gsdoc/NSCell.html
@@ -2,9 +2,9 @@
NSCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSCell
Authors
@@ -27,118 +27,118 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSClipView.html b/Documentation/gsdoc/NSClipView.html
index 8471cc071..a225ccce3 100644
--- a/Documentation/gsdoc/NSClipView.html
+++ b/Documentation/gsdoc/NSClipView.html
@@ -2,9 +2,9 @@
NSClipView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSClipView
Authors
@@ -27,34 +27,34 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSCoderAdditions.html b/Documentation/gsdoc/NSCoderAdditions.html
index 73ab7e760..0eb7d26a1 100644
--- a/Documentation/gsdoc/NSCoderAdditions.html
+++ b/Documentation/gsdoc/NSCoderAdditions.html
@@ -2,9 +2,9 @@
NSCoderAdditions
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSCoderAdditions
Authors
@@ -25,7 +25,7 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSColor.html b/Documentation/gsdoc/NSColor.html
index 1f193ebed..8f1e8e84c 100644
--- a/Documentation/gsdoc/NSColor.html
+++ b/Documentation/gsdoc/NSColor.html
@@ -2,9 +2,9 @@
NSColor
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSColor
Authors
@@ -27,87 +27,87 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSColorList.html b/Documentation/gsdoc/NSColorList.html
index 716458ddc..6435c4c17 100644
--- a/Documentation/gsdoc/NSColorList.html
+++ b/Documentation/gsdoc/NSColorList.html
@@ -2,9 +2,9 @@
NSColorList
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSColorList
Authors
@@ -27,19 +27,19 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSColorPanel.html b/Documentation/gsdoc/NSColorPanel.html
index 143a9aa3f..4c978680f 100644
--- a/Documentation/gsdoc/NSColorPanel.html
+++ b/Documentation/gsdoc/NSColorPanel.html
@@ -2,9 +2,9 @@
NSColorPanel
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSColorPanel
Authors
@@ -27,27 +27,27 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSColorPicker.html b/Documentation/gsdoc/NSColorPicker.html
index cd168101a..7e0edc09f 100644
--- a/Documentation/gsdoc/NSColorPicker.html
+++ b/Documentation/gsdoc/NSColorPicker.html
@@ -2,9 +2,9 @@
NSColorPicker
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSColorPicker
Authors
@@ -27,14 +27,14 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSColorWell.html b/Documentation/gsdoc/NSColorWell.html
index ed5e41b5b..ac187586a 100644
--- a/Documentation/gsdoc/NSColorWell.html
+++ b/Documentation/gsdoc/NSColorWell.html
@@ -2,9 +2,9 @@
NSColorWell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSColorWell
Authors
@@ -27,15 +27,15 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSComboBox.html b/Documentation/gsdoc/NSComboBox.html
index 30647e2e2..5eb26f5b5 100644
--- a/Documentation/gsdoc/NSComboBox.html
+++ b/Documentation/gsdoc/NSComboBox.html
@@ -2,9 +2,9 @@
NSComboBox
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSComboBox
Authors
@@ -27,41 +27,41 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSComboBoxCell.html b/Documentation/gsdoc/NSComboBoxCell.html
index 26835f7c4..96a596f32 100644
--- a/Documentation/gsdoc/NSComboBoxCell.html
+++ b/Documentation/gsdoc/NSComboBoxCell.html
@@ -2,9 +2,9 @@
NSComboBoxCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSComboBoxCell
Authors
@@ -27,42 +27,42 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSControl.html b/Documentation/gsdoc/NSControl.html
index e44c3cdb4..840b16531 100644
--- a/Documentation/gsdoc/NSControl.html
+++ b/Documentation/gsdoc/NSControl.html
@@ -2,9 +2,9 @@
NSControl
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSControl
Authors
@@ -27,73 +27,73 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSCursor.html b/Documentation/gsdoc/NSCursor.html
index de4f2cb3e..ed6670069 100644
--- a/Documentation/gsdoc/NSCursor.html
+++ b/Documentation/gsdoc/NSCursor.html
@@ -2,9 +2,9 @@
NSCursor
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSCursor
Authors
@@ -27,26 +27,26 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSCustomImageRep.html b/Documentation/gsdoc/NSCustomImageRep.html
index 894fe8711..4196bde1e 100644
--- a/Documentation/gsdoc/NSCustomImageRep.html
+++ b/Documentation/gsdoc/NSCustomImageRep.html
@@ -2,9 +2,9 @@
NSCustomImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSCustomImageRep
Authors
@@ -27,9 +27,9 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSDPSContext.html b/Documentation/gsdoc/NSDPSContext.html
index 76cedb40a..644af0026 100644
--- a/Documentation/gsdoc/NSDPSContext.html
+++ b/Documentation/gsdoc/NSDPSContext.html
@@ -2,9 +2,9 @@
NSDPSContext
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSDPSContext
Authors
@@ -27,47 +27,47 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSDocument.html b/Documentation/gsdoc/NSDocument.html
index 36140e769..d2a288275 100644
--- a/Documentation/gsdoc/NSDocument.html
+++ b/Documentation/gsdoc/NSDocument.html
@@ -2,9 +2,9 @@
NSDocument
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSDocument
Authors
@@ -27,56 +27,56 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSDocumentController.html b/Documentation/gsdoc/NSDocumentController.html
index 9f281ea17..c92839997 100644
--- a/Documentation/gsdoc/NSDocumentController.html
+++ b/Documentation/gsdoc/NSDocumentController.html
@@ -2,9 +2,9 @@
NSDocumentController
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSDocumentController
Authors
@@ -27,31 +27,31 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSEPSImageRep.html b/Documentation/gsdoc/NSEPSImageRep.html
index 7961c07e2..e8c8f14ac 100644
--- a/Documentation/gsdoc/NSEPSImageRep.html
+++ b/Documentation/gsdoc/NSEPSImageRep.html
@@ -2,9 +2,9 @@
NSEPSImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSEPSImageRep
Authors
@@ -27,11 +27,11 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSEvent.html b/Documentation/gsdoc/NSEvent.html
index ceafa36b2..d600ca59b 100644
--- a/Documentation/gsdoc/NSEvent.html
+++ b/Documentation/gsdoc/NSEvent.html
@@ -2,9 +2,9 @@
NSEvent
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSEvent
Authors
@@ -27,30 +27,30 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSFileWrapper.html b/Documentation/gsdoc/NSFileWrapper.html
index 96fae0232..512ca42a0 100644
--- a/Documentation/gsdoc/NSFileWrapper.html
+++ b/Documentation/gsdoc/NSFileWrapper.html
@@ -2,9 +2,9 @@
NSFileWrapper
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSFileWrapper
Authors
@@ -27,35 +27,35 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSFont.html b/Documentation/gsdoc/NSFont.html
index 449f20711..d83eb1f9d 100644
--- a/Documentation/gsdoc/NSFont.html
+++ b/Documentation/gsdoc/NSFont.html
@@ -2,9 +2,9 @@
NSFont
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSFont
Authors
@@ -27,58 +27,58 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSFontManager.html b/Documentation/gsdoc/NSFontManager.html
index 923563672..0ae596369 100644
--- a/Documentation/gsdoc/NSFontManager.html
+++ b/Documentation/gsdoc/NSFontManager.html
@@ -2,9 +2,9 @@
NSFontManager
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSFontManager
Authors
@@ -27,45 +27,45 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSFontPanel.html b/Documentation/gsdoc/NSFontPanel.html
index 02dddc34c..9ac68a2b6 100644
--- a/Documentation/gsdoc/NSFontPanel.html
+++ b/Documentation/gsdoc/NSFontPanel.html
@@ -2,9 +2,9 @@
NSFontPanel
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSFontPanel
Authors
@@ -27,15 +27,15 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSForm.html b/Documentation/gsdoc/NSForm.html
index 23bbbcf34..b89aa892b 100644
--- a/Documentation/gsdoc/NSForm.html
+++ b/Documentation/gsdoc/NSForm.html
@@ -2,9 +2,9 @@
NSForm
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSForm
Authors
@@ -27,22 +27,22 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSFormCell.html b/Documentation/gsdoc/NSFormCell.html
index c3776d048..908a7b6ee 100644
--- a/Documentation/gsdoc/NSFormCell.html
+++ b/Documentation/gsdoc/NSFormCell.html
@@ -2,9 +2,9 @@
NSFormCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSFormCell
Authors
@@ -27,20 +27,20 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSGraphicsContext.html b/Documentation/gsdoc/NSGraphicsContext.html
index 38ef4fafb..0a0aa9bfd 100644
--- a/Documentation/gsdoc/NSGraphicsContext.html
+++ b/Documentation/gsdoc/NSGraphicsContext.html
@@ -2,9 +2,9 @@
NSGraphicsContext
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSGraphicsContext
Authors
@@ -27,14 +27,14 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSHelpManager.html b/Documentation/gsdoc/NSHelpManager.html
index 70b4dda29..088bde95d 100644
--- a/Documentation/gsdoc/NSHelpManager.html
+++ b/Documentation/gsdoc/NSHelpManager.html
@@ -2,9 +2,9 @@
NSHelpManager
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSHelpManager
Authors
@@ -27,13 +27,13 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSImage.html b/Documentation/gsdoc/NSImage.html
index a6011ad43..5f0fc9d72 100644
--- a/Documentation/gsdoc/NSImage.html
+++ b/Documentation/gsdoc/NSImage.html
@@ -2,9 +2,9 @@
NSImage
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSImage
Authors
@@ -27,61 +27,61 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSImageCell.html b/Documentation/gsdoc/NSImageCell.html
index 1d444523b..34829dfad 100644
--- a/Documentation/gsdoc/NSImageCell.html
+++ b/Documentation/gsdoc/NSImageCell.html
@@ -2,9 +2,9 @@
NSImageCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSImageCell
Authors
@@ -27,12 +27,12 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSImageRep.html b/Documentation/gsdoc/NSImageRep.html
index 063608427..350992d63 100644
--- a/Documentation/gsdoc/NSImageRep.html
+++ b/Documentation/gsdoc/NSImageRep.html
@@ -2,9 +2,9 @@
NSImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSImageRep
Authors
@@ -27,39 +27,39 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSImageView.html b/Documentation/gsdoc/NSImageView.html
index 891b8da4d..56b87df2a 100644
--- a/Documentation/gsdoc/NSImageView.html
+++ b/Documentation/gsdoc/NSImageView.html
@@ -2,9 +2,9 @@
NSImageView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSImageView
Authors
@@ -27,16 +27,16 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSInputManager.html b/Documentation/gsdoc/NSInputManager.html
index 186c498ca..3e082e6d1 100644
--- a/Documentation/gsdoc/NSInputManager.html
+++ b/Documentation/gsdoc/NSInputManager.html
@@ -2,9 +2,9 @@
NSInputManager
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSInputManager
Authors
@@ -27,12 +27,12 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSInputServer.html b/Documentation/gsdoc/NSInputServer.html
index e49760ba5..04bcd14c1 100644
--- a/Documentation/gsdoc/NSInputServer.html
+++ b/Documentation/gsdoc/NSInputServer.html
@@ -2,9 +2,9 @@
NSInputServer
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSInputServer
Authors
@@ -27,19 +27,19 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSLayoutManager.html b/Documentation/gsdoc/NSLayoutManager.html
index a869a342b..4cc9e1d9d 100644
--- a/Documentation/gsdoc/NSLayoutManager.html
+++ b/Documentation/gsdoc/NSLayoutManager.html
@@ -2,9 +2,9 @@
NSLayoutManager
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSLayoutManager
Authors
@@ -27,89 +27,89 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSMatrix.html b/Documentation/gsdoc/NSMatrix.html
index 58fb7f79d..fd78ec280 100644
--- a/Documentation/gsdoc/NSMatrix.html
+++ b/Documentation/gsdoc/NSMatrix.html
@@ -2,9 +2,9 @@
NSMatrix
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMatrix
Authors
@@ -27,103 +27,103 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSMenu.html b/Documentation/gsdoc/NSMenu.html
index 985b1c2ba..3c6dab8f5 100644
--- a/Documentation/gsdoc/NSMenu.html
+++ b/Documentation/gsdoc/NSMenu.html
@@ -2,9 +2,9 @@
NSMenu
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMenu
Authors
@@ -27,52 +27,52 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSMenuItem.html b/Documentation/gsdoc/NSMenuItem.html
index 3e6577cea..accae4b6c 100644
--- a/Documentation/gsdoc/NSMenuItem.html
+++ b/Documentation/gsdoc/NSMenuItem.html
@@ -2,9 +2,9 @@
NSMenuItem
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMenuItem
Authors
diff --git a/Documentation/gsdoc/NSMenuItemCell.html b/Documentation/gsdoc/NSMenuItemCell.html
index c9404f35f..7b56711ba 100644
--- a/Documentation/gsdoc/NSMenuItemCell.html
+++ b/Documentation/gsdoc/NSMenuItemCell.html
@@ -2,9 +2,9 @@
NSMenuItemCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMenuItemCell
Authors
@@ -27,31 +27,31 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSMenuView.html b/Documentation/gsdoc/NSMenuView.html
index 01cdb1bfd..502787ccf 100644
--- a/Documentation/gsdoc/NSMenuView.html
+++ b/Documentation/gsdoc/NSMenuView.html
@@ -2,9 +2,9 @@
NSMenuView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMenuView
Authors
@@ -27,47 +27,47 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSMutableAttributedStringAdditions.html b/Documentation/gsdoc/NSMutableAttributedStringAdditions.html
index c38e28537..1cfbfcdb3 100644
--- a/Documentation/gsdoc/NSMutableAttributedStringAdditions.html
+++ b/Documentation/gsdoc/NSMutableAttributedStringAdditions.html
@@ -2,9 +2,9 @@
NSMutableAttributedStringAdditions
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMutableAttributedStringAdditions
Authors
@@ -25,16 +25,16 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSMutableParagraphStyle.html b/Documentation/gsdoc/NSMutableParagraphStyle.html
index 038d1bb67..04fcb2996 100644
--- a/Documentation/gsdoc/NSMutableParagraphStyle.html
+++ b/Documentation/gsdoc/NSMutableParagraphStyle.html
@@ -2,9 +2,9 @@
NSMutableParagraphStyle
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSMutableParagraphStyle
Authors
@@ -27,19 +27,19 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSOpenPanel.html b/Documentation/gsdoc/NSOpenPanel.html
index b3a447753..960e269b8 100644
--- a/Documentation/gsdoc/NSOpenPanel.html
+++ b/Documentation/gsdoc/NSOpenPanel.html
@@ -2,9 +2,9 @@
NSOpenPanel
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSOpenPanel
Authors
@@ -27,17 +27,17 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSPICTImageRep.html b/Documentation/gsdoc/NSPICTImageRep.html
index 1c07393bc..db51fbd32 100644
--- a/Documentation/gsdoc/NSPICTImageRep.html
+++ b/Documentation/gsdoc/NSPICTImageRep.html
@@ -2,9 +2,9 @@
NSPICTImageRep
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPICTImageRep
Authors
@@ -27,10 +27,10 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSPageLayout.gsdoc b/Documentation/gsdoc/NSPageLayout.gsdoc
index 76cefbc3f..e78a905e5 100644
--- a/Documentation/gsdoc/NSPageLayout.gsdoc
+++ b/Documentation/gsdoc/NSPageLayout.gsdoc
@@ -1,6 +1,6 @@
-
+
NSPageLayout
@@ -13,21 +13,37 @@
-
- Software documentation for the NSPageLayout class
-
+ NSPageLayout
+
+ NSPageLayout provides a panel that allows the user
+ to specify certain information about the printer and how
+ data is formatted for printing. This includes information
+ about the paper size and orientation. Typically you would
+ create a page layout panel with the
+ [pageLayout]
+ class method. However, the best way to use the panel is
+ to have the application call the runPageLayout: method in
+ the NSApplication object which would both create a standard
+ NSPageLayout panel and display it in a modal loop.
+ This method would be sent up the responder chain if the
+ user clicked on a Page Layout menu item.
+
- NSPageLayout.h
+ ../../Headers/gnustep/gui/NSPageLayout.h
pageLayout
+ Creates and returns a shared instance of the
+ NSPageLayout panel.
accessoryView
+ Returns the accessory view for the page layout
+ panel
@@ -50,62 +66,91 @@
newFactor:
new
+ Convert the old value to a
+ new one based on the current units. This
+ method has been depreciated. It doesn't do anything
+ useful
pickedButton:
sender
+ This method has been depreciated. It doesn't do
+ anything useful.
pickedOrientation:
sender
+ This method has been depreciated. It doesn't do
+ anything useful.
pickedPaperSize:
sender
+ This method has been depreciated. It doesn't do
+ anything useful.
pickedUnits:
sender
+ This method has been depreciated. It doesn't do
+ anything useful.
printInfo
+ Return the NSPrintInfo object that the receiver
+ stores layout information into.
readPrintInfo
+ Updates the receiver panel with information from
+ its NSPrintInfo object
runModal
+ Display the Page Layout panel in a modal loop.
+ Saves any aquired information in the shared
+ NSPrintInfo object. Returns NSCancelButton if
+ the user clicks the Cancel button or NSOKButton
+ otherwise.
runModalWithPrintInfo:
pInfo
+ Display the Page Layout panel in a modal loop.
+ Saves any aquired information in the indicated
+ NSPrintInfo object. Returns NSCancelButton if
+ the user clicks the Cancel button or NSOKButton
+ otherwise.
setAccessoryView:
aView
+ Set the accessory view for the page layout panel
writePrintInfo
+ Writes any layout information set by the user to the
+ receiver's NSPrintInfo object
diff --git a/Documentation/gsdoc/NSPanel.html b/Documentation/gsdoc/NSPanel.html
index f94e67bbb..5258dc240 100644
--- a/Documentation/gsdoc/NSPanel.html
+++ b/Documentation/gsdoc/NSPanel.html
@@ -2,9 +2,9 @@
NSPanel
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPanel
Authors
@@ -27,12 +27,12 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSParagraphStyle.html b/Documentation/gsdoc/NSParagraphStyle.html
index 77728ae2a..094df2e0e 100644
--- a/Documentation/gsdoc/NSParagraphStyle.html
+++ b/Documentation/gsdoc/NSParagraphStyle.html
@@ -2,9 +2,9 @@
NSParagraphStyle
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSParagraphStyle
Authors
@@ -27,17 +27,17 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSPasteboard.html b/Documentation/gsdoc/NSPasteboard.html
index 5ac7ade4a..388e89a23 100644
--- a/Documentation/gsdoc/NSPasteboard.html
+++ b/Documentation/gsdoc/NSPasteboard.html
@@ -2,9 +2,9 @@
NSPasteboard
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPasteboard
Authors
@@ -27,32 +27,32 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSPopUpButton.html b/Documentation/gsdoc/NSPopUpButton.html
index f47989e76..456e470a5 100644
--- a/Documentation/gsdoc/NSPopUpButton.html
+++ b/Documentation/gsdoc/NSPopUpButton.html
@@ -2,9 +2,9 @@
NSPopUpButton
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPopUpButton
Authors
@@ -27,42 +27,42 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSPopUpButtonCell.html b/Documentation/gsdoc/NSPopUpButtonCell.html
index cf146d623..d8cb5f637 100644
--- a/Documentation/gsdoc/NSPopUpButtonCell.html
+++ b/Documentation/gsdoc/NSPopUpButtonCell.html
@@ -2,9 +2,9 @@
NSPopUpButtonCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPopUpButtonCell
Authors
@@ -27,51 +27,51 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSPrintInfo.gsdoc b/Documentation/gsdoc/NSPrintInfo.gsdoc
index 1348489d6..52381f3cd 100644
--- a/Documentation/gsdoc/NSPrintInfo.gsdoc
+++ b/Documentation/gsdoc/NSPrintInfo.gsdoc
@@ -1,23 +1,33 @@
-
-
+
+
NSPrintInfo
-
-
-
+
+ sgf@frankau.demon.co.uk
- $Revision$
- $Date$
+
+ fedor@gnu.org
+
+
+ Stores information used in printing.
+
+ (C) 1996,1997 Free Software Foundation, Inc.
- NSPrintInfo
+ Class Description
+
+ NSPrintInfo is a storage object that stores
+ information that describes how a view is to printed
+ and the destination information for printing.
+
- Gui/NSPrintInfo.h
+ ../../Headers/gnustep/gui/NSPrintInfo.h
NSCoding
-
-
+ NSCopying
+
+
defaultPrinter
@@ -25,7 +35,7 @@
setDefaultPrinter:
- aPrinter
+ printer
@@ -63,7 +73,7 @@
initWithDictionary:
- aDictionary
+ aDict
@@ -114,7 +124,7 @@
setBottomMargin:
- margin
+ value
@@ -138,13 +148,13 @@
setLeftMargin:
- margin
+ value
setOrientation:
- orientation
+ mode
@@ -156,7 +166,7 @@
setPaperSize:
- aSize
+ size
@@ -168,13 +178,13 @@
setRightMargin:
- margin
+ value
setTopMargin:
- margin
+ value
diff --git a/Documentation/gsdoc/NSPrintInfo.html b/Documentation/gsdoc/NSPrintInfo.html
index a4c630325..4eefc0c3b 100644
--- a/Documentation/gsdoc/NSPrintInfo.html
+++ b/Documentation/gsdoc/NSPrintInfo.html
@@ -2,9 +2,9 @@
NSPrintInfo
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPrintInfo
Authors
@@ -27,40 +27,40 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSPrintOperation.gsdoc b/Documentation/gsdoc/NSPrintOperation.gsdoc
index 4492569b5..3f66d92c2 100644
--- a/Documentation/gsdoc/NSPrintOperation.gsdoc
+++ b/Documentation/gsdoc/NSPrintOperation.gsdoc
@@ -1,23 +1,38 @@
-
-
+
+
NSPrintOperation
-
-
-
+
+ FredKiefer@gmx.de
- $Revision$
- $Date$
+
+ fedor@gnu.org
+
+
+ Controls generation of EPS, PDF or PS print jobs.
+
+ (C) 1996 Free Software Foundation, Inc.
- NSPrintOperation
+ Class Description
+
+ NSPrintOperation controls printing of an
+ NSView. When invoked normally it will (optionally)
+ display a standard print panel (NSPrintPanel), and
+ based on the information entered by the user here as well
+ as information about page layout (see NSPageLayout) tells
+ the NSView to print it's contents. NSPrintOperation works
+ with the NSView to paginate the output into appropriately
+ sized and oriented pages and finally delivers the result
+ to the appropriate place, whether it be a printer, and
+ PostScript file, or another output.
+
- Gui/NSPrintOperation.h
- NSObject
-
-
+ ../../Headers/gnustep/gui/NSPrintOperation.h
+
+
EPSOperationWithView:
aView
@@ -52,9 +67,45 @@
+
+ PDFOperationWithView:
+ aView
+ insideRect:
+ rect
+ toData:
+ data
+
+
+
+
+ PDFOperationWithView:
+ aView
+ insideRect:
+ rect
+ toData:
+ data
+ printInfo:
+ aPrintInfo
+
+
+
+
+ PDFOperationWithView:
+ aView
+ insideRect:
+ rect
+ toPath:
+ path
+ printInfo:
+ aPrintInfo
+
+
+
currentOperation
+ Returns the NSPrintOperation object that is
+ currently performing a print operation (if any).
@@ -75,41 +126,67 @@
setCurrentOperation:
operation
+ Set the current NSPrintOperation to the supplied
+ operation object. As this is currently
+ implemented, if a NSPrintOperation is
+ currently running, that operation is
+ lost (along with any associated context), so be
+ careful to call this only when there is no current
+ operation.
accessoryView
+ Returns the accessory view used by the NSPrintPanel
+ associated with the receiver.
cleanUpOperation
+ Called by the print operation and it has finished
+ running a printing operation.
-
+
context
+ Returns the graphic contexts used by the print
+ operation.
-
+
createContext
+ This method is used by the print operation to create a
+ special graphics context for use while running the
+ print operation.
currentPage
+ Returns the page currently being printing. Returns
+ 0 if no page is currently being printed
deliverResult
+ Called by the print operation to deliver the results
+ of the printing operation. This might include sending
+ the output to a printer, a file or a previewing
+ program. Returns YES
if the output
+ was delivered sucessfully.
destroyContext
+ This method is used by the print operation to destroy
+ the special graphic context used while running the
+ print operation.
@@ -132,69 +209,116 @@
+
+ isCopyingOperation
+
+
+
isEPSOperation
+ Returns YES
if the receiver is
+ performing an operation whose output is EPS
+ format.
pageOrder
+ Returns the page order of printing.
printInfo
+ Returns the NSPrintInfo object associated with the
+ receiver.
printPanel
+ Returns the NSPrintPanel associated with the
+ receiver.
runOperation
+ Call this message to run the print operation on a
+ view. This includes (optionally) displaying a print
+ panel and working with the NSView to paginate and
+ draw the contents of the view.
+
+
+
+ runOperationModalForWindow:
+ docWindow
+ delegate:
+ delegate
+ didRunSelector:
+ didRunSelector
+ contextInfo:
+ contextInfo
+
+ Run a print operation modally with respect to a window.
setAccessoryView:
aView
+ Set the accessory view used by the NSPrintPanel
+ associated with the receiver.
setPageOrder:
order
+ Set the page order used when printing.
setPrintInfo:
aPrintInfo
+ Set the NSPrintInfo object associated with the
+ receiver.
setPrintPanel:
panel
+ Sets the NSPrintPanel used by the receiver obtaining
+ and displaying printing information from/to the user.
setShowPanels:
flag
+ Use this to set whether a print panel is displayed
+ during a printing operation. If set to
+ NO
, then the receiver uses information
+ that was previously set and does not display any
+ status information about the progress of the
+ printing operation.
showPanels
+ Returns YES
if the reciever display an
+ NSPrintPanel and other information when
+ running a print operation.
view
+ Return the view that is the being printed.
diff --git a/Documentation/gsdoc/NSPrintOperation.html b/Documentation/gsdoc/NSPrintOperation.html
index 328de3aaa..e55f97769 100644
--- a/Documentation/gsdoc/NSPrintOperation.html
+++ b/Documentation/gsdoc/NSPrintOperation.html
@@ -2,59 +2,79 @@
NSPrintOperation
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPrintOperation
Authors
-- Richard Frith-Macdonald
+
- Fred Kiefer
+
-
+
- Adam Fedor
-
-Version: $Revision$
-Date: $Date$
-
+
+ Controls generation of EPS, PDF or PS print jobs.
+
+Copyright: (C) 1996 Free Software Foundation, Inc.
+
+
+
+ NSPrintOperation controls printing of an
+ NSView. When invoked normally it will (optionally)
+ display a standard print panel (NSPrintPanel), and
+ based on the information entered by the user here as well
+ as information about page layout (see NSPageLayout) tells
+ the NSView to print it's contents. NSPrintOperation works
+ with the NSView to paginate the output into appropriately
+ sized and oriented pages and finally delivers the result
+ to the appropriate place, whether it be a printer, and
+ PostScript file, or another output.
+
-Declared in: Gui/NSPrintOperation.h
+Declared in: ../../Headers/gnustep/gui/NSPrintOperation.h
Inherits from: NSObject
-Conforms to: NSObject
-
-
+
Instance Variables
Methods
Class Methods
@@ -72,130 +92,213 @@
-
-+ (NSPrintOperation*) currentOperation;
+
++ (NSPrintOperation*) PDFOperationWithView: (NSView*)aView insideRect: (NSRect)rect toData: (NSMutableData*)data;
-
+
++ (NSPrintOperation*) PDFOperationWithView: (NSView*)aView insideRect: (NSRect)rect toData: (NSMutableData*)data printInfo: (NSPrintInfo*)aPrintInfo;
+
+
+
+
++ (NSPrintOperation*) PDFOperationWithView: (NSView*)aView insideRect: (NSRect)rect toPath: (NSString*)path printInfo: (NSPrintInfo*)aPrintInfo;
+
+
+
+
++ (NSPrintOperation*) currentOperation;
+
+ Returns the NSPrintOperation object that is
+ currently performing a print operation (if any).
+
+
+
+ (NSPrintOperation*) printOperationWithView: (NSView*)aView;
-
+
+ (NSPrintOperation*) printOperationWithView: (NSView*)aView printInfo: (NSPrintInfo*)aPrintInfo;
-
+
+ (void) setCurrentOperation: (NSPrintOperation*)operation;
+ Set the current NSPrintOperation to the supplied
+ operation object. As this is currently
+ implemented, if a NSPrintOperation is
+ currently running, that operation is
+ lost (along with any associated context), so be
+ careful to call this only when there is no current
+ operation.
Instances Methods
-
+
- (NSView*) accessoryView;
+ Returns the accessory view used by the NSPrintPanel
+ associated with the receiver.
-
+
- (void) cleanUpOperation;
+ Called by the print operation and it has finished
+ running a printing operation.
-
-- (NSDPSContext*) context;
+
+- (NSGraphicsContext*) context;
+ Returns the graphic contexts used by the print
+ operation.
-
-- (NSDPSContext*) createContext;
+
+- (NSGraphicsContext*) createContext;
+ This method is used by the print operation to create a
+ special graphics context for use while running the
+ print operation.
-
+
- (int) currentPage;
+ Returns the page currently being printing. Returns
+ 0 if no page is currently being printed
-
+
- (BOOL) deliverResult;
+ Called by the print operation to deliver the results
+ of the printing operation. This might include sending
+ the output to a printer, a file or a previewing
+ program. Returns YES
if the output
+ was delivered sucessfully.
-
+
- (void) destroyContext;
+ This method is used by the print operation to destroy
+ the special graphic context used while running the
+ print operation.
-
+
- (id) initEPSOperationWithView: (NSView*)aView insideRect: (NSRect)rect toData: (NSMutableData*)data printInfo: (NSPrintInfo*)aPrintInfo;
-
+
- (id) initWithView: (NSView*)aView printInfo: (NSPrintInfo*)aPrintInfo;
-
+
+- (BOOL) isCopyingOperation;
+
+
+
+
- (BOOL) isEPSOperation;
+ Returns YES
if the receiver is
+ performing an operation whose output is EPS
+ format.
-
+
- (NSPrintingPageOrder) pageOrder;
+ Returns the page order of printing.
-
+
- (NSPrintInfo*) printInfo;
+ Returns the NSPrintInfo object associated with the
+ receiver.
-
+
- (NSPrintPanel*) printPanel;
+ Returns the NSPrintPanel associated with the
+ receiver.
-
+
- (BOOL) runOperation;
+ Call this message to run the print operation on a
+ view. This includes (optionally) displaying a print
+ panel and working with the NSView to paginate and
+ draw the contents of the view.
-
+
+- (void) runOperationModalForWindow: (NSWindow*)docWindow delegate: (id)delegate didRunSelector: (SEL)didRunSelector contextInfo: (void*)contextInfo;
+
+ Run a print operation modally with respect to a window.
+
+
+
- (void) setAccessoryView: (NSView*)aView;
+ Set the accessory view used by the NSPrintPanel
+ associated with the receiver.
-
+
- (void) setPageOrder: (NSPrintingPageOrder)order;
+ Set the page order used when printing.
-
+
- (void) setPrintInfo: (NSPrintInfo*)aPrintInfo;
+ Set the NSPrintInfo object associated with the
+ receiver.
-
+
- (void) setPrintPanel: (NSPrintPanel*)panel;
+ Sets the NSPrintPanel used by the receiver obtaining
+ and displaying printing information from/to the user.
-
+
- (void) setShowPanels: (BOOL)flag;
+ Use this to set whether a print panel is displayed
+ during a printing operation. If set to
+ NO
, then the receiver uses information
+ that was previously set and does not display any
+ status information about the progress of the
+ printing operation.
-
+
- (BOOL) showPanels;
+ Returns YES
if the reciever display an
+ NSPrintPanel and other information when
+ running a print operation.
-
+
- (NSView*) view;
+ Return the view that is the being printed.
diff --git a/Documentation/gsdoc/NSPrintPanel.gsdoc b/Documentation/gsdoc/NSPrintPanel.gsdoc
index 5608ce316..539328a5e 100644
--- a/Documentation/gsdoc/NSPrintPanel.gsdoc
+++ b/Documentation/gsdoc/NSPrintPanel.gsdoc
@@ -1,6 +1,6 @@
-
+
NSPrintPanel
@@ -29,7 +29,7 @@
with a NO
argument.
- NSPrintPanel.h
+ ../../Headers/gnustep/gui/NSPrintPanel.h
diff --git a/Documentation/gsdoc/NSPrinter.html b/Documentation/gsdoc/NSPrinter.html
index c9be5b4a5..933a8af36 100644
--- a/Documentation/gsdoc/NSPrinter.html
+++ b/Documentation/gsdoc/NSPrinter.html
@@ -2,9 +2,9 @@
NSPrinter
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSPrinter
Authors
@@ -27,33 +27,33 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSProgressIndicator.html b/Documentation/gsdoc/NSProgressIndicator.html
index dc0b993a4..3292f8b98 100644
--- a/Documentation/gsdoc/NSProgressIndicator.html
+++ b/Documentation/gsdoc/NSProgressIndicator.html
@@ -2,9 +2,9 @@
NSProgressIndicator
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSProgressIndicator
Authors
@@ -27,24 +27,24 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSResponder.html b/Documentation/gsdoc/NSResponder.html
index 67068f812..c95cc5cc2 100644
--- a/Documentation/gsdoc/NSResponder.html
+++ b/Documentation/gsdoc/NSResponder.html
@@ -2,9 +2,9 @@
NSResponder
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSResponder
Authors
@@ -27,97 +27,97 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSRulerMarker.html b/Documentation/gsdoc/NSRulerMarker.html
index 094d2c6c8..282ae8b6e 100644
--- a/Documentation/gsdoc/NSRulerMarker.html
+++ b/Documentation/gsdoc/NSRulerMarker.html
@@ -2,9 +2,9 @@
NSRulerMarker
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSRulerMarker
Authors
@@ -27,25 +27,25 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSRulerView.html b/Documentation/gsdoc/NSRulerView.html
index c0fccd11e..c3dbd7708 100644
--- a/Documentation/gsdoc/NSRulerView.html
+++ b/Documentation/gsdoc/NSRulerView.html
@@ -2,9 +2,9 @@
NSRulerView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSRulerView
Authors
@@ -27,48 +27,48 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSSavePanel.html b/Documentation/gsdoc/NSSavePanel.html
index 810cd9c57..6ae727bd3 100644
--- a/Documentation/gsdoc/NSSavePanel.html
+++ b/Documentation/gsdoc/NSSavePanel.html
@@ -2,9 +2,9 @@
NSSavePanel
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSavePanel
Authors
@@ -24,29 +24,29 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSScreen.html b/Documentation/gsdoc/NSScreen.html
index 082e6e5a1..8094b5982 100644
--- a/Documentation/gsdoc/NSScreen.html
+++ b/Documentation/gsdoc/NSScreen.html
@@ -2,9 +2,9 @@
NSScreen
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSScreen
Authors
@@ -27,14 +27,14 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSScrollView.html b/Documentation/gsdoc/NSScrollView.html
index 1bbc2e6ce..f9eb0e52e 100644
--- a/Documentation/gsdoc/NSScrollView.html
+++ b/Documentation/gsdoc/NSScrollView.html
@@ -2,9 +2,9 @@
NSScrollView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSScrollView
Authors
@@ -27,58 +27,58 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSScroller.html b/Documentation/gsdoc/NSScroller.html
index d0f7c61f4..e70f644c0 100644
--- a/Documentation/gsdoc/NSScroller.html
+++ b/Documentation/gsdoc/NSScroller.html
@@ -2,9 +2,9 @@
NSScroller
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSScroller
Authors
@@ -27,23 +27,23 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSSecureTextField.html b/Documentation/gsdoc/NSSecureTextField.html
index 8f5b175c3..1a1dcc350 100644
--- a/Documentation/gsdoc/NSSecureTextField.html
+++ b/Documentation/gsdoc/NSSecureTextField.html
@@ -2,9 +2,9 @@
NSSecureTextField
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSecureTextField
Authors
diff --git a/Documentation/gsdoc/NSSecureTextFieldCell.html b/Documentation/gsdoc/NSSecureTextFieldCell.html
index 7207d9df6..a50e5a05f 100644
--- a/Documentation/gsdoc/NSSecureTextFieldCell.html
+++ b/Documentation/gsdoc/NSSecureTextFieldCell.html
@@ -2,9 +2,9 @@
NSSecureTextFieldCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSecureTextFieldCell
Authors
@@ -27,8 +27,8 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSSlider.html b/Documentation/gsdoc/NSSlider.html
index 78f2ff0df..d4b0cd8d4 100644
--- a/Documentation/gsdoc/NSSlider.html
+++ b/Documentation/gsdoc/NSSlider.html
@@ -2,9 +2,9 @@
NSSlider
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSlider
Authors
@@ -58,36 +58,36 @@ Use of an NSSlider to do the role of an NSScroller is not recommended. A
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSSliderCell.html b/Documentation/gsdoc/NSSliderCell.html
index fd4189dea..f3e12ab5a 100644
--- a/Documentation/gsdoc/NSSliderCell.html
+++ b/Documentation/gsdoc/NSSliderCell.html
@@ -2,9 +2,9 @@
NSSliderCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSliderCell
Authors
@@ -42,39 +42,39 @@ An NSSliderCell can be customized through its set...
methods.
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSSpellChecker.html b/Documentation/gsdoc/NSSpellChecker.html
index 5938d7f9b..eb51aaad9 100644
--- a/Documentation/gsdoc/NSSpellChecker.html
+++ b/Documentation/gsdoc/NSSpellChecker.html
@@ -2,9 +2,9 @@
NSSpellChecker
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSpellChecker
Authors
@@ -27,23 +27,23 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSSpellServer.html b/Documentation/gsdoc/NSSpellServer.html
index 98bb9730c..f63117909 100644
--- a/Documentation/gsdoc/NSSpellServer.html
+++ b/Documentation/gsdoc/NSSpellServer.html
@@ -2,9 +2,9 @@
NSSpellServer
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSpellServer
Authors
@@ -27,15 +27,15 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSSplitView.html b/Documentation/gsdoc/NSSplitView.html
index 17fdf03e2..aa21c8656 100644
--- a/Documentation/gsdoc/NSSplitView.html
+++ b/Documentation/gsdoc/NSSplitView.html
@@ -2,9 +2,9 @@
NSSplitView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSSplitView
Authors
@@ -27,13 +27,13 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSStringAdditions.html b/Documentation/gsdoc/NSStringAdditions.html
index cfdcb6df6..e7cf36fa8 100644
--- a/Documentation/gsdoc/NSStringAdditions.html
+++ b/Documentation/gsdoc/NSStringAdditions.html
@@ -2,9 +2,9 @@
NSStringAdditions
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSStringAdditions
Authors
@@ -25,9 +25,9 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTabView.html b/Documentation/gsdoc/NSTabView.html
index b512605f3..bd58f01f4 100644
--- a/Documentation/gsdoc/NSTabView.html
+++ b/Documentation/gsdoc/NSTabView.html
@@ -2,9 +2,9 @@
NSTabView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTabView
Authors
@@ -27,36 +27,36 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTabViewItem.html b/Documentation/gsdoc/NSTabViewItem.html
index 3d2f198b8..fafd9b965 100644
--- a/Documentation/gsdoc/NSTabViewItem.html
+++ b/Documentation/gsdoc/NSTabViewItem.html
@@ -2,9 +2,9 @@
NSTabViewItem
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTabViewItem
Authors
@@ -27,21 +27,21 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTableColumn.html b/Documentation/gsdoc/NSTableColumn.html
index 7d15f056f..445aa07b9 100644
--- a/Documentation/gsdoc/NSTableColumn.html
+++ b/Documentation/gsdoc/NSTableColumn.html
@@ -2,9 +2,9 @@
NSTableColumn
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTableColumn
Authors
@@ -69,26 +69,26 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTableHeaderCell.html b/Documentation/gsdoc/NSTableHeaderCell.html
index d756a6d73..615ed93ff 100644
--- a/Documentation/gsdoc/NSTableHeaderCell.html
+++ b/Documentation/gsdoc/NSTableHeaderCell.html
@@ -2,9 +2,9 @@
NSTableHeaderCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTableHeaderCell
Authors
@@ -27,7 +27,7 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTableHeaderView.html b/Documentation/gsdoc/NSTableHeaderView.html
index 86b2c82dc..996da4939 100644
--- a/Documentation/gsdoc/NSTableHeaderView.html
+++ b/Documentation/gsdoc/NSTableHeaderView.html
@@ -2,9 +2,9 @@
NSTableHeaderView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTableHeaderView
Authors
@@ -27,13 +27,13 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTableView.html b/Documentation/gsdoc/NSTableView.html
index 0e7e64cd4..fe496b931 100644
--- a/Documentation/gsdoc/NSTableView.html
+++ b/Documentation/gsdoc/NSTableView.html
@@ -2,9 +2,9 @@
NSTableView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTableView
Authors
@@ -27,101 +27,101 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSText.html b/Documentation/gsdoc/NSText.html
index 519d4685f..03cc86280 100644
--- a/Documentation/gsdoc/NSText.html
+++ b/Documentation/gsdoc/NSText.html
@@ -2,9 +2,9 @@
NSText
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSText
Authors
@@ -27,79 +27,79 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextAttachment.html b/Documentation/gsdoc/NSTextAttachment.html
index e300675b1..def3eed4b 100644
--- a/Documentation/gsdoc/NSTextAttachment.html
+++ b/Documentation/gsdoc/NSTextAttachment.html
@@ -2,9 +2,9 @@
NSTextAttachment
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextAttachment
Authors
@@ -27,11 +27,11 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextAttachmentCell.html b/Documentation/gsdoc/NSTextAttachmentCell.html
index aa23ad418..644e1d97c 100644
--- a/Documentation/gsdoc/NSTextAttachmentCell.html
+++ b/Documentation/gsdoc/NSTextAttachmentCell.html
@@ -2,9 +2,9 @@
NSTextAttachmentCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextAttachmentCell
Authors
@@ -27,8 +27,8 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextContainer.html b/Documentation/gsdoc/NSTextContainer.html
index 6001bbb2e..478621cd1 100644
--- a/Documentation/gsdoc/NSTextContainer.html
+++ b/Documentation/gsdoc/NSTextContainer.html
@@ -2,9 +2,9 @@
NSTextContainer
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextContainer
Authors
@@ -27,23 +27,23 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextField.html b/Documentation/gsdoc/NSTextField.html
index 3d957fa0e..0df5ba416 100644
--- a/Documentation/gsdoc/NSTextField.html
+++ b/Documentation/gsdoc/NSTextField.html
@@ -2,9 +2,9 @@
NSTextField
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextField
Authors
@@ -27,39 +27,39 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextFieldCell.html b/Documentation/gsdoc/NSTextFieldCell.html
index b3e9d88ec..ab2c9c17b 100644
--- a/Documentation/gsdoc/NSTextFieldCell.html
+++ b/Documentation/gsdoc/NSTextFieldCell.html
@@ -2,9 +2,9 @@
NSTextFieldCell
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextFieldCell
Authors
@@ -27,13 +27,13 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextStorage.html b/Documentation/gsdoc/NSTextStorage.html
index cac01297f..0697bcd75 100644
--- a/Documentation/gsdoc/NSTextStorage.html
+++ b/Documentation/gsdoc/NSTextStorage.html
@@ -2,9 +2,9 @@
NSTextStorage
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextStorage
Authors
@@ -27,19 +27,19 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextTab.html b/Documentation/gsdoc/NSTextTab.html
index c54cd34cf..fbb96cd60 100644
--- a/Documentation/gsdoc/NSTextTab.html
+++ b/Documentation/gsdoc/NSTextTab.html
@@ -2,9 +2,9 @@
NSTextTab
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextTab
Authors
@@ -27,9 +27,9 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSTextView.html b/Documentation/gsdoc/NSTextView.html
index 46c111fa0..d1f737b35 100644
--- a/Documentation/gsdoc/NSTextView.html
+++ b/Documentation/gsdoc/NSTextView.html
@@ -2,9 +2,9 @@
NSTextView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSTextView
Authors
@@ -27,125 +27,125 @@
Methods
Class Methods
diff --git a/Documentation/gsdoc/NSView.gsdoc b/Documentation/gsdoc/NSView.gsdoc
index 659ac10cf..596a2fc0e 100644
--- a/Documentation/gsdoc/NSView.gsdoc
+++ b/Documentation/gsdoc/NSView.gsdoc
@@ -133,6 +133,7 @@
allocateGState
+
Tell the view to maintain a private gstate object which
encapsulates all the information about drawing, such as coordinate
transforms, line widths, etc. If you do not invoke this method,
@@ -140,9 +141,11 @@
Allocating a private gstate may improve the performance of views
that are focused a lot and have a lot of customized drawing
parameters.
+
View subclasses should override the setUpGstate method to set these
custom parameters.
+
diff --git a/Documentation/gsdoc/NSView.html b/Documentation/gsdoc/NSView.html
index 4bdb32003..7122105e8 100644
--- a/Documentation/gsdoc/NSView.html
+++ b/Documentation/gsdoc/NSView.html
@@ -2,9 +2,9 @@
NSView
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSView
Authors
@@ -25,21 +25,27 @@
+
-NSView is an abstract class which provides facilities for drawing in a window and
- receiving events. It is the superclass of many of the visual elements of the GUI.
+NSView is an abstract class which provides facilities for
+ drawing in a window and receiving events. It is the
+ superclass of many of the visual elements of the GUI.
-In order to display itself, a view must be placed in a window (represented by an
- NSWindow object). Within the window is a hierarchy of NSViews, headed by the window's
- content view. Every other view in a window is a descendant of this view.
+In order to display itself, a view must be placed in a
+ window (represented by an NSWindow object). Within the
+ window is a hierarchy of NSViews, headed by the window's
+ content view. Every other view in a window is a descendant
+ of this view.
-Subclasses can override drawRect:
in order to implement their
- appearance. Other methods of NSView and NSResponder can also be overridden to handle
- user generated events.
+Subclasses can override drawRect:
in order
+ to implement their appearance. Other methods of NSView and
+ NSResponder can also be overridden to handle user generated
+ events.
+
Instance Variables
@@ -47,144 +53,144 @@ Subclasses can override drawRect:
in order to implement their
Methods
Class Methods
@@ -261,6 +267,23 @@ Returns YES
if the view object will accept the first click
- (void) allocateGState;
+
+
+ Tell the view to maintain a private gstate object which
+ encapsulates all the information about drawing, such as coordinate
+ transforms, line widths, etc. If you do not invoke this method,
+ a gstate object is constructed each time the view is lockFocused.
+ Allocating a private gstate may improve the performance of views
+ that are focused a lot and have a lot of customized drawing
+ parameters.
+
+
+
+
+ View subclasses should override the setUpGstate method to set these
+ custom parameters.
+
+
@@ -507,6 +530,12 @@ Returns YES
if the view object will accept the first click
- (int) gState;
+ Returns an identifier that represents the view's gstate object,
+ which is used to encapsulate drawing information about the view.
+ Most of the time a gstate object is created from scratch when
+ the view is focused, so if the view is not currently focused or
+ allocateGState has not been called, then this method will
+ return 0.
@@ -677,6 +706,8 @@ Returns whether or not aPoint lies within aRect.
- (void) releaseGState;
+ Frees the gstate object, if there is one. Note that the next time
+ the view is lockFocused, the gstate will be allocated again.
@@ -741,6 +772,8 @@ Standards: NotMacOS-X NotOpenStep
- (void) renewGState;
+ Invalidates the view's gstate object so it will be set up
+ again using setUpGState the next time the view is focused.
diff --git a/Documentation/gsdoc/NSWindow.html b/Documentation/gsdoc/NSWindow.html
index 0cc00fcea..f31039856 100644
--- a/Documentation/gsdoc/NSWindow.html
+++ b/Documentation/gsdoc/NSWindow.html
@@ -2,9 +2,9 @@
NSWindow
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSWindow
Authors
@@ -66,166 +66,166 @@
Methods
Class Methods
@@ -382,6 +382,9 @@
- (void) deminiaturize: (id)sender;
+ Causes the window to deminiaturize. Normally you would not call
+ this method directly. A window is automatically deminiaturized
+ by the user via a mouse cloick event.
@@ -611,6 +614,7 @@
- (BOOL) isMiniaturized;
+ Returns YES
if the window has been miniaturized.
@@ -676,6 +680,8 @@
- (void) miniaturize: (id)sender;
+ Causes the window to miniaturize, that is the window is removed
+ from the screen and it's counterpart (mini)window is displayed.
diff --git a/Documentation/gsdoc/NSWindowController.html b/Documentation/gsdoc/NSWindowController.html
index 7a2d3c906..0d1fd3c73 100644
--- a/Documentation/gsdoc/NSWindowController.html
+++ b/Documentation/gsdoc/NSWindowController.html
@@ -2,9 +2,9 @@
NSWindowController
-[Previous]
-[Up]
-[Next]
+[Previous]
+[Up]
+[Next]
NSWindowController
Authors
@@ -27,27 +27,27 @@
Methods
Instances Methods
diff --git a/Documentation/gsdoc/NSWorkspace.html b/Documentation/gsdoc/NSWorkspace.html
index 209e8d254..de1eaca52 100644
--- a/Documentation/gsdoc/NSWorkspace.html
+++ b/Documentation/gsdoc/NSWorkspace.html
@@ -2,8 +2,8 @@
NSWorkspace
-[Previous]
-[Up]
+[Previous]
+[Up]
NSWorkspace
Authors
@@ -26,35 +26,35 @@
Methods
Class Methods
diff --git a/Headers/gnustep/gui/NSGraphicsContext.h b/Headers/gnustep/gui/NSGraphicsContext.h
index b5c37000b..d21397928 100644
--- a/Headers/gnustep/gui/NSGraphicsContext.h
+++ b/Headers/gnustep/gui/NSGraphicsContext.h
@@ -1,8 +1,10 @@
-/* NSGraphicsContext - Generic drawing DrawContext class.
+/** NSGraphicsContext
- Copyright (C) 1998,1999 Free Software Foundation, Inc.
+ Abstract drawing context class.
- Author: Richard Frith-Macdonald
+ Copyright (C) 1998,1999 Free Software Foundation, Inc.
+
+ Author: richard@brainstorm.co.uk
Date: Feb 1999
Based on code by: Adam Fedor
Date: Nov 1998
@@ -226,7 +228,6 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext();
- (void) DPSsetfont: (int)f ;
- (void) DPSundefinefont: (const char*)name ;
- (void) setFont: (NSFont*) font;
-- (void) useFont: (NSString*) name;
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
@@ -538,6 +539,18 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext();
@end
+/* NSGraphicContext constants */
+APPKIT_EXPORT NSString *NSGraphicsContextDestinationAttributeName;
+APPKIT_EXPORT NSString *NSGraphicsContextPDFFormat;
+APPKIT_EXPORT NSString *NSGraphicsContextPSFormat;
+APPKIT_EXPORT NSString *NSGraphicsContextRepresentationFormatAttributeName;
+
+APPKIT_EXPORT NSString *NSImageInterpolationDefault;
+APPKIT_EXPORT NSString *NSImageInterpolationNone;
+APPKIT_EXPORT NSString *NSImageInterpolationLow;
+APPKIT_EXPORT NSString *NSImageInterpolationHigh;
+
+
#endif /* _NSGraphicsContext_h_INCLUDE */
#endif /* STRICT_OPENSTEP */
diff --git a/Headers/gnustep/gui/NSPrintInfo.h b/Headers/gnustep/gui/NSPrintInfo.h
index 549a16e39..f21ffd0fd 100644
--- a/Headers/gnustep/gui/NSPrintInfo.h
+++ b/Headers/gnustep/gui/NSPrintInfo.h
@@ -1,12 +1,13 @@
-/*
- NSPrintInfo.h
+/** NSPrintInfo
- Stores information used in printing
+ Stores information used in printing.
- Copyright (C) 1996,1997 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997 Free Software Foundation, Inc.
- Author: Simon Frankau
+ Author: sgf@frankau.demon.co.uk
Date: July 1997
+ Author: fedor@gnu.org
+ Date: Oct 2001
This file is part of the GNUstep GUI Library.
@@ -121,12 +122,6 @@ typedef enum _NSPrintingPaginationMode {
//
- (NSMutableDictionary *)dictionary;
-//
-// NSCoding protocol
-//
-- (void)encodeWithCoder:aCoder;
-- initWithCoder:aDecoder;
-
@end
//
diff --git a/Headers/gnustep/gui/NSPrintOperation.h b/Headers/gnustep/gui/NSPrintOperation.h
index 4c6cc64de..768b6a086 100644
--- a/Headers/gnustep/gui/NSPrintOperation.h
+++ b/Headers/gnustep/gui/NSPrintOperation.h
@@ -1,15 +1,16 @@
-/*
- NSPrintOperation.h
+/** NSPrintOperation
- Controls operations generating EPS, PDF or PS print jobs.
+ Controls generation of EPS, PDF or PS print jobs.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley
Date: 1996
- Author: Fred Kiefer
+ Author: FredKiefer@gmx.de
Date: November 2000
Updated to new specification
+ Author: fedor@gnu.org
+ Date: Oct 2001
This file is part of the GNUstep GUI Library.
diff --git a/Headers/gnustep/gui/NSView.h b/Headers/gnustep/gui/NSView.h
index af99fd3da..52986ee99 100644
--- a/Headers/gnustep/gui/NSView.h
+++ b/Headers/gnustep/gui/NSView.h
@@ -1,9 +1,8 @@
-/*
- NSView.h
+/** NSView
- The wonderful view class; it encapsulates all drawing functionality
+ Encapsulates all drawing functionality
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley
Date: 1996
@@ -11,6 +10,8 @@
Date: 1997
Author: Felipe A. Rodriguez
Date: August 1998
+ Author:
+ Date: Oct 2001
This file is part of the GNUstep GUI Library.
diff --git a/Source/NSFont.m b/Source/NSFont.m
index 6ff14b2fd..7bb5e1e24 100644
--- a/Source/NSFont.m
+++ b/Source/NSFont.m
@@ -45,6 +45,9 @@ static BOOL boldSystemCacheNeedsRecomputing = NO;
static BOOL userCacheNeedsRecomputing = NO;
static BOOL userFixedCacheNeedsRecomputing = NO;
+/* Set used to keep track of fonts we are using */
+static NSMutableSet *usedFonts = nil;
+
@interface NSFont (Private)
- (id) initWithName: (NSString*)name
matrix: (const float*)fontMatrix;
@@ -394,9 +397,21 @@ setNSFont(NSString* key, NSFont* font)
+ (void) useFont: (NSString*)name
{
- NSGraphicsContext *ctxt = GSCurrentContext();
+ if (usedFonts == nil)
+ usedFonts = RETAIN([NSMutableSet setWithCapacity: 2]);
- [ctxt useFont: name];
+ [usedFonts addObject: name];
+}
+
++ (void) resetUsedFonts
+{
+ if (usedFonts)
+ [usedFonts removeAllObjects];
+}
+
++ (NSSet *) usedFonts
+{
+ return usedFonts;
}
//
@@ -497,7 +512,7 @@ setNSFont(NSString* key, NSFont* font)
NSGraphicsContext *ctxt = GSCurrentContext();
[ctxt setFont: self];
- [ctxt useFont: fontName];
+ [NSFont useFont: fontName];
}
//
diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m
index 76bee0487..75ce67075 100644
--- a/Source/NSGraphicsContext.m
+++ b/Source/NSGraphicsContext.m
@@ -111,18 +111,6 @@ NSGraphicsContext *GSCurrentContext()
defaultNSGraphicsContextClass = defaultContextClass;
}
-+ defaultContextWithInfo: (NSDictionary *)info;
-{
- NSGraphicsContext *ctxt;
-
- NSAssert(defaultNSGraphicsContextClass,
- @"Internal Error: No default NSGraphicsContext set\n");
- ctxt = [[defaultNSGraphicsContextClass allocWithZone: _globalGSZone]
- initWithContextInfo: info];
- AUTORELEASE(ctxt);
- return ctxt;
-}
-
+ (void) setCurrentContext: (NSGraphicsContext *)context
{
#ifdef GNUSTEP_BASE_LIBRARY
@@ -149,10 +137,25 @@ NSGraphicsContext *GSCurrentContext()
return [GSCurrentContext() isDrawingToScreen];
}
-+ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes
++ defaultContextWithInfo: (NSDictionary *)info;
{
- // FIXME: The attributes should determine the concrete class
- return [self defaultContextWithInfo: attributes];
+ return [self graphicsContextWithAttributes: info];
+}
+
++ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)info
+{
+ NSGraphicsContext *ctxt;
+ if (self == [NSGraphicsContext class])
+ {
+ NSAssert(defaultNSGraphicsContextClass,
+ @"Internal Error: No default NSGraphicsContext set\n");
+ ctxt = [[defaultNSGraphicsContextClass allocWithZone: _globalGSZone]
+ initWithContextInfo: info];
+ AUTORELEASE(ctxt);
+ }
+ else
+ ctxt = [[self allocWithZone: _globalGSZone] initWithContextInfo: info];
+ return ctxt;
}
+ (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow
@@ -1170,16 +1173,6 @@ NSGraphicsContext *GSCurrentContext()
[self subclassResponsibility: _cmd];
}
-- (void) useFont: (NSString*) name
-{
- /*
- * Do nothing here, printing subclasses will have to register all
- * the fonts used by the current print operation to be able to
- * dump the %%DocumentFonts comment required by the Adobe Document
- * Structuring Convention (see the red book).
- */
-}
-
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
diff --git a/Source/NSPageLayout.m b/Source/NSPageLayout.m
index ed03ec38f..411a0e00d 100644
--- a/Source/NSPageLayout.m
+++ b/Source/NSPageLayout.m
@@ -194,7 +194,6 @@ static NSPageLayout *shared_instance;
result = [NSApp runModalForWindow: self];
[self orderOut: self];
- NSLog(@"Model Page Layout ended with code %d", result);
return result;
}
@@ -486,8 +485,7 @@ static NSPageLayout *shared_instance;
[_printInfo setOrientation: [control selectedColumn]+NSPortraitOrientation];
/* Write Size */
- /* FIXME: Currently don't allow writing size. What does that mean
- anyway? Shouldn't we set margins instead? */
+ /* FIXME: Currently don't allow writing custom size. */
}
diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m
index 0161b1f27..8bc97512f 100644
--- a/Source/NSPrintInfo.m
+++ b/Source/NSPrintInfo.m
@@ -26,7 +26,9 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include
#include
+#include
#include
#include
#include
@@ -47,6 +49,10 @@
#define NSPrintInfo_DEFAULTSTABLE @"PrintDefaults"
#endif
+#define NSNUMBER(val) [NSNumber numberWithInt: val]
+#define DICTSET(dict, obj, key) \
+ [dict setObject: obj forKey: key]
+
// FIXME: retain/release of dictionary with retain/release of printInfo?
// Class variables:
@@ -58,6 +64,16 @@ NSDictionary *paperSizes = nil;
+ initPrintInfoDefaults;
@end
+/**
+
+ Class Description
+
+ NSPrintInfo is a storage object that stores information that describes
+ how a view is to printed and the destination information for printing.
+
+
+*/
+
@implementation NSPrintInfo
//
@@ -98,28 +114,6 @@ NSDictionary *paperSizes = nil;
+ (NSSize)sizeForPaperName:(NSString *)name
{
return [[self defaultPrinter] pageSizeForPaper:name];
- // Alternatively:
-// NSBundle *adminBundle;
-// NSString *path;
-// NSValue *size;
-// if (!paperSizes)
-// {
-// adminBundle = [NSBundle bundleWithPath:NSPrinterAdmin_PATH];
-// path = [adminBundle pathForResource:NSPrintInfo_PAPERFILE ofType:nil];
-// // If not found
-// if (path == nil || [path length] == 0)
-// {
-// [NSException raise:NSGenericException
-// format:@"Could not find paper size index, file %s",
-// [NSPrintInfo_PAPERFILE cString]];
-// // NOT REACHED
-// }
-// paperSizes = RETAIN([NSDictionary dictionaryWithContentsOfFile:path]);
-// }
-// size = [paperSizes objectForKey:name];
-// if (!size)
-// return NSZeroSize;
-// return [size sizeValue];
}
//
@@ -214,19 +208,41 @@ NSDictionary *paperSizes = nil;
- (void)setOrientation:(NSPrintingOrientation)mode
{
+ NSSize size;
[_info setObject:[NSNumber numberWithInt:mode]
forKey:NSPrintOrientation];
+ /* Set the paper size accordingly */
+ size = [self paperSize];
+ if ((mode == NSPortraitOrientation && size.width > size.height)
+ || (mode == NSLandscapeOrientation && size.width < size.height))
+ {
+ float tmp = size.width;
+ size.width = size.height;
+ size.height = tmp;
+ [_info setObject: [NSValue valueWithSize: size]
+ forKey: NSPrintPaperSize];
+ }
}
- (void)setPaperName:(NSString *)name
{
- [_info setObject:name forKey:NSPrintPaperName];
+ DICTSET(_info, name, NSPrintPaperName);
+ DICTSET(_info,
+ [NSValue valueWithSize: [NSPrintInfo sizeForPaperName: name]],
+ NSPrintPaperSize);
}
- (void)setPaperSize:(NSSize)size
{
+ NSPrintingOrientation orient;
[_info setObject:[NSValue valueWithSize:size]
forKey:NSPrintPaperSize];
+ /* Set orientation accordingly */
+ if (size.width <= size.height)
+ orient = NSPortraitOrientation;
+ else
+ orient = NSLandscapeOrientation;
+ DICTSET(_info, NSNUMBER(orient), NSPrintOrientation);
}
- (void)setRightMargin:(float)value
@@ -369,38 +385,62 @@ NSDictionary *paperSizes = nil;
//
+ initPrintInfoDefaults
{
+ NSString *defPrinter, *str;
NSBundle *adminBundle;
NSString *path;
+ NSPrinter *printer;
adminBundle = [NSBundle bundleWithPath:NSPrinterAdmin_PATH];
path = [adminBundle pathForResource:NSPrintInfo_DEFAULTSTABLE ofType:nil];
- // If not found
+ defPrinter = nil;
if (path != nil && [path length] != 0)
{
- printInfoDefaults = RETAIN([NSMutableDictionary dictionaryWithContentsOfFile:path]);
- // NOT REACHED
+ printInfoDefaults = [NSMutableDictionary dictionaryWithContentsOfFile:path];
+ RETAIN(printInfoDefaults);
+ defPrinter = [printInfoDefaults objectForKey:NSPrintPrinter];
+ printer = [NSPrinter printerWithName: defPrinter];
+ if (printer == nil)
+ defPrinter = nil;
}
if (printInfoDefaults == nil)
{
- NSLog(@"Could not find printing defaults table, file %s",
- [NSPrintInfo_DEFAULTSTABLE cString]);
- // FIXME: As a replacement we add a very simple definition
- printInfoDefaults = RETAIN(([NSMutableDictionary dictionaryWithObjectsAndKeys:
- @"Unknown", NSPrintPrinter,
- @"A4", NSPrintPaperName,
- NULL]));
+ NSDebugLog(@"NSPrinter", @"Could not find printing defaults table, file %@",
+ NSPrintInfo_DEFAULTSTABLE);
+ printInfoDefaults = RETAIN([NSMutableDictionary dictionary]);
+ }
+ if (defPrinter == nil)
+ {
+ defPrinter = [[NSPrinter printerNames] objectAtIndex: 0];
+ DICTSET(printInfoDefaults, defPrinter, NSPrintPrinter);
}
- // The loaded dictionary contains the name of the printer for NSPrintPrinter
- // Load the real NSPrinter object...
- [printInfoDefaults
- setObject:[NSPrinter printerWithName:[printInfoDefaults
- objectForKey:NSPrintPrinter]]
- forKey:NSPrintPrinter];
- [printInfoDefaults
- setObject:[NSValue valueWithSize:
- [NSPrintInfo sizeForPaperName:
- [printInfoDefaults objectForKey:NSPrintPaperName]]]
- forKey:NSPrintPaperSize];
+ /* Replace the printer name with a real NSPrinter object */
+ printer = [NSPrinter printerWithName: defPrinter];
+ DICTSET(printInfoDefaults, [NSPrinter printerWithName: defPrinter], NSPrintPrinter);
+
+ /* Set up other defaults from the printer object */
+ str = [printer stringForKey:@"DefaultPageSize" inTable: @"PPD"];
+ /* FIXME: Need to check for AutoSelect and probably a million other things... */
+ if (str == nil)
+ str = @"A4";
+ DICTSET(printInfoDefaults, str, NSPrintPaperName);
+ DICTSET(printInfoDefaults,
+ [NSValue valueWithSize: [NSPrintInfo sizeForPaperName: str]],
+ NSPrintPaperSize);
+
+ /* Set default margins. FIXME: Probably should check ImageableArea */
+ DICTSET(printInfoDefaults, NSNUMBER(36), NSPrintRightMargin);
+ DICTSET(printInfoDefaults, NSNUMBER(36), NSPrintLeftMargin);
+ DICTSET(printInfoDefaults, NSNUMBER(72), NSPrintTopMargin);
+ DICTSET(printInfoDefaults, NSNUMBER(72), NSPrintBottomMargin);
+ DICTSET(printInfoDefaults, NSNUMBER(NSPortraitOrientation),
+ NSPrintOrientation);
+ //DICTSET(printInfoDefaults, NSNUMBER(NSClipPagination),
+ // NSPrintHorizontalPagination);
+ DICTSET(printInfoDefaults, NSNUMBER(NSAutoPagination),
+ NSPrintVerticalPagination);
+ DICTSET(printInfoDefaults, NSNUMBER(1), NSPrintHorizontallyCentered);
+ DICTSET(printInfoDefaults, NSNUMBER(1), NSPrintVerticallyCentered);
+
return self;
}
diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m
index 2ca00b9b2..c590297bc 100644
--- a/Source/NSPrintOperation.m
+++ b/Source/NSPrintOperation.m
@@ -29,27 +29,46 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include
#include
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
#include
-@interface NSGraphicsContext (Printing)
+#define NSNUMBER(a) [NSNumber numberWithInt: (a)]
+#define NSFNUMBER(a) [NSNumber numberWithFloat: (a)]
-+ (NSGraphicsContext*) postscriptContextWithInfo: (NSDictionary*)info;
-
-@end
+/* Local pagination variables needed while printing */
+typedef struct _page_info_t {
+ NSRect scaledBounds; /* View's rect scaled by the user specified scale
+ and page fitting */
+ NSRect paperBounds; /* Print area of a page in default user space, possibly
+ rotated if printing Landscape */
+ NSRect sheetBounds; /* Print are of a page in default user space */
+ NSSize paperSize; /* Size of the paper */
+ int xpages, ypages;
+ int first, last;
+ double pageScale; /* Scaling determined from page fitting */
+ double printScale; /* User specified scaling */
+ double nupScale; /* Scale required to fit nup pages on the sheet */
+ int nup; /* Number up pages to print on a sheet */
+ double lastWidth, lastHeight;
+ NSPrintingOrientation orient;
+} page_info_t;
@interface NSPrintOperation (Private)
@@ -62,6 +81,13 @@
@end
+@interface NSView (NSPrintOperation)
+- (void) _displayPageInRect: (NSRect)pageRect
+ atPlacement: (NSPoint)location
+ withInfo: (page_info_t)info;
+- (void) _endSheet;
+@end
+
// Subclass for the regular printing
@interface GSPrintOperation: NSPrintOperation
{
@@ -99,6 +125,21 @@
static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
+/**
+
+ Class Description
+
+ NSPrintOperation controls printing of an NSView. When invoked normally
+ it will (optionally) display a standard print panel (NSPrintPanel), and
+ based on the information entered by the user here as well as information
+ about page layout (see NSPageLayout) tells the NSView to print it's
+ contents. NSPrintOperation works with the NSView to paginate the output
+ into appropriately sized and oriented pages and finally delivers the result
+ to the appropriate place, whether it be a printer, and PostScript file,
+ or another output.
+
+
+*/
@implementation NSPrintOperation
//
@@ -196,6 +237,9 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Setting the Print Operation
//
+/** Returns the NSPrintOperation object that is currently performing
+ a print operation (if any).
+*/
+ (NSPrintOperation *)currentOperation
{
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
@@ -203,6 +247,12 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
return (NSPrintOperation*)[dict objectForKey: NSPrintOperationThreadKey];
}
+/** Set the current NSPrintOperation to the supplied operation
+ object. As this is currently implemented, if a NSPrintOperation
+ is currently running, that operation is lost (along with any
+ associated context), so be careful to call this only when there is
+ no current operation.
+*/
+ (void)setCurrentOperation:(NSPrintOperation *)operation
{
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
@@ -258,6 +308,9 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Determining the Type of Operation
//
+/** Returns YES if the receiver is performing an operation whose output
+ is EPS format.
+*/
- (BOOL)isEPSOperation
{
return NO;
@@ -271,6 +324,8 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Controlling the User Interface
//
+/** Returns the NSPrintPanel associated with the receiver.
+ */
- (NSPrintPanel *)printPanel
{
if (_printPanel == nil)
@@ -279,26 +334,42 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
return _printPanel;
}
+/** Returns YES if the reciever display an NSPrintPanel and other information
+ when running a print operation. */
- (BOOL)showPanels
{
return _showPanels;
}
+/** Sets the NSPrintPanel used by the receiver obtaining and displaying
+ printing information from/to the user.
+*/
- (void)setPrintPanel:(NSPrintPanel *)panel
{
ASSIGN(_printPanel, panel);
}
+/** Use this to set whether a print panel is displayed during a printing
+ operation. If set to NO, then the receiver uses information that
+ was previously set and does not display any status information about the
+ progress of the printing operation.
+*/
- (void)setShowPanels:(BOOL)flag
{
_showPanels = flag;
}
+/** Returns the accessory view used by the NSPrintPanel associated with
+ the receiver.
+*/
- (NSView *)accessoryView
{
return _accessoryView;
}
+/** Set the accessory view used by the NSPrintPanel associated with the
+ receiver.
+*/
- (void)setAccessoryView:(NSView *)aView
{
ASSIGN(_accessoryView, aView);
@@ -307,17 +378,25 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Managing the drawing Context
//
+/** This method is used by the print operation to create a special
+ graphics context for use while running the print operation.
+*/
- (NSGraphicsContext*)createContext
{
[self subclassResponsibility: _cmd];
return nil;
}
+/** Returns the graphic contexts used by the print operation.
+*/
- (NSGraphicsContext *)context
{
return _context;
}
+/** This method is used by the print operation to destroy the special
+ graphic context used while running the print operation.
+*/
- (void)destroyContext
{
[_context destroyContext];
@@ -327,16 +406,23 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Page Information
//
+/** Returns the page currently being printing. Returns 0 if no page
+ is currently being printed
+*/
- (int)currentPage
{
return _currentPage;
}
+/** Returns the page order of printing.
+*/
- (NSPrintingPageOrder)pageOrder
{
return _pageOrder;
}
+/** Set the page order used when printing.
+ */
- (void)setPageOrder:(NSPrintingPageOrder)order
{
_pageOrder = order;
@@ -345,18 +431,26 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Running a Print Operation
//
+/** Called by the print operation and it has finished running a printing
+ operation.
+*/
- (void)cleanUpOperation
{
_currentPage = 0;
[NSPrintOperation setCurrentOperation: nil];
}
+/** Called by the print operation to deliver the results of the printing
+ operation. This might include sending the output to a printer, a file
+ or a previewing program. Returns YES if the output was delivered
+ sucessfully.
+*/
- (BOOL)deliverResult
{
- // FIXME
- return YES;
+ return NO;
}
+/* Private method to run the printing operation */
- (BOOL) _runOperation
{
BOOL result;
@@ -367,23 +461,53 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
return NO;
result = NO;
+ if (_pageOrder == NSUnknownPageOrder)
+ {
+ if ([[[_printInfo dictionary] objectForKey: NSPrintReversePageOrder]
+ boolValue] == YES)
+ _pageOrder = NSDescendingPageOrder;
+ else
+ _pageOrder = NSAscendingPageOrder;
+ }
+
[NSGraphicsContext setCurrentContext: _context];
NS_DURING
{
[self _print];
result = YES;
+ [NSGraphicsContext setCurrentContext: oldContext];
}
NS_HANDLER
{
+ [NSGraphicsContext setCurrentContext: oldContext];
NSRunAlertPanel(@"Error", @"Printing error: %@",
@"OK", NULL, NULL, localException);
}
NS_ENDHANDLER
- [NSGraphicsContext setCurrentContext: oldContext];
[self destroyContext];
return result;
}
+- (void) _setupPrintInfo
+{
+ BOOL knowsPageRange;
+ NSRange viewPageRange;
+ NSMutableDictionary *dict = [_printInfo dictionary];
+
+ knowsPageRange = [_view knowsPageRange: &viewPageRange];
+ if (knowsPageRange == YES)
+ {
+ int first = viewPageRange.location;
+ int last = NSMaxRange(viewPageRange) - 1;
+ [dict setObject: NSNUMBER(first) forKey: NSPrintFirstPage];
+ [dict setObject: NSNUMBER(last) forKey: NSPrintLastPage];
+ }
+}
+
+/** Call this message to run the print operation on a view. This includes
+ (optionally) displaying a print panel and working with the NSView to
+ paginate and draw the contents of the view.
+*/
- (BOOL)runOperation
{
BOOL result;
@@ -394,6 +518,7 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
int button;
[panel setAccessoryView: _accessoryView];
+ [self _setupPrintInfo];
[panel updateFromPrintInfo];
button = [panel runModal];
[panel setAccessoryView: nil];
@@ -438,6 +563,8 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
withObject: contextInfo];
}
+/** Run a print operation modally with respect to a window.
+ */
- (void)runOperationModalForWindow: (NSWindow *)docWindow
delegate: (id)delegate
didRunSelector: (SEL)didRunSelector
@@ -457,6 +584,7 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
of _showPanels
*/
[panel setAccessoryView: _accessoryView];
+ [self _setupPrintInfo];
[panel updateFromPrintInfo];
[panel beginSheetWithPrintInfo: _printInfo
modalForWindow: docWindow
@@ -470,11 +598,15 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Getting the NSPrintInfo Object
//
+/** Returns the NSPrintInfo object associated with the receiver.
+*/
- (NSPrintInfo *)printInfo
{
return _printInfo;
}
+/** Set the NSPrintInfo object associated with the receiver.
+ */
- (void)setPrintInfo:(NSPrintInfo *)aPrintInfo
{
if (aPrintInfo == nil)
@@ -486,6 +618,8 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
//
// Getting the NSView Object
//
+/** Return the view that is the being printed.
+*/
- (NSView *)view
{
return _view;
@@ -520,11 +654,246 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
return self;
}
+static NSSize
+scaleSize(NSSize size, double scale)
+{
+ size.height *= scale;
+ size.width *= scale;
+ return size;
+}
+
+static NSRect
+scaleRect(NSRect rect, double scale)
+{
+ return NSMakeRect(NSMinX(rect) * scale,
+ NSMinY(rect) * scale,
+ NSWidth(rect) * scale,
+ NSHeight(rect) * scale);
+}
+
+/* Pagination - guess how many pages we need to print. This could be off
+ by one in both X and Y because of the view's ability to adjust the
+ width and height of the printRect during printing. Also set up a bunch
+ of other information needed for printing.
+*/
+- (void) _printPaginateWithInfo: (page_info_t *)info knowsRange: (BOOL)knowsRange
+{
+ NSMutableDictionary *dict;
+ dict = [_printInfo dictionary];
+
+ info->paperSize = [_printInfo paperSize];
+ info->orient = [_printInfo orientation];
+ info->printScale = [[dict objectForKey: NSPrintScalingFactor] doubleValue];
+ info->nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue];
+ info->nupScale = 1;
+ if (info->nup < 1 || (info->nup > 1 && (((info->nup) & 0x1) == 1)))
+ {
+ /* Bad nup value */
+ info->nup = 1;
+ [dict setObject: NSNUMBER(1) forKey: NSPrintPagesPerSheet];
+ }
+
+ /* Subtract the margins from the paper size to get print boundary */
+ info->paperBounds.size = info->paperSize;
+ info->paperBounds.origin.x = [_printInfo leftMargin];
+ info->paperBounds.origin.y = [_printInfo bottomMargin];
+ info->paperBounds.size.width -=
+ ([_printInfo rightMargin]+[_printInfo leftMargin]);
+ info->paperBounds.size.height -=
+ ([_printInfo topMargin]+[_printInfo bottomMargin]);
+
+ info->sheetBounds = info->paperBounds;
+ if (info->orient == NSLandscapeOrientation)
+ {
+ /* Bounding box needs to be in default user space, but the bbox
+ we get is rotated */
+ info->sheetBounds = NSMakeRect(NSMinY(info->paperBounds),
+ NSMinX(info->paperBounds),
+ NSHeight(info->paperBounds),
+ NSWidth(info->paperBounds));
+ }
+ /* Save this for the view to look at */
+ [dict setObject: [NSValue valueWithRect: info->paperBounds]
+ forKey: @"NSPrintPaperBounds"];
+ [dict setObject: [NSValue valueWithRect: info->sheetBounds]
+ forKey: @"NSPrintSheetBounds"];
+
+ /* Scale bounds by the user specified scaling */
+ info->scaledBounds = scaleRect(_rect, info->printScale);
+
+ if (knowsRange == NO)
+ {
+ /* Now calculate page fitting to get page scale */
+ info->pageScale = 1;
+ if ([_printInfo horizontalPagination] == NSFitPagination)
+ info->pageScale = info->paperBounds.size.width
+ / NSWidth(info->scaledBounds);
+ if ([_printInfo verticalPagination] == NSFitPagination)
+ info->pageScale = MIN(info->pageScale,
+ NSHeight(info->paperBounds)/NSHeight(info->scaledBounds));
+ /* Scale bounds by pageScale */
+ info->scaledBounds = scaleRect(info->scaledBounds, info->pageScale);
+
+ /* Now find out how many pages */
+ info->xpages = ceil(NSWidth(info->scaledBounds)/NSWidth(info->paperBounds));
+ info->ypages = ceil(NSHeight(info->scaledBounds)/NSHeight(info->paperBounds));
+ if ([_printInfo horizontalPagination] == NSClipPagination)
+ info->xpages = 1;
+ if ([_printInfo verticalPagination] == NSClipPagination)
+ info->ypages = 1;
+ }
+
+ /* Calculate nup. If nup is an odd multiple of two, secretly change the
+ page orientation to it's complement to make pages fit better.
+ */
+ if (((int)(info->nup / 2) & 0x1) == 1)
+ {
+ float tmp;
+ if (info->orient == NSLandscapeOrientation)
+ info->nupScale =
+ info->paperSize.width/(2*info->paperSize.height);
+ else
+ info->nupScale =
+ info->paperSize.height/(2*info->paperSize.width);
+ info->nupScale /= (info->nup / 2);
+ info->orient = (info->orient == NSPortraitOrientation) ?
+ NSLandscapeOrientation : NSPortraitOrientation;
+ tmp = info->paperSize.width;
+ info->paperSize.width = info->paperSize.height;
+ info->paperSize.height = tmp;
+ [dict setObject: NSNUMBER(info->orient) forKey: NSPrintOrientation];
+ }
+ else if (info->nup > 1)
+ {
+ info->nupScale = 2.0 / (float)info->nup;
+ }
+}
+
+/* Our personnel method to calculate the print rect for the specified page.
+ Note, we assume this function is called in order from our first to last
+ page. The returned pageRect is in the view's coordinate system
+*/
+- (NSRect) _rectForPage: (int)page info: (page_info_t *)info
+{
+ int xpage, ypage;
+ NSRect pageRect;
+
+ xpage = (page - 1) % info->xpages;
+ ypage = (page - 1) % info->ypages;
+ if (xpage == 0)
+ info->lastWidth = 0;
+ if (ypage == 0)
+ info->lastHeight = 0;
+ pageRect = NSMakeRect(info->lastWidth, info->lastHeight,
+ NSWidth(info->paperBounds), NSHeight(info->paperBounds));
+ pageRect = NSIntersectionRect(pageRect, info->scaledBounds);
+ /* Scale to view's coordinate system */
+ return scaleRect(pageRect, 1/(info->pageScale*info->printScale));
+
+}
+
+/* Let the view adjust the page rect we calculated. See assumptions for
+ _rectForPage:
+*/
+- (NSRect) _adjustPagesFirst: (int)first
+ last: (int)last
+ info: (page_info_t *)info
+{
+ int i;
+ double hlimit, wlimit;
+ NSRect pageRect;
+ hlimit = [_view heightAdjustLimit];
+ wlimit = [_view widthAdjustLimit];
+ for (i = first; i <= last; i++)
+ {
+ float newVal, limitVal;
+ pageRect = [self _rectForPage: i info: info];
+ limitVal = NSMaxY(pageRect) - hlimit * NSHeight(pageRect);
+ [_view adjustPageHeightNew: &newVal
+ top: NSMinY(pageRect)
+ bottom: NSMaxY(pageRect)
+ limit: limitVal];
+ if (newVal < NSMaxY(pageRect))
+ pageRect.size.height = MAX(newVal, limitVal) - NSMinY(pageRect);
+ limitVal = NSMaxX(pageRect) - wlimit * NSWidth(pageRect);
+ [_view adjustPageWidthNew: &newVal
+ left: NSMinX(pageRect)
+ right: NSMaxX(pageRect)
+ limit: limitVal];
+ if (newVal < NSMaxX(pageRect))
+ pageRect.size.width = MAX(newVal, limitVal) - NSMinX(pageRect);
+ info->lastWidth = NSMaxX(pageRect)*(info->pageScale*info->printScale);
+ info->lastHeight = NSMaxY(pageRect)*(info->pageScale*info->printScale);
+ }
+ return pageRect;
+}
+
- (void) _print
{
- BOOL knowsPageRange;
+ int i, dir;
+ BOOL knowsPageRange, allPages;
NSRange viewPageRange;
NSString *clocale;
+ NSMutableDictionary *dict;
+ page_info_t info;
+
+ dict = [_printInfo dictionary];
+
+ /* Setup pagination */
+ allPages = [[dict objectForKey: NSPrintAllPages] boolValue];
+ knowsPageRange = [_view knowsPageRange: &viewPageRange];
+ [self _printPaginateWithInfo: &info knowsRange: knowsPageRange];
+ if (knowsPageRange == NO)
+ {
+ viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
+ }
+ [dict setObject: NSNUMBER(NSMaxRange(viewPageRange) )
+ forKey: @"NSPrintTotalPages"];
+ if (allPages == YES)
+ {
+ info.first = viewPageRange.location;
+ info.last = NSMaxRange(viewPageRange) - 1;
+ }
+ else
+ {
+ info.first = [[dict objectForKey: NSPrintFirstPage] intValue];
+ info.last = [[dict objectForKey: NSPrintLastPage] intValue];
+ info.first = MAX(info.first, viewPageRange.location);
+ info.first = MIN(info.first, NSMaxRange(viewPageRange) - 1);
+ info.last = MAX(info.last, info.first);
+ info.last = MIN(info.last, NSMaxRange(viewPageRange) - 1);
+ viewPageRange = NSMakeRange(info.first, (info.last-info.first)+1);
+ }
+ info.lastWidth = info.lastHeight = 0;
+ [dict setObject: NSFNUMBER(info.nupScale) forKey: @"NSNupScale"];
+ [dict setObject: NSNUMBER(info.first) forKey: NSPrintFirstPage];
+ if (allPages == YES && knowsPageRange == NO)
+ [dict setObject: NSNUMBER(info.first-1) forKey: NSPrintLastPage];
+ else
+ [dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage];
+ NSDebugLLog(@"NSPrinting", @"Printing pages %d to %d",
+ info.first, info.last);
+ NSDebugLLog(@"NSPrinting", @"Printing rect %@, scaled %@",
+ NSStringFromRect(_rect),
+ NSStringFromRect(info.scaledBounds));
+
+ _currentPage = info.first;
+ dir = 1;
+ if (_pageOrder == NSDescendingPageOrder)
+ {
+ _currentPage = info.last;
+ dir = -1;
+ }
+ if (dir > 0 && _currentPage != 1)
+ {
+ /* Calculate page rects we aren't processing to catch up to the
+ first page we are */
+ NSRect pageRect;
+ pageRect = [self _adjustPagesFirst: 1
+ last: _currentPage-1
+ info: &info];
+ }
+
/* Reset the current locale to a generic C locale so numbers
get printed correctly for PostScript (maybe we should only
set the numeric locale?). Save the current locale for later. */
@@ -534,18 +903,180 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
/* Print the header information */
[_view beginDocument];
- /* Setup pagination */
- knowsPageRange = [_view knowsPageRange: &viewPageRange];
+ /* Print each page */
+ i = 0;
+ while (i < (info.last-info.first+1))
+ {
+ NSPoint location;
+ NSRect pageRect, scaledPageRect;
+ if (knowsPageRange == YES)
+ {
+ pageRect = [_view rectForPage: _currentPage];
+ }
+ else
+ {
+ if (dir < 0)
+ pageRect = [self _adjustPagesFirst: 1
+ last: _currentPage
+ info: &info];
+ else
+ pageRect = [self _adjustPagesFirst: _currentPage
+ last: _currentPage
+ info: &info];
+ }
+ NSDebugLLog(@"NSPrinting", @" current page %d, rect %@",
+ _currentPage, NSStringFromRect(pageRect));
+ if (NSIsEmptyRect(pageRect))
+ break;
- [_view beginPageInRect: _rect atPlacement: NSMakePoint(0,0)];
- [_view displayRectIgnoringOpacity: _rect];
+ scaledPageRect = scaleRect(pageRect, info.printScale*info.pageScale);
+ location = [_view locationOfPrintRect: scaledPageRect];
+
+ /* Draw using our special view routine */
+ [_view _displayPageInRect: pageRect
+ atPlacement: location
+ withInfo: info];
+
+ if (dir > 0 && _currentPage == info.last && allPages == YES)
+ {
+ /* Check if adjust pages forced part of the bounds onto
+ another page */
+ if (NSMaxX(pageRect) < NSMaxX(_rect)
+ && [_printInfo horizontalPagination] != NSClipPagination)
+ {
+ info.xpages++;
+ }
+ if (NSMaxY(pageRect) < NSMaxY(_rect)
+ && [_printInfo verticalPagination] != NSClipPagination)
+ {
+ info.ypages++;
+ }
+ viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
+ info.last = NSMaxRange(viewPageRange) - 1;
+ }
+ i++;
+ _currentPage += dir;
+ } /* Print each page */
+
+ /* Make sure we end the sheet */
+ if ( info.nup > 1 && (info.last - info.first) % info.nup != info.nup - 1 )
+ {
+ [_view drawSheetBorderWithSize: info.paperBounds.size];
+ [_view _endSheet];
+ }
[_view endDocument];
-
GSSetLocale(clocale);
+
+ /* Setup/reset for next time */
+ [dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage];
+ if (((int)(info.nup / 2) & 0x1) == 1)
+ {
+ info.orient = (info.orient == NSPortraitOrientation) ?
+ NSLandscapeOrientation : NSPortraitOrientation;
+ [dict setObject: NSNUMBER(info.orient) forKey: NSPrintOrientation];
+ }
}
@end
+@implementation NSView (NSPrintOperation)
+- (void) _displayPageInRect: (NSRect)pageRect
+ atPlacement: (NSPoint)location
+ withInfo: (page_info_t)info
+{
+ int currentPage;
+ float xoffset, yoffset, scale;
+ NSString *label;
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+
+ currentPage = [printOp currentPage];
+
+ label = nil;
+ if (info.nup == 1)
+ label = [NSString stringWithFormat: @"%d", currentPage];
+
+ /* Begin a sheet (i.e. a physical page in Postscript terms). If
+ nup > 1 then this occurs only once every nup pages */
+ if ((currentPage - info.first) % info.nup == 0)
+ {
+ [self beginPage: floor((currentPage - info.first)/info.nup)+1
+ label: label
+ bBox: info.sheetBounds
+ fonts: nil];
+ DPSPrintf(ctxt, "/__GSsheetsaveobject save def\n");
+ if (info.orient == NSLandscapeOrientation)
+ {
+ DPSrotate(ctxt, 90);
+ DPStranslate(ctxt, 0, -info.paperSize.height);
+ }
+ /* Also offset by margins */
+ DPStranslate(ctxt, NSMinX(info.paperBounds), NSMinY(info.paperBounds));
+ }
+
+ /* Begin a logical page */
+ [self beginPageInRect: pageRect atPlacement: location];
+ scale = info.pageScale * info.printScale;
+ if (scale != 1.0)
+ DPSscale(ctxt, scale, scale);
+ if ([self isFlipped])
+ {
+ NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, 1 };
+ NSAffineTransform *matrix, *flip;
+ flip = [NSAffineTransform new];
+ matrix = [NSAffineTransform new];
+ [matrix makeIdentityMatrix];
+ [matrix appendTransform: _boundsMatrix];
+ /*
+ * The flipping process must result in a coordinate system that
+ * exactly overlays the original. To do that, we must translate
+ * the origin by the height of the view.
+ */
+ [flip setTransformStruct: ats];
+ flip->matrix.ty = NSHeight(_bounds);
+ [matrix appendTransform: flip];
+ [matrix concat];
+ yoffset = NSHeight(_frame) - NSMaxY(pageRect);
+ }
+ else
+ yoffset = 0 - NSMinY(pageRect);
+
+ /* Translate so the rect we're printing is on the page */
+ xoffset = 0 - NSMinX(pageRect);
+ DPStranslate(ctxt, xoffset, yoffset);
+
+ if ((currentPage - info.first) % info.nup == 0)
+ [self endPageSetup];
+
+ /* Do the actual drawing */
+ [self displayRectIgnoringOpacity: pageRect];
+
+ /* End a logical page */
+ DPSgrestore(ctxt); // Balance gsave in beginPageInRect:
+ [self drawPageBorderWithSize:
+ scaleSize(info.paperBounds.size, info.nupScale)];
+ [self endPage];
+
+ /* End a physical page */
+ if ( ((currentPage - info.first) % info.nup == info.nup-1) )
+ {
+ [self drawSheetBorderWithSize: info.paperBounds.size];
+ [self _endSheet];
+ }
+}
+
+- (void) _endSheet
+{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ if ([printOp isEPSOperation] == NO)
+ DPSPrintf(ctxt, "showpage\n");
+ DPSPrintf(ctxt, "__GSsheetsaveobject restore\n");
+ DPSPrintf(ctxt, "%%%%PageTrailer\n");
+ DPSPrintf(ctxt, "\n");
+}
+@end
+
@implementation GSPrintOperation
@@ -581,7 +1112,9 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
}
[info setObject: _path forKey: @"NSOutputFile"];
- _context = RETAIN([NSGraphicsContext postscriptContextWithInfo: info]);
+ [info setObject: NSGraphicsContextPSFormat
+ forKey: NSGraphicsContextRepresentationFormatAttributeName];
+ _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
return _context;
}
@@ -642,6 +1175,10 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
clocale = GSSetLocale(nil);
GSSetLocale(@"C");
+ /* Save this for the view to look at. Seems like there should
+ be a better way to pass it to beginDocument */
+ [[_printInfo dictionary] setObject: [NSValue valueWithRect: _rect]
+ forKey: @"NSPrintSheetBounds"];
[_view beginDocument];
[_view beginPageInRect: _rect atPlacement: NSMakePoint(0,0)];
[_view displayRectIgnoringOpacity: _rect];
@@ -650,6 +1187,11 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
GSSetLocale(clocale);
}
+- (BOOL)isEPSOperation
+{
+ return YES;
+}
+
- (BOOL)deliverResult
{
if (_data != nil && _path != nil)
@@ -663,6 +1205,22 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
return YES;
}
+- (NSGraphicsContext*)createContext
+{
+ NSMutableDictionary *info;
+ if (_context)
+ return _context;
+
+ info = [_printInfo dictionary];
+
+ [info setObject: _path forKey: @"NSOutputFile"];
+ [info setObject: NSGraphicsContextPSFormat
+ forKey: NSGraphicsContextRepresentationFormatAttributeName];
+ _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
+
+ return _context;
+}
+
@end
@implementation GSPDFPrintOperation
diff --git a/Source/NSPrintPanel.m b/Source/NSPrintPanel.m
index 6cd0affc1..58674b42d 100644
--- a/Source/NSPrintPanel.m
+++ b/Source/NSPrintPanel.m
@@ -144,7 +144,8 @@ static NSPrintPanel *shared_instance;
/* Setup the layout popup */
control = CONTROL(self, NSPPLayoutButton);
- list = [NSArray arrayWithObjects: @"1up", @"2up", @"3up", @"4up", nil];
+ list = [NSArray arrayWithObjects: @"1 up", @"2 up", @"4 up", @"6 up",
+ @"8 up", nil];
[control removeAllItems];
for (i = 0; i < [list count]; i++)
{
@@ -239,11 +240,15 @@ static NSPrintPanel *shared_instance;
else if (tag == NSPPPreviewButton)
{
_picked = NSPPPreviewButton;
+ NSRunAlertPanel(@"Sorry", @"Previewing of print file not implemented",
+ @"OK", NULL, NULL);
+ /* Don't stop the modal session */
+ return;
}
else if (tag ==NSFaxButton )
{
_picked = NSFaxButton;
- NSRunAlertPanel(@"Warning", @"Fax of print file not implemented",
+ NSRunAlertPanel(@"Sorry", @"Faxing of print file not implemented",
@"OK", NULL, NULL);
/* Don't stop the modal session */
return;
@@ -293,7 +298,7 @@ static NSPrintPanel *shared_instance;
NSString *str;
str = [NSString stringWithFormat: @"%d", _pages.location];
[[fromRangeForm cellAtIndex: 0] setStringValue: str];
- str = [NSString stringWithFormat: @"%d", NSMaxRange(_pages)];
+ str = [NSString stringWithFormat: @"%d", NSMaxRange(_pages)-1];
[[toRangeForm cellAtIndex: 0] setStringValue: str];
}
}
@@ -361,7 +366,7 @@ static NSPrintPanel *shared_instance;
dict = [info dictionary];
- NSDebugLLog(@"NSPrintPanel",
+ NSDebugLLog(@"NSPrinting",
@"Update PrintInfo dictionary\n %@ \n --------------", dict);
_pages = NSMakeRange([[dict objectForKey: NSPrintFirstPage] intValue],
[[dict objectForKey: NSPrintLastPage] intValue]);
@@ -375,7 +380,7 @@ static NSPrintPanel *shared_instance;
if (layout > 4)
layout = 4;
control = CONTROL(self, NSPPLayoutButton);
- [control selectItemAtIndex: layout-1];
+ [control selectItemAtIndex: (int)(layout/2)];
/* Setup the resolution popup */
control = CONTROL(_optionPanel, NSPPResolutionButton);
@@ -508,7 +513,7 @@ static NSPrintPanel *shared_instance;
/* Scale */
control = CONTROL(self, NSPPScaleField);
- scale = [control intValue]/100;
+ scale = [control doubleValue]/100.0;
if (scale <= 0)
scale = .1;
if (scale >= 10)
@@ -518,7 +523,9 @@ static NSPrintPanel *shared_instance;
forKey: NSPrintScalingFactor];
/* Layout */
- layout = [CONTROL(self, NSPPLayoutButton) indexOfSelectedItem] + 1;
+ layout = [CONTROL(self, NSPPLayoutButton) indexOfSelectedItem] * 2;
+ if (layout == 0)
+ layout = 1;
[dict setObject: NSNUMBER(layout) forKey: NSPrintPagesPerSheet];
/* Resolution */
@@ -611,7 +618,7 @@ static NSPrintPanel *shared_instance;
}
[info setJobDisposition: sel];
- NSDebugLLog(@"NSPrintPanel",
+ NSDebugLLog(@"NSPrinting",
@"Final info dictionary ----\n %@ \n --------------", dict);
}
diff --git a/Source/NSView.m b/Source/NSView.m
index b8a4c2aeb..105810dc3 100644
--- a/Source/NSView.m
+++ b/Source/NSView.m
@@ -37,6 +37,7 @@
#include
#include
+#include
#include
#include
#include
@@ -46,18 +47,24 @@
#include
#include
#include
+#include
+#include
-#include
-#include
#include
-#include
-#include
+#include
#include
-#include
+#include
+#include
#include
+#include
+#include
#include
#include
#include
+#include
+#include
+#include
+#include
/* Variable tells this view and subviews that we're printing. Not really
a class variable because we want it visible to subviews also
@@ -69,6 +76,11 @@ struct NSWindow_struct
@defs(NSWindow)
};
+@interface NSFont (NSViewFonts)
++ (void) resetUsedFonts;
++ (NSSet *) usedFonts;
+@end
+
@implementation NSView
/*
@@ -1352,7 +1364,6 @@ GSSetDragTypes(NSView* obj, NSArray *types)
a superview so we get printed correctly */
[self _matrixToWindow];
[_matrixToWindow makeIdentityMatrix];
- _visibleRect = _bounds;
}
else
{
@@ -1418,11 +1429,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
if ([_window gState] == 0)
return;
- if (viewIsPrinting != nil)
- {
- _coordinates_valid = NO;
- }
- else
+ if (viewIsPrinting == nil)
{
/* Restore our original gstate */
DPSgrestore(ctxt);
@@ -2450,16 +2457,10 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
{
NSMutableData *data = [NSMutableData data];
- /* Inform ourselves and subviews that we're printing so we adjust
- the PostScript accordingly. Perhaps this could be in the thread
- dictionary, but that's probably overkill and slow */
- viewIsPrinting = self;
-
[[NSPrintOperation EPSOperationWithView: self
insideRect: aRect
toData: data] runOperation];
- viewIsPrinting = nil;
return data;
}
@@ -2495,7 +2496,15 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
- (NSString *)printJobTitle
{
- return nil;
+ id doc;
+ NSString *title;
+ doc = [[NSDocumentController sharedDocumentController] documentForWindow:
+ [self window]];
+ if (doc)
+ title = [doc displayName];
+ else
+ title = [[self window] title];
+ return title;
}
/*
@@ -2624,8 +2633,31 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
- (NSPoint) locationOfPrintRect: (NSRect)aRect
{
-// FIXME: Should depend on the print info
- return NSZeroPoint;
+ int pages;
+ NSPoint location;
+ NSRect bounds;
+ NSMutableDictionary *dict;
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSPrintInfo *printInfo = [printOp printInfo];
+ dict = [printInfo dictionary];
+
+ pages = [[dict objectForKey: @"NSPrintTotalPages"] intValue];
+ if ([dict objectForKey: @"NSPrintPaperBounds"])
+ bounds = [[dict objectForKey: @"NSPrintPaperBounds"] rectValue];
+ else
+ bounds = aRect;
+ location = NSMakePoint(0, NSHeight(bounds)-NSHeight(aRect));
+ /* FIXME: I can't figure out how the location for a multi-page document
+ is computed. Just ignore centering? */
+ if (pages == 1)
+ {
+ if ([printInfo isHorizontallyCentered])
+ location.x = (NSWidth(bounds) - NSWidth(aRect))/2;
+ if ([printInfo isVerticallyCentered])
+ location.y = (NSHeight(bounds) - NSHeight(aRect))/2;
+ }
+
+ return location;
}
- (NSRect) rectForPage: (int)page
@@ -2646,13 +2678,26 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
bBox: (NSRect)pageRect
fonts: (NSString*)fontNames
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+
+ if (aString == nil)
+ aString = [[NSNumber numberWithInt: ordinalNum] description];
+ DPSPrintf(ctxt, "%%%%Page: %s %d\n", [aString cString], ordinalNum);
+ if (NSIsEmptyRect(pageRect) == NO)
+ DPSPrintf(ctxt, "%%%%PageBoundingBox: %d %d %d %d\n",
+ (int)NSMinX(pageRect), (int)NSMinY(pageRect),
+ (int)NSMaxX(pageRect), (int)NSMaxY(pageRect));
+ if (fontNames)
+ DPSPrintf(ctxt, "%%%%PageFonts: %s\n", [fontNames cString]);
+ DPSPrintf(ctxt, "%%%%BeginPageSetup\n");
}
- (void) beginPageSetupRect: (NSRect)aRect placement: (NSPoint)location
{
+ [self beginPageInRect: aRect atPlacement: location];
}
-- (void) beginPrologueBBox: (NSRect)boundingBox
+- (void) beginPrologueBBox: (NSRect)bBox
creationDate: (NSString*)dateCreated
createdBy: (NSString*)anApplication
fonts: (NSString*)fontNames
@@ -2660,6 +2705,57 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
pages: (int)numPages
title: (NSString*)aTitle
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSPrintingOrientation orient;
+ BOOL epsOp;
+
+ epsOp = [printOp isEPSOperation];
+ orient = [[printOp printInfo] orientation];
+
+ if (epsOp)
+ DPSPrintf(ctxt, "%%!PS-Adobe-3.0 EPSF-3.0\n");
+ else
+ DPSPrintf(ctxt, "%%!PS-Adobe-3.0\n");
+ DPSPrintf(ctxt, "%%%%Title: %s\n", [aTitle cString]);
+ DPSPrintf(ctxt, "%%%%Creator: %s\n", [anApplication cString]);
+ DPSPrintf(ctxt, "%%%%CreationDate: %s\n",
+ [[dateCreated description] cString]);
+ DPSPrintf(ctxt, "%%%%For: %s\n", [user cString]);
+ if (fontNames)
+ DPSPrintf(ctxt, "%%%%DocumentFonts: %s\n", [fontNames cString]);
+ else
+ DPSPrintf(ctxt, "%%%%DocumentFonts: (atend)\n");
+
+ if (NSIsEmptyRect(bBox) == NO)
+ DPSPrintf(ctxt, "%%%%BoundingBox: %d %d %d %d\n",
+ (int)NSMinX(bBox), (int)NSMinY(bBox),
+ (int)NSMaxX(bBox), (int)NSMaxY(bBox));
+ else
+ DPSPrintf(ctxt, "%%%%BoundingBox: (atend)\n");
+
+ if (epsOp == NO)
+ {
+ if (numPages)
+ DPSPrintf(ctxt, "%%%%Pages: %d\n", numPages);
+ else
+ DPSPrintf(ctxt, "%%%%Pages: (atend)\n");
+ if ([printOp pageOrder] == NSDescendingPageOrder)
+ DPSPrintf(ctxt, "%%%%PageOrder: Descend\n");
+ else if ([printOp pageOrder] == NSAscendingPageOrder)
+ DPSPrintf(ctxt, "%%%%PageOrder: Ascend\n");
+ else if ([printOp pageOrder] == NSSpecialPageOrder)
+ DPSPrintf(ctxt, "%%%%PageOrder: Special\n");
+
+ if (orient == NSPortraitOrientation)
+ DPSPrintf(ctxt, "%%%%Orientation: Portrait\n");
+ else
+ DPSPrintf(ctxt, "%%%%Orientation: Landscape\n");
+ }
+
+ DPSPrintf(ctxt, "%%%%GNUstepVersion: %d.%d.%d\n",
+ GNUSTEP_GUI_MAJOR_VERSION, GNUSTEP_GUI_MINOR_VERSION,
+ GNUSTEP_GUI_SUBMINOR_VERSION);
}
- (void) addToPageSetup
@@ -2668,10 +2764,14 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
- (void) beginSetup
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%BeginSetup\n");
}
- (void) beginTrailer
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%Trailer\n");
}
- (void) drawPageBorderWithSize: (NSSize)borderSize
@@ -2684,39 +2784,203 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
- (void) endHeaderComments
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%EndComments\n\n");
}
- (void) endPrologue
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%EndProlog\n\n");
}
- (void) endSetup
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%EndSetup\n\n");
}
- (void) endPageSetup
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%EndPageSetup\n");
}
- (void) endPage
{
+ int nup;
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSDictionary *dict = [[printOp printInfo] dictionary];
+
+ nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue];
+ if (nup > 1)
+ {
+ DPSPrintf(ctxt, "__GSpagesaveobject restore\n\n");
+ }
}
- (void) endTrailer
{
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ DPSPrintf(ctxt, "%%%%EOF\n");
}
+/**
+ Writes header and job information for the PostScript document. This
+ includes at a minimum, PostScript header information. It may also
+ include job setup information if the output is intended for a printer
+ (i.e. not an EPS file). Most of the information for writing the
+ header comes from the NSPrintOperation and NSPrintInfo objects
+ associated with the current print operation.
+
+ There isn't normally anything that the program needs to override
+ at the beginning of a document, although if there is additional
+ setup that needs to be done, you can override the NSView's methods
+ endHeaderComments, endPrologue, beginSetup, and/or endSetup.
+
+ This method calls the above methods in the listed order before
+ or after writing the required information. For an EPS operation, the
+ beginSetup and endSetup methods aren't used. */
- (void)beginDocument
{
+ int first, last, pages, nup;
+ NSRect bbox;
+ NSDictionary *dict;
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ dict = [[printOp printInfo] dictionary];
+ if (printOp == nil)
+ {
+ NSLog(@"[NSView -beginDocument] called without a current print op");
+ return;
+ }
+ /* Inform ourselves and subviews that we're printing so we adjust
+ the PostScript accordingly. Perhaps this could be in the thread
+ dictionary, but that's probably overkill and slow */
+ viewIsPrinting = self;
+
+ /* Get pagination information */
+ nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue];
+ bbox = NSZeroRect;
+ if ([dict objectForKey: @"NSPrintSheetBounds"])
+ bbox = [[dict objectForKey: @"NSPrintSheetBounds"] rectValue];
+ first = [[dict objectForKey: NSPrintFirstPage] intValue];
+ last = [[dict objectForKey: NSPrintLastPage] intValue];
+ pages = last - first + 1;
+ if (nup > 1)
+ pages = ceil((float)pages / nup);
+
+ /* Begin document structure */
+ [self beginPrologueBBox: bbox
+ creationDate: [[NSCalendarDate calendarDate] description]
+ createdBy: [[NSProcessInfo processInfo] processName]
+ fonts: nil
+ forWhom: NSUserName()
+ pages: pages
+ title: [self printJobTitle]];
+ [self endHeaderComments];
+
+ DPSPrintf(ctxt, "%%%%BeginProlog\n");
+ // Prolog goes here !
+ [self endPrologue];
+ if ([printOp isEPSOperation] == NO)
+ {
+ [self beginSetup];
+ // Setup goes here !
+ [self endSetup];
+ }
+
+ [NSFont resetUsedFonts];
+ /* Make sure we set the visible rect so everything is printed. */
+ [self _rebuildCoordinates];
+ _visibleRect = _bounds;
}
- (void)beginPageInRect:(NSRect)aRect
atPlacement:(NSPoint)location
{
+ int nup;
+ float scale;
+ NSRect bounds;
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSDictionary *dict = [[printOp printInfo] dictionary];
+
+ if ([dict objectForKey: @"NSPrintPaperBounds"])
+ bounds = [[dict objectForKey: @"NSPrintPaperBounds"] rectValue];
+ else
+ bounds = aRect;
+
+ nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue];
+ if (nup > 1)
+ {
+ int page;
+ float xoff, yoff;
+ DPSPrintf(ctxt, "/__GSpagesaveobject save def\n");
+ page = [printOp currentPage]
+ - [[dict objectForKey: NSPrintFirstPage] intValue];
+ page = page % nup;
+ scale = [[dict objectForKey: @"NSNupScale"] floatValue];
+ if (nup == 2)
+ xoff = page;
+ else
+ xoff = (page % (nup/2));
+ xoff *= NSWidth(bounds) * scale;
+ if (nup == 2)
+ yoff = 0;
+ else
+ yoff = (int)((nup-page-1) / (nup/2));
+ yoff *= NSHeight(bounds) * scale;
+ DPStranslate(ctxt, xoff, yoff);
+ DPSgsave(ctxt);
+ DPSscale(ctxt, scale, scale);
+ }
+ else
+ DPSgsave(ctxt);
+
+ /* Translate to placement */
+ if (location.x != 0 || location.y != 0)
+ DPStranslate(ctxt, location.x, location.y);
}
- (void)endDocument
{
+ int first, last, current, pages;
+ NSSet *fontNames;
+ NSGraphicsContext *ctxt = GSCurrentContext();
+ NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSDictionary *dict = [[printOp printInfo] dictionary];
+
+ first = [[dict objectForKey: NSPrintFirstPage] intValue];
+ last = [[dict objectForKey: NSPrintLastPage] intValue];
+ pages = last - first + 1;
+ [self beginTrailer];
+
+ if (pages == 0)
+ {
+ int nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue];
+ current = [printOp currentPage];
+ pages = current - first; // Current is 1 more than the last page
+ if (nup > 1)
+ pages = ceil((float)pages / nup);
+ DPSPrintf(ctxt, "%%%%Pages: %d\n", pages);
+ }
+ fontNames = [NSFont usedFonts];
+ if (fontNames && [fontNames count])
+ {
+ NSString *name;
+ NSEnumerator *e = [fontNames objectEnumerator];
+ DPSPrintf(ctxt, "%%%%DocumentFonts: %@\n", [e nextObject]);
+ while ((name = [e nextObject]))
+ {
+ DPSPrintf(ctxt, "%%%%+ %@\n", name);
+ }
+ }
+
+ [self endTrailer];
+ [self _invalidateCoordinates];
+ viewIsPrinting = nil;
}
/*
diff --git a/Source/externs.m b/Source/externs.m
index 0f58812f4..e6fbb164f 100644
--- a/Source/externs.m
+++ b/Source/externs.m
@@ -158,6 +158,21 @@ NSString *NSDrawerWillOpenNotification =
NSString *_NSFormCellDidChangeTitleWidthNotification
= @"_NSFormCellDidChangeTitleWidthNotification";
+// NSGraphicContext constants
+NSString *NSGraphicsContextDestinationAttributeName =
+@"NSGraphicsContextDestinationAttributeName";
+NSString *NSGraphicsContextPDFFormat =
+@"NSGraphicsContextPDFFormat";
+NSString *NSGraphicsContextPSFormat =
+@"NSGraphicsContextPSFormat";
+NSString *NSGraphicsContextRepresentationFormatAttributeName =
+@"NSGraphicsContextRepresentationFormatAttributeName";
+
+NSString *NSImageInterpolationDefault = @"NSImageInterpolationDefault";
+NSString *NSImageInterpolationNone = @"NSImageInterpolationNone";
+NSString *NSImageInterpolationLow = @"NSImageInterpolationLow";
+NSString *NSImageInterpolationHigh = @"NSImageInterpolationHigh";
+
// NSHelpManager notifications;
NSString *NSContextHelpModeDidActivateNotification =
@"NSContextHelpModeDidActivateNotification";