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
This commit is contained in:
ayers 2003-07-31 23:52:10 +00:00
parent 766b747938
commit 9732999fd8
280 changed files with 25303 additions and 257 deletions

207
ChangeLog
View file

@ -1,3 +1,210 @@
2003-07-31 David Ayers <d.ayers@inode.at>
* 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 <mhanni@yahoo.com>
* Source/NSBrowserCell.m (drawInteriorWithFrame:inView:): Remove

View file

@ -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)

View file

@ -26,7 +26,7 @@
#include "GSGrayColorPicker.h"
#include <AppKit/GSHbox.h>
#include <GNUstepGUI/GSHbox.h>
@implementation GSGrayColorPicker

View file

@ -26,8 +26,8 @@
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <AppKit/GSVbox.h>
#include <AppKit/GSHbox.h>
#include <GNUstepGUI/GSVbox.h>
#include <GNUstepGUI/GSHbox.h>
#include "GSRGBColorPicker.h"
#include "GSHSBColorPicker.h"
#include "GSCMYKColorPicker.h"
@ -274,8 +274,8 @@
#include "GSStandardColorPicker.h"
#include <AppKit/GSVbox.h>
#include <AppKit/GSHbox.h>
#include <GNUstepGUI/GSVbox.h>
#include <GNUstepGUI/GSHbox.h>
#define KNOB_WIDTH 6

View file

@ -32,7 +32,7 @@
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <AppKit/GSHbox.h>
#include <GNUstepGUI/GSHbox.h>
@interface GSColorWheel : NSView

View file

@ -139,15 +139,6 @@
<item><uref url="NSWindowController.html">NSWindowController</uref></item>
<item><uref url="NSWorkspace.html">NSWorkspace</uref></item>
</list>
<p>
Documentation on non-OpenStep, non-MacOSX, and private classes
</p>
<list>
<item><uref url="GSDisplayServer.html">GSDisplayServer</uref></item>
<item><uref url="GSHbox.html">GSHbox</uref></item>
<item><uref url="GSTable.html">GSTable</uref></item>
<item><uref url="GSVbox.html">GSVbox</uref></item>
</list>
</chapter>
</body>

View file

@ -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

View file

@ -0,0 +1,50 @@
#
# GuiAdditions gsdoc makefile for the GNUstep Gui Library
# Copyright (C) 2000 Free Software Foundation, Inc.
#
# Written by: Adam Fedor <fedor@gnu.org>
#
# 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

View file

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN" "http://www.gnustep.org/gsdoc-0_6_7.xml">
<gsdoc base="Gui">
<head>
<title>GuiAdditions</title>
<author name="Richard Frith-Macdonald">
<email address="rfm@gnu.org"/>
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
</author>
<version>$Revision$</version>
<date>$Date$</date>
</head>
<body>
<chapter>
<heading>GuiAdditions</heading>
<p>
Extensions to the GNUstep GUI library - a free
software library compatible with the OpenStep Application Kit (tm).
</p>
<p>
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.
</p>
<list>
<item><uref url="GSDisplayServer.html">GSDisplayServer</uref></item>
<item><uref url="GSHbox.html">GSHbox</uref></item>
<item><uref url="GSTable.html">GSTable</uref></item>
<item><uref url="GSVbox.html">GSVbox</uref></item>
</list>
</chapter>
</body>
</gsdoc>

View file

@ -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.

View file

@ -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

View file

@ -0,0 +1,98 @@
/*
GMAppKit.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/AppKit.h>
#include <GNUstepGUI/GMArchiver.h>
@interface NSApplication (GMArchiverMethods) <ModelCoding>
@end
@interface NSBox (GMArchiverMethods) <ModelCoding>
@end
@interface NSButton (GMArchiverMethods) <ModelCoding>
@end
@interface NSCell (GMArchiverMethods) <ModelCoding>
@end
@interface NSClipView (GMArchiverMethods) <ModelCoding>
@end
@interface NSColor (GMArchiverMethods) <ModelCoding>
@end
@interface NSControl (GMArchiverMethods) <ModelCoding>
@end
@interface NSFont (GMArchiverMethods) <ModelCoding>
@end
@interface NSImage (GMArchiverMethods) <ModelCoding>
@end
@interface NSMenuItem (GMArchiverMethods) <ModelCoding>
@end
@interface NSMenu (GMArchiverMethods) <ModelCoding>
@end
@interface NSPopUpButton (GMArchiverMethods) <ModelCoding>
@end
@interface NSResponder (GMArchiverMethods) <ModelCoding>
@end
@interface NSTextField (GMArchiverMethods) <ModelCoding>
@end
@interface NSSecureTextFieldCell (GMArchiverMethods) <ModelCoding>
@end
@interface NSView (GMArchiverMethods) <ModelCoding>
@end
@interface NSWindow (GMArchiverMethods) <ModelCoding>
@end
@interface NSPanel (GMArchiverMethods) <ModelCoding>
@end
@interface NSSavePanel (GMArchiverMethods) <ModelCoding>
@end
@interface NSBrowser (GMArchiverMethods) <ModelCoding>
@end
@interface NSText (GMArchiverMethods) <ModelCoding>
@end
@interface NSTextView (GMArchiverMethods) <ModelCoding>
@end
#endif /* _GNUstep_H_GMAppKit */

