From 9732999fd8bd8845c3a508d086a34ee06594d40a Mon Sep 17 00:00:00 2001 From: ayers Date: Thu, 31 Jul 2003 23:52:10 +0000 Subject: [PATCH] Header reorganization - Please refer to ChangeLog git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 207 +++ ColorPickers/GNUmakefile | 2 +- ColorPickers/GSGrayColorPicker.m | 2 +- ColorPickers/GSStandardColorPicker.m | 8 +- ColorPickers/GSWheelColorPicker.m | 2 +- Documentation/Gui/Gui.gsdoc | 9 - Documentation/GuiAdditions/.cvsignore | 14 + Documentation/GuiAdditions/GNUmakefile | 50 + Documentation/GuiAdditions/GuiAdditions.gsdoc | 34 + Documentation/gnustep-gui.texi | 6 +- GNUmakefile.postamble | 28 +- .../gui => Additions/GNUstepGUI}/.cvsignore | 0 Headers/Additions/GNUstepGUI/GMAppKit.h | 98 ++ Headers/Additions/GNUstepGUI/GMArchiver.h | 200 +++ .../Additions/GNUstepGUI/GSDisplayServer.h | 185 +++ Headers/Additions/GNUstepGUI/GSFontInfo.h | 143 ++ Headers/Additions/GNUstepGUI/GSFusedSilica.h | 784 +++++++++++ Headers/Additions/GNUstepGUI/GSHbox.h | 167 +++ .../Additions/GNUstepGUI/GSHelpManagerPanel.h | 47 + .../GNUstepGUI/GSHorizontalTypesetter.h | 79 ++ Headers/Additions/GNUstepGUI/GSInfoPanel.h | 80 ++ .../Additions/GNUstepGUI/GSLayoutManager.h | 350 +++++ .../GNUstepGUI/GSLayoutManager_internal.h | 317 +++++ Headers/Additions/GNUstepGUI/GSMemoryPanel.h | 65 + Headers/Additions/GNUstepGUI/GSMethodTable.h | 317 +++++ Headers/Additions/GNUstepGUI/GSNibTemplates.h | 161 +++ .../Additions/GNUstepGUI/GSPasteboardServer.h | 92 ++ .../Additions/GNUstepGUI/GSServicesManager.h | 90 ++ Headers/Additions/GNUstepGUI/GSTable.h | 178 +++ .../Additions/GNUstepGUI/GSTextConverter.h | 66 + Headers/Additions/GNUstepGUI/GSTrackingRect.h | 74 + Headers/Additions/GNUstepGUI/GSTypesetter.h | 132 ++ Headers/Additions/GNUstepGUI/GSVbox.h | 117 ++ Headers/Additions/GNUstepGUI/GSVersion.h | 36 + Headers/Additions/GNUstepGUI/GSVersion.h.in | 36 + Headers/Additions/GNUstepGUI/IMConnectors.h | 59 + Headers/Additions/GNUstepGUI/IMCustomObject.h | 71 + Headers/Additions/GNUstepGUI/IMLoading.h | 52 + Headers/Additions/GNUstepGUI/config.h.in | 74 + Headers/AppKit/AppKit.h | 158 +++ Headers/AppKit/AppKitDefines.h | 44 + Headers/AppKit/AppKitExceptions.h | 73 + Headers/AppKit/DPSOperators.h | 1204 +++++++++++++++++ Headers/AppKit/NSActionCell.h | 44 + Headers/AppKit/NSAffineTransform.h | 102 ++ Headers/AppKit/NSApplication.h | 456 +++++++ Headers/AppKit/NSAttributedString.h | 122 ++ Headers/AppKit/NSBezierPath.h | 223 +++ Headers/AppKit/NSBitmapImageRep.h | 160 +++ Headers/AppKit/NSBox.h | 97 ++ Headers/AppKit/NSBrowser.h | 269 ++++ Headers/AppKit/NSBrowserCell.h | 74 + Headers/AppKit/NSButton.h | 134 ++ Headers/AppKit/NSButtonCell.h | 191 +++ Headers/AppKit/NSCachedImageRep.h | 62 + Headers/AppKit/NSCell.h | 462 +++++++ Headers/AppKit/NSClipView.h | 96 ++ Headers/AppKit/NSColor.h | 243 ++++ Headers/AppKit/NSColorList.h | 114 ++ Headers/AppKit/NSColorPanel.h | 138 ++ Headers/AppKit/NSColorPicker.h | 87 ++ Headers/AppKit/NSColorPicking.h | 98 ++ Headers/AppKit/NSColorWell.h | 81 ++ Headers/AppKit/NSComboBox.h | 112 ++ Headers/AppKit/NSComboBoxCell.h | 115 ++ Headers/AppKit/NSControl.h | 213 +++ Headers/AppKit/NSCursor.h | 108 ++ Headers/AppKit/NSCustomImageRep.h | 52 + Headers/AppKit/NSDataLink.h | 124 ++ Headers/AppKit/NSDataLinkManager.h | 144 ++ Headers/AppKit/NSDataLinkPanel.h | 99 ++ Headers/AppKit/NSDocument.h | 218 +++ Headers/AppKit/NSDocumentController.h | 125 ++ Headers/AppKit/NSDocumentFrameworkPrivate.h | 54 + Headers/AppKit/NSDragging.h | 121 ++ Headers/AppKit/NSDrawer.h | 120 ++ Headers/AppKit/NSEPSImageRep.h | 64 + Headers/AppKit/NSEvent.h | 340 +++++ Headers/AppKit/NSFileWrapper.h | 138 ++ Headers/AppKit/NSFont.h | 216 +++ Headers/AppKit/NSFontManager.h | 195 +++ Headers/AppKit/NSFontPanel.h | 122 ++ Headers/AppKit/NSForm.h | 92 ++ Headers/AppKit/NSFormCell.h | 74 + Headers/AppKit/NSGraphics.h | 248 ++++ Headers/AppKit/NSGraphicsContext.h | 413 ++++++ Headers/AppKit/NSHelpManager.h | 79 ++ Headers/AppKit/NSHelpPanel.h | 93 ++ Headers/AppKit/NSImage.h | 246 ++++ Headers/AppKit/NSImageCell.h | 85 ++ Headers/AppKit/NSImageRep.h | 122 ++ Headers/AppKit/NSImageView.h | 50 + Headers/AppKit/NSInputManager.h | 191 +++ Headers/AppKit/NSInputServer.h | 78 ++ Headers/AppKit/NSInterfaceStyle.h | 60 + Headers/AppKit/NSLayoutManager.h | 186 +++ Headers/AppKit/NSMatrix.h | 308 +++++ Headers/AppKit/NSMenu.h | 654 +++++++++ Headers/AppKit/NSMenuItem.h | 126 ++ Headers/AppKit/NSMenuItemCell.h | 100 ++ Headers/AppKit/NSMenuView.h | 425 ++++++ Headers/AppKit/NSNibConnector.h | 61 + Headers/AppKit/NSNibDeclarations.h | 38 + Headers/AppKit/NSNibLoading.h | 68 + Headers/AppKit/NSOpenGL.h | 139 ++ Headers/AppKit/NSOpenGLView.h | 51 + Headers/AppKit/NSOpenPanel.h | 93 ++ Headers/AppKit/NSOutlineView.h | 183 +++ Headers/AppKit/NSPageLayout.h | 105 ++ Headers/AppKit/NSPanel.h | 184 +++ Headers/AppKit/NSParagraphStyle.h | 164 +++ Headers/AppKit/NSPasteboard.h | 293 ++++ Headers/AppKit/NSPopUpButton.h | 91 ++ Headers/AppKit/NSPopUpButtonCell.h | 131 ++ Headers/AppKit/NSPrintInfo.h | 181 +++ Headers/AppKit/NSPrintOperation.h | 180 +++ Headers/AppKit/NSPrintPanel.h | 110 ++ Headers/AppKit/NSPrinter.h | 115 ++ Headers/AppKit/NSProgressIndicator.h | 118 ++ Headers/AppKit/NSResponder.h | 227 ++++ Headers/AppKit/NSRulerMarker.h | 84 ++ Headers/AppKit/NSRulerView.h | 174 +++ Headers/AppKit/NSSavePanel.h | 187 +++ Headers/AppKit/NSScreen.h | 75 + Headers/AppKit/NSScrollView.h | 145 ++ Headers/AppKit/NSScroller.h | 126 ++ Headers/AppKit/NSSecureTextField.h | 49 + Headers/AppKit/NSSelection.h | 79 ++ Headers/AppKit/NSSlider.h | 85 ++ Headers/AppKit/NSSliderCell.h | 111 ++ Headers/AppKit/NSSound.h | 116 ++ Headers/AppKit/NSSpellChecker.h | 123 ++ Headers/AppKit/NSSpellProtocol.h | 43 + Headers/AppKit/NSSpellServer.h | 95 ++ Headers/AppKit/NSSplitView.h | 119 ++ Headers/AppKit/NSStepper.h | 61 + Headers/AppKit/NSStepperCell.h | 78 ++ Headers/AppKit/NSStringDrawing.h | 62 + Headers/AppKit/NSTabView.h | 118 ++ Headers/AppKit/NSTabViewItem.h | 86 ++ Headers/AppKit/NSTableColumn.h | 93 ++ Headers/AppKit/NSTableHeaderCell.h | 37 + Headers/AppKit/NSTableHeaderView.h | 60 + Headers/AppKit/NSTableView.h | 336 +++++ Headers/AppKit/NSText.h | 305 +++++ Headers/AppKit/NSTextAttachment.h | 187 +++ Headers/AppKit/NSTextContainer.h | 265 ++++ Headers/AppKit/NSTextField.h | 118 ++ Headers/AppKit/NSTextFieldCell.h | 71 + Headers/AppKit/NSTextStorage.h | 172 +++ Headers/AppKit/NSTextView.h | 622 +++++++++ Headers/AppKit/NSToolbar.h | 124 ++ Headers/AppKit/NSToolbarItem.h | 114 ++ Headers/AppKit/NSUserInterfaceValidation.h | 42 + Headers/AppKit/NSView.h | 457 +++++++ Headers/AppKit/NSWindow.h | 613 +++++++++ Headers/AppKit/NSWindowController.h | 91 ++ Headers/AppKit/NSWorkspace.h | 252 ++++ Headers/AppKit/PSOperators.h | 818 +++++++++++ Model/GMAppKit.m | 2 +- Model/GMArchiver.m | 2 +- Model/GNUmakefile | 6 +- Model/GNUmakefile.postamble | 4 +- Model/IBClasses.m | 4 +- Model/IMConnectors.m | 6 +- Model/IMCustomObject.m | 4 +- Model/IMLoading.m | 6 +- Model/Translator.m | 4 +- Resources/GNUmakefile | 2 +- Source/CompatibilityHeaders.make | 50 + Source/DocMakefile | 46 +- Source/GNUmakefile | 61 +- Source/GNUmakefile.postamble | 35 +- Source/GNUmakefile.preamble | 4 +- Source/GSDisplayServer.m | 2 +- Source/GSFontInfo.m | 2 +- Source/GSFusedSilica.m | 2 +- Source/GSFusedSilicaContext.h | 68 + Source/GSFusedSilicaContext.m | 4 +- Source/GSGuiPrivate.h | 75 + Source/GSHbox.m | 2 +- Source/GSHelpManagerPanel.m | 2 +- Source/GSHorizontalTypesetter.m | 4 +- Source/GSInfoPanel.m | 2 +- Source/GSLayoutManager.m | 4 +- Source/GSMemoryPanel.m | 6 +- Source/GSServicesManager.m | 4 +- Source/GSSimpleLayoutManager.m | 2 +- Source/GSSlideView.m | 2 +- Source/GSTable.m | 2 +- Source/GSTextStorage.m | 2 +- Source/GSTrackingRect.m | 4 +- Source/GSTypesetter.m | 6 +- Source/GSVbox.m | 2 +- Source/NSActionCell.m | 2 +- Source/NSAffineTransform.m | 2 +- Source/NSApplication.m | 10 +- Source/NSAttributedString.m | 2 +- Source/NSBezierPath.m | 4 +- Source/NSBitmapImageRep.m | 4 +- Source/NSBox.m | 2 +- Source/NSBrowser.m | 2 +- Source/NSBrowserCell.m | 2 +- Source/NSBundleAdditions.m | 6 +- Source/NSButton.m | 2 +- Source/NSButtonCell.m | 4 +- Source/NSCachedImageRep.m | 2 +- Source/NSCell.m | 4 +- Source/NSClipView.m | 2 +- Source/NSColor.m | 2 +- Source/NSColorList.m | 2 +- Source/NSColorPanel.m | 4 +- Source/NSColorPicker.m | 2 +- Source/NSColorWell.m | 2 +- Source/NSControl.m | 2 +- Source/NSCursor.m | 2 +- Source/NSCustomImageRep.m | 2 +- Source/NSDataLink.m | 2 +- Source/NSDataLinkManager.m | 2 +- Source/NSDataLinkPanel.m | 2 +- Source/NSDocument.m | 2 +- Source/NSDocumentController.m | 2 +- Source/NSEvent.m | 4 +- Source/NSFileWrapper.m | 2 +- Source/NSFont.m | 6 +- Source/NSFontManager.m | 4 +- Source/NSFontPanel.m | 2 +- Source/NSForm.m | 2 +- Source/NSFormCell.m | 2 +- Source/NSGraphicsContext.m | 2 +- Source/NSHelpManager.m | 2 +- Source/NSHelpPanel.m | 2 +- Source/NSImage.m | 4 +- Source/NSImageCell.m | 2 +- Source/NSImageRep.m | 2 +- Source/NSInterfaceStyle.m | 2 +- Source/NSLayoutManager.m | 2 +- Source/NSMatrix.m | 2 +- Source/NSMenu.m | 2 +- Source/NSMenuItem.m | 4 +- Source/NSMenuItemCell.m | 2 +- Source/NSOpenGLContext.m | 2 +- Source/NSOpenGLPixelFormat.m | 2 +- Source/NSPageLayout.m | 2 +- Source/NSPanel.m | 12 +- Source/NSPasteboard.m | 6 +- Source/NSPopUpButtonCell.m | 2 +- Source/NSPrintOperation.m | 2 +- Source/NSPrintPanel.m | 4 +- Source/NSPrinter.m | 2 +- Source/NSResponder.m | 2 +- Source/NSRulerView.m | 2 +- Source/NSSavePanel.m | 2 +- Source/NSScreen.m | 2 +- Source/NSSecureTextField.m | 2 +- Source/NSSelection.m | 2 +- Source/NSSliderCell.m | 2 +- Source/NSSound.m | 2 +- Source/NSSpellChecker.m | 6 +- Source/NSSpellServer.m | 2 +- Source/NSStepper.m | 2 +- Source/NSStepperCell.m | 2 +- Source/NSTextContainer.m | 2 +- Source/NSTextField.m | 2 +- Source/NSTextFieldCell.m | 2 +- Source/NSTextStorage.m | 2 +- Source/NSTextView.m | 2 +- Source/NSView.m | 10 +- Source/NSWindow.m | 6 +- Source/NSWorkspace.m | 6 +- Source/externs.m | 2 +- Source/nsimage-tiff.h | 79 ++ Source/tiff.m | 4 +- TextConverters/RTF/GNUmakefile.preamble | 2 +- TextConverters/RTF/RTFConsumer.h | 2 +- TextConverters/RTF/RTFProducer.h | 2 +- Tools/GNUmakefile.preamble | 2 +- Tools/example.m | 1 - configure | 8 +- configure.ac | 4 +- 280 files changed, 25303 insertions(+), 257 deletions(-) create mode 100644 Documentation/GuiAdditions/.cvsignore create mode 100644 Documentation/GuiAdditions/GNUmakefile create mode 100644 Documentation/GuiAdditions/GuiAdditions.gsdoc rename Headers/{gnustep/gui => Additions/GNUstepGUI}/.cvsignore (100%) create mode 100644 Headers/Additions/GNUstepGUI/GMAppKit.h create mode 100644 Headers/Additions/GNUstepGUI/GMArchiver.h create mode 100644 Headers/Additions/GNUstepGUI/GSDisplayServer.h create mode 100644 Headers/Additions/GNUstepGUI/GSFontInfo.h create mode 100644 Headers/Additions/GNUstepGUI/GSFusedSilica.h create mode 100644 Headers/Additions/GNUstepGUI/GSHbox.h create mode 100644 Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h create mode 100644 Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h create mode 100644 Headers/Additions/GNUstepGUI/GSInfoPanel.h create mode 100644 Headers/Additions/GNUstepGUI/GSLayoutManager.h create mode 100644 Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h create mode 100644 Headers/Additions/GNUstepGUI/GSMemoryPanel.h create mode 100644 Headers/Additions/GNUstepGUI/GSMethodTable.h create mode 100644 Headers/Additions/GNUstepGUI/GSNibTemplates.h create mode 100644 Headers/Additions/GNUstepGUI/GSPasteboardServer.h create mode 100644 Headers/Additions/GNUstepGUI/GSServicesManager.h create mode 100644 Headers/Additions/GNUstepGUI/GSTable.h create mode 100644 Headers/Additions/GNUstepGUI/GSTextConverter.h create mode 100644 Headers/Additions/GNUstepGUI/GSTrackingRect.h create mode 100644 Headers/Additions/GNUstepGUI/GSTypesetter.h create mode 100644 Headers/Additions/GNUstepGUI/GSVbox.h create mode 100644 Headers/Additions/GNUstepGUI/GSVersion.h create mode 100644 Headers/Additions/GNUstepGUI/GSVersion.h.in create mode 100644 Headers/Additions/GNUstepGUI/IMConnectors.h create mode 100644 Headers/Additions/GNUstepGUI/IMCustomObject.h create mode 100644 Headers/Additions/GNUstepGUI/IMLoading.h create mode 100644 Headers/Additions/GNUstepGUI/config.h.in create mode 100644 Headers/AppKit/AppKit.h create mode 100644 Headers/AppKit/AppKitDefines.h create mode 100644 Headers/AppKit/AppKitExceptions.h create mode 100644 Headers/AppKit/DPSOperators.h create mode 100644 Headers/AppKit/NSActionCell.h create mode 100644 Headers/AppKit/NSAffineTransform.h create mode 100644 Headers/AppKit/NSApplication.h create mode 100644 Headers/AppKit/NSAttributedString.h create mode 100644 Headers/AppKit/NSBezierPath.h create mode 100644 Headers/AppKit/NSBitmapImageRep.h create mode 100644 Headers/AppKit/NSBox.h create mode 100644 Headers/AppKit/NSBrowser.h create mode 100644 Headers/AppKit/NSBrowserCell.h create mode 100644 Headers/AppKit/NSButton.h create mode 100644 Headers/AppKit/NSButtonCell.h create mode 100644 Headers/AppKit/NSCachedImageRep.h create mode 100644 Headers/AppKit/NSCell.h create mode 100644 Headers/AppKit/NSClipView.h create mode 100644 Headers/AppKit/NSColor.h create mode 100644 Headers/AppKit/NSColorList.h create mode 100644 Headers/AppKit/NSColorPanel.h create mode 100644 Headers/AppKit/NSColorPicker.h create mode 100644 Headers/AppKit/NSColorPicking.h create mode 100644 Headers/AppKit/NSColorWell.h create mode 100644 Headers/AppKit/NSComboBox.h create mode 100644 Headers/AppKit/NSComboBoxCell.h create mode 100644 Headers/AppKit/NSControl.h create mode 100644 Headers/AppKit/NSCursor.h create mode 100644 Headers/AppKit/NSCustomImageRep.h create mode 100644 Headers/AppKit/NSDataLink.h create mode 100644 Headers/AppKit/NSDataLinkManager.h create mode 100644 Headers/AppKit/NSDataLinkPanel.h create mode 100644 Headers/AppKit/NSDocument.h create mode 100644 Headers/AppKit/NSDocumentController.h create mode 100644 Headers/AppKit/NSDocumentFrameworkPrivate.h create mode 100644 Headers/AppKit/NSDragging.h create mode 100644 Headers/AppKit/NSDrawer.h create mode 100644 Headers/AppKit/NSEPSImageRep.h create mode 100644 Headers/AppKit/NSEvent.h create mode 100644 Headers/AppKit/NSFileWrapper.h create mode 100644 Headers/AppKit/NSFont.h create mode 100644 Headers/AppKit/NSFontManager.h create mode 100644 Headers/AppKit/NSFontPanel.h create mode 100644 Headers/AppKit/NSForm.h create mode 100644 Headers/AppKit/NSFormCell.h create mode 100644 Headers/AppKit/NSGraphics.h create mode 100644 Headers/AppKit/NSGraphicsContext.h create mode 100644 Headers/AppKit/NSHelpManager.h create mode 100644 Headers/AppKit/NSHelpPanel.h create mode 100644 Headers/AppKit/NSImage.h create mode 100644 Headers/AppKit/NSImageCell.h create mode 100644 Headers/AppKit/NSImageRep.h create mode 100644 Headers/AppKit/NSImageView.h create mode 100644 Headers/AppKit/NSInputManager.h create mode 100644 Headers/AppKit/NSInputServer.h create mode 100644 Headers/AppKit/NSInterfaceStyle.h create mode 100644 Headers/AppKit/NSLayoutManager.h create mode 100644 Headers/AppKit/NSMatrix.h create mode 100644 Headers/AppKit/NSMenu.h create mode 100644 Headers/AppKit/NSMenuItem.h create mode 100644 Headers/AppKit/NSMenuItemCell.h create mode 100644 Headers/AppKit/NSMenuView.h create mode 100644 Headers/AppKit/NSNibConnector.h create mode 100644 Headers/AppKit/NSNibDeclarations.h create mode 100644 Headers/AppKit/NSNibLoading.h create mode 100644 Headers/AppKit/NSOpenGL.h create mode 100644 Headers/AppKit/NSOpenGLView.h create mode 100644 Headers/AppKit/NSOpenPanel.h create mode 100644 Headers/AppKit/NSOutlineView.h create mode 100644 Headers/AppKit/NSPageLayout.h create mode 100644 Headers/AppKit/NSPanel.h create mode 100644 Headers/AppKit/NSParagraphStyle.h create mode 100644 Headers/AppKit/NSPasteboard.h create mode 100644 Headers/AppKit/NSPopUpButton.h create mode 100644 Headers/AppKit/NSPopUpButtonCell.h create mode 100644 Headers/AppKit/NSPrintInfo.h create mode 100644 Headers/AppKit/NSPrintOperation.h create mode 100644 Headers/AppKit/NSPrintPanel.h create mode 100644 Headers/AppKit/NSPrinter.h create mode 100644 Headers/AppKit/NSProgressIndicator.h create mode 100644 Headers/AppKit/NSResponder.h create mode 100644 Headers/AppKit/NSRulerMarker.h create mode 100644 Headers/AppKit/NSRulerView.h create mode 100644 Headers/AppKit/NSSavePanel.h create mode 100644 Headers/AppKit/NSScreen.h create mode 100644 Headers/AppKit/NSScrollView.h create mode 100644 Headers/AppKit/NSScroller.h create mode 100644 Headers/AppKit/NSSecureTextField.h create mode 100644 Headers/AppKit/NSSelection.h create mode 100644 Headers/AppKit/NSSlider.h create mode 100644 Headers/AppKit/NSSliderCell.h create mode 100644 Headers/AppKit/NSSound.h create mode 100644 Headers/AppKit/NSSpellChecker.h create mode 100644 Headers/AppKit/NSSpellProtocol.h create mode 100644 Headers/AppKit/NSSpellServer.h create mode 100644 Headers/AppKit/NSSplitView.h create mode 100644 Headers/AppKit/NSStepper.h create mode 100644 Headers/AppKit/NSStepperCell.h create mode 100644 Headers/AppKit/NSStringDrawing.h create mode 100644 Headers/AppKit/NSTabView.h create mode 100644 Headers/AppKit/NSTabViewItem.h create mode 100644 Headers/AppKit/NSTableColumn.h create mode 100644 Headers/AppKit/NSTableHeaderCell.h create mode 100644 Headers/AppKit/NSTableHeaderView.h create mode 100644 Headers/AppKit/NSTableView.h create mode 100644 Headers/AppKit/NSText.h create mode 100644 Headers/AppKit/NSTextAttachment.h create mode 100644 Headers/AppKit/NSTextContainer.h create mode 100644 Headers/AppKit/NSTextField.h create mode 100644 Headers/AppKit/NSTextFieldCell.h create mode 100644 Headers/AppKit/NSTextStorage.h create mode 100644 Headers/AppKit/NSTextView.h create mode 100644 Headers/AppKit/NSToolbar.h create mode 100644 Headers/AppKit/NSToolbarItem.h create mode 100644 Headers/AppKit/NSUserInterfaceValidation.h create mode 100644 Headers/AppKit/NSView.h create mode 100644 Headers/AppKit/NSWindow.h create mode 100644 Headers/AppKit/NSWindowController.h create mode 100644 Headers/AppKit/NSWorkspace.h create mode 100644 Headers/AppKit/PSOperators.h create mode 100644 Source/CompatibilityHeaders.make create mode 100644 Source/GSFusedSilicaContext.h create mode 100644 Source/GSGuiPrivate.h create mode 100644 Source/nsimage-tiff.h diff --git a/ChangeLog b/ChangeLog index d8ae193c1..d302f9059 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,210 @@ +2003-07-31 David Ayers + + * Created tag 'pre-header-reorg-20030731'. + + * Headers/Additions/GNUstepGUI: New directory. + * Headers/AppKit: Ditto. + * Headers/gnustep/gui: Obsoleted. + + * Headers/Additions/GNUstepGUI/GMAppKit.h: Moved here from + Headers/gnustep/gui. + * Headers/Additions/GNUstepGUI/GMArchiver.h: Ditto. + * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Ditto. + * Headers/Additions/GNUstepGUI/GSFontInfo.h: Ditto. + * Headers/Additions/GNUstepGUI/GSFusedSilica.h: Ditto. + * Headers/Additions/GNUstepGUI/GSHbox.h: Ditto. + * Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h: Ditto. + * Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h: Ditto. + * Headers/Additions/GNUstepGUI/GSInfoPanel.h: Ditto. + * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Ditto. + * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: Ditto. + * Headers/Additions/GNUstepGUI/GSMemoryPanel.h: Ditto. + * Headers/Additions/GNUstepGUI/GSMethodTable.h: Ditto. + * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Ditto. + * Headers/Additions/GNUstepGUI/GSPasteboardServer.h: Ditto. + * Headers/Additions/GNUstepGUI/GSServicesManager.h: Ditto. + * Headers/Additions/GNUstepGUI/GSTable.h: Ditto. + * Headers/Additions/GNUstepGUI/GSTextConverter.h: Ditto. + * Headers/Additions/GNUstepGUI/GSTrackingRect.h: Ditto. + * Headers/Additions/GNUstepGUI/GSTypesetter.h: Ditto. + * Headers/Additions/GNUstepGUI/GSVbox.h: Ditto. + * Headers/Additions/GNUstepGUI/GSVersion.h: Ditto. + * Headers/Additions/GNUstepGUI/GSVersion.h.in: Ditto. + * Headers/Additions/GNUstepGUI/IMConnectors.h: Ditto. + * Headers/Additions/GNUstepGUI/IMCustomObject.h: Ditto. + * Headers/Additions/GNUstepGUI/IMLoading.h: Ditto. + * Headers/Additions/GNUstepGUI/.cvsignore: Ditto. + + * Headers/AppKit/AppKit.h: Ditto. + * Headers/AppKit/AppKitDefines.h: Ditto. + * Headers/AppKit/AppKitExceptions.h: Ditto. + * Headers/AppKit/DPSOperators.h: Ditto. + * Headers/AppKit/NSActionCell.h: Ditto. + * Headers/AppKit/NSAffineTransform.h: Ditto. + * Headers/AppKit/NSApplication.h: Ditto. + * Headers/AppKit/NSAttributedString.h: Ditto. + * Headers/AppKit/NSBezierPath.h: Ditto. + * Headers/AppKit/NSBitmapImageRep.h: Ditto. + * Headers/AppKit/NSBox.h: Ditto. + * Headers/AppKit/NSBrowser.h: Ditto. + * Headers/AppKit/NSBrowserCell.h: Ditto. + * Headers/AppKit/NSButton.h: Ditto. + * Headers/AppKit/NSButtonCell.h: Ditto. + * Headers/AppKit/NSCachedImageRep.h: Ditto. + * Headers/AppKit/NSCell.h: Ditto. + * Headers/AppKit/NSClipView.h: Ditto. + * Headers/AppKit/NSColor.h: Ditto. + * Headers/AppKit/NSColorList.h: Ditto. + * Headers/AppKit/NSColorPanel.h: Ditto. + * Headers/AppKit/NSColorPicker.h: Ditto. + * Headers/AppKit/NSColorPicking.h: Ditto. + * Headers/AppKit/NSColorWell.h: Ditto. + * Headers/AppKit/NSComboBox.h: Ditto. + * Headers/AppKit/NSComboBoxCell.h: Ditto. + * Headers/AppKit/NSControl.h: Ditto. + * Headers/AppKit/NSCursor.h: Ditto. + * Headers/AppKit/NSCustomImageRep.h: Ditto. + * Headers/AppKit/NSDataLink.h: Ditto. + * Headers/AppKit/NSDataLinkManager.h: Ditto. + * Headers/AppKit/NSDataLinkPanel.h: Ditto. + * Headers/AppKit/NSDocument.h: Ditto. + * Headers/AppKit/NSDocumentController.h: Ditto. + * Headers/AppKit/NSDocumentFrameworkPrivate.h: Ditto. + * Headers/AppKit/NSDragging.h: Ditto. + * Headers/AppKit/NSDrawer.h: Ditto. + * Headers/AppKit/NSEPSImageRep.h: Ditto. + * Headers/AppKit/NSEvent.h: Ditto. + * Headers/AppKit/NSFileWrapper.h: Ditto. + * Headers/AppKit/NSFont.h: Ditto. + * Headers/AppKit/NSFontManager.h: Ditto. + * Headers/AppKit/NSFontPanel.h: Ditto. + * Headers/AppKit/NSForm.h: Ditto. + * Headers/AppKit/NSFormCell.h: Ditto. + * Headers/AppKit/NSGraphics.h: Ditto. + * Headers/AppKit/NSGraphicsContext.h: Ditto. + * Headers/AppKit/NSHelpManager.h: Ditto. + * Headers/AppKit/NSHelpPanel.h: Ditto. + * Headers/AppKit/NSImage.h: Ditto. + * Headers/AppKit/NSImageCell.h: Ditto. + * Headers/AppKit/NSImageRep.h: Ditto. + * Headers/AppKit/NSImageView.h: Ditto. + * Headers/AppKit/NSInputManager.h: Ditto. + * Headers/AppKit/NSInputServer.h: Ditto. + * Headers/AppKit/NSInterfaceStyle.h: Ditto. + * Headers/AppKit/NSLayoutManager.h: Ditto. + * Headers/AppKit/NSMatrix.h: Ditto. + * Headers/AppKit/NSMenu.h: Ditto. + * Headers/AppKit/NSMenuItem.h: Ditto. + * Headers/AppKit/NSMenuItemCell.h: Ditto. + * Headers/AppKit/NSMenuView.h: Ditto. + * Headers/AppKit/NSNibConnector.h: Ditto. + * Headers/AppKit/NSNibDeclarations.h: Ditto. + * Headers/AppKit/NSNibLoading.h: Ditto. + * Headers/AppKit/NSOpenGL.h: Ditto. + * Headers/AppKit/NSOpenGLView.h: Ditto. + * Headers/AppKit/NSOpenPanel.h: Ditto. + * Headers/AppKit/NSOutlineView.h: Ditto. + * Headers/AppKit/NSPageLayout.h: Ditto. + * Headers/AppKit/NSPanel.h: Ditto. + * Headers/AppKit/NSParagraphStyle.h: Ditto. + * Headers/AppKit/NSPasteboard.h: Ditto. + * Headers/AppKit/NSPopUpButton.h: Ditto. + * Headers/AppKit/NSPopUpButtonCell.h: Ditto. + * Headers/AppKit/NSPrintInfo.h: Ditto. + * Headers/AppKit/NSPrintOperation.h: Ditto. + * Headers/AppKit/NSPrintPanel.h: Ditto. + * Headers/AppKit/NSPrinter.h: Ditto. + * Headers/AppKit/NSProgressIndicator.h: Ditto. + * Headers/AppKit/NSResponder.h: Ditto. + * Headers/AppKit/NSRulerMarker.h: Ditto. + * Headers/AppKit/NSRulerView.h: Ditto. + * Headers/AppKit/NSSavePanel.h: Ditto. + * Headers/AppKit/NSScreen.h: Ditto. + * Headers/AppKit/NSScrollView.h: Ditto. + * Headers/AppKit/NSScroller.h: Ditto. + * Headers/AppKit/NSSecureTextField.h: Ditto. + * Headers/AppKit/NSSelection.h: Ditto. + * Headers/AppKit/NSSlider.h: Ditto. + * Headers/AppKit/NSSliderCell.h: Ditto. + * Headers/AppKit/NSSound.h: Ditto. + * Headers/AppKit/NSSpellChecker.h: Ditto. + * Headers/AppKit/NSSpellProtocol.h: Ditto. + * Headers/AppKit/NSSpellServer.h: Ditto. + * Headers/AppKit/NSSplitView.h: Ditto. + * Headers/AppKit/NSStepper.h: Ditto. + * Headers/AppKit/NSStepperCell.h: Ditto. + * Headers/AppKit/NSStringDrawing.h: Ditto. + * Headers/AppKit/NSTabView.h: Ditto. + * Headers/AppKit/NSTabViewItem.h: Ditto. + * Headers/AppKit/NSTableColumn.h: Ditto. + * Headers/AppKit/NSTable* HeaderCell.h: Ditto. + * Headers/AppKit/NSTable* HeaderView.h: Ditto. + * Headers/AppKit/NSTableView.h: Ditto. + * Headers/AppKit/NSText.h: Ditto. + * Headers/AppKit/NSTextAttachment.h: Ditto. + * Headers/AppKit/NSTextContainer.h: Ditto. + * Headers/AppKit/NSTextField.h: Ditto. + * Headers/AppKit/NSTextFieldCell.h: Ditto. + * Headers/AppKit/NSTextStorage.h: Ditto. + * Headers/AppKit/NSTextView.h: Ditto. + * Headers/AppKit/NSToolbar.h: Ditto. + * Headers/AppKit/NSToolbarItem.h: Ditto. + * Headers/AppKit/NSUserInterfaceValidation.h: Ditto. + * Headers/AppKit/NSView.h: Ditto. + * Headers/AppKit/NSWindow.h: Ditto. + * Headers/AppKit/NSWindowController.h: Ditto. + * Headers/AppKit/NSWorkspace.h: Ditto. + * Headers/AppKit/PSOperators.h: Ditto. + + * configure.ac: Update to new header structure. + * configure: Regenerated. + * GNUmakefile.postamble: Remove handling of header-links and + update to new header structure. + + * Source/GNUmakefile: Update to new header structure. + Install gnustep specific headers in GNUstepGUI by splitting + libgnustep-gui_HEADER_FILES into APPKIT_HEADERS and GUI_HEADERS. + Include CompatibilityHeaders.make makefile fragement. + + * Source/GNUmakefile.preamble: Update to new header structure. + * Source/CompatibilityHeaders.make: New file which installs dummy + headers in the place of the old headers, warning about obsoleting + the old location and includeing the header from its new location. + + * Source/GNUmakefile.postamble: Install AppKit Headers manually. + * Source/*.[hm]: Update includes for new header structure. + * Source/GSGuiPrivate.h: Moved here from Headers/gnustep/gui. + * Source/GSFusedSilica.h: Ditto. + * Source/nsimage-tiff.h: Ditto. + + * Tools/GNUmakefile.preamble: Update to new header structure. + * Tools/example.m: Remove include of config.h. + + * ColorPickers/GNUmakefile: Update to new header structure. + * ColorPickers/*.[hm]: Ditto. + + * TextConverters/RTF/GNUmakefile.preamble: Update to new header + structure. + * TextConverters/RTF/*.[hm]: Ditto. + + * Documentation/gnustep-gui.texi: Update to new header structure. + * Documentation/Gui/Gui.gsdoc: Remmove gnustep additions. + * Documentation/GuiAdditions/.cvsignore: New file. + * Documentation/GuiAdditions/GNUmakefile: Ditto. + * Documentation/GuiAdditions/GuiAdditions.gsdoc: Ditto. + + * Model/GNUmakefile: Update to new header structure. + * GNUmakefile.postamble: Ditto. + * Model/*.[hm]: Ditto. + + * Resources/GNUmakefile: Update to new header structure. + + * Source/DocMakefile: Update to new header structure. + Added GuiAdditions to DOCUMENT_NAME. + Split AUTOGSDOC_HEADERS into AUTOGSDOC_HEADERS_GUI and + AUTOGSDOC_HEADERS_GUIADD. + + 2003-07-31 Michael Hanni * Source/NSBrowserCell.m (drawInteriorWithFrame:inView:): Remove diff --git a/ColorPickers/GNUmakefile b/ColorPickers/GNUmakefile index a78b16ff6..cfb6affeb 100644 --- a/ColorPickers/GNUmakefile +++ b/ColorPickers/GNUmakefile @@ -37,7 +37,7 @@ BUNDLE_NAME = StandardPicker NamedPicker WheelPicker BUNDLE_INSTALL_DIR = $(GNUSTEP_LIBRARY)/ColorPickers -ADDITIONAL_INCLUDE_DIRS += -I../Headers -I../Headers/gnustep +ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) -L../Models/$(GNUSTEP_OBJ_DIR) diff --git a/ColorPickers/GSGrayColorPicker.m b/ColorPickers/GSGrayColorPicker.m index d17ccd094..4eb837860 100644 --- a/ColorPickers/GSGrayColorPicker.m +++ b/ColorPickers/GSGrayColorPicker.m @@ -26,7 +26,7 @@ #include "GSGrayColorPicker.h" -#include +#include @implementation GSGrayColorPicker diff --git a/ColorPickers/GSStandardColorPicker.m b/ColorPickers/GSStandardColorPicker.m index 8220a7f83..489d0477e 100644 --- a/ColorPickers/GSStandardColorPicker.m +++ b/ColorPickers/GSStandardColorPicker.m @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include "GSRGBColorPicker.h" #include "GSHSBColorPicker.h" #include "GSCMYKColorPicker.h" @@ -274,8 +274,8 @@ #include "GSStandardColorPicker.h" -#include -#include +#include +#include #define KNOB_WIDTH 6 diff --git a/ColorPickers/GSWheelColorPicker.m b/ColorPickers/GSWheelColorPicker.m index 7050a9c44..bc4758f04 100644 --- a/ColorPickers/GSWheelColorPicker.m +++ b/ColorPickers/GSWheelColorPicker.m @@ -32,7 +32,7 @@ #include #include -#include +#include @interface GSColorWheel : NSView diff --git a/Documentation/Gui/Gui.gsdoc b/Documentation/Gui/Gui.gsdoc index 1acceabe3..e15b387fc 100644 --- a/Documentation/Gui/Gui.gsdoc +++ b/Documentation/Gui/Gui.gsdoc @@ -139,15 +139,6 @@ NSWindowController NSWorkspace -

- Documentation on non-OpenStep, non-MacOSX, and private classes -

- - GSDisplayServer - GSHbox - GSTable - GSVbox - diff --git a/Documentation/GuiAdditions/.cvsignore b/Documentation/GuiAdditions/.cvsignore new file mode 100644 index 000000000..5d85461c5 --- /dev/null +++ b/Documentation/GuiAdditions/.cvsignore @@ -0,0 +1,14 @@ +Functions.gsdoc +Functions.html +GSDisplayServer.gsdoc +GSDisplayServer.html +GSHbox.gsdoc +GSHbox.html +GSTable.gsdoc +GSTable.html +GSVbox.gsdoc +GSVbox.html +GuiAdditions.html +GuiAdditions.igsdoc +TypesAndConstants.gsdoc +TypesAndConstants.html diff --git a/Documentation/GuiAdditions/GNUmakefile b/Documentation/GuiAdditions/GNUmakefile new file mode 100644 index 000000000..0e23be3c0 --- /dev/null +++ b/Documentation/GuiAdditions/GNUmakefile @@ -0,0 +1,50 @@ +# +# GuiAdditions gsdoc makefile for the GNUstep Gui Library +# Copyright (C) 2000 Free Software Foundation, Inc. +# +# Written by: Adam Fedor +# +# This file is part of the GNUstep Gui Library. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + +GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../gui.make +include $(GNUSTEP_MAKEFILES)/common.make + +# The documents to be generated +DOCUMENT_NAME = GuiAdditions + +GuiAdditions_AGSDOC_FILES = \ + +GuiAdditions_AGSDOC_FLAGS = \ + -DocumentationDirectory . \ + -Declared \ + -Standards YES \ + -WordMap '{\ + APPKIT_EXPORT=extern;APPKIT_DECLARE="";\ + }' -Up GuiAdditions + +GuiAdditions_DOC_INSTALL_DIR = Developer/GuiAdditions/Reference + +-include GNUmakefile.preamble + +-include GNUmakefile.local + +include $(GNUSTEP_MAKEFILES)/documentation.make + +-include GNUmakefile.postamble diff --git a/Documentation/GuiAdditions/GuiAdditions.gsdoc b/Documentation/GuiAdditions/GuiAdditions.gsdoc new file mode 100644 index 000000000..4fdbfb43e --- /dev/null +++ b/Documentation/GuiAdditions/GuiAdditions.gsdoc @@ -0,0 +1,34 @@ + + + + + GuiAdditions + + + + + $Revision$ + $Date$ + + + + GuiAdditions +

+ Extensions to the GNUstep GUI library - a free + software library compatible with the OpenStep Application Kit (tm). +

+

+ We also have reference documentation for the classes, though this is + currently very sketchy, mostly consisting of listings of class + methods and the arguments they take. +

+ + GSDisplayServer + GSHbox + GSTable + GSVbox + + +
+ +
diff --git a/Documentation/gnustep-gui.texi b/Documentation/gnustep-gui.texi index 7707dc706..d0a45aec0 100644 --- a/Documentation/gnustep-gui.texi +++ b/Documentation/gnustep-gui.texi @@ -327,7 +327,7 @@ The feature is experimental in all senses: it could be unstable. Inherits from: @code{GSTable: NSView: NSResponder: NSObject}@* Conforms to: @code{NSCoding} (from @code{NSResponder})@* @ @ @ @ @ @ @ @code{NSObject} (from @code{NSObject})@* -Declared in: @file{AppKit/GSHbox.h} +Declared in: @file{GNUstepGUI/GSHbox.h} @end display @code{GSHbox} is a GNUstep GUI extension to the OpenStep specification. @@ -645,7 +645,7 @@ Return the number of views (separators included) in the GSHbox. @b{Inherits from:} @code{NSView: NSResponder: NSObject}@* @b{Conforms to:} @code{NSCoding} (from @code{NSResponder}), @code{NSObject} (from @code{NSObject})@* -@b{Declared in:} @file{AppKit/GSTable.h} +@b{Declared in:} @file{GNUstepGUI/GSTable.h} @end display @code{GSTable} is a GNUstep GUI extension to the OpenStep specification. @@ -1008,7 +1008,7 @@ Return the number of columns in the @code{GSTable}. @b{Inherits from:} @code{GSTable: NSView: NSResponder: NSObject}@* @b{Conforms to:} @code{NSCoding} (from @code{NSResponder}), @code{NSObject} (from @code{NSObject})@* -@b{Declared in:} @file{AppKit/GSVbox.h} +@b{Declared in:} @file{GNUstepGUI/GSVbox.h} @end display @code{GSVbox} is a GNUstep GUI extension to the OpenStep specification. diff --git a/GNUmakefile.postamble b/GNUmakefile.postamble index 18d9b9a39..e4ab24bcb 100644 --- a/GNUmakefile.postamble +++ b/GNUmakefile.postamble @@ -36,7 +36,7 @@ # # Things to do before compiling -before-all:: header-links +# before-all:: # Things to do after compiling # after-all:: @@ -77,7 +77,7 @@ after-clean:: # before-distclean:: # Things to do after distcleaning -after-distclean:: remove-header-links +after-distclean:: rm -f config.status config.log config.cache TAGS config.mak gui.make gui.make: gui.make.in @@ -92,28 +92,6 @@ config.make: config.make.in # Things to do after checking # after-check:: -.PHONY: header-links remove-header-links +.PHONY: -ifeq ($(GNUSTEP_TARGET_OS), mingw32) -header-links: $(HEADER_LINK_DEPENDS) - -rm -rf Headers/AppKit - -rm -rf Headers/DPSClient - -mkdir Headers/AppKit - -mkdir Headers/DPSClient - cp -f Headers/gnustep/gui/*.h Headers/AppKit - cp -f Headers/gnustep/gui/*.h Headers/DPSClient -remove-header-links: - -rm -rf Headers/AppKit - -rm -rf Headers/DPSClient - -else -header-links: $(HEADER_LINK_DEPENDS) - -rm -rf Headers/AppKit - -rm -rf Headers/DPSClient - $(LN_S) gnustep/gui Headers/AppKit - $(LN_S) gnustep/gui Headers/DPSClient -remove-header-links: - -rm -f Headers/AppKit - -rm -f Headers/DPSClient -endif diff --git a/Headers/gnustep/gui/.cvsignore b/Headers/Additions/GNUstepGUI/.cvsignore similarity index 100% rename from Headers/gnustep/gui/.cvsignore rename to Headers/Additions/GNUstepGUI/.cvsignore diff --git a/Headers/Additions/GNUstepGUI/GMAppKit.h b/Headers/Additions/GNUstepGUI/GMAppKit.h new file mode 100644 index 000000000..85af69cf7 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GMAppKit.h @@ -0,0 +1,98 @@ +/* + GMAppKit.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: November 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_GMAppKit +#define _GNUstep_H_GMAppKit + +#include +#include + +@interface NSApplication (GMArchiverMethods) +@end + +@interface NSBox (GMArchiverMethods) +@end + +@interface NSButton (GMArchiverMethods) +@end + +@interface NSCell (GMArchiverMethods) +@end + +@interface NSClipView (GMArchiverMethods) +@end + +@interface NSColor (GMArchiverMethods) +@end + +@interface NSControl (GMArchiverMethods) +@end + +@interface NSFont (GMArchiverMethods) +@end + +@interface NSImage (GMArchiverMethods) +@end + +@interface NSMenuItem (GMArchiverMethods) +@end + +@interface NSMenu (GMArchiverMethods) +@end + +@interface NSPopUpButton (GMArchiverMethods) +@end + +@interface NSResponder (GMArchiverMethods) +@end + +@interface NSTextField (GMArchiverMethods) +@end + +@interface NSSecureTextFieldCell (GMArchiverMethods) +@end + +@interface NSView (GMArchiverMethods) +@end + +@interface NSWindow (GMArchiverMethods) +@end + +@interface NSPanel (GMArchiverMethods) +@end + +@interface NSSavePanel (GMArchiverMethods) +@end + +@interface NSBrowser (GMArchiverMethods) +@end + +@interface NSText (GMArchiverMethods) +@end + +@interface NSTextView (GMArchiverMethods) +@end + +#endif /* _GNUstep_H_GMAppKit */ diff --git a/Headers/Additions/GNUstepGUI/GMArchiver.h b/Headers/Additions/GNUstepGUI/GMArchiver.h new file mode 100644 index 000000000..11bb49131 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GMArchiver.h @@ -0,0 +1,200 @@ +/* + GMArchiver.h + + Author: Ovidiu Predescu + Date: October 1997 + + Copyright (C) 1997 Free Software Foundation, Inc. + All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* Portions of the code are based on NSArchiver from libFoundation. See the + COPYING file from libFoundation for copyright information. */ + +#ifndef __GMArchiver_h__ +#define __GMArchiver_h__ + +#ifndef GNUSTEP +#include +#else +#include +#include +#include +#include +#endif + +@class NSString; +@class NSData; +@class NSArray; +@class NSDictionary; +@class NSMutableArray; +@class NSMutableDictionary; + +@class GMArchiver; +@class GMUnarchiver; + + +/* The objects that want to be archived the following protocol. */ + +@protocol ModelCoding + +/* These methods are much like those from the NSCoding protocol. + The difference is that you can specify names for the instance + variables or attributes you encode. The recommended way is not to encode + instance variables but attributes so that an archive file does not + depend on the particular version of a class or on different + instance variable names of the class from another implementation. */ + +- (void)encodeWithModelArchiver:(GMArchiver*)archiver; +- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver; +@end + + +@interface NSObject (ModelArchivingMethods) +- (id)replacementObjectForModelArchiver:(GMArchiver*)archiver; +- (Class)classForModelArchiver; ++ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver; +@end + + +@interface GMArchiver : NSObject +{ + NSMutableDictionary* propertyList; + NSMutableArray* topLevelObjects; + id lastObjectRepresentation; + NSMapTable* objects; // object -> name + NSHashTable* conditionals; // conditional objects + NSMapTable* classes; // real classname -> class info + int counter; + int level; + BOOL writingRoot; // YES if encodeRootObject:withName: was sent + BOOL findingConditionals; // YES if finding conditionals +} + +/* Initializing an GMArchiver */ +- (id)init; + +/* Archiving Data */ ++ (BOOL)archiveRootObject:(id)rootObject + toFile:(NSString*)path; +- (BOOL)writeToFile:(NSString*)path; + +/* Getting the property list representation from the GMArchiver */ +- (id)propertyList; + +/* Encoding objects */ +- (id)encodeRootObject:(id)rootObject withName:(NSString*)name; +- (id)encodeConditionalObject:(id)object withName:(NSString*)name; +- (id)encodeObject:(id)anObject withName:(NSString*)name; +- (id)encodeString:(NSString*)anObject withName:(NSString*)name; +- (id)encodeArray:(NSArray*)array withName:(NSString*)name; +- (id)encodeDictionary:(NSDictionary*)dictionary withName:(NSString*)name; +- (id)encodeData:(NSData*)anObject withName:(NSString*)name; +- (id)encodeClass:(Class)class withName:(NSString*)name; +- (id)encodeSelector:(SEL)selector withName:(NSString*)name; + +/* Encoding the most common C types */ +- (void)encodeChar:(char)value withName:(NSString*)name; +- (void)encodeUnsignedChar:(unsigned char)value withName:(NSString*)name; +- (void)encodeBOOL:(BOOL)value withName:(NSString*)name; +- (void)encodeShort:(short)value withName:(NSString*)name; +- (void)encodeUnsignedShort:(unsigned short)value withName:(NSString*)name; +- (void)encodeInt:(int)value withName:(NSString*)name; +- (void)encodeUnsignedInt:(unsigned int)value withName:(NSString*)name; +- (void)encodeLong:(long)value withName:(NSString*)name; +- (void)encodeUnsignedLong:(unsigned long)value withName:(NSString*)name; +- (void)encodeFloat:(float)value withName:(NSString*)name; +- (void)encodeDouble:(double)value withName:(NSString*)name; + +/* Encoding geometry types */ +- (void)encodePoint:(NSPoint)point withName:(NSString*)name; +- (void)encodeSize:(NSSize)size withName:(NSString*)name; +- (void)encodeRect:(NSRect)rect withName:(NSString*)name; + +/* Substituting One Class for Another */ +- (NSString*)classNameEncodedForTrueClassName:(NSString*)trueName; +- (void)encodeClassName:(NSString*)trueName + intoClassName:(NSString*)inArchiveName; + +@end /* GMArchiver */ + + +@interface GMUnarchiver : NSObject +{ + NSMutableDictionary* propertyList; + id currentDecodedObjectRepresentation; + NSMutableDictionary* namesToObjects; // object name -> object + int level; + int version; + NSZone* objectZone; +} + +/* Initializing an GMUnarchiver */ ++ (id)unarchiverWithContentsOfFile:(NSString*)filename; +- (id)initForReadingWithPropertyList:(id)propertyList; + +/* Decoding Objects */ ++ (id)unarchiveObjectWithName:(NSString*)name + fromPropertyList:(id)propertyList; ++ (id)unarchiveObjectWithName:(NSString*)name fromFile:(NSString*)path; + +/* Decoding objects */ +- (id)decodeObjectWithName:(NSString*)name; +- (NSString*)decodeStringWithName:(NSString*)name; +- (NSArray*)decodeArrayWithName:(NSString*)name; +- (NSDictionary*)decodeDictionaryWithName:(NSString*)name; +- (NSData*)decodeDataWithName:(NSString*)name; +- (Class)decodeClassWithName:(NSString*)name; +- (SEL)decodeSelectorWithName:(NSString*)name; + +/* Decoding the most common C types */ +- (char)decodeCharWithName:(NSString*)name; +- (unsigned char)decodeUnsignedCharWithName:(NSString*)name; +- (BOOL)decodeBOOLWithName:(NSString*)name; +- (short)decodeShortWithName:(NSString*)name; +- (unsigned short)decodeUnsignedShortWithName:(NSString*)name; +- (int)decodeIntWithName:(NSString*)name; +- (unsigned int)decodeUnsignedIntWithName:(NSString*)name; +- (long)decodeLongWithName:(NSString*)name; +- (unsigned long)decodeUnsignedLongWithName:(NSString*)name; +- (float)decodeFloatWithName:(NSString*)name; +- (double)decodeDoubleWithName:(NSString*)name; + +/* Decoding geometry types */ +- (NSPoint)decodePointWithName:(NSString*)name; +- (NSSize)decodeSizeWithName:(NSString*)name; +- (NSRect)decodeRectWithName:(NSString*)name; + +/* Managing an GMUnarchiver */ +- (BOOL)isAtEnd; +- (NSZone*)objectZone; +- (void)setObjectZone:(NSZone*)zone; +- (unsigned int)systemVersion; + +/* Substituting One Class for Another */ ++ (NSString*)classNameDecodedForArchiveClassName:(NSString*)nameInArchive; ++ (void)decodeClassName:(NSString*)nameInArchive + asClassName:(NSString*)trueName; +- (NSString*)classNameDecodedForArchiveClassName:(NSString*)nameInArchive; +- (void)decodeClassName:(NSString*)nameInArchive + asClassName:(NSString*)trueName; +- (unsigned int)versionForClassName:(NSString*)className; + +@end + +#endif /* __GMArchiver_h__ */ diff --git a/Headers/Additions/GNUstepGUI/GSDisplayServer.h b/Headers/Additions/GNUstepGUI/GSDisplayServer.h new file mode 100644 index 000000000..0278a486b --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSDisplayServer.h @@ -0,0 +1,185 @@ +/** GSDisplayServer + + Abstract display server class. + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Adam Fedor + Date: Mar 2002 + + This file is part of the GNU Objective C User interface library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _GSDisplayServer_h_INCLUDE +#define _GSDisplayServer_h_INCLUDE + +#include +#include +#include +#include + +#include +#include +#include + +@class NSArray; +@class NSMutableDictionary; +@class NSEvent; +@class NSImage; +@class NSMutableArray; +@class NSMutableData; +@class GSDisplayServer; + +#ifndef NO_GNUSTEP +APPKIT_EXPORT GSDisplayServer * GSServerForWindow(NSWindow *window); +APPKIT_EXPORT GSDisplayServer * GSCurrentServer(void); + +/* Display attributes */ +APPKIT_EXPORT NSString * GSDisplayName; +APPKIT_EXPORT NSString * GSDisplayNumber; +APPKIT_EXPORT NSString * GSScreenNumber; + +@interface GSDisplayServer : NSObject +{ + NSMutableDictionary *server_info; + NSMutableArray *event_queue; + NSMapTable *drag_types; +} + ++ (void) setDefaultServerClass: (Class)aClass; ++ (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes; ++ (void) setCurrentServer: (GSDisplayServer *)server; + +- initWithAttributes: (NSDictionary *)attributes; +- (NSDictionary *) attributes; +- (void) closeServer; + +/* GL context */ +- glContextClass; +- glPixelFormatClass; + +/* Drag and drop support. */ ++ (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win; ++ (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win; ++ (NSCountedSet*) dragTypesForWindow: (NSWindow *)win; +- (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win; +- (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win; +- (NSCountedSet*) dragTypesForWindow: (NSWindow *)win; +- (id ) dragInfo; +- (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to; +- (void) restrictWindow: (int)win toImage: (NSImage*)image; + +/* Screen information */ +- (NSSize) resolutionForScreen: (int)screen; +- (NSRect) boundsForScreen: (int)screen; +- (NSWindowDepth) windowDepthForScreen: (int)screen; +- (const NSWindowDepth *) availableDepthsForScreen: (int)screen; +- (NSArray *) screenList; + +- (void *) serverDevice; +- (void *) windowDevice: (int)win; + +- (void) beep; +@end + +/* ----------------------------------------------------------------------- */ +/* GNUstep Window operations */ +/* ----------------------------------------------------------------------- */ +@interface GSDisplayServer (WindowOps) +- (void) _setWindowOwnedByServer: (int)win; +- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style; +- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style + : (int)screen; +- (void) termwindow: (int) win; +- (void) stylewindow: (unsigned int) style : (int) win; +- (void) windowbacking: (NSBackingStoreType)type : (int) win; +- (void) titlewindow: (NSString *) window_title : (int) win; +- (void) miniwindow: (int) win; +- (BOOL) appOwnsMiniwindow; +- (void) windowdevice: (int) win; +- (void) orderwindow: (int) op : (int) otherWin : (int) win; +- (void) movewindow: (NSPoint)loc : (int) win; +- (void) placewindow: (NSRect)frame : (int) win; +- (NSRect) windowbounds: (int) win; +- (void) setwindowlevel: (int) level : (int) win; +- (int) windowlevel: (int) win; +- (NSArray *) windowlist; +- (int) windowdepth: (int) win; +- (void) setmaxsize: (NSSize)size : (int) win; +- (void) setminsize: (NSSize)size : (int) win; +- (void) setresizeincrements: (NSSize)size : (int) win; +- (void) flushwindowrect: (NSRect)rect : (int) win; +- (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b + : (unsigned int) style; +- (void) docedited: (int) edited : (int) win; +- (void) setinputstate: (int)state : (int)win; +- (void) setinputfocus: (int) win; + +- (NSPoint) mouselocation; +- (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win; +- (BOOL) capturemouse: (int) win; +- (void) releasemouse; +- (void) hidecursor; +- (void) showcursor; +- (void) standardcursor: (int) style : (void**) cid; +- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors : (const char*) image : (void**) cid; +- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid; + +@end + +/* ----------------------------------------------------------------------- */ +/* GNUstep Event Operations */ +/* ----------------------------------------------------------------------- */ +@interface GSDisplayServer (EventOps) +- (NSEvent*) getEventMatchingMask: (unsigned)mask + beforeDate: (NSDate*)limit + inMode: (NSString*)mode + dequeue: (BOOL)flag; +- (void) discardEventsMatchingMask: (unsigned)mask + beforeEvent: (NSEvent*)limit; +- (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag; +@end + + +static inline NSEvent* +DPSGetEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode) +{ + return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode + dequeue: YES]; +} + +static inline NSEvent* +DPSPeekEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode) +{ + return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode + dequeue: NO]; +} + +static inline void +DPSDiscardEvents(GSDisplayServer *ctxt, unsigned mask, NSEvent* limit) +{ + [ctxt discardEventsMatchingMask: mask beforeEvent: limit]; +} + +static inline void +DPSPostEvent(GSDisplayServer *ctxt, NSEvent* anEvent, BOOL atStart) +{ + [ctxt postEvent: anEvent atStart: atStart]; +} + +#endif /* NO_GNUSTEP */ +#endif diff --git a/Headers/Additions/GNUstepGUI/GSFontInfo.h b/Headers/Additions/GNUstepGUI/GSFontInfo.h new file mode 100644 index 000000000..1fd6682ab --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSFontInfo.h @@ -0,0 +1,143 @@ +/* + GSFontInfo.h + + Private class for handling font info + + Copyright (C) 2000 Free Software Foundation, Inc. + + Author: Adam Fedor + Date: Mar 2000 + + This file is part of the GNUstep. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef __GSFontInfo_h_INCLUDE_ +#define __GSFontInfo_h_INCLUDE_ + +#include +#include + +@class NSMutableDictionary; +@class NSArray; +@class NSBezierPath; + +@interface GSFontEnumerator : NSObject +{ + NSArray *allFontNames; + NSMutableDictionary *allFontFamilies; +} + ++ (void) setDefaultClass: (Class)defaultClass; ++ (GSFontEnumerator*) sharedEnumerator; +- (void) enumerateFontsAndFamilies; +- (NSArray*) availableFonts; +- (NSArray*) availableFontFamilies; +- (NSArray*) availableMembersOfFontFamily: (NSString*)family; +@end + +@interface GSFontInfo : NSObject +{ + NSMutableDictionary* fontDictionary; + + // metrics of the font + NSString *fontName; + NSString *familyName; + float matrix[6]; + float italicAngle; + float underlinePosition; + float underlineThickness; + float capHeight; + float xHeight; + float descender; + float ascender; + NSSize maximumAdvancement; + NSSize minimumAdvancement; + NSString *encodingScheme; + NSStringEncoding mostCompatibleStringEncoding; + NSRect fontBBox; + BOOL isFixedPitch; + BOOL isBaseFont; + int weight; + NSFontTraitMask traits; +} + ++ (void) setDefaultClass: (Class)defaultClass; ++ (GSFontInfo*) fontInfoForFontName: (NSString*)fontName + matrix: (const float *)fmatrix + screenFont: (BOOL)screenFont; + ++ (int) weightForString: (NSString *)weightString; ++ (NSString *) stringForWeight: (int)weight; + +- (NSDictionary *)afmDictionary; +- (NSString *)afmFileContents; +- (NSRect)boundingRectForFont; +- (NSString *)displayName; +- (NSString *)familyName; +- (NSString *)fontName; +- (NSString *)encodingScheme; +- (const float*) matrix; +- (BOOL)isFixedPitch; +- (BOOL)isBaseFont; +- (float)ascender; +- (float)descender; +- (float)capHeight; +- (float)italicAngle; +- (NSSize)maximumAdvancement; +- (NSSize)minimumAdvancement; +- (float)underlinePosition; +- (float)underlineThickness; +- (float)xHeight; +- (float) widthOfString: (NSString*)string; +- (float)defaultLineHeightForFont; + +- (NSSize) advancementForGlyph: (NSGlyph)aGlyph; +- (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph; +- (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; +- (NSMultibyteGlyphPacking)glyphPacking; +- (NSGlyph) glyphWithName: (NSString*)glyphName; +- (NSPoint) positionOfGlyph: (NSGlyph)curGlyph + precededByGlyph: (NSGlyph)prevGlyph + isNominal: (BOOL*)nominal; +- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph + forCharacter:(unichar)aChar + struckOverRect:(NSRect)aRect; +- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph + struckOverGlyph:(NSGlyph)baseGlyph + metricsExist:(BOOL *)flag; +- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph + struckOverRect:(NSRect)aRect + metricsExist:(BOOL *)flag; +- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph + withRelation:(NSGlyphRelation)relation + toBaseGlyph:(NSGlyph)baseGlyph + totalAdvancement:(NSSize *)offset + metricsExist:(BOOL *)flag; + +- (NSStringEncoding)mostCompatibleStringEncoding; + +- (NSFontTraitMask) traits; +- (int) weight; + + +-(void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs + count: (int)count + toBezierPath: (NSBezierPath *)path; + +@end + +#endif /* __GSFontInfo_h_INCLUDE_ */ diff --git a/Headers/Additions/GNUstepGUI/GSFusedSilica.h b/Headers/Additions/GNUstepGUI/GSFusedSilica.h new file mode 100644 index 000000000..b7a25ba04 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSFusedSilica.h @@ -0,0 +1,784 @@ +/** GSFusedSilica + + C Interface to graphics drawing library + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Adam Fedor + Date: Sep 2002 + + This file is part of the GNUStep + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _GSFusedSilica_h_INCLUDE +#define _GSFusedSilica_h_INCLUDE + +#include + +/* ------------------------------------------------------------------------ + * Data Types + * ------------------------------------------------------------------------*/ + +typedef struct CGAffineTransform +{ + float a; + float b; + float c; + float d; + float tx; + float ty; +} CGAffineTransform; + +typedef struct CGPoint +{ + float x; + float y; +} CGPoint; + +typedef struct CGSize +{ + float width; + float height; +} CGSize; + +typedef struct CGRect +{ + CGPoint origin; + CGSize size; +} CGRect; + +typedef void * CGColorSpaceRef; + +typedef void * CGContextRef; + +typedef void * CGFontRef; + +typedef /*UInt16*/ unsigned int CGGlyph; + +typedef void * CGImageRef; + +typedef void * CGPatternRef; + +typedef void * CGPDFDocumentRef; + +typedef void * CGDataConsumerRef; + +/* ------------------------------------------------------------------------ + * Constants + * ---------------------------------------------------------------------- */ + +static const CGAffineTransform CGAffineTransformIdentity = {1,0,0,1,0,0}; + +typedef enum CGColorRenderingIntent +{ + kCGRenderingIntentDefault = 0, + kCGRenderingIntentAbsoluteColorimetric = 1, + kCGRenderingIntentRelativeColorimetric = 2, + kCGRenderingIntentPerceptual = 3, + kCGRenderingIntentSaturation = 4 +} CGColorRenderingIntent; + +typedef enum CGImageAlphaInfo +{ + kCGImageAlphaNone = 0, + kCGImageAlphaPremultipliedLast = 1, + kCGImageAlphaPremultipliedFirst = 2, + kCGImageAlphaLast = 3, + kCGImageAlphaFirst = 4, + kCGImageAlphaNoneSkipLast = 5, + kCGImageAlphaNoneSkipFirst = 6 +} CGImageAlphaInfo; + +typedef enum CGInterpolationQuality +{ + kCGInterpolationDefault = 0, + kCGInterpolationNone = 1, + kCGInterpolationLow = 2, + kCGInterpolationHigh = 3 +} CGInterpolationQuality; + +typedef enum CGLineCap +{ + kCGLineCapButt = 0, + kCGLineCapRound = 1, + kCGLineCapSquare = 2 +} CGLineCap; + +typedef enum CGLineJoin +{ + kCGLineJoinMiter = 0, + kCGLineJoinRound = 1, + kCGLineJoinBevel = 2 +} CGLineJoin; + +typedef enum CGPathDrawingMode +{ + kCGPathFill = 0, + kCGPathEOFill = 1, + kCGPathStroke = 2, + kCGPathFillStroke = 3, + kCGPathEOFillStroke = 4 +} CGPathDrawingMode; + +static const CGPoint CGPointZero = {0,0}; + +typedef enum CGRectEdge +{ + CGRectMinXEdge = 0, + CGRectMinYEdge = 1, + CGRectMaxXEdge = 2, + CGRectMaxYEdge = 3 +} CGRectEdge; + +static const CGRect CGRectNull = {{-1,-1},{0,0}}; /*FIXME*/ + +static const CGSize CGSizeZero = {0,0}; + +static const CGRect CGRectZero = {{0,0},{0,0}}; + +typedef enum CGTextDrawingMode +{ + kCGTextFill = 0, + kCGTextStroke = 1, + kCGTextFillStroke = 2, + kCGTextInvisible = 3, + kCGTextFillClip = 4, + kCGTextStrokeClip = 5, + kCGTextFillStrokeClip = 6, + kCGTextClip = 7 +} CGTextDrawingMode; + +typedef enum CGTextEncoding +{ + kCGEncodingFontSpecific = 0, + kCGEncodingMacRoman = 1 +} CGTextEncoding; + +/* ------------------------------------------------------------------------ + * Callbacks + * ---------------------------------------------------------------------- */ + +typedef void(*CGGetBytePointerProcPtr)(void *info); + +typedef size_t(*CGGetBytesDirectProcPtr)( + void *info, + void *buffer, + size_t offset, + size_t count +); + +typedef size_t(*CGGetBytesProcPtr)(void *info, void *buffer, size_t count); + +typedef size_t(*CGPutBytesProcPtr)( + void *info, + const void *buffer, + size_t count +); + +typedef void(*CGSkipBytesProcPtr)(void *info, size_t count); + +typedef void(*CGReleaseByteProcPtr)(void *info, const void *pointer); + +typedef void(*CGReleaseConsumerProcPtr)(void *info); + +typedef void(*CGReleaseDataProcPtr)( + void *info, + const void *data, + size_t size +); + +typedef void(*CGReleaseProviderProcPtr)(void *info); + +typedef void(*CGRewindProcPtr)(void *info); + +typedef struct CGDataConsumerCallbacks +{ + CGPutBytesProcPtr putBytes; + CGReleaseConsumerProcPtr releaseConsumer; +} CGDataConsumerCallbacks; + +typedef void * CGDataProviderRef; + +typedef struct CGDataProviderCallbacks +{ + CGGetBytesProcPtr getBytes; + CGSkipBytesProcPtr skipBytes; + CGRewindProcPtr rewind; + CGReleaseProviderProcPtr releaseProvider; +} CGDataProviderCallbacks; + +typedef struct CGDataProviderDirectAccessCallbacks +{ + CGGetBytePointerProcPtr getBytePointer; + CGReleaseByteProcPtr releaseBytePointer; + CGGetBytesDirectProcPtr getBytes; + CGReleaseProviderProcPtr releaseProvider; +} CGDataProviderDirectAccessCallbacks; + +/* ------------------------------------------------------------------------ + * Functions + * ---------------------------------------------------------------------- */ + +/* Managing Graphics Contexts */ + +CGContextRef CGBitmapContextCreate( + void *data, + size_t width, + size_t height, + size_t bitsPerComponent, + size_t bytesPerRow, + CGColorSpaceRef colorspace, + CGImageAlphaInfo alphaInfo +); + +/* +CGContextRef CGPDFContextCreate( + CGDataConsumerRef consumer, + const CGRect *mediaBox, + CFDictionaryRef auxiliaryInfo +); + +CGContextRef CGPDFContextCreateWithURL( + CFURLRef url, + const CGRect *mediaBox, + CFDictionaryRef auxiliaryInfo +); +*/ + +CGContextRef CGContextRetain(CGContextRef ctx); + +void CGContextRelease(CGContextRef ctx); + +void CGContextFlush(CGContextRef ctx); + +void CGContextSynchronize(CGContextRef ctx); + +/* Defining Pages */ + +void CGContextBeginPage(CGContextRef ctx, const CGRect *mediaBox); + +void CGContextEndPage(CGContextRef ctx); + +/* Transforming the Coordinate Space of the Page */ + +void CGContextScaleCTM(CGContextRef ctx, float sx, float sy); + +void CGContextTranslateCTM(CGContextRef ctx, float tx, float ty); + +void CGContextRotateCTM(CGContextRef ctx, float angle); + +void CGContextConcatCTM(CGContextRef ctx, CGAffineTransform transform); + +CGAffineTransform CGContextGetCTM(CGContextRef ctx); + +/* Saving and Restoring the Graphics State */ + +void CGContextSaveGState(CGContextRef ctx); + +void CGContextRestoreGState(CGContextRef ctx); + +/* Setting Graphics State Attributes */ + +void CGContextSetShouldAntialias(CGContextRef ctx, int shouldAntialias); + +void CGContextSetLineWidth(CGContextRef ctx, float width); + +void CGContextSetLineJoin(CGContextRef ctx, CGLineJoin join); + +void CGContextSetMiterLimit(CGContextRef ctx, float limit); + +void CGContextSetLineCap(CGContextRef ctx, CGLineCap cap); + +void CGContextSetLineDash(CGContextRef ctx, float phase, const float *lengths, size_t count); + +void CGContextSetFlatness(CGContextRef ctx, float flatness); + +/* Constructing Paths */ + +void CGContextBeginPath(CGContextRef ctx); + +void CGContextMoveToPoint(CGContextRef ctx, float x, float y); + +void CGContextAddLineToPoint(CGContextRef ctx, float x, float y); + +void CGContextAddLines(CGContextRef ctx, const CGPoint *points, size_t count); + +void CGContextAddCurveToPoint( + CGContextRef ctx, + float cp1x, + float cp1y, + float cp2x, + float cp2y, + float x, + float y +); + +void CGContextAddQuadCurveToPoint( + CGContextRef ctx, + float cpx, + float cpy, + float x, + float y +); + +void CGContextAddRect(CGContextRef ctx, CGRect rect); + +void CGContextAddRects(CGContextRef ctx, const CGRect *rects, size_t count); + +void CGContextAddArc( + CGContextRef ctx, + float x, + float y, + float radius, + float startAngle, + float endAngle, + int clockwise +); + +void CGContextAddArcToPoint( + CGContextRef ctx, + float x1, + float y1, + float x2, + float y2, + float radius +); + +void CGContextClosePath(CGContextRef ctx); + +/* Painting Paths */ + +void CGContextDrawPath(CGContextRef ctx, CGPathDrawingMode mode); + +void CGContextStrokePath(CGContextRef ctx); + +void CGContextFillPath(CGContextRef ctx); + +void CGContextEOFillPath(CGContextRef ctx); + +void CGContextStrokeRect(CGContextRef ctx, CGRect rect); + +void CGContextStrokeRectWithWidth(CGContextRef ctx, CGRect rect, float width); + +void CGContextFillRect(CGContextRef ctx, CGRect rect); + +void CGContextFillRects(CGContextRef ctx, const CGRect *rects, size_t count); + +void CGContextClearRect(CGContextRef c, CGRect rect); + +/* Obtaining Path Information */ + +int CGContextIsPathEmpty(CGContextRef ctx); + +CGPoint CGContextGetPathCurrentPoint(CGContextRef ctx); + +CGRect CGContextGetPathBoundingBox(CGContextRef ctx); + +/* Clipping Paths */ + +void CGContextClip(CGContextRef ctx); + +void CGContextEOClip(CGContextRef ctx); + +void CGContextClipToRect(CGContextRef ctx, CGRect rect); + +void CGContextClipToRects(CGContextRef ctx, const CGRect *rects, size_t count); + +/* Setting the Color Space */ + +CGColorSpaceRef CGColorSpaceCreateDeviceGray(void); + +CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void); + +CGColorSpaceRef CGColorSpaceCreateDeviceCMYK(void); + +CGColorSpaceRef CGColorSpaceCreateCalibratedGray( + const float *whitePoint, + const float *blackPoint, + float gamma +); + +CGColorSpaceRef CGColorSpaceCreateCalibratedRGB( + const float *whitePoint, + const float *blackPoint, + const float *gamma, + const float *matrix +); + +CGColorSpaceRef CGColorSpaceCreateLab( + const float *whitePoint, + const float *blackPoint, + const float *range +); + +CGColorSpaceRef CGColorSpaceCreateICCBased( + size_t nComponents, + const float *range, + CGDataProviderRef profile, + CGColorSpaceRef alternateSpace +); + +CGColorSpaceRef CGColorSpaceCreateIndexed( + CGColorSpaceRef baseSpace, + size_t lastIndex, + const /*UInt8*/ unsigned short int *colorTable +); + +size_t CGColorSpaceGetNumberOfComponents(CGColorSpaceRef cs); + +CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef cs); + +void CGColorSpaceRelease(CGColorSpaceRef cs); + +void CGContextSetFillColorSpace(CGContextRef ctx, CGColorSpaceRef colorspace); + +void CGContextSetStrokeColorSpace(CGContextRef ctx, CGColorSpaceRef colorspace); + +void CGContextSetRenderingIntent(CGContextRef c, CGColorRenderingIntent intent); + +/* Setting Colors */ + +void CGContextSetFillColor(CGContextRef ctx, const float *value); + +void CGContextSetStrokeColor(CGContextRef ctx, const float *value); + +void CGContextSetGrayFillColor(CGContextRef ctx, float gray, float alpha); + +void CGContextSetGrayStrokeColor(CGContextRef ctx, float gray, float alpha); + +void CGContextSetRGBFillColor( + CGContextRef ctx, + float r, + float g, + float b, + float alpha +); + +void CGContextSetRGBStrokeColor( + CGContextRef ctx, + float r, + float g, + float b, + float alpha +); + +void CGContextSetCMYKFillColor( + CGContextRef ctx, + float c, + float m, + float y, + float k, + float alpha +); + +void CGContextSetCMYKStrokeColor( + CGContextRef ctx, + float c, + float m, + float y, + float k, + float alpha +); + +void CGContextSetAlpha(CGContextRef ctx, float alpha); + +/* Drawing Images */ + +CGImageRef CGImageCreate( + size_t width, + size_t height, + size_t bitsPerComponent, + size_t bitsPerPixel, + size_t bytesPerRow, + CGColorSpaceRef colorspace, + CGImageAlphaInfo alphaInfo, + CGDataProviderRef provider, + const float *decode, + int shouldInterpolate, + CGColorRenderingIntent intent +); + +CGImageRef CGImageMaskCreate( + size_t width, + size_t height, + size_t bitsPerComponent, + size_t bitsPerPixel, + size_t bytesPerRow, + CGDataProviderRef provider, + const float *decode, + int shouldInterpolate +); + +CGImageRef CGImageRetain(CGImageRef image); + +void CGImageRelease(CGImageRef image); + +int CGImageIsMask(CGImageRef image); + +size_t CGImageGetWidth(CGImageRef image); + +size_t CGImageGetHeight(CGImageRef image); + +size_t CGImageGetBitsPerComponent(CGImageRef image); + +size_t CGImageGetBitsPerPixel(CGImageRef image); + +size_t CGImageGetBytesPerRow(CGImageRef image); + +CGColorSpaceRef CGImageGetColorSpace(CGImageRef image); + +CGImageAlphaInfo CGImageGetAlphaInfo(CGImageRef image); + +CGDataProviderRef CGImageGetDataProvider(CGImageRef image); + +const float *CGImageGetDecode(CGImageRef image); + +int CGImageGetShouldInterpolate(CGImageRef image); + +CGColorRenderingIntent CGImageGetRenderingIntent(CGImageRef image); + +void CGContextDrawImage(CGContextRef ctx, CGRect rect, CGImageRef image); + +/* Drawing PDF Documents */ + +CGPDFDocumentRef CGPDFDocumentCreateWithProvider(CGDataProviderRef provider); + +/* CGPDFDocumentRef CGPDFDocumentCreateWithURL(CFURLRef url); */ + +CGPDFDocumentRef CGPDFDocumentRetain(CGPDFDocumentRef document); + +void CGPDFDocumentRelease(CGPDFDocumentRef document); + +int CGPDFDocumentGetNumberOfPages(CGPDFDocumentRef document); + +CGRect CGPDFDocumentGetMediaBox(CGPDFDocumentRef document, int page); + +CGRect CGPDFDocumentGetCropBox(CGPDFDocumentRef document, int page); + +CGRect CGPDFDocumentGetBleedBox(CGPDFDocumentRef document, int page); + +CGRect CGPDFDocumentGetTrimBox(CGPDFDocumentRef document, int page); + +CGRect CGPDFDocumentGetArtBox(CGPDFDocumentRef document, int page); + +int CGPDFDocumentGetRotationAngle(CGPDFDocumentRef document, int page); + +void CGContextDrawPDFDocument( + CGContextRef ctx, + CGRect rect, + CGPDFDocumentRef document, + int page +); + +/* Drawing Text */ + +CGFontRef CGFontCreateWithPlatformFont(void *platformFontReference); + +void CGContextSelectFont( + CGContextRef ctx, + const char *name, + float size, + CGTextEncoding textEncoding +); + +void CGContextSetFont(CGContextRef ctx, CGFontRef font); + +void CGContextSetFontSize(CGContextRef ctx, float size); + +CGFontRef CGFontRetain(CGFontRef font); + +void CGFontRelease(CGFontRef font); + +void CGContextSetCharacterSpacing(CGContextRef ctx, float spacing); + +void CGContextSetTextDrawingMode(CGContextRef ctx, CGTextDrawingMode mode); + +void CGContextSetTextPosition(CGContextRef ctx, float x, float y); + +CGPoint CGContextGetTextPosition(CGContextRef ctx); + +void CGContextSetTextMatrix(CGContextRef ctx, CGAffineTransform transform); + +CGAffineTransform CGContextGetTextMatrix(CGContextRef ctx); + +void CGContextShowText(CGContextRef ctx, const char *cstring, size_t length); + +void CGContextShowGlyphs(CGContextRef ctx, const CGGlyph *g, size_t count); + +void CGContextShowTextAtPoint( + CGContextRef ctx, + float x, + float y, + const char *cstring, + size_t length +); + +void CGContextShowGlyphsAtPoint( + CGContextRef ctx, + float x, + float y, + const CGGlyph *g, + size_t count +); + +/* Passing Data */ + +CGDataConsumerRef CGDataConsumerCreate( + void *info, + const CGDataConsumerCallbacks *callbacks +); + +/* CGDataConsumerRef CGDataConsumerCreateWithURL(CFURLRef url); */ + +CGDataConsumerRef CGDataConsumerRetain(CGDataConsumerRef consumer); + +void CGDataConsumerRelease(CGDataConsumerRef consumer); + +CGDataProviderRef CGDataProviderCreate( + void *info, + const CGDataProviderCallbacks *callbacks +); + +CGDataProviderRef CGDataProviderCreateDirectAccess( + void *info, + size_t size, + const CGDataProviderDirectAccessCallbacks *callbacks +); + +CGDataProviderRef CGDataProviderCreateWithData( + void *info, + const void *data, + size_t size, + int releaseData +); + +/* CGDataProviderRef CGDataProviderCreateWithURL(CFURLRef url); */ + +CGDataProviderRef CGDataProviderRetain(CGDataProviderRef provider); + +void CGDataProviderRelease(CGDataProviderRef provider); + +/* Modifying Geometric Forms */ + +CGPoint CGPointMake(float x, float y); + +CGSize CGSizeMake(float width, float height); + +CGRect CGRectMake( + float x, + float y, + float width, + float height +); + +CGRect CGRectStandardize(CGRect rect); + +CGRect CGRectInset(CGRect rect, float dx, float dy); + +CGRect CGRectOffset(CGRect rect, float dx, float dy); + +CGRect CGRectIntegral(CGRect rect); + +CGRect CGRectUnion(CGRect r1, CGRect r2); + +CGRect CGRectIntersection(CGRect r1, CGRect r2); + +void CGRectDivide( + CGRect rect, + CGRect *slice, + CGRect *remainder, + float amount, + CGRectEdge edge +); + +/* Accessing Geometric Attributes */ + +float CGRectGetMinX(CGRect rect); + +float CGRectGetMidX(CGRect rect); + +float CGRectGetMaxX(CGRect rect); + +float CGRectGetMinY(CGRect rect); + +float CGRectGetMidY(CGRect rect); + +float CGRectGetMaxY(CGRect rect); + +float CGRectGetWidth(CGRect rect); + +float CGRectGetHeight(CGRect rect); + +int CGRectIsNull(CGRect rect); + +int CGRectIsEmpty(CGRect rect); + +int CGRectIntersectsRect(CGRect rect1, CGRect rect2); + +int CGRectContainsRect(CGRect rect1, CGRect rect2); + +int CGRectContainsPoint(CGRect rect, CGPoint point); + +int CGRectEqualToRect(CGRect rect1, CGRect rect2); + +int CGSizeEqualToSize(CGSize size1, CGSize size2); + +int CGPointEqualToPoint(CGPoint point1, CGPoint point2); + +/* Affine Transform Utility Functions */ + +CGAffineTransform CGAffineTransformMake( + float a, + float b, + float c, + float d, + float tx, + float ty +); + +CGAffineTransform CGAffineTransformMakeTranslation(float tx, float ty); + +CGAffineTransform CGAffineTransformMakeScale(float sx, float sy); + +CGAffineTransform CGAffineTransformMakeRotation(float angle); + +CGAffineTransform CGAffineTransformTranslate( + CGAffineTransform t, + float tx, + float ty +); + +CGAffineTransform CGAffineTransformScale( + CGAffineTransform t, + float sx, + float sy +); + +CGAffineTransform CGAffineTransformRotate(CGAffineTransform t, float angle); + +CGAffineTransform CGAffineTransformInvert(CGAffineTransform t); + +CGAffineTransform CGAffineTransformConcat( + CGAffineTransform t1, + CGAffineTransform t2 +); + +CGPoint CGPointApplyAffineTransform(CGPoint point, CGAffineTransform t); + +CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t); + +#endif diff --git a/Headers/Additions/GNUstepGUI/GSHbox.h b/Headers/Additions/GNUstepGUI/GSHbox.h new file mode 100644 index 000000000..2f12ecb93 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSHbox.h @@ -0,0 +1,167 @@ +/* + GSHbox.h + + The GSHbox class (a GNU extension) + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSHbox +#define _GNUstep_H_GSHbox + +#include "GSTable.h" + +// +// GSHbox inherits from GSTable the autosizing/autoresizing engine. +// The only real difference between a GSHbox and a GSTable with 1 row +// is that the GSHbox has a much simpler, easier and friendlier API. +// +// You shouldn't use GSTable methods with GSHbox (exception: methods +// explicitly quoted in comments to this file as 'inherited from GSTable'). +// If you need to do that, you should be using GSTable instead. +// +@interface GSHbox: GSTable +{ + BOOL _haveViews; + float _defaultMinXMargin; +} +// +// Initizialing. +// Always use init for GSHbox: other methods don't make sense. +// Don't used GSTable methods. You do not need to specify +// the number of views you plan to put in the box +// when you initialize it. +// So, the correct way to start a new GSHbox is simply: +// +// hbox = [GSHbox new]; +// +-(id) init; +// +// Setting Border. +// + +// Use these if you want some spacing around the table. +// Changing the border will update immediately the box. +// The default border is zero. +// +// Inherited from GSTable Class: +// To have the same border on the four sides use: +//-(void) setBorder: (float)aBorder; +// +// To set borders in the horizontal or vertical direction, use: +//-(void) setXBorder: (float)aBorder; +//-(void) setYBorder: (float)aBorder; +// +// To specificy different borders, use: +//-(void) setMinXBorder: (float)aBorder; +//-(void) setMaxXBorder: (float)aBorder; +//-(void) setMinYBorder: (float)aBorder; +//-(void) setMaxYBorder: (float)aBorder; +// + +// +// Adding a View. +// Use these methods to pack views in the GSHbox. +// Don't use the corresponding methods of GSTable, which are far more general +// and far more complicate. If you need to do that, use GSTable instead. +// +-(void) addView: (NSView *)aView; + +-(void) addView: (NSView *)aView +enablingXResizing: (BOOL)aFlag; + +-(void) addView: (NSView *)aView + withMinXMargin: (float)aMargin; + +-(void) addView: (NSView *)aView + // enablingXResizing is YES if the {view and its margins} should be + // resized when the GSHbox is resized in the horizontal direction. + // FALSE does not resize it. Default is YES. +enablingXResizing: (BOOL)aFlag + // With a GSHbox, only one margin is set when you add views to the GSHbox: + // the margin between each view and the preceding one. + // Exception: the first view is special, and has no margin set (it has no + // preceding view to be separated from). + // Space above or below the view may result if the view is shorter, + // in the vertical direction, than the other views in the GSHbox; + // in that case the view is resized to fit vertically, + // according to its autoresizingMask. + // By changing the autoresizingMask you may decide whether the space + // should go to the view or to its vertical margins; this for example + // lets you center vertically or flush up/down your view. + withMinXMargin: (float)aMargin; +// +// Adding a Separator. +// +-(void) addSeparator; +-(void) addSeparatorWithMinXMargin: (float)aMargin; + +// +// Setting Margins. +// + +// Use only the following method to set a default margin. +// The default margin set with the following method will be used +// for all the views added after. +// (Exception: the first view put in the box has no margins at all) +// It will not affect already added views. +// In a GSHbox, only one margin is used, the one between each view +// and the preceding one. If what you want is space around the GSHbox, +// you don't want a margin but a border; use setBorder: +// (see above, "Setting Border"). +// If you need more complicated margins/borders, use GSTable. +-(void) setDefaultMinXMargin: (float)aMargin; + +// +// Minimum Size. +// + +// This returns the minimum size the GSHbox should be resized to. +// Trying to resize the GSHbox below this size will only result in clipping +// (ie, making it disappear) part of the GSHbox. +// Inherited from GSTable Class: +// -(NSSize) minimumSize; + +// +// Resizing. +// + +// If for any reason you need the GSHbox to revert to its minimum size, +// invoke the following. +// Inherited from GSTable Class: +// -(void) sizeToFit; + +// +// Getting Number of Views +// + +// Return the number of views in the GSHbox (separators included). +-(int) numberOfViews; +@end + +#endif /* _GNUstep_H_GSHbox */ + + + + + diff --git a/Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h b/Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h new file mode 100644 index 000000000..e4fe2a6b4 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h @@ -0,0 +1,47 @@ +/* + GSHelpManagerPanel.h + + GSHelpManagerPanel displays a help message for an item. + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Pedro Ivo Andrade Tavares + Date: September 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_GSHelpManagerPanel +#define _GNUstep_H_GSHelpManagerPanel + +#include + +@class NSTextView; +@class NSAttributedString; + +@interface GSHelpManagerPanel: NSPanel +{ + NSTextView *textView; +} + ++sharedHelpManagerPanel; + +-(void)setHelpText: (NSAttributedString*)helpText; + +@end + +#endif // _GNUstep_H_GSHelpManagerPanel diff --git a/Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h b/Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h new file mode 100644 index 000000000..5d8399076 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h @@ -0,0 +1,79 @@ +/* + GSHorizontalTypesetter.h + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSHorizontalTypesetter +#define _GNUstep_H_GSHorizontalTypesetter + +#include + +@class NSLock; +@class GSLayoutManager, NSTextContainer, NSTextStorage; +@class NSDictionary; +@class NSParagraphStyle, NSFont; + +@interface GSHorizontalTypesetter : GSTypesetter +{ + NSLock *lock; + + GSLayoutManager *curLayoutManager; + NSTextContainer *curTextContainer; + NSTextStorage *curTextStorage; + + unsigned int curGlyph; + NSPoint curPoint; + + + NSParagraphStyle *curParagraphStyle; + NSRange paragraphRange; /* characters */ + + NSDictionary *curAttributes; + NSRange attributeRange; /* characters */ + struct + { + BOOL explicit_kern; + float kern; + float baseline_offset; + int superscript; + } attributes; + + NSFont *curFont; + NSRange fontRange; /* glyphs */ + + struct GSHorizontalTypesetter_glyph_cache_s *cache; + unsigned int cache_base, cache_size, cache_length; + BOOL at_end; + + + struct GSHorizontalTypesetter_line_frag_s *line_frags; + int line_frags_num, line_frags_size; +} + ++(GSHorizontalTypesetter *) sharedInstance; + +@end + +#endif + diff --git a/Headers/Additions/GNUstepGUI/GSInfoPanel.h b/Headers/Additions/GNUstepGUI/GSInfoPanel.h new file mode 100644 index 000000000..9303c002e --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSInfoPanel.h @@ -0,0 +1,80 @@ +/* + GSInfoPanel.h + + Standard GNUstep info panel + + Copyright (C) 2000 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: January 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_GSInfoPanel +#define _GNUstep_H_GSInfoPanel + +#include + +/* If you need an Info Panel, the simpler thing to do is to use + * NSApplication -orderFrontStandardInfoPanel: and + * NSApplication -orderFrontStandardInfoPanelWithOptions:. + * They automatically manage an infoPanel for you. + */ + +@interface GSInfoPanel:NSPanel +{ +} +/* + * Instance Methods + */ + +/* + * The designated initializer + * + * Useful keys (with example values) for the dictionary are: + * + * ApplicationName = @"Gorm" + * + * ApplicationDescription = @"GNUstep Graphics Object Relationship Modeller" + * + * ApplicationIcon = an image + * + * ApplicationRelease = @"Gorm 0" + * (ApplicationVersion in place of ApplicationRelease is also accepted for macosx compatibility) + * + * FullVersionID = @"0.0.1 1999" + * (Version also accepted for macosx compatibility) + * + * Authors = an array of (NSString*)s, each one probably similar to the following + * @"Richard Frith-Macdonald " + * + * URL = @"See http://www.gnustep.org" + * (still to fix/improve position of this thing so perhaps you don't want to use it) + * + * Copyright = @"Copyright (C) 1999, 2000 The Free Software Foundation, Inc." + * + * CopyrightDescription = @"Released under the GNU General Public License 2.0" + * + */ +-(id) initWithDictionary: (NSDictionary *)dictionary; +/* + * NB: Once initialized, a GSInfoPanel is immutable. + */ +@end + +#endif /* _GNUstep_H_GSInfoPanel */ diff --git a/Headers/Additions/GNUstepGUI/GSLayoutManager.h b/Headers/Additions/GNUstepGUI/GSLayoutManager.h new file mode 100644 index 000000000..c946b7e36 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSLayoutManager.h @@ -0,0 +1,350 @@ +/* + GSLayoutManager.h + + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: November 2002 - February 2003 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSLayoutManager +#define _GNUstep_H_GSLayoutManager + +#include +#include +#include + +@class GSTypesetter; +@class NSTextStorage,NSTextContainer; + +typedef enum +{ + NSGlyphInscribeBase = 0, + NSGlyphInscribeBelow = 1, + NSGlyphInscribeAbove = 2, + NSGlyphInscribeOverstrike = 3, + NSGlyphInscribeOverBelow = 4 +} NSGlyphInscription; + +@interface GSLayoutManager : NSObject +{ +@protected + NSTextStorage *_textStorage; + + id _delegate; + + BOOL usesScreenFonts; + BOOL backgroundLayoutEnabled; + BOOL showsInvisibleCharacters; + BOOL showsControlCharacters; + + GSTypesetter *typesetter; + + +/* Glyph storage */ + + /* Skip list of runs */ + struct GSLayoutManager_glyph_run_head_s *glyphs; + + /* number of runs created from existing text (ie. not as a result of + stuff being invalidated) */ + int glyph_num_end_runs; + + +/* Layout storage */ +/* OPT: This is just a simple implementation that should let me figure out +how it's supposed to work. It's functional and correct, but it isn't fast. */ + + unsigned int layout_glyph, layout_char; + + struct GSLayoutManager_textcontainer_s *textcontainers; + int num_textcontainers; + + NSRect extra_rect, extra_used_rect; + NSTextContainer *extra_textcontainer; + + + /* For -rectArrayForGlyphRange:... */ + NSRect *rect_array; + int rect_array_size; + + + /* + Cached run. GSHorizontalTypesetter (and other typesetters, presumably) + often walk linearly through the glyphs. Thus, for many methods, we cache + the last run so we can quickly get more information for the next glyph. + */ + struct GSLayoutManager_glyph_run_s *cached_run; + unsigned int cached_pos, cached_cpos; +} + + +- (NSTextStorage *) textStorage; +- (void) setTextStorage: (NSTextStorage *)aTextStorage; +- (void) replaceTextStorage: (NSTextStorage *)newTextStorage; + + +- (id) delegate; +- (void) setDelegate: (id)aDelegate; + + +-(GSTypesetter *) typesetter; +-(void) setTypesetter: (GSTypesetter *)typesetter; + + +- (void) setBackgroundLayoutEnabled: (BOOL)flag; +- (BOOL) backgroundLayoutEnabled; + +- (void) setShowsInvisibleCharacters: (BOOL)flag; +- (BOOL) showsInvisibleCharacters; + +- (void) setShowsControlCharacters: (BOOL)flag; +- (BOOL) showsControlCharacters; + + +/** Font handling **/ + +- (BOOL) usesScreenFonts; +- (void) setUsesScreenFonts: (BOOL)flag; + +- (NSFont *) substituteFontForFont: (NSFont *)originalFont; + + +/* +(?) +Sent by the NSTextStorage. mask tells us if attributes or characters (or +both) have been changed. range is the range of directly modified +characters. invalidatedRange is the range of characters affected by the +changes (contains range but may be larger due to eg. attribute fixing). +If characters have been edited, lengthChange has the text length delta. +*/ +- (void) textStorage: (NSTextStorage *)aTextStorage + edited: (unsigned int)mask + range: (NSRange)range + changeInLength: (int)lengthChange + invalidatedRange: (NSRange)invalidatedRange; + +@end + + +@interface GSLayoutManager (glyphs) + +/** Glyph handling **/ + +/* +Mark the glyphs for the characters in aRange as invalid. lengthChange +is the text length delta. If not NULL, the range of characters actually +affected (_after_ the change) will be returned in actualRange. + +This method is used internally and should _not_ be called. (It interacts +in complex ways with layout invalidation.) +*/ +- (void) invalidateGlyphsForCharacterRange: (NSRange)aRange + changeInLength: (int)lengthChange + actualCharacterRange: (NSRange *)actualRange; + +/* +These are internal methods and should _not_ be called. +*/ +- (void) insertGlyph: (NSGlyph)aGlyph + atGlyphIndex: (unsigned int)glyphIndex + characterIndex: (unsigned int)charIndex; +- (void) replaceGlyphAtIndex: (unsigned int)glyphIndex + withGlyph: (NSGlyph)newGlyph; +- (void) deleteGlyphsInRange: (NSRange)aRange; +- (void) setCharacterIndex: (unsigned int)charIndex + forGlyphAtIndex: (unsigned int)glyphIndex; + + +/* Returns total number of glyphs. */ +- (unsigned int) numberOfGlyphs; + +/* Returns the glyph at glyphIndex or raises an NSRangeException if the +index is invalid (past the end of the glyphs). */ +- (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex; + +/* Returns the glyph at glyphIndex and sets isValidIndex to YES if the index +is valid. Otherwise, the return value is arbitrary and isValidIndex is set +to NO. */ +- (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex + isValidIndex: (BOOL *)isValidIndex; + +/* Copies displayed glyphs to glyphArray for glyphRange. Returns the number +of glyphs actually copied to the array. NSRangeException of the range is +invalid (extends beyond the end of glyphs). */ +- (unsigned int) getGlyphs: (NSGlyph *)glyphArray + range: (NSRange)glyphRange; + +/* Return the first character for the glyph at glyphIndex. +(NSRangeException?) */ +- (unsigned int) characterIndexForGlyphAtIndex: (unsigned int)glyphIndex; + +/* Returns the range of glyphs for the characters in charRange. If +actualRange isn't NULL, the exact range of characters for the glyphs in the +returned range is returned there. */ +- (NSRange) glyphRangeForCharacterRange: (NSRange)charRange + actualCharacterRange: (NSRange *)actualCharRange; + +/* Returns the range of characters for the glyphs in glyphRange. Returns +the actual glyphs for the characters in the range in actualGlyphRange, if +it isn't NULL. */ +- (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange + actualGlyphRange: (NSRange *)actualGlyphRange; + + +/* These can be used to set arbitrary tags on individual glyphs. +Non-negative tags are reserved. You must provide storage yourself (by +subclassing). */ +- (void) setIntAttribute: (int)attributeTag + value: (int)anInt + forGlyphAtIndex: (unsigned int)glyphIndex; +- (int) intAttribute: (int)attributeTag + forGlyphAtIndex: (unsigned int)glyphIndex; + + +/* Returns the font actually used for a range of glyphs. This isn't +necessarily the font specified by NSFontAttributeName; both the typesetter +and the layout manager can substitute a different font (the typesetter might +eg. substitute a smaller font for sub-/super-scripted text, and the layout +manager might be substituting screen fonts. */ +- (NSFont *) effectiveFontForGlyphAtIndex: (unsigned int)glyphIndex + range: (NSRange *)range; /* GNUstep extension */ + + +- (void) setDrawsOutsideLineFragment: (BOOL)flag + forGlyphAtIndex: (unsigned int)glyphIndex; +- (BOOL) drawsOutsideLineFragmentForGlyphAtIndex: (unsigned int) glyphIndex; + +- (void) setNotShownAttribute: (BOOL)flag + forGlyphAtIndex: (unsigned int)glyphIndex; +- (BOOL) notShownAttributeForGlyphAtIndex: (unsigned int) glyphIndex; + +@end + + +@interface GSLayoutManager (layout) + +/** Text containers **/ + +- (NSArray *) textContainers; + +- (void) addTextContainer: (NSTextContainer *)container; +- (void) insertTextContainer: (NSTextContainer*)aTextContainer + atIndex: (unsigned int)index; +- (void) removeTextContainerAtIndex: (unsigned int)index; + +- (void) textContainerChangedGeometry: (NSTextContainer *)aContainer; + + +/** Layout **/ + +/* +This method is used internally and should _not_ be called. (It interacts +in complex ways with glyph invalidation, and with itself when doing soft +invalidation.) +*/ +- (void) invalidateLayoutForCharacterRange: (NSRange)aRange + isSoft: (BOOL)flag + actualCharacterRange: (NSRange *)actualRange; + + +- (void) setTextContainer: (NSTextContainer *)aTextContainer + forGlyphRange: (NSRange)glyphRange; + +- (void) setLineFragmentRect: (NSRect)fragmentRect + forGlyphRange: (NSRange)glyphRange + usedRect: (NSRect)usedRect; + +- (void) setLocation: (NSPoint)location + forStartOfGlyphRange: (NSRange)glyphRange; + +- (void) setAttachmentSize: (NSSize)attachmentSize + forGlyphRange: (NSRange)glyphRange; /* not OPENSTEP */ + + +- (NSTextContainer *) textContainerForGlyphAtIndex: (unsigned int)glyphIndex + effectiveRange: (NSRange *)effectiveRange; +- (NSRect) lineFragmentRectForGlyphAtIndex: (unsigned int)glyphIndex + effectiveRange: (NSRange *)effectiveGlyphRange; +- (NSRect) lineFragmentUsedRectForGlyphAtIndex: (unsigned int)glyphIndex + effectiveRange: (NSRange *)effectiveGlyphRange; + + +/* +The typesetter may set this to mark where the rectangle the insertion point +is to be placed if the insertion point is beyond the last character of the +text. The extra text container is reset to nil any time layout is +invalidated. +*/ +-(void) setExtraLineFragmentRect: (NSRect)linefrag + usedRect: (NSRect)used + textContainer: (NSTextContainer *)tc; + +-(NSRect) extraLineFragmentRect; +-(NSRect) extraLineFragmentUsedRect; +-(NSTextContainer *) extraLineFragmentTextContainer; + + +/* Extension, but without this, there's no way to get the starting locations +of the nominally spaced glyphs. */ +- (NSRange) rangeOfNominallySpacedGlyphsContainingIndex:(unsigned int)glyphIndex + startLocation: (NSPoint *)p; + +- (NSRange) rangeOfNominallySpacedGlyphsContainingIndex:(unsigned int)glyphIndex; + +/* The union of all line frag rects' used rects. (TODO: shouldn't this be +just the union of all the line frag rects?) */ +- (NSRect) usedRectForTextContainer: (NSTextContainer *)container; + +- (NSRange) glyphRangeForTextContainer: (NSTextContainer *)container; + + +- (unsigned int) firstUnlaidCharacterIndex; +- (unsigned int) firstUnlaidGlyphIndex; +- (void) getFirstUnlaidCharacterIndex: (unsigned int *)charIndex + glyphIndex: (unsigned int *)glyphIndex; + + +/* +Basic (and experimental) methods that let the typesetter use soft-invalidated +layout information. +*/ +-(void) _softInvalidateUseLineFrags: (int)num + withShift: (NSSize)shift + inTextContainer: (NSTextContainer *)textContainer; +-(NSRect) _softInvalidateLineFragRect: (int)index + firstGlyph: (unsigned int *)first_glyph + nextGlyph: (unsigned int *)next_glyph + inTextContainer: (NSTextContainer *)textContainer; +-(unsigned int) _softInvalidateFirstGlyphInTextContainer: (NSTextContainer *)textContainer; +-(unsigned int) _softInvalidateNumberOfLineFragsInTextContainer: (NSTextContainer *)textContainer; + +@end + + +@interface NSObject (GSLayoutManagerDelegate) +-(void) layoutManager: (GSLayoutManager *)layoutManager + didCompleteLayoutForTextContainer: (NSTextContainer *)textContainer + atEnd: (BOOL)atEnd; +@end + + +#endif + diff --git a/Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h b/Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h new file mode 100644 index 000000000..00b9fed36 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h @@ -0,0 +1,317 @@ +/* + GSLayoutManager_internal.h + + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: November 2002 - February 2003 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSLayoutManager_internal +#define _GNUstep_H_GSLayoutManager_internal + +#include + + +/* +TODO: +Since temporary attributes are set for _character_ ranges and not _glyph_ +ranges, a bunch of things could be simplified here (in particular, a +character can't be in several runs anymore, so there's no need to worry +about that or search over run boundaries). + +(2002-11-27): All comments should be clarified now. +*/ + + +/* Logarithmic time for lookups et al for up to 2^SKIP_LIST_DEPTH runs. +Only the head may actually have the maximum level. */ +/* OPT: tweak */ +#define SKIP_LIST_DEPTH 15 + +#define SKIP_LIST_LEVEL_PROBABILITY 2 + + +/* +We try to keep runs no larger than about this size. See the comment in +-_generateRunsToCharacter: for more details. +*/ +#define MAX_RUN_LENGTH 16384 + + +typedef struct GSLayoutManager_glyph_run_head_s +{ + struct GSLayoutManager_glyph_run_head_s *next; + + /* char_length must always be accurate. glyph_length is the number of + valid glyphs counting from the start. For a level 0 head, it's the number + of glyphs in that run. */ + unsigned int glyph_length, char_length; + + /* Glyph generation is complete for all created runs. */ + unsigned int complete:1; +} glyph_run_head_t; + + +typedef struct +{ + NSGlyph g; + + /* This if the offset for the first character this glyph + is mapped to; it is mapped to all characters between it and the next + character explicitly mapped to a glyph. + + The char_offset must be strictly increasing for all glyphs; if reordering + is necessary, the mapping will have to be range to range. (Eg. if you + have characters 'ab' mapped to glyphs 'AB', reordered to 'BA', then the + range 'ab' will be mapped to the range 'BA'. */ + unsigned int char_offset:21; /* This could be made a lot smaller, if necessary */ + + unsigned int drawsOutsideLineFragment:1; + unsigned int isNotShown:1; + unsigned int inscription:3; + /* 3 unused */ +} glyph_t; + + +@class NSParagraphStyle; +@class NSColor; +@class NSTextAttachment; + +typedef struct GSLayoutManager_glyph_run_s +{ + glyph_run_head_t head; + glyph_run_head_t *prev; + + /* Zero-based, so it's really the number of heads in addition to the + one included in glyph_run_t. */ + int level; + + /* All glyph-generation-affecting attributes are same as last run. This + doesn't have to be set if a run is continued, but if it is set, it must + be correct (it is (will, someday) be used to merge small runs created + by repeated inserts in a small range; not merging when we can merge + doesn't cost much, but merging when we shouldn't would mess up attributes + for those runs). + */ + unsigned int continued:1; + + /* Bidirectional-level, as per the unicode bidirectional algorithm + (unicode standard annex #9). Only valid if glyphs have been generated + (in particular, runs for which glyphs haven't been generated may not be + all at the same level). */ + /* TODO2: these aren't filled in or used anywhere yet */ + unsigned int bidi_level:6; + + /* Font for this run. */ + NSFont *font; + int ligature; + + /* YES if there's an explicit kern attribute. Currently, ligatures aren't + used when explicit kerning is available (TODO). */ + BOOL explicit_kern; + + glyph_t *glyphs; +} glyph_run_t; + + +@interface GSLayoutManager (backend) +-(unsigned int) _findSafeBreakMovingBackwardFrom: (unsigned int)ch; +-(unsigned int) _findSafeBreakMovingForwardFrom: (unsigned int)ch; +-(void) _generateGlyphsForRun: (glyph_run_t *)run at: (unsigned int)pos; +@end + + +/* All positions and lengths in glyphs */ +typedef struct +{ + unsigned int pos, length; + NSPoint p; +} linefrag_point_t; + +typedef struct +{ + unsigned int pos, length; + NSSize size; +} linefrag_attachment_t; + +typedef struct +{ + NSRect rect, used_rect; + unsigned int pos, length; + + linefrag_point_t *points; + int num_points; + + linefrag_attachment_t *attachments; + int num_attachments; +} linefrag_t; + +typedef struct GSLayoutManager_textcontainer_s +{ + NSTextContainer *textContainer; + + BOOL complete; + unsigned int pos, length; + + /* + This should be set to YES whenever any layout information for this text + container has been invalidated. It is reset to NO in -_didInvalidateLayout. + All methods called externally that invalidate layout (directly or + indirectly) should call -_didInvalidateLayout at some safe point after + all invalidation is done. + + In GSLayoutManager, -_didInvalidateLayout only resets the flags. However, + subclasses might need to actually do something. NSLayoutManager needs to + tell its NSTextView:s to resize. + */ + BOOL was_invalidated; + + /* + The array actually has num_soft+num_linefrags entries. Only the + num_linefrags first are significant, the rest hold soft invalidated + layout information. + */ + linefrag_t *linefrags; + int num_linefrags; + int num_soft; + int size_linefrags; +} textcontainer_t; + + + +@interface GSLayoutManager (glyphs_helpers) + +-(void) _run_cache_attributes: (glyph_run_t *)r : (NSDictionary *)attributes; +-(void) _run_copy_attributes: (glyph_run_t *)dst : (const glyph_run_t *)src; +-(void) _run_free_attributes: (glyph_run_t *)r; + +-(void) _initGlyphs; +-(void) _freeGlyphs; + +-(void) _glyphDumpRuns; +-(void) _sanityChecks; + +-(void) _generateGlyphsUpToCharacter: (unsigned int)last; +-(void) _generateGlyphsUpToGlyph: (unsigned int)last; + +-(glyph_run_t *) _glyphForCharacter: (unsigned int)target + index: (unsigned int *)rindex + positions: (unsigned int *)rpos : (unsigned int *)rcpos; + + +-(glyph_run_t *)run_for_glyph_index: (unsigned int)glyphIndex + : (unsigned int *)glyph_pos + : (unsigned int *)char_pos; +@end + + + +@interface GSLayoutManager (layout_helpers) +-(void) _freeLayout; +-(void) _invalidateLayoutFromContainer: (int)idx; + +-(void) _doLayout; /* TODO: this is just a hack until proper incremental layout is done */ +-(void) _doLayoutToGlyph: (unsigned int)glyphIndex; +-(void) _doLayoutToContainer: (int)cindex; + +-(void) _didInvalidateLayout; +@end + + +/* Some helper macros */ + +/* r is a run, pos and cpos are the glyph and character positions of the +run, i is the glyph index in the run. */ + +/* Steps forward to the next glyph. If there is no next glyph, r will be +the last run and i==r->head.glyph_length. */ +#define GLYPH_STEP_FORWARD(r, i, pos, cpos) \ + { \ + i++; \ + while (i == r->head.glyph_length) \ + { \ + if (!r->head.next || !r->head.next->complete) \ + { \ + if (cpos + r->head.char_length == [_textStorage length]) \ + break; \ + /* This call might lead to the current run being extended, so \ + we make sure that we check r->head.glyph_length again. */ \ + [self _generateGlyphsUpToCharacter: cpos + r->head.char_length]; \ + } \ + else \ + { \ + pos += r->head.glyph_length; \ + cpos += r->head.char_length; \ + r = (glyph_run_t *)r->head.next; \ + i = 0; \ + } \ + } \ + } + +/* Steps backward to the previous glyph. If there is no previous glyph, r +will be the first glyph and i==-1. */ +#define GLYPH_STEP_BACKWARD(r, i, pos, cpos) \ + { \ + i--; \ + while (i<0 && r->prev) \ + { \ + r=(glyph_run_t *)r->prev; \ + pos-=r->head.glyph_length; \ + cpos-=r->head.char_length; \ + i=r->head.glyph_length-1; \ + } \ + } + +/* OPT: can do better than linear scan? */ + +/* Scans forward from glyph i in run r (with positions pos and cpos) while +condition holds. r, i, pos, and cpos must be simple variables. When done, r, +i, pos, and cpos will be set for the first glyph for which the condition +doesn't hold. If there is no such glyph, r is the last run and +i==r->head.glyph_length. */ +#define GLYPH_SCAN_FORWARD(r, i, pos, cpos, condition) \ + { \ + while (condition) \ + { \ + GLYPH_STEP_FORWARD(r, i, pos, cpos) \ + if (i==r->head.glyph_length) \ + break; \ + } \ + } + +/* Scan backward. r, i, pos, and cpos will be set to the first glyph for +which condition doesn't hold. If there is no such glyph, r is the first run +and i==-1. */ +#define GLYPH_SCAN_BACKWARD(r, i, pos, cpos, condition) \ + { \ + while (condition) \ + { \ + GLYPH_STEP_BACKWARD(r, i, pos, cpos) \ + if (i==-1) \ + break; \ + } \ + } + + +#define run_for_glyph_index(a,b,c,d) [self run_for_glyph_index: a : c : d] + +#endif + diff --git a/Headers/Additions/GNUstepGUI/GSMemoryPanel.h b/Headers/Additions/GNUstepGUI/GSMemoryPanel.h new file mode 100644 index 000000000..36dbc9b72 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSMemoryPanel.h @@ -0,0 +1,65 @@ +/* GSMemoryPanel.h -*-objc-*- + + A GNUstep panel for tracking memory leaks. + + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 2000, 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* + * Class displaying a panel showing object allocation statistics. + * + */ + +#ifndef _GNUstep_H_GSMEMORY_PANEL_ +#define _GNUstep_H_GSMEMORY_PANEL_ + +#include +#include + +@interface GSMemoryPanel: NSPanel +{ + NSTableView *table; + NSMutableArray *classArray; + NSMutableArray *countArray; + NSMutableArray *totalArray; + NSMutableArray *peakArray; + /* Are we ordering by class name, or by count or total or peak number + of instances ? */ + int orderingBy; +} ++ (id) sharedMemoryPanel; + +/* Updates the statistics */ ++ (void) update: (id)sender; +- (void) update: (id)sender; +@end + +@interface NSApplication (GSMemoryPanel) +- (void) orderFrontSharedMemoryPanel: (id)sender; +@end + +#endif /* _GNUstep_H_GSMEMORY_PANEL_ */ + + + + diff --git a/Headers/Additions/GNUstepGUI/GSMethodTable.h b/Headers/Additions/GNUstepGUI/GSMethodTable.h new file mode 100644 index 000000000..0ea98fc5e --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSMethodTable.h @@ -0,0 +1,317 @@ +/* GSMethodTable.h - Definitions of PostScript methods for NSGraphicsContext + + Copyright (C) 1998 Free Software Foundation, Inc. + Written by: Adam Fedor + Date: Nov 1998 + Updated by: Richard Frith-Macdonald + + This file is part of the GNU Objective C User Interface library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 + */ + +#ifndef _GSMethodTable_h_INCLUDE +#define _GSMethodTable_h_INCLUDE + +#include +#include +#include + +@class NSAffineTransform; +@class NSBezierPath; +@class NSDate; +@class NSEvent; +@class NSGraphicsContext; +@class NSString; +@class NSColor; + +typedef struct { + +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ + void (*DPScurrentalpha_) + (NSGraphicsContext*, SEL, float*); + void (*DPScurrentcmykcolor____) + (NSGraphicsContext*, SEL, float*, float*, float*, float*); + void (*DPScurrentgray_) + (NSGraphicsContext*, SEL, float*); + void (*DPScurrenthsbcolor___) + (NSGraphicsContext*, SEL, float*, float*, float*); + void (*DPScurrentrgbcolor___) + (NSGraphicsContext*, SEL, float*, float*, float*); + void (*DPSsetalpha_) + (NSGraphicsContext*, SEL, float); + void (*DPSsetcmykcolor____) + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSsetgray_) + (NSGraphicsContext*, SEL, float); + void (*DPSsethsbcolor___) + (NSGraphicsContext*, SEL, float, float, float); + void (*DPSsetrgbcolor___) + (NSGraphicsContext*, SEL, float, float, float); + + void (*GSSetFillColorspace_) + (NSGraphicsContext*, SEL, NSDictionary *); + void (*GSSetStrokeColorspace_) + (NSGraphicsContext*, SEL, NSDictionary *); + void (*GSSetFillColor_) + (NSGraphicsContext*, SEL, float *); + void (*GSSetStrokeColor_) + (NSGraphicsContext*, SEL, float *); + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ + void (*DPSashow___) + (NSGraphicsContext*, SEL, float, float, const char*); + void (*DPSawidthshow______) + (NSGraphicsContext*, SEL, float, float, int, float, float, const char*); + void (*DPScharpath__) + (NSGraphicsContext*, SEL, const char*, int); + void (*DPSshow_) + (NSGraphicsContext*, SEL, const char*); + void (*DPSwidthshow____) + (NSGraphicsContext*, SEL, float, float, int, const char*); + void (*DPSxshow___) + (NSGraphicsContext*, SEL, const char*, const float*, int); + void (*DPSxyshow___) + (NSGraphicsContext*, SEL, const char*, const float*, int); + void (*DPSyshow___) + (NSGraphicsContext*, SEL, const char*, const float*, int); + + void (*GSSetCharacterSpacing_) + (NSGraphicsContext*, SEL, float); + void (*GSSetFont_) + (NSGraphicsContext*, SEL, NSFont*); + void (*GSSetFontSize_) + (NSGraphicsContext*, SEL, float); + NSAffineTransform * (*GSGetTextCTM) + (NSGraphicsContext*, SEL); + NSPoint (*GSGetTextPosition) + (NSGraphicsContext*, SEL); + void (*GSSetTextCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + void (*GSSetTextDrawingMode_) + (NSGraphicsContext*, SEL, GSTextDrawingMode); + void (*GSSetTextPosition_) + (NSGraphicsContext*, SEL, NSPoint); + void (*GSShowText__) + (NSGraphicsContext*, SEL, const char *, size_t); + void (*GSShowGlyphs__) + (NSGraphicsContext*, SEL, const NSGlyph *, size_t); + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ + void (*DPSgrestore) + (NSGraphicsContext*, SEL); + void (*DPSgsave) + (NSGraphicsContext*, SEL); + void (*DPSinitgraphics) + (NSGraphicsContext*, SEL); + void (*DPSsetgstate_) + (NSGraphicsContext*, SEL, int); + + int (*GSDefineGState) + (NSGraphicsContext*, SEL); + void (*GSUndefineGState_) + (NSGraphicsContext*, SEL, int); + void (*GSReplaceGState_) + (NSGraphicsContext*, SEL, int); + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ + void (*DPScurrentflat_) + (NSGraphicsContext*, SEL, float*); + void (*DPScurrentlinecap_) + (NSGraphicsContext*, SEL, int*); + void (*DPScurrentlinejoin_) + (NSGraphicsContext*, SEL, int*); + void (*DPScurrentlinewidth_) + (NSGraphicsContext*, SEL, float*); + void (*DPScurrentmiterlimit_) + (NSGraphicsContext*, SEL, float*); + void (*DPScurrentpoint__) + (NSGraphicsContext*, SEL, float*, float*); + void (*DPScurrentstrokeadjust_) + (NSGraphicsContext*, SEL, int*); + void (*DPSsetdash___) + (NSGraphicsContext*, SEL, const float*, int, float); + void (*DPSsetflat_) + (NSGraphicsContext*, SEL, float); + void (*DPSsethalftonephase__) + (NSGraphicsContext*, SEL, float, float); + void (*DPSsetlinecap_) + (NSGraphicsContext*, SEL, int); + void (*DPSsetlinejoin_) + (NSGraphicsContext*, SEL, int); + void (*DPSsetlinewidth_) + (NSGraphicsContext*, SEL, float); + void (*DPSsetmiterlimit_) + (NSGraphicsContext*, SEL, float); + void (*DPSsetstrokeadjust_) + (NSGraphicsContext*, SEL, int); + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ + void (*DPSconcat_) + (NSGraphicsContext*, SEL, const float*); + void (*DPSinitmatrix) + (NSGraphicsContext*, SEL); + void (*DPSrotate_) + (NSGraphicsContext*, SEL, float); + void (*DPSscale__) + (NSGraphicsContext*, SEL, float, float); + void (*DPStranslate__) + (NSGraphicsContext*, SEL, float, float); + + NSAffineTransform * (*GSCurrentCTM) + (NSGraphicsContext*, SEL); + void (*GSSetCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + void (*GSConcatCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ + void (*DPSarc_____) + (NSGraphicsContext*, SEL, float, float, float, float, float); + void (*DPSarcn_____) + (NSGraphicsContext*, SEL, float, float, float, float, float); + void (*DPSarct_____) + (NSGraphicsContext*, SEL, float, float, float, float, float); + void (*DPSclip) + (NSGraphicsContext*, SEL); + void (*DPSclosepath) + (NSGraphicsContext*, SEL); + void (*DPScurveto______) + (NSGraphicsContext*, SEL, float, float, float, float, float, float); + void (*DPSeoclip) + (NSGraphicsContext*, SEL); + void (*DPSeofill) + (NSGraphicsContext*, SEL); + void (*DPSfill) + (NSGraphicsContext*, SEL); + void (*DPSflattenpath) + (NSGraphicsContext*, SEL); + void (*DPSinitclip) + (NSGraphicsContext*, SEL); + void (*DPSlineto__) + (NSGraphicsContext*, SEL, float, float); + void (*DPSmoveto__) + (NSGraphicsContext*, SEL, float, float); + void (*DPSnewpath) + (NSGraphicsContext*, SEL); + void (*DPSpathbbox____) + (NSGraphicsContext*, SEL, float*, float*, float*, float*); + void (*DPSrcurveto______) + (NSGraphicsContext*, SEL, float, float, float, float, float, float); + void (*DPSrectclip____) + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSrectfill____) + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSrectstroke____) + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSreversepath) + (NSGraphicsContext*, SEL); + void (*DPSrlineto__) + (NSGraphicsContext*, SEL, float, float); + void (*DPSrmoveto__) + (NSGraphicsContext*, SEL, float, float); + void (*DPSstroke) + (NSGraphicsContext*, SEL); + + void (*GSSendBezierPath_) + (NSGraphicsContext*, SEL, NSBezierPath *); + void (*GSRectClipList__) + (NSGraphicsContext*, SEL, const NSRect *, int); + void (*GSRectFillList__) + (NSGraphicsContext*, SEL, const NSRect *, int); + +/* ----------------------------------------------------------------------- */ +/* Window system ops */ +/* ----------------------------------------------------------------------- */ + void (*GSCurrentDevice___) + (NSGraphicsContext*, SEL, void**, int*, int*); + void (*DPScurrentoffset__) + (NSGraphicsContext*, SEL, int*, int*); + void (*GSSetDevice___) + (NSGraphicsContext*, SEL, void*, int, int); + void (*DPSsetoffset__) + (NSGraphicsContext*, SEL, short int, short int); + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ + void (*DPScomposite________) + (NSGraphicsContext*, SEL, float, float, float, float, int, float, float, int); + void (*DPScompositerect_____) + (NSGraphicsContext*, SEL, float, float, float, float, int); + void (*DPSdissolve________) + (NSGraphicsContext*, SEL, float, float, float, float, int, float, float, float); + + void (*GSDrawImage__) + (NSGraphicsContext*, SEL, NSRect, void *); + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ + void (*DPSPrintf__) + (NSGraphicsContext*, SEL, const char *, va_list); + void (*DPSWriteData__) + (NSGraphicsContext*, SEL, const char *, unsigned int); + +/* ----------------------------------------------------------------------- */ +/* NSGraphics Ops */ +/* ----------------------------------------------------------------------- */ + NSColor * (*NSReadPixel_) + (NSGraphicsContext*, SEL, NSPoint); + + void (*NSBeep) + (NSGraphicsContext*, SEL); + +/* Context helper wraps */ + void (*GSWSetViewIsFlipped_) + (NSGraphicsContext*, SEL, BOOL); + BOOL (*GSWViewIsFlipped) + (NSGraphicsContext*, SEL); + +/* + * Render Bitmap Images + */ + void (*NSDrawBitmap___________)(NSGraphicsContext*, SEL, NSRect rect, + int pixelsWide, + int pixelsHigh, + int bitsPerSample, + int samplesPerPixel, + int bitsPerPixel, + int bytesPerRow, + BOOL isPlanar, + BOOL hasAlpha, + NSString *colorSpaceName, + const unsigned char *const data[5]); + + /* This probably belongs next to DPSstroke, but inserting members in this + struct breaks apps that use PS* or DPS* functions and were compiled with + an earlier version, so it's here until we figure out how to handle that. + */ + void (*DPSshfill) + (NSGraphicsContext*, SEL, NSDictionary *); +} gsMethodTable; + +#endif diff --git a/Headers/Additions/GNUstepGUI/GSNibTemplates.h b/Headers/Additions/GNUstepGUI/GSNibTemplates.h new file mode 100644 index 000000000..ee667090b --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSNibTemplates.h @@ -0,0 +1,161 @@ +/* + GSNibTemplates.h + + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + + Author: Gregory John Casamento + Date: 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_GSNibTemplates +#define _GNUstep_H_GSNibTemplates + +#include +#include +#include +#include +#include +#include +#include +#include + +#define GNUSTEP_NIB_VERSION 0 + +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; + +/* + * This is the class that holds objects within a nib. + */ +@interface GSNibContainer : NSObject +{ + NSMutableDictionary *nameTable; + NSMutableArray *connections; + BOOL _isAwake; +} +- (void) awakeWithContext: (NSDictionary*)context; +- (NSMutableDictionary*) nameTable; +- (NSMutableArray*) connections; +@end + +/* + * Template classes + */ + +@interface GSNibItem : NSObject +{ + NSString *theClass; + NSRect theFrame; + unsigned int autoresizingMask; +} +@end + +@interface GSCustomView : GSNibItem +{ +} +@end + +// templates +@protocol GSTemplate +- (void) setClassName: (NSString *)className; +- (NSString *)className; +- (id) instantiateObject: (NSCoder *)coder; +@end + +@interface NSWindowTemplate : NSWindow +{ + NSString *_className; + NSString *_parentClassName; + BOOL _deferFlag; +} +@end + +@interface NSViewTemplate : NSView +{ + NSString *_className; + NSString *_parentClassName; +} +@end + +@interface NSTextTemplate : NSText +{ + NSString *_className; + NSString *_parentClassName; +} +@end + +@interface NSTextViewTemplate : NSTextView +{ + NSString *_className; + NSString *_parentClassName; +} +@end + +@interface NSMenuTemplate : NSMenu +{ + NSString *_className; + NSString *_parentClassName; +} +@end + +@interface NSControlTemplate : NSControl +{ + NSString *_className; + NSString *_parentClassName; + id _delegate; + id _dataSource; + BOOL _usesDataSource; +} +@end + +@interface NSButtonTemplate : NSButton +{ + NSString *_className; + NSString *_parentClassName; + NSButtonType _buttonType; +} +@end + +@interface GSObjectData : NSObject +{ + NSMutableDictionary *dictionary; +} + +- (void) setValuesFromObject: (id)object; +- (void) restoreValuesToObject: (id)object; +- (NSMutableDictionary *)dictionary; +@end + +@interface GSClassSwapper : NSObject +{ + NSString *_className; + id _template; +} +- (NSString *) className; +- (void) setClassName: (NSString *)name; +- (id) template; +- (void) setTemplate: (id)template; +@end + +/* +@interface GSStringProxy : NSString +@end +*/ +#endif /* _GNUstep_H_GSNibTemplates */ diff --git a/Headers/Additions/GNUstepGUI/GSPasteboardServer.h b/Headers/Additions/GNUstepGUI/GSPasteboardServer.h new file mode 100644 index 000000000..01fb57ccc --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSPasteboardServer.h @@ -0,0 +1,92 @@ +/* + GSPasteboardServer.h + + Copyright (C) 1997,1999 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: August 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSPasteboardServer +#define _GNUstep_H_GSPasteboardServer + +#include +#include +#include + +@class NSString; +@class NSArray; +@class NSData; + +/* + * The name of the pasteboard server. + */ +#define PBSNAME @"GNUstepGSPasteboardServer" + +/* + * This protocol for use in asking GSPasteboardObj on the server to + * perform tasks for the local NSPasteboard objects. + */ +@protocol GSPasteboardObj +- (int) addTypes: (in bycopy NSArray*)types + owner: (id)owner + pasteboard: (NSPasteboard*)pb + oldCount: (int)count; +- (NSString*) availableTypeFromArray: (in bycopy NSArray*)types + changeCount: (int*)count; +- (int) changeCount; +- (NSData*) dataForType: (in bycopy NSString*)type + oldCount: (int)count + mustBeCurrent: (BOOL)flag; +- (int) declareTypes: (in bycopy NSArray*)types + owner: (id)owner + pasteboard: (NSPasteboard*)pb; +- (NSString*) name; +- (void) releaseGlobally; +- (BOOL) setData: (in bycopy NSData*)data + forType: (in bycopy NSString*)type + isFile: (BOOL)flag + oldCount: (int)count; +- (void) setHistory: (unsigned)length; +- (bycopy NSArray*) typesAndChangeCount: (int*)count; +@end + +/* + * This protocol for use in obtaining GSPasteboardObj from the server + * and controlling general server behaviour. + */ +@protocol GSPasteboardSvr +- (id) pasteboardWithName: (in bycopy NSString*)name; +@end + +/* + * This protocol is used by the server to ask pasteboard clients to + * provide additional data. + */ +@protocol GSPasteboardCallback +- (void) pasteboard: (NSPasteboard*)pb + provideDataForType: (NSString*)type; +- (void) pasteboard: (NSPasteboard*)pb + provideDataForType: (NSString*)type + andVersion:(int)v; +- (void) pasteboardChangedOwner: (NSPasteboard*)pb; +@end + +#endif // _GNUstep_H_GSPasteboardServer diff --git a/Headers/Additions/GNUstepGUI/GSServicesManager.h b/Headers/Additions/GNUstepGUI/GSServicesManager.h new file mode 100644 index 000000000..92b7ebbcb --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSServicesManager.h @@ -0,0 +1,90 @@ +/* + GSServicesManager.h + + Copyright (C) 1998 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: Novemeber 1998 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSServicesManager +#define _GNUstep_H_GSServicesManager + +@class NSApplication; +@class NSArray; +@class NSDate; +@class NSMenu; +@class NSMenuItem; +@class NSMutableArray; +@class NSMutableDictionary; +@class NSMutableSet; +@class NSString; +@class NSTimer; + +@interface GSServicesManager : NSObject +{ + NSApplication *_application; + NSMenu *_servicesMenu; + NSMutableArray *_languages; + NSMutableSet *_returnInfo; + NSMutableDictionary *_combinations; + NSMutableDictionary *_title2info; + NSArray *_menuTitles; + NSString *_disabledPath; + NSString *_servicesPath; + NSDate *_disabledStamp; + NSDate *_servicesStamp; + NSMutableSet *_allDisabled; + NSMutableDictionary *_allServices; + NSTimer *_timer; +} ++ (GSServicesManager*) newWithApplication: (NSApplication*)app; ++ (GSServicesManager*) manager; +- (BOOL) application: (NSApplication*)theApp + openFile: (NSString*)file; +- (BOOL) application: (NSApplication*)theApp + openFileWithoutUI: (NSString*)file; +- (BOOL) application: (NSApplication*)theApp + openTempFile: (NSString*)file; +- (BOOL) application: (NSApplication*)theApp + printFile: (NSString*)file; +- (void) doService: (NSMenuItem*)item; +- (NSArray*) filters; +- (BOOL) hasRegisteredTypes: (NSDictionary*)service; +- (NSString*) item2title: (NSMenuItem*)item; +- (void) loadServices; +- (NSDictionary*) menuServices; +- (void) rebuildServices; +- (void) rebuildServicesMenu; +- (void) registerAsServiceProvider; +- (void) registerSendTypes: (NSArray *)sendTypes + returnTypes: (NSArray *)returnTypes; +- (NSMenu *) servicesMenu; +- (id) servicesProvider; +- (void) setServicesMenu: (NSMenu *)anObject; +- (void) setServicesProvider: (id)anObject; +- (int) setShowsServicesMenuItem: (NSString*)item to: (BOOL)enable; +- (BOOL) showsServicesMenuItem: (NSString*)item; +- (BOOL) validateMenuItem: (NSMenuItem*)item; +- (void) updateServicesMenu; +@end + +#endif + diff --git a/Headers/Additions/GNUstepGUI/GSTable.h b/Headers/Additions/GNUstepGUI/GSTable.h new file mode 100644 index 000000000..0b66297b7 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSTable.h @@ -0,0 +1,178 @@ +/* + GSTable.h + + The GSTable class (a GNU extension) + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSTable +#define _GNUstep_H_GSTable + +#include + +@interface GSTable: NSView +{ + int _numberOfRows; + int _numberOfColumns; + // Border around the table. + float _minXBorder; + float _maxXBorder; + float _minYBorder; + float _maxYBorder; + // We control the NSView inserted in the GSTable (which we call + // the prisoners) by enclosing them in jails. + // Each prisoner is enclosed in a jail (which is a subview under + // our control). + // Each prisoner is allowed to resize only inside its jail. + NSView **_jails; + // YES if the column/row should be expanded/reduced when the size + // of the GSTable is expanded/reduced (this BOOL is otherwhere + // called X/Y Resizing Enabled). + BOOL *_expandColumn; + BOOL *_expandRow; + // Cache the total number of rows/columns which have expand set to YES + int _expandingColumnNumber; + int _expandingRowNumber; + // Dimension of each column/row + float *_columnDimension; + float *_rowDimension; + // Origin of each column/row + float *_columnXOrigin; + float *_rowYOrigin; + // Minimum dimension each row/column is allowed to have + // (which is the size the jail had when first created). + float *_minColumnDimension; + float *_minRowDimension; + // Cache the minimum size the GSTable should be resized to. + NSSize _minimumSize; + // YES if there is a prisoner in that GSTable position. + // (to avoid creating a jail if there is no prisoner to control). + BOOL *_havePrisoner; +} +// +// Initizialing. +// +-(id) initWithNumberOfRows: (int)rows + numberOfColumns: (int)columns; + +// Initialize with a default of 2 columns and 2 rows. +-(id) init; +// +// Setting Border Dimension. +// Border is space around the table. +// +-(void) setBorder: (float)aBorder; +-(void) setXBorder: (float)aBorder; +-(void) setYBorder: (float)aBorder; +-(void) setMinXBorder: (float)aBorder; +-(void) setMaxXBorder: (float)aBorder; +-(void) setMinYBorder: (float)aBorder; +-(void) setMaxYBorder: (float)aBorder; +// +// Adding a View. +// Use these methods to put views in the GSTable. +// +-(void) putView: (NSView *)aView + atRow: (int)row + column: (int)column; + +-(void) putView: (NSView *)aView + atRow: (int)row + column: (int)column + withMargins: (float)margins; + +-(void) putView: (NSView *)aView + atRow: (int)row + column: (int)column + withXMargins: (float)xMargins + yMargins: (float)yMargins; + +-(void) putView: (NSView *)aView + atRow: (int)row + column: (int)column + // Each view which is added to the GSTable can have some margins + // set. The GSTable treats the view and its margins as a whole. + // They are given (as a whole) some space, which is reduced or + // increased (but only if X or Y Resizing is Enabled for the column + // or the row in which the view resides) when the GSTable is + // resized. When this happens, the space is added (or subtracted) + // to the view or to the margins according to the autoResizeMask of + // the view. + withMinXMargin: (float)minXMargin // Left Margin + maxXMargin: (float)maxXMargin // Right Margin + minYMargin: (float)minYMargin // Lower Margin (Upper if flipped) + maxYMargin: (float)maxYMargin; // Upper Margin (Lower if flipped) +// +// Minimum Size. +// This returns the minimum size the GSTable should be resized to. +// Trying to resize the GSTable below this size will only result in clipping +// (ie, making it disappear) part of the GSTable. +// +-(NSSize) minimumSize; +// +// Resizing. +// If for any reason you need the GSTable to be redrawn (with minimum size), +// invoke the following. +-(void) sizeToFit; +// +// Setting Row and Column Expand Flag +// When the GSTable is resized, the extra space is equally divided +// between the Rows and Columns which have X/Y Resizing Enabled. +// +-(void) setXResizingEnabled: (BOOL)aFlag + forColumn: (int)aColumn; + +-(BOOL) isXResizingEnabledForColumn: (int)aColumn; + +-(void) setYResizingEnabled: (BOOL)aFlag + forRow: (int)aRow; + +-(BOOL) isYResizingEnabledForRow: (int)aRow; +// +// Adding Rows and Columns +// These should be used to add more rows and columns to the GSTable. +// Of course it is faster to create a GSTable with the right number of rows +// and columns from the beginning. +// +-(void) addRow; +// TODO: -(void) insertRow: (int)row; +// TODO: -(void) removeRow: (int)row; + +-(void) addColumn; +// TODO: -(void) insertColumn: (int)column; +// TODO: -(void) removeColumn: (int)column; +// +// Getting Row and Column Number +// +-(int) numberOfRows; + +-(int) numberOfColumns; +@end + +#endif /* _GNUstep_H_GSTable */ + + + + + diff --git a/Headers/Additions/GNUstepGUI/GSTextConverter.h b/Headers/Additions/GNUstepGUI/GSTextConverter.h new file mode 100644 index 000000000..c2700ec86 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSTextConverter.h @@ -0,0 +1,66 @@ +/* -*-objc-*- + GSTextConverter.h + + Define two protocols for text converter that will either read an external + format from a file or data object into an attributed string or write out + an attributed string in a format into a file or data object. + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Fred Kiefer + Date: August 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSTextConverter +#define _GNUstep_H_GSTextConverter + +#include +#include +#include +#include + + +@protocol GSTextConverter ++ (Class) classForFormat: (NSString*)format + producer: (BOOL)producer; +@end + +@protocol GSTextProducer ++ (NSData*) produceDataFrom: (NSAttributedString*) aText + documentAttributes: (NSDictionary*)dict; ++ (NSFileWrapper*) produceFileFrom: (NSAttributedString*) aText + documentAttributes: (NSDictionary*)dict; +@end + +/* + * The 'class' argument must be NSAttributedString (or a subclass); + * the results of parsing will be saved into a newly created object of + * that class, which is then returned. + */ +@protocol GSTextConsumer ++ (NSAttributedString*) parseData: (NSData *)aData + documentAttributes: (NSDictionary **)dict + class: (Class)class; ++ (NSAttributedString*) parseFile: (NSFileWrapper *)aFile + documentAttributes: (NSDictionary **)dict + class: (Class)class; +@end + +#endif // _GNUstep_H_GSTextConverter diff --git a/Headers/Additions/GNUstepGUI/GSTrackingRect.h b/Headers/Additions/GNUstepGUI/GSTrackingRect.h new file mode 100644 index 000000000..934d88a7a --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSTrackingRect.h @@ -0,0 +1,74 @@ +/* + GSTrackingRect.h + + Tracking rectangle class + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSTrackingRect +#define _GNUstep_H_GSTrackingRect + +#include + +@interface GSTrackingRect : NSObject +{ +@public + NSRect rectangle; + NSTrackingRectTag tag; + id owner; + void *user_data; + struct TrackFlagsType { + unsigned inside:1; + unsigned isValid:1; + unsigned checked:1; + unsigned ownerRespondsToMouseEntered:1; + unsigned ownerRespondsToMouseExited:1; + } flags; +} + +- (id) initWithRect: (NSRect)aRect + tag: (NSTrackingRectTag)aTag + owner: (id)anObject + userData: (void *)theData + inside: (BOOL)flag; + +- (NSRect) rectangle; +- (NSTrackingRectTag) tag; +- (id) owner; +- (void*) userData; +- (BOOL) inside; + +- (BOOL) isValid; +- (void) invalidate; + +/* + * NSCoding protocol + */ +- (void) encodeWithCoder: (NSCoder*)aCoder; +- (id) initWithCoder: (NSCoder*)aDecoder; + +@end + +#endif /* _GNUstep_H_GSTrackingRect */ + diff --git a/Headers/Additions/GNUstepGUI/GSTypesetter.h b/Headers/Additions/GNUstepGUI/GSTypesetter.h new file mode 100644 index 000000000..6ae848612 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSTypesetter.h @@ -0,0 +1,132 @@ +/* + GSTypesetter.h + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSTypesetter +#define _GNUstep_H_GSTypesetter + +#include +#include +#include + + + +@class GSLayoutManager; +@class NSTextContainer; +@class NSFont; + + +/* This class is abstract. */ +/* This isn't final. It will probably change. If you want to sub-class, +you'll have to update your code when things change (or wait until it's +done). */ +@interface GSTypesetter : NSObject + +/* +??? +GSTypesetter's implementation returns NSMakeSize(0,0). +*/ ++ (NSSize) printingAdjustmentsInLayoutManager: (GSLayoutManager *)layoutManager + forNominallySpacedGlyphRange: (NSRange)glyphRange + packedGlyphs: (const unsigned char *)glyphs + count: (unsigned)packedGlyphCount; + +/* +Returns a thread-safe shared GSTypesetter (a GSHorizontalTypesetter +instance in practice, at least when this is done). +*/ ++(GSTypesetter *) sharedSystemTypesetter; + + +/* +Returns the font that should be used for the given attributes. + +GSTypesetter's implementation returns the value of NSFontAttribute, or +[NSFont userFontOfSize: 0] if there is no such value. + +Subclasses can use this to make the font picked depend on other attributes, +eg. to automatically use a smaller size for subscripts and superscripts. + +{Provide context?} +*/ +-(NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes; + + +/* + +Lay out glyphs means that, for each glyph laid out in one call, the following +things need to be done: + + -setTextContainer:forGlyphRange: + 1. Set the text container for the glyph. + + -setLineFragmentRect:forGlyphRange:usedRect: + 2. Set the line fragment rectangle for the glyph. + + -setLocation:forStartOfGlyphRange: + 3. Set the position for the glyph (directly, or indirectly by setting the + starting position for a range of nominally spaced glyphs containing the + glyph). + +It should also set the drawsOutsideLineFragment and notShownAttribute if +they are YES (they are set to NO by -setTextContainer:forGlyphRange:). +(TODO: good?) + +*/ + +/* +Lay out glyphs, starting at glyphIndex, in textContainer. + +The line fragment rectangle for the previous line fragment in this +textContainer, or NSZeroRect if there are none, is in previousLineFragRect. + +The index of the first glyph not laid out should be returned in +nextGlyphIndex (which may _not_ be NULL). If all glyphs have been laid out, +set it to [layoutManager numberOfGlyphs]. + +howMany is the number of requested line fragment rectangles. The typesetter +should try to create approximately this many and then stop. If it is 0, the +typesetter should fill the entire text container. + +Returns: + 0 did some layout, nothing special happened + 1 text container is full + 2 all glyphs have been laid out + +Subclasses need to implement this method. + +{Too much context?} +*/ +-(int) layoutGlyphsInLayoutManager: (GSLayoutManager *)layoutManager + inTextContainer: (NSTextContainer *)textContainer + startingAtGlyphIndex: (unsigned int)glyphIndex + previousLineFragmentRect: (NSRect)previousLineFragRect + nextGlyphIndex: (unsigned int *)nextGlyphIndex + numberOfLineFragments: (unsigned int)howMany; + +@end + +#endif + diff --git a/Headers/Additions/GNUstepGUI/GSVbox.h b/Headers/Additions/GNUstepGUI/GSVbox.h new file mode 100644 index 000000000..b21ce6e9c --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSVbox.h @@ -0,0 +1,117 @@ +/* + GSVbox.h + + The GSVbox class (a GNU extension) + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +// +// See GSHbox.h for comments. +// This file is generated from GSHbox.h by removing comments +// and substituting all occurrences of "hbox" with "vbox", +// "XResizing" with "YResizing", "MinXMargin" with "MinYMargin". +// + + +#ifndef _GNUstep_H_GSVbox +#define _GNUstep_H_GSVbox + +#include "GSTable.h" + +@interface GSVbox: GSTable +{ + BOOL _haveViews; + float _defaultMinYMargin; +} + +// +// Initizialing. +// +-(id) init; + +// +// Setting Border. +// + +// Inherited from GSTable Class: +//-(void) setBorder: (float)aBorder; +//-(void) setXBorder: (float)aBorder; +//-(void) setYBorder: (float)aBorder; +//-(void) setMinXBorder: (float)aBorder; +//-(void) setMaxXBorder: (float)aBorder; +//-(void) setMinYBorder: (float)aBorder; +//-(void) setMaxYBorder: (float)aBorder; + +// +// Adding a View. +// +-(void) addView: (NSView *)aView; + +-(void) addView: (NSView *)aView +enablingYResizing: (BOOL)aFlag; + +-(void) addView: (NSView *)aView + withMinYMargin: (float)aMargin; + +-(void) addView: (NSView *)aView +enablingYResizing: (BOOL)aFlag + withMinYMargin: (float)aMargin; + +// +// Adding a Separator. +// +-(void) addSeparator; +-(void) addSeparatorWithMinYMargin: (float)aMargin; + +// +// Setting Margins. +// +-(void) setDefaultMinYMargin: (float)aMargin; + +// +// Minimum Size. +// + +// Inherited from GSTable Class: +// -(NSSize) minimumSize; + +// +// Resizing. +// + +// Inherited from GSTable Class: +// -(void) sizeToFit; + +// +// Getting Number of Views +// +-(int) numberOfViews; +@end + +#endif /* _GNUstep_H_GSVbox */ + + + + + diff --git a/Headers/Additions/GNUstepGUI/GSVersion.h b/Headers/Additions/GNUstepGUI/GSVersion.h new file mode 100644 index 000000000..4231777b7 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSVersion.h @@ -0,0 +1,36 @@ +/* + GSVersion.h + + Define version of GNUstep GUI Library + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef GNUSTEP_GUI_VERSION + +#define GNUSTEP_GUI_VERSION 0.8.8 +#define GNUSTEP_GUI_MAJOR_VERSION 0 +#define GNUSTEP_GUI_MINOR_VERSION 8 +#define GNUSTEP_GUI_SUBMINOR_VERSION 8 + +#endif /* GNUSTEP_GUI_VERSION */ diff --git a/Headers/Additions/GNUstepGUI/GSVersion.h.in b/Headers/Additions/GNUstepGUI/GSVersion.h.in new file mode 100644 index 000000000..7e7a3f2db --- /dev/null +++ b/Headers/Additions/GNUstepGUI/GSVersion.h.in @@ -0,0 +1,36 @@ +/* + GSVersion.h + + Define version of GNUstep GUI Library + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef GNUSTEP_GUI_VERSION + +#define GNUSTEP_GUI_VERSION @GNUSTEP_GUI_VERSION@ +#define GNUSTEP_GUI_MAJOR_VERSION @GNUSTEP_GUI_MAJOR_VERSION@ +#define GNUSTEP_GUI_MINOR_VERSION @GNUSTEP_GUI_MINOR_VERSION@ +#define GNUSTEP_GUI_SUBMINOR_VERSION @GNUSTEP_GUI_SUBMINOR_VERSION@ + +#endif /* GNUSTEP_GUI_VERSION */ diff --git a/Headers/Additions/GNUstepGUI/IMConnectors.h b/Headers/Additions/GNUstepGUI/IMConnectors.h new file mode 100644 index 000000000..70b6c0164 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/IMConnectors.h @@ -0,0 +1,59 @@ +/* + IMConnectors.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: November 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +/* These classes were inspired by IBConnectors classes from objcX, "an + Objective-C class library for a window system". The code was originally + written by Scott Francis, Paul Kunz, Imran Qureshi and Libing Wang. */ + +#ifndef _GNUstep_H_IMConnectors +#define _GNUstep_H_IMConnectors + +#ifndef GNUSTEP +#include +#else +#include +#endif + +@interface IMConnector : NSObject +{ + id source; + id destination; + NSString* label; +} + +- source; +- destination; +- label; +@end + +@interface IMControlConnector:IMConnector +- (void)establishConnection; +@end + +@interface IMOutletConnector : IMConnector +- (void)establishConnection; +@end + +#endif /* _GNUstep_H_IMConnectors */ diff --git a/Headers/Additions/GNUstepGUI/IMCustomObject.h b/Headers/Additions/GNUstepGUI/IMCustomObject.h new file mode 100644 index 000000000..422ac6a24 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/IMCustomObject.h @@ -0,0 +1,71 @@ +/* + IMCustomObject.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: November 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +/* This class was inspired by CustomObject class from objcX, "an Objective-C + class library for a window system". The code was originally written by + Paul Kunz and Imran Qureshi. */ + +#ifndef _GNUstep_H_IMCustomObject +#define _GNUstep_H_IMCustomObject + +#ifndef GNUSTEP +#include +#else +#include +#include +#endif + +/* Add an archiving category to object so every object can respond to + -nibInstantiate +*/ +@interface NSObject (ModelUnarchiving) +- (id)nibInstantiate; +@end + + +@interface IMCustomObject : NSObject +{ + NSString* className; + id realObject; + id extension; +} + +- (id)nibInstantiate; + +@end + + +@interface IMCustomView : NSView +{ + NSString* className; + id realObject; + id extension; +} + +- (id)nibInstantiate; + +@end + +#endif /* _GNUstep_H_IMCustomObject */ diff --git a/Headers/Additions/GNUstepGUI/IMLoading.h b/Headers/Additions/GNUstepGUI/IMLoading.h new file mode 100644 index 000000000..40158967f --- /dev/null +++ b/Headers/Additions/GNUstepGUI/IMLoading.h @@ -0,0 +1,52 @@ +/* + IMLoading.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: November 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_IMLoading +#define _GNUstep_H_IMLoading + +#ifndef GNUSTEP +#include +#else +#include +#endif + +@interface NSObject (NibAwaking) +- (void)awakeFromModel; +@end + +@interface GMModel : NSObject +{ + NSArray* objects; + NSArray* connections; +} ++ (BOOL)loadIMFile:(NSString*)path owner:(id)owner; ++ (BOOL)loadIMFile:(NSString*)path owner:(id)owner bundle:(NSBundle*)bundle; +- (void)_makeConnections; +- (void)_setObjects:objects connections:connections; +- (NSArray *) objects; +- (NSArray *) connections; +@end + +#endif /* _GNUstep_H_IMLoading */ diff --git a/Headers/Additions/GNUstepGUI/config.h.in b/Headers/Additions/GNUstepGUI/config.h.in new file mode 100644 index 000000000..78e295247 --- /dev/null +++ b/Headers/Additions/GNUstepGUI/config.h.in @@ -0,0 +1,74 @@ +/* Source/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOFILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `rint' function. */ +#undef HAVE_RINT + +/* Define to 1 if you have the `rintf' function. */ +#undef HAVE_RINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + + +/* Define for those who don't have rintf and/or rint */ +#ifndef HAVE_RINTF +#define rintf rint +#endif +#ifndef HAVE_RINT +#define DEFINE_RINT_IF_MISSING \ +static double rint(double a) \ +{ \ + return (floor(a+0.5)); \ +} +#else +#define DEFINE_RINT_IF_MISSING +#endif + diff --git a/Headers/AppKit/AppKit.h b/Headers/AppKit/AppKit.h new file mode 100644 index 000000000..eacea61e3 --- /dev/null +++ b/Headers/AppKit/AppKit.h @@ -0,0 +1,158 @@ +/* + AppKit.h + + Main include file for GNUstep GUI Library + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_AppKit +#define _GNUstep_H_AppKit + +/* Define library version */ +#include + +// +// Foundation +// +#include + +// +// GNUstep GUI Library functions +// +#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 +#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 +#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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef STRICT_OPENSTEP +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include + +#endif /* _GNUstep_H_AppKit */ diff --git a/Headers/AppKit/AppKitDefines.h b/Headers/AppKit/AppKitDefines.h new file mode 100644 index 000000000..09219e946 --- /dev/null +++ b/Headers/AppKit/AppKitDefines.h @@ -0,0 +1,44 @@ +/* Plateform specific definitions for externs + Copyright (C) 2001 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Jul, 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef __AppKitDefines_INCLUDE +#define __AppKitDefines_INCLUDE + +#ifdef GNUSTEP_WITH_DLL + +#if BUILD_libgnustep_gui_DLL +# define APPKIT_EXPORT __declspec(dllexport) +# define APPKIT_DECLARE __declspec(dllexport) +#else +# define APPKIT_EXPORT extern __declspec(dllimport) +# define APPKIT_DECLARE __declspec(dllimport) +#endif + +#else /* GNUSTEP_WITH[OUT]_DLL */ + +# define APPKIT_EXPORT extern +# define APPKIT_DECLARE + +#endif + +#endif /* __AppKitDefines_INCLUDE */ diff --git a/Headers/AppKit/AppKitExceptions.h b/Headers/AppKit/AppKitExceptions.h new file mode 100644 index 000000000..a54e72fd0 --- /dev/null +++ b/Headers/AppKit/AppKitExceptions.h @@ -0,0 +1,73 @@ +/* + AppKitExceptions.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: February 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ +#ifndef __AppKit_AppKitExceptions_h__ +#define __AppKit_AppKitExceptions_h__ + +#include + +@class NSString; + +APPKIT_EXPORT NSString *NSAbortModalException; +APPKIT_EXPORT NSString *NSAbortPrintingException; +APPKIT_EXPORT NSString *NSAppKitIgnoredException; +APPKIT_EXPORT NSString *NSAppKitVirtualMemoryException; +APPKIT_EXPORT NSString *NSBadBitmapParametersException; +APPKIT_EXPORT NSString *NSBadComparisonException; +APPKIT_EXPORT NSString *NSBadRTFColorTableException; +APPKIT_EXPORT NSString *NSBadRTFDirectiveException; +APPKIT_EXPORT NSString *NSBadRTFFontTableException; +APPKIT_EXPORT NSString *NSBadRTFStyleSheetException; +APPKIT_EXPORT NSString *NSBrowserIllegalDelegateException; +APPKIT_EXPORT NSString *NSColorListIOException; +APPKIT_EXPORT NSString *NSColorListNotEditableException; +APPKIT_EXPORT NSString *NSDraggingException; +APPKIT_EXPORT NSString *NSFontUnavailableException; +APPKIT_EXPORT NSString *NSIllegalSelectorException; +APPKIT_EXPORT NSString *NSImageCacheException; +APPKIT_EXPORT NSString *NSNibLoadingException; +APPKIT_EXPORT NSString *NSPPDIncludeNotFoundException; +APPKIT_EXPORT NSString *NSPPDIncludeStackOverflowException; +APPKIT_EXPORT NSString *NSPPDIncludeStackUnderflowException; +APPKIT_EXPORT NSString *NSPPDParseException; +APPKIT_EXPORT NSString *NSPasteboardCommunicationException; +APPKIT_EXPORT NSString *NSPrintOperationExistsException; +APPKIT_EXPORT NSString *NSPrintPackageException; +APPKIT_EXPORT NSString *NSPrintingCommunicationException; +APPKIT_EXPORT NSString *NSRTFPropertyStackOverflowException; +APPKIT_EXPORT NSString *NSTIFFException; +APPKIT_EXPORT NSString *NSTextLineTooLongException; +APPKIT_EXPORT NSString *NSTextNoSelectionException; +APPKIT_EXPORT NSString *NSTextReadException; +APPKIT_EXPORT NSString *NSTextWriteException; +APPKIT_EXPORT NSString *NSTypedStreamVersionException; +APPKIT_EXPORT NSString *NSWindowServerCommunicationException; +APPKIT_EXPORT NSString *NSWordTablesReadException; +APPKIT_EXPORT NSString *NSWordTablesWriteException; + +#ifndef NO_GNUSTEP +APPKIT_EXPORT NSString *GSWindowServerInternalException; +#endif + +#endif /* __AppKit_AppKitExceptions_h__ */ diff --git a/Headers/AppKit/DPSOperators.h b/Headers/AppKit/DPSOperators.h new file mode 100644 index 000000000..484087940 --- /dev/null +++ b/Headers/AppKit/DPSOperators.h @@ -0,0 +1,1204 @@ +/* DPSOperators - Drawing engine operators that require context + + Copyright (C) 1999 Free Software Foundation, Inc. + Written by: Richard Frith-Macdonald + Based on code by Adam Fedor + Date: Feb 1999 + + This file is part of the GNU Objective C User Interface library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _DPSOperators_h_INCLUDE +#define _DPSOperators_h_INCLUDE + +#include + +#define GSCTXT NSGraphicsContext + +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentalpha(GSCTXT *ctxt, float* a) +__attribute__((unused)); + +static inline void +DPScurrentcmykcolor(GSCTXT *ctxt, float* c, float* m, float* y, float* k) +__attribute__((unused)); + +static inline void +DPScurrentgray(GSCTXT *ctxt, float* gray) +__attribute__((unused)); + +static inline void +DPScurrenthsbcolor(GSCTXT *ctxt, float* h, float* s, float* b) +__attribute__((unused)); + +static inline void +DPScurrentrgbcolor(GSCTXT *ctxt, float* r, float* g, float* b) +__attribute__((unused)); + +static inline void +DPSsetalpha(GSCTXT *ctxt, float a) +__attribute__((unused)); + +static inline void +DPSsetcmykcolor(GSCTXT *ctxt, float c, float m, float y, float k) +__attribute__((unused)); + +static inline void +DPSsetgray(GSCTXT *ctxt, float gray) +__attribute__((unused)); + +static inline void +DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) +__attribute__((unused)); + +static inline void +DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) +__attribute__((unused)); + + +static inline void +GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) +__attribute__((unused)); + +static inline void +GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) +__attribute__((unused)); + +static inline void +GSSetFillColor(GSCTXT *ctxt, float * values) +__attribute__((unused)); + +static inline void +GSSetStrokeColor(GSCTXT *ctxt, float * values) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSashow(GSCTXT *ctxt, float x, float y, const char* s) +__attribute__((unused)); + +static inline void +DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char* s) +__attribute__((unused)); + +static inline void +DPScharpath(GSCTXT *ctxt, const char* s, int b) +__attribute__((unused)); + +static inline void +DPSshow(GSCTXT *ctxt, const char* s) +__attribute__((unused)); + +static inline void +DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char* s) +__attribute__((unused)); + +static inline void +DPSxshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +__attribute__((unused)); + +static inline void +DPSxyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +__attribute__((unused)); + +static inline void +DPSyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +__attribute__((unused)); + + +static inline void +GSSetCharacterSpacing(GSCTXT *ctxt, float extra) +__attribute__((unused)); + +static inline void +GSSetFont(GSCTXT *ctxt, NSFont* font) +__attribute__((unused)); + +static inline void +GSSetFontSize(GSCTXT *ctxt, float size) +__attribute__((unused)); + +static inline NSAffineTransform * +GSGetTextCTM(GSCTXT *ctxt) +__attribute__((unused)); + +static inline NSPoint +GSGetTextPosition(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +__attribute__((unused)); + +static inline void +GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) +__attribute__((unused)); + +static inline void +GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) +__attribute__((unused)); + +static inline void +GSShowText(GSCTXT *ctxt, const char * string, size_t length) +__attribute__((unused)); + +static inline void +GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSgrestore(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSgsave(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSinitgraphics(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSsetgstate(GSCTXT *ctxt, int gst) +__attribute__((unused)); + + +static inline int +GSDefineGState(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +GSUndefineGState(GSCTXT *ctxt, int gst) +__attribute__((unused)); + +static inline void +GSReplaceGState(GSCTXT *ctxt, int gst) +__attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentflat(GSCTXT *ctxt, float* flatness) +__attribute__((unused)); + +static inline void +DPScurrentlinecap(GSCTXT *ctxt, int* linecap) +__attribute__((unused)); + +static inline void +DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) +__attribute__((unused)); + +static inline void +DPScurrentlinewidth(GSCTXT *ctxt, float* width) +__attribute__((unused)); + +static inline void +DPScurrentmiterlimit(GSCTXT *ctxt, float* limit) +__attribute__((unused)); + +static inline void +DPScurrentpoint(GSCTXT *ctxt, float* x, float* y) +__attribute__((unused)); + +static inline void +DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) +__attribute__((unused)); + +static inline void +DPSsetdash(GSCTXT *ctxt, const float* pat, int size, float offset) +__attribute__((unused)); + +static inline void +DPSsetflat(GSCTXT *ctxt, float flatness) +__attribute__((unused)); + +static inline void +DPSsethalftonephase(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPSsetlinecap(GSCTXT *ctxt, int linecap) +__attribute__((unused)); + +static inline void +DPSsetlinejoin(GSCTXT *ctxt, int linejoin) +__attribute__((unused)); + +static inline void +DPSsetlinewidth(GSCTXT *ctxt, float width) +__attribute__((unused)); + +static inline void +DPSsetmiterlimit(GSCTXT *ctxt, float limit) +__attribute__((unused)); + +static inline void +DPSsetstrokeadjust(GSCTXT *ctxt, int b) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSconcat(GSCTXT *ctxt, const float* m) +__attribute__((unused)); + +static inline void +DPSinitmatrix(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSrotate(GSCTXT *ctxt, float angle) +__attribute__((unused)); + +static inline void +DPSscale(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPStranslate(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + + +static inline NSAffineTransform * +GSCurrentCTM(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +__attribute__((unused)); + +static inline void +GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSarc(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) +__attribute__((unused)); + +static inline void +DPSarcn(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) +__attribute__((unused)); + +static inline void +DPSarct(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r) +__attribute__((unused)); + +static inline void +DPSclip(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSclosepath(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPScurveto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float x3, float y3) +__attribute__((unused)); + +static inline void +DPSeoclip(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSeofill(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSfill(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSflattenpath(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSinitclip(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSlineto(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPSmoveto(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPSnewpath(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSpathbbox(GSCTXT *ctxt, float* llx, float* lly, float* urx, float* ury) +__attribute__((unused)); + +static inline void +DPSrcurveto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float x3, float y3) +__attribute__((unused)); + +static inline void +DPSrectclip(GSCTXT *ctxt, float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +DPSreversepath(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSrlineto(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPSrmoveto(GSCTXT *ctxt, float x, float y) +__attribute__((unused)); + +static inline void +DPSstroke(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSshfill(GSCTXT *ctxt, NSDictionary *shaderDictionary) +__attribute__((unused)); + + +static inline void +GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) +__attribute__((unused)); + +static inline void +GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) +__attribute__((unused)); + +static inline void +GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Window system ops */ +/* ----------------------------------------------------------------------- */ +static inline void +GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) +__attribute__((unused)); + +static inline void +DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) +__attribute__((unused)); + +static inline void +GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) +__attribute__((unused)); + +static inline void +DPSsetoffset(GSCTXT *ctxt, short int x, short int y) +__attribute__((unused)); + + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ +static inline void +DPScomposite(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) +__attribute__((unused)); + +static inline void +DPScompositerect(GSCTXT *ctxt, float x, float y, float w, float h, int op) +__attribute__((unused)); + +static inline void +DPSdissolve(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) +__attribute__((unused)); + + +static inline void +GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) +__attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ +static void +DPSPrintf(GSCTXT *ctxt, const char * fmt, ...) +__attribute__((unused)); + +static inline void +DPSWriteData(GSCTXT *ctxt, const char * buf, unsigned int count) +__attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentalpha(GSCTXT *ctxt, float* a) +{ + (ctxt->methods->DPScurrentalpha_) + (ctxt, @selector(DPScurrentalpha:), a); +} + +static inline void +DPScurrentcmykcolor(GSCTXT *ctxt, float* c, float* m, float* y, float* k) +{ + (ctxt->methods->DPScurrentcmykcolor____) + (ctxt, @selector(DPScurrentcmykcolor::::), c, m, y, k); +} + +static inline void +DPScurrentgray(GSCTXT *ctxt, float* gray) +{ + (ctxt->methods->DPScurrentgray_) + (ctxt, @selector(DPScurrentgray:), gray); +} + +static inline void +DPScurrenthsbcolor(GSCTXT *ctxt, float* h, float* s, float* b) +{ + (ctxt->methods->DPScurrenthsbcolor___) + (ctxt, @selector(DPScurrenthsbcolor:::), h, s, b); +} + +static inline void +DPScurrentrgbcolor(GSCTXT *ctxt, float* r, float* g, float* b) +{ + (ctxt->methods->DPScurrentrgbcolor___) + (ctxt, @selector(DPScurrentrgbcolor:::), r, g, b); +} + +static inline void +DPSsetalpha(GSCTXT *ctxt, float a) +{ + (ctxt->methods->DPSsetalpha_) + (ctxt, @selector(DPSsetalpha:), a); +} + +static inline void +DPSsetcmykcolor(GSCTXT *ctxt, float c, float m, float y, float k) +{ + (ctxt->methods->DPSsetcmykcolor____) + (ctxt, @selector(DPSsetcmykcolor::::), c, m, y, k); +} + +static inline void +DPSsetgray(GSCTXT *ctxt, float gray) +{ + (ctxt->methods->DPSsetgray_) + (ctxt, @selector(DPSsetgray:), gray); +} + +static inline void +DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) +{ + (ctxt->methods->DPSsethsbcolor___) + (ctxt, @selector(DPSsethsbcolor:::), h, s, b); +} + +static inline void +DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) +{ + (ctxt->methods->DPSsetrgbcolor___) + (ctxt, @selector(DPSsetrgbcolor:::), r, g, b); +} + + +static inline void +GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) +{ + (ctxt->methods->GSSetFillColorspace_) + (ctxt, @selector(GSSetFillColorspace:), dict); +} + +static inline void +GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) +{ + (ctxt->methods->GSSetStrokeColorspace_) + (ctxt, @selector(GSSetStrokeColorspace:), dict); +} + +static inline void +GSSetFillColor(GSCTXT *ctxt, float * values) +{ + (ctxt->methods->GSSetFillColor_) + (ctxt, @selector(GSSetFillColor:), values); +} + +static inline void +GSSetStrokeColor(GSCTXT *ctxt, float * values) +{ + (ctxt->methods->GSSetStrokeColor_) + (ctxt, @selector(GSSetStrokeColor:), values); +} + + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSashow(GSCTXT *ctxt, float x, float y, const char* s) +{ + (ctxt->methods->DPSashow___) + (ctxt, @selector(DPSashow:::), x, y, s); +} + +static inline void +DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char* s) +{ + (ctxt->methods->DPSawidthshow______) + (ctxt, @selector(DPSawidthshow::::::), cx, cy, c, ax, ay, s); +} + +static inline void +DPScharpath(GSCTXT *ctxt, const char* s, int b) +{ + (ctxt->methods->DPScharpath__) + (ctxt, @selector(DPScharpath::), s, b); +} + +static inline void +DPSshow(GSCTXT *ctxt, const char* s) +{ + (ctxt->methods->DPSshow_) + (ctxt, @selector(DPSshow:), s); +} + +static inline void +DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char* s) +{ + (ctxt->methods->DPSwidthshow____) + (ctxt, @selector(DPSwidthshow::::), x, y, c, s); +} + +static inline void +DPSxshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +{ + (ctxt->methods->DPSxshow___) + (ctxt, @selector(DPSxshow:::), s, numarray, size); +} + +static inline void +DPSxyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +{ + (ctxt->methods->DPSxyshow___) + (ctxt, @selector(DPSxyshow:::), s, numarray, size); +} + +static inline void +DPSyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +{ + (ctxt->methods->DPSyshow___) + (ctxt, @selector(DPSyshow:::), s, numarray, size); +} + + +static inline void +GSSetCharacterSpacing(GSCTXT *ctxt, float extra) +{ + (ctxt->methods->GSSetCharacterSpacing_) + (ctxt, @selector(GSSetCharacterSpacing:), extra); +} + +static inline void +GSSetFont(GSCTXT *ctxt, NSFont* font) +{ + (ctxt->methods->GSSetFont_) + (ctxt, @selector(GSSetFont:), font); +} + +static inline void +GSSetFontSize(GSCTXT *ctxt, float size) +{ + (ctxt->methods->GSSetFontSize_) + (ctxt, @selector(GSSetFontSize:), size); +} + +static inline NSAffineTransform * +GSGetTextCTM(GSCTXT *ctxt) +{ + return (ctxt->methods->GSGetTextCTM) + (ctxt, @selector(GSGetTextCTM)); +} + +static inline NSPoint +GSGetTextPosition(GSCTXT *ctxt) +{ + return (ctxt->methods->GSGetTextPosition) + (ctxt, @selector(GSGetTextPosition)); +} + +static inline void +GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +{ + (ctxt->methods->GSSetTextCTM_) + (ctxt, @selector(GSSetTextCTM:), ctm); +} + +static inline void +GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) +{ + (ctxt->methods->GSSetTextDrawingMode_) + (ctxt, @selector(GSSetTextDrawingMode:), mode); +} + +static inline void +GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) +{ + (ctxt->methods->GSSetTextPosition_) + (ctxt, @selector(GSSetTextPosition:), loc); +} + +static inline void +GSShowText(GSCTXT *ctxt, const char * string, size_t length) +{ + (ctxt->methods->GSShowText__) + (ctxt, @selector(GSShowText::), string, length); +} + +static inline void +GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) +{ + (ctxt->methods->GSShowGlyphs__) + (ctxt, @selector(GSShowGlyphs::), glyphs, length); +} + + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSgrestore(GSCTXT *ctxt) +{ + (ctxt->methods->DPSgrestore) + (ctxt, @selector(DPSgrestore)); +} + +static inline void +DPSgsave(GSCTXT *ctxt) +{ + (ctxt->methods->DPSgsave) + (ctxt, @selector(DPSgsave)); +} + +static inline void +DPSinitgraphics(GSCTXT *ctxt) +{ + (ctxt->methods->DPSinitgraphics) + (ctxt, @selector(DPSinitgraphics)); +} + +static inline void +DPSsetgstate(GSCTXT *ctxt, int gst) +{ + (ctxt->methods->DPSsetgstate_) + (ctxt, @selector(DPSsetgstate:), gst); +} + + +static inline int +GSDefineGState(GSCTXT *ctxt) +{ + return (ctxt->methods->GSDefineGState) + (ctxt, @selector(GSDefineGState)); +} + +static inline void +GSUndefineGState(GSCTXT *ctxt, int gst) +{ + (ctxt->methods->GSUndefineGState_) + (ctxt, @selector(GSUndefineGState:), gst); +} + +static inline void +GSReplaceGState(GSCTXT *ctxt, int gst) +{ + (ctxt->methods->GSReplaceGState_) + (ctxt, @selector(GSReplaceGState:), gst); +} + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentflat(GSCTXT *ctxt, float* flatness) +{ + (ctxt->methods->DPScurrentflat_) + (ctxt, @selector(DPScurrentflat:), flatness); +} + +static inline void +DPScurrentlinecap(GSCTXT *ctxt, int* linecap) +{ + (ctxt->methods->DPScurrentlinecap_) + (ctxt, @selector(DPScurrentlinecap:), linecap); +} + +static inline void +DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) +{ + (ctxt->methods->DPScurrentlinejoin_) + (ctxt, @selector(DPScurrentlinejoin:), linejoin); +} + +static inline void +DPScurrentlinewidth(GSCTXT *ctxt, float* width) +{ + (ctxt->methods->DPScurrentlinewidth_) + (ctxt, @selector(DPScurrentlinewidth:), width); +} + +static inline void +DPScurrentmiterlimit(GSCTXT *ctxt, float* limit) +{ + (ctxt->methods->DPScurrentmiterlimit_) + (ctxt, @selector(DPScurrentmiterlimit:), limit); +} + +static inline void +DPScurrentpoint(GSCTXT *ctxt, float* x, float* y) +{ + (ctxt->methods->DPScurrentpoint__) + (ctxt, @selector(DPScurrentpoint::), x, y); +} + +static inline void +DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) +{ + (ctxt->methods->DPScurrentstrokeadjust_) + (ctxt, @selector(DPScurrentstrokeadjust:), b); +} + +static inline void +DPSsetdash(GSCTXT *ctxt, const float* pat, int size, float offset) +{ + (ctxt->methods->DPSsetdash___) + (ctxt, @selector(DPSsetdash:::), pat, size, offset); +} + +static inline void +DPSsetflat(GSCTXT *ctxt, float flatness) +{ + (ctxt->methods->DPSsetflat_) + (ctxt, @selector(DPSsetflat:), flatness); +} + +static inline void +DPSsethalftonephase(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSsethalftonephase__) + (ctxt, @selector(DPSsethalftonephase::), x, y); +} + +static inline void +DPSsetlinecap(GSCTXT *ctxt, int linecap) +{ + (ctxt->methods->DPSsetlinecap_) + (ctxt, @selector(DPSsetlinecap:), linecap); +} + +static inline void +DPSsetlinejoin(GSCTXT *ctxt, int linejoin) +{ + (ctxt->methods->DPSsetlinejoin_) + (ctxt, @selector(DPSsetlinejoin:), linejoin); +} + +static inline void +DPSsetlinewidth(GSCTXT *ctxt, float width) +{ + (ctxt->methods->DPSsetlinewidth_) + (ctxt, @selector(DPSsetlinewidth:), width); +} + +static inline void +DPSsetmiterlimit(GSCTXT *ctxt, float limit) +{ + (ctxt->methods->DPSsetmiterlimit_) + (ctxt, @selector(DPSsetmiterlimit:), limit); +} + +static inline void +DPSsetstrokeadjust(GSCTXT *ctxt, int b) +{ + (ctxt->methods->DPSsetstrokeadjust_) + (ctxt, @selector(DPSsetstrokeadjust:), b); +} + + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSconcat(GSCTXT *ctxt, const float* m) +{ + (ctxt->methods->DPSconcat_) + (ctxt, @selector(DPSconcat:), m); +} + +static inline void +DPSinitmatrix(GSCTXT *ctxt) +{ + (ctxt->methods->DPSinitmatrix) + (ctxt, @selector(DPSinitmatrix)); +} + +static inline void +DPSrotate(GSCTXT *ctxt, float angle) +{ + (ctxt->methods->DPSrotate_) + (ctxt, @selector(DPSrotate:), angle); +} + +static inline void +DPSscale(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSscale__) + (ctxt, @selector(DPSscale::), x, y); +} + +static inline void +DPStranslate(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPStranslate__) + (ctxt, @selector(DPStranslate::), x, y); +} + + +static inline NSAffineTransform * +GSCurrentCTM(GSCTXT *ctxt) +{ + return (ctxt->methods->GSCurrentCTM) + (ctxt, @selector(GSCurrentCTM)); +} + +static inline void +GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +{ + (ctxt->methods->GSSetCTM_) + (ctxt, @selector(GSSetCTM:), ctm); +} + +static inline void +GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) +{ + (ctxt->methods->GSConcatCTM_) + (ctxt, @selector(GSConcatCTM:), ctm); +} + + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPSarc(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) +{ + (ctxt->methods->DPSarc_____) + (ctxt, @selector(DPSarc:::::), x, y, r, angle1, angle2); +} + +static inline void +DPSarcn(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) +{ + (ctxt->methods->DPSarcn_____) + (ctxt, @selector(DPSarcn:::::), x, y, r, angle1, angle2); +} + +static inline void +DPSarct(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r) +{ + (ctxt->methods->DPSarct_____) + (ctxt, @selector(DPSarct:::::), x1, y1, x2, y2, r); +} + +static inline void +DPSclip(GSCTXT *ctxt) +{ + (ctxt->methods->DPSclip) + (ctxt, @selector(DPSclip)); +} + +static inline void +DPSclosepath(GSCTXT *ctxt) +{ + (ctxt->methods->DPSclosepath) + (ctxt, @selector(DPSclosepath)); +} + +static inline void +DPScurveto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float x3, float y3) +{ + (ctxt->methods->DPScurveto______) + (ctxt, @selector(DPScurveto::::::), x1, y1, x2, y2, x3, y3); +} + +static inline void +DPSeoclip(GSCTXT *ctxt) +{ + (ctxt->methods->DPSeoclip) + (ctxt, @selector(DPSeoclip)); +} + +static inline void +DPSeofill(GSCTXT *ctxt) +{ + (ctxt->methods->DPSeofill) + (ctxt, @selector(DPSeofill)); +} + +static inline void +DPSfill(GSCTXT *ctxt) +{ + (ctxt->methods->DPSfill) + (ctxt, @selector(DPSfill)); +} + +static inline void +DPSflattenpath(GSCTXT *ctxt) +{ + (ctxt->methods->DPSflattenpath) + (ctxt, @selector(DPSflattenpath)); +} + +static inline void +DPSinitclip(GSCTXT *ctxt) +{ + (ctxt->methods->DPSinitclip) + (ctxt, @selector(DPSinitclip)); +} + +static inline void +DPSlineto(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSlineto__) + (ctxt, @selector(DPSlineto::), x, y); +} + +static inline void +DPSmoveto(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSmoveto__) + (ctxt, @selector(DPSmoveto::), x, y); +} + +static inline void +DPSnewpath(GSCTXT *ctxt) +{ + (ctxt->methods->DPSnewpath) + (ctxt, @selector(DPSnewpath)); +} + +static inline void +DPSpathbbox(GSCTXT *ctxt, float* llx, float* lly, float* urx, float* ury) +{ + (ctxt->methods->DPSpathbbox____) + (ctxt, @selector(DPSpathbbox::::), llx, lly, urx, ury); +} + +static inline void +DPSrcurveto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float x3, float y3) +{ + (ctxt->methods->DPSrcurveto______) + (ctxt, @selector(DPSrcurveto::::::), x1, y1, x2, y2, x3, y3); +} + +static inline void +DPSrectclip(GSCTXT *ctxt, float x, float y, float w, float h) +{ + (ctxt->methods->DPSrectclip____) + (ctxt, @selector(DPSrectclip::::), x, y, w, h); +} + +static inline void +DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) +{ + (ctxt->methods->DPSrectfill____) + (ctxt, @selector(DPSrectfill::::), x, y, w, h); +} + +static inline void +DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) +{ + (ctxt->methods->DPSrectstroke____) + (ctxt, @selector(DPSrectstroke::::), x, y, w, h); +} + +static inline void +DPSreversepath(GSCTXT *ctxt) +{ + (ctxt->methods->DPSreversepath) + (ctxt, @selector(DPSreversepath)); +} + +static inline void +DPSrlineto(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSrlineto__) + (ctxt, @selector(DPSrlineto::), x, y); +} + +static inline void +DPSrmoveto(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSrmoveto__) + (ctxt, @selector(DPSrmoveto::), x, y); +} + +static inline void +DPSstroke(GSCTXT *ctxt) +{ + (ctxt->methods->DPSstroke) + (ctxt, @selector(DPSstroke)); +} + +static inline void +DPSshfill(GSCTXT *ctxt, NSDictionary *shaderDictionary) +{ + (ctxt->methods->DPSshfill) + (ctxt, @selector(DPSshfill:), shaderDictionary); +} + + +static inline void +GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) +{ + (ctxt->methods->GSSendBezierPath_) + (ctxt, @selector(GSSendBezierPath:), path); +} + +static inline void +GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) +{ + (ctxt->methods->GSRectClipList__) + (ctxt, @selector(GSRectClipList::), rects, count); +} + +static inline void +GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) +{ + (ctxt->methods->GSRectFillList__) + (ctxt, @selector(GSRectFillList::), rects, count); +} + + +/* ----------------------------------------------------------------------- */ +/* Window system ops */ +/* ----------------------------------------------------------------------- */ +static inline void +GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) +{ + (ctxt->methods->GSCurrentDevice___) + (ctxt, @selector(GSCurrentGCDevice:::), device, x, y); +} + +static inline void +DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) +{ + (ctxt->methods->DPScurrentoffset__) + (ctxt, @selector(DPScurrentoffset::), x, y); +} + +static inline void +GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) +{ + (ctxt->methods->GSSetDevice___) + (ctxt, @selector(GSSetGCDevice:::), device, x, y); +} + +static inline void +DPSsetoffset(GSCTXT *ctxt, short int x, short int y) +{ + (ctxt->methods->DPSsetoffset__) + (ctxt, @selector(DPSsetoffset::), x, y); +} + + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ +static inline void +DPScomposite(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) +{ + (ctxt->methods->DPScomposite________) + (ctxt, @selector(DPScomposite::::::::), x, y, w, h, gstateNum, dx, dy, op); +} + +static inline void +DPScompositerect(GSCTXT *ctxt, float x, float y, float w, float h, int op) +{ + (ctxt->methods->DPScompositerect_____) + (ctxt, @selector(DPScompositerect:::::), x, y, w, h, op); +} + +static inline void +DPSdissolve(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) +{ + (ctxt->methods->DPSdissolve________) + (ctxt, @selector(DPSdissolve::::::::), x, y, w, h, gstateNum, dx, dy, delta); +} + + +static inline void +GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) +{ + (ctxt->methods->GSDrawImage__) + (ctxt, @selector(GSDrawImage::), rect, imageref); +} + + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ +static void +DPSPrintf(GSCTXT *ctxt, const char * fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (fmt != NULL) + (ctxt->methods->DPSPrintf__) + (ctxt, @selector(DPSPrintf::), fmt, ap); + va_end(ap); +} + +static inline void +DPSWriteData(GSCTXT *ctxt, const char * buf, unsigned int count) +{ + (ctxt->methods->DPSWriteData__) + (ctxt, @selector(DPSWriteData::), buf, count); +} + +#endif diff --git a/Headers/AppKit/NSActionCell.h b/Headers/AppKit/NSActionCell.h new file mode 100644 index 000000000..7ee83f5f0 --- /dev/null +++ b/Headers/AppKit/NSActionCell.h @@ -0,0 +1,44 @@ +/* + NSActionCell.h + + Abstract cell for target/action paradigm + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSActionCell +#define _GNUstep_H_NSActionCell + +#include + +@interface NSActionCell : NSCell +{ + // Attributes + int _tag; + id _target; + SEL _action; + NSView *_control_view; +} +@end + +#endif // _GNUstep_H_NSActionCell diff --git a/Headers/AppKit/NSAffineTransform.h b/Headers/AppKit/NSAffineTransform.h new file mode 100644 index 000000000..50d8eecb3 --- /dev/null +++ b/Headers/AppKit/NSAffineTransform.h @@ -0,0 +1,102 @@ +/* + NSAffineTransform.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: August 1997 + Rewrite for macOS-X compatibility: Richard Frith-Macdonald, 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSAffineTransform +#define _GNUstep_H_NSAffineTransform + +#include +#include + +@class NSBezierPath; + +typedef struct { + float m11; + float m12; + float m21; + float m22; + float tx; + float ty; +} NSAffineTransformStruct; + +@interface NSAffineTransform : NSObject +{ +@public + NSAffineTransformStruct matrix; +} + ++ (NSAffineTransform*) transform; +- (void) appendTransform: (NSAffineTransform*)aTransform; +- (void) concat; +- (id) initWithTransform: (NSAffineTransform*)aTransform; +- (void) invert; +- (void) prependTransform: (NSAffineTransform*)aTransform; +- (void) rotateByDegrees: (float)angle; +- (void) rotateByRadians: (float)angleRad; +- (void) scaleBy: (float)scale; +- (void) scaleXBy: (float)scaleX yBy: (float)scaleY; +- (void) set; +- (void) setTransformStruct: (NSAffineTransformStruct)val; +- (NSBezierPath*) transformBezierPath: (NSBezierPath*)aPath; +- (NSPoint) transformPoint: (NSPoint)aPoint; +- (NSSize) transformSize: (NSSize)aSize; +- (NSAffineTransformStruct) transformStruct; +- (void) translateXBy: (float)tranX yBy: (float)tranY; +@end + +#ifndef NO_GNUSTEP +@interface NSAffineTransform (GNUstep) +- (void) translateToPoint: (NSPoint)point; +- (void) scaleTo: (float)sx : (float)sy; +- (void) makeIdentityMatrix; +- (float) rotationAngle; +- (void) setFrameOrigin: (NSPoint)point; +- (void) setFrameRotation: (float)angle; + +/* Old Apple name for -invert */ +- (void) inverse; + +- (BOOL) isRotated; + +- (void) boundingRectFor: (NSRect)rect result: (NSRect*)new; + +/* Returns anotherMatrix * self */ +- (void) concatenateWith: (NSAffineTransform*)anotherMatrix; +- (void) concatenateWithMatrix: (const float[6])anotherMatrix; + +- (NSPoint) pointInMatrixSpace: (NSPoint)point; +- (NSPoint) deltaPointInMatrixSpace: (NSPoint)point; +- (NSSize) sizeInMatrixSpace: (NSSize)size; +- (NSRect) rectInMatrixSpace: (NSRect)rect; + +- (void) setMatrix: (const float[6])replace; +- (void) getMatrix: (float[6])replace; + +- (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform; + +@end +#endif + +#endif /* _GNUstep_H_NSAffineTransform */ diff --git a/Headers/AppKit/NSApplication.h b/Headers/AppKit/NSApplication.h new file mode 100644 index 000000000..8a53445b0 --- /dev/null +++ b/Headers/AppKit/NSApplication.h @@ -0,0 +1,456 @@ +/** + NSApplication.h + + The one and only application class + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Felipe A. Rodriguez + Date: August 1998 + Author: Richard Frith-Macdonald + Date: December 1998 + + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + AutogsdocSource: NSApplication.m + AutogsdocSource: GSServicesManager.m + +*/ + +#ifndef _GNUstep_H_NSApplication +#define _GNUstep_H_NSApplication + +#include + +@class NSArray; +@class NSAutoreleasePool; +@class NSMutableArray; +@class NSString; +@class NSException; +@class NSNotification; +@class NSDate; +@class NSTimer; + +@class NSEvent; +@class NSPasteboard; +@class NSMenu; +@class NSMenuItem; +@class NSImage; +@class NSWindow; +@class NSGraphicsContext; + +@class GSInfoPanel; + +typedef struct _NSModalSession *NSModalSession; + +enum { + NSRunStoppedResponse, + NSRunAbortedResponse, + NSRunContinuesResponse +}; + +#ifndef STRICT_OPENSTEP +#define NSUpdateWindowsRunLoopOrdering 600000 + +typedef enum { + NSTerminateCancel = NO, + NSTerminateNow = YES, + NSTerminateLater +} NSApplicationTerminateReply; + +typedef enum { + NSCriticalRequest, + NSInformationalRequest +} NSRequestUserAttentionType; + +#define NSAppKitVersionNumber10_0 0 +#endif + +APPKIT_EXPORT NSString *NSModalPanelRunLoopMode; +APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; + +@interface NSApplication : NSResponder +{ + NSGraphicsContext *_default_context; + NSEvent *_current_event; + NSModalSession _session; + NSWindow *_key_window; + NSWindow *_main_window; + id _delegate; + id _listener; + NSMenu *_main_menu; + NSMenu *_windows_menu; + // 5 bits + BOOL _app_is_running; + BOOL _app_is_active; + BOOL _app_is_hidden; + BOOL _unhide_on_activation; + BOOL _windows_need_update; + NSImage *_app_icon; + NSWindow *_app_icon_window; + NSMutableArray *_hidden; + NSMutableArray *_inactive; + NSWindow *_hidden_key; + GSInfoPanel *_infoPanel; + + /* This autorelease pool should only be created and used by -run, with + a single exception (which is why it is stored here as an ivar): the + -terminate: method will destroy this autorelease pool before exiting + the program. */ + NSAutoreleasePool *_runLoopPool; +} + +/* + * Class methods + */ + +#ifndef STRICT_OPENSTEP ++ (void) detachDrawingThread: (SEL)selector + toTarget: (id)target + withObject: (id)argument; +#endif + +/* + * Creating and initializing the NSApplication + */ ++ (NSApplication*) sharedApplication; + +/* + * Instance methods + */ + +/* + * Creating and initializing the NSApplication + */ +- (void) finishLaunching; + +/* + * Changing the active application + */ +- (void) activateIgnoringOtherApps: (BOOL)flag; +- (void) deactivate; +- (BOOL) isActive; +#ifndef STRICT_OPENSTEP +- (void) hideOtherApplications: (id)sender; +- (void) unhideAllApplications: (id)sender; +#endif + +/* + * Running the event loop + */ +- (void) abortModal; +- (NSModalSession) beginModalSessionForWindow: (NSWindow*)theWindow; +- (void) endModalSession: (NSModalSession)theSession; +- (BOOL) isRunning; +- (void) run; +- (int) runModalForWindow: (NSWindow*)theWindow; +- (int) runModalSession: (NSModalSession)theSession; +- (NSWindow *) modalWindow; +- (void) sendEvent: (NSEvent*)theEvent; +- (void) stop: (id)sender; +- (void) stopModal; +- (void) stopModalWithCode: (int)returnCode; + +#ifndef STRICT_OPENSTEP +- (int) runModalForWindow: (NSWindow *)theWindow + relativeToWindow: (NSWindow *)docWindow; +- (void) beginSheet: (NSWindow *)sheet + modalForWindow: (NSWindow *)docWindow + modalDelegate: (id)modalDelegate + didEndSelector: (SEL)didEndSelector + contextInfo: (void *)contextInfo; +- (void) endSheet: (NSWindow *)sheet; +- (void) endSheet: (NSWindow *)sheet + returnCode: (int)returnCode; +#endif + +/* + * Getting, removing, and posting events + */ +- (NSEvent*) currentEvent; +- (void) discardEventsMatchingMask: (unsigned int)mask + beforeEvent: (NSEvent*)lastEvent; +- (NSEvent*) nextEventMatchingMask: (unsigned int)mask + untilDate: (NSDate*)expiration + inMode: (NSString*)mode + dequeue: (BOOL)flag; +- (void) postEvent: (NSEvent*)event atStart: (BOOL)flag; + +/* + * Sending action messages + */ +- (BOOL) sendAction: (SEL)aSelector + to: (id)aTarget + from: (id)sender; +- (id) targetForAction: (SEL)aSelector; +#ifndef STRICT_OPENSTEP +- (id)targetForAction: (SEL)theAction + to: (id)theTarget + from: (id)sender; +#endif +- (BOOL) tryToPerform: (SEL)aSelector + with: (id)anObject; + +/* + * Setting the application's icon + */ +- (void) setApplicationIconImage: (NSImage*)anImage; +- (NSImage*) applicationIconImage; + +/* + * Hiding all windows + */ +- (void) hide: (id)sender; +- (BOOL) isHidden; +- (void) unhide: (id)sender; +- (void) unhideWithoutActivation; + +/* + * Managing windows + */ +- (NSWindow*) keyWindow; +- (NSWindow*) mainWindow; +- (NSWindow*) makeWindowsPerform: (SEL)aSelector + inOrder: (BOOL)flag; +- (void) miniaturizeAll: (id)sender; +- (void) preventWindowOrdering; +- (void) setWindowsNeedUpdate: (BOOL)flag; +- (void) updateWindows; +- (NSArray*) windows; +- (NSWindow*) windowWithWindowNumber: (int)windowNum; + +/* + * Showing Standard Panels + */ +#ifndef NO_GNUSTEP +/* GNUstep extensions displaying an infoPanel, title is 'Info' */ +/* For a list of the useful values in the dictionary, see GSInfoPanel.h. + The entries are mostly compatible with macosx. */ +- (void) orderFrontStandardInfoPanel: (id)sender; +- (void) orderFrontStandardInfoPanelWithOptions: (NSDictionary *)dictionary; +#endif +#ifndef STRICT_OPENSTEP +/* macosx extensions displaying an aboutPanel, title is 'About'. + NB: These two methods do exactly the same as the two methods above, + only the title is different. */ +- (void) orderFrontStandardAboutPanel: (id)sender; +- (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *)dictionary; +#endif + +/* + * Getting the main menu + */ +- (NSMenu*) mainMenu; +- (void) setMainMenu: (NSMenu*)aMenu; +#ifndef STRICT_OPENSTEP +- (void) setAppleMenu: (NSMenu*)aMenu; +#endif + +/* + * Managing the Windows menu + */ +- (void) addWindowsItem: (NSWindow*)aWindow + title: (NSString*)aString + filename: (BOOL)isFilename; +- (void) arrangeInFront: (id)sender; +- (void) changeWindowsItem: (NSWindow*)aWindow + title: (NSString*)aString + filename: (BOOL)isFilename; +- (void) removeWindowsItem: (NSWindow*)aWindow; +- (void) setWindowsMenu: (NSMenu*)aMenu; +- (void) updateWindowsItem: (NSWindow*)aWindow; +- (NSMenu*) windowsMenu; + +/* + * Managing the Service menu + */ +- (void) registerServicesMenuSendTypes: (NSArray*)sendTypes + returnTypes: (NSArray*)returnTypes; +- (NSMenu*) servicesMenu; +- (id) servicesProvider; +- (void) setServicesMenu: (NSMenu*)aMenu; +- (void) setServicesProvider: (id)anObject; +- (id) validRequestorForSendType: (NSString*)sendType + returnType: (NSString*)returnType; + +/* + * Getting the display context + */ +- (NSGraphicsContext*) context; + +/* + * Reporting an exception + */ +- (void) reportException: (NSException*)anException; + +/* + * Terminating the application + */ +#ifndef STRICT_OPENSTEP +- (void) replyToApplicationShouldTerminate: (BOOL)shouldTerminate; +#endif +- (void) terminate: (id)sender; + +/* + * Assigning a delegate + */ +- (id) delegate; +- (void) setDelegate: (id)anObject; + +#ifndef STRICT_OPENSTEP +/* + * Methods for scripting + */ +- (NSArray *) orderedDocuments; +- (NSArray *) orderedWindows; +/* + * Methods for user attention requests + */ +- (void) cancelUserAttentionRequest: (int)request; +- (int) requestUserAttention: (NSRequestUserAttentionType)requestType; +#endif + +@end + +@interface NSObject (NSServicesRequests) + +/* + * Pasteboard Read/Write + */ +- (BOOL) readSelectionFromPasteboard: (NSPasteboard*)pboard; +- (BOOL) writeSelectionToPasteboard: (NSPasteboard*)pboard + types: (NSArray*)types; + +#ifndef NO_GNUSTEP +- (NSWindow*) iconWindow; +#endif +@end + +#ifndef NO_GNUSTEP +/* + * A formal protocol that duplicates the informal protocol for delegates. + */ +@protocol GSAppDelegateProtocol +- (BOOL) application: (NSApplication*)app + openFileWithoutUI: (NSString*)filename; +- (BOOL) application: (NSApplication*)app + openFile: (NSString*)filename; +- (BOOL) application: (NSApplication*)app + openTempFile: (NSString*)filename; +- (BOOL) application: (NSApplication *)theApplication + printFile:(NSString *)filename; +- (BOOL) applicationOpenUntitledFile: (NSApplication*)app; +- (BOOL) applicationShouldOpenUntitledFile:(NSApplication *)sender; +#ifndef STRICT_OPENSTEP +- (BOOL) applicationShouldTerminate: (id)sender; +#else +- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *)sender; +#endif +- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (id)sender; + +- (void) applicationDidBecomeActive: (NSNotification*)aNotification; +- (void) applicationDidFinishLaunching: (NSNotification*)aNotification; +- (void) applicationDidHide: (NSNotification*)aNotification; +- (void) applicationDidResignActive: (NSNotification*)aNotification; +- (void) applicationDidUnhide: (NSNotification*)aNotification; +- (void) applicationDidUpdate: (NSNotification*)aNotification; +- (void) applicationWillBecomeActive: (NSNotification*)aNotification; +- (void) applicationWillFinishLaunching: (NSNotification*)aNotification; +- (void) applicationWillHide: (NSNotification*)aNotification; +- (void) applicationWillResignActive: (NSNotification*)aNotification; +- (void) applicationWillTerminate:(NSNotification *)aNotification; +- (void) applicationWillUnhide: (NSNotification*)aNotification; +- (void) applicationWillUpdate: (NSNotification*)aNotification; +#ifndef STRICT_OPENSTEP +- (BOOL) application: (NSApplication *)sender + delegateHandlesKey: (NSString *)key; +- (NSMenu *) applicationDockMenu: (NSApplication *)sender; +- (BOOL) applicationShouldHandleReopen: (NSApplication *)theApplication + hasVisibleWindows: (BOOL)flag; +- (void) applicationDidChangeScreenParameters: (NSNotification *)aNotification; +#endif +@end +#endif + +/* + * Notifications + */ +APPKIT_EXPORT NSString *NSApplicationDidBecomeActiveNotification; +APPKIT_EXPORT NSString *NSApplicationDidFinishLaunchingNotification; +APPKIT_EXPORT NSString *NSApplicationDidHideNotification; +APPKIT_EXPORT NSString *NSApplicationDidResignActiveNotification; +APPKIT_EXPORT NSString *NSApplicationDidUnhideNotification; +APPKIT_EXPORT NSString *NSApplicationDidUpdateNotification; +APPKIT_EXPORT NSString *NSApplicationWillBecomeActiveNotification; +APPKIT_EXPORT NSString *NSApplicationWillFinishLaunchingNotification; +APPKIT_EXPORT NSString *NSApplicationWillHideNotification; +APPKIT_EXPORT NSString *NSApplicationWillResignActiveNotification; +APPKIT_EXPORT NSString *NSApplicationWillTerminateNotification; +APPKIT_EXPORT NSString *NSApplicationWillUnhideNotification; +APPKIT_EXPORT NSString *NSApplicationWillUpdateNotification; + +/* + * Determine Whether an Item Is Included in Services Menus + */ +APPKIT_EXPORT int +NSSetShowsServicesMenuItem(NSString *name, BOOL enabled); + +APPKIT_EXPORT BOOL +NSShowsServicesMenuItem(NSString *name); + +/* + * Programmatically Invoke a Service + */ +APPKIT_EXPORT BOOL +NSPerformService(NSString *serviceItem, NSPasteboard *pboard); + +#ifndef NO_GNUSTEP +APPKIT_EXPORT id +GSContactApplication(NSString *appName, NSString *port, NSDate *expire); +#endif + +/* + * Force Services Menu to Update Based on New Services + */ +APPKIT_EXPORT void +NSUpdateDynamicServices(void); + +/* + * Register object to handle services requests. + */ +APPKIT_EXPORT void +NSRegisterServicesProvider(id provider, NSString *name); + +APPKIT_EXPORT void +NSUnRegisterServicesProvider(NSString *name); + +APPKIT_EXPORT int +NSApplicationMain(int argc, const char **argv); + +APPKIT_EXPORT void +NSShowSystemInfoPanel(NSDictionary *options); + +/* + * The NSApp global variable. + */ +APPKIT_EXPORT NSApplication *NSApp; + +#endif // _GNUstep_H_NSApplication diff --git a/Headers/AppKit/NSAttributedString.h b/Headers/AppKit/NSAttributedString.h new file mode 100644 index 000000000..4ea2d09b7 --- /dev/null +++ b/Headers/AppKit/NSAttributedString.h @@ -0,0 +1,122 @@ +/* + NSAttributedString.h + + Categories which add capabilities to NSAttributedString + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: July 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSAttributedString +#define _GNUstep_H_NSAttributedString + +#ifndef STRICT_OPENSTEP + +#include +#include +#include +#include +#include + +@class NSTextAttachment; +@class NSFileWrapper; +@class NSString; +@class NSDictionary; +@class NSData; +@class NSArray; +@class NSURL; + +/* Global NSString attribute names used in accessing the respective + property in a text attributes dictionary. if the key is not in the + dictionary the default value is assumed. */ +APPKIT_EXPORT NSString *NSFontAttributeName; +APPKIT_EXPORT NSString *NSParagraphStyleAttributeName; +APPKIT_EXPORT NSString *NSForegroundColorAttributeName; +APPKIT_EXPORT NSString *NSUnderlineStyleAttributeName; +APPKIT_EXPORT NSString *NSSuperscriptAttributeName; +APPKIT_EXPORT NSString *NSBackgroundColorAttributeName; +APPKIT_EXPORT NSString *NSAttachmentAttributeName; +APPKIT_EXPORT NSString *NSLigatureAttributeName; +APPKIT_EXPORT NSString *NSBaselineOffsetAttributeName; +APPKIT_EXPORT NSString *NSKernAttributeName; +APPKIT_EXPORT NSString *NSLinkAttributeName; + +/* Currently supported values for NSUnderlineStyleAttributeName. */ +enum +{ + GSNoUnderlineStyle = 0, + NSSingleUnderlineStyle = 1 +}; + +@interface NSAttributedString (AppKit) +- (NSDictionary*) fontAttributesInRange: (NSRange)range; +- (NSDictionary*) rulerAttributesInRange: (NSRange)range; +- (unsigned) lineBreakBeforeIndex: (unsigned)location + withinRange: (NSRange)aRange; +- (NSRange) doubleClickAtIndex: (unsigned)location; +- (unsigned) nextWordFromIndex: (unsigned)location forward: (BOOL)isForward; + +- (id) initWithRTF: (NSData*)data documentAttributes: (NSDictionary**)dict; +- (id) initWithRTFD: (NSData*)data documentAttributes: (NSDictionary**)dict; +- (id) initWithPath: (NSString*)path documentAttributes: (NSDictionary**)dict; +- (id) initWithURL: (NSURL*)url documentAttributes: (NSDictionary**)dict; +- (id) initWithRTFDFileWrapper: (NSFileWrapper*)wrapper + documentAttributes: (NSDictionary**)dict; +- (id) initWithHTML: (NSData*)data documentAttributes: (NSDictionary**)dict; +- (id) initWithHTML: (NSData*)data baseURL: (NSURL*)base + documentAttributes: (NSDictionary**)dict; + +- (NSData*) RTFFromRange: (NSRange)range + documentAttributes: (NSDictionary*)dict; +- (NSData*) RTFDFromRange: (NSRange)range + documentAttributes: (NSDictionary*)dict; +- (NSFileWrapper*) RTFDFileWrapperFromRange: (NSRange)range + documentAttributes: (NSDictionary*)dict; + +#ifndef STRICT_OPENSTEP ++ (NSArray *) textFileTypes; ++ (NSArray *) textPasteboardTypes; ++ (NSArray *) textUnfilteredFileTypes; ++ (NSArray *) textUnfilteredPasteboardTypes; +#endif +@end + +@interface NSMutableAttributedString (AppKit) +- (void) superscriptRange: (NSRange)range; +- (void) subscriptRange: (NSRange)range; +- (void) unscriptRange: (NSRange)range; +- (void) applyFontTraits: (NSFontTraitMask)traitMask range: (NSRange)range; +- (void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range; + +- (void) fixAttributesInRange: (NSRange)range; +- (void) fixFontAttributeInRange: (NSRange)range; +- (void) fixParagraphStyleAttributeInRange: (NSRange)range; +- (void) fixAttachmentAttributeInRange: (NSRange)range; + +- (BOOL) readFromURL: (NSURL *)url + options: (NSDictionary *)options + documentAttributes: (NSDictionary**)documentAttributes; +@end + +#endif + +#endif + diff --git a/Headers/AppKit/NSBezierPath.h b/Headers/AppKit/NSBezierPath.h new file mode 100644 index 000000000..c20cc44ab --- /dev/null +++ b/Headers/AppKit/NSBezierPath.h @@ -0,0 +1,223 @@ +/* + The NSBezierPath class + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Enrico Sersale + Date: Dec 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA. +*/ + +#ifndef BEZIERPATH_H +#define BEZIERPATH_H + +#include +#include + +@class NSAffineTransform; +@class NSImage; + +typedef enum { + NSButtLineCapStyle = 0, + NSRoundLineCapStyle = 1, + NSSquareLineCapStyle = 2 +} NSLineCapStyle; + +typedef enum { + NSMiterLineJoinStyle = 0, + NSRoundLineJoinStyle = 1, + NSBevelLineJoinStyle = 2 +} NSLineJoinStyle; + +typedef enum { + NSNonZeroWindingRule, + NSEvenOddWindingRule +} NSWindingRule; + +typedef enum { + NSMoveToBezierPathElement, + NSLineToBezierPathElement, + NSCurveToBezierPathElement, + NSClosePathBezierPathElement +} NSBezierPathElement; + +@interface NSBezierPath : NSObject +{ +@private + NSWindingRule _windingRule; + NSLineCapStyle _lineCapStyle; + NSLineJoinStyle _lineJoinStyle; + float _lineWidth; + float _flatness; + float _miterLimit; + int _dash_count; + float _dash_phase; + float *_dash_pattern; + BOOL _shouldRecalculateBounds; + NSRect _bounds; + NSRect _controlPointBounds; + BOOL _cachesBezierPath; + NSImage *_cacheImage; +} + +// +// Creating common paths +// ++ (NSBezierPath *)bezierPath; ++ (NSBezierPath *)bezierPathWithRect:(NSRect)aRect; ++ (NSBezierPath *)bezierPathWithOvalInRect:(NSRect)aRect; + +// +// Immediate mode drawing of common paths +// ++ (void)fillRect:(NSRect)aRect; ++ (void)strokeRect:(NSRect)aRect; ++ (void)clipRect:(NSRect)aRect; ++ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2; ++ (void)drawPackedGlyphs: (const char *)packedGlyphs atPoint: (NSPoint)aPoint; + +// +// Default path rendering parameters +// ++ (void)setDefaultMiterLimit:(float)limit; ++ (float)defaultMiterLimit; ++ (void)setDefaultFlatness:(float)flatness; ++ (float)defaultFlatness; ++ (void)setDefaultWindingRule:(NSWindingRule)windingRule; ++ (NSWindingRule)defaultWindingRule; ++ (void)setDefaultLineCapStyle:(NSLineCapStyle)lineCapStyle; ++ (NSLineCapStyle)defaultLineCapStyle; ++ (void)setDefaultLineJoinStyle:(NSLineJoinStyle)lineJoinStyle; ++ (NSLineJoinStyle)defaultLineJoinStyle; ++ (void)setDefaultLineWidth:(float)lineWidth; ++ (float)defaultLineWidth; + +// +// Path construction +// +- (void)moveToPoint:(NSPoint)aPoint; +- (void)lineToPoint:(NSPoint)aPoint; +- (void)curveToPoint:(NSPoint)aPoint + controlPoint1:(NSPoint)controlPoint1 + controlPoint2:(NSPoint)controlPoint2; +- (void)closePath; +- (void)removeAllPoints; + +// +// Relative path construction +// +- (void)relativeMoveToPoint:(NSPoint)aPoint; +- (void)relativeLineToPoint:(NSPoint)aPoint; +- (void)relativeCurveToPoint:(NSPoint)aPoint + controlPoint1:(NSPoint)controlPoint1 + controlPoint2:(NSPoint)controlPoint2; + +// +// Path rendering parameters +// +- (float)lineWidth; +- (void)setLineWidth:(float)lineWidth; +- (NSLineCapStyle)lineCapStyle; +- (void)setLineCapStyle:(NSLineCapStyle)lineCapStyle; +- (NSLineJoinStyle)lineJoinStyle; +- (void)setLineJoinStyle:(NSLineJoinStyle)lineJoinStyle; +- (NSWindingRule)windingRule; +- (void)setWindingRule:(NSWindingRule)windingRule; +- (void)setFlatness:(float)flatness; +- (float)flatness; +- (void)setMiterLimit:(float)limit; +- (float)miterLimit; +- (void)getLineDash:(float *)pattern count:(int *)count phase:(float *)phase; +- (void)setLineDash:(const float *)pattern count:(int)count phase:(float)phase; + +// +// Path operations +// +- (void)stroke; +- (void)fill; +- (void)addClip; +- (void)setClip; + +// +// Path modifications. +// +- (NSBezierPath *)bezierPathByFlatteningPath; +- (NSBezierPath *)bezierPathByReversingPath; + +// +// Applying transformations. +// +- (void)transformUsingAffineTransform:(NSAffineTransform *)transform; + +// +// Path info +// +- (BOOL)isEmpty; +- (NSPoint)currentPoint; +- (NSRect)controlPointBounds; +- (NSRect)bounds; + +// +// Elements +// +- (int)elementCount; +- (NSBezierPathElement)elementAtIndex:(int)index + associatedPoints:(NSPoint *)points; +- (NSBezierPathElement)elementAtIndex:(int)index; +- (void)setAssociatedPoints:(NSPoint *)points atIndex:(int)index; + +// +// Appending common paths +// +- (void)appendBezierPath:(NSBezierPath *)aPath; +- (void)appendBezierPathWithRect:(NSRect)aRect; +- (void)appendBezierPathWithPoints:(NSPoint *)points count:(int)count; +- (void)appendBezierPathWithOvalInRect:(NSRect)aRect; +- (void)appendBezierPathWithArcWithCenter:(NSPoint)center + radius:(float)radius + startAngle:(float)startAngle + endAngle:(float)endAngle + clockwise:(BOOL)clockwise; +- (void)appendBezierPathWithArcWithCenter:(NSPoint)center + radius:(float)radius + startAngle:(float)startAngle + endAngle:(float)endAngle; +- (void)appendBezierPathWithArcFromPoint:(NSPoint)point1 + toPoint:(NSPoint)point2 + radius:(float)radius; +- (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font; +- (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs + count:(int)count + inFont:(NSFont *)font; +- (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs; + +// +// Hit detection +// +- (BOOL)containsPoint:(NSPoint)point; + +// +// Caching +// +- (BOOL)cachesBezierPath; +- (void)setCachesBezierPath:(BOOL)flag; + +@end + +#endif // BEZIERPATH_H diff --git a/Headers/AppKit/NSBitmapImageRep.h b/Headers/AppKit/NSBitmapImageRep.h new file mode 100644 index 000000000..0e4a91b55 --- /dev/null +++ b/Headers/AppKit/NSBitmapImageRep.h @@ -0,0 +1,160 @@ +/* + NSBitmapImageRep.h + + Bitmap image representations + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSBitmapImageRep +#define _GNUstep_H_NSBitmapImageRep + +#include + +@class NSArray; +@class NSString; +@class NSData; +@class NSMutableData; +@class NSColor; + +typedef enum _NSTIFFCompression { + NSTIFFCompressionNone = 1, + NSTIFFCompressionCCITTFAX3 = 3, + NSTIFFCompressionCCITTFAX4 = 4, + NSTIFFCompressionLZW = 5, + NSTIFFCompressionJPEG = 6, + NSTIFFCompressionNEXT = 32766, + NSTIFFCompressionPackBits = 32773, + NSTIFFCompressionOldJPEG = 32865 +} NSTIFFCompression; + +#ifndef STRICT_OPENSTEP +// FIXME: This is probably wrong +typedef enum _NSBitmapImageFileType { + NSTIFFFileType = 0, + NSBMPFileType = 1, + NSGIFFileType = 2, + NSJPEGFileType = 3, + NSPNGFileType = 4 +} NSBitmapImageFileType; +#endif + +@interface NSBitmapImageRep : NSImageRep +{ + // Attributes + unsigned int _bytesPerRow; + unsigned int _numColors; + unsigned int _bitsPerPixel; + unsigned short _compression; + float _comp_factor; + BOOL _isPlanar; + unsigned char **_imagePlanes; + NSMutableData *_imageData; +} + +// +// Allocating and Initializing a New NSBitmapImageRep Object +// ++ (id) imageRepWithData: (NSData*)tiffData; ++ (NSArray*) imageRepsWithData: (NSData*)tiffData; +- (id) initWithData: (NSData*)tiffData; +- (id) initWithFocusedViewRect: (NSRect)rect; +- (id) initWithBitmapDataPlanes: (unsigned char**)planes + pixelsWide: (int)width + pixelsHigh: (int)height + bitsPerSample: (int)bps + samplesPerPixel: (int)spp + hasAlpha: (BOOL)alpha + isPlanar: (BOOL)isPlanar + colorSpaceName: (NSString*)colorSpaceName + bytesPerRow: (int)rowBytes + bitsPerPixel: (int)pixelBits; + +#ifndef STRICT_OPENSTEP +- (void)colorizeByMappingGray:(float)midPoint + toColor:(NSColor *)midPointColor + blackMapping:(NSColor *)shadowColor + whiteMapping:(NSColor *)lightColor; +- (id)initWithBitmapHandle:(void *)bitmap; +- (id)initWithIconHandle:(void *)icon; +#endif + +// +// Getting Information about the Image +// +- (int) bitsPerPixel; +- (int) samplesPerPixel; +- (BOOL) isPlanar; +- (int) numberOfPlanes; +- (int) bytesPerPlane; +- (int) bytesPerRow; + +// +// Getting Image Data +// +- (unsigned char*) bitmapData; +- (void) getBitmapDataPlanes: (unsigned char**)data; + +// +// Producing a TIFF Representation of the Image +// ++ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray; ++ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray + usingCompression: (NSTIFFCompression)type + factor: (float)factor; +- (NSData*) TIFFRepresentation; +- (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)type + factor: (float)factor; + +#ifndef STRICT_OPENSTEP ++ (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps + usingType:(NSBitmapImageFileType)storageType + properties:(NSDictionary *)properties; +- (NSData *)representationUsingType:(NSBitmapImageFileType)storageType + properties:(NSDictionary *)properties; +#endif + +// +// Setting and Checking Compression Types +// ++ (void) getTIFFCompressionTypes: (const NSTIFFCompression**)list + count: (int*)numTypes; ++ (NSString*) localizedNameForTIFFCompressionType: (NSTIFFCompression)type; +- (BOOL) canBeCompressedUsing: (NSTIFFCompression)compression; +- (void) getCompression: (NSTIFFCompression*)compression + factor: (float*)factor; +- (void) setCompression: (NSTIFFCompression)compression + factor: (float)factor; + +#ifndef STRICT_OPENSTEP +- (void)setProperty:(NSString *)property withValue:(id)value; +- (id)valueForProperty:(NSString *)property; +#endif + +@end + +@interface NSBitmapImageRep (GNUstepExtension) ++ (NSArray*) imageRepsWithFile: (NSString *)filename; +@end + +#endif // _GNUstep_H_NSBitmapImageRep diff --git a/Headers/AppKit/NSBox.h b/Headers/AppKit/NSBox.h new file mode 100644 index 000000000..76edd6597 --- /dev/null +++ b/Headers/AppKit/NSBox.h @@ -0,0 +1,97 @@ +/* + NSBox.h + + Simple box view that can display a border and title + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSBox +#define _GNUstep_H_NSBox + +#include + +@class NSString; +@class NSFont; + +typedef enum _NSTitlePosition { + NSNoTitle, + NSAboveTop, + NSAtTop, + NSBelowTop, + NSAboveBottom, + NSAtBottom, + NSBelowBottom +} NSTitlePosition; + +@interface NSBox : NSView +{ + // Attributes + id _cell; + id _content_view; + NSSize _offsets; + NSRect _border_rect; + NSRect _title_rect; + NSBorderType _border_type; + NSTitlePosition _title_position; +} + +// +// Getting and Modifying the Border and Title +// +- (NSRect)borderRect; +- (NSBorderType)borderType; +- (void)setBorderType:(NSBorderType)aType; +- (void)setTitle:(NSString *)aString; +- (void)setTitleFont:(NSFont *)fontObj; +- (void)setTitlePosition:(NSTitlePosition)aPosition; +- (NSString *)title; +- (id)titleCell; +- (NSFont *)titleFont; +- (NSTitlePosition)titlePosition; +- (NSRect)titleRect; +#ifndef STRICT_OPENSTEP +- (void)setTitleWithMnemonic:(NSString *)aString; +#endif + +// +// Setting and Placing the Content View +// +- (id)contentView; +- (NSSize)contentViewMargins; +- (void)setContentView:(NSView *)aView; +- (void)setContentViewMargins:(NSSize)offsetSize; + +// +// Resizing the Box +// +- (void)setFrameFromContentFrame:(NSRect)contentFrame; +- (void)sizeToFit; + +#ifndef NO_GNUSTEP +-(NSSize) minimumSize; +#endif +@end + +#endif // _GNUstep_H_NSBox + diff --git a/Headers/AppKit/NSBrowser.h b/Headers/AppKit/NSBrowser.h new file mode 100644 index 000000000..dd2e22822 --- /dev/null +++ b/Headers/AppKit/NSBrowser.h @@ -0,0 +1,269 @@ +/* + NSBrowser.h + + Control to display and select from hierarchal lists + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSBrowser +#define _GNUstep_H_NSBrowser + +#include + +@class NSString; +@class NSArray; + +@class NSCell; +@class NSMatrix; +@class NSScroller; +//@class NSBox; + +@interface NSBrowser : NSControl +{ + // Attributes + id _browserCellPrototype; + id _browserMatrixClass; + NSString *_pathSeparator; + + //NSBox *_horizontalScrollerBox; + NSScroller *_horizontalScroller; + NSTimeInterval _lastKeyPressed; + NSString *_charBuffer; + + BOOL _isLoaded; + BOOL _allowsBranchSelection; + BOOL _allowsEmptySelection; + BOOL _allowsMultipleSelection; + BOOL _reusesColumns; + BOOL _separatesColumns; + BOOL _takesTitleFromPreviousColumn; + BOOL _isTitled; + BOOL _hasHorizontalScroller; + BOOL _skipUpdateScroller; + BOOL _acceptsArrowKeys; + BOOL _sendsActionOnArrowKeys; + BOOL _acceptsAlphaNumericalKeys; + BOOL _sendsActionOnAlphaNumericalKeys; + + BOOL _passiveDelegate; + id _browserDelegate; + id _target; + SEL _action; + SEL _doubleAction; + NSMutableArray *_browserColumns; + NSSize _columnSize; + NSRect _scrollerRect; + int _alphaNumericalLastColumn; + int _maxVisibleColumns; + float _minColumnWidth; + int _lastColumnLoaded; + int _firstVisibleColumn; + int _lastVisibleColumn; +} + +// +// Setting the Delegate +// +- (id) delegate; +- (void) setDelegate: (id)anObject; + +// +// Target and Action +// +- (SEL) doubleAction; +- (BOOL) sendAction; +- (void) setDoubleAction: (SEL)aSelector; + +// +// Setting Component Classes +// ++ (Class) cellClass; +- (id) cellPrototype; +- (Class) matrixClass; +- (void) setCellClass: (Class)classId; +- (void) setCellPrototype: (NSCell *)aCell; +- (void) setMatrixClass: (Class)classId; + +// +// Setting NSBrowser Behavior +// +- (BOOL) reusesColumns; +- (void) setReusesColumns: (BOOL)flag; +- (void) setTakesTitleFromPreviousColumn: (BOOL)flag; +- (BOOL) takesTitleFromPreviousColumn; + +// +// Allowing Different Types of Selection +// +- (BOOL) allowsBranchSelection; +- (BOOL) allowsEmptySelection; +- (BOOL) allowsMultipleSelection; +- (void) setAllowsBranchSelection: (BOOL)flag; +- (void) setAllowsEmptySelection: (BOOL)flag; +- (void) setAllowsMultipleSelection: (BOOL)flag; + +// +// Setting Arrow Key Behavior +// +- (BOOL) acceptsArrowKeys; +- (BOOL) sendsActionOnArrowKeys; +- (void) setAcceptsArrowKeys: (BOOL)flag; +- (void) setSendsActionOnArrowKeys: (BOOL)flag; + +// +// Showing a Horizontal Scroller +// +- (void) setHasHorizontalScroller: (BOOL)flag; +- (BOOL) hasHorizontalScroller; + +// +// Setting the NSBrowser's Appearance +// +- (int) maxVisibleColumns; +- (int) minColumnWidth; +- (BOOL) separatesColumns; +- (void) setMaxVisibleColumns: (int)columnCount; +- (void) setMinColumnWidth: (int)columnWidth; +- (void) setSeparatesColumns: (BOOL)flag; + +// +// Manipulating Columns +// +- (void) addColumn; +- (int) columnOfMatrix: (NSMatrix *)matrix; +- (void) displayAllColumns; +- (void) displayColumn: (int)column; +- (int) firstVisibleColumn; +- (BOOL) isLoaded; +- (int) lastColumn; +- (int) lastVisibleColumn; +- (void) loadColumnZero; +- (int) numberOfVisibleColumns; +- (void) reloadColumn: (int)column; +- (void) selectAll: (id)sender; +- (void) selectRow: (int)row inColumn: (int)column; +- (int) selectedColumn; +- (int) selectedRowInColumn: (int)column; +- (void) setLastColumn: (int)column; +- (void) validateVisibleColumns; + +// +// Manipulating Column Titles +// +- (void) drawTitle: (NSString *)title + inRect: (NSRect)aRect + ofColumn: (int)column; +#ifndef STRICT_OPENSTEP +- (void) drawTitleOfColumn: (int)column + inRect: (NSRect)aRect; +#endif +- (BOOL) isTitled; +- (void) setTitled: (BOOL)flag; +- (void) setTitle: (NSString *)aString + ofColumn: (int)column; +- (NSRect) titleFrameOfColumn: (int)column; +- (float) titleHeight; +- (NSString *) titleOfColumn: (int)column; + +// +// Scrolling an NSBrowser +// +- (void) scrollColumnsLeftBy: (int)shiftAmount; +- (void) scrollColumnsRightBy: (int)shiftAmount; +- (void) scrollColumnToVisible: (int)column; +- (void) scrollViaScroller: (NSScroller *)sender; +- (void) updateScroller; + +// +// Event Handling +// +- (void) doClick: (id)sender; +- (void) doDoubleClick: (id)sender; + +// +// Getting Matrices and Cells +// +- (id) loadedCellAtRow: (int)row + column: (int)column; +- (NSMatrix *) matrixInColumn: (int)column; +- (id) selectedCell; +- (id) selectedCellInColumn: (int)column; +- (NSArray *) selectedCells; + +// +// Getting Column Frames +// +- (NSRect) frameOfColumn: (int)column; +- (NSRect) frameOfInsideOfColumn: (int)column; + +// +// Manipulating Paths +// +- (NSString *) path; +- (NSString *) pathSeparator; +- (NSString *) pathToColumn: (int)column; +- (BOOL) setPath: (NSString *)path; +- (void) setPathSeparator: (NSString *)aString; + +// +// Arranging an NSBrowser's Components +// +- (void) tile; + +@end + +// +// Controlling the alphanumerical keys behaviour +// +@interface NSBrowser (GNUstepExtensions) +- (BOOL)acceptsAlphaNumericalKeys; +- (void) setAcceptsAlphaNumericalKeys: (BOOL)flag; +- (BOOL) sendsActionOnAlphaNumericalKeys; +- (void) setSendsActionOnAlphaNumericalKeys: (BOOL)flag; +@end + +// +// Methods Implemented by the Delegate +// +@interface NSObject (NSBrowserDelegate) + +- (void) browser: (NSBrowser *)sender createRowsForColumn: (int)column + inMatrix: (NSMatrix *)matrix; +- (BOOL) browser: (NSBrowser *)sender isColumnValid: (int)column; +- (int) browser: (NSBrowser *)sender numberOfRowsInColumn: (int)column; +- (BOOL) browser: (NSBrowser *)sender selectCellWithString: (NSString *)title + inColumn: (int)column; +- (BOOL) browser: (NSBrowser *)sender selectRow: (int)row inColumn: (int)column; +- (NSString *) browser: (NSBrowser *)sender titleOfColumn: (int)column; +- (void) browser: (NSBrowser *)sender + willDisplayCell: (id)cell + atRow: (int)row + column: (int)column; +- (void) browserDidScroll: (NSBrowser *)sender; +- (void) browserWillScroll: (NSBrowser *)sender; + +@end + + +#endif // _GNUstep_H_NSBrowser diff --git a/Headers/AppKit/NSBrowserCell.h b/Headers/AppKit/NSBrowserCell.h new file mode 100644 index 000000000..2227016c4 --- /dev/null +++ b/Headers/AppKit/NSBrowserCell.h @@ -0,0 +1,74 @@ +/* + NSBrowserCell.h + + Cell class for the NSBrowser + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSBrowserCell +#define _GNUstep_H_NSBrowserCell + +#include + +@class NSImage; + +@interface NSBrowserCell : NSCell +{ + // Attributes + NSImage *_alternateImage; + // Think of the following ones as of two BOOL ivars +#define _browsercell_is_leaf _cell.subclass_bool_one +#define _browsercell_is_loaded _cell.subclass_bool_two +} + +// +// Accessing Graphic Attributes +// ++ (NSImage *)branchImage; ++ (NSImage *)highlightedBranchImage; +- (NSImage *)alternateImage; +- (void)setAlternateImage:(NSImage *)anImage; +- (NSColor *)highlightColorInView: (NSView *)controlView; + +// +// Placing in the Browser Hierarchy +// +- (BOOL)isLeaf; +- (void)setLeaf:(BOOL)flag; + +// +// Determining Loaded Status +// +- (BOOL)isLoaded; +- (void)setLoaded:(BOOL)flag; + +// +// Setting State +// +- (void)reset; +- (void)set; + +@end + +#endif // _GNUstep_H_NSBrowserCell diff --git a/Headers/AppKit/NSButton.h b/Headers/AppKit/NSButton.h new file mode 100644 index 000000000..cf3ed8905 --- /dev/null +++ b/Headers/AppKit/NSButton.h @@ -0,0 +1,134 @@ +/* + NSButton.h + + The button class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Ovidiu Predescu + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSButton +#define _GNUstep_H_NSButton + +#include +#include + +@class NSString; +@class NSEvent; + +@interface NSButton : NSControl +{ + // Attributes +} + +// +// Setting the Button Type +// +- (void)setButtonType:(NSButtonType)aType; + +// +// Setting the State +// +- (void)setState:(int)value; +- (int)state; +- (BOOL)allowsMixedState; +- (void)setAllowsMixedState: (BOOL)flag; +- (void)setNextState; + +// +// Setting the Repeat Interval +// +- (void)getPeriodicDelay:(float *)delay + interval:(float *)interval; +- (void)setPeriodicDelay:(float)delay + interval:(float)interval; + +// +// Setting the Titles +// +- (NSString *)alternateTitle; +- (void)setAlternateTitle:(NSString *)aString; +- (void)setTitle:(NSString *)aString; +- (NSString *)title; +#ifndef STRICT_OPENSTEP +- (NSAttributedString *)attributedAlternateTitle; +- (NSAttributedString *)attributedTitle; +- (void)setAttributedAlternateTitle:(NSAttributedString *)aString; +- (void)setAttributedTitle:(NSAttributedString *)aString; +- (void)setTitleWithMnemonic:(NSString *)aString; +#endif + +// +// Setting the Images +// +- (NSImage *)alternateImage; +- (NSImage *)image; +- (NSCellImagePosition)imagePosition; +- (void)setAlternateImage:(NSImage *)anImage; +- (void)setImage:(NSImage *)anImage; +- (void)setImagePosition:(NSCellImagePosition)aPosition; + +// +// Modifying Graphic Attributes +// +- (BOOL)isBordered; +- (BOOL)isTransparent; +- (void)setBordered:(BOOL)flag; +- (void)setTransparent:(BOOL)flag; +#ifndef STRICT_OPENSTEP +- (NSBezelStyle)bezelStyle; +- (void)setBezelStyle:(NSBezelStyle)bezelStyle; +- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show; +- (BOOL)showsBorderOnlyWhileMouseInside; +#endif + +// +// Displaying +// +- (void)highlight:(BOOL)flag; + +// +// Setting the Key Equivalent +// +- (NSString *)keyEquivalent; +- (unsigned int)keyEquivalentModifierMask; +- (void)setKeyEquivalent:(NSString *)aKeyEquivalent; +- (void)setKeyEquivalentModifierMask:(unsigned int)mask; + +// +// Handling Events and Action Messages +// +- (void)performClick:(id)sender; +- (BOOL)performKeyEquivalent:(NSEvent *)anEvent; + +// +// Sound +// +#ifndef STRICT_OPENSTEP +- (void)setSound:(NSSound *)aSound; +- (NSSound *)sound; +#endif + +@end + +#endif // _GNUstep_H_NSButton diff --git a/Headers/AppKit/NSButtonCell.h b/Headers/AppKit/NSButtonCell.h new file mode 100644 index 000000000..8274c4f2e --- /dev/null +++ b/Headers/AppKit/NSButtonCell.h @@ -0,0 +1,191 @@ +/* + NSButtonCell.h + + The cell class for NSButton + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Ovidiu Predescu + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSButtonCell +#define _GNUstep_H_NSButtonCell + +#include + +@class NSFont; +@class NSSound; + +typedef enum _NSButtonType { + NSMomentaryPushButton, + NSPushOnPushOffButton, + NSToggleButton, + NSSwitchButton, + NSRadioButton, + NSMomentaryChangeButton, + NSOnOffButton, + // These come from MacOSX + NSMomentaryLight, + NSMomentaryLightButton = NSMomentaryLight, + NSMomentaryPushInButton = NSMomentaryPushButton +} NSButtonType; + +typedef enum _NSBezelStyle { + NSRoundedBezelStyle, + NSRegularSquareBezelStyle, + NSThickSquareBezelStyle, + NSThickerSquareBezelStyle, + // The next five no longer show up in the MacOSX documentation + NSNeXTBezelStyle, + NSPushButtonBezelStyle, + NSSmallIconButtonBezelStyle, + NSMediumIconButtonBezelStyle, + NSLargeIconButtonBezelStyle, + // But those two do + NSShadowlessSquareBezelStyle, + NSCircularBezelStyle +} NSBezelStyle; + +typedef enum _NSGradientType { + NSGradientNone, + NSGradientConcaveWeak, + NSGradientConcaveStrong, + NSGradientConvexWeak, + NSGradientConvexStrong +} NSGradientType; + + +@interface NSButtonCell : NSActionCell +{ + // Attributes + NSString *_altContents; + NSImage *_altImage; + NSString *_keyEquivalent; + NSFont *_keyEquivalentFont; + NSSound *_sound; + unsigned int _keyEquivalentModifierMask; + unsigned int _highlightsByMask; + unsigned int _showAltStateMask; + float _delayInterval; + float _repeatInterval; + NSBezelStyle _bezel_style; + NSGradientType _gradient_type; + BOOL _shows_border_only_while_mouse_inside; + BOOL _mouse_inside; + // Think of the following as a BOOL ivars +#define _buttoncell_is_transparent _cell.subclass_bool_one +#define _image_dims_when_disabled _cell.subclass_bool_two +} + +// +// Setting the Titles +// +- (NSString *)alternateTitle; +- (void)setAlternateTitle:(NSString *)aString; +- (void)setFont:(NSFont *)fontObject; +- (void)setTitle:(NSString *)aString; +- (NSString *)title; +#ifndef STRICT_OPENSTEP +- (NSAttributedString *)attributedAlternateTitle; +- (NSAttributedString *)attributedTitle; +- (void)setAttributedAlternateTitle:(NSAttributedString *)aString; +- (void)setAttributedTitle:(NSAttributedString *)aString; +- (void)setTitleWithMnemonic:(NSString *)aString; +- (NSString *)alternateMnemonic; +- (unsigned)alternateMnemonicLocation; +- (void)setAlternateMnemonicLocation:(unsigned)location; +- (void)setAlternateTitleWithMnemonic:(NSString *)aString; +#endif + +// +// Setting the Images +// +- (NSImage *)alternateImage; +- (NSCellImagePosition)imagePosition; +- (void)setAlternateImage:(NSImage *)anImage; +- (void)setImagePosition:(NSCellImagePosition)aPosition; + +// +// Setting the Repeat Interval +// +- (void)getPeriodicDelay:(float *)delay + interval:(float *)interval; +- (void)setPeriodicDelay:(float)delay + interval:(float)interval; + +// +// Setting the Key Equivalent +// +- (NSString *)keyEquivalent; +- (NSFont *)keyEquivalentFont; +- (unsigned int)keyEquivalentModifierMask; +- (void)setKeyEquivalent:(NSString *)key; +- (void)setKeyEquivalentModifierMask:(unsigned int)mask; +- (void)setKeyEquivalentFont:(NSFont *)fontObj; +- (void)setKeyEquivalentFont:(NSString *)fontName + size:(float)fontSize; + +// +// Modifying Graphic Attributes +// +- (BOOL)isTransparent; +- (void)setTransparent:(BOOL)flag; +#ifndef STRICT_OPENSTEP +- (NSBezelStyle)bezelStyle; +- (void)setBezelStyle:(NSBezelStyle)bezelStyle; +- (BOOL)showsBorderOnlyWhileMouseInside; +- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show; +- (NSGradientType)gradientType; +- (void)setGradientType:(NSGradientType)gradientType; +- (BOOL)imageDimsWhenDisabled; +- (void)setImageDimsWhenDisabled:(BOOL)flag; +#endif + +// +// Modifying Graphic Attributes +// +- (int)highlightsBy; +- (void)setHighlightsBy:(int)mask; +- (void)setShowsStateBy:(int)mask; +- (void)setButtonType:(NSButtonType)buttonType; +- (int)showsStateBy; + +// +// Sound +// +#ifndef STRICT_OPENSTEP +- (void)setSound:(NSSound *)aSound; +- (NSSound *)sound; +#endif + +// +// Mouse +// +#ifndef STRICT_OPENSTEP +- (void)mouseEntered:(NSEvent *)event; +- (void)mouseExited:(NSEvent *)event; +- (void)performClick:(id)sender; +#endif + +@end + +#endif // _GNUstep_H_NSButtonCell diff --git a/Headers/AppKit/NSCachedImageRep.h b/Headers/AppKit/NSCachedImageRep.h new file mode 100644 index 000000000..3cd69d7ca --- /dev/null +++ b/Headers/AppKit/NSCachedImageRep.h @@ -0,0 +1,62 @@ +/* + NSCachedImageRep.h + + Cached image representation. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSCachedImageRep +#define _GNUstep_H_NSCachedImageRep + +#include +#include + +@class NSWindow; + +@interface NSCachedImageRep : NSImageRep +{ + // Attributes + NSRect _rect; + NSWindow* _window; +} + +// +// Initializing an NSCachedImageRep +// +- (id)initWithSize:(NSSize)aSize + depth:(NSWindowDepth)aDepth + separate:(BOOL)separate + alpha:(BOOL)alpha; +- (id)initWithWindow:(NSWindow *)aWindow + rect:(NSRect)aRect; + +// +// Getting the Representation +// +- (NSRect)rect; +- (NSWindow *)window; + +@end + +#endif // _GNUstep_H_NSCachedImageRep diff --git a/Headers/AppKit/NSCell.h b/Headers/AppKit/NSCell.h new file mode 100644 index 000000000..1ef5ab01c --- /dev/null +++ b/Headers/AppKit/NSCell.h @@ -0,0 +1,462 @@ +/* -*-objc-*- + NSCell.h + + The abstract cell class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSCell +#define _GNUstep_H_NSCell + +#include +#include + +// For tint +#include +// For text alignment +#include + +@class NSString; +@class NSMutableDictionary; +@class NSView; +@class NSFont; +@class NSText; +@class NSFormatter; + +typedef enum _NSCellType { + NSNullCellType, + NSTextCellType, + NSImageCellType +} NSCellType; + +enum { + NSAnyType, + NSIntType, + NSPositiveIntType, + NSFloatType, + NSPositiveFloatType, + NSDateType, + NSDoubleType, + NSPositiveDoubleType +}; + +typedef enum { + NSNoImage = 0, + NSImageOnly, + NSImageLeft, + NSImageRight, + NSImageBelow, + NSImageAbove, + NSImageOverlaps +} NSCellImagePosition; + +typedef enum _NSCellAttribute { + NSCellDisabled, + NSCellState, + NSPushInCell, + NSCellEditable, + NSChangeGrayCell, + NSCellHighlighted, + NSCellLightsByContents, + NSCellLightsByGray, + NSChangeBackgroundCell, + NSCellLightsByBackground, + NSCellIsBordered, + NSCellHasOverlappingImage, + NSCellHasImageHorizontal, + NSCellHasImageOnLeftOrBottom, + NSCellChangesContents, + NSCellIsInsetButton, + NSCellAllowsMixedState +} NSCellAttribute; + +enum { + NSNoCellMask = 0, + NSContentsCellMask = 1, + NSPushInCellMask = 2, + NSChangeGrayCellMask = 4, + NSChangeBackgroundCellMask = 8 +}; + +enum { + xDist = 2, // horizontal distance between the text and image rects. + yDist = 2 // vertical distance between the text and image rects. +}; + +/* + * We try to do as in macosx. + */ +enum { + NSOffState = 0, + NSOnState = 1, + NSMixedState = -1 +}; + +typedef enum _NSControlSize { + NSRegularControlSize, + NSSmallControlSize +} NSControlSize; + +@interface NSCell : NSObject +{ + // Attributes + NSString *_contents; + NSImage *_cell_image; + NSFont *_font; + id _objectValue; + struct GSCellFlagsType { + // total 32 bits. 0 bits left. + unsigned contents_is_attributed_string: 1; + unsigned is_highlighted: 1; + unsigned is_disabled: 1; + unsigned is_editable: 1; + unsigned is_rich_text: 1; + unsigned imports_graphics: 1; + unsigned shows_first_responder: 1; + unsigned refuses_first_responder: 1; + unsigned sends_action_on_end_editing: 1; + unsigned is_bordered: 1; + unsigned is_bezeled: 1; + unsigned is_scrollable: 1; + unsigned wraps: 1; + unsigned text_align: 3; // 5 values + unsigned is_selectable: 1; + unsigned allows_mixed_state: 1; + unsigned has_valid_object_value: 1; + unsigned type: 2; // 3 values + unsigned image_position: 3; // 7 values + unsigned entry_type: 4; // 8 values + // 4 bits reserved for subclass use + unsigned subclass_bool_one: 1; + unsigned subclass_bool_two: 1; + unsigned subclass_bool_three: 1; + unsigned subclass_bool_four: 1; + /* This is not in the bitfield now (for simpler macosx compatibility) + but who knows in the future */ + int state; // 3 values but one negative + } _cell; + unsigned char _mnemonic_location; + unsigned int _mouse_down_flags; + unsigned int _action_mask; + NSFormatter *_formatter; + NSMenu *_menu; + id _represented_object; +} + +// +// Class methods +// +#ifndef STRICT_OPENSTEP ++ (NSMenu *)defaultMenu; +#endif ++ (BOOL) prefersTrackingUntilMouseUp; + +// +// Initializing an NSCell +// +- (id)initImageCell:(NSImage *)anImage; +- (id)initTextCell:(NSString *)aString; + +// +// Setting the NSCell's Value +// +- (id)objectValue; +- (BOOL)hasValidObjectValue; +- (double)doubleValue; +- (float)floatValue; +- (int)intValue; +- (NSString *)stringValue; +- (void) setObjectValue:(id)object; +- (void)setDoubleValue:(double)aDouble; +- (void)setFloatValue:(float)aFloat; +- (void)setIntValue:(int)anInt; +- (void)setStringValue:(NSString *)aString; + +// +// Setting Parameters +// +- (int)cellAttribute:(NSCellAttribute)aParameter; +- (void)setCellAttribute:(NSCellAttribute)aParameter + to:(int)value; + +// +// Setting the NSCell's Type +// +- (void)setType:(NSCellType)aType; +- (NSCellType)type; + +// +// Enabling and Disabling the NSCell +// +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; + +// +// Modifying Graphic Attributes +// +- (BOOL)isBezeled; +- (BOOL)isBordered; +- (BOOL)isOpaque; +- (void)setBezeled:(BOOL)flag; +- (void)setBordered:(BOOL)flag; + +// +// Setting the NSCell's State +// +- (void)setState:(int)value; +- (int)state; +- (BOOL)allowsMixedState; +- (void)setAllowsMixedState:(BOOL)flag; +- (int)nextState; +- (void)setNextState; + +// +// Modifying Text Attributes +// +- (NSTextAlignment)alignment; +- (NSFont *)font; +- (BOOL)isEditable; +- (BOOL)isSelectable; +- (BOOL)isScrollable; +- (void)setAlignment:(NSTextAlignment)mode; +- (void)setEditable:(BOOL)flag; +- (void)setFont:(NSFont *)fontObject; +- (void)setSelectable:(BOOL)flag; +- (void)setScrollable:(BOOL)flag; +- (void)setWraps:(BOOL)flag; +- (BOOL)wraps; +- (NSText *)setUpFieldEditorAttributes:(NSText *)textObject; +#ifndef STRICT_OPENSTEP +- (void)setAttributedStringValue:(NSAttributedString *)attribStr; +- (NSAttributedString *)attributedStringValue; +- (void)setAllowsEditingTextAttributes:(BOOL)flag; +- (BOOL)allowsEditingTextAttributes; +- (void)setImportsGraphics:(BOOL)flag; +- (BOOL)importsGraphics; +- (void)setTitle:(NSString *)aString; +- (NSString *)title; +#endif + +// +// Target and Action +// +- (SEL)action; +- (BOOL)isContinuous; +- (int)sendActionOn:(int)mask; +- (void)setAction:(SEL)aSelector; +- (void)setContinuous:(BOOL)flag; +- (void)setTarget:(id)anObject; +- (id)target; + +// +// Setting the Image +// +- (NSImage *)image; +- (void)setImage:(NSImage *)anImage; + +// +// Assigning a Tag +// +- (void)setTag:(int)anInt; +- (int)tag; + +// +// Formatting Data and Validating Input +// +#ifndef STRICT_OPENSTEP +- (void)setFormatter:(NSFormatter *)newFormatter; +- (id)formatter; +#endif +- (int)entryType; +- (BOOL)isEntryAcceptable:(NSString *)aString; +- (void)setEntryType:(int)aType; +- (void)setFloatingPointFormat:(BOOL)autoRange + left:(unsigned int)leftDigits + right:(unsigned int)rightDigits; + +// +// Menu +// +#ifndef STRICT_OPENSTEP +- (void)setMenu:(NSMenu *)aMenu; +- (NSMenu *)menu; +- (NSMenu *)menuForEvent:(NSEvent *)anEvent + inRect:(NSRect)cellFrame + ofView:(NSView *)aView; +#endif + +// +// Comparing to Another NSCell +// +- (NSComparisonResult)compare:(id)otherCell; + +// +// respond to keyboard +// +// All these methods except -performClick: are provided only for some +// compatibility with MacOS-X code and their use in new programs is +// deprecated. Please use -isEnabled, -setEnabled: instead of +// -acceptsFirstReponder, -refusesFirstResponder, +// -setRefusesFirstResponder:. Mnemonics (eg 'File' with the 'F' +// underlined as in MS Windows(tm) menus) are not part of GNUstep's +// interface so methods referring to mnemonics do nothing -- they are +// provided for compatibility only; please use key equivalents instead +// in your GNUstep programs. +#ifndef STRICT_OPENSTEP +- (BOOL)acceptsFirstResponder; +- (void)setShowsFirstResponder:(BOOL)flag; +- (BOOL)showsFirstResponder; +- (void)setTitleWithMnemonic:(NSString *)aString; +- (NSString *)mnemonic; +- (void)setMnemonicLocation:(unsigned int)location; +- (unsigned int)mnemonicLocation; +- (BOOL)refusesFirstResponder; +- (void)setRefusesFirstResponder:(BOOL)flag; +- (void)performClick:(id)sender; +#endif + +// +// Interacting with Other NSCells +// +- (void)takeObjectValueFrom: (id)sender; +- (void)takeDoubleValueFrom:(id)sender; +- (void)takeFloatValueFrom:(id)sender; +- (void)takeIntValueFrom:(id)sender; +- (void)takeStringValueFrom:(id)sender; + +// +// Using the NSCell to Represent an Object +// +- (id)representedObject; +- (void)setRepresentedObject:(id)anObject; + +// +// Tracking the Mouse +// +- (BOOL)continueTracking:(NSPoint)lastPoint + at:(NSPoint)currentPoint + inView:(NSView *)controlView; +- (int)mouseDownFlags; +- (void)getPeriodicDelay:(float *)delay + interval:(float *)interval; +- (BOOL)startTrackingAt:(NSPoint)startPoint + inView:(NSView *)controlView; +- (void)stopTracking:(NSPoint)lastPoint + at:(NSPoint)stopPoint + inView:(NSView *)controlView + mouseIsUp:(BOOL)flag; +- (BOOL)trackMouse:(NSEvent *)theEvent + inRect:(NSRect)cellFrame + ofView:(NSView *)controlView + untilMouseUp:(BOOL)flag; + +// +// Managing the Cursor +// +- (void)resetCursorRect:(NSRect)cellFrame + inView:(NSView *)controlView; + +// +// Handling Keyboard Alternatives +// +- (NSString *)keyEquivalent; + +// +// Determining Component Sizes +// +- (void)calcDrawInfo:(NSRect)aRect; +- (NSSize)cellSize; +- (NSSize)cellSizeForBounds:(NSRect)aRect; +- (NSRect)drawingRectForBounds:(NSRect)theRect; +- (NSRect)imageRectForBounds:(NSRect)theRect; +- (NSRect)titleRectForBounds:(NSRect)theRect; +#ifndef STRICT_OPENSTEP +- (void)setControlSize:(NSControlSize)controlSize; +- (NSControlSize)controlSize; +#endif + +// +// Displaying +// +- (NSView *)controlView; +- (void)drawInteriorWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)highlight:(BOOL)lit + withFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (BOOL)isHighlighted; +#ifndef STRICT_OPENSTEP +- (void)setHighlighted: (BOOL) flag; +- (NSColor*)highlightColorWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)setControlTint:(NSControlTint)controlTint; +- (NSControlTint)controlTint; +#endif + +// +// Editing Text +// +- (void)editWithFrame:(NSRect)aRect + inView:(NSView *)controlView + editor:(NSText *)textObject + delegate:(id)anObject + event:(NSEvent *)theEvent; +- (void)selectWithFrame:(NSRect)aRect + inView:(NSView *)controlView + editor:(NSText *)textObject + delegate:(id)anObject + start:(int)selStart + length:(int)selLength; +- (void)endEditing:(NSText *)textObject; +#ifndef STRICT_OPENSTEP +- (BOOL)sendsActionOnEndEditing; +- (void)setSendsActionOnEndEditing:(BOOL)flag; +#endif + +@end + +// +// Methods that are private GNUstep extensions +// +@interface NSCell (PrivateMethods) + +- (NSMutableDictionary*) _nonAutoreleasedTypingAttributes; +- (NSColor*) textColor; +- (NSSize) _sizeText: (NSString*) title; +- (void) _drawText: (NSString*)aString inFrame: (NSRect)cellFrame; +- (void) _drawAttributedText: (NSAttributedString*)aString + inFrame: (NSRect)aRect; + +@end + +// +// Function which should be somewhere else +// +inline NSSize +_sizeForBorderType (NSBorderType aType); + +#endif // _GNUstep_H_NSCell + diff --git a/Headers/AppKit/NSClipView.h b/Headers/AppKit/NSClipView.h new file mode 100644 index 000000000..6afed0352 --- /dev/null +++ b/Headers/AppKit/NSClipView.h @@ -0,0 +1,96 @@ +/* + NSClipView.h + + The class that contains the document view displayed by a NSScrollView. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: July 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSClipView +#define _GNUstep_H_NSClipView + +#include + +@class NSNotification; +@class NSCursor; +@class NSColor; + +@interface NSClipView : NSView +{ + NSView* _documentView; + NSCursor* _cursor; + NSColor* _backgroundColor; + BOOL _drawsBackground; + BOOL _copiesOnScroll; + /* Cached */ + BOOL _isOpaque; +} + +/* Setting the document view */ +- (void)setDocumentView:(NSView*)aView; +- (id)documentView; + +/* Scrolling */ +- (void)scrollToPoint:(NSPoint)aPoint; +- (BOOL)autoscroll:(NSEvent*)theEvent; +- (NSPoint)constrainScrollPoint:(NSPoint)proposedNewOrigin; + +/* Determining scrolling efficiency */ +- (void)setCopiesOnScroll:(BOOL)flag; +- (BOOL)copiesOnScroll; + +/* Getting the visible portion */ +- (NSRect)documentRect; +- (NSRect)documentVisibleRect; + +/* Setting the document cursor */ +- (void)setDocumentCursor:(NSCursor*)aCursor; +- (NSCursor*)documentCursor; + +/* Setting the background color */ +- (void)setBackgroundColor:(NSColor*)aColor; +- (NSColor*)backgroundColor; + +#ifndef STRICT_OPENSTEP +/* Setting the background drawing */ +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; +#endif + +/* Overridden NSView methods */ +- (BOOL)acceptsFirstResponder; +- (BOOL)isFlipped; +- (void)rotateByAngle:(float)angle; +- (void)scaleUnitSquareToSize:(NSSize)newUnitSize; +- (void)setBoundsOrigin:(NSPoint)aPoint; +- (void)setBoundsRotation:(float)angle; +- (void)setBoundsSize:(NSSize)aSize; +- (void)setFrameSize:(NSSize)aSize; +- (void)setFrameOrigin:(NSPoint)aPoint; +- (void)setFrameRotation:(float)angle; +- (void)translateOriginToPoint:(NSPoint)aPoint; +- (void)viewBoundsChanged:(NSNotification*)aNotification; +- (void)viewFrameChanged:(NSNotification*)aNotification; + +@end + +#endif /* _GNUstep_H_NSClipView */ diff --git a/Headers/AppKit/NSColor.h b/Headers/AppKit/NSColor.h new file mode 100644 index 000000000..2e66dc3fc --- /dev/null +++ b/Headers/AppKit/NSColor.h @@ -0,0 +1,243 @@ +/* + NSColor.h + + The colorful color class + + Copyright (C) 1996, 1998 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSColor +#define _GNUstep_H_NSColor + +#include +#include + +@class NSString; +@class NSDictionary; +@class NSPasteboard; +@class NSImage; + +typedef enum _NSControlTint { + NSDefaultControlTint, + NSClearControlTint +} NSControlTint; + +/* + * NSColor is an abstract super class of the class cluster of the real colour classes. + * For each colour space exists a specific subclass that implements the behaviour for + * this colour space. + * The colour spaces NSDeviceBlackColorSpace and NSCalibratedBlackColorSpace + * are no longer supported by this class. They were not in the old OpenStep + * specification, and are not used in the new Apple specification. The names are + * used as synonyms to NSDeviceWhiteColorSpace and NSCalibratedWhiteColorSpace. + */ + +@interface NSColor : NSObject +{ +} + +// +// Creating an NSColor from Component Values +// ++ (NSColor *)colorWithCalibratedHue:(float)hue + saturation:(float)saturation + brightness:(float)brightness + alpha:(float)alpha; ++ (NSColor *)colorWithCalibratedRed:(float)red + green:(float)green + blue:(float)blue + alpha:(float)alpha; ++ (NSColor *)colorWithCalibratedWhite:(float)white + alpha:(float)alpha; ++ (NSColor *)colorWithCatalogName:(NSString *)listName + colorName:(NSString *)colorName; ++ (NSColor *)colorWithDeviceCyan:(float)cyan + magenta:(float)magenta + yellow:(float)yellow + black:(float)black + alpha:(float)alpha; ++ (NSColor *)colorWithDeviceHue:(float)hue + saturation:(float)saturation + brightness:(float)brightness + alpha:(float)alpha; ++ (NSColor *)colorWithDeviceRed:(float)red + green:(float)green + blue:(float)blue + alpha:(float)alpha; ++ (NSColor *)colorWithDeviceWhite:(float)white + alpha:(float)alpha; + +// +// Creating an NSColor With Preset Components +// ++ (NSColor *)blackColor; ++ (NSColor *)blueColor; ++ (NSColor *)brownColor; ++ (NSColor *)clearColor; ++ (NSColor *)cyanColor; ++ (NSColor *)darkGrayColor; ++ (NSColor *)grayColor; ++ (NSColor *)greenColor; ++ (NSColor *)lightGrayColor; ++ (NSColor *)magentaColor; ++ (NSColor *)orangeColor; ++ (NSColor *)purpleColor; ++ (NSColor *)redColor; ++ (NSColor *)whiteColor; ++ (NSColor *)yellowColor; + +// +// Ignoring Alpha Components +// ++ (BOOL)ignoresAlpha; ++ (void)setIgnoresAlpha:(BOOL)flag; + +// +// Retrieving a Set of Components +// +- (void)getCyan:(float *)cyan + magenta:(float *)magenta + yellow:(float *)yellow + black:(float *)black + alpha:(float *)alpha; +- (void)getHue:(float *)hue + saturation:(float *)saturation + brightness:(float *)brightness + alpha:(float *)alpha; +- (void)getRed:(float *)red + green:(float *)green + blue:(float *)blue + alpha:(float *)alpha; +- (void)getWhite:(float *)white + alpha:(float *)alpha; + +// +// Retrieving Individual Components +// +- (float)alphaComponent; +- (float)blackComponent; +- (float)blueComponent; +- (float)brightnessComponent; +- (NSString *)catalogNameComponent; +- (NSString *)colorNameComponent; +- (float)cyanComponent; +- (float)greenComponent; +- (float)hueComponent; +- (NSString *)localizedCatalogNameComponent; +- (NSString *)localizedColorNameComponent; +- (float)magentaComponent; +- (float)redComponent; +- (float)saturationComponent; +- (float)whiteComponent; +- (float)yellowComponent; + +// +// Converting to Another Color Space +// +- (NSString *)colorSpaceName; +- (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace; +- (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace + device:(NSDictionary *)deviceDescription; + +// +// Changing the Color +// +- (NSColor *)blendedColorWithFraction:(float)fraction + ofColor:(NSColor *)aColor; +- (NSColor *)colorWithAlphaComponent:(float)alpha; + +// +// Copying and Pasting +// ++ (NSColor *)colorFromPasteboard:(NSPasteboard *)pasteBoard; +- (void)writeToPasteboard:(NSPasteboard *)pasteBoard; + +// +// Drawing +// +- (void)drawSwatchInRect:(NSRect)rect; +- (void)set; + +#ifndef STRICT_OPENSTEP +// +// Changing the color +// +- (NSColor*) highlightWithLevel: (float)level; +- (NSColor*) shadowWithLevel: (float)level; + ++ (NSColor*) colorWithPatternImage:(NSImage*)image; ++ (NSColor*) colorForControlTint:(NSControlTint)controlTint; + +// +// System colors stuff. +// ++ (NSColor*) controlBackgroundColor; ++ (NSColor*) controlColor; ++ (NSColor*) controlHighlightColor; ++ (NSColor*) controlLightHighlightColor; ++ (NSColor*) controlShadowColor; ++ (NSColor*) controlDarkShadowColor; ++ (NSColor*) controlTextColor; ++ (NSColor*) disabledControlTextColor; ++ (NSColor*) gridColor; ++ (NSColor*) headerColor; ++ (NSColor*) headerTextColor; ++ (NSColor*) highlightColor; ++ (NSColor*) keyboardFocusIndicatorColor; ++ (NSColor*) knobColor; ++ (NSColor*) scrollBarColor; ++ (NSColor*) selectedControlColor; ++ (NSColor*) selectedControlTextColor; ++ (NSColor*) selectedKnobColor; ++ (NSColor*) selectedMenuItemColor; ++ (NSColor*) selectedMenuItemTextColor; ++ (NSColor*) selectedTextBackgroundColor; ++ (NSColor*) selectedTextColor; ++ (NSColor*) shadowColor; ++ (NSColor*) textBackgroundColor; ++ (NSColor*) textColor; ++ (NSColor*) windowBackgroundColor; ++ (NSColor*) windowFrameColor; ++ (NSColor*) windowFrameTextColor; + +// Pattern colour +- (NSImage*) patternImage; +#endif + +@end + +APPKIT_EXPORT NSString *NSSystemColorsDidChangeNotification; + +#ifndef STRICT_MACOS_X +@interface NSCoder (NSCoderAdditions) + +// +// Converting an Archived NXColor to an NSColor +// +- (NSColor *)decodeNXColor; + +@end +#endif + +#endif // _GNUstep_H_NSColor + diff --git a/Headers/AppKit/NSColorList.h b/Headers/AppKit/NSColorList.h new file mode 100644 index 000000000..a3ff7611e --- /dev/null +++ b/Headers/AppKit/NSColorList.h @@ -0,0 +1,114 @@ +/* + NSColorList.h + + Manage named lists of NSColors. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Nicola Pero + Date: 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSColorList +#define _GNUstep_H_NSColorList + +#include +#include + +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSDictionary; +@class NSMutableDictionary; + +@class NSColor; + +@interface NSColorList : NSObject + +{ + NSString* _name; + NSString* _fullFileName; + BOOL _is_editable; + + // Color Lists are required to be a sort of ordered dictionary + // For now it is implemented as follows (Scott Christley, 1996): + + // This object contains couples (keys (=color names), values (=colors)) + NSMutableDictionary* _colorDictionary; + + // This object contains the keys (=color names) in order + NSMutableArray* _orderedColorKeys; +} + +// +// Initializing an NSColorList +// +- (id)initWithName:(NSString *)name; +- (id)initWithName:(NSString *)name + fromFile:(NSString *)path; + +// +// Getting All Color Lists +// ++ (NSArray *)availableColorLists; + +// +// Getting a Color List by Name +// ++ (NSColorList *)colorListNamed:(NSString *)name; +- (NSString *)name; + +// +// Managing Colors by Key +// +- (NSArray *)allKeys; +- (NSColor *)colorWithKey:(NSString *)key; +- (void)insertColor:(NSColor *)color + key:(NSString *)key + atIndex:(unsigned)location; +- (void)removeColorWithKey:(NSString *)key; +- (void)setColor:(NSColor *)aColor + forKey:(NSString *)key; + +// +// Editing +// +- (BOOL)isEditable; + +// +// Writing and Removing Files +// +- (BOOL)writeToFile:(NSString *)path; +- (void)removeFile; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +/* Notifications */ +APPKIT_EXPORT NSString *NSColorListChangedNotification; + +#endif // _GNUstep_H_NSColorList diff --git a/Headers/AppKit/NSColorPanel.h b/Headers/AppKit/NSColorPanel.h new file mode 100644 index 000000000..6672a7bfa --- /dev/null +++ b/Headers/AppKit/NSColorPanel.h @@ -0,0 +1,138 @@ +/* + NSColorPanel.h + + System generic color panel + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSColorPanel +#define _GNUstep_H_NSColorPanel + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +@class NSView; +@class NSColorList; +@class NSEvent; + +enum { + NSGrayModeColorPanel, + NSRGBModeColorPanel, + NSCMYKModeColorPanel, + NSHSBModeColorPanel, + NSCustomPaletteModeColorPanel, + NSColorListModeColorPanel, + NSWheelModeColorPanel +}; + +enum { + NSColorPanelGrayModeMask = 1, + NSColorPanelRGBModeMask = 2, + NSColorPanelCMYKModeMask = 4, + NSColorPanelHSBModeMask = 8, + NSColorPanelCustomPaletteModeMask = 16, + NSColorPanelColorListModeMask = 32, + NSColorPanelWheelModeMask = 64, + NSColorPanelAllModesMask = 127 +}; + +@interface NSApplication (NSColorPanel) +- (void) orderFrontColorPanel: (id)sender; +@end + +@interface NSColorPanel : NSPanel +{ + // Attributes + NSView *_topView; + NSColorWell *_colorWell; + NSButton *_magnifyButton; + NSMatrix *_pickerMatrix; + NSBox *_pickerBox; + NSSlider *_alphaSlider; + NSSplitView *_splitView; + NSView *_accessoryView; + + //NSMatrix *_swatches; + + NSMutableArray *_pickers; + id _currentPicker; + id _target; + SEL _action; + BOOL _isContinuous; + BOOL _showsAlpha; +} + +// +// Creating the NSColorPanel +// ++ (NSColorPanel *)sharedColorPanel; ++ (BOOL)sharedColorPanelExists; + +// +// Setting the NSColorPanel +// ++ (void)setPickerMask:(int)mask; ++ (void)setPickerMode:(int)mode; +- (NSView *)accessoryView; +- (BOOL)isContinuous; +- (int)mode; +- (void)setAccessoryView:(NSView *)aView; +- (void)setAction:(SEL)aSelector; +- (void)setContinuous:(BOOL)flag; +- (void)setMode:(int)mode; +- (void)setShowsAlpha:(BOOL)flag; +- (void)setTarget:(id)anObject; +- (BOOL)showsAlpha; + +// +// Attaching a Color List +// +- (void)attachColorList:(NSColorList *)aColorList; +- (void)detachColorList:(NSColorList *)aColorList; + +// +// Setting Color +// ++ (BOOL)dragColor:(NSColor *)aColor + withEvent:(NSEvent *)anEvent + fromView:(NSView *)sourceView; +- (void)setColor:(NSColor *)aColor; + +- (float)alpha; +- (NSColor *)color; + +@end + +/* Notifications */ +APPKIT_EXPORT NSString *NSColorPanelColorChangedNotification; + +#endif // _GNUstep_H_NSColorPanel diff --git a/Headers/AppKit/NSColorPicker.h b/Headers/AppKit/NSColorPicker.h new file mode 100644 index 000000000..cb840c715 --- /dev/null +++ b/Headers/AppKit/NSColorPicker.h @@ -0,0 +1,87 @@ +/* + NSColorPicker.h + + Abstract superclass of custom color pickers + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSColorPicker +#define _GNUstep_H_NSColorPicker + +#include +#include + +@class NSColorPanel; +@class NSColorList; +@class NSImage; +@class NSButtonCell; + +@interface NSColorPicker : NSObject +{ + // Attributes + id _colorPanel; +} + +// +// Initializing an NSColorPicker +// +- (id)initWithPickerMask:(int)aMask + colorPanel:(NSColorPanel *)colorPanel; + +// +// Getting the Color Panel +// +- (NSColorPanel *)colorPanel; + +// +// Adding Button Images +// +- (void)insertNewButtonImage:(NSImage *)newImage + in:(NSButtonCell *)newButtonCell; +- (NSImage *)provideNewButtonImage; + +// +// Setting the Mode +// +- (void)setMode:(int)mode; + +// +// Using Color Lists +// +- (void)attachColorList:(NSColorList *)colorList; +- (void)detachColorList:(NSColorList *)colorList; + +// +// Showing Opacity Controls +// +- (void)alphaControlAddedOrRemoved:(id)sender; + +// +// Responding to a Resized View +// +- (void)viewSizeChanged:(id)sender; + +@end + +#endif // _GNUstep_H_NSColorPicker diff --git a/Headers/AppKit/NSColorPicking.h b/Headers/AppKit/NSColorPicking.h new file mode 100644 index 000000000..93924d72c --- /dev/null +++ b/Headers/AppKit/NSColorPicking.h @@ -0,0 +1,98 @@ +/* + NSColorPicking.h + + Protocols for picking colors + + Copyright (C) 1997 Free Software Foundation, Inc. + + Author: Simon Frankau + Date: 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSColorPicking +#define _GNUstep_H_NSColorPicking + +#include + +@class NSColor; +@class NSColorPanel; +@class NSView; +@class NSImage; +@class NSButtonCell; +@class NSColorList; + +@protocol NSColorPickingCustom + +// +// Getting the Mode +// +- (int)currentMode; +- (BOOL)supportsMode:(int)mode; + +// +// Getting the view +// +- (NSView *)provideNewView:(BOOL)firstRequest; + +// +// Setting the Current Color +// +- (void)setColor:(NSColor *)aColor; + +@end + +@protocol NSColorPickingDefault + +// +// Initialize a Color Picker +// +- (id)initWithPickerMask:(int)mask + colorPanel:(NSColorPanel *)colorPanel; + +// +// Adding Button Images +// +- (void)insertNewButtonImage:(NSImage *)newImage + in:(NSButtonCell *)newButtonCell; +- (NSImage *)provideNewButtonImage; + +// +// Setting the Mode +// +- (void)setMode:(int)mode; + +// +// Using Color Lists +// +- (void)attachColorList:(NSColorList *)aColorList; +- (void)detachColorList:(NSColorList *)aColorList; + +// +// Showing Opacity Controls +// +- (void)alphaControlAddedOrRemoved:(id)sender; + +// +// Responding to a Resized View +// +- (void)viewSizeChanged:(id)sender; + +@end + +#endif // _GNUstep_H_NSColorPicking diff --git a/Headers/AppKit/NSColorWell.h b/Headers/AppKit/NSColorWell.h new file mode 100644 index 000000000..9a532ce2b --- /dev/null +++ b/Headers/AppKit/NSColorWell.h @@ -0,0 +1,81 @@ +/* + NSColorWell.h + + NSControl for selecting and display a single color value. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSColorWell +#define _GNUstep_H_NSColorWell + +#include + +@class NSColor; + +@interface NSColorWell : NSControl + +{ + // Attributes + NSColor *_the_color; + BOOL _is_active; + BOOL _is_bordered; + NSRect _wellRect; + id _target; + SEL _action; +} + +// +// Drawing +// +- (void)drawWellInside:(NSRect)insideRect; + +// +// Activating +// +- (void)activate:(BOOL)exclusive; +- (void)deactivate; +- (BOOL)isActive; + +// +// Managing Color +// +- (NSColor *)color; +- (void)setColor:(NSColor *)color; +- (void)takeColorFrom:(id)sender; + +// +// Managing Borders +// +- (BOOL)isBordered; +- (void)setBordered:(BOOL)bordered; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSColorWell diff --git a/Headers/AppKit/NSComboBox.h b/Headers/AppKit/NSComboBox.h new file mode 100644 index 000000000..6d40d88e5 --- /dev/null +++ b/Headers/AppKit/NSComboBox.h @@ -0,0 +1,112 @@ +/* + NSComboBox.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Gerrit van Dyk + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSComboBox +#define _GNUstep_H_NSComboBox + +#include +#include + +@interface NSComboBox : NSTextField +{ +} + +- (BOOL) hasVerticalScroller; +- (void) setHasVerticalScroller: (BOOL)flag; + +- (NSSize) intercellSpacing; +- (void) setIntercellSpacing: (NSSize)aSize; + +- (float) itemHeight; +- (void) setItemHeight: (float)itemHeight; + +- (int) numberOfVisibleItems; +- (void) setNumberOfVisibleItems: (int)visibleItems; + +- (void) reloadData; +- (void) noteNumberOfItemsChanged; + +- (BOOL) usesDataSource; +- (void) setUsesDataSource: (BOOL)flag; + +- (void) scrollItemAtIndexToTop: (int)index; +- (void) scrollItemAtIndexToVisible: (int)index; + +- (void) selectItemAtIndex: (int)index; +- (void) deselectItemAtIndex: (int)index; +- (int) indexOfSelectedItem; +- (int) numberOfItems; + +/* These two methods can only be used when usesDataSource is YES */ +- (id) dataSource; +- (void) setDataSource: (id)aSource; + +/* These methods can only be used when usesDataSource is NO */ +- (void) addItemWithObjectValue: (id)object; +- (void) addItemsWithObjectValues: (NSArray *)objects; +- (void) insertItemWithObjectValue: (id)object atIndex:(int)index; +- (void) removeItemWithObjectValue: (id)object; +- (void) removeItemAtIndex: (int)index; +- (void) removeAllItems; +- (void) selectItemWithObjectValue: (id)object; +- (id) itemObjectValueAtIndex: (int)index; +- (id) objectValueOfSelectedItem; +- (int) indexOfItemWithObjectValue: (id)object; +- (NSArray *) objectValues; + +#ifndef STRICT_OPENSTEP +/* text completion */ +- (void) setCompletes: (BOOL)completes; +- (BOOL) completes; +#endif + +@end + +@interface NSObject (NSComboBoxDataSource) +- (int) numberOfItemsInComboBox: (NSComboBox *)aComboBox; +- (id) comboBox: (NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index; +- (unsigned int) comboBox: (NSComboBox *)aComboBox +indexOfItemWithStringValue: (NSString *)string; +#ifndef STRICT_OPENSTEP +/* text completion */ +- (NSString *) comboBox: (NSComboBox *)aComboBox + completedString: (NSString *)aString; +#endif +@end + +@interface NSObject (NSComboBoxNotifications) +- (void) comboBoxWillPopUp: (NSNotification *)notification; +- (void) comboBoxWillDismiss: (NSNotification *)notification; +- (void) comboBoxSelectionDidChange: (NSNotification *)notification; +- (void) comboBoxSelectionIsChanging: (NSNotification *)notification; +@end + +APPKIT_EXPORT NSString *NSComboBoxWillPopUpNotification; +APPKIT_EXPORT NSString *NSComboBoxWillDismissNotification; +APPKIT_EXPORT NSString *NSComboBoxSelectionDidChangeNotification; +APPKIT_EXPORT NSString *NSComboBoxSelectionIsChangingNotification; + +#endif /* _GNUstep_H_NSComboBox */ diff --git a/Headers/AppKit/NSComboBoxCell.h b/Headers/AppKit/NSComboBoxCell.h new file mode 100644 index 000000000..41f6411f1 --- /dev/null +++ b/Headers/AppKit/NSComboBoxCell.h @@ -0,0 +1,115 @@ +/* + NSComboBoxCell.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Gerrit van Dyk + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSComboBoxCell +#define _GNUstep_H_NSComboBoxCell + +#include + +@class NSButtonCell, NSScrollView; + +@interface NSComboBoxCell : NSTextFieldCell +{ + id _dataSource; + NSButtonCell *_buttonCell; + NSMutableArray *_popUpList; + BOOL _usesDataSource; + BOOL _hasVerticalScroller; + BOOL _completes; + int _visibleItems; + NSSize _intercellSpacing; + float _itemHeight; + int _selectedItem; + +@private + id _popup; +} + +- (BOOL)hasVerticalScroller; +- (void)setHasVerticalScroller:(BOOL)flag; + +- (NSSize)intercellSpacing; +- (void)setIntercellSpacing:(NSSize)aSize; + +- (float)itemHeight; +- (void)setItemHeight:(float)itemHeight; + +- (int)numberOfVisibleItems; +- (void)setNumberOfVisibleItems:(int)visibleItems; + +- (void)reloadData; +- (void)noteNumberOfItemsChanged; + +- (BOOL)usesDataSource; +- (void)setUsesDataSource:(BOOL)flag; + +- (void)scrollItemAtIndexToTop:(int)index; +- (void)scrollItemAtIndexToVisible:(int)index; + +- (void)selectItemAtIndex:(int)index; +- (void)deselectItemAtIndex:(int)index; +- (int)indexOfSelectedItem; +- (int)numberOfItems; + +/* These two methods can only be used when usesDataSource is YES */ +- (id)dataSource; +- (void)setDataSource:(id)aSource; + +/* These methods can only be used when usesDataSource is NO */ +- (void)addItemWithObjectValue:(id)object; +- (void)addItemsWithObjectValues:(NSArray *)objects; +- (void)insertItemWithObjectValue:(id)object atIndex:(int)index; +- (void)removeItemWithObjectValue:(id)object; +- (void)removeItemAtIndex:(int)index; +- (void)removeAllItems; +- (void)selectItemWithObjectValue:(id)object; +- (id)itemObjectValueAtIndex:(int)index; +- (id)objectValueOfSelectedItem; +- (int)indexOfItemWithObjectValue:(id)object; +- (NSArray *)objectValues; + +#ifndef STRICT_OPENSTEP +/* text completion */ +- (NSString *)completedString:(NSString *)substring; +- (void)setCompletes:(BOOL)completes; +- (BOOL)completes; +#endif +@end + +@interface NSObject (NSComboBoxCellDataSource) +- (int)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell; +- (id)comboBoxCell:(NSComboBoxCell *)aComboBoxCell +objectValueForItemAtIndex:(int)index; +- (unsigned int)comboBoxCell:(NSComboBoxCell *)aComboBoxCell + indexOfItemWithStringValue:(NSString *)string; +#ifndef STRICT_OPENSTEP +/* text completion */ +- (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBoxCell + completedString:(NSString *)uncompletedString; +#endif +@end + +#endif /* _GNUstep_H_NSComboBoxCell */ diff --git a/Headers/AppKit/NSControl.h b/Headers/AppKit/NSControl.h new file mode 100644 index 000000000..32f8b7c7d --- /dev/null +++ b/Headers/AppKit/NSControl.h @@ -0,0 +1,213 @@ +/* + NSControl.h + + The abstract control class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSControl +#define _GNUstep_H_NSControl + +#include + +@class NSString; +@class NSNotification; +@class NSFormatter; + +@class NSCell; +@class NSFont; +@class NSEvent; + +@interface NSControl : NSView +{ + // Attributes + int _tag; + id _cell; // id so compiler wont complain too much for subclasses + BOOL _ignoresMultiClick; +} + +// +// Setting the Control's Cell +// ++ (Class)cellClass; ++ (void)setCellClass:(Class)factoryId; +- (id)cell; +- (void)setCell:(NSCell *)aCell; + +// +// Enabling and Disabling the Control +// +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; + +// +// Identifying the Selected Cell +// +- (id)selectedCell; +- (int)selectedTag; + +// +// Setting the Control's Value +// +- (void) setDoubleValue: (double)aDouble; +- (double) doubleValue; + +- (void) setFloatValue: (float)aFloat; +- (float) floatValue; + +- (void) setIntValue: (int)anInt; +- (int) intValue; + +- (void) setStringValue: (NSString *)aString; +- (NSString *) stringValue; + +- (void) setObjectValue: (id)anObject; +- (id) objectValue; + +- (void) setNeedsDisplay; + +// +// Interacting with Other Controls +// +- (void) takeDoubleValueFrom: (id)sender; +- (void) takeFloatValueFrom: (id)sender; +- (void) takeIntValueFrom: (id)sender; +- (void) takeStringValueFrom: (id)sender; +- (void) takeObjectValueFrom: (id)sender; + +// +// Formatting Text +// +- (NSTextAlignment)alignment; +- (NSFont *)font; +- (void)setAlignment:(NSTextAlignment)mode; +- (void)setFont:(NSFont *)fontObject; +- (void)setFloatingPointFormat:(BOOL)autoRange + left:(unsigned)leftDigits + right:(unsigned)rightDigits; +#ifndef STRICT_OPENSTEP +- (void)setFormatter:(NSFormatter*)newFormatter; +- (id)formatter; +#endif + +// +// Managing the Field Editor +// +- (BOOL)abortEditing; +- (NSText *)currentEditor; +- (void)validateEditing; + +// +// Resizing the Control +// +- (void)calcSize; +- (void)sizeToFit; + +// +// Displaying the Control and Cell +// +- (void)drawCell:(NSCell *)aCell; +- (void)drawCellInside:(NSCell *)aCell; +- (void)selectCell:(NSCell *)aCell; +- (void)updateCell:(NSCell *)aCell; +- (void)updateCellInside:(NSCell *)aCell; + +// +// Target and Action +// +- (SEL)action; +- (BOOL)isContinuous; +- (BOOL)sendAction:(SEL)theAction + to:(id)theTarget; +- (int)sendActionOn:(int)mask; +- (void)setAction:(SEL)aSelector; +- (void)setContinuous:(BOOL)flag; +- (void)setTarget:(id)anObject; +- (id)target; + +// +// Attributed string handling +// +#ifndef STRICT_OPENSTEP +- (NSAttributedString *)attributedStringValue; +- (void)setAttributedStringValue:(NSAttributedString *)attribStr; +#endif + +// +// Assigning a Tag +// +- (void)setTag:(int)anInt; +- (int)tag; + +// +// Activation +// +- (void)performClick:(id)sender; +#ifndef STRICT_OPENSTEP +- (BOOL)refusesFirstResponder; +- (void)setRefusesFirstResponder:(BOOL)flag; +#endif + +// +// Tracking the Mouse +// +- (void)mouseDown:(NSEvent *)theEvent; +- (BOOL)ignoresMultiClick; +- (void)setIgnoresMultiClick:(BOOL)flag; + +@end + +APPKIT_EXPORT NSString *NSControlTextDidBeginEditingNotification; +APPKIT_EXPORT NSString *NSControlTextDidEndEditingNotification; +APPKIT_EXPORT NSString *NSControlTextDidChangeNotification; + +// +// Methods Implemented by the Delegate +// +@interface NSObject (NSControlDelegate) +- (BOOL) control: (NSControl *)control + textShouldBeginEditing: (NSText *)fieldEditor; + +- (BOOL) control: (NSControl *)control + textShouldEndEditing: (NSText *)fieldEditor; + +- (void) controlTextDidBeginEditing: (NSNotification *)aNotification; + +- (void) controlTextDidEndEditing: (NSNotification *)aNotification; + +- (void) controlTextDidChange: (NSNotification *)aNotification; + +- (BOOL) control: (NSControl *)control + didFailToFormatString: (NSString *)string + errorDescription: (NSString *)error; + +- (void) control: (NSControl *)control + didFailToValidatePartialString: (NSString *)string + errorDescription: (NSString *)error; + +- (BOOL) control: (NSControl *)control isValidObject:(id)object; +@end + + +#endif // _GNUstep_H_NSControl diff --git a/Headers/AppKit/NSCursor.h b/Headers/AppKit/NSCursor.h new file mode 100644 index 000000000..a12c663e6 --- /dev/null +++ b/Headers/AppKit/NSCursor.h @@ -0,0 +1,108 @@ +/* + NSCursor.h + + Holds an image to use as a cursor + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSCursor +#define _GNUstep_H_NSCursor + +#include + +@class NSImage; +@class NSEvent; +@class NSColor; + +@interface NSCursor : NSObject +{ + NSImage *_cursor_image; + NSPoint _hot_spot; + BOOL _is_set_on_mouse_entered; + BOOL _is_set_on_mouse_exited; + void *_cid; +} + +/* + * Initializing a New NSCursor Object + */ +- (id) initWithImage: (NSImage *)newImage; +- (id) initWithImage: (NSImage *)newImage + hotSpot: (NSPoint)hotSpot; + + +#ifndef STRICT_OPENSTEP +- (id)initWithImage:(NSImage *)newImage +foregroundColorHint:(NSColor *)fg +backgroundColorHint:(NSColor *)bg + hotSpot:(NSPoint)hotSpot; +#endif + +/* + * Defining the Cursor + */ +- (NSPoint) hotSpot; +- (NSImage*) image; +// This methods are defined in OpenStep, but not in MacOSX +- (void) setHotSpot: (NSPoint)spot; +- (void) setImage: (NSImage *)newImage; + +/* + * Setting the Cursor + */ ++ (void) hide; ++ (void) pop; ++ (void) setHiddenUntilMouseMoves: (BOOL)flag; ++ (BOOL) isHiddenUntilMouseMoves; ++ (void) unhide; +- (BOOL) isSetOnMouseEntered; +- (BOOL) isSetOnMouseExited; +- (void) mouseEntered: (NSEvent*)theEvent; +- (void) mouseExited: (NSEvent*)theEvent; +- (void) pop; +- (void) push; +- (void) set; +- (void) setOnMouseEntered: (BOOL)flag; +- (void) setOnMouseExited: (BOOL)flag; + +/* + * Getting the Cursor + */ ++ (NSCursor*) arrowCursor; ++ (NSCursor*) currentCursor; ++ (NSCursor*) IBeamCursor; + +#ifndef NO_GNUSTEP ++ (NSCursor*) greenArrowCursor; +#endif + +@end + +/* Cursor types */ +typedef enum { + GSArrowCursor, + GSIBeamCursor +} GSCursorTypes; + +#endif /* _GNUstep_H_NSCursor */ diff --git a/Headers/AppKit/NSCustomImageRep.h b/Headers/AppKit/NSCustomImageRep.h new file mode 100644 index 000000000..e04f0f03b --- /dev/null +++ b/Headers/AppKit/NSCustomImageRep.h @@ -0,0 +1,52 @@ +/* + NSCustomImageRep.h + + Custom image representation. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSCustomImageRep +#define _GNUstep_H_NSCustomImageRep + +#include + +@interface NSCustomImageRep : NSImageRep +{ + // Attributes + id _delegate; + SEL _selector; +} + +- (id)initWithDrawSelector:(SEL)aSelector + delegate:(id)anObject; + +// +// Identifying the Object +// +- (id)delegate; +- (SEL)drawSelector; + +@end + +#endif // _GNUstep_H_NSCustomImageRep diff --git a/Headers/AppKit/NSDataLink.h b/Headers/AppKit/NSDataLink.h new file mode 100644 index 000000000..8015c4416 --- /dev/null +++ b/Headers/AppKit/NSDataLink.h @@ -0,0 +1,124 @@ +/* + NSDataLink.h + + Link between a source and dependent document + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSDataLink +#define _GNUstep_H_NSDataLink + +#include +#include + +@class NSString; +@class NSArray; +@class NSDate; + +@class NSDataLinkManager; +@class NSSelection; +@class NSPasteboard; + +typedef int NSDataLinkNumber; + +typedef enum _NSDataLinkDisposition { + NSLinkInDestination, + NSLinkInSource, + NSLinkBroken +} NSDataLinkDisposition; + +typedef enum _NSDataLinkUpdateMode { + NSUpdateContinuously, + NSUpdateWhenSourceSaved, + NSUpdateManually, + NSUpdateNever +} NSDataLinkUpdateMode; + +APPKIT_EXPORT NSString *NSDataLinkFileNameExtension; + +@interface NSDataLink : NSObject +{ + // Attributes +} + +// +// Initializing a Link +// +- (id)initLinkedToFile:(NSString *)filename; +- (id)initLinkedToSourceSelection:(NSSelection *)selection + managedBy:(NSDataLinkManager *)linkManager + supportingTypes:(NSArray *)newTypes; +- (id)initWithContentsOfFile:(NSString *)filename; +- (id)initWithPasteboard:(NSPasteboard *)pasteboard; + +// +// Exporting a Link +// +- (BOOL)saveLinkIn:(NSString *)directoryName; +- (BOOL)writeToFile:(NSString *)filename; +- (void)writeToPasteboard:(NSPasteboard *)pasteboard; + +// +// Information about the Link +// +- (NSDataLinkDisposition)disposition; +- (NSDataLinkNumber)linkNumber; +- (NSDataLinkManager *)manager; + +// +// Information about the Link's Source +// +- (NSDate *)lastUpdateTime; +- (BOOL)openSource; +- (NSString *)sourceApplicationName; +- (NSString *)sourceFilename; +- (NSSelection *)sourceSelection; +- (NSArray *)types; + +// +// Information about the Link's Destination +// +- (NSString *)destinationApplicationName; +- (NSString *)destinationFilename; +- (NSSelection *)destinationSelection; + +// +// Changing the Link +// +- (BOOL)break; +- (void)noteSourceEdited; +- (void)setUpdateMode:(NSDataLinkUpdateMode)mode; +- (BOOL)updateDestination; +- (NSDataLinkUpdateMode)updateMode; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSDataLink + diff --git a/Headers/AppKit/NSDataLinkManager.h b/Headers/AppKit/NSDataLinkManager.h new file mode 100644 index 000000000..0c353fa14 --- /dev/null +++ b/Headers/AppKit/NSDataLinkManager.h @@ -0,0 +1,144 @@ +/* + NSDataLinkManager.h + + Manager of a NSDataLink + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSDataLinkManager +#define _GNUstep_H_NSDataLinkManager + +#include + +@class NSString; +@class NSEnumerator; +@class NSMutableDictionary; +@class NSDataLink; +@class NSSelection; +@class NSPasteboard; +@class NSWindow; + +@interface NSDataLinkManager : NSObject +{ + // Attributes + id delegate; + NSString *filename; + BOOL delegateVerifiesLinks; + BOOL interactsWithUser; + BOOL isEdited; + BOOL areLinkOutlinesVisible; + NSMutableDictionary *sourceLinks; + NSMutableDictionary *destinationLinks; +} + +// +// Initializing and Freeing a Link Manager +// +- (id)initWithDelegate:(id)anObject; +- (id)initWithDelegate:(id)anObject + fromFile:(NSString *)path; + +// +// Adding and Removing Links +// +- (BOOL)addLink:(NSDataLink *)link + at:(NSSelection *)selection; +- (BOOL)addLinkAsMarker:(NSDataLink *)link + at:(NSSelection *)selection; +- (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection + fromPasteboard:(NSPasteboard *)pasteboard + at:(NSSelection *)selection; +- (void)breakAllLinks; +- (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard; + +// +// Informing the Link Manager of Document Status +// +- (void)noteDocumentClosed; +- (void)noteDocumentEdited; +- (void)noteDocumentReverted; +- (void)noteDocumentSaved; +- (void)noteDocumentSavedAs:(NSString *)path; +- (void)noteDocumentSavedTo:(NSString *)path; + +// +// Getting and Setting Information about the Link Manager +// +- (id)delegate; +- (BOOL)delegateVerifiesLinks; +- (NSString *)filename; +- (BOOL)interactsWithUser; +- (BOOL)isEdited; +- (void)setDelegateVerifiesLinks:(BOOL)flag; +- (void)setInteractsWithUser:(BOOL)flag; + +// +// Getting and Setting Information about the Manager's Links +// +- (BOOL)areLinkOutlinesVisible; +- (NSEnumerator *)destinationLinkEnumerator; +- (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel; +- (void)setLinkOutlinesVisible:(BOOL)flag; +- (NSEnumerator *)sourceLinkEnumerator; + +// +// Methods Implemented by the Delegate +// +- (BOOL)copyToPasteboard:(NSPasteboard *)pasteboard + at:(NSSelection *)selection + cheapCopyAllowed:(BOOL)flag; +- (void)dataLinkManager:(NSDataLinkManager *)sender + didBreakLink:(NSDataLink *)link; +- (BOOL)dataLinkManager:(NSDataLinkManager *)sender + isUpdateNeededForLink:(NSDataLink *)link; +- (void)dataLinkManager:(NSDataLinkManager *)sender + startTrackingLink:(NSDataLink *)link; +- (void)dataLinkManager:(NSDataLinkManager *)sender + stopTrackingLink:(NSDataLink *)link; +- (void)dataLinkManagerCloseDocument:(NSDataLinkManager *)sender; +- (void)dataLinkManagerDidEditLinks:(NSDataLinkManager *)sender; +- (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender; +- (BOOL)dataLinkManagerTracksLinksIndividually:(NSDataLinkManager *)sender; +- (BOOL)importFile:(NSString *)filename + at:(NSSelection *)selection; +- (BOOL)pasteFromPasteboard:(NSPasteboard *)pasteboard + at:(NSSelection *)selection; +- (BOOL)showSelection:(NSSelection *)selection; +- (NSWindow *)windowForSelection:(NSSelection *)selection; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +// +// Draw a Distinctive Outline around Linked Data +// +void NSFrameLinkRect(NSRect aRect, BOOL isDestination); +float NSLinkFrameThickness(void); + +#endif // _GNUstep_H_NSDataLinkManager diff --git a/Headers/AppKit/NSDataLinkPanel.h b/Headers/AppKit/NSDataLinkPanel.h new file mode 100644 index 000000000..9fe6e74f6 --- /dev/null +++ b/Headers/AppKit/NSDataLinkPanel.h @@ -0,0 +1,99 @@ +/* + NSDataLinkPanel.h + + Standard panel for inspecting data links + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSDataLinkPanel +#define _GNUstep_H_NSDataLinkPanel + +#include +#include + +@class NSDataLink; +@class NSDataLinkManager; +@class NSView; + +@interface NSApplication (NSDataLinkPanel) +- (void) orderFrontDataLinkPanel: (id)sender; +@end + +@interface NSDataLinkPanel : NSPanel +{ + // Attributes + id _sourceField; + id _lastUpdateField; + id _openSourceButton; + id _updateDestinationButton; + id _breakLinkButton; + id _breakAllLinksButton; + id _updateModeButton; +} + +// +// Initializing +// ++ (NSDataLinkPanel *)sharedDataLinkPanel; + +// +// Keeping the Panel Up to Date +// ++ (void)getLink:(NSDataLink **)link + manager:(NSDataLinkManager **)linkManager + isMultiple:(BOOL *)flag; ++ (void)setLink:(NSDataLink *)link + manager:(NSDataLinkManager *)linkManager + isMultiple:(BOOL)flag; +- (void)getLink:(NSDataLink **)link + manager:(NSDataLinkManager **)linkManager + isMultiple:(BOOL *)flag; +- (void)setLink:(NSDataLink *)link + manager:(NSDataLinkManager *)linkManager + isMultiple:(BOOL)flag; + +// +// Customizing the Panel +// +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; + +// +// Responding to User Input +// +- (void)pickedBreakAllLinks:(id)sender; +- (void)pickedBreakLink:(id)sender; +- (void)pickedOpenSource:(id)sender; +- (void)pickedUpdateDestination:(id)sender; +- (void)pickedUpdateMode:(id)sender; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSDataLinkPanel diff --git a/Headers/AppKit/NSDocument.h b/Headers/AppKit/NSDocument.h new file mode 100644 index 000000000..0ea130c36 --- /dev/null +++ b/Headers/AppKit/NSDocument.h @@ -0,0 +1,218 @@ +/* + NSDocument.h + + The abstract document class + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Carl Lindberg + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSDocument +#define _GNUstep_H_NSDocument + +#include +#include +#include + + +/* Foundation classes */ +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSData; +@class NSFileManager; +@class NSURL; +@class NSUndoManager; + +/* AppKit classes */ +@class NSWindow; +@class NSView; +@class NSSavePanel; +@class NSMenuItem; +@class NSPrintInfo; +@class NSPopUpButton; +@class NSFileWrapper; +@class NSDocumentController; +@class NSWindowController; + + +typedef enum _NSDocumentChangeType { + NSChangeDone = 0, + NSChangeUndone = 1, + NSChangeCleared = 2 +} NSDocumentChangeType; + +typedef enum _NSSaveOperationType { + NSSaveOperation = 0, + NSSaveAsOperation = 1, + NSSaveToOperation = 2 +} NSSaveOperationType; + +@interface NSDocument : NSObject +{ + @private + NSWindow *_window; // Outlet for the single window case + NSMutableArray *_windowControllers; // WindowControllers for this document + NSString *_fileName; // Save location + NSString *_fileType; // file/document type + NSPrintInfo *_printInfo; // print info record + long _changeCount; // number of time the document has been changed + NSView *savePanelAccessory; // outlet for the accessory save-panel view + NSPopUpButton *spaButton; // outlet for "the File Format:" button in the save panel. + int _documentIndex; // Untitled index + NSUndoManager *_undoManager; // Undo manager for this document + struct __docFlags { + unsigned int inClose:1; + unsigned int hasUndoManager:1; + unsigned int RESERVED:30; + } _docFlags; + void *_reserved1; +} + +/*" Initialization "*/ +- (id)init; +- (id)initWithContentsOfFile:(NSString *)fileName ofType:(NSString *)fileType; +- (id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)fileType; + +/*" Window management "*/ +- (NSArray *)windowControllers; +- (void)addWindowController:(NSWindowController *)windowController; +- (BOOL)shouldCloseWindowController:(NSWindowController *)windowController; +- (void)showWindows; +- (void)removeWindowController:(NSWindowController *)windowController; +- (void)setWindow:(NSWindow *)aWindow; + +/*" Window controller creation "*/ +- (void)makeWindowControllers; // Manual creation +- (NSString *)windowNibName; // Automatic creation (Document will be the nib owner) + +/*" Window loading notifications "*/ +// Only called if the document is the owner of the nib +- (void)windowControllerWillLoadNib:(NSWindowController *)windowController; +- (void)windowControllerDidLoadNib:(NSWindowController *)windowController; + +/*" Edited flag "*/ +- (BOOL)isDocumentEdited; +- (void)updateChangeCount:(NSDocumentChangeType)change; + +/*" Display Name (window title) "*/ +- (NSString *)displayName; + +/*" Backup file "*/ +- (BOOL)keepBackupFile; + +/*" Closing "*/ +- (void)close; +- (BOOL)canCloseDocument; + +/*" Type and location "*/ +- (NSString *)fileName; +- (void)setFileName:(NSString *)fileName; +- (NSString *)fileType; +- (void)setFileType:(NSString *)type; ++ (NSArray *)readableTypes; ++ (NSArray *)writableTypes; ++ (BOOL)isNativeType:(NSString *)type; + +/*" Read/Write/Revert "*/ + +- (NSData *)dataRepresentationOfType:(NSString *)type; +- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type; + +- (NSFileWrapper *)fileWrapperRepresentationOfType:(NSString *)type; +- (BOOL)loadFileWrapperRepresentation:(NSFileWrapper *)wrapper + ofType:(NSString *)type; + +- (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type; +- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type; +- (BOOL)revertToSavedFromFile:(NSString *)fileName ofType:(NSString *)type; + +- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type; +- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)type; +- (BOOL)revertToSavedFromURL:(NSURL *)url ofType:(NSString *)type; + +/*" Save panel "*/ +- (BOOL)shouldRunSavePanelWithAccessoryView; +- (NSString *)fileNameFromRunningSavePanelForSaveOperation:(NSSaveOperationType)saveOperation; +- (int)runModalSavePanel:(NSSavePanel *)savePanel withAccessoryView:(NSView *)accessoryView; +- (NSString *)fileTypeFromLastRunSavePanel; +- (NSDictionary *)fileAttributesToWriteToFile: (NSString *)fullDocumentPath + ofType: (NSString *)docType + saveOperation: (NSSaveOperationType)saveOperationType; +- (BOOL)writeToFile:(NSString *)fileName + ofType:(NSString *)type + originalFile:(NSString *)origFileName + saveOperation:(NSSaveOperationType)saveOp; +- (BOOL)writeWithBackupToFile:(NSString *)fileName + ofType:(NSString *)fileType + saveOperation:(NSSaveOperationType)saveOp; + +/*" Printing "*/ +- (NSPrintInfo *)printInfo; +- (void)setPrintInfo:(NSPrintInfo *)printInfo; +- (BOOL)shouldChangePrintInfo:(NSPrintInfo *)newPrintInfo; +- (IBAction)runPageLayout:(id)sender; +- (int)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo; +- (IBAction)printDocument:(id)sender; +- (void)printShowingPrintPanel:(BOOL)flag; + +/*" IB Actions "*/ +- (IBAction)saveDocument:(id)sender; +- (IBAction)saveDocumentAs:(id)sender; +- (IBAction)saveDocumentTo:(id)sender; +- (IBAction)revertDocumentToSaved:(id)sender; + +/*" Menus "*/ +- (BOOL)validateMenuItem:(NSMenuItem *)anItem; +- (BOOL)validateUserInterfaceItem:(id )anItem; + +/*" Undo "*/ +- (NSUndoManager *)undoManager; +- (void)setUndoManager:(NSUndoManager *)undoManager; +- (BOOL)hasUndoManager; +- (void)setHasUndoManager:(BOOL)flag; + +/* NEW delegate operations*/ +- (void)shouldCloseWindowController:(NSWindowController *)windowController + delegate:(id)delegate + shouldCloseSelector:(SEL)callback + contextInfo:(void *)contextInfo; +- (void)canCloseDocumentWithDelegate:(id)delegate + shouldCloseSelector:(SEL)shouldCloseSelector + contextInfo:(void *)contextInfo; +- (void)saveToFile:(NSString *)fileName + saveOperation:(NSSaveOperationType)saveOperation + delegate:(id)delegate + didSaveSelector:(SEL)didSaveSelector + contextInfo:(void *)contextInfo; +- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel; +- (void)saveDocumentWithDelegate:(id)delegate + didSaveSelector:(SEL)didSaveSelector + contextInfo:(void *)contextInfo; +- (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation + delegate:(id)delegate + didSaveSelector:(SEL)didSaveSelector + contextInfo:(void *)contextInfo; + +@end + +#endif // _GNUstep_H_NSDocument diff --git a/Headers/AppKit/NSDocumentController.h b/Headers/AppKit/NSDocumentController.h new file mode 100644 index 000000000..7f68feec2 --- /dev/null +++ b/Headers/AppKit/NSDocumentController.h @@ -0,0 +1,125 @@ +/* + NSDocumentController.h + + The document controller class + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Carl Lindberg + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSDocumentController +#define _GNUstep_H_NSDocumentController + +#ifndef STRICT_OPENSTEP + +#include +#include +#include + +@class NSArray, NSMutableArray; +@class NSURL; +@class NSMenuItem, NSOpenPanel, NSWindow; +@class NSDocument; + +@interface NSDocumentController : NSObject +{ + @private + NSMutableArray *_documents; + NSMutableArray *_recentDocuments; + struct __controllerFlags { + unsigned int shouldCreateUI:1; + unsigned int RESERVED:31; + } _controllerFlags; + NSArray *_types; // from info.plist with key NSTypes + void *_reserved1; + void *_reserved2; +} + ++ (id)sharedDocumentController; + +/*" document creation "*/ +// doesn't create the windowControllers +- (id)makeUntitledDocumentOfType:(NSString *)type; +- (id)makeDocumentWithContentsOfFile:(NSString *)fileName ofType:(NSString *)type; +// creates window controllers +- (id)openUntitledDocumentOfType:(NSString*)type display:(BOOL)display; +- (id)openDocumentWithContentsOfFile:(NSString *)fileName display:(BOOL)display; + +- (id)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(NSString *)type; +- (id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)display; + +/*" With or without UI "*/ +- (BOOL)shouldCreateUI; +- (void)setShouldCreateUI:(BOOL)flag; + +/*" Actions "*/ +- (IBAction)saveAllDocuments:(id)sender; +- (IBAction)openDocument:(id)sender; +- (IBAction)newDocument:(id)sender; +- (IBAction)clearRecentDocuments:(id)sender; + +/*" Recent Documents "*/ +- (void)noteNewRecentDocument:(NSDocument *)aDocument; +- (void)noteNewRecentDocumentURL:(NSURL *)anURL; +- (NSArray *)recentDocumentURLs; + +/*" Open panel "*/ +- (NSArray *)URLsFromRunningOpenPanel; +- (NSArray *)fileNamesFromRunningOpenPanel; +- (int)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)openableFileExtensions; + +/*" Document management "*/ +- (void)addDocument:(NSDocument *)document; +- (void)removeDocument:(NSDocument *)document; +- (BOOL)closeAllDocuments; +- (void)closeAllDocumentsWithDelegate:(id)delegate + didCloseAllSelector:(SEL)didAllCloseSelector + contextInfo:(void *)contextInfo; +- (BOOL)reviewUnsavedDocumentsWithAlertTitle:(NSString *)title cancellable:(BOOL)cancellable; +- (void)reviewUnsavedDocumentsWithAlertTitle:(NSString *)title + cancellable:(BOOL)cancellable + delegate:(id)delegate + didReviewAllSelector:(SEL)didReviewAllSelector + contextInfo:(void *)contextInfo; +- (NSArray *)documents; +- (BOOL)hasEditedDocuments; +- (id)currentDocument; +- (NSString *)currentDirectory; +- (id)documentForWindow:(NSWindow *)window; +- (id)documentForFileName:(NSString *)fileName; + + +/*" Menu validation "*/ +- (BOOL)validateMenuItem:(NSMenuItem *)anItem; +- (BOOL)validateUserInterfaceItem:(id )anItem; + +/*" Types and extensions "*/ +- (NSString *)displayNameForType:(NSString *)type; +- (NSString *)typeFromFileExtension:(NSString *)fileExtension; +- (NSArray *)fileExtensionsFromType:(NSString *)type; +- (Class)documentClassForType:(NSString *)type; + +@end + +#endif // STRICT_OPENSTEP + +#endif // _GNUstep_H_NSDocumentController + diff --git a/Headers/AppKit/NSDocumentFrameworkPrivate.h b/Headers/AppKit/NSDocumentFrameworkPrivate.h new file mode 100644 index 000000000..d352bfd9a --- /dev/null +++ b/Headers/AppKit/NSDocumentFrameworkPrivate.h @@ -0,0 +1,54 @@ +/* + NSDocumentFramworkPrivate.h + + The private methods of all the classes of the document framework + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Carl Lindberg + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSDocumentFramworkPrivate +#define _GNUstep_H_NSDocumentFramworkPrivate + +#include "NSDocumentController.h" + +@interface NSDocumentController (Private) +- (NSArray *)_editorAndViewerTypesForClass:(Class)documentClass; +- (NSArray *)_editorTypesForClass:(Class)fp12; +- (NSArray *)_exportableTypesForClass:(Class)documentClass; +@end + + +#include "NSDocument.h" + +@interface NSDocument (Private) +- (void)_removeWindowController:(NSWindowController *)controller; +- (NSWindow *)_transferWindowOwnership; +@end + + +#include "NSWindowController.h" + +@interface NSWindowController (Private) +- (void)_windowDidLoad; +@end + +#endif // _GNUstep_H_NSDocumentFramworkPrivate diff --git a/Headers/AppKit/NSDragging.h b/Headers/AppKit/NSDragging.h new file mode 100644 index 000000000..6395b7bef --- /dev/null +++ b/Headers/AppKit/NSDragging.h @@ -0,0 +1,121 @@ +/* + NSDragging.h + + Protocols for drag 'n' drop. + + Copyright (C) 1997 Free Software Foundation, Inc. + + Author: Simon Frankau + Date: 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSDragging +#define _GNUstep_H_NSDragging + +#include + +@class NSWindow; +@class NSPasteboard; +@class NSImage; + +typedef enum _NSDragOperation { + NSDragOperationNone = 0, + NSDragOperationCopy = 1, + NSDragOperationLink = 2, + NSDragOperationGeneric = 4, + NSDragOperationPrivate = 8, + NSDragOperationMove = 16, + NSDragOperationDelete = 32, + NSDragOperationAll = 63, + NSDragOperationEvery = NSDragOperationAll +} NSDragOperation; + +@protocol NSDraggingInfo + +// +// Dragging-session Information +// +- (NSWindow *)draggingDestinationWindow; +- (NSPoint)draggingLocation; +- (NSPasteboard *)draggingPasteboard; +- (int)draggingSequenceNumber; +- (id)draggingSource; +- (unsigned int)draggingSourceOperationMask; + +// +// Image Information +// +- (NSImage *)draggedImage; +- (NSPoint)draggedImageLocation; + +// +// Sliding the Image +// +- (void)slideDraggedImageTo:(NSPoint)screenPoint; + +@end + +@interface NSObject (NSDraggingDestination) + +// +// Before the Image is Released +// +- (unsigned int)draggingEntered:(id )sender; +- (unsigned int)draggingUpdated:(id )sender; +- (void)draggingExited:(id )sender; + +// +// After the Image is Released +// +- (BOOL)prepareForDragOperation:(id )sender; +- (BOOL)performDragOperation:(id )sender; +- (void)concludeDragOperation:(id )sender; + +#ifndef STRICT_OPENSTEP +- (void)draggingEnded: (id )sender; +#endif +@end + +@interface NSObject (NSDraggingSource) + +// +// Querying the Source +// +- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal; +- (BOOL)ignoreModifierKeysWhileDragging; + +// +// Informing the Source +// +- (void)draggedImage:(NSImage *)image + beganAt:(NSPoint)screenPoint; +- (void)draggedImage: (NSImage*)image + endedAt: (NSPoint)screenPoint + deposited: (BOOL)didDeposit; + +#ifndef STRICT_OPENSTEP +- (void)draggedImage: (NSImage*)image + endedAt: (NSPoint)screenPoint + operation: (NSDragOperation)operation; +- (void)draggedImage: (NSImage*)image + movedTo: (NSPoint)screenPoint; +#endif +@end + +#endif // _GNUstep_H_NSDragging diff --git a/Headers/AppKit/NSDrawer.h b/Headers/AppKit/NSDrawer.h new file mode 100644 index 000000000..750e90f22 --- /dev/null +++ b/Headers/AppKit/NSDrawer.h @@ -0,0 +1,120 @@ +/* -*-objc-*- + NSDrawer.h + + The drawer class + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Fred Kiefer + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSDrawer +#define _GNUstep_H_NSDrawer + +#include +#include + +@class NSWindow; +@class NSView; + +enum { + NSDrawerClosedState, + NSDrawerOpeningState, + NSDrawerOpenState, + NSDrawerClosingState +}; + +@interface NSDrawer : NSResponder +{ + // Attributes + id _delegate; + NSView *_contentView; + NSWindow *_parentWindow; + NSRectEdge _preferredEdge; + NSRectEdge _currentEdge; + NSSize _maxContentSize; + NSSize _minContentSize; + float _leadingOffset; + float _trailingOffset; + int _state; +} + +// Creation +- (id) initWithContentSize: (NSSize)contentSize + preferredEdge: (NSRectEdge)edge; + +// Opening and Closing +- (void) close; +- (void) close: (id)sender; +- (void) open; +- (void) open: (id)sender; +- (void) openOnEdge: (NSRectEdge)edge; +- (void) toggle: (id)sender; + +// Managing Size +- (NSSize) contentSize; +- (float) leadingOffset; +- (NSSize) maxContentSize; +- (NSSize) minContentSize; +- (void) setContentSize: (NSSize)size; +- (void) setLeadingOffset: (float)offset; +- (void) setMaxContentSize: (NSSize)size; +- (void) setMinContentSize: (NSSize)size; +- (void) setTrailingOffset: (float)offset; +- (float) trailingOffset; + +// Managing Edge +- (NSRectEdge) edge; +- (NSRectEdge) preferredEdge; +- (void) setPreferredEdge: (NSRectEdge)preferredEdge; + +// Managing Views +- (NSView *) contentView; +- (NSWindow *) parentWindow; +- (void) setContentView: (NSView *)aView; +- (void) setParentWindow: (NSWindow *)parent; + +// Delegation and State +- (id) delegate; +- (void) setDelegate: (id)anObject; +- (int) state; + +@end + +@interface NSDrawerDelegate +- (BOOL) drawerShouldClose: (NSDrawer *)sender; +- (BOOL) drawerShouldOpen: (NSDrawer *)sender; +- (NSSize) drawerWillResizeContents: (NSDrawer *)sender + toSize: (NSSize)contentSize; +- (void) drawerDidClose: (NSNotification *)notification; +- (void) drawerDidOpen: (NSNotification *)notification; +- (void) drawerWillClose: (NSNotification *)notification; +- (void) drawerWillOpen: (NSNotification *)notification; +@end + +// Notifications +APPKIT_EXPORT NSString *NSDrawerDidCloseNotification; +APPKIT_EXPORT NSString *NSDrawerDidOpenNotification; +APPKIT_EXPORT NSString *NSDrawerWillCloseNotification; +APPKIT_EXPORT NSString *NSDrawerWillOpenNotification; + +#endif // _GNUstep_H_NSDrawer + diff --git a/Headers/AppKit/NSEPSImageRep.h b/Headers/AppKit/NSEPSImageRep.h new file mode 100644 index 000000000..2dd4fb30a --- /dev/null +++ b/Headers/AppKit/NSEPSImageRep.h @@ -0,0 +1,64 @@ +/* + NSEPSImageRep.h + + EPS image representation. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSEPSImageRep +#define _GNUstep_H_NSEPSImageRep + +#include +#include + +@class NSData; + +@interface NSEPSImageRep : NSImageRep +{ + // Attributes + NSRect _bounds; + NSData *_epsData; +} + +// +// Initializing a New Instance +// ++ (id)imageRepWithData:(NSData *)epsData; +- (id)initWithData:(NSData *)epsData; + +// +// Getting Image Data +// +- (NSRect)boundingBox; +- (NSData *)EPSRepresentation; + +// +// Drawing the Image +// +- (void)prepareGState; + +@end + +#endif // _GNUstep_H_NSEPSImageRep + diff --git a/Headers/AppKit/NSEvent.h b/Headers/AppKit/NSEvent.h new file mode 100644 index 000000000..f60c507e7 --- /dev/null +++ b/Headers/AppKit/NSEvent.h @@ -0,0 +1,340 @@ +/* + NSEvent.h + + The event class + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSEvent +#define _GNUstep_H_NSEvent + +#include +#include +#include + +@class NSString; +@class NSWindow; +@class NSGraphicsContext; + +/* + * Enumerated type for events - order IS significant as ranges of values + * are used for testing for valid event types. + */ +typedef enum _NSEventType { + NSLeftMouseDown, + NSLeftMouseUp, + NSOtherMouseDown, + NSOtherMouseUp, + NSRightMouseDown, + NSRightMouseUp, + NSMouseMoved, + NSLeftMouseDragged, + NSOtherMouseDragged, + NSRightMouseDragged, + NSMouseEntered, + NSMouseExited, + NSKeyDown, + NSKeyUp, + NSFlagsChanged, + NSAppKitDefined, + NSSystemDefined, + NSApplicationDefined, + NSPeriodic, + NSCursorUpdate, + NSScrollWheel +} NSEventType; + +enum { + NSLeftMouseDownMask = (1 << NSLeftMouseDown), + NSLeftMouseUpMask = (1 << NSLeftMouseUp), + NSOtherMouseDownMask = (1 << NSOtherMouseDown), + NSOtherMouseUpMask = (1 << NSOtherMouseUp), + NSRightMouseDownMask = (1 << NSRightMouseDown), + NSRightMouseUpMask = (1 << NSRightMouseUp), + NSMouseMovedMask = (1 << NSMouseMoved), + NSLeftMouseDraggedMask = (1 << NSLeftMouseDragged), + NSOtherMouseDraggedMask = (1 << NSOtherMouseDragged), + NSRightMouseDraggedMask = (1 << NSRightMouseDragged), + NSMouseEnteredMask = (1 << NSMouseEntered), + NSMouseExitedMask = (1 << NSMouseExited), + NSKeyDownMask = (1 << NSKeyDown), + NSKeyUpMask = (1 << NSKeyUp), + NSFlagsChangedMask = (1 << NSFlagsChanged), + NSAppKitDefinedMask = (1 << NSAppKitDefined), + NSSystemDefinedMask = (1 << NSSystemDefined), + NSApplicationDefinedMask = (1 << NSApplicationDefined), + NSPeriodicMask = (1 << NSPeriodic), + NSCursorUpdateMask = (1 << NSCursorUpdate), + NSScrollWheelMask = (1 << NSScrollWheel), + NSAnyEventMask = 0xffffffff +}; + +enum { + NSAlphaShiftKeyMask = 1, + NSShiftKeyMask = 2, + NSControlKeyMask = 4, + NSAlternateKeyMask = 8, + NSCommandKeyMask = 16, + NSNumericPadKeyMask = 32, + NSHelpKeyMask = 64, + NSFunctionKeyMask = 128 +}; + +@interface NSEvent : NSObject +{ + NSEventType event_type; + NSPoint location_point; + unsigned int modifier_flags; + NSTimeInterval event_time; + int window_num; + NSGraphicsContext *event_context; + union _MB_event_data + { + struct + { + int event_num; + short click; + short button; + float pressure; + float deltaX; + float deltaY; + float deltaZ; + } mouse; + struct + { + BOOL repeat; + NSString *char_keys; + NSString *unmodified_keys; + unsigned short key_code; + } key; + struct + { + int event_num; + int tracking_num; + void *user_data; + } tracking; + struct + { + short sub_type; + int data1; + int data2; + } misc; + } event_data; +} + ++ (NSEvent*) enterExitEventWithType: (NSEventType)type + location: (NSPoint)location + modifierFlags: (unsigned int)flags + timestamp: (NSTimeInterval)time + windowNumber: (int)windowNum + context: (NSGraphicsContext*)context + eventNumber: (int)eventNum + trackingNumber: (int)trackingNum + userData: (void *)userData; + ++ (NSEvent*) keyEventWithType: (NSEventType)type + location: (NSPoint)location + modifierFlags: (unsigned int)flags + timestamp: (NSTimeInterval)time + windowNumber: (int)windowNum + context: (NSGraphicsContext*)context + characters: (NSString *)keys + charactersIgnoringModifiers: (NSString *)ukeys + isARepeat: (BOOL)repeatKey + keyCode: (unsigned short)code; + ++ (NSEvent*) mouseEventWithType: (NSEventType)type + location: (NSPoint)location + modifierFlags: (unsigned int)flags + timestamp: (NSTimeInterval)time + windowNumber: (int)windowNum + context: (NSGraphicsContext*)context + eventNumber: (int)eventNum + clickCount: (int)clickNum + pressure: (float)pressureValue; + +#ifndef NO_GNUSTEP ++ (NSEvent*) mouseEventWithType: (NSEventType)type + location: (NSPoint)location + modifierFlags: (unsigned int)flags + timestamp: (NSTimeInterval)time + windowNumber: (int)windowNum + context: (NSGraphicsContext*)context + eventNumber: (int)eventNum + clickCount: (int)clickNum + pressure: (float)pressureValue + buttonNumber: (int)buttonNum + deltaX: (float)deltaX + deltaY: (float)deltaY + deltaZ: (float)deltaZ; +#endif + ++ (NSPoint)mouseLocation; + ++ (NSEvent*) otherEventWithType: (NSEventType)type + location: (NSPoint)location + modifierFlags: (unsigned int)flags + timestamp: (NSTimeInterval)time + windowNumber: (int)windowNum + context: (NSGraphicsContext*)context + subtype: (short)subType + data1: (int)data1 + data2: (int)data2; + ++ (void) startPeriodicEventsAfterDelay: (NSTimeInterval)delaySeconds + withPeriod: (NSTimeInterval)periodSeconds; ++ (void) stopPeriodicEvents; + + +#ifndef STRICT_OPENSTEP +- (int) buttonNumber; +#endif +- (NSString *) characters; +- (NSString *) charactersIgnoringModifiers; +- (int) clickCount; +- (NSGraphicsContext*) context; +- (int) data1; +- (int) data2; +#ifndef STRICT_OPENSTEP +- (float)deltaX; +- (float)deltaY; +- (float)deltaZ; +#endif +- (int) eventNumber; +- (BOOL) isARepeat; +- (unsigned short) keyCode; +- (NSPoint) locationInWindow; +- (unsigned int) modifierFlags; +- (float) pressure; +- (short) subtype; +- (NSTimeInterval) timestamp; +- (int) trackingNumber; +- (NSEventType) type; +- (void *) userData; +- (NSWindow *) window; +- (int) windowNumber; + + +@end + +enum { + NSUpArrowFunctionKey = 0xF700, + NSDownArrowFunctionKey = 0xF701, + NSLeftArrowFunctionKey = 0xF702, + NSRightArrowFunctionKey = 0xF703, + NSF1FunctionKey = 0xF704, + NSF2FunctionKey = 0xF705, + NSF3FunctionKey = 0xF706, + NSF4FunctionKey = 0xF707, + NSF5FunctionKey = 0xF708, + NSF6FunctionKey = 0xF709, + NSF7FunctionKey = 0xF70A, + NSF8FunctionKey = 0xF70B, + NSF9FunctionKey = 0xF70C, + NSF10FunctionKey = 0xF70D, + NSF11FunctionKey = 0xF70E, + NSF12FunctionKey = 0xF70F, + NSF13FunctionKey = 0xF710, + NSF14FunctionKey = 0xF711, + NSF15FunctionKey = 0xF712, + NSF16FunctionKey = 0xF713, + NSF17FunctionKey = 0xF714, + NSF18FunctionKey = 0xF715, + NSF19FunctionKey = 0xF716, + NSF20FunctionKey = 0xF717, + NSF21FunctionKey = 0xF718, + NSF22FunctionKey = 0xF719, + NSF23FunctionKey = 0xF71A, + NSF24FunctionKey = 0xF71B, + NSF25FunctionKey = 0xF71C, + NSF26FunctionKey = 0xF71D, + NSF27FunctionKey = 0xF71E, + NSF28FunctionKey = 0xF71F, + NSF29FunctionKey = 0xF720, + NSF30FunctionKey = 0xF721, + NSF31FunctionKey = 0xF722, + NSF32FunctionKey = 0xF723, + NSF33FunctionKey = 0xF724, + NSF34FunctionKey = 0xF725, + NSF35FunctionKey = 0xF726, + NSInsertFunctionKey = 0xF727, + NSDeleteFunctionKey = 0xF728, + NSHomeFunctionKey = 0xF729, + NSBeginFunctionKey = 0xF72A, + NSEndFunctionKey = 0xF72B, + NSPageUpFunctionKey = 0xF72C, + NSPageDownFunctionKey = 0xF72D, + NSPrintScreenFunctionKey = 0xF72E, + NSScrollLockFunctionKey = 0xF72F, + NSPauseFunctionKey = 0xF730, + NSSysReqFunctionKey = 0xF731, + NSBreakFunctionKey = 0xF732, + NSResetFunctionKey = 0xF733, + NSStopFunctionKey = 0xF734, + NSMenuFunctionKey = 0xF735, + NSUserFunctionKey = 0xF736, + NSSystemFunctionKey = 0xF737, + NSPrintFunctionKey = 0xF738, + NSClearLineFunctionKey = 0xF739, + NSClearDisplayFunctionKey = 0xF73A, + NSInsertLineFunctionKey = 0xF73B, + NSDeleteLineFunctionKey = 0xF73C, + NSInsertCharFunctionKey = 0xF73D, + NSDeleteCharFunctionKey = 0xF73E, + NSPrevFunctionKey = 0xF73F, + NSNextFunctionKey = 0xF740, + NSSelectFunctionKey = 0xF741, + NSExecuteFunctionKey = 0xF742, + NSUndoFunctionKey = 0xF743, + NSRedoFunctionKey = 0xF744, + NSFindFunctionKey = 0xF745, + NSHelpFunctionKey = 0xF746, + NSModeSwitchFunctionKey = 0xF747 +}; + +/* + * Convert an Event Mask Type to a Mask + */ +unsigned int NSEventMaskFromType(NSEventType type); + +#ifndef NO_GNUSTEP +typedef enum { + GSAppKitWindowMoved = 1, + GSAppKitWindowResized, + GSAppKitWindowClose, + GSAppKitWindowMiniaturize, + GSAppKitWindowFocusIn, + GSAppKitWindowFocusOut, + GSAppKitWindowLeave, + GSAppKitWindowEnter, + GSAppKitDraggingEnter, + GSAppKitDraggingUpdate, + GSAppKitDraggingStatus, + GSAppKitDraggingExit, + GSAppKitDraggingDrop, + GSAppKitDraggingFinished +} GSAppKitSubtype; +#endif + +#endif /* _GNUstep_H_NSEvent */ diff --git a/Headers/AppKit/NSFileWrapper.h b/Headers/AppKit/NSFileWrapper.h new file mode 100644 index 000000000..9c8bd289a --- /dev/null +++ b/Headers/AppKit/NSFileWrapper.h @@ -0,0 +1,138 @@ +/* + NSFileWrapper.h + + NSFileWrapper objects hold a file's contents in dynamic memory. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Felipe A. Rodriguez + Date: Sept 1998 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSFileWrapper +#define _GNUstep_H_NSFileWrapper + +#include +#include + +@class NSImage; +@class NSString; + +typedef enum +{ + GSFileWrapperDirectoryType, + GSFileWrapperRegularFileType, + GSFileWrapperSymbolicLinkType +} GSFileWrapperType; + +@interface NSFileWrapper : NSObject +{ + NSString *_filename; + NSString *_preferredFilename; + NSMutableDictionary *_fileAttributes; + GSFileWrapperType _wrapperType; + id _wrapperData; + NSImage *_iconImage; +} + +// +// Initialization +// + +// Init instance of directory type +- (id)initDirectoryWithFileWrappers:(NSDictionary *)docs; + +// Init instance of regular file type +- (id)initRegularFileWithContents:(NSData *)data; + +// Init instance of symbolic link type +- (id)initSymbolicLinkWithDestination:(NSString *)path; + +// Init an instance from the file, directory, or symbolic link at path. +// This can create a tree of instances +- (id)initWithPath:(NSString *)path; // with a directory instance at the top + +// Init an instance from data in standard serial format. Serial format +// is the same as that used by NSText's RTFDFromRange: method. This can +// create a tree of instances with a directory instance at the top +- (id)initWithSerializedRepresentation:(NSData *)data; + +// +// General methods +// + +// write instace to disk at path. if directory type, this method is recursive +// if flag is YES, the wrapper will be updated with the name used in writing +// the file +- (BOOL)writeToFile:(NSString *)path + atomically:(BOOL)atomicFlag + updateFilenames:(BOOL)updateFilenamesFlag; + +- (NSData *)serializedRepresentation; + +- (void)setFilename:(NSString *)filename; +- (NSString *)filename; + +- (void)setPreferredFilename:(NSString *)filename; +- (NSString *)preferredFilename; + +- (void)setFileAttributes:(NSDictionary *)attributes; +- (NSDictionary *)fileAttributes; + +- (BOOL)isRegularFile; +- (BOOL)isDirectory; +- (BOOL)isSymbolicLink; + +- (void)setIcon:(NSImage *)icon; +- (NSImage *)icon; + +- (BOOL)needsToBeUpdatedFromPath:(NSString *)path; +- (BOOL)updateFromPath:(NSString *)path; + +// +// Directory type methods +// + +// these messages raise an exception when sent to non-directory type wrappers! +- (NSString *)addFileWrapper:(NSFileWrapper *)doc; +- (void)removeFileWrapper:(NSFileWrapper *)doc; +- (NSDictionary *)fileWrappers; +- (NSString *)keyForFileWrapper:(NSFileWrapper *)doc; +- (NSString *)addFileWithPath:(NSString *)path; +- (NSString *)addRegularFileWithContents:(NSData *)data + preferredFilename:(NSString *)filename; +- (NSString *)addSymbolicLinkWithDestination:(NSString *)path + preferredFilename:(NSString *)filename; + +// +// Regular file type methods +// + +- (NSData *)regularFileContents; + +// +// Symbolic link type methods +// + +- (NSString *)symbolicLinkDestination; + +@end + +#endif // _GNUstep_H_NSFileWrapper diff --git a/Headers/AppKit/NSFont.h b/Headers/AppKit/NSFont.h new file mode 100644 index 000000000..d8d2721f5 --- /dev/null +++ b/Headers/AppKit/NSFont.h @@ -0,0 +1,216 @@ +/* + NSFont.h + + The font class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Author: Ovidiu Predescu + Date: 1996, 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSFont +#define _GNUstep_H_NSFont + +#include +#include +#include +#include + +@class NSDictionary; + +typedef unsigned int NSGlyph; + +enum { + NSControlGlyph = 0x00ffffff, + GSAttachmentGlyph = 0x00fffffe, + NSNullGlyph = 0x0 +}; + + +typedef enum _NSGlyphRelation { + NSGlyphBelow, + NSGlyphAbove, +} NSGlyphRelation; + +typedef enum _NSMultibyteGlyphPacking { + NSOneByteGlyphPacking, + NSJapaneseEUCGlyphPacking, + NSAsciiWithDoubleByteEUCGlyphPacking, + NSTwoByteGlyphPacking, + NSFourByteGlyphPacking +} NSMultibyteGlyphPacking; + +APPKIT_EXPORT const float *NSFontIdentityMatrix; + +@interface NSFont : NSObject +{ + NSString *fontName; + float matrix[6]; + BOOL matrixExplicitlySet; + BOOL screenFont; + + id fontInfo; + void *_fontRef; + + /* + If this font was created with a specific "role", like user font, or + message font, and not a specific postscript name, the role will be + stored here. + */ + int role; +} + +// +// Creating a Font Object +// ++ (NSFont*) boldSystemFontOfSize: (float)fontSize; ++ (NSFont*) fontWithName: (NSString*)aFontName + matrix: (const float*)fontMatrix; ++ (NSFont*) fontWithName: (NSString*)aFontName + size: (float)fontSize; ++ (NSFont*) systemFontOfSize: (float)fontSize; ++ (NSFont*) userFixedPitchFontOfSize: (float)fontSize; ++ (NSFont*) userFontOfSize: (float)fontSize; + ++ (NSFont*) titleBarFontOfSize: (float)fontSize; ++ (NSFont*) menuFontOfSize: (float)fontSize; ++ (NSFont*) messageFontOfSize: (float)fontSize; ++ (NSFont*) paletteFontOfSize: (float)fontSize; ++ (NSFont*) toolTipsFontOfSize: (float)fontSize; ++ (NSFont*) controlContentFontOfSize: (float)fontSize; ++ (NSFont*) labelFontOfSize: (float)fontSize; + +// +// Font Sizes +// ++ (float) labelFontSize; ++ (float) smallSystemFontSize; ++ (float) systemFontSize; + +// +// Preferred Fonts +// ++ (NSArray*) preferredFontNames; ++ (void) setPreferredFontNames: (NSArray*)fontNames; + +// +// Setting the Font +// ++ (void) setUserFixedPitchFont: (NSFont*)aFont; ++ (void) setUserFont: (NSFont*)aFont; ++ (void) useFont: (NSString*)aFontName; +- (void) set; + +// +// Querying the Font +// +- (NSDictionary*) afmDictionary; +- (NSString*) afmFileContents; +- (NSRect) boundingRectForFont; +- (NSString*) displayName; +- (NSString*) familyName; +- (NSString*) fontName; +- (NSString*) encodingScheme; +- (BOOL) isFixedPitch; +- (BOOL) isBaseFont; +- (const float*) matrix; +- (float) pointSize; +- (NSFont*) printerFont; +- (NSFont*) screenFont; +- (float) ascender; +- (float) descender; +- (float) capHeight; +- (float) italicAngle; +- (NSSize) maximumAdvancement; +- (NSSize) minimumAdvancement; +- (float) underlinePosition; +- (float) underlineThickness; +- (float) xHeight; +- (float) widthOfString: (NSString*)string; +- (float) defaultLineHeightForFont; + +// +// Manipulating Glyphs +// +- (NSSize) advancementForGlyph: (NSGlyph)aGlyph; +- (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph; +- (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; +- (NSMultibyteGlyphPacking) glyphPacking; +- (NSGlyph) glyphWithName: (NSString*)glyphName; +- (NSPoint) positionOfGlyph: (NSGlyph)curGlyph + precededByGlyph: (NSGlyph)prevGlyph + isNominal: (BOOL*)nominal; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + forCharacter: (unichar)aChar + struckOverRect: (NSRect)aRect; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + struckOverGlyph: (NSGlyph)baseGlyph + metricsExist: (BOOL*)flag; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + struckOverRect: (NSRect)aRect + metricsExist: (BOOL*)flag; +- (NSPoint) positionOfGlyph: (NSGlyph)aGlyph + withRelation: (NSGlyphRelation)relation + toBaseGlyph: (NSGlyph)baseGlyph + totalAdvancement: (NSSize*)offset + metricsExist: (BOOL*)flag; +- (int) positionsForCompositeSequence: (NSGlyph*)glyphs + numberOfGlyphs: (int)numGlyphs + pointArray: (NSPoint*)points; + +- (NSStringEncoding) mostCompatibleStringEncoding; + +@end + +#ifndef STRICT_OPENSTEP +@class GSFontInfo; + +@interface NSFont (GNUstep) +- (GSFontInfo*) fontInfo; +- (void *) fontRef; +@end + +int NSConvertGlyphsToPackedGlyphs(NSGlyph*glBuf, + int count, + NSMultibyteGlyphPacking packing, + char*packedGlyphs); +#endif + +APPKIT_EXPORT NSString *NSAFMAscender; +APPKIT_EXPORT NSString *NSAFMCapHeight; +APPKIT_EXPORT NSString *NSAFMCharacterSet; +APPKIT_EXPORT NSString *NSAFMDescender; +APPKIT_EXPORT NSString *NSAFMEncodingScheme; +APPKIT_EXPORT NSString *NSAFMFamilyName; +APPKIT_EXPORT NSString *NSAFMFontName; +APPKIT_EXPORT NSString *NSAFMFormatVersion; +APPKIT_EXPORT NSString *NSAFMFullName; +APPKIT_EXPORT NSString *NSAFMItalicAngle; +APPKIT_EXPORT NSString *NSAFMMappingScheme; +APPKIT_EXPORT NSString *NSAFMNotice; +APPKIT_EXPORT NSString *NSAFMUnderlinePosition; +APPKIT_EXPORT NSString *NSAFMUnderlineThickness; +APPKIT_EXPORT NSString *NSAFMVersion; +APPKIT_EXPORT NSString *NSAFMWeight; +APPKIT_EXPORT NSString *NSAFMXHeight; + +#endif // _GNUstep_H_NSFont diff --git a/Headers/AppKit/NSFontManager.h b/Headers/AppKit/NSFontManager.h new file mode 100644 index 000000000..576a88da7 --- /dev/null +++ b/Headers/AppKit/NSFontManager.h @@ -0,0 +1,195 @@ +/* + NSFontManager.h + + Manages system and user fonts + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Modified: Fred Kiefer + Date: January 2000 + Almost complete rewrite. + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSFontManager +#define _GNUstep_H_NSFontManager + +#include + +@class NSString; +@class NSArray; + +@class NSFont; +@class NSMenu; +@class NSFontPanel; + +typedef unsigned int NSFontTraitMask; + +enum { + NSItalicFontMask = 1, + NSUnitalicFontMask = 0, //1024, + NSBoldFontMask = 2, + NSUnboldFontMask = 0, //2048, + NSNarrowFontMask = 4, + NSExpandedFontMask = 8, + NSCondensedFontMask = 16, + NSSmallCapsFontMask = 32, + NSPosterFontMask = 64, + NSCompressedFontMask = 128, + NSNonStandardCharacterSetFontMask = 256, + NSFixedPitchFontMask = 512 +}; + +typedef enum { + NSNoFontChangeAction, + NSViaPanelFontAction, + NSAddTraitFontAction, + NSRemoveTraitFontAction, + NSSizeUpFontAction, + NSSizeDownFontAction, + NSHeavierFontAction, + NSLighterFontAction, +} NSFontTag; + +@interface NSFontManager : NSObject +{ + // Attributes + id _delegate; + SEL _action; + NSFont *_selectedFont; + BOOL _multiple; + NSMenu *_fontMenu; + NSFontTag _storedTag; + NSFontTraitMask _trait; + id _fontEnumerator; +} + +// +// Managing the FontManager +// ++ (void) setFontManagerFactory: (Class)class; ++ (void) setFontPanelFactory: (Class)class; ++ (NSFontManager *)sharedFontManager; + +// +// information on available fonts +// +- (NSArray *)availableFonts; +- (NSArray *)availableFontFamilies; +- (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)fontTraitMask; +- (NSArray *)availableMembersOfFontFamily:(NSString *)family; +- (NSString *) localizedNameForFamily:(NSString *)family face:(NSString *)face; + +// +// Selecting fonts +// +- (void)setSelectedFont:(NSFont *)fontObject + isMultiple:(BOOL)flag; +- (NSFont *)selectedFont; +- (BOOL)isMultiple; +- (BOOL)sendAction; + +// +// Action methods +// +- (void)addFontTrait:(id)sender; +- (void)removeFontTrait:(id)sender; +- (void)modifyFont:(id)sender; +- (void)modifyFontViaPanel:(id)sender; + +// +//Automatic font conversion +// +- (NSFont *)convertFont:(NSFont *)fontObject; + +// +// Converting Fonts +// +- (NSFont *)convertFont:(NSFont *)fontObject + toFamily:(NSString *)family; +- (NSFont *)convertFont:(NSFont *)fontObject + toFace:(NSString *)typeface; +- (NSFont *)convertFont:(NSFont *)fontObject + toHaveTrait:(NSFontTraitMask)trait; +- (NSFont *)convertFont:(NSFont *)fontObject + toNotHaveTrait:(NSFontTraitMask)trait; +- (NSFont *)convertFont:(NSFont *)fontObject + toSize:(float)size; +- (NSFont *)convertWeight:(BOOL)upFlag + ofFont:(NSFont *)fontObject; + +// +// Getting a font +// +- (NSFont *)fontWithFamily:(NSString *)family + traits:(NSFontTraitMask)traits + weight:(int)weight + size:(float)size; +// +// Examining a font +// +- (NSFontTraitMask)traitsOfFont:(NSFont *)aFont; +- (int)weightOfFont:(NSFont *)fontObject; +- (BOOL)fontNamed:(NSString *)typeface + hasTraits:(NSFontTraitMask)fontTraitMask; + +// +// Enabling +// +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; + +// +// Font menu +// +- (NSMenu *)fontMenu:(BOOL)create; +- (void)setFontMenu:(NSMenu *)newMenu; + +// +// Font panel +// +- (NSFontPanel *)fontPanel:(BOOL)create; +- (void)orderFrontFontPanel:(id)sender; + +// +// Assigning a Delegate +// +- (id)delegate; +- (void)setDelegate:(id)anObject; + +// +// Action Methods +// +- (SEL)action; +- (void)setAction:(SEL)aSelector; + +@end + +@interface NSObject (NSFontManagerDelegate) +// +// Methods Implemented by the Delegate +// +- (BOOL)fontManager:(id)sender willIncludeFont:(NSString *)fontName; +@end + +#endif // _GNUstep_H_NSFontManager + + diff --git a/Headers/AppKit/NSFontPanel.h b/Headers/AppKit/NSFontPanel.h new file mode 100644 index 000000000..4f10ecd62 --- /dev/null +++ b/Headers/AppKit/NSFontPanel.h @@ -0,0 +1,122 @@ +/* + NSFontPanel.h + + Standard panel for selecting and previewing fonts. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSFontPanel +#define _GNUstep_H_NSFontPanel + +#include +#include + +@class NSFont; +@class NSView; +@class NSButton; +@class NSBrowser; +@class NSTextField; + +enum { + NSFPPreviewButton, + NSFPRevertButton, + NSFPSetButton, + NSFPPreviewField, + NSFPSizeField, + NSFPSizeTitle, + NSFPCurrentField, + + // GNUstep extensions + NSFPFamilyBrowser, + NSFPFaceBrowser, + NSFPSizeBrowser +}; + +@interface NSFontPanel : NSPanel +{ + // Attributes + NSFont *_panelFont; + BOOL _multiple; + BOOL _preview; + + // store currently selected information + NSMutableArray *_familyList; + NSMutableArray *_faceList; + int _family; + int _face; + NSFontTraitMask _traits; + int _weight; + // user typed string for preview area + NSString *_previewString; + + // field for display + NSView *_accessoryView; + NSView *_topView; + NSView *_bottomView; + + // sizes + NSSize _originalMinSize; + NSSize _originalSize; +} + +// +// Creating an NSFontPanel +// ++ (NSFontPanel *)sharedFontPanel; ++ (BOOL)sharedFontPanelExists; + +// +// Enabling +// +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; +- (void)reloadDefaultFontFamilies; + +// +// Updating font +// +- (void)setPanelFont:(NSFont *)fontObject + isMultiple:(BOOL)flag; + +// +// Converting +// +- (NSFont *)panelConvertFont:(NSFont *)fontObject; + +// +// Works in modal loops +// +- (BOOL)worksWhenModal; + +// +// Configuring the NSFontPanel +// +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; + +@end + +#endif // _GNUstep_H_NSFontPanel + + diff --git a/Headers/AppKit/NSForm.h b/Headers/AppKit/NSForm.h new file mode 100644 index 000000000..f2d22fc4f --- /dev/null +++ b/Headers/AppKit/NSForm.h @@ -0,0 +1,92 @@ +/* + NSForm.h + + Form class, a matrix of text fields with labels + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: March 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSForm +#define _GNUstep_H_NSForm + +#include + +@class NSFormCell; +@class NSFont; + +@interface NSForm : NSMatrix +{ + BOOL _title_width_needs_update; +} +// +// Laying Out the Form +// +- (NSFormCell*)addEntry:(NSString*)title; +- (NSFormCell*)insertEntry:(NSString*)title + atIndex:(int)index; +- (void)removeEntryAtIndex:(int)index; +- (void)setInterlineSpacing:(float)spacing; + +// +// Finding Indices +// +- (int)indexOfCellWithTag:(int)aTag; +- (int)indexOfSelectedItem; + +// +// Modifying Graphic Attributes +// +- (void)setBezeled:(BOOL)flag; +- (void)setBordered:(BOOL)flag; +- (void)setTextAlignment:(int)aMode; +- (void)setTextFont:(NSFont*)fontObject; +- (void)setTitleAlignment:(NSTextAlignment)aMode; +- (void)setTitleFont:(NSFont*)fontObject; + +// +// Getting a Cell +// +- (id)cellAtIndex:(int)index; + +// +// Displaying a Cell +// +- (void)drawCellAtIndex:(int)index; + +// +// Editing Text +// +- (void)selectTextAtIndex:(int)index; + +// +// Resizing the Form +// +- (void)setEntryWidth:(float)width; + +// Private +-(void) _setTitleWidthNeedsUpdate: (NSNotification*)notification; +@end + +APPKIT_EXPORT NSString *_NSFormCellDidChangeTitleWidthNotification; + +#endif // _GNUstep_H_NSForm diff --git a/Headers/AppKit/NSFormCell.h b/Headers/AppKit/NSFormCell.h new file mode 100644 index 000000000..da2824204 --- /dev/null +++ b/Headers/AppKit/NSFormCell.h @@ -0,0 +1,74 @@ +/* + NSFormCell.h + + The cell class for the NSForm control + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: March 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSFormCell +#define _GNUstep_H_NSFormCell + +#include + +@interface NSFormCell : NSActionCell +{ + // NB: this is the titleWidth which is effectively used -- takes in + // account all the other cells' titleWidths. + // If its value is -1, it means it must be recomputed. + float _displayedTitleWidth; + + // Think the following as a BOOL ivar + // YES if the titleWidth is automatically computed +#define _formcell_auto_title_width _cell.subclass_bool_one + NSCell* _titleCell; +} + +// +// Modifying the Title +// +- (void)setTitle:(NSString*)aString; +- (void)setTitleAlignment:(NSTextAlignment)mode; +- (void)setTitleFont:(NSFont*)fontObject; +- (void)setTitleWidth:(float)width; +- (NSString*)title; +- (NSTextAlignment)titleAlignment; +- (NSFont*)titleFont; +- (float)titleWidth; +- (float)titleWidth:(NSSize)aSize; + +#ifndef STRICT_OPENSTEP +// +// Attributed title +// +- (NSAttributedString *)attributedTitle; +- (void)setAttributedTitle:(NSAttributedString *)anAttributedString; +- (void)setTitleWithMnemonic:(NSString *)titleWithAmpersand; +#endif + +@end + + +APPKIT_EXPORT NSString *_NSFormCellDidChangeTitleWidthNotification; + +#endif // _GNUstep_H_NSFormCell diff --git a/Headers/AppKit/NSGraphics.h b/Headers/AppKit/NSGraphics.h new file mode 100644 index 000000000..6ebdf7405 --- /dev/null +++ b/Headers/AppKit/NSGraphics.h @@ -0,0 +1,248 @@ +/* + NSGraphics.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: February 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ +#ifndef __NSGraphics_h__ +#define __NSGraphics_h__ + +#include +#include + +#include +#include + +@class NSString; +@class NSColor; +@class NSGraphicsContext; + +/* + * Colorspace Names + */ +APPKIT_EXPORT NSString *NSCalibratedWhiteColorSpace; +APPKIT_EXPORT NSString *NSCalibratedBlackColorSpace; +APPKIT_EXPORT NSString *NSCalibratedRGBColorSpace; +APPKIT_EXPORT NSString *NSDeviceWhiteColorSpace; +APPKIT_EXPORT NSString *NSDeviceBlackColorSpace; +APPKIT_EXPORT NSString *NSDeviceRGBColorSpace; +APPKIT_EXPORT NSString *NSDeviceCMYKColorSpace; +APPKIT_EXPORT NSString *NSNamedColorSpace; +#ifndef STRICT_OPENSTEP +APPKIT_EXPORT NSString *NSPatternColorSpace; +#endif +APPKIT_EXPORT NSString *NSCustomColorSpace; + + +/* + * Color function APPKIT_EXPORTs + */ +APPKIT_EXPORT const NSWindowDepth _GSGrayBitValue; +APPKIT_EXPORT const NSWindowDepth _GSRGBBitValue; +APPKIT_EXPORT const NSWindowDepth _GSCMYKBitValue; +APPKIT_EXPORT const NSWindowDepth _GSCustomBitValue; +APPKIT_EXPORT const NSWindowDepth _GSNamedBitValue; +APPKIT_EXPORT const NSWindowDepth *_GSWindowDepths[7]; +APPKIT_EXPORT const NSWindowDepth NSDefaultDepth; +APPKIT_EXPORT const NSWindowDepth NSTwoBitGrayDepth; +APPKIT_EXPORT const NSWindowDepth NSEightBitGrayDepth; +APPKIT_EXPORT const NSWindowDepth NSEightBitRGBDepth; +APPKIT_EXPORT const NSWindowDepth NSTwelveBitRGBDepth; +APPKIT_EXPORT const NSWindowDepth GSSixteenBitRGBDepth; +APPKIT_EXPORT const NSWindowDepth NSTwentyFourBitRGBDepth; + +/* + * Gray Values + */ +APPKIT_EXPORT const float NSBlack; +APPKIT_EXPORT const float NSDarkGray; +APPKIT_EXPORT const float NSWhite; +APPKIT_EXPORT const float NSLightGray; +APPKIT_EXPORT const float NSGray; + +/* + * Device Dictionary Keys + */ +APPKIT_EXPORT NSString *NSDeviceResolution; +APPKIT_EXPORT NSString *NSDeviceColorSpaceName; +APPKIT_EXPORT NSString *NSDeviceBitsPerSample; +APPKIT_EXPORT NSString *NSDeviceIsScreen; +APPKIT_EXPORT NSString *NSDeviceIsPrinter; +APPKIT_EXPORT NSString *NSDeviceSize; + +/* + * Get Information About Color Space and Window Depth + */ +APPKIT_EXPORT const NSWindowDepth *NSAvailableWindowDepths(void); +APPKIT_EXPORT NSWindowDepth NSBestDepth(NSString *colorSpace, + int bitsPerSample, int bitsPerPixel, + BOOL planar, BOOL *exactMatch); +APPKIT_EXPORT int NSBitsPerPixelFromDepth(NSWindowDepth depth); +APPKIT_EXPORT int NSBitsPerSampleFromDepth(NSWindowDepth depth); +APPKIT_EXPORT NSString *NSColorSpaceFromDepth(NSWindowDepth depth); +APPKIT_EXPORT int NSNumberOfColorComponents(NSString *colorSpaceName); +APPKIT_EXPORT BOOL NSPlanarFromDepth(NSWindowDepth depth); + + +/* + * Functions for getting information about windows. + */ +APPKIT_EXPORT void NSCountWindows(int *count); +APPKIT_EXPORT void NSWindowList(int size, int list[]); + +APPKIT_EXPORT void NSEraseRect(NSRect aRect); +APPKIT_EXPORT void NSHighlightRect(NSRect aRect); +APPKIT_EXPORT void NSRectClip(NSRect aRect); +APPKIT_EXPORT void NSRectClipList(const NSRect *rects, int count); +APPKIT_EXPORT void NSRectFill(NSRect aRect); +APPKIT_EXPORT void NSRectFillList(const NSRect *rects, int count); +APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects, + const float *grays,int count); + +APPKIT_EXPORT NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect, + const NSRectEdge * sides, + const float *grays, int count); + +APPKIT_EXPORT void NSDrawButton(const NSRect aRect, const NSRect clipRect); +APPKIT_EXPORT void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect); +APPKIT_EXPORT void NSDrawGroove(const NSRect aRect, const NSRect clipRect); +APPKIT_EXPORT void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect); +APPKIT_EXPORT void NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect); + +// This is from an old version of the specification +static inline void +NSDrawBezel(const NSRect aRect, const NSRect clipRect) +{ + NSDrawGrayBezel(aRect, clipRect); +} + +APPKIT_EXPORT void NSDottedFrameRect(NSRect aRect); +APPKIT_EXPORT void NSFrameRect(const NSRect aRect); +APPKIT_EXPORT void NSFrameRectWithWidth(const NSRect aRect, float frameWidth); + +static inline NSColor* +NSReadPixel(NSPoint location) +{ + NSGraphicsContext *ctxt = GSCurrentContext(); + return (ctxt->methods->NSReadPixel_) + (ctxt, @selector(NSReadPixel:), location); +} + +APPKIT_EXPORT void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, + NSRect destRect); +APPKIT_EXPORT void NSCopyBits(int srcGstate, NSRect srcRect, + NSPoint destPoint); + +static inline void +NSDrawBitmap(NSRect rect, + int pixelsWide, + int pixelsHigh, + int bitsPerSample, + int samplesPerPixel, + int bitsPerPixel, + int bytesPerRow, + BOOL isPlanar, + BOOL hasAlpha, + NSString *colorSpaceName, + const unsigned char *const data[5]) +{ + NSGraphicsContext *ctxt = GSCurrentContext(); + (ctxt->methods->NSDrawBitmap___________) + (ctxt, @selector(NSDrawBitmap:::::::::::), rect, + pixelsWide, + pixelsHigh, + bitsPerSample, + samplesPerPixel, + bitsPerPixel, + bytesPerRow, + isPlanar, + hasAlpha, + colorSpaceName, + data); + } + +static inline void +NSBeep(void) +{ + NSGraphicsContext *ctxt = GSCurrentContext(); + (ctxt->methods->NSBeep) + (ctxt, @selector(NSBeep)); +} + +static inline void +GSWSetViewIsFlipped(NSGraphicsContext *ctxt, BOOL flipped) +{ + (ctxt->methods->GSWSetViewIsFlipped_) + (ctxt, @selector(GSWSetViewIsFlipped:), flipped); +} + +static inline BOOL +GSWViewIsFlipped(NSGraphicsContext *ctxt) +{ + return (ctxt->methods->GSWViewIsFlipped) + (ctxt, @selector(GSWViewIsFlipped)); +} + +#ifndef NO_GNUSTEP +@class NSArray; +@class NSWindow; + +APPKIT_EXPORT NSArray* GSAllWindows(void); +APPKIT_EXPORT NSWindow* GSWindowWithNumber(int num); +#endif + +#ifndef STRICT_OPENSTEP +// Window operations +APPKIT_EXPORT void NSConvertGlobalToWindowNumber(int globalNum, unsigned int *winNum); +APPKIT_EXPORT void NSConvertWindowNumberToGlobal(int winNum, unsigned int *globalNum); + +// Rectangle drawing +APPKIT_EXPORT NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, + const NSRectEdge *sides, + NSColor **colors, + int count); +APPKIT_EXPORT void NSDrawDarkBezel(NSRect aRect, NSRect clipRect); +APPKIT_EXPORT void NSDrawLightBezel(NSRect aRect, NSRect clipRect); +APPKIT_EXPORT void NSRectFillListWithColors(const NSRect *rects, + NSColor **colors, int count); + +APPKIT_EXPORT void NSRectFillUsingOperation(NSRect aRect, + NSCompositingOperation op); +APPKIT_EXPORT void NSRectFillListUsingOperation(const NSRect *rects, + int count, + NSCompositingOperation op); +APPKIT_EXPORT void NSRectFillListWithColorsUsingOperation(const NSRect *rects, + NSColor **colors, + int num, + NSCompositingOperation op); + +APPKIT_EXPORT void NSDrawWindowBackground(NSRect aRect); + +// Context information +APPKIT_EXPORT void NSCountWindowsForContext(int context, int *count); +APPKIT_EXPORT void NSWindowListForContext(int context, int size, int list[][]); +APPKIT_EXPORT int NSGetWindowServerMemory(int context, int *virtualMemory, + int *windowBackingMemory, + NSString **windowDumpStream); + +#endif + +#endif /* __NSGraphics_h__ */ diff --git a/Headers/AppKit/NSGraphicsContext.h b/Headers/AppKit/NSGraphicsContext.h new file mode 100644 index 000000000..fe8805848 --- /dev/null +++ b/Headers/AppKit/NSGraphicsContext.h @@ -0,0 +1,413 @@ +/** NSGraphicsContext + + Abstract drawing context class. + + Copyright (C) 1998,1999 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: Feb 1999 + Based on code by: Adam Fedor + Date: Nov 1998 + + This file is part of the GNU Objective C User interface library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _NSGraphicsContext_h_INCLUDE +#define _NSGraphicsContext_h_INCLUDE + +#include +#include + +#include + +@class NSDate; +@class NSDictionary; +@class NSMutableArray; +@class NSMutableData; +@class NSMutableSet; +@class NSString; +@class NSView; +@class NSWindow; +@class NSFont; +@class NSSet; + +/* + * Backing Store Types + */ +typedef enum _NSBackingStoreType +{ + NSBackingStoreRetained, + NSBackingStoreNonretained, + NSBackingStoreBuffered + +} NSBackingStoreType; + +/* + * Compositing operators + */ +typedef enum _NSCompositingOperation +{ + NSCompositeClear, + NSCompositeCopy, + NSCompositeSourceOver, + NSCompositeSourceIn, + NSCompositeSourceOut, + NSCompositeSourceAtop, + NSCompositeDestinationOver, + NSCompositeDestinationIn, + NSCompositeDestinationOut, + NSCompositeDestinationAtop, + NSCompositeXOR, + NSCompositePlusDarker, + NSCompositeHighlight, + NSCompositePlusLighter + +} NSCompositingOperation; + +typedef int NSWindowDepth; + +/* Image interpolation */ +typedef enum _NSImageInterpolation +{ + NSImageInterpolationDefault, + NSImageInterpolationNone, + NSImageInterpolationLow, + NSImageInterpolationHigh +} NSImageInterpolation; + + +/* + * The following graphics context stuff is needed by inline functions, + * so it must always be available even when STRICT_OPENSTEP is defined. + */ + + +typedef enum _GSTextDrawingMode +{ + GSTextFill, + GSTextStroke, + GSTextClip +} GSTextDrawingMode; + +// We have to load this after the NSCompositingOperation are defined!!! +#include + +/* + * Window ordering + */ +typedef enum _NSWindowOrderingMode +{ + NSWindowAbove, + NSWindowBelow, + NSWindowOut + +} NSWindowOrderingMode; + +/* + * Window input state + */ +typedef enum _GSWindowInputState +{ + GSTitleBarKey = 0, + GSTitleBarNormal = 1, + GSTitleBarMain = 2 + +} GSWindowInputState; + +/* Color spaces */ +typedef enum _GSColorSpace +{ + GSDeviceGray, + GSDeviceRGB, + GSDeviceCMYK, + GSCalibratedGray, + GSCalibratedRGB, + GSCIELab, + GSICC +} GSColorSpace; + +@interface NSGraphicsContext : NSObject +{ + /* Make the one public instance variable first in the object so that, if we + * add or remove others, we don't necessarily need to recompile everything. + */ +@public + const gsMethodTable *methods; + +@protected + NSDictionary *context_info; + NSMutableData *context_data; + NSMutableArray *focus_stack; + NSMutableSet *usedFonts; + NSImageInterpolation _interp; + BOOL _antialias; +} + ++ (BOOL) currentContextDrawingToScreen; ++ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes; ++ (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow; + ++ (void) restoreGraphicsState; ++ (void) saveGraphicsState; ++ (void) setGraphicsState: (int)graphicsState; ++ (void) setCurrentContext: (NSGraphicsContext*)context; ++ (NSGraphicsContext*) currentContext; + +- (NSDictionary *) attributes; +- (void *) graphicsPort; + +- (BOOL) isDrawingToScreen; +- (void) flushGraphics; +- (void) restoreGraphicsState; +- (void) saveGraphicsState; + +- (void *) focusStack; +- (void) setFocusStack: (void *)stack; + +- (void) setImageInterpolation: (NSImageInterpolation)interpolation; +- (NSImageInterpolation) imageInterpolation; +- (void) setShouldAntialias: (BOOL)antialias; +- (BOOL) shouldAntialias; + +@end + +APPKIT_EXPORT NSGraphicsContext *GSCurrentContext(void); + +#ifndef NO_GNUSTEP + +@interface NSGraphicsContext (GNUstep) ++ (void) setDefaultContextClass: (Class)defaultContextClass; + +- (id) initWithContextInfo: (NSDictionary*)info; + +/* + * Focus management methods - lock and unlock should only be used by NSView + * in it's implementation of lockFocus and unlockFocus. + */ +- (NSView*) focusView; +- (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect; +- (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush; + +/* Private methods for printing */ +- (void) useFont: (NSString *)fontName; +- (void) resetUsedFonts; +- (NSSet *) usedFonts; + +/* Private backend methods */ ++ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver; +@end +#endif + + +/* + * GNUstep drawing engine extensions - these are the methods actually + * called when one of the inline PostScript functions (like PSlineto()) + * is called. + */ +@interface NSGraphicsContext (Ops) +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPScurrentalpha: (float*)a; +- (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k; +- (void) DPScurrentgray: (float*)gray; +- (void) DPScurrenthsbcolor: (float*)h : (float*)s : (float*)b; +- (void) DPScurrentrgbcolor: (float*)r : (float*)g : (float*)b; +- (void) DPSsetalpha: (float)a; +- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k; +- (void) DPSsetgray: (float)gray; +- (void) DPSsethsbcolor: (float)h : (float)s : (float)b; +- (void) DPSsetrgbcolor: (float)r : (float)g : (float)b; + +- (void) GSSetFillColorspace: (void *)spaceref; +- (void) GSSetStrokeColorspace: (void *)spaceref; +- (void) GSSetFillColor: (const float *)values; +- (void) GSSetStrokeColor: (const float *)values; + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPSashow: (float)x : (float)y : (const char*)s; +- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay + : (const char*)s; +- (void) DPScharpath: (const char*)s : (int)b; +- (void) DPSshow: (const char*)s; +- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s; +- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size; +- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size; +- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size; + +- (void) GSSetCharacterSpacing: (float)extra; +- (void) GSSetFont: (void *)fontref; +- (void) GSSetFontSize: (float)size; +- (NSAffineTransform *) GSGetTextCTM; +- (NSPoint) GSGetTextPosition; +- (void) GSSetTextCTM: (NSAffineTransform *)ctm; +- (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode; +- (void) GSSetTextPosition: (NSPoint)loc; +- (void) GSShowText: (const char *)string : (size_t) length; +- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length; + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ +- (void) DPSgrestore; +- (void) DPSgsave; +- (void) DPSinitgraphics; +- (void) DPSsetgstate: (int)gst; + +- (int) GSDefineGState; +- (void) GSUndefineGState: (int)gst; +- (void) GSReplaceGState: (int)gst; + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPScurrentflat: (float*)flatness; +- (void) DPScurrentlinecap: (int*)linecap; +- (void) DPScurrentlinejoin: (int*)linejoin; +- (void) DPScurrentlinewidth: (float*)width; +- (void) DPScurrentmiterlimit: (float*)limit; +- (void) DPScurrentpoint: (float*)x : (float*)y; +- (void) DPScurrentstrokeadjust: (int*)b; +- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset; +- (void) DPSsetflat: (float)flatness; +- (void) DPSsethalftonephase: (float)x : (float)y; +- (void) DPSsetlinecap: (int)linecap; +- (void) DPSsetlinejoin: (int)linejoin; +- (void) DPSsetlinewidth: (float)width; +- (void) DPSsetmiterlimit: (float)limit; +- (void) DPSsetstrokeadjust: (int)b; + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPSconcat: (const float*)m; +- (void) DPSinitmatrix; +- (void) DPSrotate: (float)angle; +- (void) DPSscale: (float)x : (float)y; +- (void) DPStranslate: (float)x : (float)y; + +- (NSAffineTransform *) GSCurrentCTM; +- (void) GSSetCTM: (NSAffineTransform *)ctm; +- (void) GSConcatCTM: (NSAffineTransform *)ctm; + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1 + : (float)angle2; +- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1 + : (float)angle2; +- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r; +- (void) DPSclip; +- (void) DPSclosepath; +- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 + : (float)x3 : (float)y3; +- (void) DPSeoclip; +- (void) DPSeofill; +- (void) DPSfill; +- (void) DPSflattenpath; +- (void) DPSinitclip; +- (void) DPSlineto: (float)x : (float)y; +- (void) DPSmoveto: (float)x : (float)y; +- (void) DPSnewpath; +- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury; +- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 + : (float)x3 : (float)y3; +- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h; +- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h; +- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h; +- (void) DPSreversepath; +- (void) DPSrlineto: (float)x : (float)y; +- (void) DPSrmoveto: (float)x : (float)y; +- (void) DPSstroke; +- (void) DPSshfill: (NSDictionary *)shaderDictionary; + +- (void) GSSendBezierPath: (NSBezierPath *)path; +- (void) GSRectClipList: (const NSRect *)rects : (int) count; +- (void) GSRectFillList: (const NSRect *)rects : (int) count; + +/* ----------------------------------------------------------------------- */ +/* Window system ops */ +/* ----------------------------------------------------------------------- */ +- (void) GSCurrentDevice: (void**)device : (int*)x : (int*)y; +- (void) GSSetDevice: (void*)device : (int)x : (int)y; +- (void) DPScurrentoffset: (int*)x : (int*)y; +- (void) DPSsetoffset: (short int)x : (short int)y; + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ +- (void) DPScomposite: (float)x : (float)y : (float)w : (float)h + : (int)gstateNum : (float)dx : (float)dy : (int)op; +- (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op; +- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h + : (int)gstateNum : (float)dx : (float)dy : (float)delta; + +- (void) GSDrawImage: (NSRect)rect : (void *)imageref; + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ +- (void) DPSPrintf: (const char *)fmt : (va_list)args; +- (void) DPSWriteData: (const char *)buf : (unsigned int)count; + +@end + +/* ----------------------------------------------------------------------- */ +/* NSGraphics Ops */ +/* ----------------------------------------------------------------------- */ +@interface NSGraphicsContext (NSGraphics) +- (NSColor *) NSReadPixel: (NSPoint) location; + +/* Soon to be obsolete */ +- (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh + : (int) bitsPerSample : (int) samplesPerPixel + : (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar + : (BOOL) hasAlpha : (NSString *) colorSpaceName + : (const unsigned char *const [5]) data; + +- (void) NSBeep; + +/* Context helper wraps */ +- (void) GSWSetViewIsFlipped: (BOOL) flipped; +- (BOOL) GSWViewIsFlipped; + +@end + +/* NSGraphicContext constants */ +APPKIT_EXPORT NSString *NSGraphicsContextDestinationAttributeName; +APPKIT_EXPORT NSString *NSGraphicsContextPDFFormat; +APPKIT_EXPORT NSString *NSGraphicsContextPSFormat; +APPKIT_EXPORT NSString *NSGraphicsContextRepresentationFormatAttributeName; + +/* Colorspace constants */ +APPKIT_EXPORT NSString *GSColorSpaceName; +APPKIT_EXPORT NSString *GSColorSpaceWhitePoint; +APPKIT_EXPORT NSString *GSColorSpaceBlackPoint; +APPKIT_EXPORT NSString *GSColorSpaceGamma; +APPKIT_EXPORT NSString *GSColorSpaceMatrix; +APPKIT_EXPORT NSString *GSColorSpaceRange; +APPKIT_EXPORT NSString *GSColorSpaceComponents; +APPKIT_EXPORT NSString *GSColorSpaceProfile; +APPKIT_EXPORT NSString *GSAlternateColorSpace; +APPKIT_EXPORT NSString *GSBaseColorSpace; +APPKIT_EXPORT NSString *GSColorSpaceColorTable; + +#endif /* _NSGraphicsContext_h_INCLUDE */ + diff --git a/Headers/AppKit/NSHelpManager.h b/Headers/AppKit/NSHelpManager.h new file mode 100644 index 000000000..58e8abb43 --- /dev/null +++ b/Headers/AppKit/NSHelpManager.h @@ -0,0 +1,79 @@ +/* + NSHelpManager.m + + Description... + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Pedro Ivo Andrade Tavares + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __GNUstep_H_NSHelpManager +#define __GNUstep_H_NSHelpManager + +#include +#include +#include + +@class NSAttributedString; + +@interface NSBundle (NSHelpManager) +- (NSAttributedString*) contextHelpForKey: (NSString*) key; +@end + +@interface NSApplication (NSHelpManager) +- (void) showHelp: (id) sender; +- (void) activateContextHelpMode: (id) sender; +@end + +@interface NSHelpManager: NSObject +{ +@private + NSMapTable* contextHelpTopics; +} + +// +// Class methods +// ++ (NSHelpManager*)sharedHelpManager; + ++ (BOOL)isContextHelpModeActive; + ++ (void)setContextHelpModeActive: (BOOL) flag; + +// +// Instance methods +// +- (NSAttributedString*) contextHelpForObject: (id)object; + +- (void) removeContextHelpForObject: (id)object; + +- (void) setContextHelp: (NSAttributedString*) help withObject: (id) object; + +- (BOOL) showContextHelpForObject: (id)object locationHint: (NSPoint) point; + +@end + +// Notifications +APPKIT_EXPORT NSString* NSContextHelpModeDidActivateNotification; +APPKIT_EXPORT NSString* NSContextHelpModeDidDeactivateNotification; + +#endif // GNUstep_H_NSHelpManager diff --git a/Headers/AppKit/NSHelpPanel.h b/Headers/AppKit/NSHelpPanel.h new file mode 100644 index 000000000..14fff7ffe --- /dev/null +++ b/Headers/AppKit/NSHelpPanel.h @@ -0,0 +1,93 @@ +/* + NSHelpPanel.h + + Standard panel for showing help information + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef STRICT_MACOS_X + +#ifndef _GNUstep_H_NSHelpPanel +#define _GNUstep_H_NSHelpPanel + +#include +#include + +@class NSString; + +@interface NSApplication (NSHelpPanel) +- (void) orderFrontHelpPanel: (id)sender; +@end + +@interface NSHelpPanel : NSPanel +{ + // Attributes +} + +// +// Accessing the Help Panel +// ++ (NSHelpPanel *)sharedHelpPanel; ++ (NSHelpPanel *)sharedHelpPanelWithDirectory:(NSString *)helpDirectory; + +// +// Managing the Contents +// ++ (void)setHelpDirectory:(NSString *)helpDirectory; +- (void)addSupplement:(NSString *)helpDirectory + inPath:(NSString *)supplementPath; +- (NSString *)helpDirectory; +- (NSString *)helpFile; + +// +// Attaching Help to Objects +// ++ (void)attachHelpFile:(NSString *)filename + markerName:(NSString *)markerName + to:(id)anObject; ++ (void)detachHelpFrom:(id)anObject; + +// +// Showing Help +// +- (void)showFile:(NSString *)filename + atMarker:(NSString *)markerName; +- (BOOL)showHelpAttachedTo:(id)anObject; + +// +// Printing +// +- (void)print:(id)sender; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSHelpPanel +#endif // STRICT_MACOS_X + diff --git a/Headers/AppKit/NSImage.h b/Headers/AppKit/NSImage.h new file mode 100644 index 000000000..9923b839d --- /dev/null +++ b/Headers/AppKit/NSImage.h @@ -0,0 +1,246 @@ +/* + NSImage.h + + Load, manipulate and display images + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSImage +#define _GNUstep_H_NSImage + +#include +#include +#include + +@class NSString; +@class NSMutableArray; +@class NSData; +@class NSURL; + +@class NSPasteboard; +@class NSImageRep; +@class NSColor; +@class NSView; + +typedef enum { + NSImageCacheDefault, + NSImageCacheAlways, + NSImageCacheBySize, + NSImageCacheNever +} NSImageCacheMode; + + +@interface NSImage : NSObject +{ + // Attributes + NSString *_name; + NSString *_fileName; + NSSize _size; + struct __imageFlags { + unsigned archiveByName: 1; + unsigned scalable: 1; + unsigned dataRetained: 1; + unsigned flipDraw: 1; + unsigned sizeWasExplicitlySet: 1; + unsigned useEPSOnResolutionMismatch: 1; + unsigned colorMatchPreferred: 1; + unsigned multipleResolutionMatching: 1; + unsigned cacheSeparately: 1; + unsigned unboundedCacheDepth: 1; + unsigned syncLoad: 1; + } _flags; + NSMutableArray *_reps; + NSColor *_color; + NSView *_lockedView; + id _delegate; + NSImageCacheMode _cacheMode; +} + +// +// Initializing a New NSImage Instance +// +- (id) initByReferencingFile: (NSString*)fileName; +- (id) initWithContentsOfFile: (NSString*)fileName; +- (id) initWithData: (NSData*)data; +- (id) initWithPasteboard: (NSPasteboard*)pasteboard; +- (id) initWithSize: (NSSize)aSize; + +#ifndef STRICT_OPENSTEP +- (id)initWithBitmapHandle:(void *)bitmap; +- (id)initWithContentsOfURL:(NSURL *)anURL; +- (id)initWithIconHandle:(void *)icon; +#endif + +// +// Setting the Size of the Image +// +- (void) setSize: (NSSize)aSize; +- (NSSize) size; + +// +// Referring to Images by Name +// ++ (id) imageNamed: (NSString*)aName; +- (BOOL) setName: (NSString*)aName; +- (NSString*) name; + +// +// Specifying the Image +// +- (void) addRepresentation: (NSImageRep*)imageRep; +- (void) addRepresentations: (NSArray*)imageRepArray; +- (void) lockFocus; +- (void) lockFocusOnRepresentation: (NSImageRep*)imageRep; +- (void) unlockFocus; + +// +// Using the Image +// +- (void) compositeToPoint: (NSPoint)aPoint + operation: (NSCompositingOperation)op; +- (void) compositeToPoint: (NSPoint)aPoint + fromRect: (NSRect)aRect + operation: (NSCompositingOperation)op; +- (void) dissolveToPoint: (NSPoint)aPoint + fraction: (float)aFloat; +- (void) dissolveToPoint: (NSPoint)aPoint + fromRect: (NSRect)aRect + fraction: (float)aFloat; + +#ifndef STRICT_OPENSTEP +- (void) compositeToPoint: (NSPoint)aPoint + fromRect: (NSRect)srcRect + operation: (NSCompositingOperation)op + fraction: (float)delta; +- (void) compositeToPoint: (NSPoint)aPoint + operation: (NSCompositingOperation)op + fraction: (float)delta; +#endif + +// +// Choosing Which Image Representation to Use +// +- (void) setPrefersColorMatch: (BOOL)flag; +- (BOOL) prefersColorMatch; +- (void) setUsesEPSOnResolutionMismatch: (BOOL)flag; +- (BOOL) usesEPSOnResolutionMismatch; +- (void) setMatchesOnMultipleResolution: (BOOL)flag; +- (BOOL) matchesOnMultipleResolution; + +// +// Getting the Representations +// +- (NSImageRep*) bestRepresentationForDevice: (NSDictionary*)deviceDescription; +- (NSArray*) representations; +- (void) removeRepresentation: (NSImageRep*)imageRep; + +// +// Determining How the Image is Stored +// +- (void) setCachedSeparately: (BOOL)flag; +- (BOOL) isCachedSeparately; +- (void) setDataRetained: (BOOL)flag; +- (BOOL) isDataRetained; +- (void) setCacheDepthMatchesImageDepth: (BOOL)flag; +- (BOOL) cacheDepthMatchesImageDepth; +- (void) setCacheMode: (NSImageCacheMode)mode; +- (NSImageCacheMode) cacheMode; + +// +// Drawing +// +- (BOOL) drawRepresentation: (NSImageRep*)imageRep + inRect: (NSRect)aRect; +#ifndef STRICT_OPENSTEP +- (void) drawAtPoint: (NSPoint)point + fromRect: (NSRect)srcRect + operation: (NSCompositingOperation)op + fraction: (float)delta; +- (void) drawInRect: (NSRect)dstRect + fromRect: (NSRect)srcRect + operation: (NSCompositingOperation)op + fraction: (float)delta; +#endif + +// +// Determining How the Image is Drawn +// +- (BOOL) isValid; +- (void) setScalesWhenResized: (BOOL)flag; +- (BOOL) scalesWhenResized; +- (void) setBackgroundColor: (NSColor*)aColor; +- (NSColor*) backgroundColor; +- (void) recache; +- (void) setFlipped: (BOOL)flag; +- (BOOL) isFlipped; + +// +// Assigning a Delegate +// +- (void) setDelegate: (id)anObject; +- (id) delegate; + +// +// Producing TIFF Data for the Image +// +- (NSData*) TIFFRepresentation; +- (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)comp + factor: (float)aFloat; + +// +// Managing NSImageRep Subclasses +// ++ (NSArray*) imageUnfilteredFileTypes; ++ (NSArray*) imageUnfilteredPasteboardTypes; + +// +// Testing Image Data Sources +// ++ (BOOL) canInitWithPasteboard: (NSPasteboard*)pasteboard; ++ (NSArray*) imageFileTypes; ++ (NSArray*) imagePasteboardTypes; + +@end + + +@interface NSBundle (NSImageAdditions) + +- (NSString*) pathForImageResource: (NSString*)name; + +@end + +#ifndef NO_GNUSTEP +/* + * A formal protocol that duplicates the informal protocol for delegates. + */ +@protocol GSImageDelegateProtocol + +- (NSImage*) imageDidNotDraw: (id)sender + inRect: (NSRect)aRect; + +@end +#endif + +#endif // _GNUstep_H_NSImage + diff --git a/Headers/AppKit/NSImageCell.h b/Headers/AppKit/NSImageCell.h new file mode 100644 index 000000000..82987e515 --- /dev/null +++ b/Headers/AppKit/NSImageCell.h @@ -0,0 +1,85 @@ +/* + NSImageCell.h + + The cell class for NSImage + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Jonathan Gapen + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSImageCell +#define _GNUstep_H_NSImageCell + +#include + +typedef enum { + NSScaleProportionally = 0, // Fit propoRtionally + NSScaleToFit, // Forced fit (distort if necessary) + NSScaleNone // Don't scale (clip) +} NSImageScaling; + +typedef enum { + NSImageAlignCenter = 0, + NSImageAlignTop, + NSImageAlignTopLeft, + NSImageAlignTopRight, + NSImageAlignLeft, + NSImageAlignBottom, + NSImageAlignBottomLeft, + NSImageAlignBottomRight, + NSImageAlignRight +} NSImageAlignment; + +typedef enum { + NSImageFrameNone = 0, + NSImageFramePhoto, + NSImageFrameGrayBezel, + NSImageFrameGroove, + NSImageFrameButton +} NSImageFrameStyle; + +@interface NSImageCell : NSCell +{ + // Attributes + NSImageAlignment _imageAlignment; + NSImageFrameStyle _frameStyle; + NSImageScaling _imageScaling; + NSSize _original_image_size; +} + +// +// Aligning and scaling the image +// +- (NSImageAlignment) imageAlignment; +- (void) setImageAlignment: (NSImageAlignment)anAlignment; +- (NSImageScaling) imageScaling; +- (void) setImageScaling: (NSImageScaling)scaling; + +// +// Choosing the frame +// +- (NSImageFrameStyle) imageFrameStyle; +- (void) setImageFrameStyle: (NSImageFrameStyle)aFrameStyle; + +@end + +#endif // _GNUstep_H_NSImageCell diff --git a/Headers/AppKit/NSImageRep.h b/Headers/AppKit/NSImageRep.h new file mode 100644 index 000000000..32d775299 --- /dev/null +++ b/Headers/AppKit/NSImageRep.h @@ -0,0 +1,122 @@ +/* + NSImageRep.h + + Abstract representation of an image. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSImageRep +#define _GNUstep_H_NSImageRep + +#include +#include + +@class NSString; +@class NSArray; +@class NSData; + +@class NSPasteboard; + +enum { + NSImageRepMatchesDevice +}; + +@interface NSImageRep : NSObject +{ + // Attributes + NSString* _colorSpace; + NSSize _size; + BOOL _hasAlpha; + BOOL _isOpaque; + int _bitsPerSample; + int _pixelsWide; + int _pixelsHigh; +} + +// +// Creating an NSImageRep +// ++ (id)imageRepWithContentsOfFile:(NSString *)filename; ++ (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename; ++ (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard; ++ (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard; +#ifndef STRICT_OPENSTEP ++ (id)imageRepWithContentsOfURL:(NSURL *)anURL; ++ (NSArray *)imageRepsWithContentsOfURL:(NSURL *)anURL; +#endif + +// +// Checking Data Types +// ++ (BOOL)canInitWithData:(NSData *)data; ++ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard; ++ (NSArray *)imageFileTypes; ++ (NSArray *)imagePasteboardTypes; ++ (NSArray *)imageUnfilteredFileTypes; ++ (NSArray *)imageUnfilteredPasteboardTypes; + +// +// Setting the Size of the Image +// +- (void)setSize:(NSSize)aSize; +- (NSSize)size; + +// +// Specifying Information about the Representation +// +- (int)bitsPerSample; +- (NSString *)colorSpaceName; +- (BOOL)hasAlpha; +- (BOOL)isOpaque; +- (int)pixelsHigh; +- (int)pixelsWide; +- (void)setAlpha:(BOOL)flag; +- (void)setBitsPerSample:(int)anInt; +- (void)setColorSpaceName:(NSString *)aString; +- (void)setOpaque:(BOOL)flag; +- (void)setPixelsHigh:(int)anInt; +- (void)setPixelsWide:(int)anInt; + +// +// Drawing the Image +// +- (BOOL)draw; +- (BOOL)drawAtPoint:(NSPoint)aPoint; +- (BOOL)drawInRect:(NSRect)aRect; + +// +// Managing NSImageRep Subclasses +// ++ (Class)imageRepClassForData:(NSData *)data; ++ (Class)imageRepClassForFileType:(NSString *)type; ++ (Class)imageRepClassForPasteboardType:(NSString *)type; ++ (void)registerImageRepClass:(Class)imageRepClass; ++ (NSArray *)registeredImageRepClasses; ++ (void)unregisterImageRepClass:(Class)imageRepClass; + +@end + +APPKIT_EXPORT NSString *NSImageRepRegistryChangedNotification; + +#endif // _GNUstep_H_NSImageRep diff --git a/Headers/AppKit/NSImageView.h b/Headers/AppKit/NSImageView.h new file mode 100644 index 000000000..95ce7e814 --- /dev/null +++ b/Headers/AppKit/NSImageView.h @@ -0,0 +1,50 @@ +/* + NSImageView.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: January 1998 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSImageView +#define _GNUstep_H_NSImageView + +#include +#include + +@interface NSImageView : NSControl +{ +} + +- (NSImage *)image; +- (void)setImage:(NSImage *)image; + +- (NSImageAlignment)imageAlignment; +- (void)setImageAlignment:(NSImageAlignment)align; +- (NSImageScaling)imageScaling; +- (void)setImageScaling:(NSImageScaling)scaling; +- (NSImageFrameStyle)imageFrameStyle; +- (void)setImageFrameStyle:(NSImageFrameStyle)style; +- (void)setEditable:(BOOL)flag; +- (BOOL)isEditable; + +@end + +#endif /* _GNUstep_H_NSImageView */ diff --git a/Headers/AppKit/NSInputManager.h b/Headers/AppKit/NSInputManager.h new file mode 100644 index 000000000..191a7c627 --- /dev/null +++ b/Headers/AppKit/NSInputManager.h @@ -0,0 +1,191 @@ +/* -*-objc-*- + NSInputManager.h + + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: December 2001, February 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSInputManager +#define _GNUstep_H_NSInputManager + +#include +#include +#include +#include +#include + +@class NSInputServer; +@class NSEvent; +@class NSImage; + +@protocol NSTextInput +- (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange; +- (BOOL) hasMarkedText; +- (NSRange) markedRange; +- (NSRange) selectedRange; +- (void) unmarkText; +- (NSArray*) validAttributesForMarkedText; + + +- (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange; +- (unsigned int) characterIndexForPoint: (NSPoint)thePoint; +- (long) conversationIdentifier; +- (void) doCommandBySelector: (SEL)aSelector; +- (NSRect) firstRectForCharacterRange: (NSRange)theRange; +- (void) insertText: (id)aString; +@end + +/* The input manager understands quite sophisticated keybindings. + * + * A certain keystroke (represented by a unichar + some modifiers) can + * be bound to a selector. For example: "Control-f" = "moveForward:"; + * If you press Control-f, the selector moveForward: is invoked. + * + * A certain keystroke can be bound to an array of selectors. For + * example: "Control-k" = ("moveToBeginningOfLine:", "deleteToEndOfLine:"); + * If you press Control-k, the selector moveToBeginningOfLine: is invoked, + * immediately followed by deleteToEndOfLine:. + * + * A certain keystroke can be bound to a dictionary of other + * keybindings. For example "Control-c" = { "Control-f" = + * "openFile:"; "Control-s" = "save:"; }; + * If you press Control-c followed by Control-f, openFile: is invoked; + * if you press Control-c followed by Control-s, save: is invoked. + * + * Any keystroke which is not bound by a keybinding is basically inserted + * as it is by calling 'insertText:' of the caller. + * + * Control-g is normally bound to aborting the current keybinding + * sequence. Whenever you are confused about what the hell you have + * typed and what strange command the input manager is going to + * understand, just type Control-g to discard past pending keystrokes, + * and reset the input manager. + * + * Control-q is normally bound to literally quoting the next + * keystroke. That is, the next keystroke is *not* interpreted by the + * input manager, but rather inserted literally into the text. + */ + +@class GSKeyBindingTable; + +@interface NSInputManager: NSObject +{ + /* The current client we are working for. */ + id _currentClient; + + /* This is the basic, root set of bindings. Whenever the input + manager detects that the current client has changed, it immediately + resets the current key bindings to the root ones. If you are typing + and are confused about what's happening, pressing Control-g always + resets the bindings to the root bindings. */ + GSKeyBindingTable *_rootBindingTable; + + /* These are the bindings which will be used to interpret the next + keystroke. At the beginning, this is the same as the + _rootBindingTable. But when you type a keystroke which is the + beginning of a sequence of keystrokes producing a certain action, + then the input manager updates the _currentBindingTable to be the + table where he looks up the next keystroke you put in. + */ + GSKeyBindingTable *_currentBindingTable; + + /* When we are reading multi-keystroke bindings, we need to remember + the keystrokes we read thinking they were the beginning of a + multi-keystroke binding ... just in case it turns out that they + are not :-) */ + NSMutableArray *_pendingKeyEvents; + + /* When it is YES, the next key stroke is interpreted literally rather + than looked up using the _currentBindingTable. */ + BOOL _interpretNextKeyStrokeLiterally; + + /* Extremely special keybinding which overrides any other keybinding + in all contexts - abort - normally bound to Control-g. When we + encounter this keystroke, we abort all pending keystrokes and + reset ourselves immediately into vanilla root input state. */ + unichar _abortCharacter; + unsigned int _abortFlags; + + /* When it is YES, keystrokes containing the NSControlKeyMask as not + inserted into the text. This is so that if you press Control-x, + and that is bound to nothing, it doesn't get inserted as a strange + character into your text. */ + BOOL _insertControlKeystrokes; +} ++ (NSInputManager *) currentInputManager; + +- (id) initWithName: (NSString *)inputServerName + host: (NSString *)hostName; + +- (BOOL) handleMouseEvent: (NSEvent *)theMouseEvent; +- (void) handleKeyboardEvents: (NSArray *)eventArray + client: (id)client; +- (NSString *) language; +- (NSString *) localizedInputManagerName; +- (void) markedTextAbandoned: (id)client; +- (void) markedTextSelectionChanged: (NSRange)newSel + client: (id)client; +- (BOOL) wantsToDelayTextChangeNotifications; +- (BOOL) wantsToHandleMouseEvents; +- (BOOL) wantsToInterpretAllKeystrokes; + +/* GNUstep Extensions. */ + +/* Can be called explicitly by applications to load in application-specific + keybindings for use by a specific input manager. */ +- (void) loadBindingsFromFile: (NSString *)fullPath; + +/* Parses a key as found in a keybinding file. + key is something like 'Control-f' or 'Control-Shift-LeftArrow'. + Returns YES if the key could be parsed, NO if not. If the key + could be parsed, character will contain the unichar, and modifiers + the modifiers. */ ++ (BOOL) parseKey: (NSString *)key + intoCharacter: (unichar *)character + andModifiers: (unsigned int *)modifiers; + +/* This is used to produce a key description which can be put into a + keybinding file from an actual keystroke. The gnustep-gui never + needs this :-) since it only reads keybinding files, never writes + them, but Preferences applications might need it - they can have + the user type in the desired keystroke, then call this method to + turn the keystroke into a string which can be put in keybindings + files. Pass 0 as modifiers if you only want the name of the + keystroke, ignoring modifiers. */ ++ (NSString *) describeKeyStroke: (unichar)character + withModifiers: (unsigned int)modifiers; + +/* Methods used internally ... not really part of the public API, can change + without notice. */ + +/* Reset the internal state. Normally bound to Control-g [regardless + of context!], but also automatically done whenever the current + client changes. */ +- (void) resetInternalState; + +/* Quote the next key stroke. Normally bound to Control-q. */ +- (void) quoteNextKeyStroke; + + +@end + +#endif /* _GNUstep_H_NSInputManager */ diff --git a/Headers/AppKit/NSInputServer.h b/Headers/AppKit/NSInputServer.h new file mode 100644 index 000000000..e26c56e2a --- /dev/null +++ b/Headers/AppKit/NSInputServer.h @@ -0,0 +1,78 @@ +/* -*-objc-*- + NSInputServer.h + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Fred Kiefer + Date: August 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSInputServer +#define _GNUstep_H_NSInputServer + +#include +#include +#include + +@protocol NSInputServerMouseTracker +- (BOOL) mouseDownOnCharacterIndex: (unsigned)index + atCoordinate: (NSPoint)point + withModifier: (unsigned int)flags + client: (id)sender; +- (BOOL) mouseDraggedOnCharacterIndex: (unsigned)index + atCoordinate: (NSPoint)point + withModifier: (unsigned int)flags + client: (id)sender; +- (void) mouseUpOnCharacterIndex: (unsigned)index + atCoordinate: (NSPoint)point + withModifier: (unsigned int)flags + client: (id)sender; +@end + +@protocol NSInputServiceProvider +- (void) activeConversationChanged: (id)sender + toNewConversation: (long)newConversation; +- (void) activeConversationWillChange: (id)sender + fromOldConversation: (long)oldConversation; +- (BOOL) canBeDisabled; +- (void) doCommandBySelector: (SEL)aSelector + client: (id)sender; +- (void) inputClientBecomeActive: (id)sender; +- (void) inputClientDisabled: (id)sender; +- (void) inputClientEnabled: (id)sender; +- (void) inputClientResignActive: (id)sender; +- (void) insertText: (id)aString + client: (id)sender; +- (void) markedTextAbandoned: (id)sender; +- (void) markedTextSelectionChanged: (NSRange)newSelection + client: (id)sender; +- (void) terminate: (id)sender; +- (BOOL) wantsToDelayTextChangeNotifications; +- (BOOL) wantsToHandleMouseEvents; +- (BOOL) wantsToInterpretAllKeystrokes; +@end + +@interface NSInputServer: NSObject + +- (id) initWithDelegate: (id)aDelegate + name: (NSString *)name; +@end + +#endif //_GNUstep_H_NSInputServer diff --git a/Headers/AppKit/NSInterfaceStyle.h b/Headers/AppKit/NSInterfaceStyle.h new file mode 100644 index 000000000..e41a5fe7a --- /dev/null +++ b/Headers/AppKit/NSInterfaceStyle.h @@ -0,0 +1,60 @@ +/* + NSInterfaceStyle.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSInterfaceStyle +#define _GNUstep_H_NSInterfaceStyle + +#ifndef STRICT_OPENSTEP + +#include + +@class NSResponder; +@class NSString; + +typedef enum { + NSNoInterfaceStyle = 0, + NSNextStepInterfaceStyle = 1, + NSMacintoshInterfaceStyle = 2, + NSWindows95InterfaceStyle = 3, + +/* + * GNUstep specific. Blame: Michael Hanni. + */ + + GSWindowMakerInterfaceStyle = 4 + +} NSInterfaceStyle; + +APPKIT_EXPORT NSString *NSInterfaceStyleDefault; + +APPKIT_EXPORT NSInterfaceStyle +NSInterfaceStyleForKey(NSString *key, NSResponder *responder); + +#endif // STRICT_OPENSTEP + +#endif // _GNUstep_H_NSInterfaceStyle + + diff --git a/Headers/AppKit/NSLayoutManager.h b/Headers/AppKit/NSLayoutManager.h new file mode 100644 index 000000000..6e5451151 --- /dev/null +++ b/Headers/AppKit/NSLayoutManager.h @@ -0,0 +1,186 @@ +/* + NSLayoutManager.h + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: 2002-11 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSLayoutManager +#define _GNUstep_H_NSLayoutManager + +#include +#include + +@class NSParagraphStyle; + + +/* +GNUstep extension. +*/ +typedef enum { + GSInsertionPointMoveLeft, + GSInsertionPointMoveRight, + GSInsertionPointMoveDown, + GSInsertionPointMoveUp, +} GSInsertionPointMovementDirection; + + +@interface NSLayoutManager : GSLayoutManager +{ + /* Public for use only in the associated NSTextViews. Don't access + them directly from elsewhere. */ +@public + /* Ivars to synchronize multiple textviews */ + BOOL _isSynchronizingFlags; + BOOL _isSynchronizingDelegates; + BOOL _beganEditing; + + /* Selection */ + NSRange _selected_range; + NSRange _original_selected_range; + NSSelectionGranularity _selectionGranularity; + NSSelectionAffinity _selectionAffinity; + + /* Retained by the NSLayoutManager. NSTextView:s that change this value + should release the old value and retain the new one. It is nil originally + and will be released when the NSLayoutManager is deallocated. */ + NSMutableDictionary *_typingAttributes; +} + +/* TODO */ + +-(void) invalidateDisplayForGlyphRange: (NSRange)aRange; +-(void) invalidateDisplayForCharacterRange: (NSRange)aRange; /* not STRICT_40 ?? */ + +- (NSTextView *) firstTextView; +- (NSTextView *) textViewForBeginningOfSelection; +- (BOOL) layoutManagerOwnsFirstResponderInWindow: (NSWindow *)window; + +-(NSArray *) rulerMarkersForTextView: (NSTextView *)textView + paragraphStyle: (NSParagraphStyle *)paragraphStyle + ruler: (NSRulerView *)aRulerView; +-(NSView *) rulerAccessoryViewForTextView: (NSTextView *)textView + paragraphStyle: (NSParagraphStyle *)style + ruler: (NSRulerView *)ruler + enabled: (BOOL)isEnabled; + +-(float) hyphenationFactor; +-(void) setHyphenationFactor: (float)factor; + +@end + + +@interface NSLayoutManager (layout) + +- (void) textContainerChangedTextView: (NSTextContainer *)aContainer; + + +- (NSPoint) locationForGlyphAtIndex: (unsigned int)glyphIndex; + + +- (NSRect *) rectArrayForGlyphRange: (NSRange)glyphRange + withinSelectedGlyphRange: (NSRange)selGlyphRange + inTextContainer: (NSTextContainer *)container + rectCount: (unsigned int *)rectCount; +- (NSRect *) rectArrayForCharacterRange: (NSRange)charRange + withinSelectedCharacterRange: (NSRange)selCharRange + inTextContainer: (NSTextContainer *)container + rectCount: (unsigned int *)rectCount; + +- (NSRect) boundingRectForGlyphRange: (NSRange)glyphRange + inTextContainer: (NSTextContainer *)aTextContainer; + + +- (NSRange) glyphRangeForBoundingRect: (NSRect)bounds + inTextContainer: (NSTextContainer *)container; +- (NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect)bounds + inTextContainer: (NSTextContainer *)container; + +- (unsigned int) glyphIndexForPoint: (NSPoint)aPoint + inTextContainer: (NSTextContainer *)aTextContainer; +- (unsigned int) glyphIndexForPoint: (NSPoint)point + inTextContainer: (NSTextContainer *)container + fractionOfDistanceThroughGlyph: (float *)partialFraction; + + +/* +Returns a rectangle suitable for drawing an insertion point in if the +insertion point is placed before the given character. The character index +may be any character in the text (it will handle positions "inside" a +ligature), and (unlike other methods) it may be one past the end of the +text (ie. cindex==[[_textStorage string] length]). + +If the character isn't in the text container, returns NSZeroRect. + +GNUstep extension. +*/ +-(NSRect) insertionPointRectForCharacterIndex: (unsigned int)cindex + inTextContainer: (NSTextContainer *)textContainer; + + +/* +Insertion point movement primitive. 'from' is the character index moved from, +and 'original' is the character index originally moved from in this sequence +of moves (ie. if the user hits the down key several times, the first call +would have original==from, and subsequent calls would use the same 'original' +and the 'from' returned from the last call). + +The returned character index will always be different from 'from' unless +'from' is the "furthest" character index in the text container in the +specified direction. + +The distance is the target distance for the move (in the text container's +coordinate system). The move won't be farther than this distance unless +it's impossible to move a shorter distance. Distance 0.0 is treated +specially: the move will be the shortest possible move, and movement will +"make sense" even if the glyph/character mapping is complex at 'from' +(eg. it will move through ligatures in a sensible way). + +Note that this method does not work across text containers. 'original' and +'from' should be in the same container, and the returned index will also be +in that container. + +GNUstep extension. +*/ +-(unsigned int) characterIndexMoving: (GSInsertionPointMovementDirection)direction + fromCharacterIndex: (unsigned int)from + originalCharacterIndex: (unsigned int)original + distance: (float)distance; + +@end + + +@interface NSLayoutManager (drawing) + +-(void) drawBackgroundForGlyphRange: (NSRange)range + atPoint: (NSPoint)containerOrigin; + +-(void) drawGlyphsForGlyphRange: (NSRange)range + atPoint: (NSPoint)containerOrigin; + +/* TODO: underline */ + +@end + + +#endif + diff --git a/Headers/AppKit/NSMatrix.h b/Headers/AppKit/NSMatrix.h new file mode 100644 index 000000000..42898752e --- /dev/null +++ b/Headers/AppKit/NSMatrix.h @@ -0,0 +1,308 @@ +/* + NSMatrix.h + + Copyright (C) 1996,1997,1999 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: March 1997 + A completely rewritten version of the original source by Pascal Forget and + Scott Christley. + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSMatrix +#define _GNUstep_H_NSMatrix + +#include + +@class NSArray; +@class NSMutableArray; +@class NSNotification; + +@class NSCell; +@class NSColor; +@class NSText; +@class NSEvent; + +typedef enum _NSMatrixMode { + NSRadioModeMatrix, + NSHighlightModeMatrix, + NSListModeMatrix, + NSTrackModeMatrix +} NSMatrixMode; + +@interface NSMatrix : NSControl +{ + id **_cells; + BOOL **_selectedCells; + int _maxRows; + int _maxCols; + int _numRows; + int _numCols; + NSZone *_myZone; + Class _cellClass; + id _cellPrototype; + IMP _cellNew; + IMP _cellInit; + NSMatrixMode _mode; + NSSize _cellSize; + NSSize _intercell; + NSColor *_backgroundColor; + NSColor *_cellBackgroundColor; + id _delegate; + NSText* _textObject; + BOOL _tabKeyTraversesCells; + id _target; + SEL _action; + SEL _doubleAction; + SEL _errorAction; + id _selectedCell; + int _selectedRow; + int _selectedColumn; + BOOL _allowsEmptySelection; + BOOL _selectionByRect; + BOOL _drawsBackground; + BOOL _drawsCellBackground; + BOOL _autosizesCells; + BOOL _autoscroll; + id _reserved1; + int _dottedRow; + int _dottedColumn; +} + +/* + * Initializing the NSMatrix Class + */ ++ (Class) cellClass; ++ (void) setCellClass: (Class)classId; + +/* + * Initializing an NSMatrix Object + */ +- (id) initWithFrame: (NSRect)frameRect; +- (id) initWithFrame: (NSRect)frameRect + mode: (int)aMode + cellClass: (Class)classId + numberOfRows: (int)rowsHigh + numberOfColumns: (int)colsWide; +- (id) initWithFrame: (NSRect)frameRect + mode: (int)aMode + prototype: (NSCell *)aCell + numberOfRows: (int)rowsHigh + numberOfColumns: (int)colsWide; + +/* + * Setting the Selection Mode + */ +- (NSMatrixMode) mode; +- (void) setMode: (NSMatrixMode)aMode; + +/* + * Configuring the NSMatrix + */ +- (BOOL) allowsEmptySelection; +- (BOOL) isSelectionByRect; +- (void) setAllowsEmptySelection: (BOOL)flag; +- (void) setSelectionByRect: (BOOL)flag; + +/* + * Setting the Cell Class + */ +- (Class) cellClass; +- (id) prototype; +- (void) setCellClass: (Class)classId; +- (void) setPrototype: (NSCell *)aCell; + +/* + * Laying Out the NSMatrix + */ +- (void) addColumn; +- (void) addColumnWithCells: (NSArray *)cellArray; +- (void) addRow; +- (void) addRowWithCells: (NSArray *)cellArray; +- (NSRect) cellFrameAtRow: (int)row + column: (int)column; +- (NSSize) cellSize; +- (void) getNumberOfRows: (int *)rowCount + columns: (int *)columnCount; +- (void) insertColumn: (int)column; +- (void) insertColumn: (int)column withCells: (NSArray *)cellArray; +- (void) insertRow: (int)row; +- (void) insertRow: (int)row withCells: (NSArray *)cellArray; +- (NSSize) intercellSpacing; +- (NSCell *) makeCellAtRow: (int)row + column: (int)column; +- (void) putCell: (NSCell *)newCell + atRow: (int)row + column: (int)column; +- (void) removeColumn: (int)column; +- (void) removeRow: (int)row; +- (void) renewRows: (int)newRows + columns: (int)newColumns; +- (void) setCellSize: (NSSize)aSize; +- (void) setIntercellSpacing: (NSSize)aSize; +- (void) sortUsingFunction: (int (*)(id element1, id element2, void *userData))comparator + context: (void *)context; +- (void) sortUsingSelector: (SEL)comparator; +- (int) numberOfColumns; +- (int) numberOfRows; + +/* + * Finding Matrix Coordinates + */ +- (BOOL) getRow: (int *)row + column: (int *)column + forPoint: (NSPoint)aPoint; +- (BOOL) getRow: (int *)row + column: (int *)column + ofCell: (NSCell *)aCell; + +/* + * Modifying Individual Cells + */ +- (void) setState: (int)value + atRow: (int)row + column: (int)column; + +/* + * Selecting Cells + */ +- (void) deselectAllCells; +- (void) deselectSelectedCell; +- (void) selectAll: (id)sender; +- (void) selectCellAtRow: (int)row + column: (int)column; +- (BOOL) selectCellWithTag: (int)anInt; +- (id) selectedCell; +- (NSArray *) selectedCells; +- (int) selectedColumn; +- (int) selectedRow; +- (void) setSelectionFrom: (int)startPos + to: (int)endPos + anchor: (int)anchorPos + highlight: (BOOL)flag; + +/* + * Finding Cells + */ +- (id) cellAtRow: (int)row + column: (int)column; +- (id) cellWithTag: (int)anInt; +- (NSArray *) cells; + +/* + * Modifying Graphic Attributes + */ +- (NSColor *) backgroundColor; +- (NSColor *) cellBackgroundColor; +- (BOOL) drawsBackground; +- (BOOL) drawsCellBackground; +- (void) setBackgroundColor: (NSColor *)aColor; +- (void) setCellBackgroundColor: (NSColor *)aColor; +- (void) setDrawsBackground: (BOOL)flag; +- (void) setDrawsCellBackground: (BOOL)flag; + +/* + * Editing Text in Cells + */ +- (void) selectText: (id)sender; +- (id) selectTextAtRow: (int)row + column: (int)column; +- (void) textDidBeginEditing: (NSNotification *)aNotification; +- (void) textDidChange: (NSNotification *)aNotification; +- (void) textDidEndEditing: (NSNotification *)aNotification; +- (BOOL) textShouldBeginEditing: (NSText *)aTextObject; +- (BOOL) textShouldEndEditing: (NSText *)aTextObject; + +/* + * Setting Tab Key Behavior + */ +- (id) keyCell; +- (void) setKeyCell: (NSCell *)aCell; +- (id) nextText; +- (id) previousText; +- (void) setNextText: (id)anObject; +- (void) setPreviousText: (id)anObject; +- (BOOL) tabKeyTraversesCells; +- (void) setTabKeyTraversesCells: (BOOL)flag; + +/* + * Assigning a Delegate + */ +- (void) setDelegate: (id)anObject; +- (id) delegate; + +/* + * Resizing the Matrix and Cells + */ +- (BOOL) autosizesCells; +- (void) setAutosizesCells: (BOOL)flag; +- (void) setValidateSize: (BOOL)flag; +- (void) sizeToCells; + +/* + * Scrolling + */ +- (BOOL) isAutoscroll; +- (void) scrollCellToVisibleAtRow: (int)row + column: (int)column; +- (void) setAutoscroll: (BOOL)flag; +- (void) setScrollable: (BOOL)flag; + +/* + * Displaying + */ +- (void) drawCellAtRow: (int)row + column: (int)column; +- (void) highlightCell: (BOOL)flag + atRow: (int)row + column: (int)column; + +/* + *Target and Action + */ +- (void) setAction: (SEL)aSelector; +- (SEL) action; +- (void) setDoubleAction: (SEL)aSelector; +- (SEL) doubleAction; +- (void) setErrorAction: (SEL)aSelector; +- (SEL) errorAction; +- (BOOL) sendAction; +- (void) sendAction: (SEL)aSelector + to: (id)anObject + forAllCells: (BOOL)flag; +- (void) sendDoubleAction; +- (void) setErrorAction: (SEL)aSelector; + +/* + * Handling Event and Action Messages + */ +- (BOOL) acceptsFirstMouse: (NSEvent *)theEvent; +- (void) mouseDown: (NSEvent *)theEvent; +- (int) mouseDownFlags; +- (BOOL) performKeyEquivalent: (NSEvent *)theEvent; + +/* + * Managing the Cursor + */ +- (void) resetCursorRects; + +@end + +#endif /* _GNUstep_H_NSMatrix */ diff --git a/Headers/AppKit/NSMenu.h b/Headers/AppKit/NSMenu.h new file mode 100644 index 000000000..4dca163c4 --- /dev/null +++ b/Headers/AppKit/NSMenu.h @@ -0,0 +1,654 @@ +/* + NSMenu.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: May 1997 + A completely rewritten version of the original source by Scott Christley. + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSMenu +#define _GNUstep_H_NSMenu + +#include +#include + +#include +#include + +@class NSString; +@class NSEvent; +@class NSMatrix; +@class NSPopUpButton; +@class NSPopUpButtonCell; +@class NSView; +@class NSWindow; +@class NSMutableArray; + + +@protocol NSMenuView +/** + Set the menu that this view object will be drawing. + This method will NOT retain the menu. + In normal usage an instance of NSMenu will + use this method to supply the NSMenuView with reference + to itself. The NSMenu will retain the NSMenuView. + */ +- (void)setMenu:(NSMenu *)menu; +/** + Set the currently highlighted item. + + This is used by the NSMenu class to restore + the selected item when it is temporary set to + another item. This happens when both the regular + version and the transient version are on the screen. + + A value of -1 means that no item will be highlighted. +*/ +- (void)setHighlightedItemIndex:(int)index; +/** + Returns the currently highlighted item. Returns -1 + if no item is highlighted. +*/ +- (int)highlightedItemIndex; + +/** + This should ensure that if there is an attached + submenu this submenu will be detached. + + Detaching means that this particular menu representation + should be removed from the screen. + + It should implement a deep detach, that is, all + attached submenus of this menu should also be detached. +*/ +- (void) detachSubmenu; + +/** + This will relayout the NSMenuView. + + It should be called when the menu changes. Changes include + becoming detached, adding or removing submenu items etcetera. + + However, normally it does not need to be called directly because + Because the NSMenuView is supposed to listen to the NSMenu notifications + for the item added, removed and change notifications. + + It should be called explicitly when other changes occur, such as + becoming detached or changing the title. +*/ +- (void)update; + +/** + Hm, why is this method needed? Shouldn't this be done by + the update method? +*/ +- (void)sizeToFit; //!!! + +/** + Method used by NSMenuItemCell to draw itself correctly and nicely + lined up with the other menu items. +*/ +- (float)stateImageWidth; +/** + Method used by NSMenuItemCell to draw itself correctly and nicely + lined up with the other menu items +*/ +- (float)imageAndTitleOffset; +/** + Methos used by NSMenuItemCell to draw itself correctly and nicely + lined up with the other menu items. +*/ +- (float)imageAndTitleWidth; +/** + Methos used by NSMenuItemCell to draw itself correctly and nicely + lined up with the other menu items. +*/ +- (float)keyEquivalentOffset; +/** + Used by NSItemCell to ... +*/ +- (float)keyEquivalentWidth; + +/** + Used by the NSMenu to determine where to position a + submenu. +*/ +- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu; + +- (void)performActionWithHighlightingForItemAtIndex:(int)index; //???? + +/** +

+ This is method is responsible for handling all events while + the user is interacting with this menu. It should pass on this + call to another menurepresentation when the user moves the + mouse cursor over either a submenu or over the supermenu. +

+ The method returns when the interaction from the user with the + menu system is over. +

+ The method returns NO when the user releases the mouse button + above a submenu item and YES in all other cases. +

+

+ This return value can be used to determine if submenus should + be removed from the screen or that they are supposed to stay. +

+

+ The implementation should roughly follow the following logic: +

+ +{ + while (have not released mouse button) + { + if (mouse hovers over submenu, or supermenu) + { + if ([(menurepresentation under mouse) + trackWithEvent: the event]) + { + [self detachSubmenu]; + return YES; + } + return NO; + } + //highlight item under mouse + + if (highlighting submenu item) + { + [self attachSubmenuAtIndex:..]; + } + else + { + [self detachSubmenu]; + } + get next event. + } + + execute the menu action if applicable; + + return YES | NO depending on the situation; +} + + + Note that actual implementations tend to be more complicated because + because of all kind of useability issues. Useabilities issues to + look out for are: + + Menus that are only partly on the screen. Those need to be moved while + navigation the menu. + Submenus that are hard to reach. If the natural route to the content of a submenu + travels through other menu items you do not want to remove the submenu immediately. + + Transient menus require slightly different behaviour from the normal menus. + For example, when selecting a action from a transient menu that brings up a modal + panel you would expect the transient menu to dissappear. However in the normal + menu system you want it to stay, so you still have feedback on which menu action + triggered the modal panel. + + + +*/ +- (BOOL)trackWithEvent:(NSEvent *)event; + +@end + + + +/** +

+Menus provide the user with a list of actions and/or submenus. +Submenus themselves are full fledged menus and so a heirarchical +structure of appears. +

+

+Every application has one special menu, the so called Application menu. +This menu is always visible on the screen when the application is active. +This menu normally contains items like, info, +services, print, hide and quit. +

+

+After the info item normally some submenus follow containing +the application specific actions. +

+

+On GNUstep the content of the menu is stacked vertically as oppossed to +the Windows and Mac world, where they are stacked horizontally. +Also because the menus are not part of any normal window they can be dragged +around opened and closed independend of the application windows. +

+

+This can lead to a few menus being open simultanuously. +The collection of open menus is remembered, +when the program is started again, all the torn off menus aka +detached menus, are displayed at their last known position. +

+

+The menu behaviour is richer than in most other environments and +bear some explanation. This explanation is aimed at users of Menus but more so +at the developer of custom menus. +

+ +Application menu +There alwasy at least one menu +present and visible while the application is active. This is the application menu. +This window can never be closed. + +Attached menu + +Normally when you click in a menu +on a submenu item, the submenu is shown directly next to the menu you click in. +The submenu is now called an attached menu. It is attached to the +menu that was clicked in. + +Detached menu + +A menu is detached when it is not attached +to its parent menu. A menu can become +detached when the user drags a submenu away from its parents. +A detached window contains in its title a close button. + +Transient menu + +A transient menu is a menu that dissappears as +soon as the user stops interacting with the menus. +Typically a transient menu is created when a right mouse click appears in an +application window. The right mouse click will bring up the Application menu +at the place the user clicks. While keeping the mouse button down the +user can select items by moving around. When releasing the button, all +transient menus will be removed from the screen and the action will be executed. +

+It is important to note that it is impossible to click in transient menus. +

+
+Attached transient menu + +This is a menu that is attached and transient at the same time. + +
+ +A single NSMenu instance can be displayed zero or one times when the user is +not interaction with the menus. +When the user is interaction with the menus it can occur that the same NSMenu +is displayed in two locations at the same time. This is only possible +when one of the displayed instances is a transient menu. + +To understand how the diffent kind of menus are created lets look at some user actions: + + +The user clicks on an item which is not a submenu.
+ The item is highlighted until the action corresponding with the item is completed. + More precisely, the application highlights the menu item, performs the action, and unhighlights the item. +
+The user clicks on a submenu item which is not highlighted already
+ If the submenu is not a detached menu, the submenu will become an attached + menu to the menu that is clicked in. The item that is clicked in will + become highlighted and stays highlighted. +

+ If the submenu is a detached menu, the transient version of the submenu + will be shown +

+ +
+The user clicks on a submenu item which is highlighted
+ This means that the submenu is an attached submenu for this menu. + After clicking the submenu item will no be no longer highlighted and + the submenu will be removed from the screen. +
+The user drags over a menu item
+ The item will be highlighted, if the item is a submenu item, the submenu + will be shown as an attached submenu. This can be transient, or non transient. +
+
+ + + +
+Customizing the look of Menus +
+ +There are basically three ways of customizing the look of NSMenu + +Using custom NSMenuItemCell's. This you should do when you want to influence +the look of the items displayed in the menu. +Using custom NSMenuView. This is the class to modify if you want to change +the way the menu is layout on the screen. So if you want to stack the menu +items horizontally, you should change this class. This should be rarely needed. + +Reimplement NSMenu. This you should not do. But, if you implement +everything yourself you can achieve anything. + + + +
+Information for implementing custom NSMenuView class +
+When implementing a custom NSMenuView class it is important +to keep the following information in mind. + + + The menus (or the menu items) form a tree. Navigating through this tree +is done with the methods [NSMenu-supermenu], which returns the parent menu +of the receiver, and with [NSMenu-itemAtIndex:] which returns a +NSMenuItem on which we can call [(NSMenuItem)-submenu] for a child menu. + + The menus as displayed on the screen do NOT form a tree. +This because detached and transient menus lead to duplicate menus on the screen. + + + +The displayed menus on the screen have the following structure: + + +The ordered graph of displayed menus (note, NOT the set of NSMenus) form a collection of line graphs. +The attached menus are precisely the non root vertices in this graph. +An attached menu of a transient menu is itself a transient menu. +The collection of transient menus form connect subgraph of the menu graph. + + +*/ +@interface NSMenu : NSObject +{ + NSString *_title; + NSMutableArray *_items; + NSView* _view; + NSMenu *_superMenu; + NSMenu *_attachedMenu; + NSMutableArray *_notifications; + BOOL _changedMessagesEnabled; + BOOL _autoenable; + BOOL _needsSizing; + BOOL _is_tornoff; + + // GNUstepExtra category + NSPopUpButtonCell *_popUpButtonCell; + BOOL _transient; + +@private + NSWindow *_aWindow; + NSWindow *_bWindow; + NSMenu *_oldAttachedMenu; + int _oldHiglightedIndex; +} + +/* Controlling Allocation Zones */ ++ (void) setMenuZone: (NSZone*)zone; ++ (NSZone*) menuZone; + + +/** + * + * + */ + +- (id) initWithTitle: (NSString*)aTitle; + +/* Setting Up the Menu Commands */ +- (void) addItem: (id )newItem; +- (id ) addItemWithTitle: (NSString *)aString + action: (SEL)aSelector + keyEquivalent: (NSString *)keyEquiv; +- (void) insertItem: (id )newItem + atIndex: (int)index; +- (id ) insertItemWithTitle: (NSString *)aString + action: (SEL)aSelector + keyEquivalent: (NSString *)charCode + atIndex: (unsigned int)index; +- (void) itemChanged: (id )anObject; +- (void) removeItem: (id )anItem; +- (void) removeItemAtIndex: (int)index; + +/* Finding menu items */ +/** + * Returns an array containing all menu items in this menu. + */ +- (NSArray*) itemArray; +- (id ) itemAtIndex: (int)index; +- (id ) itemWithTag: (int)aTag; +- (id ) itemWithTitle: (NSString*)aString; +- (int) numberOfItems; + +/* Finding Indices of Menu Items */ +- (int) indexOfItem: (id )anObject; +- (int) indexOfItemWithTitle: (NSString *)aTitle; +- (int) indexOfItemWithTag: (int)aTag; +- (int) indexOfItemWithTarget: (id)anObject + andAction: (SEL)actionSelector; +- (int) indexOfItemWithRepresentedObject: (id)anObject; +- (int) indexOfItemWithSubmenu: (NSMenu *)anObject; + +/* Managing submenus */ +- (void) setSubmenu: (NSMenu*)aMenu forItem: (id )anItem; +- (void) submenuAction: (id)sender; + +/** + Returns the menu that is attached to this menu. +

+ If two instances of this menu are visible, + return the attached window of the transient version + of this menu. +

+

+ If no menu is attached return nil. +

+*/ +- (NSMenu*) attachedMenu; +/** + Returns if this menu is attached to its supermenu, + return nil if it does not have a parent menu. +

+ If two instances of this menu are visible, return + the outcome of the check for the transient version + of the menu. +

+*/ +- (BOOL) isAttached; +/** + If there are two instances of this menu visible, return NO. + Otherwise, return YES if we are a detached menu and visible. +*/ +- (BOOL) isTornOff; + +/** + Returns the position where submenu will be displayed + when it will be displayed as an attached menu of this menu. + The result is undefined when aSubmenu is not actually a submenu + of this menu. +*/ +- (NSPoint) locationForSubmenu:(NSMenu*)aSubmenu; +/** + Returns the supermenu of this menu. Return nil + if this is the application menu. +*/ +- (NSMenu*) supermenu; +/** + Set the supermenu of this menu. + TODO: add explanation if this will change remove this menu + from the old supermenu or if it does not. +*/ +- (void) setSupermenu: (NSMenu *)supermenu; + +/* Enabling and disabling menu items */ +- (BOOL) autoenablesItems; +- (void) setAutoenablesItems: (BOOL)flag; +- (void) update; + +/* Handling keyboard equivalents */ +- (BOOL) performKeyEquivalent: (NSEvent*)theEvent; + +/* Simulating Mouse Clicks */ +- (void) performActionForItemAtIndex: (int)index; + +/** + Change the title of the menu. +*/ +- (void) setTitle: (NSString*)aTitle; +/** + Returns the current title. +*/ +- (NSString*) title; + +/** + Set the View that should be used to display the menu. +

+ The default is NSMenuView, but a user can supply its + own NSView object as long as it +

+ + Inherits from NSView + Implements NSMenuView protocol + +*/ +- (void) setMenuRepresentation: (id) menuRep; +/** + Return the NSView that is used for drawing + the menu. + It is the view set with [NSMenu-setMenuRepresentation:] and + therefore it should be safe to assume it is an NSView + implementing the NSMenuView protocol. +*/ +- (id) menuRepresentation; + +/* Updating Menu Layout */ +- (void) setMenuChangedMessagesEnabled: (BOOL)flag; +- (BOOL) menuChangedMessagesEnabled; +- (void) sizeToFit; + +/* Displaying Context-Sensitive Help */ +- (void) helpRequested: (NSEvent*)event; + ++ (void) popUpContextMenu: (NSMenu*)menu + withEvent: (NSEvent*)event + forView: (NSView*)view; + +@end + + +/** + * Specifies the protocol to which an object must confirm if it is to be + * used to validate menu items (in order to implement automatic enabling + * and disabling of menu items). + */ + +@protocol NSMenuValidation +/** + *

The receiver should return YES if the menuItem is valid ... and should + * be enabled in the menu, NO if it is invalid and the user should not be + * able to select it. + *

+ *

This method is invoked automatically to determine whether menu items + * should be enabled or disabled automatically whenever [NSMenu-update] is + * invoked (usually by the applications event loop). + *

+ */ +- (BOOL) validateMenuItem: (id)menuItem; +@end + +#ifndef NO_GNUSTEP +@interface NSObject (NSMenuActionResponder) +- (BOOL) validateMenuItem: (NSMenuItem*)aMenuItem; +@end + +/** + This interface exist contains methods that are meant + for the NSMenuView. If you write your own implementation + of the NSMenuView interface you can use these methods + to popup other menus or close them. +*/ +@interface NSMenu (GNUstepExtra) + +/** + Returns YES if there is a transient version + of this menu displayed on the screen. +*/ +- (BOOL) isTransient; +/** + Returns the window in which this menu is displayed. + If there is a transient version it will return the + window in which the transient version is displayed. + If the Menu is not displayed at all the result + is meaningless. +*/ +- (NSWindow*) window; + +/* Shows the menu window on screen */ +/** + Show menu on the screen. This method can/should be used by + the menurepresentation to display a submenu on the screen. + */ +- (void) display; +/** + Display the transient version of the menu. +*/ +- (void) displayTransient; + +/** + Positions the menu according to the standard user defaults. + If the position is not found in the defaults revert to positioning + the window in the upper left corner. +*/ +- (void) setGeometry; + +/** + When the flag is YES + this method will detach the receiver from its parent and + update the menurepresentation so it will display a close + button if appropriate. + + If the flag is NO this method will update the menurepresentation + so it will be able to remove the close button if needed. + Note that it will not reattach to its parent menu. +*/ +- (void) setTornOff: (BOOL) flag; + + +/** + Remove the window from the screen. This method can/should be + used by the menurepresentation to remove a submenu from the screen. + */ +- (void) close; +/** + Remove the transient version of the window from the screen. + This method is used by NSMenuView implementations that need + to open/close transient menus. +*/ +- (void) closeTransient; + +/* Moving menus */ +- (void) nestedSetFrameOrigin: (NSPoint)aPoint; + +/* Shift partly off-screen menus */ +- (BOOL) isPartlyOffScreen; +- (void) shiftOnScreen; + +/* Popup behaviour */ +- (BOOL) _ownedByPopUp; +- (void) _setOwnedByPopUp: (NSPopUpButtonCell*)popUp; +@end +#endif + +APPKIT_EXPORT NSString* const NSMenuDidSendActionNotification; +APPKIT_EXPORT NSString* const NSMenuWillSendActionNotification; +APPKIT_EXPORT NSString* const NSMenuDidAddItemNotification; +APPKIT_EXPORT NSString* const NSMenuDidRemoveItemNotification; +APPKIT_EXPORT NSString* const NSMenuDidChangeItemNotification; + +#endif // _GNUstep_H_NSMenu diff --git a/Headers/AppKit/NSMenuItem.h b/Headers/AppKit/NSMenuItem.h new file mode 100644 index 000000000..8174cf0a8 --- /dev/null +++ b/Headers/AppKit/NSMenuItem.h @@ -0,0 +1,126 @@ +/* + NSMenuItem.h + + The menu cell protocol and the GNUstep menu cell class. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: David Lazaro Saz + Date: Sep 1999 + + Author: Ovidiu Predescu + Date: May 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSMenuItem +#define _GNUstep_H_NSMenuItem + +@class NSString; + +@class NSMenu; +@class NSImage; + +/** + * Specifies the methods that an object must implement if it is to be + * placed in a menu as a menu item. The [NSMenuItem] class provides + * a reference implementation suitable for most uses. + */ +@protocol NSMenuItem + ++ (id) separatorItem; ++ (void) setUsesUserKeyEquivalents: (BOOL)flag; ++ (BOOL) usesUserKeyEquivalents; + +- (SEL) action; +- (BOOL) hasSubmenu; +- (NSImage*) image; +- (id) initWithTitle: (NSString*)aString + action: (SEL)aSelector + keyEquivalent: (NSString*)charCode; +- (BOOL) isEnabled; +- (BOOL) isSeparatorItem; +- (NSString*) keyEquivalent; +- (unsigned int) keyEquivalentModifierMask; +- (NSMenu*) menu; +- (NSImage*) mixedStateImage; +- (NSString*) mnemonic; +- (unsigned) mnemonicLocation; +- (NSImage*) offStateImage; +- (NSImage*) onStateImage; +- (id) representedObject; +- (void) setAction: (SEL)aSelector; +- (void) setEnabled: (BOOL)flag; +- (void) setImage: (NSImage*)menuImage; +- (void) setKeyEquivalent: (NSString*)aKeyEquivalent; +- (void) setKeyEquivalentModifierMask: (unsigned int)mask; +- (void) setMenu: (NSMenu*)menu; +- (void) setMixedStateImage: (NSImage*)image; +- (void) setMnemonicLocation: (unsigned) location; +- (void) setOffStateImage: (NSImage*)image; +- (void) setOnStateImage: (NSImage*)image; +- (void) setRepresentedObject: (id)anObject; +- (void) setState: (int)state; +- (void) setSubmenu: (NSMenu*)submenu; +- (void) setTag: (int)anInt; +- (void) setTarget: (id)anObject; +- (void) setTitle: (NSString*)aString; +- (void) setTitleWithMnemonic: (NSString*)stringWithAmpersand; +- (int) state; +- (NSMenu*) submenu; +- (int) tag; +- (id) target; +- (NSString*) title; +- (unsigned int) userKeyEquivalentModifierMask; +- (NSString*) userKeyEquivalent; + +@end + +@interface NSMenuItem : NSObject +{ + NSMenu *_menu; + NSString *_title; + NSString *_keyEquivalent; + unsigned int _keyEquivalentModifierMask; + unsigned _mnemonicLocation; + int _state; + BOOL _enabled; + NSImage *_image; + NSImage *_onStateImage; + NSImage *_offStateImage; + NSImage *_mixedStateImage; + id _target; + SEL _action; + int _tag; + id _representedObject; + NSMenu *_submenu; + BOOL _changesState; +} + +@end + +#ifndef NO_GNUSTEP +@interface NSMenuItem (GNUstepExtra) +- (void) setChangesState: (BOOL)flag; +- (BOOL) changesState; +@end +#endif + +#endif // _GNUstep_H_NSMenuItem + diff --git a/Headers/AppKit/NSMenuItemCell.h b/Headers/AppKit/NSMenuItemCell.h new file mode 100644 index 000000000..79fbb6da6 --- /dev/null +++ b/Headers/AppKit/NSMenuItemCell.h @@ -0,0 +1,100 @@ +/* + NSMenuItemCell.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: June 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSMenuItemCell +#define _GNUstep_H_NSMenuItemCell + +#include +#include +#include + +@class NSMenuView; + +typedef void (*DrawingIMP)(id, SEL, NSRect, NSView*); + +@interface NSMenuItemCell : NSButtonCell +{ + NSMenuItem *_menuItem; + NSMenuView *_menuView; + + // Cache + BOOL _needs_sizing; + float _imageWidth; + float _titleWidth; + float _keyEquivalentWidth; + float _stateImageWidth; + float _menuItemHeight; + + NSImage *_imageToDisplay; + NSString *_titleToDisplay; + NSSize _imageSize; + + /* If we belong to a popupbutton, we display image on the extreme + right */ + BOOL _mcell_belongs_to_popupbutton; + +@private + NSColor *_backgroundColor; +} + +- (void)setHighlighted:(BOOL)flag; +- (BOOL)isHighlighted; + +- (void)setMenuItem:(NSMenuItem *)item; +- (NSMenuItem *)menuItem; + +- (void)setMenuView:(NSMenuView *)menuView; +- (NSMenuView *)menuView; + +- (void)calcSize; +- (void)setNeedsSizing:(BOOL)flag; +- (BOOL)needsSizing; + +- (float)imageWidth; +- (float)titleWidth; +- (float)keyEquivalentWidth; +- (float)stateImageWidth; + +- (NSRect)imageRectForBounds:(NSRect)cellFrame; +- (NSRect)keyEquivalentRectForBounds:(NSRect)cellFrame; +- (NSRect)stateImageRectForBounds:(NSRect)cellFrame; +- (NSRect)titleRectForBounds:(NSRect)cellFrame; + +- (void)drawBorderAndBackgroundWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawImageWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawKeyEquivalentWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawSeparatorItemWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawStateImageWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +- (void)drawTitleWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView; +@end + +#endif diff --git a/Headers/AppKit/NSMenuView.h b/Headers/AppKit/NSMenuView.h new file mode 100644 index 000000000..ab60e79e8 --- /dev/null +++ b/Headers/AppKit/NSMenuView.h @@ -0,0 +1,425 @@ +/* + NSMenuView.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: June 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSMenuView +#define _GNUstep_H_NSMenuView + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +@class NSColor; +@class NSPopUpButton; +@class NSFont; + +/** + The NSMenu class uses an object implementing the NSMenuView protocol to + do the actual drawing.

+ + Normally there is no good reason to write your own class implementing + this protocol. However if you want to customize your menus you should + implement this protocol to ensure that it works nicely together + with sub/super menus not using your custom menu representation. + +

+ How menus are drawn +

+ + This class implements several menu look and feels at the same time. + The looks and feels implemented are: + + + Ordinary vertically stacked menus with the NeXT submenu positioning + behavour. + + + Vertically stacked menus with the WindowMaker submenu placement. This + behaviour is selected by choosing the + GSWindowMakerInterfaceStyle. + + + PopupButtons are actually menus. This class implements also the + behaviour for the NSPopButtons. See for the the class NSPopButton. + + +*/ +@interface NSMenuView : NSView +{ + NSMutableArray *_itemCells; + BOOL _horizontal; + NSFont *_font; + int _highlightedItemIndex; + float _horizontalEdgePad; + float _stateImageOffset; + float _stateImageWidth; + float _imageAndTitleOffset; + float _imageAndTitleWidth; + float _keyEqOffset; + float _keyEqWidth; + BOOL _needsSizing; + NSSize _cellSize; + +@private + id _items_link; + int _leftBorderOffset; + id _titleView; + + /* + Private and not named '_menu' to avoid confusion and further problems + with NSResponder's menu. + */ + NSMenu *_attachedMenu; +} + +/*********************************************************************** + * Initializing a menu view + ***********************************************************************/ +/** + Creates new instance and sets menu to torn off state with + NSMenu's setTornOff:. + */ +- (id) initAsTearOff; + +/*********************************************************************** + * Getting and setting menu view attributes + ***********************************************************************/ +/** + Returns the height of the menu bar. + */ ++ (float) menuBarHeight; + +/** + Sets the menu to be displayed in to menu. Also this method adds this + menu view to the menu's list of observers, mark view to force + recalculation of layout with setNeedsSizing:YES, and updates itself + with update method. + */ +- (void) setMenu: (NSMenu *)menu; + +/** + Returns the NSMenu associated with this menu view. + */ +- (NSMenu *) menu; + +/** + Sets menu orientation. If YES menu items are displayed from left + to right, if NO from top to bottom (vertically). By default, menu + items are displayed vertically. + */ +- (void) setHorizontal: (BOOL)flag; + +/** + Returns YES if menu items are displayed horizontally, NO if + vertically. + */ +- (BOOL) isHorizontal; + +/** + Sets the default font to use when drawing the menu text. + */ +- (void) setFont: (NSFont *)font; + +/** + Returns the default font used to draw the menu text. + */ +- (NSFont *) font; + +/** + Highlights item with at index. If index is -1 all highlighing is removed. + */ +- (void) setHighlightedItemIndex: (int)index; + +/** + Returns the index of the highlighted item. Returns -1 if there is no + highlighted item. + */ +- (int) highlightedItemIndex; + +/** + Replaces item cell at index with cell. Highlighting of item is preserved. + */ +- (void) setMenuItemCell: (NSMenuItemCell *)cell + forItemAtIndex: (int)index; + +/** + Returns cell associated with item at index. + */ +- (NSMenuItemCell *) menuItemCellForItemAtIndex: (int)index; + +/** + Returns menu view associated with visible attached submenu. + */ +- (NSMenuView *) attachedMenuView; + +/** + Returns visible attached submenu. + */ +- (NSMenu *) attachedMenu; + +/** + Returns YES, if this object is an visivle attached submenu's view. + Returns NO otherwise. + */ +- (BOOL) isAttached; + +/** + Returns YES, if this object is associated with torn off menu + (menu with a close button on title bar). + */ +- (BOOL) isTornOff; + +/** + Returns horizontal space used for padding between menu item elements + (state image, title image, title, key equivalent, submenu arrow image). + */ +- (float) horizontalEdgePadding; + +/** + Sets amount of pixels added between menu item elements to pad. + */ +- (void) setHorizontalEdgePadding: (float)pad; + +/*********************************************************************** + * Notification methods + ***********************************************************************/ +/** + Marks menu item cell associated with the menu item and menu view as + needing to be resized. This method is invoked when + NSMenuDidChangeItemNotification received. The notification parameter + contains index of changed menu item and can be accessed with + NSMenuItemIndex key. + */ +- (void) itemChanged: (NSNotification *)notification; + +/** + Creates new item cell for the newly created menu item, marks cell and + menu view as needing to be resized. This method is invoked when + NSMenuDidAddItemNotification received. The notification parameter + contains index of changed menu item and can be accessed with + NSMenuItemIndex key. + + */ +- (void) itemAdded: (NSNotification *)notification; + +/** + Removes cell associated with removed menu item, removes highlighting + if removed menu item was highlighted, marks cell and menu view as + needing to be resized. This method is invoked when + NSMenuDidRemoveItemNotification received. The notification parameter + contains index of changed menu item and can be accessed with + NSMenuItemIndex key. + + */ +- (void) itemRemoved: (NSNotification *)notification; + +/*********************************************************************** + * Working with submenus + ***********************************************************************/ +/** + * Detaches currently visible submenu window from main menu. + */ +- (void) detachSubmenu; + +/** + Attach submenu if the item at index is a submenu. It will figure out + if the new submenu should be transient or not. +*/ +- (void) attachSubmenuForItemAtIndex: (int)index; + +/*********************************************************************** + * Calculating menu geometry + ***********************************************************************/ +/** + Adds title view for application menu and submenus, removes title view + if menu is owned by NSPopUpButton, adds close button to title view for + torn off menus and removes it for other type of menu. + */ +- (void) update; + +/** + Sets the flag whether layout needs to be resized. Set it to YES if + menu contents changed and layout needs to be recalculated. This method + is used internally. Yout should not invoke it directly from applications. + */ +- (void) setNeedsSizing: (BOOL)flag; + +/** + Return YES if menu view contents changed and needs to be resized. + */ +- (BOOL) needsSizing; + +/** + + */ +- (void) sizeToFit; + +/** + Returns the starting horizontal position for drawing the state image. + */ +- (float) stateImageOffset; + +/** + Returns the width of the state image. + */ +- (float) stateImageWidth; + +/** + Returns the starting horizontal position for drawing the image and title. + */ +- (float) imageAndTitleOffset; + +/** + Returns the width of the image and title section. Tis section contains + image and text of menu item. + */ +- (float) imageAndTitleWidth; + +/** + Returns the starting position for drawing the key equivalent. Key + equivalent can be submenu arrow if menu item has submenu. + */ +- (float) keyEquivalentOffset; + +/** + Returns the width of key equivalent text. Key equivalent can be submenu + arrow if menu item has submenu + */ +- (float) keyEquivalentWidth; + +/** + Returns bounds rectangle of the menu view. It is smaller by 1 pixel + in width than menu window (dark gray border at left). + */ +- (NSRect) innerRect; + +/** + Returns frame rectangle of menu item cell. It is smaller by 1 pixel + in width than menu window (dark gray border). + */ +- (NSRect) rectOfItemAtIndex: (int)index; + +/** + Returns the index of the item below point. Returns -1 if mouse is + not above a menu item. +*/ +- (int) indexOfItemAtPoint: (NSPoint)point; + +/** + Calls setNeedsDisplayInRect: for rectangle occupied by item at index. + */ +- (void) setNeedsDisplayForItemAtIndex: (int)index; + +/** + Returns the correct frame origin for aSubmenu based on the location + of the receiver. This location may depend on the current NSInterfaceStyle. +*/ +- (NSPoint) locationForSubmenu:(NSMenu *) aSubmenu; + +/** + Resize menu view frame to be appropriate in size to attach to screenRect + at preferredEdge. For popup's menu, if selectedItemIndex is other than + -1, position view so selected item covers the NSPopUpButton. + +
NOTE: preffered edge positioning doesn't implemented + yet! + */ +- (void) setWindowFrameForAttachingToRect: (NSRect)screenRect + onScreen: (NSScreen *)screen + preferredEdge: (NSRectEdge)edge + popUpSelectedItem: (int)selectedItemIndex; + +/*********************************************************************** + * Event handling + ***********************************************************************/ +- (void) performActionWithHighlightingForItemAtIndex: (int)index; + +/** + This method is responsible for tracking the mouse while this menu + is on the screen and the user is busy navigating the menu or one + of it submenus. Responsible does not mean that this method does it + all. For submenus for example it will call, indirectly, itself for + submenu under consideration. + + It will return YES if user released mouse, not above a submenu item. + NO in all other circumstances. + + Implementation detail: + + + It use periodic events to update the highlight state and + attach / detach submenus. + + The flag justAttachedNewSubmenu is set to YES when a new + submenu is attached. The effect is that the + highlighting / attaching / detaching is supressed + for this menu. This is done so the user is given + a change to move the mouse pointer into the newly + attached submenu. Otherwise it would immediately + be removed as the mouse pointer move over another + item. + + The logic for resetting the flag is rather adhoc. + + + the flag subMenusNeedRemoving means that we + will remove all the submenus after we are done. + + This flag is used to clean up the submenus + when the user has opened a submenu by clicking + and wants to close it again by clicking on the + hihglighted item. + + When the user released the mouse this method + will cleanup all the transient menus. + + Not only its own, but also its attached menu + and all its transient super menus. + + The clean up is done BEFORE the action is executed. + This is needed otherwise `hiding' the application + leaves a dangling menu. If this is not acceptable, + there should be another mechanism of handling + the hiding. BTW besides the `hiding' the application, + model panels are also a problem when the menu + is not cleared before executing the action. + + +*/ +- (BOOL) trackWithEvent: (NSEvent *)event; + +@end + +#endif diff --git a/Headers/AppKit/NSNibConnector.h b/Headers/AppKit/NSNibConnector.h new file mode 100644 index 000000000..a109d49e6 --- /dev/null +++ b/Headers/AppKit/NSNibConnector.h @@ -0,0 +1,61 @@ +/* + NSNibConnector.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Richard Frith-Macdonald + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSNibConnector +#define _GNUstep_H_NSNibConnector + +#ifndef GNUSTEP +#include +#else +#include +#endif + +@interface NSNibConnector : NSObject +{ + id _src; + id _dst; + NSString *_tag; +} + +- (id) destination; +- (void) establishConnection; +- (NSString*) label; +- (void) replaceObject: (id)anObject withObject: (id)anotherObject; +- (id) source; +- (void) setDestination: (id)anObject; +- (void) setLabel: (NSString*)label; +- (void) setSource: (id)anObject; +@end + +@interface NSNibControlConnector : NSNibConnector +- (void) establishConnection; +@end + +@interface NSNibOutletConnector : NSNibConnector +- (void) establishConnection; +@end + +#endif + diff --git a/Headers/AppKit/NSNibDeclarations.h b/Headers/AppKit/NSNibDeclarations.h new file mode 100644 index 000000000..b139e7927 --- /dev/null +++ b/Headers/AppKit/NSNibDeclarations.h @@ -0,0 +1,38 @@ +/* + NSNibDeclarations.h + + Declarations for types used by Interface Builder when reading header + files. + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Giddings + Date: Feb. 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _NSNibDeclarations_H_ +#define _NSNibDeclarations_H_ + +#ifndef STRICT_OPENSTEP +#define IBOutlet +#define IBAction void +#endif + +#endif diff --git a/Headers/AppKit/NSNibLoading.h b/Headers/AppKit/NSNibLoading.h new file mode 100644 index 000000000..bc987ddc4 --- /dev/null +++ b/Headers/AppKit/NSNibLoading.h @@ -0,0 +1,68 @@ +/* + NSNibLoading.h + + Copyright (C) 1997, 1999 Free Software Foundation, Inc. + + Author: Simon Frankau + Date: 1997 + Author: Richard Frith-Macdonald + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSNibLoading +#define _GNUstep_H_NSNibLoading + +#include +#include +#include +#include + +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; + +@interface NSObject (NSNibAwaking) + +/* + * Notification of Loading + */ +- (void) awakeFromNib; + +@end + + +@interface NSBundle (NSNibLoading) + ++ (BOOL) loadNibFile: (NSString *)fileName + externalNameTable: (NSDictionary *)context + withZone: (NSZone *)zone; + ++ (BOOL) loadNibNamed: (NSString *)aNibName + owner: (id)owner; + +- (BOOL) loadNibFile: (NSString *)fileName + externalNameTable: (NSDictionary *)context + withZone: (NSZone *)zone; + +#ifndef NO_GNUSTEP +- (NSString *) pathForNibResource: (NSString *)fileName; +#endif // NO_GNUSTEP +@end + +#endif /* _GNUstep_H_NSNibLoading */ diff --git a/Headers/AppKit/NSOpenGL.h b/Headers/AppKit/NSOpenGL.h new file mode 100644 index 000000000..a058600f8 --- /dev/null +++ b/Headers/AppKit/NSOpenGL.h @@ -0,0 +1,139 @@ +/* -*-ObjC-*- */ +/** + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Frederic De Jaeger + Date: Nov 2002 + + This file is part of the GNU Objective C User interface library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _NSOpenGL_h_INCLUDE +#define _NSOpenGL_h_INCLUDE + +#include +@class NSView; + +typedef enum { + NSOpenGLPFAAllRenderers = 1, + NSOpenGLPFADoubleBuffer = 5, + NSOpenGLPFAStereo = 6, + NSOpenGLPFAAuxBuffers = 7, + NSOpenGLPFAColorSize = 8, + NSOpenGLPFAAlphaSize = 11, + NSOpenGLPFADepthSize = 12, + NSOpenGLPFAStencilSize = 13, + NSOpenGLPFAAccumSize = 14, + NSOpenGLPFAMinimumPolicy = 51, + NSOpenGLPFAMaximumPolicy = 52, + NSOpenGLPFAOffScreen = 53, + NSOpenGLPFAFullScreen = 54, + NSOpenGLPFASampleBuffers = 55, + NSOpenGLPFASamples = 56, + NSOpenGLPFAAuxDepthStencil = 57, + NSOpenGLPFARendererID = 70, + NSOpenGLPFASingleRenderer = 71, + NSOpenGLPFANoRecovery = 72, + NSOpenGLPFAAccelerated = 73, + NSOpenGLPFAClosestPolicy = 74, + NSOpenGLPFARobust = 75, + NSOpenGLPFABackingStore = 76, + NSOpenGLPFAMPSafe = 78, + NSOpenGLPFAWindow = 80, + NSOpenGLPFAMultiScreen = 81, + NSOpenGLPFACompliant = 83, + NSOpenGLPFAScreenMask = 84, + NSOpenGLPFAVirtualScreenCount = 128 +} NSOpenGLPixelFormatAttribute; + +typedef enum { + NSOpenGLCPSwapRectangle = 200, + NSOpenGLCPSwapRectangleEnable = 201, + NSOpenGLCPRasterizationEnable = 221, + NSOpenGLCPSwapInterval = 222, + NSOpenGLCPSurfaceOrder = 235, + NSOpenGLCPSurfaceOpacity = 236, + NSOpenGLCPStateValidation = 301 +} NSOpenGLContextParameter; + +typedef enum { + NSOpenGLGOFormatCacheSize = 501, + NSOpenGLGOClearFormatCache = 502, + NSOpenGLGORetainRenderers = 503, + NSOpenGLGOResetLibrary = 504 +} NSOpenGLGlobalOption; + +@interface NSOpenGLPixelFormat : NSObject +{ +} +- (void)getValues:(long *)vals + forAttribute:(NSOpenGLPixelFormatAttribute)attrib + forVirtualScreen:(int)screen; +- (id)initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs; +- (int)numberOfVirtualScreens; +@end + +@interface NSOpenGLContext : NSObject +{ +} + ++ (void)clearCurrentContext; ++ (NSOpenGLContext *)currentContext; +- (void)clearDrawable; +- (void)copyAttributesFromContext:(NSOpenGLContext *)context + withMask:(unsigned long)mask; +- (void)createTexture:(unsigned long)target + fromView:(NSView*)view + internalFormat:(unsigned long)format; + +- (int)currentVirtualScreen; + +- (void)flushBuffer; + +- (void)getValues:(long *)vals + forParameter:(NSOpenGLContextParameter)param; + +- (id)initWithFormat:(NSOpenGLPixelFormat *)format + shareContext:(NSOpenGLContext *)share; + + +- (void)makeCurrentContext; + +- (void)setCurrentVirtualScreen:(int)screen; + +- (void)setFullScreen; + +- (void)setOffScreen:(void *)baseaddr + width:(long)width + height:(long)height + rowbytes:(long)rowbytes; + +- (void)setValues:(const long *)vals + forParameter:(NSOpenGLContextParameter)param; + +- (void)setView:(NSView *)view; + +- (void)update; + +- (NSView *)view; + + +@end + + + +#endif diff --git a/Headers/AppKit/NSOpenGLView.h b/Headers/AppKit/NSOpenGLView.h new file mode 100644 index 000000000..5fdc505ea --- /dev/null +++ b/Headers/AppKit/NSOpenGLView.h @@ -0,0 +1,51 @@ +/* -*-ObjC-*- */ +/** + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Frederic De Jaeger + Date: Nov 2002 + + This file is part of the GNU Objective C User interface library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _NSOpenGLView_h +#define _NSOpenGLView_h + +#include + +@class NSOpenGLContext; +@class NSOpenGLPixelFormat; + +@interface NSOpenGLView : NSView +{ + NSOpenGLContext *glcontext; + NSOpenGLPixelFormat *pixel_format; + BOOL attached; +} ++ (NSOpenGLPixelFormat*)defaultPixelFormat; +- (void)clearGLContext; +- (void)setOpenGLContext:(NSOpenGLContext*)context; +- (NSOpenGLContext*)openGLContext; +- (id)initWithFrame:(NSRect)frameRect +pixelFormat:(NSOpenGLPixelFormat*)format; +- (void) dealloc; +- (NSOpenGLPixelFormat*)pixelFormat; +- (void)setPixelFormat:(NSOpenGLPixelFormat*)pixelFormat; +- (void) reshape; +- (void) update; +@end +#endif diff --git a/Headers/AppKit/NSOpenPanel.h b/Headers/AppKit/NSOpenPanel.h new file mode 100644 index 000000000..c2f5a8d0f --- /dev/null +++ b/Headers/AppKit/NSOpenPanel.h @@ -0,0 +1,93 @@ +/* + NSOpenPanel.h + + Standard panel for opening files + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Daniel Bðhringer + Date: August 1998 + Source by Daniel Bðhringer integrated into Scott Christley's preliminary + implementation by Felipe A. Rodriguez + + Author: Nicola Pero + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSOpenPanel +#define _GNUstep_H_NSOpenPanel + +#include + +@class NSString; +@class NSArray; + +@interface NSOpenPanel : NSSavePanel +{ + NSArray *_fileTypes; + BOOL _canChooseDirectories; + BOOL _canChooseFiles; +} +// Accessing the NSOpenPanel shared instance ++ (NSOpenPanel *) openPanel; + +// Running an NSOpenPanel +- (int) runModalForTypes: (NSArray *)fileTypes; +- (int) runModalForDirectory: (NSString *)path + file: (NSString *)name + types: (NSArray *)fileTypes; + +#ifndef STRICT_OPENSTEP +- (int) runModalForDirectory: (NSString *)path + file: (NSString *)name + types: (NSArray *)fileTypes + relativeToWindow: (NSWindow*)window; +- (void) beginSheetForDirectory: (NSString *)path + file: (NSString *)name + types: (NSArray *)fileTypes + modalForWindow: (NSWindow *)docWindow + modalDelegate: (id)delegate + didEndSelector: (SEL)didEndSelector + contextInfo: (void *)contextInfo; +#endif + +- (NSArray *) filenames; + +#ifndef STRICT_OPENSTEP +- (NSArray *) URLs; +#endif + +// Filtering Files +- (BOOL) canChooseDirectories; +- (BOOL) canChooseFiles; +- (void) setCanChooseDirectories: (BOOL)flag; +- (void) setCanChooseFiles: (BOOL)flag; +#ifndef STRICT_OPENSTEP +- (void) setResolvesAliases: (BOOL)flag; +- (BOOL) resolvesAliases; +#endif + +- (BOOL) allowsMultipleSelection; +- (void) setAllowsMultipleSelection: (BOOL)flag; +@end + +#endif // _GNUstep_H_NSOpenPanel diff --git a/Headers/AppKit/NSOutlineView.h b/Headers/AppKit/NSOutlineView.h new file mode 100644 index 000000000..d0e734830 --- /dev/null +++ b/Headers/AppKit/NSOutlineView.h @@ -0,0 +1,183 @@ +/* + NSOutlineView.h + + The outline class. + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Gregory John Casamento + Date: October 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSOutlineView +#define _GNUstep_H_NSOutlineView + +#include +#include + +@class NSMutableArray; +@class NSString; + +@interface NSOutlineView : NSTableView +{ + NSMapTable *_itemDict; + NSMutableArray *_items; + NSMutableArray *_expandedItems; + NSMapTable *_levelOfItems; + BOOL _autoResizesOutlineColumn; + BOOL _indentationMarkerFollowsCell; + BOOL _autosaveExpandedItems; + float _indentationPerLevel; + NSTableColumn *_outlineTableColumn; +} + +// Instance methods +- (BOOL)autoResizesOutlineColumn; +- (BOOL)autosaveExpandedItems; +- (void)collapseItem: (id)item; +- (void)collapseItem: (id)item collapseChildren: (BOOL)collapseChildren; +- (void)expandItem: (id)item; +- (void)expandItem:(id)item expandChildren:(BOOL)expandChildren; +- (BOOL)indentationMarkerFollowsCell; +- (float)indentationPerLevel; +- (BOOL)isExpandable: (id)item; +- (BOOL)isItemExpanded: (id)item; +- (id)itemAtRow: (int)row; +- (int)levelForItem: (id)item; +- (int)levelForRow:(int)row; +- (NSTableColumn *)outlineTableColumn; +- (void)reloadItem: (id)item; +- (void)reloadItem: (id)item reloadChildren: (BOOL)reloadChildren; +- (int)rowForItem: (id)item; +- (void)setAutoresizesOutlineColumn: (BOOL)resize; +- (void)setAutosaveExpandedItems: (BOOL)flag; +- (void)setDropItem:(id)item dropChildIndex: (int)childIndex; +- (void)setIndentationMarkerFollowsCell: (BOOL)followsCell; +- (void)setIndentationPerLevel: (float)newIndentLevel; +- (void)setOutlineTableColumn: (NSTableColumn *)outlineTableColumn; +- (BOOL)shouldCollapseAutoExpandedItemsForDeposited: (BOOL)deposited; + +@end /* interface of NSOutlineView */ + +/* + * Informal protocol NSOutlineViewDataSource + */ +@interface NSObject (NSOutlineViewDataSource) +- (BOOL)outlineView: (NSOutlineView *)outlineView + acceptDrop: (id )info + item: (id)item + childIndex: (int)index; + +// required method +- (id)outlineView: (NSOutlineView *)outlineView + child: (int)index + ofItem: (id)item; + +// required method +- (BOOL)outlineView: (NSOutlineView *)outlineView + isItemExpandable: (id)item; + +- (id)outlineView: (NSOutlineView *)outlineView +itemForPersistentObject:(id)object; + +// required method +- (int)outlineView: (NSOutlineView *)outlineView +numberOfChildrenOfItem: (id)item; + +// required method +- (id)outlineView: (NSOutlineView *)outlineView +objectValueForTableColumn:(NSTableColumn *)tableColumn + byItem:(id)item; + +- (id)outlineView: (NSOutlineView *)outlineView +persistentObjectForItem: (id)item; + +- (void)outlineView: (NSOutlineView *)outlineView + setObjectValue: (id)object + forTableColumn: (NSTableColumn *)tableColumn + byItem: (id)item; + +- (NSDragOperation)outlineView: (NSOutlineView*)outlineView + validateDrop: (id )info + proposedItem: (id)item + proposedChildIndex: (int)index; + +- (BOOL)outlineView: (NSOutlineView *)outlineView + writeItems: (NSArray*)items + toPasteboard: (NSPasteboard*)pboard; +@end + +/* + * Constants + */ +extern int NSOutlineViewDropOnItemIndex; + +//enum { NSOutlineViewDropOnItemIndex = -1 }; + +/* + * Notifications + */ +APPKIT_EXPORT NSString *NSOutlineViewColumnDidMoveNotification; +APPKIT_EXPORT NSString *NSOutlineViewColumnDidResizeNotification; +APPKIT_EXPORT NSString *NSOutlineViewSelectionDidChangeNotification; +APPKIT_EXPORT NSString *NSOutlineViewSelectionIsChangingNotification; +APPKIT_EXPORT NSString *NSOutlineViewItemDidExpandNotification; +APPKIT_EXPORT NSString *NSOutlineViewItemDidCollapseNotification; +APPKIT_EXPORT NSString *NSOutlineViewItemWillExpandNotification; +APPKIT_EXPORT NSString *NSOutlineViewItemWillCollapseNotification; + +/* + * Methods Implemented by the Delegate + */ +@interface NSObject (NSOutlineViewDelegate) +// notification methods +- (void) outlineViewColumnDidMove: (NSNotification *)aNotification; +- (void) outlineViewColumnDidResize: (NSNotification *)aNotification; +- (void) outlineViewItemDidCollapse: (NSNotification *)aNotification; +- (void) outlineViewItemDidExpand: (NSNotification *)aNotification; +- (void) outlineViewItemWillCollapse: (NSNotification *)aNotification; +- (void) outlineViewItemWillExpand: (NSNotification *)aNotification; +- (void) outlineViewSelectionDidChange: (NSNotification *)aNotification; +- (void) outlineViewSelectionIsChanging: (NSNotification *)aNotification; + +// delegate methods +- (BOOL) outlineView: (NSOutlineView *)outlineView + shouldCollapseItem: (id)item; +- (BOOL) outlineView: (NSOutlineView *)outlineView +shouldEditTableColumn: (NSTableColumn *)tableColumn + item: (id)item; +- (BOOL) outlineView: (NSOutlineView *)outlineView + shouldExpandItem: (id)item; +- (BOOL) outlineView: (NSOutlineView *)outlineView + shouldSelectItem: (id)item; +- (BOOL) outlineView: (NSOutlineView *)outlineView +shouldSelectTableColumn: (NSTableColumn *)tableColumn; +- (void) outlineView: (NSOutlineView *)outlineView + willDisplayCell: (id)cell + forTableColumn: (NSTableColumn *)tableColumn + item: (id)item; +- (void) outlineView: (NSOutlineView *)outlineView +willDisplayOutlineCell: (id)cell + forTableColumn: (NSTableColumn *)tableColumn + item: (id)item; +- (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView *)outlineView; +@end + +#endif /* _GNUstep_H_NSOutlineView */ diff --git a/Headers/AppKit/NSPageLayout.h b/Headers/AppKit/NSPageLayout.h new file mode 100644 index 000000000..019a88507 --- /dev/null +++ b/Headers/AppKit/NSPageLayout.h @@ -0,0 +1,105 @@ +/** NSPageLayout + + Standard panel for querying user about page layout. + + Copyright (C) 2001 Free Software Foundation, Inc. + + Written By: Adam Fedor + Date: Oct 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPageLayout +#define _GNUstep_H_NSPageLayout + +#include +#include + +@class NSPrintInfo; +@class NSView; + +enum { + NSPLImageButton, + NSPLTitleField, + NSPLPaperNameButton, + NSPLUnitsButton, + NSPLWidthForm, + NSPLHeightForm, + NSPLOrientationMatrix, + NSPLCancelButton, + NSPLOKButton +}; + +@interface NSApplication (NSPageLayout) +- (void) runPageLayout: (id)sender; +@end + +@interface NSPageLayout : NSPanel +{ + NSSize _size; + NSPrintInfo *_printInfo; + NSView *_accessoryView; + id _panel; + int _picked; +} + +// +// Creating an NSPageLayout Instance +// ++ (NSPageLayout *)pageLayout; + +// +// Running the Panel +// +- (int)runModal; +- (int)runModalWithPrintInfo:(NSPrintInfo *)pInfo; +#ifndef STRICT_OPENSTEP +- (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo + modalForWindow:(NSWindow *)docWindow + delegate:(id)delegate + didEndSelector:(SEL)didEndSelector + contextInfo:(void *)contextInfo; +#endif + +// +// Customizing the Panel +// +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; + +// +// Updating the Panel's Display +// +- (void)convertOldFactor:(float *)old + newFactor:(float *)new; +- (void)pickedButton:(id)sender; +- (void)pickedOrientation:(id)sender; +- (void)pickedPaperSize:(id)sender; +- (void)pickedUnits:(id)sender; + +// +// Communicating with the NSPrintInfo Object +// +- (NSPrintInfo *)printInfo; +- (void)readPrintInfo; +- (void)writePrintInfo; + +@end + +#endif // _GNUstep_H_NSPageLayout diff --git a/Headers/AppKit/NSPanel.h b/Headers/AppKit/NSPanel.h new file mode 100644 index 000000000..f393beb00 --- /dev/null +++ b/Headers/AppKit/NSPanel.h @@ -0,0 +1,184 @@ +/* + NSPanel.h + + Panel window class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPanel +#define _GNUstep_H_NSPanel + +#include + +@class NSString; + +enum { + NSUtilityWindowMask = 16, + NSDocModalWindowMask = 32 +}; + +enum { + NSOKButton = 1, + NSCancelButton = 0 +}; + +enum { + NSAlertDefaultReturn = 1, + NSAlertAlternateReturn = 0, + NSAlertOtherReturn = -1, + NSAlertErrorReturn = -2 +}; + +// from MacOS X docs +#define NSAlertDefault NSAlertDefaultReturn +#define NSAlertAlternate NSAlertAlternateReturn +#define NSAlertOther NSAlertOtherReturn + +#ifndef STRICT_OPENSTEP +#define NS_ALERTDEFAULT NSAlertDefaultReturn +#define NS_ALERTALTERNATE NSAlertAlternateReturn +#define NS_ALERTOTHER NSAlertOtherReturn +#define NS_ALERTERROR NSAlertErrorReturn +#endif + +@interface NSPanel : NSWindow +{ + // Think of the following as BOOL ivars +#define _becomesKeyOnlyIfNeeded _f.subclass_bool_one +#define _isFloatingPanel _f.subclass_bool_two +#define _worksWhenModal _f.subclass_bool_three +} + +// +// Determining the Panel Behavior +// +- (BOOL)becomesKeyOnlyIfNeeded; +- (BOOL)isFloatingPanel; +- (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag; +- (void)setFloatingPanel:(BOOL)flag; +- (void)setWorksWhenModal:(BOOL)flag; +- (BOOL)worksWhenModal; + +@end + +// +// Create an Attention Panel without Running It Yet +// +APPKIT_EXPORT id NSGetAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +#ifndef STRICT_OPENSTEP +APPKIT_EXPORT id NSGetCriticalAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +APPKIT_EXPORT id NSGetInformationalAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); +#endif + +// +// Create and Run an Attention Panel +// +APPKIT_EXPORT int NSRunAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +#ifndef STRICT_OPENSTEP +APPKIT_EXPORT int NSRunCriticalAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); + +APPKIT_EXPORT int NSRunInformationalAlertPanel(NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); +#endif + +#ifndef STRICT_MACOS_X +APPKIT_EXPORT int NSRunLocalizedAlertPanel(NSString *table, + NSString *title, + NSString *msg, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, ...); +#endif + +#ifndef STRICT_OPENSTEP +// +// New alert interface of Mac OS X +// +APPKIT_EXPORT void NSBeginAlertSheet(NSString *title, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, + NSWindow *docWindow, + id modalDelegate, + SEL willEndSelector, + SEL didEndSelector, + void *contextInfo, + NSString *msg, ...); + +APPKIT_EXPORT void NSBeginCriticalAlertSheet(NSString *title, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, + NSWindow *docWindow, + id modalDelegate, + SEL willEndSelector, + SEL didEndSelector, + void *contextInfo, + NSString *msg, ...); + +APPKIT_EXPORT void NSBeginInformationalAlertSheet(NSString *title, + NSString *defaultButton, + NSString *alternateButton, + NSString *otherButton, + NSWindow *docWindow, + id modalDelegate, + SEL willEndSelector, + SEL didEndSelector, + void *contextInfo, + NSString *msg, ...); + +#endif + +// +// Release an Attention Panel +// +APPKIT_EXPORT void NSReleaseAlertPanel(id panel); + +#endif // _GNUstep_H_NSPanel diff --git a/Headers/AppKit/NSParagraphStyle.h b/Headers/AppKit/NSParagraphStyle.h new file mode 100644 index 000000000..5e8a9698f --- /dev/null +++ b/Headers/AppKit/NSParagraphStyle.h @@ -0,0 +1,164 @@ +/* + NSParagraphStyle.h + + NSParagraphStyle and NSMutableParagraphStyle hold paragraph style + information NSTextTab holds information about a single tab stop + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Daniel Bðhringer + Date: August 1998 + Update: Richard Frith-Macdonald March 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +typedef enum _NSTextTabType { + NSLeftTabStopType = 0, + NSRightTabStopType, + NSCenterTabStopType, + NSDecimalTabStopType +} NSTextTabType; + +typedef enum _NSLineBreakMode { /* What to do with long lines */ + NSLineBreakByWordWrapping = 0, /* Wrap at word boundaries, default */ + NSLineBreakByCharWrapping, /* Wrap at character boundaries */ + NSLineBreakByClipping, /* Simply clip */ + NSLineBreakByTruncatingHead, /* Truncate at head of line: "...wxyz" */ + NSLineBreakByTruncatingTail, /* Truncate at tail of line: "abcd..." */ + NSLineBreakByTruncatingMiddle /* Truncate middle of line: "ab...yz" */ +} NSLineBreakMode; + +typedef enum _NSWritingDirection { + NSWritingDirectionNaturalDirection, + NSWritingDirectionLeftToRight, + NSWritingDirectionRightToLeft +} NSWritingDirection; + +@interface NSTextTab : NSObject +{ + NSTextTabType _tabStopType; + float _location; +} +- (id) initWithType: (NSTextTabType)type location: (float)loc; +- (float) location; +- (NSTextTabType) tabStopType; +@end + +@interface NSParagraphStyle : NSObject +{ + float _lineSpacing; + float _paragraphSpacing; + float _headIndent; + float _tailIndent; + float _firstLineHeadIndent; + float _minimumLineHeight; + float _maximumLineHeight; + NSMutableArray *_tabStops; + NSTextAlignment _alignment; + NSLineBreakMode _lineBreakMode; + NSWritingDirection _baseDirection; +} + ++ (NSParagraphStyle*) defaultParagraphStyle; + +/* + * "Leading": distance between the bottom of one line fragment and top + * of next (applied between lines in the same container). + * Can't be negative. This value is included in the line fragment + * heights in layout manager. + */ +- (float) lineSpacing; + +/* + * Distance between the bottom of this paragraph and top of next. + */ +- (float) paragraphSpacing; + +- (NSTextAlignment) alignment; + +/* + * The following values are relative to the appropriate margin + * (depending on the paragraph direction) + */ + +/* + * Distance from margin to front edge of paragraph + */ +- (float) headIndent; + +/* + * Distance from margin to back edge of paragraph; if negative or 0, + * from other margin + */ +- (float) tailIndent; + +/* + * Distance from margin to edge appropriate for text direction + */ +- (float) firstLineHeadIndent; + +/* + * Distance from margin to tab stops + */ +- (NSArray *)tabStops; + +/* + * Line height is the distance from bottom of descenders to to + * of ascenders; basically the line fragment height. Does not include + * lineSpacing (which is added after this computation). + */ +- (float) minimumLineHeight; + +/* + * 0 implies no maximum. + */ +- (float) maximumLineHeight; +- (NSLineBreakMode) lineBreakMode; + +#ifndef STRICT_OPENSTEP ++ (NSWritingDirection) defaultWritingDirectionForLanguage: (NSString*) language; +- (NSWritingDirection) baseWritingDirection; +#endif + +@end + +@interface NSMutableParagraphStyle : NSParagraphStyle +{ +} + +- (void) setLineSpacing: (float)aFloat; +- (void) setParagraphSpacing: (float)aFloat; +- (void) setAlignment: (NSTextAlignment)newAlignment; +- (void) setFirstLineHeadIndent: (float)aFloat; +- (void) setHeadIndent: (float)aFloat; +- (void) setTailIndent: (float)aFloat; +- (void) setLineBreakMode: (NSLineBreakMode)mode; +- (void) setMinimumLineHeight: (float)aFloat; +- (void) setMaximumLineHeight: (float)aFloat; +- (void) addTabStop: (NSTextTab*)anObject; +- (void) removeTabStop: (NSTextTab*)anObject; +- (void) setTabStops: (NSArray*)array; +- (void) setParagraphStyle: (NSParagraphStyle*)obj; + +#ifndef STRICT_OPENSTEP +- (void) setBaseWritingDirection: (NSWritingDirection)direction; +#endif +@end diff --git a/Headers/AppKit/NSPasteboard.h b/Headers/AppKit/NSPasteboard.h new file mode 100644 index 000000000..ceefe5056 --- /dev/null +++ b/Headers/AppKit/NSPasteboard.h @@ -0,0 +1,293 @@ +/* + NSPasteboard.h + + Class to transfer data to and from the pasteboard server + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Richard Frith-Macdonald + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPasteboard +#define _GNUstep_H_NSPasteboard + +#include +#include +#include + +@class NSString; +@class NSArray; +@class NSData; +@class NSFileWrapper; + +/** + * Pasteboard contains string data as written by + * [NSPasteboard-setString:forType:] or [NSPasteboard-setPropertyList:forType:] + */ +APPKIT_EXPORT NSString *NSStringPboardType; + +/** + * Pasteboard contains color information + */ +APPKIT_EXPORT NSString *NSColorPboardType; + +/** + * Pasteboard contains generic file content information (serialized) + * as written by [NSPasteboard-writeFileContents:] or + * [NSPasteboard-writeFileWrapper:] + */ +APPKIT_EXPORT NSString *NSFileContentsPboardType; + +/** + * Pasteboard contains an array of filenames (serialized) + * as written by [NSPasteboard-setPropertyList:forType:] + */ +APPKIT_EXPORT NSString *NSFilenamesPboardType; + +/** + * Pasteboard contains font color information + */ +APPKIT_EXPORT NSString *NSFontPboardType; + +/** + * Pasteboard contains ruler color information + */ +APPKIT_EXPORT NSString *NSRulerPboardType; + +/** + * Pasteboard contains postscript code + */ +APPKIT_EXPORT NSString *NSPostScriptPboardType; + +/** + * Pasteboard contains tabular text. + */ +APPKIT_EXPORT NSString *NSTabularTextPboardType; + +/** + * Pasteboard contains text in rich text format. + */ +APPKIT_EXPORT NSString *NSRTFPboardType; + +/** + * Pasteboard contains text in rich text format with additional info + */ +APPKIT_EXPORT NSString *NSRTFDPboardType; + +/** + * Pasteboard contains a TIFF image + */ +APPKIT_EXPORT NSString *NSTIFFPboardType; + +/** + * Pasteboard contains a link to data in some document + */ +APPKIT_EXPORT NSString *NSDataLinkPboardType; + +/** + * Pasteboard contains general binary data + */ +APPKIT_EXPORT NSString *NSGeneralPboardType; + +#ifndef STRICT_OPENSTEP +/** + * Pasteboard contains a PDF document + */ +APPKIT_EXPORT NSString *NSPDFPboardType; + +/** + * Pasteboard contains a PICT diagram document + */ +APPKIT_EXPORT NSString *NSPICTPboardType; + +/** + * Pasteboard contains a URL + */ +APPKIT_EXPORT NSString *NSURLPboardType; + +/** + * Pasteboard contains HTML data + */ +APPKIT_EXPORT NSString *NSHTMLPboardType; +#endif + +/** + * The pasteboard used for drag and drop information. + */ +APPKIT_EXPORT NSString *NSDragPboard; + +/** + * The pasteboard used search and replace editing operations. + */ +APPKIT_EXPORT NSString *NSFindPboard; + +/** + * The pasteboard used for cutting and pasting font information. + */ +APPKIT_EXPORT NSString *NSFontPboard; + +/** + * The general purpose pasteboard (mostly used for cut and paste) + */ +APPKIT_EXPORT NSString *NSGeneralPboard; + +/** + * The pasteboard used for cutting and pasting ruler information. + */ +APPKIT_EXPORT NSString *NSRulerPboard; + +/** + * Exception raised when communication with the pasteboard server fails. + */ +APPKIT_EXPORT NSString *NSPasteboardCommunicationException; + + +@interface NSPasteboard : NSObject +{ + NSString *name; // The name of this pasteboard. + int changeCount; // What we think the current count is. + id target; // Proxy to the object in the server. + id owner; // Local pasteboard owner. + BOOL useHistory; // Want strict OPENSTEP? +} + +// +// Creating and Releasing an NSPasteboard Object +// ++ (NSPasteboard*) generalPasteboard; ++ (NSPasteboard*) pasteboardWithName: (NSString*)aName; ++ (NSPasteboard*) pasteboardWithUniqueName; +- (void) releaseGlobally; + +// +// Getting Data in Different Formats +// ++ (NSPasteboard*) pasteboardByFilteringData: (NSData*)data + ofType: (NSString*)type; ++ (NSPasteboard*) pasteboardByFilteringFile: (NSString*)filename; ++ (NSPasteboard*) pasteboardByFilteringTypesInPasteboard: (NSPasteboard*)pboard; ++ (NSArray*) typesFilterableTo: (NSString*)type; + +// +// Referring to a Pasteboard by Name +// +- (NSString*) name; + +// +// Writing Data +// +- (int) addTypes: (NSArray*)newTypes + owner: (id)newOwner; +- (int) declareTypes: (NSArray*)newTypes + owner: (id)newOwner; +- (BOOL) setData: (NSData*)data + forType: (NSString*)dataType; +- (BOOL) setPropertyList: (id)propertyList + forType: (NSString*)dataType; +- (BOOL) setString: (NSString*)string + forType: (NSString*)dataType; +- (BOOL) writeFileContents: (NSString*)filename; +- (BOOL) writeFileWrapper: (NSFileWrapper*)wrapper; + +// +// Determining Types +// +- (NSString*) availableTypeFromArray: (NSArray*)types; +- (NSArray*) types; + +// +// Reading Data +// +- (int) changeCount; +- (NSData*) dataForType: (NSString*)dataType; +- (id) propertyListForType: (NSString*)dataType; +- (NSString*) readFileContentsType: (NSString*)type + toFile: (NSString*)filename; +- (NSFileWrapper*) readFileWrapper; +- (NSString*) stringForType: (NSString*)dataType; + +@end + +/** + * The NSPasteboardOwner informal protocal defines the messages that + * the pasteboard system will send to a pasteboard owner if they are + * implemented. These are needed to support lazy provision of + * pasteboard data. + */ +@interface NSObject (NSPasteboardOwner) +/** + * This method is called by the pasteboard system when it does not have + * the data that has been asked for ... the pasteboard owner should + * supply the data to the pasteboard by calling -setData:forType: or one + * of the related methods. + */ +- (void) pasteboard: (NSPasteboard*)sender + provideDataForType: (NSString*)type; + +#ifndef NO_GNUSTEP +/** + * Implemented where GNUstep pasteboard extensions are required.
+ * This method is called by the pasteboard system when it does not have + * the data that has been asked for ... the pasteboard owner should + * supply the data to the pasteboard by calling -setData:forType: or one + * of the related methods. + */ +- (void) pasteboard: (NSPasteboard*)sender + provideDataForType: (NSString*)type + andVersion: (int)version; +#endif + +/** + * This method is called by the pasteboard system when another object + * takes ownership of the pasteboard ... it lets the previous owner + * know that it is no longer required to supply data. + */ +- (void) pasteboardChangedOwner: (NSPasteboard*)sender; + +@end + +@interface NSPasteboard (GNUstepExtensions) ++ (NSString*) mimeTypeForPasteboardType: (NSString*)type; ++ (NSString*) pasteboardTypeForMimeType: (NSString*)mimeType; +- (void) setChangeCount: (int)count; +- (void) setHistory: (unsigned)length; +@end + +#ifndef STRICT_OPENSTEP +#include + +@interface NSURL (NSPasteboard) ++ (NSURL*) URLFromPasteboard: (NSPasteboard*)pasteBoard; +- (void) writeToPasteboard: (NSPasteboard*)pasteBoard; +@end + +#endif +// +// Return File-related Pasteboard Types +// +APPKIT_EXPORT NSString *NSCreateFileContentsPboardType(NSString *fileType); +APPKIT_EXPORT NSString *NSCreateFilenamePboardType(NSString *fileType); +APPKIT_EXPORT NSString *NSGetFileType(NSString *pboardType); +APPKIT_EXPORT NSArray *NSGetFileTypes(NSArray *pboardTypes); + + +#endif // _GNUstep_H_NSPasteboard diff --git a/Headers/AppKit/NSPopUpButton.h b/Headers/AppKit/NSPopUpButton.h new file mode 100644 index 000000000..b67504911 --- /dev/null +++ b/Headers/AppKit/NSPopUpButton.h @@ -0,0 +1,91 @@ +/* + NSPopUpButton.h + + Popup list class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Michael Hanni + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPopUpButton +#define _GNUstep_H_NSPopUpButton + +#include + +#include +#include + +@class NSString; +@class NSArray; + + +@interface NSPopUpButton : NSButton +{ +} + +// +// Initializing an NSPopUpButton +// +- (id)initWithFrame:(NSRect)frameRect + pullsDown:(BOOL)flag; + +- (void)setPullsDown:(BOOL)flag; +- (BOOL)pullsDown; +- (void)setAutoenablesItems:(BOOL)flag; +- (BOOL)autoenablesItems; +- (void)addItemWithTitle:(NSString *)title; +- (void)addItemsWithTitles:(NSArray *)itemTitles; +- (void)insertItemWithTitle:(NSString *)title + atIndex:(int)index; +- (void)removeAllItems; +- (void)removeItemWithTitle:(NSString *)title; +- (void)removeItemAtIndex:(int)index; +- (id )selectedItem; +- (NSString *)titleOfSelectedItem; +- (int)indexOfSelectedItem; +- (void)selectItem:(id )anObject; +- (void)selectItemAtIndex:(int)index; +- (void)selectItemWithTitle:(NSString *)title; +- (int)numberOfItems; +- (NSArray *)itemArray; +- (id )itemAtIndex:(int)index; +- (NSString *)itemTitleAtIndex:(int)index; +- (NSArray *)itemTitles; +- (id )itemWithTitle:(NSString *)title; +- (id )lastItem; +- (int)indexOfItem:(id )anObject; +- (int)indexOfItemWithTag:(int)tag; +- (int)indexOfItemWithTitle:(NSString *)title; +- (int)indexOfItemWithRepresentedObject:(id)anObject; +- (int)indexOfItemWithTarget:(id)target + andAction:(SEL)actionSelector; +- (void)setPreferredEdge:(NSRectEdge)edge; +- (NSRectEdge)preferredEdge; +- (void)setTitle:(NSString *)aString; +- (void)synchronizeTitleAndSelectedItem; +@end + +APPKIT_EXPORT NSString *NSPopUpButtonWillPopUpNotification; + +#endif // _GNUstep_H_NSPopUpButton diff --git a/Headers/AppKit/NSPopUpButtonCell.h b/Headers/AppKit/NSPopUpButtonCell.h new file mode 100644 index 000000000..ac63f1964 --- /dev/null +++ b/Headers/AppKit/NSPopUpButtonCell.h @@ -0,0 +1,131 @@ +/* + NSPopUpButtonCell.h + + Cell for Popup list class + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPopUpButtonCell +#define _GNUstep_H_NSPopUpButtonCell + +#include +#include + +@class NSMenu; + +typedef enum { + NSPopUpNoArrow = 0, + NSPopUpArrowAtCenter = 1, + NSPopUpArrowAtBottom = 2, +} NSPopUpArrowPosition; + +@interface NSPopUpButtonCell : NSMenuItemCell +{ + id _selectedItem; + struct __pbcFlags { + unsigned int pullsDown: 1; + unsigned int preferredEdge: 3; + unsigned int usesItemFromMenu: 1; + unsigned int altersStateOfSelectedItem: 1; + unsigned int arrowPosition: 2; + } _pbcFlags; +} + +- (id) initTextCell: (NSString*)stringValue pullsDown: (BOOL)pullDown; + +// Overrides behavior of NSCell. This is the menu for the popup, not a +// context menu. PopUpButtonCells do not have context menus. +- (void) setMenu: (NSMenu*)menu; +- (NSMenu*) menu; + +// Behavior settings +- (void) setPullsDown: (BOOL)flag; +- (BOOL) pullsDown; + +- (void) setAutoenablesItems: (BOOL)flag; +- (BOOL) autoenablesItems; + +- (void) setPreferredEdge: (NSRectEdge)edge; +- (NSRectEdge) preferredEdge; + +- (void) setUsesItemFromMenu: (BOOL)flag; +- (BOOL) usesItemFromMenu; + +- (void) setAltersStateOfSelectedItem: (BOOL)flag; +- (BOOL) altersStateOfSelectedItem; + +// Adding and removing items +- (void) addItemWithTitle: (NSString*)title; +- (void) addItemsWithTitles: (NSArray*)itemTitles; +- (void) insertItemWithTitle: (NSString*)title atIndex: (int)index; + +- (void) removeItemWithTitle: (NSString*)title; +- (void) removeItemAtIndex: (int)index; +- (void) removeAllItems; + + +// Accessing the items +- (NSArray*) itemArray; +- (int) numberOfItems; + +- (int) indexOfItem: (id )item; +- (int) indexOfItemWithTitle: (NSString*)title; +- (int) indexOfItemWithTag: (int)aTag; +- (int) indexOfItemWithRepresentedObject: (id)obj; +- (int) indexOfItemWithTarget: (id)aTarget andAction: (SEL)actionSelector; + +- (id ) itemAtIndex: (int)index; +- (id ) itemWithTitle: (NSString*)title; +- (id ) lastItem; + + +// Dealing with selection +- (void) selectItem: (id )item; +- (void) selectItemAtIndex: (int)index; +- (void) selectItemWithTitle: (NSString*)title; +- (void) setTitle: (NSString*)aString; + +- (id ) selectedItem; +- (int) indexOfSelectedItem; +- (void) synchronizeTitleAndSelectedItem; + + +// Title conveniences +- (NSString*) itemTitleAtIndex: (int)index; +- (NSArray*) itemTitles; +- (NSString*) titleOfSelectedItem; + +- (void) attachPopUpWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; +- (void) dismissPopUp; +- (void) performClickWithFrame: (NSRect)frame inView: (NSView*)controlView; + +// Arrow position for bezel style and borderless popups. +- (NSPopUpArrowPosition) arrowPosition; +- (void) setArrowPosition: (NSPopUpArrowPosition)position; +@end + +/* Notifications */ +APPKIT_EXPORT NSString*NSPopUpButtonCellWillPopUpNotification; + +#endif // _GNUstep_H_NSPopUpButtonCell diff --git a/Headers/AppKit/NSPrintInfo.h b/Headers/AppKit/NSPrintInfo.h new file mode 100644 index 000000000..de98b844a --- /dev/null +++ b/Headers/AppKit/NSPrintInfo.h @@ -0,0 +1,181 @@ +/** NSPrintInfo + + Stores information used in printing. + + Copyright (C) 1996,1997 Free Software Foundation, Inc. + + Author: Simon Frankau + Date: July 1997 + Author: Adam Fedor + Date: Oct 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPrintInfo +#define _GNUstep_H_NSPrintInfo + +#include +#include +#include + +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; + +@class NSPrinter; + +typedef enum _NSPrintingOrientation { + NSPortraitOrientation, + NSLandscapeOrientation +} NSPrintingOrientation; + +typedef enum _NSPrintingPaginationMode { + NSAutoPagination, + NSFitPagination, + NSClipPagination +} NSPrintingPaginationMode; + +@interface NSPrintInfo : NSObject +{ + NSMutableDictionary *_info; +} + +// +// Creating and Initializing an NSPrintInfo Instance +// +- (id)initWithDictionary:(NSDictionary *)aDict; + +// +// Managing the Shared NSPrintInfo Object +// ++ (void)setSharedPrintInfo:(NSPrintInfo *)printInfo; ++ (NSPrintInfo *)sharedPrintInfo; + +// +// Managing the Printing Rectangle +// ++ (NSSize)sizeForPaperName:(NSString *)name; +- (float)bottomMargin; +- (float)leftMargin; +- (NSPrintingOrientation)orientation; +- (NSString *)paperName; +- (NSSize)paperSize; +- (float)rightMargin; +- (void)setBottomMargin:(float)value; +- (void)setLeftMargin:(float)value; +- (void)setOrientation:(NSPrintingOrientation)mode; +- (void)setPaperName:(NSString *)name; +- (void)setPaperSize:(NSSize)size; +- (void)setRightMargin:(float)value; +- (void)setTopMargin:(float)value; +- (float)topMargin; + +// +// Pagination +// +- (NSPrintingPaginationMode)horizontalPagination; +- (void)setHorizontalPagination:(NSPrintingPaginationMode)mode; +- (void)setVerticalPagination:(NSPrintingPaginationMode)mode; +- (NSPrintingPaginationMode)verticalPagination; + +// +// Positioning the Image on the Page +// +- (BOOL)isHorizontallyCentered; +- (BOOL)isVerticallyCentered; +- (void)setHorizontallyCentered:(BOOL)flag; +- (void)setVerticallyCentered:(BOOL)flag; + +// +// Specifying the Printer +// ++ (NSPrinter *)defaultPrinter; ++ (void)setDefaultPrinter:(NSPrinter *)printer; +- (NSPrinter *)printer; +- (void)setPrinter:(NSPrinter *)aPrinter; + +// +// Controlling Printing +// +- (NSString *)jobDisposition; +- (void)setJobDisposition:(NSString *)disposition; +- (void)setUpPrintOperationDefaultValues; + +// +// Accessing the NSPrintInfo Object's Dictionary +// +- (NSMutableDictionary *)dictionary; + +@end + +// +// Printing Information Dictionary Keys +// +APPKIT_EXPORT NSString *NSPrintAllPages; +APPKIT_EXPORT NSString *NSPrintBottomMargin; +APPKIT_EXPORT NSString *NSPrintCopies; +APPKIT_EXPORT NSString *NSPrintFaxCoverSheetName; +APPKIT_EXPORT NSString *NSPrintFaxHighResolution; +APPKIT_EXPORT NSString *NSPrintFaxModem; +APPKIT_EXPORT NSString *NSPrintFaxReceiverNames; +APPKIT_EXPORT NSString *NSPrintFaxReceiverNumbers; +APPKIT_EXPORT NSString *NSPrintFaxReturnReceipt; +APPKIT_EXPORT NSString *NSPrintFaxSendTime; +APPKIT_EXPORT NSString *NSPrintFaxTrimPageEnds; +APPKIT_EXPORT NSString *NSPrintFaxUseCoverSheet; +APPKIT_EXPORT NSString *NSPrintFirstPage; +APPKIT_EXPORT NSString *NSPrintHorizontalPagination; +APPKIT_EXPORT NSString *NSPrintHorizontallyCentered; +APPKIT_EXPORT NSString *NSPrintJobDisposition; +APPKIT_EXPORT NSString *NSPrintJobFeatures; +APPKIT_EXPORT NSString *NSPrintLastPage; +APPKIT_EXPORT NSString *NSPrintLeftMargin; +APPKIT_EXPORT NSString *NSPrintManualFeed; +APPKIT_EXPORT NSString *NSPrintOrientation; +APPKIT_EXPORT NSString *NSPrintPackageException; +APPKIT_EXPORT NSString *NSPrintPagesPerSheet; +APPKIT_EXPORT NSString *NSPrintPaperFeed; +APPKIT_EXPORT NSString *NSPrintPaperName; +APPKIT_EXPORT NSString *NSPrintPaperSize; +APPKIT_EXPORT NSString *NSPrintPrinter; +APPKIT_EXPORT NSString *NSPrintReversePageOrder; +APPKIT_EXPORT NSString *NSPrintRightMargin; +APPKIT_EXPORT NSString *NSPrintSavePath; +APPKIT_EXPORT NSString *NSPrintScalingFactor; +APPKIT_EXPORT NSString *NSPrintTopMargin; +APPKIT_EXPORT NSString *NSPrintVerticalPagination; +APPKIT_EXPORT NSString *NSPrintVerticallyCentered; + +// +// Additional (GNUstep) keys +// +/** Set to Rows to print row by row, set to Columns + to print column by column */ +APPKIT_EXPORT NSString *NSPrintPageDirection; + +// +// Print Job Disposition Values +// +APPKIT_EXPORT NSString *NSPrintCancelJob; +APPKIT_EXPORT NSString *NSPrintFaxJob; +APPKIT_EXPORT NSString *NSPrintPreviewJob; +APPKIT_EXPORT NSString *NSPrintSaveJob; +APPKIT_EXPORT NSString *NSPrintSpoolJob; + +#endif // _GNUstep_H_NSPrintInfo diff --git a/Headers/AppKit/NSPrintOperation.h b/Headers/AppKit/NSPrintOperation.h new file mode 100644 index 000000000..c6d504d69 --- /dev/null +++ b/Headers/AppKit/NSPrintOperation.h @@ -0,0 +1,180 @@ +/** NSPrintOperation + + Controls generation of EPS, PDF or PS print jobs. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Fred Kiefer + Date: November 2000 + Updated to new specification + Author: Adam Fedor + Date: Oct 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPrintOperation +#define _GNUstep_H_NSPrintOperation + +#include +#include + +@class NSString; +@class NSData; +@class NSMutableData; + +@class NSView; +@class NSPrintInfo; +@class NSPrintPanel; +@class NSGraphicsContext; + +typedef enum _NSPrintingPageOrder { + NSDescendingPageOrder, + NSSpecialPageOrder, + NSAscendingPageOrder, + NSUnknownPageOrder +} NSPrintingPageOrder; + +@interface NSPrintOperation : NSObject +{ + // Attributes + NSPrintInfo *_printInfo; + NSView *_view; + NSRect _rect; + NSMutableData *_data; + NSString *_path; + NSGraphicsContext *_context; + NSPrintPanel *_printPanel; + NSView *_accessoryView; + NSPrintingPageOrder _pageOrder; + BOOL _showPanels; + BOOL _pathSet; + int _currentPage; +} + +// +// Creating and Initializing an NSPrintOperation Object +// ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView + insideRect:(NSRect)rect + toData:(NSMutableData *)data; ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView + insideRect:(NSRect)rect + toData:(NSMutableData *)data + printInfo:(NSPrintInfo *)aPrintInfo; ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)aView + insideRect:(NSRect)rect + toPath:(NSString *)path + printInfo:(NSPrintInfo *)aPrintInfo; + ++ (NSPrintOperation *)printOperationWithView:(NSView *)aView; ++ (NSPrintOperation *)printOperationWithView:(NSView *)aView + printInfo:(NSPrintInfo *)aPrintInfo; + +#ifndef STRICT_OPENSTEP ++ (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; +#endif + +- (id)initEPSOperationWithView:(NSView *)aView + insideRect:(NSRect)rect + toData:(NSMutableData *)data + printInfo:(NSPrintInfo *)aPrintInfo; +- (id)initWithView:(NSView *)aView + printInfo:(NSPrintInfo *)aPrintInfo; + +// +// Setting the Print Operation +// ++ (NSPrintOperation *)currentOperation; ++ (void)setCurrentOperation:(NSPrintOperation *)operation; + +// +// Determining the Type of Operation +// +- (BOOL)isEPSOperation; + +#ifndef STRICT_OPENSTEP +- (BOOL)isCopyingOperation; +#endif + +// +// Controlling the User Interface +// +- (NSPrintPanel *)printPanel; +- (BOOL)showPanels; +- (void)setPrintPanel:(NSPrintPanel *)panel; +- (void)setShowPanels:(BOOL)flag; + +#ifndef STRICT_OPENSTEP +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; +#endif + +// +// Managing the DPS Context +// +- (NSGraphicsContext *)createContext; +- (NSGraphicsContext *)context; +- (void)destroyContext; + +// +// Page Information +// +- (int)currentPage; +- (NSPrintingPageOrder)pageOrder; +- (void)setPageOrder:(NSPrintingPageOrder)order; + +// +// Running a Print Operation +// +- (void)cleanUpOperation; +- (BOOL)deliverResult; +- (BOOL)runOperation; +#ifndef STRICT_OPENSTEP +- (void)runOperationModalForWindow: (NSWindow *)docWindow + delegate: (id)delegate + didRunSelector: (SEL)didRunSelector + contextInfo:(void *)contextInfo; +#endif + +// +// Getting the NSPrintInfo Object +// +- (NSPrintInfo *)printInfo; +- (void)setPrintInfo:(NSPrintInfo *)aPrintInfo; + +// +// Getting the NSView Object +// +- (NSView *)view; + +@end + +#endif // _GNUstep_H_NSPrintOperation diff --git a/Headers/AppKit/NSPrintPanel.h b/Headers/AppKit/NSPrintPanel.h new file mode 100644 index 000000000..3707ef86b --- /dev/null +++ b/Headers/AppKit/NSPrintPanel.h @@ -0,0 +1,110 @@ +/* + NSPrintPanel.h + + Standard panel to query users for info on a print job + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifndef _GNUstep_H_NSPrintPanel +#define _GNUstep_H_NSPrintPanel + +#include + +@class NSView; +@class NSPrintInfo; + +enum { + NSPPSaveButton = 3, + NSPPPreviewButton = 4, + NSFaxButton = 5, + NSPPTitleField = 20, + NSPPImageButton = 21, + NSPPNameTitle = 22, + NSPPNameField = 23, + NSPPNoteTitle = 24, + NSPPNoteField = 25, + NSPPStatusTitle = 26, + NSPPStatusField = 27, + NSPPCopiesField = 28, + NSPPPageChoiceMatrix = 29, + NSPPPageRangeFrom = 30, + NSPPPageRangeTo = 31, + NSPPScaleField = 32, + NSPPOptionsButton = 33, + NSPPPaperFeedButton = 34, + NSPPLayoutButton = 35, + NSPPResolutionButton = 36, + NSPPOptionOKButton = 40 +}; + +@interface NSPrintPanel : NSPanel +{ + id _panel; + id _optionPanel; + id _accessoryView; + id _savePath; + int _picked; + NSRange _pages; +} + +// +// Creating an NSPrintPanel +// ++ (NSPrintPanel *)printPanel; + +// +// Customizing the Panel +// +- (void)setAccessoryView:(NSView *)aView; +- (NSView *)accessoryView; + +// +// Running the Panel +// +- (int) runModal; +#ifndef STRICT_OPENSTEP +- (void) beginSheetWithPrintInfo: (NSPrintInfo *)printInfo + modalForWindow: (NSWindow *)docWindow + delegate: (id)delegate + didEndSelector: (SEL)didEndSelector + contextInfo: (void *)contextInfo; +#endif + +// +// Updating the Panel's Display +// +- (void)pickedButton:(id)sender; +- (void)pickedAllPages:(id)sender; +- (void)pickedLayoutList:(id)sender; + +// +// Communicating with the NSPrintInfo Object +// +- (void)updateFromPrintInfo; +- (void)finalWritePrintInfo; + +@end + +#endif // _GNUstep_H_NSPrintPanel diff --git a/Headers/AppKit/NSPrinter.h b/Headers/AppKit/NSPrinter.h new file mode 100644 index 000000000..d43a35b15 --- /dev/null +++ b/Headers/AppKit/NSPrinter.h @@ -0,0 +1,115 @@ +/* + NSPrinter.h + + Class representing a printer's or printer model's capabilities. + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Authors: Simon Frankau + Date: June 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSPrinter +#define _GNUstep_H_NSPrinter + +#include +#include + +@class NSString; +@class NSArray; +@class NSDictionary; +@class NSMutableDictionary; + +typedef enum _NSPrinterTableStatus { + NSPrinterTableOK, + NSPrinterTableNotFound, + NSPrinterTableError +} NSPrinterTableStatus; + +@interface NSPrinter : NSObject +{ + NSString *_printerHost, *_printerName, *_printerNote, *_printerType; + int _cacheAcceptsBinary, _cacheOutputOrder; + BOOL _isRealPrinter; + NSMutableDictionary *_PPD; + NSMutableDictionary *_PPDOptionTranslation; + NSMutableDictionary *_PPDArgumentTranslation; + NSMutableDictionary *_PPDOrderDependency; + NSMutableDictionary *_PPDUIConstraints; +} + +// +// Finding an NSPrinter +// ++ (NSPrinter *)printerWithName:(NSString *)name; ++ (NSPrinter *)printerWithType:(NSString *)type; ++ (NSArray *)printerNames; ++ (NSArray *)printerTypes; + +// +// Printer Attributes +// +- (NSString *)host; +- (NSString *)name; +- (NSString *)note; +- (NSString *)type; + +// +// Retrieving Specific Information +// +- (BOOL)acceptsBinary; +- (NSRect)imageRectForPaper:(NSString *)paperName; +- (NSSize)pageSizeForPaper:(NSString *)paperName; +- (BOOL)isColor; +- (BOOL)isFontAvailable:(NSString *)fontName; +- (int)languageLevel; +- (BOOL)isOutputStackInReverseOrder; + +// +// Querying the NSPrinter Tables +// +- (BOOL)booleanForKey:(NSString *)key + inTable:(NSString *)table; +- (NSDictionary *)deviceDescription; +- (float)floatForKey:(NSString *)key + inTable:(NSString *)table; +- (int)intForKey:(NSString *)key + inTable:(NSString *)table; +- (NSRect)rectForKey:(NSString *)key + inTable:(NSString *)table; +- (NSSize)sizeForKey:(NSString *)key + inTable:(NSString *)table; +- (NSString *)stringForKey:(NSString *)key + inTable:(NSString *)table; +- (NSArray *)stringListForKey:(NSString *)key + inTable:(NSString *)table; +- (NSPrinterTableStatus)statusForTable:(NSString *)table; +- (BOOL)isKey:(NSString *)key + inTable:(NSString *)table; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSPrinter diff --git a/Headers/AppKit/NSProgressIndicator.h b/Headers/AppKit/NSProgressIndicator.h new file mode 100644 index 000000000..966ffae81 --- /dev/null +++ b/Headers/AppKit/NSProgressIndicator.h @@ -0,0 +1,118 @@ +/* + NSProgressIndicator.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Gerrit van Dyk + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSProgressIndicator +#define _GNUstep_H_NSProgressIndicator + +#include + +@class NSTimer; +@class NSThread; + +/* For NSControlTint */ +#include + +/* For NSControlSize */ +#include + +#define NSProgressIndicatorPreferredThickness 14 +#define NSProgressIndicatorPreferredSmallThickness 10 +#define NSProgressIndicatorPreferredLargeThickness 18 +#define NSProgressIndicatorPreferredAquaThickness 12 + +@interface NSProgressIndicator : NSView +{ + BOOL _isIndeterminate; + BOOL _isBezeled; + BOOL _usesThreadedAnimation; + NSTimeInterval _animationDelay; + double _doubleValue; + double _minValue; + double _maxValue; + BOOL _isVertical; +@private + BOOL _isRunning; + int _count; + NSTimer *_timer; + NSThread *_thread; +} + +// +// Animating the progress indicator +// +- (void)animate:(id)sender; +- (NSTimeInterval)animationDelay; +- (void)setAnimimationDelay:(NSTimeInterval)delay; +- (void)startAnimation:(id)sender; +- (void)stopAnimation:(id)sender; +- (BOOL)usesThreadedAnimation; +- (void)setUsesThreadedAnimation:(BOOL)flag; + +// +// Advancing the progress bar +// +- (void)incrementBy:(double)delta; +- (double)doubleValue; +- (void)setDoubleValue:(double)aValue; +- (double)minValue; +- (void)setMinValue:(double)newMinimum; +- (double)maxValue; +- (void)setMaxValue:(double)newMaximum; + +// +// Setting the appearance +// +- (BOOL)isBezeled; +- (void)setBezeled:(BOOL)flag; +- (BOOL)isIndeterminate; +- (void)setIndeterminate:(BOOL)flag; + +// +// Standard control layout +// +- (NSControlSize)controlSize; +- (void)setControlSize:(NSControlSize)size; +- (NSControlTint)controlTint; +- (void)setControlTint:(NSControlTint)tint; + +@end + +#ifndef NO_GNUSTEP +@interface NSProgressIndicator (GNUstepExtensions) + +/* + * Enables Vertical ProgressBar + * + * If isVertical = YES, Progress is from the bottom to the top + * If isVertical = NO, Progress is from the left to the right + */ +- (BOOL)isVertical; +- (void)setVertical:(BOOL)flag; + +@end +#endif + +#endif /* _GNUstep_H_NSProgressIndicator */ diff --git a/Headers/AppKit/NSResponder.h b/Headers/AppKit/NSResponder.h new file mode 100644 index 000000000..48d9fd3cb --- /dev/null +++ b/Headers/AppKit/NSResponder.h @@ -0,0 +1,227 @@ +/* + NSResponder.h + + Abstract class which is basis of command and event processing + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSResponder +#define _GNUstep_H_NSResponder + +#include +#include +#include + +@class NSCoder; +@class NSString; +@class NSEvent; +@class NSMenu; +@class NSUndoManager; + +@interface NSResponder : NSObject +{ +#ifdef STRICT_OPENSTEP + int _interface_style; +#else + NSInterfaceStyle _interface_style; +#endif + NSResponder *_next_responder; + + /* + Due to interface brain-damage, but NSResponder and NSMenuView have -menu + and -setMenu: methods, but for different menus. Thus, to prevent (future, + there have already been some) problems and confusion, this ivar is + private (iow, it can't be accidentally used in NSMenuView). + */ +@private + NSMenu *_menu; + /* + * Flags for internal use by NSResponder and it's subclasses. + */ +@public + struct _rFlagsType { + /* + * 'flipped_view' is set in NSViews designated initialiser (and other + * methods that create views) to be the value returned by [-isFlipped] + * This caching assumes that the value returned by [-isFlipped] will + * not change during the views lifetime - if it does, the view must + * be sure to change the flag accordingly. + */ + unsigned flipped_view:1; + unsigned has_subviews:1; /* The view has subviews. */ + unsigned has_currects:1; /* The view has cursor rects. */ + unsigned has_trkrects:1; /* The view has tracking rects. */ + unsigned has_draginfo:1; /* View/window has drag types. */ + unsigned opaque_view:1; /* For views whose opacity may */ + /* change to keep track of it. */ + unsigned valid_rects:1; /* Some cursor rects may be ok. */ + unsigned needs_display:1; /* Window/view needs display. */ + } _rFlags; +} + +/* + * Instance methods + */ + +/* + * Managing the next responder + */ +- (NSResponder*) nextResponder; +- (void) setNextResponder: (NSResponder*)aResponder; + +/* + * Determining the first responder + */ +- (BOOL) acceptsFirstResponder; +- (BOOL) becomeFirstResponder; +- (BOOL) resignFirstResponder; + +/* + * Aid event processing + */ +- (BOOL) performKeyEquivalent: (NSEvent*)theEvent; +- (BOOL) tryToPerform: (SEL)anAction with: (id)anObject; + +/* + * Forwarding event messages + */ +- (void) flagsChanged: (NSEvent*)theEvent; +- (void) helpRequested: (NSEvent*)theEvent; +- (void) keyDown: (NSEvent*)theEvent; +- (void) keyUp: (NSEvent*)theEvent; +- (void) mouseDown: (NSEvent*)theEvent; +- (void) mouseDragged: (NSEvent*)theEvent; +- (void) mouseEntered: (NSEvent*)theEvent; +- (void) mouseExited: (NSEvent*)theEvent; +- (void) mouseMoved: (NSEvent*)theEvent; +- (void) mouseUp: (NSEvent*)theEvent; +- (void) noResponderFor: (SEL)eventSelector; +#ifndef STRICT_OPENSTEP +- (void) otherMouseDown: (NSEvent*)theEvent; +- (void) otherMouseDragged: (NSEvent*)theEvent; +- (void) otherMouseUp: (NSEvent*)theEvent; +#endif +- (void) rightMouseDown: (NSEvent*)theEvent; +- (void) rightMouseDragged: (NSEvent*)theEvent; +- (void) rightMouseUp: (NSEvent*)theEvent; +- (void) scrollWheel: (NSEvent *)theEvent; + +/* + * Services menu support + */ +- (id) validRequestorForSendType: (NSString*)typeSent + returnType: (NSString*)typeReturned; + +/* + * NSCoding protocol + */ +- (void) encodeWithCoder: (NSCoder*)aCoder; +- (id) initWithCoder: (NSCoder*)aDecoder; + +#ifndef STRICT_OPENSTEP +- (void) interpretKeyEvents: (NSArray*)eventArray; +- (BOOL) performMnemonic: (NSString*)aString; +- (void) flushBufferedKeyEvents; +- (void) doCommandBySelector: (SEL)aSelector; +- (void) insertText: (NSString*)aString; +- (NSUndoManager*) undoManager; + +/* + * Menu + */ +- (NSMenu*) menu; +- (void) setMenu: (NSMenu*)aMenu; + +/* + * Setting the interface + */ +- (NSInterfaceStyle) interfaceStyle; +- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle; +#endif +@end + +#ifndef STRICT_OPENSTEP +@interface NSResponder (OptionalActionMethods) +- (void) capitalizeWord: (id)sender; +- (void) centerSelectionInVisibleArea: (id)sender; +- (void) changeCaseOfLetter: (id)sender; +- (void) complete: (id)sender; +- (void) deleteBackward: (id)sender; +- (void) deleteForward: (id)sender; +- (void) deleteToBeginningOfLine: (id)sender; +- (void) deleteToBeginningOfParagraph: (id)sender; +- (void) deleteToEndOfLine: (id)sender; +- (void) deleteToEndOfParagraph: (id)sender; +- (void) deleteToMark: (id)sender; +- (void) deleteWordBackward: (id)sender; +- (void) deleteWordForward: (id)sender; +- (void) indent: (id)sender; +- (void) insertBacktab: (id)sender; +- (void) insertNewline: (id)sender; +- (void) insertNewlineIgnoringFieldEditor: (id)sender; +- (void) insertParagraphSeparator: (id)sender; +- (void) insertTab: (id)sender; +- (void) insertTabIgnoringFieldEditor: (id)sender; +- (void) lowercaseWord: (id)sender; +- (void) moveBackward: (id)sender; +- (void) moveBackwardAndModifySelection: (id)sender; +- (void) moveDown: (id)sender; +- (void) moveDownAndModifySelection: (id)sender; +- (void) moveForward: (id)sender; +- (void) moveForwardAndModifySelection: (id)sender; +- (void) moveLeft: (id)sender; +- (void) moveRight: (id)sender; +- (void) moveToBeginningOfDocument: (id)sender; +- (void) moveToBeginningOfLine: (id)sender; +- (void) moveToBeginningOfParagraph: (id)sender; +- (void) moveToEndOfDocument: (id)sender; +- (void) moveToEndOfLine: (id)sender; +- (void) moveToEndOfParagraph: (id)sender; +- (void) moveUp: (id)sender; +- (void) moveUpAndModifySelection: (id)sender; +- (void) moveWordBackward: (id)sender; +- (void) moveWordBackwardAndModifySelection: (id)sender; +- (void) moveWordForward: (id)sender; +- (void) moveWordForwardAndModifySelection: (id)sender; +- (void) pageDown: (id)sender; +- (void) pageUp: (id)sender; +- (void) scrollLineDown: (id)sender; +- (void) scrollLineUp: (id)sender; +- (void) scrollPageDown: (id)sender; +- (void) scrollPageUp: (id)sender; +- (void) selectAll: (id)sender; +- (void) selectLine: (id)sender; +- (void) selectParagraph: (id)sender; +- (void) selectToMark: (id)sender; +- (void) selectWord: (id)sender; +- (void) showContextHelp: (id)sender; +- (void) swapWithMark: (id)sender; +- (void) transpose: (id)sender; +- (void) transposeWords: (id)sender; +- (void) uppercaseWord: (id)sender; +- (void) yank: (id)sender; +@end +#endif + +#endif /* _GNUstep_H_NSResponder */ diff --git a/Headers/AppKit/NSRulerMarker.h b/Headers/AppKit/NSRulerMarker.h new file mode 100644 index 000000000..dcb7303ee --- /dev/null +++ b/Headers/AppKit/NSRulerMarker.h @@ -0,0 +1,84 @@ +/* + NSRulerMarker.h + + Displays a symbol in a NSRulerView. + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: Feb 1999 + Author: Fred Kiefer + Date: Sept 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSRulerMarker +#define _GNUstep_H_NSRulerMarker + +#include +#include + +@class NSRulerView; +@class NSImage; +@class NSEvent; + +@interface NSRulerMarker : NSObject +{ + NSRulerView *_rulerView; + NSImage *_image; + id _representedObject; + NSPoint _imageOrigin; + float _location; + BOOL _isMovable; + BOOL _isRemovable; + BOOL _isDragging; +} + +- (id)initWithRulerView:(NSRulerView *)aRulerView + markerLocation:(float)location + image:(NSImage *)anImage + imageOrigin:(NSPoint)imageOrigin; + +- (NSRulerView *)ruler; + +- (void)setImage:(NSImage *)anImage; +- (NSImage *)image; + +- (void)setImageOrigin:(NSPoint)aPoint; +- (NSPoint)imageOrigin; +- (NSRect)imageRectInRuler; +- (float)thicknessRequiredInRuler; + +- (void)setMovable:(BOOL)flag; +- (BOOL)isMovable; +- (void)setRemovable:(BOOL)flag; +- (BOOL)isRemovable; + +- (void)setMarkerLocation:(float)location; +- (float)markerLocation; + +- (void)setRepresentedObject:(id )anObject; +- (id )representedObject; + +- (void)drawRect:(NSRect)aRect; +- (BOOL)isDragging; +- (BOOL)trackMouse:(NSEvent *)theEvent adding:(BOOL)adding; + +@end + +#endif /* _GNUstep_H_NSRulerMarker */ diff --git a/Headers/AppKit/NSRulerView.h b/Headers/AppKit/NSRulerView.h new file mode 100644 index 000000000..94df32c30 --- /dev/null +++ b/Headers/AppKit/NSRulerView.h @@ -0,0 +1,174 @@ +/* -*-objc-*- + NSRulerView.h + + The NSRulerView class. + + Copyright (C) 1999-2002 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: Feb 1999 + Author: Fred Kiefer + Date: Sept 2001 + Author: Diego Kreutz (kreutz@inf.ufsm.br) + Date: January 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSRulerView +#define _GNUstep_H_NSRulerView + +#include + +/* Declaring classes, rather than #including the full class header, + * results in much faster compilations. */ +@class NSScrollView; +@class NSString; +@class NSArray; +@class NSRulerMarker; +@class NSCoder; +@class NSEvent; + +typedef enum { + NSHorizontalRuler, + NSVerticalRuler +} NSRulerOrientation; + +@class GSRulerUnit; + +@interface NSRulerView : NSView +{ + GSRulerUnit *_unit; + NSScrollView *_scrollView; + NSView *_clientView; + NSView *_accessoryView; + float _originOffset; + NSMutableArray *_markers; + NSRulerOrientation _orientation; + float _ruleThickness; + float _reservedThicknessForAccessoryView; + float _reservedThicknessForMarkers; + + /* Cached values. It's a little expensive to calculate them and they + * change only when the unit or the originOffset is changed or when + * clientView changes it's size or zooming factor. This cache is + * invalidated by -invalidateHashMarks method. */ + BOOL _cacheIsValid; + float _markDistance; + float _labelDistance; + int _marksToBigMark; + int _marksToMidMark; + int _marksToLabel; + float _UNUSED; + float _unitToRuler; + NSString *_labelFormat; +} + +- (id) initWithScrollView: (NSScrollView *)aScrollView + orientation: (NSRulerOrientation)o; + ++ (void) registerUnitWithName: (NSString *)uName + abbreviation:(NSString *)abbreviation + unitToPointsConversionFactor:(float)conversionFactor + stepUpCycle:(NSArray *)stepUpCycle + stepDownCycle:(NSArray *)stepDownCycle; + +- (void) setMeasurementUnits: (NSString *)uName; +- (NSString *) measurementUnits; + +- (void) setClientView: (NSView *)aView; +- (NSView *) clientView; + +- (void) setAccessoryView: (NSView *)aView; +- (NSView *) accessoryView; + +- (void) setOriginOffset: (float)offset; +- (float) originOffset; + +- (void) setMarkers: (NSArray *)newMarkers; +- (NSArray *) markers; +- (void) addMarker: (NSRulerMarker *)aMarker; +- (void) removeMarker: (NSRulerMarker *)aMarker; +- (BOOL) trackMarker: (NSRulerMarker *)aMarker + withMouseEvent: (NSEvent *)theEvent; + +- (void) moveRulerlineFromLocation: (float)oldLoc toLocation: (float)newLoc; + +- (void) drawHashMarksAndLabelsInRect: (NSRect)aRect; +- (void) drawMarkersInRect: (NSRect)aRect; +- (void) invalidateHashMarks; + +- (void) setScrollView:(NSScrollView *) scrollView; +- (NSScrollView *) scrollView; + +- (void) setOrientation: (NSRulerOrientation)o; +- (NSRulerOrientation) orientation; +- (void) setReservedThicknessForAccessoryView: (float)thickness; +- (float) reservedThicknessForAccessoryView; +- (void) setReservedThicknessForMarkers: (float)thickness; +- (float) reservedThicknessForMarkers; +- (void) setRuleThickness: (float)thickness; +- (float) ruleThickness; +- (float) requiredThickness; +- (float) baselineLocation; +- (BOOL) isFlipped; + +@end + +/* + * Methods Implemented by the client view ... FIXME/TODO: we currently + * do not send all these messages to the client view ... while we + * should! + */ +@interface NSObject (NSRulerViewClientView) + +- (void)rulerView: (NSRulerView *)aRulerView + didAddMarker: (NSRulerMarker *)aMarker; + +- (void)rulerView: (NSRulerView *)aRulerView + didMoveMarker: (NSRulerMarker *)aMarker; + +- (void)rulerView: (NSRulerView *)aRulerView + didRemoveMarker: (NSRulerMarker *)aMarker; + +- (void)rulerView: (NSRulerView *)aRulerView + handleMouseDown: (NSEvent *)theEvent; + +- (BOOL)rulerView: (NSRulerView *)aRulerView + shouldAddMarker: (NSRulerMarker *)aMarker; + +- (BOOL)rulerView: (NSRulerView *)aRulerView + shouldMoveMarker: (NSRulerMarker *)aMarker; + +- (BOOL)rulerView: (NSRulerView *)aRulerView + shouldRemoveMarker: (NSRulerMarker *)aMarker; + +- (float)rulerView: (NSRulerView *)aRulerView + willAddMarker: (NSRulerMarker *)aMarker + atLocation: (float)location; + +- (float)rulerView: (NSRulerView *)aRulerView + willMoveMarker: (NSRulerMarker *)aMarker + toLocation: (float)location; + +- (void)rulerView: (NSRulerView *)aRulerView +willSetClientView: (NSView *)newClient; + +@end + +#endif /* _GNUstep_H_NSRulerView */ + diff --git a/Headers/AppKit/NSSavePanel.h b/Headers/AppKit/NSSavePanel.h new file mode 100644 index 000000000..dfdc70c96 --- /dev/null +++ b/Headers/AppKit/NSSavePanel.h @@ -0,0 +1,187 @@ +/* + NSSavePanel.h + + Standard save panel for saving files + + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Daniel B?hringer + Date: August 1998 + Source by Daniel B?hringer integrated into Scott Christley's preliminary + implementation by Felipe A. Rodriguez + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSavePanel +#define _GNUstep_H_NSSavePanel + +#include + +@class NSString; +@class NSURL; +@class NSBrowser; +@class NSButton; +@class NSForm; +@class NSTextField; +@class NSView; + +enum { + NSFileHandlingPanelCancelButton = NSCancelButton, + NSFileHandlingPanelOKButton = NSOKButton, + NSFileHandlingPanelImageButton, + NSFileHandlingPanelTitleField, + NSFileHandlingPanelBrowser, + NSFileHandlingPanelForm, + NSFileHandlingPanelHomeButton, + NSFileHandlingPanelDiskButton, + NSFileHandlingPanelDiskEjectButton +}; + +@interface NSSavePanel : NSPanel +{ + NSView *_accessoryView; + NSView *_bottomView; + NSBrowser *_browser; + NSForm *_form; + NSButton *_okButton; + NSTextField *_titleField; + NSView *_topView; + + NSSize _originalMinSize; + NSSize _originalSize; + + NSString *_requiredFileType; + NSString *_directory; + NSString *_fullFileName; + + BOOL _treatsFilePackagesAsDirectories; + BOOL _delegateHasCompareFilter; + BOOL _delegateHasShowFilenameFilter; + BOOL _delegateHasValidNameFilter; + BOOL _delegateHasUserEnteredFilename; + + // YES when we stopped because the user pressed 'OK' + BOOL _OKButtonPressed; +} + +/* + * Getting the NSSavePanel shared instance + */ ++ (NSSavePanel *) savePanel; + +/* + * Customizing the NSSavePanel + */ +- (void) setAccessoryView: (NSView *)aView; +- (NSView *) accessoryView; +- (void) setTitle: (NSString *)title; +- (NSString *) title; +- (void) setPrompt: (NSString *)prompt; +- (NSString *) prompt; + +#ifndef STRICT_OPENSTEP +/* + * Hidding extensions + */ +- (void) setCanSelectHiddenExtension: (BOOL) flag; +- (BOOL) isExtensionHidden; +- (void) setExtensionHidden: (BOOL) flag; +#endif + +/* + * Setting Directory and File Type + */ +- (NSString *) requiredFileType; +- (void) setDirectory: (NSString *)path; +- (void) setRequiredFileType: (NSString *)fileType; + +- (void) setTreatsFilePackagesAsDirectories: (BOOL)flag; +- (BOOL) treatsFilePackagesAsDirectories; + +- (void) validateVisibleColumns; + +/* + * Running the NSSavePanel + */ +- (int) runModalForDirectory: (NSString *)path file: (NSString *)filename; +- (int) runModal; + +#ifndef STRICT_OPENSTEP +- (int) runModalForDirectory: (NSString *)path + file: (NSString *)filename + relativeToWindow: (NSWindow*)window; +- (void) beginSheetForDirectory: (NSString *)path + file: (NSString *)filename + modalForWindow: (NSWindow *)docWindow + modalDelegate: (id)delegate + didEndSelector: (SEL)didEndSelector + contextInfo: (void *)contextInfo; +#endif + +/* + * Reading Save Information + */ +- (NSString *) directory; +- (NSString *) filename; +#ifndef STRICT_OPENSTEP +- (NSURL *) URL; +- (BOOL) isExpanded; +#endif + +/* + * Target and Action Methods + */ +- (void) ok: (id)sender; // target/action of panel's OK button. +- (void) cancel: (id)sender; // target/action of panel's cancel button + +/* + * Responding to User Input + */ +- (void) selectText: (id)sender; +@end + +/* + * Methods Implemented by the Delegate + */ +@interface NSObject (NSSavePanelDelegate) +/** + * The NSSavePanel sends this message just before the end of a + * modal session for each file name displayed or selected + * (including file names in multiple selections). The delegate + * determines whether it wants the file identified by filename; + * it returns YES if the file name is valid, or NO if the + * NSSavePanel should stay in its modal loop and wait for the + * user to type in or select a different file name or names. If + * the delegate refuses a file name in a multiple selection, + * none of the file names in the selection are accepted. + */ +- (BOOL) panel: (id)sender isValidFilename: (NSString*)filename; +- (NSComparisonResult) panel: (id)sender + compareFilename: (NSString *)filename1 + with: (NSString *)filename2 + caseSensitive: (BOOL)caseSensitive; +- (BOOL) panel: (id)sender shouldShowFilename: (NSString *)filename; +- (NSString *)panel: (id)sender +userEnteredFilename: (NSString *)fileName + confirmed: (BOOL)okFlag; +@end + +#endif /* _GNUstep_H_NSSavePanel */ diff --git a/Headers/AppKit/NSScreen.h b/Headers/AppKit/NSScreen.h new file mode 100644 index 000000000..5ad145173 --- /dev/null +++ b/Headers/AppKit/NSScreen.h @@ -0,0 +1,75 @@ +/* + NSScreen.h + + Class representing monitors + + Copyright (C) 1996, 2000 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + Fixes and updates made by + Author: Gregory John Casamento + Date: 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSScreen +#define _GNUstep_H_NSScreen + +#include +#include + +@class NSArray; +@class NSDictionary; + +@interface NSScreen : NSObject +{ +@private + NSWindowDepth _depth; + NSRect _frame; + int _screenNumber; + NSWindowDepth *_supportedWindowDepths; +} + +/* + * Creating NSScreen Instances + */ ++ (NSScreen*) mainScreen; ++ (NSScreen*) deepestScreen; ++ (NSArray*) screens; ++ (void)resetScreens; + +/* + * Reading Screen Information + */ +- (NSWindowDepth) depth; +- (NSRect) frame; +- (NSDictionary*) deviceDescription; + +#ifndef STRICT_OPENSTEP +- (const NSWindowDepth*) supportedWindowDepths; +- (NSRect) visibleFrame; +#endif +#ifndef NO_GNUSTEP +- (int) screenNumber; +#endif + +@end +#endif // _GNUstep_H_NSScreen diff --git a/Headers/AppKit/NSScrollView.h b/Headers/AppKit/NSScrollView.h new file mode 100644 index 000000000..6e810f546 --- /dev/null +++ b/Headers/AppKit/NSScrollView.h @@ -0,0 +1,145 @@ +/* + NSScrollView.h + + A view that allows you to scroll a document view that's too big to display + entirely on a window. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: July 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSScrollView +#define _GNUstep_H_NSScrollView + +#include + +@class NSClipView; +@class NSRulerView; +@class NSColor; +@class NSCursor; +@class NSScroller; + +@interface NSScrollView : NSView +{ + NSClipView* _contentView; + NSScroller* _horizScroller; + NSScroller* _vertScroller; + NSRulerView* _horizRuler; + NSRulerView* _vertRuler; + float _hLineScroll; + float _hPageScroll; + float _vLineScroll; + float _vPageScroll; + NSBorderType _borderType; + BOOL _hasHorizScroller; + BOOL _hasVertScroller; + BOOL _hasHorizRuler; + BOOL _hasVertRuler; + BOOL _scrollsDynamically; + BOOL _rulersVisible; + BOOL _knobMoved; + BOOL _hasHeaderView; + BOOL _hasCornerView; + NSClipView *_headerClipView; +} + +/* Calculating layout */ ++ (NSSize)contentSizeForFrameSize:(NSSize)frameSize + hasHorizontalScroller:(BOOL)hFlag + hasVerticalScroller:(BOOL)vFlag + borderType:(NSBorderType)borderType; ++ (NSSize)frameSizeForContentSize:(NSSize)contentSize + hasHorizontalScroller:(BOOL)hFlag + hasVerticalScroller:(BOOL)vFlag + borderType:(NSBorderType)borderType; + +/* Determining component sizes */ +- (NSSize)contentSize; +- (NSRect)documentVisibleRect; + +/* Managing graphic attributes */ +- (void)setBackgroundColor:(NSColor*)aColor; +- (NSColor*)backgroundColor; +- (void)setBorderType:(NSBorderType)borderType; +- (NSBorderType)borderType; + +/* Managing the scrolled views */ +- (void)setContentView:(NSClipView*)aView; +- (NSClipView*)contentView; +- (void)setDocumentView:(NSView*)aView; +- (id)documentView; +- (void)setDocumentCursor:(NSCursor*)aCursor; +- (NSCursor*)documentCursor; + +/* Managing scrollers */ +- (void)setHorizontalScroller:(NSScroller*)aScroller; +- (NSScroller*)horizontalScroller; +- (void)setHasHorizontalScroller:(BOOL)flag; +- (BOOL)hasHorizontalScroller; +- (void)setVerticalScroller:(NSScroller*)aScroller; +- (NSScroller*)verticalScroller; +- (void)setHasVerticalScroller:(BOOL)flag; +- (BOOL)hasVerticalScroller; + +/* Managing rulers */ ++ (void)setRulerViewClass:(Class)aClass; ++ (Class)rulerViewClass; +- (void)setHasHorizontalRuler:(BOOL)flag; +- (BOOL)hasHorizontalRuler; +- (void)setHorizontalRulerView:(NSRulerView*)aRulerView; +- (NSRulerView*)horizontalRulerView; +- (void)setHasVerticalRuler:(BOOL)flag; +- (BOOL)hasVerticalRuler; +- (void)setVerticalRulerView:(NSRulerView*)aRulerView; +- (NSRulerView*)verticalRulerView; +- (void)setRulersVisible:(BOOL)flag; +- (BOOL)rulersVisible; + +/* Setting scrolling behavior */ +- (void)setLineScroll:(float)aFloat; +- (float)lineScroll; +- (void)setPageScroll:(float)aFloat; +- (float)pageScroll; +- (void)setScrollsDynamically:(BOOL)flag; +- (BOOL)scrollsDynamically; +#ifndef STRICT_OPENSTEP +- (float) horizontalLineScroll; +- (float) horizontalPageScroll; +- (float) verticalLineScroll; +- (float) verticalPageScroll; +- (void) setHorizontalLineScroll: (float)aFloat; +- (void) setHorizontalPageScroll: (float)aFloat; +- (void) setVerticalLineScroll: (float)aFloat; +- (void) setVerticalPageScroll: (float)aFloat; +/* Setting the background drawing */ +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; +#endif + +/* Updating display after scrolling */ +- (void)reflectScrolledClipView:(NSClipView*)aClipView; + +/* Arranging components */ +- (void)tile; + +@end + +#endif /* _GNUstep_H_NSScrollView */ diff --git a/Headers/AppKit/NSScroller.h b/Headers/AppKit/NSScroller.h new file mode 100644 index 000000000..4348f63e0 --- /dev/null +++ b/Headers/AppKit/NSScroller.h @@ -0,0 +1,126 @@ +/* + NSScroller.h + + The scroller class + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + A completely rewritten version of the original source by Scott Christley. + Date: July 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSScroller +#define _GNUstep_H_NSScroller + +#include +#include + +@class NSEvent; + +typedef enum _NSScrollArrowPosition { + NSScrollerArrowsMaxEnd, + NSScrollerArrowsMinEnd, + NSScrollerArrowsNone +} NSScrollArrowPosition; + +typedef enum _NSScrollerPart { + NSScrollerNoPart = 0, + NSScrollerDecrementPage, + NSScrollerKnob, + NSScrollerIncrementPage, + NSScrollerDecrementLine, + NSScrollerIncrementLine, + NSScrollerKnobSlot +} NSScrollerPart; + +typedef enum _NSScrollerUsablePart { + NSNoScrollerParts = 0, + NSOnlyScrollerArrows, + NSAllScrollerParts +} NSUsableScrollerParts; + +typedef enum _NSScrollerArrow { + NSScrollerIncrementArrow, + NSScrollerDecrementArrow +} NSScrollerArrow; + +@interface NSScroller : NSControl +{ + float _floatValue; + float _knobProportion; + id _target; + SEL _action; + BOOL _isHorizontal; + BOOL _isEnabled; + NSScrollerPart _hitPart; + NSScrollArrowPosition _arrowsPosition; + NSUsableScrollerParts _usableParts; + BOOL _cacheValid; +} + +// +// Laying out the NSScroller +// ++ (float)scrollerWidth; +- (NSScrollArrowPosition)arrowsPosition; +- (void)checkSpaceForParts; +- (NSRect)rectForPart:(NSScrollerPart)partCode; +- (void)setArrowsPosition:(NSScrollArrowPosition)where; +- (NSUsableScrollerParts)usableParts; + +// +// Setting the NSScroller's Values +// +- (float)knobProportion; +- (void)setFloatValue:(float)aFloat knobProportion:(float)ratio; + +// +// Displaying +// +- (void)drawArrow:(NSScrollerArrow)whichButton highlight:(BOOL)flag; +- (void)drawKnobSlot; +- (void)drawKnob; +- (void)drawParts; +- (void)highlight:(BOOL)flag; + +// +// Handling Events +// +- (NSScrollerPart)hitPart; + +/* Return the part of the scroller which contains thePoint. thePoint + * is in the window's coordinate system. + */ +- (NSScrollerPart)testPart:(NSPoint)thePoint; +- (void)trackKnob:(NSEvent *)theEvent; +- (void)trackScrollButtons:(NSEvent *)theEvent; + +#ifndef STRICT_OPENSTEP ++ (float)scrollerWidthForControlSize:(NSControlSize)controlSize; +- (void)setControlSize:(NSControlSize)controlSize; +- (NSControlSize)controlSize; +- (void)setControlTint:(NSControlTint)controlTint; +- (NSControlTint)controlTint; +#endif + +@end + +#endif // _GNUstep_H_NSScroller diff --git a/Headers/AppKit/NSSecureTextField.h b/Headers/AppKit/NSSecureTextField.h new file mode 100644 index 000000000..e5dc4ab5f --- /dev/null +++ b/Headers/AppKit/NSSecureTextField.h @@ -0,0 +1,49 @@ +/* + NSSecureTextField.h + + Secure text field control class for hidden text entry + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Lyndon Tremblay + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSecureTextField +#define _GNUstep_H_NSSecureTextField + +#include +#include + +@interface NSSecureTextField : NSTextField +{} +- (void) setEchosBullets:(BOOL)flag; +- (BOOL) echosBullets; +@end + +@interface NSSecureTextFieldCell : NSTextFieldCell +{ + BOOL _echosBullets; +} +- (void) setEchosBullets:(BOOL)flag; +- (BOOL) echosBullets; +@end + +#endif /* _GNUstep_H_NSSecureTextField */ diff --git a/Headers/AppKit/NSSelection.h b/Headers/AppKit/NSSelection.h new file mode 100644 index 000000000..9de6f864b --- /dev/null +++ b/Headers/AppKit/NSSelection.h @@ -0,0 +1,79 @@ +/* + NSSelection.h + + Class describing a selection in a document + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSelection +#define _GNUstep_H_NSSelection + +#include + +@class NSData; +@class NSPasteboard; + +@interface NSSelection : NSObject +{ + // Attributes + @private + NSData *_descriptionData; + BOOL _isWellKnownSelection; + int _selectionType; +} + +// +// Returning Special Selection Shared Instances +// ++ (NSSelection *)allSelection; ++ (NSSelection *)currentSelection; ++ (NSSelection *)emptySelection; + +// +// Creating and Initializing a Selection +// ++ (NSSelection *)selectionWithDescriptionData:(NSData *)data; +- (id)initWithDescriptionData:(NSData *)newData; +- (id)initWithPasteboard:(NSPasteboard *)pasteboard; + +// +// Describing a Selection +// +- (NSData *)descriptionData; +- (BOOL)isWellKnownSelection; + +// +// Writing a Selection to the Pasteboard +// +- (void)writeToPasteboard:(NSPasteboard *)pasteboard; + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSSelection diff --git a/Headers/AppKit/NSSlider.h b/Headers/AppKit/NSSlider.h new file mode 100644 index 000000000..7f2f72db1 --- /dev/null +++ b/Headers/AppKit/NSSlider.h @@ -0,0 +1,85 @@ +/* + NSSlider.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: September 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSSlider +#define _GNUstep_H_NSSlider + +#include +#include + +@class NSString; +@class NSImage; +@class NSCell; +@class NSFont; +@class NSColor; +@class NSEvent; + +@interface NSSlider : NSControl +// appearance +- (double) altIncrementValue; +- (NSImage*) image; +- (int) isVertical; +- (float) knobThickness; +- (void) setAltIncrementValue: (double)increment; +- (void) setImage: (NSImage*)backgroundImage; +- (void) setKnobThickness: (float)aFloat; + +// title +- (NSString*) title; +- (id) titleCell; +- (NSColor*) titleColor; +- (NSFont*) titleFont; +- (void) setTitle: (NSString*)aString; +- (void) setTitleCell: (NSCell*)aCell; +- (void) setTitleColor: (NSColor*)aColor; +- (void) setTitleFont: (NSFont*)fontObject; + +// value limits +- (double) maxValue; +- (double) minValue; +- (void) setMaxValue: (double)aDouble; +- (void) setMinValue: (double)aDouble; + +// mouse handling +- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent; + +#ifndef STRICT_OPENSTEP +// ticks +- (BOOL) allowsTickMarkValuesOnly; +- (double) closestTickMarkValueToValue: (double)aValue; +- (int) indexOfTickMarkAtPoint: (NSPoint)point; +- (int) numberOfTickMarks; +- (NSRect) rectOfTickMarkAtIndex: (int)index; +- (void) setAllowsTickMarkValuesOnly: (BOOL)flag; +- (void) setNumberOfTickMarks: (int)numberOfTickMarks; +- (void) setTickMarkPosition: (NSTickMarkPosition)position; +- (NSTickMarkPosition) tickMarkPosition; +- (double) tickMarkValueAtIndex: (int)index; +#endif + +@end + +#endif // _GNUstep_H_NSSlider + diff --git a/Headers/AppKit/NSSliderCell.h b/Headers/AppKit/NSSliderCell.h new file mode 100644 index 000000000..8c5d9994c --- /dev/null +++ b/Headers/AppKit/NSSliderCell.h @@ -0,0 +1,111 @@ +/* + NSSliderCell.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Ovidiu Predescu + Date: September 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSSliderCell +#define _GNUstep_H_NSSliderCell + +#include + +@class NSString; +@class NSColor; +@class NSFont; +@class NSImage; + +typedef enum _NSTickMarkPosition +{ + NSTickMarkBelow = 0, + NSTickMarkAbove, + NSTickMarkLeft = 0, + NSTickMarkRight +} NSTickMarkPosition; + +@interface NSSliderCell : NSActionCell +{ + float _minValue; + float _maxValue; + float _altIncrementValue; + id _titleCell; + id _knobCell; + NSRect _trackRect; + BOOL _isVertical; + BOOL _allowsTickMarkValuesOnly; + int _numberOfTickMarks; + NSTickMarkPosition _tickMarkPosition; +} + +/* Asking about the cell's behavior */ +- (double) altIncrementValue; ++ (BOOL) prefersTrackingUntilMouseUp; +- (NSRect) trackRect; + +/* Changing the cell's behavior */ +- (void) setAltIncrementValue: (double)increment; + +/* Displaying the cell */ +- (NSRect) knobRectFlipped: (BOOL)flipped; +- (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped; +- (void) drawKnob; +- (void) drawKnob: (NSRect)knobRect; + +/* Asking about the cell's appearance */ +- (float) knobThickness; +- (int) isVertical; +- (NSString*) title; +- (id) titleCell; +- (NSColor*) titleColor; +- (NSFont*) titleFont; + +/* Changing the cell's appearance */ +- (void) setKnobThickness: (float)thickness; +- (void) setTitle: (NSString*)title; +- (void) setTitleCell: (NSCell*)aCell; +- (void) setTitleColor: (NSColor*)color; +- (void) setTitleFont: (NSFont*)font; + +/* Asking about the value limits */ +- (double) minValue; +- (double) maxValue; + +/* Changing the value limits */ +- (void) setMinValue: (double)aDouble; +- (void) setMaxValue: (double)aDouble; + +#ifndef STRICT_OPENSTEP +// ticks +- (BOOL) allowsTickMarkValuesOnly; +- (double) closestTickMarkValueToValue: (double)aValue; +- (int) indexOfTickMarkAtPoint: (NSPoint)point; +- (int) numberOfTickMarks; +- (NSRect) rectOfTickMarkAtIndex: (int)index; +- (void) setAllowsTickMarkValuesOnly: (BOOL)flag; +- (void) setNumberOfTickMarks: (int)numberOfTickMarks; +- (void) setTickMarkPosition: (NSTickMarkPosition)position; +- (NSTickMarkPosition) tickMarkPosition; +- (double) tickMarkValueAtIndex: (int)index; +#endif + +@end + +#endif /* _GNUstep_H_NSSliderCell */ diff --git a/Headers/AppKit/NSSound.h b/Headers/AppKit/NSSound.h new file mode 100644 index 000000000..0af384a8d --- /dev/null +++ b/Headers/AppKit/NSSound.h @@ -0,0 +1,116 @@ +/* + NSSound.h + + Load, manipulate and play sounds + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Enrico Sersale + Date: Jul 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSound +#define _GNUstep_H_NSSound + +#include +#include + +@class NSArray; +@class NSData; +@class NSMutableData; +@class NSPasteboard; +@class NSString; +@class NSURL; + +@interface NSSound : NSObject +{ + NSString *_name; + NSString *_uniqueIdentifier; + BOOL _onlyReference; + id _delegate; + + NSData *_data; + float _samplingRate; + float _frameSize; + long _dataLocation; + long _dataSize; + long _frameCount; + int _channelCount; + int _dataFormat; +} + +// +// Creating an NSSound +// +- (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef; +- (id)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef; +- (id)initWithData:(NSData *)data; +- (id)initWithPasteboard:(NSPasteboard *)pasteboard; + +// +// Playing +// +- (BOOL)pause; +- (BOOL)play; +- (BOOL)resume; +- (BOOL)stop; +- (BOOL)isPlaying; + +// +// Working with pasteboards +// ++ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard; ++ (NSArray *)soundUnfilteredPasteboardTypes; +- (void)writeToPasteboard:(NSPasteboard *)pasteboard; + +// +// Working with delegates +// +- (id)delegate; +- (void)setDelegate:(id)aDelegate; + +// +// Naming Sounds +// ++ (id)soundNamed:(NSString *)name; ++ (NSArray *)soundUnfilteredFileTypes; +- (NSString *)name; +- (BOOL)setName:(NSString *)aName; + +@end + +// +// Methods Implemented by the Delegate +// +@interface NSObject (NSSoundDelegate) + +- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool; + +@end + + +@interface NSBundle (NSSoundAdditions) + +- (NSString *)pathForSoundResource:(NSString *)name; + +@end + +#endif // _GNUstep_H_NSSound + diff --git a/Headers/AppKit/NSSpellChecker.h b/Headers/AppKit/NSSpellChecker.h new file mode 100644 index 000000000..e3ff70874 --- /dev/null +++ b/Headers/AppKit/NSSpellChecker.h @@ -0,0 +1,123 @@ +/* + NSSpellChecker.h + + Class which is interface to spell-checking service + + Copyright (C) 1996, 2001 Free Software Foundation, Inc. + + Author: Gregory John Casamento + Date: 2001 + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSpellChecker +#define _GNUstep_H_NSSpellChecker + +#include +#include + +@class NSProxy; +@class NSString; +@class NSArray; +@class NSView; +@class NSPanel; +@class NSDictionary; +@class NSMutableDictionary; + +@interface NSSpellChecker : NSObject +{ +@private + /* Non-GUI attributes */ + id _serverProxy; + NSString *_language; + NSMutableDictionary *_ignoredWords; + + // Variables to keep state... + int _position; + int _currentTag; + BOOL _wrapFlag; + + // GUI ... + id _wordField; + id _accessoryView; + id _dictionaryPulldown; + id _spellPanel; + + // Buttons... (so we can enable/disable, if necessary) + id _learnButton; + id _forgetButton; + id _ignoreButton; + id _guessButton; + id _findNextButton; + id _correctButton; +} + +// +// Making a Checker available +// ++ (NSSpellChecker *)sharedSpellChecker; ++ (BOOL)sharedSpellCheckerExists; + +// +// Managing the Spelling Panel +// +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; +- (NSPanel *)spellingPanel; + +// +// Checking Spelling +// +- (int)countWordsInString:(NSString *)aString + language:(NSString *)language; +- (NSRange)checkSpellingOfString:(NSString *)stringToCheck + startingAt:(int)startingOffset; +- (NSRange)checkSpellingOfString:(NSString *)stringToCheck + startingAt:(int)startingOffset + language:(NSString *)language + wrap:(BOOL)wrapFlag + inSpellDocumentWithTag:(int)tag + wordCount:(int *)wordCount; +- (NSArray *)guessesForWord:(NSString *)word; + +// +// Setting the Language +// +- (NSString *)language; +- (BOOL)setLanguage:(NSString *)aLanguage; + +// +// Managing the Spelling Process +// ++ (int)uniqueSpellDocumentTag; +- (void)closeSpellDocumentWithTag:(int)tag; +- (void)ignoreWord:(NSString *)wordToIgnore + inSpellDocumentWithTag:(int)tag; +- (NSArray *)ignoredWordsInSpellDocumentWithTag:(int)tag; +- (void)setIgnoredWords:(NSArray *)someWords + inSpellDocumentWithTag:(int)tag; +- (void)setWordFieldStringValue:(NSString *)aString; +- (void)updateSpellingPanelWithMisspelledWord:(NSString *)word; + +@end +#endif // _GNUstep_H_NSSpellChecker + diff --git a/Headers/AppKit/NSSpellProtocol.h b/Headers/AppKit/NSSpellProtocol.h new file mode 100644 index 000000000..472522bf1 --- /dev/null +++ b/Headers/AppKit/NSSpellProtocol.h @@ -0,0 +1,43 @@ +/* + NSSpellProtocol.h + + Protocols for spell checking + + Copyright (C) 1997 Free Software Foundation, Inc. + + Author: Simon Frankau + Date: 1997 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSSpellProtocol +#define _GNUstep_H_NSSpellProtocol + +@protocol NSChangeSpelling + +- (void) changeSpelling:(id)sender; + +@end + +@protocol NSIgnoreMisspelledWords + +- (void)ignoreSpelling:(id)sender; + +@end + +#endif // _GNUstep_H_NSSpellProtocol diff --git a/Headers/AppKit/NSSpellServer.h b/Headers/AppKit/NSSpellServer.h new file mode 100644 index 000000000..949719c0e --- /dev/null +++ b/Headers/AppKit/NSSpellServer.h @@ -0,0 +1,95 @@ +/* + NSSpellServer.h + + Class to allow a spell checker to be available to other apps + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Gregory John Casamento + Date: 2001 + + Author of previous version: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSpellServer +#define _GNUstep_H_NSSpellServer + +#include +#include + +// Forward declarations +@class NSConnection; +@class NSMutableArray; +@class NSMutableDictionary; + +@interface NSSpellServer : NSObject +{ +@private + id _delegate; + BOOL _caseSensitive; + NSMutableDictionary *_userDictionaries; + NSString *_currentLanguage; + NSArray *_ignoredWords; +} + +// Checking in Your Service +- (BOOL)registerLanguage:(NSString *)language + byVendor:(NSString *)vendor; + +// Assigning a Delegate +- (id)delegate; +- (void)setDelegate:(id)anObject; + +// Running the Service +- (void)run; + +// Checking User Dictionaries +- (BOOL)isWordInUserDictionaries:(NSString *)word + caseSensitive:(BOOL)flag; +@end + +// +// NOTE: This is an informal protocol since the +// NSSpellChecker will need to use a proxy object +// to call these methods. If they are defined on +// NSObject, then the compiler won't complain +// about not being able to find the method. (GJC) +// +@interface NSObject (NSSpellServerDelegate) +- (NSRange)spellServer:(NSSpellServer *)sender +findMisspelledWordInString:(NSString *)stringToCheck + language:(NSString *)language + wordCount:(int *)wordCount + countOnly:(BOOL)countOnly; + +- (NSArray *)spellServer:(NSSpellServer *)sender + suggestGuessesForWord:(NSString *)word + inLanguage:(NSString *)language; + +- (void)spellServer:(NSSpellServer *)sender + didLearnWord:(NSString *)word + inLanguage:(NSString *)language; + +- (void)spellServer:(NSSpellServer *)sender + didForgetWord:(NSString *)word + inLanguage:(NSString *)language; +@end +#endif // _GNUstep_H_NSSpellServer diff --git a/Headers/AppKit/NSSplitView.h b/Headers/AppKit/NSSplitView.h new file mode 100644 index 000000000..2e702ae2e --- /dev/null +++ b/Headers/AppKit/NSSplitView.h @@ -0,0 +1,119 @@ +/* -*-objc-*- + NSSplitView.h + + Allows multiple views to share a region in a window + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Robert Vasvari + Date: Jul 1998 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSSplitView +#define _GNUstep_H_NSSplitView + +#include + +@class NSImage, NSColor, NSNotification; + +@interface NSSplitView : NSView +{ + id _delegate; + float _dividerWidth; + float _draggedBarWidth; + BOOL _isVertical; + NSImage *_dimpleImage; + NSColor *_backgroundColor; + NSColor *_dividerColor; + BOOL _never_displayed_before; +} + +- (void) setDelegate: (id)anObject; +- (id) delegate; +- (void) adjustSubviews; +- (void) drawDividerInRect: (NSRect)aRect; +- (float) dividerThickness; + +/* Vertical splitview has a vertical split bar */ +- (void) setVertical: (BOOL)flag; +- (BOOL) isVertical; + +#ifndef STRICT_OPENSTEP +- (BOOL) isSubviewCollapsed: (NSView *)subview; +- (BOOL) isPaneSplitter; +- (void) setIsPaneSplitter: (BOOL)flag; +#endif + +@end + +#ifndef NO_GNUSTEP +@interface NSSplitView (GNUstepExtra) +/* extra methods to make it more usable */ +- (float) draggedBarWidth; +- (void) setDraggedBarWidth: (float)newWidth; +/* if flag is yes, dividerThickness is reset to the height/width of the dimple + image + 1; +*/ +- (void) setDimpleImage: (NSImage *)anImage resetDividerThickness: (BOOL)flag; +- (NSImage *) dimpleImage; +- (NSColor *) backgroundColor; +- (void) setBackgroundColor: (NSColor *)aColor; +- (NSColor *) dividerColor; +- (void) setDividerColor: (NSColor *)aColor; + +@end +#endif + +@interface NSObject (NSSplitViewDelegate) +- (void) splitView: (NSSplitView *)sender +resizeSubviewsWithOldSize: (NSSize)oldSize; + +- (void) splitView: (NSSplitView *)sender +constrainMinCoordinate: (float *)min + maxCoordinate: (float *)max + ofSubviewAt: (int)offset; + +- (float) splitView: (NSSplitView *)sender +constrainSplitPosition: (float)proposedPosition + ofSubviewAt: (int)offset; + +- (void) splitViewWillResizeSubviews: (NSNotification *)notification; +- (void) splitViewDidResizeSubviews: (NSNotification *)notification; + +#ifndef STRICT_OPENSTEP +- (BOOL) splitView: (NSSplitView *)sender +canCollapseSubview: (NSView *)subview; + +- (float) splitView: (NSSplitView *)sender +constrainMaxCoordinate: (float)proposedMax + ofSubviewAt: (int)offset; + +- (float) splitView: (NSSplitView *)sender +constrainMinCoordinate: (float)proposedMin + ofSubviewAt: (int)offset; +#endif + +@end + +/* Notifications */ +APPKIT_EXPORT NSString *NSSplitViewDidResizeSubviewsNotification; +APPKIT_EXPORT NSString *NSSplitViewWillResizeSubviewsNotification; + +#endif diff --git a/Headers/AppKit/NSStepper.h b/Headers/AppKit/NSStepper.h new file mode 100644 index 000000000..e64779857 --- /dev/null +++ b/Headers/AppKit/NSStepper.h @@ -0,0 +1,61 @@ +/* + NSStepper.h + + The stepper class + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Pierre-Yves Rivaille + Date: August 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSStepper +#define _GNUstep_H_NSStepper + +#include + +@class NSEvent; + +@interface NSStepper : NSControl +{ + // Attributes +} +- (double) maxValue; +- (void) setMaxValue: (double)maxValue; +- (double) minValue; +- (void) setMinValue: (double)minValue; +- (double) increment; +- (void) setIncrement: (double)increment; + + +- (BOOL)autorepeat; +- (void)setAutorepeat: (BOOL)autorepeat; +- (BOOL)valueWraps; +- (void)setValueWraps: (BOOL)valueWraps; + +- (void)mouseDown:(NSEvent*)event; +@end + +@interface NSStepper (Private) +- (void)_increment; +- (void)_decrement; +@end + +#endif // _GNUstep_H_NSStepper diff --git a/Headers/AppKit/NSStepperCell.h b/Headers/AppKit/NSStepperCell.h new file mode 100644 index 000000000..246d46fd0 --- /dev/null +++ b/Headers/AppKit/NSStepperCell.h @@ -0,0 +1,78 @@ +/* + NSStepperCell.h + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Pierre-Yves Rivaille + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSStepperCell +#define _GNUstep_H_NSStepperCell + +#include + + +@interface NSStepperCell : NSActionCell +{ + // Think of the following ones as of two BOOL ivars +#define _autorepeat _cell.subclass_bool_one +#define _valueWraps _cell.subclass_bool_two + + double _maxValue; + double _minValue; + double _increment; + BOOL highlightUp; + BOOL highlightDown; +} + +- (double)maxValue; +- (void)setMaxValue: (double)maxValue; +- (double)minValue; +- (void)setMinValue: (double)minValue; +- (double)increment; +- (void)setIncrement: (double)increment; + + +- (BOOL)autorepeat; +- (void)setAutorepeat: (BOOL)autorepeat; +- (BOOL)valueWraps; +- (void)setValueWraps: (BOOL)valueWraps; + + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +@interface NSStepperCell (Private) +- (void) highlight: (BOOL) highlight + upButton: (BOOL) upButton + withFrame: (NSRect) frame + inView: (NSView*) controlView; + +- (NSRect)upButtonRectWithFrame: (NSRect) frame; +- (NSRect)downButtonRectWithFrame: (NSRect) frame; +- (void)_drawText: (NSRect)aRect; +@end +#endif // _GNUstep_H_NSStepperCell diff --git a/Headers/AppKit/NSStringDrawing.h b/Headers/AppKit/NSStringDrawing.h new file mode 100644 index 000000000..ca26e7f9f --- /dev/null +++ b/Headers/AppKit/NSStringDrawing.h @@ -0,0 +1,62 @@ +/* + NSStringDrawing.h + + Categories which add measure capabilities to NSAttributedString + and NSString. + + Copyright (C) 1997 Free Software Foundation, Inc. + + Author: Felipe A. Rodriguez + Date: Aug 1998 + Rewrite: Richard Frith-Macdonald + Date: Mar 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSStringDrawing +#define _GNUstep_H_NSStringDrawing + +#ifndef STRICT_OPENSTEP + +#include +#include +#include +#include + +@interface NSString (NSStringDrawing) + +- (void) drawAtPoint: (NSPoint)point withAttributes: (NSDictionary*)attrs; +- (void) drawInRect: (NSRect)rect withAttributes: (NSDictionary*)attrs; +- (NSSize) sizeWithAttributes: (NSDictionary*)attrs; + +@end + +@interface NSAttributedString (NSStringDrawing) + +- (NSSize) size; +- (void) drawAtPoint: (NSPoint)point; +- (void) drawInRect: (NSRect)rect; + +@end + +#else +@class NSAttributedString; +#endif + +#endif /* _GNUstep_H_NSStringDrawing */ diff --git a/Headers/AppKit/NSTabView.h b/Headers/AppKit/NSTabView.h new file mode 100644 index 000000000..412598582 --- /dev/null +++ b/Headers/AppKit/NSTabView.h @@ -0,0 +1,118 @@ +/* + NSTabView.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTabView +#define _GNUstep_H_NSTabView + +#include +#include +#include + +typedef enum { + NSTopTabsBezelBorder, + NSBottomTabsBezelBorder, + NSNoTabsBezelBorder, + NSNoTabsLineBorder, + NSNoTabsNoBorder, + NSLeftTabsBezelBorder, + NSRightTabsBezelBorder +} NSTabViewType; + +@class NSFont; +@class NSTabViewItem; + +@interface NSTabView : NSView +{ + NSMutableArray *_items; + NSFont *_font; + NSTabViewType _type; + NSTabViewItem *_selected; + BOOL _draws_background; + BOOL _truncated_label; + id _delegate; + int _selected_item; +} +- (void)addTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem + atIndex:(int)index; +- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem; +- (int)indexOfTabViewItem:(NSTabViewItem *)tabViewItem; +- (int)indexOfTabViewItemWithIdentifier:(id)identifier; +- (int)numberOfTabViewItems; + +- (NSTabViewItem *)tabViewItemAtIndex:(int)index; +- (NSArray *)tabViewItems; + +- (void)selectFirstTabViewItem:(id)sender; +- (void)selectLastTabViewItem:(id)sender; +- (void)selectNextTabViewItem:(id)sender; +- (void)selectPreviousTabViewItem:(id)sender; +- (void)selectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)selectTabViewItemAtIndex:(int)index; +- (void)selectTabViewItemWithIdentifier:(id)identifier; +- (void)takeSelectedTabViewItemFromSender:(id)sender; +- (NSTabViewItem*) selectedTabViewItem; + +- (void)setFont:(NSFont *)font; +- (NSFont *)font; + +- (void)setTabViewType:(NSTabViewType)tabViewType; +- (NSTabViewType)tabViewType; + +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; + +- (void)setAllowsTruncatedLabels:(BOOL)allowTruncatedLabels; +- (BOOL)allowsTruncatedLabels; + +- (void)setDelegate:(id)anObject; +- (id)delegate; + +- (NSSize)minimumSize; +- (NSRect)contentRect; + +- (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point; + +#ifndef STRICT_OPENSTEP +- (NSControlSize)controlSize; +- (NSControlTint)controlTint; +- (void)setControlSize:(NSControlSize)controlSize; +- (void)setControlTint:(NSControlTint)controlTint; +#endif + +@end + +@interface NSObject(NSTabViewDelegate) +- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)TabView; +@end + +#endif // _GNUstep_H_NSTabView + +/* Notifications */ + diff --git a/Headers/AppKit/NSTabViewItem.h b/Headers/AppKit/NSTabViewItem.h new file mode 100644 index 000000000..79bc120a5 --- /dev/null +++ b/Headers/AppKit/NSTabViewItem.h @@ -0,0 +1,86 @@ +/* + NSTabViewItem.h + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTabViewItem +#define _GNUstep_H_NSTabViewItem + +#include + +typedef enum { + NSSelectedTab = 0, + NSBackgroundTab, + NSPressedTab +} NSTabState; + +@class NSColor; + +@interface NSTabViewItem : NSObject +{ + id _ident; + NSString *_label; + NSView *_view; + NSColor *_color; + NSTabState _state; + NSView *_first_responder; + NSTabView *_tabview; + NSRect _rect; // cached +} +- (id) initWithIdentifier:(id)identifier; + +- (void)setIdentifier:(id)identifier; +- (id)identifier; + +- (void)setLabel:(NSString *)label; +- (NSString *)label; +- (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel; + +- (void)setView:(NSView *)view; +- (NSView *)view; + +- (void)setColor:(NSColor *)color; +- (NSColor *)color; + +- (NSTabState)tabState; +- (NSTabView *)tabView; + +- (void)setInitialFirstResponder:(NSView *)view; +- (id)initialFirstResponder; + +- (void)drawLabel:(BOOL)shouldTruncateLabel + inRect:(NSRect)tabRect; +@end + +@interface NSTabViewItem (GNUstep) + +// Non-spec +- (void)_setTabState:(NSTabState)tabState; +- (void)_setTabView:(NSTabView *)tabView; +- (NSRect) _tabRect; +- (NSString*)_truncatedLabel; +@end + +#endif // _GNUstep_H_NSTabViewItem + diff --git a/Headers/AppKit/NSTableColumn.h b/Headers/AppKit/NSTableColumn.h new file mode 100644 index 000000000..ae26d4b47 --- /dev/null +++ b/Headers/AppKit/NSTableColumn.h @@ -0,0 +1,93 @@ +/* + NSTableColumn.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + Author: Nicola Pero + Date: December 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTableColumn +#define _GNUstep_H_NSTableColumn + +#include + +@class NSCell; +@class NSTableView; + +@interface NSTableColumn : NSObject +{ + id _identifier; + NSTableView *_tableView; + float _width; + float _min_width; + float _max_width; + BOOL _is_resizable; + BOOL _is_editable; + NSCell *_headerCell; + NSCell *_dataCell; +} +/* + * Initializing an NSTableColumn instance + */ +- (id) initWithIdentifier: (id)anObject; +/* + * Managing the Identifier + */ +- (void) setIdentifier: (id)anObject; +- (id) identifier; +/* + * Setting the NSTableView + */ +- (void) setTableView: (NSTableView *)aTableView; +- (NSTableView *) tableView; +/* + * Controlling size + */ +- (void) setWidth: (float)newWidth; +- (float) width; +- (void) setMinWidth: (float)minWidth; +- (float) minWidth; +- (void) setMaxWidth: (float)maxWidth; +- (float) maxWidth; +- (void) setResizable: (BOOL)flag; +- (BOOL) isResizable; +- (void) sizeToFit; +/* + * Controlling editability + */ +- (void) setEditable: (BOOL)flag; +- (BOOL) isEditable; +/* + * Setting component cells + */ +- (void) setHeaderCell: (NSCell *)aCell; +- (NSCell *) headerCell; +- (void) setDataCell: (NSCell *)aCell; +- (NSCell *) dataCell; +- (NSCell *) dataCellForRow: (int)row; +@end + +/* Notifications */ +APPKIT_EXPORT NSString *NSTableViewColumnDidResizeNotification; +#endif diff --git a/Headers/AppKit/NSTableHeaderCell.h b/Headers/AppKit/NSTableHeaderCell.h new file mode 100644 index 000000000..2aa8d238a --- /dev/null +++ b/Headers/AppKit/NSTableHeaderCell.h @@ -0,0 +1,37 @@ +/* + NSTableHeaderCell.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTableHeaderCell +#define _GNUstep_H_NSTableHeaderCell + +#include + +@interface NSTableHeaderCell : NSTextFieldCell +{ +} +@end + +#endif diff --git a/Headers/AppKit/NSTableHeaderView.h b/Headers/AppKit/NSTableHeaderView.h new file mode 100644 index 000000000..3ca86c4ff --- /dev/null +++ b/Headers/AppKit/NSTableHeaderView.h @@ -0,0 +1,60 @@ +/* + NSTableHeaderView.h + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Michael Hanni + Date: 1999 + + Author: Nicola Pero + Date: December 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTableHeaderView +#define _GNUstep_H_NSTableHeaderView + +#include +#include + +@class NSTableView; + +@interface NSTableHeaderView : NSView +{ + NSTableView *_tableView; + int _resizedColumn; +} +/* + * Setting the table view + */ +- (void) setTableView: (NSTableView*)aTableView; +- (NSTableView*) tableView; +/* + * Checking altered columns + */ +- (int) draggedColumn; +- (float) draggedDistance; +- (int) resizedColumn; +/* + * Utility methods + */ +- (int) columnAtPoint: (NSPoint)aPoint; +- (NSRect) headerRectOfColumn: (int)columnIndex; +@end +#endif diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h new file mode 100644 index 000000000..7db88844c --- /dev/null +++ b/Headers/AppKit/NSTableView.h @@ -0,0 +1,336 @@ +/* + NSTableView.h + + The table class. + + Copyright (C) 2000 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: March 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTableView +#define _GNUstep_H_NSTableView + +#include +#include + +@class NSArray; +@class NSTableColumn; +@class NSTableHeaderView; +@class NSText; +@class NSImage; + +typedef enum _NSTableViewDropOperation { + NSTableViewDropOn, + NSTableViewDropAbove +} NSTableViewDropOperation; + +@interface NSTableView : NSControl +{ + /* + * Real Ivars + */ + id _dataSource; + NSMutableArray *_tableColumns; + BOOL _drawsGrid; + NSColor *_gridColor; + NSColor *_backgroundColor; + float _rowHeight; + NSSize _intercellSpacing; + id _delegate; + NSTableHeaderView *_headerView; + NSView *_cornerView; + SEL _action; + SEL _doubleAction; + id _target; + int _clickedRow; + int _clickedColumn; + NSTableColumn *_highlightedTableColumn; + NSMutableArray *_selectedColumns; + NSMutableArray *_selectedRows; + int _selectedColumn; + int _selectedRow; + BOOL _allowsMultipleSelection; + BOOL _allowsEmptySelection; + BOOL _allowsColumnSelection; + BOOL _allowsColumnResizing; + BOOL _allowsColumnReordering; + BOOL _autoresizesAllColumnsToFit; + BOOL _selectingColumns; + NSText *_textObject; + int _editedRow; + int _editedColumn; + NSCell *_editedCell; + BOOL _autosaveTableColumns; + NSString *_autosaveName; + + /* + * Ivars Acting as Cache + */ + int _numberOfRows; + int _numberOfColumns; + /* YES if _delegate responds to + tableView:willDisplayCell:forTableColumn:row: */ + BOOL _del_responds; + /* YES if _dataSource responds to + tableView:setObjectValue:forTableColumn:row: */ + BOOL _dataSource_editable; + + /* + * We cache column origins (precisely, the x coordinate of the left + * origin of each column). When a column width is changed through + * [NSTableColumn setWidth:], then [NSTableView tile] gets called, + * which updates the cache. */ + float *_columnOrigins; + + /* + * We keep the superview's width in order to know when to + * size the last column to fit + */ + float _superview_width; + + /* if YES [which happens only during a sizeToFit], we are doing + computations on sizes so we ignore tile (produced for example by + the NSTableColumns) during the computation. We perform a global + tile at the end */ + BOOL _tilingDisabled; +} + +/* Table Dimensions */ +- (int) numberOfColumns; +- (int) numberOfRows; + +/* Columns */ +- (void) addTableColumn: (NSTableColumn *)aColumn; +- (void) removeTableColumn: (NSTableColumn *)aColumn; +- (void) moveColumn: (int)columnIndex toColumn: (int)newIndex; +- (NSArray *) tableColumns; +- (int) columnWithIdentifier: (id)identifier; +- (NSTableColumn *) tableColumnWithIdentifier: (id)anObject; + +/* Data Source */ +- (void) setDataSource: (id)anObject; +- (id) dataSource; + +/* Loading data */ +- (void) reloadData; + +/* Target-action */ +- (void) setDoubleAction: (SEL)aSelector; +- (SEL) doubleAction; +- (int) clickedColumn; +- (int) clickedRow; + +/* Configuration */ +- (void) setAllowsColumnReordering: (BOOL)flag; +- (BOOL) allowsColumnReordering; +- (void) setAllowsColumnResizing: (BOOL)flag; +- (BOOL) allowsColumnResizing; +- (void) setAllowsMultipleSelection: (BOOL)flag; +- (BOOL) allowsMultipleSelection; +- (void) setAllowsEmptySelection: (BOOL)flag; +- (BOOL) allowsEmptySelection; +- (void) setAllowsColumnSelection: (BOOL)flag; +- (BOOL) allowsColumnSelection; + +/* Drawing Attributes */ +- (void) setIntercellSpacing: (NSSize)aSize; +- (NSSize) intercellSpacing; +- (void) setRowHeight: (float)rowHeight; +- (float) rowHeight; +- (void) setBackgroundColor: (NSColor *)aColor; +- (NSColor *) backgroundColor; + +/* Selecting Columns and Rows */ +- (void) selectColumn: (int) columnIndex byExtendingSelection: (BOOL)flag; +- (void) selectRow: (int) rowIndex byExtendingSelection: (BOOL)flag; +- (void) deselectColumn: (int)columnIndex; +- (void) deselectRow: (int)rowIndex; +- (int) numberOfSelectedColumns; +- (int) numberOfSelectedRows; +- (int) selectedColumn; +- (int) selectedRow; +- (BOOL) isColumnSelected: (int)columnIndex; +- (BOOL) isRowSelected: (int)rowIndex; +- (NSEnumerator *) selectedColumnEnumerator; +- (NSEnumerator *) selectedRowEnumerator; +- (void) selectAll: (id)sender; +- (void) deselectAll: (id)sender; + +/* Grid Drawing attributes */ +- (void) setDrawsGrid: (BOOL)flag; +- (BOOL) drawsGrid; +- (void) setGridColor: (NSColor *)aColor; +- (NSColor *) gridColor; + +/* Editing Cells */ +/* ALL TODOS */ +- (void) editColumn: (int)columnIndex + row: (int)rowIndex + withEvent: (NSEvent *)theEvent + select: (BOOL)flag; +- (int) editedRow; +- (int) editedColumn; + +/* Auxiliary Components */ +- (void) setHeaderView: (NSTableHeaderView*)aHeaderView; +- (NSTableHeaderView*) headerView; +- (void) setCornerView: (NSView*)aView; +- (NSView*) cornerView; + +/* Layout */ +- (NSRect) rectOfColumn: (int)columnIndex; +- (NSRect) rectOfRow: (int)rowIndex; +- (NSRange) columnsInRect: (NSRect)aRect; +- (NSRange) rowsInRect: (NSRect)aRect; +- (int) columnAtPoint: (NSPoint)aPoint; +- (int) rowAtPoint: (NSPoint)aPoint; +- (NSRect) frameOfCellAtColumn: (int)columnIndex + row: (int)rowIndex; +- (void) setAutoresizesAllColumnsToFit: (BOOL)flag; +- (BOOL) autoresizesAllColumnsToFit; +- (void) sizeLastColumnToFit; +// - (void) sizeToFit; inherited from NSControl +- (void) setFrame: (NSRect) frameRect; +- (void) noteNumberOfRowsChanged; +- (void) tile; + +/* Drawing */ +- (void) drawRow: (int)rowIndex clipRect: (NSRect)clipRect; +- (void) drawGridInClipRect: (NSRect)aRect; +- (void) highlightSelectionInClipRect: (NSRect)clipRect; + +/* Scrolling */ +- (void) scrollRowToVisible: (int)rowIndex; +- (void) scrollColumnToVisible: (int)columnIndex; + +/* Text delegate methods */ +- (BOOL) textShouldBeginEditing: (NSText *)textObject; +- (void) textDidBeginEditing: (NSNotification *)aNotification; +- (void) textDidChange: (NSNotification *)aNotification; +- (BOOL) textShouldEndEditing: (NSText *)textObject; +- (void) textDidEndEditing: (NSNotification *)aNotification; + +/* Persistence */ +- (NSString *) autosaveName; +- (BOOL) autosaveTableColumns; +- (void) setAutosaveName: (NSString *)name; +- (void) setAutosaveTableColumns: (BOOL)flag; + +/* Delegate */ +- (void) setDelegate: (id)anObject; +- (id) delegate; + +/* indicator image */ +/* NB: ALL TODOS */ +- (NSImage *) indicatorImageInTableColumn: (NSTableColumn *)aTableColumn; +- (void) setIndicatorImage: (NSImage *)anImage + inTableColumn: (NSTableColumn *)aTableColumn; + +/* highlighting columns */ +/* NB: ALL TODOS */ +- (NSTableColumn *) highlightedTableColumn; +- (void) setHighlightedTableColumn: (NSTableColumn *)aTableColumn; + +/* dragging rows */ +/* NB: ALL TODOS */ +- (NSImage*) dragImageForRows: (NSArray*)dragRows + event: (NSEvent*)dragEvent + dragImageOffset: (NSPoint*)dragImageOffset; +- (void) setDropRow: (int)row + dropOperation: (NSTableViewDropOperation)operation; +- (void) setVerticalMotionCanBeginDrag: (BOOL)flag; +- (BOOL) verticalMotionCanBeginDrag; + +@end /* interface of NSTableView */ + +@interface NSTableView (GNUPrivate) +- (void) _sendDoubleActionForColumn: (int)columnIndex; +- (void) _selectColumn: (int)columnIndex + modifiers: (unsigned int)modifiers; +@end + +/* + * Informal protocol NSTableDataSource + */ + +@interface NSObject (NSTableDataSource) + +- (int) numberOfRowsInTableView: (NSTableView *)aTableView; +- (id) tableView: (NSTableView *)aTableView +objectValueForTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex; +- (void) tableView: (NSTableView *)aTableView + setObjectValue: (id)anObject + forTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex; + +/* Dragging */ +- (BOOL) tableView: (NSTableView*)tableView + acceptDrop: (id )info + row: (int)row + dropOperation: (NSTableViewDropOperation)operation; +- (NSDragOperation) tableView: (NSTableView*)tableView + validateDrop: (id )info + proposedRow: (int)row + proposedDropOperation: (NSTableViewDropOperation)operation; +- (BOOL) tableView: (NSTableView *)tableView + writeRows: (NSArray*)rows + toPasteboard: (NSPasteboard*)pboard; +@end + +APPKIT_EXPORT NSString *NSTableViewColumnDidMoveNotification; +APPKIT_EXPORT NSString *NSTableViewColumnDidResizeNotification; +APPKIT_EXPORT NSString *NSTableViewSelectionDidChangeNotification; +APPKIT_EXPORT NSString *NSTableViewSelectionIsChangingNotification; + +/* + * Methods Implemented by the Delegate + */ + +@interface NSObject (NSTableViewDelegate) + +- (BOOL) selectionShouldChangeInTableView: (NSTableView *)aTableView; +- (void) tableView: (NSTableView*)tableView +didClickTableColumn: (NSTableColumn *)tableColumn; +- (void) tableView: (NSTableView*)tableView +didDragTableColumn: (NSTableColumn *)tableColumn; +- (void) tableView: (NSTableView*)tableView +mouseDownInHeaderOfTableColumn: (NSTableColumn *)tableColumn; +- (BOOL)tableView: (NSTableView *)aTableView +shouldEditTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex; +- (BOOL) tableView: (NSTableView *)aTableView + shouldSelectRow: (int)rowIndex; +- (BOOL) tableView: (NSTableView *)aTableView +shouldSelectTableColumn: (NSTableColumn *)aTableColumn; +- (void) tableView: (NSTableView *)aTableView + willDisplayCell: (id)aCell + forTableColumn: (NSTableColumn *)aTableColumn + row: (int)rowIndex; +- (void) tableViewColumnDidMove: (NSNotification *)aNotification; +- (void) tableViewColumnDidResize: (NSNotification *)aNotification; +- (void) tableViewSelectionDidChange: (NSNotification *)aNotification; +- (void) tableViewSelectionIsChanging: (NSNotification *)aNotification; + +@end + +#endif /* _GNUstep_H_NSTableView */ diff --git a/Headers/AppKit/NSText.h b/Headers/AppKit/NSText.h new file mode 100644 index 000000000..424a43f8e --- /dev/null +++ b/Headers/AppKit/NSText.h @@ -0,0 +1,305 @@ +/* -*-objc-*- + NSText.h + + The text object + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Author: Felipe A. Rodriguez + Date: July 1998 + Author: Daniel Bðhringer + Date: August 1998 + Author: Nicola Pero + Date: December 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSText +#define _GNUstep_H_NSText + +/* + * The NSText class is now an abstract class. When you allocate an + * instance of NSText, an instance of NSTextView is always allocated + * instead. + * + * But you can still subclass NSText to implement your own text + * editing class not derived from NSTextView. NSText declares general + * methods that a text editing object should have; it has some helper + * methods which are simple wrappers around the real basic editing + * methods. The real editing methods are not implemented in NSText, + * which is why it is abstract. To make a working subclass, you need to + * implement these methods, marked as "PRIMITIVE" below. + * + * The working subclass could potentially be implemented in absolutely + * *any* way you want. I have been told that some versions of Emacs can + * be embedded as an X subwindow inside alien widgets and windows - so + * yes, potentially if you are able to figure out how to embed Emacs + * inside the GNUstep NSView tree, you can write a subclass of NSText + * which just uses Emacs. */ + +#include +#include +#include + +@class NSString; +@class NSData; +@class NSNotification; +@class NSColor; +@class NSFont; + +typedef enum _NSTextAlignment { + NSLeftTextAlignment = 0, + NSRightTextAlignment, + NSCenterTextAlignment, + NSJustifiedTextAlignment, + NSNaturalTextAlignment +} NSTextAlignment; + +enum { + NSIllegalTextMovement = 0, + NSReturnTextMovement = 0x10, + NSTabTextMovement = 0x11, + NSBacktabTextMovement = 0x12, + NSLeftTextMovement = 0x13, + NSRightTextMovement = 0x14, + NSUpTextMovement = 0x15, + NSDownTextMovement = 0x16 +}; + +enum { + NSParagraphSeparatorCharacter = 0x2029, + NSLineSeparatorCharacter = 0x2028, + NSTabCharacter = 0x0009, + NSFormFeedCharacter = 0x000c, + NSNewlineCharacter = 0x000a, + NSCarriageReturnCharacter = 0x000d, + NSEnterCharacter = 0x0003, + NSBackspaceCharacter = 0x0008, + NSBackTabCharacter = 0x0019, + NSDeleteCharacter = 0x007f, +}; + + +/* The following are required by the original openstep doc. */ +enum { + NSBackspaceKey = 8, + NSCarriageReturnKey = 13, + NSDeleteKey = 0x7f, + NSBacktabKey = 25 +}; + +#include + +@interface NSText : NSView +{ +} + +/* + * Getting and Setting Contents + */ +/* these aren't in OPENSTEP */ +- (void) replaceCharactersInRange: (NSRange)aRange + withRTF: (NSData*)rtfData; +- (void) replaceCharactersInRange: (NSRange)aRange + withRTFD: (NSData*)rtfdData; +/* PRIMITIVE */ +- (void) replaceCharactersInRange: (NSRange)aRange + withString: (NSString*)aString; +/* PRIMITIVE */ +-(void) replaceCharactersInRange: (NSRange)aRange /* GNUstep extension */ + withAttributedString: (NSAttributedString *)attrString; +/* PRIMITIVE */ +- (void) setString: (NSString*)aString; +/* PRIMITIVE */ +- (NSString*) string; + +/* + * Old fashioned OpenStep methods (wrappers for the previous ones) + */ +- (void) replaceRange: (NSRange)aRange withString: (NSString*)aString; /* not OPENSTEP */ +- (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData; +- (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData; +- (void) setText: (NSString*)aString; +- (void) setText: (NSString*)aString range: (NSRange)aRange; /* not OPENSTEP */ +- (NSString*) text; + +/* + * Graphic attributes + */ +/* PRIMITIVE */ +- (NSColor*) backgroundColor; +/* PRIMITIVE */ +- (BOOL) drawsBackground; +/* PRIMITIVE */ +- (void) setBackgroundColor: (NSColor*)color; +/* PRIMITIVE */ +- (void) setDrawsBackground: (BOOL)flag; + +/* + * Managing Global Characteristics + */ +- (BOOL) importsGraphics; /* PRIMITIVE */ +- (BOOL) isEditable; /* PRIMITIVE */ +- (BOOL) isFieldEditor; /* PRIMITIVE */ +- (BOOL) isRichText; /* PRIMITIVE */ +- (BOOL) isSelectable; /* PRIMITIVE */ +- (void) setEditable: (BOOL)flag; /* PRIMITIVE */ +- (void) setFieldEditor: (BOOL)flag; /* PRIMITIVE */ +- (void) setImportsGraphics: (BOOL)flag; /* PRIMITIVE */ +- (void) setRichText: (BOOL)flag; /* PRIMITIVE */ +- (void) setSelectable: (BOOL)flag; /* PRIMITIVE */ + +/* + * Using the font panel + */ +- (void) setUsesFontPanel: (BOOL)flag; /* PRIMITIVE */ +- (BOOL) usesFontPanel; /* PRIMITIVE */ + +/* + * Managing the Ruler + */ +- (BOOL) isRulerVisible; /* PRIMITIVE */ +- (void) toggleRuler: (id)sender; /* PRIMITIVE */ + +/* + * Managing the Selection + */ +- (NSRange) selectedRange; +- (void) setSelectedRange: (NSRange)range; + +/* + * Responding to Editing Commands + */ +- (void) copy: (id)sender; /* PRIMITIVE */ +- (void) copyFont: (id)sender; /* PRIMITIVE */ +- (void) copyRuler: (id)sender; /* PRIMITIVE */ +- (void) cut: (id)sender; +- (void) delete: (id)sender; /* PRIMITIVE */ +- (void) paste: (id)sender; /* PRIMITIVE */ +- (void) pasteFont: (id)sender; /* PRIMITIVE */ +- (void) pasteRuler: (id)sender; /* PRIMITIVE */ +- (void) selectAll: (id)sender; + +/* + * Managing Font + */ +- (void) changeFont: (id)sender; /* PRIMITIVE */ +- (NSFont*) font; /* PRIMITIVE */ +- (void) setFont: (NSFont*)font; /* PRIMITIVE */ +- (void) setFont: (NSFont*)font range: (NSRange)aRange; /* PRIMITIVE */ +/* Old OpenStep name for the same method. */ +- (void) setFont: (NSFont*)font ofRange: (NSRange)aRange; + +/* + * Managing Alignment + */ +- (NSTextAlignment) alignment; /* PRIMITIVE */ +- (void) setAlignment: (NSTextAlignment)mode; /* PRIMITIVE */ +- (void) alignCenter: (id)sender; /* PRIMITIVE */ +- (void) alignLeft: (id)sender; /* PRIMITIVE */ +- (void) alignRight: (id)sender; /* PRIMITIVE */ + +/* + * Text colour + */ +- (void) setTextColor: (NSColor*)color range: (NSRange)aRange; /* PRIMITIVE */ /* not OPENSTEP */ +- (void) setColor: (NSColor*)color ofRange: (NSRange)aRange; /* PRIMITIVE */ +- (void) setTextColor: (NSColor*)color; /* PRIMITIVE */ +- (NSColor*) textColor; /* PRIMITIVE */ + +/* + * Text attributes + */ +- (void) subscript: (id)sender; /* PRIMITIVE */ +- (void) superscript: (id)sender; /* PRIMITIVE */ +- (void) underline: (id)sender; /* PRIMITIVE */ +- (void) unscript: (id)sender; /* PRIMITIVE */ + +/* + * Reading and Writing RTFD Files + */ +-(BOOL) readRTFDFromFile: (NSString*)path; /* PRIMITIVE */ +-(BOOL) writeRTFDToFile: (NSString*)path atomically: (BOOL)flag; /* PRIMITIVE */ +-(NSData*) RTFDFromRange: (NSRange)aRange; /* PRIMITIVE */ +-(NSData*) RTFFromRange: (NSRange)aRange; /* PRIMITIVE */ + +/* + * Sizing the Frame Rectangle + */ +- (BOOL) isHorizontallyResizable; /* PRIMITIVE */ +- (BOOL) isVerticallyResizable; /* PRIMITIVE */ +- (NSSize) maxSize; /* PRIMITIVE */ +- (NSSize) minSize; /* PRIMITIVE */ +- (void) setHorizontallyResizable: (BOOL)flag; /* PRIMITIVE */ +- (void) setMaxSize: (NSSize)newMaxSize; /* PRIMITIVE */ +- (void) setMinSize: (NSSize)newMinSize; /* PRIMITIVE */ +- (void) setVerticallyResizable: (BOOL)flag; /* PRIMITIVE */ +- (void) sizeToFit; /* PRIMITIVE */ + +/* + * Spelling + */ +- (void) checkSpelling: (id)sender; /* PRIMITIVE */ +- (void) showGuessPanel: (id)sender; + +/* + * Scrolling + */ +- (void) scrollRangeToVisible: (NSRange)aRange; /* PRIMITIVE */ + +/* + * Managing the Delegate + */ +- (id) delegate; /* PRIMITIVE */ +- (void) setDelegate: (id)anObject; /* PRIMITIVE */ + +/* + * NSChangeSpelling protocol + */ +- (void) changeSpelling: (id)sender; /* PRIMITIVE */ + +/* + * NSIgnoreMisspelledWords protocol + */ +- (void) ignoreSpelling: (id)sender; /* PRIMITIVE */ /* not OPENSTEP */ +@end + +@interface NSText (GNUstepExtensions) + +- (unsigned) textLength; /* PRIMITIVE */ + +@end + +/* Notifications */ +APPKIT_EXPORT NSString *NSTextDidBeginEditingNotification; +APPKIT_EXPORT NSString *NSTextDidEndEditingNotification; +APPKIT_EXPORT NSString *NSTextDidChangeNotification; + +@interface NSObject (NSTextDelegate) +- (BOOL) textShouldBeginEditing: (NSText*)textObject; /* YES means do it */ +- (BOOL) textShouldEndEditing: (NSText*)textObject; /* YES means do it */ +- (void) textDidBeginEditing: (NSNotification*)notification; +- (void) textDidEndEditing: (NSNotification*)notification; +- (void) textDidChange: (NSNotification*)notification; /* Any keyDown or paste which changes the contents causes this */ +@end + +#endif // _GNUstep_H_NSText + diff --git a/Headers/AppKit/NSTextAttachment.h b/Headers/AppKit/NSTextAttachment.h new file mode 100644 index 000000000..802421dec --- /dev/null +++ b/Headers/AppKit/NSTextAttachment.h @@ -0,0 +1,187 @@ +/* + NSTextAttachment.h + + Classes to represent text attachments. + + NSTextAttachment is used to represent text attachments. When inline, + text attachments appear as the value of the NSAttachmentAttributeName + attached to the special character NSAttachmentCharacter. + + NSTextAttachment uses an object obeying the NSTextAttachmentCell + protocol to get input from the user and to display an image. + + NSTextAttachmentCell is a simple subclass of NSCell which provides + the NSTextAttachment protocol. + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Daniel Bðhringer + Date: August 1998 + Source by Daniel Bðhringer integrated into GNUstep gui + by Felipe A. Rodriguez + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. +*/ + +#ifndef _GNUstep_H_NSTextAttachment +#define _GNUstep_H_NSTextAttachment + +#ifndef STRICT_OPENSTEP + +#include +#include + +@class NSTextContainer; +@class NSFileWrapper; +@class NSTextAttachment; +@class NSLayoutManager; + +enum { + NSAttachmentCharacter = 0xfffc /* To denote attachments. */ +}; + +/* + These are the only methods required of cells in text attachments... + The default NSCell class implements most of these; the NSTextAttachmentCell + class is a subclass which implements all and provides some additional + functionality. + */ +@protocol NSTextAttachmentCell +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; +- (void)drawWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView + characterIndex:(unsigned)charIndex; +- (void)drawWithFrame:(NSRect)cellFrame + inView:(NSView *)controlView + characterIndex:(unsigned)charIndex + layoutManager:(NSLayoutManager *)layoutManager; +- (void)highlight:(BOOL)flag + withFrame:(NSRect)cellFrame + inView:(NSView *)controlView; + + +/** The old way of placing the cell. The text system will never call +these directly (TODO: make sure it doesn't), but other things might. The +class implements the new method by calling these, so subclasses can +easily change behavior by overriding these. **/ + +- (NSSize)cellSize; + +/* Returns the offset from the current point when typesetting to the lower +left corner of the cell. The class returns (0,0). Positive y is probably +up. (TODO) */ +- (NSPoint)cellBaselineOffset; + + +/** The new way of placing the cell. **/ + +/* Returns the rectangle in which the cell should be drawn. The rectangle +is relative to the current point when typesetting. Positive y is probably +up. (TODO) + +lineFrag is the line frag rect that this cell might be placed in, and +position is the current position in that line frag rect (positive y is +probably down (TODO)). Note that the line frag rect and glyph position +may not be where the cell is actually placed. + +Note that this might be called many times for the same attachment. Eg. if +you return a rectangle that won't fit in the proposed line frag rect, the +typesetter might try to adjust things so it will fit. It will then send +this message with a new proposed line frag rect and glyph position. Thus, +great care must be taken when using the line frag rect to calculate the +returned rectangle to prevent the typesetting process from getting stuck. + +The class uses -cellSize and -cellBaselineOffset to return a rect. +*/ +-(NSRect) cellFrameForTextContainer: (NSTextContainer *)textContainer + proposedLineFragment: (NSRect)lineFrag + glyphPosition: (NSPoint)position + characterIndex: (unsigned int)charIndex; + + +- (BOOL)wantsToTrackMouse; +- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent + inRect:(NSRect)cellFrame + ofView:(NSView *)controlView + atCharacterIndex:(unsigned)charIndex; +- (BOOL)trackMouse:(NSEvent *)theEvent + inRect:(NSRect)cellFrame + ofView:(NSView *)controlView + untilMouseUp:(BOOL)flag; +- (BOOL)trackMouse:(NSEvent *)theEvent + inRect:(NSRect)cellFrame + ofView:(NSView *)controlView + atCharacterIndex:(unsigned)charIndex + untilMouseUp:(BOOL)flag; +- (void)setAttachment:(NSTextAttachment *)anObject; +- (NSTextAttachment *)attachment; +@end + + +/* + Simple class to provide basic attachment cell functionality. + By default this class causes NSTextView to send out delegate + messages when the attachment is clicked on or dragged. + */ +@interface NSTextAttachmentCell : NSCell { + NSTextAttachment *_attachment; +} +@end + + +@interface NSTextAttachment : NSObject { + NSFileWrapper *_fileWrapper; + id _cell; +} + +/* + Designated initializer. + */ +- (id)initWithFileWrapper:(NSFileWrapper *)fileWrapper; + +/* + The fileWrapper is the meat of most types of attachment. + It can be set or queried with these methods. An NSTextAttachment + usually has a fileWrapper. setFileWrapper does not update the + attachment's cell in any way. + */ +- (void)setFileWrapper:(NSFileWrapper *)fileWrapper; +- (NSFileWrapper *)fileWrapper; + +/* + The cell which handles user interaction. + By default an instance of NSTextAttachmentCell is used. + */ +- (id )attachmentCell; +- (void)setAttachmentCell:(id )cell; + +@end + +@interface NSAttributedString (NSTextAttachment) ++ (NSAttributedString*) attributedStringWithAttachment: + (NSTextAttachment*)attachment; +- (BOOL) containsAttachments; +@end + +@interface NSMutableAttributedString (NSTextAttachment) +- (void) updateAttachmentsFromPath: (NSString *)path; +@end + +#endif + +#endif /* _GNUstep_H_NSTextAttachment */ + diff --git a/Headers/AppKit/NSTextContainer.h b/Headers/AppKit/NSTextContainer.h new file mode 100644 index 000000000..0e44df08d --- /dev/null +++ b/Headers/AppKit/NSTextContainer.h @@ -0,0 +1,265 @@ +/* + NSTextContainer.h + + Text container for text system + + Copyright (C) 1999 Free Software Foundation, Inc. + + Author: Alexander Malmberg + Date: April 2003 + + Author: Jonathan Gapen + Date: 1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/** +A text container defines a region in the plane. It is used by the +text system to lay out text: text is laid out inside this region. A layout +manager has a list of text containers that it lays out text in. A text +container may have one NSTextView attached to it that displays the text laid +out in the text container. + +Note that the coordinate system used by NSTextContainer is the +same as in the rest of the text system classes, ie. positive y is down. + +NSTextContainer itself defines a simple rectangular region as large as the +container size. In most cases, only a single, simple text container is used +with a layout manager and a text view. Examples of cases where you might want +to use several text containers, or subclasses that define more complex +regions, are: + + + + Multi-page layout; one text container for each page. + + Multi-column layout; one text container for each column. + + Layout flowing around pictures; the text container would define a region + that does not include the space used by the picture. + + + +If the region defined by a text container can change dynamically, the text +container should call [GSLayoutManager-textContainerChangedGeometry:] +whenever this happens. +*/ + +#ifndef _GNUstep_H_NSTextContainer +#define _GNUstep_H_NSTextContainer + +#ifdef STRICT_OPENSTEP +#error "The OpenStep specification does not define an NSTextContainer class." +#endif + +#include + +@class GSLayoutManager; +@class NSTextView; + +typedef enum { + NSLineSweepLeft, + NSLineSweepRight, + NSLineSweepDown, + NSLineSweepUp +} NSLineSweepDirection; + +typedef enum { + NSLineMoveLeft, + NSLineMoveRight, + NSLineMoveDown, + NSLineMoveUp, + NSLineDoesntMove +} NSLineMovementDirection; + +@interface NSTextContainer : NSObject +{ + id _layoutManager; + id _textView; + + NSRect _containerRect; + float _lineFragmentPadding; + + BOOL _observingFrameChanges; + BOOL _widthTracksTextView; + BOOL _heightTracksTextView; +} + +/** +Initializes a new instance and sets the container size to aSize. +*/ +- (id) initWithContainerSize: (NSSize)aSize; + + +/** +Querying the region +*/ + +/** +Returns YES if the region for this container is a rectangle +as large as the container size, otherwise NO. For simple rectangular regions, +the text system can apply certain optimizations. + +NSTextContainer always returns YES. Subclasses that define more complex +regions must return NO. +*/ +- (BOOL) isSimpleRectangularTextContainer; + +/** +This is the main method used by the text system for querying the region +and flowing text in it. It takes a proposed line fragment rectangle and, +if possible, splits it into a valid line fragment rectangle, and a remaining +rectangle that can be used in subsequent calls to this method. + +sweepDir is the direction that text moves inside the lines, and moveDir is +the direction lines move in, or NSLineDoesntMove if the line may not move. +The line sweep and line movement may not both be in the same dimension, ie. +both be vertical, or both be horizontal. + +The method returns the first (according to the sweep direction) valid line +fragment rectangle in the proposed rectangle. This line fragment rectangle +is a sub-rectangle of the proposed rectangle in the sweep direction, and has +the same size in the other direction. (Ie. if the sweep direction is left, +the line fragment rectangle must have the same height as the proposed +rectangle.) If there is no valid line fragment rectangle in the proposed +rectangle, the proposed rectangle may be moved in the line movement direction +until there is one. If no valid line fragment rectangle can be returned, +the method returns NSZeroRect. + +The remaining rectangle should be set to the potentially valid part of the +proposed rectangle, after moving in the line movement direction, that remains +after the first line fragment rectangle. + +The proposed rectangle may be any rectangle; in particular, it may extend +outside the container size. The remaining rectangle does not have to be or +contain a valid line fragment rectangle. + +Subclasses define regions by overriding this method. + +Note: The TextContainerExample in the text system example collection +(TODO: link) contains an example implementation of an NSTextContainer subclass +that defiens a non-trivial region, as well as an interactive demonstration of +this method. It can also be used as a simple test of custom subclasses. + +Note: Although a correct NSTextContainer implementation must handle all line +sweep and movement directions, the current standard typesetter will only call +this method with sweep right, and no movement or movement down. Relying on +this makes writing a subclass easier, but it is not safe. +*/ +- (NSRect) lineFragmentRectForProposedRect: (NSRect)proposedRect + sweepDirection: (NSLineSweepDirection)sweepDir + movementDirection: (NSLineMovementDirection)moveDir + remainingRect: (NSRect *)remainingRect; + +/** +Returns YES if aPoint is inside the region. + +Subclasses define regions by overriding this method. +*/ +- (BOOL) containsPoint: (NSPoint)aPoint; + + +/** +Managing the text network
+ +A text container may be attached to one layout manager and one text view. +The text container is retained by the layout manager, and retains the text +view. +*/ + +/** +Replaces the layout manager of this text container with aLayoutManager. +This is done without changing the rest of the text network, so +aLayoutManager will be connected to the text storage and text containers +that the current layout manager is connected to. +*/ +- (void) replaceLayoutManager: (GSLayoutManager *)aLayoutManager; + +/** +Returns the layout manager of this text container. +*/ +- (GSLayoutManager *) layoutManager; + +/** +This method should not be called directly. It is called by the layout manager +when the layout manager of a text container changes. +*/ +- (void) setLayoutManager: (GSLayoutManager *)aLayoutManager; + + +/** +Sets the NSTextView for this text container. Note that a text view +should be attached to a text container only if the text container is attached +to a layout manager that can handle text views (eg. NSLayoutManager). + +The text view is retained by the text container. +*/ +- (void) setTextView: (NSTextView *)aTextView; + +/** +Returns the NSTextView attached to this text container, or nil if there is +none. +*/ +- (NSTextView *) textView; + + +/** +The container size
+ +A text container has a container size. The region defined by the text +container must be a subset of the rectangle of this size with it's top-left +corner in the origin. + +Subclasses do not have to support arbitrary sizes, and may choose to ignore +-setContainerSize: completely. However, the size returned by -containerSize +must be valid. +*/ +- (void) setContainerSize: (NSSize)aSize; +- (NSSize) containerSize; + + +/** +Automatic resizing
+ +A text container can be set to automatically track the width and/or height +of its NSTextView (TODO: frame? bounds?). For more information, see the +documentation on automatic resizing in NSTextView. (TODO: link) + +When enabled, the automatic resizing is done by calling +[NSTextContainer-setContainerSize:] with the new size whenever the text view +is resized. +*/ +- (void) setWidthTracksTextView: (BOOL)flag; +- (BOOL) widthTracksTextView; +- (void) setHeightTracksTextView: (BOOL)flag; +- (BOOL) heightTracksTextView; + + +/** +Line fragment padding
+ +The line fragment padding is an amount of space left empty at each end of +a line fragment rectangle by the standard typesetter. The default is 0.0. +*/ +- (void) setLineFragmentPadding: (float)aFloat; +- (float) lineFragmentPadding; + +@end + +#endif /* _GNUstep_H_NSTextContainer */ diff --git a/Headers/AppKit/NSTextField.h b/Headers/AppKit/NSTextField.h new file mode 100644 index 000000000..177ae3f7f --- /dev/null +++ b/Headers/AppKit/NSTextField.h @@ -0,0 +1,118 @@ +/* + NSTextField.h + + Text field control class for text entry + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTextField +#define _GNUstep_H_NSTextField + +#include + +@class NSNotification; +@class NSColor; +@class NSText; +@class NSCursor; + +@interface NSTextField : NSControl +{ + // Attributes + id _delegate; + SEL _error_action; + NSText *_text_object; +} + +// +// Setting User Access to Text +// +- (BOOL)isEditable; +- (BOOL)isSelectable; +- (void)setEditable:(BOOL)flag; +- (void)setSelectable:(BOOL)flag; + +// +// Editing Text +// +- (void)selectText:(id)sender; + +// +// Setting Tab Key Behavior +// +- (id)nextText; +- (id)previousText; +- (void)setNextText:(id)anObject; +- (void)setPreviousText:(id)anObject; + +// +// Assigning a Delegate +// +- (void)setDelegate:(id)anObject; +- (id)delegate; + +// +// Modifying Graphic Attributes +// +- (NSColor *)backgroundColor; +- (BOOL)drawsBackground; +- (BOOL)isBezeled; +- (BOOL)isBordered; +- (void)setBackgroundColor:(NSColor *)aColor; +- (void)setBezeled:(BOOL)flag; +- (void)setBordered:(BOOL)flag; +- (void)setDrawsBackground:(BOOL)flag; +- (void)setTextColor:(NSColor *)aColor; +- (NSColor *)textColor; + +// +// Target and Action +// +- (SEL)errorAction; +- (void)setErrorAction:(SEL)aSelector; + +// +// Handling Events +// +- (BOOL)acceptsFirstResponder; +- (void)textDidBeginEditing:(NSNotification *)aNotification; +- (void)textDidChange:(NSNotification *)aNotification; +- (void)textDidEndEditing:(NSNotification *)aNotification; +- (BOOL)textShouldBeginEditing:(NSText *)textObject; +- (BOOL)textShouldEndEditing:(NSText *)textObject; + +#ifndef STRICT_OPENSTEP +// +// Rich Text +// +- (void)setAllowsEditingTextAttributes:(BOOL)flag; +- (BOOL)allowsEditingTextAttributes; +- (void)setImportsGraphics:(BOOL)flag; +- (BOOL)importsGraphics; + +- (void)setTitleWithMnemonic:(NSString *)aString; +#endif + +@end + +#endif // _GNUstep_H_NSTextField diff --git a/Headers/AppKit/NSTextFieldCell.h b/Headers/AppKit/NSTextFieldCell.h new file mode 100644 index 000000000..5ee0e3e7f --- /dev/null +++ b/Headers/AppKit/NSTextFieldCell.h @@ -0,0 +1,71 @@ +/* + NSTextFieldCell.h + + Cell class for the text field entry control + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTextFieldCell +#define _GNUstep_H_NSTextFieldCell + +#include + +@class NSColor; + +@interface NSTextFieldCell : NSActionCell +{ + // Attributes + NSColor *_background_color; + NSColor *_text_color; + // Think of the following ones as of two BOOL ivars +#define _textfieldcell_draws_background _cell.subclass_bool_one + // The following is different from _draws_background + // if we are using a semi-transparent color. +#define _textfieldcell_is_opaque _cell.subclass_bool_two +} + +// +// Modifying Graphic Attributes +// +- (void)setTextColor:(NSColor *)aColor; +- (NSColor *)textColor; + +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; + +- (void)setBackgroundColor:(NSColor *)aColor; +- (NSColor *)backgroundColor; + +- (id)setUpFieldEditorAttributes: (NSText *)textObject; + + +// +// NSCoding protocol +// +- (void)encodeWithCoder: (NSCoder *)aCoder; +- initWithCoder: (NSCoder *)aDecoder; + +@end + +#endif // _GNUstep_H_NSTextFieldCell diff --git a/Headers/AppKit/NSTextStorage.h b/Headers/AppKit/NSTextStorage.h new file mode 100644 index 000000000..6561cf48e --- /dev/null +++ b/Headers/AppKit/NSTextStorage.h @@ -0,0 +1,172 @@ +/* + NSTextStorage.h + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Daniel Bðhringer + Date: August 1998 + Source by Daniel Bðhringer integrated into GNUstep gui + by Felipe A. Rodriguez + Update: Richard Frith-Macdonald + + Documentation written from scratch by: Nicola Pero + + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + +#ifndef _GNUstep_H_NSTextStorage +#define _GNUstep_H_NSTextStorage + +#include +#include + +@class GSLayoutManager; + +/* + * When edit:range:changeInLength: is called, it takes a mask saying + * what has been edited. The mask is NSTextStorageEditedAttributes + * if the attributes have been changed, NSTextStorageEditedCharacters + * if the characters have been changed, and + * NSTextStorageEditedAttributes | NSTextStorageEditedCharacters if both + * characters and attributes were edited. + */ +enum +{ + NSTextStorageEditedAttributes = 1, + NSTextStorageEditedCharacters = 2 +}; + +/* + * The NSTextStorage + */ +@interface NSTextStorage : NSMutableAttributedString +{ + NSRange _editedRange; + int _editedDelta; + NSMutableArray *_layoutManagers; + id _delegate; + unsigned _editedMask; + unsigned _editCount; +} + +- (void) addLayoutManager: (GSLayoutManager*)obj; +- (void) removeLayoutManager: (GSLayoutManager*)obj; +- (NSArray*) layoutManagers; + +/* + * This method is normally called between a beginEditing and an + * endEditing message to record any changes which were made to the + * receiver. It is automatically called by the NSTextStorage + * primitives, so in other words, NSTextStorage calls it for you, and + * you don't normally need to call this method. You might (a more + * theoretical than practical option) need to subclass it and override + * this method to take into account changes done. + * + * If the method is called outside a beginEditing/endEditing calls, it + * calls processEditing immediately. As far as I understand, that would + * happen if you modify the NSTextStorage without enclosing your changes + * inside a beginEditing/endEditing calls. + * + * maks can be NSTextStorageEditedAttributes or + * NSTextStorageEditedCharacters, or and | of the two. + * + * the old range is the range affected by the change in the string ... in the + * original string. + * + * the changeInLength is, well, positive if you added characters, negative + * if you removed characters. */ +- (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta; + +/* + * This method is called to process the editing once it's finished. + * Normally it is called by endEditing; but if you modify the NSTextStorage + * without enclosing the modifications into a beginEditing/endEditing pair, + * this method will be called directly by edited:range:changeInLength:. + * + * But in practice, what does this method do ? Well, it posts the + * NSTextStorageWillProcessEditing notification. Then, it calls + * fixAttributesAfterEditingRange:. Then, it posts the + * NSTextStorageDidProcessEditing notification. Finally, it tells the + * layout manager(s) about this change in the text storage by calling + * textStorage:edited:range:changeInLength:invalidatedRange:. */ +- (void) processEditing; + +/* + * Start a set of changes to the text storage. All the changes are + * recorded and merged - without any layout to be done. When you call + * endEditing, the layout will be done in one single operation. + * + * In practice, you should call beginEditing before starting to modify + * the NSTextStorage. When you are finished modifying it and you want + * your changes to be propagated to the layout manager(s), you call + * endEditing. + * + * If you don't enclose your changes into a beginEditing/endEditing pair, + * it still works, but it's less efficient. + */ +- (void) beginEditing; + +/* + * End a set of changes, and calls processEditing. + */ +- (void) endEditing; + +/* + * The delegate can use the following methods when it receives a + * notification that a change was made. The methods tell him what + * kind of change was made. */ +- (unsigned) editedMask; +- (NSRange) editedRange; +- (int) changeInLength; + +- (void) setDelegate: (id)delegate; +- (id) delegate; + +#ifndef STRICT_OPENSTEP +- (void) ensureAttributesAreFixedInRange: (NSRange)range; +- (BOOL) fixesAttributesLazily; +- (void) invalidateAttributesInRange: (NSRange)range; +#endif + +@end + + +/**** NSTextStorage delegate methods ****/ + +@interface NSObject (NSTextStorageDelegate) + +/* + * The delegate is automatically registered to receive the + * NSTextStorageWillProcessEditingNotification, and the + * NSTextStorageDidProcessEditingNotification via these methods, so + * once the notifications are sent, these methods of the delegate will + * be invokes. In these methods the delegate can use editedMask, + * editedRange, changeInLength to figure out what the actual change + * is. + */ +- (void) textStorageWillProcessEditing: (NSNotification*)notification; +- (void) textStorageDidProcessEditing: (NSNotification*)notification; + +@end + +/**** Notifications ****/ + +/* The object of the notification is the NSTextStorage itself. */ +APPKIT_EXPORT NSString *NSTextStorageWillProcessEditingNotification; +APPKIT_EXPORT NSString *NSTextStorageDidProcessEditingNotification; + +#endif diff --git a/Headers/AppKit/NSTextView.h b/Headers/AppKit/NSTextView.h new file mode 100644 index 000000000..6f2a9d595 --- /dev/null +++ b/Headers/AppKit/NSTextView.h @@ -0,0 +1,622 @@ +/* -*-objc-*- + NSTextView.h + + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + + Author: Fred Kiefer + Date: September 2000 + Reformatted and cleaned up. + + Author: Nicola Pero + Date: December 2000 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSTextView +#define _GNUstep_H_NSTextView + +#include +#include +#include +#include + +@class NSTimer; +@class NSTextContainer; +@class NSTextStorage; +@class NSLayoutManager; +@class NSRulerView,NSRulerMarker; + + +typedef enum _NSSelectionGranularity { + NSSelectByCharacter = 0, + NSSelectByWord = 1, + NSSelectByParagraph = 2, +} NSSelectionGranularity; + + +/* TODO: this looks like a mosx extension, not a GNUstep extension. should +double-check */ +typedef enum _NSSelectionAffinity { + NSSelectionAffinityUpstream = 0, + NSSelectionAffinityDownstream = 1, +} NSSelectionAffinity; + + +/* +If several NSTextView:s are connected to one NSLayoutManager, some attributes +are shared between them. This is done in two ways: storing the attributes in +the NSLayoutManager, or storing a copy in each NSTextView and ensuring that +the any changes are replicated in all of them. + +Persistant attributes (ie. attributes that are encoded and decoded) need to +be stored in the NSTextView. Non-persistant attributes don't, and should +therefore be stored in the NSLayoutManager to avoid problems. +*/ + +@interface NSTextView : NSText +{ + /* These attributes are shared by all text views attached to a layout + manager. Any changes must be replicated in all those text views. */ + id _delegate; + struct GSTextViewFlagsType { + unsigned is_field_editor:1; + unsigned is_editable:1; + unsigned is_selectable:1; + unsigned is_rich_text:1; + unsigned imports_graphics:1; + + unsigned uses_font_panel:1; + + unsigned uses_ruler:1; + unsigned is_ruler_visible:1; + + /* I don't know for sure that these are supposed to be shared, but it + would be very awkward if they weren't. */ + unsigned allows_undo:1; + unsigned smart_insert_delete:1; + /* End of shared attributes. */ + + + unsigned draws_background:1; + + unsigned is_horizontally_resizable:1; + unsigned is_vertically_resizable:1; + + /* owns_text_network is YES if we have created the whole network + of text classes (and thus we are responsible to release them + when we are released). + + owns_text_network in NO if the text network was assembled by + hand, and the text storage owns everything - thus we need to + release nothing. + + See -initWithFrame: for more comments about this. */ + unsigned owns_text_network:1; + + + /* multiple_textviews is YES if more than one NSTextView are + sharing this layout manager. In this case, we need to keep the + views in sync. */ + unsigned multiple_textviews:1; + + /* These two really are shared, but they're cached, They must be updated + whenever the delegate changes (including indirect changes). */ + /* YES if delegate responds to + `shouldChangeTextInRange:replacementString:' */ + unsigned delegate_responds_to_should_change:1; + /* YES if delegate responds to + `textView:willChangeSelectionFromCharacterRange:toCharacterRange:' */ + unsigned delegate_responds_to_will_change_sel:1; + } _tf; + + + /* TODO: figure out whether these should be shared or not */ + NSColor *_insertionPointColor; /* shared? */ + + NSDictionary *_selectedTextAttributes; /* shared? */ + NSDictionary *_markedTextAttributes; /* shared? */ + + + /* shared by all text views attached to one NSTextStorage */ + int _spellCheckerDocumentTag; + + + NSColor *_backgroundColor; + + NSSize _minSize; + NSSize _maxSize; + + + /* The following is the object used when posting notifications. + It is usually `self' - but in the case of multiple textviews + it is the firstTextView returned by the layout manager - which + might or might not be `self'. This must *not* be retained. */ + NSTextView *_notifObject; + + + /* other members of the text network */ + NSTextContainer *_textContainer; + NSLayoutManager *_layoutManager; + NSTextStorage *_textStorage; + + /* container inset and origin */ + NSSize _textContainerInset; + NSPoint _textContainerOrigin; + + + + /* TODO: move to NSLayoutManager? */ + /* Probably not necessary; the insertion point is always drawn in the + text view that is the first responder, so there shouldn't be any + problems with keeping track of it locally. Still need to think hard + about handling of it, though. */ +#if 0 + /* Timer used to redraw the insertion point ... FIXME - think what + happens with multiple textviews */ + NSTimer *_insertionPointTimer; + /* Blinking of the insertion point is controlled by the following + ivar ... it is YES during the little period in which the + insertion point should be drawn on screen, and NO during the + following little period in which the insertion point should not + be drawn */ + BOOL _drawInsertionPointNow; +#endif + + + /* Stores the insertion point rect - updated by + updateInsertionPointStateAndRestartTimer: - we must make sure we + call the method every time that the insertion point rect might + need to be recomputed . */ + NSRect _insertionPointRect; + + /* + This is the character index a sequence of moves in one dimension (ie. + up/down or left/right) started at. It is passed to the layout manager + and is used when an NSTextView is deciding where to move. (Eg. + NSLayoutManager tries to maintain the original horizontal position when + moving up/down.) + */ + unsigned int _originalInsertionPointCharacterIndex; + + /* + 0=no information (_originalInsertionPointCharacterIndex undefined) + 1=horizontal + 2=vertical + */ + int _currentInsertionPointMovementDirection; + + /* + TODO: + Still need to figure out what "proper behavior" is when moving between two + NSTextView:s, though. + */ +} + + +/** +Returns the default typing attributes: black text, default paragraph +style (as returned by [NSParagraphStyle defaultParagraphStyle]), and default +user font and size (as returned by [NSFont userFontOfSize: 0.0]). + +GNUstep extension. +*/ ++(NSDictionary *) defaultTypingAttributes; + + +/**** Initializing ****/ + +/* This is sent each time a view is initialized. If you subclass you +should ensure that you only register once. */ ++(void) registerForServices; + +/* Designated Initializer. container may be nil. */ +-(id) initWithFrame: (NSRect)frameRect + textContainer: (NSTextContainer *)container; + +/* This variant will create the text network (NSTextStorage, NSLayoutManager, +and a NSTextContainer). The network will be owned by the NSTextView; +releasing it will release all parts of the network. */ +-(id) initWithFrame: (NSRect)frameRect; + + +/**** Text network management ****/ + +/* The set method should not be called directly, but you might want to +override it. Gets or sets the text container for this view. +Setting the text container marks the view as needing display. The +text container calls the set method from its setTextView: method. */ +-(NSTextContainer *) textContainer; +-(void) setTextContainer: (NSTextContainer *)container; + +/* This method should be used instead of the primitive +-setTextContainer: if you need to replace a view's text container +with a new one leaving the rest of the text network intact. This method +deals with all the work of making sure the view doesn't get +deallocated and removing the old container from the layoutManager +and replacing it with the new one. */ +-(void) replaceTextContainer: (NSTextContainer *)newContainer; + +-(NSLayoutManager *) layoutManager; +-(NSTextStorage *) textStorage; + + + +/* +These two methods are for modifying the text programmatically. They +don't ask the delegate are send any notifications, and they always work +(ie. even if the text view isn't editable). + +(They are really from NSText, but redeclared here so they can be documented +here.) +*/ + +- (void) replaceCharactersInRange: (NSRange)aRange + withString: (NSString*)aString; + +/* +If the text view isn't rich-text, the attributes of aString will be ignored +and the typing attributed will be used. +*/ +-(void) replaceCharactersInRange: (NSRange)aRange /* GNUstep extension. */ + withAttributedString: (NSAttributedString *)aString; + + + +/*** Additional Font menu commands ***/ + +/* These complete the set of range: type set methods. to be equivalent +to the set of non-range taking varieties. */ +-(void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range; + + + +-(void) setRulerVisible: (BOOL)flag; +-(BOOL) usesRuler; +-(void) setUsesRuler: (BOOL)flag; +-(BOOL) isContinuousSpellCheckingEnabled; /* mosx */ +-(void) setContinuousSpellCheckingEnabled: (BOOL)flag; /* mosx */ +-(BOOL) allowsUndo; /* mosx */ +-(void) setAllowsUndo: (BOOL)flag; /* mosx */ +-(BOOL) smartInsertDeleteEnabled; +-(void) setSmartInsertDeleteEnabled: (BOOL)flag; + + +/* These methods are like paste: (from NSResponder) but they restrict +the acceptable type of the pasted data. They are suitable as menu +actions for appropriate "Paste As" submenu commands. */ +-(void) pasteAsPlainText: (id)sender; +-(void) pasteAsRichText: (id)sender; + + +/*** Dealing with user changes ***/ + +-(BOOL) shouldChangeTextInRange: (NSRange)affectedCharRange + replacementString: (NSString *)replacementString; +-(void) didChangeText; + +-(NSRange) rangeForUserTextChange; +-(NSRange) rangeForUserCharacterAttributeChange; +-(NSRange) rangeForUserParagraphAttributeChange; + + + +/*** Text container stuff ***/ + + +/* The text container inset determines the padding that the view provides +around the container. The text container is placed in a rectangle in the +text view's bounds rectangle, inset by inset.width on the left and right +edge and inset.height on the top and bottom edge. + +Thus, setting this to (3,5) will give a 3 unit border on the left edge of +the text container, a 3 unit border on the right edge, a 5 unit border on +the top edge, and a 5 unit border on the bottom edge. +*/ +-(void) setTextContainerInset: (NSSize)inset; +-(NSSize) textContainerInset; + +/* The text container's origin is the origin of the text container's +coordinate system in the text view's coordinate system. It is determined +from the current usage of the container, the container inset, and the view +size. textContainerOrigin returns this point. +{TODO: why describe how the origin is determined? atm, it's even incorrect} + +invalidateTextContainerOrigin is sent automatically whenever something +changes that might cause the origin to move. You usually do not need to call +it yourself. */ +-(NSPoint) textContainerOrigin; +-(void) invalidateTextContainerOrigin; + + +/*** Sizing methods ***/ + +/* Sets the frame size of the view to desiredSize constrained within +(effective) minimum size and maximum size, and to the directions in which +the text view is resizable. */ +-(void) setConstrainedFrameSize: (NSSize)desiredSize; + + + +-(void) setSelectedTextAttributes: (NSDictionary *)attributeDictionary; +-(NSDictionary *) selectedTextAttributes; + +-(void) setInsertionPointColor: (NSColor *)color; +-(NSColor *) insertionPointColor; + + +/*** Marked range ***/ + +-(void) setMarkedTextAttributes: (NSDictionary *)attributeDictionary; +-(NSDictionary *) markedTextAttributes; + + +#ifdef GNUSTEP +/*** Private, internal methods for (currently only) XIM support ***/ + +/* +The implementations for these are empty in NSTextView. Backends can override +these in a category. +*/ + +-(void) _updateInputMethodState; +-(void) _updateInputMethodWithInsertionPoint: (NSPoint)insertionPoint; + +#endif + +@end + + +/* +These methods are implemented in NSTextView_actions.m. See the comment in +that file for details on the split and which methods are for +user/programmatic changes of the text. +*/ +@interface NSTextView (user_actions) + +-(void) alignJustified: (id)sender; /* mosx */ + +-(void) turnOffKerning: (id)sender; +-(void) tightenKerning: (id)sender; +-(void) loosenKerning: (id)sender; +-(void) useStandardKerning: (id)sender; + +-(void) turnOffLigatures: (id)sender; +-(void) useStandardLigatures: (id)sender; +-(void) useAllLigatures: (id)sender; + +-(void) raiseBaseline: (id)sender; +-(void) lowerBaseline: (id)sender; + +-(void) toggleTraditionalCharacterShape: (id)sender; /* mosx */ + +-(void) transpose: (id)sender; /* not OPENSTEP */ + +-(void) toggleContinuousSpellChecking: (id)sender; /* mosx */ + +@end + + +@interface NSTextView (leftovers) + + + +/*** Ruler support ***/ + +-(void) rulerView: (NSRulerView *)ruler didMoveMarker: (NSRulerMarker *)marker; +-(void) rulerView: (NSRulerView *)ruler didRemoveMarker: (NSRulerMarker *)marker; +-(void) rulerView: (NSRulerView *)ruler didAddMarker: (NSRulerMarker *)marker; +-(BOOL) rulerView: (NSRulerView *)ruler shouldMoveMarker: (NSRulerMarker *)marker; +-(BOOL) rulerView: (NSRulerView *)ruler shouldRemoveMarker: (NSRulerMarker *)marker; +-(BOOL) rulerView: (NSRulerView *)ruler shouldAddMarker: (NSRulerMarker *)marker; +-(float) rulerView: (NSRulerView *)ruler + willMoveMarker: (NSRulerMarker *)marker + toLocation: (float)location; +-(float) rulerView: (NSRulerView *)ruler + willAddMarker: (NSRulerMarker *)marker + atLocation: (float)location; +-(void) rulerView: (NSRulerView *)ruler + handleMouseDown: (NSEvent *)event; + + +/*** Fine display control ***/ + +/* Like -setNeedsDisplayInRect: (NSView), bit if flag is YES, won't do any +layout. This means that it will only display the glyphs in rect that have +already been laid out. */ +-(void) setNeedsDisplayInRect: (NSRect)rect + avoidAdditionalLayout: (BOOL)flag; + +-(BOOL) shouldDrawInsertionPoint; +-(void) drawInsertionPointInRect: (NSRect)rect + color: (NSColor *)color + turnedOn: (BOOL)flag; + + +/*** Pasteboard management ***/ + +-(NSString *) preferredPasteboardTypeFromArray: (NSArray *)availableTypes + restrictedToTypesFromArray: (NSArray *)allowedTypes; /* mosx */ +-(BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard; /* mosx */ +-(BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard + type: (NSString *)type; /* mosx */ +-(NSArray *) readablePasteboardTypes; /* mosx */ +-(NSArray *) writablePasteboardTypes; /* mosx */ +-(BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard + type: (NSString *)type; /* mosx */ +-(BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard + types: (NSArray *)types; /* mosx */ + +/* TODO: check that this belongs under pasteboard management */ +-(id) validRequestorForSendType: (NSString *)sendType + returnType: (NSString *)returnType; /* mosx */ + + +/*** Drag and drop handling ***/ + +-(NSImage *) dragImageForSelectionWithEvent: (NSEvent *)event + origin: (NSPoint *)origin; /* mosx */ +-(unsigned int) dragOperationForDraggingInfo: (id )dragInfo + type: (NSString *)type; /* mosx */ +-(BOOL) dragSelectionWithEvent: (NSEvent *)event + offset: (NSSize)mouseOffset + slideBack: (BOOL)slideBack; /* mosx */ + +-(void) cleanUpAfterDragOperation; /* mosx */ + + +/*** Selected range ***/ + +-(NSRange) selectionRangeForProposedRange: (NSRange)proposedCharRange + granularity: (NSSelectionGranularity)gr; + +-(NSRange) selectedRange; +-(void) setSelectedRange: (NSRange)charRange; + +-(void) setSelectedRange: (NSRange)charRange + affinity: (NSSelectionAffinity)affinity + stillSelecting: (BOOL)stillSelectingFlag; +/* Called by drawing routines to determine where to draw insertion + point */ +-(NSSelectionAffinity) selectionAffinity; +-(NSSelectionGranularity) selectionGranularity; +-(void) setSelectionGranularity: (NSSelectionGranularity)granularity; + +-(void) updateInsertionPointStateAndRestartTimer: (BOOL)restartFlag; + + + +/*** Spell checking ***/ + +-(int) spellCheckerDocumentTag; + + +/*** Smart copy/paste/delete support ***/ + +-(NSRange) smartDeleteRangeForProposedRange: (NSRange)proposedCharRange; +-(void) smartInsertForString: (NSString *)aString + replacingRange: (NSRange)charRange + beforeString: (NSString **)beforeString + afterString: (NSString **)afterString; + + +/** TODO: categorize */ + + +-(NSDictionary *) typingAttributes; +-(void) setTypingAttributes: (NSDictionary *)attrs; + +-(void) updateRuler; +-(void) updateFontPanel; + +-(NSArray *) acceptableDragTypes; +-(void) updateDragTypeRegistration; + + + +@end + + +@interface NSTextView (GSTextView_sync) +/* + * This queries the NSLayoutManager to see if it is using multiple + * text views, and saves this information in a flag, and caches the + * first text view object. The NSLayoutManager needs to call this + * method to update this information. */ +-(void) _updateMultipleTextViews; + +/* For internal use. */ +-(void) _syncTextViewsByCalling: (SEL)action withFlag: (BOOL)flag; +-(void) _recacheDelegateResponses; + +/* +NSLayoutManager will send this message to a text view when layout information +for that text view has been invalidated. +*/ +-(void) _layoutManagerDidInvalidateLayout; +@end + + +/* Note that all delegation messages come from the first text view of a +layout manager. */ + +#ifndef STRICT_OPENSTEP +@interface NSObject (NSTextViewDelegate) + +-(void) textView: (NSTextView *)textView + clickedOnCell: (id )cell + inRect: (NSRect)cellFrame; +-(void) textView: (NSTextView *)textView + clickedOnCell: (id )cell + inRect: (NSRect)cellFrame + atIndex: (unsigned)charIndex; + +-(BOOL) textView: (NSTextView *)textView clickedOnLink: (id)link; +-(BOOL) textView: (NSTextView *)textView + clickedOnLink: (id)link + atIndex: (unsigned)charIndex; + +-(void) textView: (NSTextView *)textView +doubleClickedOnCell: (id )cell + inRect: (NSRect)cellFrame; +-(void) textView: (NSTextView *)textView +doubleClickedOnCell: (id )cell + inRect: (NSRect)cellFrame + atIndex: (unsigned)charIndex; + +-(void) textView: (NSTextView *)view + draggedCell: (id )cell + inRect: (NSRect)rect event:(NSEvent *)event; +-(void) textView: (NSTextView *)view + draggedCell: (id )cell + inRect: (NSRect)rect + event: (NSEvent *)event + atIndex: (unsigned)charIndex; + +-(NSRange) textView: (NSTextView *)textView +willChangeSelectionFromCharacterRange: (NSRange)oldSelectedCharRange + toCharacterRange: (NSRange)newSelectedCharRange; + +-(void) textViewDidChangeSelection: (NSNotification *)notification; + +/* If characters are changing, replacementString is what will replace +the affectedCharRange. If attributes only are changing, +replacementString will be nil. */ +-(BOOL) textView: (NSTextView *)textView + shouldChangeTextInRange: (NSRange)affectedCharRange + replacementString: (NSString *)replacementString; + +-(BOOL) textView: (NSTextView *)textView + doCommandBySelector: (SEL)commandSelector; + +-(NSUndoManager *) undoManagerForTextView: (NSTextView *)view; +@end +#endif // STRICT_OPENSTEP + +/* NSOldNotifyingTextView -> the old view, NSNewNotifyingTextView -> +the new view. The text view delegate is not automatically +registered to receive this notification because the text machinery +will automatically switch over the delegate to observe the new +first text view as the first text view changes. */ +APPKIT_EXPORT NSString *NSTextViewWillChangeNotifyingTextViewNotification; + +APPKIT_EXPORT NSString *NSTextViewDidChangeSelectionNotification; +APPKIT_EXPORT NSString *NSOldSelectedCharacterRange; + +#endif /* _GNUstep_H_NSTextView */ + diff --git a/Headers/AppKit/NSToolbar.h b/Headers/AppKit/NSToolbar.h new file mode 100644 index 000000000..0c3f5fb22 --- /dev/null +++ b/Headers/AppKit/NSToolbar.h @@ -0,0 +1,124 @@ +/* + NSToolbar.h + + The toolbar class. + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Gregory John Casamento , + Fabien Vallon + Date: May 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSToolbar +#define _GNUstep_H_NSToolbar + +#include +#include + +@class NSArray; +@class NSMutableArray; +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; +@class NSToolbarItem; +@class NSNotification; + +/* + * Constants + */ +typedef enum +{ + NSToolbarDisplayModeDefault, + NSToolbarDisplayModeIconAndLabel, + NSToolbarDisplayModeIconOnly, + NSToolbarDisplayModeLabelOnly +} NSToolbarDisplayMode; + +APPKIT_EXPORT NSString *NSToolbarDidRemoveItemNotification; +APPKIT_EXPORT NSString *NSToolbarWillAddItemNotification; + +@interface NSToolbar : NSObject +{ + BOOL _allowsUserCustomization; + BOOL _autosavesConfiguration; + NSMutableDictionary *_configurationDictionary; + BOOL _customizationPaletteIsRunning; + id _delegate; + NSToolbarDisplayMode _displayMode; + NSString *_identifier; + BOOL _visible; + NSMutableArray *_items; + NSMutableArray *_visibleItems; + id _toolbarView; +} + +// Instance methods +- (BOOL) allowsUserCustomization; +- (BOOL) autosavesConfiguration; +- (NSDictionary*) configurationDictionary; +- (BOOL) customizationPaletteIsRunning; +- (id) delegate; +- (NSToolbarDisplayMode) displayMode; +- (NSString*) identifier; +- (id) initWithIdentifier: (NSString*)identifier; +- (void) insertItemWithItemIdentifier: (NSString*)itemIdentifier + atIndex: (int)index; +- (BOOL) isVisible; +- (NSArray*) items; +- (void) removeItemAtIndex: (int)index; +- (void) runCustomizationPalette: (id)sender; + +- (void) setAllowsUserCustomization: (BOOL)flag; +- (void) setAutosavesConfiguration: (BOOL)flag; +- (void) setConfigurationFromDictionary: (NSDictionary*)configDict; +- (void) setDelegate: (id)delegate; +- (void) setDisplayMode: (NSToolbarDisplayMode)displayMode; +- (void) setVisible: (BOOL)shown; +- (void) validateVisibleItems; +- (NSArray*) visibleItems; +@end /* interface of NSToolbar */ + +@class GSToolbarView; + +@interface NSToolbar (GNUstepPrivate) +- (GSToolbarView *) _toolbarView; +@end + +/* + * Methods Implemented by the Delegate + */ +@interface NSObject (NSToolbarDelegate) +// notification methods +- (void) toolbarDidRemoveItem: (NSNotification*)aNotification; +- (void) toolbarWillAddItem: (NSNotification*)aNotification; + +// delegate methods +// required method +- (NSToolbarItem*)toolbar: (NSToolbar*)toolbar + itemForItemIdentifier: (NSString*)itemIdentifier + willBeInsertedIntoToolbar: (BOOL)flag; +// required method +- (NSArray*) toolbarAllowedItemIdentifiers: (NSToolbar*)toolbar; +// required method +- (NSArray*) toolbarDefaultItemIdentifiers: (NSToolbar*)toolbar; +@end + +#endif /* _GNUstep_H_NSToolbar */ diff --git a/Headers/AppKit/NSToolbarItem.h b/Headers/AppKit/NSToolbarItem.h new file mode 100644 index 000000000..fb897a1d1 --- /dev/null +++ b/Headers/AppKit/NSToolbarItem.h @@ -0,0 +1,114 @@ +/* + NSToolbarItem.h + + The toolbar item class. + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Gregory John Casamento , + Fabien Vallon + Date: May 2002 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSToolbarItem +#define _GNUstep_H_NSToolbarItem + +#include +#include +#include +#include + +@class NSArray; +@class NSString; +@class NSDictionary; +@class NSMutableDictionary; +@class NSToolbar; +@class NSImage; +@class NSMenuItem; +@class NSView; + +/* + * Constants + */ +APPKIT_EXPORT NSString *NSToolbarSeperatorItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarSpaceItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarFlexibleSpaceItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarShowColorsItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarShowFontsItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarCustomizeToolbarItemIdentifier; +APPKIT_EXPORT NSString *NSToolbarPrintItemIdentifier; + +@interface NSToolbarItem : NSObject +{ + // externally visible variables + SEL _action; + BOOL _allowsDuplicatesInToolbar; + BOOL _enabled; + NSImage *_image; + NSString *_itemIdentifier; + NSString *_label; + NSSize _maxSize; + NSMenuItem *_menuFormRepresentation; + NSSize _minSize; + NSString *_paletteLabel; + int _tag; + id _target; + NSToolbar *_toolbar; + NSString *_toolTip; + NSView *_view; +} + +// Instance methods +- (SEL)action; +- (BOOL)allowsDuplicatesInToolbar; +- (NSImage *)image; +- (id)initWithItemIdentifier: (NSString *)itemIdentifier; +- (BOOL)isEnabled; +- (NSString *)itemIdentifier; +- (NSString *)label; +- (NSSize)maxSize; +- (NSMenuItem *)menuFormRepresentation; +- (NSSize)minSize; +- (NSString *)paletteLabel; +- (void)setAction: (SEL)action; +- (void)setEnabled: (BOOL)enabled; +- (void)setImage: (NSImage *)image; +- (void)setLabel: (NSString *)label; +- (void)setMaxSize: (NSSize)maxSize; +- (void)setMenuFormRepresentation: (NSMenuItem *)menuItem; +- (void)setMinSize: (NSSize)minSize; +- (void)setPaletteLabel: (NSString *)paletteLabel; +- (void)setTag: (int)tag; +- (void)setTarget: (id)target; +- (void)setToolTip: (NSString *)toolTip; +- (void)setView: (NSView *)view; +- (int)tag; +- (id)target; +- (NSString *)toolTip; +- (NSToolbar *)toolbar; +- (void)validate; +- (NSView *)view; +@end /* interface of NSToolbarItem */ + +@protocol NSToolbarItemValidation +- (BOOL)validateToolbarItem: (NSToolbarItem *)theItem; +@end + +#endif /* _GNUstep_H_NSToolbarItem */ diff --git a/Headers/AppKit/NSUserInterfaceValidation.h b/Headers/AppKit/NSUserInterfaceValidation.h new file mode 100644 index 000000000..998190c86 --- /dev/null +++ b/Headers/AppKit/NSUserInterfaceValidation.h @@ -0,0 +1,42 @@ +/* + NSUserInterfaceValidation.h + + Protocols for interface item validation + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Fred Kiefer + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSUserInterfaceValidation +#define _GNUstep_H_NSUserInterfaceValidation + +@protocol NSValidatedUserInterfaceItem + +- (SEL)action; +- (int)tag; +@end + +@protocol NSUserInterfaceValidations + +- (BOOL)validateUserInterfaceItem:(id )anItem; +@end + +#endif // _GNUstep_H_NSUserInterfaceValidation diff --git a/Headers/AppKit/NSView.h b/Headers/AppKit/NSView.h new file mode 100644 index 000000000..a4e202c0b --- /dev/null +++ b/Headers/AppKit/NSView.h @@ -0,0 +1,457 @@ +/** NSView + + Encapsulates all drawing functionality + + Copyright (C) 1996 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Heavily changed and extended by Ovidiu Predescu . + Date: 1997 + Author: Felipe A. Rodriguez + Date: August 1998 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSView +#define _GNUstep_H_NSView + +#include +#include + +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSData; + +@class NSWindow; +@class NSPasteboard; +@class NSView; +@class NSClipView; +@class NSImage; +@class NSCursor; +@class NSScrollView; +@class NSMenu; + +typedef int NSTrackingRectTag; +typedef int NSToolTipTag; + +/* + * constants representing the four types of borders that + * can appear around an NSView + */ +typedef enum _NSBorderType { + NSNoBorder, + NSLineBorder, + NSBezelBorder, + NSGrooveBorder +} NSBorderType; + +/* + * autoresize constants which NSView uses in + * determining the parts of a view which are + * resized when the view's superview is resized + */ +enum { + NSViewNotSizable = 0, // view does not resize with its superview + NSViewMinXMargin = 1, // left margin between views can stretch + NSViewWidthSizable = 2, // view's width can stretch + NSViewMaxXMargin = 4, // right margin between views can stretch + NSViewMinYMargin = 8, // bottom margin between views can stretch + NSViewHeightSizable = 16, // view's height can stretch + NSViewMaxYMargin = 32 // top margin between views can stretch +}; + +@interface NSView : NSResponder +{ + NSRect _frame; + NSRect _bounds; + id _frameMatrix; + id _boundsMatrix; + id _matrixToWindow; + id _matrixFromWindow; + + NSView* _super_view; + NSMutableArray *_sub_views; + id _window; + NSMutableArray *_tracking_rects; + NSMutableArray *_cursor_rects; + NSRect _invalidRect; + NSRect _visibleRect; + unsigned int _autoresizingMask; + int _gstate; + + BOOL _is_rotated_from_base; + BOOL _is_rotated_or_scaled_from_base; + BOOL _post_frame_changes; + BOOL _post_bounds_changes; + BOOL _autoresizes_subviews; + BOOL _coordinates_valid; + BOOL _allocate_gstate; + BOOL _renew_gstate; + + void *_nextKeyView; + void *_previousKeyView; +} + +/* + * Initializing NSView Objects + */ +- (id) initWithFrame: (NSRect)frameRect; + +/* + * Managing the NSView Hierarchy + */ +- (void) addSubview: (NSView*)aView; +- (void) addSubview: (NSView*)aView + positioned: (NSWindowOrderingMode)place + relativeTo: (NSView*)otherView; +- (NSView*) ancestorSharedWithView: (NSView*)aView; +- (BOOL) isDescendantOf: (NSView*)aView; +- (NSView*) opaqueAncestor; +- (void) removeFromSuperviewWithoutNeedingDisplay; +- (void) removeFromSuperview; +#ifndef NO_GNUSTEP +- (void) removeSubview: (NSView*)aView; +#endif +- (void) replaceSubview: (NSView*)oldView + with: (NSView*)newView; +- (void) sortSubviewsUsingFunction: (int (*)(id ,id ,void*))compare + context: (void*)context; +- (NSArray*) subviews; +- (NSView*) superview; +- (NSWindow*) window; +- (void) viewWillMoveToSuperview: (NSView*)newSuper; +- (void) viewWillMoveToWindow: (NSWindow*)newWindow; +#ifndef STRICT_OPENSTEP +- (void) didAddSubview: (NSView *)subview; +- (void) viewDidMoveToSuperview; +- (void) viewDidMoveToWindow; +- (void) willRemoveSubview: (NSView *)subview; +#endif + +/* + * Assigning a Tag + */ +- (int) tag; +- (id) viewWithTag: (int)aTag; + +/* + * Modifying the Frame Rectangle + */ +- (float) frameRotation; +- (NSRect) frame; +- (void) setFrame: (NSRect)frameRect; +- (void) setFrameOrigin: (NSPoint)newOrigin; +- (void) setFrameRotation: (float)angle; +- (void) setFrameSize: (NSSize)newSize; + +/* + * Modifying the Coordinate System + */ +- (float) boundsRotation; +- (NSRect) bounds; +- (void) setBounds: (NSRect)aRect; +- (void) setBoundsOrigin: (NSPoint)newOrigin; +- (void) setBoundsRotation: (float)angle; +- (void) setBoundsSize: (NSSize)newSize; + +- (void) translateOriginToPoint: (NSPoint)point; +- (void) scaleUnitSquareToSize: (NSSize)newSize; +- (void) rotateByAngle: (float)angle; + +- (BOOL) isFlipped; +- (BOOL) isRotatedFromBase; +- (BOOL) isRotatedOrScaledFromBase; + +/* + * Converting Coordinates + */ +- (NSRect) centerScanRect: (NSRect)aRect; +- (NSPoint) convertPoint: (NSPoint)aPoint + fromView: (NSView*)aView; +- (NSPoint) convertPoint: (NSPoint)aPoint + toView: (NSView*)aView; +- (NSRect) convertRect: (NSRect)aRect + fromView: (NSView*)aView; +- (NSRect) convertRect: (NSRect)aRect + toView: (NSView*)aView; +- (NSSize) convertSize: (NSSize)aSize + fromView: (NSView*)aView; +- (NSSize) convertSize: (NSSize)aSize + toView: (NSView*)aView; + +/* + * Notifying Ancestor Views + */ +- (void) setPostsFrameChangedNotifications: (BOOL)flag; +- (BOOL) postsFrameChangedNotifications; +- (void) setPostsBoundsChangedNotifications: (BOOL)flag; +- (BOOL) postsBoundsChangedNotifications; + +/* + * Resizing Subviews + */ +- (void) resizeSubviewsWithOldSize: (NSSize)oldSize; +- (void) setAutoresizesSubviews: (BOOL)flag; +- (BOOL) autoresizesSubviews; +- (void) setAutoresizingMask: (unsigned int)mask; +- (unsigned int) autoresizingMask; +- (void) resizeWithOldSuperviewSize: (NSSize)oldSize; + +/* + * Focusing + */ ++ (NSView*) focusView; +- (void) lockFocus; +- (void) unlockFocus; +#ifndef STRICT_OPENSTEP +- (BOOL) lockFocusIfCanDraw; +- (void) lockFocusInRect: (NSRect)rect; +#endif + +/* + * Displaying + */ +- (void) display; +- (void) displayIfNeeded; +- (void) displayIfNeededIgnoringOpacity; +- (void) displayIfNeededInRect: (NSRect)aRect; +- (void) displayIfNeededInRectIgnoringOpacity: (NSRect)aRect; +- (void) displayRect: (NSRect)aRect; +- (void) displayRectIgnoringOpacity: (NSRect)aRect; +- (BOOL) needsDisplay; +- (void) setNeedsDisplay: (BOOL)flag; +- (void) setNeedsDisplayInRect: (NSRect)invalidRect; +- (BOOL) isOpaque; + +- (void) drawRect: (NSRect)rect; +- (NSRect) visibleRect; +- (BOOL) canDraw; +- (BOOL) shouldDrawColor; + +/* + * Graphics State Objects + */ +- (void) allocateGState; +- (void) releaseGState; +- (int) gState; +- (void) renewGState; +- (void) setUpGState; + +- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent; +- (NSView*) hitTest: (NSPoint)aPoint; +- (BOOL) mouse: (NSPoint)aPoint + inRect: (NSRect)aRect; +- (BOOL) performKeyEquivalent: (NSEvent*)theEvent; +#ifndef STRICT_OPENSTEP +- (BOOL) performMnemonic: (NSString *)aString; +#endif + +/* + * Dragging + */ +- (BOOL) dragFile: (NSString*)filename + fromRect: (NSRect)rect + slideBack: (BOOL)slideFlag + event: (NSEvent*)event; +- (void) dragImage: (NSImage*)anImage + at: (NSPoint)viewLocation + offset: (NSSize)initialOffset + event: (NSEvent*)event + pasteboard: (NSPasteboard*)pboard + source: (id)sourceObject + slideBack: (BOOL)slideFlag; +- (void) registerForDraggedTypes: (NSArray*)newTypes; +- (void) unregisterDraggedTypes; +- (BOOL) shouldDelayWindowOrderingForEvent: (NSEvent*)anEvent; + +/* + * Managing the Cursor + */ +- (void) addCursorRect: (NSRect)aRect + cursor: (NSCursor*)anObject; +- (void) discardCursorRects; +- (void) removeCursorRect: (NSRect)aRect + cursor: (NSCursor*)anObject; +- (void) resetCursorRects; + +#ifndef STRICT_OPENSTEP +/* + * Tool Tips + */ +- (NSToolTipTag) addToolTipRect: (NSRect)aRect + owner: (id)anObject + userData: (void *)data; +- (void) removeAllToolTips; +- (void) removeToolTip: (NSToolTipTag)tag; +- (void) setToolTip: (NSString *)string; +- (NSString *) toolTip; +#endif + +/* + * Tracking rectangles + */ +- (void) removeTrackingRect: (NSTrackingRectTag)tag; +- (NSTrackingRectTag) addTrackingRect: (NSRect)aRect + owner: (id)anObject + userData: (void*)data + assumeInside: (BOOL)flag; + +/* + * Scrolling + */ +- (NSRect) adjustScroll: (NSRect)newVisible; +- (BOOL) autoscroll: (NSEvent*)theEvent; +- (NSScrollView*) enclosingScrollView; +- (void) scrollPoint: (NSPoint)aPoint; +- (void) scrollRect: (NSRect)aRect + by: (NSSize)delta; +- (BOOL) scrollRectToVisible: (NSRect)aRect; + +- (void) reflectScrolledClipView: (NSClipView*)aClipView; +- (void) scrollClipView: (NSClipView*)aClipView + toPoint: (NSPoint)aPoint; + +#ifndef STRICT_OPENSTEP +/* + * Menu operations + */ ++ (NSMenu *) defaultMenu; +- (NSMenu *) menuForEvent: (NSEvent *)theEvent; +#endif + +/* + * Aiding Event Handling + */ +-(BOOL) needsPanelToBecomeKey; +- (void) setNextKeyView: (NSView*)aView; +- (NSView*) nextKeyView; +- (NSView*) nextValidKeyView; +- (void) setPreviousKeyView: (NSView*)aView; +- (NSView*) previousKeyView; +- (NSView*) previousValidKeyView; + +/* + * Printing + */ +- (void) fax: (id)sender; +- (void) print: (id)sender; +- (NSData*) dataWithEPSInsideRect: (NSRect)aRect; +- (void) writeEPSInsideRect: (NSRect)rect + toPasteboard: (NSPasteboard*)pasteboard; +#ifndef STRICT_OPENSTEP +- (NSData *)dataWithPDFInsideRect:(NSRect)aRect; +- (void)writePDFInsideRect:(NSRect)aRect + toPasteboard:(NSPasteboard *)pboard; +- (NSString *)printJobTitle; +#endif + +/* + * Pagination + */ +- (void) adjustPageHeightNew: (float*)newBottom + top: (float)oldTop + bottom: (float)oldBottom + limit: (float)bottomLimit; +- (void) adjustPageWidthNew: (float*)newRight + left: (float)oldLeft + right: (float)oldRight + limit: (float)rightLimit; +- (float) heightAdjustLimit; +- (BOOL) knowsPagesFirst: (int*)firstPageNum + last: (int*)lastPageNum; +#ifndef STRICT_OPENSTEP +- (BOOL) knowsPageRange: (NSRange*)range; +#endif +- (NSPoint) locationOfPrintRect: (NSRect)aRect; +- (NSRect) rectForPage: (int)page; +- (float) widthAdjustLimit; + +/* + * Writing Conforming PostScript + */ +- (void) addToPageSetup; +- (void) beginPage: (int)ordinalNum + label: (NSString*)aString + bBox: (NSRect)pageRect + fonts: (NSString*)fontNames; +- (void) beginPageSetupRect: (NSRect)aRect + placement: (NSPoint)location; +- (void) beginPrologueBBox: (NSRect)boundingBox + creationDate: (NSString*)dateCreated + createdBy: (NSString*)anApplication + fonts: (NSString*)fontNames + forWhom: (NSString*)user + pages: (int)numPages + title: (NSString*)aTitle; +- (void) beginSetup; +- (void) beginTrailer; +- (void) drawPageBorderWithSize: (NSSize)borderSize; +- (void) drawSheetBorderWithSize: (NSSize)borderSize; +- (void) endHeaderComments; +- (void) endPrologue; +- (void) endSetup; +- (void) endPageSetup; +- (void) endPage; +- (void) endTrailer; +#ifndef STRICT_OPENSTEP +- (void)beginDocument; +- (void)beginPageInRect:(NSRect)aRect + atPlacement:(NSPoint)location; +- (void)endDocument; +#endif + +@end + + +@class NSAffineTransform; + +/* + * GNUstep extensions + * Methods whose names begin with an underscore must NOT be overridden. + */ +#ifndef NO_GNUSTEP +@interface NSView (PrivateMethods) + +/* + * The [-_invalidateCoordinates] method marks the cached visible rectangles + * of the view and it's subview as being invalid. NSViews methods call this + * whenever the coordinate system of the view is changed in any way - thus + * forcing recalculation of cached values next time they are needed. + */ +- (void) _invalidateCoordinates; +- (void) _rebuildCoordinates; + +- (NSAffineTransform*) _matrixToWindow; +- (NSAffineTransform*) _matrixFromWindow; +@end +#endif + +/* + * GNUstep specific function to determine the drag types registered for a view. + */ +APPKIT_EXPORT NSArray *GSGetDragTypes(NSView* aView); + +/* Notifications */ +APPKIT_EXPORT NSString *NSViewFrameDidChangeNotification; +APPKIT_EXPORT NSString *NSViewBoundsDidChangeNotification; +APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification; + +#endif // _GNUstep_H_NSView diff --git a/Headers/AppKit/NSWindow.h b/Headers/AppKit/NSWindow.h new file mode 100644 index 000000000..d679ed9ff --- /dev/null +++ b/Headers/AppKit/NSWindow.h @@ -0,0 +1,613 @@ +/* + NSWindow.h + + The window class + + Copyright (C) 1996,1999 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + Modified: Felipe A. Rodriguez + Date: June 1998 + Modified: Richard Frith-Macdonald + Date: 1998,1999 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSWindow +#define _GNUstep_H_NSWindow + +#include +#include +#include +#include +#include + +@class NSArray; +@class NSData; +@class NSDate; +@class NSDictionary; +@class NSMutableArray; +@class NSNotification; +@class NSString; + +@class NSButtonCell; +@class NSColor; +@class NSEvent; +@class NSImage; +@class NSMenu; +@class NSPasteboard; +@class NSScreen; +@class NSText; +@class NSToolbar; +@class NSView; +@class NSWindowController; +@class NSCachedImageRep; + +/* + * Window levels are taken from MacOS-X + * NSDesktopWindowLevel is copied from Window maker and is intended to be + * the level at which things on the desktop sit ... so you should be able + * to put a desktop background just below it. + */ +enum { + NSDesktopWindowLevel = -1000, /* GNUstep addition */ + NSNormalWindowLevel = 0, + NSFloatingWindowLevel = 3, + NSSubmenuWindowLevel = 3, + NSTornOffMenuWindowLevel = 3, + NSMainMenuWindowLevel = 20, + NSDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ + NSStatusWindowLevel = 21, + NSModalPanelWindowLevel = 100, + NSPopUpMenuWindowLevel = 101, + NSScreenSaverWindowLevel = 1000 +}; + +enum { + NSBorderlessWindowMask = 0, + NSTitledWindowMask = 1, + NSClosableWindowMask = 2, + NSMiniaturizableWindowMask = 4, + NSResizableWindowMask = 8, + NSIconWindowMask = 64, /* GNUstep extension - app icon window */ + NSMiniWindowMask = 128 /* GNUstep extension - miniwindows */ +}; + +typedef enum _NSSelectionDirection { + NSDirectSelection, + NSSelectingNext, + NSSelectingPrevious +} NSSelectionDirection; + +APPKIT_EXPORT NSSize NSIconSize; +APPKIT_EXPORT NSSize NSTokenSize; + +@interface NSWindow : NSResponder +{ + NSRect _frame; + NSSize _minimumSize; + NSSize _maximumSize; + NSSize _increments; + NSString *_autosaveName; + id _wv; + id _contentView; + id _firstResponder; + id _futureFirstResponder; + NSView *_initialFirstResponder; + id _delegate; + id _fieldEditor; + id _lastView; + id _lastDragView; + int _lastDragOperationMask; + int _windowNum; + int _gstate; + void *_reserved_s; + NSScreen *_screen; + NSColor *_backgroundColor; + NSString *_representedFilename; + NSString *_miniaturizedTitle; + NSImage *_miniaturizedImage; + NSString *_windowTitle; + NSPoint _lastPoint; + NSBackingStoreType _backingType; + unsigned _styleMask; + int _windowLevel; + NSRect _rectNeedingFlush; + NSMutableArray *_rectsBeingDrawn; + unsigned _disableFlushWindow; + NSSelectionDirection _selectionDirection; + + NSWindowDepth _depthLimit; + NSWindowController *_windowController; + int _counterpart; + float _alphaValue; + + NSToolbar *_toolbar; + + NSCachedImageRep *_cachedImage; + NSPoint _cachedImageOrigin; + + struct GSWindowFlagsType { + unsigned accepts_drag:1; + unsigned is_one_shot:1; + unsigned needs_flush:1; + unsigned is_autodisplay:1; + unsigned optimize_drawing:1; + unsigned dynamic_depth_limit:1; + unsigned cursor_rects_enabled:1; + unsigned cursor_rects_valid:1; + unsigned visible:1; + unsigned is_key:1; + unsigned is_main:1; + unsigned is_edited:1; + unsigned is_released_when_closed:1; + unsigned is_miniaturized:1; + unsigned menu_exclude:1; + unsigned hides_on_deactivate:1; + unsigned accepts_mouse_moved:1; + unsigned has_opened:1; + unsigned has_closed:1; + unsigned default_button_cell_key_disabled:1; + unsigned can_hide:1; + unsigned has_shadow:1; + unsigned is_opaque:1; + // 3 bits reserved for subclass use + unsigned subclass_bool_one: 1; + unsigned subclass_bool_two: 1; + unsigned subclass_bool_three: 1; + } _f; + + id _defaultButtonCell; + void *_reserved_1; + void *_reserved_2; +} + +/* + * Class methods + */ + +/* + * Computing frame and content rectangles + */ ++ (NSRect) contentRectForFrameRect: (NSRect)aRect + styleMask: (unsigned int)aStyle; + ++ (NSRect) frameRectForContentRect: (NSRect)aRect + styleMask: (unsigned int)aStyle; + ++ (NSRect) minFrameWidthWithTitle: (NSString *)aTitle + styleMask: (unsigned int)aStyle; + + +/* + * Initializing and getting a new NSWindow object + */ +- (id) initWithContentRect: (NSRect)contentRect + styleMask: (unsigned int)aStyle + backing: (NSBackingStoreType)bufferingType + defer: (BOOL)flag; + +- (id) initWithContentRect: (NSRect)contentRect + styleMask: (unsigned int)aStyle + backing: (NSBackingStoreType)bufferingType + defer: (BOOL)flag + screen: (NSScreen*)aScreen; + +/* + * Converting coordinates + */ +- (NSPoint) convertBaseToScreen: (NSPoint)aPoint; +- (NSPoint) convertScreenToBase: (NSPoint)aPoint; + +/* + * Moving and resizing the window + */ +- (NSRect) frame; +- (void) setFrame: (NSRect)frameRect + display: (BOOL)flag; +- (void) setFrameOrigin: (NSPoint)aPoint; +- (void) setFrameTopLeftPoint: (NSPoint)aPoint; +- (void) setContentSize: (NSSize)aSize; +- (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint; +- (void) center; +- (int) resizeFlags; +#ifndef STRICT_OPENSTEP +- (void) setFrame: (NSRect)frameRect + display: (BOOL)displayFlag + animate: (BOOL)animationFlag; +- (NSTimeInterval) animationResizeTime: (NSRect)newFrame; +- (void) performZoom: (id)sender; +- (void) zoom: (id)sender; +- (BOOL) showsResizeIndicator; +- (void) setShowsResizeIndicator: (BOOL)show; +#endif + +/* + * Constraining size + */ +- (NSSize) minSize; +- (NSSize) maxSize; +- (void) setMinSize: (NSSize)aSize; +- (void) setMaxSize: (NSSize)aSize; +- (NSRect) constrainFrameRect: (NSRect)frameRect + toScreen: (NSScreen*)screen; +#ifndef STRICT_OPENSTEP +- (NSSize) aspectRatio; +- (void) setAspectRatio: (NSSize)ratio; +- (NSSize) resizeIncrements; +- (void) setResizeIncrements: (NSSize)aSize; +#endif + +/* + * Saving and restoring the frame + */ ++ (void) removeFrameUsingName: (NSString*)name; +- (NSString*) frameAutosaveName; +- (void) saveFrameUsingName: (NSString*)name; +- (BOOL) setFrameAutosaveName: (NSString*)name; +- (void) setFrameFromString: (NSString*)string; +- (BOOL) setFrameUsingName: (NSString*)name; +- (NSString*) stringWithSavedFrame; +#ifndef STRICT_OPENSTEP +- (BOOL) setFrameUsingName: (NSString *)name + force: (BOOL)force; +#endif + +/* + * Window status and ordering + */ +- (void) orderBack: sender; +- (void) orderFront: sender; +- (void) orderFrontRegardless; +- (void) orderOut: (id)sender; +- (void) orderWindow: (NSWindowOrderingMode)place + relativeTo: (int)otherWin; +- (BOOL) isVisible; +- (int) level; +- (void) setLevel: (int)newLevel; + +- (void) becomeKeyWindow; +- (void) becomeMainWindow; +- (BOOL) canBecomeKeyWindow; +- (BOOL) canBecomeMainWindow; +- (BOOL) isKeyWindow; +- (BOOL) isMainWindow; +- (void) makeKeyAndOrderFront: (id)sender; +- (void) makeKeyWindow; +- (void) makeMainWindow; +- (void) resignKeyWindow; +- (void) resignMainWindow; + +#ifndef STRICT_OPENSTEP +- (NSButtonCell*) defaultButtonCell; +- (void) setDefaultButtonCell: (NSButtonCell*)aCell; +- (void) disableKeyEquivalentForDefaultButtonCell; +- (void) enableKeyEquivalentForDefaultButtonCell; +#endif + +/* + * Managing the display + */ +- (void) display; +- (void) displayIfNeeded; +- (BOOL) isAutodisplay; +- (void) setAutodisplay: (BOOL)flag; +- (void) setViewsNeedDisplay: (BOOL)flag; +- (void) update; +- (void) useOptimizedDrawing: (BOOL)flag; +- (BOOL) viewsNeedDisplay; + +- (BOOL) isFlushWindowDisabled; +- (void) disableFlushWindow; +- (void) enableFlushWindow; +- (void) flushWindow; +- (void) flushWindowIfNeeded; + +#ifndef STRICT_OPENSTEP +- (void) cacheImageInRect: (NSRect)aRect; +- (void) discardCachedImage; +- (void) restoreCachedImage; +#endif + +/* + * Window device attributes + */ +- (int) windowNumber; +- (int) gState; +- (NSDictionary*) deviceDescription; +- (NSBackingStoreType) backingType; +- (void) setBackingType: (NSBackingStoreType)type; +- (BOOL) isOneShot; +- (void) setOneShot: (BOOL)flag; + +/* + * Screens and window depths + */ ++ (NSWindowDepth) defaultDepthLimit; +- (BOOL) canStoreColor; +- (NSWindowDepth) depthLimit; +- (BOOL) hasDynamicDepthLimit; +- (void) setDepthLimit: (NSWindowDepth)limit; +- (void) setDynamicDepthLimit: (BOOL)flag; + +- (NSScreen*) deepestScreen; +- (NSScreen*) screen; + +- (NSResponder*) firstResponder; +- (BOOL) makeFirstResponder: (NSResponder*)aResponder; + +/* + * Aiding event handling + */ +- (NSEvent*) currentEvent; +- (NSEvent*) nextEventMatchingMask: (unsigned int)mask; +- (NSEvent*) nextEventMatchingMask: (unsigned int)mask + untilDate: (NSDate*)expiration + inMode: (NSString*)mode + dequeue: (BOOL)deqFlag; +- (void) discardEventsMatchingMask: (unsigned int)mask + beforeEvent: (NSEvent*)lastEvent; +- (void) postEvent: (NSEvent*)event + atStart: (BOOL)flag; +- (void) sendEvent: (NSEvent*)theEvent; +- (BOOL) tryToPerform: (SEL)anAction with: (id)anObject; +- (void) keyDown: (NSEvent*)theEvent; +- (NSPoint) mouseLocationOutsideOfEventStream; +- (BOOL) acceptsMouseMovedEvents; +- (void) setAcceptsMouseMovedEvents: (BOOL)flag; + +/* + * The field editor + */ +- (void) endEditingFor: anObject; +- (NSText*) fieldEditor: (BOOL)createFlag + forObject: (id)anObject; + +#ifndef STRICT_OPENSTEP +- (NSView*) initialFirstResponder; +- (NSSelectionDirection) keyViewSelectionDirection; +- (void) selectKeyViewFollowingView: (NSView*)aView; +- (void) selectKeyViewPrecedingView: (NSView*)aView; +- (void) selectNextKeyView: (id)sender; +- (void) selectPreviousKeyView: (id)sender; +- (void) setInitialFirstResponder: (NSView*)aView; +#endif + +/* + * Window graphics + */ +- (NSString*) representedFilename; +- (void) setRepresentedFilename: (NSString*)aString; +- (void) setTitle: (NSString*)aString; +- (void) setTitleWithRepresentedFilename: (NSString*)aString; +- (NSString*) title; + +- (BOOL) isDocumentEdited; +- (void) setDocumentEdited: (BOOL)flag; + +/* + * Handling user actions and events + */ +- (void) close; +- (void) performClose: (id)sender; +- (void) setReleasedWhenClosed: (BOOL)flag; +- (BOOL) isReleasedWhenClosed; + +- (void) deminiaturize: (id)sender; +- (void) miniaturize: (id)sender; +- (void) performMiniaturize: (id)sender; +- (BOOL) isMiniaturized; + +/* + * The miniwindow + */ +- (NSImage*) miniwindowImage; +- (NSString*) miniwindowTitle; +- (void) setMiniwindowImage: (NSImage*)image; +- (void) setMiniwindowTitle: (NSString*)title; +#ifndef NO_GNUSTEP +- (NSWindow*) counterpart; +#endif + +#ifndef STRICT_OPENSTEP ++ (void) menuChanged: (NSMenu*)aMenu; +#endif + +/* + * Windows menu support + */ +- (BOOL) isExcludedFromWindowsMenu; +- (void) setExcludedFromWindowsMenu: (BOOL)flag; + +/* + * Cursor management + */ +- (BOOL) areCursorRectsEnabled; +- (void) disableCursorRects; +- (void) discardCursorRects; +- (void) enableCursorRects; +- (void) invalidateCursorRectsForView: (NSView*)aView; +- (void) resetCursorRects; + +/* + * Dragging + */ +- (void) dragImage: (NSImage*)anImage + at: (NSPoint)baseLocation + offset: (NSSize)initialOffset + event: (NSEvent*)event + pasteboard: (NSPasteboard*)pboard + source: sourceObject + slideBack: (BOOL)slideFlag; +- (void) registerForDraggedTypes: (NSArray*)newTypes; +- (void) unregisterDraggedTypes; + +- (BOOL) hidesOnDeactivate; +- (void) setHidesOnDeactivate: (BOOL)flag; +- (BOOL) worksWhenModal; +#ifndef STRICT_OPENSTEP +- (void) setCanHide: (BOOL)flag; +- (BOOL) canHide; +#endif + +/* + * Accessing the content view + */ +- (id) contentView; +- (void) setContentView: (NSView*)aView; +- (void) setBackgroundColor: (NSColor*)color; +- (NSColor*) backgroundColor; +- (unsigned int) styleMask; +#ifndef STRICT_OPENSTEP +- (void) setHasShadow: (BOOL)hasShadow; +- (BOOL) hasShadow; +- (void) setAlphaValue: (float)windowAlpha; +- (float) alphaValue; +- (void) setOpaque: (BOOL)isOpaque; +- (BOOL) isOpaque; +#endif + +/* + * Services menu support + */ +- (id) validRequestorForSendType: (NSString*)sendType + returnType: (NSString*)returnType; + +/* + * Printing and postscript + */ +- (void) fax: (id)sender; +- (void) print: (id)sender; +- (NSData*) dataWithEPSInsideRect: (NSRect)rect; +#ifndef STRICT_OPENSTEP +- (NSData *)dataWithPDFInsideRect:(NSRect)aRect; +#endif + +/* + * Assigning a delegate + */ +- (id) delegate; +- (void) setDelegate: (id)anObject; + +/* + * The window controller + */ +- (void) setWindowController: (NSWindowController*)windowController; +- (id) windowController; + +#ifndef STRICT_OPENSTEP +- (NSArray *) drawers; +- (void) setToolbar: (NSToolbar*)toolbar; +- (NSToolbar *) toolbar; +- (void) toggleToolbarShown: (id)sender; +- (void) runToolbarCustomizationPalette: (id)sender; +- (NSWindow *) initWithWindowRef: (void *)windowRef; +- (void *)windowRef; +- (void*) windowHandle; +#endif +@end + +#ifndef NO_GNUSTEP +/* + * GNUstep backend methods + */ +@interface NSWindow (GNUstepBackend) + +/* + * Mouse capture/release + */ +- (void) _captureMouse: (id)sender; +- (void) _releaseMouse: (id)sender; + +/* + * Allow subclasses to init without the backend class + * attempting to create an actual window + */ +- (void) _initDefaults; + +/* + * Let backend set window visibility. + */ +- (void) _setVisible: (BOOL)flag; + +@end +#endif + +#ifndef NO_GNUSTEP +@interface NSWindow (GNUstepTextView) +/* + * Called from NSTextView's resignFirstResponder to know which is + * the next first responder. + */ +- (id) _futureFirstResponder; +@end +#endif + +/* + * Implemented by the delegate + */ + +#ifdef GNUSTEP +@interface NSObject (NSWindowDelegate) +- (BOOL) windowShouldClose: (id)sender; +#ifndef STRICT_OPENSTEP +- (BOOL) windowShouldZoom: (NSWindow*)sender + toFrame: (NSRect)aFrame; +- (NSRect) windowWillUseStandardFrame: (NSWindow*)sender + defaultFrame: (NSRect)aFrame; +#endif +- (NSSize) windowWillResize: (NSWindow*)sender + toSize: (NSSize)frameSize; +- (id) windowWillReturnFieldEditor: (NSWindow*)sender + toObject: (id)client; +- (void) windowDidBecomeKey: (NSNotification*)aNotification; +- (void) windowDidBecomeMain: (NSNotification*)aNotification; +- (void) windowDidChangeScreen: (NSNotification*)aNotification; +- (void) windowDidDeminiaturize: (NSNotification*)aNotification; +- (void) windowDidExpose: (NSNotification*)aNotification; +- (void) windowDidMiniaturize: (NSNotification*)aNotification; +- (void) windowDidMove: (NSNotification*)aNotification; +- (void) windowDidResignKey: (NSNotification*)aNotification; +- (void) windowDidResignMain: (NSNotification*)aNotification; +- (void) windowDidResize: (NSNotification*)aNotification; +- (void) windowDidUpdate: (NSNotification*)aNotification; +- (void) windowWillClose: (NSNotification*)aNotification; +- (void) windowWillMiniaturize: (NSNotification*)aNotification; +- (void) windowWillMove: (NSNotification*)aNotification; +@end +#endif + +/* Notifications */ +APPKIT_EXPORT NSString *NSWindowDidBecomeKeyNotification; +APPKIT_EXPORT NSString *NSWindowDidBecomeMainNotification; +APPKIT_EXPORT NSString *NSWindowDidChangeScreenNotification; +APPKIT_EXPORT NSString *NSWindowDidDeminiaturizeNotification; +APPKIT_EXPORT NSString *NSWindowDidExposeNotification; +APPKIT_EXPORT NSString *NSWindowDidMiniaturizeNotification; +APPKIT_EXPORT NSString *NSWindowDidMoveNotification; +APPKIT_EXPORT NSString *NSWindowDidResignKeyNotification; +APPKIT_EXPORT NSString *NSWindowDidResignMainNotification; +APPKIT_EXPORT NSString *NSWindowDidResizeNotification; +APPKIT_EXPORT NSString *NSWindowDidUpdateNotification; +APPKIT_EXPORT NSString *NSWindowWillCloseNotification; +APPKIT_EXPORT NSString *NSWindowWillMiniaturizeNotification; +APPKIT_EXPORT NSString *NSWindowWillMoveNotification; + +#endif /* _GNUstep_H_NSWindow */ diff --git a/Headers/AppKit/NSWindowController.h b/Headers/AppKit/NSWindowController.h new file mode 100644 index 000000000..26854d602 --- /dev/null +++ b/Headers/AppKit/NSWindowController.h @@ -0,0 +1,91 @@ +/* + NSWindowController.h + + The document controller class + + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#ifndef _GNUstep_H_NSWindowController +#define _GNUstep_H_NSWindowController + +#include +#include + +@class NSString; +@class NSArray; +@class NSWindow; +@class NSDocument; + +@interface NSWindowController : NSObject +{ + @private + NSWindow *_window; + NSString *_windowNibName; + NSString *_windowNibPath; + NSString *_windowFrameAutosaveName; + NSDocument *_document; + NSArray *_topLevelObjects; + id _owner; + struct ___wcFlags + { + unsigned int shouldCloseDocument:1; + unsigned int shouldCascade:1; + unsigned int nibIsLoaded:1; + unsigned int RESERVED:29; + } _wcFlags; + void *_reserved1; + void *_reserved2; +} + +- (id) initWithWindowNibName: (NSString *)windowNibName; // self is the owner +- (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner; +- (id) initWithWindow: (NSWindow *)window; +- (id) initWithWindowNibPath: (NSString *)windowNibPath + owner: (id)owner; + +- (void) loadWindow; +- (IBAction) showWindow: (id)sender; +- (BOOL) isWindowLoaded; +- (NSWindow *) window; +- (void) setWindow: (NSWindow *)aWindow; +- (void) windowDidLoad; +- (void) windowWillLoad; + +- (void) setDocument: (NSDocument *)document; +- (id) document; +- (void) setDocumentEdited: (BOOL)flag; + +- (void) close; +- (BOOL) shouldCloseDocument; +- (void) setShouldCloseDocument: (BOOL)flag; + +- (id) owner; +- (NSString *) windowNibName; +- (NSString *) windowNibPath; + +- (BOOL) shouldCascadeWindows; +- (void) setShouldCascadeWindows: (BOOL)flag; +- (void) setWindowFrameAutosaveName: (NSString *)name; +- (NSString *) windowFrameAutosaveName; +- (NSString *) windowTitleForDocumentDisplayName: (NSString *)displayName; +- (void) synchronizeWindowTitleWithDocumentName; +@end + +#endif /* _GNUstep_H_NSWindowController */ diff --git a/Headers/AppKit/NSWorkspace.h b/Headers/AppKit/NSWorkspace.h new file mode 100644 index 000000000..ac2f6d038 --- /dev/null +++ b/Headers/AppKit/NSWorkspace.h @@ -0,0 +1,252 @@ +/* + NSWorkspace.h + + Interface for workspace. + + Copyright (C) 1996-2002 Free Software Foundation, Inc. + + Author: Scott Christley + Date: 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_NSWorkspace +#define _GNUstep_H_NSWorkspace + +#include +#include +#include + +@class NSString; +@class NSArray; +@class NSMutableArray; +@class NSMutableDictionary; +@class NSNotificationCenter; +@class NSImage; +@class NSView; +@class NSURL; + +@interface NSWorkspace : NSObject +{ + NSMutableDictionary *_iconMap; + NSMutableDictionary *_launched; + NSNotificationCenter *_workspaceCenter; + BOOL _fileSystemChanged; + BOOL _userDefaultsChanged; +} + +// +// Creating a Workspace +// ++ (NSWorkspace*) sharedWorkspace; + +// +// Opening Files +// +- (BOOL) openFile: (NSString*)fullPath; +- (BOOL) openFile: (NSString*)fullPath + fromImage: (NSImage*)anImage + at: (NSPoint)point + inView: (NSView*)aView; +- (BOOL) openFile: (NSString*)fullPath + withApplication: (NSString*)appName; +- (BOOL) openFile: (NSString*)fullPath + withApplication: (NSString*)appName + andDeactivate: (BOOL)flag; +- (BOOL) openTempFile: (NSString*)fullPath; +#ifndef STRICT_OPENSTEP +- (BOOL) openURL: (NSURL*)url; +#endif + +// +// Manipulating Files +// +- (BOOL) performFileOperation: (NSString*)operation + source: (NSString*)source + destination: (NSString*)destination + files: (NSArray*)files + tag: (int*)tag; +- (BOOL) selectFile: (NSString*)fullPath + inFileViewerRootedAtPath: (NSString*)rootFullpath; + +// +// Requesting Information about Files +// +- (NSString*) fullPathForApplication: (NSString*)appName; +- (BOOL) getFileSystemInfoForPath: (NSString*)fullPath + isRemovable: (BOOL*)removableFlag + isWritable: (BOOL*)writableFlag + isUnmountable: (BOOL*)unmountableFlag + description: (NSString**)description + type: (NSString**)fileSystemType; +- (BOOL) getInfoForFile: (NSString*)fullPath + application: (NSString**)appName + type: (NSString**)type; +- (NSImage*) iconForFile: (NSString*)fullPath; +- (NSImage*) iconForFiles: (NSArray*)pathArray; +- (NSImage*) iconForFileType: (NSString*)fileType; +#ifndef STRICT_OPENSTEP +- (BOOL) isFilePackageAtPath: (NSString*)fullPath; +#endif + +// +// Tracking Changes to the File System +// +- (BOOL) fileSystemChanged; +- (void) noteFileSystemChanged; +#ifndef STRICT_OPENSTEP +- (void) noteFileSystemChanged: (NSString*)path; +#endif + +// +// Updating Registered Services and File Types +// +- (void) findApplications; + +// +// Launching and Manipulating Applications +// +- (void) hideOtherApplications; +- (BOOL) launchApplication: (NSString*)appName; +- (BOOL) launchApplication: (NSString*)appName + showIcon: (BOOL)showIcon + autolaunch: (BOOL)autolaunch; +#ifndef STRICT_OPENSTEP +- (NSDictionary*) activeApplication; +- (NSArray*) launchedApplications; +#endif + +// +// Unmounting a Device +// +- (BOOL) unmountAndEjectDeviceAtPath: (NSString*)path; + +// +// Tracking Status Changes for Devices +// +- (void) checkForRemovableMedia; +- (NSArray*) mountNewRemovableMedia; +- (NSArray*) mountedRemovableMedia; +#ifndef STRICT_OPENSTEP +- (NSArray*) mountedLocalVolumePaths; +#endif + +// +// Notification Center +// +- (NSNotificationCenter*) notificationCenter; + +// +// Tracking Changes to the User Defaults Database +// +- (void) noteUserDefaultsChanged; +- (BOOL) userDefaultsChanged; + +// +// Animating an Image +// +- (void) slideImage: (NSImage*)image + from: (NSPoint)fromPoint + to: (NSPoint)toPoint; + +// +// Requesting Additional Time before Power Off or Logout +// +- (int) extendPowerOffBy: (int)requested; + +@end + +#ifndef NO_GNUSTEP + +@class NSBundle; + +@interface NSWorkspace (GNUstep) +- (NSString*) getBestAppInRole: (NSString*)role + forExtension: (NSString*)ext; +- (NSString*) getBestIconForExtension: (NSString*)ext; +- (NSDictionary*) infoForExtension: (NSString*)ext; +- (NSBundle*) bundleForApp:(NSString*)appName; +- (NSImage*) appIconForApp:(NSString*)appName; +- (NSString*) locateApplicationBinary: (NSString*)appName; +- (void) setBestApp: (NSString*)appName + inRole: (NSString*)role + forExtension: (NSString*)ext; +- (void) setBestIcon: (NSString*)iconPath forExtension: (NSString*)ext; +@end +#endif + +/* Notifications */ + +/** + * This notification is sent by applications when they launch, + * the notification userInfo dictionary contains the following - + * + * NSApplicationName + * The name of the launched application. + * A string. + * + * NSApplicationPath + * The full path to the launched application. + * A string. + * + * NSApplicationProcessIdentifier + * The process identifier (pid) of the launched application. + * + * NSApplicationProcessSerialNumberHigh + * MacOS-X specific ... not present in GNUstep. + * + * NSApplicationProcessSerialNumberLow + * MacOS-X specific ... not present in GNUstep. + * + * + */ +APPKIT_EXPORT NSString *NSWorkspaceDidLaunchApplicationNotification; + +APPKIT_EXPORT NSString *NSWorkspaceDidMountNotification; +APPKIT_EXPORT NSString *NSWorkspaceDidPerformFileOperationNotification; +APPKIT_EXPORT NSString *NSWorkspaceDidTerminateApplicationNotification; +APPKIT_EXPORT NSString *NSWorkspaceDidUnmountNotification; +APPKIT_EXPORT NSString *NSWorkspaceWillLaunchApplicationNotification; +APPKIT_EXPORT NSString *NSWorkspaceWillPowerOffNotification; +APPKIT_EXPORT NSString *NSWorkspaceWillUnmountNotification; + +// +// Workspace File Type Globals +// +APPKIT_EXPORT NSString *NSPlainFileType; +APPKIT_EXPORT NSString *NSDirectoryFileType; +APPKIT_EXPORT NSString *NSApplicationFileType; +APPKIT_EXPORT NSString *NSFilesystemFileType; +APPKIT_EXPORT NSString *NSShellCommandFileType; + +// +// Workspace File Operation Globals +// +APPKIT_EXPORT NSString *NSWorkspaceCompressOperation; +APPKIT_EXPORT NSString *NSWorkspaceCopyOperation; +APPKIT_EXPORT NSString *NSWorkspaceDecompressOperation; +APPKIT_EXPORT NSString *NSWorkspaceDecryptOperation; +APPKIT_EXPORT NSString *NSWorkspaceDestroyOperation; +APPKIT_EXPORT NSString *NSWorkspaceDuplicateOperation; +APPKIT_EXPORT NSString *NSWorkspaceEncryptOperation; +APPKIT_EXPORT NSString *NSWorkspaceLinkOperation; +APPKIT_EXPORT NSString *NSWorkspaceMoveOperation; +APPKIT_EXPORT NSString *NSWorkspaceRecycleOperation; + +#endif // _GNUstep_H_NSWorkspace diff --git a/Headers/AppKit/PSOperators.h b/Headers/AppKit/PSOperators.h new file mode 100644 index 000000000..805c7a49f --- /dev/null +++ b/Headers/AppKit/PSOperators.h @@ -0,0 +1,818 @@ +/* PSOperators.h - Drawing engine operators that use default context + + Copyright (C) 1999 Free Software Foundation, Inc. + Written by: Richard Frith-Macdonald + Based on code by Adam Fedor + Date: Feb 1999 + + This file is part of the GNU Objective C User Interface library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _PSOperators_h_INCLUDE +#define _PSOperators_h_INCLUDE + +#include + +#ifndef NO_GNUSTEP +#define DEFCTXT GSCurrentContext() +#else +#define DEFCTXT [NSGraphicsContext currentContext] +#endif + +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentalpha(float* a) +__attribute__((unused)); + +static inline void +PScurrentcmykcolor(float* c, float* m, float* y, float* k) +__attribute__((unused)); + +static inline void +PScurrentgray(float* gray) +__attribute__((unused)); + +static inline void +PScurrenthsbcolor(float* h, float* s, float* b) +__attribute__((unused)); + +static inline void +PScurrentrgbcolor(float* r, float* g, float* b) +__attribute__((unused)); + +static inline void +PSsetalpha(float a) +__attribute__((unused)); + +static inline void +PSsetcmykcolor(float c, float m, float y, float k) +__attribute__((unused)); + +static inline void +PSsetgray(float gray) +__attribute__((unused)); + +static inline void +PSsethsbcolor(float h, float s, float b) +__attribute__((unused)); + +static inline void +PSsetrgbcolor(float r, float g, float b) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSashow(float x, float y, const char* s) +__attribute__((unused)); + +static inline void +PSawidthshow(float cx, float cy, int c, float ax, float ay, const char* s) +__attribute__((unused)); + +static inline void +PScharpath(const char* s, int b) +__attribute__((unused)); + +static inline void +PSshow(const char* s) +__attribute__((unused)); + +static inline void +PSwidthshow(float x, float y, int c, const char* s) +__attribute__((unused)); + +static inline void +PSxshow(const char* s, const float* numarray, int size) +__attribute__((unused)); + +static inline void +PSxyshow(const char* s, const float* numarray, int size) +__attribute__((unused)); + +static inline void +PSyshow(const char* s, const float* numarray, int size) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ +static inline void +PSgrestore() +__attribute__((unused)); + +static inline void +PSgsave() +__attribute__((unused)); + +static inline void +PSinitgraphics() +__attribute__((unused)); + +static inline void +PSsetgstate(int gst) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentflat(float* flatness) +__attribute__((unused)); + +static inline void +PScurrentlinecap(int* linecap) +__attribute__((unused)); + +static inline void +PScurrentlinejoin(int* linejoin) +__attribute__((unused)); + +static inline void +PScurrentlinewidth(float* width) +__attribute__((unused)); + +static inline void +PScurrentmiterlimit(float* limit) +__attribute__((unused)); + +static inline void +PScurrentpoint(float* x, float* y) +__attribute__((unused)); + +static inline void +PScurrentstrokeadjust(int* b) +__attribute__((unused)); + +static inline void +PSsetdash(const float* pat, int size, float offset) +__attribute__((unused)); + +static inline void +PSsetflat(float flatness) +__attribute__((unused)); + +static inline void +PSsethalftonephase(float x, float y) +__attribute__((unused)); + +static inline void +PSsetlinecap(int linecap) +__attribute__((unused)); + +static inline void +PSsetlinejoin(int linejoin) +__attribute__((unused)); + +static inline void +PSsetlinewidth(float width) +__attribute__((unused)); + +static inline void +PSsetmiterlimit(float limit) +__attribute__((unused)); + +static inline void +PSsetstrokeadjust(int b) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSconcat(const float* m) +__attribute__((unused)); + +static inline void +PSinitmatrix() +__attribute__((unused)); + +static inline void +PSrotate(float angle) +__attribute__((unused)); + +static inline void +PSscale(float x, float y) +__attribute__((unused)); + +static inline void +PStranslate(float x, float y) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSarc(float x, float y, float r, float angle1, float angle2) +__attribute__((unused)); + +static inline void +PSarcn(float x, float y, float r, float angle1, float angle2) +__attribute__((unused)); + +static inline void +PSarct(float x1, float y1, float x2, float y2, float r) +__attribute__((unused)); + +static inline void +PSclip() +__attribute__((unused)); + +static inline void +PSclosepath() +__attribute__((unused)); + +static inline void +PScurveto(float x1, float y1, float x2, float y2, float x3, float y3) +__attribute__((unused)); + +static inline void +PSeoclip() +__attribute__((unused)); + +static inline void +PSeofill() +__attribute__((unused)); + +static inline void +PSfill() +__attribute__((unused)); + +static inline void +PSflattenpath() +__attribute__((unused)); + +static inline void +PSinitclip() +__attribute__((unused)); + +static inline void +PSlineto(float x, float y) +__attribute__((unused)); + +static inline void +PSmoveto(float x, float y) +__attribute__((unused)); + +static inline void +PSnewpath() +__attribute__((unused)); + +static inline void +PSpathbbox(float* llx, float* lly, float* urx, float* ury) +__attribute__((unused)); + +static inline void +PSrcurveto(float x1, float y1, float x2, float y2, float x3, float y3) +__attribute__((unused)); + +static inline void +PSrectclip(float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +PSrectfill(float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +PSrectstroke(float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +PSreversepath() +__attribute__((unused)); + +static inline void +PSrlineto(float x, float y) +__attribute__((unused)); + +static inline void +PSrmoveto(float x, float y) +__attribute__((unused)); + +static inline void +PSstroke() +__attribute__((unused)); + +static inline void +PSshfill(NSDictionary *shaderDictionary) +__attribute__((unused)); + + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ +static inline void +PScomposite(float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) +__attribute__((unused)); + +static inline void +PScompositerect(float x, float y, float w, float h, int op) +__attribute__((unused)); + +static inline void +PSdissolve(float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ +static inline void +PSPrintf(const char * fmt, va_list args) +__attribute__((unused)); + +static inline void +PSWriteData(const char * buf, unsigned int count) +__attribute__((unused)); + + +/* ----------------------------------------------------------------------- */ +/* Color operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentalpha(float* a) +{ + DPScurrentalpha(DEFCTXT, a); +} + +static inline void +PScurrentcmykcolor(float* c, float* m, float* y, float* k) +{ + DPScurrentcmykcolor(DEFCTXT, c, m, y, k); +} + +static inline void +PScurrentgray(float* gray) +{ + DPScurrentgray(DEFCTXT, gray); +} + +static inline void +PScurrenthsbcolor(float* h, float* s, float* b) +{ + DPScurrenthsbcolor(DEFCTXT, h, s, b); +} + +static inline void +PScurrentrgbcolor(float* r, float* g, float* b) +{ + DPScurrentrgbcolor(DEFCTXT, r, g, b); +} + +static inline void +PSsetalpha(float a) +{ + DPSsetalpha(DEFCTXT, a); +} + +static inline void +PSsetcmykcolor(float c, float m, float y, float k) +{ + DPSsetcmykcolor(DEFCTXT, c, m, y, k); +} + +static inline void +PSsetgray(float gray) +{ + DPSsetgray(DEFCTXT, gray); +} + +static inline void +PSsethsbcolor(float h, float s, float b) +{ + DPSsethsbcolor(DEFCTXT, h, s, b); +} + +static inline void +PSsetrgbcolor(float r, float g, float b) +{ + DPSsetrgbcolor(DEFCTXT, r, g, b); +} + + + +/* ----------------------------------------------------------------------- */ +/* Text operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSashow(float x, float y, const char* s) +{ + DPSashow(DEFCTXT, x, y, s); +} + +static inline void +PSawidthshow(float cx, float cy, int c, float ax, float ay, const char* s) +{ + DPSawidthshow(DEFCTXT, cx, cy, c, ax, ay, s); +} + +static inline void +PScharpath(const char* s, int b) +{ + DPScharpath(DEFCTXT, s, b); +} + +static inline void +PSshow(const char* s) +{ + DPSshow(DEFCTXT, s); +} + +static inline void +PSwidthshow(float x, float y, int c, const char* s) +{ + DPSwidthshow(DEFCTXT, x, y, c, s); +} + +static inline void +PSxshow(const char* s, const float* numarray, int size) +{ + DPSxshow(DEFCTXT, s, numarray, size); +} + +static inline void +PSxyshow(const char* s, const float* numarray, int size) +{ + DPSxyshow(DEFCTXT, s, numarray, size); +} + +static inline void +PSyshow(const char* s, const float* numarray, int size) +{ + DPSyshow(DEFCTXT, s, numarray, size); +} + + + +/* ----------------------------------------------------------------------- */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ +static inline void +PSgsave() +{ + DPSgsave(DEFCTXT); +} + +static inline void +PSgrestore() +{ + DPSgrestore(DEFCTXT); +} + +static inline void +PSinitgraphics() +{ + DPSinitgraphics(DEFCTXT); +} + +static inline void +PSsetgstate(int gst) +{ + DPSsetgstate(DEFCTXT, gst); +} + + + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentflat(float* flatness) +{ + DPScurrentflat(DEFCTXT, flatness); +} + +static inline void +PScurrentlinecap(int* linecap) +{ + DPScurrentlinecap(DEFCTXT, linecap); +} + +static inline void +PScurrentlinejoin(int* linejoin) +{ + DPScurrentlinejoin(DEFCTXT, linejoin); +} + +static inline void +PScurrentlinewidth(float* width) +{ + DPScurrentlinewidth(DEFCTXT, width); +} + +static inline void +PScurrentmiterlimit(float* limit) +{ + DPScurrentmiterlimit(DEFCTXT, limit); +} + +static inline void +PScurrentpoint(float* x, float* y) +{ + DPScurrentpoint(DEFCTXT, x, y); +} + +static inline void +PScurrentstrokeadjust(int* b) +{ + DPScurrentstrokeadjust(DEFCTXT, b); +} + +static inline void +PSsetdash(const float* pat, int size, float offset) +{ + DPSsetdash(DEFCTXT, pat, size, offset); +} + +static inline void +PSsetflat(float flatness) +{ + DPSsetflat(DEFCTXT, flatness); +} + +static inline void +PSsethalftonephase(float x, float y) +{ + DPSsethalftonephase(DEFCTXT, x, y); +} + +static inline void +PSsetlinecap(int linecap) +{ + DPSsetlinecap(DEFCTXT, linecap); +} + +static inline void +PSsetlinejoin(int linejoin) +{ + DPSsetlinejoin(DEFCTXT, linejoin); +} + +static inline void +PSsetlinewidth(float width) +{ + DPSsetlinewidth(DEFCTXT, width); +} + +static inline void +PSsetmiterlimit(float limit) +{ + DPSsetmiterlimit(DEFCTXT, limit); +} + +static inline void +PSsetstrokeadjust(int b) +{ + DPSsetstrokeadjust(DEFCTXT, b); +} + + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSconcat(const float* m) +{ + DPSconcat(DEFCTXT, m); +} + +static inline void +PSinitmatrix() +{ + DPSinitmatrix(DEFCTXT); +} + +static inline void +PSrotate(float angle) +{ + DPSrotate(DEFCTXT, angle); +} + +static inline void +PSscale(float x, float y) +{ + DPSscale(DEFCTXT, x, y); +} + +static inline void +PStranslate(float x, float y) +{ + DPStranslate(DEFCTXT, x, y); +} + + + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PSarc(float x, float y, float r, float angle1, float angle2) +{ + DPSarc(DEFCTXT, x, y, r, angle1, angle2); +} + +static inline void +PSarcn(float x, float y, float r, float angle1, float angle2) +{ + DPSarcn(DEFCTXT, x, y, r, angle1, angle2); +} + +static inline void +PSarct(float x1, float y1, float x2, float y2, float r) +{ + DPSarct(DEFCTXT, x1, y1, x2, y2, r); +} + +static inline void +PSclip() +{ + DPSclip(DEFCTXT); +} + +static inline void +PSclosepath() +{ + DPSclosepath(DEFCTXT); +} + +static inline void +PScurveto(float x1, float y1, float x2, float y2, float x3, float y3) +{ + DPScurveto(DEFCTXT, x1, y1, x2, y2, x3, y3); +} + +static inline void +PSeoclip() +{ + DPSeoclip(DEFCTXT); +} + +static inline void +PSeofill() +{ + DPSeofill(DEFCTXT); +} + +static inline void +PSfill() +{ + DPSfill(DEFCTXT); +} + +static inline void +PSflattenpath() +{ + DPSflattenpath(DEFCTXT); +} + +static inline void +PSinitclip() +{ + DPSinitclip(DEFCTXT); +} + +static inline void +PSlineto(float x, float y) +{ + DPSlineto(DEFCTXT, x, y); +} + +static inline void +PSmoveto(float x, float y) +{ + DPSmoveto(DEFCTXT, x, y); +} + +static inline void +PSnewpath() +{ + DPSnewpath(DEFCTXT); +} + +static inline void +PSpathbbox(float* llx, float* lly, float* urx, float* ury) +{ + DPSpathbbox(DEFCTXT, llx, lly, urx, ury); +} + +static inline void +PSrcurveto(float x1, float y1, float x2, float y2, float x3, float y3) +{ + DPSrcurveto(DEFCTXT, x1, y1, x2, y2, x3, y3); +} + +static inline void +PSrectclip(float x, float y, float w, float h) +{ + DPSrectclip(DEFCTXT, x, y, w, h); +} + +static inline void +PSrectfill(float x, float y, float w, float h) +{ + DPSrectfill(DEFCTXT, x, y, w, h); +} + +static inline void +PSrectstroke(float x, float y, float w, float h) +{ + DPSrectstroke(DEFCTXT, x, y, w, h); +} + +static inline void +PSreversepath() +{ + DPSreversepath(DEFCTXT); +} + +static inline void +PSrlineto(float x, float y) +{ + DPSrlineto(DEFCTXT, x, y); +} + +static inline void +PSrmoveto(float x, float y) +{ + DPSrmoveto(DEFCTXT, x, y); +} + +static inline void +PSstroke() +{ + DPSstroke(DEFCTXT); +} + +static inline void +PSshfill(NSDictionary *shaderDictionary) +{ + DPSshfill(DEFCTXT, shaderDictionary); +} + + +/*-------------------------------------------------------------------------*/ +/* Graphics Extensions Ops */ +/*-------------------------------------------------------------------------*/ +static inline void +PScomposite(float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) +{ + DPScomposite(DEFCTXT, x, y, w, h, gstateNum, dx, dy, op); +} + +static inline void +PScompositerect(float x, float y, float w, float h, int op) +{ + DPScompositerect(DEFCTXT, x, y, w, h, op); +} + +static inline void +PSdissolve(float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) +{ + DPSdissolve(DEFCTXT, x, y, w, h, gstateNum, dx, dy, delta); +} + + + +/* ----------------------------------------------------------------------- */ +/* Postscript Client functions */ +/* ----------------------------------------------------------------------- */ +static inline void +PSPrintf(const char * fmt, va_list args) +{ + DPSPrintf(DEFCTXT, fmt, args); +} + +static inline void +PSWriteData(const char * buf, unsigned int count) +{ + DPSWriteData(DEFCTXT, buf, count); +} + +#endif diff --git a/Model/GMAppKit.m b/Model/GMAppKit.m index d947f57ec..b5ce68ae5 100644 --- a/Model/GMAppKit.m +++ b/Model/GMAppKit.m @@ -23,7 +23,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "gnustep/gui/GMAppKit.h" +#include "GNUstepGUI/GMAppKit.h" #ifndef AUTORELEASE #define AUTORELEASE(object) [object autorelease] diff --git a/Model/GMArchiver.m b/Model/GMArchiver.m index a8e24d43e..12ecdba92 100644 --- a/Model/GMArchiver.m +++ b/Model/GMArchiver.m @@ -47,7 +47,7 @@ #define RETAIN(object) [object retain] #endif -#include +#include @interface GMClassInfo : NSObject { diff --git a/Model/GNUmakefile b/Model/GNUmakefile index f84c4ad8f..9b8e74331 100644 --- a/Model/GNUmakefile +++ b/Model/GNUmakefile @@ -43,8 +43,8 @@ endif libgmodel_OBJC_FILES = IMCustomObject.m IMConnectors.m IMLoading.m GMAppKit.m \ GMArchiver.m -libgmodel_HEADER_FILES_DIR = ../Headers/gnustep/gui -libgmodel_HEADER_FILES_INSTALL_DIR = /gnustep/gui +libgmodel_HEADER_FILES_DIR = ../Headers/Additions/GNUstepGUI +libgmodel_HEADER_FILES_INSTALL_DIR = /GNUstepGUI libgmodel_HEADER_FILES = IMConnectors.h IMCustomObject.h IMLoading.h \ GMAppKit.h GMArchiver.h @@ -71,7 +71,7 @@ endif ADDITIONAL_OBJC_FLAGS += $(BACKEND_DEFINE) # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS = -I../Headers +ADDITIONAL_INCLUDE_DIRS = -I../Headers/Additions -I../Headers # What are the libraries this library depends upon. This is needed for some # systems where building a shared library requires to pass to the linker diff --git a/Model/GNUmakefile.postamble b/Model/GNUmakefile.postamble index 542032be8..63984d980 100644 --- a/Model/GNUmakefile.postamble +++ b/Model/GNUmakefile.postamble @@ -23,9 +23,9 @@ # before-libgmodel-all:: \ - $(addprefix ../Headers/gnustep/gui/, $(libgmodel_HEADER_FILES)) + $(addprefix ../Headers/Additions/GNUstepGUI/, $(libgmodel_HEADER_FILES)) -../Headers/gnustep/gui/%.h: %.h +../Headers/Additions/GNUstepGUI/%.h: %.h cp $^ $@ # Additional dependencies diff --git a/Model/IBClasses.m b/Model/IBClasses.m index 0ff253362..f34a1ce2b 100644 --- a/Model/IBClasses.m +++ b/Model/IBClasses.m @@ -29,7 +29,7 @@ #include #include #endif -#include +#include #ifdef __APPLE__ #import @@ -40,7 +40,7 @@ #include "IBClasses.h" #include "Translator.h" #include "IMConnectors.h" -#include "gnustep/gui/IMCustomObject.h" +#include "GNUstepGUI/IMCustomObject.h" //#define DEBUG diff --git a/Model/IMConnectors.m b/Model/IMConnectors.m index ee5872d6a..202178a0c 100644 --- a/Model/IMConnectors.m +++ b/Model/IMConnectors.m @@ -26,12 +26,12 @@ #include #ifndef NeXT_Foundation_LIBRARY -#include +#include #endif #include #include -#include -#include "gnustep/gui/IMCustomObject.h" +#include +#include "GNUstepGUI/IMCustomObject.h" #include "IMConnectors.h" @implementation IMConnector diff --git a/Model/IMCustomObject.m b/Model/IMCustomObject.m index d4756e42a..0fb7945f3 100644 --- a/Model/IMCustomObject.m +++ b/Model/IMCustomObject.m @@ -24,8 +24,8 @@ */ #include -#include "gnustep/gui/GMArchiver.h" -#include "gnustep/gui/IMCustomObject.h" +#include "GNUstepGUI/GMArchiver.h" +#include "GNUstepGUI/IMCustomObject.h" @implementation NSObject(ModelUnarchiving) diff --git a/Model/IMLoading.m b/Model/IMLoading.m index 3114651d3..3abbcdf2b 100644 --- a/Model/IMLoading.m +++ b/Model/IMLoading.m @@ -32,9 +32,9 @@ #include #endif -#include "gnustep/gui/GMArchiver.h" -#include "gnustep/gui/IMLoading.h" -#include "gnustep/gui/IMCustomObject.h" +#include "GNUstepGUI/GMArchiver.h" +#include "GNUstepGUI/IMLoading.h" +#include "GNUstepGUI/IMCustomObject.h" /* For awakeFromNib */ #include diff --git a/Model/Translator.m b/Model/Translator.m index a4b1b2c79..c3b270eef 100644 --- a/Model/Translator.m +++ b/Model/Translator.m @@ -31,8 +31,8 @@ */ #include -#include "gnustep/gui/GMArchiver.h" -#include "gnustep/gui/IMLoading.h" +#include "GNUstepGUI/GMArchiver.h" +#include "GNUstepGUI/IMLoading.h" #include "IBClasses.h" #include "Translator.h" diff --git a/Resources/GNUmakefile b/Resources/GNUmakefile index 236a113dd..0fd066b96 100644 --- a/Resources/GNUmakefile +++ b/Resources/GNUmakefile @@ -52,4 +52,4 @@ strings_HEADER_FILES = after-strings:: make_strings -L "$(gui-resources_LANGUAGES)" \ $(addprefix ../Source/,$(strings_OBJC_FILES)) \ - $(addprefix ../Headers/gnustep/gui/,$(strings_HEADER_FILES)) + $(addprefix ../Headers/Additions/GNUstepGUI/,$(strings_HEADER_FILES)) diff --git a/Source/CompatibilityHeaders.make b/Source/CompatibilityHeaders.make new file mode 100644 index 000000000..563a2e7ed --- /dev/null +++ b/Source/CompatibilityHeaders.make @@ -0,0 +1,50 @@ +# -*-makefile-*- +# CompatibilityHeaders.make +# +# Create compatibility headers so that code written before the big header +# move will continue to compile (for a while). +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# +# Author: Alexander Malmberg +# Date: 2003-07-29 +# +# This file is part of the GNUstep project. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# You should have received a copy of the GNU General Public +# License along with this library; see the file COPYING.LIB. +# If not, write to the Free Software Foundation, +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +# The usage should be fairly obvious. For each pair of OLD_DIR and NEW_DIR, +# make a copy and set OLD_DIR, NEW_DIR, and LIST. Note that LIST must be +# non-empty; if there are no files for a pair, remove it completely. + +after-install:: + @echo Installing compatibility headers... + + @OLD_DIR=AppKit; NEW_DIR=GNUstepGUI; \ + LIST="$(GUI_HEADERS)" ;\ + $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ + for I in $$LIST ; do \ + (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ + echo "#include <$$NEW_DIR/$$I>" ) \ + > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ + done + + @OLD_DIR=gnustep/gui; NEW_DIR=GNUstepGUI; \ + LIST="$(GUI_HEADERS)" ;\ + $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ + for I in $$LIST ; do \ + (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ + echo "#include <$$NEW_DIR/$$I>" ) \ + > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ + done + diff --git a/Source/DocMakefile b/Source/DocMakefile index 138534829..351ae000f 100644 --- a/Source/DocMakefile +++ b/Source/DocMakefile @@ -27,12 +27,7 @@ MAKEFILE_NAME = DocMakefile include $(GNUSTEP_MAKEFILES)/common.make # These are gui headers that are also classes documented with autogsdoc -AUTOGSDOC_HEADERS = \ -GSDisplayServer.h \ -GSFusedSilica.h \ -GSTable.h \ -GSHbox.h \ -GSVbox.h \ +AUTOGSDOC_HEADERS_GUI = \ NSActionCell.h \ NSAffineTransform.h \ NSApplication.h \ @@ -137,9 +132,17 @@ NSWindow.h \ NSWindowController.h \ NSWorkspace.h -DOCUMENT_NAME = Gui +AUTOGSDOC_HEADERS_GUIADD = \ +GSDisplayServer.h \ +GSFusedSilica.h \ +GSTable.h \ +GSHbox.h \ +GSVbox.h \ + +DOCUMENT_NAME = Gui GuiAdditions Gui_DOC_INSTALL_DIR = Developer +GuiAdditions_DOC_INSTALL_DIR = Developer Gui_AGSDOC_FILES = ../Documentation/Gui/Gui.gsdoc \ ../Documentation/Gui/Introduction.gsdoc \ @@ -149,7 +152,9 @@ Gui_AGSDOC_FILES = ../Documentation/Gui/Gui.gsdoc \ ../Documentation/Gui/NSCoderAdditions.gsdoc \ ../Documentation/Gui/NSMutableAttributedStringAdditions.gsdoc \ ../Documentation/Gui/NSStringAdditions.gsdoc \ - $(AUTOGSDOC_HEADERS) + $(AUTOGSDOC_HEADERS_GUI) + +GuiAdditions_AGSDOC_FILES = $(AUTOGSDOC_HEADERS_GUIADD) # # Hack ... using the -DocumentationDirectory flag overrides the value @@ -171,22 +176,45 @@ Gui_AGSDOC_FLAGS = \ DEFINE_RINT_IF_MISSING=""; \ }' -Up Gui +GuiAdditions_AGSDOC_FLAGS = \ + -DocumentationDirectory ../Documentation/GuiAdditions \ + -HeaderDirectory ../Headers/Additions/GNUstepGUI \ + -Declared GNUstepGUI \ + -Standards YES \ + -ConstantsTemplate TypesAndConstants \ + -FunctionsTemplate Functions \ + -MacrosTemplate Functions \ + -TypedefsTemplate TypesAndConstants \ + -VariablesTemplate TypesAndConstants \ + -WordMap '{\ + APPKIT_EXPORT=extern;APPKIT_DECLARE="";\ + DEFINE_RINT_IF_MISSING=""; \ + }' -Up Gui + include $(GNUSTEP_MAKEFILES)/documentation.make -before-all:: ../Documentation/Gui +before-all:: ../Documentation/Gui \ + ../Documentation/GuiAdditions cp ../Documentation/Gui/Gui.gsdoc . + cp ../Documentation/GuiAdditions/GuiAdditions.gsdoc . ../Documentation/Gui: $(MKDIRS) ../Documentation/Gui +../Documentation/GuiAdditions: + $(MKDIRS) ../Documentation/GuiAdditions + # # Clean up temporary files used while generating documentation. # after-clean:: $(RM) Gui.gsdoc + $(RM) GuiAdditions.gsdoc if [ -d Gui ]; then \ $(RM) Gui/stamp; \ rmdir Gui; \ + $(RM) GuiAdditions/stamp; \ + rmdir GuiAdditions; \ fi diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 05b51a7e3..219ff2475 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -184,32 +184,13 @@ ifneq ($(FOUNDATION_LIB), fd) libgnustep-gui_OBJC_FILES += NSPasteboard.m endif -libgnustep-gui_HEADER_FILES_DIR = ../Headers/AppKit -libgnustep-gui_HEADER_FILES_INSTALL_DIR = /AppKit +libgnustep-gui_HEADER_FILES_DIR = ../Headers/Additions/GNUstepGUI +libgnustep-gui_HEADER_FILES_INSTALL_DIR = /GNUstepGUI -libgnustep-gui_HEADER_FILES = \ +APPKIT_HEADERS = \ AppKit.h \ -GSVersion.h \ AppKitDefines.h \ AppKitExceptions.h \ -DPSOperators.h \ -GMAppKit.h \ -GMArchiver.h \ -GSFontInfo.h \ -GSMemoryPanel.h \ -GSInfoPanel.h \ -GSMethodTable.h \ -GSPasteboardServer.h \ -GSServicesManager.h \ -GSTextConverter.h \ -GSTrackingRect.h \ -GSHelpManagerPanel.h \ -GSNibTemplates.h \ -GSDisplayServer.h \ -GSFusedSilica.h \ -GSTable.h \ -GSHbox.h \ -GSVbox.h \ NSActionCell.h \ NSAffineTransform.h \ NSApplication.h \ @@ -315,9 +296,6 @@ NSView.h \ NSWindow.h \ NSWindowController.h \ NSWorkspace.h \ -IMConnectors.h \ -IMCustomObject.h \ -IMLoading.h \ NSAttributedString.h \ NSColorPicking.h \ NSDocumentFrameworkPrivate.h \ @@ -328,12 +306,41 @@ NSNibDeclarations.h \ NSNibLoading.h \ NSSpellProtocol.h \ NSUserInterfaceValidation.h \ -PSOperators.h \ +DPSOperators.h \ +PSOperators.h + +GUI_HEADERS = \ +GSVersion.h \ +GMAppKit.h \ +GMArchiver.h \ +GSFontInfo.h \ +GSMemoryPanel.h \ +GSInfoPanel.h \ +GSMethodTable.h \ +GSPasteboardServer.h \ +GSServicesManager.h \ +GSTextConverter.h \ +GSTrackingRect.h \ +GSHelpManagerPanel.h \ +GSNibTemplates.h \ +GSDisplayServer.h \ +GSFusedSilica.h \ +GSTable.h \ +GSHbox.h \ +GSVbox.h \ +IMConnectors.h \ +IMCustomObject.h \ +IMLoading.h \ GSLayoutManager.h \ GSLayoutManager_internal.h \ GSTypesetter.h \ GSHorizontalTypesetter.h +libgnustep-gui_HEADER_FILES = ${GUI_HEADERS} + +HEADERS_INSTALL = ${APPKIT_HEADERS} \ + ${GUI_HEADERS} + # Extra DLL exports file libgnustep-gui_DLL_DEF = libgnustep-gui.def @@ -344,3 +351,5 @@ include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make include GNUmakefile.postamble + +include CompatibilityHeaders.make diff --git a/Source/GNUmakefile.postamble b/Source/GNUmakefile.postamble index 179d3f5ce..897364997 100644 --- a/Source/GNUmakefile.postamble +++ b/Source/GNUmakefile.postamble @@ -37,26 +37,36 @@ # Things to do before compiling ifeq ($(doc),yes) -before-all:: +before-all:: $(GNUSTEP_TARGET_DIR)/config.h cp ../Documentation/Gui/Gui.gsdoc . # Things to do after compiling after-all:: $(RM) Gui.gsdoc if test -d Gui; then rmdir Gui; fi; +else +before-all:: $(GNUSTEP_TARGET_DIR)/config.h endif # Things to do before installing # before-install:: # Things to do after installing -# after-install:: +after-install:: + for file in $(APPKIT_HEADERS); do \ + $(INSTALL_DATA) ../Headers/AppKit/$$file \ + $(GNUSTEP_HEADERS)/AppKit/$$file ; \ + done +# # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling -# after-uninstall:: +after-uninstall:: + for file in $(APPKIT_HEADERS); do \ + rm -f $(GNUSTEP_HEADERS)/AppKit/$$file ; \ + done # Things to do before cleaning # before-clean:: @@ -69,7 +79,9 @@ endif # Things to do after distcleaning after-distclean:: - rm -f GNUmakefile.local + rm -f GNUmakefile.local + rm -rf $(GNUSTEP_TARGET_DIR)/config.h + rm -rf ../Headers/Additions/GNUstepGUI/config.h # Things to do before checking # before-check:: @@ -80,6 +92,21 @@ after-distclean:: # # GNUstep GUI Library specific targets +# +# The config.h file is specific to a target +# +$(GNUSTEP_TARGET_DIR)/config.h: ../config.status + $(MKDIRS) $(GNUSTEP_TARGET_DIR) + -mv ../Headers/Additions/GNUstepGUI/config.h $(GNUSTEP_TARGET_DIR) + -touch $(GNUSTEP_TARGET_DIR)/config.h + +# +# Files that need a rebuild if config.h is changed. +# + +$(GNUSTEP_OBJ_DIR)/*.o \ + : $(GNUSTEP_TARGET_DIR)/config.h + # # Make list of class names for DLL exports. I'm not sure how to make this # work with the correct dependencies, so for now it should be regenerated diff --git a/Source/GNUmakefile.preamble b/Source/GNUmakefile.preamble index 47f0390d9..039477727 100644 --- a/Source/GNUmakefile.preamble +++ b/Source/GNUmakefile.preamble @@ -61,7 +61,7 @@ ADDITIONAL_OBJCFLAGS = -Wall # ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS += -I../Headers +ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS = @@ -74,7 +74,7 @@ ADDITIONAL_INCLUDE_DIRS += -I../Headers # # Additional directories to be created during installation -# ADDITIONAL_INSTALL_DIRS = +ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/AppKit # What are the libraries this library depends upon. This is needed for some # systems where building a shared library requires to pass to the linker diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index 6ad054814..211523d00 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -34,7 +34,7 @@ #include "AppKit/NSEvent.h" #include "AppKit/NSImage.h" #include "AppKit/NSWindow.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" #include "GSSlideView.h" diff --git a/Source/GSFontInfo.m b/Source/GSFontInfo.m index c92af7a10..81f498443 100644 --- a/Source/GSFontInfo.m +++ b/Source/GSFontInfo.m @@ -27,7 +27,7 @@ #include -#include "gnustep/gui/GSFontInfo.h" +#include "GNUstepGUI/GSFontInfo.h" #include #include #include diff --git a/Source/GSFusedSilica.m b/Source/GSFusedSilica.m index 50175dd66..d1d8e3509 100644 --- a/Source/GSFusedSilica.m +++ b/Source/GSFusedSilica.m @@ -24,7 +24,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "gnustep/gui/GSFusedSilicaContext.h" +#include "GSFusedSilicaContext.h" #include "AppKit/NSAffineTransform.h" #include diff --git a/Source/GSFusedSilicaContext.h b/Source/GSFusedSilicaContext.h new file mode 100644 index 000000000..bc2868cac --- /dev/null +++ b/Source/GSFusedSilicaContext.h @@ -0,0 +1,68 @@ +/** GSFusedSilicaContext + + Extention to NSGraphicsContext for necessary methods + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Adam Fedor + Date: Oct 2002 + + This file is part of the GNUStep + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + */ + +#ifndef _GSFusedSilicaContext_h_INCLUDE +#define _GSFusedSilicaContext_h_INCLUDE + +#include +#include + +@interface NSGraphicsContext (FusedSilica) + +/* Colorspaces */ ++ (CGColorSpaceRef) CGColorSpaceCreateDeviceGray; ++ (CGColorSpaceRef) CGColorSpaceCreateDeviceRGB; ++ (CGColorSpaceRef) CGColorSpaceCreateDeviceCMYK; ++ (CGColorSpaceRef) CGColorSpaceCreateCalibratedGray: (const float *)whitePoint + : (const float *)blackPoint + : (float)gamma; ++ (CGColorSpaceRef) CGColorSpaceCreateCalibratedRGB: (const float *)whitePoint + : (const float *)blackPoint + : (const float *)gamma + : (const float *)matrix; ++ (CGColorSpaceRef) CGColorSpaceCreateLab: (const float *)whitePoint + : (const float *)blackPoint + : (const float *)range; ++ (CGColorSpaceRef) CGColorSpaceCreateICCBased: (size_t)nComponents + : (const float *)range + : (CGDataProviderRef)profile + : (CGColorSpaceRef)alternateSpace; ++ (CGColorSpaceRef) CGColorSpaceCreateIndexed: (CGColorSpaceRef)baseSpace + : (size_t) lastIndex + : (const unsigned short int *)colorTable; ++ (size_t) CGColorSpaceGetNumberOfComponents: (CGColorSpaceRef)cs; ++ (CGColorSpaceRef) CGColorSpaceRetain: (CGColorSpaceRef)cs; ++ (void) CGColorSpaceRelease: (CGColorSpaceRef)cs; + +/* Fonts */ + ++ (CGFontRef) CGFontReferenceFromFont: (NSFont *)font; ++ (CGFontRef) CGFontRetain: (CGFontRef) font; ++ (void) CGFontRelease: (CGFontRef) font; + +@end + +#endif diff --git a/Source/GSFusedSilicaContext.m b/Source/GSFusedSilicaContext.m index 6cdc798b5..c61011f55 100644 --- a/Source/GSFusedSilicaContext.m +++ b/Source/GSFusedSilicaContext.m @@ -24,8 +24,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "gnustep/gui/GSFusedSilicaContext.h" -#include "gnustep/gui/GSFontInfo.h" +#include "GSFusedSilicaContext.h" +#include "GNUstepGUI/GSFontInfo.h" #include "AppKit/NSGraphics.h" #include #include diff --git a/Source/GSGuiPrivate.h b/Source/GSGuiPrivate.h new file mode 100644 index 000000000..ffcd559da --- /dev/null +++ b/Source/GSGuiPrivate.h @@ -0,0 +1,75 @@ +/* + GSGuiPrivate.h + + Define private functions for use in the GNUstep GUI Library + + Copyright (C) 2001 Free Software Foundation, Inc. + + Author: Nicola Pero + Date: 2001 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef _GNUstep_H_GSGuiPrivate +#define _GNUstep_H_GSGuiPrivate + +#include + +/* + * Return the gnustep-gui bundle used to load gnustep-gui resources. + * Should be only used inside the gnustep-gui library. Implemented + * in Source/NSApplication.m + */ +NSBundle *GSGuiBundle (); + +/* + * Localize a message of the gnustep-gui library. + */ +static inline NSString *GSGuiLocalizedString (NSString *key, NSString *comment) +{ + NSBundle *b = GSGuiBundle (); + + if (b != nil) + { + return [b localizedStringForKey: key value: @"" table: nil]; + } + else + { + return key; + } +} + +/* + * Redefine _() to be our own GSGuiLocalizedString(). This is so that + * make_strings will recognize it, and for easy typing. + */ +#ifdef _ +# undef _ +#endif +#define _(X) GSGuiLocalizedString (X, @"") + +#ifdef NSLocalizedString +# undef NSLocalizedString +#endif +#define NSLocalizedString(key,comment) GSGuiLocalizedString (key, comment) + +#endif /* _GNUstep_H_GSGuiPrivate */ + + + diff --git a/Source/GSHbox.m b/Source/GSHbox.m index 00b277648..989306612 100644 --- a/Source/GSHbox.m +++ b/Source/GSHbox.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/GSHbox.h" +#include "GNUstepGUI/GSHbox.h" // For the separator #include "AppKit/NSBox.h" diff --git a/Source/GSHelpManagerPanel.m b/Source/GSHelpManagerPanel.m index fd9f52f42..b5bb779e3 100644 --- a/Source/GSHelpManagerPanel.m +++ b/Source/GSHelpManagerPanel.m @@ -32,7 +32,7 @@ #include "AppKit/NSClipView.h" #include "AppKit/NSColor.h" -#include "gnustep/gui/GSHelpManagerPanel.h" +#include "GNUstepGUI/GSHelpManagerPanel.h" @implementation GSHelpManagerPanel diff --git a/Source/GSHorizontalTypesetter.m b/Source/GSHorizontalTypesetter.m index 19b8ca506..6bc6b4442 100644 --- a/Source/GSHorizontalTypesetter.m +++ b/Source/GSHorizontalTypesetter.m @@ -24,7 +24,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/GSHorizontalTypesetter.h" +#include "GNUstepGUI/GSHorizontalTypesetter.h" #include @@ -38,7 +38,7 @@ #include "AppKit/NSTextAttachment.h" #include "AppKit/NSTextContainer.h" #include "AppKit/NSTextStorage.h" -#include "gnustep/gui/GSLayoutManager.h" +#include "GNUstepGUI/GSLayoutManager.h" diff --git a/Source/GSInfoPanel.m b/Source/GSInfoPanel.m index 1f605be3c..bb2b8f0c7 100644 --- a/Source/GSInfoPanel.m +++ b/Source/GSInfoPanel.m @@ -30,7 +30,7 @@ #include "AppKit/NSFont.h" #include "AppKit/NSImage.h" #include "AppKit/NSTextField.h" -#include "gnustep/gui/GSInfoPanel.h" +#include "GNUstepGUI/GSInfoPanel.h" #include #include #include diff --git a/Source/GSLayoutManager.m b/Source/GSLayoutManager.m index df917847c..70c5df76a 100644 --- a/Source/GSLayoutManager.m +++ b/Source/GSLayoutManager.m @@ -35,8 +35,8 @@ /* just for NSAttachmentCharacter */ #include "AppKit/NSTextAttachment.h" -#include "gnustep/gui/GSTypesetter.h" -#include "gnustep/gui/GSLayoutManager_internal.h" +#include "GNUstepGUI/GSTypesetter.h" +#include "GNUstepGUI/GSLayoutManager_internal.h" diff --git a/Source/GSMemoryPanel.m b/Source/GSMemoryPanel.m index 3bdcbc85d..b46153f42 100644 --- a/Source/GSMemoryPanel.m +++ b/Source/GSMemoryPanel.m @@ -25,9 +25,9 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/GSMemoryPanel.h" -#include "gnustep/gui/GSHbox.h" -#include "gnustep/gui/GSVbox.h" +#include "GNUstepGUI/GSMemoryPanel.h" +#include "GNUstepGUI/GSHbox.h" +#include "GNUstepGUI/GSVbox.h" enum { OrderByClassName, diff --git a/Source/GSServicesManager.m b/Source/GSServicesManager.m index 446867278..47bcdeec6 100644 --- a/Source/GSServicesManager.m +++ b/Source/GSServicesManager.m @@ -24,7 +24,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -56,7 +56,7 @@ #include "AppKit/NSWorkspace.h" #include "AppKit/NSDocumentController.h" -#include "gnustep/gui/GSServicesManager.h" +#include "GNUstepGUI/GSServicesManager.h" static GSServicesManager *manager = nil; diff --git a/Source/GSSimpleLayoutManager.m b/Source/GSSimpleLayoutManager.m index 33d28055e..73680d470 100644 --- a/Source/GSSimpleLayoutManager.m +++ b/Source/GSSimpleLayoutManager.m @@ -52,7 +52,7 @@ #include "AppKit/NSStringDrawing.h" #include "AppKit/NSParagraphStyle.h" -#include "gnustep/gui/GSSimpleLayoutManager.h" +#include "GNUstepGUI/GSSimpleLayoutManager.h" #define HUGE 1e7 diff --git a/Source/GSSlideView.m b/Source/GSSlideView.m index b3a00c089..90d318734 100644 --- a/Source/GSSlideView.m +++ b/Source/GSSlideView.m @@ -33,7 +33,7 @@ #include "AppKit/NSView.h" #include "AppKit/NSWindow.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" #include "GSSlideView.h" #include diff --git a/Source/GSTable.m b/Source/GSTable.m index 96ecb3425..d949c27ca 100644 --- a/Source/GSTable.m +++ b/Source/GSTable.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/GSTable.h" +#include "GNUstepGUI/GSTable.h" @interface GSTable (Private) -(void) _updateForNewFrameSize: (NSSize)newFrameSize; diff --git a/Source/GSTextStorage.m b/Source/GSTextStorage.m index d44cc5780..89d7109c6 100644 --- a/Source/GSTextStorage.m +++ b/Source/GSTextStorage.m @@ -62,7 +62,7 @@ #define GSI_MAP_VTYPES GSUNION_INT #define GSI_MAP_NOCLEAN 1 -#include +#include static NSDictionary *blank; static NSLock *attrLock = nil; diff --git a/Source/GSTrackingRect.m b/Source/GSTrackingRect.m index 66ab1400d..822b8665d 100644 --- a/Source/GSTrackingRect.m +++ b/Source/GSTrackingRect.m @@ -26,8 +26,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" -#include "gnustep/gui/GSTrackingRect.h" +#include "config.h" +#include "GNUstepGUI/GSTrackingRect.h" @implementation GSTrackingRect diff --git a/Source/GSTypesetter.m b/Source/GSTypesetter.m index 874ef3819..7c8b365f6 100644 --- a/Source/GSTypesetter.m +++ b/Source/GSTypesetter.m @@ -24,10 +24,10 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/GSTypesetter.h" +#include "GNUstepGUI/GSTypesetter.h" -#include "gnustep/gui/GSLayoutManager.h" -#include "gnustep/gui/GSHorizontalTypesetter.h" +#include "GNUstepGUI/GSLayoutManager.h" +#include "GNUstepGUI/GSHorizontalTypesetter.h" #include #include "AppKit/NSAttributedString.h" diff --git a/Source/GSVbox.m b/Source/GSVbox.m index b215fcf00..efd512e4d 100644 --- a/Source/GSVbox.m +++ b/Source/GSVbox.m @@ -28,7 +28,7 @@ // See GSHbox.m for comments // This file is derived from GSVbox.m -#include "gnustep/gui/GSVbox.h" +#include "GNUstepGUI/GSVbox.h" #include "AppKit/NSBox.h" @implementation GSVbox: GSTable diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m index 04ecfd0ea..b3c8713fa 100644 --- a/Source/NSActionCell.m +++ b/Source/NSActionCell.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSActionCell.h" #include "AppKit/NSControl.h" diff --git a/Source/NSAffineTransform.m b/Source/NSAffineTransform.m index 637ec15f4..5b9b86cb3 100644 --- a/Source/NSAffineTransform.m +++ b/Source/NSAffineTransform.m @@ -24,7 +24,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 099230dde..4a8eccbdf 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -29,7 +29,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -67,10 +67,10 @@ #include "AppKit/NSNibLoading.h" #include "AppKit/NSPageLayout.h" -#include "gnustep/gui/GSDisplayServer.h" -#include "gnustep/gui/GSServicesManager.h" -#include "gnustep/gui/GSGuiPrivate.h" -#include "gnustep/gui/GSInfoPanel.h" +#include "GNUstepGUI/GSDisplayServer.h" +#include "GNUstepGUI/GSServicesManager.h" +#include "GSGuiPrivate.h" +#include "GNUstepGUI/GSInfoPanel.h" /* The -gui thread. See the comment in initialize_gnustep_backend. */ NSThread *GSAppKitThread; diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index 4efeb26e7..296ecffba 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -43,7 +43,7 @@ // For the colour name spaces #include "AppKit/NSGraphics.h" -#include "gnustep/gui/GSTextConverter.h" +#include "GNUstepGUI/GSTextConverter.h" /* Cache class pointers to avoid the expensive lookup by string. */ static Class dictionaryClass = nil; diff --git a/Source/NSBezierPath.m b/Source/NSBezierPath.m index 2dee3fabf..ced81d582 100644 --- a/Source/NSBezierPath.m +++ b/Source/NSBezierPath.m @@ -33,7 +33,7 @@ #include "AppKit/NSFont.h" #include "AppKit/NSImage.h" #include "AppKit/PSOperators.h" -#include "AppKit/GSFontInfo.h" +#include "GNUstepGUI/GSFontInfo.h" #include @@ -1434,7 +1434,7 @@ typedef struct _PathElement #ifdef GSIArray #undef GSIArray #endif -#include +#include @interface GSBezierPath : NSBezierPath { diff --git a/Source/NSBitmapImageRep.m b/Source/NSBitmapImageRep.m index 71d88a8ff..7544644a5 100644 --- a/Source/NSBitmapImageRep.m +++ b/Source/NSBitmapImageRep.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -40,7 +40,7 @@ #include "AppKit/NSBitmapImageRep.h" #include "AppKit/AppKitExceptions.h" -#include "gnustep/gui/nsimage-tiff.h" +#include "nsimage-tiff.h" /* Maximum number of planes */ #define MAX_PLANES 5 diff --git a/Source/NSBox.m b/Source/NSBox.m index 6c41ae126..ac73bc367 100644 --- a/Source/NSBox.m +++ b/Source/NSBox.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 5cad21afb..4d3e487a2 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -34,7 +34,7 @@ */ #include // (float)rintf(float x) -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSBrowserCell.m b/Source/NSBrowserCell.m index 1afb84c98..209d7f627 100644 --- a/Source/NSBrowserCell.m +++ b/Source/NSBrowserCell.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index a300f400f..6ca179dfd 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -55,8 +55,8 @@ #include "AppKit/NSWindow.h" #include "AppKit/NSNibConnector.h" #include "AppKit/NSNibLoading.h" -#include "gnustep/gui/GSNibTemplates.h" -#include "AppKit/IMLoading.h" +#include "GNUstepGUI/GSNibTemplates.h" +#include "GNUstepGUI/IMLoading.h" // // For the template classes since they need to know about any and all subclasses diff --git a/Source/NSButton.m b/Source/NSButton.m index 2d9cd2277..7ffe5b55e 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSButton.h" #include "AppKit/NSWindow.h" diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 6efeb8472..1be0d51ac 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -30,13 +30,13 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include #include #include -#include +#include #include "AppKit/AppKitExceptions.h" #include "AppKit/NSApplication.h" diff --git a/Source/NSCachedImageRep.m b/Source/NSCachedImageRep.m index 75b89d8c2..37e8f8848 100644 --- a/Source/NSCachedImageRep.m +++ b/Source/NSCachedImageRep.m @@ -30,7 +30,7 @@ using the rect information. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSCell.m b/Source/NSCell.m index 72f70000d..c438484f0 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -31,7 +31,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "AppKit/AppKitExceptions.h" #include "AppKit/NSAttributedString.h" diff --git a/Source/NSClipView.m b/Source/NSClipView.m index e0beb2bb9..061461d73 100644 --- a/Source/NSClipView.m +++ b/Source/NSClipView.m @@ -24,7 +24,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSClipView.h" diff --git a/Source/NSColor.m b/Source/NSColor.m index a91a22a6e..9fd5c8d15 100644 --- a/Source/NSColor.m +++ b/Source/NSColor.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSColorList.m b/Source/NSColorList.m index 83e595636..15a2a449d 100644 --- a/Source/NSColorList.m +++ b/Source/NSColorList.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index 111ef98df..078a31df7 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -41,7 +41,7 @@ #include "AppKit/NSImage.h" #include "AppKit/NSPasteboard.h" #include "AppKit/NSWindow.h" -#include "AppKit/IMLoading.h" +#include "GNUstepGUI/IMLoading.h" #define MAX_ALPHA_VALUE 100.0 static NSLock *_gs_gui_color_panel_lock = nil; diff --git a/Source/NSColorPicker.m b/Source/NSColorPicker.m index ef6447470..f9c4f700f 100644 --- a/Source/NSColorPicker.m +++ b/Source/NSColorPicker.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSButtonCell.h" #include "AppKit/NSColorPicker.h" diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index d58b0ee38..d8ac0bd68 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSActionCell.h" #include "AppKit/NSApplication.h" #include "AppKit/NSColorPanel.h" diff --git a/Source/NSControl.m b/Source/NSControl.m index 47b7e2894..aa658dc82 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 7d4f263bd..10bf75fb5 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -36,7 +36,7 @@ #include "AppKit/NSImage.h" #include "AppKit/NSBitmapImageRep.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" // Class variables static NSMutableArray *gnustep_gui_cursor_stack; diff --git a/Source/NSCustomImageRep.m b/Source/NSCustomImageRep.m index 4493f94b6..3bb7fa065 100644 --- a/Source/NSCustomImageRep.m +++ b/Source/NSCustomImageRep.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSCustomImageRep.h" #include diff --git a/Source/NSDataLink.m b/Source/NSDataLink.m index dd77e6142..e9313a2bb 100644 --- a/Source/NSDataLink.m +++ b/Source/NSDataLink.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSDataLink.h" #include "AppKit/NSDataLinkManager.h" diff --git a/Source/NSDataLinkManager.m b/Source/NSDataLinkManager.m index 1374ed55b..8fc4481c6 100644 --- a/Source/NSDataLinkManager.m +++ b/Source/NSDataLinkManager.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSDataLinkManager.h" @implementation NSDataLinkManager diff --git a/Source/NSDataLinkPanel.m b/Source/NSDataLinkPanel.m index fc6eb4877..c8a31f4e1 100644 --- a/Source/NSDataLinkPanel.m +++ b/Source/NSDataLinkPanel.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSDataLinkPanel.h" #include "AppKit/NSNibLoading.h" diff --git a/Source/NSDocument.m b/Source/NSDocument.m index 88efc99d0..68677ebb3 100644 --- a/Source/NSDocument.m +++ b/Source/NSDocument.m @@ -37,7 +37,7 @@ #include "AppKit/NSPopUpButton.h" #include "AppKit/NSDocumentFrameworkPrivate.h" -#include "gnustep/gui/GSGuiPrivate.h" +#include "GSGuiPrivate.h" @implementation NSDocument diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index 9bdc279c0..6582a9297 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -33,7 +33,7 @@ #include "AppKit/NSMenuItem.h" #include "AppKit/NSWorkspace.h" #include "AppKit/NSDocumentFrameworkPrivate.h" -#include "gnustep/gui/GSGuiPrivate.h" +#include "GSGuiPrivate.h" #include diff --git a/Source/NSEvent.m b/Source/NSEvent.m index ca487cdc4..afe4cb684 100644 --- a/Source/NSEvent.m +++ b/Source/NSEvent.m @@ -30,7 +30,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -47,7 +47,7 @@ #include "AppKit/NSGraphics.h" #include "AppKit/PSOperators.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" /* * gstep-base has a faster mechanism to get the current thread. diff --git a/Source/NSFileWrapper.m b/Source/NSFileWrapper.m index 4984b2b17..16c163447 100644 --- a/Source/NSFileWrapper.m +++ b/Source/NSFileWrapper.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSFileWrapper.h" #include "AppKit/NSFont.h" diff --git a/Source/NSFont.m b/Source/NSFont.m index c520cc0ab..7498c355f 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -38,8 +38,8 @@ #include "AppKit/NSFont.h" #include "AppKit/NSFontManager.h" #include "AppKit/NSView.h" -#include "gnustep/gui/GSFontInfo.h" -#include "gnustep/gui/GSFusedSilicaContext.h" +#include "GNUstepGUI/GSFontInfo.h" +#include "GSFusedSilicaContext.h" @interface NSFont (Private) diff --git a/Source/NSFontManager.m b/Source/NSFontManager.m index e5d10fc43..23d254894 100644 --- a/Source/NSFontManager.m +++ b/Source/NSFontManager.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -38,7 +38,7 @@ #include "AppKit/NSFontPanel.h" #include "AppKit/NSMenu.h" #include "AppKit/NSMenuItem.h" -#include "gnustep/gui/GSFontInfo.h" +#include "GNUstepGUI/GSFontInfo.h" /* diff --git a/Source/NSFontPanel.m b/Source/NSFontPanel.m index e168220c1..59350e2ff 100644 --- a/Source/NSFontPanel.m +++ b/Source/NSFontPanel.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include "AppKit/NSDragging.h" diff --git a/Source/NSForm.m b/Source/NSForm.m index 0dddd7007..fcace8d24 100644 --- a/Source/NSForm.m +++ b/Source/NSForm.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSForm.h" #include "AppKit/NSFormCell.h" diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index cc9f94cfe..cf566aaa1 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSColor.h" #include "AppKit/NSFormCell.h" diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index cb3098149..094f9cea7 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -1448,7 +1448,7 @@ NSGraphicsContext *GSCurrentContext(void) @end -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ diff --git a/Source/NSHelpManager.m b/Source/NSHelpManager.m index 1585bcc48..b8ea3dff7 100644 --- a/Source/NSHelpManager.m +++ b/Source/NSHelpManager.m @@ -37,7 +37,7 @@ #include "AppKit/NSHelpManager.h" #include "AppKit/NSGraphics.h" -#include "gnustep/gui/GSHelpManagerPanel.h" +#include "GNUstepGUI/GSHelpManagerPanel.h" @implementation NSBundle (NSHelpManager) diff --git a/Source/NSHelpPanel.m b/Source/NSHelpPanel.m index 0e1054968..0b9b03701 100644 --- a/Source/NSHelpPanel.m +++ b/Source/NSHelpPanel.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSHelpPanel.h" #include "AppKit/NSHelpManager.h" diff --git a/Source/NSImage.m b/Source/NSImage.m index ad16319f9..3df4a59da 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -22,7 +22,7 @@ If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -46,7 +46,7 @@ #include "AppKit/NSPasteboard.h" #include "AppKit/NSPrintOperation.h" #include "AppKit/PSOperators.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" BOOL NSImageForceCaching = NO; /* use on missmatch */ diff --git a/Source/NSImageCell.m b/Source/NSImageCell.m index 568b8008a..ee683d2f7 100644 --- a/Source/NSImageCell.m +++ b/Source/NSImageCell.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSCell.h" #include "AppKit/NSGraphics.h" diff --git a/Source/NSImageRep.m b/Source/NSImageRep.m index c98417f4e..0e28e274a 100644 --- a/Source/NSImageRep.m +++ b/Source/NSImageRep.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSInterfaceStyle.m b/Source/NSInterfaceStyle.m index 7079a7f1c..b8dae8879 100644 --- a/Source/NSInterfaceStyle.m +++ b/Source/NSInterfaceStyle.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index 5ac40d20f..65e98a551 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -105,7 +105,7 @@ first. Remaining cases, highest priority first: #include #include "AppKit/NSLayoutManager.h" -#include "gnustep/gui/GSLayoutManager_internal.h" +#include "GNUstepGUI/GSLayoutManager_internal.h" #include #include "AppKit/NSColor.h" diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 9b3dc975d..83bccfe80 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -48,7 +48,7 @@ on OS42, command and shift on MacOSX). */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 5220c34e5..d3badd032 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -32,7 +32,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSMenuItem.m b/Source/NSMenuItem.m index f5f6f9446..06018457f 100644 --- a/Source/NSMenuItem.m +++ b/Source/NSMenuItem.m @@ -27,12 +27,12 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include #include -#include +#include #include "AppKit/NSMenuItem.h" #include "AppKit/NSMenu.h" #include "AppKit/NSImage.h" diff --git a/Source/NSMenuItemCell.m b/Source/NSMenuItemCell.m index 5050a9a87..6bb12244e 100644 --- a/Source/NSMenuItemCell.m +++ b/Source/NSMenuItemCell.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSOpenGLContext.m b/Source/NSOpenGLContext.m index 4a23fe5b0..3a5cc01a3 100644 --- a/Source/NSOpenGLContext.m +++ b/Source/NSOpenGLContext.m @@ -27,7 +27,7 @@ #include #include "AppKit/NSOpenGL.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" @implementation NSOpenGLContext + _classContext diff --git a/Source/NSOpenGLPixelFormat.m b/Source/NSOpenGLPixelFormat.m index 5c71609c0..d2f28eda7 100644 --- a/Source/NSOpenGLPixelFormat.m +++ b/Source/NSOpenGLPixelFormat.m @@ -28,7 +28,7 @@ #include #include -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" #include "AppKit/NSOpenGL.h" diff --git a/Source/NSPageLayout.m b/Source/NSPageLayout.m index 6f4d9e13e..b9e1d46cb 100644 --- a/Source/NSPageLayout.m +++ b/Source/NSPageLayout.m @@ -42,7 +42,7 @@ #include "AppKit/NSPrintInfo.h" #include "AppKit/NSPageLayout.h" #include "AppKit/NSPrinter.h" -#include "gnustep/gui/GSGuiPrivate.h" +#include "GSGuiPrivate.h" static NSPageLayout *shared_instance; diff --git a/Source/NSPanel.m b/Source/NSPanel.m index 1c44cdce1..74b7025b9 100644 --- a/Source/NSPanel.m +++ b/Source/NSPanel.m @@ -33,7 +33,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -47,13 +47,13 @@ #include "AppKit/NSImage.h" #include "AppKit/NSScreen.h" #include "AppKit/NSScrollView.h" -#include "AppKit/IMLoading.h" -#include "AppKit/GMAppKit.h" - -#include "AppKit/GMArchiver.h" - #include "AppKit/NSHelpManager.h" +#include "GNUstepGUI/IMLoading.h" +#include "GNUstepGUI/GMAppKit.h" +#include "GNUstepGUI/GMArchiver.h" + + #ifdef ALERT_TITLE static NSString *defaultTitle = @"Alert"; #else diff --git a/Source/NSPasteboard.m b/Source/NSPasteboard.m index 03dad7e16..9f1bdde97 100644 --- a/Source/NSPasteboard.m +++ b/Source/NSPasteboard.m @@ -517,7 +517,7 @@ */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSPasteboard.h" #include "AppKit/NSApplication.h" #include "AppKit/NSWorkspace.h" @@ -544,8 +544,8 @@ #include #include -#include "gnustep/gui/GSServicesManager.h" -#include "gnustep/gui/GSPasteboardServer.h" +#include "GNUstepGUI/GSServicesManager.h" +#include "GNUstepGUI/GSPasteboardServer.h" static NSString *contentsPrefix = @"NSTypedFileContentsPboardType:"; static NSString *namePrefix = @"NSTypedFilenamesPboardType:"; diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 5445ed420..10ca475d5 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSApplication.h" #include "AppKit/NSGraphics.h" #include "AppKit/NSImage.h" diff --git a/Source/NSPrintOperation.m b/Source/NSPrintOperation.m index e65297ba7..3b7e4e51b 100644 --- a/Source/NSPrintOperation.m +++ b/Source/NSPrintOperation.m @@ -30,7 +30,7 @@ */ #include -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSPrintPanel.m b/Source/NSPrintPanel.m index d1a31ab2b..4806ebb80 100644 --- a/Source/NSPrintPanel.m +++ b/Source/NSPrintPanel.m @@ -26,7 +26,7 @@ */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -41,7 +41,7 @@ #include "AppKit/NSPopUpButton.h" #include "AppKit/NSSavePanel.h" #include "AppKit/NSView.h" -#include "AppKit/GSGuiPrivate.h" +#include "GSGuiPrivate.h" static NSPrintPanel *shared_instance; diff --git a/Source/NSPrinter.m b/Source/NSPrinter.m index 48dcb130b..220a8896f 100644 --- a/Source/NSPrinter.m +++ b/Source/NSPrinter.m @@ -35,7 +35,7 @@ * (This is not required in the OpenStep standard, but could be useful). */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSResponder.m b/Source/NSResponder.m index 818f8c79b..f1e86b905 100644 --- a/Source/NSResponder.m +++ b/Source/NSResponder.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSRulerView.m b/Source/NSRulerView.m index 79476470a..305f0697c 100644 --- a/Source/NSRulerView.m +++ b/Source/NSRulerView.m @@ -24,7 +24,7 @@ */ #include -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 5f5007d5a..c8de13076 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -52,7 +52,7 @@ #include "AppKit/NSTextField.h" #include "AppKit/NSWorkspace.h" -#include "gnustep/gui/GSGuiPrivate.h" +#include "GSGuiPrivate.h" #define _SAVE_PANEL_X_PAD 5 #define _SAVE_PANEL_Y_PAD 4 diff --git a/Source/NSScreen.m b/Source/NSScreen.m index 4f5e1d35c..df24577ce 100644 --- a/Source/NSScreen.m +++ b/Source/NSScreen.m @@ -32,7 +32,7 @@ #include "AppKit/NSInterfaceStyle.h" #include "AppKit/NSGraphicsContext.h" #include "AppKit/AppKitExceptions.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSDisplayServer.h" @interface NSScreen (Private) - (id) _initWithScreenNumber: (int)screen; diff --git a/Source/NSSecureTextField.m b/Source/NSSecureTextField.m index 691acde96..cbba8ab34 100644 --- a/Source/NSSecureTextField.m +++ b/Source/NSSecureTextField.m @@ -28,7 +28,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSSecureTextField.h" #include "AppKit/NSImage.h" diff --git a/Source/NSSelection.m b/Source/NSSelection.m index 659f758a1..1b86da6d5 100644 --- a/Source/NSSelection.m +++ b/Source/NSSelection.m @@ -29,7 +29,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include "AppKit/NSSelection.h" diff --git a/Source/NSSliderCell.m b/Source/NSSliderCell.m index ec2e3a1dd..9ca964c90 100644 --- a/Source/NSSliderCell.m +++ b/Source/NSSliderCell.m @@ -25,7 +25,7 @@ */ #include // (float)rintf(float x) -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSSound.m b/Source/NSSound.m index 22fdcd1c4..78bf9aa6c 100644 --- a/Source/NSSound.m +++ b/Source/NSSound.m @@ -25,7 +25,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSPasteboard.h" #include "AppKit/NSSound.h" diff --git a/Source/NSSpellChecker.m b/Source/NSSpellChecker.m index 09dd8177b..73e3d474d 100644 --- a/Source/NSSpellChecker.m +++ b/Source/NSSpellChecker.m @@ -29,7 +29,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -50,8 +50,8 @@ #include "AppKit/NSGraphics.h" #include "AppKit/NSWindow.h" #include "AppKit/NSPanel.h" -#include "gnustep/gui/GSGuiPrivate.h" -#include "gnustep/gui/GSServicesManager.h" +#include "GSGuiPrivate.h" +#include "GNUstepGUI/GSServicesManager.h" // prototype for function to create name for server NSString *GSSpellServerName(NSString *checkerDictionary, NSString *language); diff --git a/Source/NSSpellServer.m b/Source/NSSpellServer.m index 866adde6a..05299f764 100644 --- a/Source/NSSpellServer.m +++ b/Source/NSSpellServer.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSSpellServer.h" #include #include diff --git a/Source/NSStepper.m b/Source/NSStepper.m index 053af1086..0aaa0aeee 100644 --- a/Source/NSStepper.m +++ b/Source/NSStepper.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSStepperCell.m b/Source/NSStepperCell.m index 854baa00f..e8b3be9db 100644 --- a/Source/NSStepperCell.m +++ b/Source/NSStepperCell.m @@ -23,7 +23,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include "AppKit/NSGraphicsContext.h" #include "AppKit/NSColor.h" #include "AppKit/DPSOperators.h" diff --git a/Source/NSTextContainer.m b/Source/NSTextContainer.m index 41519bb5d..16ab11136 100644 --- a/Source/NSTextContainer.m +++ b/Source/NSTextContainer.m @@ -33,7 +33,7 @@ #include "AppKit/NSTextContainer.h" #include "AppKit/NSTextStorage.h" #include "AppKit/NSTextView.h" -#include "gnustep/gui/GSLayoutManager.h" +#include "GNUstepGUI/GSLayoutManager.h" @interface NSTextContainer (TextViewObserver) - (void) _textViewFrameChanged: (NSNotification*)aNotification; diff --git a/Source/NSTextField.m b/Source/NSTextField.m index 916bf57a3..fc06f663c 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -29,7 +29,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 246a95ca1..8a16daf69 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -27,7 +27,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSColor.h" #include "AppKit/NSFont.h" diff --git a/Source/NSTextStorage.m b/Source/NSTextStorage.m index 41deef437..59e7bf5e8 100644 --- a/Source/NSTextStorage.m +++ b/Source/NSTextStorage.m @@ -28,7 +28,7 @@ #include #include "AppKit/NSAttributedString.h" #include "AppKit/NSTextStorage.h" -#include "gnustep/gui/GSLayoutManager.h" +#include "GNUstepGUI/GSLayoutManager.h" @implementation NSTextStorage diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 2296f659c..5996ed51a 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -45,7 +45,7 @@ #include "AppKit/NSTextView.h" -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include diff --git a/Source/NSView.m b/Source/NSView.m index bb66b8ac7..a80e1ce7d 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -31,7 +31,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -65,9 +65,9 @@ #include "AppKit/NSWindow.h" #include "AppKit/NSWorkspace.h" #include "AppKit/PSOperators.h" -#include "gnustep/gui/GSDisplayServer.h" -#include "gnustep/gui/GSTrackingRect.h" -#include "gnustep/gui/GSVersion.h" +#include "GNUstepGUI/GSDisplayServer.h" +#include "GNUstepGUI/GSTrackingRect.h" +#include "GNUstepGUI/GSVersion.h" /* * We need a fast array that can store objects without retain/release ... @@ -79,7 +79,7 @@ #ifdef GSIArray #undef GSIArray #endif -#include +#include #define nKV(O) ((GSIArray)(O->_nextKeyView)) #define pKV(O) ((GSIArray)(O->_previousKeyView)) diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 4d7a82467..93993e015 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -30,7 +30,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include @@ -68,8 +68,8 @@ #include "AppKit/NSGraphics.h" #include "AppKit/NSCachedImageRep.h" #include "AppKit/NSToolbar.h" -#include "gnustep/gui/GSTrackingRect.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSTrackingRect.h" +#include "GNUstepGUI/GSDisplayServer.h" BOOL GSViewAcceptsDrag(NSView *v, id dragInfo); diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index d56d0b131..171f1644c 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -29,7 +29,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include #include @@ -52,8 +52,8 @@ #include "AppKit/NSPanel.h" #include "AppKit/NSWindow.h" #include "AppKit/NSScreen.h" -#include "gnustep/gui/GSServicesManager.h" -#include "gnustep/gui/GSDisplayServer.h" +#include "GNUstepGUI/GSServicesManager.h" +#include "GNUstepGUI/GSDisplayServer.h" #define PosixExecutePermission (0111) diff --git a/Source/externs.m b/Source/externs.m index 39bb8bedf..6a2abc41d 100644 --- a/Source/externs.m +++ b/Source/externs.m @@ -26,7 +26,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "gnustep/gui/config.h" +#include "config.h" #include #include "AppKit/NSEvent.h" diff --git a/Source/nsimage-tiff.h b/Source/nsimage-tiff.h new file mode 100644 index 000000000..0258d200e --- /dev/null +++ b/Source/nsimage-tiff.h @@ -0,0 +1,79 @@ +/* + nsimage-tiff.h + + Functions for dealing with tiff images + + Copyright (C) 1996 Free Software Foundation, Inc. + + Written by: Adam Fedor + Date: Feb 1996 + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +/* + Warning: This header file should not be used for reading and + writing tiff files. You should use the NSImage and NSBitmapImageRep + classes for general reading/writting of tiff files. +*/ + +#ifndef _GNUstep_H_tiff +#define _GNUstep_H_tiff + +#include +#include + +/* Structure to store common information about a tiff. */ +typedef struct { + uint32 imageNumber; + uint32 subfileType; + uint32 width; + uint32 height; + uint16 bitsPerSample; /* number of bits per data channel */ + uint16 samplesPerPixel; /* number of channels per pixel */ + uint16 planarConfig; /* meshed or separate */ + uint16 photoInterp; /* photometric interpretation of bitmap data, */ + uint16 compression; + uint16 extraSamples; /* Alpha */ + int assocAlpha; + int quality; /* compression quality (for jpeg) 1 to 255 */ + int numImages; /* number of images in tiff */ + int error; +} NSTiffInfo; + +typedef struct { + uint32 size; + uint16 *red; + uint16 *green; + uint16 *blue; +} NSTiffColormap; + +typedef char* realloc_data_callback(char* data, long size); + +extern TIFF* NSTiffOpenDataRead(const char* data, long size); +extern TIFF* NSTiffOpenDataWrite(char **data, long *size); +extern int NSTiffClose(TIFF* image); + +extern int NSTiffGetImageCount(TIFF* image); +extern int NSTiffWrite(TIFF* image, NSTiffInfo* info, char* data); +extern int NSTiffRead(TIFF* image, NSTiffInfo* info, char* data); +extern NSTiffInfo* NSTiffGetInfo(int imageNumber, TIFF* image); + +extern NSTiffColormap* NSTiffGetColormap(TIFF* image); + +#endif // _GNUstep_H_tiff + diff --git a/Source/tiff.m b/Source/tiff.m index 474d03fea..1c71ebc97 100644 --- a/Source/tiff.m +++ b/Source/tiff.m @@ -56,8 +56,8 @@ * OF THIS SOFTWARE. */ -#include "gnustep/gui/config.h" -#include "gnustep/gui/nsimage-tiff.h" +#include "config.h" +#include "nsimage-tiff.h" #include #include #include diff --git a/TextConverters/RTF/GNUmakefile.preamble b/TextConverters/RTF/GNUmakefile.preamble index 55d2ad326..a73c32263 100644 --- a/TextConverters/RTF/GNUmakefile.preamble +++ b/TextConverters/RTF/GNUmakefile.preamble @@ -48,7 +48,7 @@ ADDITIONAL_CFLAGS += #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS +=-I../../Headers +ADDITIONAL_INCLUDE_DIRS +=-I../../Headers/Additions -I../../Headers # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS += diff --git a/TextConverters/RTF/RTFConsumer.h b/TextConverters/RTF/RTFConsumer.h index 4ce992ee6..a615a5b12 100644 --- a/TextConverters/RTF/RTFConsumer.h +++ b/TextConverters/RTF/RTFConsumer.h @@ -26,7 +26,7 @@ #ifndef _rtfConsumer_h_INCLUDE #define _rtfConsumer_h_INCLUDE -#include +#include @class NSMutableDictionary; @class NSMutableArray; diff --git a/TextConverters/RTF/RTFProducer.h b/TextConverters/RTF/RTFProducer.h index 91c7b3ec4..a1390e4dd 100644 --- a/TextConverters/RTF/RTFProducer.h +++ b/TextConverters/RTF/RTFProducer.h @@ -31,7 +31,7 @@ #ifndef _GNUstep_H_RTFDProducer #define _GNUstep_H_RTFDProducer -#include +#include //#include "GSTextConverter.h" @class NSAttributedString; diff --git a/Tools/GNUmakefile.preamble b/Tools/GNUmakefile.preamble index 9963fa209..af94ece9e 100644 --- a/Tools/GNUmakefile.preamble +++ b/Tools/GNUmakefile.preamble @@ -21,7 +21,7 @@ # ADDITIONAL_CFLAGS += # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS += -I../Headers -I$(GNUSTEP_SYSTEM_ROOT)/Headers +ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS += diff --git a/Tools/example.m b/Tools/example.m index 941ed1e43..4a2c81685 100644 --- a/Tools/example.m +++ b/Tools/example.m @@ -22,7 +22,6 @@ */ -#include #include #include #include diff --git a/configure b/configure index e171e4ef6..78bac4e8c 100755 --- a/configure +++ b/configure @@ -1233,7 +1233,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. -ac_config_headers="$ac_config_headers Headers/gnustep/gui/config.h" +ac_config_headers="$ac_config_headers Headers/Additions/GNUstepGUI/config.h" #-------------------------------------------------------------------- @@ -3434,7 +3434,7 @@ echo "${ECHO_T}$GNUSTEP_GUI_VERSION" >&6 -ac_config_files="$ac_config_files config.make gui.make Headers/gnustep/gui/GSVersion.h" +ac_config_files="$ac_config_files config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3908,8 +3908,8 @@ do # Handling of arguments. "config.make" ) CONFIG_FILES="$CONFIG_FILES config.make" ;; "gui.make" ) CONFIG_FILES="$CONFIG_FILES gui.make" ;; - "Headers/gnustep/gui/GSVersion.h" ) CONFIG_FILES="$CONFIG_FILES Headers/gnustep/gui/GSVersion.h" ;; - "Headers/gnustep/gui/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS Headers/gnustep/gui/config.h" ;; + "Headers/Additions/GNUstepGUI/GSVersion.h" ) CONFIG_FILES="$CONFIG_FILES Headers/Additions/GNUstepGUI/GSVersion.h" ;; + "Headers/Additions/GNUstepGUI/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS Headers/Additions/GNUstepGUI/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; diff --git a/configure.ac b/configure.ac index ae2ce8623..5c4e68598 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ fi #-------------------------------------------------------------------- AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) -AC_CONFIG_HEADER(Headers/gnustep/gui/config.h) +AC_CONFIG_HEADER(Headers/Additions/GNUstepGUI/config.h) #-------------------------------------------------------------------- # Determine the host, build, and target systems @@ -285,7 +285,7 @@ static double rint(double a) \ #endif ]) -AC_CONFIG_FILES([config.make gui.make Headers/gnustep/gui/GSVersion.h]) +AC_CONFIG_FILES([config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h]) AC_OUTPUT