View file

@ -0,0 +1,200 @@
/*
GMArchiver.h
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/Foundation.h>
#else
#include <Foundation/NSCoder.h>
#include <Foundation/NSHashTable.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSGeometry.h>
#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__ */

View file

@ -0,0 +1,185 @@
/** <title>GSDisplayServer</title>
<abstract>Abstract display server class.</abstract>
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSSet.h>
#include <AppKit/NSDragging.h>
#include <AppKit/AppKitDefines.h>
#include <AppKit/NSGraphicsContext.h>
@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 <NSDraggingInfo>) 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

View file

@ -0,0 +1,143 @@
/*
GSFontInfo.h
Private class for handling font info
Copyright (C) 2000 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
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 <AppKit/NSFont.h>
#include <AppKit/NSFontManager.h>
@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 <NSCopying, NSMutableCopying>
{
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_ */

View file

@ -0,0 +1,784 @@
/** <title>GSFusedSilica</title>
<abstract>C Interface to graphics drawing library</abstract>
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Adam Fedor <fedor@gnu.org>
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 <unistd.h>
/* ------------------------------------------------------------------------
* 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

View file

@ -0,0 +1,167 @@
/*
GSHbox.h
The GSHbox class (a GNU extension)
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 */

View file

@ -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 <ptavares@iname.com>
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 <AppKit/NSPanel.h>
@class NSTextView;
@class NSAttributedString;
@interface GSHelpManagerPanel: NSPanel
{
NSTextView *textView;
}
+sharedHelpManagerPanel;
-(void)setHelpText: (NSAttributedString*)helpText;
@end
#endif // _GNUstep_H_GSHelpManagerPanel

View file

@ -0,0 +1,79 @@
/*
GSHorizontalTypesetter.h
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Alexander Malmberg <alexander@malmberg.org>
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 <GNUstepGUI/GSTypesetter.h>
@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

View file

@ -0,0 +1,80 @@
/*
GSInfoPanel.h
Standard GNUstep info panel
Copyright (C) 2000 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 <AppKit/NSPanel.h>
/* 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 <richard@brainstorm.co.uk>"
*
* 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 */

View file

@ -0,0 +1,350 @@
/*
GSLayoutManager.h
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Author: Alexander Malmberg <alexander@malmberg.org>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/NSFont.h>
@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

View file

@ -0,0 +1,317 @@
/*
GSLayoutManager_internal.h
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Author: Alexander Malmberg <alexander@malmberg.org>
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 <GNUstepGUI/GSLayoutManager.h>
/*
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

View file

@ -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 <nicola@brainstorm.co.uk>
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 <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
@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_ */

View file

@ -0,0 +1,317 @@
/* GSMethodTable.h - Definitions of PostScript methods for NSGraphicsContext
Copyright (C) 1998 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
Date: Nov 1998
Updated by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/NSFont.h>
@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

View file

@ -0,0 +1,161 @@
/*
GSNibTemplates.h
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
Author: Gregory John Casamento <greg_casamento@yahoo.com>
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 <Foundation/NSObject.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSMenu.h>
#include <AppKit/NSView.h>
#include <AppKit/NSText.h>
#include <AppKit/NSTextView.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSButton.h>
#define GNUSTEP_NIB_VERSION 0
@class NSString;
@class NSDictionary;
@class NSMutableDictionary;
/*
* This is the class that holds objects within a nib.
*/
@interface GSNibContainer : NSObject <NSCoding>
{
NSMutableDictionary *nameTable;
NSMutableArray *connections;
BOOL _isAwake;
}
- (void) awakeWithContext: (NSDictionary*)context;
- (NSMutableDictionary*) nameTable;
- (NSMutableArray*) connections;
@end
/*
* Template classes
*/
@interface GSNibItem : NSObject <NSCoding>
{
NSString *theClass;
NSRect theFrame;
unsigned int autoresizingMask;
}
@end
@interface GSCustomView : GSNibItem <NSCoding>
{
}
@end
// templates
@protocol GSTemplate
- (void) setClassName: (NSString *)className;
- (NSString *)className;
- (id) instantiateObject: (NSCoder *)coder;
@end
@interface NSWindowTemplate : NSWindow <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
BOOL _deferFlag;
}
@end
@interface NSViewTemplate : NSView <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
}
@end
@interface NSTextTemplate : NSText <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
}
@end
@interface NSTextViewTemplate : NSTextView <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
}
@end
@interface NSMenuTemplate : NSMenu <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
}
@end
@interface NSControlTemplate : NSControl <GSTemplate>
{
NSString *_className;
NSString *_parentClassName;
id _delegate;
id _dataSource;
BOOL _usesDataSource;
}
@end
@interface NSButtonTemplate : NSButton <GSTemplate>
{
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 */

View file

@ -0,0 +1,92 @@
/*
GSPasteboardServer.h
Copyright (C) 1997,1999 Free Software Foundation, Inc.
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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 <Foundation/NSObject.h>
#include <Foundation/NSString.h>
#include <AppKit/NSPasteboard.h>
@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<GSPasteboardObj>) 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

View file

@ -0,0 +1,90 @@
/*
GSServicesManager.h
Copyright (C) 1998 Free Software Foundation, Inc.
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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

View file

@ -0,0 +1,178 @@
/*
GSTable.h
The GSTable class (a GNU extension)
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 <AppKit/NSView.h>
@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 */

View file

@ -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 <FredKiefer@gmx.de>
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 <Foundation/NSAttributedString.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSData.h>
#include <AppKit/NSFileWrapper.h>
@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

View file

@ -0,0 +1,74 @@
/*
GSTrackingRect.h
Tracking rectangle class
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSView.h>
@interface GSTrackingRect : NSObject <NSCoding>
{
@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 */

View file

@ -0,0 +1,132 @@
/*
GSTypesetter.h
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Alexander Malmberg <alexander@malmberg.org>
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 <Foundation/NSObject.h>
#include <Foundation/NSRange.h>
#include <Foundation/NSGeometry.h>
@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

View file

@ -0,0 +1,117 @@
/*
GSVbox.h
The GSVbox class (a GNU extension)
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 */

View file

@ -0,0 +1,36 @@
/*
GSVersion.h
Define version of GNUstep GUI Library
Copyright (C) 2001 Free Software Foundation, Inc.
Author: Nicola Pero <nicola@brainstorm.co.uk>
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 */

View file

@ -0,0 +1,36 @@
/*
GSVersion.h
Define version of GNUstep GUI Library
Copyright (C) 2001 Free Software Foundation, Inc.
Author: Nicola Pero <nicola@brainstorm.co.uk>
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 */

View file

@ -0,0 +1,59 @@
/*
IMConnectors.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/Foundation.h>
#else
#include <Foundation/NSObject.h>
#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 */

View file

@ -0,0 +1,71 @@
/*
IMCustomObject.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/AppKit.h>
#else
#include <Foundation/NSObject.h>
#include <AppKit/NSView.h>
#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 */

View file

@ -0,0 +1,52 @@
/*
IMLoading.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/Foundation.h>
#else
#include <Foundation/NSBundle.h>
#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 */

View file

@ -0,0 +1,74 @@
/* Source/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <audiofile.h> header file. */
#undef HAVE_AUDIOFILE_H
/* Define to 1 if you have the <inttypes.h> 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 <memory.h> 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 <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> 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

158
Headers/AppKit/AppKit.h Normal file
View file

@ -0,0 +1,158 @@
/*
AppKit.h
Main include file for GNUstep GUI Library
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <GNUstepGUI/GSVersion.h>
//
// Foundation
//
#include <Foundation/Foundation.h>
//
// GNUstep GUI Library functions
//
#include <AppKit/NSGraphics.h>
#include <AppKit/NSActionCell.h>
#include <AppKit/NSAffineTransform.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSAttributedString.h>
#include <AppKit/NSBezierPath.h>
#include <AppKit/NSBitmapImageRep.h>
#include <AppKit/NSBox.h>
#include <AppKit/NSBrowser.h>
#include <AppKit/NSBrowserCell.h>
#include <AppKit/NSButton.h>
#include <AppKit/NSButtonCell.h>
#include <AppKit/NSCachedImageRep.h>
#include <AppKit/NSCell.h>
#include <AppKit/NSClipView.h>
#include <AppKit/NSColor.h>
#include <AppKit/NSColorList.h>
#include <AppKit/NSColorPanel.h>
#include <AppKit/NSColorPicker.h>
#include <AppKit/NSColorPicking.h>
#include <AppKit/NSColorWell.h>
#include <AppKit/NSComboBox.h>
#include <AppKit/NSComboBoxCell.h>
#include <AppKit/NSControl.h>
#include <AppKit/NSCursor.h>
#include <AppKit/NSCustomImageRep.h>
#include <AppKit/NSDataLink.h>
#include <AppKit/NSDataLinkManager.h>
#include <AppKit/NSDataLinkPanel.h>
#include <AppKit/NSDocument.h>
#include <AppKit/NSDocumentController.h>
#include <AppKit/NSDragging.h>
#include <AppKit/NSEPSImageRep.h>
#include <AppKit/NSEvent.h>
#include <AppKit/NSFont.h>
#include <AppKit/NSFontManager.h>
#include <AppKit/NSFontPanel.h>
#include <AppKit/NSForm.h>
#include <AppKit/NSFormCell.h>
#include <AppKit/NSGraphicsContext.h>
#include <AppKit/NSHelpPanel.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSImageCell.h>
#include <AppKit/NSImageRep.h>
#include <AppKit/NSImageView.h>
#include <AppKit/NSInterfaceStyle.h>
#include <AppKit/NSMatrix.h>
#include <AppKit/NSMenu.h>
#include <AppKit/NSMenuItem.h>
#include <AppKit/NSMenuItemCell.h>
#include <AppKit/NSMenuView.h>
#include <AppKit/NSNibLoading.h>
#include <AppKit/NSOpenPanel.h>
#include <AppKit/NSOutlineView.h>
#include <AppKit/NSPageLayout.h>
#include <AppKit/NSPanel.h>
#include <AppKit/NSParagraphStyle.h>
#include <AppKit/NSPasteboard.h>
#include <AppKit/NSPopUpButton.h>
#include <AppKit/NSPopUpButtonCell.h>
#include <AppKit/NSPrinter.h>
#include <AppKit/NSPrintInfo.h>
#include <AppKit/NSPrintOperation.h>
#include <AppKit/NSPrintPanel.h>
#include <AppKit/NSProgressIndicator.h>
#include <AppKit/NSResponder.h>
#include <AppKit/NSSavePanel.h>
#include <AppKit/NSScreen.h>
#include <AppKit/NSScroller.h>
#include <AppKit/NSScrollView.h>
#include <AppKit/NSSecureTextField.h>
#include <AppKit/NSSelection.h>
#include <AppKit/NSSlider.h>
#include <AppKit/NSSliderCell.h>
#include <AppKit/NSSound.h>
#include <AppKit/NSSpellChecker.h>
#include <AppKit/NSSpellProtocol.h>
#include <AppKit/NSSpellServer.h>
#include <AppKit/NSSplitView.h>
#include <AppKit/NSStepper.h>
#include <AppKit/NSStepperCell.h>
#include <AppKit/NSStringDrawing.h>
#include <AppKit/NSTableColumn.h>
#include <AppKit/NSTableHeaderCell.h>
#include <AppKit/NSTableHeaderView.h>
#include <AppKit/NSTableView.h>
#include <AppKit/NSTabView.h>
#include <AppKit/NSTabViewItem.h>
#include <AppKit/NSText.h>
#include <AppKit/NSTextField.h>
#include <AppKit/NSTextFieldCell.h>
#include <AppKit/NSTextView.h>
#include <AppKit/NSView.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSWorkspace.h>
#include <AppKit/NSNibDeclarations.h>
#ifndef STRICT_OPENSTEP
#include <AppKit/NSDrawer.h>
#include <AppKit/NSFileWrapper.h>
#include <AppKit/NSLayoutManager.h>
#include <AppKit/NSOutlineView.h>
#include <AppKit/NSRulerMarker.h>
#include <AppKit/NSRulerView.h>
#include <AppKit/NSTextContainer.h>
#include <AppKit/NSTextStorage.h>
#include <AppKit/NSUserInterfaceValidation.h>
#include <AppKit/NSWindowController.h>
#include <AppKit/NSToolbar.h>
#include <AppKit/NSToolbarItem.h>
#endif
#include <AppKit/PSOperators.h>
#endif /* _GNUstep_H_AppKit */

View file

@ -0,0 +1,44 @@
/* Plateform specific definitions for externs
Copyright (C) 2001 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@gnu.org>
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 */

View file

@ -0,0 +1,73 @@
/*
AppKitExceptions.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/AppKitDefines.h>
@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__ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,44 @@
/*
NSActionCell.h
Abstract cell for target/action paradigm
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSCell.h>
@interface NSActionCell : NSCell
{
// Attributes
int _tag;
id _target;
SEL _action;
NSView *_control_view;
}
@end
#endif // _GNUstep_H_NSActionCell

View file

@ -0,0 +1,102 @@
/*
NSAffineTransform.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
@class NSBezierPath;
typedef struct {
float m11;
float m12;
float m21;
float m22;
float tx;
float ty;
} NSAffineTransformStruct;
@interface NSAffineTransform : NSObject <NSCopying, NSCoding>
{
@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 */

View file

@ -0,0 +1,456 @@
/**
NSApplication.h
The one and only application class
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: August 1998
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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 <AppKit/NSResponder.h>
@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 <NSCoding>
{
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

View file

@ -0,0 +1,122 @@
/*
NSAttributedString.h
Categories which add capabilities to NSAttributedString
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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 <Foundation/NSAttributedString.h>
#include <Foundation/NSRange.h>
#include <AppKit/NSFontManager.h>
#include <AppKit/NSText.h>
#include <AppKit/AppKitDefines.h>
@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

View file

@ -0,0 +1,223 @@
/*
The NSBezierPath class
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Enrico Sersale <enrico@imago.ro>
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 <Foundation/Foundation.h>
#include <AppKit/NSFont.h>
@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 <NSCopying, NSCoding>
{
@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

View file

@ -0,0 +1,160 @@
/*
NSBitmapImageRep.h
Bitmap image representations
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <AppKit/NSImageRep.h>
@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

97
Headers/AppKit/NSBox.h Normal file
View file

@ -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 <scottc@net-community.com>
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 <AppKit/NSView.h>
@class NSString;
@class NSFont;
typedef enum _NSTitlePosition {
NSNoTitle,
NSAboveTop,
NSAtTop,
NSBelowTop,
NSAboveBottom,
NSAtBottom,
NSBelowBottom
} NSTitlePosition;
@interface NSBox : NSView <NSCoding>
{
// 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

269
Headers/AppKit/NSBrowser.h Normal file
View file

@ -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 <scottc@net-community.com>
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 <AppKit/NSControl.h>
@class NSString;
@class NSArray;
@class NSCell;
@class NSMatrix;
@class NSScroller;
//@class NSBox;
@interface NSBrowser : NSControl <NSCoding>
{
// 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

View file

@ -0,0 +1,74 @@
/*
NSBrowserCell.h
Cell class for the NSBrowser
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSCell.h>
@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

134
Headers/AppKit/NSButton.h Normal file
View file

@ -0,0 +1,134 @@
/*
NSButton.h
The button class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/NSControl.h>
#include <AppKit/NSButtonCell.h>
@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

View file

@ -0,0 +1,191 @@
/*
NSButtonCell.h
The cell class for NSButton
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/NSActionCell.h>
@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

View file

@ -0,0 +1,62 @@
/*
NSCachedImageRep.h
Cached image representation.
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <AppKit/NSImageRep.h>
#include <AppKit/NSGraphics.h>
@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

462
Headers/AppKit/NSCell.h Normal file
View file

@ -0,0 +1,462 @@
/* -*-objc-*-
NSCell.h
The abstract cell class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSCoder.h>
#include <Foundation/NSGeometry.h>
// For tint
#include <AppKit/NSColor.h>
// For text alignment
#include <AppKit/NSText.h>
@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 <NSCopying, NSCoding>
{
// 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

View file

@ -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 <ovidiu@net-community.com>
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 <AppKit/NSView.h>
@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 */

243
Headers/AppKit/NSColor.h Normal file
View file

@ -0,0 +1,243 @@
/*
NSColor.h
The colorful color class
Copyright (C) 1996, 1998 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSCoder.h>
#include <AppKit/AppKitDefines.h>
@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 <NSCoding, NSCopying>
{
}
//
// 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

View file

@ -0,0 +1,114 @@
/*
NSColorList.h
Manage named lists of NSColors.
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 <Foundation/NSCoder.h>
#include <AppKit/AppKitDefines.h>
@class NSString;
@class NSArray;
@class NSMutableArray;
@class NSDictionary;
@class NSMutableDictionary;
@class NSColor;
@interface NSColorList : NSObject <NSCoding>
{
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

View file

@ -0,0 +1,138 @@
/*
NSColorPanel.h
System generic color panel
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSApplication.h>
#include <AppKit/NSBox.h>
#include <AppKit/NSButton.h>
#include <AppKit/NSColorPicking.h>
#include <AppKit/NSColorWell.h>
#include <AppKit/NSMatrix.h>
#include <AppKit/NSNibDeclarations.h>
#include <AppKit/NSPanel.h>
#include <AppKit/NSSlider.h>
#include <AppKit/NSSplitView.h>
@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<NSColorPickingCustom,NSColorPickingDefault> _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

View file

@ -0,0 +1,87 @@
/*
NSColorPicker.h
Abstract superclass of custom color pickers
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSObject.h>
#include <AppKit/NSColorPicking.h>
@class NSColorPanel;
@class NSColorList;
@class NSImage;
@class NSButtonCell;
@interface NSColorPicker : NSObject <NSColorPickingDefault>
{
// 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

View file

@ -0,0 +1,98 @@
/*
NSColorPicking.h
Protocols for picking colors
Copyright (C) 1997 Free Software Foundation, Inc.
Author: Simon Frankau <sgf@frankau.demon.co.uk>
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 <objc/Protocol.h>
@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

View file

@ -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 <scottc@net-community.com>
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 <AppKit/NSControl.h>
@class NSColor;
@interface NSColorWell : NSControl <NSCoding>
{
// 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

112
Headers/AppKit/NSComboBox.h Normal file
View file

@ -0,0 +1,112 @@
/*
NSComboBox.h
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Gerrit van Dyk <gerritvd@decillion.net>
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 <Foundation/NSNotification.h>
#include <AppKit/NSTextField.h>
@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 */

View file

@ -0,0 +1,115 @@
/*
NSComboBoxCell.h
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Gerrit van Dyk <gerritvd@decillion.net>
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 <AppKit/NSTextFieldCell.h>
@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 */

213
Headers/AppKit/NSControl.h Normal file
View file

@ -0,0 +1,213 @@
/*
NSControl.h
The abstract control class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSText.h>
@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

108
Headers/AppKit/NSCursor.h Normal file
View file

@ -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 <scottc@net-community.com>
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 <Foundation/NSCoder.h>
@class NSImage;
@class NSEvent;
@class NSColor;
@interface NSCursor : NSObject <NSCoding>
{
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 */

View file

@ -0,0 +1,52 @@
/*
NSCustomImageRep.h
Custom image representation.
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <AppKit/NSImageRep.h>
@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

124
Headers/AppKit/NSDataLink.h Normal file
View file

@ -0,0 +1,124 @@
/*
NSDataLink.h
Link between a source and dependent document
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSCoder.h>
#include <AppKit/AppKitDefines.h>
@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 <NSCoding>
{
// 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

View file

@ -0,0 +1,144 @@
/*
NSDataLinkManager.h
Manager of a NSDataLink
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSCoder.h>
@class NSString;
@class NSEnumerator;
@class NSMutableDictionary;
@class NSDataLink;
@class NSSelection;
@class NSPasteboard;
@class NSWindow;
@interface NSDataLinkManager : NSObject <NSCoding>
{
// 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

View file

@ -0,0 +1,99 @@
/*
NSDataLinkPanel.h
Standard panel for inspecting data links
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSApplication.h>
#include <AppKit/NSPanel.h>
@class NSDataLink;
@class NSDataLinkManager;
@class NSView;
@interface NSApplication (NSDataLinkPanel)
- (void) orderFrontDataLinkPanel: (id)sender;
@end
@interface NSDataLinkPanel : NSPanel <NSCoding>
{
// 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

218
Headers/AppKit/NSDocument.h Normal file
View file

@ -0,0 +1,218 @@
/*
NSDocument.h
The abstract document class
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Carl Lindberg <Carl.Lindberg@hbo.com>
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 <Foundation/NSObject.h>
#include <AppKit/NSNibDeclarations.h>
#include <AppKit/NSUserInterfaceValidation.h>
/* 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 <NSValidatedUserInterfaceItem>)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

View file

@ -0,0 +1,125 @@
/*
NSDocumentController.h
The document controller class
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Carl Lindberg <Carl.Lindberg@hbo.com>
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 <Foundation/Foundation.h>
#include <AppKit/NSNibDeclarations.h>
#include <AppKit/NSUserInterfaceValidation.h>
@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 <NSValidatedUserInterfaceItem>)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

View file

@ -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 <Carl.Lindberg@hbo.com>
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

121
Headers/AppKit/NSDragging.h Normal file
View file

@ -0,0 +1,121 @@
/*
NSDragging.h
Protocols for drag 'n' drop.
Copyright (C) 1997 Free Software Foundation, Inc.
Author: Simon Frankau <sgf@frankau.demon.co.uk>
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 <Foundation/NSGeometry.h>
@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 <NSDraggingInfo>)sender;
- (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender;
- (void)draggingExited:(id <NSDraggingInfo>)sender;
//
// After the Image is Released
//
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
#ifndef STRICT_OPENSTEP
- (void)draggingEnded: (id <NSDraggingInfo>)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

120
Headers/AppKit/NSDrawer.h Normal file
View file

@ -0,0 +1,120 @@
/* -*-objc-*-
NSDrawer.h
The drawer class
Copyright (C) 2001 Free Software Foundation, Inc.
Author: Fred Kiefer <FredKiefer@gmx.de>
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 <Foundation/NSGeometry.h>
#include <AppKit/NSResponder.h>
@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

View file

@ -0,0 +1,64 @@
/*
NSEPSImageRep.h
EPS image representation.
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <Foundation/NSGeometry.h>
#include <AppKit/NSImageRep.h>
@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

340
Headers/AppKit/NSEvent.h Normal file
View file

@ -0,0 +1,340 @@
/*
NSEvent.h
The event class
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <Foundation/NSCoder.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSDate.h>
@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 <NSCoding, NSCopying>
{
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 */

View file

@ -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 <far@ix.netcom.com>
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 <Foundation/NSDictionary.h>
#include <AppKit/NSImage.h>
@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

216
Headers/AppKit/NSFont.h Normal file
View file

@ -0,0 +1,216 @@
/*
NSFont.h
The font class
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/NSCoder.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSString.h>
#include <AppKit/AppKitDefines.h>
@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 <NSCoding, NSCopying>
{
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

View file

@ -0,0 +1,195 @@
/*
NSFontManager.h
Manages system and user fonts
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Modified: Fred Kiefer <FredKiefer@gmx.de>
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 <Foundation/NSObject.h>
@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

View file

@ -0,0 +1,122 @@
/*
NSFontPanel.h
Standard panel for selecting and previewing fonts.
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSPanel.h>
#include <AppKit/NSFontManager.h>
@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 <NSCoding>
{
// 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

92
Headers/AppKit/NSForm.h Normal file
View file

@ -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 <ovidiu@net-community.com>
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 <AppKit/NSMatrix.h>
@class NSFormCell;
@class NSFont;
@interface NSForm : NSMatrix <NSCoding>
{
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

View file

@ -0,0 +1,74 @@
/*
NSFormCell.h
The cell class for the NSForm control
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/NSActionCell.h>
@interface NSFormCell : NSActionCell <NSCoding>
{
// 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

248
Headers/AppKit/NSGraphics.h Normal file
View file

@ -0,0 +1,248 @@
/*
NSGraphics.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/NSGraphicsContext.h>
#include <AppKit/AppKitDefines.h>
@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__ */

View file

@ -0,0 +1,413 @@
/** <title>NSGraphicsContext</title>
<abstract>Abstract drawing context class.</abstract>
Copyright (C) 1998,1999 Free Software Foundation, Inc.
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: Feb 1999
Based on code by: Adam Fedor <fedor@gnu.org>
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 <Foundation/NSObject.h>
#include <Foundation/NSMapTable.h>
#include <AppKit/AppKitDefines.h>
@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 <GNUstepGUI/GSMethodTable.h>
/*
* 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 */

View file

@ -0,0 +1,79 @@
/*
NSHelpManager.m
Description...
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Pedro Ivo Andrade Tavares <ptavares@iname.com>
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 <Foundation/NSBundle.h>
#include <Foundation/NSMapTable.h>
#include <AppKit/NSApplication.h>
@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

View file

@ -0,0 +1,93 @@
/*
NSHelpPanel.h
Standard panel for showing help information
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
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 <AppKit/NSApplication.h>
#include <AppKit/NSPanel.h>
@class NSString;
@interface NSApplication (NSHelpPanel)
- (void) orderFrontHelpPanel: (id)sender;
@end
@interface NSHelpPanel : NSPanel <NSCoding>
{
// 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

246
Headers/AppKit/NSImage.h Normal file
View file

@ -0,0 +1,246 @@
/*
NSImage.h
Load, manipulate and display images
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <AppKit/NSGraphicsContext.h>
#include <Foundation/NSBundle.h>
#include <AppKit/NSBitmapImageRep.h>
@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 <NSCoding, NSCopying>
{
// 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

View file

@ -0,0 +1,85 @@
/*
NSImageCell.h
The cell class for NSImage
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Jonathan Gapen <jagapen@chem.wisc.edu>
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 <AppKit/NSCell.h>
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

122
Headers/AppKit/NSImageRep.h Normal file
View file

@ -0,0 +1,122 @@
/*
NSImageRep.h
Abstract representation of an image.
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
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 <Foundation/NSGeometry.h>
#include <AppKit/AppKitDefines.h>
@class NSString;
@class NSArray;
@class NSData;
@class NSPasteboard;
enum {
NSImageRepMatchesDevice
};
@interface NSImageRep : NSObject <NSCoding, NSCopying>
{
// 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

View file

@ -0,0 +1,50 @@
/*
NSImageView.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/NSControl.h>
#include <AppKit/NSImageCell.h>
@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 */

View file

@ -0,0 +1,191 @@
/* -*-objc-*-
NSInputManager.h
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
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 <objc/Protocol.h>
#include <objc/objc.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSAttributedString.h>
@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 <NSTextInput>
{
/* 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 */

View file

@ -0,0 +1,78 @@
/* -*-objc-*-
NSInputServer.h
Copyright (C) 2001 Free Software Foundation, Inc.
Author: Fred Kiefer <FredKiefer@gmx.de>
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 <objc/Protocol.h>
#include <Foundation/NSGeometry.h>
#include <Foundation/NSString.h>
@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 <NSInputServerMouseTracker, NSInputServiceProvider>
- (id) initWithDelegate: (id)aDelegate
name: (NSString *)name;
@end
#endif //_GNUstep_H_NSInputServer

View file

@ -0,0 +1,60 @@
/*
NSInterfaceStyle.h
Copyright (C) 1999 Free Software Foundation, Inc.
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
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 <AppKit/AppKitDefines.h>
@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

View file

@ -0,0 +1,186 @@
/*
NSLayoutManager.h
Copyright (C) 2002 Free Software Foundation, Inc.
Author: Alexander Malmberg <alexander@malmberg.org>
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 <GNUstepGUI/GSLayoutManager.h>
#include <AppKit/NSTextView.h>
@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

308
Headers/AppKit/NSMatrix.h Normal file
View file

@ -0,0 +1,308 @@
/*
NSMatrix.h
Copyright (C) 1996,1997,1999 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <AppKit/NSControl.h>
@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 <NSCoding>
{
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 */

654
Headers/AppKit/NSMenu.h Normal file
View file

@ -0,0 +1,654 @@
/*
NSMenu.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/NSMenuItem.h>
#include <AppKit/AppKitDefines.h>
@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; //????
/**
<p>
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.
</p><p>
The method returns when the interaction from the user with the
menu system is over.
</p><p>
The method returns NO when the user releases the mouse button
above a submenu item and YES in all other cases.
</p>
<p>
This return value can be used to determine if submenus should
be removed from the screen or that they are supposed to stay.
</p>
<p>
The implementation should roughly follow the following logic:
</p>
<example>
{
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;
}
</example>
Note that actual implementations tend to be more complicated because
because of all kind of useability issues. Useabilities issues to
look out for are:
<list>
<item> Menus that are only partly on the screen. Those need to be moved while
navigation the menu.</item>
<item> 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.
</item>
<item> 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.
</item>
</list>
*/
- (BOOL)trackWithEvent:(NSEvent *)event;
@end
/**
<p>
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.
</p>
<p>
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, <em>info</em>,
<em>services</em>, <em>print</em>, <em>hide</em> and <em>quit</em>.
</p>
<p>
After the <em>info</em> item normally some submenus follow containing
the application specific actions.
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
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.
</p>
<deflist>
<term>Application menu</term>
<desc>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.
</desc>
<term>Attached menu</term>
<desc>
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 <em>attached</em> menu. It is attached to the
menu that was clicked in.
</desc>
<term>Detached menu</term>
<desc>
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.
</desc>
<term>Transient menu</term>
<desc>
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.
<p>
It is important to note that it is impossible to click in transient menus.
</p>
</desc>
<term>Attached transient menu</term>
<desc>
This is a menu that is attached and transient at the same time.
</desc>
</deflist>
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:
<list>
<item>The user clicks on an item which is not a submenu.<br/>
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.
</item>
<item>The user clicks on a submenu item which is not highlighted already<br/>
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.
<p>
If the submenu is a detached menu, the transient version of the submenu
will be shown
</p>
</item>
<item>The user clicks on a submenu item which is highlighted<br/>
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.
</item>
<item>The user drags over a menu item<br/>
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.
</item>
</list>
<br/>
<strong>Customizing the look of Menus</strong>
<br/>
There are basically three ways of customizing the look of NSMenu
<enum>
<item>Using custom NSMenuItemCell's. This you should do when you want to influence
the look of the items displayed in the menu.</item>
<item>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.
</item>
<item>Reimplement NSMenu. This you should not do. But, if you implement
everything yourself you can achieve anything.
</item>
</enum>
<br/>
<strong>Information for implementing custom NSMenuView class</strong>
<br/>
When implementing a custom NSMenuView class it is important
to keep the following information in mind.
<list>
<item> 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.
</item>
<item> 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.
</item>
</list>
The displayed menus on the screen have the following structure:
<enum>
<item>The ordered graph of displayed menus (note, NOT the set of NSMenus) form a collection of line graphs.</item>
<item>The attached menus are precisely the non root vertices in this graph.</item>
<item>An attached menu of a transient menu is itself a transient menu.</item>
<item>The collection of transient menus form connect subgraph of the menu graph.</item>
</enum>
*/
@interface NSMenu : NSObject <NSCoding, NSCopying>
{
NSString *_title;
NSMutableArray *_items;
NSView<NSMenuView>* _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;
/**
*
*<init/>
*/
- (id) initWithTitle: (NSString*)aTitle;
/* Setting Up the Menu Commands */
- (void) addItem: (id <NSMenuItem>)newItem;
- (id <NSMenuItem>) addItemWithTitle: (NSString *)aString
action: (SEL)aSelector
keyEquivalent: (NSString *)keyEquiv;
- (void) insertItem: (id <NSMenuItem>)newItem
atIndex: (int)index;
- (id <NSMenuItem>) insertItemWithTitle: (NSString *)aString
action: (SEL)aSelector
keyEquivalent: (NSString *)charCode
atIndex: (unsigned int)index;
- (void) itemChanged: (id <NSMenuItem>)anObject;
- (void) removeItem: (id <NSMenuItem>)anItem;
- (void) removeItemAtIndex: (int)index;
/* Finding menu items */
/**
* Returns an array containing all menu items in this menu.
*/
- (NSArray*) itemArray;
- (id <NSMenuItem>) itemAtIndex: (int)index;
- (id <NSMenuItem>) itemWithTag: (int)aTag;
- (id <NSMenuItem>) itemWithTitle: (NSString*)aString;
- (int) numberOfItems;
/* Finding Indices of Menu Items */
- (int) indexOfItem: (id <NSMenuItem>)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 <NSMenuItem>)anItem;
- (void) submenuAction: (id)sender;
/**
Returns the menu that is attached to this menu.
<p>
If two instances of this menu are visible,
return the attached window of the transient version
of this menu.
</p>
<p>
If no menu is attached return nil.
</p>
*/
- (NSMenu*) attachedMenu;
/**
Returns if this menu is attached to its supermenu,
return nil if it does not have a parent menu.
<p>
If two instances of this menu are visible, return
the outcome of the check for the transient version
of the menu.
</p>
*/
- (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.
<p>
The default is NSMenuView, but a user can supply its
own NSView object as long as it
</p>
<list>
<item>Inherits from NSView</item>
<item>Implements NSMenuView protocol</item>
</list>
*/
- (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
/**
* <p>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.
* </p>
* <p>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).
* </p>
*/
- (BOOL) validateMenuItem: (id<NSMenuItem>)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

126
Headers/AppKit/NSMenuItem.h Normal file
View file

@ -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 <khelekir@encomix.es>
Date: Sep 1999
Author: Ovidiu Predescu <ovidiu@net-community.com>
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 <NSCopying, NSCoding, NSObject>
+ (id<NSMenuItem>) 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 <NSMenuItem>
{
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

View file

@ -0,0 +1,100 @@
/*
NSMenuItemCell.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Michael Hanni <mhanni@sprintmail.com>
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 <AppKit/NSActionCell.h>
#include <AppKit/NSButtonCell.h>
#include <AppKit/NSMenuItem.h>
@class NSMenuView;
typedef void (*DrawingIMP)(id, SEL, NSRect, NSView*);
@interface NSMenuItemCell : NSButtonCell <NSCopying, NSCoding>
{
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

Some files were not shown because too many files have changed in this diff Show more